-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat(ui): toggle component and more #1913
Conversation
🦋 Changeset detectedLatest commit: a4e36a3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Visit the preview URL for this PR (updated for commit a4e36a3): https://penumbra-ui-preview--pr1913-fix-tab-styles-tf62cbwe.web.app (expires Tue, 26 Nov 2024 10:17:07 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 709d729610ef7a6369b23f1cb2b820a60cc685b1 |
export type DensityProps = DensityPropType & { | ||
children?: ReactNode; | ||
} & (SelectedDensity extends 'sparse' | ||
? { sparse: true; compact?: never } | ||
: { compact: true; sparse?: never }); | ||
}; |
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.
question: can't we do this?
export type Density = 'sparse' | 'medium' | 'compact';
export type DensityProps = {
density: Density;
children?: ReactNode;
};
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.
though if we specifically need those names as a field, we could also do this:
export type DensityPropType =
| { sparse: true; medium?: never; compact?: never }
| { medium: true; sparse?: never; compact?: never }
| { compact: true; sparse?: never; medium?: never };
export type DensityProps = DensityPropType & {
children?: ReactNode;
};
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.
Density and Text components initially had this style of props that is more neat: <Density compact/>
, <Text body/>
. I personally don't mind the union type but it is already a bit too late to change – so many components depend on a shorter syntax.
Changed the types to the version from your second comment
Changeset:
ui-deprecated
medium
density – new density type introduced in the DEX Figma, implemented in at least Tabs componentxxs
Text style – new typography type with 11px font-sizeTabs
component – add support formedium
densityCheck here: https://penumbra-ui-preview--pr1913-fix-tab-styles-tf62cbwe.web.app/