@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,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";
|
|
2
3
|
Object.defineProperty(exports, "__esModule", {
|
|
3
4
|
value: true
|
|
@@ -9,8 +10,59 @@ Object.defineProperty(exports, "default", {
|
|
|
9
10
|
}
|
|
10
11
|
});
|
|
11
12
|
var _jsxruntime = require("react/jsx-runtime");
|
|
13
|
+
var _react = require("react");
|
|
12
14
|
var _tailwindvariants = require("tailwind-variants");
|
|
13
15
|
var _polarisicons = /*#__PURE__*/ _interop_require_wildcard(require("@shopify/polaris-icons"));
|
|
16
|
+
function _array_like_to_array(arr, len) {
|
|
17
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
18
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
19
|
+
return arr2;
|
|
20
|
+
}
|
|
21
|
+
function _array_with_holes(arr) {
|
|
22
|
+
if (Array.isArray(arr)) return arr;
|
|
23
|
+
}
|
|
24
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
25
|
+
try {
|
|
26
|
+
var info = gen[key](arg);
|
|
27
|
+
var value = info.value;
|
|
28
|
+
} catch (error) {
|
|
29
|
+
reject(error);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (info.done) {
|
|
33
|
+
resolve(value);
|
|
34
|
+
} else {
|
|
35
|
+
Promise.resolve(value).then(_next, _throw);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function _async_to_generator(fn) {
|
|
39
|
+
return function() {
|
|
40
|
+
var self = this, args = arguments;
|
|
41
|
+
return new Promise(function(resolve, reject) {
|
|
42
|
+
var gen = fn.apply(self, args);
|
|
43
|
+
function _next(value) {
|
|
44
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
45
|
+
}
|
|
46
|
+
function _throw(err) {
|
|
47
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
48
|
+
}
|
|
49
|
+
_next(undefined);
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function _define_property(obj, key, value) {
|
|
54
|
+
if (key in obj) {
|
|
55
|
+
Object.defineProperty(obj, key, {
|
|
56
|
+
value: value,
|
|
57
|
+
enumerable: true,
|
|
58
|
+
configurable: true,
|
|
59
|
+
writable: true
|
|
60
|
+
});
|
|
61
|
+
} else {
|
|
62
|
+
obj[key] = value;
|
|
63
|
+
}
|
|
64
|
+
return obj;
|
|
65
|
+
}
|
|
14
66
|
function _getRequireWildcardCache(nodeInterop) {
|
|
15
67
|
if (typeof WeakMap !== "function") return null;
|
|
16
68
|
var cacheBabelInterop = new WeakMap();
|
|
@@ -52,6 +104,223 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
52
104
|
}
|
|
53
105
|
return newObj;
|
|
54
106
|
}
|
|
107
|
+
function _iterable_to_array_limit(arr, i) {
|
|
108
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
109
|
+
if (_i == null) return;
|
|
110
|
+
var _arr = [];
|
|
111
|
+
var _n = true;
|
|
112
|
+
var _d = false;
|
|
113
|
+
var _s, _e;
|
|
114
|
+
try {
|
|
115
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
116
|
+
_arr.push(_s.value);
|
|
117
|
+
if (i && _arr.length === i) break;
|
|
118
|
+
}
|
|
119
|
+
} catch (err) {
|
|
120
|
+
_d = true;
|
|
121
|
+
_e = err;
|
|
122
|
+
} finally{
|
|
123
|
+
try {
|
|
124
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
125
|
+
} finally{
|
|
126
|
+
if (_d) throw _e;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return _arr;
|
|
130
|
+
}
|
|
131
|
+
function _non_iterable_rest() {
|
|
132
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
133
|
+
}
|
|
134
|
+
function _object_spread(target) {
|
|
135
|
+
for(var i = 1; i < arguments.length; i++){
|
|
136
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
137
|
+
var ownKeys = Object.keys(source);
|
|
138
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
139
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
140
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
141
|
+
}));
|
|
142
|
+
}
|
|
143
|
+
ownKeys.forEach(function(key) {
|
|
144
|
+
_define_property(target, key, source[key]);
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
return target;
|
|
148
|
+
}
|
|
149
|
+
function ownKeys(object, enumerableOnly) {
|
|
150
|
+
var keys = Object.keys(object);
|
|
151
|
+
if (Object.getOwnPropertySymbols) {
|
|
152
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
153
|
+
if (enumerableOnly) {
|
|
154
|
+
symbols = symbols.filter(function(sym) {
|
|
155
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
keys.push.apply(keys, symbols);
|
|
159
|
+
}
|
|
160
|
+
return keys;
|
|
161
|
+
}
|
|
162
|
+
function _object_spread_props(target, source) {
|
|
163
|
+
source = source != null ? source : {};
|
|
164
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
165
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
166
|
+
} else {
|
|
167
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
168
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
return target;
|
|
172
|
+
}
|
|
173
|
+
function _sliced_to_array(arr, i) {
|
|
174
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
175
|
+
}
|
|
176
|
+
function _type_of(obj) {
|
|
177
|
+
"@swc/helpers - typeof";
|
|
178
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
179
|
+
}
|
|
180
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
181
|
+
if (!o) return;
|
|
182
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
183
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
184
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
185
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
186
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
187
|
+
}
|
|
188
|
+
function _ts_generator(thisArg, body) {
|
|
189
|
+
var f, y, t, _ = {
|
|
190
|
+
label: 0,
|
|
191
|
+
sent: function() {
|
|
192
|
+
if (t[0] & 1) throw t[1];
|
|
193
|
+
return t[1];
|
|
194
|
+
},
|
|
195
|
+
trys: [],
|
|
196
|
+
ops: []
|
|
197
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
198
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
199
|
+
return this;
|
|
200
|
+
}), g;
|
|
201
|
+
function verb(n) {
|
|
202
|
+
return function(v) {
|
|
203
|
+
return step([
|
|
204
|
+
n,
|
|
205
|
+
v
|
|
206
|
+
]);
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
function step(op) {
|
|
210
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
211
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
212
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
213
|
+
if (y = 0, t) op = [
|
|
214
|
+
op[0] & 2,
|
|
215
|
+
t.value
|
|
216
|
+
];
|
|
217
|
+
switch(op[0]){
|
|
218
|
+
case 0:
|
|
219
|
+
case 1:
|
|
220
|
+
t = op;
|
|
221
|
+
break;
|
|
222
|
+
case 4:
|
|
223
|
+
_.label++;
|
|
224
|
+
return {
|
|
225
|
+
value: op[1],
|
|
226
|
+
done: false
|
|
227
|
+
};
|
|
228
|
+
case 5:
|
|
229
|
+
_.label++;
|
|
230
|
+
y = op[1];
|
|
231
|
+
op = [
|
|
232
|
+
0
|
|
233
|
+
];
|
|
234
|
+
continue;
|
|
235
|
+
case 7:
|
|
236
|
+
op = _.ops.pop();
|
|
237
|
+
_.trys.pop();
|
|
238
|
+
continue;
|
|
239
|
+
default:
|
|
240
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
241
|
+
_ = 0;
|
|
242
|
+
continue;
|
|
243
|
+
}
|
|
244
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
245
|
+
_.label = op[1];
|
|
246
|
+
break;
|
|
247
|
+
}
|
|
248
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
249
|
+
_.label = t[1];
|
|
250
|
+
t = op;
|
|
251
|
+
break;
|
|
252
|
+
}
|
|
253
|
+
if (t && _.label < t[2]) {
|
|
254
|
+
_.label = t[2];
|
|
255
|
+
_.ops.push(op);
|
|
256
|
+
break;
|
|
257
|
+
}
|
|
258
|
+
if (t[2]) _.ops.pop();
|
|
259
|
+
_.trys.pop();
|
|
260
|
+
continue;
|
|
261
|
+
}
|
|
262
|
+
op = body.call(thisArg, _);
|
|
263
|
+
} catch (e) {
|
|
264
|
+
op = [
|
|
265
|
+
6,
|
|
266
|
+
e
|
|
267
|
+
];
|
|
268
|
+
y = 0;
|
|
269
|
+
} finally{
|
|
270
|
+
f = t = 0;
|
|
271
|
+
}
|
|
272
|
+
if (op[0] & 5) throw op[1];
|
|
273
|
+
return {
|
|
274
|
+
value: op[0] ? op[1] : void 0,
|
|
275
|
+
done: true
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* @component Icon
|
|
281
|
+
*
|
|
282
|
+
* @description Renders an icon with configurable size, color, and display style. Supports Polaris icons (fill-based),
|
|
283
|
+
* Lucide icons (stroke-based), and custom SVG components. Polaris icons are detected automatically via displayName lookup;
|
|
284
|
+
* any unrecognized component is treated as a stroke-based (Lucide) icon. String sources are resolved in order: Polaris → internal Litho icons → dynamic Lucide import.
|
|
285
|
+
*
|
|
286
|
+
* @usage
|
|
287
|
+
* - DO: Use with Polaris or Lucide icon sources to add visual cues alongside text labels or inside buttons.
|
|
288
|
+
* - DON'T: Use icons as the sole means of conveying meaning without an accompanying text label or accessible name.
|
|
289
|
+
*
|
|
290
|
+
* @accessibility
|
|
291
|
+
* - Icons are decorative by default; pair with visible text or an `accessibilityLabel` on the parent component.
|
|
292
|
+
* - When used standalone (e.g., icon-only button), ensure the parent element provides an `aria-label`.
|
|
293
|
+
*
|
|
294
|
+
* @alternative
|
|
295
|
+
* - If you need a clickable icon, wrap in a `Button` with the `icon` prop instead of using Icon directly.
|
|
296
|
+
* - If you need a small image preview, use `Thumbnail` instead.
|
|
297
|
+
*
|
|
298
|
+
* @param {Object} props - The properties for configuring the Component.
|
|
299
|
+
* @param {React.ElementType|string} props.source - The icon source. A Polaris icon component, a Lucide icon component, or a string name (resolved as Polaris → Litho → Lucide dynamic import).
|
|
300
|
+
* @param {('white'|'default'|'base'|'subdued'|'lower'|'link'|'primary'|'alternate'|'high'|'low'|'currentColor'|'successFgAlternate'|'success'|'fg-success'|'critical'|'fg-critical'|'criticalFgAlternate'|'warning'|'info'|'caution'|'attention'|'highlight'|'neutral'|'normal'|'disabled'|'active'|'btn-primary-icon'|'btn-secondary-icon'|'btn-plain-icon'|'btn-link-icon'|'btn-destructive-icon'|'btn-highlight-icon'|'inputFg'|'inputFgDisabled'|'success-icon'|'critical-icon'|'warning-icon'|'attention-icon'|'info-icon'|'highlight-icon'|'insight-icon'|'neutral-icon'|'success-alt-icon'|'critical-alt-icon'|'warning-alt-icon'|'attention-alt-icon'|'info-alt-icon'|'highlight-alt-icon'|'insight-alt-icon'|'neutral-alt-icon')} [props.color="default"] - The color variant for the icon.
|
|
301
|
+
* @param {('white'|'default'|'base'|'subdued'|'link'|'primary'|'alternate'|'success'|'critical'|'warning'|'info'|'caution'|'attention'|'highlight'|'neutral'|'normal'|'disabled'|'active')} [props.hoverColor] - The hover color variant for the icon (Polaris only).
|
|
302
|
+
* @param {('block'|'flex'|'inline'|'inline-block'|'inline-flex')} [props.display="block"] - Determines the display type for the icon container.
|
|
303
|
+
* @param {('xs'|'sm'|'default'|'lg'|'xl'|'2xl'|number)} [props.size="default"] - Sets the icon size. Semantic: 'xs' (12px), 'sm' (16px), 'default' (20px), 'lg' (24px), 'xl' (28px), '2xl' (32px). Numeric token: 3–20 (maps to 12–80px). Raw pixel number also accepted.
|
|
304
|
+
* @param {boolean} [props.stroke=false] - Whether to use stroke styling instead of fill (for Polaris icons with stroke paths).
|
|
305
|
+
* @param {number} [props.strokeWidth=2] - SVG stroke width for Lucide icons. 0.5–3 in 0.25 increments. Ignored for Polaris icons.
|
|
306
|
+
* @param {number} [props.opacity=100] - Container opacity 0–100 in steps of 10.
|
|
307
|
+
* @param {Function} [props.onClick] - Click handler for the icon.
|
|
308
|
+
* @param {string} [props.className] - Additional CSS classes to apply.
|
|
309
|
+
* @returns {JSX.Element} The rendered icon component with the specified styles.
|
|
310
|
+
*
|
|
311
|
+
* @example
|
|
312
|
+
* // Polaris icon
|
|
313
|
+
* <Icon source={TickMinor} color="success" size="lg" />
|
|
314
|
+
*
|
|
315
|
+
* // Lucide icon (direct import)
|
|
316
|
+
* import { Cable } from "lucide-react";
|
|
317
|
+
* <Icon source={Cable} color="info-alt-icon" size={12} opacity={70} />
|
|
318
|
+
*
|
|
319
|
+
* // Lucide icon (string-based dynamic loading)
|
|
320
|
+
* <Icon source="cable" color="info-alt-icon" size={12} />
|
|
321
|
+
*/ // ---------------------------------------------------------------------------
|
|
322
|
+
// Styles (container)
|
|
323
|
+
// ---------------------------------------------------------------------------
|
|
55
324
|
var styles = (0, _tailwindvariants.tv)({
|
|
56
325
|
base: "Litho-Icon",
|
|
57
326
|
variants: {
|
|
@@ -61,21 +330,15 @@ var styles = (0, _tailwindvariants.tv)({
|
|
|
61
330
|
inline: "inline",
|
|
62
331
|
"inline-block": "inline-block",
|
|
63
332
|
"inline-flex": "inline-flex items-center justify-center"
|
|
64
|
-
},
|
|
65
|
-
size: {
|
|
66
|
-
xs: "h-3 w-3 min-w-3",
|
|
67
|
-
sm: "h-4 w-4 min-w-4",
|
|
68
|
-
default: "h-5 w-5 min-w-5",
|
|
69
|
-
lg: "h-6 w-6 min-w-6",
|
|
70
|
-
xl: "h-7 w-7 min-w-7",
|
|
71
|
-
"2xl": "h-8 w-8 min-w-8"
|
|
72
333
|
}
|
|
73
334
|
},
|
|
74
335
|
defaultVariants: {
|
|
75
|
-
display: "block"
|
|
76
|
-
size: "default"
|
|
336
|
+
display: "block"
|
|
77
337
|
}
|
|
78
338
|
});
|
|
339
|
+
// ---------------------------------------------------------------------------
|
|
340
|
+
// Fill-based color styles (Polaris icons)
|
|
341
|
+
// ---------------------------------------------------------------------------
|
|
79
342
|
var iconStyles = (0, _tailwindvariants.tv)({
|
|
80
343
|
base: "",
|
|
81
344
|
variants: {
|
|
@@ -118,6 +381,7 @@ var iconStyles = (0, _tailwindvariants.tv)({
|
|
|
118
381
|
"info-icon": "fill-info-icon",
|
|
119
382
|
"highlight-icon": "fill-highlight-icon",
|
|
120
383
|
"insight-icon": "fill-insight-icon",
|
|
384
|
+
"btn-insight-icon": "fill-btn-insight-icon",
|
|
121
385
|
"neutral-icon": "fill-neutral-icon",
|
|
122
386
|
"success-alt-icon": "fill-success-alt-icon",
|
|
123
387
|
"critical-alt-icon": "fill-critical-alt-icon",
|
|
@@ -127,7 +391,14 @@ var iconStyles = (0, _tailwindvariants.tv)({
|
|
|
127
391
|
"highlight-alt-icon": "fill-highlight-alt-icon",
|
|
128
392
|
"insight-alt-icon": "fill-insight-alt-icon",
|
|
129
393
|
"neutral-alt-icon": "fill-neutral-alt-icon",
|
|
130
|
-
"FrameSaveBar": "fill-alternate dark:fill-black"
|
|
394
|
+
"FrameSaveBar": "fill-alternate dark:fill-black",
|
|
395
|
+
"brand": "fill-brand",
|
|
396
|
+
"brand-low": "fill-brand-low",
|
|
397
|
+
"brand-lower": "fill-brand-lower",
|
|
398
|
+
"brand-alternate": "fill-brand-alternate",
|
|
399
|
+
"brand-saturated": "fill-brand-saturated",
|
|
400
|
+
"brand-subdued": "fill-brand-subdued",
|
|
401
|
+
"brand-chat": "fill-brand-chat"
|
|
131
402
|
},
|
|
132
403
|
hoverColor: {
|
|
133
404
|
white: "hover:fill-white group-hover/LithoIcon:fill-white",
|
|
@@ -206,6 +477,276 @@ var iconStyles = (0, _tailwindvariants.tv)({
|
|
|
206
477
|
color: "default"
|
|
207
478
|
}
|
|
208
479
|
});
|
|
480
|
+
// ---------------------------------------------------------------------------
|
|
481
|
+
// Stroke-based color map (Lucide / generic stroke icons)
|
|
482
|
+
// Mirrors iconStyles.color keys but uses text-* instead of fill-*
|
|
483
|
+
// Lucide SVGs use stroke="currentColor", so text-* classes set the icon color.
|
|
484
|
+
// ---------------------------------------------------------------------------
|
|
485
|
+
var STROKE_COLOR_MAP = {
|
|
486
|
+
// Core
|
|
487
|
+
white: "text-white",
|
|
488
|
+
default: "text-higher",
|
|
489
|
+
base: "text-higher",
|
|
490
|
+
subdued: "text-low",
|
|
491
|
+
lower: "text-lower",
|
|
492
|
+
link: "text-link",
|
|
493
|
+
primary: "text-link",
|
|
494
|
+
alternate: "text-alternate",
|
|
495
|
+
high: "text-high",
|
|
496
|
+
low: "text-low",
|
|
497
|
+
currentColor: "text-current",
|
|
498
|
+
// Status foreground
|
|
499
|
+
successFgAlternate: "text-fg-success-alternate",
|
|
500
|
+
success: "text-fg-success",
|
|
501
|
+
"fg-success": "text-fg-success",
|
|
502
|
+
critical: "text-fg-critical",
|
|
503
|
+
"fg-critical": "text-fg-critical",
|
|
504
|
+
criticalFgAlternate: "text-fg-critical-alternate",
|
|
505
|
+
warning: "text-attention-alt-icon",
|
|
506
|
+
info: "text-info-alt-icon",
|
|
507
|
+
caution: "text-fg-caution-alternate",
|
|
508
|
+
attention: "text-attention-alt-icon",
|
|
509
|
+
highlight: "text-highlight-alt-icon",
|
|
510
|
+
neutral: "text-neutral-alt-icon",
|
|
511
|
+
normal: "text-normal",
|
|
512
|
+
disabled: "text-lowest",
|
|
513
|
+
active: "text-tab-active-fg",
|
|
514
|
+
// Button-specific
|
|
515
|
+
"btn-primary-icon": "text-btn-primary-icon",
|
|
516
|
+
"btn-secondary-icon": "text-btn-secondary-icon",
|
|
517
|
+
"btn-plain-icon": "text-btn-plain-icon",
|
|
518
|
+
"btn-link-icon": "text-btn-link-icon",
|
|
519
|
+
"btn-destructive-icon": "text-btn-destructive-icon",
|
|
520
|
+
"btn-highlight-icon": "text-btn-highlight-icon",
|
|
521
|
+
// Input
|
|
522
|
+
inputFg: "text-form-input-fg",
|
|
523
|
+
inputFgDisabled: "text-form-input-fg-disabled",
|
|
524
|
+
// Status icons
|
|
525
|
+
"success-icon": "text-success-icon",
|
|
526
|
+
"critical-icon": "text-critical-icon",
|
|
527
|
+
"warning-icon": "text-warning-icon",
|
|
528
|
+
"attention-icon": "text-attention-icon",
|
|
529
|
+
"info-icon": "text-info-icon",
|
|
530
|
+
"highlight-icon": "text-highlight-icon",
|
|
531
|
+
"insight-icon": "text-insight-icon",
|
|
532
|
+
"btn-insight-icon": "text-btn-insight-icon",
|
|
533
|
+
"neutral-icon": "text-neutral-icon",
|
|
534
|
+
// Status alt icons
|
|
535
|
+
"success-alt-icon": "text-success-alt-icon",
|
|
536
|
+
"critical-alt-icon": "text-critical-alt-icon",
|
|
537
|
+
"warning-alt-icon": "text-attention-alt-icon",
|
|
538
|
+
"attention-alt-icon": "text-attention-alt-icon",
|
|
539
|
+
"info-alt-icon": "text-info-alt-icon",
|
|
540
|
+
"highlight-alt-icon": "text-highlight-alt-icon",
|
|
541
|
+
"insight-alt-icon": "text-insight-alt-icon",
|
|
542
|
+
"neutral-alt-icon": "text-neutral-alt-icon",
|
|
543
|
+
// Brand
|
|
544
|
+
"brand": "text-brand",
|
|
545
|
+
"brand-low": "text-brand-low",
|
|
546
|
+
"brand-lower": "text-brand-lower",
|
|
547
|
+
"brand-alternate": "text-brand-alternate",
|
|
548
|
+
"brand-saturated": "text-brand-saturated",
|
|
549
|
+
"brand-subdued": "text-brand-subdued",
|
|
550
|
+
"brand-chat": "text-brand-chat"
|
|
551
|
+
};
|
|
552
|
+
// ---------------------------------------------------------------------------
|
|
553
|
+
// Size system (extended to support Lucide's larger size range)
|
|
554
|
+
// ---------------------------------------------------------------------------
|
|
555
|
+
/** Map semantic size names to numeric tokens. */ var SEMANTIC_TO_TOKEN = {
|
|
556
|
+
xs: 3,
|
|
557
|
+
sm: 4,
|
|
558
|
+
default: 5,
|
|
559
|
+
lg: 6,
|
|
560
|
+
xl: 7,
|
|
561
|
+
"2xl": 8
|
|
562
|
+
};
|
|
563
|
+
/** Map numeric tokens (3-20) to pixel values. */ var TOKEN_TO_PX = {
|
|
564
|
+
3: 12,
|
|
565
|
+
4: 16,
|
|
566
|
+
5: 20,
|
|
567
|
+
6: 24,
|
|
568
|
+
7: 28,
|
|
569
|
+
8: 32,
|
|
570
|
+
9: 36,
|
|
571
|
+
10: 40,
|
|
572
|
+
11: 44,
|
|
573
|
+
12: 48,
|
|
574
|
+
13: 52,
|
|
575
|
+
14: 56,
|
|
576
|
+
15: 60,
|
|
577
|
+
16: 64,
|
|
578
|
+
17: 68,
|
|
579
|
+
18: 72,
|
|
580
|
+
19: 76,
|
|
581
|
+
20: 80
|
|
582
|
+
};
|
|
583
|
+
/** Static Tailwind classes for container sizing (avoids purge issues). Tokens without entries use inline styles. */ var SIZE_CLASSES = {
|
|
584
|
+
3: "h-3 w-3 min-w-3",
|
|
585
|
+
4: "h-4 w-4 min-w-4",
|
|
586
|
+
5: "h-5 w-5 min-w-5",
|
|
587
|
+
6: "h-6 w-6 min-w-6",
|
|
588
|
+
7: "h-7 w-7 min-w-7",
|
|
589
|
+
8: "h-8 w-8 min-w-8",
|
|
590
|
+
9: "h-9 w-9 min-w-9",
|
|
591
|
+
10: "h-10 w-10 min-w-10",
|
|
592
|
+
11: "h-11 w-11 min-w-11",
|
|
593
|
+
12: "h-12 w-12 min-w-12",
|
|
594
|
+
14: "h-14 w-14 min-w-14",
|
|
595
|
+
16: "h-16 w-16 min-w-16",
|
|
596
|
+
20: "h-20 w-20 min-w-20"
|
|
597
|
+
};
|
|
598
|
+
var LITHO_TOKENS = [
|
|
599
|
+
3,
|
|
600
|
+
4,
|
|
601
|
+
5,
|
|
602
|
+
6,
|
|
603
|
+
7,
|
|
604
|
+
8,
|
|
605
|
+
9,
|
|
606
|
+
10,
|
|
607
|
+
11,
|
|
608
|
+
12,
|
|
609
|
+
13,
|
|
610
|
+
14,
|
|
611
|
+
15,
|
|
612
|
+
16,
|
|
613
|
+
17,
|
|
614
|
+
18,
|
|
615
|
+
19,
|
|
616
|
+
20
|
|
617
|
+
];
|
|
618
|
+
/**
|
|
619
|
+
* Resolve the size prop to { px, sizeClass, sizeStyle }.
|
|
620
|
+
* Accepts: semantic string, numeric token (3-20), or raw px number.
|
|
621
|
+
*/ var resolveSize = function(size) {
|
|
622
|
+
// Semantic name → token → px
|
|
623
|
+
if (typeof size === "string" && SEMANTIC_TO_TOKEN[size] !== undefined) {
|
|
624
|
+
var token = SEMANTIC_TO_TOKEN[size];
|
|
625
|
+
var px = TOKEN_TO_PX[token];
|
|
626
|
+
var sizeClass = SIZE_CLASSES[token] || null;
|
|
627
|
+
var sizeStyle = sizeClass ? null : {
|
|
628
|
+
width: px,
|
|
629
|
+
height: px,
|
|
630
|
+
minWidth: px
|
|
631
|
+
};
|
|
632
|
+
return {
|
|
633
|
+
px: px,
|
|
634
|
+
sizeClass: sizeClass,
|
|
635
|
+
sizeStyle: sizeStyle
|
|
636
|
+
};
|
|
637
|
+
}
|
|
638
|
+
// Numeric token → px
|
|
639
|
+
if (typeof size === "number" && LITHO_TOKENS.includes(size)) {
|
|
640
|
+
var px1 = TOKEN_TO_PX[size];
|
|
641
|
+
var sizeClass1 = SIZE_CLASSES[size] || null;
|
|
642
|
+
var sizeStyle1 = sizeClass1 ? null : {
|
|
643
|
+
width: px1,
|
|
644
|
+
height: px1,
|
|
645
|
+
minWidth: px1
|
|
646
|
+
};
|
|
647
|
+
return {
|
|
648
|
+
px: px1,
|
|
649
|
+
sizeClass: sizeClass1,
|
|
650
|
+
sizeStyle: sizeStyle1
|
|
651
|
+
};
|
|
652
|
+
}
|
|
653
|
+
// Raw px number (not a token)
|
|
654
|
+
if (typeof size === "number") {
|
|
655
|
+
return {
|
|
656
|
+
px: size,
|
|
657
|
+
sizeClass: null,
|
|
658
|
+
sizeStyle: {
|
|
659
|
+
width: size,
|
|
660
|
+
height: size,
|
|
661
|
+
minWidth: size
|
|
662
|
+
}
|
|
663
|
+
};
|
|
664
|
+
}
|
|
665
|
+
// Fallback to default
|
|
666
|
+
var px2 = TOKEN_TO_PX[5];
|
|
667
|
+
return {
|
|
668
|
+
px: px2,
|
|
669
|
+
sizeClass: SIZE_CLASSES[5],
|
|
670
|
+
sizeStyle: null
|
|
671
|
+
};
|
|
672
|
+
};
|
|
673
|
+
// ---------------------------------------------------------------------------
|
|
674
|
+
// Lucide dynamic loading
|
|
675
|
+
// ---------------------------------------------------------------------------
|
|
676
|
+
var lucideCache = new Map();
|
|
677
|
+
var toPascalCase = function(name) {
|
|
678
|
+
return name.split("-").map(function(p) {
|
|
679
|
+
return p[0].toUpperCase() + p.slice(1);
|
|
680
|
+
}).join("");
|
|
681
|
+
};
|
|
682
|
+
var loadLucideIcon = function(name) {
|
|
683
|
+
return _async_to_generator(function() {
|
|
684
|
+
var key, mod, icon, e;
|
|
685
|
+
return _ts_generator(this, function(_state) {
|
|
686
|
+
switch(_state.label){
|
|
687
|
+
case 0:
|
|
688
|
+
key = toPascalCase(name);
|
|
689
|
+
if (lucideCache.has(key)) return [
|
|
690
|
+
2,
|
|
691
|
+
lucideCache.get(key)
|
|
692
|
+
];
|
|
693
|
+
_state.label = 1;
|
|
694
|
+
case 1:
|
|
695
|
+
_state.trys.push([
|
|
696
|
+
1,
|
|
697
|
+
3,
|
|
698
|
+
,
|
|
699
|
+
4
|
|
700
|
+
]);
|
|
701
|
+
return [
|
|
702
|
+
4,
|
|
703
|
+
Promise.resolve().then(function() {
|
|
704
|
+
return /*#__PURE__*/ _interop_require_wildcard(require("lucide-react"));
|
|
705
|
+
})
|
|
706
|
+
];
|
|
707
|
+
case 2:
|
|
708
|
+
mod = _state.sent();
|
|
709
|
+
icon = mod[key] || null;
|
|
710
|
+
lucideCache.set(key, icon);
|
|
711
|
+
return [
|
|
712
|
+
2,
|
|
713
|
+
icon
|
|
714
|
+
];
|
|
715
|
+
case 3:
|
|
716
|
+
e = _state.sent();
|
|
717
|
+
lucideCache.set(key, null);
|
|
718
|
+
return [
|
|
719
|
+
2,
|
|
720
|
+
null
|
|
721
|
+
];
|
|
722
|
+
case 4:
|
|
723
|
+
return [
|
|
724
|
+
2
|
|
725
|
+
];
|
|
726
|
+
}
|
|
727
|
+
});
|
|
728
|
+
})();
|
|
729
|
+
};
|
|
730
|
+
// ---------------------------------------------------------------------------
|
|
731
|
+
// StrokeWidth / Opacity helpers
|
|
732
|
+
// ---------------------------------------------------------------------------
|
|
733
|
+
var resolveStrokeWidth = function(strokeWidth) {
|
|
734
|
+
if (strokeWidth === undefined || strokeWidth === null) return undefined;
|
|
735
|
+
var n = Number(strokeWidth);
|
|
736
|
+
if (Number.isNaN(n)) return undefined;
|
|
737
|
+
var rounded = Math.round(n / 0.25) * 0.25;
|
|
738
|
+
return Math.round(Math.min(3, Math.max(0.5, rounded)) * 100) / 100;
|
|
739
|
+
};
|
|
740
|
+
var resolveOpacity = function(opacity) {
|
|
741
|
+
if (opacity === undefined || opacity === null) return 100;
|
|
742
|
+
var n = Number(opacity);
|
|
743
|
+
if (Number.isNaN(n)) return 100;
|
|
744
|
+
var rounded = Math.round(n / 10) * 10;
|
|
745
|
+
return Math.min(100, Math.max(0, rounded));
|
|
746
|
+
};
|
|
747
|
+
// ---------------------------------------------------------------------------
|
|
748
|
+
// Internal Litho icons (custom SVGs)
|
|
749
|
+
// ---------------------------------------------------------------------------
|
|
209
750
|
var LithoIcons = function(param) {
|
|
210
751
|
var className = param.className;
|
|
211
752
|
return {
|
|
@@ -283,65 +824,146 @@ var LithoIcons = function(param) {
|
|
|
283
824
|
})
|
|
284
825
|
};
|
|
285
826
|
};
|
|
827
|
+
// ---------------------------------------------------------------------------
|
|
828
|
+
// Component detection
|
|
829
|
+
// ---------------------------------------------------------------------------
|
|
286
830
|
/**
|
|
287
|
-
*
|
|
288
|
-
*
|
|
289
|
-
*
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
* @param {('xs'|'sm'|'default'|'lg'|'xl'|'2xl')} [props.size="default"] - Sets the icon size.
|
|
298
|
-
* - 'xs': Extra small (12px)
|
|
299
|
-
* - 'sm': Small (16px)
|
|
300
|
-
* - 'default': Medium (20px)
|
|
301
|
-
* - 'lg': Large (24px)
|
|
302
|
-
* - 'xl': Extra large (28px)
|
|
303
|
-
* - '2xl': Double extra large (32px)
|
|
304
|
-
* @param {boolean} [props.stroke=false] - Whether to use stroke styling instead of fill.
|
|
305
|
-
* @param {Function} [props.onClick] - Click handler for the icon.
|
|
306
|
-
* @param {string} [props.className] - Additional CSS classes to apply.
|
|
307
|
-
* @returns {JSX.Element} The rendered icon component with the specified styles.
|
|
308
|
-
*
|
|
309
|
-
* @example
|
|
310
|
-
* <Icon
|
|
311
|
-
* source={PolarisIcons.TickMinor}
|
|
312
|
-
* color="success"
|
|
313
|
-
* display="inline"
|
|
314
|
-
* size="lg"
|
|
315
|
-
* />
|
|
316
|
-
*/ function Icon() {
|
|
831
|
+
* Check if a value is a renderable React component (function, class, or forwardRef).
|
|
832
|
+
* Lucide icons are forwardRef objects (typeof "object" with a .render function).
|
|
833
|
+
* Polaris icons are plain functions.
|
|
834
|
+
*/ var isComponent = function(value) {
|
|
835
|
+
return typeof value === "function" || (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && value !== null && typeof value.render === "function";
|
|
836
|
+
};
|
|
837
|
+
// ---------------------------------------------------------------------------
|
|
838
|
+
// Component
|
|
839
|
+
// ---------------------------------------------------------------------------
|
|
840
|
+
function Icon() {
|
|
317
841
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
318
|
-
var source = props.source, color = props.color, hoverColor = props.hoverColor, _props_display = props.display, display = _props_display === void 0 ? "block" : _props_display, _props_size = props.size, size = _props_size === void 0 ? "default" : _props_size, _props_stroke = props.stroke, stroke = _props_stroke === void 0 ? false : _props_stroke, onClick = props.onClick, className = props.className;
|
|
319
|
-
|
|
320
|
-
var
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
842
|
+
var source = props.source, color = props.color, hoverColor = props.hoverColor, _props_display = props.display, display = _props_display === void 0 ? "block" : _props_display, _props_size = props.size, size = _props_size === void 0 ? "default" : _props_size, _props_stroke = props.stroke, stroke = _props_stroke === void 0 ? false : _props_stroke, _props_strokeWidth = props.strokeWidth, strokeWidth = _props_strokeWidth === void 0 ? 2 : _props_strokeWidth, _props_opacity = props.opacity, opacity = _props_opacity === void 0 ? 100 : _props_opacity, onClick = props.onClick, className = props.className;
|
|
843
|
+
// --- Resolve size ---
|
|
844
|
+
var resolved = resolveSize(size);
|
|
845
|
+
var resolvedStrokeWidth = resolveStrokeWidth(strokeWidth);
|
|
846
|
+
var resolvedOpacity = resolveOpacity(opacity);
|
|
847
|
+
// --- Detect icon type ---
|
|
848
|
+
// 1. Try Polaris lookup (by displayName for components, by string key for strings)
|
|
849
|
+
var polarisIcon = typeof source === "string" ? _polarisicons[source] : isComponent(source) ? _polarisicons[source === null || source === void 0 ? void 0 : source.displayName] : null;
|
|
850
|
+
// 2. Check for Litho internal icons (string sources only)
|
|
851
|
+
var fillClasses = iconStyles({
|
|
325
852
|
color: color,
|
|
326
853
|
stroke: stroke,
|
|
327
854
|
hoverColor: hoverColor
|
|
328
855
|
});
|
|
329
856
|
var LithoIconComponents = LithoIcons({
|
|
330
|
-
className:
|
|
857
|
+
className: fillClasses
|
|
331
858
|
});
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
859
|
+
var lithoIcon = typeof source === "string" ? LithoIconComponents[source] : null;
|
|
860
|
+
// 3. If not Polaris and not Litho, treat function sources as Lucide/generic stroke icons
|
|
861
|
+
var isLucideComponent = !polarisIcon && !lithoIcon && isComponent(source);
|
|
862
|
+
// 4. If string not found in Polaris/Litho, try dynamic Lucide load
|
|
863
|
+
var needsDynamicLoad = !polarisIcon && !lithoIcon && typeof source === "string";
|
|
864
|
+
var _useState = _sliced_to_array((0, _react.useState)(null), 2), dynamicIcon = _useState[0], setDynamicIcon = _useState[1];
|
|
865
|
+
(0, _react.useEffect)(function() {
|
|
866
|
+
if (!needsDynamicLoad) {
|
|
867
|
+
setDynamicIcon(null);
|
|
868
|
+
return;
|
|
869
|
+
}
|
|
870
|
+
var isMounted = true;
|
|
871
|
+
loadLucideIcon(source).then(function(icon) {
|
|
872
|
+
if (isMounted && icon) {
|
|
873
|
+
setDynamicIcon(function() {
|
|
874
|
+
return icon;
|
|
875
|
+
});
|
|
876
|
+
}
|
|
337
877
|
});
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
878
|
+
return function() {
|
|
879
|
+
isMounted = false;
|
|
880
|
+
};
|
|
881
|
+
}, [
|
|
882
|
+
source,
|
|
883
|
+
needsDynamicLoad
|
|
884
|
+
]);
|
|
885
|
+
// --- Build container classes ---
|
|
886
|
+
var displayClass = styles({
|
|
887
|
+
display: display
|
|
345
888
|
});
|
|
889
|
+
var sizeClass = resolved.sizeClass || "";
|
|
890
|
+
var containerClasses = "".concat(displayClass).concat(sizeClass ? " ".concat(sizeClass) : "").concat(className ? " ".concat(className) : "");
|
|
891
|
+
var containerStyle = _object_spread({}, resolved.sizeStyle || {}, resolvedOpacity < 100 ? {
|
|
892
|
+
opacity: resolvedOpacity / 100
|
|
893
|
+
} : {});
|
|
894
|
+
var hasContainerStyle = Object.keys(containerStyle).length > 0;
|
|
895
|
+
// --- Shared interactive props for onClick ---
|
|
896
|
+
var interactiveProps = onClick ? {
|
|
897
|
+
role: "button",
|
|
898
|
+
tabIndex: 0,
|
|
899
|
+
onKeyDown: function(e) {
|
|
900
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
901
|
+
e.preventDefault();
|
|
902
|
+
onClick(e);
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
} : {};
|
|
906
|
+
// --- Render: Litho internal icon ---
|
|
907
|
+
if (lithoIcon) {
|
|
908
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", _object_spread_props(_object_spread({
|
|
909
|
+
className: containerClasses,
|
|
910
|
+
style: hasContainerStyle ? containerStyle : undefined,
|
|
911
|
+
onClick: onClick
|
|
912
|
+
}, interactiveProps), {
|
|
913
|
+
children: lithoIcon
|
|
914
|
+
}));
|
|
915
|
+
}
|
|
916
|
+
// --- Render: Polaris icon ---
|
|
917
|
+
if (polarisIcon) {
|
|
918
|
+
var PolarisComponent = polarisIcon;
|
|
919
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", _object_spread_props(_object_spread({
|
|
920
|
+
className: containerClasses,
|
|
921
|
+
style: hasContainerStyle ? containerStyle : undefined,
|
|
922
|
+
onClick: onClick
|
|
923
|
+
}, interactiveProps), {
|
|
924
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(PolarisComponent, {
|
|
925
|
+
className: fillClasses
|
|
926
|
+
})
|
|
927
|
+
}));
|
|
928
|
+
}
|
|
929
|
+
// --- Render: Lucide icon (direct component or dynamically loaded) ---
|
|
930
|
+
var LucideComponent = isLucideComponent ? source : dynamicIcon;
|
|
931
|
+
if (LucideComponent) {
|
|
932
|
+
var strokeColorClass = color ? STROKE_COLOR_MAP[color] || "" : "";
|
|
933
|
+
// Lucide uses a 24x24 viewBox vs Polaris's 20x20, so render the SVG 4px
|
|
934
|
+
// smaller than the container to visually match Polaris icon sizing.
|
|
935
|
+
var lucideIconSize = Math.max(resolved.px - 3, 8);
|
|
936
|
+
var lucideProps = {
|
|
937
|
+
size: lucideIconSize
|
|
938
|
+
};
|
|
939
|
+
if (resolvedStrokeWidth !== undefined) {
|
|
940
|
+
lucideProps.strokeWidth = resolvedStrokeWidth;
|
|
941
|
+
}
|
|
942
|
+
// Override container to flex/inline-flex to center the smaller SVG
|
|
943
|
+
var lucideDisplay = display === "inline" || display === "inline-block" || display === "inline-flex" ? "inline-flex" : "flex";
|
|
944
|
+
var lucideContainerClasses = "".concat(styles({
|
|
945
|
+
display: lucideDisplay
|
|
946
|
+
})).concat(sizeClass ? " ".concat(sizeClass) : "").concat(className ? " ".concat(className) : "");
|
|
947
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", _object_spread_props(_object_spread({
|
|
948
|
+
className: lucideContainerClasses,
|
|
949
|
+
style: hasContainerStyle ? containerStyle : undefined,
|
|
950
|
+
onClick: onClick
|
|
951
|
+
}, interactiveProps), {
|
|
952
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(LucideComponent, _object_spread_props(_object_spread({}, lucideProps), {
|
|
953
|
+
className: strokeColorClass || undefined
|
|
954
|
+
}))
|
|
955
|
+
}));
|
|
956
|
+
}
|
|
957
|
+
// --- Render: JSX passthrough (ReactNode) or fallback ---
|
|
958
|
+
if (source && /*#__PURE__*/ (0, _react.isValidElement)(source)) {
|
|
959
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", _object_spread_props(_object_spread({
|
|
960
|
+
className: containerClasses,
|
|
961
|
+
style: hasContainerStyle ? containerStyle : undefined,
|
|
962
|
+
onClick: onClick
|
|
963
|
+
}, interactiveProps), {
|
|
964
|
+
children: source
|
|
965
|
+
}));
|
|
966
|
+
}
|
|
967
|
+
return null;
|
|
346
968
|
}
|
|
347
969
|
var _default = Icon;
|