-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apply opinionated defaults to LogoSuite #691
Apply opinionated defaults to LogoSuite #691
Conversation
🦋 Changeset detectedLatest commit: bccd348 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🟢 No design token changes found |
|
542720e
to
2dc38b1
Compare
df67e35
to
8a104a7
Compare
8a104a7
to
f9f78e2
Compare
dc2e302
to
d52f1ac
Compare
d52f1ac
to
16e71e1
Compare
91d4884
to
c42c1e1
Compare
packages/design-tokens/src/tokens/functional/components/logosuite/base.json
Outdated
Show resolved
Hide resolved
...snapshots/Visual-Comparison-LogoSuite-LogoSuite-Visible-Heading-With-Description-1-linux.png
Outdated
Show resolved
Hide resolved
73e96bd
to
eb50023
Compare
.changeset/silent-scissors-suffer.md
Outdated
'@primer/react-brand': minor | ||
--- | ||
|
||
⚠️ This update contains a breaking change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the breaking change still valid following recent changes? If it is, could we be more specific about whether it's a visual one vs API? Guessing it's the former, in which case we should give the user a nudge about what to look for.
Example you can reference from another recent change: https://github.com/primer/brand/pull/616/files#diff-bf4a5c10ff09f2964e747a5873b4c1b2124a813202d314f69effbc3de1faf3dfR7-R8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the changeset, let me know what you think 👍
type StoryProps = Required< | ||
Pick<LogoSuiteProps, 'align' | 'hasDivider'> & | ||
Pick<LogoSuiteHeadingProps, 'visuallyHidden'> & | ||
Pick<LogoSuiteLogoBarProps, 'marquee' | 'marqueeSpeed' | 'variant'> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is cool, better than what's currently here so let's go with it 👍
Leaving some additional thoughts for posterity too, so we can come back to use of Omit vs Pick.
I could be reading this wrong, but when adding a new prop to LogoSuite we unfortunately won't get it for 'free' here unless we opt in. I think we're doing this because we want to avoid a conflict in names between named children, but that's potentially an edge case. I'd assume in most cases we'd want to benefit from auto opt-in where possible. We could instead manually opt-out those conflicting props as they are really only solving the need to flatten Storybook arguments and nothing to do with the component itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that's exactly right. I thought this behaviour would be more predictable and intuitive.
You want to add a new control to the story? Just add the type to the top of the file too.
As opposed to
You want to add a new prop to one of the LogoSuite components? It might cause conflicts in the Storybook types, regardless of whether this prop is actually used in Storybook.
It's just a matter of preference, but I prefer the explicit, opt-in approach to the more magic, opt-out approach. Adding a type to cover new functionality feels much more natural to me than having types be automatically added for me and then potentially having to manage conflicts. If we adopt this approach everywhere then conflicts might not be that uncommon as we reuse prop names fairly regularly across components.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @joshfarrant, appreciate you going through all that feedback. LogoSuite is looking really cool 👍
List of notable changes:
default
variant to LogoSuite which:emphasis
styles if there are 5 or fewer logosmuted
styles if there are 6 or more logosWhat should reviewers focus on?
default
variant make sense and is it communicated appropriately in the docs?Supporting resources (related issues, external links, etc):
Contributor checklist:
Reviewer checklist:
Screenshots: