@mindlogic-ai/logician-ui 5.0.0-alpha.2 → 5.0.0-alpha.20
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/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.usage.mdx +187 -0
- 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,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
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { ArgTypes, Canvas, Meta } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import { En, Ko, LangToggle } from '../../guidelines/_components/Lang';
|
|
4
|
+
import * as ConfettiStories from './Confetti.stories';
|
|
5
|
+
|
|
6
|
+
<Meta of={ConfettiStories} name="Usage" />
|
|
7
|
+
|
|
8
|
+
<LangToggle />
|
|
9
|
+
|
|
10
|
+
<En>
|
|
11
|
+
|
|
12
|
+
# Confetti
|
|
13
|
+
|
|
14
|
+
A one-shot celebratory burst over a container, for the rare moment a purchase
|
|
15
|
+
completes or a reward lands.
|
|
16
|
+
|
|
17
|
+
</En>
|
|
18
|
+
|
|
19
|
+
<Ko>
|
|
20
|
+
|
|
21
|
+
# Confetti
|
|
22
|
+
|
|
23
|
+
컨테이너 위로 한 번 터지는 축하 효과입니다. 구매가 끝나거나 보상을 받는 드문 순간에 씁니다.
|
|
24
|
+
|
|
25
|
+
</Ko>
|
|
26
|
+
|
|
27
|
+
<Canvas of={ConfettiStories.Default} />
|
|
28
|
+
|
|
29
|
+
<En>
|
|
30
|
+
|
|
31
|
+
## When to use
|
|
32
|
+
|
|
33
|
+
- A purchase confirmation, a completed course or a level-up: an outcome the
|
|
34
|
+
reader earned and does not see often.
|
|
35
|
+
- At most once per moment. Mount it when the moment begins; pass a new `seed`
|
|
36
|
+
only to scatter a new burst.
|
|
37
|
+
- A small win inside a flow, such as one correct answer, may pair a small burst
|
|
38
|
+
with its `Appear` stamp. Keep that burst smaller (fewer pieces, or scaled
|
|
39
|
+
down) than the ones for a purchase or a level-up, so the rarer moments still
|
|
40
|
+
read bigger.
|
|
41
|
+
|
|
42
|
+
## When not to use
|
|
43
|
+
|
|
44
|
+
- Routine success (saved, sent, copied) → `Toast`, or `Pulse` on the value
|
|
45
|
+
that changed.
|
|
46
|
+
- Anything that went wrong or needs attention → never.
|
|
47
|
+
|
|
48
|
+
## Reduced motion and accessibility
|
|
49
|
+
|
|
50
|
+
- With `prefers-reduced-motion: reduce` the pieces mount but stay invisible.
|
|
51
|
+
The burst carries no information, so nothing is lost.
|
|
52
|
+
- The overlay is `aria-hidden` and ignores the pointer, so it never covers a
|
|
53
|
+
button or reaches a screen reader. The success itself must be stated in text
|
|
54
|
+
on the screen.
|
|
55
|
+
- Every piece finishes in under three seconds, so there is nothing to pause
|
|
56
|
+
(WCAG 2.2.2 covers motion longer than five seconds).
|
|
57
|
+
|
|
58
|
+
## Props
|
|
59
|
+
|
|
60
|
+
Confetti takes no children. It fills the nearest positioned ancestor, so give
|
|
61
|
+
that element `position: relative`, or the burst covers the whole page. The
|
|
62
|
+
default colours are decorative only: coral, beige and the system hues with no
|
|
63
|
+
status meaning. Red, yellow, green and blue are left out of the defaults
|
|
64
|
+
because they mean danger, warning, success and info. Passing them through
|
|
65
|
+
`colors` is fine: a burst lasts under two seconds on a moment that is already
|
|
66
|
+
a success, so no piece can be read as a status. The status-colour rule is for
|
|
67
|
+
things that stay on screen, such as badges, chart lines and text. The defaults
|
|
68
|
+
are light-mode values and do not change in dark mode; pass `colors` (tokens
|
|
69
|
+
work) if that matters.
|
|
70
|
+
|
|
71
|
+
</En>
|
|
72
|
+
|
|
73
|
+
<Ko>
|
|
74
|
+
|
|
75
|
+
## 언제 쓰나요
|
|
76
|
+
|
|
77
|
+
- 구매 확인, 과정 완료, 레벨 업처럼 사용자가 직접 얻어 냈고 자주 보지 않는 결과.
|
|
78
|
+
- 한 순간에 한 번만 씁니다. 그 순간이 시작될 때 마운트하고, 새로 터뜨릴 때만 `seed`를
|
|
79
|
+
바꿉니다.
|
|
80
|
+
- 정답 하나처럼 흐름 속의 작은 성공에는 `Appear` 표시와 함께 작은 폭죽을 터뜨려도
|
|
81
|
+
됩니다. 구매나 레벨 업 때보다 작게(조각을 줄이거나 크기를 줄여) 터뜨려야 드문 순간이
|
|
82
|
+
더 크게 느껴집니다.
|
|
83
|
+
|
|
84
|
+
## 언제 쓰지 않나요
|
|
85
|
+
|
|
86
|
+
- 저장, 전송, 복사처럼 흔한 성공에는 `Toast`를 쓰거나, 바뀐 값에 `Pulse`를 씁니다.
|
|
87
|
+
- 잘못됐거나 확인이 필요한 일에는 절대 쓰지 않습니다.
|
|
88
|
+
|
|
89
|
+
## 동작 줄이기와 접근성
|
|
90
|
+
|
|
91
|
+
- `prefers-reduced-motion: reduce`에서는 조각이 마운트되지만 보이지 않습니다. 이
|
|
92
|
+
효과에는 정보가 없으니 잃는 것도 없습니다.
|
|
93
|
+
- 겹쳐진 층에는 `aria-hidden`이 붙고 포인터를 받지 않으므로, 버튼을 가리거나 화면
|
|
94
|
+
낭독기에 읽히지 않습니다. 성공했다는 사실은 화면의 문구로 따로 알려야 합니다.
|
|
95
|
+
- 모든 조각이 3초 안에 끝나므로 멈춤 기능이 필요 없습니다(WCAG 2.2.2는 5초 넘게
|
|
96
|
+
움직이는 콘텐츠에 해당합니다).
|
|
97
|
+
|
|
98
|
+
## 속성
|
|
99
|
+
|
|
100
|
+
Confetti는 자식을 받지 않습니다. 가장 가까운 위치 지정 조상을 채우므로, 그 요소에
|
|
101
|
+
`position: relative`를 줍니다. 그러지 않으면 페이지 전체를 덮습니다. 기본 색은 장식용으로,
|
|
102
|
+
코랄, 베이지, 그리고 상태 뜻이 없는 시스템 색만 씁니다. 빨강, 노랑, 초록, 파랑은 각각
|
|
103
|
+
위험, 경고, 성공, 정보를 뜻하므로 기본값에서 뺐습니다. 그래도 `colors`로 넘기는 것은
|
|
104
|
+
괜찮습니다. 폭죽은 이미 성공한 순간에 2초도 안 돼 사라지므로, 어떤 조각도 상태 표시로
|
|
105
|
+
읽히지 않습니다. 상태 색 규칙은 배지, 차트 선, 글자처럼 화면에 남는 요소에 적용합니다.
|
|
106
|
+
기본 색은 라이트 모드 값이라 다크 모드에서 바뀌지 않습니다. 필요하면 `colors`를
|
|
107
|
+
넘깁니다(토큰도 됩니다).
|
|
108
|
+
|
|
109
|
+
</Ko>
|
|
110
|
+
|
|
111
|
+
<ArgTypes of={ConfettiStories} include={['pieceCount', 'colors', 'seed']} />
|
|
@@ -2,11 +2,11 @@ import type { SystemHue } from '../../theme/colors';
|
|
|
2
2
|
import { CORAL, RAMPS, SYSTEM_HUES } from '../../theme/palette.generated';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Hues
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
5
|
+
* Hues left out of the *default* pieces: red, yellow and green are the
|
|
6
|
+
* danger, warning and success solids, and blue is info and links. This is a
|
|
7
|
+
* default, not a ban — a caller may pass them through `colors`, since a burst
|
|
8
|
+
* lasting under two seconds on a success moment cannot be read as a status
|
|
9
|
+
* (Confetti.usage.mdx).
|
|
10
10
|
*/
|
|
11
11
|
export const CONFETTI_EXCLUDED_HUES = [
|
|
12
12
|
'red',
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
|
|
3
|
+
import { Card } from '../Card';
|
|
4
|
+
import { H1, Text } from '../Typography';
|
|
3
5
|
import { Container } from './Container';
|
|
4
6
|
|
|
5
7
|
const meta = {
|
|
@@ -18,3 +20,33 @@ export default meta;
|
|
|
18
20
|
type Story = StoryObj<typeof meta>;
|
|
19
21
|
|
|
20
22
|
export const Basic: Story = {};
|
|
23
|
+
|
|
24
|
+
// ───────────────────────── Usage-page specimens ─────────────────────────
|
|
25
|
+
// Pulled into `Container.usage.mdx` with <Canvas of={…} />. Hidden from the
|
|
26
|
+
// sidebar (`!dev`); `tags` is written out on each story because the indexer
|
|
27
|
+
// reads CSF statically.
|
|
28
|
+
|
|
29
|
+
export const DoPageLandmark: Story = {
|
|
30
|
+
tags: ['!dev'],
|
|
31
|
+
name: 'Usage / Do: the page column, as the main landmark',
|
|
32
|
+
args: { bg: undefined, p: 6, textAlign: 'start' },
|
|
33
|
+
render: (args) => (
|
|
34
|
+
<Container {...args} as="main">
|
|
35
|
+
<H1 mb={2}>사용량</H1>
|
|
36
|
+
<Text>이번 달 1일부터 오늘까지의 합계입니다.</Text>
|
|
37
|
+
</Container>
|
|
38
|
+
),
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const DontInsideACard: Story = {
|
|
42
|
+
tags: ['!dev'],
|
|
43
|
+
name: "Usage / Don't: a Container inside a narrow box",
|
|
44
|
+
args: { bg: 'primary.washActive', p: 4, textAlign: 'start' },
|
|
45
|
+
render: (args) => (
|
|
46
|
+
<Card p={4} maxW="320px" overflow="auto">
|
|
47
|
+
<Container {...args}>
|
|
48
|
+
폭이 창 크기로 정해져 카드 밖으로 넘칩니다.
|
|
49
|
+
</Container>
|
|
50
|
+
</Card>
|
|
51
|
+
),
|
|
52
|
+
};
|