@mindlogic-ai/logician-ui 5.0.0-alpha.2 → 5.0.0-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/components/Avatar/Avatar.d.ts +68 -11
- package/dist/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/components/Avatar/Avatar.js +41 -5
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/Avatar/Avatar.mjs +40 -5
- package/dist/components/Avatar/Avatar.mjs.map +1 -1
- package/dist/components/Avatar/index.d.ts +2 -2
- package/dist/components/Avatar/index.d.ts.map +1 -1
- package/dist/components/Badge/Badge.d.ts.map +1 -1
- package/dist/components/Badge/Badge.js +5 -3
- package/dist/components/Badge/Badge.js.map +1 -1
- package/dist/components/Badge/Badge.mjs +5 -3
- package/dist/components/Badge/Badge.mjs.map +1 -1
- package/dist/components/Badge/Badge.types.d.ts +7 -5
- package/dist/components/Badge/Badge.types.d.ts.map +1 -1
- package/dist/components/Banner/Banner.types.d.ts +24 -1
- package/dist/components/Banner/Banner.types.d.ts.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.styles.d.ts +2 -2
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +31 -3
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/Button.mjs +31 -3
- package/dist/components/Button/Button.mjs.map +1 -1
- package/dist/components/Button/Button.types.d.ts +38 -1
- package/dist/components/Button/Button.types.d.ts.map +1 -1
- package/dist/components/Card/Card.types.d.ts +12 -0
- package/dist/components/Card/Card.types.d.ts.map +1 -1
- package/dist/components/Code/shikiAdapter.d.ts +3 -1
- package/dist/components/Code/shikiAdapter.d.ts.map +1 -1
- package/dist/components/Code/shikiAdapter.js +29 -8
- package/dist/components/Code/shikiAdapter.js.map +1 -1
- package/dist/components/Code/shikiAdapter.mjs +29 -8
- package/dist/components/Code/shikiAdapter.mjs.map +1 -1
- package/dist/components/CodeTabs/CodeTabs.styles.d.ts +6 -5
- package/dist/components/CodeTabs/CodeTabs.styles.d.ts.map +1 -1
- package/dist/components/CodeTabs/CodeTabs.styles.js +6 -5
- package/dist/components/CodeTabs/CodeTabs.styles.js.map +1 -1
- package/dist/components/CodeTabs/CodeTabs.styles.mjs +6 -5
- package/dist/components/CodeTabs/CodeTabs.styles.mjs.map +1 -1
- package/dist/components/ColorMode/ColorModeToggle.d.ts +7 -2
- package/dist/components/ColorMode/ColorModeToggle.d.ts.map +1 -1
- package/dist/components/ColorMode/ColorModeToggle.js +8 -3
- package/dist/components/ColorMode/ColorModeToggle.js.map +1 -1
- package/dist/components/ColorMode/ColorModeToggle.mjs +8 -3
- package/dist/components/ColorMode/ColorModeToggle.mjs.map +1 -1
- package/dist/components/Confetti/Confetti.types.d.ts +5 -1
- package/dist/components/Confetti/Confetti.types.d.ts.map +1 -1
- package/dist/components/Confetti/confettiColors.d.ts +5 -5
- package/dist/components/Confetti/confettiColors.js +5 -5
- package/dist/components/Confetti/confettiColors.mjs +5 -5
- package/dist/components/ErrorFallback/ErrorFallback.types.d.ts +6 -0
- package/dist/components/ErrorFallback/ErrorFallback.types.d.ts.map +1 -1
- package/dist/components/Form/FormModalFooter/FormModalFooter.d.ts +1 -1
- package/dist/components/Form/FormModalFooter/FormModalFooter.d.ts.map +1 -1
- package/dist/components/Form/FormModalFooter/FormModalFooter.js +2 -2
- package/dist/components/Form/FormModalFooter/FormModalFooter.js.map +1 -1
- package/dist/components/Form/FormModalFooter/FormModalFooter.mjs +2 -2
- package/dist/components/Form/FormModalFooter/FormModalFooter.mjs.map +1 -1
- package/dist/components/Form/FormModalFooter/FormModalFooter.types.d.ts +11 -1
- package/dist/components/Form/FormModalFooter/FormModalFooter.types.d.ts.map +1 -1
- package/dist/components/Form/FormSection/CollapsibleFormSection.js +1 -0
- package/dist/components/Form/FormSection/CollapsibleFormSection.js.map +1 -1
- package/dist/components/Form/FormSection/CollapsibleFormSection.mjs +1 -0
- package/dist/components/Form/FormSection/CollapsibleFormSection.mjs.map +1 -1
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/Input.js +4 -0
- package/dist/components/Input/Input.js.map +1 -1
- package/dist/components/Input/Input.mjs +4 -0
- package/dist/components/Input/Input.mjs.map +1 -1
- package/dist/components/LineGraph/LineGraph.d.ts.map +1 -1
- package/dist/components/LineGraph/LineGraph.js +4 -5
- package/dist/components/LineGraph/LineGraph.js.map +1 -1
- package/dist/components/LineGraph/LineGraph.mjs +5 -6
- package/dist/components/LineGraph/LineGraph.mjs.map +1 -1
- package/dist/components/LineGraph/LineGraph.types.d.ts +12 -2
- package/dist/components/LineGraph/LineGraph.types.d.ts.map +1 -1
- package/dist/components/LineGraph/seriesColors.d.ts +12 -8
- package/dist/components/LineGraph/seriesColors.d.ts.map +1 -1
- package/dist/components/LineGraph/seriesColors.js +8 -7
- package/dist/components/LineGraph/seriesColors.js.map +1 -1
- package/dist/components/LineGraph/seriesColors.mjs +8 -7
- package/dist/components/LineGraph/seriesColors.mjs.map +1 -1
- package/dist/components/Masonry/Masonry.types.d.ts +8 -3
- package/dist/components/Masonry/Masonry.types.d.ts.map +1 -1
- package/dist/components/Menu/MenuItem.types.d.ts +8 -0
- package/dist/components/Menu/MenuItem.types.d.ts.map +1 -1
- package/dist/components/Modal/ModalCloseButton.d.ts +1 -1
- package/dist/components/Modal/ModalCloseButton.js +1 -1
- package/dist/components/Modal/ModalCloseButton.mjs +1 -1
- package/dist/components/NavList/NavList.d.ts +35 -0
- package/dist/components/NavList/NavList.d.ts.map +1 -0
- package/dist/components/NavList/NavList.js +113 -0
- package/dist/components/NavList/NavList.js.map +1 -0
- package/dist/components/NavList/NavList.mjs +111 -0
- package/dist/components/NavList/NavList.mjs.map +1 -0
- package/dist/components/NavList/NavList.styles.d.ts +90 -0
- package/dist/components/NavList/NavList.styles.d.ts.map +1 -0
- package/dist/components/NavList/NavList.styles.js +104 -0
- package/dist/components/NavList/NavList.styles.js.map +1 -0
- package/dist/components/NavList/NavList.styles.mjs +97 -0
- package/dist/components/NavList/NavList.styles.mjs.map +1 -0
- package/dist/components/NavList/NavList.translations.json.js +19 -0
- package/dist/components/NavList/NavList.translations.json.js.map +1 -0
- package/dist/components/NavList/NavList.translations.json.mjs +14 -0
- package/dist/components/NavList/NavList.translations.json.mjs.map +1 -0
- package/dist/components/NavList/NavList.types.d.ts +140 -0
- package/dist/components/NavList/NavList.types.d.ts.map +1 -0
- package/dist/components/NavList/NavListContext.d.ts +30 -0
- package/dist/components/NavList/NavListContext.d.ts.map +1 -0
- package/dist/components/NavList/NavListContext.js +16 -0
- package/dist/components/NavList/NavListContext.js.map +1 -0
- package/dist/components/NavList/NavListContext.mjs +13 -0
- package/dist/components/NavList/NavListContext.mjs.map +1 -0
- package/dist/components/NavList/NavListGroup.d.ts +31 -0
- package/dist/components/NavList/NavListGroup.d.ts.map +1 -0
- package/dist/components/NavList/NavListGroup.js +115 -0
- package/dist/components/NavList/NavListGroup.js.map +1 -0
- package/dist/components/NavList/NavListGroup.mjs +113 -0
- package/dist/components/NavList/NavListGroup.mjs.map +1 -0
- package/dist/components/NavList/NavListItem.d.ts +16 -0
- package/dist/components/NavList/NavListItem.d.ts.map +1 -0
- package/dist/components/NavList/NavListItem.js +284 -0
- package/dist/components/NavList/NavListItem.js.map +1 -0
- package/dist/components/NavList/NavListItem.mjs +282 -0
- package/dist/components/NavList/NavListItem.mjs.map +1 -0
- package/dist/components/NavList/NavListSkeleton.d.ts +17 -0
- package/dist/components/NavList/NavListSkeleton.d.ts.map +1 -0
- package/dist/components/NavList/NavListSkeleton.js +33 -0
- package/dist/components/NavList/NavListSkeleton.js.map +1 -0
- package/dist/components/NavList/NavListSkeleton.mjs +31 -0
- package/dist/components/NavList/NavListSkeleton.mjs.map +1 -0
- package/dist/components/NavList/index.d.ts +7 -0
- package/dist/components/NavList/index.d.ts.map +1 -0
- package/dist/components/Pagination/Pagination.d.ts +11 -10
- package/dist/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/components/Pagination/Pagination.js +11 -10
- package/dist/components/Pagination/Pagination.js.map +1 -1
- package/dist/components/Pagination/Pagination.mjs +11 -10
- package/dist/components/Pagination/Pagination.mjs.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.types.d.ts +9 -0
- package/dist/components/ProgressBar/ProgressBar.types.d.ts.map +1 -1
- package/dist/components/RadialProgress/RadialProgress.types.d.ts +21 -1
- package/dist/components/RadialProgress/RadialProgress.types.d.ts.map +1 -1
- package/dist/components/SeeMoreButton/SeeMoreButton.types.d.ts +8 -0
- package/dist/components/SeeMoreButton/SeeMoreButton.types.d.ts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.js +6 -7
- package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.mjs +6 -7
- package/dist/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
- package/dist/components/SegmentedProgressBar/SegmentedProgressBar.types.d.ts +2 -0
- package/dist/components/SegmentedProgressBar/SegmentedProgressBar.types.d.ts.map +1 -1
- package/dist/components/Select/Combobox.d.ts +1 -1
- package/dist/components/Select/Combobox.d.ts.map +1 -1
- package/dist/components/Select/Combobox.js +9 -2
- package/dist/components/Select/Combobox.js.map +1 -1
- package/dist/components/Select/Combobox.mjs +10 -3
- package/dist/components/Select/Combobox.mjs.map +1 -1
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.js +14 -2
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Select/Select.mjs +15 -3
- package/dist/components/Select/Select.mjs.map +1 -1
- package/dist/components/Select/Select.styles.d.ts +97 -1
- package/dist/components/Select/Select.styles.d.ts.map +1 -1
- package/dist/components/Select/Select.styles.js +83 -0
- package/dist/components/Select/Select.styles.js.map +1 -1
- package/dist/components/Select/Select.styles.mjs +82 -1
- package/dist/components/Select/Select.styles.mjs.map +1 -1
- package/dist/components/Tabs/Tab/Tab.styles.d.ts +1 -1
- package/dist/components/Tabs/Tab/Tab.styles.js +1 -1
- package/dist/components/Tabs/Tab/Tab.styles.mjs +1 -1
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.js +4 -0
- package/dist/components/Textarea/Textarea.js.map +1 -1
- package/dist/components/Textarea/Textarea.mjs +4 -0
- package/dist/components/Textarea/Textarea.mjs.map +1 -1
- package/dist/components/Toast/Toast.styles.d.ts +6 -2
- package/dist/components/Toast/Toast.styles.d.ts.map +1 -1
- package/dist/components/Toast/Toast.styles.js +18 -10
- package/dist/components/Toast/Toast.styles.js.map +1 -1
- package/dist/components/Toast/Toast.styles.mjs +18 -10
- package/dist/components/Toast/Toast.styles.mjs.map +1 -1
- package/dist/components/Typography/Caption.d.ts.map +1 -1
- package/dist/components/Typography/Caption.js +1 -1
- package/dist/components/Typography/Caption.js.map +1 -1
- package/dist/components/Typography/Caption.mjs +1 -1
- package/dist/components/Typography/Caption.mjs.map +1 -1
- package/dist/components/Typography/H1.d.ts.map +1 -1
- package/dist/components/Typography/H1.js +1 -1
- package/dist/components/Typography/H1.js.map +1 -1
- package/dist/components/Typography/H1.mjs +1 -1
- package/dist/components/Typography/H1.mjs.map +1 -1
- package/dist/components/Typography/H2.d.ts.map +1 -1
- package/dist/components/Typography/H2.js +1 -1
- package/dist/components/Typography/H2.js.map +1 -1
- package/dist/components/Typography/H2.mjs +1 -1
- package/dist/components/Typography/H2.mjs.map +1 -1
- package/dist/components/Typography/H3.d.ts.map +1 -1
- package/dist/components/Typography/H3.js +1 -1
- package/dist/components/Typography/H3.js.map +1 -1
- package/dist/components/Typography/H3.mjs +1 -1
- package/dist/components/Typography/H3.mjs.map +1 -1
- package/dist/components/Typography/H4.d.ts.map +1 -1
- package/dist/components/Typography/H4.js +1 -1
- package/dist/components/Typography/H4.js.map +1 -1
- package/dist/components/Typography/H4.mjs +1 -1
- package/dist/components/Typography/H4.mjs.map +1 -1
- package/dist/components/Typography/H5.d.ts.map +1 -1
- package/dist/components/Typography/H5.js +1 -1
- package/dist/components/Typography/H5.js.map +1 -1
- package/dist/components/Typography/H5.mjs +1 -1
- package/dist/components/Typography/H5.mjs.map +1 -1
- package/dist/components/Typography/Link.d.ts.map +1 -1
- package/dist/components/Typography/Link.js +1 -1
- package/dist/components/Typography/Link.js.map +1 -1
- package/dist/components/Typography/Link.mjs +1 -1
- package/dist/components/Typography/Link.mjs.map +1 -1
- package/dist/components/Typography/Overline.d.ts.map +1 -1
- package/dist/components/Typography/Overline.js +1 -1
- package/dist/components/Typography/Overline.js.map +1 -1
- package/dist/components/Typography/Overline.mjs +1 -1
- package/dist/components/Typography/Overline.mjs.map +1 -1
- package/dist/components/Typography/Subtext.d.ts.map +1 -1
- package/dist/components/Typography/Subtext.js +1 -1
- package/dist/components/Typography/Subtext.js.map +1 -1
- package/dist/components/Typography/Subtext.mjs +1 -1
- package/dist/components/Typography/Subtext.mjs.map +1 -1
- package/dist/components/Typography/Subtitle.d.ts.map +1 -1
- package/dist/components/Typography/Subtitle.js +1 -1
- package/dist/components/Typography/Subtitle.js.map +1 -1
- package/dist/components/Typography/Subtitle.mjs +1 -1
- package/dist/components/Typography/Subtitle.mjs.map +1 -1
- package/dist/components/Typography/Text.d.ts.map +1 -1
- package/dist/components/Typography/Text.js +1 -1
- package/dist/components/Typography/Text.js.map +1 -1
- package/dist/components/Typography/Text.mjs +1 -1
- package/dist/components/Typography/Text.mjs.map +1 -1
- package/dist/hooks/useLanguage.d.ts +5 -0
- package/dist/hooks/useLanguage.d.ts.map +1 -1
- package/dist/hooks/useLanguage.js +7 -3
- package/dist/hooks/useLanguage.js.map +1 -1
- package/dist/hooks/useLanguage.mjs +7 -4
- package/dist/hooks/useLanguage.mjs.map +1 -1
- package/dist/hooks/useTranslate.d.ts.map +1 -1
- package/dist/hooks/useTranslate.js +8 -5
- package/dist/hooks/useTranslate.js.map +1 -1
- package/dist/hooks/useTranslate.mjs +8 -5
- package/dist/hooks/useTranslate.mjs.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -2
- package/dist/index.mjs.map +1 -1
- package/dist/theme/colors.d.ts +2 -2
- package/dist/theme/colors.d.ts.map +1 -1
- package/dist/theme/colors.js +54 -18
- package/dist/theme/colors.js.map +1 -1
- package/dist/theme/colors.mjs +55 -19
- package/dist/theme/colors.mjs.map +1 -1
- package/dist/theme/global.d.ts.map +1 -1
- package/dist/theme/global.js +19 -1
- package/dist/theme/global.js.map +1 -1
- package/dist/theme/global.mjs +19 -1
- package/dist/theme/global.mjs.map +1 -1
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +2 -0
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/index.mjs +2 -0
- package/dist/theme/index.mjs.map +1 -1
- package/dist/theme/palette.generated.d.ts +232 -123
- package/dist/theme/palette.generated.d.ts.map +1 -1
- package/dist/theme/palette.generated.js +233 -123
- package/dist/theme/palette.generated.js.map +1 -1
- package/dist/theme/palette.generated.mjs +233 -124
- package/dist/theme/palette.generated.mjs.map +1 -1
- package/dist/theme/paletteSwatches.d.ts +20 -0
- package/dist/theme/paletteSwatches.d.ts.map +1 -1
- package/dist/theme/recipes/avatar.d.ts +30 -0
- package/dist/theme/recipes/avatar.d.ts.map +1 -0
- package/dist/theme/recipes/avatar.js +96 -0
- package/dist/theme/recipes/avatar.js.map +1 -0
- package/dist/theme/recipes/avatar.mjs +94 -0
- package/dist/theme/recipes/avatar.mjs.map +1 -0
- package/dist/translations/Defaults.translations.json.js +19 -1
- package/dist/translations/Defaults.translations.json.js.map +1 -1
- package/dist/translations/Defaults.translations.json.mjs +18 -2
- package/dist/translations/Defaults.translations.json.mjs.map +1 -1
- package/dist/utils/disabledControl.d.ts +8 -1
- package/dist/utils/disabledControl.d.ts.map +1 -1
- package/dist/utils/disabledControl.js +8 -1
- package/dist/utils/disabledControl.js.map +1 -1
- package/dist/utils/disabledControl.mjs +8 -1
- package/dist/utils/disabledControl.mjs.map +1 -1
- package/dist/utils/focusRing.d.ts +22 -0
- package/dist/utils/focusRing.d.ts.map +1 -1
- package/dist/utils/focusRing.js +22 -0
- package/dist/utils/focusRing.js.map +1 -1
- package/dist/utils/focusRing.mjs +21 -1
- package/dist/utils/focusRing.mjs.map +1 -1
- package/package.json +2 -1
- package/src/components/Accordion/Accordion.stories.tsx +85 -0
- package/src/components/Accordion/Accordion.usage.mdx +200 -0
- package/src/components/Appear/Appear.usage.mdx +107 -0
- package/src/components/Avatar/Avatar.recipe.test.tsx +176 -0
- package/src/components/Avatar/Avatar.stories.tsx +199 -24
- package/src/components/Avatar/Avatar.tsx +118 -21
- package/src/components/Avatar/Avatar.usage.mdx +185 -0
- package/src/components/Avatar/index.tsx +8 -1
- package/src/components/Badge/Badge.stories.tsx +193 -3
- package/src/components/Badge/Badge.tsx +5 -3
- package/src/components/Badge/Badge.types.ts +7 -5
- package/src/components/Badge/Badge.usage.mdx +265 -0
- package/src/components/Banner/Banner.stories.tsx +152 -2
- package/src/components/Banner/Banner.types.ts +30 -1
- package/src/components/Banner/Banner.usage.mdx +233 -0
- package/src/components/BottomSheet/BottomSheet.stories.tsx +168 -1
- package/src/components/BottomSheet/BottomSheet.test.tsx +2 -1
- package/src/components/BottomSheet/BottomSheet.usage.mdx +216 -0
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +59 -0
- package/src/components/Breadcrumb/Breadcrumb.usage.mdx +181 -0
- package/src/components/Button/Button.focusableWhenDisabled.test.tsx +218 -0
- package/src/components/Button/Button.stories.tsx +332 -3
- package/src/components/Button/Button.tsx +46 -3
- package/src/components/Button/Button.types.ts +38 -1
- package/src/components/Button/Button.usage.mdx +358 -0
- package/src/components/Button/Button.variants.test.tsx +13 -1
- package/src/components/Card/Card.stories.tsx +106 -0
- package/src/components/Card/Card.types.ts +12 -0
- package/src/components/Card/Card.usage.mdx +216 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +140 -13
- package/src/components/Checkbox/Checkbox.usage.mdx +214 -0
- package/src/components/Chip/Chip.usage.mdx +78 -0
- package/src/components/Code/Code.stories.tsx +60 -0
- package/src/components/Code/Code.test.tsx +116 -0
- package/src/components/Code/Code.usage.mdx +187 -0
- package/src/components/Code/shikiAdapter.ts +38 -9
- package/src/components/CodeTabs/CodeTabs.stories.tsx +53 -0
- package/src/components/CodeTabs/CodeTabs.styles.ts +6 -5
- package/src/components/CodeTabs/CodeTabs.usage.mdx +176 -0
- package/src/components/Collapsible/Collapsible.stories.tsx +58 -0
- package/src/components/Collapsible/Collapsible.usage.mdx +173 -0
- package/src/components/ColorMode/ColorMode.stories.tsx +50 -0
- package/src/components/ColorMode/ColorMode.usage.mdx +135 -0
- package/src/components/ColorMode/ColorModeToggle.tsx +10 -3
- package/src/components/Confetti/Confetti.types.ts +5 -1
- package/src/components/Confetti/Confetti.usage.mdx +111 -0
- package/src/components/Confetti/confettiColors.ts +5 -5
- package/src/components/Container/Container.stories.tsx +32 -0
- package/src/components/Container/Container.usage.mdx +130 -0
- package/src/components/CopyableCode/CopyableCode.stories.tsx +62 -0
- package/src/components/CopyableCode/CopyableCode.usage.mdx +168 -0
- package/src/components/CountBadge/CountBadge.stories.tsx +69 -0
- package/src/components/CountBadge/CountBadge.usage.mdx +215 -0
- package/src/components/CountUp/CountUp.usage.mdx +107 -0
- package/src/components/DatePicker/DatePicker.usage.mdx +177 -0
- package/src/components/DatePicker/RangeDatePicker.stories.tsx +87 -3
- package/src/components/ErrorFallback/ErrorFallback.types.ts +6 -0
- package/src/components/ErrorFallback/ErrorFallback.usage.mdx +127 -0
- package/src/components/ExpandableText/ExpandableText.stories.tsx +55 -0
- package/src/components/ExpandableText/ExpandableText.usage.mdx +176 -0
- package/src/components/FileInput/FileInput.stories.tsx +38 -1
- package/src/components/FileInput/FileInput.usage.mdx +178 -0
- package/src/components/FileItem/FileItem.stories.tsx +71 -0
- package/src/components/FileItem/FileItem.usage.mdx +180 -0
- package/src/components/FileList/FileList.stories.tsx +25 -0
- package/src/components/FileList/FileList.usage.mdx +165 -0
- package/src/components/FlyTo/FlyTo.usage.mdx +99 -0
- package/src/components/Form/Form.stories.tsx +149 -0
- package/src/components/Form/Form.usage.mdx +203 -0
- package/src/components/Form/FormModalFooter/FormModalFooter.stories.tsx +1 -1
- package/src/components/Form/FormModalFooter/FormModalFooter.test.tsx +19 -1
- package/src/components/Form/FormModalFooter/FormModalFooter.tsx +2 -0
- package/src/components/Form/FormModalFooter/FormModalFooter.types.ts +11 -1
- package/src/components/FormControl/FormControl.stories.tsx +35 -0
- package/src/components/FormControl/FormControl.usage.mdx +128 -0
- package/src/components/FormIntegration/FormIntegration.usage.mdx +158 -0
- package/src/components/FormLabel/FormLabel.stories.tsx +71 -0
- package/src/components/FormLabel/FormLabel.usage.mdx +125 -0
- package/src/components/Icon/Icon.stories.tsx +61 -1
- package/src/components/Icon/Icon.usage.mdx +158 -0
- package/src/components/IconButton/IconButton.stories.tsx +213 -5
- package/src/components/IconButton/IconButton.usage.mdx +275 -0
- package/src/components/InfoSprinkle/InfoSprinkle.stories.tsx +77 -1
- package/src/components/InfoSprinkle/InfoSprinkle.usage.mdx +189 -0
- package/src/components/InlineCode/InlineCode.stories.tsx +75 -0
- package/src/components/InlineCode/InlineCode.usage.mdx +142 -0
- package/src/components/Input/Input.stories.tsx +180 -0
- package/src/components/Input/Input.tsx +4 -0
- package/src/components/Input/Input.usage.mdx +278 -0
- package/src/components/LineGraph/LineGraph.stories.tsx +112 -0
- package/src/components/LineGraph/LineGraph.tsx +4 -5
- package/src/components/LineGraph/LineGraph.types.ts +12 -2
- package/src/components/LineGraph/LineGraph.usage.mdx +186 -0
- package/src/components/LineGraph/seriesColors.test.ts +10 -9
- package/src/components/LineGraph/seriesColors.ts +18 -16
- package/src/components/Loaders/Loaders.stories.tsx +93 -0
- package/src/components/Loaders/Loaders.usage.mdx +180 -0
- package/src/components/LogicianProvider/LogicianProvider.usage.mdx +98 -0
- package/src/components/Markdown/Markdown.stories.tsx +53 -0
- package/src/components/Markdown/Markdown.usage.mdx +182 -0
- package/src/components/Masonry/Masonry.stories.tsx +63 -1
- package/src/components/Masonry/Masonry.types.ts +8 -3
- package/src/components/Masonry/Masonry.usage.mdx +142 -0
- package/src/components/MaxLengthIndicator/MaxLengthIndicator.stories.tsx +57 -0
- package/src/components/MaxLengthIndicator/MaxLengthIndicator.usage.mdx +125 -0
- package/src/components/Menu/Menu.stories.tsx +146 -2
- package/src/components/Menu/Menu.usage.mdx +238 -0
- package/src/components/Menu/MenuItem.types.ts +8 -0
- package/src/components/Modal/Modal.stories.tsx +177 -1
- package/src/components/Modal/Modal.usage.mdx +262 -0
- package/src/components/Modal/ModalCloseButton.tsx +1 -1
- package/src/components/MonthPicker/MonthPicker.stories.tsx +30 -0
- package/src/components/MonthPicker/MonthPicker.usage.mdx +191 -0
- package/src/components/NavList/NavList.stories.tsx +927 -0
- package/src/components/NavList/NavList.styles.ts +114 -0
- package/src/components/NavList/NavList.test.tsx +1306 -0
- package/src/components/NavList/NavList.translations.json +9 -0
- package/src/components/NavList/NavList.tsx +160 -0
- package/src/components/NavList/NavList.types.ts +155 -0
- package/src/components/NavList/NavList.usage.mdx +545 -0
- package/src/components/NavList/NavListContext.ts +25 -0
- package/src/components/NavList/NavListGroup.tsx +243 -0
- package/src/components/NavList/NavListItem.tsx +543 -0
- package/src/components/NavList/NavListSkeleton.tsx +57 -0
- package/src/components/NavList/index.ts +15 -0
- package/src/components/Pagination/Pagination.stories.tsx +90 -1
- package/src/components/Pagination/Pagination.tsx +11 -10
- package/src/components/Pagination/Pagination.usage.mdx +186 -0
- package/src/components/PasswordInput/PasswordInput.stories.tsx +51 -0
- package/src/components/PasswordInput/PasswordInput.usage.mdx +193 -0
- package/src/components/PinInput/PinInput.stories.tsx +91 -0
- package/src/components/PinInput/PinInput.usage.mdx +194 -0
- package/src/components/Popover/Popover.stories.tsx +104 -1
- package/src/components/Popover/Popover.usage.mdx +197 -0
- package/src/components/ProgressBar/ProgressBar.stories.tsx +92 -1
- package/src/components/ProgressBar/ProgressBar.types.ts +9 -0
- package/src/components/ProgressBar/ProgressBar.usage.mdx +210 -0
- package/src/components/Pulse/Pulse.usage.mdx +102 -0
- package/src/components/RadialProgress/RadialProgress.stories.tsx +74 -1
- package/src/components/RadialProgress/RadialProgress.types.ts +21 -1
- package/src/components/RadialProgress/RadialProgress.usage.mdx +153 -0
- package/src/components/Radio/Radio.stories.tsx +119 -0
- package/src/components/Radio/Radio.usage.mdx +187 -0
- package/src/components/Reveal/Reveal.usage.mdx +105 -0
- package/src/components/ScaledContext/ScaledContext.usage.mdx +111 -0
- package/src/components/SeeMoreButton/SeeMoreButton.stories.tsx +146 -2
- package/src/components/SeeMoreButton/SeeMoreButton.types.ts +8 -0
- package/src/components/SeeMoreButton/SeeMoreButton.usage.mdx +213 -0
- package/src/components/SegmentedControl/SegmentedControl.stories.tsx +69 -0
- package/src/components/SegmentedControl/SegmentedControl.tsx +6 -7
- package/src/components/SegmentedControl/SegmentedControl.usage.mdx +209 -0
- package/src/components/SegmentedProgressBar/SegmentedProgressBar.stories.tsx +54 -0
- package/src/components/SegmentedProgressBar/SegmentedProgressBar.types.ts +2 -0
- package/src/components/SegmentedProgressBar/SegmentedProgressBar.usage.mdx +145 -0
- package/src/components/Select/Combobox.tsx +28 -3
- package/src/components/Select/Select.clearTrigger.test.tsx +76 -0
- package/src/components/Select/Select.stories.tsx +290 -1
- package/src/components/Select/Select.styles.ts +89 -0
- package/src/components/Select/Select.tsx +28 -2
- package/src/components/Select/Select.usage.mdx +341 -0
- package/src/components/Shake/Shake.usage.mdx +107 -0
- package/src/components/Slider/Slider.stories.tsx +116 -0
- package/src/components/Slider/Slider.usage.mdx +179 -0
- package/src/components/Spinner/Spinner.stories.tsx +64 -0
- package/src/components/Spinner/Spinner.usage.mdx +136 -0
- package/src/components/SwapTransition/SwapTransition.usage.mdx +102 -0
- package/src/components/Switch/Switch.stories.tsx +131 -6
- package/src/components/Switch/Switch.usage.mdx +199 -0
- package/src/components/Table/Table.stories.tsx +159 -1
- package/src/components/Table/Table.usage.mdx +235 -0
- package/src/components/Tabs/Tab/Tab.styles.ts +1 -1
- package/src/components/Tabs/Tabs.stories.tsx +86 -0
- package/src/components/Tabs/Tabs.usage.mdx +263 -0
- package/src/components/Tag/Tag.stories.tsx +181 -4
- package/src/components/Tag/Tag.usage.mdx +257 -0
- package/src/components/Textarea/Textarea.stories.tsx +113 -0
- package/src/components/Textarea/Textarea.tsx +4 -0
- package/src/components/Textarea/Textarea.usage.mdx +186 -0
- package/src/components/Toast/Toast.stories.tsx +185 -3
- package/src/components/Toast/Toast.styles.ts +18 -10
- package/src/components/Toast/Toast.usage.mdx +265 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +86 -1
- package/src/components/Tooltip/Tooltip.usage.mdx +219 -0
- package/src/components/Tree/Tree.stories.tsx +89 -0
- package/src/components/Tree/Tree.usage.mdx +207 -0
- package/src/components/Typography/Caption.tsx +0 -1
- package/src/components/Typography/H1.tsx +0 -1
- package/src/components/Typography/H2.tsx +0 -1
- package/src/components/Typography/H3.tsx +0 -1
- package/src/components/Typography/H4.tsx +0 -1
- package/src/components/Typography/H5.tsx +0 -1
- package/src/components/Typography/Link.tsx +0 -1
- package/src/components/Typography/Overline.tsx +0 -1
- package/src/components/Typography/Subtext.tsx +0 -1
- package/src/components/Typography/Subtitle.tsx +0 -1
- package/src/components/Typography/Text.tsx +0 -1
- package/src/components/Typography/Typography.stories.tsx +117 -0
- package/src/components/Typography/Typography.usage.mdx +257 -0
- package/src/components/Workflow/Workflow.usage.mdx +199 -0
- package/src/components/a11y.kwcag.test.tsx +66 -0
- package/src/components/claude.md +1 -1
- package/src/components/noRawScales.test.ts +5 -1
- package/src/foundations/BrandAssets.mdx +637 -0
- package/src/foundations/BrandAssets.stories.tsx +680 -0
- package/src/foundations/BrandColour.mdx +366 -0
- package/src/foundations/BrandColour.stories.tsx +343 -0
- package/src/guidelines/ComponentPageTemplate.mdx +84 -0
- package/src/guidelines/FeedbackActions.mdx +162 -23
- package/src/guidelines/_components/Lang.tsx +175 -0
- package/src/guidelines/_components/TokenTable.tsx +136 -0
- package/src/hooks/useLanguage.ts +8 -3
- package/src/hooks/useTranslate.test.tsx +46 -0
- package/src/hooks/useTranslate.ts +7 -5
- package/src/index.ts +7 -1
- package/src/theme/BazePalette.stories.tsx +111 -1
- package/src/theme/Palette.stories.tsx +2 -2
- package/src/theme/SemanticTokens.mdx +76 -17
- package/src/theme/claude.md +23 -9
- package/src/theme/colors.ts +71 -18
- package/src/theme/contrast.test.ts +57 -0
- package/src/theme/global.ts +20 -1
- package/src/theme/index.ts +2 -0
- package/src/theme/palette.generated.ts +233 -123
- package/src/theme/paletteSwatches.test.ts +1 -1
- package/src/theme/paletteSwatches.ts +35 -0
- package/src/theme/recipes/avatar.ts +92 -0
- package/src/translations/Defaults.translations.json +14 -0
- package/src/utils/disabledControl.ts +8 -1
- package/src/utils/focusRing.ts +23 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { Canvas, Meta } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import { En, Ko, LangToggle, Verdict } from '../../guidelines/_components/Lang';
|
|
4
|
+
import * as CodeTabsStories from './CodeTabs.stories';
|
|
5
|
+
|
|
6
|
+
<Meta of={CodeTabsStories} name="Usage" />
|
|
7
|
+
|
|
8
|
+
<LangToggle />
|
|
9
|
+
|
|
10
|
+
<En>
|
|
11
|
+
|
|
12
|
+
# CodeTabs
|
|
13
|
+
|
|
14
|
+
One example shown in several languages, one tab per language, with an
|
|
15
|
+
optional copy button for the tab that is showing. FactChat uses it for the
|
|
16
|
+
API access snippet in a chatbot's share settings.
|
|
17
|
+
|
|
18
|
+
## When to use
|
|
19
|
+
|
|
20
|
+
- The same call written in two or more languages (cURL, Python,
|
|
21
|
+
JavaScript), where the reader needs only one of them.
|
|
22
|
+
|
|
23
|
+
## When not to use
|
|
24
|
+
|
|
25
|
+
- One snippet → `Code`.
|
|
26
|
+
- Steps the reader needs in order (install, configure, run) → one `Code`
|
|
27
|
+
block per step, in sequence, so none are hidden.
|
|
28
|
+
- Content that is not code → `Tabs`.
|
|
29
|
+
|
|
30
|
+
## Options
|
|
31
|
+
|
|
32
|
+
| Prop | Means |
|
|
33
|
+
| --- | --- |
|
|
34
|
+
| `code` | `{ [language]: source }`. The keys are the tab labels and the highlighting language, in the order given. The first is selected. |
|
|
35
|
+
| `onCopy` | Turns the copy button on. The component writes the selected tab's code to the clipboard, then calls `onCopy(code)`. |
|
|
36
|
+
|
|
37
|
+
The chrome is dark in both colour modes, because the `github-dark` token
|
|
38
|
+
colours need a dark ground.
|
|
39
|
+
|
|
40
|
+
## Do / Don't
|
|
41
|
+
|
|
42
|
+
</En>
|
|
43
|
+
|
|
44
|
+
<Ko>
|
|
45
|
+
|
|
46
|
+
# CodeTabs
|
|
47
|
+
|
|
48
|
+
하나의 예제를 여러 언어로 보여 주는 컴포넌트입니다. 언어마다 탭이 하나씩 있고, 보이는
|
|
49
|
+
탭의 코드를 복사하는 버튼을 켤 수 있습니다. FactChat은 챗봇 공유 설정의 API 접근
|
|
50
|
+
예제에 씁니다.
|
|
51
|
+
|
|
52
|
+
## 언제 쓰나요
|
|
53
|
+
|
|
54
|
+
- 같은 호출을 두 가지 이상의 언어(cURL, Python, JavaScript)로 보여 주고, 읽는 사람은
|
|
55
|
+
그중 하나만 필요할 때.
|
|
56
|
+
|
|
57
|
+
## 언제 쓰지 않나요
|
|
58
|
+
|
|
59
|
+
- 코드가 하나라면 `Code`를 씁니다.
|
|
60
|
+
- 순서대로 모두 필요한 단계(설치, 설정, 실행)라면 단계마다 `Code` 블록을 차례로 두어
|
|
61
|
+
숨기는 것이 없게 합니다.
|
|
62
|
+
- 코드가 아닌 내용은 `Tabs`를 씁니다.
|
|
63
|
+
|
|
64
|
+
## 옵션
|
|
65
|
+
|
|
66
|
+
| 속성 | 뜻 |
|
|
67
|
+
| --- | --- |
|
|
68
|
+
| `code` | `{ [언어]: 코드 }`. 키가 탭 이름이자 강조 언어이고, 넘긴 순서대로 나옵니다. 첫 탭이 선택됩니다. |
|
|
69
|
+
| `onCopy` | 복사 버튼을 켭니다. 선택된 탭의 코드를 컴포넌트가 클립보드에 쓰고 `onCopy(code)`를 부릅니다. |
|
|
70
|
+
|
|
71
|
+
`github-dark` 색은 어두운 바탕을 전제로 하므로, 두 색 모드 모두에서 어두운 바탕을
|
|
72
|
+
씁니다.
|
|
73
|
+
|
|
74
|
+
## 이렇게 하세요 / 이렇게 하지 마세요
|
|
75
|
+
|
|
76
|
+
</Ko>
|
|
77
|
+
|
|
78
|
+
<Canvas of={CodeTabsStories.DoSameCallPerLanguage} />
|
|
79
|
+
<Verdict
|
|
80
|
+
kind="do"
|
|
81
|
+
en="One call, one tab per language. The reader picks theirs and copies it."
|
|
82
|
+
ko="호출 하나에 언어마다 탭 하나. 읽는 사람이 자기 언어를 골라 복사합니다."
|
|
83
|
+
/>
|
|
84
|
+
|
|
85
|
+
<Canvas of={CodeTabsStories.DontStepsAsTabs} />
|
|
86
|
+
<Verdict
|
|
87
|
+
kind="dont"
|
|
88
|
+
en="Put different steps (install, set up the client, the request body) behind language tabs. The reader needs all three, and the tabs hide two of them."
|
|
89
|
+
ko="서로 다른 단계(설치, 클라이언트 설정, 요청 본문)를 언어 탭 뒤에 나누지 마세요. 세 단계가 모두 필요한데 탭은 둘을 숨깁니다."
|
|
90
|
+
/>
|
|
91
|
+
|
|
92
|
+
<En>
|
|
93
|
+
|
|
94
|
+
## Content
|
|
95
|
+
|
|
96
|
+
- Use a language identifier Shiki knows as the key (`python`,
|
|
97
|
+
`javascript`, `bash`); it is shown in uppercase, and any other key fails to
|
|
98
|
+
highlight.
|
|
99
|
+
- Keep the examples equivalent: same call, same values, same placeholders.
|
|
100
|
+
|
|
101
|
+
## Accessibility
|
|
102
|
+
|
|
103
|
+
What CodeTabs does for you:
|
|
104
|
+
|
|
105
|
+
- The tabs are the house `Tabs`, so the tab pattern (`tablist`, `tab`,
|
|
106
|
+
arrow-key movement) comes with them (WCAG 2.1.1, 4.1.2).
|
|
107
|
+
- Hidden panels are `aria-hidden` and invisible, so only the selected
|
|
108
|
+
language is read.
|
|
109
|
+
- Text on the dark chrome is at least 7:1 (`action.fg` 70% on `action.bg`)
|
|
110
|
+
in every mode (WCAG 1.4.3).
|
|
111
|
+
|
|
112
|
+
What you still have to do:
|
|
113
|
+
|
|
114
|
+
- The copy button's name is the fixed English "Copy"; its tooltip is
|
|
115
|
+
translated. Note it if your screen is Korean-only.
|
|
116
|
+
- Say in the text above what the example does (WCAG 1.3.1).
|
|
117
|
+
|
|
118
|
+
## Tokens
|
|
119
|
+
|
|
120
|
+
Read from `CODE_CHROME` in `CodeTabs.styles.ts`. It borrows the `action.*`
|
|
121
|
+
roles because they are the one pair that stays dark in every mode.
|
|
122
|
+
|
|
123
|
+
</En>
|
|
124
|
+
|
|
125
|
+
<Ko>
|
|
126
|
+
|
|
127
|
+
## 문구
|
|
128
|
+
|
|
129
|
+
- 키에는 Shiki가 아는 언어 식별자(`python`, `javascript`, `bash`)를 씁니다. 화면에는
|
|
130
|
+
대문자로 나오며, 다른 키를 쓰면 강조가 실패합니다.
|
|
131
|
+
- 예제끼리 내용을 맞춥니다. 같은 호출, 같은 값, 같은 바꿔 넣을 자리를 씁니다.
|
|
132
|
+
|
|
133
|
+
## 접근성
|
|
134
|
+
|
|
135
|
+
CodeTabs가 알아서 하는 일
|
|
136
|
+
|
|
137
|
+
- 탭은 이 디자인 시스템의 `Tabs`이므로 탭 패턴(`tablist`, `tab`, 화살표 키 이동)을
|
|
138
|
+
그대로 따릅니다(WCAG 2.1.1, 4.1.2).
|
|
139
|
+
- 숨겨진 패널은 `aria-hidden`이고 보이지 않으므로, 선택된 언어만 읽힙니다.
|
|
140
|
+
- 어두운 바탕 위의 글자는 모든 모드에서 7:1 이상입니다(`action.bg` 위의 `action.fg`
|
|
141
|
+
70%, WCAG 1.4.3).
|
|
142
|
+
|
|
143
|
+
직접 챙겨야 하는 일
|
|
144
|
+
|
|
145
|
+
- 복사 버튼 이름은 영어 "Copy"로 고정되어 있고 툴팁만 번역됩니다. 한국어 전용
|
|
146
|
+
화면이라면 이 점을 기록해 둡니다.
|
|
147
|
+
- 예제가 무엇을 하는지 위 본문에서 알립니다(WCAG 1.3.1).
|
|
148
|
+
|
|
149
|
+
## 토큰
|
|
150
|
+
|
|
151
|
+
`CodeTabs.styles.ts`의 `CODE_CHROME`에서 읽습니다. 모든 모드에서 어두운 유일한 역할
|
|
152
|
+
쌍이라 `action.*`을 빌려 씁니다.
|
|
153
|
+
|
|
154
|
+
</Ko>
|
|
155
|
+
|
|
156
|
+
<Canvas of={CodeTabsStories.UsageTokens} sourceState="none" />
|
|
157
|
+
|
|
158
|
+
<En>
|
|
159
|
+
|
|
160
|
+
## Related
|
|
161
|
+
|
|
162
|
+
- **Code**: a single snippet.
|
|
163
|
+
- **Tabs**: tabs for anything that is not code.
|
|
164
|
+
- **CopyableCode**: one line with a copy button.
|
|
165
|
+
|
|
166
|
+
</En>
|
|
167
|
+
|
|
168
|
+
<Ko>
|
|
169
|
+
|
|
170
|
+
## 관련 컴포넌트
|
|
171
|
+
|
|
172
|
+
- **Code**: 코드 하나.
|
|
173
|
+
- **Tabs**: 코드가 아닌 내용의 탭.
|
|
174
|
+
- **CopyableCode**: 복사 버튼이 달린 한 줄.
|
|
175
|
+
|
|
176
|
+
</Ko>
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import { Text } from '@chakra-ui/react';
|
|
3
3
|
|
|
4
|
+
import { T } from '../../guidelines/_components/Lang';
|
|
5
|
+
import { TokenTable } from '../../guidelines/_components/TokenTable';
|
|
6
|
+
import { Code } from '../Code';
|
|
4
7
|
import { Collapsible, CollapsibleContent, CollapsibleRoot, CollapsibleTrigger } from '.';
|
|
5
8
|
|
|
6
9
|
const meta = {
|
|
@@ -65,3 +68,58 @@ export const CompoundAPI: Story = {
|
|
|
65
68
|
</Collapsible.Root>
|
|
66
69
|
),
|
|
67
70
|
};
|
|
71
|
+
|
|
72
|
+
// ───────────────────────── Usage-page specimens ─────────────────────────
|
|
73
|
+
// Pulled into `Collapsible.usage.mdx` with <Canvas of={…} />. Hidden from
|
|
74
|
+
// the sidebar (`!dev`); `tags` is written out on each story because the
|
|
75
|
+
// indexer reads CSF statically.
|
|
76
|
+
|
|
77
|
+
export const DoOptionalDetail: Story = {
|
|
78
|
+
tags: ['!dev'],
|
|
79
|
+
parameters: { layout: 'padded' },
|
|
80
|
+
name: 'Usage / Do: optional detail, closed by default',
|
|
81
|
+
render: (args) => (
|
|
82
|
+
<CollapsibleRoot {...args} maxW="560px">
|
|
83
|
+
<CollapsibleTrigger>원본 데이터 보기</CollapsibleTrigger>
|
|
84
|
+
<CollapsibleContent>
|
|
85
|
+
<Code language="json">{`{ "event": "member.invite", "count": 3 }`}</Code>
|
|
86
|
+
</CollapsibleContent>
|
|
87
|
+
</CollapsibleRoot>
|
|
88
|
+
),
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export const DontVagueTrigger: Story = {
|
|
92
|
+
tags: ['!dev'],
|
|
93
|
+
parameters: { layout: 'padded' },
|
|
94
|
+
name: "Usage / Don't: a trigger that does not say what opens",
|
|
95
|
+
render: (args) => (
|
|
96
|
+
<CollapsibleRoot {...args} maxW="560px">
|
|
97
|
+
<CollapsibleTrigger>더 보기</CollapsibleTrigger>
|
|
98
|
+
<CollapsibleContent>
|
|
99
|
+
<Text>초대 메일은 7일 뒤에 만료됩니다.</Text>
|
|
100
|
+
</CollapsibleContent>
|
|
101
|
+
</CollapsibleRoot>
|
|
102
|
+
),
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export const UsageTokens: Story = {
|
|
106
|
+
tags: ['!dev'],
|
|
107
|
+
parameters: { layout: 'padded' },
|
|
108
|
+
name: 'Usage / Tokens',
|
|
109
|
+
render: () => (
|
|
110
|
+
<TokenTable
|
|
111
|
+
rows={[
|
|
112
|
+
{
|
|
113
|
+
token: 'border.subtle',
|
|
114
|
+
use: (
|
|
115
|
+
<T
|
|
116
|
+
en="Root border, trigger bottom border"
|
|
117
|
+
ko="루트 테두리, 트리거 아래 테두리"
|
|
118
|
+
/>
|
|
119
|
+
),
|
|
120
|
+
},
|
|
121
|
+
{ token: 'bg.subtle', use: <T en="Trigger hover" ko="트리거 호버" /> },
|
|
122
|
+
]}
|
|
123
|
+
/>
|
|
124
|
+
),
|
|
125
|
+
};
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { Canvas, Meta } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import { En, Ko, LangToggle, Verdict } from '../../guidelines/_components/Lang';
|
|
4
|
+
import * as CollapsibleStories from './Collapsible.stories';
|
|
5
|
+
|
|
6
|
+
<Meta of={CollapsibleStories} name="Usage" />
|
|
7
|
+
|
|
8
|
+
<LangToggle />
|
|
9
|
+
|
|
10
|
+
<En>
|
|
11
|
+
|
|
12
|
+
# Collapsible
|
|
13
|
+
|
|
14
|
+
One bordered section with a full-width trigger that shows or hides its
|
|
15
|
+
content. `CollapsibleRoot` › `CollapsibleTrigger` + `CollapsibleContent`, or
|
|
16
|
+
the same parts as `Collapsible.Root` / `.Trigger` / `.Content` /
|
|
17
|
+
`.Indicator`. The height animates on the house presence clock (300 ms in,
|
|
18
|
+
150 ms out), and the animation is dropped under reduced motion.
|
|
19
|
+
|
|
20
|
+
## When to use
|
|
21
|
+
|
|
22
|
+
- Optional detail the reader rarely needs: raw event data, advanced
|
|
23
|
+
settings, a model's internal process.
|
|
24
|
+
- One section. For several sections in a row, use `Accordion`.
|
|
25
|
+
|
|
26
|
+
## When not to use
|
|
27
|
+
|
|
28
|
+
- Several sections in a stack → `Accordion`.
|
|
29
|
+
- Clipping a paragraph to a few lines → `ExpandableText`.
|
|
30
|
+
- Required input or a warning the reader must see → show it on the page.
|
|
31
|
+
- A menu of actions → `Menu`.
|
|
32
|
+
|
|
33
|
+
## Options
|
|
34
|
+
|
|
35
|
+
| Prop | Means |
|
|
36
|
+
| --- | --- |
|
|
37
|
+
| `defaultOpen` / `open` + `onOpenChange` | Closed by default; open at start, or controlled |
|
|
38
|
+
| `CollapsibleTrigger customIcon` | Replace the default indicator |
|
|
39
|
+
| `lazyMount` / `unmountOnExit` | Mount content only when opened |
|
|
40
|
+
|
|
41
|
+
## Do / Don't
|
|
42
|
+
|
|
43
|
+
</En>
|
|
44
|
+
|
|
45
|
+
<Ko>
|
|
46
|
+
|
|
47
|
+
# Collapsible
|
|
48
|
+
|
|
49
|
+
테두리가 있는 섹션 하나와, 그 내용을 보이거나 숨기는 전체 너비 트리거로 이뤄진
|
|
50
|
+
컴포넌트입니다. 구조는 `CollapsibleRoot` › `CollapsibleTrigger` +
|
|
51
|
+
`CollapsibleContent`이고, 같은 파트를 `Collapsible.Root` / `.Trigger` / `.Content` /
|
|
52
|
+
`.Indicator`로도 씁니다. 높이는 공통 등장 시간(열 때 300ms, 닫을 때 150ms)으로
|
|
53
|
+
움직이고, 움직임 줄이기 설정에서는 애니메이션이 빠집니다.
|
|
54
|
+
|
|
55
|
+
## 언제 쓰나요
|
|
56
|
+
|
|
57
|
+
- 읽는 사람이 가끔만 필요한 부가 정보: 이벤트 원본 데이터, 고급 설정, 모델의 내부
|
|
58
|
+
처리 과정.
|
|
59
|
+
- 섹션이 하나일 때. 여러 섹션이 이어진다면 `Accordion`을 씁니다.
|
|
60
|
+
|
|
61
|
+
## 언제 쓰지 않나요
|
|
62
|
+
|
|
63
|
+
- 섹션 여러 개를 쌓는다면 `Accordion`을 씁니다.
|
|
64
|
+
- 문단을 몇 줄만 보여 주려면 `ExpandableText`를 씁니다.
|
|
65
|
+
- 필수 입력이나 꼭 봐야 하는 경고는 페이지에 그대로 보여 줍니다.
|
|
66
|
+
- 동작 목록이라면 `Menu`를 씁니다.
|
|
67
|
+
|
|
68
|
+
## 옵션
|
|
69
|
+
|
|
70
|
+
| 속성 | 뜻 |
|
|
71
|
+
| --- | --- |
|
|
72
|
+
| `defaultOpen` / `open` + `onOpenChange` | 기본은 닫힘. 처음부터 열어 두거나 제어 값으로 씀 |
|
|
73
|
+
| `CollapsibleTrigger`의 `customIcon` | 기본 표시를 바꿈 |
|
|
74
|
+
| `lazyMount` / `unmountOnExit` | 열 때만 내용을 그림 |
|
|
75
|
+
|
|
76
|
+
## 이렇게 하세요 / 이렇게 하지 마세요
|
|
77
|
+
|
|
78
|
+
</Ko>
|
|
79
|
+
|
|
80
|
+
<Canvas of={CollapsibleStories.DoOptionalDetail} />
|
|
81
|
+
<Verdict
|
|
82
|
+
kind="do"
|
|
83
|
+
en="Keep optional detail closed, behind a trigger that names it."
|
|
84
|
+
ko="부가 정보는 닫아 두고, 그 정보의 이름을 적은 트리거 뒤에 둡니다."
|
|
85
|
+
/>
|
|
86
|
+
|
|
87
|
+
<Canvas of={CollapsibleStories.DontVagueTrigger} />
|
|
88
|
+
<Verdict
|
|
89
|
+
kind="dont"
|
|
90
|
+
en="Label the trigger 더 보기. The reader cannot tell whether it is worth opening, and a screen reader announces only 더 보기, collapsed."
|
|
91
|
+
ko="트리거를 '더 보기'라고 쓰지 마세요. 열어 볼 가치가 있는지 알 수 없고, 화면 낭독기는 '더 보기, 접힘'만 읽습니다."
|
|
92
|
+
/>
|
|
93
|
+
|
|
94
|
+
<En>
|
|
95
|
+
|
|
96
|
+
## Content
|
|
97
|
+
|
|
98
|
+
- The trigger names what opens: 원본 데이터 보기, 고급 설정.
|
|
99
|
+
- Do not change the trigger text when it opens; the indicator and
|
|
100
|
+
`aria-expanded` already say it is open.
|
|
101
|
+
|
|
102
|
+
## Accessibility
|
|
103
|
+
|
|
104
|
+
What Collapsible does for you:
|
|
105
|
+
|
|
106
|
+
- The trigger is a `<button>` with `aria-expanded` and `aria-controls`
|
|
107
|
+
pointing at the content (WCAG 4.1.2). Enter and Space toggle it (WCAG
|
|
108
|
+
2.1.1).
|
|
109
|
+
- Under reduced motion the height animation is replaced.
|
|
110
|
+
|
|
111
|
+
What you still have to do:
|
|
112
|
+
|
|
113
|
+
- `CollapsibleTrigger` does not add the shared focus ring; it relies on the
|
|
114
|
+
browser's outline. Check that focus is visible where you use it (WCAG
|
|
115
|
+
2.4.7).
|
|
116
|
+
- Keep the trigger to phrasing content: text, icons, `Badge`
|
|
117
|
+
(`ACCESSIBILITY.md` §5).
|
|
118
|
+
- If the section is part of the page outline, wrap the trigger in a heading
|
|
119
|
+
(WCAG 1.3.1).
|
|
120
|
+
|
|
121
|
+
## Tokens
|
|
122
|
+
|
|
123
|
+
</En>
|
|
124
|
+
|
|
125
|
+
<Ko>
|
|
126
|
+
|
|
127
|
+
## 문구
|
|
128
|
+
|
|
129
|
+
- 트리거에는 무엇이 열리는지 씁니다: 원본 데이터 보기, 고급 설정.
|
|
130
|
+
- 열렸을 때 트리거 문구를 바꾸지 않습니다. 표시 아이콘과 `aria-expanded`가 이미 열린
|
|
131
|
+
상태를 알립니다.
|
|
132
|
+
|
|
133
|
+
## 접근성
|
|
134
|
+
|
|
135
|
+
Collapsible이 알아서 하는 일
|
|
136
|
+
|
|
137
|
+
- 트리거는 `aria-expanded`와 내용을 가리키는 `aria-controls`가 있는 `<button>`입니다
|
|
138
|
+
(WCAG 4.1.2). Enter와 Space로 여닫습니다(WCAG 2.1.1).
|
|
139
|
+
- 움직임 줄이기 설정에서는 높이 애니메이션이 다른 효과로 바뀝니다.
|
|
140
|
+
|
|
141
|
+
직접 챙겨야 하는 일
|
|
142
|
+
|
|
143
|
+
- `CollapsibleTrigger`는 공통 초점 링을 붙이지 않고 브라우저 기본 외곽선에
|
|
144
|
+
기댑니다. 쓰는 곳에서 초점이 보이는지 확인합니다(WCAG 2.4.7).
|
|
145
|
+
- 트리거 안에는 글자, 아이콘, `Badge` 같은 phrasing content만 넣습니다
|
|
146
|
+
(`ACCESSIBILITY.md` 5절).
|
|
147
|
+
- 섹션이 페이지 구조의 일부라면 트리거를 제목 요소로 감쌉니다(WCAG 1.3.1).
|
|
148
|
+
|
|
149
|
+
## 토큰
|
|
150
|
+
|
|
151
|
+
</Ko>
|
|
152
|
+
|
|
153
|
+
<Canvas of={CollapsibleStories.UsageTokens} sourceState="none" />
|
|
154
|
+
|
|
155
|
+
<En>
|
|
156
|
+
|
|
157
|
+
## Related
|
|
158
|
+
|
|
159
|
+
- **Accordion**: several sections in a stack.
|
|
160
|
+
- **ExpandableText**: clip a paragraph to a few lines.
|
|
161
|
+
- **Card**: a section that is always open.
|
|
162
|
+
|
|
163
|
+
</En>
|
|
164
|
+
|
|
165
|
+
<Ko>
|
|
166
|
+
|
|
167
|
+
## 관련 컴포넌트
|
|
168
|
+
|
|
169
|
+
- **Accordion**: 여러 섹션을 쌓을 때.
|
|
170
|
+
- **ExpandableText**: 문단을 몇 줄로 접을 때.
|
|
171
|
+
- **Card**: 늘 열려 있는 섹션.
|
|
172
|
+
|
|
173
|
+
</Ko>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { HStack, Stack } from '@chakra-ui/react';
|
|
2
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
import { InlineCode } from '../InlineCode';
|
|
5
|
+
import { Subtext, Text } from '../Typography';
|
|
6
|
+
import { ColorModeToggle, useColorMode } from '.';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The colour-mode runtime: `ColorModeProvider` (mounted by `LogicianProvider`),
|
|
10
|
+
* the `useColorMode` / `useColorModeValue` hooks, and a ready-made
|
|
11
|
+
* `ColorModeToggle`.
|
|
12
|
+
*
|
|
13
|
+
* In Storybook the toolbar's **Color mode** pins the canvas through
|
|
14
|
+
* `forcedColorMode`, so clicking the toggle here updates the stored
|
|
15
|
+
* preference (shown below) while the canvas keeps following the toolbar —
|
|
16
|
+
* the same thing an app sees during a forced-mode rollout.
|
|
17
|
+
*/
|
|
18
|
+
const meta = {
|
|
19
|
+
title: 'Setup/ColorMode',
|
|
20
|
+
component: ColorModeToggle,
|
|
21
|
+
args: { 'aria-label': '다크 모드 전환' },
|
|
22
|
+
} satisfies Meta<typeof ColorModeToggle>;
|
|
23
|
+
|
|
24
|
+
export default meta;
|
|
25
|
+
|
|
26
|
+
type Story = StoryObj<typeof meta>;
|
|
27
|
+
|
|
28
|
+
const Readout = () => {
|
|
29
|
+
const { colorMode, colorModePreference } = useColorMode();
|
|
30
|
+
return (
|
|
31
|
+
<Stack gap={1}>
|
|
32
|
+
<Text>
|
|
33
|
+
colorMode: <InlineCode>{colorMode}</InlineCode>
|
|
34
|
+
</Text>
|
|
35
|
+
<Subtext mb={0}>
|
|
36
|
+
colorModePreference:{' '}
|
|
37
|
+
<InlineCode>{colorModePreference ?? 'undefined'}</InlineCode>
|
|
38
|
+
</Subtext>
|
|
39
|
+
</Stack>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const Basic: Story = {
|
|
44
|
+
render: (args) => (
|
|
45
|
+
<HStack gap={4} align="center">
|
|
46
|
+
<ColorModeToggle {...args} />
|
|
47
|
+
<Readout />
|
|
48
|
+
</HStack>
|
|
49
|
+
),
|
|
50
|
+
};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { Canvas, Meta } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import { En, Ko, LangToggle } from '../../guidelines/_components/Lang';
|
|
4
|
+
import * as ColorModeStories from './ColorMode.stories';
|
|
5
|
+
|
|
6
|
+
<Meta of={ColorModeStories} name="Usage" />
|
|
7
|
+
|
|
8
|
+
<LangToggle />
|
|
9
|
+
|
|
10
|
+
<En>
|
|
11
|
+
|
|
12
|
+
# ColorMode
|
|
13
|
+
|
|
14
|
+
The light/dark runtime: `ColorModeProvider`, the `useColorMode` and
|
|
15
|
+
`useColorModeValue` hooks, and a ready-made `ColorModeToggle` button.
|
|
16
|
+
|
|
17
|
+
</En>
|
|
18
|
+
|
|
19
|
+
<Ko>
|
|
20
|
+
|
|
21
|
+
# ColorMode
|
|
22
|
+
|
|
23
|
+
라이트·다크 모드를 다루는 부분입니다. `ColorModeProvider`, `useColorMode`와
|
|
24
|
+
`useColorModeValue` 훅, 바로 쓸 수 있는 `ColorModeToggle` 버튼으로 이루어집니다.
|
|
25
|
+
|
|
26
|
+
</Ko>
|
|
27
|
+
|
|
28
|
+
<Canvas of={ColorModeStories.Basic} />
|
|
29
|
+
|
|
30
|
+
<En>
|
|
31
|
+
|
|
32
|
+
In Storybook the toolbar's **Color mode** pins the canvas with
|
|
33
|
+
`forcedColorMode`. Clicking the toggle changes the stored preference shown next
|
|
34
|
+
to it, while the canvas keeps following the toolbar.
|
|
35
|
+
|
|
36
|
+
## When to use
|
|
37
|
+
|
|
38
|
+
- `useColorMode().colorMode` when something cannot be a token and has to know
|
|
39
|
+
the rendered mode: a tenant logo with light and dark files, a diagram
|
|
40
|
+
library's theme, a chart palette.
|
|
41
|
+
- `setColorMode` with `colorModePreference` for a settings picker that offers
|
|
42
|
+
light, dark and system.
|
|
43
|
+
- `ColorModeToggle` for a quick light/dark switch in a header or a toolbar.
|
|
44
|
+
- `ColorModeProvider` on its own only when the app composes providers by hand
|
|
45
|
+
and does not use `LogicianProvider`, which already mounts it.
|
|
46
|
+
|
|
47
|
+
## When not to use
|
|
48
|
+
|
|
49
|
+
- A colour that a semantic token can express → the token (`fg.default`,
|
|
50
|
+
`bg.surface`). Tokens switch with the mode in CSS; `useColorModeValue` is for
|
|
51
|
+
values that cannot be tokens.
|
|
52
|
+
- A preference that must keep "system" → a picker on `setColorMode`, not
|
|
53
|
+
`ColorModeToggle`. The toggle only sets `light` or `dark`.
|
|
54
|
+
|
|
55
|
+
## Accessibility
|
|
56
|
+
|
|
57
|
+
- The toggle's default name is the English "Toggle color mode". In a Korean UI
|
|
58
|
+
pass your own `aria-label` (WCAG 4.1.2). The name does not change with the
|
|
59
|
+
mode, and the button has no pressed state.
|
|
60
|
+
- Its sun and moon icons cross with a short rotation that drops to instant
|
|
61
|
+
under `prefers-reduced-motion: reduce`. The page-wide colour change is always
|
|
62
|
+
instant (`disableTransitionOnChange`).
|
|
63
|
+
- Before hydration the toggle shows the light-mode icon, because the resolved
|
|
64
|
+
mode is only known on the client.
|
|
65
|
+
- Both modes have to pass contrast (WCAG 1.4.3). Check the screen in light and
|
|
66
|
+
dark after any colour change.
|
|
67
|
+
|
|
68
|
+
## Props and API
|
|
69
|
+
|
|
70
|
+
| API | What it gives you |
|
|
71
|
+
| -------------------------------- | ------------------------------------------------------------------------------------------------------------- |
|
|
72
|
+
| `colorMode` | The mode being rendered, `'light'` or `'dark'`. A forced mode wins. |
|
|
73
|
+
| `colorModePreference` | The stored preference, including `'system'`. |
|
|
74
|
+
| `setColorMode(mode)` | Sets the preference: `'light'`, `'dark'` or `'system'`. |
|
|
75
|
+
| `toggleColorMode()` | Switches between light and dark from the user's resolved preference. |
|
|
76
|
+
| `useColorModeValue(light, dark)` | Returns one of two values for the rendered mode. |
|
|
77
|
+
| `ColorModeToggle` | An `IconButton`; takes its props except `children`. |
|
|
78
|
+
| `ColorModeProvider` | `next-themes` with the class strategy on `<html>`, storage key `logician-color-mode`, `system` resolution on. |
|
|
79
|
+
|
|
80
|
+
The host app must add `suppressHydrationWarning` to its `<html>` element, and
|
|
81
|
+
should not write `color-scheme` itself: the provider does.
|
|
82
|
+
|
|
83
|
+
</En>
|
|
84
|
+
|
|
85
|
+
<Ko>
|
|
86
|
+
|
|
87
|
+
Storybook에서는 툴바의 **Color mode**가 `forcedColorMode`로 캔버스를 고정합니다.
|
|
88
|
+
토글을 누르면 옆에 보이는 저장된 선호값은 바뀌지만, 캔버스는 계속 툴바를 따릅니다.
|
|
89
|
+
|
|
90
|
+
## 언제 쓰나요
|
|
91
|
+
|
|
92
|
+
- 토큰으로 표현할 수 없고 지금 그려지는 모드를 알아야 할 때
|
|
93
|
+
`useColorMode().colorMode`를 씁니다. 라이트·다크 파일이 따로 있는 테넌트 로고,
|
|
94
|
+
다이어그램 라이브러리의 테마, 차트 색 목록이 그런 예입니다.
|
|
95
|
+
- 라이트, 다크, 시스템 설정을 고르는 설정 화면에는 `setColorMode`와
|
|
96
|
+
`colorModePreference`를 씁니다.
|
|
97
|
+
- 헤더나 도구 막대에 빠르게 라이트·다크를 바꾸는 버튼이 필요하면 `ColorModeToggle`을
|
|
98
|
+
씁니다.
|
|
99
|
+
- `ColorModeProvider`를 따로 쓰는 경우는 앱이 `LogicianProvider` 없이 프로바이더를
|
|
100
|
+
직접 조합할 때뿐입니다. `LogicianProvider`가 이미 이것을 마운트합니다.
|
|
101
|
+
|
|
102
|
+
## 언제 쓰지 않나요
|
|
103
|
+
|
|
104
|
+
- 시맨틱 토큰(`fg.default`, `bg.surface`)으로 표현할 수 있는 색은 토큰을 씁니다. 토큰은
|
|
105
|
+
CSS에서 모드에 따라 바뀝니다. `useColorModeValue`는 토큰이 될 수 없는 값에만 씁니다.
|
|
106
|
+
- "시스템 설정"을 남겨야 하는 선호 설정에는 `ColorModeToggle` 대신 `setColorMode`로
|
|
107
|
+
고르는 화면을 만듭니다. 토글은 `light`와 `dark`만 정합니다.
|
|
108
|
+
|
|
109
|
+
## 접근성
|
|
110
|
+
|
|
111
|
+
- 토글의 기본 이름은 영어 "Toggle color mode"입니다. 한국어 화면에서는 `aria-label`을
|
|
112
|
+
직접 넘깁니다(WCAG 4.1.2). 이름은 모드에 따라 바뀌지 않고, 눌림 상태도 없습니다.
|
|
113
|
+
- 해와 달 아이콘은 짧게 회전하며 바뀌는데, `prefers-reduced-motion: reduce`에서는 바로
|
|
114
|
+
바뀝니다. 페이지 전체의 색 전환은 늘 즉시 일어납니다(`disableTransitionOnChange`).
|
|
115
|
+
- 하이드레이션 전에는 라이트 모드 아이콘을 보여 줍니다. 실제 모드는 클라이언트에서만 알
|
|
116
|
+
수 있기 때문입니다.
|
|
117
|
+
- 두 모드 모두 명도 대비를 통과해야 합니다(WCAG 1.4.3). 색을 바꿨다면 라이트와 다크에서
|
|
118
|
+
화면을 확인합니다.
|
|
119
|
+
|
|
120
|
+
## 속성과 API
|
|
121
|
+
|
|
122
|
+
| API | 하는 일 |
|
|
123
|
+
| -------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
|
124
|
+
| `colorMode` | 지금 그려지는 모드, `'light'` 또는 `'dark'`. 강제 모드가 있으면 그 값입니다. |
|
|
125
|
+
| `colorModePreference` | 저장된 선호값. `'system'`도 포함합니다. |
|
|
126
|
+
| `setColorMode(mode)` | 선호값을 `'light'`, `'dark'`, `'system'` 중 하나로 정합니다. |
|
|
127
|
+
| `toggleColorMode()` | 사용자 선호를 기준으로 라이트와 다크를 오갑니다. |
|
|
128
|
+
| `useColorModeValue(light, dark)` | 지금 모드에 맞는 값 하나를 돌려줍니다. |
|
|
129
|
+
| `ColorModeToggle` | `IconButton`이며, `children`을 뺀 그 속성을 받습니다. |
|
|
130
|
+
| `ColorModeProvider` | `next-themes` 기반. `<html>`에 클래스를 쓰고, 저장 키는 `logician-color-mode`, 시스템 설정 반영이 켜져 있습니다. |
|
|
131
|
+
|
|
132
|
+
호스트 앱은 `<html>`에 `suppressHydrationWarning`을 붙여야 하고, `color-scheme`은 직접
|
|
133
|
+
쓰지 않습니다. 프로바이더가 씁니다.
|
|
134
|
+
|
|
135
|
+
</Ko>
|
|
@@ -17,8 +17,13 @@ export interface ColorModeToggleProps extends Omit<
|
|
|
17
17
|
* A ready-made light/dark toggle button. Shared across products so each app
|
|
18
18
|
* doesn't reinvent the control.
|
|
19
19
|
*
|
|
20
|
-
*
|
|
21
|
-
* mismatch (the resolved mode is only known after hydration).
|
|
20
|
+
* Shows the light-mode state (moon) until mounted on the client, to avoid an
|
|
21
|
+
* SSR/CSR icon mismatch (the resolved mode is only known after hydration).
|
|
22
|
+
* Toggles between `light` and `dark` only; to offer `system` as well, build a
|
|
23
|
+
* picker on `useColorMode().setColorMode`.
|
|
24
|
+
*
|
|
25
|
+
* The icon wrappers render as `<span>`: only phrasing content may sit inside
|
|
26
|
+
* a `<button>` (see ACCESSIBILITY.md §5).
|
|
22
27
|
*
|
|
23
28
|
* @example
|
|
24
29
|
* ```tsx
|
|
@@ -45,8 +50,9 @@ export const ColorModeToggle: React.FC<ColorModeToggleProps> = ({
|
|
|
45
50
|
page-wide colour flip stays instant on purpose — `ColorModeProvider`
|
|
46
51
|
sets `disableTransitionOnChange` so the whole UI doesn't wash through
|
|
47
52
|
an intermediate state — this animates the control only. */}
|
|
48
|
-
<Box display="grid" placeItems="center">
|
|
53
|
+
<Box as="span" display="grid" placeItems="center">
|
|
49
54
|
<Box
|
|
55
|
+
as="span"
|
|
50
56
|
gridArea="1 / 1"
|
|
51
57
|
display="grid"
|
|
52
58
|
placeItems="center"
|
|
@@ -58,6 +64,7 @@ export const ColorModeToggle: React.FC<ColorModeToggleProps> = ({
|
|
|
58
64
|
<SunIcon />
|
|
59
65
|
</Box>
|
|
60
66
|
<Box
|
|
67
|
+
as="span"
|
|
61
68
|
gridArea="1 / 1"
|
|
62
69
|
display="grid"
|
|
63
70
|
placeItems="center"
|
|
@@ -3,7 +3,11 @@ import type { BoxProps } from '@chakra-ui/react';
|
|
|
3
3
|
export interface ConfettiProps extends BoxProps {
|
|
4
4
|
/** How many pieces. Defaults to 50. */
|
|
5
5
|
pieceCount?: number;
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Colours to pick from: any CSS colour string or colour token. Defaults to ten
|
|
8
|
+
* decorative colours — coral, beige and the eight system hues with no status
|
|
9
|
+
* meaning — as light-mode hex, so they do not follow dark mode.
|
|
10
|
+
*/
|
|
7
11
|
colors?: string[];
|
|
8
12
|
/**
|
|
9
13
|
* Changes the scatter. The generator is seeded rather than `Math.random()` so
|