@heymantle/litho 0.0.15 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AI_COMPONENTS_GUIDE.md +28 -15
- package/AI_INTEGRATION_GUIDE.md +3 -3
- package/AI_PATTERNS_GUIDE.md +59 -25
- package/COMPONENT_QUICK_REFERENCE.md +3 -3
- package/dist/cjs/components/ActionList.js +33 -25
- package/dist/cjs/components/AnnouncementBar.js +115 -18
- package/dist/cjs/components/AnnouncementCard.js +269 -0
- package/dist/cjs/components/AppProvider.js +15 -2
- package/dist/cjs/components/Autocomplete.js +58 -36
- package/dist/cjs/components/Badge.js +28 -14
- package/dist/cjs/components/Banner.js +37 -27
- package/dist/cjs/components/Box.js +50 -38
- package/dist/cjs/components/Button.js +338 -109
- package/dist/cjs/components/ButtonGroup.js +27 -14
- package/dist/cjs/components/Card.js +311 -143
- package/dist/cjs/components/Checkbox.js +55 -47
- package/dist/cjs/components/CheckboxCard.js +222 -0
- package/dist/cjs/components/CheckboxCardGroup.js +384 -0
- package/dist/cjs/components/ChoiceList.js +21 -11
- package/dist/cjs/components/Code.js +22 -8
- package/dist/cjs/components/Collapsible.js +24 -11
- package/dist/cjs/components/ColorField.js +163 -38
- package/dist/cjs/components/ContextualSaveBar.js +13 -6
- package/dist/cjs/components/DatePicker.js +48 -37
- package/dist/cjs/components/Disclosure.js +35 -22
- package/dist/cjs/components/Divider.js +82 -18
- package/dist/cjs/components/DropZone.js +111 -37
- package/dist/cjs/components/EmptyState.js +18 -6
- package/dist/cjs/components/Filters.js +84 -36
- package/dist/cjs/components/FooterHelp.js +14 -4
- package/dist/cjs/components/Form.js +13 -2
- package/dist/cjs/components/Frame.js +57 -22
- package/dist/cjs/components/FrameSaveBar.js +37 -6
- package/dist/cjs/components/Grid.js +31 -15
- package/dist/cjs/components/HorizontalStack.js +38 -25
- package/dist/cjs/components/Icon.js +683 -61
- package/dist/cjs/components/Image.js +35 -22
- package/dist/cjs/components/InlineError.js +19 -10
- package/dist/cjs/components/Label.js +21 -12
- package/dist/cjs/components/Layout.js +33 -24
- package/dist/cjs/components/LayoutSection.js +84 -22
- package/dist/cjs/components/Link.js +35 -22
- package/dist/cjs/components/List.js +28 -12
- package/dist/cjs/components/Listbox.js +53 -31
- package/dist/cjs/components/Loading.js +14 -2
- package/dist/cjs/components/Modal.js +22 -40
- package/dist/cjs/components/Navigation.js +107 -36
- package/dist/cjs/components/Page.js +44 -31
- package/dist/cjs/components/Pagination.js +20 -5
- package/dist/cjs/components/Pane.js +67 -4
- package/dist/cjs/components/Popover.js +37 -21
- package/dist/cjs/components/PopoverManager.js +14 -1
- package/dist/cjs/components/ProgressBar.js +28 -15
- package/dist/cjs/components/RadioButton.js +32 -24
- package/dist/cjs/components/RadioButtonCard.js +92 -67
- package/dist/cjs/components/RadioButtonCardGroup.js +379 -0
- package/dist/cjs/components/RangeSlider.js +34 -26
- package/dist/cjs/components/ResourceList.js +28 -14
- package/dist/cjs/components/Select.js +38 -26
- package/dist/cjs/components/SkeletonText.js +33 -18
- package/dist/cjs/components/Spinner.js +24 -12
- package/dist/cjs/components/Stack.js +131 -71
- package/dist/cjs/components/TabNavigation.js +27 -1
- package/dist/cjs/components/Table.js +58 -18
- package/dist/cjs/components/Tabs.js +52 -23
- package/dist/cjs/components/Tag.js +37 -16
- package/dist/cjs/components/Text.js +32 -18
- package/dist/cjs/components/TextField.js +119 -69
- package/dist/cjs/components/Thumbnail.js +25 -11
- package/dist/cjs/components/TimePicker.js +22 -1
- package/dist/cjs/components/Tip.js +140 -25
- package/dist/cjs/components/ToastNotification.js +107 -34
- package/dist/cjs/components/ToastProvider.js +13 -3
- package/dist/cjs/components/Tooltip.js +50 -41
- package/dist/cjs/components/TopBar.js +83 -9
- package/dist/cjs/components/VerticalStack.js +31 -16
- package/dist/cjs/index.js +24 -0
- package/dist/cjs/stories/Autocomplete.stories.js +10 -10
- package/dist/cjs/stories/Checkbox.stories.js +6 -8
- package/dist/cjs/stories/CheckboxCardGroup.stories.js +459 -0
- package/dist/cjs/stories/Collapsible.stories.js +11 -11
- package/dist/cjs/stories/ColorField.stories.js +2 -3
- package/dist/cjs/stories/ComplexExamples.stories.js +48 -77
- package/dist/cjs/stories/ContextualSaveBar.stories.js +1 -1
- package/dist/cjs/stories/Divider.stories.js +15 -16
- package/dist/cjs/stories/DropZone.stories.js +3 -3
- package/dist/cjs/stories/FooterHelp.stories.js +3 -4
- package/dist/cjs/stories/Form.stories.js +2 -4
- package/dist/cjs/stories/Grid.stories.js +24 -33
- package/dist/cjs/stories/Icon.stories.js +22 -23
- package/dist/cjs/stories/Image.stories.js +12 -15
- package/dist/cjs/stories/InlineError.stories.js +0 -1
- package/dist/cjs/stories/Layout.stories.js +96 -2
- package/dist/cjs/stories/LayoutSection.stories.js +13 -18
- package/dist/cjs/stories/List.stories.js +24 -28
- package/dist/cjs/stories/Listbox.stories.js +2 -2
- package/dist/cjs/stories/Loading.stories.js +21 -25
- package/dist/cjs/stories/Modal.stories.js +0 -1
- package/dist/cjs/stories/Pagination.stories.js +4 -4
- package/dist/cjs/stories/Pane.stories.js +10 -18
- package/dist/cjs/stories/Popover.stories.js +7 -7
- package/dist/cjs/stories/PopoverManager.stories.js +9 -9
- package/dist/cjs/stories/ProgressBar.stories.js +8 -8
- package/dist/cjs/stories/RadioButton.stories.js +2 -2
- package/dist/cjs/stories/RadioButtonCard.stories.js +2 -2
- package/dist/cjs/stories/RadioButtonCardGroup.stories.js +502 -0
- package/dist/cjs/stories/RangeSlider.stories.js +1 -3
- package/dist/cjs/stories/ResourceList.stories.js +13 -13
- package/dist/cjs/stories/Spinner.stories.js +9 -9
- package/dist/cjs/stories/Stack.stories.js +233 -51
- package/dist/cjs/stories/Tabs.stories.js +2 -2
- package/dist/cjs/stories/Tag.stories.js +1 -1
- package/dist/cjs/stories/Thumbnail.stories.js +17 -18
- package/dist/cjs/stories/TimePicker.stories.js +0 -5
- package/dist/cjs/stories/Tip.stories.js +1 -1
- package/dist/esm/components/ActionList.js +33 -25
- package/dist/esm/components/AnnouncementBar.js +115 -18
- package/dist/esm/components/AnnouncementCard.js +254 -0
- package/dist/esm/components/AppProvider.js +15 -2
- package/dist/esm/components/Autocomplete.js +58 -36
- package/dist/esm/components/Badge.js +28 -14
- package/dist/esm/components/Banner.js +37 -27
- package/dist/esm/components/Box.js +50 -38
- package/dist/esm/components/Button.js +338 -109
- package/dist/esm/components/ButtonGroup.js +27 -14
- package/dist/esm/components/Card.js +300 -140
- package/dist/esm/components/Checkbox.js +55 -47
- package/dist/esm/components/CheckboxCard.js +207 -0
- package/dist/esm/components/CheckboxCardGroup.js +370 -0
- package/dist/esm/components/ChoiceList.js +21 -11
- package/dist/esm/components/Code.js +22 -8
- package/dist/esm/components/Collapsible.js +24 -11
- package/dist/esm/components/ColorField.js +165 -40
- package/dist/esm/components/ContextualSaveBar.js +13 -6
- package/dist/esm/components/DatePicker.js +48 -37
- package/dist/esm/components/Disclosure.js +35 -22
- package/dist/esm/components/Divider.js +78 -20
- package/dist/esm/components/DropZone.js +111 -37
- package/dist/esm/components/EmptyState.js +18 -6
- package/dist/esm/components/Filters.js +84 -36
- package/dist/esm/components/FooterHelp.js +14 -4
- package/dist/esm/components/Form.js +13 -2
- package/dist/esm/components/Frame.js +57 -22
- package/dist/esm/components/FrameSaveBar.js +37 -6
- package/dist/esm/components/Grid.js +31 -15
- package/dist/esm/components/HorizontalStack.js +38 -25
- package/dist/esm/components/Icon.js +681 -62
- package/dist/esm/components/Image.js +35 -22
- package/dist/esm/components/InlineError.js +19 -10
- package/dist/esm/components/Label.js +21 -12
- package/dist/esm/components/Layout.js +58 -25
- package/dist/esm/components/LayoutSection.js +84 -22
- package/dist/esm/components/Link.js +35 -22
- package/dist/esm/components/List.js +28 -12
- package/dist/esm/components/Listbox.js +53 -31
- package/dist/esm/components/Loading.js +14 -2
- package/dist/esm/components/Modal.js +69 -41
- package/dist/esm/components/Navigation.js +107 -36
- package/dist/esm/components/Page.js +44 -31
- package/dist/esm/components/Pagination.js +20 -5
- package/dist/esm/components/Pane.js +67 -4
- package/dist/esm/components/Popover.js +37 -21
- package/dist/esm/components/PopoverManager.js +14 -1
- package/dist/esm/components/ProgressBar.js +28 -15
- package/dist/esm/components/RadioButton.js +32 -24
- package/dist/esm/components/RadioButtonCard.js +92 -67
- package/dist/esm/components/RadioButtonCardGroup.js +364 -0
- package/dist/esm/components/RangeSlider.js +34 -26
- package/dist/esm/components/ResourceList.js +28 -14
- package/dist/esm/components/Select.js +38 -26
- package/dist/esm/components/SkeletonText.js +33 -18
- package/dist/esm/components/Spinner.js +24 -12
- package/dist/esm/components/Stack.js +131 -71
- package/dist/esm/components/TabNavigation.js +27 -1
- package/dist/esm/components/Table.js +58 -18
- package/dist/esm/components/Tabs.js +52 -23
- package/dist/esm/components/Tag.js +37 -16
- package/dist/esm/components/Text.js +32 -18
- package/dist/esm/components/TextField.js +119 -69
- package/dist/esm/components/Thumbnail.js +25 -11
- package/dist/esm/components/TimePicker.js +22 -1
- package/dist/esm/components/Tip.js +140 -25
- package/dist/esm/components/ToastNotification.js +107 -34
- package/dist/esm/components/ToastProvider.js +13 -3
- package/dist/esm/components/Tooltip.js +50 -41
- package/dist/esm/components/TopBar.js +83 -9
- package/dist/esm/components/VerticalStack.js +31 -16
- package/dist/esm/index.js +6 -0
- package/dist/esm/stories/Autocomplete.stories.js +10 -10
- package/dist/esm/stories/Checkbox.stories.js +6 -8
- package/dist/esm/stories/CheckboxCardGroup.stories.js +421 -0
- package/dist/esm/stories/Collapsible.stories.js +11 -11
- package/dist/esm/stories/ColorField.stories.js +2 -3
- package/dist/esm/stories/ComplexExamples.stories.js +48 -77
- package/dist/esm/stories/ContextualSaveBar.stories.js +1 -1
- package/dist/esm/stories/Divider.stories.js +15 -16
- package/dist/esm/stories/DropZone.stories.js +3 -3
- package/dist/esm/stories/FooterHelp.stories.js +3 -4
- package/dist/esm/stories/Form.stories.js +2 -4
- package/dist/esm/stories/Grid.stories.js +24 -33
- package/dist/esm/stories/Icon.stories.js +22 -23
- package/dist/esm/stories/Image.stories.js +12 -15
- package/dist/esm/stories/InlineError.stories.js +0 -1
- package/dist/esm/stories/Layout.stories.js +93 -2
- package/dist/esm/stories/LayoutSection.stories.js +13 -18
- package/dist/esm/stories/List.stories.js +24 -28
- package/dist/esm/stories/Listbox.stories.js +2 -2
- package/dist/esm/stories/Loading.stories.js +21 -25
- package/dist/esm/stories/Modal.stories.js +0 -1
- package/dist/esm/stories/Pagination.stories.js +4 -4
- package/dist/esm/stories/Pane.stories.js +10 -18
- package/dist/esm/stories/Popover.stories.js +7 -7
- package/dist/esm/stories/PopoverManager.stories.js +9 -9
- package/dist/esm/stories/ProgressBar.stories.js +8 -8
- package/dist/esm/stories/RadioButton.stories.js +2 -2
- package/dist/esm/stories/RadioButtonCard.stories.js +2 -2
- package/dist/esm/stories/RadioButtonCardGroup.stories.js +461 -0
- package/dist/esm/stories/RangeSlider.stories.js +1 -3
- package/dist/esm/stories/ResourceList.stories.js +13 -13
- package/dist/esm/stories/Spinner.stories.js +9 -9
- package/dist/esm/stories/Stack.stories.js +224 -51
- package/dist/esm/stories/Tabs.stories.js +2 -2
- package/dist/esm/stories/Tag.stories.js +1 -1
- package/dist/esm/stories/Thumbnail.stories.js +17 -18
- package/dist/esm/stories/TimePicker.stories.js +0 -5
- package/dist/esm/stories/Tip.stories.js +1 -1
- package/dist/types/components/ActionList.d.ts +1 -31
- package/dist/types/components/ActionList.d.ts.map +1 -1
- package/dist/types/components/AnnouncementBar.d.ts +1 -19
- package/dist/types/components/AnnouncementBar.d.ts.map +1 -1
- package/dist/types/components/AnnouncementCard.d.ts +3 -0
- package/dist/types/components/AnnouncementCard.d.ts.map +1 -0
- package/dist/types/components/AppProvider.d.ts +14 -1
- package/dist/types/components/AppProvider.d.ts.map +1 -1
- package/dist/types/components/Autocomplete.d.ts +1 -71
- package/dist/types/components/Autocomplete.d.ts.map +1 -1
- package/dist/types/components/Badge.d.ts +1 -19
- package/dist/types/components/Badge.d.ts.map +1 -1
- package/dist/types/components/Banner.d.ts +1 -37
- package/dist/types/components/Banner.d.ts.map +1 -1
- package/dist/types/components/Box.d.ts +1 -68
- package/dist/types/components/Box.d.ts.map +1 -1
- package/dist/types/components/Button.d.ts +1 -131
- package/dist/types/components/Button.d.ts.map +1 -1
- package/dist/types/components/ButtonGroup.d.ts +1 -22
- package/dist/types/components/ButtonGroup.d.ts.map +1 -1
- package/dist/types/components/Card.d.ts +54 -59
- package/dist/types/components/Card.d.ts.map +1 -1
- package/dist/types/components/Checkbox.d.ts +1 -63
- package/dist/types/components/Checkbox.d.ts.map +1 -1
- package/dist/types/components/CheckboxCard.d.ts +3 -0
- package/dist/types/components/CheckboxCard.d.ts.map +1 -0
- package/dist/types/components/CheckboxCardGroup.d.ts +3 -0
- package/dist/types/components/CheckboxCardGroup.d.ts.map +1 -0
- package/dist/types/components/ChoiceList.d.ts +1 -42
- package/dist/types/components/ChoiceList.d.ts.map +1 -1
- package/dist/types/components/Code.d.ts +1 -26
- package/dist/types/components/Code.d.ts.map +1 -1
- package/dist/types/components/Collapsible.d.ts +1 -15
- package/dist/types/components/Collapsible.d.ts.map +1 -1
- package/dist/types/components/ColorField.d.ts +13 -34
- package/dist/types/components/ColorField.d.ts.map +1 -1
- package/dist/types/components/ContextualSaveBar.d.ts +13 -6
- package/dist/types/components/ContextualSaveBar.d.ts.map +1 -1
- package/dist/types/components/DatePicker.d.ts +1 -64
- package/dist/types/components/DatePicker.d.ts.map +1 -1
- package/dist/types/components/Disclosure.d.ts +1 -25
- package/dist/types/components/Disclosure.d.ts.map +1 -1
- package/dist/types/components/Divider.d.ts +1 -19
- package/dist/types/components/Divider.d.ts.map +1 -1
- package/dist/types/components/DropZone.d.ts +1 -62
- package/dist/types/components/DropZone.d.ts.map +1 -1
- package/dist/types/components/EmptyState.d.ts +1 -50
- package/dist/types/components/EmptyState.d.ts.map +1 -1
- package/dist/types/components/Filters.d.ts +13 -68
- package/dist/types/components/Filters.d.ts.map +1 -1
- package/dist/types/components/FooterHelp.d.ts +14 -4
- package/dist/types/components/FooterHelp.d.ts.map +1 -1
- package/dist/types/components/Form.d.ts +13 -2
- package/dist/types/components/Form.d.ts.map +1 -1
- package/dist/types/components/Frame.d.ts +15 -36
- package/dist/types/components/Frame.d.ts.map +1 -1
- package/dist/types/components/FrameSaveBar.d.ts +3 -6
- package/dist/types/components/FrameSaveBar.d.ts.map +1 -1
- package/dist/types/components/Grid.d.ts +5 -21
- package/dist/types/components/Grid.d.ts.map +1 -1
- package/dist/types/components/HorizontalStack.d.ts +1 -34
- package/dist/types/components/HorizontalStack.d.ts.map +1 -1
- package/dist/types/components/Icon.d.ts +1 -41
- package/dist/types/components/Icon.d.ts.map +1 -1
- package/dist/types/components/Image.d.ts +1 -43
- package/dist/types/components/Image.d.ts.map +1 -1
- package/dist/types/components/InlineError.d.ts +1 -20
- package/dist/types/components/InlineError.d.ts.map +1 -1
- package/dist/types/components/Label.d.ts +1 -26
- package/dist/types/components/Label.d.ts.map +1 -1
- package/dist/types/components/Layout.d.ts +24 -15
- package/dist/types/components/Layout.d.ts.map +1 -1
- package/dist/types/components/LayoutSection.d.ts +1 -19
- package/dist/types/components/LayoutSection.d.ts.map +1 -1
- package/dist/types/components/Link.d.ts +1 -37
- package/dist/types/components/Link.d.ts.map +1 -1
- package/dist/types/components/List.d.ts +5 -17
- package/dist/types/components/List.d.ts.map +1 -1
- package/dist/types/components/Listbox.d.ts +1 -32
- package/dist/types/components/Listbox.d.ts.map +1 -1
- package/dist/types/components/Loading.d.ts +14 -2
- package/dist/types/components/Loading.d.ts.map +1 -1
- package/dist/types/components/Modal.d.ts +26 -35
- package/dist/types/components/Modal.d.ts.map +1 -1
- package/dist/types/components/Navigation.d.ts +1 -25
- package/dist/types/components/Navigation.d.ts.map +1 -1
- package/dist/types/components/Page.d.ts +1 -57
- package/dist/types/components/Page.d.ts.map +1 -1
- package/dist/types/components/Pagination.d.ts +13 -3
- package/dist/types/components/Pagination.d.ts.map +1 -1
- package/dist/types/components/Pane.d.ts +55 -3
- package/dist/types/components/Pane.d.ts.map +1 -1
- package/dist/types/components/Popover.d.ts +5 -37
- package/dist/types/components/Popover.d.ts.map +1 -1
- package/dist/types/components/PopoverManager.d.ts.map +1 -1
- package/dist/types/components/ProgressBar.d.ts +1 -22
- package/dist/types/components/ProgressBar.d.ts.map +1 -1
- package/dist/types/components/RadioButton.d.ts +1 -37
- package/dist/types/components/RadioButton.d.ts.map +1 -1
- package/dist/types/components/RadioButtonCard.d.ts +1 -39
- package/dist/types/components/RadioButtonCard.d.ts.map +1 -1
- package/dist/types/components/RadioButtonCardGroup.d.ts +3 -0
- package/dist/types/components/RadioButtonCardGroup.d.ts.map +1 -0
- package/dist/types/components/RangeSlider.d.ts +1 -42
- package/dist/types/components/RangeSlider.d.ts.map +1 -1
- package/dist/types/components/ResourceList.d.ts +5 -30
- package/dist/types/components/ResourceList.d.ts.map +1 -1
- package/dist/types/components/Select.d.ts +1 -46
- package/dist/types/components/Select.d.ts.map +1 -1
- package/dist/types/components/SkeletonText.d.ts +1 -26
- package/dist/types/components/SkeletonText.d.ts.map +1 -1
- package/dist/types/components/Spinner.d.ts +1 -16
- package/dist/types/components/Spinner.d.ts.map +1 -1
- package/dist/types/components/Stack.d.ts +1 -47
- package/dist/types/components/Stack.d.ts.map +1 -1
- package/dist/types/components/TabNavigation.d.ts.map +1 -1
- package/dist/types/components/Table.d.ts +13 -58
- package/dist/types/components/Table.d.ts.map +1 -1
- package/dist/types/components/Tabs.d.ts +3 -41
- package/dist/types/components/Tabs.d.ts.map +1 -1
- package/dist/types/components/Tag.d.ts +1 -24
- package/dist/types/components/Tag.d.ts.map +1 -1
- package/dist/types/components/Text.d.ts +1 -30
- package/dist/types/components/Text.d.ts.map +1 -1
- package/dist/types/components/TextField.d.ts +1 -109
- package/dist/types/components/TextField.d.ts.map +1 -1
- package/dist/types/components/Thumbnail.d.ts +1 -16
- package/dist/types/components/Thumbnail.d.ts.map +1 -1
- package/dist/types/components/TimePicker.d.ts +28 -1
- package/dist/types/components/TimePicker.d.ts.map +1 -1
- package/dist/types/components/Tip.d.ts +1 -21
- package/dist/types/components/Tip.d.ts.map +1 -1
- package/dist/types/components/ToastNotification.d.ts +1 -34
- package/dist/types/components/ToastNotification.d.ts.map +1 -1
- package/dist/types/components/ToastProvider.d.ts +13 -3
- package/dist/types/components/ToastProvider.d.ts.map +1 -1
- package/dist/types/components/Tooltip.d.ts +1 -54
- package/dist/types/components/Tooltip.d.ts.map +1 -1
- package/dist/types/components/TopBar.d.ts +1 -19
- package/dist/types/components/TopBar.d.ts.map +1 -1
- package/dist/types/components/VerticalStack.d.ts +1 -25
- package/dist/types/components/VerticalStack.d.ts.map +1 -1
- package/dist/types/index.d.ts +6 -0
- package/index.css +76 -14
- package/package.json +4 -3
|
@@ -1,10 +1,91 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
function _define_property(obj, key, value) {
|
|
3
|
+
if (key in obj) {
|
|
4
|
+
Object.defineProperty(obj, key, {
|
|
5
|
+
value: value,
|
|
6
|
+
enumerable: true,
|
|
7
|
+
configurable: true,
|
|
8
|
+
writable: true
|
|
9
|
+
});
|
|
10
|
+
} else {
|
|
11
|
+
obj[key] = value;
|
|
12
|
+
}
|
|
13
|
+
return obj;
|
|
14
|
+
}
|
|
15
|
+
function _object_spread(target) {
|
|
16
|
+
for(var i = 1; i < arguments.length; i++){
|
|
17
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
18
|
+
var ownKeys = Object.keys(source);
|
|
19
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
20
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
21
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
ownKeys.forEach(function(key) {
|
|
25
|
+
_define_property(target, key, source[key]);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return target;
|
|
29
|
+
}
|
|
30
|
+
function ownKeys(object, enumerableOnly) {
|
|
31
|
+
var keys = Object.keys(object);
|
|
32
|
+
if (Object.getOwnPropertySymbols) {
|
|
33
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
34
|
+
if (enumerableOnly) {
|
|
35
|
+
symbols = symbols.filter(function(sym) {
|
|
36
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
keys.push.apply(keys, symbols);
|
|
40
|
+
}
|
|
41
|
+
return keys;
|
|
42
|
+
}
|
|
43
|
+
function _object_spread_props(target, source) {
|
|
44
|
+
source = source != null ? source : {};
|
|
45
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
46
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
47
|
+
} else {
|
|
48
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
49
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
return target;
|
|
53
|
+
}
|
|
1
54
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
55
|
import React, { cloneElement, isValidElement, useMemo } from "react";
|
|
3
56
|
import { tv } from "tailwind-variants";
|
|
4
57
|
import Icon from "./Icon.js";
|
|
58
|
+
import Button from "./Button.js";
|
|
59
|
+
import Text from "./Text.js";
|
|
5
60
|
import { AlertMinor, CancelMinor, InfoMinor, MagicMajor } from "@shopify/polaris-icons";
|
|
6
|
-
|
|
7
|
-
|
|
61
|
+
/**
|
|
62
|
+
* @component Tip
|
|
63
|
+
*
|
|
64
|
+
* @description A subtle inline hint component that displays contextual guidance or tips within a page section.
|
|
65
|
+
*
|
|
66
|
+
* @usage
|
|
67
|
+
* - DO: Provide helpful, non-critical contextual hints or best practices inline.
|
|
68
|
+
* - DON'T: Use for important alerts or errors (use Banner).
|
|
69
|
+
*
|
|
70
|
+
* @accessibility
|
|
71
|
+
* - Tip content is read as regular page content; ensure the tip text is meaningful without relying on its icon.
|
|
72
|
+
*
|
|
73
|
+
* @alternative
|
|
74
|
+
* - If you need a prominent alert with actions, use `Banner`.
|
|
75
|
+
* - If you need a global notification bar, use `AnnouncementBar`.
|
|
76
|
+
*
|
|
77
|
+
* @param {Object} props - The component props.
|
|
78
|
+
* @param {"info" | "critical" | "success" | "warning" | "attention" | "highlight" | "neutral" | "plain" | "minimal"} [props.status="info"] - The status type of the tip.
|
|
79
|
+
* @param {Function} [props.onDismiss] - Function to call when the dismiss button is clicked.
|
|
80
|
+
* @param {Function} [props.onClick] - Function to call when the tip is clicked.
|
|
81
|
+
* @param {React.ReactNode} props.children - The content of the tip.
|
|
82
|
+
* @param {React.ElementType} [props.icon] - Custom icon for the tip.
|
|
83
|
+
* @param {"left" | "right" | "center"} [props.align="left"] - The alignment of the tip.
|
|
84
|
+
* @param {Array<{content: string, onAction: Function}>} [props.actions] - Array of action objects to show as buttons at the bottom.
|
|
85
|
+
* @param {string | React.ReactNode} [props.title=null] - Optional title shown above the tip content.
|
|
86
|
+
* @returns {JSX.Element} The rendered Tip component.
|
|
87
|
+
*/ var styles = tv({
|
|
88
|
+
base: "Litho-Tip relative flex rounded-md",
|
|
8
89
|
variants: {
|
|
9
90
|
status: {
|
|
10
91
|
success: "bg-success-alt text-success-alt-fg",
|
|
@@ -14,7 +95,8 @@ var styles = tv({
|
|
|
14
95
|
highlight: "bg-highlight-alt text-highlight-alt-fg",
|
|
15
96
|
insight: "bg-insight-alt text-insight-alt-fg",
|
|
16
97
|
info: "bg-info-alt text-info-alt-fg",
|
|
17
|
-
plain: "bg-transparent text-subdued
|
|
98
|
+
plain: "bg-transparent text-high border border-border-subdued rounded-lg",
|
|
99
|
+
minimal: "bg-transparent text-high"
|
|
18
100
|
},
|
|
19
101
|
dismissible: {
|
|
20
102
|
true: "pr-8"
|
|
@@ -24,19 +106,29 @@ var styles = tv({
|
|
|
24
106
|
},
|
|
25
107
|
border: {
|
|
26
108
|
true: "border border-tint-2"
|
|
109
|
+
},
|
|
110
|
+
padding: {
|
|
111
|
+
default: "p-2",
|
|
112
|
+
md: "p-3",
|
|
113
|
+
lg: "p-4"
|
|
27
114
|
}
|
|
28
115
|
},
|
|
29
116
|
defaultVariants: {
|
|
30
117
|
status: "info",
|
|
31
118
|
dismissible: false,
|
|
32
119
|
clickable: false,
|
|
33
|
-
border: false
|
|
120
|
+
border: false,
|
|
121
|
+
padding: "default"
|
|
34
122
|
},
|
|
35
123
|
compoundVariants: [
|
|
36
124
|
{
|
|
37
125
|
clickable: true,
|
|
38
126
|
status: "info",
|
|
39
127
|
className: "hover:outline hover:outline-info-alt-lower"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
status: "minimal",
|
|
131
|
+
className: "!p-0"
|
|
40
132
|
}
|
|
41
133
|
]
|
|
42
134
|
});
|
|
@@ -81,29 +173,20 @@ var statusHelpers = {
|
|
|
81
173
|
insight: {
|
|
82
174
|
icon: MagicMajor
|
|
83
175
|
},
|
|
84
|
-
neutral: {}
|
|
176
|
+
neutral: {},
|
|
177
|
+
minimal: {}
|
|
85
178
|
};
|
|
86
|
-
|
|
87
|
-
* Tip component for displaying informational messages with optional dismiss functionality.
|
|
88
|
-
*
|
|
89
|
-
* @param {Object} props - The component props.
|
|
90
|
-
* @param {"info" | "critical" | "success" | "warning" | "attention" | "highlight" | "neutral"} [props.status="info"] - The status type of the tip.
|
|
91
|
-
* @param {Function} [props.onDismiss] - Function to call when the dismiss button is clicked.
|
|
92
|
-
* @param {Function} [props.onClick] - Function to call when the tip is clicked.
|
|
93
|
-
* @param {React.ReactNode} props.children - The content of the tip.
|
|
94
|
-
* @param {React.ElementType} [props.icon] - Custom icon for the tip.
|
|
95
|
-
* @param {"left" | "right" | "center"} [props.align="left"] - The alignment of the tip.
|
|
96
|
-
* @returns {JSX.Element} The rendered Tip component.
|
|
97
|
-
*/ function Tip() {
|
|
179
|
+
function Tip() {
|
|
98
180
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
99
181
|
var _statusHelpers_status;
|
|
100
|
-
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;
|
|
182
|
+
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;
|
|
101
183
|
var icon = _icon === null ? null : _icon || ((_statusHelpers_status = statusHelpers[status]) === null || _statusHelpers_status === void 0 ? void 0 : _statusHelpers_status.icon) || InfoMinor;
|
|
102
184
|
var classes = styles({
|
|
103
185
|
status: status,
|
|
104
186
|
dismissible: !!onDismiss,
|
|
105
187
|
clickable: !!onClick,
|
|
106
|
-
border: border
|
|
188
|
+
border: border,
|
|
189
|
+
padding: padding
|
|
107
190
|
});
|
|
108
191
|
var base = "-alt-icon";
|
|
109
192
|
var iconColorMap = {
|
|
@@ -115,7 +198,9 @@ var statusHelpers = {
|
|
|
115
198
|
highlight: "highlight".concat(base),
|
|
116
199
|
insight: "insight".concat(base),
|
|
117
200
|
neutral: "neutral".concat(base),
|
|
118
|
-
default: "info".concat(base)
|
|
201
|
+
default: "info".concat(base),
|
|
202
|
+
plain: "subdued",
|
|
203
|
+
minimal: "subdued"
|
|
119
204
|
};
|
|
120
205
|
var iconColor = iconColorMap[status] || iconColorMap.default;
|
|
121
206
|
var processedChildren = useMemo(function() {
|
|
@@ -139,9 +224,19 @@ var statusHelpers = {
|
|
|
139
224
|
children,
|
|
140
225
|
status
|
|
141
226
|
]);
|
|
142
|
-
return /*#__PURE__*/ _jsxs("div", {
|
|
227
|
+
return /*#__PURE__*/ _jsxs("div", _object_spread_props(_object_spread({
|
|
143
228
|
className: classes,
|
|
144
|
-
onClick: onClick
|
|
229
|
+
onClick: onClick
|
|
230
|
+
}, onClick ? {
|
|
231
|
+
role: "button",
|
|
232
|
+
tabIndex: 0,
|
|
233
|
+
onKeyDown: function(e) {
|
|
234
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
235
|
+
e.preventDefault();
|
|
236
|
+
onClick(e);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
} : {}), {
|
|
145
240
|
children: [
|
|
146
241
|
/*#__PURE__*/ _jsxs("div", {
|
|
147
242
|
className: innerStyles({
|
|
@@ -152,8 +247,28 @@ var statusHelpers = {
|
|
|
152
247
|
source: icon,
|
|
153
248
|
color: iconColor
|
|
154
249
|
}),
|
|
155
|
-
/*#__PURE__*/
|
|
156
|
-
|
|
250
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
251
|
+
className: "flex flex-col gap-1 flex-1",
|
|
252
|
+
children: [
|
|
253
|
+
title != null && title !== "" && /*#__PURE__*/ _jsx(Text, {
|
|
254
|
+
fontWeight: "medium",
|
|
255
|
+
children: title
|
|
256
|
+
}),
|
|
257
|
+
/*#__PURE__*/ _jsx("div", {
|
|
258
|
+
children: processedChildren
|
|
259
|
+
}),
|
|
260
|
+
(actions === null || actions === void 0 ? void 0 : actions.length) > 0 && /*#__PURE__*/ _jsx("div", {
|
|
261
|
+
className: "relative -left-3 flex items-center",
|
|
262
|
+
children: actions.map(function(action, i) {
|
|
263
|
+
return /*#__PURE__*/ _jsx(Button, {
|
|
264
|
+
plain: true,
|
|
265
|
+
size: "small",
|
|
266
|
+
onClick: action.onAction,
|
|
267
|
+
children: action.content
|
|
268
|
+
}, i);
|
|
269
|
+
})
|
|
270
|
+
})
|
|
271
|
+
]
|
|
157
272
|
})
|
|
158
273
|
]
|
|
159
274
|
}),
|
|
@@ -168,6 +283,6 @@ var statusHelpers = {
|
|
|
168
283
|
})
|
|
169
284
|
})
|
|
170
285
|
]
|
|
171
|
-
});
|
|
286
|
+
}));
|
|
172
287
|
}
|
|
173
288
|
export default Tip;
|
|
@@ -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, {
|