@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,142 @@
|
|
|
1
|
+
import { Canvas, Meta } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import { En, Ko, LangToggle, Verdict } from '../../guidelines/_components/Lang';
|
|
4
|
+
import * as InlineCodeStories from './InlineCode.stories';
|
|
5
|
+
|
|
6
|
+
<Meta of={InlineCodeStories} name="Usage" />
|
|
7
|
+
|
|
8
|
+
<LangToggle />
|
|
9
|
+
|
|
10
|
+
<En>
|
|
11
|
+
|
|
12
|
+
# InlineCode
|
|
13
|
+
|
|
14
|
+
Code inside a sentence: a field name, a value, a shortcut. A small chip one
|
|
15
|
+
size below the text around it (`textStyle="subtext"`, em-relative), with a
|
|
16
|
+
`bg.subtle` fill and a hairline ring.
|
|
17
|
+
|
|
18
|
+
## When to use
|
|
19
|
+
|
|
20
|
+
- Identifiers the user types or will see in code or settings:
|
|
21
|
+
`finish_reason`, `model_id`, a file name.
|
|
22
|
+
|
|
23
|
+
## When not to use
|
|
24
|
+
|
|
25
|
+
- More than one line → `Code`.
|
|
26
|
+
- A value the user only needs to copy → `CopyableCode`.
|
|
27
|
+
- Emphasis or warnings → plain text, bold if it must stand out.
|
|
28
|
+
- Keyboard keys in instructions → write them out (Ctrl + C); the chip says
|
|
29
|
+
"code", not "key".
|
|
30
|
+
|
|
31
|
+
## Do / Don't
|
|
32
|
+
|
|
33
|
+
</En>
|
|
34
|
+
|
|
35
|
+
<Ko>
|
|
36
|
+
|
|
37
|
+
# InlineCode
|
|
38
|
+
|
|
39
|
+
문장 안의 코드입니다. 필드 이름, 값, 단축키 같은 것을 씁니다. 주변 글자보다 한 단계
|
|
40
|
+
작은 칩으로 그려지고(`textStyle="subtext"`, em 단위), `bg.subtle` 배경과 얇은 테두리가
|
|
41
|
+
있습니다.
|
|
42
|
+
|
|
43
|
+
## 언제 쓰나요
|
|
44
|
+
|
|
45
|
+
- 사용자가 직접 입력하거나 코드·설정에서 보게 될 식별자: `finish_reason`,
|
|
46
|
+
`model_id`, 파일 이름.
|
|
47
|
+
|
|
48
|
+
## 언제 쓰지 않나요
|
|
49
|
+
|
|
50
|
+
- 두 줄 이상이라면 `Code`를 씁니다.
|
|
51
|
+
- 복사만 하면 되는 값은 `CopyableCode`를 씁니다.
|
|
52
|
+
- 강조나 경고에는 일반 글자를 쓰고, 꼭 눈에 띄어야 하면 굵게 씁니다.
|
|
53
|
+
- 안내문의 키보드 키는 글자로 씁니다(Ctrl + C). 이 칩은 '코드'라는 뜻이지 '키'라는
|
|
54
|
+
뜻이 아닙니다.
|
|
55
|
+
|
|
56
|
+
## 이렇게 하세요 / 이렇게 하지 마세요
|
|
57
|
+
|
|
58
|
+
</Ko>
|
|
59
|
+
|
|
60
|
+
<Canvas of={InlineCodeStories.DoIdentifierInSentence} />
|
|
61
|
+
<Verdict
|
|
62
|
+
kind="do"
|
|
63
|
+
en="Mark names and values the user will meet in code."
|
|
64
|
+
ko="사용자가 코드에서 만나게 될 이름과 값을 표시합니다."
|
|
65
|
+
/>
|
|
66
|
+
|
|
67
|
+
<Canvas of={InlineCodeStories.DontEmphasis} />
|
|
68
|
+
<Verdict
|
|
69
|
+
kind="dont"
|
|
70
|
+
en="Use code styling to make words stand out. It tells the reader the words are code."
|
|
71
|
+
ko="말을 돋보이게 하려고 코드 모양을 쓰지 마세요. 읽는 사람은 그 말을 코드로 받아들입니다."
|
|
72
|
+
/>
|
|
73
|
+
|
|
74
|
+
<En>
|
|
75
|
+
|
|
76
|
+
## Content
|
|
77
|
+
|
|
78
|
+
- Write the identifier exactly as it appears, including case.
|
|
79
|
+
- Keep Korean particles outside the chip: `length`인지, not `length인지`.
|
|
80
|
+
|
|
81
|
+
## Accessibility
|
|
82
|
+
|
|
83
|
+
What InlineCode does for you:
|
|
84
|
+
|
|
85
|
+
- It renders `<code>`, so assistive technology that reports code can, and
|
|
86
|
+
the chip ring keeps it visible on `bg.sunken`, where the fill alone would
|
|
87
|
+
vanish.
|
|
88
|
+
|
|
89
|
+
What you still have to do:
|
|
90
|
+
|
|
91
|
+
- Nothing in the chip is read differently by most screen readers. Do not
|
|
92
|
+
rely on the code styling to carry meaning (WCAG 1.3.1); the sentence must
|
|
93
|
+
make sense on its own.
|
|
94
|
+
|
|
95
|
+
## Tokens
|
|
96
|
+
|
|
97
|
+
</En>
|
|
98
|
+
|
|
99
|
+
<Ko>
|
|
100
|
+
|
|
101
|
+
## 문구
|
|
102
|
+
|
|
103
|
+
- 식별자는 대소문자까지 보이는 그대로 씁니다.
|
|
104
|
+
- 한국어 조사는 칩 밖에 둡니다. `length인지`가 아니라 `length`인지로 씁니다.
|
|
105
|
+
|
|
106
|
+
## 접근성
|
|
107
|
+
|
|
108
|
+
InlineCode가 알아서 하는 일
|
|
109
|
+
|
|
110
|
+
- `<code>`로 그리므로 코드를 구분해 알려 주는 보조 기술은 그렇게 읽습니다. 배경만으로는
|
|
111
|
+
`bg.sunken` 위에서 칩이 사라지기 때문에 테두리를 둡니다.
|
|
112
|
+
|
|
113
|
+
직접 챙겨야 하는 일
|
|
114
|
+
|
|
115
|
+
- 대부분의 화면 낭독기는 칩 안의 글자를 다르게 읽지 않습니다. 코드 모양에 뜻을 맡기지
|
|
116
|
+
말고(WCAG 1.3.1), 문장만으로 뜻이 통하게 씁니다.
|
|
117
|
+
|
|
118
|
+
## 토큰
|
|
119
|
+
|
|
120
|
+
</Ko>
|
|
121
|
+
|
|
122
|
+
<Canvas of={InlineCodeStories.UsageTokens} sourceState="none" />
|
|
123
|
+
|
|
124
|
+
<En>
|
|
125
|
+
|
|
126
|
+
## Related
|
|
127
|
+
|
|
128
|
+
- **Code**: multi-line code.
|
|
129
|
+
- **CopyableCode**: a value with a copy button.
|
|
130
|
+
- **Typography**: the text InlineCode sits in.
|
|
131
|
+
|
|
132
|
+
</En>
|
|
133
|
+
|
|
134
|
+
<Ko>
|
|
135
|
+
|
|
136
|
+
## 관련 컴포넌트
|
|
137
|
+
|
|
138
|
+
- **Code**: 여러 줄 코드.
|
|
139
|
+
- **CopyableCode**: 복사 버튼이 있는 값.
|
|
140
|
+
- **Typography**: InlineCode가 들어가는 본문.
|
|
141
|
+
|
|
142
|
+
</Ko>
|
|
@@ -3,6 +3,9 @@ import { Meta, StoryObj } from '@storybook/react';
|
|
|
3
3
|
import { useState } from 'react';
|
|
4
4
|
|
|
5
5
|
import { PhoneFilledIcon, SearchIcon, MailIcon } from '@/components/Icon';
|
|
6
|
+
import { T } from '../../guidelines/_components/Lang';
|
|
7
|
+
import { TokenTable } from '../../guidelines/_components/TokenTable';
|
|
8
|
+
import { FieldRow } from '../Form';
|
|
6
9
|
import { MaxLengthIndicator } from '../MaxLengthIndicator';
|
|
7
10
|
|
|
8
11
|
import { Input } from './Input';
|
|
@@ -257,3 +260,180 @@ export const FocusState: Story = {
|
|
|
257
260
|
);
|
|
258
261
|
},
|
|
259
262
|
};
|
|
263
|
+
|
|
264
|
+
// ───────────────────────── Usage-page specimens ─────────────────────────
|
|
265
|
+
// Pulled into `Input.usage.mdx` with <Canvas of={…} />. Hidden from the
|
|
266
|
+
// sidebar (`!dev`); `tags` is written out on each story because the indexer
|
|
267
|
+
// reads CSF statically.
|
|
268
|
+
|
|
269
|
+
export const DoLabelAbove: Story = {
|
|
270
|
+
tags: ['!dev'],
|
|
271
|
+
parameters: { layout: 'padded' },
|
|
272
|
+
name: 'Usage / Do: a label above the field',
|
|
273
|
+
render: () => (
|
|
274
|
+
<Box maxW="360px">
|
|
275
|
+
<FieldRow
|
|
276
|
+
label="업무용 이메일"
|
|
277
|
+
helperText="초대 메일이 이 주소로 갑니다."
|
|
278
|
+
required
|
|
279
|
+
>
|
|
280
|
+
<Input
|
|
281
|
+
type="email"
|
|
282
|
+
autoComplete="email"
|
|
283
|
+
placeholder="name@company.com"
|
|
284
|
+
/>
|
|
285
|
+
</FieldRow>
|
|
286
|
+
</Box>
|
|
287
|
+
),
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
export const DontPlaceholderAsLabel: Story = {
|
|
291
|
+
tags: ['!dev'],
|
|
292
|
+
parameters: { layout: 'padded' },
|
|
293
|
+
name: "Usage / Don't: the placeholder as the label",
|
|
294
|
+
render: () => (
|
|
295
|
+
<Box maxW="360px">
|
|
296
|
+
<Input type="email" placeholder="업무용 이메일" />
|
|
297
|
+
</Box>
|
|
298
|
+
),
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
export const DoErrorInWords: Story = {
|
|
302
|
+
tags: ['!dev'],
|
|
303
|
+
parameters: { layout: 'padded' },
|
|
304
|
+
name: 'Usage / Do: say what is wrong, under the field',
|
|
305
|
+
render: () => (
|
|
306
|
+
<Box maxW="360px">
|
|
307
|
+
<FieldRow label="업무용 이메일" error="이메일 주소 형식이 아닙니다.">
|
|
308
|
+
<Input type="email" value="name@company" onChange={() => {}} />
|
|
309
|
+
</FieldRow>
|
|
310
|
+
</Box>
|
|
311
|
+
),
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
export const DontBorderOnly: Story = {
|
|
315
|
+
tags: ['!dev'],
|
|
316
|
+
parameters: { layout: 'padded' },
|
|
317
|
+
name: "Usage / Don't: a red border and nothing else",
|
|
318
|
+
render: () => (
|
|
319
|
+
<Box maxW="360px">
|
|
320
|
+
<Input type="email" value="name@company" onChange={() => {}} invalid />
|
|
321
|
+
</Box>
|
|
322
|
+
),
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
export const DoMaskedAmount: Story = {
|
|
326
|
+
tags: ['!dev'],
|
|
327
|
+
parameters: { layout: 'padded' },
|
|
328
|
+
name: 'Usage / Do: maskNumber for amounts',
|
|
329
|
+
render: () => {
|
|
330
|
+
const [value, setValue] = useState('2000000');
|
|
331
|
+
return (
|
|
332
|
+
<Box maxW="360px">
|
|
333
|
+
<FieldRow
|
|
334
|
+
label="월 크레딧 한도"
|
|
335
|
+
helperText={`저장되는 값: ${value || '(비어 있음)'}`}
|
|
336
|
+
>
|
|
337
|
+
<Input
|
|
338
|
+
type="number"
|
|
339
|
+
maskNumber
|
|
340
|
+
value={value}
|
|
341
|
+
onChange={(e) => setValue(e.target.value)}
|
|
342
|
+
/>
|
|
343
|
+
</FieldRow>
|
|
344
|
+
</Box>
|
|
345
|
+
);
|
|
346
|
+
},
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
export const DoCountWithLimit: Story = {
|
|
350
|
+
tags: ['!dev'],
|
|
351
|
+
parameters: { layout: 'padded' },
|
|
352
|
+
name: 'Usage / Do: show the limit next to maxLength',
|
|
353
|
+
render: () => {
|
|
354
|
+
const [value, setValue] = useState('마케팅팀');
|
|
355
|
+
return (
|
|
356
|
+
<Box maxW="360px">
|
|
357
|
+
<FieldRow
|
|
358
|
+
label="그룹 이름"
|
|
359
|
+
endAdornment={
|
|
360
|
+
<MaxLengthIndicator value={value.length} maxLength={20} />
|
|
361
|
+
}
|
|
362
|
+
>
|
|
363
|
+
<Input
|
|
364
|
+
maxLength={20}
|
|
365
|
+
value={value}
|
|
366
|
+
onChange={(e) => setValue(e.target.value)}
|
|
367
|
+
/>
|
|
368
|
+
</FieldRow>
|
|
369
|
+
</Box>
|
|
370
|
+
);
|
|
371
|
+
},
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Tokens Input reads. Input has no styles file — the values are written in
|
|
376
|
+
* `Input.tsx` (and mirrored by `Select.styles.ts`); this list follows that file.
|
|
377
|
+
*/
|
|
378
|
+
export const UsageTokens: Story = {
|
|
379
|
+
tags: ['!dev'],
|
|
380
|
+
parameters: { layout: 'padded' },
|
|
381
|
+
name: 'Usage / Tokens',
|
|
382
|
+
render: () => (
|
|
383
|
+
<TokenTable
|
|
384
|
+
rows={[
|
|
385
|
+
{
|
|
386
|
+
token: 'bg.surface',
|
|
387
|
+
use: <T en="Field background" ko="입력란 배경" />,
|
|
388
|
+
},
|
|
389
|
+
{ token: 'fg.default', use: <T en="Typed text" ko="입력한 글자" /> },
|
|
390
|
+
{
|
|
391
|
+
token: 'border.control',
|
|
392
|
+
use: (
|
|
393
|
+
<T
|
|
394
|
+
en="Border at rest (3:1 against the page)"
|
|
395
|
+
ko="평소 테두리(배경과 3:1)"
|
|
396
|
+
/>
|
|
397
|
+
),
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
token: 'fg.icon',
|
|
401
|
+
use: <T en="Border on hover" ko="마우스를 올렸을 때 테두리" />,
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
token: 'primary.main',
|
|
405
|
+
use: (
|
|
406
|
+
<T
|
|
407
|
+
en="Border and 1px ring on focus"
|
|
408
|
+
ko="초점을 받았을 때 테두리와 1px 링"
|
|
409
|
+
/>
|
|
410
|
+
),
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
token: 'danger.solid',
|
|
414
|
+
use: <T en="Border when invalid" ko="오류 상태 테두리" />,
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
token: 'bg.subtle',
|
|
418
|
+
use: <T en="Read-only background" ko="읽기 전용 배경" />,
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
token: 'fg.muted',
|
|
422
|
+
use: <T en="Read-only text" ko="읽기 전용 글자" />,
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
token: 'border.subtle',
|
|
426
|
+
use: <T en="Read-only border" ko="읽기 전용 테두리" />,
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
token: 'disabled.bg',
|
|
430
|
+
use: <T en="Disabled background" ko="비활성 배경" />,
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
token: 'disabled.fg',
|
|
434
|
+
use: <T en="Disabled text" ko="비활성 글자" />,
|
|
435
|
+
},
|
|
436
|
+
]}
|
|
437
|
+
/>
|
|
438
|
+
),
|
|
439
|
+
};
|
|
@@ -352,6 +352,10 @@ export const Input = forwardRef(
|
|
|
352
352
|
bg: 'bg.subtle',
|
|
353
353
|
color: 'fg.muted',
|
|
354
354
|
borderColor: 'border.subtle',
|
|
355
|
+
// Nothing can be typed here, so hovering must not promise an edit.
|
|
356
|
+
_hover: {
|
|
357
|
+
borderColor: 'border.subtle',
|
|
358
|
+
},
|
|
355
359
|
}}
|
|
356
360
|
_disabled={{
|
|
357
361
|
...disabledControl,
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import { ArgTypes, Canvas, Meta } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import { En, Ko, LangToggle, Verdict } from '../../guidelines/_components/Lang';
|
|
4
|
+
import * as InputStories from './Input.stories';
|
|
5
|
+
|
|
6
|
+
<Meta of={InputStories} name="Usage" />
|
|
7
|
+
|
|
8
|
+
<LangToggle />
|
|
9
|
+
|
|
10
|
+
<En>
|
|
11
|
+
|
|
12
|
+
# Input
|
|
13
|
+
|
|
14
|
+
A single-line text field: names, email addresses, amounts, search terms.
|
|
15
|
+
|
|
16
|
+
## When to use
|
|
17
|
+
|
|
18
|
+
- One line of free text the user types: a name, an email address, a URL.
|
|
19
|
+
- A number the user types exactly, such as a credit limit. Use
|
|
20
|
+
`type="number"` with `maskNumber` to show thousands separators.
|
|
21
|
+
- A search or filter box, with a `leftIcon`.
|
|
22
|
+
|
|
23
|
+
## When not to use
|
|
24
|
+
|
|
25
|
+
- More than one line, or text that wraps → `Textarea`.
|
|
26
|
+
- A password or secret → `PasswordInput`.
|
|
27
|
+
- A short one-time code typed box by box → `PinInput`.
|
|
28
|
+
- A choice from a known list → `SelectField`, `ComboboxField`, `Radio`.
|
|
29
|
+
- A date or month → `SingleDatePicker`, `RangeDatePicker`, `MonthPicker`.
|
|
30
|
+
- A rough value on a scale, where the exact number does not matter → `Slider`.
|
|
31
|
+
|
|
32
|
+
## Props that change behaviour
|
|
33
|
+
|
|
34
|
+
</En>
|
|
35
|
+
|
|
36
|
+
<Ko>
|
|
37
|
+
|
|
38
|
+
# Input
|
|
39
|
+
|
|
40
|
+
한 줄짜리 텍스트 입력란입니다. 이름, 이메일 주소, 금액, 검색어에 씁니다.
|
|
41
|
+
|
|
42
|
+
## 언제 쓰나요
|
|
43
|
+
|
|
44
|
+
- 사용자가 직접 입력하는 한 줄짜리 텍스트: 이름, 이메일 주소, URL.
|
|
45
|
+
- 정확하게 입력해야 하는 숫자(예: 크레딧 한도). 천 단위 쉼표가 필요하면
|
|
46
|
+
`type="number"`와 `maskNumber`를 함께 씁니다.
|
|
47
|
+
- 검색창이나 필터 입력란. 이때는 `leftIcon`에 아이콘을 넣습니다.
|
|
48
|
+
|
|
49
|
+
## 언제 쓰지 않나요
|
|
50
|
+
|
|
51
|
+
- 두 줄 이상이거나 줄바꿈이 필요한 글은 `Textarea`를 씁니다.
|
|
52
|
+
- 비밀번호나 비밀 값은 `PasswordInput`을 씁니다.
|
|
53
|
+
- 한 칸에 한 글자씩 넣는 짧은 인증 코드는 `PinInput`을 씁니다.
|
|
54
|
+
- 정해진 목록에서 고르는 값은 `SelectField`, `ComboboxField`, `Radio`를 씁니다.
|
|
55
|
+
- 날짜나 월은 `SingleDatePicker`, `RangeDatePicker`, `MonthPicker`를 씁니다.
|
|
56
|
+
- 정확한 숫자보다 대략적인 위치가 중요한 값은 `Slider`를 씁니다.
|
|
57
|
+
|
|
58
|
+
## 동작을 바꾸는 속성
|
|
59
|
+
|
|
60
|
+
</Ko>
|
|
61
|
+
|
|
62
|
+
<ArgTypes
|
|
63
|
+
of={InputStories}
|
|
64
|
+
include={[
|
|
65
|
+
'maskNumber',
|
|
66
|
+
'trimWhiteSpace',
|
|
67
|
+
'noSpaces',
|
|
68
|
+
'invalid',
|
|
69
|
+
'leftIcon',
|
|
70
|
+
'rightIcon',
|
|
71
|
+
]}
|
|
72
|
+
/>
|
|
73
|
+
|
|
74
|
+
<En>
|
|
75
|
+
|
|
76
|
+
| Prop | What it does | Use for |
|
|
77
|
+
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
|
|
78
|
+
| `maskNumber` | Only with `type="number"`. Renders a text input that shows `2,000,000` while `onChange` receives the digits (`2000000`). | Amounts, limits, counts |
|
|
79
|
+
| `noSpaces` | Blocks the space key and strips every space, including pasted ones. | Email addresses, IDs, codes |
|
|
80
|
+
| `trimWhiteSpace` | Blocks a leading space and trims **both ends on every keystroke**, so a space between two words cannot be typed, only pasted. | Single-word values only. Never names or titles; trim at submit instead |
|
|
81
|
+
| `invalid` | Red border only. It does not tell assistive technology anything; see Accessibility. | With `FieldRow` `error` |
|
|
82
|
+
| `readOnly` | `bg.subtle` fill and muted text. The value can still be selected and copied. | Values the user may see but not change |
|
|
83
|
+
| `disabled` | The fixed `disabled.*` pair, not reduced opacity. | A field that does not apply right now |
|
|
84
|
+
|
|
85
|
+
Good to know:
|
|
86
|
+
|
|
87
|
+
- While a Korean IME is composing, Enter is swallowed, so a half-typed syllable
|
|
88
|
+
never submits the form.
|
|
89
|
+
- `onKeyDown` is only called for Enter. Listen on a wrapper if you need other
|
|
90
|
+
keys.
|
|
91
|
+
- On touch devices the text is raised to 16px so iOS Safari does not zoom the
|
|
92
|
+
page on focus.
|
|
93
|
+
|
|
94
|
+
## Do / Don't
|
|
95
|
+
|
|
96
|
+
</En>
|
|
97
|
+
|
|
98
|
+
<Ko>
|
|
99
|
+
|
|
100
|
+
| 속성 | 하는 일 | 쓰는 곳 |
|
|
101
|
+
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
|
|
102
|
+
| `maskNumber` | `type="number"`와 함께일 때만 동작합니다. 화면에는 `2,000,000`으로 보이고 `onChange`에는 숫자만(`2000000`) 전달됩니다. | 금액, 한도, 개수 |
|
|
103
|
+
| `noSpaces` | 스페이스 키를 막고, 붙여 넣은 내용까지 모든 공백을 지웁니다. | 이메일 주소, 아이디, 코드 |
|
|
104
|
+
| `trimWhiteSpace` | 맨 앞 공백을 막고 **입력할 때마다 앞뒤 공백을 지웁니다.** 그래서 단어 사이 공백은 타이핑으로 넣을 수 없고 붙여 넣기로만 들어갑니다. | 한 단어짜리 값에만 씁니다. 이름이나 제목에는 쓰지 말고 제출할 때 공백을 정리합니다 |
|
|
105
|
+
| `invalid` | 테두리만 빨갛게 바꿉니다. 보조기술에는 아무것도 알리지 않습니다. 접근성 절을 보세요. | `FieldRow`의 `error`와 함께 |
|
|
106
|
+
| `readOnly` | `bg.subtle` 배경에 흐린 글자로 바뀝니다. 값을 선택하고 복사할 수는 있습니다. | 보여 주되 바꾸면 안 되는 값 |
|
|
107
|
+
| `disabled` | 투명도를 낮추지 않고 고정된 `disabled.*` 색 한 쌍을 씁니다. | 지금은 해당하지 않는 입력란 |
|
|
108
|
+
|
|
109
|
+
알아 두면 좋은 점
|
|
110
|
+
|
|
111
|
+
- 한글 입력기로 글자를 조합하는 동안에는 Enter를 무시합니다. 조합 중인 글자 때문에 폼이
|
|
112
|
+
제출되지 않습니다.
|
|
113
|
+
- `onKeyDown`은 Enter를 눌렀을 때만 호출됩니다. 다른 키가 필요하면 바깥 요소에서
|
|
114
|
+
받습니다.
|
|
115
|
+
- 터치 기기에서는 글자를 16px로 키워 iOS Safari가 초점을 받을 때 화면을 확대하지 않게
|
|
116
|
+
합니다.
|
|
117
|
+
|
|
118
|
+
## 이렇게 하세요 / 이렇게 하지 마세요
|
|
119
|
+
|
|
120
|
+
</Ko>
|
|
121
|
+
|
|
122
|
+
<Canvas of={InputStories.DoLabelAbove} />
|
|
123
|
+
<Verdict
|
|
124
|
+
kind="do"
|
|
125
|
+
en="Put a visible label above the field with FieldRow. The label stays while the user types, and FieldRow connects it to the input."
|
|
126
|
+
ko="FieldRow로 입력란 위에 보이는 라벨을 둡니다. 라벨은 입력하는 동안에도 남아 있고, FieldRow가 라벨과 입력란을 연결합니다."
|
|
127
|
+
/>
|
|
128
|
+
|
|
129
|
+
<Canvas of={InputStories.DontPlaceholderAsLabel} />
|
|
130
|
+
<Verdict
|
|
131
|
+
kind="dont"
|
|
132
|
+
en="Use the placeholder as the label. It disappears on the first keystroke, and the field has no name for a screen reader."
|
|
133
|
+
ko="플레이스홀더를 라벨 대신 쓰지 마세요. 첫 글자를 입력하면 사라지고, 화면 낭독기에는 입력란의 이름이 없습니다."
|
|
134
|
+
/>
|
|
135
|
+
|
|
136
|
+
<Canvas of={InputStories.DoErrorInWords} />
|
|
137
|
+
<Verdict
|
|
138
|
+
kind="do"
|
|
139
|
+
en="Pass the message to FieldRow error. The field turns invalid for assistive technology too, and the message is read with it."
|
|
140
|
+
ko="오류 문구는 FieldRow의 error에 넘깁니다. 보조기술에도 오류 상태가 전달되고, 입력란과 함께 문구가 읽힙니다."
|
|
141
|
+
/>
|
|
142
|
+
|
|
143
|
+
<Canvas of={InputStories.DontBorderOnly} />
|
|
144
|
+
<Verdict
|
|
145
|
+
kind="dont"
|
|
146
|
+
en="Signal an error with the red border alone. Colour is the only cue, and nothing says what to fix (WCAG 1.4.1, 3.3.1)."
|
|
147
|
+
ko="빨간 테두리만으로 오류를 알리지 마세요. 색 말고는 단서가 없고, 무엇을 고쳐야 하는지도 알 수 없습니다(WCAG 1.4.1, 3.3.1)."
|
|
148
|
+
/>
|
|
149
|
+
|
|
150
|
+
<Canvas of={InputStories.DoMaskedAmount} />
|
|
151
|
+
<Verdict
|
|
152
|
+
kind="do"
|
|
153
|
+
en="Use type='number' with maskNumber for amounts. The reader sees separators; your form state keeps plain digits."
|
|
154
|
+
ko="금액에는 type='number'와 maskNumber를 씁니다. 화면에는 쉼표가 보이고, 폼 상태에는 숫자만 남습니다."
|
|
155
|
+
/>
|
|
156
|
+
|
|
157
|
+
<Canvas of={InputStories.DoCountWithLimit} />
|
|
158
|
+
<Verdict
|
|
159
|
+
kind="do"
|
|
160
|
+
en="When you set maxLength, show the count with MaxLengthIndicator in the label row, so the limit is not a surprise."
|
|
161
|
+
ko="maxLength를 정했다면 라벨 줄에 MaxLengthIndicator로 글자 수를 보여 줍니다. 그래야 제한에 걸려도 당황하지 않습니다."
|
|
162
|
+
/>
|
|
163
|
+
|
|
164
|
+
<En>
|
|
165
|
+
|
|
166
|
+
## Content
|
|
167
|
+
|
|
168
|
+
- Label: a noun phrase in sentence case, no colon ("Work email", not
|
|
169
|
+
"Work Email:"). Korean labels are nouns too: 업무용 이메일, not 이메일을
|
|
170
|
+
입력하세요.
|
|
171
|
+
- Placeholder: an example of the format (`name@company.com`), never the label
|
|
172
|
+
and never an instruction the user needs after they start typing.
|
|
173
|
+
- Helper text: one sentence on what happens with the value or which format is
|
|
174
|
+
accepted. Put it in `FieldRow` `helperText`, not in the placeholder.
|
|
175
|
+
- Error text: say what is wrong and how to fix it, in one sentence: 이메일 주소
|
|
176
|
+
형식이 아닙니다.
|
|
177
|
+
|
|
178
|
+
## Accessibility
|
|
179
|
+
|
|
180
|
+
What Input does for you:
|
|
181
|
+
|
|
182
|
+
- Renders a native `<input>`, so Tab, typing, selection and copy and paste
|
|
183
|
+
work as the browser provides.
|
|
184
|
+
- Shows a visible focus state: a `primary.main` border and 1px ring (WCAG
|
|
185
|
+
2.4.7).
|
|
186
|
+
- Inside `FormControl` or `FieldRow` it takes the field's id, so the label is
|
|
187
|
+
associated, and it picks up `aria-invalid`, `required` and the
|
|
188
|
+
`aria-describedby` that points at helper and error text.
|
|
189
|
+
|
|
190
|
+
What you still have to do:
|
|
191
|
+
|
|
192
|
+
- **Name every field.** Use `FieldRow` `label` or `FormControl` + `FormLabel`.
|
|
193
|
+
A placeholder is not a name, and an icon is not either (WCAG 4.1.2; KWCAG
|
|
194
|
+
5.3.4.1 레이블 제공).
|
|
195
|
+
- **Mark errors on the field, not on the input.** The `invalid` prop changes
|
|
196
|
+
the border only. Set `error` on `FieldRow` (or `invalid` on `FormControl`)
|
|
197
|
+
so the state and the message reach assistive technology (WCAG 3.3.1).
|
|
198
|
+
- **Say what the field is for** with `type` and `autoComplete` (`email`,
|
|
199
|
+
`name`, `tel`), so browsers and assistive tools can fill it (WCAG 1.3.5).
|
|
200
|
+
- An icon-only `rightIcon` that does something (clear, search) has to be a
|
|
201
|
+
button with an `aria-label`. A decorative `leftIcon` gets `aria-hidden`.
|
|
202
|
+
|
|
203
|
+
## Tokens
|
|
204
|
+
|
|
205
|
+
Input has no styles file; the table follows the values in `Input.tsx`, which
|
|
206
|
+
`Select.styles.ts` mirrors.
|
|
207
|
+
|
|
208
|
+
</En>
|
|
209
|
+
|
|
210
|
+
<Ko>
|
|
211
|
+
|
|
212
|
+
## 문구
|
|
213
|
+
|
|
214
|
+
- 라벨: 문장형 대소문자의 명사구로 쓰고 쌍점을 붙이지 않습니다("Work email",
|
|
215
|
+
"Work Email:"이 아님). 한국어 라벨도 명사로 씁니다. "이메일을 입력하세요"가 아니라
|
|
216
|
+
"업무용 이메일"입니다.
|
|
217
|
+
- 플레이스홀더: 형식의 예(`name@company.com`)만 씁니다. 라벨을 대신하지 않고, 입력을
|
|
218
|
+
시작한 뒤에도 필요한 안내를 넣지 않습니다.
|
|
219
|
+
- 도움말: 값이 어디에 쓰이는지나 받는 형식을 한 문장으로 씁니다. 플레이스홀더가 아니라
|
|
220
|
+
`FieldRow`의 `helperText`에 넣습니다.
|
|
221
|
+
- 오류 문구: 무엇이 잘못됐고 어떻게 고치는지 한 문장으로 씁니다. 예: 이메일 주소
|
|
222
|
+
형식이 아닙니다.
|
|
223
|
+
|
|
224
|
+
## 접근성
|
|
225
|
+
|
|
226
|
+
Input이 알아서 하는 일
|
|
227
|
+
|
|
228
|
+
- 네이티브 `<input>`을 그리므로 Tab 이동, 입력, 선택, 복사와 붙여 넣기가 브라우저
|
|
229
|
+
기본대로 동작합니다.
|
|
230
|
+
- 초점을 받으면 `primary.main` 테두리와 1px 링으로 눈에 띄게 표시합니다(WCAG 2.4.7).
|
|
231
|
+
- `FormControl`이나 `FieldRow` 안에 두면 필드의 id를 받아 라벨과 연결되고,
|
|
232
|
+
`aria-invalid`, `required`, 도움말과 오류 문구를 가리키는 `aria-describedby`도
|
|
233
|
+
함께 받습니다.
|
|
234
|
+
|
|
235
|
+
직접 챙겨야 하는 일
|
|
236
|
+
|
|
237
|
+
- **모든 입력란에 이름을 붙입니다.** `FieldRow`의 `label`이나 `FormControl`과
|
|
238
|
+
`FormLabel`을 씁니다. 플레이스홀더나 아이콘은 이름이 아닙니다(WCAG 4.1.2, KWCAG
|
|
239
|
+
5.3.4.1 레이블 제공).
|
|
240
|
+
- **오류는 입력란이 아니라 필드에 표시합니다.** `invalid` 속성은 테두리만 바꿉니다.
|
|
241
|
+
`FieldRow`에 `error`를 넘기거나 `FormControl`에 `invalid`를 주어야 오류 상태와 문구가
|
|
242
|
+
보조기술에 전달됩니다(WCAG 3.3.1).
|
|
243
|
+
- **입력란의 용도를 밝힙니다.** `type`과 `autoComplete`(`email`, `name`, `tel`)를
|
|
244
|
+
지정하면 브라우저와 보조 도구가 값을 채워 줄 수 있습니다(WCAG 1.3.5).
|
|
245
|
+
- 지우기나 검색처럼 동작하는 `rightIcon`은 `aria-label`이 있는 버튼이어야 합니다.
|
|
246
|
+
꾸밈용 `leftIcon`에는 `aria-hidden`을 붙입니다.
|
|
247
|
+
|
|
248
|
+
## 토큰
|
|
249
|
+
|
|
250
|
+
Input에는 스타일 파일이 없습니다. 아래 표는 `Input.tsx`에 적힌 값을 따르며,
|
|
251
|
+
`Select.styles.ts`도 같은 값을 씁니다.
|
|
252
|
+
|
|
253
|
+
</Ko>
|
|
254
|
+
|
|
255
|
+
<Canvas of={InputStories.UsageTokens} sourceState="none" />
|
|
256
|
+
|
|
257
|
+
<En>
|
|
258
|
+
|
|
259
|
+
## Related
|
|
260
|
+
|
|
261
|
+
- **FieldRow** / **FormControl**: label, helper text and error around the
|
|
262
|
+
field.
|
|
263
|
+
- **Textarea**, **PasswordInput**, **PinInput**: other text entry.
|
|
264
|
+
- **SelectField** / **ComboboxField**: a choice from a list.
|
|
265
|
+
- **MaxLengthIndicator**: the character count next to the label.
|
|
266
|
+
|
|
267
|
+
</En>
|
|
268
|
+
|
|
269
|
+
<Ko>
|
|
270
|
+
|
|
271
|
+
## 관련 컴포넌트
|
|
272
|
+
|
|
273
|
+
- **FieldRow** / **FormControl**: 입력란을 둘러싼 라벨, 도움말, 오류 문구.
|
|
274
|
+
- **Textarea**, **PasswordInput**, **PinInput**: 다른 텍스트 입력.
|
|
275
|
+
- **SelectField** / **ComboboxField**: 목록에서 고르는 값.
|
|
276
|
+
- **MaxLengthIndicator**: 라벨 옆 글자 수 표시.
|
|
277
|
+
|
|
278
|
+
</Ko>
|