@heymantle/litho 0.0.15 → 0.0.16
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/AI_COMPONENTS_GUIDE.md +28 -15
- package/AI_INTEGRATION_GUIDE.md +3 -3
- package/AI_PATTERNS_GUIDE.md +59 -25
- package/COMPONENT_QUICK_REFERENCE.md +3 -3
- package/dist/cjs/components/ActionList.js +33 -25
- package/dist/cjs/components/AnnouncementBar.js +115 -18
- package/dist/cjs/components/AnnouncementCard.js +269 -0
- package/dist/cjs/components/AppProvider.js +15 -2
- package/dist/cjs/components/Autocomplete.js +58 -36
- package/dist/cjs/components/Badge.js +28 -14
- package/dist/cjs/components/Banner.js +37 -27
- package/dist/cjs/components/Box.js +50 -38
- package/dist/cjs/components/Button.js +338 -109
- package/dist/cjs/components/ButtonGroup.js +27 -14
- package/dist/cjs/components/Card.js +311 -143
- package/dist/cjs/components/Checkbox.js +55 -47
- package/dist/cjs/components/CheckboxCard.js +222 -0
- package/dist/cjs/components/CheckboxCardGroup.js +384 -0
- package/dist/cjs/components/ChoiceList.js +21 -11
- package/dist/cjs/components/Code.js +22 -8
- package/dist/cjs/components/Collapsible.js +24 -11
- package/dist/cjs/components/ColorField.js +163 -38
- package/dist/cjs/components/ContextualSaveBar.js +13 -6
- package/dist/cjs/components/DatePicker.js +48 -37
- package/dist/cjs/components/Disclosure.js +35 -22
- package/dist/cjs/components/Divider.js +82 -18
- package/dist/cjs/components/DropZone.js +111 -37
- package/dist/cjs/components/EmptyState.js +18 -6
- package/dist/cjs/components/Filters.js +84 -36
- package/dist/cjs/components/FooterHelp.js +14 -4
- package/dist/cjs/components/Form.js +13 -2
- package/dist/cjs/components/Frame.js +57 -22
- package/dist/cjs/components/FrameSaveBar.js +37 -6
- package/dist/cjs/components/Grid.js +31 -15
- package/dist/cjs/components/HorizontalStack.js +38 -25
- package/dist/cjs/components/Icon.js +683 -61
- package/dist/cjs/components/Image.js +35 -22
- package/dist/cjs/components/InlineError.js +19 -10
- package/dist/cjs/components/Label.js +21 -12
- package/dist/cjs/components/Layout.js +33 -24
- package/dist/cjs/components/LayoutSection.js +84 -22
- package/dist/cjs/components/Link.js +35 -22
- package/dist/cjs/components/List.js +28 -12
- package/dist/cjs/components/Listbox.js +53 -31
- package/dist/cjs/components/Loading.js +14 -2
- package/dist/cjs/components/Modal.js +22 -40
- package/dist/cjs/components/Navigation.js +107 -36
- package/dist/cjs/components/Page.js +44 -31
- package/dist/cjs/components/Pagination.js +20 -5
- package/dist/cjs/components/Pane.js +67 -4
- package/dist/cjs/components/Popover.js +37 -21
- package/dist/cjs/components/PopoverManager.js +14 -1
- package/dist/cjs/components/ProgressBar.js +28 -15
- package/dist/cjs/components/RadioButton.js +32 -24
- package/dist/cjs/components/RadioButtonCard.js +92 -67
- package/dist/cjs/components/RadioButtonCardGroup.js +379 -0
- package/dist/cjs/components/RangeSlider.js +34 -26
- package/dist/cjs/components/ResourceList.js +28 -14
- package/dist/cjs/components/Select.js +38 -26
- package/dist/cjs/components/SkeletonText.js +33 -18
- package/dist/cjs/components/Spinner.js +24 -12
- package/dist/cjs/components/Stack.js +131 -71
- package/dist/cjs/components/TabNavigation.js +27 -1
- package/dist/cjs/components/Table.js +58 -18
- package/dist/cjs/components/Tabs.js +52 -23
- package/dist/cjs/components/Tag.js +37 -16
- package/dist/cjs/components/Text.js +32 -18
- package/dist/cjs/components/TextField.js +119 -69
- package/dist/cjs/components/Thumbnail.js +25 -11
- package/dist/cjs/components/TimePicker.js +22 -1
- package/dist/cjs/components/Tip.js +140 -25
- package/dist/cjs/components/ToastNotification.js +107 -34
- package/dist/cjs/components/ToastProvider.js +13 -3
- package/dist/cjs/components/Tooltip.js +50 -41
- package/dist/cjs/components/TopBar.js +83 -9
- package/dist/cjs/components/VerticalStack.js +31 -16
- package/dist/cjs/index.js +24 -0
- package/dist/cjs/stories/Autocomplete.stories.js +10 -10
- package/dist/cjs/stories/Checkbox.stories.js +6 -8
- package/dist/cjs/stories/CheckboxCardGroup.stories.js +459 -0
- package/dist/cjs/stories/Collapsible.stories.js +11 -11
- package/dist/cjs/stories/ColorField.stories.js +2 -3
- package/dist/cjs/stories/ComplexExamples.stories.js +48 -77
- package/dist/cjs/stories/ContextualSaveBar.stories.js +1 -1
- package/dist/cjs/stories/Divider.stories.js +15 -16
- package/dist/cjs/stories/DropZone.stories.js +3 -3
- package/dist/cjs/stories/FooterHelp.stories.js +3 -4
- package/dist/cjs/stories/Form.stories.js +2 -4
- package/dist/cjs/stories/Grid.stories.js +24 -33
- package/dist/cjs/stories/Icon.stories.js +22 -23
- package/dist/cjs/stories/Image.stories.js +12 -15
- package/dist/cjs/stories/InlineError.stories.js +0 -1
- package/dist/cjs/stories/Layout.stories.js +96 -2
- package/dist/cjs/stories/LayoutSection.stories.js +13 -18
- package/dist/cjs/stories/List.stories.js +24 -28
- package/dist/cjs/stories/Listbox.stories.js +2 -2
- package/dist/cjs/stories/Loading.stories.js +21 -25
- package/dist/cjs/stories/Modal.stories.js +0 -1
- package/dist/cjs/stories/Pagination.stories.js +4 -4
- package/dist/cjs/stories/Pane.stories.js +10 -18
- package/dist/cjs/stories/Popover.stories.js +7 -7
- package/dist/cjs/stories/PopoverManager.stories.js +9 -9
- package/dist/cjs/stories/ProgressBar.stories.js +8 -8
- package/dist/cjs/stories/RadioButton.stories.js +2 -2
- package/dist/cjs/stories/RadioButtonCard.stories.js +2 -2
- package/dist/cjs/stories/RadioButtonCardGroup.stories.js +502 -0
- package/dist/cjs/stories/RangeSlider.stories.js +1 -3
- package/dist/cjs/stories/ResourceList.stories.js +13 -13
- package/dist/cjs/stories/Spinner.stories.js +9 -9
- package/dist/cjs/stories/Stack.stories.js +233 -51
- package/dist/cjs/stories/Tabs.stories.js +2 -2
- package/dist/cjs/stories/Tag.stories.js +1 -1
- package/dist/cjs/stories/Thumbnail.stories.js +17 -18
- package/dist/cjs/stories/TimePicker.stories.js +0 -5
- package/dist/cjs/stories/Tip.stories.js +1 -1
- package/dist/esm/components/ActionList.js +33 -25
- package/dist/esm/components/AnnouncementBar.js +115 -18
- package/dist/esm/components/AnnouncementCard.js +254 -0
- package/dist/esm/components/AppProvider.js +15 -2
- package/dist/esm/components/Autocomplete.js +58 -36
- package/dist/esm/components/Badge.js +28 -14
- package/dist/esm/components/Banner.js +37 -27
- package/dist/esm/components/Box.js +50 -38
- package/dist/esm/components/Button.js +338 -109
- package/dist/esm/components/ButtonGroup.js +27 -14
- package/dist/esm/components/Card.js +300 -140
- package/dist/esm/components/Checkbox.js +55 -47
- package/dist/esm/components/CheckboxCard.js +207 -0
- package/dist/esm/components/CheckboxCardGroup.js +370 -0
- package/dist/esm/components/ChoiceList.js +21 -11
- package/dist/esm/components/Code.js +22 -8
- package/dist/esm/components/Collapsible.js +24 -11
- package/dist/esm/components/ColorField.js +165 -40
- package/dist/esm/components/ContextualSaveBar.js +13 -6
- package/dist/esm/components/DatePicker.js +48 -37
- package/dist/esm/components/Disclosure.js +35 -22
- package/dist/esm/components/Divider.js +78 -20
- package/dist/esm/components/DropZone.js +111 -37
- package/dist/esm/components/EmptyState.js +18 -6
- package/dist/esm/components/Filters.js +84 -36
- package/dist/esm/components/FooterHelp.js +14 -4
- package/dist/esm/components/Form.js +13 -2
- package/dist/esm/components/Frame.js +57 -22
- package/dist/esm/components/FrameSaveBar.js +37 -6
- package/dist/esm/components/Grid.js +31 -15
- package/dist/esm/components/HorizontalStack.js +38 -25
- package/dist/esm/components/Icon.js +681 -62
- package/dist/esm/components/Image.js +35 -22
- package/dist/esm/components/InlineError.js +19 -10
- package/dist/esm/components/Label.js +21 -12
- package/dist/esm/components/Layout.js +58 -25
- package/dist/esm/components/LayoutSection.js +84 -22
- package/dist/esm/components/Link.js +35 -22
- package/dist/esm/components/List.js +28 -12
- package/dist/esm/components/Listbox.js +53 -31
- package/dist/esm/components/Loading.js +14 -2
- package/dist/esm/components/Modal.js +69 -41
- package/dist/esm/components/Navigation.js +107 -36
- package/dist/esm/components/Page.js +44 -31
- package/dist/esm/components/Pagination.js +20 -5
- package/dist/esm/components/Pane.js +67 -4
- package/dist/esm/components/Popover.js +37 -21
- package/dist/esm/components/PopoverManager.js +14 -1
- package/dist/esm/components/ProgressBar.js +28 -15
- package/dist/esm/components/RadioButton.js +32 -24
- package/dist/esm/components/RadioButtonCard.js +92 -67
- package/dist/esm/components/RadioButtonCardGroup.js +364 -0
- package/dist/esm/components/RangeSlider.js +34 -26
- package/dist/esm/components/ResourceList.js +28 -14
- package/dist/esm/components/Select.js +38 -26
- package/dist/esm/components/SkeletonText.js +33 -18
- package/dist/esm/components/Spinner.js +24 -12
- package/dist/esm/components/Stack.js +131 -71
- package/dist/esm/components/TabNavigation.js +27 -1
- package/dist/esm/components/Table.js +58 -18
- package/dist/esm/components/Tabs.js +52 -23
- package/dist/esm/components/Tag.js +37 -16
- package/dist/esm/components/Text.js +32 -18
- package/dist/esm/components/TextField.js +119 -69
- package/dist/esm/components/Thumbnail.js +25 -11
- package/dist/esm/components/TimePicker.js +22 -1
- package/dist/esm/components/Tip.js +140 -25
- package/dist/esm/components/ToastNotification.js +107 -34
- package/dist/esm/components/ToastProvider.js +13 -3
- package/dist/esm/components/Tooltip.js +50 -41
- package/dist/esm/components/TopBar.js +83 -9
- package/dist/esm/components/VerticalStack.js +31 -16
- package/dist/esm/index.js +6 -0
- package/dist/esm/stories/Autocomplete.stories.js +10 -10
- package/dist/esm/stories/Checkbox.stories.js +6 -8
- package/dist/esm/stories/CheckboxCardGroup.stories.js +421 -0
- package/dist/esm/stories/Collapsible.stories.js +11 -11
- package/dist/esm/stories/ColorField.stories.js +2 -3
- package/dist/esm/stories/ComplexExamples.stories.js +48 -77
- package/dist/esm/stories/ContextualSaveBar.stories.js +1 -1
- package/dist/esm/stories/Divider.stories.js +15 -16
- package/dist/esm/stories/DropZone.stories.js +3 -3
- package/dist/esm/stories/FooterHelp.stories.js +3 -4
- package/dist/esm/stories/Form.stories.js +2 -4
- package/dist/esm/stories/Grid.stories.js +24 -33
- package/dist/esm/stories/Icon.stories.js +22 -23
- package/dist/esm/stories/Image.stories.js +12 -15
- package/dist/esm/stories/InlineError.stories.js +0 -1
- package/dist/esm/stories/Layout.stories.js +93 -2
- package/dist/esm/stories/LayoutSection.stories.js +13 -18
- package/dist/esm/stories/List.stories.js +24 -28
- package/dist/esm/stories/Listbox.stories.js +2 -2
- package/dist/esm/stories/Loading.stories.js +21 -25
- package/dist/esm/stories/Modal.stories.js +0 -1
- package/dist/esm/stories/Pagination.stories.js +4 -4
- package/dist/esm/stories/Pane.stories.js +10 -18
- package/dist/esm/stories/Popover.stories.js +7 -7
- package/dist/esm/stories/PopoverManager.stories.js +9 -9
- package/dist/esm/stories/ProgressBar.stories.js +8 -8
- package/dist/esm/stories/RadioButton.stories.js +2 -2
- package/dist/esm/stories/RadioButtonCard.stories.js +2 -2
- package/dist/esm/stories/RadioButtonCardGroup.stories.js +461 -0
- package/dist/esm/stories/RangeSlider.stories.js +1 -3
- package/dist/esm/stories/ResourceList.stories.js +13 -13
- package/dist/esm/stories/Spinner.stories.js +9 -9
- package/dist/esm/stories/Stack.stories.js +224 -51
- package/dist/esm/stories/Tabs.stories.js +2 -2
- package/dist/esm/stories/Tag.stories.js +1 -1
- package/dist/esm/stories/Thumbnail.stories.js +17 -18
- package/dist/esm/stories/TimePicker.stories.js +0 -5
- package/dist/esm/stories/Tip.stories.js +1 -1
- package/dist/types/components/ActionList.d.ts +1 -31
- package/dist/types/components/ActionList.d.ts.map +1 -1
- package/dist/types/components/AnnouncementBar.d.ts +1 -19
- package/dist/types/components/AnnouncementBar.d.ts.map +1 -1
- package/dist/types/components/AnnouncementCard.d.ts +3 -0
- package/dist/types/components/AnnouncementCard.d.ts.map +1 -0
- package/dist/types/components/AppProvider.d.ts +14 -1
- package/dist/types/components/AppProvider.d.ts.map +1 -1
- package/dist/types/components/Autocomplete.d.ts +1 -71
- package/dist/types/components/Autocomplete.d.ts.map +1 -1
- package/dist/types/components/Badge.d.ts +1 -19
- package/dist/types/components/Badge.d.ts.map +1 -1
- package/dist/types/components/Banner.d.ts +1 -37
- package/dist/types/components/Banner.d.ts.map +1 -1
- package/dist/types/components/Box.d.ts +1 -68
- package/dist/types/components/Box.d.ts.map +1 -1
- package/dist/types/components/Button.d.ts +1 -131
- package/dist/types/components/Button.d.ts.map +1 -1
- package/dist/types/components/ButtonGroup.d.ts +1 -22
- package/dist/types/components/ButtonGroup.d.ts.map +1 -1
- package/dist/types/components/Card.d.ts +54 -59
- package/dist/types/components/Card.d.ts.map +1 -1
- package/dist/types/components/Checkbox.d.ts +1 -63
- package/dist/types/components/Checkbox.d.ts.map +1 -1
- package/dist/types/components/CheckboxCard.d.ts +3 -0
- package/dist/types/components/CheckboxCard.d.ts.map +1 -0
- package/dist/types/components/CheckboxCardGroup.d.ts +3 -0
- package/dist/types/components/CheckboxCardGroup.d.ts.map +1 -0
- package/dist/types/components/ChoiceList.d.ts +1 -42
- package/dist/types/components/ChoiceList.d.ts.map +1 -1
- package/dist/types/components/Code.d.ts +1 -26
- package/dist/types/components/Code.d.ts.map +1 -1
- package/dist/types/components/Collapsible.d.ts +1 -15
- package/dist/types/components/Collapsible.d.ts.map +1 -1
- package/dist/types/components/ColorField.d.ts +13 -34
- package/dist/types/components/ColorField.d.ts.map +1 -1
- package/dist/types/components/ContextualSaveBar.d.ts +13 -6
- package/dist/types/components/ContextualSaveBar.d.ts.map +1 -1
- package/dist/types/components/DatePicker.d.ts +1 -64
- package/dist/types/components/DatePicker.d.ts.map +1 -1
- package/dist/types/components/Disclosure.d.ts +1 -25
- package/dist/types/components/Disclosure.d.ts.map +1 -1
- package/dist/types/components/Divider.d.ts +1 -19
- package/dist/types/components/Divider.d.ts.map +1 -1
- package/dist/types/components/DropZone.d.ts +1 -62
- package/dist/types/components/DropZone.d.ts.map +1 -1
- package/dist/types/components/EmptyState.d.ts +1 -50
- package/dist/types/components/EmptyState.d.ts.map +1 -1
- package/dist/types/components/Filters.d.ts +13 -68
- package/dist/types/components/Filters.d.ts.map +1 -1
- package/dist/types/components/FooterHelp.d.ts +14 -4
- package/dist/types/components/FooterHelp.d.ts.map +1 -1
- package/dist/types/components/Form.d.ts +13 -2
- package/dist/types/components/Form.d.ts.map +1 -1
- package/dist/types/components/Frame.d.ts +15 -36
- package/dist/types/components/Frame.d.ts.map +1 -1
- package/dist/types/components/FrameSaveBar.d.ts +3 -6
- package/dist/types/components/FrameSaveBar.d.ts.map +1 -1
- package/dist/types/components/Grid.d.ts +5 -21
- package/dist/types/components/Grid.d.ts.map +1 -1
- package/dist/types/components/HorizontalStack.d.ts +1 -34
- package/dist/types/components/HorizontalStack.d.ts.map +1 -1
- package/dist/types/components/Icon.d.ts +1 -41
- package/dist/types/components/Icon.d.ts.map +1 -1
- package/dist/types/components/Image.d.ts +1 -43
- package/dist/types/components/Image.d.ts.map +1 -1
- package/dist/types/components/InlineError.d.ts +1 -20
- package/dist/types/components/InlineError.d.ts.map +1 -1
- package/dist/types/components/Label.d.ts +1 -26
- package/dist/types/components/Label.d.ts.map +1 -1
- package/dist/types/components/Layout.d.ts +24 -15
- package/dist/types/components/Layout.d.ts.map +1 -1
- package/dist/types/components/LayoutSection.d.ts +1 -19
- package/dist/types/components/LayoutSection.d.ts.map +1 -1
- package/dist/types/components/Link.d.ts +1 -37
- package/dist/types/components/Link.d.ts.map +1 -1
- package/dist/types/components/List.d.ts +5 -17
- package/dist/types/components/List.d.ts.map +1 -1
- package/dist/types/components/Listbox.d.ts +1 -32
- package/dist/types/components/Listbox.d.ts.map +1 -1
- package/dist/types/components/Loading.d.ts +14 -2
- package/dist/types/components/Loading.d.ts.map +1 -1
- package/dist/types/components/Modal.d.ts +26 -35
- package/dist/types/components/Modal.d.ts.map +1 -1
- package/dist/types/components/Navigation.d.ts +1 -25
- package/dist/types/components/Navigation.d.ts.map +1 -1
- package/dist/types/components/Page.d.ts +1 -57
- package/dist/types/components/Page.d.ts.map +1 -1
- package/dist/types/components/Pagination.d.ts +13 -3
- package/dist/types/components/Pagination.d.ts.map +1 -1
- package/dist/types/components/Pane.d.ts +55 -3
- package/dist/types/components/Pane.d.ts.map +1 -1
- package/dist/types/components/Popover.d.ts +5 -37
- package/dist/types/components/Popover.d.ts.map +1 -1
- package/dist/types/components/PopoverManager.d.ts.map +1 -1
- package/dist/types/components/ProgressBar.d.ts +1 -22
- package/dist/types/components/ProgressBar.d.ts.map +1 -1
- package/dist/types/components/RadioButton.d.ts +1 -37
- package/dist/types/components/RadioButton.d.ts.map +1 -1
- package/dist/types/components/RadioButtonCard.d.ts +1 -39
- package/dist/types/components/RadioButtonCard.d.ts.map +1 -1
- package/dist/types/components/RadioButtonCardGroup.d.ts +3 -0
- package/dist/types/components/RadioButtonCardGroup.d.ts.map +1 -0
- package/dist/types/components/RangeSlider.d.ts +1 -42
- package/dist/types/components/RangeSlider.d.ts.map +1 -1
- package/dist/types/components/ResourceList.d.ts +5 -30
- package/dist/types/components/ResourceList.d.ts.map +1 -1
- package/dist/types/components/Select.d.ts +1 -46
- package/dist/types/components/Select.d.ts.map +1 -1
- package/dist/types/components/SkeletonText.d.ts +1 -26
- package/dist/types/components/SkeletonText.d.ts.map +1 -1
- package/dist/types/components/Spinner.d.ts +1 -16
- package/dist/types/components/Spinner.d.ts.map +1 -1
- package/dist/types/components/Stack.d.ts +1 -47
- package/dist/types/components/Stack.d.ts.map +1 -1
- package/dist/types/components/TabNavigation.d.ts.map +1 -1
- package/dist/types/components/Table.d.ts +13 -58
- package/dist/types/components/Table.d.ts.map +1 -1
- package/dist/types/components/Tabs.d.ts +3 -41
- package/dist/types/components/Tabs.d.ts.map +1 -1
- package/dist/types/components/Tag.d.ts +1 -24
- package/dist/types/components/Tag.d.ts.map +1 -1
- package/dist/types/components/Text.d.ts +1 -30
- package/dist/types/components/Text.d.ts.map +1 -1
- package/dist/types/components/TextField.d.ts +1 -109
- package/dist/types/components/TextField.d.ts.map +1 -1
- package/dist/types/components/Thumbnail.d.ts +1 -16
- package/dist/types/components/Thumbnail.d.ts.map +1 -1
- package/dist/types/components/TimePicker.d.ts +28 -1
- package/dist/types/components/TimePicker.d.ts.map +1 -1
- package/dist/types/components/Tip.d.ts +1 -21
- package/dist/types/components/Tip.d.ts.map +1 -1
- package/dist/types/components/ToastNotification.d.ts +1 -34
- package/dist/types/components/ToastNotification.d.ts.map +1 -1
- package/dist/types/components/ToastProvider.d.ts +13 -3
- package/dist/types/components/ToastProvider.d.ts.map +1 -1
- package/dist/types/components/Tooltip.d.ts +1 -54
- package/dist/types/components/Tooltip.d.ts.map +1 -1
- package/dist/types/components/TopBar.d.ts +1 -19
- package/dist/types/components/TopBar.d.ts.map +1 -1
- package/dist/types/components/VerticalStack.d.ts +1 -25
- package/dist/types/components/VerticalStack.d.ts.map +1 -1
- package/dist/types/index.d.ts +6 -0
- package/index.css +76 -14
- package/package.json +4 -3
package/AI_COMPONENTS_GUIDE.md
CHANGED
|
@@ -159,7 +159,7 @@ import { ComponentName } from '@heymantle/litho';
|
|
|
159
159
|
actions={[{ content: 'Edit', onAction: handleEdit }]}
|
|
160
160
|
padded
|
|
161
161
|
>
|
|
162
|
-
<Stack
|
|
162
|
+
<Stack>
|
|
163
163
|
<Text>Product details go here</Text>
|
|
164
164
|
</Stack>
|
|
165
165
|
</Card>
|
|
@@ -214,7 +214,7 @@ import { ComponentName } from '@heymantle/litho';
|
|
|
214
214
|
|
|
215
215
|
**Example:**
|
|
216
216
|
```jsx
|
|
217
|
-
<Grid columns={{ xs: 1, sm: 2, lg: 3 }}
|
|
217
|
+
<Grid columns={{ xs: 1, sm: 2, lg: 3 }}>
|
|
218
218
|
<Card>Product 1</Card>
|
|
219
219
|
<Card>Product 2</Card>
|
|
220
220
|
<Card>Product 3</Card>
|
|
@@ -225,14 +225,13 @@ import { ComponentName } from '@heymantle/litho';
|
|
|
225
225
|
|
|
226
226
|
### Stack
|
|
227
227
|
|
|
228
|
-
**Purpose:** Flexible stack component for creating vertical or horizontal layouts with consistent spacing. By default creates a vertical stack.
|
|
228
|
+
**Purpose:** Flexible stack component for creating vertical or horizontal layouts with consistent spacing. By default creates a vertical stack. Supports responsive breakpoints for switching from vertical to horizontal at a given screen width.
|
|
229
229
|
|
|
230
230
|
**Key Props:**
|
|
231
|
-
- `horizontal` (boolean):
|
|
231
|
+
- `horizontal` (boolean|'xs'|'sm'|'md'|'lg'|'xl'): Direction control. `true` for always horizontal. A breakpoint string (e.g. `"md"`) makes it vertical below that breakpoint and horizontal at/above it. Defaults to `false` (vertical)
|
|
232
|
+
- `fill` (boolean): When true and horizontal is active, children fill equal space. Defaults to `true`
|
|
232
233
|
- `gap` (string|number): Space between children
|
|
233
|
-
- `align` (string): Main axis alignment ('start', 'center', 'end', '
|
|
234
|
-
- `blockAlign` (string): Cross-axis alignment for horizontal stacks (vertical alignment)
|
|
235
|
-
- `inlineAlign` (string): Cross-axis alignment for vertical stacks (horizontal alignment)
|
|
234
|
+
- `align` (string): Main axis alignment ('start', 'center', 'end', 'between', 'around')
|
|
236
235
|
- `wrap` (boolean): Whether children should wrap to the next line
|
|
237
236
|
|
|
238
237
|
**Common Use Cases:**
|
|
@@ -240,14 +239,28 @@ import { ComponentName } from '@heymantle/litho';
|
|
|
240
239
|
- Form field layouts
|
|
241
240
|
- Content spacing
|
|
242
241
|
- Header actions
|
|
242
|
+
- Responsive column layouts (vertical on mobile, horizontal on desktop)
|
|
243
243
|
|
|
244
244
|
**Example:**
|
|
245
245
|
```jsx
|
|
246
|
-
|
|
246
|
+
{/* Horizontal with equal-width children (fill is true by default) */}
|
|
247
|
+
<Stack horizontal justify="between">
|
|
247
248
|
<Text variant="headingLg">Title</Text>
|
|
248
249
|
<Button>Action</Button>
|
|
249
250
|
</Stack>
|
|
250
251
|
|
|
252
|
+
{/* Responsive: vertical on mobile, horizontal columns at md breakpoint */}
|
|
253
|
+
<Stack horizontal="md">
|
|
254
|
+
<Card title="Plan A" padded>Basic</Card>
|
|
255
|
+
<Card title="Plan B" padded>Pro</Card>
|
|
256
|
+
</Stack>
|
|
257
|
+
|
|
258
|
+
{/* Horizontal without fill (children size naturally) */}
|
|
259
|
+
<Stack horizontal>
|
|
260
|
+
<Button>Cancel</Button>
|
|
261
|
+
<Button primary>Save</Button>
|
|
262
|
+
</Stack>
|
|
263
|
+
|
|
251
264
|
<Stack gap="6">
|
|
252
265
|
<TextField label="Name" />
|
|
253
266
|
<TextField label="Email" />
|
|
@@ -565,7 +578,7 @@ const handleSave = async () => {
|
|
|
565
578
|
};
|
|
566
579
|
|
|
567
580
|
<Form>
|
|
568
|
-
<Stack
|
|
581
|
+
<Stack>
|
|
569
582
|
<TextField
|
|
570
583
|
label="Name"
|
|
571
584
|
value={formData.name}
|
|
@@ -956,7 +969,7 @@ const handleSave = async () => {
|
|
|
956
969
|
onClose={() => setPaneOpen(false)}
|
|
957
970
|
title="Product Details"
|
|
958
971
|
>
|
|
959
|
-
<Stack
|
|
972
|
+
<Stack>
|
|
960
973
|
{/* Pane content */}
|
|
961
974
|
</Stack>
|
|
962
975
|
</Pane>
|
|
@@ -1045,7 +1058,7 @@ const handleSave = async () => {
|
|
|
1045
1058
|
items={customers}
|
|
1046
1059
|
renderItem={(customer) => (
|
|
1047
1060
|
<ResourceList.Item key={customer.id} id={`customer-${customer.id}`}>
|
|
1048
|
-
<Stack horizontal
|
|
1061
|
+
<Stack horizontal justify="between">
|
|
1049
1062
|
<Stack gap="1">
|
|
1050
1063
|
<Text variant="headingSm">{customer.name}</Text>
|
|
1051
1064
|
<Text variant="bodySm" color="subdued">{customer.email}</Text>
|
|
@@ -1266,7 +1279,7 @@ import { EditMinor } from '@shopify/polaris-icons';
|
|
|
1266
1279
|
|
|
1267
1280
|
**Example:**
|
|
1268
1281
|
```jsx
|
|
1269
|
-
<Stack
|
|
1282
|
+
<Stack>
|
|
1270
1283
|
<Text>Section 1</Text>
|
|
1271
1284
|
<Divider />
|
|
1272
1285
|
<Text>Section 2</Text>
|
|
@@ -1421,7 +1434,7 @@ const { darkMode, toggleDarkMode } = useDarkMode();
|
|
|
1421
1434
|
1. **Always wrap your app with AppProvider** for context access
|
|
1422
1435
|
2. **Use Page as top-level container** for application pages
|
|
1423
1436
|
3. **Prefer Layout for complex pages** with multiple sections
|
|
1424
|
-
4. **Use
|
|
1437
|
+
4. **Use Stack** for consistent spacing
|
|
1425
1438
|
5. **Use Card for content grouping** with optional titles
|
|
1426
1439
|
6. **Provide resourceName** for ResourceList and Table for better accessibility
|
|
1427
1440
|
7. **Use proper status colors** for badges and banners (success/critical/warning)
|
|
@@ -1472,7 +1485,7 @@ const { darkMode, toggleDarkMode } = useDarkMode();
|
|
|
1472
1485
|
<Layout>
|
|
1473
1486
|
<Layout.Section>
|
|
1474
1487
|
<Card title="Customer Information" padded>
|
|
1475
|
-
<Stack
|
|
1488
|
+
<Stack>
|
|
1476
1489
|
<TextField label="Name" value={name} onChange={setName} />
|
|
1477
1490
|
<TextField label="Email" value={email} onChange={setEmail} />
|
|
1478
1491
|
</Stack>
|
|
@@ -1496,7 +1509,7 @@ const { darkMode, toggleDarkMode } = useDarkMode();
|
|
|
1496
1509
|
description="Basic settings"
|
|
1497
1510
|
>
|
|
1498
1511
|
<Card padded>
|
|
1499
|
-
<Stack
|
|
1512
|
+
<Stack>
|
|
1500
1513
|
<TextField label="Store Name" />
|
|
1501
1514
|
<TextField label="Email" />
|
|
1502
1515
|
</Stack>
|
package/AI_INTEGRATION_GUIDE.md
CHANGED
|
@@ -72,7 +72,7 @@ import Button from '@heymantle/litho/components/Button';
|
|
|
72
72
|
|
|
73
73
|
```jsx
|
|
74
74
|
// ✅ Correct - Use Litho components for layout
|
|
75
|
-
<Stack
|
|
75
|
+
<Stack>
|
|
76
76
|
<TextField label="Name" />
|
|
77
77
|
<TextField label="Email" />
|
|
78
78
|
</Stack>
|
|
@@ -100,7 +100,7 @@ import Button from '@heymantle/litho/components/Button';
|
|
|
100
100
|
|
|
101
101
|
```jsx
|
|
102
102
|
// ✅ Correct - Use Stack for consistent spacing
|
|
103
|
-
<Stack
|
|
103
|
+
<Stack>
|
|
104
104
|
<TextField label="Name" />
|
|
105
105
|
<TextField label="Email" />
|
|
106
106
|
<Button primary>Submit</Button>
|
|
@@ -285,7 +285,7 @@ import { TextField as MuiTextField } from '@mui/material';
|
|
|
285
285
|
</div>
|
|
286
286
|
|
|
287
287
|
// ✅ CORRECT - Use Stack with horizontal
|
|
288
|
-
<Stack horizontal
|
|
288
|
+
<Stack horizontal>
|
|
289
289
|
<Button>Cancel</Button>
|
|
290
290
|
<Button>Save</Button>
|
|
291
291
|
</Stack>
|
package/AI_PATTERNS_GUIDE.md
CHANGED
|
@@ -313,8 +313,8 @@ function MultiStepRegistration() {
|
|
|
313
313
|
switch (currentStep) {
|
|
314
314
|
case 0:
|
|
315
315
|
return (
|
|
316
|
-
<Stack
|
|
317
|
-
<Grid columns={{ xs: 1, sm: 2 }}
|
|
316
|
+
<Stack>
|
|
317
|
+
<Grid columns={{ xs: 1, sm: 2 }}>
|
|
318
318
|
<TextField
|
|
319
319
|
label="First Name"
|
|
320
320
|
value={formData.firstName}
|
|
@@ -347,14 +347,14 @@ function MultiStepRegistration() {
|
|
|
347
347
|
|
|
348
348
|
case 1:
|
|
349
349
|
return (
|
|
350
|
-
<Stack
|
|
350
|
+
<Stack>
|
|
351
351
|
<TextField
|
|
352
352
|
label="Street Address"
|
|
353
353
|
value={formData.address}
|
|
354
354
|
onChange={(value) => updateField('address', value)}
|
|
355
355
|
placeholder="123 Main Street"
|
|
356
356
|
/>
|
|
357
|
-
<Grid columns={{ xs: 1, sm: 3 }}
|
|
357
|
+
<Grid columns={{ xs: 1, sm: 3 }}>
|
|
358
358
|
<TextField
|
|
359
359
|
label="City"
|
|
360
360
|
value={formData.city}
|
|
@@ -380,7 +380,7 @@ function MultiStepRegistration() {
|
|
|
380
380
|
case 2:
|
|
381
381
|
return (
|
|
382
382
|
<Stack gap="6">
|
|
383
|
-
<Stack
|
|
383
|
+
<Stack>
|
|
384
384
|
<Text variant="headingSm">
|
|
385
385
|
Notification Preferences
|
|
386
386
|
</Text>
|
|
@@ -423,7 +423,7 @@ function MultiStepRegistration() {
|
|
|
423
423
|
{/* Progress Indicator */}
|
|
424
424
|
<Box paddingBlockEnd="8">
|
|
425
425
|
<Stack gap="2">
|
|
426
|
-
<Stack horizontal
|
|
426
|
+
<Stack horizontal justify="between">
|
|
427
427
|
{steps.map((step, index) => (
|
|
428
428
|
<Text
|
|
429
429
|
key={step}
|
|
@@ -453,7 +453,7 @@ function MultiStepRegistration() {
|
|
|
453
453
|
{/* Navigation */}
|
|
454
454
|
<Box paddingBlockStart="8">
|
|
455
455
|
<Box paddingBlockStart="4" className="border-t border-edge-subdued">
|
|
456
|
-
<Stack horizontal
|
|
456
|
+
<Stack horizontal justify="between">
|
|
457
457
|
<Button
|
|
458
458
|
disabled={currentStep === 0}
|
|
459
459
|
onClick={handlePrevious}
|
|
@@ -531,7 +531,7 @@ function ContactForm() {
|
|
|
531
531
|
<Card title="Contact Us" padded>
|
|
532
532
|
<Form>
|
|
533
533
|
<Stack gap="6">
|
|
534
|
-
<Stack horizontal
|
|
534
|
+
<Stack horizontal>
|
|
535
535
|
<TextField
|
|
536
536
|
label="Name"
|
|
537
537
|
value={formData.name}
|
|
@@ -563,7 +563,7 @@ function ContactForm() {
|
|
|
563
563
|
placeholder="Select a subject"
|
|
564
564
|
/>
|
|
565
565
|
|
|
566
|
-
<Stack
|
|
566
|
+
<Stack>
|
|
567
567
|
<Text variant="headingSm">
|
|
568
568
|
Priority
|
|
569
569
|
</Text>
|
|
@@ -751,7 +751,7 @@ function OrderList() {
|
|
|
751
751
|
accessibilityLabel={`View details for order ${order.id}`}
|
|
752
752
|
>
|
|
753
753
|
<Stack gap="2">
|
|
754
|
-
<Stack horizontal
|
|
754
|
+
<Stack horizontal justify="between" align="start">
|
|
755
755
|
<Stack gap="1">
|
|
756
756
|
<Text variant="headingSm">{order.id}</Text>
|
|
757
757
|
<Text variant="bodySm">{order.customer}</Text>
|
|
@@ -764,7 +764,7 @@ function OrderList() {
|
|
|
764
764
|
</Stack>
|
|
765
765
|
</Stack>
|
|
766
766
|
|
|
767
|
-
<Stack horizontal
|
|
767
|
+
<Stack horizontal justify="between" align="center">
|
|
768
768
|
<Text variant="bodySm" color="subdued">
|
|
769
769
|
{order.items} item{order.items !== 1 ? 's' : ''} • {order.date}
|
|
770
770
|
</Text>
|
|
@@ -864,7 +864,7 @@ function SettingsPage() {
|
|
|
864
864
|
<Checkbox label="Allow search engines to index profile" />
|
|
865
865
|
<Checkbox label="Show online status" />
|
|
866
866
|
</Stack>
|
|
867
|
-
<Stack horizontal
|
|
867
|
+
<Stack horizontal>
|
|
868
868
|
<Button>Change Password</Button>
|
|
869
869
|
<Button>Setup 2FA</Button>
|
|
870
870
|
</Stack>
|
|
@@ -909,7 +909,7 @@ function SettingsPage() {
|
|
|
909
909
|
description="Irreversible and destructive actions"
|
|
910
910
|
>
|
|
911
911
|
<Card padded>
|
|
912
|
-
<Stack
|
|
912
|
+
<Stack>
|
|
913
913
|
<Text color="subdued">
|
|
914
914
|
These actions cannot be undone. Please proceed with caution.
|
|
915
915
|
</Text>
|
|
@@ -955,7 +955,7 @@ function ProductManagement() {
|
|
|
955
955
|
description="Essential details about your product"
|
|
956
956
|
>
|
|
957
957
|
<Card padded>
|
|
958
|
-
<Stack
|
|
958
|
+
<Stack>
|
|
959
959
|
<TextField label="Product Name" placeholder="Enter product name" />
|
|
960
960
|
<TextField label="SKU" placeholder="Product SKU" />
|
|
961
961
|
<TextField
|
|
@@ -973,7 +973,7 @@ function ProductManagement() {
|
|
|
973
973
|
description="Set pricing and manage stock levels"
|
|
974
974
|
>
|
|
975
975
|
<Card padded>
|
|
976
|
-
<Grid columns={{ xs: 1, sm: 2, lg: 4 }}
|
|
976
|
+
<Grid columns={{ xs: 1, sm: 2, lg: 4 }}>
|
|
977
977
|
<TextField label="Price" placeholder="$0.00" />
|
|
978
978
|
<TextField label="Compare Price" placeholder="$0.00" />
|
|
979
979
|
<TextField label="Cost per Item" placeholder="$0.00" />
|
|
@@ -987,8 +987,8 @@ function ProductManagement() {
|
|
|
987
987
|
description="Configure shipping options and delivery settings"
|
|
988
988
|
>
|
|
989
989
|
<Card padded>
|
|
990
|
-
<Stack
|
|
991
|
-
<Grid columns={{ xs: 1, sm: 2, lg: 4 }}
|
|
990
|
+
<Stack>
|
|
991
|
+
<Grid columns={{ xs: 1, sm: 2, lg: 4 }}>
|
|
992
992
|
<TextField label="Weight" placeholder="0.0 kg" />
|
|
993
993
|
<TextField label="Length" placeholder="0.0 cm" />
|
|
994
994
|
<TextField label="Width" placeholder="0.0 cm" />
|
|
@@ -1005,7 +1005,7 @@ function ProductManagement() {
|
|
|
1005
1005
|
|
|
1006
1006
|
<Layout.Section>
|
|
1007
1007
|
<Card padded>
|
|
1008
|
-
<Stack horizontal
|
|
1008
|
+
<Stack horizontal align="end">
|
|
1009
1009
|
<Button>Save as Draft</Button>
|
|
1010
1010
|
<Button>Preview</Button>
|
|
1011
1011
|
<Button primary>Publish Product</Button>
|
|
@@ -1022,6 +1022,40 @@ function ProductManagement() {
|
|
|
1022
1022
|
|
|
1023
1023
|
---
|
|
1024
1024
|
|
|
1025
|
+
### Responsive Column Layout
|
|
1026
|
+
|
|
1027
|
+
**Use Case:** Content that stacks vertically on mobile and displays as equal-width columns on larger screens. Common for pricing cards, feature comparisons, and dashboard panels.
|
|
1028
|
+
|
|
1029
|
+
```jsx
|
|
1030
|
+
import { Stack, Card, Text } from '@heymantle/litho';
|
|
1031
|
+
|
|
1032
|
+
function PricingSection() {
|
|
1033
|
+
return (
|
|
1034
|
+
<Stack horizontal="md">
|
|
1035
|
+
<Card title="Basic" padded>
|
|
1036
|
+
<Text>Essential features for small teams.</Text>
|
|
1037
|
+
</Card>
|
|
1038
|
+
<Card title="Pro" padded>
|
|
1039
|
+
<Text>Advanced features for growing businesses.</Text>
|
|
1040
|
+
</Card>
|
|
1041
|
+
<Card title="Enterprise" padded>
|
|
1042
|
+
<Text>Full-featured solution for large organizations.</Text>
|
|
1043
|
+
</Card>
|
|
1044
|
+
</Stack>
|
|
1045
|
+
);
|
|
1046
|
+
}
|
|
1047
|
+
```
|
|
1048
|
+
|
|
1049
|
+
**Key Points:**
|
|
1050
|
+
- `horizontal="md"` makes the stack vertical below 800px and horizontal at/above
|
|
1051
|
+
- Children fill equal width by default (`fill={true}`)
|
|
1052
|
+
- Use `fill={false}` when children should size naturally (e.g. button groups)
|
|
1053
|
+
- Available breakpoints: `"xs"` (320px), `"sm"` (480px), `"md"` (800px), `"lg"` (1038px), `"xl"` (1440px)
|
|
1054
|
+
|
|
1055
|
+
**Storybook Reference:** `stories/Stack.stories.js` → ResponsiveFill
|
|
1056
|
+
|
|
1057
|
+
---
|
|
1058
|
+
|
|
1025
1059
|
## CRUD Operation Patterns
|
|
1026
1060
|
|
|
1027
1061
|
### List Page with Actions
|
|
@@ -1046,14 +1080,14 @@ function ProductsListPage() {
|
|
|
1046
1080
|
|
|
1047
1081
|
const renderProduct = (product) => (
|
|
1048
1082
|
<ResourceList.Item key={product.id} id={`product-${product.id}`}>
|
|
1049
|
-
<Stack horizontal
|
|
1083
|
+
<Stack horizontal justify="between" align="center">
|
|
1050
1084
|
<Stack gap="1">
|
|
1051
1085
|
<Text variant="headingSm">{product.name}</Text>
|
|
1052
1086
|
<Text variant="bodySm" color="subdued">
|
|
1053
1087
|
Stock: {product.stock} units
|
|
1054
1088
|
</Text>
|
|
1055
1089
|
</Stack>
|
|
1056
|
-
<Stack horizontal
|
|
1090
|
+
<Stack horizontal align="center">
|
|
1057
1091
|
<Text variant="headingSm">{product.price}</Text>
|
|
1058
1092
|
<Badge status={product.status === 'active' ? 'success' : 'critical'}>
|
|
1059
1093
|
{product.status === 'active' ? 'Active' : 'Out of Stock'}
|
|
@@ -1072,7 +1106,7 @@ function ProductsListPage() {
|
|
|
1072
1106
|
}}
|
|
1073
1107
|
>
|
|
1074
1108
|
<Card padded>
|
|
1075
|
-
<Stack
|
|
1109
|
+
<Stack>
|
|
1076
1110
|
<Filters
|
|
1077
1111
|
queryValue={searchQuery}
|
|
1078
1112
|
onQueryChange={setSearchQuery}
|
|
@@ -1165,7 +1199,7 @@ function CustomerDetailPage() {
|
|
|
1165
1199
|
<Layout>
|
|
1166
1200
|
<Layout.Section>
|
|
1167
1201
|
<Card title="Customer Information" padded>
|
|
1168
|
-
<Stack
|
|
1202
|
+
<Stack>
|
|
1169
1203
|
<TextField
|
|
1170
1204
|
label="Name"
|
|
1171
1205
|
value={customer.name}
|
|
@@ -1185,7 +1219,7 @@ function CustomerDetailPage() {
|
|
|
1185
1219
|
onChange={(value) => setCustomer({ ...customer, phone: value })}
|
|
1186
1220
|
disabled={!editing}
|
|
1187
1221
|
/>
|
|
1188
|
-
<Stack horizontal gap="2"
|
|
1222
|
+
<Stack horizontal gap="2" align="center">
|
|
1189
1223
|
<Text variant="bodySm">Status:</Text>
|
|
1190
1224
|
<Badge status={customer.status === 'active' ? 'success' : 'warning'}>
|
|
1191
1225
|
{customer.status}
|
|
@@ -1310,7 +1344,7 @@ function EditProductModal({ open, onClose, product }) {
|
|
|
1310
1344
|
]}
|
|
1311
1345
|
sectioned
|
|
1312
1346
|
>
|
|
1313
|
-
<Stack
|
|
1347
|
+
<Stack>
|
|
1314
1348
|
<TextField
|
|
1315
1349
|
label="Product Name"
|
|
1316
1350
|
value={formData.name}
|
|
@@ -1433,7 +1467,7 @@ function FormWithErrorHandling() {
|
|
|
1433
1467
|
|
|
1434
1468
|
return (
|
|
1435
1469
|
<Form>
|
|
1436
|
-
<Stack
|
|
1470
|
+
<Stack>
|
|
1437
1471
|
{generalError && (
|
|
1438
1472
|
<Banner status="critical" onDismiss={() => setGeneralError('')}>
|
|
1439
1473
|
{generalError}
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
| **Layout.AnnotatedSection** | Section with title/description | `title`, `description` | Settings, forms |
|
|
27
27
|
| **Card** | Content container | `title`, `actions`, `padded`, `sectioned` | Grouping content |
|
|
28
28
|
| **Grid** | Responsive grid | `columns` (object/number), `gap` | Product grids, dashboards |
|
|
29
|
-
| **Stack** | Vertical/horizontal spacing | `gap`, `align`, `horizontal
|
|
29
|
+
| **Stack** | Vertical/horizontal spacing | `gap`, `align`, `horizontal` (bool/breakpoint), `fill`,
|
|
30
30
|
| **Box** | Utility container | `padding`, `background`, `borderRadius` | Spacing, colored sections |
|
|
31
31
|
| **Frame** | App shell with nav | `navigation`, `topBar` | Application wrapper |
|
|
32
32
|
|
|
@@ -192,7 +192,7 @@ const handleSave = async () => {
|
|
|
192
192
|
};
|
|
193
193
|
|
|
194
194
|
<Form>
|
|
195
|
-
<Stack
|
|
195
|
+
<Stack>
|
|
196
196
|
<TextField
|
|
197
197
|
label="Name"
|
|
198
198
|
value={formData.name}
|
|
@@ -253,7 +253,7 @@ const handleSave = async () => {
|
|
|
253
253
|
secondaryActions={[{content: 'Cancel', onAction: close}]}
|
|
254
254
|
sectioned
|
|
255
255
|
>
|
|
256
|
-
<Stack
|
|
256
|
+
<Stack>
|
|
257
257
|
<TextField label="Name" value={name} onChange={setName} />
|
|
258
258
|
</Stack>
|
|
259
259
|
</Modal>
|
|
@@ -62,7 +62,36 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
62
62
|
}
|
|
63
63
|
return newObj;
|
|
64
64
|
}
|
|
65
|
-
|
|
65
|
+
/**
|
|
66
|
+
* @component ActionList
|
|
67
|
+
*
|
|
68
|
+
* @description A vertical list of actionable items typically displayed inside a Popover for dropdown menus and contextual actions.
|
|
69
|
+
*
|
|
70
|
+
* @usage
|
|
71
|
+
* - DO: Display a list of actions inside a Popover dropdown menu.
|
|
72
|
+
* - DON'T: Use as a standalone visible list (use List or ResourceList).
|
|
73
|
+
*
|
|
74
|
+
* @accessibility
|
|
75
|
+
* - Renders as a list of buttons; each action item is keyboard navigable.
|
|
76
|
+
*
|
|
77
|
+
* @alternative
|
|
78
|
+
* - If you need a visible list of content, use `List`.
|
|
79
|
+
* - If you need a selectable list, use `Listbox`.
|
|
80
|
+
*
|
|
81
|
+
* @param {Object} props - Component properties.
|
|
82
|
+
* @param {Array<{title: string, items: Array<ActionListItem>}>} [props.sections] - Sections containing items for the action list.
|
|
83
|
+
* @param {Array<ActionListItem>} [props.items] - List of items to render in the action list when no sections are provided.
|
|
84
|
+
* @param {string} [props.iconColor="subdued"] - Default color for icons in the action items.
|
|
85
|
+
* @param {function} [props.onActionAnyItem] - Callback function invoked whenever any action item is selected.
|
|
86
|
+
* @param {boolean} [props.fullWidth=false] - Whether to apply full width styling to the action list.
|
|
87
|
+
* @param {boolean} [props.padded=true] - Whether to apply padding to the action list.
|
|
88
|
+
* @param {string} [props.className] - Additional CSS classes to apply to the action list.
|
|
89
|
+
* @example
|
|
90
|
+
* const items = [{ content: 'Item 1', onAction: () => {} }];
|
|
91
|
+
* <ActionList items={items} />
|
|
92
|
+
*
|
|
93
|
+
* @returns {JSX.Element} The rendered ActionList component.
|
|
94
|
+
*/ var styles = (0, _tailwindvariants.tv)({
|
|
66
95
|
base: "Litho-ActionList",
|
|
67
96
|
variants: {
|
|
68
97
|
fullWidth: {
|
|
@@ -120,28 +149,12 @@ var itemStyles = (0, _tailwindvariants.tv)({
|
|
|
120
149
|
* @property {string} imageUrl - The image to display for the action item.
|
|
121
150
|
* @property {string} url - The URL to navigate to when the action item is selected.
|
|
122
151
|
* @property {SecondaryAction} secondaryAction - The secondary action to display for the action item.
|
|
123
|
-
*/ /**
|
|
124
|
-
* ActionList component renders a list of actionable items with optional sections.
|
|
125
|
-
* Supports keyboard navigation and action triggers on item selection.
|
|
126
|
-
*
|
|
127
|
-
* @component
|
|
128
|
-
* @param {Object} props - Component properties.
|
|
129
|
-
* @param {Array<{title: string, items: Array<ActionListItem>}>} [props.sections] - Sections containing items for the action list.
|
|
130
|
-
* @param {Array<ActionListItem>} [props.items] - List of items to render in the action list when no sections are provided.
|
|
131
|
-
* @param {string} [props.iconColor="subdued"] - Default color for icons in the action items.
|
|
132
|
-
* @param {function} [props.onActionAnyItem] - Callback function invoked whenever any action item is selected.
|
|
133
|
-
* @param {boolean} [props.fullWidth=false] - Whether to apply full width styling to the action list.
|
|
134
|
-
* @param {boolean} [props.padded=true] - Whether to apply padding to the action list.
|
|
135
|
-
* @param {string} [props.className] - Additional CSS classes to apply to the action list.
|
|
136
|
-
* @example
|
|
137
|
-
* const items = [{ content: 'Item 1', onAction: () => {} }];
|
|
138
|
-
* <ActionList items={items} />
|
|
139
|
-
*
|
|
140
|
-
* @returns {JSX.Element} The rendered ActionList component.
|
|
141
152
|
*/ function ActionList() {
|
|
142
153
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
143
154
|
var sections = props.sections, _props_padded = props.padded, padded = _props_padded === void 0 ? true : _props_padded, tmp = props.items, initialItems = tmp === void 0 ? [] : tmp, tmp1 = props.iconColor, _iconColor = tmp1 === void 0 ? "subdued" : tmp1, onActionAnyItem = props.onActionAnyItem, className = props.className, _props_fullWidth = props.fullWidth, fullWidth = _props_fullWidth === void 0 ? false : _props_fullWidth;
|
|
144
|
-
|
|
155
|
+
// Always use index-based keys to avoid duplicate key issues when
|
|
156
|
+
// multiple sections have empty or identical titles
|
|
157
|
+
var sectionTitleAsKeys = false;
|
|
145
158
|
var items = initialItems || (sections ? sections.flatMap(function(section) {
|
|
146
159
|
return section.items;
|
|
147
160
|
}) : []);
|
|
@@ -184,11 +197,6 @@ var itemStyles = (0, _tailwindvariants.tv)({
|
|
|
184
197
|
padded: padded
|
|
185
198
|
});
|
|
186
199
|
var isSectioned = sections && sections.length > 0;
|
|
187
|
-
if (isSectioned) {
|
|
188
|
-
sectionTitleAsKeys = sections.every(function(section) {
|
|
189
|
-
return Object.prototype.hasOwnProperty.call(section, "title");
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
200
|
var ActionListItem = function(param) {
|
|
193
201
|
var item = param.item, index = param.index;
|
|
194
202
|
var content = item.content, description = item.description, disabled = item.disabled, destructive = item.destructive, icon = item.icon, onAction = item.onAction, prefix = item.prefix, imageUrl = item.imageUrl, url = item.url, secondaryAction = item.secondaryAction;
|
|
@@ -12,12 +12,90 @@ var _jsxruntime = require("react/jsx-runtime");
|
|
|
12
12
|
var _tailwindvariants = require("tailwind-variants");
|
|
13
13
|
var _Text = /*#__PURE__*/ _interop_require_default(require("./Text"));
|
|
14
14
|
var _Icon = /*#__PURE__*/ _interop_require_default(require("./Icon"));
|
|
15
|
+
var _polarisicons = require("@shopify/polaris-icons");
|
|
16
|
+
function _define_property(obj, key, value) {
|
|
17
|
+
if (key in obj) {
|
|
18
|
+
Object.defineProperty(obj, key, {
|
|
19
|
+
value: value,
|
|
20
|
+
enumerable: true,
|
|
21
|
+
configurable: true,
|
|
22
|
+
writable: true
|
|
23
|
+
});
|
|
24
|
+
} else {
|
|
25
|
+
obj[key] = value;
|
|
26
|
+
}
|
|
27
|
+
return obj;
|
|
28
|
+
}
|
|
15
29
|
function _interop_require_default(obj) {
|
|
16
30
|
return obj && obj.__esModule ? obj : {
|
|
17
31
|
default: obj
|
|
18
32
|
};
|
|
19
33
|
}
|
|
20
|
-
|
|
34
|
+
function _object_spread(target) {
|
|
35
|
+
for(var i = 1; i < arguments.length; i++){
|
|
36
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
37
|
+
var ownKeys = Object.keys(source);
|
|
38
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
39
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
40
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
ownKeys.forEach(function(key) {
|
|
44
|
+
_define_property(target, key, source[key]);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return target;
|
|
48
|
+
}
|
|
49
|
+
function ownKeys(object, enumerableOnly) {
|
|
50
|
+
var keys = Object.keys(object);
|
|
51
|
+
if (Object.getOwnPropertySymbols) {
|
|
52
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
53
|
+
if (enumerableOnly) {
|
|
54
|
+
symbols = symbols.filter(function(sym) {
|
|
55
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
keys.push.apply(keys, symbols);
|
|
59
|
+
}
|
|
60
|
+
return keys;
|
|
61
|
+
}
|
|
62
|
+
function _object_spread_props(target, source) {
|
|
63
|
+
source = source != null ? source : {};
|
|
64
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
65
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
66
|
+
} else {
|
|
67
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
68
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return target;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* @component AnnouncementBar
|
|
75
|
+
*
|
|
76
|
+
* @description A full-width banner displayed at the top of the application for global announcements and promotions.
|
|
77
|
+
*
|
|
78
|
+
* @usage
|
|
79
|
+
* - DO: Display global announcements, promotions, or system-wide messages.
|
|
80
|
+
* - DON'T: Use for page-specific messages (use Banner).
|
|
81
|
+
*
|
|
82
|
+
* @accessibility
|
|
83
|
+
* - Ensure the announcement text is descriptive; provide a dismiss action for user control.
|
|
84
|
+
*
|
|
85
|
+
* @alternative
|
|
86
|
+
* - If you need page-specific messaging, use `Banner`.
|
|
87
|
+
* - If you need a contextual hint, use `Tip`.
|
|
88
|
+
*
|
|
89
|
+
* @param {Object} props - Component properties.
|
|
90
|
+
* @param {Function} [props.onClick] - Click handler function.
|
|
91
|
+
* @param {string} props.content - Text content to be displayed.
|
|
92
|
+
* @param {string} [props.icon] - Icon source name.
|
|
93
|
+
* @param {"bounce"} [props.animateIcon] - Animation type for the icon.
|
|
94
|
+
* @param {boolean} [props.fixed] - Whether to fix the announcement bar to the top of the page.
|
|
95
|
+
* @param {Function} [props.onDismiss] - Callback to dismiss the announcement bar. Renders a close button when provided.
|
|
96
|
+
*
|
|
97
|
+
* @returns {JSX.Element} AnnouncementBar component.
|
|
98
|
+
*/ var styles = (0, _tailwindvariants.tv)({
|
|
21
99
|
base: "Litho-AnnouncementBar text-center p-2 min-h-10 flex items-center justify-center bg-brand",
|
|
22
100
|
variants: {
|
|
23
101
|
fixed: {
|
|
@@ -37,28 +115,27 @@ var iconContainerStyles = (0, _tailwindvariants.tv)({
|
|
|
37
115
|
}
|
|
38
116
|
}
|
|
39
117
|
});
|
|
40
|
-
|
|
41
|
-
* AnnouncementBar Component
|
|
42
|
-
*
|
|
43
|
-
* @param {Object} props - Component properties.
|
|
44
|
-
* @param {Function} [props.onClick] - Click handler function.
|
|
45
|
-
* @param {string} props.content - Text content to be displayed.
|
|
46
|
-
* @param {string} [props.icon] - Icon source name.
|
|
47
|
-
* @param {"bounce"} [props.animateIcon] - Animation type for the icon.
|
|
48
|
-
* @param {boolean} [props.fixed] - Whether to fix the announcement bar to the top of the page.
|
|
49
|
-
*
|
|
50
|
-
* @returns {JSX.Element} AnnouncementBar component.
|
|
51
|
-
*/ function AnnouncementBar() {
|
|
118
|
+
function AnnouncementBar() {
|
|
52
119
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
53
|
-
var onClick = props.onClick, content = props.content, icon = props.icon, animateIcon = props.animateIcon, _props_fixed = props.fixed, fixed = _props_fixed === void 0 ? false : _props_fixed;
|
|
54
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
120
|
+
var onClick = props.onClick, content = props.content, icon = props.icon, animateIcon = props.animateIcon, _props_fixed = props.fixed, fixed = _props_fixed === void 0 ? false : _props_fixed, onDismiss = props.onDismiss;
|
|
121
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", _object_spread_props(_object_spread({
|
|
55
122
|
className: styles({
|
|
56
123
|
fixed: fixed,
|
|
57
124
|
interactive: !!onClick
|
|
58
125
|
}),
|
|
59
|
-
onClick: onClick
|
|
126
|
+
onClick: onClick
|
|
127
|
+
}, onClick ? {
|
|
128
|
+
role: "button",
|
|
129
|
+
tabIndex: 0,
|
|
130
|
+
onKeyDown: function(e) {
|
|
131
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
132
|
+
e.preventDefault();
|
|
133
|
+
onClick(e);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
} : {}), {
|
|
60
137
|
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
61
|
-
className: "flex items-center justify-center gap-4",
|
|
138
|
+
className: "flex items-center justify-center gap-4 w-full relative",
|
|
62
139
|
children: [
|
|
63
140
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
|
|
64
141
|
fontWeight: "medium",
|
|
@@ -72,9 +149,29 @@ var iconContainerStyles = (0, _tailwindvariants.tv)({
|
|
|
72
149
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Icon.default, {
|
|
73
150
|
source: icon
|
|
74
151
|
})
|
|
152
|
+
}),
|
|
153
|
+
onDismiss && /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
154
|
+
className: "absolute right-0 p-1 cursor-pointer rounded-md hover:bg-brand-low",
|
|
155
|
+
onClick: function(e) {
|
|
156
|
+
e.stopPropagation();
|
|
157
|
+
onDismiss();
|
|
158
|
+
},
|
|
159
|
+
role: "button",
|
|
160
|
+
tabIndex: 0,
|
|
161
|
+
"aria-label": "Dismiss announcement",
|
|
162
|
+
onKeyDown: function(e) {
|
|
163
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
164
|
+
e.preventDefault();
|
|
165
|
+
e.stopPropagation();
|
|
166
|
+
onDismiss();
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Icon.default, {
|
|
170
|
+
source: _polarisicons.CancelSmallMinor
|
|
171
|
+
})
|
|
75
172
|
})
|
|
76
173
|
]
|
|
77
174
|
})
|
|
78
|
-
});
|
|
175
|
+
}));
|
|
79
176
|
}
|
|
80
177
|
var _default = AnnouncementBar;
|