@heymantle/litho 0.0.14 → 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/README.md +52 -0
- 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 +57 -13
- package/dist/cjs/components/Divider.js +82 -18
- package/dist/cjs/components/DropZone.js +194 -68
- 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 +37 -26
- 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 +32 -39
- 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 +63 -30
- 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 +85 -29
- package/dist/cjs/components/Tabs.js +84 -24
- 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/playwright.config.js +114 -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/cjs/styles/Table.js +2 -7
- package/dist/cjs/tests/visual/stories.spec.js +637 -0
- package/dist/cjs/utilities/dates.js +7 -7
- 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 +50 -6
- package/dist/esm/components/Divider.js +78 -20
- package/dist/esm/components/DropZone.js +194 -68
- 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 +62 -27
- 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 +79 -40
- 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 +63 -30
- 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 +85 -29
- package/dist/esm/components/Tabs.js +84 -24
- 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/playwright.config.js +104 -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/esm/styles/Table.js +2 -7
- package/dist/esm/tests/visual/stories.spec.js +633 -0
- package/dist/esm/utilities/dates.js +7 -7
- 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 +3 -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 -35
- 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 +40 -34
- 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/dist/types/styles/Table.d.ts.map +1 -1
- package/index.css +76 -14
- package/package.json +15 -5
|
@@ -7,6 +7,19 @@ function _array_like_to_array(arr, len) {
|
|
|
7
7
|
function _array_with_holes(arr) {
|
|
8
8
|
if (Array.isArray(arr)) return arr;
|
|
9
9
|
}
|
|
10
|
+
function _define_property(obj, key, value) {
|
|
11
|
+
if (key in obj) {
|
|
12
|
+
Object.defineProperty(obj, key, {
|
|
13
|
+
value: value,
|
|
14
|
+
enumerable: true,
|
|
15
|
+
configurable: true,
|
|
16
|
+
writable: true
|
|
17
|
+
});
|
|
18
|
+
} else {
|
|
19
|
+
obj[key] = value;
|
|
20
|
+
}
|
|
21
|
+
return obj;
|
|
22
|
+
}
|
|
10
23
|
function _iterable_to_array_limit(arr, i) {
|
|
11
24
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
12
25
|
if (_i == null) return;
|
|
@@ -34,6 +47,45 @@ function _iterable_to_array_limit(arr, i) {
|
|
|
34
47
|
function _non_iterable_rest() {
|
|
35
48
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
36
49
|
}
|
|
50
|
+
function _object_spread(target) {
|
|
51
|
+
for(var i = 1; i < arguments.length; i++){
|
|
52
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
53
|
+
var ownKeys = Object.keys(source);
|
|
54
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
55
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
56
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
ownKeys.forEach(function(key) {
|
|
60
|
+
_define_property(target, key, source[key]);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
return target;
|
|
64
|
+
}
|
|
65
|
+
function ownKeys(object, enumerableOnly) {
|
|
66
|
+
var keys = Object.keys(object);
|
|
67
|
+
if (Object.getOwnPropertySymbols) {
|
|
68
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
69
|
+
if (enumerableOnly) {
|
|
70
|
+
symbols = symbols.filter(function(sym) {
|
|
71
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
keys.push.apply(keys, symbols);
|
|
75
|
+
}
|
|
76
|
+
return keys;
|
|
77
|
+
}
|
|
78
|
+
function _object_spread_props(target, source) {
|
|
79
|
+
source = source != null ? source : {};
|
|
80
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
81
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
82
|
+
} else {
|
|
83
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
84
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
return target;
|
|
88
|
+
}
|
|
37
89
|
function _sliced_to_array(arr, i) {
|
|
38
90
|
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
39
91
|
}
|
|
@@ -51,7 +103,47 @@ import { tv } from "tailwind-variants";
|
|
|
51
103
|
import Text from "./Text.js";
|
|
52
104
|
import Icon from "./Icon.js";
|
|
53
105
|
import { CancelMinor } from "@shopify/polaris-icons";
|
|
54
|
-
|
|
106
|
+
/**
|
|
107
|
+
* @component ToastNotification
|
|
108
|
+
*
|
|
109
|
+
* @description A brief, auto-dismissing notification that appears at the bottom of the screen to confirm an action or report an event.
|
|
110
|
+
*
|
|
111
|
+
* @usage
|
|
112
|
+
* - DO: Display brief, auto-dismissing success or info notifications after user actions.
|
|
113
|
+
* - DON'T: Use for persistent messages or errors (use Banner).
|
|
114
|
+
*
|
|
115
|
+
* @accessibility
|
|
116
|
+
* - Toast should be announced to screen readers via `role="alert"` or live region. Keep messages brief.
|
|
117
|
+
*
|
|
118
|
+
* @alternative
|
|
119
|
+
* - If you need a persistent message, use `Banner`.
|
|
120
|
+
* - If you need a modal confirmation, use `Modal`.
|
|
121
|
+
*
|
|
122
|
+
* @param {Object} props - The component props.
|
|
123
|
+
* @param {React.ReactNode} [props.prefix] - Optional prefix content (image, icon, or component) to display before the title.
|
|
124
|
+
* @param {Object|Function} [props.icon] - Optional icon source (from @shopify/polaris-icons) to display as prefix. Used as fallback if prefix is not provided.
|
|
125
|
+
* @param {string} props.title - The main title text of the toast.
|
|
126
|
+
* @param {string} [props.subtitle] - Optional subtitle text displayed below the title.
|
|
127
|
+
* @param {number} [props.duration=3000] - Duration in milliseconds before the toast auto-dismisses. Defaults to 2000ms (2 seconds).
|
|
128
|
+
* @param {'topRight' | 'topLeft' | 'topCenter' | 'bottomRight' | 'bottomLeft' | 'bottomCenter'} [props.position='topRight'] - Position of the toast on the screen.
|
|
129
|
+
* @param {Function} [props.onDismiss] - Callback function called when the toast is dismissed (either automatically or manually).
|
|
130
|
+
* @param {Function} [props.onClick] - Callback function called when the toast is clicked. Makes the entire toast clickable with cursor-pointer.
|
|
131
|
+
* @param {boolean} [props.dismissible=true] - Whether the toast can be manually dismissed via the close button.
|
|
132
|
+
* @param {boolean} [props.fixed=true] - Whether to use fixed positioning. Set to false when used within ToastProvider.
|
|
133
|
+
* @param {boolean} [props.isDismissing=false] - Whether the toast is in a dismissing state. Starts the exit animation immediately.
|
|
134
|
+
* @param {string} [props.className] - Additional CSS classes to apply to the toast container.
|
|
135
|
+
* @returns {JSX.Element|null} The rendered toast notification or null if dismissed.
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* <ToastNotification
|
|
139
|
+
* prefix={<Icon source={TickMinor} color="success" />}
|
|
140
|
+
* title="Support ticket updated"
|
|
141
|
+
* subtitle="Your ticket has been resolved"
|
|
142
|
+
* duration={3000}
|
|
143
|
+
* position="topRight"
|
|
144
|
+
* onDismiss={() => console.log('Toast dismissed')}
|
|
145
|
+
* />
|
|
146
|
+
*/ var styles = tv({
|
|
55
147
|
base: "Litho-ToastNotification group/toast pointer-events-auto min-w-60 max-w-85 bg-surface-highest/95 hover:bg-surface-highest rounded-md shadow-card border border-tint-2 p-2 flex items-start gap-2 transition-all duration-300 ease-in-out",
|
|
56
148
|
variants: {
|
|
57
149
|
position: {
|
|
@@ -147,36 +239,7 @@ var styles = tv({
|
|
|
147
239
|
var closeButtonStyles = tv({
|
|
148
240
|
base: "Litho-ToastNotification__Close flex-none p-0.5 rounded-md cursor-pointer hover:bg-tint-2 active:bg-tint-3 transition-colors opacity-0 group-hover/toast:opacity-100"
|
|
149
241
|
});
|
|
150
|
-
|
|
151
|
-
* ToastNotification component for displaying temporary notifications to users.
|
|
152
|
-
* Automatically dismisses after the specified duration.
|
|
153
|
-
*
|
|
154
|
-
* @component
|
|
155
|
-
* @param {Object} props - The component props.
|
|
156
|
-
* @param {React.ReactNode} [props.prefix] - Optional prefix content (image, icon, or component) to display before the title.
|
|
157
|
-
* @param {Object|Function} [props.icon] - Optional icon source (from @shopify/polaris-icons) to display as prefix. Used as fallback if prefix is not provided.
|
|
158
|
-
* @param {string} props.title - The main title text of the toast.
|
|
159
|
-
* @param {string} [props.subtitle] - Optional subtitle text displayed below the title.
|
|
160
|
-
* @param {number} [props.duration=3000] - Duration in milliseconds before the toast auto-dismisses. Defaults to 2000ms (2 seconds).
|
|
161
|
-
* @param {'topRight' | 'topLeft' | 'topCenter' | 'bottomRight' | 'bottomLeft' | 'bottomCenter'} [props.position='topRight'] - Position of the toast on the screen.
|
|
162
|
-
* @param {Function} [props.onDismiss] - Callback function called when the toast is dismissed (either automatically or manually).
|
|
163
|
-
* @param {Function} [props.onClick] - Callback function called when the toast is clicked. Makes the entire toast clickable with cursor-pointer.
|
|
164
|
-
* @param {boolean} [props.dismissible=true] - Whether the toast can be manually dismissed via the close button.
|
|
165
|
-
* @param {boolean} [props.fixed=true] - Whether to use fixed positioning. Set to false when used within ToastProvider.
|
|
166
|
-
* @param {boolean} [props.isDismissing=false] - Whether the toast is in a dismissing state. Starts the exit animation immediately.
|
|
167
|
-
* @param {string} [props.className] - Additional CSS classes to apply to the toast container.
|
|
168
|
-
* @returns {JSX.Element|null} The rendered toast notification or null if dismissed.
|
|
169
|
-
*
|
|
170
|
-
* @example
|
|
171
|
-
* <ToastNotification
|
|
172
|
-
* prefix={<Icon source={TickMinor} color="success" />}
|
|
173
|
-
* title="Support ticket updated"
|
|
174
|
-
* subtitle="Your ticket has been resolved"
|
|
175
|
-
* duration={3000}
|
|
176
|
-
* position="topRight"
|
|
177
|
-
* onDismiss={() => console.log('Toast dismissed')}
|
|
178
|
-
* />
|
|
179
|
-
*/ function ToastNotification() {
|
|
242
|
+
function ToastNotification() {
|
|
180
243
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
181
244
|
var prefix = props.prefix, icon = props.icon, title = props.title, subtitle = props.subtitle, _props_duration = props.duration, duration = _props_duration === void 0 ? 3000 : _props_duration, _props_position = props.position, position = _props_position === void 0 ? "topRight" : _props_position, onDismiss = props.onDismiss, onClick = props.onClick, _props_dismissible = props.dismissible, dismissible = _props_dismissible === void 0 ? true : _props_dismissible, _props_fixed = props.fixed, fixed = _props_fixed === void 0 ? true : _props_fixed, _props_isDismissing = props.isDismissing, isDismissing = _props_isDismissing === void 0 ? false : _props_isDismissing, className = props.className;
|
|
182
245
|
var _useState = _sliced_to_array(useState(!isDismissing), 2), visible = _useState[0], setVisible = _useState[1];
|
|
@@ -309,11 +372,21 @@ var closeButtonStyles = tv({
|
|
|
309
372
|
source: icon,
|
|
310
373
|
color: "subdued"
|
|
311
374
|
}) : null);
|
|
312
|
-
return /*#__PURE__*/ _jsxs("div", {
|
|
375
|
+
return /*#__PURE__*/ _jsxs("div", _object_spread_props(_object_spread({
|
|
313
376
|
className: "".concat(classes).concat(className ? " ".concat(className) : ""),
|
|
314
377
|
onClick: handleToastClick,
|
|
315
378
|
onMouseEnter: handleMouseEnter,
|
|
316
|
-
onMouseLeave: handleMouseLeave
|
|
379
|
+
onMouseLeave: handleMouseLeave
|
|
380
|
+
}, onClick ? {
|
|
381
|
+
role: "button",
|
|
382
|
+
tabIndex: 0,
|
|
383
|
+
onKeyDown: function(e) {
|
|
384
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
385
|
+
e.preventDefault();
|
|
386
|
+
onClick(e);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
} : {}), {
|
|
317
390
|
children: [
|
|
318
391
|
prefixContent && /*#__PURE__*/ _jsx("div", {
|
|
319
392
|
className: "Litho-ToastNotification__Prefix flex-none",
|
|
@@ -348,6 +421,6 @@ var closeButtonStyles = tv({
|
|
|
348
421
|
})
|
|
349
422
|
})
|
|
350
423
|
]
|
|
351
|
-
});
|
|
424
|
+
}));
|
|
352
425
|
}
|
|
353
426
|
export default ToastNotification;
|
|
@@ -96,10 +96,20 @@ var ToastContext = /*#__PURE__*/ createContext(null);
|
|
|
96
96
|
return context;
|
|
97
97
|
};
|
|
98
98
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
99
|
+
* @component ToastProvider
|
|
100
|
+
*
|
|
101
|
+
* @description A context provider that manages the toast notification queue and renders the ARIA live region for screen reader announcements.
|
|
102
|
+
*
|
|
103
|
+
* @usage
|
|
104
|
+
* - DO: Wrap your app or page to enable toast notifications via the `useToast` hook.
|
|
105
|
+
* - DON'T: Use multiple ToastProviders in the same component tree.
|
|
106
|
+
*
|
|
107
|
+
* @accessibility
|
|
108
|
+
* - ToastProvider manages the toast container's ARIA live region for screen reader announcements.
|
|
109
|
+
*
|
|
110
|
+
* @alternative
|
|
111
|
+
* - If you need persistent in-page messages, use `Banner` instead of the toast system.
|
|
101
112
|
*
|
|
102
|
-
* @component
|
|
103
113
|
* @param {Object} props - The component props.
|
|
104
114
|
* @param {React.ReactNode} props.children - Child components that can use the toast system.
|
|
105
115
|
* @param {'topRight' | 'topLeft' | 'topCenter' | 'bottomRight' | 'bottomLeft' | 'bottomCenter'} [props.defaultPosition='topRight'] - Default position for toasts.
|
|
@@ -86,7 +86,56 @@ import Stack from "./Stack.js";
|
|
|
86
86
|
import List from "./List.js";
|
|
87
87
|
import Icon from "./Icon.js";
|
|
88
88
|
import { CircleInformationMajor } from "@shopify/polaris-icons";
|
|
89
|
-
|
|
89
|
+
/**
|
|
90
|
+
* @component Tooltip
|
|
91
|
+
*
|
|
92
|
+
* @description A floating text label that appears on hover or focus to provide brief supplementary information about an element.
|
|
93
|
+
*
|
|
94
|
+
* @usage
|
|
95
|
+
* - DO: Provide brief, non-essential supplementary info on hover or focus.
|
|
96
|
+
* - DON'T: Put essential or interactive content in tooltips (use Popover).
|
|
97
|
+
*
|
|
98
|
+
* @accessibility
|
|
99
|
+
* - Tooltip content is announced on focus; ensure trigger element is focusable.
|
|
100
|
+
* - Do not rely on hover-only access.
|
|
101
|
+
*
|
|
102
|
+
* @alternative
|
|
103
|
+
* - If you need interactive content in a floating panel, use `Popover`.
|
|
104
|
+
* - If you need persistent help text, use `Tip`.
|
|
105
|
+
*
|
|
106
|
+
* @param {Object} props - The props for the Tooltip component.
|
|
107
|
+
* @param {React.ReactNode} props.children - The content that triggers the tooltip on hover.
|
|
108
|
+
* @param {React.ReactNode | TooltipContentObject} props.content - The content displayed inside the tooltip. Can be either a React node or a structured content object.
|
|
109
|
+
* @param {boolean} [props.dismissOnMouseOut=true] - Whether the tooltip should be dismissed when the mouse leaves the activator.
|
|
110
|
+
* @param {boolean} [props.dismissOnActivatorClick=true] - Whether the tooltip should be dismissed when clicking the activator.
|
|
111
|
+
* @param {"above" | "below"} [props.preferredPosition="below"] - The preferred position of the tooltip relative to the activator.
|
|
112
|
+
* @param {"center" | "left" | "right"} [props.alignment="center"] - The alignment of the tooltip content.
|
|
113
|
+
* @param {number} [props.hoverDelay=0] - The delay (in milliseconds) before showing the tooltip on hover.
|
|
114
|
+
* @param {boolean} [props.hasUnderline=false] - Whether the activator should have an underline.
|
|
115
|
+
* @param {number | boolean} [props.zIndexOverride] - Override for the z-index of the tooltip.
|
|
116
|
+
* @param {"inline" | "inline-block" | "block"} [props.display="inline-block"] - The display property of the tooltip container.
|
|
117
|
+
* @param {string} [props.className] - Additional class name for the tooltip container.
|
|
118
|
+
*
|
|
119
|
+
* @returns {React.ReactElement} The rendered Tooltip component.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* // Basic usage with string content
|
|
123
|
+
* <Tooltip content="This is a tooltip">
|
|
124
|
+
* <button>Hover me</button>
|
|
125
|
+
* </Tooltip>
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* // Using structured content object
|
|
129
|
+
* <Tooltip content={{
|
|
130
|
+
* heading: "Important Information",
|
|
131
|
+
* content: [
|
|
132
|
+
* { type: "paragraph", content: "This is a paragraph." },
|
|
133
|
+
* { type: "list", content: ["Item 1", "Item 2", "Item 3"] }
|
|
134
|
+
* ]
|
|
135
|
+
* }}>
|
|
136
|
+
* <span>Hover for structured content</span>
|
|
137
|
+
* </Tooltip>
|
|
138
|
+
*/ var styles = tv({
|
|
90
139
|
base: "Litho-TooltipContainer relative w-auto h-auto",
|
|
91
140
|
variants: {
|
|
92
141
|
display: {
|
|
@@ -158,45 +207,6 @@ var arrowStyles = tv({
|
|
|
158
207
|
* @typedef {Object} TooltipContentObject
|
|
159
208
|
* @property {string} [heading] - Optional heading text for the tooltip
|
|
160
209
|
* @property {TooltipContentItem[]} content - Array of content items to display in the tooltip
|
|
161
|
-
*/ /**
|
|
162
|
-
* Tooltip component for displaying contextual information when hovering over an element.
|
|
163
|
-
* The tooltip can be positioned above or below the activator with customizable alignment.
|
|
164
|
-
* It includes optional underline styling and supports dynamic z-index overrides.
|
|
165
|
-
*
|
|
166
|
-
* @component
|
|
167
|
-
*
|
|
168
|
-
* @param {Object} props - The props for the Tooltip component.
|
|
169
|
-
* @param {React.ReactNode} props.children - The content that triggers the tooltip on hover.
|
|
170
|
-
* @param {React.ReactNode | TooltipContentObject} props.content - The content displayed inside the tooltip. Can be either a React node or a structured content object.
|
|
171
|
-
* @param {boolean} [props.dismissOnMouseOut=true] - Whether the tooltip should be dismissed when the mouse leaves the activator.
|
|
172
|
-
* @param {boolean} [props.dismissOnActivatorClick=true] - Whether the tooltip should be dismissed when clicking the activator.
|
|
173
|
-
* @param {"above" | "below"} [props.preferredPosition="below"] - The preferred position of the tooltip relative to the activator.
|
|
174
|
-
* @param {"center" | "left" | "right"} [props.alignment="center"] - The alignment of the tooltip content.
|
|
175
|
-
* @param {number} [props.hoverDelay=0] - The delay (in milliseconds) before showing the tooltip on hover.
|
|
176
|
-
* @param {boolean} [props.hasUnderline=false] - Whether the activator should have an underline.
|
|
177
|
-
* @param {number | boolean} [props.zIndexOverride] - Override for the z-index of the tooltip.
|
|
178
|
-
* @param {"inline" | "inline-block" | "block"} [props.display="inline-block"] - The display property of the tooltip container.
|
|
179
|
-
* @param {string} [props.className] - Additional class name for the tooltip container.
|
|
180
|
-
*
|
|
181
|
-
* @returns {React.ReactElement} The rendered Tooltip component.
|
|
182
|
-
*
|
|
183
|
-
* @example
|
|
184
|
-
* // Basic usage with string content
|
|
185
|
-
* <Tooltip content="This is a tooltip">
|
|
186
|
-
* <button>Hover me</button>
|
|
187
|
-
* </Tooltip>
|
|
188
|
-
*
|
|
189
|
-
* @example
|
|
190
|
-
* // Using structured content object
|
|
191
|
-
* <Tooltip content={{
|
|
192
|
-
* heading: "Important Information",
|
|
193
|
-
* content: [
|
|
194
|
-
* { type: "paragraph", content: "This is a paragraph." },
|
|
195
|
-
* { type: "list", content: ["Item 1", "Item 2", "Item 3"] }
|
|
196
|
-
* ]
|
|
197
|
-
* }}>
|
|
198
|
-
* <span>Hover for structured content</span>
|
|
199
|
-
* </Tooltip>
|
|
200
210
|
*/ function Tooltip() {
|
|
201
211
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
202
212
|
var _props_display = props.display, display = _props_display === void 0 ? "inline-block" : _props_display, children = props.children, content = props.content, _props_dismissOnMouseOut = props.dismissOnMouseOut, dismissOnMouseOut = _props_dismissOnMouseOut === void 0 ? true : _props_dismissOnMouseOut, _props_dismissOnActivatorClick = props.dismissOnActivatorClick, dismissOnActivatorClick = _props_dismissOnActivatorClick === void 0 ? true : _props_dismissOnActivatorClick, _props_preferredPosition = props.preferredPosition, preferredPosition = _props_preferredPosition === void 0 ? "below" : _props_preferredPosition, _props_alignment = props.alignment, alignment = _props_alignment === void 0 ? "center" : _props_alignment, _props_hoverDelay = props.hoverDelay, hoverDelay = _props_hoverDelay === void 0 ? 0 : _props_hoverDelay, _props_hasUnderline = props.hasUnderline, hasUnderline = _props_hasUnderline === void 0 ? false : _props_hasUnderline, zIndexOverride = props.zIndexOverride, className = props.className;
|
|
@@ -303,7 +313,6 @@ var arrowStyles = tv({
|
|
|
303
313
|
}, key);
|
|
304
314
|
} else if (item.type == "list") {
|
|
305
315
|
return /*#__PURE__*/ _jsx(Stack, {
|
|
306
|
-
inlineAlign: "start",
|
|
307
316
|
align: "start",
|
|
308
317
|
gap: "0",
|
|
309
318
|
children: /*#__PURE__*/ _jsx(List, {
|
|
@@ -7,6 +7,19 @@ function _array_like_to_array(arr, len) {
|
|
|
7
7
|
function _array_with_holes(arr) {
|
|
8
8
|
if (Array.isArray(arr)) return arr;
|
|
9
9
|
}
|
|
10
|
+
function _define_property(obj, key, value) {
|
|
11
|
+
if (key in obj) {
|
|
12
|
+
Object.defineProperty(obj, key, {
|
|
13
|
+
value: value,
|
|
14
|
+
enumerable: true,
|
|
15
|
+
configurable: true,
|
|
16
|
+
writable: true
|
|
17
|
+
});
|
|
18
|
+
} else {
|
|
19
|
+
obj[key] = value;
|
|
20
|
+
}
|
|
21
|
+
return obj;
|
|
22
|
+
}
|
|
10
23
|
function _iterable_to_array_limit(arr, i) {
|
|
11
24
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
12
25
|
if (_i == null) return;
|
|
@@ -34,6 +47,45 @@ function _iterable_to_array_limit(arr, i) {
|
|
|
34
47
|
function _non_iterable_rest() {
|
|
35
48
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
36
49
|
}
|
|
50
|
+
function _object_spread(target) {
|
|
51
|
+
for(var i = 1; i < arguments.length; i++){
|
|
52
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
53
|
+
var ownKeys = Object.keys(source);
|
|
54
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
55
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
56
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
ownKeys.forEach(function(key) {
|
|
60
|
+
_define_property(target, key, source[key]);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
return target;
|
|
64
|
+
}
|
|
65
|
+
function ownKeys(object, enumerableOnly) {
|
|
66
|
+
var keys = Object.keys(object);
|
|
67
|
+
if (Object.getOwnPropertySymbols) {
|
|
68
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
69
|
+
if (enumerableOnly) {
|
|
70
|
+
symbols = symbols.filter(function(sym) {
|
|
71
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
keys.push.apply(keys, symbols);
|
|
75
|
+
}
|
|
76
|
+
return keys;
|
|
77
|
+
}
|
|
78
|
+
function _object_spread_props(target, source) {
|
|
79
|
+
source = source != null ? source : {};
|
|
80
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
81
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
82
|
+
} else {
|
|
83
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
84
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
return target;
|
|
88
|
+
}
|
|
37
89
|
function _sliced_to_array(arr, i) {
|
|
38
90
|
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
39
91
|
}
|
|
@@ -54,13 +106,21 @@ import Button from "./Button.js";
|
|
|
54
106
|
import Popover from "./Popover.js";
|
|
55
107
|
import Text from "./Text.js";
|
|
56
108
|
import { useFrame } from "./Frame.js";
|
|
57
|
-
var styles = tv({
|
|
58
|
-
base: "Litho-TopBar flex items-center h-[var(--litho-header-height)] border-b border-edge-subdued dark:border-edge-alt-subdued"
|
|
59
|
-
});
|
|
60
109
|
/**
|
|
61
|
-
*
|
|
110
|
+
* @component TopBar
|
|
111
|
+
*
|
|
112
|
+
* @description An application header bar that displays branding, navigation controls, and user actions at the top of the Frame.
|
|
113
|
+
*
|
|
114
|
+
* @usage
|
|
115
|
+
* - DO: Use as the application header with logo, search, and user actions.
|
|
116
|
+
* - DON'T: Use for page-level titles (use Page).
|
|
117
|
+
*
|
|
118
|
+
* @accessibility
|
|
119
|
+
* - Renders as a `<header>` landmark; ensure the logo link has an accessible label.
|
|
120
|
+
*
|
|
121
|
+
* @alternative
|
|
122
|
+
* - If you need a page title with actions, use `Page`. If you need a side navigation, use `Navigation`.
|
|
62
123
|
*
|
|
63
|
-
* @component
|
|
64
124
|
* @param {Object} props - The component props.
|
|
65
125
|
* @param {React.ReactNode} [props.userMenu] - The user menu element.
|
|
66
126
|
* @param {React.ReactNode} [props.searchTrigger] - The search trigger element.
|
|
@@ -68,7 +128,10 @@ var styles = tv({
|
|
|
68
128
|
* @param {boolean} [props.alwaysShowUserMenuInTopBar] - Whether to always show the user menu in the top bar.
|
|
69
129
|
* @param {React.ReactNode} [props.headerAccessory] - Accessory to render in the header.
|
|
70
130
|
* @returns {JSX.Element} The rendered TopBar component.
|
|
71
|
-
*/
|
|
131
|
+
*/ var styles = tv({
|
|
132
|
+
base: "Litho-TopBar flex items-center h-[var(--litho-header-height)] border-b border-edge-subdued dark:border-edge-alt-subdued"
|
|
133
|
+
});
|
|
134
|
+
function TopBar() {
|
|
72
135
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
73
136
|
var hasNavigation = props.hasNavigation, userMenu = props.userMenu, searchTrigger = props.searchTrigger, alwaysShowUserMenuInTopBar = props.alwaysShowUserMenuInTopBar, headerAccessory = props.headerAccessory;
|
|
74
137
|
var setShowMobileNavigation = useFrame().setShowMobileNavigation;
|
|
@@ -146,11 +209,22 @@ var activatorStyles = tv({
|
|
|
146
209
|
if (!hasPopover) return;
|
|
147
210
|
setShowPopover(!showPopover);
|
|
148
211
|
};
|
|
149
|
-
var activator = /*#__PURE__*/ _jsxs("div", {
|
|
212
|
+
var activator = /*#__PURE__*/ _jsxs("div", _object_spread_props(_object_spread({
|
|
150
213
|
className: activatorStyles({
|
|
151
214
|
interactive: hasPopover
|
|
152
215
|
}),
|
|
153
|
-
onClick: handleActivatorClick
|
|
216
|
+
onClick: handleActivatorClick
|
|
217
|
+
}, hasPopover ? {
|
|
218
|
+
role: "button",
|
|
219
|
+
tabIndex: 0,
|
|
220
|
+
"aria-expanded": showPopover,
|
|
221
|
+
onKeyDown: function(e) {
|
|
222
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
223
|
+
e.preventDefault();
|
|
224
|
+
handleActivatorClick();
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
} : {}), {
|
|
154
228
|
children: [
|
|
155
229
|
image && /*#__PURE__*/ _jsx("div", {
|
|
156
230
|
className: "flex items-center justify-center shrink-0 w-8 h-8 rounded-md font-semibold text-xs",
|
|
@@ -174,7 +248,7 @@ var activatorStyles = tv({
|
|
|
174
248
|
]
|
|
175
249
|
})
|
|
176
250
|
]
|
|
177
|
-
});
|
|
251
|
+
}));
|
|
178
252
|
if (!hasPopover) {
|
|
179
253
|
return activator;
|
|
180
254
|
}
|
|
@@ -79,7 +79,36 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
79
79
|
}
|
|
80
80
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
81
81
|
import { tv } from "tailwind-variants";
|
|
82
|
-
|
|
82
|
+
/**
|
|
83
|
+
* @component VerticalStack
|
|
84
|
+
*
|
|
85
|
+
* @description A vertical flex layout component for stacking children in a column with consistent spacing and alignment.
|
|
86
|
+
*
|
|
87
|
+
* @deprecated Use `Stack` instead. This component will be removed in a future release.
|
|
88
|
+
*
|
|
89
|
+
* @usage
|
|
90
|
+
* - DO: Stack elements vertically with consistent spacing.
|
|
91
|
+
* - DON'T: Use for horizontal layouts (use `HorizontalStack` instead).
|
|
92
|
+
*
|
|
93
|
+
* @accessibility
|
|
94
|
+
* - Maintains natural document flow; screen readers read content in DOM order.
|
|
95
|
+
*
|
|
96
|
+
* @alternative
|
|
97
|
+
* - If you need horizontal layout, use `HorizontalStack`.
|
|
98
|
+
* - If you need flexible direction, use `Stack`.
|
|
99
|
+
*
|
|
100
|
+
* @param {object} props - The properties for the VerticalStack component.
|
|
101
|
+
* @param {string} [props.as="div"] - The HTML tag or component to render as the root element.
|
|
102
|
+
* @param {React.ReactNode} [props.children] - The child elements to render within the stack.
|
|
103
|
+
* @param {string} [props.align] - Vertical alignment of the stack content. Options: "start", "end", "center", "spaceBetween".
|
|
104
|
+
* @param {string} [props.inlineAlign] - Horizontal alignment of the stack content. Options: "start", "end", "center", "spaceBetween".
|
|
105
|
+
* @param {('none'|'xs'|'sm'|'md'|'lg'|'0'|'px'|'0.5'|'1'|'2'|'3'|'4'|'5'|'6'|'8'|'10')} [props.gap="none"] - Spacing between child elements. Semantic options: "none", "xs" (1), "sm" (2), "md" (4), "lg" (8). Numeric options: "0", "px", "0.5", "1", "2", "3", "4", "5", "6", "8", "10".
|
|
106
|
+
* @param {string} [props.id] - The id for the root element of the stack.
|
|
107
|
+
* @param {string} [props.className] - Additional CSS classes to append to the generated styles.
|
|
108
|
+
* @param {object} [props.restProps] - Any additional properties to spread onto the root element.
|
|
109
|
+
*
|
|
110
|
+
* @returns {JSX.Element} The rendered `VerticalStack` component.
|
|
111
|
+
*/ var styles = tv({
|
|
83
112
|
base: "Litho-VerticalStack flex flex-col",
|
|
84
113
|
variants: {
|
|
85
114
|
gap: {
|
|
@@ -116,21 +145,7 @@ var styles = tv({
|
|
|
116
145
|
}
|
|
117
146
|
}
|
|
118
147
|
});
|
|
119
|
-
|
|
120
|
-
* A flexible vertical stack component for consistent layout styling.
|
|
121
|
-
*
|
|
122
|
-
* @param {object} props - The properties for the VerticalStack component.
|
|
123
|
-
* @param {string} [props.as="div"] - The HTML tag or component to render as the root element.
|
|
124
|
-
* @param {React.ReactNode} [props.children] - The child elements to render within the stack.
|
|
125
|
-
* @param {string} [props.align] - Vertical alignment of the stack content. Options: "start", "end", "center", "spaceBetween".
|
|
126
|
-
* @param {string} [props.inlineAlign] - Horizontal alignment of the stack content. Options: "start", "end", "center", "spaceBetween".
|
|
127
|
-
* @param {('none'|'xs'|'sm'|'md'|'lg'|'0'|'px'|'0.5'|'1'|'2'|'3'|'4'|'5'|'6'|'8'|'10')} [props.gap="none"] - Spacing between child elements. Semantic options: "none", "xs" (1), "sm" (2), "md" (4), "lg" (8). Numeric options: "0", "px", "0.5", "1", "2", "3", "4", "5", "6", "8", "10".
|
|
128
|
-
* @param {string} [props.id] - The id for the root element of the stack.
|
|
129
|
-
* @param {string} [props.className] - Additional CSS classes to append to the generated styles.
|
|
130
|
-
* @param {object} [props.restProps] - Any additional properties to spread onto the root element.
|
|
131
|
-
*
|
|
132
|
-
* @returns {JSX.Element} The rendered `VerticalStack` component.
|
|
133
|
-
*/ function VerticalStack() {
|
|
148
|
+
function VerticalStack() {
|
|
134
149
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
135
150
|
var _props_as = props.as, as = _props_as === void 0 ? 'div' : _props_as, children = props.children, align = props.align, inlineAlign = props.inlineAlign, gap = props.gap, id = props.id, className = props.className, restProps = _object_without_properties(props, [
|
|
136
151
|
"as",
|
package/dist/esm/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as ActionList } from "./components/ActionList.js";
|
|
2
2
|
export { default as AnnouncementBar } from "./components/AnnouncementBar.js";
|
|
3
|
+
export { default as AnnouncementCard } from "./components/AnnouncementCard.js";
|
|
3
4
|
export { default as AppProvider, useDarkMode } from "./components/AppProvider.js";
|
|
4
5
|
export { default as Autocomplete } from "./components/Autocomplete.js";
|
|
5
6
|
export { default as Badge } from "./components/Badge.js";
|
|
@@ -9,6 +10,8 @@ export { default as Button } from "./components/Button.js";
|
|
|
9
10
|
export { default as ButtonGroup } from "./components/ButtonGroup.js";
|
|
10
11
|
export { default as Card } from "./components/Card.js";
|
|
11
12
|
export { default as Checkbox } from "./components/Checkbox.js";
|
|
13
|
+
export { default as CheckboxCard } from "./components/CheckboxCard.js";
|
|
14
|
+
export { default as CheckboxCardGroup } from "./components/CheckboxCardGroup.js";
|
|
12
15
|
export { default as ChoiceList } from "./components/ChoiceList.js";
|
|
13
16
|
export { default as Code } from "./components/Code.js";
|
|
14
17
|
export { default as Collapsible } from "./components/Collapsible.js";
|
|
@@ -44,6 +47,8 @@ export { default as Pane } from "./components/Pane.js";
|
|
|
44
47
|
export { default as Popover } from "./components/Popover.js";
|
|
45
48
|
export { default as ProgressBar } from "./components/ProgressBar.js";
|
|
46
49
|
export { default as RadioButton } from "./components/RadioButton.js";
|
|
50
|
+
export { default as RadioButtonCard } from "./components/RadioButtonCard.js";
|
|
51
|
+
export { default as RadioButtonCardGroup } from "./components/RadioButtonCardGroup.js";
|
|
47
52
|
export { default as RangeSlider } from "./components/RangeSlider.js";
|
|
48
53
|
export { default as ResourceList } from "./components/ResourceList.js";
|
|
49
54
|
export { default as Select } from "./components/Select.js";
|
|
@@ -51,6 +56,7 @@ export { default as SkeletonText } from "./components/SkeletonText.js";
|
|
|
51
56
|
export { default as Spinner } from "./components/Spinner.js";
|
|
52
57
|
export { default as Stack } from "./components/Stack.js";
|
|
53
58
|
export { default as Table } from "./components/Table.js";
|
|
59
|
+
export { default as TabNavigation } from "./components/TabNavigation.js";
|
|
54
60
|
export { default as Tabs } from "./components/Tabs.js";
|
|
55
61
|
export { default as Tag } from "./components/Tag.js";
|
|
56
62
|
export { default as Text } from "./components/Text.js";
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
function _object_spread(target) {
|
|
15
|
+
for(var i = 1; i < arguments.length; i++){
|
|
16
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
17
|
+
var ownKeys = Object.keys(source);
|
|
18
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
19
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
20
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
ownKeys.forEach(function(key) {
|
|
24
|
+
_define_property(target, key, source[key]);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
}
|
|
29
|
+
function ownKeys(object, enumerableOnly) {
|
|
30
|
+
var keys = Object.keys(object);
|
|
31
|
+
if (Object.getOwnPropertySymbols) {
|
|
32
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
33
|
+
if (enumerableOnly) {
|
|
34
|
+
symbols = symbols.filter(function(sym) {
|
|
35
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
keys.push.apply(keys, symbols);
|
|
39
|
+
}
|
|
40
|
+
return keys;
|
|
41
|
+
}
|
|
42
|
+
function _object_spread_props(target, source) {
|
|
43
|
+
source = source != null ? source : {};
|
|
44
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
45
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
46
|
+
} else {
|
|
47
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
48
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return target;
|
|
52
|
+
}
|
|
53
|
+
import { defineConfig, devices } from "@playwright/test";
|
|
54
|
+
export default defineConfig({
|
|
55
|
+
testDir: './tests/visual',
|
|
56
|
+
// Run tests in parallel
|
|
57
|
+
fullyParallel: true,
|
|
58
|
+
// Fail the build on CI if you accidentally left test.only in the source code
|
|
59
|
+
forbidOnly: !!process.env.CI,
|
|
60
|
+
// Retry failed tests on CI
|
|
61
|
+
retries: process.env.CI ? 2 : 0,
|
|
62
|
+
// Limit parallel workers on CI
|
|
63
|
+
workers: process.env.CI ? 1 : undefined,
|
|
64
|
+
// Reporter configuration
|
|
65
|
+
reporter: process.env.CI ? 'github' : 'list',
|
|
66
|
+
// Shared settings for all projects
|
|
67
|
+
use: {
|
|
68
|
+
// Base URL for Storybook
|
|
69
|
+
baseURL: 'http://127.0.0.1:6006',
|
|
70
|
+
// Capture trace on failure
|
|
71
|
+
trace: 'on-first-retry'
|
|
72
|
+
},
|
|
73
|
+
// Snapshot naming - remove platform suffix for cross-platform baselines
|
|
74
|
+
snapshotPathTemplate: '{testDir}/{testFileDir}/{testFileName}-snapshots/{arg}{ext}',
|
|
75
|
+
// Visual comparison settings
|
|
76
|
+
expect: {
|
|
77
|
+
toHaveScreenshot: {
|
|
78
|
+
// Allow differences for anti-aliasing and sub-pixel text positioning
|
|
79
|
+
maxDiffPixelRatio: 0.04,
|
|
80
|
+
// Animation settings
|
|
81
|
+
animations: 'disabled'
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
// Configure projects for major browsers
|
|
85
|
+
projects: [
|
|
86
|
+
{
|
|
87
|
+
name: 'chromium',
|
|
88
|
+
use: _object_spread_props(_object_spread({}, devices['Desktop Chrome']), {
|
|
89
|
+
// Consistent viewport
|
|
90
|
+
viewport: {
|
|
91
|
+
width: 1280,
|
|
92
|
+
height: 720
|
|
93
|
+
}
|
|
94
|
+
})
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
// Web server configuration - start Storybook before running tests
|
|
98
|
+
webServer: {
|
|
99
|
+
command: 'npm run storybook -- --ci --quiet',
|
|
100
|
+
url: 'http://127.0.0.1:6006',
|
|
101
|
+
reuseExistingServer: !process.env.CI,
|
|
102
|
+
timeout: 120000
|
|
103
|
+
}
|
|
104
|
+
});
|