@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,275 @@
|
|
|
1
|
+
import { ArgTypes, Canvas, Meta } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import { En, Ko, LangToggle, Verdict } from '../../guidelines/_components/Lang';
|
|
4
|
+
import * as IconButtonStories from './IconButton.stories';
|
|
5
|
+
|
|
6
|
+
<Meta of={IconButtonStories} name="Usage" />
|
|
7
|
+
|
|
8
|
+
<LangToggle />
|
|
9
|
+
|
|
10
|
+
<En>
|
|
11
|
+
|
|
12
|
+
# IconButton
|
|
13
|
+
|
|
14
|
+
A round button with an icon and no visible label, for actions so common that
|
|
15
|
+
the icon alone is enough: close, copy, edit, delete, send.
|
|
16
|
+
|
|
17
|
+
## When to use
|
|
18
|
+
|
|
19
|
+
- Toolbars and per-item actions where a row of labels would crowd the
|
|
20
|
+
content: the copy, edit and share actions under a chat message, the delete
|
|
21
|
+
icon on a list row.
|
|
22
|
+
- Close and back in dialogs, drawers and panels.
|
|
23
|
+
- The send button of a chat composer (`variant="action"`).
|
|
24
|
+
|
|
25
|
+
## When not to use
|
|
26
|
+
|
|
27
|
+
- The icon is not universally understood, or the action is rare or
|
|
28
|
+
destructive enough that the user should read it → `Button` with an icon and
|
|
29
|
+
a label.
|
|
30
|
+
- Opening a menu of more actions on its own → wrap the IconButton in
|
|
31
|
+
`Menu.Trigger asChild`, so the menu supplies the popup ARIA.
|
|
32
|
+
- A setting that stays on or off → `Switch`.
|
|
33
|
+
- "Load more" at the end of a list → `SeeMoreButton`.
|
|
34
|
+
|
|
35
|
+
## Variants and what they mean
|
|
36
|
+
|
|
37
|
+
</En>
|
|
38
|
+
|
|
39
|
+
<Ko>
|
|
40
|
+
|
|
41
|
+
# IconButton
|
|
42
|
+
|
|
43
|
+
글자 없이 아이콘만 있는 둥근 버튼입니다. 닫기, 복사, 수정, 삭제, 보내기처럼 아이콘만
|
|
44
|
+
봐도 알 만큼 흔한 동작에 씁니다.
|
|
45
|
+
|
|
46
|
+
## 언제 쓰나요
|
|
47
|
+
|
|
48
|
+
- 라벨을 늘어놓으면 내용이 답답해지는 툴바와 항목별 동작: 채팅 메시지 아래의 복사,
|
|
49
|
+
수정, 공유, 목록 행의 삭제 아이콘.
|
|
50
|
+
- 대화상자, 서랍, 패널의 닫기와 뒤로 가기.
|
|
51
|
+
- 채팅 입력창의 보내기 버튼(`variant="action"`).
|
|
52
|
+
|
|
53
|
+
## 언제 쓰지 않나요
|
|
54
|
+
|
|
55
|
+
- 누구나 아는 아이콘이 아니거나, 드물게 쓰거나, 사용자가 글로 읽어야 할 만큼 위험한
|
|
56
|
+
동작이라면 아이콘과 라벨을 함께 넣은 `Button`을 씁니다.
|
|
57
|
+
- 더 많은 동작을 담은 메뉴를 IconButton 혼자 열게 하지 않습니다. `Menu.Trigger asChild`로
|
|
58
|
+
감싸 메뉴가 팝업 ARIA를 붙이게 합니다.
|
|
59
|
+
- 켜짐과 꺼짐이 유지되는 설정이라면 `Switch`를 씁니다.
|
|
60
|
+
- 목록 끝의 "더보기"라면 `SeeMoreButton`을 씁니다.
|
|
61
|
+
|
|
62
|
+
## 변형과 뜻
|
|
63
|
+
|
|
64
|
+
</Ko>
|
|
65
|
+
|
|
66
|
+
<ArgTypes of={IconButtonStories} include={['variant', 'isDestructive']} />
|
|
67
|
+
|
|
68
|
+
<En>
|
|
69
|
+
|
|
70
|
+
| Variant | Means | Use for |
|
|
71
|
+
| --- | --- | --- |
|
|
72
|
+
| `ghost` (default) | A routine action next to content. Glyph `fg.icon`, darkens on hover | 닫기, 복사, 수정, 뒤로 가기 |
|
|
73
|
+
| `secondary` | Ghost with an outline, so it reads as a button on its own | 이전 / 다음, 일시정지, 수정 취소 |
|
|
74
|
+
| `primary` | The one main icon action of its area. Black fill | 재생, 수정 저장 (check icon) |
|
|
75
|
+
| `danger` | Confirms a destructive step. Red fill | Rare; prefer `ghost` + `isDestructive` |
|
|
76
|
+
| `action` | Send. Coral fill, dark arrow | The chat composer's 보내기, nothing else |
|
|
77
|
+
|
|
78
|
+
`isDestructive` turns the glyph `danger.fg` on `ghost` and `secondary`; it is
|
|
79
|
+
ignored on the filled roles.
|
|
80
|
+
|
|
81
|
+
In FactChat, `ghost` makes up most IconButtons; `secondary` is used about a
|
|
82
|
+
fifth as often, and the filled roles are rare. Start from `ghost`.
|
|
83
|
+
|
|
84
|
+
## Do / Don't
|
|
85
|
+
|
|
86
|
+
</En>
|
|
87
|
+
|
|
88
|
+
<Ko>
|
|
89
|
+
|
|
90
|
+
| 변형 | 뜻 | 예 |
|
|
91
|
+
| --- | --- | --- |
|
|
92
|
+
| `ghost` (기본) | 내용 옆의 일상적인 동작. 아이콘은 `fg.icon`이며 마우스를 올리면 진해짐 | 닫기, 복사, 수정, 뒤로 가기 |
|
|
93
|
+
| `secondary` | 테두리가 있는 ghost. 혼자 있어도 버튼으로 보임 | 이전 / 다음, 일시정지, 수정 취소 |
|
|
94
|
+
| `primary` | 그 영역의 주 아이콘 동작 하나. 검정 바탕 | 재생, 수정 저장(체크 아이콘) |
|
|
95
|
+
| `danger` | 되돌릴 수 없는 단계를 확정. 빨간 바탕 | 드물게 씀. 보통은 `ghost` + `isDestructive` |
|
|
96
|
+
| `action` | 보내기. 코랄 바탕에 어두운 화살표 | 채팅 입력창의 보내기에만 씀 |
|
|
97
|
+
|
|
98
|
+
`isDestructive`는 `ghost`와 `secondary`의 아이콘을 `danger.fg`로 바꿉니다. 바탕이
|
|
99
|
+
있는 변형에서는 무시됩니다.
|
|
100
|
+
|
|
101
|
+
FactChat에서는 IconButton 대부분이 `ghost`이고, `secondary`는 그 5분의 1 정도이며,
|
|
102
|
+
바탕이 있는 변형은 드뭅니다. `ghost`에서 시작합니다.
|
|
103
|
+
|
|
104
|
+
## 이렇게 하세요 / 이렇게 하지 마세요
|
|
105
|
+
|
|
106
|
+
</Ko>
|
|
107
|
+
|
|
108
|
+
<Canvas of={IconButtonStories.DoGhostToolbar} />
|
|
109
|
+
<Verdict
|
|
110
|
+
kind="do"
|
|
111
|
+
en="Use ghost icon buttons in a toolbar, each with an aria-label and a tooltip that says the same thing. Mark delete with isDestructive."
|
|
112
|
+
ko="툴바에는 ghost 아이콘 버튼을 쓰고, 버튼마다 aria-label과 같은 말을 담은 툴팁을 붙입니다. 삭제에는 isDestructive를 붙입니다."
|
|
113
|
+
/>
|
|
114
|
+
|
|
115
|
+
<Canvas of={IconButtonStories.DontFilledToolbar} />
|
|
116
|
+
<Verdict
|
|
117
|
+
kind="dont"
|
|
118
|
+
en="Fill every icon in a toolbar. Four black and red circles compete with the content they act on, and none of them is the main action."
|
|
119
|
+
ko="툴바의 아이콘마다 바탕을 채우지 마세요. 검정과 빨강 원 네 개가 정작 내용보다 눈에 띄고, 그중 어느 것도 주 행동이 아닙니다."
|
|
120
|
+
/>
|
|
121
|
+
|
|
122
|
+
<Canvas of={IconButtonStories.DoActionForSend} />
|
|
123
|
+
<Verdict
|
|
124
|
+
kind="do"
|
|
125
|
+
en="Keep the coral action variant for send. It is the screen's one run signal; the attach button next to it stays ghost."
|
|
126
|
+
ko="코랄 action 변형은 보내기에만 씁니다. 화면의 유일한 실행 신호이며, 옆의 첨부 버튼은 ghost로 둡니다."
|
|
127
|
+
/>
|
|
128
|
+
|
|
129
|
+
<Canvas of={IconButtonStories.DontActionForAdd} />
|
|
130
|
+
<Verdict
|
|
131
|
+
kind="dont"
|
|
132
|
+
en="Use the coral action button for add, settings or anything else. Coral means send or run; on any other action it reads as a second run signal."
|
|
133
|
+
ko="추가, 설정 같은 다른 동작에 코랄 action 버튼을 쓰지 마세요. 코랄은 보내기와 실행을 뜻하므로, 다른 동작에 쓰면 실행 신호가 두 개로 보입니다."
|
|
134
|
+
/>
|
|
135
|
+
|
|
136
|
+
<Canvas of={IconButtonStories.DoTextWhenUnclear} />
|
|
137
|
+
<Verdict
|
|
138
|
+
kind="do"
|
|
139
|
+
en="When the icon would need explaining, use a Button with an icon and a label."
|
|
140
|
+
ko="아이콘에 설명이 필요하다면 아이콘과 라벨을 함께 넣은 Button을 씁니다."
|
|
141
|
+
/>
|
|
142
|
+
|
|
143
|
+
<Canvas of={IconButtonStories.DontUnclearIcon} />
|
|
144
|
+
<Verdict
|
|
145
|
+
kind="dont"
|
|
146
|
+
en="Rely on an icon only its designer can read. The aria-label helps screen readers, but sighted users still have to guess."
|
|
147
|
+
ko="만든 사람만 알아보는 아이콘에 기대지 마세요. aria-label은 화면 낭독기 사용자에게만 도움이 되고, 화면을 보는 사용자는 여전히 짐작해야 합니다."
|
|
148
|
+
/>
|
|
149
|
+
|
|
150
|
+
<En>
|
|
151
|
+
|
|
152
|
+
## Content
|
|
153
|
+
|
|
154
|
+
IconButton has no visible text, so its content is the `aria-label` and the
|
|
155
|
+
tooltip.
|
|
156
|
+
|
|
157
|
+
- Name the action, not the icon: 삭제, not 휴지통; 보내기, not 화살표.
|
|
158
|
+
- Add the object when the row alone does not make it clear: 멤버 삭제,
|
|
159
|
+
파일 내려받기.
|
|
160
|
+
- Use the same word as the tooltip and as any Button for the same action
|
|
161
|
+
elsewhere in the flow.
|
|
162
|
+
- Sentence case in English ("Copy link"). No full stop.
|
|
163
|
+
|
|
164
|
+
## Accessibility
|
|
165
|
+
|
|
166
|
+
What IconButton does for you:
|
|
167
|
+
|
|
168
|
+
- It renders a native `<button>`, so Tab reaches it and Enter and Space
|
|
169
|
+
activate it (WCAG 2.1.1).
|
|
170
|
+
- A keyboard focus ring (`focus.ring` with a canvas-coloured inner band) on
|
|
171
|
+
`:focus-visible` only (WCAG 2.4.7).
|
|
172
|
+
- The resting glyph on `ghost` and `secondary` is `fg.icon`, chosen for 3:1
|
|
173
|
+
against the surface as a non-text graphic (WCAG 1.4.11).
|
|
174
|
+
- Disabled is a fixed colour pair, not opacity, and does not react to hover or
|
|
175
|
+
press. `ghost` has no fill to grey out, so its disabled glyph is the lighter
|
|
176
|
+
`disabled.fgGhost` — `disabled.fg` sat too close to the resting `fg.icon`.
|
|
177
|
+
|
|
178
|
+
What you still have to do:
|
|
179
|
+
|
|
180
|
+
- **Always pass `aria-label`.** The type does not require it, and without it
|
|
181
|
+
the button has no accessible name (WCAG 4.1.2; axe `button-name`, KWCAG
|
|
182
|
+
5.3.4.1 in ACCESSIBILITY.md §1). Pass it on the first render, not after
|
|
183
|
+
hydration.
|
|
184
|
+
- **A tooltip is not the name.** Give the tooltip the same words as the
|
|
185
|
+
`aria-label`, so what a sighted user sees and what a speech-input user says
|
|
186
|
+
match (WCAG 2.5.3).
|
|
187
|
+
- **Hide nothing behind colour.** `isDestructive` and `danger` colour the
|
|
188
|
+
glyph; the label (삭제) is what carries the meaning (WCAG 1.4.1).
|
|
189
|
+
- **No IconButton inside another control** (ACCESSIBILITY.md §3, axe
|
|
190
|
+
`nested-interactive`). A delete icon on a clickable card goes next to the
|
|
191
|
+
card's link, not inside it.
|
|
192
|
+
- **Say why it is disabled.** A disabled send button (nothing typed yet) is
|
|
193
|
+
skipped by Tab; the empty input already explains it. Elsewhere, explain in
|
|
194
|
+
text.
|
|
195
|
+
|
|
196
|
+
## Tokens
|
|
197
|
+
|
|
198
|
+
The table is generated from `IconButton.styles.ts` and the theme.
|
|
199
|
+
`transparent` fills and borders are left out. `primary` and `danger` reuse
|
|
200
|
+
Button's styles.
|
|
201
|
+
|
|
202
|
+
</En>
|
|
203
|
+
|
|
204
|
+
<Ko>
|
|
205
|
+
|
|
206
|
+
## 문구
|
|
207
|
+
|
|
208
|
+
IconButton에는 보이는 글자가 없으므로 문구는 `aria-label`과 툴팁입니다.
|
|
209
|
+
|
|
210
|
+
- 아이콘이 아니라 동작을 적습니다. "휴지통"이 아니라 "삭제", "화살표"가 아니라
|
|
211
|
+
"보내기"입니다.
|
|
212
|
+
- 행만 보고는 대상이 분명하지 않다면 대상을 붙입니다: 멤버 삭제, 파일 내려받기.
|
|
213
|
+
- 툴팁, 그리고 같은 흐름에서 같은 동작을 하는 Button과 같은 말을 씁니다.
|
|
214
|
+
- 영어는 문장형 대소문자를 쓰고("Copy link") 마침표를 찍지 않습니다.
|
|
215
|
+
|
|
216
|
+
## 접근성
|
|
217
|
+
|
|
218
|
+
IconButton이 알아서 하는 일
|
|
219
|
+
|
|
220
|
+
- 기본 `<button>`으로 렌더하므로 Tab으로 이동하고 Enter와 Space로 실행합니다(WCAG
|
|
221
|
+
2.1.1).
|
|
222
|
+
- 키보드 초점에만(`:focus-visible`) 초점 링을 그립니다. `focus.ring`에 바탕색 안쪽
|
|
223
|
+
띠를 더한 모양입니다(WCAG 2.4.7).
|
|
224
|
+
- `ghost`와 `secondary`의 평소 아이콘 색은 `fg.icon`입니다. 글자가 아닌 그래픽으로서
|
|
225
|
+
바탕과 3:1 대비를 맞춘 값입니다(WCAG 1.4.11).
|
|
226
|
+
- 비활성 상태는 투명도가 아니라 고정된 색 한 쌍이며, 마우스를 올리거나 눌러도 변하지
|
|
227
|
+
않습니다. `ghost`는 회색으로 바꿀 바탕이 없어서 비활성 아이콘을 더 옅은
|
|
228
|
+
`disabled.fgGhost`로 칠합니다. `disabled.fg`는 평소 아이콘 색 `fg.icon`과 거의 같아 보였습니다.
|
|
229
|
+
|
|
230
|
+
직접 챙겨야 하는 일
|
|
231
|
+
|
|
232
|
+
- **`aria-label`을 반드시 줍니다.** 타입이 강제하지 않으며, 빠뜨리면 버튼에 접근 가능한
|
|
233
|
+
이름이 없습니다(WCAG 4.1.2, axe `button-name`, ACCESSIBILITY.md 1절의 KWCAG
|
|
234
|
+
5.3.4.1). 하이드레이션 이후가 아니라 첫 렌더부터 줍니다.
|
|
235
|
+
- **툴팁은 이름이 아닙니다.** 툴팁에 `aria-label`과 같은 말을 넣어, 눈으로 보는 말과
|
|
236
|
+
음성으로 부르는 말이 같게 합니다(WCAG 2.5.3).
|
|
237
|
+
- **색에 뜻을 숨기지 않습니다.** `isDestructive`와 `danger`는 아이콘 색만 바꾸고, 뜻은
|
|
238
|
+
"삭제" 같은 라벨이 전합니다(WCAG 1.4.1).
|
|
239
|
+
- **컨트롤 안에 IconButton을 넣지 않습니다**(ACCESSIBILITY.md 3절, axe
|
|
240
|
+
`nested-interactive`). 누를 수 있는 카드의 삭제 아이콘은 카드 링크 안이 아니라
|
|
241
|
+
옆에 둡니다.
|
|
242
|
+
- **왜 비활성인지 알립니다.** 아직 아무것도 입력하지 않아 비활성인 보내기 버튼은 Tab이
|
|
243
|
+
건너뛰지만, 빈 입력창이 이유를 보여 줍니다. 다른 자리에서는 글로 이유를 적습니다.
|
|
244
|
+
|
|
245
|
+
## 토큰
|
|
246
|
+
|
|
247
|
+
아래 표는 `IconButton.styles.ts`와 테마에서 자동으로 만듭니다. `transparent`인
|
|
248
|
+
바탕과 테두리는 뺐습니다. `primary`와 `danger`는 Button의 스타일을 그대로 씁니다.
|
|
249
|
+
|
|
250
|
+
</Ko>
|
|
251
|
+
|
|
252
|
+
<Canvas of={IconButtonStories.UsageTokens} sourceState="none" />
|
|
253
|
+
|
|
254
|
+
<En>
|
|
255
|
+
|
|
256
|
+
## Related
|
|
257
|
+
|
|
258
|
+
- **Button**: the same roles with a visible label.
|
|
259
|
+
- **Tooltip**: the visible name of an IconButton.
|
|
260
|
+
- **Menu**: an icon that opens more actions.
|
|
261
|
+
- **Foundations/Brand & colour usage**: why the send button is the one coral
|
|
262
|
+
fill.
|
|
263
|
+
|
|
264
|
+
</En>
|
|
265
|
+
|
|
266
|
+
<Ko>
|
|
267
|
+
|
|
268
|
+
## 관련 컴포넌트
|
|
269
|
+
|
|
270
|
+
- **Button**: 보이는 라벨이 있는 버튼. 역할은 같습니다.
|
|
271
|
+
- **Tooltip**: IconButton의 이름을 눈에 보이게 하는 도구.
|
|
272
|
+
- **Menu**: 더 많은 동작을 여는 아이콘.
|
|
273
|
+
- **Foundations/Brand & colour usage**: 보내기 버튼만 코랄 바탕인 이유.
|
|
274
|
+
|
|
275
|
+
</Ko>
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { Box, HStack, VStack } from '@chakra-ui/react';
|
|
2
2
|
import { Meta, StoryObj } from '@storybook/react';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { T } from '../../guidelines/_components/Lang';
|
|
5
|
+
import { TokenTable } from '../../guidelines/_components/TokenTable';
|
|
6
|
+
import { Card } from '../Card';
|
|
7
|
+
import { Input } from '../Input';
|
|
8
|
+
import { Subtext, Subtitle, Text } from '../Typography';
|
|
5
9
|
import { InfoSprinkle } from './InfoSprinkle';
|
|
6
10
|
|
|
7
11
|
const meta = {
|
|
@@ -39,3 +43,75 @@ export const LargerBaseFontSize: Story = {
|
|
|
39
43
|
baseFontSize: '18px',
|
|
40
44
|
},
|
|
41
45
|
};
|
|
46
|
+
|
|
47
|
+
// ───────────────────────── Usage-page specimens ─────────────────────────
|
|
48
|
+
// Pulled into `InfoSprinkle.usage.mdx` with <Canvas of={…} />. Hidden from the
|
|
49
|
+
// sidebar (`!dev`). Each card is held open (`open`) so the page shows it
|
|
50
|
+
// without a hover.
|
|
51
|
+
|
|
52
|
+
export const DoDefineALabel: Story = {
|
|
53
|
+
tags: ['!dev'],
|
|
54
|
+
parameters: { layout: 'padded' },
|
|
55
|
+
name: 'Usage / Do: define the label next to it',
|
|
56
|
+
render: () => (
|
|
57
|
+
<Box pt="96px" px={16}>
|
|
58
|
+
<Card p={4} w="240px">
|
|
59
|
+
<HStack gap={1}>
|
|
60
|
+
<Subtext>활성 멤버</Subtext>
|
|
61
|
+
<InfoSprinkle
|
|
62
|
+
open
|
|
63
|
+
iconButtonProps={{ size: 'xs', 'aria-label': '활성 멤버 설명' }}
|
|
64
|
+
>
|
|
65
|
+
<Text maxW="220px">
|
|
66
|
+
최근 30일 동안 한 번 이상 대화한 멤버 수입니다.
|
|
67
|
+
</Text>
|
|
68
|
+
</InfoSprinkle>
|
|
69
|
+
</HStack>
|
|
70
|
+
<Text fontWeight="bold" fontSize="lg">
|
|
71
|
+
128
|
|
72
|
+
</Text>
|
|
73
|
+
</Card>
|
|
74
|
+
</Box>
|
|
75
|
+
),
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const DontHideTheRule: Story = {
|
|
79
|
+
tags: ['!dev'],
|
|
80
|
+
parameters: { layout: 'padded' },
|
|
81
|
+
name: "Usage / Don't: hide a rule the user must follow",
|
|
82
|
+
render: () => (
|
|
83
|
+
<Box pt="96px" px={16}>
|
|
84
|
+
<VStack align="stretch" gap={1} w="260px">
|
|
85
|
+
<HStack gap={1}>
|
|
86
|
+
<Text as="label" htmlFor="usage-password" fontWeight="semibold">
|
|
87
|
+
새 비밀번호
|
|
88
|
+
</Text>
|
|
89
|
+
<InfoSprinkle
|
|
90
|
+
open
|
|
91
|
+
iconButtonProps={{ size: 'xs', 'aria-label': '비밀번호 규칙' }}
|
|
92
|
+
>
|
|
93
|
+
<Text maxW="220px">
|
|
94
|
+
8자 이상, 숫자와 특수문자를 포함해야 합니다.
|
|
95
|
+
</Text>
|
|
96
|
+
</InfoSprinkle>
|
|
97
|
+
</HStack>
|
|
98
|
+
<Input id="usage-password" type="password" />
|
|
99
|
+
</VStack>
|
|
100
|
+
</Box>
|
|
101
|
+
),
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/** Tokens the trigger and card read: the icon colour from `InfoSprinkle.tsx`, the card from the Chakra HoverCard recipe. */
|
|
105
|
+
export const UsageTokens: Story = {
|
|
106
|
+
tags: ['!dev'],
|
|
107
|
+
parameters: { layout: 'padded' },
|
|
108
|
+
name: 'Usage / Tokens',
|
|
109
|
+
render: () => (
|
|
110
|
+
<TokenTable
|
|
111
|
+
rows={[
|
|
112
|
+
{ token: 'fg.muted', use: <T en="Icon" ko="아이콘" /> },
|
|
113
|
+
{ token: 'bg.panel', use: <T en="Card" ko="카드" /> },
|
|
114
|
+
]}
|
|
115
|
+
/>
|
|
116
|
+
),
|
|
117
|
+
};
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { ArgTypes, Canvas, Meta } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import { En, Ko, LangToggle, Verdict } from '../../guidelines/_components/Lang';
|
|
4
|
+
import * as InfoSprinkleStories from './InfoSprinkle.stories';
|
|
5
|
+
|
|
6
|
+
<Meta of={InfoSprinkleStories} name="Usage" />
|
|
7
|
+
|
|
8
|
+
<LangToggle />
|
|
9
|
+
|
|
10
|
+
<En>
|
|
11
|
+
|
|
12
|
+
# InfoSprinkle
|
|
13
|
+
|
|
14
|
+
A small info icon next to a label that opens a card with a definition or a
|
|
15
|
+
short explanation, on hover, on focus, or on tap.
|
|
16
|
+
|
|
17
|
+
## When to use
|
|
18
|
+
|
|
19
|
+
- To define a term on a stat card or a table header: what "활성 멤버" counts,
|
|
20
|
+
whether a member count includes subgroups.
|
|
21
|
+
- To explain how a number is calculated, such as rounding.
|
|
22
|
+
- To say when something runs, such as an analysis schedule.
|
|
23
|
+
|
|
24
|
+
## When not to use
|
|
25
|
+
|
|
26
|
+
- A rule the user must follow to succeed (password rules, file limits) → put it
|
|
27
|
+
in visible helper text under the field.
|
|
28
|
+
- The name of an icon-only button → `Tooltip`.
|
|
29
|
+
- Content with links or controls → `Popover`.
|
|
30
|
+
- A warning or a status → `Banner` or `Badge`.
|
|
31
|
+
|
|
32
|
+
## Variants and what they mean
|
|
33
|
+
|
|
34
|
+
InfoSprinkle has no visual variants. Set the size and name of the icon with
|
|
35
|
+
`iconButtonProps`, the card's padding with `contentProps`, and its placement
|
|
36
|
+
with `positioning` (default `top`).
|
|
37
|
+
|
|
38
|
+
</En>
|
|
39
|
+
|
|
40
|
+
<Ko>
|
|
41
|
+
|
|
42
|
+
# InfoSprinkle
|
|
43
|
+
|
|
44
|
+
라벨 옆의 작은 정보 아이콘입니다. 포인터를 올리거나, 초점이 닿거나, 누르면 용어 설명이나
|
|
45
|
+
짧은 해설을 담은 카드가 열립니다.
|
|
46
|
+
|
|
47
|
+
## 언제 쓰나요
|
|
48
|
+
|
|
49
|
+
- 통계 카드나 표 머리글의 용어를 설명할 때: "활성 멤버"가 무엇을 세는지, 멤버 수에 하위
|
|
50
|
+
그룹이 들어가는지.
|
|
51
|
+
- 반올림처럼 숫자를 계산하는 방식을 설명할 때.
|
|
52
|
+
- 분석 일정처럼 무언가가 언제 실행되는지 알릴 때.
|
|
53
|
+
|
|
54
|
+
## 언제 쓰지 않나요
|
|
55
|
+
|
|
56
|
+
- 비밀번호 규칙이나 파일 제한처럼 사용자가 꼭 지켜야 하는 규칙은 입력란 아래에 눈에 보이는
|
|
57
|
+
도움말로 씁니다.
|
|
58
|
+
- 아이콘만 있는 버튼의 이름은 `Tooltip`으로 보입니다.
|
|
59
|
+
- 링크나 컨트롤이 들어가는 내용은 `Popover`에 넣습니다.
|
|
60
|
+
- 경고나 상태는 `Banner`나 `Badge`로 알립니다.
|
|
61
|
+
|
|
62
|
+
## 변형과 뜻
|
|
63
|
+
|
|
64
|
+
InfoSprinkle에는 모양 변형이 없습니다. 아이콘의 크기와 이름은 `iconButtonProps`로,
|
|
65
|
+
카드 여백은 `contentProps`로, 위치는 `positioning`(기본 `top`)으로 정합니다.
|
|
66
|
+
|
|
67
|
+
</Ko>
|
|
68
|
+
|
|
69
|
+
<ArgTypes of={InfoSprinkleStories} include={['iconButtonProps', 'contentProps', 'baseFontSize']} />
|
|
70
|
+
|
|
71
|
+
<En>
|
|
72
|
+
|
|
73
|
+
## Do / Don't
|
|
74
|
+
|
|
75
|
+
</En>
|
|
76
|
+
|
|
77
|
+
<Ko>
|
|
78
|
+
|
|
79
|
+
## 이렇게 하세요 / 이렇게 하지 마세요
|
|
80
|
+
|
|
81
|
+
</Ko>
|
|
82
|
+
|
|
83
|
+
<Canvas of={InfoSprinkleStories.DoDefineALabel} />
|
|
84
|
+
<Verdict
|
|
85
|
+
kind="do"
|
|
86
|
+
en="Put it right after the label it explains, and name the icon after that label ('활성 멤버 설명')."
|
|
87
|
+
ko="설명하는 라벨 바로 뒤에 두고, 아이콘 이름도 그 라벨을 따라 붙입니다('활성 멤버 설명')."
|
|
88
|
+
/>
|
|
89
|
+
|
|
90
|
+
<Canvas of={InfoSprinkleStories.DontHideTheRule} />
|
|
91
|
+
<Verdict
|
|
92
|
+
kind="dont"
|
|
93
|
+
en="Hide a rule the user must follow behind the icon. Most people will not open it, and they find out only when the form is rejected. Show the rule under the field."
|
|
94
|
+
ko="꼭 지켜야 하는 규칙을 아이콘 뒤에 숨기지 마세요. 대부분은 열어 보지 않고, 양식이 거부된 뒤에야 알게 됩니다. 규칙은 입력란 아래에 보이게 씁니다."
|
|
95
|
+
/>
|
|
96
|
+
|
|
97
|
+
<En>
|
|
98
|
+
|
|
99
|
+
## Content
|
|
100
|
+
|
|
101
|
+
- One or two sentences that define or explain. Full stops, sentence case.
|
|
102
|
+
- Start with the answer: "최근 30일 동안 한 번 이상 대화한 멤버 수입니다.", not
|
|
103
|
+
"이 숫자는 …를 뜻합니다".
|
|
104
|
+
- No links or buttons inside; the card closes as soon as the pointer or focus
|
|
105
|
+
leaves the icon.
|
|
106
|
+
|
|
107
|
+
## Accessibility
|
|
108
|
+
|
|
109
|
+
What InfoSprinkle does for you:
|
|
110
|
+
|
|
111
|
+
- The trigger is a real `IconButton`, so it is reachable with `Tab`
|
|
112
|
+
(WCAG 2.1.1). The card opens on hover and on focus, and on tap on touch
|
|
113
|
+
devices that have no hover.
|
|
114
|
+
- The card is portalled and closes when the pointer or focus moves away.
|
|
115
|
+
|
|
116
|
+
What you still have to do:
|
|
117
|
+
|
|
118
|
+
- **Name each icon.** The default `aria-label` is the English "Info", and every
|
|
119
|
+
icon on the screen gets the same one. Pass a name through `iconButtonProps`
|
|
120
|
+
that says what it explains: `'aria-label': '활성 멤버 설명'` (WCAG 2.4.6,
|
|
121
|
+
4.1.2).
|
|
122
|
+
- **Do not rely on screen readers reading the card.** It is a Chakra
|
|
123
|
+
`HoverCard`: the trigger has no `aria-describedby` or `aria-expanded`
|
|
124
|
+
pointing at it, and the card sits at the end of the page. Keep the
|
|
125
|
+
information a screen reader user needs in visible text or in the label.
|
|
126
|
+
- Do not put the only copy of required information in it.
|
|
127
|
+
|
|
128
|
+
## Tokens
|
|
129
|
+
|
|
130
|
+
The icon colour is set in `InfoSprinkle.tsx`; the card colour comes from
|
|
131
|
+
Chakra's HoverCard recipe.
|
|
132
|
+
|
|
133
|
+
</En>
|
|
134
|
+
|
|
135
|
+
<Ko>
|
|
136
|
+
|
|
137
|
+
## 문구
|
|
138
|
+
|
|
139
|
+
- 용어를 정의하거나 해설하는 한두 문장을 씁니다. 마침표를 찍습니다.
|
|
140
|
+
- 답부터 씁니다. "이 숫자는 …를 뜻합니다"가 아니라 "최근 30일 동안 한 번 이상 대화한
|
|
141
|
+
멤버 수입니다."처럼 씁니다.
|
|
142
|
+
- 안에 링크나 버튼을 넣지 않습니다. 포인터나 초점이 아이콘을 떠나면 카드가 바로 닫힙니다.
|
|
143
|
+
|
|
144
|
+
## 접근성
|
|
145
|
+
|
|
146
|
+
InfoSprinkle이 알아서 하는 일
|
|
147
|
+
|
|
148
|
+
- 여는 요소가 실제 `IconButton`이라 `Tab`으로 닿을 수 있습니다(WCAG 2.1.1). 포인터를
|
|
149
|
+
올리거나 초점이 닿으면 카드가 열리고, 마우스 올리기가 없는 터치 기기에서는 누르면
|
|
150
|
+
열립니다.
|
|
151
|
+
- 카드는 포털로 그려지며, 포인터나 초점이 떠나면 닫힙니다.
|
|
152
|
+
|
|
153
|
+
직접 챙겨야 하는 일
|
|
154
|
+
|
|
155
|
+
- **아이콘마다 이름을 붙입니다.** 기본 `aria-label`은 영어 "Info"라서 화면의 모든 아이콘이
|
|
156
|
+
같은 이름을 갖게 됩니다. `iconButtonProps`로 무엇을 설명하는지 밝힌 이름을 넘깁니다.
|
|
157
|
+
예: `'aria-label': '활성 멤버 설명'`(WCAG 2.4.6, 4.1.2).
|
|
158
|
+
- **화면 낭독기가 카드를 읽어 줄 것이라 기대하지 않습니다.** Chakra `HoverCard`라서
|
|
159
|
+
여는 버튼에 카드를 가리키는 `aria-describedby`나 `aria-expanded`가 없고, 카드는 페이지
|
|
160
|
+
맨 끝에 붙습니다. 화면 낭독기 사용자에게 필요한 정보는 보이는 문구나 라벨에 둡니다.
|
|
161
|
+
- 꼭 필요한 정보를 이 카드에만 두지 않습니다.
|
|
162
|
+
|
|
163
|
+
## 토큰
|
|
164
|
+
|
|
165
|
+
아이콘 색은 `InfoSprinkle.tsx`에서, 카드 색은 Chakra HoverCard 레시피에서 정합니다.
|
|
166
|
+
|
|
167
|
+
</Ko>
|
|
168
|
+
|
|
169
|
+
<Canvas of={InfoSprinkleStories.UsageTokens} sourceState="none" />
|
|
170
|
+
|
|
171
|
+
<En>
|
|
172
|
+
|
|
173
|
+
## Related
|
|
174
|
+
|
|
175
|
+
- **Tooltip**: the name of an icon-only button.
|
|
176
|
+
- **Popover**: a panel with links or controls.
|
|
177
|
+
- **FormControl**: helper text under a field, for rules the user must follow.
|
|
178
|
+
|
|
179
|
+
</En>
|
|
180
|
+
|
|
181
|
+
<Ko>
|
|
182
|
+
|
|
183
|
+
## 관련 컴포넌트
|
|
184
|
+
|
|
185
|
+
- **Tooltip**: 아이콘만 있는 버튼의 이름.
|
|
186
|
+
- **Popover**: 링크나 컨트롤이 있는 패널.
|
|
187
|
+
- **FormControl**: 사용자가 지켜야 하는 규칙을 담는 입력란 아래 도움말.
|
|
188
|
+
|
|
189
|
+
</Ko>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
import { T } from '../../guidelines/_components/Lang';
|
|
4
|
+
import { TokenTable } from '../../guidelines/_components/TokenTable';
|
|
5
|
+
import { Text } from '../Typography';
|
|
6
|
+
import { InlineCode } from './InlineCode';
|
|
7
|
+
|
|
8
|
+
const meta = {
|
|
9
|
+
title: 'Components/InlineCode',
|
|
10
|
+
component: InlineCode,
|
|
11
|
+
args: {
|
|
12
|
+
children: 'model_id',
|
|
13
|
+
},
|
|
14
|
+
} satisfies Meta<typeof InlineCode>;
|
|
15
|
+
|
|
16
|
+
export default meta;
|
|
17
|
+
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
|
|
20
|
+
export const Basic: Story = {};
|
|
21
|
+
|
|
22
|
+
/** In running text, where it is meant to be used. */
|
|
23
|
+
export const InSentence: Story = {
|
|
24
|
+
render: (args) => (
|
|
25
|
+
<Text>
|
|
26
|
+
요청 본문의 <InlineCode {...args} /> 칸에 모델 이름을 넣습니다.
|
|
27
|
+
</Text>
|
|
28
|
+
),
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// ───────────────────────── Usage-page specimens ─────────────────────────
|
|
32
|
+
// Pulled into `InlineCode.usage.mdx` with <Canvas of={…} />. Hidden from the
|
|
33
|
+
// sidebar (`!dev`); `tags` is written out on each story because the indexer
|
|
34
|
+
// reads CSF statically.
|
|
35
|
+
|
|
36
|
+
export const DoIdentifierInSentence: Story = {
|
|
37
|
+
tags: ['!dev'],
|
|
38
|
+
parameters: { layout: 'padded' },
|
|
39
|
+
name: 'Usage / Do: names the user types or sees in code',
|
|
40
|
+
render: () => (
|
|
41
|
+
<Text>
|
|
42
|
+
응답이 끊기면 <InlineCode>finish_reason</InlineCode> 값이{' '}
|
|
43
|
+
<InlineCode>length</InlineCode>인지 확인하세요.
|
|
44
|
+
</Text>
|
|
45
|
+
),
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const DontEmphasis: Story = {
|
|
49
|
+
tags: ['!dev'],
|
|
50
|
+
parameters: { layout: 'padded' },
|
|
51
|
+
name: "Usage / Don't: code styling for emphasis",
|
|
52
|
+
render: () => (
|
|
53
|
+
<Text>
|
|
54
|
+
이 작업은 <InlineCode>되돌릴 수 없습니다</InlineCode>.
|
|
55
|
+
</Text>
|
|
56
|
+
),
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const UsageTokens: Story = {
|
|
60
|
+
tags: ['!dev'],
|
|
61
|
+
parameters: { layout: 'padded' },
|
|
62
|
+
name: 'Usage / Tokens',
|
|
63
|
+
render: () => (
|
|
64
|
+
<TokenTable
|
|
65
|
+
rows={[
|
|
66
|
+
{ token: 'bg.subtle', use: <T en="Chip fill" ko="칩 배경" /> },
|
|
67
|
+
{ token: 'fg.default', use: <T en="Text" ko="글자" /> },
|
|
68
|
+
{
|
|
69
|
+
token: 'border.subtle',
|
|
70
|
+
use: <T en="1px ring (box-shadow)" ko="1px 테두리(box-shadow)" />,
|
|
71
|
+
},
|
|
72
|
+
]}
|
|
73
|
+
/>
|
|
74
|
+
),
|
|
75
|
+
};
|