@mindlogic-ai/logician-ui 5.0.0-alpha.2 → 5.0.0-alpha.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/components/Avatar/Avatar.d.ts +68 -11
- package/dist/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/components/Avatar/Avatar.js +41 -5
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/Avatar/Avatar.mjs +40 -5
- package/dist/components/Avatar/Avatar.mjs.map +1 -1
- package/dist/components/Avatar/index.d.ts +2 -2
- package/dist/components/Avatar/index.d.ts.map +1 -1
- package/dist/components/Badge/Badge.d.ts.map +1 -1
- package/dist/components/Badge/Badge.js +5 -3
- package/dist/components/Badge/Badge.js.map +1 -1
- package/dist/components/Badge/Badge.mjs +5 -3
- package/dist/components/Badge/Badge.mjs.map +1 -1
- package/dist/components/Badge/Badge.types.d.ts +7 -5
- package/dist/components/Badge/Badge.types.d.ts.map +1 -1
- package/dist/components/Banner/Banner.types.d.ts +24 -1
- package/dist/components/Banner/Banner.types.d.ts.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.styles.d.ts +2 -2
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +31 -3
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/Button.mjs +31 -3
- package/dist/components/Button/Button.mjs.map +1 -1
- package/dist/components/Button/Button.types.d.ts +38 -1
- package/dist/components/Button/Button.types.d.ts.map +1 -1
- package/dist/components/Card/Card.types.d.ts +12 -0
- package/dist/components/Card/Card.types.d.ts.map +1 -1
- package/dist/components/CodeTabs/CodeTabs.styles.d.ts +6 -5
- package/dist/components/CodeTabs/CodeTabs.styles.d.ts.map +1 -1
- package/dist/components/CodeTabs/CodeTabs.styles.js +6 -5
- package/dist/components/CodeTabs/CodeTabs.styles.js.map +1 -1
- package/dist/components/CodeTabs/CodeTabs.styles.mjs +6 -5
- package/dist/components/CodeTabs/CodeTabs.styles.mjs.map +1 -1
- package/dist/components/ColorMode/ColorModeToggle.d.ts +7 -2
- package/dist/components/ColorMode/ColorModeToggle.d.ts.map +1 -1
- package/dist/components/ColorMode/ColorModeToggle.js +8 -3
- package/dist/components/ColorMode/ColorModeToggle.js.map +1 -1
- package/dist/components/ColorMode/ColorModeToggle.mjs +8 -3
- package/dist/components/ColorMode/ColorModeToggle.mjs.map +1 -1
- package/dist/components/Confetti/Confetti.types.d.ts +5 -1
- package/dist/components/Confetti/Confetti.types.d.ts.map +1 -1
- package/dist/components/Confetti/confettiColors.d.ts +5 -5
- package/dist/components/Confetti/confettiColors.js +5 -5
- package/dist/components/Confetti/confettiColors.mjs +5 -5
- package/dist/components/ErrorFallback/ErrorFallback.types.d.ts +6 -0
- package/dist/components/ErrorFallback/ErrorFallback.types.d.ts.map +1 -1
- package/dist/components/Form/FormModalFooter/FormModalFooter.d.ts +1 -1
- package/dist/components/Form/FormModalFooter/FormModalFooter.d.ts.map +1 -1
- package/dist/components/Form/FormModalFooter/FormModalFooter.js +2 -2
- package/dist/components/Form/FormModalFooter/FormModalFooter.js.map +1 -1
- package/dist/components/Form/FormModalFooter/FormModalFooter.mjs +2 -2
- package/dist/components/Form/FormModalFooter/FormModalFooter.mjs.map +1 -1
- package/dist/components/Form/FormModalFooter/FormModalFooter.types.d.ts +11 -1
- package/dist/components/Form/FormModalFooter/FormModalFooter.types.d.ts.map +1 -1
- package/dist/components/Form/FormSection/CollapsibleFormSection.js +1 -0
- package/dist/components/Form/FormSection/CollapsibleFormSection.js.map +1 -1
- package/dist/components/Form/FormSection/CollapsibleFormSection.mjs +1 -0
- package/dist/components/Form/FormSection/CollapsibleFormSection.mjs.map +1 -1
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/Input.js +4 -0
- package/dist/components/Input/Input.js.map +1 -1
- package/dist/components/Input/Input.mjs +4 -0
- package/dist/components/Input/Input.mjs.map +1 -1
- package/dist/components/LineGraph/LineGraph.d.ts.map +1 -1
- package/dist/components/LineGraph/LineGraph.js +4 -5
- package/dist/components/LineGraph/LineGraph.js.map +1 -1
- package/dist/components/LineGraph/LineGraph.mjs +5 -6
- package/dist/components/LineGraph/LineGraph.mjs.map +1 -1
- package/dist/components/LineGraph/LineGraph.types.d.ts +12 -2
- package/dist/components/LineGraph/LineGraph.types.d.ts.map +1 -1
- package/dist/components/LineGraph/seriesColors.d.ts +12 -8
- package/dist/components/LineGraph/seriesColors.d.ts.map +1 -1
- package/dist/components/LineGraph/seriesColors.js +8 -7
- package/dist/components/LineGraph/seriesColors.js.map +1 -1
- package/dist/components/LineGraph/seriesColors.mjs +8 -7
- package/dist/components/LineGraph/seriesColors.mjs.map +1 -1
- package/dist/components/Masonry/Masonry.types.d.ts +8 -3
- package/dist/components/Masonry/Masonry.types.d.ts.map +1 -1
- package/dist/components/Menu/MenuItem.types.d.ts +8 -0
- package/dist/components/Menu/MenuItem.types.d.ts.map +1 -1
- package/dist/components/Modal/ModalCloseButton.d.ts +1 -1
- package/dist/components/Modal/ModalCloseButton.js +1 -1
- package/dist/components/Modal/ModalCloseButton.mjs +1 -1
- package/dist/components/NavList/NavList.d.ts +35 -0
- package/dist/components/NavList/NavList.d.ts.map +1 -0
- package/dist/components/NavList/NavList.js +113 -0
- package/dist/components/NavList/NavList.js.map +1 -0
- package/dist/components/NavList/NavList.mjs +111 -0
- package/dist/components/NavList/NavList.mjs.map +1 -0
- package/dist/components/NavList/NavList.styles.d.ts +90 -0
- package/dist/components/NavList/NavList.styles.d.ts.map +1 -0
- package/dist/components/NavList/NavList.styles.js +104 -0
- package/dist/components/NavList/NavList.styles.js.map +1 -0
- package/dist/components/NavList/NavList.styles.mjs +97 -0
- package/dist/components/NavList/NavList.styles.mjs.map +1 -0
- package/dist/components/NavList/NavList.translations.json.js +19 -0
- package/dist/components/NavList/NavList.translations.json.js.map +1 -0
- package/dist/components/NavList/NavList.translations.json.mjs +14 -0
- package/dist/components/NavList/NavList.translations.json.mjs.map +1 -0
- package/dist/components/NavList/NavList.types.d.ts +140 -0
- package/dist/components/NavList/NavList.types.d.ts.map +1 -0
- package/dist/components/NavList/NavListContext.d.ts +30 -0
- package/dist/components/NavList/NavListContext.d.ts.map +1 -0
- package/dist/components/NavList/NavListContext.js +16 -0
- package/dist/components/NavList/NavListContext.js.map +1 -0
- package/dist/components/NavList/NavListContext.mjs +13 -0
- package/dist/components/NavList/NavListContext.mjs.map +1 -0
- package/dist/components/NavList/NavListGroup.d.ts +31 -0
- package/dist/components/NavList/NavListGroup.d.ts.map +1 -0
- package/dist/components/NavList/NavListGroup.js +115 -0
- package/dist/components/NavList/NavListGroup.js.map +1 -0
- package/dist/components/NavList/NavListGroup.mjs +113 -0
- package/dist/components/NavList/NavListGroup.mjs.map +1 -0
- package/dist/components/NavList/NavListItem.d.ts +16 -0
- package/dist/components/NavList/NavListItem.d.ts.map +1 -0
- package/dist/components/NavList/NavListItem.js +284 -0
- package/dist/components/NavList/NavListItem.js.map +1 -0
- package/dist/components/NavList/NavListItem.mjs +282 -0
- package/dist/components/NavList/NavListItem.mjs.map +1 -0
- package/dist/components/NavList/NavListSkeleton.d.ts +17 -0
- package/dist/components/NavList/NavListSkeleton.d.ts.map +1 -0
- package/dist/components/NavList/NavListSkeleton.js +33 -0
- package/dist/components/NavList/NavListSkeleton.js.map +1 -0
- package/dist/components/NavList/NavListSkeleton.mjs +31 -0
- package/dist/components/NavList/NavListSkeleton.mjs.map +1 -0
- package/dist/components/NavList/index.d.ts +7 -0
- package/dist/components/NavList/index.d.ts.map +1 -0
- package/dist/components/Pagination/Pagination.d.ts +11 -10
- package/dist/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/components/Pagination/Pagination.js +11 -10
- package/dist/components/Pagination/Pagination.js.map +1 -1
- package/dist/components/Pagination/Pagination.mjs +11 -10
- package/dist/components/Pagination/Pagination.mjs.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.types.d.ts +9 -0
- package/dist/components/ProgressBar/ProgressBar.types.d.ts.map +1 -1
- package/dist/components/RadialProgress/RadialProgress.types.d.ts +21 -1
- package/dist/components/RadialProgress/RadialProgress.types.d.ts.map +1 -1
- package/dist/components/SeeMoreButton/SeeMoreButton.types.d.ts +8 -0
- package/dist/components/SeeMoreButton/SeeMoreButton.types.d.ts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.js +6 -7
- package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.mjs +6 -7
- package/dist/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
- package/dist/components/SegmentedProgressBar/SegmentedProgressBar.types.d.ts +2 -0
- package/dist/components/SegmentedProgressBar/SegmentedProgressBar.types.d.ts.map +1 -1
- package/dist/components/Select/Combobox.d.ts +1 -1
- package/dist/components/Select/Combobox.d.ts.map +1 -1
- package/dist/components/Select/Combobox.js +9 -2
- package/dist/components/Select/Combobox.js.map +1 -1
- package/dist/components/Select/Combobox.mjs +10 -3
- package/dist/components/Select/Combobox.mjs.map +1 -1
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.js +14 -2
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Select/Select.mjs +15 -3
- package/dist/components/Select/Select.mjs.map +1 -1
- package/dist/components/Select/Select.styles.d.ts +97 -1
- package/dist/components/Select/Select.styles.d.ts.map +1 -1
- package/dist/components/Select/Select.styles.js +83 -0
- package/dist/components/Select/Select.styles.js.map +1 -1
- package/dist/components/Select/Select.styles.mjs +82 -1
- package/dist/components/Select/Select.styles.mjs.map +1 -1
- package/dist/components/Tabs/Tab/Tab.styles.d.ts +1 -1
- package/dist/components/Tabs/Tab/Tab.styles.js +1 -1
- package/dist/components/Tabs/Tab/Tab.styles.mjs +1 -1
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.js +4 -0
- package/dist/components/Textarea/Textarea.js.map +1 -1
- package/dist/components/Textarea/Textarea.mjs +4 -0
- package/dist/components/Textarea/Textarea.mjs.map +1 -1
- package/dist/components/Toast/Toast.styles.d.ts +6 -2
- package/dist/components/Toast/Toast.styles.d.ts.map +1 -1
- package/dist/components/Toast/Toast.styles.js +18 -10
- package/dist/components/Toast/Toast.styles.js.map +1 -1
- package/dist/components/Toast/Toast.styles.mjs +18 -10
- package/dist/components/Toast/Toast.styles.mjs.map +1 -1
- package/dist/components/Typography/Caption.d.ts.map +1 -1
- package/dist/components/Typography/Caption.js +1 -1
- package/dist/components/Typography/Caption.js.map +1 -1
- package/dist/components/Typography/Caption.mjs +1 -1
- package/dist/components/Typography/Caption.mjs.map +1 -1
- package/dist/components/Typography/H1.d.ts.map +1 -1
- package/dist/components/Typography/H1.js +1 -1
- package/dist/components/Typography/H1.js.map +1 -1
- package/dist/components/Typography/H1.mjs +1 -1
- package/dist/components/Typography/H1.mjs.map +1 -1
- package/dist/components/Typography/H2.d.ts.map +1 -1
- package/dist/components/Typography/H2.js +1 -1
- package/dist/components/Typography/H2.js.map +1 -1
- package/dist/components/Typography/H2.mjs +1 -1
- package/dist/components/Typography/H2.mjs.map +1 -1
- package/dist/components/Typography/H3.d.ts.map +1 -1
- package/dist/components/Typography/H3.js +1 -1
- package/dist/components/Typography/H3.js.map +1 -1
- package/dist/components/Typography/H3.mjs +1 -1
- package/dist/components/Typography/H3.mjs.map +1 -1
- package/dist/components/Typography/H4.d.ts.map +1 -1
- package/dist/components/Typography/H4.js +1 -1
- package/dist/components/Typography/H4.js.map +1 -1
- package/dist/components/Typography/H4.mjs +1 -1
- package/dist/components/Typography/H4.mjs.map +1 -1
- package/dist/components/Typography/H5.d.ts.map +1 -1
- package/dist/components/Typography/H5.js +1 -1
- package/dist/components/Typography/H5.js.map +1 -1
- package/dist/components/Typography/H5.mjs +1 -1
- package/dist/components/Typography/H5.mjs.map +1 -1
- package/dist/components/Typography/Link.d.ts.map +1 -1
- package/dist/components/Typography/Link.js +1 -1
- package/dist/components/Typography/Link.js.map +1 -1
- package/dist/components/Typography/Link.mjs +1 -1
- package/dist/components/Typography/Link.mjs.map +1 -1
- package/dist/components/Typography/Overline.d.ts.map +1 -1
- package/dist/components/Typography/Overline.js +1 -1
- package/dist/components/Typography/Overline.js.map +1 -1
- package/dist/components/Typography/Overline.mjs +1 -1
- package/dist/components/Typography/Overline.mjs.map +1 -1
- package/dist/components/Typography/Subtext.d.ts.map +1 -1
- package/dist/components/Typography/Subtext.js +1 -1
- package/dist/components/Typography/Subtext.js.map +1 -1
- package/dist/components/Typography/Subtext.mjs +1 -1
- package/dist/components/Typography/Subtext.mjs.map +1 -1
- package/dist/components/Typography/Subtitle.d.ts.map +1 -1
- package/dist/components/Typography/Subtitle.js +1 -1
- package/dist/components/Typography/Subtitle.js.map +1 -1
- package/dist/components/Typography/Subtitle.mjs +1 -1
- package/dist/components/Typography/Subtitle.mjs.map +1 -1
- package/dist/components/Typography/Text.d.ts.map +1 -1
- package/dist/components/Typography/Text.js +1 -1
- package/dist/components/Typography/Text.js.map +1 -1
- package/dist/components/Typography/Text.mjs +1 -1
- package/dist/components/Typography/Text.mjs.map +1 -1
- package/dist/hooks/useLanguage.d.ts +5 -0
- package/dist/hooks/useLanguage.d.ts.map +1 -1
- package/dist/hooks/useLanguage.js +7 -3
- package/dist/hooks/useLanguage.js.map +1 -1
- package/dist/hooks/useLanguage.mjs +7 -4
- package/dist/hooks/useLanguage.mjs.map +1 -1
- package/dist/hooks/useTranslate.d.ts.map +1 -1
- package/dist/hooks/useTranslate.js +8 -5
- package/dist/hooks/useTranslate.js.map +1 -1
- package/dist/hooks/useTranslate.mjs +8 -5
- package/dist/hooks/useTranslate.mjs.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -2
- package/dist/index.mjs.map +1 -1
- package/dist/theme/colors.d.ts +2 -2
- package/dist/theme/colors.d.ts.map +1 -1
- package/dist/theme/colors.js +54 -18
- package/dist/theme/colors.js.map +1 -1
- package/dist/theme/colors.mjs +55 -19
- package/dist/theme/colors.mjs.map +1 -1
- package/dist/theme/global.d.ts.map +1 -1
- package/dist/theme/global.js +19 -1
- package/dist/theme/global.js.map +1 -1
- package/dist/theme/global.mjs +19 -1
- package/dist/theme/global.mjs.map +1 -1
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +2 -0
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/index.mjs +2 -0
- package/dist/theme/index.mjs.map +1 -1
- package/dist/theme/palette.generated.d.ts +232 -123
- package/dist/theme/palette.generated.d.ts.map +1 -1
- package/dist/theme/palette.generated.js +233 -123
- package/dist/theme/palette.generated.js.map +1 -1
- package/dist/theme/palette.generated.mjs +233 -124
- package/dist/theme/palette.generated.mjs.map +1 -1
- package/dist/theme/paletteSwatches.d.ts +20 -0
- package/dist/theme/paletteSwatches.d.ts.map +1 -1
- package/dist/theme/recipes/avatar.d.ts +30 -0
- package/dist/theme/recipes/avatar.d.ts.map +1 -0
- package/dist/theme/recipes/avatar.js +96 -0
- package/dist/theme/recipes/avatar.js.map +1 -0
- package/dist/theme/recipes/avatar.mjs +94 -0
- package/dist/theme/recipes/avatar.mjs.map +1 -0
- package/dist/translations/Defaults.translations.json.js +19 -1
- package/dist/translations/Defaults.translations.json.js.map +1 -1
- package/dist/translations/Defaults.translations.json.mjs +18 -2
- package/dist/translations/Defaults.translations.json.mjs.map +1 -1
- package/dist/utils/disabledControl.d.ts +8 -1
- package/dist/utils/disabledControl.d.ts.map +1 -1
- package/dist/utils/disabledControl.js +8 -1
- package/dist/utils/disabledControl.js.map +1 -1
- package/dist/utils/disabledControl.mjs +8 -1
- package/dist/utils/disabledControl.mjs.map +1 -1
- package/dist/utils/focusRing.d.ts +22 -0
- package/dist/utils/focusRing.d.ts.map +1 -1
- package/dist/utils/focusRing.js +22 -0
- package/dist/utils/focusRing.js.map +1 -1
- package/dist/utils/focusRing.mjs +21 -1
- package/dist/utils/focusRing.mjs.map +1 -1
- package/package.json +2 -1
- package/src/components/Accordion/Accordion.stories.tsx +85 -0
- package/src/components/Accordion/Accordion.usage.mdx +200 -0
- package/src/components/Appear/Appear.usage.mdx +107 -0
- package/src/components/Avatar/Avatar.recipe.test.tsx +176 -0
- package/src/components/Avatar/Avatar.stories.tsx +199 -24
- package/src/components/Avatar/Avatar.tsx +118 -21
- package/src/components/Avatar/Avatar.usage.mdx +185 -0
- package/src/components/Avatar/index.tsx +8 -1
- package/src/components/Badge/Badge.stories.tsx +193 -3
- package/src/components/Badge/Badge.tsx +5 -3
- package/src/components/Badge/Badge.types.ts +7 -5
- package/src/components/Badge/Badge.usage.mdx +265 -0
- package/src/components/Banner/Banner.stories.tsx +152 -2
- package/src/components/Banner/Banner.types.ts +30 -1
- package/src/components/Banner/Banner.usage.mdx +233 -0
- package/src/components/BottomSheet/BottomSheet.stories.tsx +168 -1
- package/src/components/BottomSheet/BottomSheet.test.tsx +2 -1
- package/src/components/BottomSheet/BottomSheet.usage.mdx +216 -0
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +59 -0
- package/src/components/Breadcrumb/Breadcrumb.usage.mdx +181 -0
- package/src/components/Button/Button.focusableWhenDisabled.test.tsx +218 -0
- package/src/components/Button/Button.stories.tsx +332 -3
- package/src/components/Button/Button.tsx +46 -3
- package/src/components/Button/Button.types.ts +38 -1
- package/src/components/Button/Button.usage.mdx +358 -0
- package/src/components/Button/Button.variants.test.tsx +13 -1
- package/src/components/Card/Card.stories.tsx +106 -0
- package/src/components/Card/Card.types.ts +12 -0
- package/src/components/Card/Card.usage.mdx +216 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +140 -13
- package/src/components/Checkbox/Checkbox.usage.mdx +214 -0
- package/src/components/Chip/Chip.usage.mdx +78 -0
- package/src/components/Code/Code.stories.tsx +60 -0
- package/src/components/Code/Code.usage.mdx +187 -0
- package/src/components/CodeTabs/CodeTabs.stories.tsx +53 -0
- package/src/components/CodeTabs/CodeTabs.styles.ts +6 -5
- package/src/components/CodeTabs/CodeTabs.usage.mdx +176 -0
- package/src/components/Collapsible/Collapsible.stories.tsx +58 -0
- package/src/components/Collapsible/Collapsible.usage.mdx +173 -0
- package/src/components/ColorMode/ColorMode.stories.tsx +50 -0
- package/src/components/ColorMode/ColorMode.usage.mdx +135 -0
- package/src/components/ColorMode/ColorModeToggle.tsx +10 -3
- package/src/components/Confetti/Confetti.types.ts +5 -1
- package/src/components/Confetti/Confetti.usage.mdx +111 -0
- package/src/components/Confetti/confettiColors.ts +5 -5
- package/src/components/Container/Container.stories.tsx +32 -0
- package/src/components/Container/Container.usage.mdx +130 -0
- package/src/components/CopyableCode/CopyableCode.stories.tsx +62 -0
- package/src/components/CopyableCode/CopyableCode.usage.mdx +168 -0
- package/src/components/CountBadge/CountBadge.stories.tsx +69 -0
- package/src/components/CountBadge/CountBadge.usage.mdx +215 -0
- package/src/components/CountUp/CountUp.usage.mdx +107 -0
- package/src/components/DatePicker/DatePicker.usage.mdx +177 -0
- package/src/components/DatePicker/RangeDatePicker.stories.tsx +87 -3
- package/src/components/ErrorFallback/ErrorFallback.types.ts +6 -0
- package/src/components/ErrorFallback/ErrorFallback.usage.mdx +127 -0
- package/src/components/ExpandableText/ExpandableText.stories.tsx +55 -0
- package/src/components/ExpandableText/ExpandableText.usage.mdx +176 -0
- package/src/components/FileInput/FileInput.stories.tsx +38 -1
- package/src/components/FileInput/FileInput.usage.mdx +178 -0
- package/src/components/FileItem/FileItem.stories.tsx +71 -0
- package/src/components/FileItem/FileItem.usage.mdx +180 -0
- package/src/components/FileList/FileList.stories.tsx +25 -0
- package/src/components/FileList/FileList.usage.mdx +165 -0
- package/src/components/FlyTo/FlyTo.usage.mdx +99 -0
- package/src/components/Form/Form.stories.tsx +149 -0
- package/src/components/Form/Form.usage.mdx +203 -0
- package/src/components/Form/FormModalFooter/FormModalFooter.stories.tsx +1 -1
- package/src/components/Form/FormModalFooter/FormModalFooter.test.tsx +19 -1
- package/src/components/Form/FormModalFooter/FormModalFooter.tsx +2 -0
- package/src/components/Form/FormModalFooter/FormModalFooter.types.ts +11 -1
- package/src/components/FormControl/FormControl.stories.tsx +35 -0
- package/src/components/FormControl/FormControl.usage.mdx +128 -0
- package/src/components/FormIntegration/FormIntegration.usage.mdx +158 -0
- package/src/components/FormLabel/FormLabel.stories.tsx +71 -0
- package/src/components/FormLabel/FormLabel.usage.mdx +125 -0
- package/src/components/Icon/Icon.stories.tsx +61 -1
- package/src/components/Icon/Icon.usage.mdx +158 -0
- package/src/components/IconButton/IconButton.stories.tsx +213 -5
- package/src/components/IconButton/IconButton.usage.mdx +275 -0
- package/src/components/InfoSprinkle/InfoSprinkle.stories.tsx +77 -1
- package/src/components/InfoSprinkle/InfoSprinkle.usage.mdx +189 -0
- package/src/components/InlineCode/InlineCode.stories.tsx +75 -0
- package/src/components/InlineCode/InlineCode.usage.mdx +142 -0
- package/src/components/Input/Input.stories.tsx +180 -0
- package/src/components/Input/Input.tsx +4 -0
- package/src/components/Input/Input.usage.mdx +278 -0
- package/src/components/LineGraph/LineGraph.stories.tsx +112 -0
- package/src/components/LineGraph/LineGraph.tsx +4 -5
- package/src/components/LineGraph/LineGraph.types.ts +12 -2
- package/src/components/LineGraph/LineGraph.usage.mdx +186 -0
- package/src/components/LineGraph/seriesColors.test.ts +10 -9
- package/src/components/LineGraph/seriesColors.ts +18 -16
- package/src/components/Loaders/Loaders.stories.tsx +93 -0
- package/src/components/Loaders/Loaders.usage.mdx +180 -0
- package/src/components/LogicianProvider/LogicianProvider.usage.mdx +98 -0
- package/src/components/Markdown/Markdown.stories.tsx +53 -0
- package/src/components/Markdown/Markdown.usage.mdx +182 -0
- package/src/components/Masonry/Masonry.stories.tsx +63 -1
- package/src/components/Masonry/Masonry.types.ts +8 -3
- package/src/components/Masonry/Masonry.usage.mdx +142 -0
- package/src/components/MaxLengthIndicator/MaxLengthIndicator.stories.tsx +57 -0
- package/src/components/MaxLengthIndicator/MaxLengthIndicator.usage.mdx +125 -0
- package/src/components/Menu/Menu.stories.tsx +146 -2
- package/src/components/Menu/Menu.usage.mdx +238 -0
- package/src/components/Menu/MenuItem.types.ts +8 -0
- package/src/components/Modal/Modal.stories.tsx +177 -1
- package/src/components/Modal/Modal.usage.mdx +262 -0
- package/src/components/Modal/ModalCloseButton.tsx +1 -1
- package/src/components/MonthPicker/MonthPicker.stories.tsx +30 -0
- package/src/components/MonthPicker/MonthPicker.usage.mdx +191 -0
- package/src/components/NavList/NavList.stories.tsx +927 -0
- package/src/components/NavList/NavList.styles.ts +114 -0
- package/src/components/NavList/NavList.test.tsx +1306 -0
- package/src/components/NavList/NavList.translations.json +9 -0
- package/src/components/NavList/NavList.tsx +160 -0
- package/src/components/NavList/NavList.types.ts +155 -0
- package/src/components/NavList/NavList.usage.mdx +545 -0
- package/src/components/NavList/NavListContext.ts +25 -0
- package/src/components/NavList/NavListGroup.tsx +243 -0
- package/src/components/NavList/NavListItem.tsx +543 -0
- package/src/components/NavList/NavListSkeleton.tsx +57 -0
- package/src/components/NavList/index.ts +15 -0
- package/src/components/Pagination/Pagination.stories.tsx +90 -1
- package/src/components/Pagination/Pagination.tsx +11 -10
- package/src/components/Pagination/Pagination.usage.mdx +186 -0
- package/src/components/PasswordInput/PasswordInput.stories.tsx +51 -0
- package/src/components/PasswordInput/PasswordInput.usage.mdx +193 -0
- package/src/components/PinInput/PinInput.stories.tsx +91 -0
- package/src/components/PinInput/PinInput.usage.mdx +194 -0
- package/src/components/Popover/Popover.stories.tsx +104 -1
- package/src/components/Popover/Popover.usage.mdx +197 -0
- package/src/components/ProgressBar/ProgressBar.stories.tsx +92 -1
- package/src/components/ProgressBar/ProgressBar.types.ts +9 -0
- package/src/components/ProgressBar/ProgressBar.usage.mdx +210 -0
- package/src/components/Pulse/Pulse.usage.mdx +102 -0
- package/src/components/RadialProgress/RadialProgress.stories.tsx +74 -1
- package/src/components/RadialProgress/RadialProgress.types.ts +21 -1
- package/src/components/RadialProgress/RadialProgress.usage.mdx +153 -0
- package/src/components/Radio/Radio.stories.tsx +119 -0
- package/src/components/Radio/Radio.usage.mdx +187 -0
- package/src/components/Reveal/Reveal.usage.mdx +105 -0
- package/src/components/ScaledContext/ScaledContext.usage.mdx +111 -0
- package/src/components/SeeMoreButton/SeeMoreButton.stories.tsx +146 -2
- package/src/components/SeeMoreButton/SeeMoreButton.types.ts +8 -0
- package/src/components/SeeMoreButton/SeeMoreButton.usage.mdx +213 -0
- package/src/components/SegmentedControl/SegmentedControl.stories.tsx +69 -0
- package/src/components/SegmentedControl/SegmentedControl.tsx +6 -7
- package/src/components/SegmentedControl/SegmentedControl.usage.mdx +209 -0
- package/src/components/SegmentedProgressBar/SegmentedProgressBar.stories.tsx +54 -0
- package/src/components/SegmentedProgressBar/SegmentedProgressBar.types.ts +2 -0
- package/src/components/SegmentedProgressBar/SegmentedProgressBar.usage.mdx +145 -0
- package/src/components/Select/Combobox.tsx +28 -3
- package/src/components/Select/Select.clearTrigger.test.tsx +76 -0
- package/src/components/Select/Select.stories.tsx +290 -1
- package/src/components/Select/Select.styles.ts +89 -0
- package/src/components/Select/Select.tsx +28 -2
- package/src/components/Select/Select.usage.mdx +341 -0
- package/src/components/Shake/Shake.usage.mdx +107 -0
- package/src/components/Slider/Slider.stories.tsx +116 -0
- package/src/components/Slider/Slider.usage.mdx +179 -0
- package/src/components/Spinner/Spinner.stories.tsx +64 -0
- package/src/components/Spinner/Spinner.usage.mdx +136 -0
- package/src/components/SwapTransition/SwapTransition.usage.mdx +102 -0
- package/src/components/Switch/Switch.stories.tsx +131 -6
- package/src/components/Switch/Switch.usage.mdx +199 -0
- package/src/components/Table/Table.stories.tsx +159 -1
- package/src/components/Table/Table.usage.mdx +235 -0
- package/src/components/Tabs/Tab/Tab.styles.ts +1 -1
- package/src/components/Tabs/Tabs.stories.tsx +86 -0
- package/src/components/Tabs/Tabs.usage.mdx +263 -0
- package/src/components/Tag/Tag.stories.tsx +181 -4
- package/src/components/Tag/Tag.usage.mdx +257 -0
- package/src/components/Textarea/Textarea.stories.tsx +113 -0
- package/src/components/Textarea/Textarea.tsx +4 -0
- package/src/components/Textarea/Textarea.usage.mdx +186 -0
- package/src/components/Toast/Toast.stories.tsx +185 -3
- package/src/components/Toast/Toast.styles.ts +18 -10
- package/src/components/Toast/Toast.usage.mdx +265 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +86 -1
- package/src/components/Tooltip/Tooltip.usage.mdx +219 -0
- package/src/components/Tree/Tree.stories.tsx +89 -0
- package/src/components/Tree/Tree.usage.mdx +207 -0
- package/src/components/Typography/Caption.tsx +0 -1
- package/src/components/Typography/H1.tsx +0 -1
- package/src/components/Typography/H2.tsx +0 -1
- package/src/components/Typography/H3.tsx +0 -1
- package/src/components/Typography/H4.tsx +0 -1
- package/src/components/Typography/H5.tsx +0 -1
- package/src/components/Typography/Link.tsx +0 -1
- package/src/components/Typography/Overline.tsx +0 -1
- package/src/components/Typography/Subtext.tsx +0 -1
- package/src/components/Typography/Subtitle.tsx +0 -1
- package/src/components/Typography/Text.tsx +0 -1
- package/src/components/Typography/Typography.stories.tsx +117 -0
- package/src/components/Typography/Typography.usage.mdx +257 -0
- package/src/components/Workflow/Workflow.usage.mdx +199 -0
- package/src/components/a11y.kwcag.test.tsx +66 -0
- package/src/components/claude.md +1 -1
- package/src/components/noRawScales.test.ts +5 -1
- package/src/foundations/BrandAssets.mdx +637 -0
- package/src/foundations/BrandAssets.stories.tsx +680 -0
- package/src/foundations/BrandColour.mdx +366 -0
- package/src/foundations/BrandColour.stories.tsx +343 -0
- package/src/guidelines/ComponentPageTemplate.mdx +84 -0
- package/src/guidelines/FeedbackActions.mdx +162 -23
- package/src/guidelines/_components/Lang.tsx +175 -0
- package/src/guidelines/_components/TokenTable.tsx +136 -0
- package/src/hooks/useLanguage.ts +8 -3
- package/src/hooks/useTranslate.test.tsx +46 -0
- package/src/hooks/useTranslate.ts +7 -5
- package/src/index.ts +7 -1
- package/src/theme/BazePalette.stories.tsx +111 -1
- package/src/theme/Palette.stories.tsx +2 -2
- package/src/theme/SemanticTokens.mdx +76 -17
- package/src/theme/claude.md +23 -9
- package/src/theme/colors.ts +71 -18
- package/src/theme/contrast.test.ts +57 -0
- package/src/theme/global.ts +20 -1
- package/src/theme/index.ts +2 -0
- package/src/theme/palette.generated.ts +233 -123
- package/src/theme/paletteSwatches.test.ts +1 -1
- package/src/theme/paletteSwatches.ts +35 -0
- package/src/theme/recipes/avatar.ts +92 -0
- package/src/translations/Defaults.translations.json +14 -0
- package/src/utils/disabledControl.ts +8 -1
- package/src/utils/focusRing.ts +23 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { ArgTypes, Canvas, Meta } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import { En, Ko, LangToggle, Verdict } from '../../guidelines/_components/Lang';
|
|
4
|
+
import * as FileListStories from './FileList.stories';
|
|
5
|
+
|
|
6
|
+
<Meta of={FileListStories} name="Usage" />
|
|
7
|
+
|
|
8
|
+
<LangToggle />
|
|
9
|
+
|
|
10
|
+
<En>
|
|
11
|
+
|
|
12
|
+
# FileList
|
|
13
|
+
|
|
14
|
+
A bordered list of `FileItem` rows that shows the first few files and reveals
|
|
15
|
+
more on request.
|
|
16
|
+
|
|
17
|
+
## When to use
|
|
18
|
+
|
|
19
|
+
- The files attached to something: a chatbot's knowledge files, a project's
|
|
20
|
+
uploads, a policy's documents.
|
|
21
|
+
|
|
22
|
+
## When not to use
|
|
23
|
+
|
|
24
|
+
- One file → `FileItem`.
|
|
25
|
+
- Hundreds of files the user searches, sorts or selects → `Table`.
|
|
26
|
+
|
|
27
|
+
## Props
|
|
28
|
+
|
|
29
|
+
</En>
|
|
30
|
+
|
|
31
|
+
<Ko>
|
|
32
|
+
|
|
33
|
+
# FileList
|
|
34
|
+
|
|
35
|
+
`FileItem` 행을 테두리 안에 모아, 처음 몇 개만 보여 주고 요청하면 더 펼치는
|
|
36
|
+
목록입니다.
|
|
37
|
+
|
|
38
|
+
## 언제 쓰나요
|
|
39
|
+
|
|
40
|
+
- 어떤 대상에 붙은 파일들: 챗봇의 지식 파일, 프로젝트에 올린 파일, 정책 문서.
|
|
41
|
+
|
|
42
|
+
## 언제 쓰지 않나요
|
|
43
|
+
|
|
44
|
+
- 파일이 하나라면 `FileItem`을 씁니다.
|
|
45
|
+
- 검색, 정렬, 선택이 필요한 수백 개의 파일은 `Table`을 씁니다.
|
|
46
|
+
|
|
47
|
+
## 속성
|
|
48
|
+
|
|
49
|
+
</Ko>
|
|
50
|
+
|
|
51
|
+
<ArgTypes
|
|
52
|
+
of={FileListStories}
|
|
53
|
+
include={[
|
|
54
|
+
'files',
|
|
55
|
+
'visibleCount',
|
|
56
|
+
'onFileDownload',
|
|
57
|
+
'onFileDelete',
|
|
58
|
+
'stagger',
|
|
59
|
+
]}
|
|
60
|
+
/>
|
|
61
|
+
|
|
62
|
+
<En>
|
|
63
|
+
|
|
64
|
+
- Shows `visibleCount` rows (default 3); the "see more" button adds three at
|
|
65
|
+
a time. With no files it renders nothing.
|
|
66
|
+
- A row gets a download button only when the file has a `fileUrl` and you pass
|
|
67
|
+
`onFileDownload`.
|
|
68
|
+
- `onFileDelete` may return a promise; the row shows a spinner until it
|
|
69
|
+
settles, and a second click on the same row is ignored meanwhile.
|
|
70
|
+
|
|
71
|
+
## Do / Don't
|
|
72
|
+
|
|
73
|
+
</En>
|
|
74
|
+
|
|
75
|
+
<Ko>
|
|
76
|
+
|
|
77
|
+
- `visibleCount`개 행(기본 3개)을 보여 주고, "더 보기" 버튼을 누를 때마다 세 개씩
|
|
78
|
+
늘립니다. 파일이 없으면 아무것도 그리지 않습니다.
|
|
79
|
+
- 내려받기 버튼은 파일에 `fileUrl`이 있고 `onFileDownload`를 넘겼을 때만 생깁니다.
|
|
80
|
+
- `onFileDelete`는 프로미스를 돌려줘도 됩니다. 끝날 때까지 그 행에 스피너가 보이고, 그
|
|
81
|
+
사이 같은 행을 다시 눌러도 무시합니다.
|
|
82
|
+
|
|
83
|
+
## 이렇게 하세요 / 이렇게 하지 마세요
|
|
84
|
+
|
|
85
|
+
</Ko>
|
|
86
|
+
|
|
87
|
+
<Canvas of={FileListStories.DoDownloadAndDelete} />
|
|
88
|
+
<Verdict
|
|
89
|
+
kind="do"
|
|
90
|
+
en="Pass fileUrl for files that can be downloaded and let uploads in progress show their own bar."
|
|
91
|
+
ko="내려받을 수 있는 파일에는 fileUrl을 넘기고, 올리는 중인 파일은 진행 막대가 보이게 둡니다."
|
|
92
|
+
/>
|
|
93
|
+
|
|
94
|
+
<En>
|
|
95
|
+
|
|
96
|
+
## Content
|
|
97
|
+
|
|
98
|
+
- When the list is empty, say so outside it (no files yet, and how to add
|
|
99
|
+
one); FileList renders nothing.
|
|
100
|
+
- Put a heading or label above it that says whose files these are.
|
|
101
|
+
|
|
102
|
+
## Accessibility
|
|
103
|
+
|
|
104
|
+
What FileList does for you:
|
|
105
|
+
|
|
106
|
+
- Renders a real list (`<ul>` / `<li>`), so a screen reader announces the
|
|
107
|
+
number of files (WCAG 1.3.1).
|
|
108
|
+
|
|
109
|
+
Known gaps, and what to do:
|
|
110
|
+
|
|
111
|
+
- **The "see more" button has no focus ring.** Its styles are reset with
|
|
112
|
+
`all: unset`, which removes the outline (WCAG 2.4.7).
|
|
113
|
+
- Its count shows the initial `visibleCount`, not the number of rows on
|
|
114
|
+
screen, after the first click.
|
|
115
|
+
- Rows inherit the `FileItem` gaps (errors in tooltips, English cancel
|
|
116
|
+
label).
|
|
117
|
+
|
|
118
|
+
## Tokens
|
|
119
|
+
|
|
120
|
+
The frame and row dividers are `border.subtle`; the "see more" text and
|
|
121
|
+
chevron are `fg.subtle`. Row colours are listed on the FileItem page.
|
|
122
|
+
|
|
123
|
+
## Related
|
|
124
|
+
|
|
125
|
+
- **FileItem**: one row.
|
|
126
|
+
- **FileInput**: adding files.
|
|
127
|
+
- **Table**: large file sets.
|
|
128
|
+
|
|
129
|
+
</En>
|
|
130
|
+
|
|
131
|
+
<Ko>
|
|
132
|
+
|
|
133
|
+
## 문구
|
|
134
|
+
|
|
135
|
+
- 목록이 비면 FileList는 아무것도 그리지 않으므로, 목록 밖에서 아직 파일이 없다는 것과
|
|
136
|
+
추가하는 방법을 알려 줍니다.
|
|
137
|
+
- 위에 누구의 파일인지 알려 주는 제목이나 라벨을 둡니다.
|
|
138
|
+
|
|
139
|
+
## 접근성
|
|
140
|
+
|
|
141
|
+
FileList가 알아서 하는 일
|
|
142
|
+
|
|
143
|
+
- 실제 목록(`<ul>`·`<li>`)으로 그리므로 화면 낭독기가 파일 개수를 알려 줍니다(WCAG
|
|
144
|
+
1.3.1).
|
|
145
|
+
|
|
146
|
+
알려진 한계와 대처
|
|
147
|
+
|
|
148
|
+
- **"더 보기" 버튼에 초점 표시가 없습니다.** 스타일을 `all: unset`으로 지워서 윤곽선이
|
|
149
|
+
사라집니다(WCAG 2.4.7).
|
|
150
|
+
- 한 번 누른 뒤에도 버튼의 숫자는 화면에 보이는 행 수가 아니라 처음 `visibleCount`를
|
|
151
|
+
보여 줍니다.
|
|
152
|
+
- 각 행은 `FileItem`의 한계(툴팁 속 오류, 영어 취소 버튼 이름)를 그대로 가집니다.
|
|
153
|
+
|
|
154
|
+
## 토큰
|
|
155
|
+
|
|
156
|
+
테두리와 행 구분선은 `border.subtle`, "더 보기" 글자와 화살표는 `fg.subtle`입니다. 행의
|
|
157
|
+
색은 FileItem 페이지에 있습니다.
|
|
158
|
+
|
|
159
|
+
## 관련 컴포넌트
|
|
160
|
+
|
|
161
|
+
- **FileItem**: 한 줄.
|
|
162
|
+
- **FileInput**: 파일 추가.
|
|
163
|
+
- **Table**: 많은 파일.
|
|
164
|
+
|
|
165
|
+
</Ko>
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { ArgTypes, Canvas, Meta } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import { En, Ko, LangToggle } from '../../guidelines/_components/Lang';
|
|
4
|
+
import * as FlyToStories from './FlyTo.stories';
|
|
5
|
+
|
|
6
|
+
<Meta of={FlyToStories} name="Usage" />
|
|
7
|
+
|
|
8
|
+
<LangToggle />
|
|
9
|
+
|
|
10
|
+
<En>
|
|
11
|
+
|
|
12
|
+
# FlyTo
|
|
13
|
+
|
|
14
|
+
Sends a ghost of an element arcing from one rect to another, to say "this went
|
|
15
|
+
there": a reward chip into a balance, a file into a folder.
|
|
16
|
+
|
|
17
|
+
</En>
|
|
18
|
+
|
|
19
|
+
<Ko>
|
|
20
|
+
|
|
21
|
+
# FlyTo
|
|
22
|
+
|
|
23
|
+
요소의 복제본을 한 위치에서 다른 위치로 포물선을 그리며 날려 보내, "이것이 저기로
|
|
24
|
+
갔다"를 보여 줍니다. 보상 칩이 잔액으로, 파일이 폴더로 들어가는 장면에 씁니다.
|
|
25
|
+
|
|
26
|
+
</Ko>
|
|
27
|
+
|
|
28
|
+
<Canvas of={FlyToStories.Default} />
|
|
29
|
+
|
|
30
|
+
<En>
|
|
31
|
+
|
|
32
|
+
## When to use
|
|
33
|
+
|
|
34
|
+
- A reward the reader just earned travels to the balance or counter it adds
|
|
35
|
+
to, and the balance updates when it lands (`onDone`).
|
|
36
|
+
- An item moves to a place that is visible on screen, and seeing it go there
|
|
37
|
+
explains where it went.
|
|
38
|
+
|
|
39
|
+
## When not to use
|
|
40
|
+
|
|
41
|
+
- The target is not on screen, or there is no meaningful source → skip the
|
|
42
|
+
flight and `Pulse` the value that changed.
|
|
43
|
+
- Only a number changed → `CountUp`, optionally inside a `Pulse`.
|
|
44
|
+
- Something new appears in place → `Appear`.
|
|
45
|
+
|
|
46
|
+
## Reduced motion and accessibility
|
|
47
|
+
|
|
48
|
+
- With `prefers-reduced-motion: reduce` nothing flies: FlyTo renders nothing and
|
|
49
|
+
calls `onDone` right after mounting, so whatever the flight was sequencing
|
|
50
|
+
still happens.
|
|
51
|
+
- The ghost is decoration. It renders into a portal at the end of the page, so
|
|
52
|
+
a screen reader can reach a copy of its text there. Pass `aria-hidden` when
|
|
53
|
+
the ghost holds text.
|
|
54
|
+
- The meaning lives in the state change, not the flight. Update the target
|
|
55
|
+
value in `onDone`, and if the reader must hear it, announce it yourself
|
|
56
|
+
(WCAG 4.1.3).
|
|
57
|
+
- The ghost ignores the pointer (`pointer-events: none`), so it never blocks
|
|
58
|
+
a click.
|
|
59
|
+
|
|
60
|
+
## Props
|
|
61
|
+
|
|
62
|
+
`from` and `to` are viewport rects, usually from `getBoundingClientRect()`.
|
|
63
|
+
The caller mounts FlyTo to start a flight and unmounts it in `onDone`.
|
|
64
|
+
|
|
65
|
+
</En>
|
|
66
|
+
|
|
67
|
+
<Ko>
|
|
68
|
+
|
|
69
|
+
## 언제 쓰나요
|
|
70
|
+
|
|
71
|
+
- 사용자가 방금 받은 보상이 그것이 더해질 잔액이나 카운터로 날아가고, 도착하는 순간
|
|
72
|
+
잔액이 바뀔 때(`onDone`).
|
|
73
|
+
- 항목이 화면에 보이는 다른 자리로 옮겨 가고, 날아가는 모습이 어디로 갔는지를 설명해 줄 때.
|
|
74
|
+
|
|
75
|
+
## 언제 쓰지 않나요
|
|
76
|
+
|
|
77
|
+
- 목적지가 화면에 없거나 출발점이 뚜렷하지 않다면 날리지 말고, 바뀐 값에 `Pulse`를
|
|
78
|
+
씁니다.
|
|
79
|
+
- 숫자만 바뀌었다면 `CountUp`을 쓰고, 필요하면 `Pulse`로 감쌉니다.
|
|
80
|
+
- 새 요소가 제자리에 나타난다면 `Appear`를 씁니다.
|
|
81
|
+
|
|
82
|
+
## 동작 줄이기와 접근성
|
|
83
|
+
|
|
84
|
+
- `prefers-reduced-motion: reduce`에서는 아무것도 날지 않습니다. FlyTo는 아무것도
|
|
85
|
+
그리지 않고 마운트 직후 `onDone`을 부르므로, 비행 뒤에 이어지던 일은 그대로 진행됩니다.
|
|
86
|
+
- 복제본은 장식입니다. 페이지 끝의 포털에 그려지므로 화면 낭독기가 거기서 그 글자를 한
|
|
87
|
+
번 더 만날 수 있습니다. 복제본에 글자가 있다면 `aria-hidden`을 넘깁니다.
|
|
88
|
+
- 뜻은 비행이 아니라 상태 변화에 있습니다. `onDone`에서 목적지 값을 바꾸고, 사용자가
|
|
89
|
+
들어야 하는 변화라면 직접 알립니다(WCAG 4.1.3).
|
|
90
|
+
- 복제본은 포인터를 받지 않으므로(`pointer-events: none`) 클릭을 막지 않습니다.
|
|
91
|
+
|
|
92
|
+
## 속성
|
|
93
|
+
|
|
94
|
+
`from`과 `to`는 뷰포트 기준 사각형이며 보통 `getBoundingClientRect()`에서 얻습니다.
|
|
95
|
+
비행을 시작하려면 FlyTo를 마운트하고, `onDone`에서 언마운트합니다.
|
|
96
|
+
|
|
97
|
+
</Ko>
|
|
98
|
+
|
|
99
|
+
<ArgTypes of={FlyToStories} include={['from', 'to', 'lift', 'onDone']} />
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { Box, Dialog } from '@chakra-ui/react';
|
|
3
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
4
|
+
|
|
5
|
+
import { Button } from '../Button';
|
|
6
|
+
import { Input } from '../Input';
|
|
7
|
+
import { SelectField } from '../Select';
|
|
8
|
+
import { Switch } from '../Switch';
|
|
9
|
+
import { Textarea } from '../Textarea';
|
|
10
|
+
import { Subtext } from '../Typography';
|
|
11
|
+
import {
|
|
12
|
+
FieldRow,
|
|
13
|
+
FormFooter,
|
|
14
|
+
FormModalFooter,
|
|
15
|
+
FormScrollArea,
|
|
16
|
+
FormSection,
|
|
17
|
+
} from '.';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The Form building blocks together: `FormSection` groups, `FieldRow` fields,
|
|
21
|
+
* a `FormFooter` pinned under a `FormScrollArea`. Each part has its own story
|
|
22
|
+
* set below this one.
|
|
23
|
+
*/
|
|
24
|
+
const meta = {
|
|
25
|
+
title: 'Components/Form',
|
|
26
|
+
parameters: { layout: 'padded' },
|
|
27
|
+
} satisfies Meta;
|
|
28
|
+
|
|
29
|
+
export default meta;
|
|
30
|
+
|
|
31
|
+
type Story = StoryObj;
|
|
32
|
+
|
|
33
|
+
const MODELS = [
|
|
34
|
+
{ label: 'GPT-5', value: 'gpt-5' },
|
|
35
|
+
{ label: 'Claude Sonnet', value: 'claude-sonnet' },
|
|
36
|
+
{ label: 'Gemini Flash', value: 'gemini-flash' },
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
const SettingsPanel = ({ withErrors = false }: { withErrors?: boolean }) => {
|
|
40
|
+
const [name, setName] = useState(withErrors ? '' : '사내 규정 도우미');
|
|
41
|
+
return (
|
|
42
|
+
<Box
|
|
43
|
+
h="460px"
|
|
44
|
+
w="400px"
|
|
45
|
+
borderWidth="1px"
|
|
46
|
+
borderColor="border.subtle"
|
|
47
|
+
borderRadius="12px"
|
|
48
|
+
overflow="hidden"
|
|
49
|
+
>
|
|
50
|
+
<FormScrollArea>
|
|
51
|
+
<Box p={4} flex={1}>
|
|
52
|
+
<FormSection title="기본 정보" gap={4}>
|
|
53
|
+
<FieldRow
|
|
54
|
+
label="챗봇 이름"
|
|
55
|
+
required
|
|
56
|
+
error={
|
|
57
|
+
withErrors && !name ? '챗봇 이름을 입력해 주세요.' : undefined
|
|
58
|
+
}
|
|
59
|
+
>
|
|
60
|
+
<Input value={name} onChange={(e) => setName(e.target.value)} />
|
|
61
|
+
</FieldRow>
|
|
62
|
+
<FieldRow label="설명" helperText="목록에서 이름 아래에 보입니다.">
|
|
63
|
+
<Textarea rows={3} />
|
|
64
|
+
</FieldRow>
|
|
65
|
+
</FormSection>
|
|
66
|
+
<FormSection title="동작" divider mt={6} gap={4}>
|
|
67
|
+
<FieldRow label="기본 모델">
|
|
68
|
+
<SelectField
|
|
69
|
+
ariaLabel="기본 모델"
|
|
70
|
+
options={MODELS}
|
|
71
|
+
defaultValue="gpt-5"
|
|
72
|
+
/>
|
|
73
|
+
</FieldRow>
|
|
74
|
+
<Switch display="flex" justifyContent="space-between" w="100%">
|
|
75
|
+
<Switch.Label>웹 검색 사용</Switch.Label>
|
|
76
|
+
<Switch.Control />
|
|
77
|
+
</Switch>
|
|
78
|
+
</FormSection>
|
|
79
|
+
</Box>
|
|
80
|
+
<FormFooter
|
|
81
|
+
meta={<Subtext color="fg.muted">오후 2:14에 저장됨</Subtext>}
|
|
82
|
+
action={<Button variant="primary">저장</Button>}
|
|
83
|
+
/>
|
|
84
|
+
</FormScrollArea>
|
|
85
|
+
</Box>
|
|
86
|
+
);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
/** A settings panel: two sections, a pinned footer with meta and action. */
|
|
90
|
+
export const Basic: Story = {
|
|
91
|
+
render: () => <SettingsPanel />,
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
// ───────────────────────── Usage-page specimens ─────────────────────────
|
|
95
|
+
// Pulled into `Form.usage.mdx` with <Canvas of={…} />. Hidden (`!dev`).
|
|
96
|
+
|
|
97
|
+
export const DoErrorsAtTheField: Story = {
|
|
98
|
+
tags: ['!dev'],
|
|
99
|
+
name: 'Usage / Do: errors at the field',
|
|
100
|
+
render: () => <SettingsPanel withErrors />,
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export const DoModalFooter: Story = {
|
|
104
|
+
tags: ['!dev'],
|
|
105
|
+
name: 'Usage / Do: FormModalFooter in a modal form',
|
|
106
|
+
render: () => (
|
|
107
|
+
// `ModalFooter` reads the dialog's style context; a closed root provides it
|
|
108
|
+
// without opening anything.
|
|
109
|
+
<Dialog.Root>
|
|
110
|
+
<Box
|
|
111
|
+
w="480px"
|
|
112
|
+
bg="bg.surface"
|
|
113
|
+
borderWidth="1px"
|
|
114
|
+
borderColor="border.subtle"
|
|
115
|
+
borderRadius="12px"
|
|
116
|
+
>
|
|
117
|
+
<FormModalFooter
|
|
118
|
+
onDelete={() => {}}
|
|
119
|
+
deleteLabel="그룹 삭제"
|
|
120
|
+
onCancel={() => {}}
|
|
121
|
+
cancelLabel="취소"
|
|
122
|
+
submitLabel="저장"
|
|
123
|
+
onSubmit={() => {}}
|
|
124
|
+
/>
|
|
125
|
+
</Box>
|
|
126
|
+
</Dialog.Root>
|
|
127
|
+
),
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export const DontHandRolledFooter: Story = {
|
|
131
|
+
tags: ['!dev'],
|
|
132
|
+
name: "Usage / Don't: a hand-rolled footer",
|
|
133
|
+
render: () => (
|
|
134
|
+
<Box
|
|
135
|
+
w="480px"
|
|
136
|
+
p={4}
|
|
137
|
+
display="flex"
|
|
138
|
+
gap={2}
|
|
139
|
+
bg="bg.surface"
|
|
140
|
+
borderWidth="1px"
|
|
141
|
+
borderColor="border.subtle"
|
|
142
|
+
borderRadius="12px"
|
|
143
|
+
>
|
|
144
|
+
<Button variant="primary">저장</Button>
|
|
145
|
+
<Button variant="danger">그룹 삭제</Button>
|
|
146
|
+
<Button variant="subtle">취소</Button>
|
|
147
|
+
</Box>
|
|
148
|
+
),
|
|
149
|
+
};
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { Canvas, Meta } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import { En, Ko, LangToggle, Verdict } from '../../guidelines/_components/Lang';
|
|
4
|
+
import * as FormStories from './Form.stories';
|
|
5
|
+
|
|
6
|
+
<Meta of={FormStories} name="Usage" />
|
|
7
|
+
|
|
8
|
+
<LangToggle />
|
|
9
|
+
|
|
10
|
+
<En>
|
|
11
|
+
|
|
12
|
+
# Form
|
|
13
|
+
|
|
14
|
+
The layout parts every form shares: fields, sections, a scroll area and the
|
|
15
|
+
footer with the actions.
|
|
16
|
+
|
|
17
|
+
| Part | What it does |
|
|
18
|
+
| ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
19
|
+
| `FieldRow` | One field: label (with `description` and an `endAdornment` slot), the control, `helperText` and `error`. Wraps `FormControl`, so ids and ARIA are wired for you. |
|
|
20
|
+
| `FieldLabel` / `FieldHelp` / `FieldError` | The pieces `FieldRow` is made of, for layouts it does not cover. `FieldError` renders nothing when empty. |
|
|
21
|
+
| `FormSection` | A titled group of fields with one gap (default `4`). `divider` adds a top rule; `collapsible` (with a `title`) turns it into an accordion, and `hasError` flags a collapsed section that hides errors. |
|
|
22
|
+
| `FormSectionHeader` | The section title row (`H5`, description, `titleAdornment`, `action`) on its own. |
|
|
23
|
+
| `FormScrollArea` | A full-height scrolling column, so a sticky footer pins to its bottom. |
|
|
24
|
+
| `FormFooter` | A sticky footer for panel forms: `start` on the left, `meta` (saved time, cost) and `action` on the right. |
|
|
25
|
+
| `FormModalFooter` | The modal footer: optional delete on the far left, Cancel, and a primary submit with its own loading and disabled state. |
|
|
26
|
+
|
|
27
|
+
## When to use
|
|
28
|
+
|
|
29
|
+
- Any settings panel, create or edit modal, or sidebar form. Start with
|
|
30
|
+
`FieldRow` for every field and `FormSection` for every group.
|
|
31
|
+
- `FormFooter` in a panel that scrolls; `FormModalFooter` in a modal.
|
|
32
|
+
|
|
33
|
+
## When not to use
|
|
34
|
+
|
|
35
|
+
- A single search box or filter bar → the control on its own, with an
|
|
36
|
+
`ariaLabel` or visible label.
|
|
37
|
+
- A confirm dialog with no fields → `Modal` with its own footer.
|
|
38
|
+
|
|
39
|
+
## Do / Don't
|
|
40
|
+
|
|
41
|
+
</En>
|
|
42
|
+
|
|
43
|
+
<Ko>
|
|
44
|
+
|
|
45
|
+
# Form
|
|
46
|
+
|
|
47
|
+
모든 폼이 함께 쓰는 배치 부품입니다. 필드, 섹션, 스크롤 영역, 동작 버튼이 있는 푸터가
|
|
48
|
+
있습니다.
|
|
49
|
+
|
|
50
|
+
| 부품 | 하는 일 |
|
|
51
|
+
| ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
52
|
+
| `FieldRow` | 필드 하나. 라벨(`description`, `endAdornment` 자리 포함), 컨트롤, `helperText`, `error`. `FormControl`을 감싸므로 id와 ARIA 연결을 대신 해 줍니다. |
|
|
53
|
+
| `FieldLabel` / `FieldHelp` / `FieldError` | `FieldRow`를 이루는 조각. `FieldRow`로 안 되는 배치에 씁니다. `FieldError`는 비어 있으면 아무것도 그리지 않습니다. |
|
|
54
|
+
| `FormSection` | 제목이 있는 필드 묶음. 간격은 하나로 통일합니다(기본 `4`). `divider`는 위에 구분선을 긋고, `collapsible`(`title` 필요)은 접히는 묶음으로 바꾸며, `hasError`는 접힌 섹션에 숨은 오류를 표시합니다. |
|
|
55
|
+
| `FormSectionHeader` | 섹션 제목 줄(`H5`, 설명, `titleAdornment`, `action`)만 따로 쓸 때. |
|
|
56
|
+
| `FormScrollArea` | 높이를 꽉 채우고 스크롤되는 세로 영역. 붙박이 푸터가 아래에 고정됩니다. |
|
|
57
|
+
| `FormFooter` | 패널 폼의 붙박이 푸터. 왼쪽에 `start`, 오른쪽에 `meta`(저장 시각, 비용)와 `action`. |
|
|
58
|
+
| `FormModalFooter` | 모달 푸터. 맨 왼쪽의 삭제(선택), 취소, 로딩과 비활성 상태를 스스로 가진 기본 제출 버튼. |
|
|
59
|
+
|
|
60
|
+
## 언제 쓰나요
|
|
61
|
+
|
|
62
|
+
- 설정 패널, 만들기·수정 모달, 사이드바 폼 어디서나 씁니다. 필드마다 `FieldRow`를,
|
|
63
|
+
묶음마다 `FormSection`을 먼저 씁니다.
|
|
64
|
+
- 스크롤되는 패널에는 `FormFooter`를, 모달에는 `FormModalFooter`를 씁니다.
|
|
65
|
+
|
|
66
|
+
## 언제 쓰지 않나요
|
|
67
|
+
|
|
68
|
+
- 검색창이나 필터 막대 하나는 컨트롤만 두고 `ariaLabel`이나 보이는 라벨을 붙입니다.
|
|
69
|
+
- 입력란 없이 확인만 받는 대화상자는 `Modal`의 푸터를 씁니다.
|
|
70
|
+
|
|
71
|
+
## 이렇게 하세요 / 이렇게 하지 마세요
|
|
72
|
+
|
|
73
|
+
</Ko>
|
|
74
|
+
|
|
75
|
+
<Canvas of={FormStories.Basic} />
|
|
76
|
+
<Verdict
|
|
77
|
+
kind="do"
|
|
78
|
+
en="Build panels from FormSection and FieldRow, and pin the action in a FormFooter inside a FormScrollArea."
|
|
79
|
+
ko="패널은 FormSection과 FieldRow로 짜고, 동작 버튼은 FormScrollArea 안의 FormFooter에 고정합니다."
|
|
80
|
+
/>
|
|
81
|
+
|
|
82
|
+
<Canvas of={FormStories.DoErrorsAtTheField} />
|
|
83
|
+
<Verdict
|
|
84
|
+
kind="do"
|
|
85
|
+
en="Show each error under its own field with FieldRow error. The field is marked invalid for assistive technology at the same time."
|
|
86
|
+
ko="오류는 FieldRow의 error로 해당 필드 바로 아래에 보여 줍니다. 보조기술에도 그 필드가 오류 상태라고 함께 전달됩니다."
|
|
87
|
+
/>
|
|
88
|
+
|
|
89
|
+
<Canvas of={FormStories.DoModalFooter} />
|
|
90
|
+
<Verdict
|
|
91
|
+
kind="do"
|
|
92
|
+
en="Use FormModalFooter in modals: delete far left, Cancel, then the primary action last."
|
|
93
|
+
ko="모달에는 FormModalFooter를 씁니다. 삭제는 맨 왼쪽, 그다음 취소, 기본 동작은 맨 끝입니다."
|
|
94
|
+
/>
|
|
95
|
+
|
|
96
|
+
<Canvas of={FormStories.DontHandRolledFooter} />
|
|
97
|
+
<Verdict
|
|
98
|
+
kind="dont"
|
|
99
|
+
en="Hand-roll the footer. The order changes from modal to modal, and the danger action ends up next to Save."
|
|
100
|
+
ko="푸터를 직접 만들지 마세요. 모달마다 순서가 달라지고, 위험한 동작이 저장 버튼 옆에 붙게 됩니다."
|
|
101
|
+
/>
|
|
102
|
+
|
|
103
|
+
<En>
|
|
104
|
+
|
|
105
|
+
## Content
|
|
106
|
+
|
|
107
|
+
- Section titles are nouns (기본 정보, 동작). Field rules are on the Input and
|
|
108
|
+
Select pages.
|
|
109
|
+
- Footer labels name the result (저장, 만들기, 그룹 삭제). The design system
|
|
110
|
+
owns no copy: `cancelLabel`, `submitLabel` and `deleteLabel` come from your
|
|
111
|
+
translations.
|
|
112
|
+
- `meta` is a fact, not an instruction: 오후 2:14에 저장됨, 10 크레딧.
|
|
113
|
+
|
|
114
|
+
## Accessibility
|
|
115
|
+
|
|
116
|
+
What these parts do for you:
|
|
117
|
+
|
|
118
|
+
- `FieldRow` associates the label, sets `aria-invalid` when `error` is set,
|
|
119
|
+
and points `aria-describedby` at the helper and error text. `required`
|
|
120
|
+
shows the asterisk and marks the control required.
|
|
121
|
+
- `FormModalFooter` keeps the submit a `type="submit"` button inside a
|
|
122
|
+
`<form>`, so Enter submits; pass `onSubmit` only for a portalled or
|
|
123
|
+
form-less modal. `isSubmitting` disables every button so the modal cannot be
|
|
124
|
+
dismissed mid-request. Pair it with `submitLoadingText` ("Saving") so the
|
|
125
|
+
busy submit button still says what it is doing.
|
|
126
|
+
- A collapsed `FormSection` with `hasError` swaps its chevron for a danger
|
|
127
|
+
glyph, so hidden errors are not missed.
|
|
128
|
+
|
|
129
|
+
What you still have to do:
|
|
130
|
+
|
|
131
|
+
- **Name controls that `FieldRow` cannot reach.** `SelectField`,
|
|
132
|
+
`ComboboxField` and `Slider` take their name from their own label part: pass
|
|
133
|
+
the row's label as `ariaLabel` (`ACCESSIBILITY.md` §1).
|
|
134
|
+
- A flat `FormSection` and `FormSectionHeader` render the title as an `<h5>`. Check
|
|
135
|
+
that the level fits the page outline; where it does not, leave `title` out
|
|
136
|
+
and put your own heading of the right level above the fields (WCAG 1.3.1;
|
|
137
|
+
KWCAG 5.2.4.2 제목 제공).
|
|
138
|
+
- On submit, move focus to the first field with an error, or summarise the
|
|
139
|
+
errors at the top (WCAG 3.3.1).
|
|
140
|
+
|
|
141
|
+
## Tokens
|
|
142
|
+
|
|
143
|
+
Form parts are layout. `FormFooter` uses `bg.surface` with a `border.subtle`
|
|
144
|
+
top rule, `FormSection` `divider` uses `border.subtle`, and `FieldError` uses
|
|
145
|
+
`danger.fg`. Section descriptions and `FieldLabel` descriptions are
|
|
146
|
+
`fg.muted`.
|
|
147
|
+
|
|
148
|
+
## Related
|
|
149
|
+
|
|
150
|
+
- **FormControl** / **FormLabel**: the primitives under `FieldRow`.
|
|
151
|
+
- **FormIntegration**: wiring these to Formik or React Hook Form.
|
|
152
|
+
- **Modal**: `FormModalFooter` sits in `ModalFooter`.
|
|
153
|
+
|
|
154
|
+
</En>
|
|
155
|
+
|
|
156
|
+
<Ko>
|
|
157
|
+
|
|
158
|
+
## 문구
|
|
159
|
+
|
|
160
|
+
- 섹션 제목은 명사로 씁니다(기본 정보, 동작). 필드 문구 규칙은 Input과 Select 페이지에
|
|
161
|
+
있습니다.
|
|
162
|
+
- 푸터 버튼에는 결과를 씁니다(저장, 만들기, 그룹 삭제). 디자인 시스템은 문구를 가지지
|
|
163
|
+
않으므로 `cancelLabel`, `submitLabel`, `deleteLabel`은 앱의 번역에서 넘깁니다.
|
|
164
|
+
- `meta`에는 지시가 아니라 사실을 씁니다. 예: 오후 2:14에 저장됨, 10 크레딧.
|
|
165
|
+
|
|
166
|
+
## 접근성
|
|
167
|
+
|
|
168
|
+
이 부품들이 알아서 하는 일
|
|
169
|
+
|
|
170
|
+
- `FieldRow`는 라벨을 연결하고, `error`가 있으면 `aria-invalid`를 붙이며, 도움말과 오류
|
|
171
|
+
문구를 `aria-describedby`로 가리킵니다. `required`를 주면 별표가 보이고 컨트롤도 필수로
|
|
172
|
+
표시됩니다.
|
|
173
|
+
- `FormModalFooter`는 `<form>` 안에서 제출 버튼을 `type="submit"`으로 두어 Enter로
|
|
174
|
+
제출되게 합니다. `onSubmit`은 포털로 그려지거나 `<form>`이 없는 모달에서만 넘깁니다.
|
|
175
|
+
`isSubmitting`이면 모든 버튼이 비활성이 되어 요청 중에 모달이 닫히지 않습니다.
|
|
176
|
+
`submitLoadingText`("저장 중")를 함께 넘기면 요청 중인 제출 버튼도 무엇을 하는지 말합니다.
|
|
177
|
+
- `hasError`인 `FormSection`이 접혀 있으면 펼침 화살표 대신 위험 표시가 보여 숨은
|
|
178
|
+
오류를 놓치지 않습니다.
|
|
179
|
+
|
|
180
|
+
직접 챙겨야 하는 일
|
|
181
|
+
|
|
182
|
+
- **`FieldRow`가 닿지 않는 컨트롤에는 따로 이름을 줍니다.** `SelectField`,
|
|
183
|
+
`ComboboxField`, `Slider`는 자기 라벨 부품에서 이름을 가져오므로 행의 라벨을
|
|
184
|
+
`ariaLabel`로 넘깁니다(`ACCESSIBILITY.md` 1절).
|
|
185
|
+
- 펼친 `FormSection`과 `FormSectionHeader`는 제목을 `<h5>`로 그립니다. 그 수준이 화면 구조에
|
|
186
|
+
맞는지 확인하고, 맞지 않으면 `title`을 비우고 필드 위에 알맞은 수준의 제목을 직접
|
|
187
|
+
둡니다(WCAG 1.3.1, KWCAG 5.2.4.2 제목 제공).
|
|
188
|
+
- 제출할 때 오류가 있으면 첫 오류 필드로 초점을 옮기거나 위쪽에 오류를 모아 보여
|
|
189
|
+
줍니다(WCAG 3.3.1).
|
|
190
|
+
|
|
191
|
+
## 토큰
|
|
192
|
+
|
|
193
|
+
Form 부품은 배치용입니다. `FormFooter`는 `bg.surface`에 `border.subtle` 윗선을,
|
|
194
|
+
`FormSection`의 `divider`는 `border.subtle`을, `FieldError`는 `danger.fg`를 씁니다.
|
|
195
|
+
섹션 설명과 `FieldLabel` 설명은 `fg.muted`입니다.
|
|
196
|
+
|
|
197
|
+
## 관련 컴포넌트
|
|
198
|
+
|
|
199
|
+
- **FormControl** / **FormLabel**: `FieldRow` 아래의 기본 부품.
|
|
200
|
+
- **FormIntegration**: Formik이나 React Hook Form과 연결하기.
|
|
201
|
+
- **Modal**: `FormModalFooter`는 `ModalFooter` 안에 들어갑니다.
|
|
202
|
+
|
|
203
|
+
</Ko>
|
|
@@ -50,7 +50,7 @@ export const WithDelete: Story = {
|
|
|
50
50
|
|
|
51
51
|
/** Mid-request: spinner on submit, every button disabled. */
|
|
52
52
|
export const Submitting: Story = {
|
|
53
|
-
args: { isSubmitting: true },
|
|
53
|
+
args: { isSubmitting: true, submitLoadingText: 'Saving' },
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
/** Gated submit (e.g. a required field is empty). */
|
|
@@ -20,12 +20,14 @@ vi.mock('@/components/Button', () => ({
|
|
|
20
20
|
type,
|
|
21
21
|
disabled,
|
|
22
22
|
loading,
|
|
23
|
+
loadingText,
|
|
23
24
|
}: {
|
|
24
25
|
children?: ReactNode;
|
|
25
26
|
onClick?: () => void;
|
|
26
27
|
type?: 'button' | 'submit';
|
|
27
28
|
disabled?: boolean;
|
|
28
29
|
loading?: boolean;
|
|
30
|
+
loadingText?: ReactNode;
|
|
29
31
|
}) => (
|
|
30
32
|
<button
|
|
31
33
|
type={type}
|
|
@@ -33,7 +35,7 @@ vi.mock('@/components/Button', () => ({
|
|
|
33
35
|
disabled={disabled}
|
|
34
36
|
data-loading={loading ? 'true' : 'false'}
|
|
35
37
|
>
|
|
36
|
-
{children}
|
|
38
|
+
{loading && loadingText ? loadingText : children}
|
|
37
39
|
</button>
|
|
38
40
|
),
|
|
39
41
|
}));
|
|
@@ -139,6 +141,22 @@ describe('FormModalFooter', () => {
|
|
|
139
141
|
expect(submit).toHaveAttribute('data-loading', 'true');
|
|
140
142
|
});
|
|
141
143
|
|
|
144
|
+
it('names the busy submit button with submitLoadingText', () => {
|
|
145
|
+
render(
|
|
146
|
+
<FormModalFooter
|
|
147
|
+
onCancel={noop}
|
|
148
|
+
onSubmit={noop}
|
|
149
|
+
cancelLabel="Cancel"
|
|
150
|
+
submitLabel="Save"
|
|
151
|
+
submitLoadingText="Saving"
|
|
152
|
+
isSubmitting
|
|
153
|
+
/>
|
|
154
|
+
);
|
|
155
|
+
const submit = screen.getByRole('button', { name: 'Saving' });
|
|
156
|
+
expect(submit).toBeDisabled();
|
|
157
|
+
expect(submit).toHaveAttribute('data-loading', 'true');
|
|
158
|
+
});
|
|
159
|
+
|
|
142
160
|
it('disables only the submit button when submitDisabled is set', () => {
|
|
143
161
|
render(
|
|
144
162
|
<FormModalFooter
|
|
@@ -28,6 +28,7 @@ export const FormModalFooter = ({
|
|
|
28
28
|
submitLabel,
|
|
29
29
|
submitColorPalette = 'primary',
|
|
30
30
|
isSubmitting = false,
|
|
31
|
+
submitLoadingText,
|
|
31
32
|
submitDisabled = false,
|
|
32
33
|
onSubmit,
|
|
33
34
|
bordered = false,
|
|
@@ -73,6 +74,7 @@ export const FormModalFooter = ({
|
|
|
73
74
|
type={onSubmit ? 'button' : 'submit'}
|
|
74
75
|
onClick={onSubmit}
|
|
75
76
|
loading={isSubmitting}
|
|
77
|
+
loadingText={submitLoadingText}
|
|
76
78
|
disabled={isSubmitting || submitDisabled}
|
|
77
79
|
>
|
|
78
80
|
{submitLabel}
|