@heymantle/litho 0.0.3 → 0.0.4
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/dist/cjs/components/ActionList.js +50 -16
- package/dist/cjs/components/AnnouncementBar.js +10 -3
- package/dist/cjs/components/AppProvider.js +10 -1
- package/dist/cjs/components/Autocomplete.js +33 -11
- package/dist/cjs/components/Badge.js +2 -1
- package/dist/cjs/components/Banner.js +35 -31
- package/dist/cjs/components/Box.js +5 -3
- package/dist/cjs/components/Button.js +34 -12
- package/dist/cjs/components/Card.js +5 -45
- package/dist/cjs/components/Checkbox.js +16 -6
- package/dist/cjs/components/ChoiceList.js +7 -4
- package/dist/cjs/components/ColorField.js +8 -3
- package/dist/cjs/components/DatePicker.js +13 -8
- package/dist/cjs/components/DropZone.js +33 -18
- package/dist/cjs/components/EmptyState.js +15 -7
- package/dist/cjs/components/Filters.js +32 -20
- package/dist/cjs/components/FooterHelp.js +7 -2
- package/dist/cjs/components/Form.js +18 -3
- package/dist/cjs/components/Frame.js +40 -15
- package/dist/cjs/components/FrameSaveBar.js +21 -12
- package/dist/cjs/components/Layout.js +3 -3
- package/dist/cjs/components/LayoutSection.js +2 -2
- package/dist/cjs/components/Link.js +6 -2
- package/dist/cjs/components/List.js +1 -0
- package/dist/cjs/components/Listbox.js +9 -4
- package/dist/cjs/components/Modal.js +26 -17
- package/dist/cjs/components/Navigation.js +30 -20
- package/dist/cjs/components/Page.js +8 -3
- package/dist/cjs/components/Pagination.js +11 -4
- package/dist/cjs/components/Pane.js +118 -35
- package/dist/cjs/components/Popover.js +59 -6
- package/dist/cjs/components/RangeSlider.js +11 -4
- package/dist/cjs/components/ResourceList.js +9 -3
- package/dist/cjs/components/Select.js +2 -0
- package/dist/cjs/components/Table.js +32 -19
- package/dist/cjs/components/Text.js +8 -5
- package/dist/cjs/components/TextField.js +23 -13
- package/dist/cjs/components/Thumbnail.js +7 -2
- package/dist/cjs/components/TimePicker.js +7 -2
- package/dist/cjs/components/Tip.js +10 -4
- package/dist/cjs/components/Tooltip.js +16 -8
- package/dist/cjs/components/TopBar.js +17 -9
- package/dist/cjs/dev/verify-publish.js +37 -4
- package/dist/cjs/postcss.config.js +21 -0
- package/dist/cjs/stories/ActionList.stories.js +365 -0
- package/dist/cjs/stories/AnnouncementBar.stories.js +244 -0
- package/dist/cjs/stories/Autocomplete.stories.js +871 -0
- package/dist/cjs/stories/Badge.stories.js +183 -0
- package/dist/cjs/stories/Banner.stories.js +201 -0
- package/dist/cjs/stories/Box.stories.js +599 -0
- package/dist/cjs/stories/Button.stories.js +325 -0
- package/dist/cjs/stories/ButtonGroup.stories.js +404 -0
- package/dist/cjs/stories/Card.stories.js +278 -0
- package/dist/cjs/stories/Checkbox.stories.js +266 -0
- package/dist/cjs/stories/ChoiceList.stories.js +884 -0
- package/dist/cjs/stories/Collapsible.stories.js +905 -0
- package/dist/cjs/stories/ColorField.stories.js +883 -0
- package/dist/cjs/stories/ContextualSaveBar.stories.js +970 -0
- package/dist/cjs/stories/DatePicker.stories.js +584 -0
- package/dist/cjs/stories/Divider.stories.js +759 -0
- package/dist/cjs/stories/DropZone.stories.js +1205 -0
- package/dist/cjs/stories/EmptyState.stories.js +296 -0
- package/dist/cjs/stories/Filters.stories.js +1353 -0
- package/dist/cjs/stories/FooterHelp.stories.js +869 -0
- package/dist/cjs/stories/Form.stories.js +940 -0
- package/dist/cjs/stories/Grid.stories.js +1199 -0
- package/dist/cjs/stories/HorizontalStack.stories.js +1064 -0
- package/dist/cjs/stories/Icon.stories.js +596 -0
- package/dist/cjs/stories/Image.stories.js +883 -0
- package/dist/cjs/stories/InlineError.stories.js +710 -0
- package/dist/cjs/stories/Label.stories.js +665 -0
- package/dist/cjs/stories/Layout.stories.js +685 -0
- package/dist/cjs/stories/LayoutSection.stories.js +1267 -0
- package/dist/cjs/stories/Link.stories.js +423 -0
- package/dist/cjs/stories/List.stories.js +1031 -0
- package/dist/cjs/stories/Listbox.stories.js +820 -0
- package/dist/cjs/stories/Loading.stories.js +900 -0
- package/dist/cjs/stories/Modal.stories.js +363 -0
- package/dist/cjs/stories/Navigation.stories.js +605 -0
- package/dist/cjs/stories/Page.stories.js +318 -0
- package/dist/cjs/stories/Pagination.stories.js +438 -0
- package/dist/cjs/stories/Pane.stories.js +1535 -0
- package/dist/cjs/stories/Popover.stories.js +637 -0
- package/dist/cjs/stories/PopoverManager.stories.js +1225 -0
- package/dist/cjs/stories/ProgressBar.stories.js +506 -0
- package/dist/cjs/stories/RadioButton.stories.js +642 -0
- package/dist/cjs/stories/RadioButtonCard.stories.js +816 -0
- package/dist/cjs/stories/RangeSlider.stories.js +892 -0
- package/dist/cjs/stories/ResourceList.stories.js +1067 -0
- package/dist/cjs/stories/Select.stories.js +413 -0
- package/dist/cjs/stories/SkeletonText.stories.js +776 -0
- package/dist/cjs/stories/Spinner.stories.js +396 -0
- package/dist/cjs/stories/Table.stories.js +628 -0
- package/dist/cjs/stories/Tabs.stories.js +723 -0
- package/dist/cjs/stories/Tag.stories.js +620 -0
- package/dist/cjs/stories/Text.stories.js +262 -0
- package/dist/cjs/stories/TextField.stories.js +377 -0
- package/dist/cjs/stories/Thumbnail.stories.js +859 -0
- package/dist/cjs/stories/TimePicker.stories.js +966 -0
- package/dist/cjs/stories/Tip.stories.js +753 -0
- package/dist/cjs/stories/Tooltip.stories.js +357 -0
- package/dist/cjs/stories/TopBar.stories.js +155 -0
- package/dist/cjs/stories/VerticalStack.stories.js +1287 -0
- package/dist/cjs/tailwind.config.js +17 -0
- package/dist/cjs/utilities/transformers.js +66 -0
- package/dist/cjs/vite.config.js +35 -0
- package/dist/esm/components/ActionList.js +41 -12
- package/dist/esm/components/AnnouncementBar.js +3 -1
- package/dist/esm/components/AppProvider.js +10 -1
- package/dist/esm/components/Autocomplete.js +21 -4
- package/dist/esm/components/Badge.js +2 -2
- package/dist/esm/components/Banner.js +20 -21
- package/dist/esm/components/Box.js +5 -4
- package/dist/esm/components/Button.js +24 -7
- package/dist/esm/components/Card.js +5 -4
- package/dist/esm/components/Checkbox.js +6 -1
- package/dist/esm/components/ChoiceList.js +7 -4
- package/dist/esm/components/ColorField.js +1 -1
- package/dist/esm/components/DatePicker.js +6 -1
- package/dist/esm/components/DropZone.js +14 -4
- package/dist/esm/components/EmptyState.js +4 -1
- package/dist/esm/components/Filters.js +10 -3
- package/dist/esm/components/FooterHelp.js +1 -1
- package/dist/esm/components/Form.js +18 -3
- package/dist/esm/components/Frame.js +18 -6
- package/dist/esm/components/FrameSaveBar.js +10 -6
- package/dist/esm/components/InlineError.js +1 -1
- package/dist/esm/components/Layout.js +4 -4
- package/dist/esm/components/LayoutSection.js +2 -2
- package/dist/esm/components/Link.js +6 -2
- package/dist/esm/components/List.js +1 -0
- package/dist/esm/components/Listbox.js +4 -4
- package/dist/esm/components/Modal.js +8 -4
- package/dist/esm/components/Navigation.js +16 -11
- package/dist/esm/components/Page.js +9 -4
- package/dist/esm/components/Pagination.js +3 -1
- package/dist/esm/components/Pane.js +114 -36
- package/dist/esm/components/Popover.js +18 -6
- package/dist/esm/components/RangeSlider.js +3 -1
- package/dist/esm/components/ResourceList.js +2 -1
- package/dist/esm/components/Select.js +2 -0
- package/dist/esm/components/Table.js +16 -3
- package/dist/esm/components/Text.js +8 -6
- package/dist/esm/components/TextField.js +6 -1
- package/dist/esm/components/Thumbnail.js +1 -1
- package/dist/esm/components/TimePicker.js +1 -1
- package/dist/esm/components/Tip.js +3 -2
- package/dist/esm/components/Tooltip.js +4 -1
- package/dist/esm/components/TopBar.js +7 -4
- package/dist/esm/dev/verify-publish.js +37 -4
- package/dist/esm/postcss.config.js +6 -0
- package/dist/esm/stories/ActionList.stories.js +327 -0
- package/dist/esm/stories/AnnouncementBar.stories.js +212 -0
- package/dist/esm/stories/Autocomplete.stories.js +833 -0
- package/dist/esm/stories/Badge.stories.js +138 -0
- package/dist/esm/stories/Banner.stories.js +159 -0
- package/dist/esm/stories/Box.stories.js +558 -0
- package/dist/esm/stories/Button.stories.js +277 -0
- package/dist/esm/stories/ButtonGroup.stories.js +357 -0
- package/dist/esm/stories/Card.stories.js +240 -0
- package/dist/esm/stories/Checkbox.stories.js +219 -0
- package/dist/esm/stories/ChoiceList.stories.js +834 -0
- package/dist/esm/stories/Collapsible.stories.js +867 -0
- package/dist/esm/stories/ColorField.stories.js +842 -0
- package/dist/esm/stories/ContextualSaveBar.stories.js +938 -0
- package/dist/esm/stories/DatePicker.stories.js +537 -0
- package/dist/esm/stories/Divider.stories.js +715 -0
- package/dist/esm/stories/DropZone.stories.js +1161 -0
- package/dist/esm/stories/EmptyState.stories.js +246 -0
- package/dist/esm/stories/Filters.stories.js +1315 -0
- package/dist/esm/stories/FooterHelp.stories.js +813 -0
- package/dist/esm/stories/Form.stories.js +905 -0
- package/dist/esm/stories/Grid.stories.js +1152 -0
- package/dist/esm/stories/HorizontalStack.stories.js +1011 -0
- package/dist/esm/stories/Icon.stories.js +555 -0
- package/dist/esm/stories/Image.stories.js +836 -0
- package/dist/esm/stories/InlineError.stories.js +666 -0
- package/dist/esm/stories/Label.stories.js +612 -0
- package/dist/esm/stories/Layout.stories.js +647 -0
- package/dist/esm/stories/LayoutSection.stories.js +1226 -0
- package/dist/esm/stories/Link.stories.js +379 -0
- package/dist/esm/stories/List.stories.js +975 -0
- package/dist/esm/stories/Listbox.stories.js +776 -0
- package/dist/esm/stories/Loading.stories.js +850 -0
- package/dist/esm/stories/Modal.stories.js +322 -0
- package/dist/esm/stories/Navigation.stories.js +567 -0
- package/dist/esm/stories/Page.stories.js +276 -0
- package/dist/esm/stories/Pagination.stories.js +394 -0
- package/dist/esm/stories/Pane.stories.js +1497 -0
- package/dist/esm/stories/Popover.stories.js +605 -0
- package/dist/esm/stories/PopoverManager.stories.js +1193 -0
- package/dist/esm/stories/ProgressBar.stories.js +465 -0
- package/dist/esm/stories/RadioButton.stories.js +598 -0
- package/dist/esm/stories/RadioButtonCard.stories.js +772 -0
- package/dist/esm/stories/RangeSlider.stories.js +845 -0
- package/dist/esm/stories/ResourceList.stories.js +1029 -0
- package/dist/esm/stories/Select.stories.js +363 -0
- package/dist/esm/stories/SkeletonText.stories.js +717 -0
- package/dist/esm/stories/Spinner.stories.js +355 -0
- package/dist/esm/stories/Table.stories.js +584 -0
- package/dist/esm/stories/Tabs.stories.js +685 -0
- package/dist/esm/stories/Tag.stories.js +573 -0
- package/dist/esm/stories/Text.stories.js +217 -0
- package/dist/esm/stories/TextField.stories.js +332 -0
- package/dist/esm/stories/Thumbnail.stories.js +806 -0
- package/dist/esm/stories/TimePicker.stories.js +910 -0
- package/dist/esm/stories/Tip.stories.js +706 -0
- package/dist/esm/stories/Tooltip.stories.js +313 -0
- package/dist/esm/stories/TopBar.stories.js +114 -0
- package/dist/esm/stories/VerticalStack.stories.js +1240 -0
- package/dist/esm/tailwind.config.js +7 -0
- package/dist/esm/utilities/transformers.js +47 -0
- package/dist/esm/vite.config.js +20 -0
- package/dist/types/components/ActionList.d.ts +122 -0
- package/dist/types/components/ActionList.d.ts.map +1 -0
- package/dist/types/components/AnnouncementBar.d.ts +21 -0
- package/dist/types/components/AnnouncementBar.d.ts.map +1 -0
- package/dist/types/components/AppProvider.d.ts +61 -0
- package/dist/types/components/AppProvider.d.ts.map +1 -0
- package/dist/types/components/Autocomplete.d.ts +130 -0
- package/dist/types/components/Autocomplete.d.ts.map +1 -0
- package/dist/types/components/Badge.d.ts +21 -0
- package/dist/types/components/Badge.d.ts.map +1 -0
- package/dist/types/components/Banner.d.ts +78 -0
- package/dist/types/components/Banner.d.ts.map +1 -0
- package/dist/types/components/Box.d.ts +70 -0
- package/dist/types/components/Box.d.ts.map +1 -0
- package/dist/types/components/Button.d.ts +123 -0
- package/dist/types/components/Button.d.ts.map +1 -0
- package/dist/types/components/ButtonGroup.d.ts +26 -0
- package/dist/types/components/ButtonGroup.d.ts.map +1 -0
- package/dist/types/components/Card.d.ts +139 -0
- package/dist/types/components/Card.d.ts.map +1 -0
- package/dist/types/components/Checkbox.d.ts +56 -0
- package/dist/types/components/Checkbox.d.ts.map +1 -0
- package/dist/types/components/ChoiceList.d.ts +69 -0
- package/dist/types/components/ChoiceList.d.ts.map +1 -0
- package/dist/types/components/Collapsible.d.ts +17 -0
- package/dist/types/components/Collapsible.d.ts.map +1 -0
- package/dist/types/components/ColorField.d.ts +36 -0
- package/dist/types/components/ColorField.d.ts.map +1 -0
- package/dist/types/components/ContextualSaveBar.d.ts +22 -0
- package/dist/types/components/ContextualSaveBar.d.ts.map +1 -0
- package/dist/types/components/DatePicker.d.ts +66 -0
- package/dist/types/components/DatePicker.d.ts.map +1 -0
- package/dist/types/components/Divider.d.ts +21 -0
- package/dist/types/components/Divider.d.ts.map +1 -0
- package/dist/types/components/DropZone.d.ts +108 -0
- package/dist/types/components/DropZone.d.ts.map +1 -0
- package/dist/types/components/EmptyState.d.ts +52 -0
- package/dist/types/components/EmptyState.d.ts.map +1 -0
- package/dist/types/components/Filters.d.ts +166 -0
- package/dist/types/components/Filters.d.ts.map +1 -0
- package/dist/types/components/FooterHelp.d.ts +21 -0
- package/dist/types/components/FooterHelp.d.ts.map +1 -0
- package/dist/types/components/Form.d.ts +39 -0
- package/dist/types/components/Form.d.ts.map +1 -0
- package/dist/types/components/Frame.d.ts +51 -0
- package/dist/types/components/Frame.d.ts.map +1 -0
- package/dist/types/components/FrameSaveBar.d.ts +8 -0
- package/dist/types/components/FrameSaveBar.d.ts.map +1 -0
- package/dist/types/components/Grid.d.ts +39 -0
- package/dist/types/components/Grid.d.ts.map +1 -0
- package/dist/types/components/HorizontalStack.d.ts +36 -0
- package/dist/types/components/HorizontalStack.d.ts.map +1 -0
- package/dist/types/components/Icon.d.ts +43 -0
- package/dist/types/components/Icon.d.ts.map +1 -0
- package/dist/types/components/Image.d.ts +45 -0
- package/dist/types/components/Image.d.ts.map +1 -0
- package/dist/types/components/InlineError.d.ts +22 -0
- package/dist/types/components/InlineError.d.ts.map +1 -0
- package/dist/types/components/Label.d.ts +28 -0
- package/dist/types/components/Label.d.ts.map +1 -0
- package/dist/types/components/Layout.d.ts +44 -0
- package/dist/types/components/Layout.d.ts.map +1 -0
- package/dist/types/components/LayoutSection.d.ts +24 -0
- package/dist/types/components/LayoutSection.d.ts.map +1 -0
- package/dist/types/components/Link.d.ts +38 -0
- package/dist/types/components/Link.d.ts.map +1 -0
- package/dist/types/components/List.d.ts +33 -0
- package/dist/types/components/List.d.ts.map +1 -0
- package/dist/types/components/Listbox.d.ts +34 -0
- package/dist/types/components/Listbox.d.ts.map +1 -0
- package/dist/types/components/Loading.d.ts +13 -0
- package/dist/types/components/Loading.d.ts.map +1 -0
- package/dist/types/components/Modal.d.ts +75 -0
- package/dist/types/components/Modal.d.ts.map +1 -0
- package/dist/types/components/Navigation.d.ts +105 -0
- package/dist/types/components/Navigation.d.ts.map +1 -0
- package/dist/types/components/Page.d.ts +59 -0
- package/dist/types/components/Page.d.ts.map +1 -0
- package/dist/types/components/Pagination.d.ts +39 -0
- package/dist/types/components/Pagination.d.ts.map +1 -0
- package/dist/types/components/Pane.d.ts +11 -0
- package/dist/types/components/Pane.d.ts.map +1 -0
- package/dist/types/components/Popover.d.ts +56 -0
- package/dist/types/components/Popover.d.ts.map +1 -0
- package/dist/types/components/PopoverManager.d.ts +3 -0
- package/dist/types/components/PopoverManager.d.ts.map +1 -0
- package/dist/types/components/ProgressBar.d.ts +24 -0
- package/dist/types/components/ProgressBar.d.ts.map +1 -0
- package/dist/types/components/RadioButton.d.ts +39 -0
- package/dist/types/components/RadioButton.d.ts.map +1 -0
- package/dist/types/components/RadioButtonCard.d.ts +41 -0
- package/dist/types/components/RadioButtonCard.d.ts.map +1 -0
- package/dist/types/components/RangeSlider.d.ts +44 -0
- package/dist/types/components/RangeSlider.d.ts.map +1 -0
- package/dist/types/components/ResourceList.d.ts +54 -0
- package/dist/types/components/ResourceList.d.ts.map +1 -0
- package/dist/types/components/Select.d.ts +48 -0
- package/dist/types/components/Select.d.ts.map +1 -0
- package/dist/types/components/SkeletonText.d.ts +28 -0
- package/dist/types/components/SkeletonText.d.ts.map +1 -0
- package/dist/types/components/Spinner.d.ts +18 -0
- package/dist/types/components/Spinner.d.ts.map +1 -0
- package/dist/types/components/Table.d.ts +197 -0
- package/dist/types/components/Table.d.ts.map +1 -0
- package/dist/types/components/Tabs.d.ts +41 -0
- package/dist/types/components/Tabs.d.ts.map +1 -0
- package/dist/types/components/Tag.d.ts +26 -0
- package/dist/types/components/Tag.d.ts.map +1 -0
- package/dist/types/components/Text.d.ts +32 -0
- package/dist/types/components/Text.d.ts.map +1 -0
- package/dist/types/components/TextField.d.ts +109 -0
- package/dist/types/components/TextField.d.ts.map +1 -0
- package/dist/types/components/Thumbnail.d.ts +18 -0
- package/dist/types/components/Thumbnail.d.ts.map +1 -0
- package/dist/types/components/TimePicker.d.ts +3 -0
- package/dist/types/components/TimePicker.d.ts.map +1 -0
- package/dist/types/components/Tip.d.ts +23 -0
- package/dist/types/components/Tip.d.ts.map +1 -0
- package/dist/types/components/Tooltip.d.ts +84 -0
- package/dist/types/components/Tooltip.d.ts.map +1 -0
- package/dist/types/components/TopBar.d.ts +43 -0
- package/dist/types/components/TopBar.d.ts.map +1 -0
- package/dist/types/components/VerticalStack.d.ts +27 -0
- package/dist/types/components/VerticalStack.d.ts.map +1 -0
- package/dist/types/index.d.ts +62 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/styles/Table.d.ts +1570 -0
- package/dist/types/styles/Table.d.ts.map +1 -0
- package/dist/types/utilities/dates.d.ts +46 -0
- package/dist/types/utilities/dates.d.ts.map +1 -0
- package/dist/types/utilities/transformers.d.ts +4 -0
- package/dist/types/utilities/transformers.d.ts.map +1 -0
- package/dist/types/utilities/useIndexResourceState.d.ts +21 -0
- package/dist/types/utilities/useIndexResourceState.d.ts.map +1 -0
- package/dist/types/utilities/useMounted.d.ts +2 -0
- package/dist/types/utilities/useMounted.d.ts.map +1 -0
- package/dist/types/utilities/useTableScrollState.d.ts +29 -0
- package/dist/types/utilities/useTableScrollState.d.ts.map +1 -0
- package/index.css +6 -0
- package/package.json +37 -6
|
@@ -0,0 +1,884 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get Default () {
|
|
13
|
+
return Default;
|
|
14
|
+
},
|
|
15
|
+
get Disabled () {
|
|
16
|
+
return Disabled;
|
|
17
|
+
},
|
|
18
|
+
get FormValidation () {
|
|
19
|
+
return FormValidation;
|
|
20
|
+
},
|
|
21
|
+
get MultipleSelection () {
|
|
22
|
+
return MultipleSelection;
|
|
23
|
+
},
|
|
24
|
+
get ProductCategories () {
|
|
25
|
+
return ProductCategories;
|
|
26
|
+
},
|
|
27
|
+
get SingleSelection () {
|
|
28
|
+
return SingleSelection;
|
|
29
|
+
},
|
|
30
|
+
get SubscriptionPlan () {
|
|
31
|
+
return SubscriptionPlan;
|
|
32
|
+
},
|
|
33
|
+
get SurveyForm () {
|
|
34
|
+
return SurveyForm;
|
|
35
|
+
},
|
|
36
|
+
get WithError () {
|
|
37
|
+
return WithError;
|
|
38
|
+
},
|
|
39
|
+
get WithHelpText () {
|
|
40
|
+
return WithHelpText;
|
|
41
|
+
},
|
|
42
|
+
get default () {
|
|
43
|
+
return _default;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
var _jsxruntime = require("react/jsx-runtime");
|
|
47
|
+
var _react = require("react");
|
|
48
|
+
var _ChoiceList = /*#__PURE__*/ _interop_require_default(require("../components/ChoiceList.js"));
|
|
49
|
+
var _Text = /*#__PURE__*/ _interop_require_default(require("../components/Text.js"));
|
|
50
|
+
var _Card = /*#__PURE__*/ _interop_require_default(require("../components/Card.js"));
|
|
51
|
+
var _Button = /*#__PURE__*/ _interop_require_default(require("../components/Button.js"));
|
|
52
|
+
var _transformers = require("../utilities/transformers.js");
|
|
53
|
+
var _VerticalStack = /*#__PURE__*/ _interop_require_default(require("../components/VerticalStack.js"));
|
|
54
|
+
var _HorizontalStack = /*#__PURE__*/ _interop_require_default(require("../components/HorizontalStack.js"));
|
|
55
|
+
var _Badge = /*#__PURE__*/ _interop_require_default(require("../components/Badge.js"));
|
|
56
|
+
function _array_like_to_array(arr, len) {
|
|
57
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
58
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
59
|
+
return arr2;
|
|
60
|
+
}
|
|
61
|
+
function _array_with_holes(arr) {
|
|
62
|
+
if (Array.isArray(arr)) return arr;
|
|
63
|
+
}
|
|
64
|
+
function _define_property(obj, key, value) {
|
|
65
|
+
if (key in obj) {
|
|
66
|
+
Object.defineProperty(obj, key, {
|
|
67
|
+
value: value,
|
|
68
|
+
enumerable: true,
|
|
69
|
+
configurable: true,
|
|
70
|
+
writable: true
|
|
71
|
+
});
|
|
72
|
+
} else {
|
|
73
|
+
obj[key] = value;
|
|
74
|
+
}
|
|
75
|
+
return obj;
|
|
76
|
+
}
|
|
77
|
+
function _interop_require_default(obj) {
|
|
78
|
+
return obj && obj.__esModule ? obj : {
|
|
79
|
+
default: obj
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function _iterable_to_array_limit(arr, i) {
|
|
83
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
84
|
+
if (_i == null) return;
|
|
85
|
+
var _arr = [];
|
|
86
|
+
var _n = true;
|
|
87
|
+
var _d = false;
|
|
88
|
+
var _s, _e;
|
|
89
|
+
try {
|
|
90
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
91
|
+
_arr.push(_s.value);
|
|
92
|
+
if (i && _arr.length === i) break;
|
|
93
|
+
}
|
|
94
|
+
} catch (err) {
|
|
95
|
+
_d = true;
|
|
96
|
+
_e = err;
|
|
97
|
+
} finally{
|
|
98
|
+
try {
|
|
99
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
100
|
+
} finally{
|
|
101
|
+
if (_d) throw _e;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return _arr;
|
|
105
|
+
}
|
|
106
|
+
function _non_iterable_rest() {
|
|
107
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
108
|
+
}
|
|
109
|
+
function _object_spread(target) {
|
|
110
|
+
for(var i = 1; i < arguments.length; i++){
|
|
111
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
112
|
+
var ownKeys = Object.keys(source);
|
|
113
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
114
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
115
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
116
|
+
}));
|
|
117
|
+
}
|
|
118
|
+
ownKeys.forEach(function(key) {
|
|
119
|
+
_define_property(target, key, source[key]);
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
return target;
|
|
123
|
+
}
|
|
124
|
+
function ownKeys(object, enumerableOnly) {
|
|
125
|
+
var keys = Object.keys(object);
|
|
126
|
+
if (Object.getOwnPropertySymbols) {
|
|
127
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
128
|
+
if (enumerableOnly) {
|
|
129
|
+
symbols = symbols.filter(function(sym) {
|
|
130
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
keys.push.apply(keys, symbols);
|
|
134
|
+
}
|
|
135
|
+
return keys;
|
|
136
|
+
}
|
|
137
|
+
function _object_spread_props(target, source) {
|
|
138
|
+
source = source != null ? source : {};
|
|
139
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
140
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
141
|
+
} else {
|
|
142
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
143
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
return target;
|
|
147
|
+
}
|
|
148
|
+
function _sliced_to_array(arr, i) {
|
|
149
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
150
|
+
}
|
|
151
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
152
|
+
if (!o) return;
|
|
153
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
154
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
155
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
156
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
157
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
158
|
+
}
|
|
159
|
+
var _default = {
|
|
160
|
+
title: "Litho/ChoiceList",
|
|
161
|
+
component: _ChoiceList.default,
|
|
162
|
+
parameters: {
|
|
163
|
+
layout: "padded",
|
|
164
|
+
docs: {
|
|
165
|
+
description: {
|
|
166
|
+
component: "A ChoiceList component that allows users to select one or multiple options from a list of choices. ChoiceLists support both single and multiple selection modes with customizable styling."
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
args: {
|
|
171
|
+
title: "Choose an option",
|
|
172
|
+
choices: [
|
|
173
|
+
{
|
|
174
|
+
label: "Option 1",
|
|
175
|
+
value: "option1"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
label: "Option 2",
|
|
179
|
+
value: "option2"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
label: "Option 3",
|
|
183
|
+
value: "option3"
|
|
184
|
+
}
|
|
185
|
+
],
|
|
186
|
+
selected: []
|
|
187
|
+
},
|
|
188
|
+
tags: [
|
|
189
|
+
"autodocs"
|
|
190
|
+
],
|
|
191
|
+
argTypes: {
|
|
192
|
+
title: {
|
|
193
|
+
control: "text",
|
|
194
|
+
description: "Title for the choice list"
|
|
195
|
+
},
|
|
196
|
+
titleHidden: {
|
|
197
|
+
control: "boolean",
|
|
198
|
+
description: "Whether to hide the title visually"
|
|
199
|
+
},
|
|
200
|
+
choices: {
|
|
201
|
+
control: "object",
|
|
202
|
+
description: "Array of choice objects with label, value, and optional properties",
|
|
203
|
+
table: {
|
|
204
|
+
type: {
|
|
205
|
+
summary: "Array<ChoiceListItem>",
|
|
206
|
+
detail: "{\n value: string;\n label: string;\n disabled?: boolean;\n helpText?: string;\n tooltip?: React.ReactNode;\n renderChildren?: () => React.ReactNode;\n}"
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
selected: {
|
|
211
|
+
control: "object",
|
|
212
|
+
description: "Array of currently selected values"
|
|
213
|
+
},
|
|
214
|
+
allowMultiple: {
|
|
215
|
+
control: "boolean",
|
|
216
|
+
description: "Whether multiple selections are allowed (uses checkboxes) or single selection (uses radio buttons)"
|
|
217
|
+
},
|
|
218
|
+
disabled: {
|
|
219
|
+
control: "boolean",
|
|
220
|
+
description: "Whether the entire choice list is disabled"
|
|
221
|
+
},
|
|
222
|
+
error: {
|
|
223
|
+
control: "text",
|
|
224
|
+
description: "Error message to display for validation"
|
|
225
|
+
},
|
|
226
|
+
name: {
|
|
227
|
+
control: "text",
|
|
228
|
+
description: "Name attribute for the choice inputs (used for grouping radio buttons)"
|
|
229
|
+
},
|
|
230
|
+
tooltip: {
|
|
231
|
+
control: "object",
|
|
232
|
+
description: "Tooltip content for the choice list title"
|
|
233
|
+
},
|
|
234
|
+
onChange: {
|
|
235
|
+
action: "selectionChanged",
|
|
236
|
+
description: "Callback when selection changes, receives updated array of selected values"
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
var Default = {
|
|
241
|
+
render: function(args) {
|
|
242
|
+
var _useState = _sliced_to_array((0, _react.useState)(args.selected), 2), selected = _useState[0], setSelected = _useState[1];
|
|
243
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_Card.default, {
|
|
244
|
+
padded: true,
|
|
245
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ChoiceList.default, _object_spread_props(_object_spread({}, args), {
|
|
246
|
+
selected: selected,
|
|
247
|
+
onChange: function(newSelected) {
|
|
248
|
+
var _args_onChange;
|
|
249
|
+
setSelected(newSelected);
|
|
250
|
+
(_args_onChange = args.onChange) === null || _args_onChange === void 0 ? void 0 : _args_onChange.call(args, newSelected);
|
|
251
|
+
}
|
|
252
|
+
}))
|
|
253
|
+
});
|
|
254
|
+
},
|
|
255
|
+
parameters: {
|
|
256
|
+
docs: {
|
|
257
|
+
description: {
|
|
258
|
+
story: "Default choice list with single selection mode."
|
|
259
|
+
},
|
|
260
|
+
source: {
|
|
261
|
+
transform: _transformers.transformStorySource
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
var SingleSelection = {
|
|
267
|
+
args: {
|
|
268
|
+
title: "Select your plan",
|
|
269
|
+
allowMultiple: false,
|
|
270
|
+
choices: [
|
|
271
|
+
{
|
|
272
|
+
label: "Basic Plan - $9/month",
|
|
273
|
+
value: "basic"
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
label: "Pro Plan - $29/month",
|
|
277
|
+
value: "pro"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
label: "Enterprise Plan - $99/month",
|
|
281
|
+
value: "enterprise"
|
|
282
|
+
}
|
|
283
|
+
],
|
|
284
|
+
selected: [
|
|
285
|
+
"basic"
|
|
286
|
+
]
|
|
287
|
+
},
|
|
288
|
+
render: function(args) {
|
|
289
|
+
var _useState = _sliced_to_array((0, _react.useState)(args.selected), 2), selected = _useState[0], setSelected = _useState[1];
|
|
290
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_Card.default, {
|
|
291
|
+
padded: true,
|
|
292
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ChoiceList.default, _object_spread_props(_object_spread({}, args), {
|
|
293
|
+
selected: selected,
|
|
294
|
+
onChange: setSelected
|
|
295
|
+
}))
|
|
296
|
+
});
|
|
297
|
+
},
|
|
298
|
+
parameters: {
|
|
299
|
+
docs: {
|
|
300
|
+
description: {
|
|
301
|
+
story: "Choice lists can be restricted to single selection mode."
|
|
302
|
+
},
|
|
303
|
+
source: {
|
|
304
|
+
transform: _transformers.transformStorySource
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
var MultipleSelection = {
|
|
310
|
+
args: {
|
|
311
|
+
title: "Select features",
|
|
312
|
+
allowMultiple: true,
|
|
313
|
+
choices: [
|
|
314
|
+
{
|
|
315
|
+
label: "Email notifications",
|
|
316
|
+
value: "email"
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
label: "SMS notifications",
|
|
320
|
+
value: "sms"
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
label: "Push notifications",
|
|
324
|
+
value: "push"
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
label: "Weekly digest",
|
|
328
|
+
value: "digest"
|
|
329
|
+
}
|
|
330
|
+
],
|
|
331
|
+
selected: [
|
|
332
|
+
"email",
|
|
333
|
+
"push"
|
|
334
|
+
]
|
|
335
|
+
},
|
|
336
|
+
render: function(args) {
|
|
337
|
+
var _useState = _sliced_to_array((0, _react.useState)(args.selected), 2), selected = _useState[0], setSelected = _useState[1];
|
|
338
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_Card.default, {
|
|
339
|
+
padded: true,
|
|
340
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ChoiceList.default, _object_spread_props(_object_spread({}, args), {
|
|
341
|
+
selected: selected,
|
|
342
|
+
onChange: setSelected
|
|
343
|
+
}))
|
|
344
|
+
});
|
|
345
|
+
},
|
|
346
|
+
parameters: {
|
|
347
|
+
docs: {
|
|
348
|
+
description: {
|
|
349
|
+
story: "Choice lists can allow multiple selections with checkboxes."
|
|
350
|
+
},
|
|
351
|
+
source: {
|
|
352
|
+
transform: _transformers.transformStorySource
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
var WithHelpText = {
|
|
358
|
+
render: function() {
|
|
359
|
+
var _useState = _sliced_to_array((0, _react.useState)([
|
|
360
|
+
"standard"
|
|
361
|
+
]), 2), selected = _useState[0], setSelected = _useState[1];
|
|
362
|
+
var choices = [
|
|
363
|
+
{
|
|
364
|
+
label: "Standard Shipping",
|
|
365
|
+
value: "standard",
|
|
366
|
+
helpText: "5-7 business days • Free"
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
label: "Express Shipping",
|
|
370
|
+
value: "express",
|
|
371
|
+
helpText: "2-3 business days • $9.99"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
label: "Overnight Shipping",
|
|
375
|
+
value: "overnight",
|
|
376
|
+
helpText: "Next business day • $24.99"
|
|
377
|
+
}
|
|
378
|
+
];
|
|
379
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_Card.default, {
|
|
380
|
+
padded: true,
|
|
381
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ChoiceList.default, {
|
|
382
|
+
title: "Shipping method",
|
|
383
|
+
choices: choices,
|
|
384
|
+
selected: selected,
|
|
385
|
+
onChange: setSelected,
|
|
386
|
+
allowMultiple: false
|
|
387
|
+
})
|
|
388
|
+
});
|
|
389
|
+
},
|
|
390
|
+
parameters: {
|
|
391
|
+
docs: {
|
|
392
|
+
description: {
|
|
393
|
+
story: "Choice options can include help text for additional context."
|
|
394
|
+
},
|
|
395
|
+
source: {
|
|
396
|
+
transform: _transformers.transformStorySource
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
};
|
|
401
|
+
var WithError = {
|
|
402
|
+
args: {
|
|
403
|
+
title: "Required selection",
|
|
404
|
+
error: "Please select at least one option",
|
|
405
|
+
choices: [
|
|
406
|
+
{
|
|
407
|
+
label: "Option A",
|
|
408
|
+
value: "a"
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
label: "Option B",
|
|
412
|
+
value: "b"
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
label: "Option C",
|
|
416
|
+
value: "c"
|
|
417
|
+
}
|
|
418
|
+
],
|
|
419
|
+
selected: []
|
|
420
|
+
},
|
|
421
|
+
render: function(args) {
|
|
422
|
+
var _useState = _sliced_to_array((0, _react.useState)(args.selected), 2), selected = _useState[0], setSelected = _useState[1];
|
|
423
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_Card.default, {
|
|
424
|
+
padded: true,
|
|
425
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ChoiceList.default, _object_spread_props(_object_spread({}, args), {
|
|
426
|
+
selected: selected,
|
|
427
|
+
onChange: setSelected
|
|
428
|
+
}))
|
|
429
|
+
});
|
|
430
|
+
},
|
|
431
|
+
parameters: {
|
|
432
|
+
docs: {
|
|
433
|
+
description: {
|
|
434
|
+
story: "Choice lists can display error states for validation."
|
|
435
|
+
},
|
|
436
|
+
source: {
|
|
437
|
+
transform: _transformers.transformStorySource
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
};
|
|
442
|
+
var Disabled = {
|
|
443
|
+
args: {
|
|
444
|
+
title: "Disabled choice list",
|
|
445
|
+
disabled: true,
|
|
446
|
+
choices: [
|
|
447
|
+
{
|
|
448
|
+
label: "Option 1",
|
|
449
|
+
value: "option1"
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
label: "Option 2",
|
|
453
|
+
value: "option2"
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
label: "Option 3",
|
|
457
|
+
value: "option3"
|
|
458
|
+
}
|
|
459
|
+
],
|
|
460
|
+
selected: [
|
|
461
|
+
"option1"
|
|
462
|
+
]
|
|
463
|
+
},
|
|
464
|
+
render: function(args) {
|
|
465
|
+
var _useState = _sliced_to_array((0, _react.useState)(args.selected), 2), selected = _useState[0], setSelected = _useState[1];
|
|
466
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_Card.default, {
|
|
467
|
+
padded: true,
|
|
468
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ChoiceList.default, _object_spread_props(_object_spread({}, args), {
|
|
469
|
+
selected: selected,
|
|
470
|
+
onChange: setSelected
|
|
471
|
+
}))
|
|
472
|
+
});
|
|
473
|
+
},
|
|
474
|
+
parameters: {
|
|
475
|
+
docs: {
|
|
476
|
+
description: {
|
|
477
|
+
story: "Choice lists can be disabled to prevent interaction."
|
|
478
|
+
},
|
|
479
|
+
source: {
|
|
480
|
+
transform: _transformers.transformStorySource
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
};
|
|
485
|
+
var ProductCategories = {
|
|
486
|
+
render: function() {
|
|
487
|
+
var _useState = _sliced_to_array((0, _react.useState)([
|
|
488
|
+
"electronics",
|
|
489
|
+
"books"
|
|
490
|
+
]), 2), selectedCategories = _useState[0], setSelectedCategories = _useState[1];
|
|
491
|
+
var categories = [
|
|
492
|
+
{
|
|
493
|
+
label: "Electronics",
|
|
494
|
+
value: "electronics"
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
label: "Books",
|
|
498
|
+
value: "books"
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
label: "Clothing",
|
|
502
|
+
value: "clothing"
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
label: "Home & Garden",
|
|
506
|
+
value: "home-garden"
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
label: "Sports & Outdoors",
|
|
510
|
+
value: "sports"
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
label: "Toys & Games",
|
|
514
|
+
value: "toys"
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
label: "Health & Beauty",
|
|
518
|
+
value: "health"
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
label: "Automotive",
|
|
522
|
+
value: "automotive"
|
|
523
|
+
}
|
|
524
|
+
];
|
|
525
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_Card.default, {
|
|
526
|
+
title: "Product Filter",
|
|
527
|
+
padded: true,
|
|
528
|
+
children: [
|
|
529
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_ChoiceList.default, {
|
|
530
|
+
title: "Categories",
|
|
531
|
+
choices: categories,
|
|
532
|
+
selected: selectedCategories,
|
|
533
|
+
onChange: setSelectedCategories,
|
|
534
|
+
allowMultiple: true
|
|
535
|
+
}),
|
|
536
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_VerticalStack.default, {
|
|
537
|
+
gap: "1",
|
|
538
|
+
children: [
|
|
539
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
|
|
540
|
+
variant: "headingSm",
|
|
541
|
+
children: "Selected: "
|
|
542
|
+
}),
|
|
543
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_HorizontalStack.default, {
|
|
544
|
+
gap: "1",
|
|
545
|
+
children: selectedCategories.map(function(category) {
|
|
546
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_Badge.default, {
|
|
547
|
+
children: category
|
|
548
|
+
}, category);
|
|
549
|
+
})
|
|
550
|
+
})
|
|
551
|
+
]
|
|
552
|
+
})
|
|
553
|
+
]
|
|
554
|
+
});
|
|
555
|
+
},
|
|
556
|
+
parameters: {
|
|
557
|
+
docs: {
|
|
558
|
+
description: {
|
|
559
|
+
story: "Real-world example of using choice lists for product category filtering."
|
|
560
|
+
},
|
|
561
|
+
source: {
|
|
562
|
+
transform: _transformers.transformStorySource
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
};
|
|
567
|
+
var SubscriptionPlan = {
|
|
568
|
+
render: function() {
|
|
569
|
+
var _useState = _sliced_to_array((0, _react.useState)([
|
|
570
|
+
"pro"
|
|
571
|
+
]), 2), selectedPlan = _useState[0], setSelectedPlan = _useState[1];
|
|
572
|
+
var plans = [
|
|
573
|
+
{
|
|
574
|
+
label: "Starter",
|
|
575
|
+
value: "starter",
|
|
576
|
+
helpText: "Perfect for individuals • $0/month • 5 projects • 1GB storage"
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
label: "Professional",
|
|
580
|
+
value: "pro",
|
|
581
|
+
helpText: "For small teams • $29/month • Unlimited projects • 100GB storage"
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
label: "Enterprise",
|
|
585
|
+
value: "enterprise",
|
|
586
|
+
helpText: "For large organizations • $99/month • Advanced features • 1TB storage"
|
|
587
|
+
}
|
|
588
|
+
];
|
|
589
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_Card.default, {
|
|
590
|
+
title: "Choose Your Plan",
|
|
591
|
+
children: [
|
|
592
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Card.default.Section, {
|
|
593
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ChoiceList.default, {
|
|
594
|
+
title: "Subscription plans",
|
|
595
|
+
choices: plans,
|
|
596
|
+
selected: selectedPlan,
|
|
597
|
+
onChange: setSelectedPlan,
|
|
598
|
+
allowMultiple: false
|
|
599
|
+
})
|
|
600
|
+
}),
|
|
601
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Card.default.Section, {
|
|
602
|
+
subdued: true,
|
|
603
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_VerticalStack.default, {
|
|
604
|
+
gap: "2",
|
|
605
|
+
children: [
|
|
606
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
|
|
607
|
+
variant: "headingSm",
|
|
608
|
+
children: "Plan Summary"
|
|
609
|
+
}),
|
|
610
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
|
|
611
|
+
children: selectedPlan.length > 0 ? "You've selected the ".concat(selectedPlan[0], " plan.") : "No plan selected."
|
|
612
|
+
}),
|
|
613
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Button.default, {
|
|
614
|
+
primary: true,
|
|
615
|
+
children: "Continue to Payment"
|
|
616
|
+
})
|
|
617
|
+
]
|
|
618
|
+
})
|
|
619
|
+
})
|
|
620
|
+
]
|
|
621
|
+
});
|
|
622
|
+
},
|
|
623
|
+
parameters: {
|
|
624
|
+
docs: {
|
|
625
|
+
description: {
|
|
626
|
+
story: "Subscription plan selection with detailed plan information."
|
|
627
|
+
},
|
|
628
|
+
source: {
|
|
629
|
+
transform: _transformers.transformStorySource
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
var SurveyForm = {
|
|
635
|
+
render: function() {
|
|
636
|
+
var _useState = _sliced_to_array((0, _react.useState)([]), 2), satisfaction = _useState[0], setSatisfaction = _useState[1];
|
|
637
|
+
var _useState1 = _sliced_to_array((0, _react.useState)([]), 2), features = _useState1[0], setFeatures = _useState1[1];
|
|
638
|
+
var _useState2 = _sliced_to_array((0, _react.useState)([]), 2), improvements = _useState2[0], setImprovements = _useState2[1];
|
|
639
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_Card.default, {
|
|
640
|
+
title: "Product Feedback Survey",
|
|
641
|
+
children: [
|
|
642
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Card.default.Section, {
|
|
643
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_VerticalStack.default, {
|
|
644
|
+
gap: "2",
|
|
645
|
+
children: [
|
|
646
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_ChoiceList.default, {
|
|
647
|
+
title: "How satisfied are you with our product?",
|
|
648
|
+
choices: [
|
|
649
|
+
{
|
|
650
|
+
label: "Very satisfied",
|
|
651
|
+
value: "very-satisfied"
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
label: "Satisfied",
|
|
655
|
+
value: "satisfied"
|
|
656
|
+
},
|
|
657
|
+
{
|
|
658
|
+
label: "Neutral",
|
|
659
|
+
value: "neutral"
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
label: "Dissatisfied",
|
|
663
|
+
value: "dissatisfied"
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
label: "Very dissatisfied",
|
|
667
|
+
value: "very-dissatisfied"
|
|
668
|
+
}
|
|
669
|
+
],
|
|
670
|
+
selected: satisfaction,
|
|
671
|
+
onChange: setSatisfaction,
|
|
672
|
+
allowMultiple: false
|
|
673
|
+
}),
|
|
674
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_ChoiceList.default, {
|
|
675
|
+
title: "Which features do you use most? (Select all that apply)",
|
|
676
|
+
choices: [
|
|
677
|
+
{
|
|
678
|
+
label: "Dashboard analytics",
|
|
679
|
+
value: "analytics"
|
|
680
|
+
},
|
|
681
|
+
{
|
|
682
|
+
label: "Team collaboration",
|
|
683
|
+
value: "collaboration"
|
|
684
|
+
},
|
|
685
|
+
{
|
|
686
|
+
label: "File sharing",
|
|
687
|
+
value: "file-sharing"
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
label: "Project templates",
|
|
691
|
+
value: "templates"
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
label: "Mobile app",
|
|
695
|
+
value: "mobile"
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
label: "API integrations",
|
|
699
|
+
value: "api"
|
|
700
|
+
}
|
|
701
|
+
],
|
|
702
|
+
selected: features,
|
|
703
|
+
onChange: setFeatures,
|
|
704
|
+
allowMultiple: true
|
|
705
|
+
}),
|
|
706
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_ChoiceList.default, {
|
|
707
|
+
title: "What areas need improvement? (Select all that apply)",
|
|
708
|
+
choices: [
|
|
709
|
+
{
|
|
710
|
+
label: "User interface design",
|
|
711
|
+
value: "ui-design"
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
label: "Performance speed",
|
|
715
|
+
value: "performance"
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
label: "Documentation",
|
|
719
|
+
value: "documentation"
|
|
720
|
+
},
|
|
721
|
+
{
|
|
722
|
+
label: "Customer support",
|
|
723
|
+
value: "support"
|
|
724
|
+
},
|
|
725
|
+
{
|
|
726
|
+
label: "Pricing",
|
|
727
|
+
value: "pricing"
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
label: "Feature completeness",
|
|
731
|
+
value: "features"
|
|
732
|
+
}
|
|
733
|
+
],
|
|
734
|
+
selected: improvements,
|
|
735
|
+
onChange: setImprovements,
|
|
736
|
+
allowMultiple: true
|
|
737
|
+
})
|
|
738
|
+
]
|
|
739
|
+
})
|
|
740
|
+
}),
|
|
741
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Card.default.Section, {
|
|
742
|
+
subdued: true,
|
|
743
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_HorizontalStack.default, {
|
|
744
|
+
gap: "1",
|
|
745
|
+
children: [
|
|
746
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Button.default, {
|
|
747
|
+
primary: true,
|
|
748
|
+
children: "Submit Survey"
|
|
749
|
+
}),
|
|
750
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Button.default, {
|
|
751
|
+
children: "Save as Draft"
|
|
752
|
+
})
|
|
753
|
+
]
|
|
754
|
+
})
|
|
755
|
+
})
|
|
756
|
+
]
|
|
757
|
+
});
|
|
758
|
+
},
|
|
759
|
+
parameters: {
|
|
760
|
+
docs: {
|
|
761
|
+
description: {
|
|
762
|
+
story: "Complex survey form using multiple choice lists with different selection modes."
|
|
763
|
+
},
|
|
764
|
+
source: {
|
|
765
|
+
transform: _transformers.transformStorySource
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
};
|
|
770
|
+
var FormValidation = {
|
|
771
|
+
render: function() {
|
|
772
|
+
var _useState = _sliced_to_array((0, _react.useState)([]), 2), preferences = _useState[0], setPreferences = _useState[1];
|
|
773
|
+
var _useState1 = _sliced_to_array((0, _react.useState)([]), 2), communication = _useState1[0], setCommunication = _useState1[1];
|
|
774
|
+
var _useState2 = _sliced_to_array((0, _react.useState)({}), 2), errors = _useState2[0], setErrors = _useState2[1];
|
|
775
|
+
var handleSubmit = function() {
|
|
776
|
+
var newErrors = {};
|
|
777
|
+
if (preferences.length === 0) {
|
|
778
|
+
newErrors.preferences = "Please select at least one preference";
|
|
779
|
+
}
|
|
780
|
+
if (communication.length === 0) {
|
|
781
|
+
newErrors.communication = "Please select a communication method";
|
|
782
|
+
}
|
|
783
|
+
setErrors(newErrors);
|
|
784
|
+
if (Object.keys(newErrors).length === 0) {
|
|
785
|
+
console.log("Form submitted successfully");
|
|
786
|
+
}
|
|
787
|
+
};
|
|
788
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_Card.default, {
|
|
789
|
+
title: "User Preferences",
|
|
790
|
+
children: [
|
|
791
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_Card.default.Section, {
|
|
792
|
+
children: [
|
|
793
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_ChoiceList.default, {
|
|
794
|
+
title: "Marketing preferences",
|
|
795
|
+
choices: [
|
|
796
|
+
{
|
|
797
|
+
label: "Product updates",
|
|
798
|
+
value: "product-updates"
|
|
799
|
+
},
|
|
800
|
+
{
|
|
801
|
+
label: "Special offers",
|
|
802
|
+
value: "offers"
|
|
803
|
+
},
|
|
804
|
+
{
|
|
805
|
+
label: "Newsletter",
|
|
806
|
+
value: "newsletter"
|
|
807
|
+
},
|
|
808
|
+
{
|
|
809
|
+
label: "Event invitations",
|
|
810
|
+
value: "events"
|
|
811
|
+
}
|
|
812
|
+
],
|
|
813
|
+
selected: preferences,
|
|
814
|
+
onChange: function(selected) {
|
|
815
|
+
setPreferences(selected);
|
|
816
|
+
if (errors.preferences && selected.length > 0) {
|
|
817
|
+
setErrors(function(prev) {
|
|
818
|
+
return _object_spread_props(_object_spread({}, prev), {
|
|
819
|
+
preferences: ""
|
|
820
|
+
});
|
|
821
|
+
});
|
|
822
|
+
}
|
|
823
|
+
},
|
|
824
|
+
allowMultiple: true,
|
|
825
|
+
error: errors.preferences
|
|
826
|
+
}),
|
|
827
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_ChoiceList.default, {
|
|
828
|
+
title: "Preferred communication method",
|
|
829
|
+
choices: [
|
|
830
|
+
{
|
|
831
|
+
label: "Email",
|
|
832
|
+
value: "email"
|
|
833
|
+
},
|
|
834
|
+
{
|
|
835
|
+
label: "SMS",
|
|
836
|
+
value: "sms"
|
|
837
|
+
},
|
|
838
|
+
{
|
|
839
|
+
label: "Phone call",
|
|
840
|
+
value: "phone"
|
|
841
|
+
},
|
|
842
|
+
{
|
|
843
|
+
label: "Mail",
|
|
844
|
+
value: "mail"
|
|
845
|
+
}
|
|
846
|
+
],
|
|
847
|
+
selected: communication,
|
|
848
|
+
onChange: function(selected) {
|
|
849
|
+
setCommunication(selected);
|
|
850
|
+
if (errors.communication && selected.length > 0) {
|
|
851
|
+
setErrors(function(prev) {
|
|
852
|
+
return _object_spread_props(_object_spread({}, prev), {
|
|
853
|
+
communication: ""
|
|
854
|
+
});
|
|
855
|
+
});
|
|
856
|
+
}
|
|
857
|
+
},
|
|
858
|
+
allowMultiple: false,
|
|
859
|
+
error: errors.communication
|
|
860
|
+
})
|
|
861
|
+
]
|
|
862
|
+
}),
|
|
863
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Card.default.Section, {
|
|
864
|
+
subdued: true,
|
|
865
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Button.default, {
|
|
866
|
+
primary: true,
|
|
867
|
+
onClick: handleSubmit,
|
|
868
|
+
children: "Save Preferences"
|
|
869
|
+
})
|
|
870
|
+
})
|
|
871
|
+
]
|
|
872
|
+
});
|
|
873
|
+
},
|
|
874
|
+
parameters: {
|
|
875
|
+
docs: {
|
|
876
|
+
description: {
|
|
877
|
+
story: "Form validation example with error handling for required choice lists."
|
|
878
|
+
},
|
|
879
|
+
source: {
|
|
880
|
+
transform: _transformers.transformStorySource
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
};
|