@mindlogic-ai/logician-ui 5.0.0-alpha.3 → 5.0.0-alpha.30
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/MIGRATION-5.0.md +40 -1
- package/README.md +1 -0
- package/USAGE.md +20 -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/Banner/Banner.types.d.ts +24 -1
- package/dist/components/Banner/Banner.types.d.ts.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.styles.d.ts +2 -2
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +31 -3
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/Button.mjs +31 -3
- package/dist/components/Button/Button.mjs.map +1 -1
- package/dist/components/Button/Button.types.d.ts +38 -1
- package/dist/components/Button/Button.types.d.ts.map +1 -1
- package/dist/components/Card/Card.types.d.ts +12 -0
- package/dist/components/Card/Card.types.d.ts.map +1 -1
- package/dist/components/Code/shikiAdapter.d.ts +3 -1
- package/dist/components/Code/shikiAdapter.d.ts.map +1 -1
- package/dist/components/Code/shikiAdapter.js +29 -8
- package/dist/components/Code/shikiAdapter.js.map +1 -1
- package/dist/components/Code/shikiAdapter.mjs +29 -8
- package/dist/components/Code/shikiAdapter.mjs.map +1 -1
- package/dist/components/CodeTabs/CodeTabs.styles.d.ts +6 -5
- package/dist/components/CodeTabs/CodeTabs.styles.d.ts.map +1 -1
- package/dist/components/CodeTabs/CodeTabs.styles.js +6 -5
- package/dist/components/CodeTabs/CodeTabs.styles.js.map +1 -1
- package/dist/components/CodeTabs/CodeTabs.styles.mjs +6 -5
- package/dist/components/CodeTabs/CodeTabs.styles.mjs.map +1 -1
- package/dist/components/ColorMode/ColorModeToggle.d.ts +7 -2
- package/dist/components/ColorMode/ColorModeToggle.d.ts.map +1 -1
- package/dist/components/ColorMode/ColorModeToggle.js +8 -3
- package/dist/components/ColorMode/ColorModeToggle.js.map +1 -1
- package/dist/components/ColorMode/ColorModeToggle.mjs +8 -3
- package/dist/components/ColorMode/ColorModeToggle.mjs.map +1 -1
- package/dist/components/Confetti/Confetti.types.d.ts +5 -1
- package/dist/components/Confetti/Confetti.types.d.ts.map +1 -1
- package/dist/components/Confetti/confettiColors.d.ts +5 -5
- package/dist/components/Confetti/confettiColors.js +5 -5
- package/dist/components/Confetti/confettiColors.mjs +5 -5
- package/dist/components/DatePicker/DatePicker.types.d.ts +12 -0
- package/dist/components/DatePicker/DatePicker.types.d.ts.map +1 -0
- package/dist/components/DatePicker/RangeDatePicker.d.ts +2 -1
- package/dist/components/DatePicker/RangeDatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/RangeDatePicker.js +4 -2
- package/dist/components/DatePicker/RangeDatePicker.js.map +1 -1
- package/dist/components/DatePicker/RangeDatePicker.mjs +4 -2
- package/dist/components/DatePicker/RangeDatePicker.mjs.map +1 -1
- package/dist/components/DatePicker/SingleDatePicker.d.ts +2 -1
- package/dist/components/DatePicker/SingleDatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/SingleDatePicker.js +4 -2
- package/dist/components/DatePicker/SingleDatePicker.js.map +1 -1
- package/dist/components/DatePicker/SingleDatePicker.mjs +4 -2
- package/dist/components/DatePicker/SingleDatePicker.mjs.map +1 -1
- package/dist/components/DatePicker/index.d.ts +1 -0
- package/dist/components/DatePicker/index.d.ts.map +1 -1
- package/dist/components/ErrorFallback/ErrorFallback.types.d.ts +6 -0
- package/dist/components/ErrorFallback/ErrorFallback.types.d.ts.map +1 -1
- package/dist/components/ExpandableText/ExpandableText.d.ts.map +1 -1
- package/dist/components/ExpandableText/ExpandableText.js +1 -1
- package/dist/components/ExpandableText/ExpandableText.js.map +1 -1
- package/dist/components/ExpandableText/ExpandableText.mjs +1 -1
- package/dist/components/ExpandableText/ExpandableText.mjs.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/MonthPicker/MonthPicker.d.ts.map +1 -1
- package/dist/components/MonthPicker/MonthPicker.js +3 -2
- package/dist/components/MonthPicker/MonthPicker.js.map +1 -1
- package/dist/components/MonthPicker/MonthPicker.mjs +3 -2
- package/dist/components/MonthPicker/MonthPicker.mjs.map +1 -1
- package/dist/components/MonthPicker/MonthPicker.types.d.ts +7 -1
- package/dist/components/MonthPicker/MonthPicker.types.d.ts.map +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 +34 -33
- package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.mjs +35 -34
- package/dist/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.styles.d.ts +24 -0
- package/dist/components/SegmentedControl/SegmentedControl.styles.d.ts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.styles.js +30 -0
- package/dist/components/SegmentedControl/SegmentedControl.styles.js.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.styles.mjs +29 -1
- package/dist/components/SegmentedControl/SegmentedControl.styles.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/Switch/SwitchControl.d.ts.map +1 -1
- package/dist/components/Switch/SwitchControl.js +26 -11
- package/dist/components/Switch/SwitchControl.js.map +1 -1
- package/dist/components/Switch/SwitchControl.mjs +27 -12
- package/dist/components/Switch/SwitchControl.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/Tag/Tag.d.ts.map +1 -1
- package/dist/components/Tag/Tag.js +14 -2
- package/dist/components/Tag/Tag.js.map +1 -1
- package/dist/components/Tag/Tag.mjs +15 -3
- package/dist/components/Tag/Tag.mjs.map +1 -1
- package/dist/components/Tag/Tag.styles.d.ts +20 -2
- package/dist/components/Tag/Tag.styles.d.ts.map +1 -1
- package/dist/components/Tag/Tag.styles.js +81 -0
- package/dist/components/Tag/Tag.styles.js.map +1 -1
- package/dist/components/Tag/Tag.styles.mjs +81 -1
- package/dist/components/Tag/Tag.styles.mjs.map +1 -1
- package/dist/components/Tag/Tag.types.d.ts +15 -2
- package/dist/components/Tag/Tag.types.d.ts.map +1 -1
- package/dist/components/Tag/index.d.ts +2 -2
- package/dist/components/Tag/index.d.ts.map +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.d.ts.map +1 -1
- package/dist/components/Toast/Toast.js +5 -1
- package/dist/components/Toast/Toast.js.map +1 -1
- package/dist/components/Toast/Toast.mjs +5 -1
- package/dist/components/Toast/Toast.mjs.map +1 -1
- package/dist/components/Toast/Toast.styles.d.ts +13 -2
- package/dist/components/Toast/Toast.styles.d.ts.map +1 -1
- package/dist/components/Toast/Toast.styles.js +19 -7
- package/dist/components/Toast/Toast.styles.js.map +1 -1
- package/dist/components/Toast/Toast.styles.mjs +19 -7
- 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 +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -3
- 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 +63 -19
- package/dist/theme/colors.js.map +1 -1
- package/dist/theme/colors.mjs +64 -20
- package/dist/theme/colors.mjs.map +1 -1
- package/dist/theme/controlSizes.d.ts +91 -0
- package/dist/theme/controlSizes.d.ts.map +1 -0
- package/dist/theme/controlSizes.js +143 -0
- package/dist/theme/controlSizes.js.map +1 -0
- package/dist/theme/controlSizes.mjs +135 -0
- package/dist/theme/controlSizes.mjs.map +1 -0
- 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 +14 -43
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/index.mjs +14 -43
- package/dist/theme/index.mjs.map +1 -1
- package/dist/theme/palette.generated.d.ts +295 -162
- package/dist/theme/palette.generated.d.ts.map +1 -1
- package/dist/theme/palette.generated.js +296 -162
- package/dist/theme/palette.generated.js.map +1 -1
- package/dist/theme/palette.generated.mjs +296 -163
- 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/theme/recipes/controls.d.ts +94 -0
- package/dist/theme/recipes/controls.d.ts.map +1 -0
- package/dist/theme/recipes/controls.js +154 -0
- package/dist/theme/recipes/controls.js.map +1 -0
- package/dist/theme/recipes/controls.mjs +144 -0
- package/dist/theme/recipes/controls.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/Banner/Banner.stories.tsx +152 -2
- package/src/components/Banner/Banner.types.ts +30 -1
- package/src/components/Banner/Banner.usage.mdx +233 -0
- package/src/components/BottomSheet/BottomSheet.stories.tsx +168 -1
- package/src/components/BottomSheet/BottomSheet.test.tsx +2 -1
- package/src/components/BottomSheet/BottomSheet.usage.mdx +216 -0
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +59 -0
- package/src/components/Breadcrumb/Breadcrumb.usage.mdx +181 -0
- package/src/components/Button/Button.focusableWhenDisabled.test.tsx +218 -0
- package/src/components/Button/Button.stories.tsx +332 -3
- package/src/components/Button/Button.tsx +46 -3
- package/src/components/Button/Button.types.ts +38 -1
- package/src/components/Button/Button.usage.mdx +358 -0
- package/src/components/Button/Button.variants.test.tsx +13 -1
- package/src/components/Card/Card.stories.tsx +106 -0
- package/src/components/Card/Card.types.ts +12 -0
- package/src/components/Card/Card.usage.mdx +216 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +140 -13
- package/src/components/Checkbox/Checkbox.usage.mdx +214 -0
- package/src/components/Chip/Chip.usage.mdx +78 -0
- package/src/components/Code/Code.stories.tsx +60 -0
- package/src/components/Code/Code.test.tsx +116 -0
- package/src/components/Code/Code.usage.mdx +187 -0
- package/src/components/Code/shikiAdapter.ts +38 -9
- package/src/components/CodeTabs/CodeTabs.stories.tsx +53 -0
- package/src/components/CodeTabs/CodeTabs.styles.ts +6 -5
- package/src/components/CodeTabs/CodeTabs.usage.mdx +176 -0
- package/src/components/Collapsible/Collapsible.stories.tsx +58 -0
- package/src/components/Collapsible/Collapsible.usage.mdx +173 -0
- package/src/components/ColorMode/ColorMode.stories.tsx +50 -0
- package/src/components/ColorMode/ColorMode.usage.mdx +135 -0
- package/src/components/ColorMode/ColorModeToggle.tsx +10 -3
- package/src/components/Confetti/Confetti.types.ts +5 -1
- package/src/components/Confetti/Confetti.usage.mdx +111 -0
- package/src/components/Confetti/confettiColors.ts +5 -5
- package/src/components/Container/Container.stories.tsx +32 -0
- package/src/components/Container/Container.usage.mdx +130 -0
- package/src/components/CopyableCode/CopyableCode.stories.tsx +62 -0
- package/src/components/CopyableCode/CopyableCode.usage.mdx +168 -0
- package/src/components/CountBadge/CountBadge.stories.tsx +69 -0
- package/src/components/CountBadge/CountBadge.usage.mdx +215 -0
- package/src/components/CountUp/CountUp.usage.mdx +107 -0
- package/src/components/DatePicker/DatePicker.types.ts +12 -0
- package/src/components/DatePicker/DatePicker.usage.mdx +177 -0
- package/src/components/DatePicker/RangeDatePicker.stories.tsx +87 -3
- package/src/components/DatePicker/RangeDatePicker.tsx +7 -1
- package/src/components/DatePicker/SingleDatePicker.tsx +7 -1
- package/src/components/DatePicker/index.ts +1 -0
- 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.tsx +0 -1
- package/src/components/ExpandableText/ExpandableText.usage.mdx +178 -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.tsx +7 -1
- package/src/components/MonthPicker/MonthPicker.types.ts +8 -1
- 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.styles.ts +38 -0
- package/src/components/SegmentedControl/SegmentedControl.tsx +43 -37
- package/src/components/SegmentedControl/SegmentedControl.usage.mdx +216 -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 +139 -6
- package/src/components/Switch/Switch.usage.mdx +200 -0
- package/src/components/Switch/SwitchControl.tsx +32 -15
- 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.styles.ts +117 -2
- package/src/components/Tag/Tag.test.tsx +87 -1
- package/src/components/Tag/Tag.tsx +22 -1
- package/src/components/Tag/Tag.types.ts +16 -2
- package/src/components/Tag/Tag.usage.mdx +257 -0
- package/src/components/Tag/index.ts +2 -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 +19 -7
- package/src/components/Toast/Toast.tsx +8 -1
- 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 +78 -21
- package/src/components/claude.md +24 -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 +103 -4
- package/src/foundations/BrandColour.stories.tsx +135 -2
- 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 +19 -1
- package/src/theme/BazePalette.stories.tsx +111 -1
- package/src/theme/ControlSizes.stories.tsx +586 -0
- package/src/theme/Palette.stories.tsx +2 -2
- package/src/theme/SemanticTokens.mdx +118 -19
- package/src/theme/claude.md +34 -9
- package/src/theme/colors.ts +82 -19
- package/src/theme/contrast.test.ts +67 -0
- package/src/theme/controlSizes.test.ts +153 -0
- package/src/theme/controlSizes.ts +162 -0
- package/src/theme/global.ts +20 -1
- package/src/theme/index.ts +23 -46
- package/src/theme/palette.generated.ts +296 -162
- 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/theme/recipes/controls.ts +171 -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,200 @@
|
|
|
1
|
+
import { Canvas, Meta } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import { En, Ko, LangToggle, Verdict } from '../../guidelines/_components/Lang';
|
|
4
|
+
import * as AccordionStories from './Accordion.stories';
|
|
5
|
+
|
|
6
|
+
<Meta of={AccordionStories} name="Usage" />
|
|
7
|
+
|
|
8
|
+
<LangToggle />
|
|
9
|
+
|
|
10
|
+
<En>
|
|
11
|
+
|
|
12
|
+
# Accordion
|
|
13
|
+
|
|
14
|
+
A stack of sections, each with a heading button that opens and closes its
|
|
15
|
+
content. `Accordion` › `AccordionItem` (`value`) › `AccordionButton` +
|
|
16
|
+
`AccordionPanel`.
|
|
17
|
+
|
|
18
|
+
Defaults that differ from Chakra: `multiple` is `true` (several sections can
|
|
19
|
+
be open at once) and `variant` is `enclosed`. Content opens on the house
|
|
20
|
+
presence clock (300 ms in, 150 ms out).
|
|
21
|
+
|
|
22
|
+
## When to use
|
|
23
|
+
|
|
24
|
+
- A list of questions or topics the reader scans, opening only the ones they
|
|
25
|
+
need: an FAQ, a landing page's feature list.
|
|
26
|
+
- Long optional content grouped into several named sections.
|
|
27
|
+
|
|
28
|
+
## When not to use
|
|
29
|
+
|
|
30
|
+
- One section → `Collapsible`.
|
|
31
|
+
- Content everyone needs, or steps that must be completed in order → show it
|
|
32
|
+
on the page, or use a stepper. Do not hide required input.
|
|
33
|
+
- Switching between views of the same thing → `Tabs`.
|
|
34
|
+
- A hierarchy the user selects from → `Tree`.
|
|
35
|
+
|
|
36
|
+
## Options
|
|
37
|
+
|
|
38
|
+
| Prop | Means |
|
|
39
|
+
| --- | --- |
|
|
40
|
+
| `variant` | `enclosed` (default), `outline`, `subtle`, `plain`: Chakra's accordion recipe styles |
|
|
41
|
+
| `multiple` | Default `true`. Set `false` to keep one open at a time |
|
|
42
|
+
| `collapsible` | With `multiple={false}`, lets the open item be closed again |
|
|
43
|
+
| `defaultValue` / `value` | Item values open at start, or controlled |
|
|
44
|
+
| `lazyMount` / `unmountOnExit` | Mount heavy content only when opened |
|
|
45
|
+
| `AccordionButton customIcon` | Replace the chevron indicator |
|
|
46
|
+
|
|
47
|
+
`AccordionPanel` is marked deprecated in favour of `Accordion.ItemContent` +
|
|
48
|
+
`Accordion.ItemBody` from Chakra; it still works and renders exactly that.
|
|
49
|
+
|
|
50
|
+
## Do / Don't
|
|
51
|
+
|
|
52
|
+
</En>
|
|
53
|
+
|
|
54
|
+
<Ko>
|
|
55
|
+
|
|
56
|
+
# Accordion
|
|
57
|
+
|
|
58
|
+
섹션을 쌓아 두고, 섹션마다 제목 버튼으로 내용을 여닫는 컴포넌트입니다. 구조는
|
|
59
|
+
`Accordion` › `AccordionItem`(`value`) › `AccordionButton` + `AccordionPanel`입니다.
|
|
60
|
+
|
|
61
|
+
Chakra와 다른 기본값이 있습니다. `multiple`이 `true`라 여러 섹션을 함께 열 수 있고,
|
|
62
|
+
`variant`는 `enclosed`입니다. 내용은 공통 등장 시간(열 때 300ms, 닫을 때 150ms)으로
|
|
63
|
+
열립니다.
|
|
64
|
+
|
|
65
|
+
## 언제 쓰나요
|
|
66
|
+
|
|
67
|
+
- 읽는 사람이 훑어보다가 필요한 것만 여는 질문이나 주제 목록: 자주 묻는 질문, 랜딩
|
|
68
|
+
페이지의 기능 목록.
|
|
69
|
+
- 길지만 선택적인 내용을 이름 붙은 여러 섹션으로 나눌 때.
|
|
70
|
+
|
|
71
|
+
## 언제 쓰지 않나요
|
|
72
|
+
|
|
73
|
+
- 섹션이 하나라면 `Collapsible`을 씁니다.
|
|
74
|
+
- 모두가 봐야 하는 내용이나 순서대로 마쳐야 하는 단계는 페이지에 그대로 보여 주거나
|
|
75
|
+
단계 표시를 씁니다. 필수 입력을 숨기지 않습니다.
|
|
76
|
+
- 같은 대상의 보기를 바꾼다면 `Tabs`를 씁니다.
|
|
77
|
+
- 고르는 계층이라면 `Tree`를 씁니다.
|
|
78
|
+
|
|
79
|
+
## 옵션
|
|
80
|
+
|
|
81
|
+
| 속성 | 뜻 |
|
|
82
|
+
| --- | --- |
|
|
83
|
+
| `variant` | `enclosed`(기본값), `outline`, `subtle`, `plain`. Chakra 아코디언 레시피의 모양 |
|
|
84
|
+
| `multiple` | 기본값 `true`. `false`로 두면 한 번에 하나만 열림 |
|
|
85
|
+
| `collapsible` | `multiple={false}`일 때 열린 항목을 다시 닫을 수 있게 함 |
|
|
86
|
+
| `defaultValue` / `value` | 처음 열어 둘 항목, 또는 제어 값 |
|
|
87
|
+
| `lazyMount` / `unmountOnExit` | 무거운 내용을 열 때만 그림 |
|
|
88
|
+
| `AccordionButton`의 `customIcon` | 화살표 표시를 바꿈 |
|
|
89
|
+
|
|
90
|
+
`AccordionPanel`은 Chakra의 `Accordion.ItemContent` + `Accordion.ItemBody`를 쓰라는
|
|
91
|
+
뜻으로 deprecated 표시가 되어 있습니다. 지금도 동작하며 그 구조를 그대로 그립니다.
|
|
92
|
+
|
|
93
|
+
## 이렇게 하세요 / 이렇게 하지 마세요
|
|
94
|
+
|
|
95
|
+
</Ko>
|
|
96
|
+
|
|
97
|
+
<Canvas of={AccordionStories.DoFaq} />
|
|
98
|
+
<Verdict
|
|
99
|
+
kind="do"
|
|
100
|
+
en="Use it for questions the reader scans. Each heading is a full question, so the closed list already says what is inside."
|
|
101
|
+
ko="훑어보는 질문 목록에 씁니다. 제목마다 완전한 질문이라 닫힌 상태에서도 안에 무엇이 있는지 알 수 있습니다."
|
|
102
|
+
/>
|
|
103
|
+
|
|
104
|
+
<Canvas of={AccordionStories.DontHideRequired} />
|
|
105
|
+
<Verdict
|
|
106
|
+
kind="dont"
|
|
107
|
+
en="Hide a required step behind a closed section. People submit without opening it. Show required input on the page."
|
|
108
|
+
ko="필수 단계를 닫힌 섹션 뒤에 숨기지 마세요. 사람들은 열어 보지 않고 제출합니다. 필수 입력은 페이지에 보여 줍니다."
|
|
109
|
+
/>
|
|
110
|
+
|
|
111
|
+
<En>
|
|
112
|
+
|
|
113
|
+
## Content
|
|
114
|
+
|
|
115
|
+
- Headings say what is inside: a question, or a noun phrase. Not 더 보기.
|
|
116
|
+
- Keep headings to one line on mobile.
|
|
117
|
+
- Do not put another Accordion inside a panel.
|
|
118
|
+
|
|
119
|
+
## Accessibility
|
|
120
|
+
|
|
121
|
+
What Accordion does for you:
|
|
122
|
+
|
|
123
|
+
- Each `AccordionButton` is a `<button>` with `aria-expanded` and
|
|
124
|
+
`aria-controls`, and the content region is labelled by it (WCAG 4.1.2).
|
|
125
|
+
- Enter and Space toggle; arrow keys, Home and End move between headings
|
|
126
|
+
(WCAG 2.1.1). The button shows the shared focus ring (WCAG 2.4.7).
|
|
127
|
+
|
|
128
|
+
What you still have to do:
|
|
129
|
+
|
|
130
|
+
- **Put the button inside a heading when the sections are part of the page
|
|
131
|
+
structure**, so heading navigation finds them (WCAG 1.3.1): wrap the
|
|
132
|
+
`AccordionButton` in a heading of the level your page needs.
|
|
133
|
+
- Keep the trigger to phrasing content: text, icons, `Badge`. No `<div>` or
|
|
134
|
+
`<p>` inside the button (`ACCESSIBILITY.md` §5).
|
|
135
|
+
- A custom icon is decorative; give it `aria-hidden`.
|
|
136
|
+
|
|
137
|
+
## Tokens
|
|
138
|
+
|
|
139
|
+
The variant colours come from Chakra's accordion recipe. The library adds
|
|
140
|
+
only the focus ring and the presence timing (`theme/recipes/accordion.ts`).
|
|
141
|
+
|
|
142
|
+
</En>
|
|
143
|
+
|
|
144
|
+
<Ko>
|
|
145
|
+
|
|
146
|
+
## 문구
|
|
147
|
+
|
|
148
|
+
- 제목에는 안에 무엇이 있는지 씁니다. 질문이나 명사구로 쓰고, '더 보기'처럼 쓰지
|
|
149
|
+
않습니다.
|
|
150
|
+
- 제목은 모바일에서 한 줄에 들어가게 씁니다.
|
|
151
|
+
- 패널 안에 다시 Accordion을 넣지 않습니다.
|
|
152
|
+
|
|
153
|
+
## 접근성
|
|
154
|
+
|
|
155
|
+
Accordion이 알아서 하는 일
|
|
156
|
+
|
|
157
|
+
- `AccordionButton`은 `aria-expanded`와 `aria-controls`가 있는 `<button>`이고, 내용
|
|
158
|
+
영역은 그 버튼을 이름으로 씁니다(WCAG 4.1.2).
|
|
159
|
+
- Enter와 Space로 여닫고, 화살표 키와 Home/End로 제목 사이를 오갑니다(WCAG 2.1.1).
|
|
160
|
+
버튼에는 공통 초점 링이 나타납니다(WCAG 2.4.7).
|
|
161
|
+
|
|
162
|
+
직접 챙겨야 하는 일
|
|
163
|
+
|
|
164
|
+
- **섹션이 페이지 구조의 일부라면 버튼을 제목 요소 안에 둡니다.** 그래야 제목으로
|
|
165
|
+
이동할 때 찾을 수 있습니다(WCAG 1.3.1). `AccordionButton`을 페이지에 맞는 수준의
|
|
166
|
+
제목으로 감쌉니다.
|
|
167
|
+
- 트리거 안에는 글자, 아이콘, `Badge` 같은 phrasing content만 넣습니다. 버튼 안에
|
|
168
|
+
`<div>`나 `<p>`를 넣지 않습니다(`ACCESSIBILITY.md` 5절).
|
|
169
|
+
- 직접 넣은 아이콘은 장식이므로 `aria-hidden`을 붙입니다.
|
|
170
|
+
|
|
171
|
+
## 토큰
|
|
172
|
+
|
|
173
|
+
변형의 색은 Chakra 아코디언 레시피에서 옵니다. 이 라이브러리는 초점 링과 등장
|
|
174
|
+
시간(`theme/recipes/accordion.ts`)만 더합니다.
|
|
175
|
+
|
|
176
|
+
</Ko>
|
|
177
|
+
|
|
178
|
+
<Canvas of={AccordionStories.UsageTokens} sourceState="none" />
|
|
179
|
+
|
|
180
|
+
<En>
|
|
181
|
+
|
|
182
|
+
## Related
|
|
183
|
+
|
|
184
|
+
- **Collapsible**: a single section that opens.
|
|
185
|
+
- **Tabs**: switch between views.
|
|
186
|
+
- **ExpandableText**: clip one block of text.
|
|
187
|
+
- **Tree**: a hierarchy to select from.
|
|
188
|
+
|
|
189
|
+
</En>
|
|
190
|
+
|
|
191
|
+
<Ko>
|
|
192
|
+
|
|
193
|
+
## 관련 컴포넌트
|
|
194
|
+
|
|
195
|
+
- **Collapsible**: 여닫는 섹션 하나.
|
|
196
|
+
- **Tabs**: 보기 전환.
|
|
197
|
+
- **ExpandableText**: 글 한 덩어리를 접어 둘 때.
|
|
198
|
+
- **Tree**: 고르는 계층.
|
|
199
|
+
|
|
200
|
+
</Ko>
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { ArgTypes, Canvas, Meta } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import { En, Ko, LangToggle } from '../../guidelines/_components/Lang';
|
|
4
|
+
import * as AppearStories from './Appear.stories';
|
|
5
|
+
|
|
6
|
+
<Meta of={AppearStories} name="Usage" />
|
|
7
|
+
|
|
8
|
+
<LangToggle />
|
|
9
|
+
|
|
10
|
+
<En>
|
|
11
|
+
|
|
12
|
+
# Appear
|
|
13
|
+
|
|
14
|
+
Brings a single element in once, on mount: a fade, plus an optional scale (a
|
|
15
|
+
stamp landing) or a short rise (content arriving).
|
|
16
|
+
|
|
17
|
+
</En>
|
|
18
|
+
|
|
19
|
+
<Ko>
|
|
20
|
+
|
|
21
|
+
# Appear
|
|
22
|
+
|
|
23
|
+
요소 하나를 마운트될 때 한 번 등장시킵니다. 기본은 페이드이고, 도장이 찍히듯 커지는
|
|
24
|
+
효과나 아래에서 올라오는 효과를 더할 수 있습니다.
|
|
25
|
+
|
|
26
|
+
</Ko>
|
|
27
|
+
|
|
28
|
+
<Canvas of={AppearStories.Default} />
|
|
29
|
+
|
|
30
|
+
<En>
|
|
31
|
+
|
|
32
|
+
## When to use
|
|
33
|
+
|
|
34
|
+
- A mark that lands on something the reader just did: a ✓ on a correct
|
|
35
|
+
answer, a reward medallion (`scaleFrom`).
|
|
36
|
+
- A line or card that arrives on its own schedule, such as the beats of a
|
|
37
|
+
level-up screen, each with its own `delayMs` (`rise`).
|
|
38
|
+
|
|
39
|
+
## When not to use
|
|
40
|
+
|
|
41
|
+
- The element can also close (a menu, popover or modal) →
|
|
42
|
+
`animationStyle="presence"`, which those parts already use. Appear cannot
|
|
43
|
+
animate out.
|
|
44
|
+
- Several items of one list arrive together → `staggerProps(index)`.
|
|
45
|
+
- The content opens underneath something and pushes the layout down →
|
|
46
|
+
`Reveal`.
|
|
47
|
+
- One piece of content replaces another → `SwapTransition`.
|
|
48
|
+
- A value that is already on screen changed → `Pulse` or `CountUp`.
|
|
49
|
+
|
|
50
|
+
The **어느 것을 쓸까** story plays `presence`, `stagger` and Appear side by side.
|
|
51
|
+
|
|
52
|
+
## Reduced motion and accessibility
|
|
53
|
+
|
|
54
|
+
- With `prefers-reduced-motion: reduce` the fade stays and the scale and rise
|
|
55
|
+
are dropped. The element still has to become visible; the movement carries no
|
|
56
|
+
information.
|
|
57
|
+
- Appear adds one `div` around `children`, and layout props land on that
|
|
58
|
+
wrapper. Inside a `<button>` pass `as="span"`, because a button may only hold
|
|
59
|
+
phrasing content (ACCESSIBILITY.md §5). Where the parent needs its children
|
|
60
|
+
directly (a `<tr>`, Ark parts such as `Menu.List`), animate the inner element
|
|
61
|
+
instead of wrapping.
|
|
62
|
+
- Appearing does not announce anything. If the new element is a result the
|
|
63
|
+
reader has to hear, put the message in a live region yourself
|
|
64
|
+
(WCAG 4.1.3).
|
|
65
|
+
|
|
66
|
+
## Props
|
|
67
|
+
|
|
68
|
+
</En>
|
|
69
|
+
|
|
70
|
+
<Ko>
|
|
71
|
+
|
|
72
|
+
## 언제 쓰나요
|
|
73
|
+
|
|
74
|
+
- 사용자가 방금 한 일 위에 표시가 찍힐 때: 정답 위의 ✓, 보상 메달(`scaleFrom`).
|
|
75
|
+
- 한 줄이나 카드가 각자 정한 시점에 들어올 때. 예를 들어 레벨 업 화면의 문구들은 저마다
|
|
76
|
+
다른 `delayMs`로 들어옵니다(`rise`).
|
|
77
|
+
|
|
78
|
+
## 언제 쓰지 않나요
|
|
79
|
+
|
|
80
|
+
- 요소가 닫히기도 한다면(메뉴, 팝오버, 모달) `animationStyle="presence"`를 씁니다. 이
|
|
81
|
+
파트들은 이미 presence를 씁니다. Appear는 사라지는 애니메이션이 없습니다.
|
|
82
|
+
- 한 목록의 항목 여럿이 함께 들어온다면 `staggerProps(index)`를 씁니다.
|
|
83
|
+
- 내용이 무언가의 아래에서 열리며 레이아웃을 밀어낸다면 `Reveal`을 씁니다.
|
|
84
|
+
- 한 내용이 다른 내용으로 바뀐다면 `SwapTransition`을 씁니다.
|
|
85
|
+
- 이미 화면에 있는 값이 바뀌었다면 `Pulse`나 `CountUp`을 씁니다.
|
|
86
|
+
|
|
87
|
+
**어느 것을 쓸까** 스토리에서 `presence`, `stagger`, Appear를 나란히 재생해 볼 수 있습니다.
|
|
88
|
+
|
|
89
|
+
## 동작 줄이기와 접근성
|
|
90
|
+
|
|
91
|
+
- `prefers-reduced-motion: reduce`에서는 페이드만 남고 커지는 효과와 올라오는 효과는
|
|
92
|
+
빠집니다. 요소는 여전히 나타나야 하지만, 움직임 자체는 정보가 아니기 때문입니다.
|
|
93
|
+
- Appear는 `children` 바깥에 `div`를 하나 더하고, 레이아웃 속성은 그 감싸는 요소에
|
|
94
|
+
적용됩니다. `<button>` 안에서는 `as="span"`을 넘깁니다. 버튼 안에는 phrasing
|
|
95
|
+
content만 들어갈 수 있습니다(ACCESSIBILITY.md 5절). 부모가 자식을 직접 다뤄야 하는
|
|
96
|
+
곳(`<tr>`, `Menu.List` 같은 Ark 파트)에서는 감싸지 말고 안쪽 요소에 애니메이션을 줍니다.
|
|
97
|
+
- 나타난다고 해서 무언가를 읽어 주지는 않습니다. 사용자가 들어야 하는 결과라면 그
|
|
98
|
+
메시지를 직접 라이브 영역에 넣습니다(WCAG 4.1.3).
|
|
99
|
+
|
|
100
|
+
## 속성
|
|
101
|
+
|
|
102
|
+
</Ko>
|
|
103
|
+
|
|
104
|
+
<ArgTypes
|
|
105
|
+
of={AppearStories}
|
|
106
|
+
include={['scaleFrom', 'rise', 'delayMs', 'durationMs']}
|
|
107
|
+
/>
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { ChakraProvider } from '@chakra-ui/react';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { describe, expect, it } from 'vitest';
|
|
4
|
+
|
|
5
|
+
import { system } from '../../theme';
|
|
6
|
+
import { Avatar, avatarColorPalette, hueForName } from '.';
|
|
7
|
+
|
|
8
|
+
const wrap = (ui: React.ReactNode) =>
|
|
9
|
+
render(<ChakraProvider value={system}>{ui}</ChakraProvider>);
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The rules emotion emitted for `el`'s own `css-*` class, one per line. jsdom
|
|
13
|
+
* cannot compute styles inside Chakra's `@layer` blocks, so the tests read the
|
|
14
|
+
* generated rules instead of `getComputedStyle`.
|
|
15
|
+
*/
|
|
16
|
+
function rulesFor(el: Element | null): string[] {
|
|
17
|
+
if (!el) throw new Error('element not rendered');
|
|
18
|
+
const cls = [...el.classList].find((c) => c.startsWith('css-'));
|
|
19
|
+
return [...document.querySelectorAll('style')]
|
|
20
|
+
.flatMap((s) => (s.textContent ?? '').split('\n'))
|
|
21
|
+
.filter((line) => line.includes(`.${cls}{`));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Every declaration for `el`, layered or not, as one string. */
|
|
25
|
+
const declarations = (el: Element | null) => rulesFor(el).join('');
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Only the rules outside any `@layer` (style props such as `colorPalette`) —
|
|
29
|
+
* these beat the recipe's `@layer recipes` rules.
|
|
30
|
+
*/
|
|
31
|
+
const unlayered = (el: Element | null) =>
|
|
32
|
+
rulesFor(el)
|
|
33
|
+
.filter((line) => !line.startsWith('@layer'))
|
|
34
|
+
.join('');
|
|
35
|
+
|
|
36
|
+
const root = (c: HTMLElement) => c.querySelector('[data-part="root"]');
|
|
37
|
+
const fallback = (c: HTMLElement) => c.querySelector('[data-part="fallback"]');
|
|
38
|
+
|
|
39
|
+
describe('avatar recipe', () => {
|
|
40
|
+
it('the fallback fills the root and the root carries the fill', () => {
|
|
41
|
+
const { container } = wrap(<Avatar name="Sean Park" />);
|
|
42
|
+
const r = declarations(root(container));
|
|
43
|
+
const f = declarations(fallback(container));
|
|
44
|
+
// The regression: Chakra sizes only the root, so a fill on an unsized
|
|
45
|
+
// fallback covered just the glyph box.
|
|
46
|
+
expect(f).toContain('width:100%');
|
|
47
|
+
expect(f).toContain('height:100%');
|
|
48
|
+
expect(f).toContain('justify-content:center');
|
|
49
|
+
expect(f).not.toMatch(/background:/);
|
|
50
|
+
expect(r).toContain(
|
|
51
|
+
'background:var(--chakra-colors-color-palette-surface,'
|
|
52
|
+
);
|
|
53
|
+
expect(r).toContain('color:var(--chakra-colors-color-palette-fg)');
|
|
54
|
+
expect(r).toContain('border-width:1px');
|
|
55
|
+
expect(r).toContain('overflow:hidden');
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it('maps colorPalette onto the person’s category pair', () => {
|
|
59
|
+
const hue = hueForName('Sean Park');
|
|
60
|
+
const { container } = wrap(<Avatar name="Sean Park" />);
|
|
61
|
+
// Unlayered, so it wins over the recipe's own `category.neutral` default.
|
|
62
|
+
expect(unlayered(root(container))).toContain(
|
|
63
|
+
`--chakra-colors-color-palette-surface:var(--chakra-colors-category-${hue}-surface)`
|
|
64
|
+
);
|
|
65
|
+
expect(avatarColorPalette('Sean Park')).toBe(`category.${hue}`);
|
|
66
|
+
expect(avatarColorPalette('Sean Park', 'blue')).toBe('category.blue');
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it('a nameless avatar — and a bare Avatar.Root — use the neutral pair', () => {
|
|
70
|
+
expect(avatarColorPalette(undefined)).toBe('category.neutral');
|
|
71
|
+
for (const ui of [
|
|
72
|
+
<Avatar key="a" />,
|
|
73
|
+
<Avatar.Root key="b">
|
|
74
|
+
<Avatar.Fallback name="Bare Root" />
|
|
75
|
+
</Avatar.Root>,
|
|
76
|
+
]) {
|
|
77
|
+
const { container, unmount } = wrap(ui);
|
|
78
|
+
const r = declarations(root(container));
|
|
79
|
+
expect(r).toContain(
|
|
80
|
+
'--chakra-colors-color-palette-surface:var(--chakra-colors-category-neutral-surface)'
|
|
81
|
+
);
|
|
82
|
+
expect(declarations(fallback(container))).toContain('width:100%');
|
|
83
|
+
unmount();
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it('variant="logo" paints the light logo tile, not the palette', () => {
|
|
88
|
+
const { container } = wrap(<Avatar name="GPT" variant="logo" />);
|
|
89
|
+
const r = declarations(root(container));
|
|
90
|
+
expect(r).toContain('background:var(--chakra-colors-bg-logo)');
|
|
91
|
+
expect(r).toContain('color:var(--chakra-colors-fg-on-logo)');
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it('a Chakra palette without `surface` still fills (falls back to `muted`)', () => {
|
|
95
|
+
const { container } = wrap(<Avatar name="X" colorPalette="blue" />);
|
|
96
|
+
expect(declarations(root(container))).toMatch(
|
|
97
|
+
/background:var\(--chakra-colors-color-palette-surface, ?var\(--chakra-colors-color-palette-muted\)\)/
|
|
98
|
+
);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
it('solid / outline fall back onto the category pair', () => {
|
|
102
|
+
const solid = wrap(<Avatar name="X" variant="solid" />);
|
|
103
|
+
expect(declarations(root(solid.container))).toMatch(
|
|
104
|
+
/background:var\(--chakra-colors-color-palette-solid, ?var\(--chakra-colors-color-palette-fg\)\)/
|
|
105
|
+
);
|
|
106
|
+
solid.unmount();
|
|
107
|
+
const outline = wrap(<Avatar name="X" variant="outline" />);
|
|
108
|
+
expect(declarations(root(outline.container))).toMatch(
|
|
109
|
+
/border-color:var\(--chakra-colors-color-palette-border, ?var\(--chakra-colors-color-palette-fg\)\)/
|
|
110
|
+
);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it('keeps Chakra’s size variants', () => {
|
|
114
|
+
const { container } = wrap(<Avatar name="A" size="2xl" />);
|
|
115
|
+
expect(declarations(root(container))).toContain(
|
|
116
|
+
'--avatar-size:var(--chakra-sizes-16)'
|
|
117
|
+
);
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
describe('Avatar.Group max', () => {
|
|
122
|
+
const names = ['김지민', '이서준', '박하은', '최유나', '정민호'];
|
|
123
|
+
|
|
124
|
+
it('shows max avatars plus a neutral "+N" counter', () => {
|
|
125
|
+
const { container } = wrap(
|
|
126
|
+
<Avatar.Group max={3}>
|
|
127
|
+
{names.map((n) => (
|
|
128
|
+
<Avatar key={n} name={n} />
|
|
129
|
+
))}
|
|
130
|
+
</Avatar.Group>
|
|
131
|
+
);
|
|
132
|
+
const roots = container.querySelectorAll('[data-part="root"]');
|
|
133
|
+
expect(roots).toHaveLength(4);
|
|
134
|
+
const counter = roots[3];
|
|
135
|
+
expect(counter.textContent).toBe('+2');
|
|
136
|
+
// Phrasing content, so `<Avatar.Group as="span">` can sit in a button.
|
|
137
|
+
expect(counter.tagName).toBe('SPAN');
|
|
138
|
+
expect(counter.querySelector('[data-part="fallback"]')?.tagName).toBe(
|
|
139
|
+
'SPAN'
|
|
140
|
+
);
|
|
141
|
+
expect(declarations(counter)).toContain(
|
|
142
|
+
'--chakra-colors-color-palette-surface:var(--chakra-colors-category-neutral-surface)'
|
|
143
|
+
);
|
|
144
|
+
expect(declarations(counter)).toContain(
|
|
145
|
+
'background:var(--chakra-colors-color-palette-surface,'
|
|
146
|
+
);
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
it('the counter stays neutral in a logo group', () => {
|
|
150
|
+
const { container } = wrap(
|
|
151
|
+
<Avatar.Group max={1} variant="logo">
|
|
152
|
+
<Avatar name="A" />
|
|
153
|
+
<Avatar name="B" />
|
|
154
|
+
</Avatar.Group>
|
|
155
|
+
);
|
|
156
|
+
const roots = container.querySelectorAll('[data-part="root"]');
|
|
157
|
+
expect(declarations(roots[0])).toContain('var(--chakra-colors-bg-logo)');
|
|
158
|
+
expect(declarations(roots[1])).not.toContain('bg-logo');
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
it('no max, or max ≥ count, renders every avatar and no counter', () => {
|
|
162
|
+
for (const max of [undefined, 5, 9]) {
|
|
163
|
+
const { container, unmount } = wrap(
|
|
164
|
+
<Avatar.Group max={max}>
|
|
165
|
+
{names.map((n) => (
|
|
166
|
+
<Avatar key={n} name={n} />
|
|
167
|
+
))}
|
|
168
|
+
</Avatar.Group>
|
|
169
|
+
);
|
|
170
|
+
const roots = container.querySelectorAll('[data-part="root"]');
|
|
171
|
+
expect(roots).toHaveLength(5);
|
|
172
|
+
expect(container.textContent).not.toContain('+');
|
|
173
|
+
unmount();
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
});
|