@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
|
@@ -15,7 +15,28 @@ function _interop_require_default(obj) {
|
|
|
15
15
|
default: obj
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
/**
|
|
19
|
+
* @component TimePicker
|
|
20
|
+
*
|
|
21
|
+
* @description A time selection input that wraps a TextField with type='time' for picking specific times.
|
|
22
|
+
*
|
|
23
|
+
* @usage
|
|
24
|
+
* - DO: Use for selecting specific times in scheduling or event forms.
|
|
25
|
+
* - DON'T: Use for date selection (use DatePicker).
|
|
26
|
+
*
|
|
27
|
+
* @accessibility
|
|
28
|
+
* - Wraps a TextField with type="time" for native keyboard and screen reader support; always provide a label.
|
|
29
|
+
*
|
|
30
|
+
* @alternative
|
|
31
|
+
* - If you need date selection, use `DatePicker`. If you need freeform text input, use `TextField`.
|
|
32
|
+
*
|
|
33
|
+
* @param {Object} [props={}] - The properties for the TimePicker component.
|
|
34
|
+
* @param {string} [props.label="Time:"] - The label text for the time input.
|
|
35
|
+
* @param {boolean} [props.labelInline=true] - Whether to display the label inline as a prefix.
|
|
36
|
+
* @param {string} [props.value] - The current time value (in HH:mm format).
|
|
37
|
+
* @param {Function} [props.onChange] - Callback function invoked when the time value changes.
|
|
38
|
+
* @returns {JSX.Element} The rendered TimePicker component.
|
|
39
|
+
*/ function TimePicker() {
|
|
19
40
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
20
41
|
var _props_label = props.label, label = _props_label === void 0 ? "Time:" : _props_label, _props_labelInline = props.labelInline, labelInline = _props_labelInline === void 0 ? true : _props_labelInline, value = props.value, onChange = props.onChange;
|
|
21
42
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_TextField.default, {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";
|
|
2
3
|
Object.defineProperty(exports, "__esModule", {
|
|
3
4
|
value: true
|
|
@@ -12,7 +13,22 @@ var _jsxruntime = require("react/jsx-runtime");
|
|
|
12
13
|
var _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
13
14
|
var _tailwindvariants = require("tailwind-variants");
|
|
14
15
|
var _Icon = /*#__PURE__*/ _interop_require_default(require("./Icon"));
|
|
16
|
+
var _Button = /*#__PURE__*/ _interop_require_default(require("./Button"));
|
|
17
|
+
var _Text = /*#__PURE__*/ _interop_require_default(require("./Text"));
|
|
15
18
|
var _polarisicons = require("@shopify/polaris-icons");
|
|
19
|
+
function _define_property(obj, key, value) {
|
|
20
|
+
if (key in obj) {
|
|
21
|
+
Object.defineProperty(obj, key, {
|
|
22
|
+
value: value,
|
|
23
|
+
enumerable: true,
|
|
24
|
+
configurable: true,
|
|
25
|
+
writable: true
|
|
26
|
+
});
|
|
27
|
+
} else {
|
|
28
|
+
obj[key] = value;
|
|
29
|
+
}
|
|
30
|
+
return obj;
|
|
31
|
+
}
|
|
16
32
|
function _interop_require_default(obj) {
|
|
17
33
|
return obj && obj.__esModule ? obj : {
|
|
18
34
|
default: obj
|
|
@@ -59,8 +75,73 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
59
75
|
}
|
|
60
76
|
return newObj;
|
|
61
77
|
}
|
|
62
|
-
|
|
63
|
-
|
|
78
|
+
function _object_spread(target) {
|
|
79
|
+
for(var i = 1; i < arguments.length; i++){
|
|
80
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
81
|
+
var ownKeys = Object.keys(source);
|
|
82
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
83
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
84
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
ownKeys.forEach(function(key) {
|
|
88
|
+
_define_property(target, key, source[key]);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
return target;
|
|
92
|
+
}
|
|
93
|
+
function ownKeys(object, enumerableOnly) {
|
|
94
|
+
var keys = Object.keys(object);
|
|
95
|
+
if (Object.getOwnPropertySymbols) {
|
|
96
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
97
|
+
if (enumerableOnly) {
|
|
98
|
+
symbols = symbols.filter(function(sym) {
|
|
99
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
keys.push.apply(keys, symbols);
|
|
103
|
+
}
|
|
104
|
+
return keys;
|
|
105
|
+
}
|
|
106
|
+
function _object_spread_props(target, source) {
|
|
107
|
+
source = source != null ? source : {};
|
|
108
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
109
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
110
|
+
} else {
|
|
111
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
112
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
return target;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* @component Tip
|
|
119
|
+
*
|
|
120
|
+
* @description A subtle inline hint component that displays contextual guidance or tips within a page section.
|
|
121
|
+
*
|
|
122
|
+
* @usage
|
|
123
|
+
* - DO: Provide helpful, non-critical contextual hints or best practices inline.
|
|
124
|
+
* - DON'T: Use for important alerts or errors (use Banner).
|
|
125
|
+
*
|
|
126
|
+
* @accessibility
|
|
127
|
+
* - Tip content is read as regular page content; ensure the tip text is meaningful without relying on its icon.
|
|
128
|
+
*
|
|
129
|
+
* @alternative
|
|
130
|
+
* - If you need a prominent alert with actions, use `Banner`.
|
|
131
|
+
* - If you need a global notification bar, use `AnnouncementBar`.
|
|
132
|
+
*
|
|
133
|
+
* @param {Object} props - The component props.
|
|
134
|
+
* @param {"info" | "critical" | "success" | "warning" | "attention" | "highlight" | "neutral" | "plain" | "minimal"} [props.status="info"] - The status type of the tip.
|
|
135
|
+
* @param {Function} [props.onDismiss] - Function to call when the dismiss button is clicked.
|
|
136
|
+
* @param {Function} [props.onClick] - Function to call when the tip is clicked.
|
|
137
|
+
* @param {React.ReactNode} props.children - The content of the tip.
|
|
138
|
+
* @param {React.ElementType} [props.icon] - Custom icon for the tip.
|
|
139
|
+
* @param {"left" | "right" | "center"} [props.align="left"] - The alignment of the tip.
|
|
140
|
+
* @param {Array<{content: string, onAction: Function}>} [props.actions] - Array of action objects to show as buttons at the bottom.
|
|
141
|
+
* @param {string | React.ReactNode} [props.title=null] - Optional title shown above the tip content.
|
|
142
|
+
* @returns {JSX.Element} The rendered Tip component.
|
|
143
|
+
*/ var styles = (0, _tailwindvariants.tv)({
|
|
144
|
+
base: "Litho-Tip relative flex rounded-md",
|
|
64
145
|
variants: {
|
|
65
146
|
status: {
|
|
66
147
|
success: "bg-success-alt text-success-alt-fg",
|
|
@@ -70,7 +151,8 @@ var styles = (0, _tailwindvariants.tv)({
|
|
|
70
151
|
highlight: "bg-highlight-alt text-highlight-alt-fg",
|
|
71
152
|
insight: "bg-insight-alt text-insight-alt-fg",
|
|
72
153
|
info: "bg-info-alt text-info-alt-fg",
|
|
73
|
-
plain: "bg-transparent text-subdued
|
|
154
|
+
plain: "bg-transparent text-high border border-border-subdued rounded-lg",
|
|
155
|
+
minimal: "bg-transparent text-high"
|
|
74
156
|
},
|
|
75
157
|
dismissible: {
|
|
76
158
|
true: "pr-8"
|
|
@@ -80,19 +162,29 @@ var styles = (0, _tailwindvariants.tv)({
|
|
|
80
162
|
},
|
|
81
163
|
border: {
|
|
82
164
|
true: "border border-tint-2"
|
|
165
|
+
},
|
|
166
|
+
padding: {
|
|
167
|
+
default: "p-2",
|
|
168
|
+
md: "p-3",
|
|
169
|
+
lg: "p-4"
|
|
83
170
|
}
|
|
84
171
|
},
|
|
85
172
|
defaultVariants: {
|
|
86
173
|
status: "info",
|
|
87
174
|
dismissible: false,
|
|
88
175
|
clickable: false,
|
|
89
|
-
border: false
|
|
176
|
+
border: false,
|
|
177
|
+
padding: "default"
|
|
90
178
|
},
|
|
91
179
|
compoundVariants: [
|
|
92
180
|
{
|
|
93
181
|
clickable: true,
|
|
94
182
|
status: "info",
|
|
95
183
|
className: "hover:outline hover:outline-info-alt-lower"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
status: "minimal",
|
|
187
|
+
className: "!p-0"
|
|
96
188
|
}
|
|
97
189
|
]
|
|
98
190
|
});
|
|
@@ -137,29 +229,20 @@ var statusHelpers = {
|
|
|
137
229
|
insight: {
|
|
138
230
|
icon: _polarisicons.MagicMajor
|
|
139
231
|
},
|
|
140
|
-
neutral: {}
|
|
232
|
+
neutral: {},
|
|
233
|
+
minimal: {}
|
|
141
234
|
};
|
|
142
|
-
|
|
143
|
-
* Tip component for displaying informational messages with optional dismiss functionality.
|
|
144
|
-
*
|
|
145
|
-
* @param {Object} props - The component props.
|
|
146
|
-
* @param {"info" | "critical" | "success" | "warning" | "attention" | "highlight" | "neutral"} [props.status="info"] - The status type of the tip.
|
|
147
|
-
* @param {Function} [props.onDismiss] - Function to call when the dismiss button is clicked.
|
|
148
|
-
* @param {Function} [props.onClick] - Function to call when the tip is clicked.
|
|
149
|
-
* @param {React.ReactNode} props.children - The content of the tip.
|
|
150
|
-
* @param {React.ElementType} [props.icon] - Custom icon for the tip.
|
|
151
|
-
* @param {"left" | "right" | "center"} [props.align="left"] - The alignment of the tip.
|
|
152
|
-
* @returns {JSX.Element} The rendered Tip component.
|
|
153
|
-
*/ function Tip() {
|
|
235
|
+
function Tip() {
|
|
154
236
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
155
237
|
var _statusHelpers_status;
|
|
156
|
-
var _props_status = props.status, status = _props_status === void 0 ? "info" : _props_status, onClick = props.onClick, onDismiss = props.onDismiss, children = props.children, _icon = props.icon, _props_align = props.align, align = _props_align === void 0 ? "left" : _props_align, border = props.border;
|
|
238
|
+
var _props_status = props.status, status = _props_status === void 0 ? "info" : _props_status, onClick = props.onClick, onDismiss = props.onDismiss, children = props.children, _icon = props.icon, _props_align = props.align, align = _props_align === void 0 ? "left" : _props_align, border = props.border, actions = props.actions, _props_title = props.title, title = _props_title === void 0 ? null : _props_title, _props_padding = props.padding, padding = _props_padding === void 0 ? "default" : _props_padding;
|
|
157
239
|
var icon = _icon === null ? null : _icon || ((_statusHelpers_status = statusHelpers[status]) === null || _statusHelpers_status === void 0 ? void 0 : _statusHelpers_status.icon) || _polarisicons.InfoMinor;
|
|
158
240
|
var classes = styles({
|
|
159
241
|
status: status,
|
|
160
242
|
dismissible: !!onDismiss,
|
|
161
243
|
clickable: !!onClick,
|
|
162
|
-
border: border
|
|
244
|
+
border: border,
|
|
245
|
+
padding: padding
|
|
163
246
|
});
|
|
164
247
|
var base = "-alt-icon";
|
|
165
248
|
var iconColorMap = {
|
|
@@ -171,7 +254,9 @@ var statusHelpers = {
|
|
|
171
254
|
highlight: "highlight".concat(base),
|
|
172
255
|
insight: "insight".concat(base),
|
|
173
256
|
neutral: "neutral".concat(base),
|
|
174
|
-
default: "info".concat(base)
|
|
257
|
+
default: "info".concat(base),
|
|
258
|
+
plain: "subdued",
|
|
259
|
+
minimal: "subdued"
|
|
175
260
|
};
|
|
176
261
|
var iconColor = iconColorMap[status] || iconColorMap.default;
|
|
177
262
|
var processedChildren = (0, _react.useMemo)(function() {
|
|
@@ -195,9 +280,19 @@ var statusHelpers = {
|
|
|
195
280
|
children,
|
|
196
281
|
status
|
|
197
282
|
]);
|
|
198
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
283
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", _object_spread_props(_object_spread({
|
|
199
284
|
className: classes,
|
|
200
|
-
onClick: onClick
|
|
285
|
+
onClick: onClick
|
|
286
|
+
}, onClick ? {
|
|
287
|
+
role: "button",
|
|
288
|
+
tabIndex: 0,
|
|
289
|
+
onKeyDown: function(e) {
|
|
290
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
291
|
+
e.preventDefault();
|
|
292
|
+
onClick(e);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
} : {}), {
|
|
201
296
|
children: [
|
|
202
297
|
/*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
203
298
|
className: innerStyles({
|
|
@@ -208,8 +303,28 @@ var statusHelpers = {
|
|
|
208
303
|
source: icon,
|
|
209
304
|
color: iconColor
|
|
210
305
|
}),
|
|
211
|
-
/*#__PURE__*/ (0, _jsxruntime.
|
|
212
|
-
|
|
306
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
307
|
+
className: "flex flex-col gap-1 flex-1",
|
|
308
|
+
children: [
|
|
309
|
+
title != null && title !== "" && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
|
|
310
|
+
fontWeight: "medium",
|
|
311
|
+
children: title
|
|
312
|
+
}),
|
|
313
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
314
|
+
children: processedChildren
|
|
315
|
+
}),
|
|
316
|
+
(actions === null || actions === void 0 ? void 0 : actions.length) > 0 && /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
317
|
+
className: "relative -left-3 flex items-center",
|
|
318
|
+
children: actions.map(function(action, i) {
|
|
319
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_Button.default, {
|
|
320
|
+
plain: true,
|
|
321
|
+
size: "small",
|
|
322
|
+
onClick: action.onAction,
|
|
323
|
+
children: action.content
|
|
324
|
+
}, i);
|
|
325
|
+
})
|
|
326
|
+
})
|
|
327
|
+
]
|
|
213
328
|
})
|
|
214
329
|
]
|
|
215
330
|
}),
|
|
@@ -224,6 +339,6 @@ var statusHelpers = {
|
|
|
224
339
|
})
|
|
225
340
|
})
|
|
226
341
|
]
|
|
227
|
-
});
|
|
342
|
+
}));
|
|
228
343
|
}
|
|
229
344
|
var _default = Tip;
|
|
@@ -23,6 +23,19 @@ function _array_like_to_array(arr, len) {
|
|
|
23
23
|
function _array_with_holes(arr) {
|
|
24
24
|
if (Array.isArray(arr)) return arr;
|
|
25
25
|
}
|
|
26
|
+
function _define_property(obj, key, value) {
|
|
27
|
+
if (key in obj) {
|
|
28
|
+
Object.defineProperty(obj, key, {
|
|
29
|
+
value: value,
|
|
30
|
+
enumerable: true,
|
|
31
|
+
configurable: true,
|
|
32
|
+
writable: true
|
|
33
|
+
});
|
|
34
|
+
} else {
|
|
35
|
+
obj[key] = value;
|
|
36
|
+
}
|
|
37
|
+
return obj;
|
|
38
|
+
}
|
|
26
39
|
function _interop_require_default(obj) {
|
|
27
40
|
return obj && obj.__esModule ? obj : {
|
|
28
41
|
default: obj
|
|
@@ -55,6 +68,45 @@ function _iterable_to_array_limit(arr, i) {
|
|
|
55
68
|
function _non_iterable_rest() {
|
|
56
69
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
57
70
|
}
|
|
71
|
+
function _object_spread(target) {
|
|
72
|
+
for(var i = 1; i < arguments.length; i++){
|
|
73
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
74
|
+
var ownKeys = Object.keys(source);
|
|
75
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
76
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
77
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
ownKeys.forEach(function(key) {
|
|
81
|
+
_define_property(target, key, source[key]);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
return target;
|
|
85
|
+
}
|
|
86
|
+
function ownKeys(object, enumerableOnly) {
|
|
87
|
+
var keys = Object.keys(object);
|
|
88
|
+
if (Object.getOwnPropertySymbols) {
|
|
89
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
90
|
+
if (enumerableOnly) {
|
|
91
|
+
symbols = symbols.filter(function(sym) {
|
|
92
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
keys.push.apply(keys, symbols);
|
|
96
|
+
}
|
|
97
|
+
return keys;
|
|
98
|
+
}
|
|
99
|
+
function _object_spread_props(target, source) {
|
|
100
|
+
source = source != null ? source : {};
|
|
101
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
102
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
103
|
+
} else {
|
|
104
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
105
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
return target;
|
|
109
|
+
}
|
|
58
110
|
function _sliced_to_array(arr, i) {
|
|
59
111
|
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
60
112
|
}
|
|
@@ -66,7 +118,47 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
66
118
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
67
119
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
68
120
|
}
|
|
69
|
-
|
|
121
|
+
/**
|
|
122
|
+
* @component ToastNotification
|
|
123
|
+
*
|
|
124
|
+
* @description A brief, auto-dismissing notification that appears at the bottom of the screen to confirm an action or report an event.
|
|
125
|
+
*
|
|
126
|
+
* @usage
|
|
127
|
+
* - DO: Display brief, auto-dismissing success or info notifications after user actions.
|
|
128
|
+
* - DON'T: Use for persistent messages or errors (use Banner).
|
|
129
|
+
*
|
|
130
|
+
* @accessibility
|
|
131
|
+
* - Toast should be announced to screen readers via `role="alert"` or live region. Keep messages brief.
|
|
132
|
+
*
|
|
133
|
+
* @alternative
|
|
134
|
+
* - If you need a persistent message, use `Banner`.
|
|
135
|
+
* - If you need a modal confirmation, use `Modal`.
|
|
136
|
+
*
|
|
137
|
+
* @param {Object} props - The component props.
|
|
138
|
+
* @param {React.ReactNode} [props.prefix] - Optional prefix content (image, icon, or component) to display before the title.
|
|
139
|
+
* @param {Object|Function} [props.icon] - Optional icon source (from @shopify/polaris-icons) to display as prefix. Used as fallback if prefix is not provided.
|
|
140
|
+
* @param {string} props.title - The main title text of the toast.
|
|
141
|
+
* @param {string} [props.subtitle] - Optional subtitle text displayed below the title.
|
|
142
|
+
* @param {number} [props.duration=3000] - Duration in milliseconds before the toast auto-dismisses. Defaults to 2000ms (2 seconds).
|
|
143
|
+
* @param {'topRight' | 'topLeft' | 'topCenter' | 'bottomRight' | 'bottomLeft' | 'bottomCenter'} [props.position='topRight'] - Position of the toast on the screen.
|
|
144
|
+
* @param {Function} [props.onDismiss] - Callback function called when the toast is dismissed (either automatically or manually).
|
|
145
|
+
* @param {Function} [props.onClick] - Callback function called when the toast is clicked. Makes the entire toast clickable with cursor-pointer.
|
|
146
|
+
* @param {boolean} [props.dismissible=true] - Whether the toast can be manually dismissed via the close button.
|
|
147
|
+
* @param {boolean} [props.fixed=true] - Whether to use fixed positioning. Set to false when used within ToastProvider.
|
|
148
|
+
* @param {boolean} [props.isDismissing=false] - Whether the toast is in a dismissing state. Starts the exit animation immediately.
|
|
149
|
+
* @param {string} [props.className] - Additional CSS classes to apply to the toast container.
|
|
150
|
+
* @returns {JSX.Element|null} The rendered toast notification or null if dismissed.
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* <ToastNotification
|
|
154
|
+
* prefix={<Icon source={TickMinor} color="success" />}
|
|
155
|
+
* title="Support ticket updated"
|
|
156
|
+
* subtitle="Your ticket has been resolved"
|
|
157
|
+
* duration={3000}
|
|
158
|
+
* position="topRight"
|
|
159
|
+
* onDismiss={() => console.log('Toast dismissed')}
|
|
160
|
+
* />
|
|
161
|
+
*/ var styles = (0, _tailwindvariants.tv)({
|
|
70
162
|
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",
|
|
71
163
|
variants: {
|
|
72
164
|
position: {
|
|
@@ -162,36 +254,7 @@ var styles = (0, _tailwindvariants.tv)({
|
|
|
162
254
|
var closeButtonStyles = (0, _tailwindvariants.tv)({
|
|
163
255
|
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"
|
|
164
256
|
});
|
|
165
|
-
|
|
166
|
-
* ToastNotification component for displaying temporary notifications to users.
|
|
167
|
-
* Automatically dismisses after the specified duration.
|
|
168
|
-
*
|
|
169
|
-
* @component
|
|
170
|
-
* @param {Object} props - The component props.
|
|
171
|
-
* @param {React.ReactNode} [props.prefix] - Optional prefix content (image, icon, or component) to display before the title.
|
|
172
|
-
* @param {Object|Function} [props.icon] - Optional icon source (from @shopify/polaris-icons) to display as prefix. Used as fallback if prefix is not provided.
|
|
173
|
-
* @param {string} props.title - The main title text of the toast.
|
|
174
|
-
* @param {string} [props.subtitle] - Optional subtitle text displayed below the title.
|
|
175
|
-
* @param {number} [props.duration=3000] - Duration in milliseconds before the toast auto-dismisses. Defaults to 2000ms (2 seconds).
|
|
176
|
-
* @param {'topRight' | 'topLeft' | 'topCenter' | 'bottomRight' | 'bottomLeft' | 'bottomCenter'} [props.position='topRight'] - Position of the toast on the screen.
|
|
177
|
-
* @param {Function} [props.onDismiss] - Callback function called when the toast is dismissed (either automatically or manually).
|
|
178
|
-
* @param {Function} [props.onClick] - Callback function called when the toast is clicked. Makes the entire toast clickable with cursor-pointer.
|
|
179
|
-
* @param {boolean} [props.dismissible=true] - Whether the toast can be manually dismissed via the close button.
|
|
180
|
-
* @param {boolean} [props.fixed=true] - Whether to use fixed positioning. Set to false when used within ToastProvider.
|
|
181
|
-
* @param {boolean} [props.isDismissing=false] - Whether the toast is in a dismissing state. Starts the exit animation immediately.
|
|
182
|
-
* @param {string} [props.className] - Additional CSS classes to apply to the toast container.
|
|
183
|
-
* @returns {JSX.Element|null} The rendered toast notification or null if dismissed.
|
|
184
|
-
*
|
|
185
|
-
* @example
|
|
186
|
-
* <ToastNotification
|
|
187
|
-
* prefix={<Icon source={TickMinor} color="success" />}
|
|
188
|
-
* title="Support ticket updated"
|
|
189
|
-
* subtitle="Your ticket has been resolved"
|
|
190
|
-
* duration={3000}
|
|
191
|
-
* position="topRight"
|
|
192
|
-
* onDismiss={() => console.log('Toast dismissed')}
|
|
193
|
-
* />
|
|
194
|
-
*/ function ToastNotification() {
|
|
257
|
+
function ToastNotification() {
|
|
195
258
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
196
259
|
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;
|
|
197
260
|
var _useState = _sliced_to_array((0, _react.useState)(!isDismissing), 2), visible = _useState[0], setVisible = _useState[1];
|
|
@@ -324,11 +387,21 @@ var closeButtonStyles = (0, _tailwindvariants.tv)({
|
|
|
324
387
|
source: icon,
|
|
325
388
|
color: "subdued"
|
|
326
389
|
}) : null);
|
|
327
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
390
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", _object_spread_props(_object_spread({
|
|
328
391
|
className: "".concat(classes).concat(className ? " ".concat(className) : ""),
|
|
329
392
|
onClick: handleToastClick,
|
|
330
393
|
onMouseEnter: handleMouseEnter,
|
|
331
|
-
onMouseLeave: handleMouseLeave
|
|
394
|
+
onMouseLeave: handleMouseLeave
|
|
395
|
+
}, onClick ? {
|
|
396
|
+
role: "button",
|
|
397
|
+
tabIndex: 0,
|
|
398
|
+
onKeyDown: function(e) {
|
|
399
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
400
|
+
e.preventDefault();
|
|
401
|
+
onClick(e);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
} : {}), {
|
|
332
405
|
children: [
|
|
333
406
|
prefixContent && /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
334
407
|
className: "Litho-ToastNotification__Prefix flex-none",
|
|
@@ -363,6 +436,6 @@ var closeButtonStyles = (0, _tailwindvariants.tv)({
|
|
|
363
436
|
})
|
|
364
437
|
})
|
|
365
438
|
]
|
|
366
|
-
});
|
|
439
|
+
}));
|
|
367
440
|
}
|
|
368
441
|
var _default = ToastNotification;
|
|
@@ -102,10 +102,20 @@ var useToast = function() {
|
|
|
102
102
|
return context;
|
|
103
103
|
};
|
|
104
104
|
/**
|
|
105
|
-
*
|
|
106
|
-
*
|
|
105
|
+
* @component ToastProvider
|
|
106
|
+
*
|
|
107
|
+
* @description A context provider that manages the toast notification queue and renders the ARIA live region for screen reader announcements.
|
|
108
|
+
*
|
|
109
|
+
* @usage
|
|
110
|
+
* - DO: Wrap your app or page to enable toast notifications via the `useToast` hook.
|
|
111
|
+
* - DON'T: Use multiple ToastProviders in the same component tree.
|
|
112
|
+
*
|
|
113
|
+
* @accessibility
|
|
114
|
+
* - ToastProvider manages the toast container's ARIA live region for screen reader announcements.
|
|
115
|
+
*
|
|
116
|
+
* @alternative
|
|
117
|
+
* - If you need persistent in-page messages, use `Banner` instead of the toast system.
|
|
107
118
|
*
|
|
108
|
-
* @component
|
|
109
119
|
* @param {Object} props - The component props.
|
|
110
120
|
* @param {React.ReactNode} props.children - Child components that can use the toast system.
|
|
111
121
|
* @param {'topRight' | 'topLeft' | 'topCenter' | 'bottomRight' | 'bottomLeft' | 'bottomCenter'} [props.defaultPosition='topRight'] - Default position for toasts.
|
|
@@ -142,7 +142,56 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
142
142
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
143
143
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
144
144
|
}
|
|
145
|
-
|
|
145
|
+
/**
|
|
146
|
+
* @component Tooltip
|
|
147
|
+
*
|
|
148
|
+
* @description A floating text label that appears on hover or focus to provide brief supplementary information about an element.
|
|
149
|
+
*
|
|
150
|
+
* @usage
|
|
151
|
+
* - DO: Provide brief, non-essential supplementary info on hover or focus.
|
|
152
|
+
* - DON'T: Put essential or interactive content in tooltips (use Popover).
|
|
153
|
+
*
|
|
154
|
+
* @accessibility
|
|
155
|
+
* - Tooltip content is announced on focus; ensure trigger element is focusable.
|
|
156
|
+
* - Do not rely on hover-only access.
|
|
157
|
+
*
|
|
158
|
+
* @alternative
|
|
159
|
+
* - If you need interactive content in a floating panel, use `Popover`.
|
|
160
|
+
* - If you need persistent help text, use `Tip`.
|
|
161
|
+
*
|
|
162
|
+
* @param {Object} props - The props for the Tooltip component.
|
|
163
|
+
* @param {React.ReactNode} props.children - The content that triggers the tooltip on hover.
|
|
164
|
+
* @param {React.ReactNode | TooltipContentObject} props.content - The content displayed inside the tooltip. Can be either a React node or a structured content object.
|
|
165
|
+
* @param {boolean} [props.dismissOnMouseOut=true] - Whether the tooltip should be dismissed when the mouse leaves the activator.
|
|
166
|
+
* @param {boolean} [props.dismissOnActivatorClick=true] - Whether the tooltip should be dismissed when clicking the activator.
|
|
167
|
+
* @param {"above" | "below"} [props.preferredPosition="below"] - The preferred position of the tooltip relative to the activator.
|
|
168
|
+
* @param {"center" | "left" | "right"} [props.alignment="center"] - The alignment of the tooltip content.
|
|
169
|
+
* @param {number} [props.hoverDelay=0] - The delay (in milliseconds) before showing the tooltip on hover.
|
|
170
|
+
* @param {boolean} [props.hasUnderline=false] - Whether the activator should have an underline.
|
|
171
|
+
* @param {number | boolean} [props.zIndexOverride] - Override for the z-index of the tooltip.
|
|
172
|
+
* @param {"inline" | "inline-block" | "block"} [props.display="inline-block"] - The display property of the tooltip container.
|
|
173
|
+
* @param {string} [props.className] - Additional class name for the tooltip container.
|
|
174
|
+
*
|
|
175
|
+
* @returns {React.ReactElement} The rendered Tooltip component.
|
|
176
|
+
*
|
|
177
|
+
* @example
|
|
178
|
+
* // Basic usage with string content
|
|
179
|
+
* <Tooltip content="This is a tooltip">
|
|
180
|
+
* <button>Hover me</button>
|
|
181
|
+
* </Tooltip>
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* // Using structured content object
|
|
185
|
+
* <Tooltip content={{
|
|
186
|
+
* heading: "Important Information",
|
|
187
|
+
* content: [
|
|
188
|
+
* { type: "paragraph", content: "This is a paragraph." },
|
|
189
|
+
* { type: "list", content: ["Item 1", "Item 2", "Item 3"] }
|
|
190
|
+
* ]
|
|
191
|
+
* }}>
|
|
192
|
+
* <span>Hover for structured content</span>
|
|
193
|
+
* </Tooltip>
|
|
194
|
+
*/ var styles = (0, _tailwindvariants.tv)({
|
|
146
195
|
base: "Litho-TooltipContainer relative w-auto h-auto",
|
|
147
196
|
variants: {
|
|
148
197
|
display: {
|
|
@@ -214,45 +263,6 @@ var arrowStyles = (0, _tailwindvariants.tv)({
|
|
|
214
263
|
* @typedef {Object} TooltipContentObject
|
|
215
264
|
* @property {string} [heading] - Optional heading text for the tooltip
|
|
216
265
|
* @property {TooltipContentItem[]} content - Array of content items to display in the tooltip
|
|
217
|
-
*/ /**
|
|
218
|
-
* Tooltip component for displaying contextual information when hovering over an element.
|
|
219
|
-
* The tooltip can be positioned above or below the activator with customizable alignment.
|
|
220
|
-
* It includes optional underline styling and supports dynamic z-index overrides.
|
|
221
|
-
*
|
|
222
|
-
* @component
|
|
223
|
-
*
|
|
224
|
-
* @param {Object} props - The props for the Tooltip component.
|
|
225
|
-
* @param {React.ReactNode} props.children - The content that triggers the tooltip on hover.
|
|
226
|
-
* @param {React.ReactNode | TooltipContentObject} props.content - The content displayed inside the tooltip. Can be either a React node or a structured content object.
|
|
227
|
-
* @param {boolean} [props.dismissOnMouseOut=true] - Whether the tooltip should be dismissed when the mouse leaves the activator.
|
|
228
|
-
* @param {boolean} [props.dismissOnActivatorClick=true] - Whether the tooltip should be dismissed when clicking the activator.
|
|
229
|
-
* @param {"above" | "below"} [props.preferredPosition="below"] - The preferred position of the tooltip relative to the activator.
|
|
230
|
-
* @param {"center" | "left" | "right"} [props.alignment="center"] - The alignment of the tooltip content.
|
|
231
|
-
* @param {number} [props.hoverDelay=0] - The delay (in milliseconds) before showing the tooltip on hover.
|
|
232
|
-
* @param {boolean} [props.hasUnderline=false] - Whether the activator should have an underline.
|
|
233
|
-
* @param {number | boolean} [props.zIndexOverride] - Override for the z-index of the tooltip.
|
|
234
|
-
* @param {"inline" | "inline-block" | "block"} [props.display="inline-block"] - The display property of the tooltip container.
|
|
235
|
-
* @param {string} [props.className] - Additional class name for the tooltip container.
|
|
236
|
-
*
|
|
237
|
-
* @returns {React.ReactElement} The rendered Tooltip component.
|
|
238
|
-
*
|
|
239
|
-
* @example
|
|
240
|
-
* // Basic usage with string content
|
|
241
|
-
* <Tooltip content="This is a tooltip">
|
|
242
|
-
* <button>Hover me</button>
|
|
243
|
-
* </Tooltip>
|
|
244
|
-
*
|
|
245
|
-
* @example
|
|
246
|
-
* // Using structured content object
|
|
247
|
-
* <Tooltip content={{
|
|
248
|
-
* heading: "Important Information",
|
|
249
|
-
* content: [
|
|
250
|
-
* { type: "paragraph", content: "This is a paragraph." },
|
|
251
|
-
* { type: "list", content: ["Item 1", "Item 2", "Item 3"] }
|
|
252
|
-
* ]
|
|
253
|
-
* }}>
|
|
254
|
-
* <span>Hover for structured content</span>
|
|
255
|
-
* </Tooltip>
|
|
256
266
|
*/ function Tooltip() {
|
|
257
267
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
258
268
|
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;
|
|
@@ -359,7 +369,6 @@ var arrowStyles = (0, _tailwindvariants.tv)({
|
|
|
359
369
|
}, key);
|
|
360
370
|
} else if (item.type == "list") {
|
|
361
371
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_Stack.default, {
|
|
362
|
-
inlineAlign: "start",
|
|
363
372
|
align: "start",
|
|
364
373
|
gap: "0",
|
|
365
374
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_List.default, {
|