-
Notifications
You must be signed in to change notification settings - Fork 40
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
fix(react): add missing data-size & data-color props to Details #2930
Conversation
🦋 Changeset detectedLatest commit: 8f54ec9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 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 |
Preview deployments for this pull request: Storybook - |
Coverage Report
File Coverage
|
DefaultProps & HTMLAttributes<HTMLDetailsElement>, | ||
{ | ||
/** | ||
* Specify which color palette to use. | ||
*/ | ||
'data-color'?: DefaultProps['data-color']; |
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.
DefaultProps
comes with data-color
, do we need to specify it again?
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.
Something with MergeRight
or how react-docgen parses types not working as intended?
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.
The only reason I'm repeating it, is to make the documentation make sense. The DefaultProps['data-color']
doc comment says (emphasis mine):
Sets a color palette which may be used by descendants. Does not affect this component. If left unspecified, the color is inherited from the nearest ancestor with data-color.
When I implemented the new color system I landed on this as the best default documentation, since it would be confusing for components that don't change color based on this prop to have "Specify which color palette to use". But if you have any ideas or suggestions on how to do this more clearly, I'm all ears 😊
However, looking at Details' implementation, both the type and doc comment should actually be different. It should be something like this:
/**
* Specify which color palette to use.
* If left unspecified, the color is inherited from the nearest ancestor with data-color.
*/
'data-color'?: 'subtle' | Color;
90d2d3e
to
8f54ec9
Compare
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to next, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `next` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `next`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## @digdir/[email protected] ### Minor Changes - Fix wrong base default color beeing set by the themebuilder ([#2953](#2953)) - Moved typography based sizing formula to design-tokens ([#2796](#2796)) - Removed design-tokens `sizing` & `spacing`, use `size`. ([#2939](#2939)) - Support for building typography based sizing design-tokens ([#2796](#2796)) ### Patch Changes - Rename `data-ds-typography` to `data-typography` ([#2959](#2959)) ## @digdir/[email protected] ### Minor Changes - Removed CSS variables `--ds-spacing-*` & `--ds-sizing-*`, use `--ds-size-*`. ([#2939](#2939)) - New CSS variables for sizes, `--ds-size-*` ([#2935](#2935)) - Moved typography based sizing formula to design-tokens ([#2796](#2796)) ### Patch Changes - Button: add `height: fit-content` ([#2942](#2942)) - Pagination: Use empty `li` for ellipsis ([#2942](#2942)) - Link: Fix missing underline when using Tailwind ([#2923](#2923)) - Table: ([#2933](#2933)) - Correct footer styling - Automatic focus styling for sorting buttons - Switch: Adjust design to better align with radio and checkbox ([#2929](#2929)) - Tooltip: Use popover API ([#2916](#2916)) - Removes `delay`, this is now `--dsc-tooltip-transition-delay` - Removes `defaultOpen` - Removes `portal` - Removes ability to hover to keep open - PopoverTrigger: New prop `inline` for use when inline elements (such as text) need a `Popover` ([#2915](#2915)) ## @digdir/[email protected] ### Minor Changes - Removed CSS variables `--ds-spacing-*` & `--ds-sizing-*`, use `--ds-size-*`. ([#2939](#2939)) - Moved typography based sizing formula to design-tokens ([#2796](#2796)) - Removed design-tokens `sizing` & `spacing`, use `size`. ([#2939](#2939)) ### Patch Changes - Rename `data-ds-typography` to `data-typography` ([#2959](#2959)) ## @digdir/[email protected] ### Patch Changes - Pagination: Use empty `li` for ellipsis ([#2942](#2942)) - Add missing `data-size` and `data-color` props to Details ([#2930](#2930)) - Table: ([#2933](#2933)) - Correct footer styling - Automatic focus styling for sorting buttons - Loosen default types for `data-color` and `data-size` to support accept `string` ([#2951](#2951)) - Export all utilities ([#2961](#2961)) - Field: Fix `position` not working ([#2931](#2931)) - Tooltip: Use popover API ([#2916](#2916)) - Removes `delay`, this is now `--dsc-tooltip-transition-delay` - Removes `defaultOpen` - Removes `portal` - Removes ability to hover to keep open - PopoverTrigger: New prop `inline` for use when inline elements (such as text) need a `Popover` ([#2915](#2915)) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
No description provided.