@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
|
@@ -3,8 +3,16 @@ import { Meta, StoryObj } from '@storybook/react';
|
|
|
3
3
|
|
|
4
4
|
import { SYSTEM_HUE_NAMES } from '@/theme/colors';
|
|
5
5
|
|
|
6
|
+
import { TokenTable } from '../../guidelines/_components/TokenTable';
|
|
7
|
+
import { Subtext } from '../Typography';
|
|
8
|
+
import { SparklesIcon } from '../Icon';
|
|
6
9
|
import { Avatar } from '.';
|
|
7
10
|
|
|
11
|
+
const REACT_LOGO =
|
|
12
|
+
'https://cdn.jsdelivr.net/gh/devicons/devicon/icons/react/react-original.svg';
|
|
13
|
+
const GITHUB_LOGO =
|
|
14
|
+
'https://cdn.jsdelivr.net/gh/devicons/devicon/icons/github/github-original.svg';
|
|
15
|
+
|
|
8
16
|
const meta = {
|
|
9
17
|
title: 'Components/Avatar',
|
|
10
18
|
component: Avatar,
|
|
@@ -143,34 +151,14 @@ export const WithImage: Story = {
|
|
|
143
151
|
/>
|
|
144
152
|
</HStack>
|
|
145
153
|
</Box>
|
|
146
|
-
{/*
|
|
154
|
+
{/* Logos: variant="logo" */}
|
|
147
155
|
<Box>
|
|
148
156
|
<Text fontSize="lg" fontWeight="bold" mb={4} color="fg.default">
|
|
149
|
-
|
|
157
|
+
Logos (variant="logo")
|
|
150
158
|
</Text>
|
|
151
159
|
<HStack gap={4}>
|
|
152
|
-
<
|
|
153
|
-
|
|
154
|
-
name="GitHub"
|
|
155
|
-
src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/github/github-original.svg"
|
|
156
|
-
size="lg"
|
|
157
|
-
bg="white"
|
|
158
|
-
/>
|
|
159
|
-
<Text fontSize="xs" color="fg.muted">
|
|
160
|
-
bg="white"
|
|
161
|
-
</Text>
|
|
162
|
-
</VStack>
|
|
163
|
-
<VStack gap={2}>
|
|
164
|
-
<Avatar
|
|
165
|
-
name="React"
|
|
166
|
-
src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/react/react-original.svg"
|
|
167
|
-
size="lg"
|
|
168
|
-
bg="category.blue.surface"
|
|
169
|
-
/>
|
|
170
|
-
<Text fontSize="xs" color="fg.muted">
|
|
171
|
-
bg="category.blue.surface"
|
|
172
|
-
</Text>
|
|
173
|
-
</VStack>
|
|
160
|
+
<Avatar name="GitHub" src={GITHUB_LOGO} size="lg" variant="logo" />
|
|
161
|
+
<Avatar name="React" src={REACT_LOGO} size="lg" variant="logo" />
|
|
174
162
|
</HStack>
|
|
175
163
|
</Box>
|
|
176
164
|
</VStack>
|
|
@@ -424,3 +412,190 @@ export const ExplicitHue: Story = {
|
|
|
424
412
|
</Flex>
|
|
425
413
|
),
|
|
426
414
|
};
|
|
415
|
+
|
|
416
|
+
const SIZES = ['2xs', 'xs', 'sm', 'md', 'lg', 'xl', '2xl'] as const;
|
|
417
|
+
const PEOPLE = ['박상현', 'Sean Park', '김지민', 'Jaeho Shin', '이서준'];
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* The regression this recipe fixes: the hue must fill the whole circle at
|
|
421
|
+
* every size, with the initial centred — not a small pill around the glyph.
|
|
422
|
+
*/
|
|
423
|
+
export const InitialsEverySize: Story = {
|
|
424
|
+
render: () => (
|
|
425
|
+
<VStack gap={3} align="start">
|
|
426
|
+
{PEOPLE.map((name) => (
|
|
427
|
+
<HStack key={name} gap={4}>
|
|
428
|
+
<Box w="96px">
|
|
429
|
+
<Text fontSize="sm" color="fg.muted">
|
|
430
|
+
{name}
|
|
431
|
+
</Text>
|
|
432
|
+
</Box>
|
|
433
|
+
{SIZES.map((size) => (
|
|
434
|
+
<Avatar key={size} name={name} size={size} />
|
|
435
|
+
))}
|
|
436
|
+
</HStack>
|
|
437
|
+
))}
|
|
438
|
+
<HStack gap={4}>
|
|
439
|
+
<Box w="96px">
|
|
440
|
+
<Text fontSize="sm" color="fg.muted">
|
|
441
|
+
(no name)
|
|
442
|
+
</Text>
|
|
443
|
+
</Box>
|
|
444
|
+
{SIZES.map((size) => (
|
|
445
|
+
<Avatar key={size} size={size} />
|
|
446
|
+
))}
|
|
447
|
+
</HStack>
|
|
448
|
+
</VStack>
|
|
449
|
+
),
|
|
450
|
+
};
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* No name, no photo: the neutral pair (`category.neutral` →
|
|
454
|
+
* `bg.muted` / `secondary.fgStrong`) and Chakra's person icon — never red.
|
|
455
|
+
* `Avatar.Root` + `Avatar.Fallback` used bare get the same.
|
|
456
|
+
*/
|
|
457
|
+
export const NoName: Story = {
|
|
458
|
+
render: () => (
|
|
459
|
+
<HStack gap={4}>
|
|
460
|
+
<Avatar size="lg" />
|
|
461
|
+
<Avatar.Root size="lg">
|
|
462
|
+
<Avatar.Fallback />
|
|
463
|
+
</Avatar.Root>
|
|
464
|
+
<Avatar.Root size="lg">
|
|
465
|
+
<Avatar.Fallback name="Bare Root" />
|
|
466
|
+
</Avatar.Root>
|
|
467
|
+
</HStack>
|
|
468
|
+
),
|
|
469
|
+
};
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* `variant="logo"`: the `bg.logo` tile, light in both modes, for model,
|
|
473
|
+
* chatbot and brand marks drawn for a light ground. With no image the
|
|
474
|
+
* fallback (an icon or initials) is centred on the tile.
|
|
475
|
+
*/
|
|
476
|
+
export const Logo: Story = {
|
|
477
|
+
render: () => (
|
|
478
|
+
<VStack gap={4} align="start">
|
|
479
|
+
<HStack gap={4}>
|
|
480
|
+
{SIZES.map((size) => (
|
|
481
|
+
<Avatar
|
|
482
|
+
key={size}
|
|
483
|
+
size={size}
|
|
484
|
+
variant="logo"
|
|
485
|
+
name="React"
|
|
486
|
+
src={REACT_LOGO}
|
|
487
|
+
/>
|
|
488
|
+
))}
|
|
489
|
+
</HStack>
|
|
490
|
+
<HStack gap={4}>
|
|
491
|
+
{SIZES.map((size) => (
|
|
492
|
+
<Avatar.Root key={size} size={size} variant="logo">
|
|
493
|
+
<Avatar.Fallback>
|
|
494
|
+
<SparklesIcon boxSize="50%" aria-hidden />
|
|
495
|
+
</Avatar.Fallback>
|
|
496
|
+
</Avatar.Root>
|
|
497
|
+
))}
|
|
498
|
+
</HStack>
|
|
499
|
+
<HStack gap={4}>
|
|
500
|
+
{SIZES.map((size) => (
|
|
501
|
+
<Avatar key={size} size={size} variant="logo" name="Chat Bot" />
|
|
502
|
+
))}
|
|
503
|
+
</HStack>
|
|
504
|
+
</VStack>
|
|
505
|
+
),
|
|
506
|
+
};
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* `Avatar.Group` `max`: the avatars past `max` collapse into a "+N" counter in
|
|
510
|
+
* the neutral pair, whatever the group's variant.
|
|
511
|
+
*/
|
|
512
|
+
export const GroupMax: Story = {
|
|
513
|
+
render: () => {
|
|
514
|
+
const names = ['김지민', '이서준', '박하은', '최유나', '정민호', '한도윤'];
|
|
515
|
+
return (
|
|
516
|
+
<VStack gap={6} align="start">
|
|
517
|
+
{(['sm', 'md', 'lg'] as const).map((size) => (
|
|
518
|
+
<Avatar.Group key={size} size={size} max={3}>
|
|
519
|
+
{names.map((name) => (
|
|
520
|
+
<Avatar key={name} name={name} />
|
|
521
|
+
))}
|
|
522
|
+
</Avatar.Group>
|
|
523
|
+
))}
|
|
524
|
+
<Avatar.Group size="md" max={2} variant="logo">
|
|
525
|
+
<Avatar name="React" src={REACT_LOGO} />
|
|
526
|
+
<Avatar name="GitHub" src={GITHUB_LOGO} />
|
|
527
|
+
<Avatar name="Chat Bot" />
|
|
528
|
+
<Avatar name="Other" />
|
|
529
|
+
</Avatar.Group>
|
|
530
|
+
</VStack>
|
|
531
|
+
);
|
|
532
|
+
},
|
|
533
|
+
};
|
|
534
|
+
|
|
535
|
+
// ───────────────────────── Usage-page specimens ─────────────────────────
|
|
536
|
+
// Pulled into `Avatar.usage.mdx` with <Canvas of={…} />. Hidden from the
|
|
537
|
+
// sidebar (`!dev`); `tags` is written out on each story because the indexer
|
|
538
|
+
// reads CSF statically.
|
|
539
|
+
|
|
540
|
+
const MEMBERS = ['김지민', '이서준', '박하은'];
|
|
541
|
+
|
|
542
|
+
export const DoNameNextToIt: Story = {
|
|
543
|
+
tags: ['!dev'],
|
|
544
|
+
parameters: { layout: 'padded' },
|
|
545
|
+
name: 'Usage / Do: the name next to the avatar',
|
|
546
|
+
render: () => (
|
|
547
|
+
<VStack align="start" gap={3}>
|
|
548
|
+
{MEMBERS.map((name) => (
|
|
549
|
+
<HStack key={name} gap={3}>
|
|
550
|
+
<Avatar size="sm" name={name} aria-hidden />
|
|
551
|
+
<Box>
|
|
552
|
+
<Text fontWeight="medium">{name}</Text>
|
|
553
|
+
<Subtext color="fg.muted">멤버</Subtext>
|
|
554
|
+
</Box>
|
|
555
|
+
</HStack>
|
|
556
|
+
))}
|
|
557
|
+
</VStack>
|
|
558
|
+
),
|
|
559
|
+
};
|
|
560
|
+
|
|
561
|
+
export const DontHueAsStatus: Story = {
|
|
562
|
+
tags: ['!dev'],
|
|
563
|
+
parameters: { layout: 'padded' },
|
|
564
|
+
name: "Usage / Don't: a hue to mean a status",
|
|
565
|
+
render: () => (
|
|
566
|
+
<HStack gap={3}>
|
|
567
|
+
<Avatar size="sm" name="김지민" colorHue="green" />
|
|
568
|
+
<Avatar size="sm" name="이서준" colorHue="red" />
|
|
569
|
+
<Avatar size="sm" name="박하은" colorHue="yellow" />
|
|
570
|
+
</HStack>
|
|
571
|
+
),
|
|
572
|
+
};
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* Fallback colours per hue — the `category.{hue}` palette the avatar recipe
|
|
576
|
+
* paints the root with. The first row is the `category.neutral` pair used with
|
|
577
|
+
* no name; the last rows are the `logo` variant's tile.
|
|
578
|
+
*/
|
|
579
|
+
export const UsageTokens: Story = {
|
|
580
|
+
tags: ['!dev'],
|
|
581
|
+
parameters: { layout: 'padded' },
|
|
582
|
+
name: 'Usage / Tokens',
|
|
583
|
+
render: () => (
|
|
584
|
+
<TokenTable
|
|
585
|
+
rows={[
|
|
586
|
+
{ token: 'category.neutral.surface', use: 'no name · background' },
|
|
587
|
+
{ token: 'category.neutral.fg', use: 'no name · initials' },
|
|
588
|
+
...SYSTEM_HUE_NAMES.flatMap((hue) => [
|
|
589
|
+
{ token: `category.${hue}.surface`, use: `${hue} · background` },
|
|
590
|
+
{ token: `category.${hue}.fg`, use: `${hue} · initials` },
|
|
591
|
+
]),
|
|
592
|
+
{ token: 'border.subtle', use: 'border' },
|
|
593
|
+
{
|
|
594
|
+
token: 'bg.logo',
|
|
595
|
+
use: 'variant="logo" · tile (light in both modes)',
|
|
596
|
+
},
|
|
597
|
+
{ token: 'fg.onLogo', use: 'variant="logo" · initials' },
|
|
598
|
+
]}
|
|
599
|
+
/>
|
|
600
|
+
),
|
|
601
|
+
};
|
|
@@ -1,27 +1,66 @@
|
|
|
1
|
-
import { forwardRef } from 'react';
|
|
2
1
|
import {
|
|
3
|
-
|
|
2
|
+
Children,
|
|
3
|
+
type ComponentProps,
|
|
4
|
+
forwardRef,
|
|
5
|
+
type ForwardRefExoticComponent,
|
|
6
|
+
type ReactNode,
|
|
7
|
+
type RefAttributes,
|
|
8
|
+
} from 'react';
|
|
9
|
+
import {
|
|
4
10
|
AvatarContext,
|
|
5
11
|
AvatarFallback,
|
|
6
|
-
AvatarGroup,
|
|
12
|
+
AvatarGroup as ChakraAvatarGroup,
|
|
13
|
+
AvatarGroupProps as ChakraAvatarGroupProps,
|
|
7
14
|
AvatarIcon,
|
|
8
15
|
AvatarImage,
|
|
9
|
-
AvatarRoot,
|
|
16
|
+
AvatarRoot as ChakraAvatarRoot,
|
|
10
17
|
AvatarRootProps as ChakraAvatarRootProps,
|
|
11
|
-
AvatarRootProvider,
|
|
18
|
+
AvatarRootProvider as ChakraAvatarRootProvider,
|
|
19
|
+
type ConditionalValue,
|
|
12
20
|
} from '@chakra-ui/react';
|
|
13
21
|
|
|
14
22
|
import { SYSTEM_HUE_NAMES, SystemHue } from '@/theme/colors';
|
|
15
23
|
|
|
16
24
|
export type {
|
|
17
25
|
AvatarFallbackProps,
|
|
18
|
-
AvatarGroupProps,
|
|
19
26
|
AvatarIconProps,
|
|
20
27
|
AvatarImageProps,
|
|
21
|
-
AvatarRootProps,
|
|
22
28
|
} from '@chakra-ui/react';
|
|
23
29
|
|
|
24
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Chakra's variants plus Logician's `logo`. Chakra types `variant` from its
|
|
32
|
+
* own recipe, so the theme-level `logo` variant needs widening here.
|
|
33
|
+
*/
|
|
34
|
+
export type AvatarVariant = 'subtle' | 'solid' | 'outline' | 'logo';
|
|
35
|
+
|
|
36
|
+
/** `P` with `variant` widened to {@link AvatarVariant}. */
|
|
37
|
+
type WithAvatarVariant<P> = Omit<P, 'variant'> & {
|
|
38
|
+
/**
|
|
39
|
+
* `subtle` (default): the `colorPalette` fill — a person's category hue, or
|
|
40
|
+
* the neutral pair. `logo`: the light `bg.logo` tile for model, chatbot and
|
|
41
|
+
* brand marks, the same in both modes.
|
|
42
|
+
*/
|
|
43
|
+
variant?: ConditionalValue<AvatarVariant>;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export type AvatarRootProps = WithAvatarVariant<ChakraAvatarRootProps>;
|
|
47
|
+
export type AvatarRootProviderProps = WithAvatarVariant<
|
|
48
|
+
ComponentProps<typeof ChakraAvatarRootProvider>
|
|
49
|
+
>;
|
|
50
|
+
|
|
51
|
+
// Chakra's parts, typed for the `logo` variant.
|
|
52
|
+
const AvatarRoot = ChakraAvatarRoot as ForwardRefExoticComponent<
|
|
53
|
+
AvatarRootProps & RefAttributes<HTMLDivElement>
|
|
54
|
+
>;
|
|
55
|
+
const AvatarRootProvider =
|
|
56
|
+
ChakraAvatarRootProvider as ForwardRefExoticComponent<
|
|
57
|
+
AvatarRootProviderProps & RefAttributes<HTMLDivElement>
|
|
58
|
+
>;
|
|
59
|
+
const ChakraAvatarGroupTyped = ChakraAvatarGroup as ForwardRefExoticComponent<
|
|
60
|
+
WithAvatarVariant<ChakraAvatarGroupProps> & RefAttributes<HTMLDivElement>
|
|
61
|
+
>;
|
|
62
|
+
|
|
63
|
+
export type AvatarProps = AvatarRootProps & {
|
|
25
64
|
src?: string;
|
|
26
65
|
name?: string;
|
|
27
66
|
/**
|
|
@@ -35,6 +74,19 @@ export type AvatarProps = ChakraAvatarRootProps & {
|
|
|
35
74
|
colorHue?: SystemHue;
|
|
36
75
|
};
|
|
37
76
|
|
|
77
|
+
export interface AvatarGroupProps extends Omit<
|
|
78
|
+
WithAvatarVariant<ChakraAvatarGroupProps>,
|
|
79
|
+
'children'
|
|
80
|
+
> {
|
|
81
|
+
children?: ReactNode;
|
|
82
|
+
/**
|
|
83
|
+
* Show at most this many avatars; the rest collapse into a trailing "+N"
|
|
84
|
+
* counter in the neutral pair. Omit to show all. Chakra 3 dropped 2.x's
|
|
85
|
+
* `max`; this restores it.
|
|
86
|
+
*/
|
|
87
|
+
max?: number;
|
|
88
|
+
}
|
|
89
|
+
|
|
38
90
|
/**
|
|
39
91
|
* A stable hash of `name` into one of `SYSTEM_HUE_NAMES`, so a given name
|
|
40
92
|
* always lands on the same hue (no lookup table, nothing to keep in sync) and
|
|
@@ -60,9 +112,26 @@ export function hueForName(name: string | undefined): SystemHue | undefined {
|
|
|
60
112
|
return SYSTEM_HUE_NAMES[index];
|
|
61
113
|
}
|
|
62
114
|
|
|
115
|
+
/**
|
|
116
|
+
* The `colorPalette` an avatar paints with: `category.<hue>` for a person
|
|
117
|
+
* (`colorHue`, else {@link hueForName}), `category.neutral` with no name. The
|
|
118
|
+
* avatar recipe maps `colorPalette.surface` / `colorPalette.fg` onto it.
|
|
119
|
+
*/
|
|
120
|
+
export function avatarColorPalette(
|
|
121
|
+
name: string | undefined,
|
|
122
|
+
colorHue?: SystemHue
|
|
123
|
+
): `category.${SystemHue | 'neutral'}` {
|
|
124
|
+
const hue = colorHue ?? hueForName(name);
|
|
125
|
+
return hue ? `category.${hue}` : 'category.neutral';
|
|
126
|
+
}
|
|
127
|
+
|
|
63
128
|
/**
|
|
64
129
|
* Fallback (initials / icon) colours: the person's hue when there is one,
|
|
65
130
|
* otherwise the neutral pair Badge `neutral` uses.
|
|
131
|
+
*
|
|
132
|
+
* @deprecated The avatar recipe now paints the root from `colorPalette` (see
|
|
133
|
+
* {@link avatarColorPalette}); `Avatar` no longer calls this. Kept for
|
|
134
|
+
* callers that colour a non-avatar element to match a person. Removed in 6.0.
|
|
66
135
|
*/
|
|
67
136
|
export function avatarFallbackColors(
|
|
68
137
|
name: string | undefined,
|
|
@@ -73,26 +142,54 @@ export function avatarFallbackColors(
|
|
|
73
142
|
return { bg: `category.${hue}.surface`, color: `category.${hue}.fg` };
|
|
74
143
|
}
|
|
75
144
|
|
|
145
|
+
/**
|
|
146
|
+
* Chakra's `AvatarGroup` (overlapping avatars; `size` / `variant` reach every
|
|
147
|
+
* child through the recipe props context) with the `max` overflow cap. The
|
|
148
|
+
* counter is always the neutral `subtle` pair, whatever the group's variant:
|
|
149
|
+
* it is a count, not a person or a logo.
|
|
150
|
+
*/
|
|
151
|
+
const AvatarGroup = forwardRef<HTMLDivElement, AvatarGroupProps>(
|
|
152
|
+
({ max, children, ...rest }, ref) => {
|
|
153
|
+
const items = Children.toArray(children);
|
|
154
|
+
const visible =
|
|
155
|
+
typeof max === 'number' ? items.slice(0, Math.max(0, max)) : items;
|
|
156
|
+
const overflow = items.length - visible.length;
|
|
157
|
+
return (
|
|
158
|
+
<ChakraAvatarGroupTyped ref={ref} {...rest}>
|
|
159
|
+
{visible}
|
|
160
|
+
{overflow > 0 && (
|
|
161
|
+
// Spans so a group inside a button (a popover trigger) stays phrasing
|
|
162
|
+
// content; the recipe sets the display, so nothing else changes.
|
|
163
|
+
<AvatarRoot
|
|
164
|
+
as="span"
|
|
165
|
+
colorPalette="category.neutral"
|
|
166
|
+
variant="subtle"
|
|
167
|
+
>
|
|
168
|
+
<AvatarFallback as="span">+{overflow}</AvatarFallback>
|
|
169
|
+
</AvatarRoot>
|
|
170
|
+
)}
|
|
171
|
+
</ChakraAvatarGroupTyped>
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
);
|
|
175
|
+
|
|
176
|
+
AvatarGroup.displayName = 'AvatarGroup';
|
|
177
|
+
|
|
76
178
|
const AvatarComponent = forwardRef<HTMLDivElement, AvatarProps>(
|
|
77
179
|
(props, ref) => {
|
|
78
180
|
const { src, name, colorHue, ...rest } = props;
|
|
79
|
-
|
|
181
|
+
// Fill, text colour, border and the full-circle fallback all come from
|
|
182
|
+
// the avatar recipe (src/theme/recipes/avatar.ts); only the palette is
|
|
183
|
+
// chosen here. A caller's own `colorPalette` still wins.
|
|
80
184
|
return (
|
|
81
|
-
<
|
|
185
|
+
<AvatarRoot
|
|
82
186
|
ref={ref}
|
|
83
|
-
|
|
84
|
-
borderColor="border.subtle"
|
|
85
|
-
overflow="hidden"
|
|
86
|
-
bgColor="transparent"
|
|
187
|
+
colorPalette={avatarColorPalette(name, colorHue)}
|
|
87
188
|
{...rest}
|
|
88
189
|
>
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
color={fallback.color}
|
|
93
|
-
/>
|
|
94
|
-
<ChakraAvatar.Image src={src} />
|
|
95
|
-
</ChakraAvatar.Root>
|
|
190
|
+
<AvatarFallback name={name} />
|
|
191
|
+
<AvatarImage src={src} />
|
|
192
|
+
</AvatarRoot>
|
|
96
193
|
);
|
|
97
194
|
}
|
|
98
195
|
);
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { Canvas, Meta } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import { En, Ko, LangToggle, Verdict } from '../../guidelines/_components/Lang';
|
|
4
|
+
import * as AvatarStories from './Avatar.stories';
|
|
5
|
+
|
|
6
|
+
<Meta of={AvatarStories} name="Usage" />
|
|
7
|
+
|
|
8
|
+
<LangToggle />
|
|
9
|
+
|
|
10
|
+
<En>
|
|
11
|
+
|
|
12
|
+
# Avatar
|
|
13
|
+
|
|
14
|
+
A person's photo, or their initials when there is no photo. The initials are
|
|
15
|
+
tinted with one of the twelve category hues, picked from a stable hash of
|
|
16
|
+
`name`, so the same person has the same colour everywhere without storing
|
|
17
|
+
one.
|
|
18
|
+
|
|
19
|
+
## When to use
|
|
20
|
+
|
|
21
|
+
- Next to a person's name in a member list, a table row, a comment, or the
|
|
22
|
+
account menu.
|
|
23
|
+
- A stack of people (`Avatar.Group`) where the count matters more than each
|
|
24
|
+
name.
|
|
25
|
+
|
|
26
|
+
## When not to use
|
|
27
|
+
|
|
28
|
+
- A chatbot, tenant or product logo as an avatar → `variant="logo"`, which
|
|
29
|
+
swaps the person's hue for the light `bg.logo` tile those marks are drawn
|
|
30
|
+
for (light in both modes). Anywhere else a logo is just an `<img>` with alt
|
|
31
|
+
text: an avatar without `variant="logo"` implies a person.
|
|
32
|
+
- A status (online, blocked) → `Badge` next to the name. Avatar has no status
|
|
33
|
+
colours.
|
|
34
|
+
|
|
35
|
+
## Options
|
|
36
|
+
|
|
37
|
+
| Prop | Means |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| `src` | Photo URL. While it loads, or if it fails, the fallback shows. |
|
|
40
|
+
| `name` | Used for the initials and the hue. With no name, the fallback is the neutral pair (`bg.muted` / `secondary.fgStrong`), never red. |
|
|
41
|
+
| `colorHue` | Overrides the hashed hue. Identity only, never status. |
|
|
42
|
+
| `size` | Chakra sizes, `2xs` to `2xl` and `full`. |
|
|
43
|
+
| `variant` | `subtle` (default): the person's hue, or the neutral pair. `logo`: the light `bg.logo` tile for model and chatbot marks, with `fg.onLogo` initials. |
|
|
44
|
+
| `colorPalette` | Set for you from `name` / `colorHue` (`category.<hue>`, or `category.neutral`). Pass one only to colour a bare `Avatar.Root`. |
|
|
45
|
+
| `Avatar.Group` `max` | Show at most this many; the rest become a "+N" counter in the neutral pair. |
|
|
46
|
+
|
|
47
|
+
The fill, text colour and border belong to the avatar recipe, and the
|
|
48
|
+
fallback fills the whole circle, so `Avatar.Root` + `Avatar.Fallback` need no
|
|
49
|
+
styling of their own. Do not pass `bg` / `color` to recolour an avatar.
|
|
50
|
+
|
|
51
|
+
## Do / Don't
|
|
52
|
+
|
|
53
|
+
</En>
|
|
54
|
+
|
|
55
|
+
<Ko>
|
|
56
|
+
|
|
57
|
+
# Avatar
|
|
58
|
+
|
|
59
|
+
사람의 사진, 사진이 없으면 이름 머리글자를 보여 주는 컴포넌트입니다. 머리글자는 열두
|
|
60
|
+
가지 category 색 가운데 하나로 칠해지는데, `name`의 고정 해시로 고르므로 색을 따로
|
|
61
|
+
저장하지 않아도 같은 사람은 어디서나 같은 색입니다.
|
|
62
|
+
|
|
63
|
+
## 언제 쓰나요
|
|
64
|
+
|
|
65
|
+
- 멤버 목록, 표의 행, 댓글, 계정 메뉴에서 사람 이름 옆에.
|
|
66
|
+
- 이름 하나하나보다 사람 수가 중요한 묶음(`Avatar.Group`).
|
|
67
|
+
|
|
68
|
+
## 언제 쓰지 않나요
|
|
69
|
+
|
|
70
|
+
- 챗봇, 기관, 제품 로고를 아바타 자리에 둘 때는 `variant="logo"`를 씁니다. 사람의
|
|
71
|
+
색 대신, 그 로고들이 전제하는 밝은 `bg.logo` 타일(라이트·다크 모두 밝음)을 깝니다.
|
|
72
|
+
그 밖의 자리에서 로고는 대체 글이 있는 `<img>`입니다. `variant="logo"`가 없는
|
|
73
|
+
Avatar는 사람을 뜻합니다.
|
|
74
|
+
- 상태(접속 중, 차단됨)는 이름 옆의 `Badge`로 알립니다. Avatar에는 상태색이 없습니다.
|
|
75
|
+
|
|
76
|
+
## 옵션
|
|
77
|
+
|
|
78
|
+
| 속성 | 뜻 |
|
|
79
|
+
| --- | --- |
|
|
80
|
+
| `src` | 사진 URL. 불러오는 동안이나 실패하면 대체 표시가 나옵니다. |
|
|
81
|
+
| `name` | 머리글자와 색을 정합니다. 이름이 없으면 중립 색(`bg.muted` / `secondary.fgStrong`)을 쓰고, 빨강은 쓰지 않습니다. |
|
|
82
|
+
| `colorHue` | 해시로 고른 색을 바꿉니다. 사람을 구분할 때만 쓰고 상태에는 쓰지 않습니다. |
|
|
83
|
+
| `size` | Chakra 크기. `2xs`부터 `2xl`, `full`. |
|
|
84
|
+
| `variant` | `subtle`(기본): 사람의 색, 이름이 없으면 중립 색. `logo`: 모델·챗봇 로고용 밝은 `bg.logo` 타일, 머리글자는 `fg.onLogo`. |
|
|
85
|
+
| `colorPalette` | `name` / `colorHue`로 자동으로 정해집니다(`category.<hue>`, 또는 `category.neutral`). `Avatar.Root`를 직접 쓸 때만 넘깁니다. |
|
|
86
|
+
| `Avatar.Group` `max` | 이 수까지만 보여 주고 나머지는 중립 색 "+N" 표시로 묶습니다. |
|
|
87
|
+
|
|
88
|
+
배경, 글자 색, 테두리는 아바타 레시피가 정하고 대체 표시는 원 전체를 채웁니다.
|
|
89
|
+
그래서 `Avatar.Root` + `Avatar.Fallback`에는 따로 스타일을 줄 필요가 없습니다.
|
|
90
|
+
아바타 색을 바꾸려고 `bg` / `color`를 넘기지 마세요.
|
|
91
|
+
|
|
92
|
+
## 이렇게 하세요 / 이렇게 하지 마세요
|
|
93
|
+
|
|
94
|
+
</Ko>
|
|
95
|
+
|
|
96
|
+
<Canvas of={AvatarStories.DoNameNextToIt} />
|
|
97
|
+
<Verdict
|
|
98
|
+
kind="do"
|
|
99
|
+
en="Show the name as text next to the avatar, and hide the avatar from assistive technology so the name is read once."
|
|
100
|
+
ko="아바타 옆에 이름을 글자로 보여 주고, 아바타는 보조 기술에서 숨겨 이름이 한 번만 읽히게 합니다."
|
|
101
|
+
/>
|
|
102
|
+
|
|
103
|
+
<Canvas of={AvatarStories.DontHueAsStatus} />
|
|
104
|
+
<Verdict
|
|
105
|
+
kind="dont"
|
|
106
|
+
en="Pick green, red or yellow to mean active, blocked or pending. The hue only tells people apart; readers will not know it changed meaning."
|
|
107
|
+
ko="활성, 차단, 대기를 나타내려고 초록, 빨강, 노랑을 고르지 마세요. 색은 사람을 구분할 뿐이라, 뜻이 바뀌었다는 것을 읽는 사람은 알 수 없습니다."
|
|
108
|
+
/>
|
|
109
|
+
|
|
110
|
+
<En>
|
|
111
|
+
|
|
112
|
+
## Content
|
|
113
|
+
|
|
114
|
+
- Pass the display name the user knows (김지민), not an email, so the
|
|
115
|
+
initials make sense.
|
|
116
|
+
|
|
117
|
+
## Accessibility
|
|
118
|
+
|
|
119
|
+
What Avatar does for you:
|
|
120
|
+
|
|
121
|
+
- With no photo, the initials are real text, so they are read.
|
|
122
|
+
|
|
123
|
+
What you still have to do:
|
|
124
|
+
|
|
125
|
+
- **The photo has no alt text.** `Avatar` does not pass one to the image, so
|
|
126
|
+
a loaded photo is an `<img>` without `alt` (WCAG 1.1.1). Show the name as
|
|
127
|
+
text next to it and put `aria-hidden` on the Avatar, as in the Do example.
|
|
128
|
+
An avatar on its own (a toolbar account button) gets its name from the
|
|
129
|
+
button's `aria-label`.
|
|
130
|
+
- Do not use the hue to carry meaning (WCAG 1.4.1).
|
|
131
|
+
|
|
132
|
+
## Tokens
|
|
133
|
+
|
|
134
|
+
The `category.*` pairs the avatar recipe reads through `colorPalette`, and the
|
|
135
|
+
`logo` tile.
|
|
136
|
+
|
|
137
|
+
</En>
|
|
138
|
+
|
|
139
|
+
<Ko>
|
|
140
|
+
|
|
141
|
+
## 문구
|
|
142
|
+
|
|
143
|
+
- 이메일이 아니라 사용자가 아는 표시 이름(김지민)을 넘겨야 머리글자가 뜻이 통합니다.
|
|
144
|
+
|
|
145
|
+
## 접근성
|
|
146
|
+
|
|
147
|
+
Avatar가 알아서 하는 일
|
|
148
|
+
|
|
149
|
+
- 사진이 없으면 머리글자가 실제 글자라서 읽힙니다.
|
|
150
|
+
|
|
151
|
+
직접 챙겨야 하는 일
|
|
152
|
+
|
|
153
|
+
- **사진에 대체 글이 없습니다.** `Avatar`가 이미지에 alt를 넘기지 않아서, 사진을
|
|
154
|
+
불러오면 `alt` 없는 `<img>`가 됩니다(WCAG 1.1.1). 이름을 옆에 글자로 보여 주고
|
|
155
|
+
Avatar에는 `aria-hidden`을 붙입니다(이렇게 하세요 예시처럼). 아바타만 있는 경우(도구
|
|
156
|
+
모음의 계정 버튼)에는 버튼의 `aria-label`로 이름을 붙입니다.
|
|
157
|
+
- 색에 뜻을 담지 않습니다(WCAG 1.4.1).
|
|
158
|
+
|
|
159
|
+
## 토큰
|
|
160
|
+
|
|
161
|
+
아바타 레시피가 `colorPalette`로 읽는 `category.*` 쌍과 `logo` 타일입니다.
|
|
162
|
+
|
|
163
|
+
</Ko>
|
|
164
|
+
|
|
165
|
+
<Canvas of={AvatarStories.UsageTokens} sourceState="none" />
|
|
166
|
+
|
|
167
|
+
<En>
|
|
168
|
+
|
|
169
|
+
## Related
|
|
170
|
+
|
|
171
|
+
- **Badge**: a person's status next to their name.
|
|
172
|
+
- **Table**: member lists.
|
|
173
|
+
- **Foundations/Brand & colour usage**: category hues carry no meaning.
|
|
174
|
+
|
|
175
|
+
</En>
|
|
176
|
+
|
|
177
|
+
<Ko>
|
|
178
|
+
|
|
179
|
+
## 관련 컴포넌트
|
|
180
|
+
|
|
181
|
+
- **Badge**: 이름 옆의 상태.
|
|
182
|
+
- **Table**: 멤버 목록.
|
|
183
|
+
- **Foundations/Brand & colour usage**: category 색에는 뜻이 없습니다.
|
|
184
|
+
|
|
185
|
+
</Ko>
|
|
@@ -5,5 +5,12 @@ export type {
|
|
|
5
5
|
AvatarImageProps,
|
|
6
6
|
AvatarProps,
|
|
7
7
|
AvatarRootProps,
|
|
8
|
+
AvatarRootProviderProps,
|
|
9
|
+
AvatarVariant,
|
|
10
|
+
} from './Avatar';
|
|
11
|
+
export {
|
|
12
|
+
Avatar,
|
|
13
|
+
avatarColorPalette,
|
|
14
|
+
avatarFallbackColors,
|
|
15
|
+
hueForName,
|
|
8
16
|
} from './Avatar';
|
|
9
|
-
export { Avatar, avatarFallbackColors, hueForName } from './Avatar';
|