@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,186 @@
|
|
|
1
|
+
import { ArgTypes, Canvas, Meta } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import { En, Ko, LangToggle, Verdict } from '../../guidelines/_components/Lang';
|
|
4
|
+
import * as TextareaStories from './Textarea.stories';
|
|
5
|
+
|
|
6
|
+
<Meta of={TextareaStories} name="Usage" />
|
|
7
|
+
|
|
8
|
+
<LangToggle />
|
|
9
|
+
|
|
10
|
+
<En>
|
|
11
|
+
|
|
12
|
+
# Textarea
|
|
13
|
+
|
|
14
|
+
A multi-line text field for prose the user writes: instructions, descriptions,
|
|
15
|
+
messages.
|
|
16
|
+
|
|
17
|
+
## When to use
|
|
18
|
+
|
|
19
|
+
- Text that can run to several sentences or lines: a chatbot's system
|
|
20
|
+
instructions, a description, a reason for a request.
|
|
21
|
+
|
|
22
|
+
## When not to use
|
|
23
|
+
|
|
24
|
+
- A one-line value such as a name or a title → `Input`.
|
|
25
|
+
- The chat composer, which grows with the message and sends on Enter → the
|
|
26
|
+
chat input in your app, not this field.
|
|
27
|
+
- Formatted text (headings, lists, links) → a rich-text editor.
|
|
28
|
+
|
|
29
|
+
## Props
|
|
30
|
+
|
|
31
|
+
</En>
|
|
32
|
+
|
|
33
|
+
<Ko>
|
|
34
|
+
|
|
35
|
+
# Textarea
|
|
36
|
+
|
|
37
|
+
사용자가 직접 쓰는 여러 줄짜리 글(지시문, 설명, 메시지)을 받는 입력란입니다.
|
|
38
|
+
|
|
39
|
+
## 언제 쓰나요
|
|
40
|
+
|
|
41
|
+
- 몇 문장이나 몇 줄로 길어질 수 있는 글: 챗봇의 시스템 지시문, 설명, 요청 사유.
|
|
42
|
+
|
|
43
|
+
## 언제 쓰지 않나요
|
|
44
|
+
|
|
45
|
+
- 이름이나 제목처럼 한 줄이면 되는 값은 `Input`을 씁니다.
|
|
46
|
+
- 내용에 따라 높이가 늘고 Enter로 보내는 채팅 입력창은 이 컴포넌트가 아니라 앱의 채팅
|
|
47
|
+
입력 컴포넌트를 씁니다.
|
|
48
|
+
- 제목, 목록, 링크 같은 서식이 필요한 글은 리치 텍스트 편집기를 씁니다.
|
|
49
|
+
|
|
50
|
+
## 속성
|
|
51
|
+
|
|
52
|
+
</Ko>
|
|
53
|
+
|
|
54
|
+
<ArgTypes of={TextareaStories} include={['invalid']} />
|
|
55
|
+
|
|
56
|
+
<En>
|
|
57
|
+
|
|
58
|
+
- `rows` sets the height. Textarea is fixed at `resize="none"` and does not
|
|
59
|
+
grow with its content; pass `resize="vertical"` if the user should be able to
|
|
60
|
+
drag it taller.
|
|
61
|
+
- `invalid` changes the border only. Put the field in `FieldRow` with `error`
|
|
62
|
+
so assistive technology hears it too.
|
|
63
|
+
- `readOnly` and `disabled` look the same as on `Input`.
|
|
64
|
+
|
|
65
|
+
## Do / Don't
|
|
66
|
+
|
|
67
|
+
</En>
|
|
68
|
+
|
|
69
|
+
<Ko>
|
|
70
|
+
|
|
71
|
+
- 높이는 `rows`로 정합니다. Textarea는 `resize="none"`으로 고정되어 있고 내용에 따라
|
|
72
|
+
늘어나지 않습니다. 사용자가 끌어서 늘릴 수 있어야 한다면 `resize="vertical"`을
|
|
73
|
+
넘깁니다.
|
|
74
|
+
- `invalid`는 테두리만 바꿉니다. 보조기술에도 알리려면 `FieldRow`에 넣고 `error`를
|
|
75
|
+
줍니다.
|
|
76
|
+
- `readOnly`와 `disabled`는 `Input`과 같은 모양입니다.
|
|
77
|
+
|
|
78
|
+
## 이렇게 하세요 / 이렇게 하지 마세요
|
|
79
|
+
|
|
80
|
+
</Ko>
|
|
81
|
+
|
|
82
|
+
<Canvas of={TextareaStories.DoInstructionsWithCount} />
|
|
83
|
+
<Verdict
|
|
84
|
+
kind="do"
|
|
85
|
+
en="Give long text a label, a line of help, and a visible count when there is a limit."
|
|
86
|
+
ko="긴 글을 받는 입력란에는 라벨과 한 줄 도움말을 두고, 글자 수 제한이 있으면 남은 양을 보여 줍니다."
|
|
87
|
+
/>
|
|
88
|
+
|
|
89
|
+
<Canvas of={TextareaStories.DontSingleValue} />
|
|
90
|
+
<Verdict
|
|
91
|
+
kind="dont"
|
|
92
|
+
en="Use a Textarea for a one-line value. The height promises a paragraph that never comes."
|
|
93
|
+
ko="한 줄이면 되는 값에 Textarea를 쓰지 마세요. 높이만 보고 긴 글을 써야 하는 줄 압니다."
|
|
94
|
+
/>
|
|
95
|
+
|
|
96
|
+
<Canvas of={TextareaStories.DoSingleValueInInput} />
|
|
97
|
+
<Verdict
|
|
98
|
+
kind="do"
|
|
99
|
+
en="Use Input for a name or a title."
|
|
100
|
+
ko="이름이나 제목에는 Input을 씁니다."
|
|
101
|
+
/>
|
|
102
|
+
|
|
103
|
+
<En>
|
|
104
|
+
|
|
105
|
+
## Content
|
|
106
|
+
|
|
107
|
+
- Label and error rules are the same as `Input`.
|
|
108
|
+
- Size the field to the expected answer: `rows={3}` for a short reason, more
|
|
109
|
+
for instructions. Height is a hint about how much to write.
|
|
110
|
+
- Put examples in helper text, not in a long placeholder that vanishes on the
|
|
111
|
+
first keystroke.
|
|
112
|
+
|
|
113
|
+
## Accessibility
|
|
114
|
+
|
|
115
|
+
What Textarea does for you:
|
|
116
|
+
|
|
117
|
+
- Renders a native `<textarea>`. Enter inserts a new line; Tab moves focus out.
|
|
118
|
+
- Shows a `primary.main` focus border and ring (WCAG 2.4.7), and inside
|
|
119
|
+
`FormControl` / `FieldRow` it is labelled and gets `aria-invalid` and
|
|
120
|
+
`aria-describedby` from the field.
|
|
121
|
+
|
|
122
|
+
What you still have to do:
|
|
123
|
+
|
|
124
|
+
- Give it a visible label with `FieldRow` or `FormControl` + `FormLabel`
|
|
125
|
+
(WCAG 4.1.2; KWCAG 5.3.4.1 레이블 제공).
|
|
126
|
+
- Put errors in words with `FieldRow` `error`, not as a red border alone
|
|
127
|
+
(WCAG 1.4.1, 3.3.1).
|
|
128
|
+
- If you set `maxLength`, show the count; the browser stops input silently at
|
|
129
|
+
the limit.
|
|
130
|
+
|
|
131
|
+
## Tokens
|
|
132
|
+
|
|
133
|
+
</En>
|
|
134
|
+
|
|
135
|
+
<Ko>
|
|
136
|
+
|
|
137
|
+
## 문구
|
|
138
|
+
|
|
139
|
+
- 라벨과 오류 문구 규칙은 `Input`과 같습니다.
|
|
140
|
+
- 예상되는 답의 길이에 맞춰 높이를 정합니다. 짧은 사유는 `rows={3}`, 지시문은 그보다
|
|
141
|
+
길게 잡습니다. 높이는 얼마나 써야 하는지 알려 주는 단서입니다.
|
|
142
|
+
- 예시는 첫 글자를 입력하면 사라지는 긴 플레이스홀더가 아니라 도움말에 씁니다.
|
|
143
|
+
|
|
144
|
+
## 접근성
|
|
145
|
+
|
|
146
|
+
Textarea가 알아서 하는 일
|
|
147
|
+
|
|
148
|
+
- 네이티브 `<textarea>`를 그립니다. Enter는 줄을 바꾸고, Tab은 초점을 다음 요소로
|
|
149
|
+
옮깁니다.
|
|
150
|
+
- 초점을 받으면 `primary.main` 테두리와 링을 보여 주고(WCAG 2.4.7), `FormControl`이나
|
|
151
|
+
`FieldRow` 안에서는 라벨과 연결되며 `aria-invalid`와 `aria-describedby`를 받습니다.
|
|
152
|
+
|
|
153
|
+
직접 챙겨야 하는 일
|
|
154
|
+
|
|
155
|
+
- `FieldRow`나 `FormControl`과 `FormLabel`로 보이는 라벨을 붙입니다(WCAG 4.1.2, KWCAG
|
|
156
|
+
5.3.4.1 레이블 제공).
|
|
157
|
+
- 오류는 빨간 테두리만이 아니라 `FieldRow`의 `error`로 문구를 함께 보여 줍니다(WCAG
|
|
158
|
+
1.4.1, 3.3.1).
|
|
159
|
+
- `maxLength`를 정했다면 글자 수를 보여 줍니다. 브라우저는 제한에 닿으면 아무 안내 없이
|
|
160
|
+
입력을 막습니다.
|
|
161
|
+
|
|
162
|
+
## 토큰
|
|
163
|
+
|
|
164
|
+
</Ko>
|
|
165
|
+
|
|
166
|
+
<Canvas of={TextareaStories.UsageTokens} sourceState="none" />
|
|
167
|
+
|
|
168
|
+
<En>
|
|
169
|
+
|
|
170
|
+
## Related
|
|
171
|
+
|
|
172
|
+
- **Input**: one line of text.
|
|
173
|
+
- **FieldRow**: label, helper text, error and the count slot.
|
|
174
|
+
- **MaxLengthIndicator**: the character count.
|
|
175
|
+
|
|
176
|
+
</En>
|
|
177
|
+
|
|
178
|
+
<Ko>
|
|
179
|
+
|
|
180
|
+
## 관련 컴포넌트
|
|
181
|
+
|
|
182
|
+
- **Input**: 한 줄짜리 텍스트.
|
|
183
|
+
- **FieldRow**: 라벨, 도움말, 오류 문구, 글자 수 자리.
|
|
184
|
+
- **MaxLengthIndicator**: 글자 수 표시.
|
|
185
|
+
|
|
186
|
+
</Ko>
|
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { ReactNode, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Box,
|
|
4
|
+
Toaster as ChakraToaster,
|
|
5
|
+
createToaster,
|
|
6
|
+
Flex,
|
|
7
|
+
Stack,
|
|
8
|
+
Text,
|
|
9
|
+
} from '@chakra-ui/react';
|
|
3
10
|
import { Meta, StoryObj } from '@storybook/react';
|
|
4
11
|
|
|
12
|
+
import { T } from '../../guidelines/_components/Lang';
|
|
13
|
+
import { TokenTable } from '../../guidelines/_components/TokenTable';
|
|
5
14
|
import { Button } from '../Button';
|
|
6
15
|
import { Toast } from './Toast';
|
|
7
|
-
import
|
|
16
|
+
import { toastStyles } from './Toast.styles';
|
|
17
|
+
import type { ToastAction, ToastStatus, UseToastOptions } from './Toast.types';
|
|
8
18
|
import { Toaster } from './Toaster';
|
|
9
19
|
import { useToast } from './useToast';
|
|
10
20
|
|
|
@@ -14,6 +24,14 @@ const meta = {
|
|
|
14
24
|
parameters: {
|
|
15
25
|
layout: 'centered',
|
|
16
26
|
},
|
|
27
|
+
argTypes: {
|
|
28
|
+
status: {
|
|
29
|
+
control: 'select',
|
|
30
|
+
options: ['neutral', 'info', 'success', 'warning', 'error'],
|
|
31
|
+
description:
|
|
32
|
+
'`neutral` (default): a plain result with no status, no icon. `success`: done as asked. `info`: a fact about what just happened; nothing is wrong. `warning`: done, but not quite as expected. `error`: it did not happen.',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
17
35
|
} satisfies Meta<typeof Toast>;
|
|
18
36
|
|
|
19
37
|
export default meta;
|
|
@@ -602,3 +620,167 @@ export const ActionShortMessage: Story = {
|
|
|
602
620
|
/>
|
|
603
621
|
),
|
|
604
622
|
};
|
|
623
|
+
|
|
624
|
+
// ───────────────────────── Usage-page specimens ─────────────────────────
|
|
625
|
+
// Pulled into `Toast.usage.mdx` with <Canvas of={…} />. Hidden from the
|
|
626
|
+
// sidebar (`!dev`); `tags` is written on each story because the indexer reads
|
|
627
|
+
// CSF statically.
|
|
628
|
+
//
|
|
629
|
+
// Each specimen renders the real `Toast` through its own toaster, held open
|
|
630
|
+
// (`duration: Infinity`) inside a transformed box. The transform makes the
|
|
631
|
+
// toaster's `position: fixed` region relative to the box, so the toast sits in
|
|
632
|
+
// the docs page instead of at the top of the window, and the specimens do not
|
|
633
|
+
// share the app-wide `toaster`.
|
|
634
|
+
|
|
635
|
+
const ToastPreview = ({
|
|
636
|
+
status = 'neutral',
|
|
637
|
+
title,
|
|
638
|
+
description,
|
|
639
|
+
action,
|
|
640
|
+
height = 150,
|
|
641
|
+
}: {
|
|
642
|
+
status?: ToastStatus;
|
|
643
|
+
title?: ReactNode;
|
|
644
|
+
description?: ReactNode;
|
|
645
|
+
action?: ToastAction;
|
|
646
|
+
height?: number;
|
|
647
|
+
}) => {
|
|
648
|
+
// Created with its toast in the initialiser, not in an effect: a toast
|
|
649
|
+
// dismissed by a StrictMode effect cleanup did not come back.
|
|
650
|
+
const [local] = useState(() => {
|
|
651
|
+
const toaster = createToaster({ placement: 'top' });
|
|
652
|
+
toaster.create({
|
|
653
|
+
type: status === 'neutral' ? 'info' : status,
|
|
654
|
+
title,
|
|
655
|
+
description,
|
|
656
|
+
duration: Infinity,
|
|
657
|
+
meta: { status, action },
|
|
658
|
+
});
|
|
659
|
+
return toaster;
|
|
660
|
+
});
|
|
661
|
+
return (
|
|
662
|
+
<Box
|
|
663
|
+
position="relative"
|
|
664
|
+
transform="translateZ(0)"
|
|
665
|
+
h={`${height}px`}
|
|
666
|
+
w="100%"
|
|
667
|
+
minW={{ md: '420px' }}
|
|
668
|
+
overflow="hidden"
|
|
669
|
+
>
|
|
670
|
+
<ChakraToaster toaster={local} insetInline={{ mdDown: '4' }} gap={3}>
|
|
671
|
+
{(toast) => {
|
|
672
|
+
const s = (toast.meta?.status ?? 'neutral') as ToastStatus;
|
|
673
|
+
return (
|
|
674
|
+
<Toast
|
|
675
|
+
title={toast.title}
|
|
676
|
+
description={toast.description}
|
|
677
|
+
status={s}
|
|
678
|
+
action={toast.meta?.action}
|
|
679
|
+
onClose={() => {}}
|
|
680
|
+
{...toastStyles[s]}
|
|
681
|
+
/>
|
|
682
|
+
);
|
|
683
|
+
}}
|
|
684
|
+
</ChakraToaster>
|
|
685
|
+
</Box>
|
|
686
|
+
);
|
|
687
|
+
};
|
|
688
|
+
|
|
689
|
+
const noop = () => {};
|
|
690
|
+
|
|
691
|
+
export const DoActionProp: Story = {
|
|
692
|
+
tags: ['!dev'],
|
|
693
|
+
parameters: { layout: 'padded' },
|
|
694
|
+
name: 'Usage / Do: one action through `action`',
|
|
695
|
+
render: () => (
|
|
696
|
+
<ToastPreview
|
|
697
|
+
status="error"
|
|
698
|
+
description="크레딧이 부족해 응답을 생성하지 못했습니다."
|
|
699
|
+
action={{ label: '크레딧 구매', onClick: noop }}
|
|
700
|
+
/>
|
|
701
|
+
),
|
|
702
|
+
};
|
|
703
|
+
|
|
704
|
+
export const DontButtonInDescription: Story = {
|
|
705
|
+
tags: ['!dev'],
|
|
706
|
+
parameters: { layout: 'padded' },
|
|
707
|
+
name: "Usage / Don't: a Button inside `description`",
|
|
708
|
+
render: () => (
|
|
709
|
+
<ToastPreview
|
|
710
|
+
status="error"
|
|
711
|
+
height={170}
|
|
712
|
+
description={
|
|
713
|
+
<Stack gap={2} align="flex-start">
|
|
714
|
+
<span>크레딧이 부족해 응답을 생성하지 못했습니다.</span>
|
|
715
|
+
<Button variant="secondary" size="sm">
|
|
716
|
+
크레딧 구매
|
|
717
|
+
</Button>
|
|
718
|
+
</Stack>
|
|
719
|
+
}
|
|
720
|
+
/>
|
|
721
|
+
),
|
|
722
|
+
};
|
|
723
|
+
|
|
724
|
+
export const DoUndoAfterDelete: Story = {
|
|
725
|
+
tags: ['!dev'],
|
|
726
|
+
parameters: { layout: 'padded' },
|
|
727
|
+
name: 'Usage / Do: confirm, and offer undo',
|
|
728
|
+
render: () => (
|
|
729
|
+
<ToastPreview
|
|
730
|
+
status="success"
|
|
731
|
+
description="채팅을 삭제했습니다."
|
|
732
|
+
action={{ label: '되돌리기', onClick: noop }}
|
|
733
|
+
/>
|
|
734
|
+
),
|
|
735
|
+
};
|
|
736
|
+
|
|
737
|
+
export const DontToastForFieldError: Story = {
|
|
738
|
+
tags: ['!dev'],
|
|
739
|
+
parameters: { layout: 'padded' },
|
|
740
|
+
name: "Usage / Don't: a toast for a field error",
|
|
741
|
+
render: () => (
|
|
742
|
+
<ToastPreview
|
|
743
|
+
status="error"
|
|
744
|
+
description="이메일 형식이 올바르지 않습니다."
|
|
745
|
+
/>
|
|
746
|
+
),
|
|
747
|
+
};
|
|
748
|
+
|
|
749
|
+
export const DoNeutralResult: Story = {
|
|
750
|
+
tags: ['!dev'],
|
|
751
|
+
parameters: { layout: 'padded' },
|
|
752
|
+
name: 'Usage / Do: neutral for a plain result',
|
|
753
|
+
render: () => <ToastPreview description="링크를 복사했습니다." />,
|
|
754
|
+
};
|
|
755
|
+
|
|
756
|
+
const STATUSES: ToastStatus[] = ['neutral', 'info', 'success', 'warning', 'error'];
|
|
757
|
+
|
|
758
|
+
/** Tokens each status reads, from `Toast.styles.ts` and the theme. */
|
|
759
|
+
export const UsageTokens: Story = {
|
|
760
|
+
tags: ['!dev'],
|
|
761
|
+
parameters: { layout: 'padded' },
|
|
762
|
+
name: 'Usage / Tokens',
|
|
763
|
+
render: () => (
|
|
764
|
+
<TokenTable
|
|
765
|
+
rows={STATUSES.flatMap((status) => [
|
|
766
|
+
{
|
|
767
|
+
token: toastStyles[status].bg as string,
|
|
768
|
+
use: <T en={`${status} · background`} ko={`${status} · 배경`} />,
|
|
769
|
+
},
|
|
770
|
+
{
|
|
771
|
+
token: toastStyles[status].borderColor as string,
|
|
772
|
+
use: <T en={`${status} · border`} ko={`${status} · 테두리`} />,
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
token: toastStyles[status].color as string,
|
|
776
|
+
use: (
|
|
777
|
+
<T
|
|
778
|
+
en={`${status} · text, icon, action, ×`}
|
|
779
|
+
ko={`${status} · 글자, 아이콘, 동작, ×`}
|
|
780
|
+
/>
|
|
781
|
+
),
|
|
782
|
+
},
|
|
783
|
+
])}
|
|
784
|
+
/>
|
|
785
|
+
),
|
|
786
|
+
};
|
|
@@ -7,8 +7,12 @@ import type { ToastStatus } from './Toast.types';
|
|
|
7
7
|
*
|
|
8
8
|
* Each status is bg `{s}.bg` + text `{s}.fg` + a 1px `{s}.border` outline —
|
|
9
9
|
* `info` reads its own `info.*` family instead of borrowing `primary.*`.
|
|
10
|
-
* `neutral` carries no status (it is the default when none is given)
|
|
11
|
-
* `
|
|
10
|
+
* `neutral` carries no status (it is the default when none is given) and is
|
|
11
|
+
* inverted: the tooltip pair `tooltip.bg` / `tooltip.fg`. A `bg.surface` toast
|
|
12
|
+
* was white on a white canvas in light mode, set apart only by a 1px border
|
|
13
|
+
* and the shadow — a "링크를 복사했어요" confirmation was easy to miss. The
|
|
14
|
+
* tooltip pair already flips per mode (ink in light, off-white in dark), so the
|
|
15
|
+
* toast stays the highest-contrast thing on the page in both.
|
|
12
16
|
*/
|
|
13
17
|
export const toastStyles: Record<ToastStatus, BoxProps> = {
|
|
14
18
|
info: {
|
|
@@ -32,9 +36,9 @@ export const toastStyles: Record<ToastStatus, BoxProps> = {
|
|
|
32
36
|
borderColor: 'danger.border',
|
|
33
37
|
},
|
|
34
38
|
neutral: {
|
|
35
|
-
bg: 'bg
|
|
36
|
-
color: 'fg
|
|
37
|
-
borderColor: '
|
|
39
|
+
bg: 'tooltip.bg',
|
|
40
|
+
color: 'tooltip.fg',
|
|
41
|
+
borderColor: 'tooltip.bg',
|
|
38
42
|
},
|
|
39
43
|
};
|
|
40
44
|
|
|
@@ -69,9 +73,11 @@ export const closeButtonStyles: Record<ToastStatus, BoxProps> = {
|
|
|
69
73
|
},
|
|
70
74
|
},
|
|
71
75
|
neutral: {
|
|
72
|
-
color: 'fg
|
|
76
|
+
color: 'tooltip.fg',
|
|
73
77
|
_hover: {
|
|
74
|
-
|
|
78
|
+
// A tint of the toast's own text colour: no surface token sits on the
|
|
79
|
+
// inverted ground in both modes.
|
|
80
|
+
bg: 'color-mix(in srgb, var(--chakra-colors-tooltip-fg) 16%, transparent)',
|
|
75
81
|
},
|
|
76
82
|
},
|
|
77
83
|
};
|
|
@@ -127,9 +133,11 @@ export const actionStyles: Record<ToastStatus, BoxProps> = {
|
|
|
127
133
|
},
|
|
128
134
|
neutral: {
|
|
129
135
|
...actionBase,
|
|
130
|
-
color: 'fg
|
|
131
|
-
_hover: {
|
|
132
|
-
|
|
136
|
+
color: 'tooltip.fg',
|
|
137
|
+
_hover: {
|
|
138
|
+
bg: 'color-mix(in srgb, var(--chakra-colors-tooltip-fg) 16%, transparent)',
|
|
139
|
+
},
|
|
140
|
+
_focusVisible: { outline: '2px solid', outlineColor: 'tooltip.fg' },
|
|
133
141
|
},
|
|
134
142
|
};
|
|
135
143
|
|