@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
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return _default;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
var _jsxruntime = require("react/jsx-runtime");
|
|
12
|
+
var _tailwindvariants = require("tailwind-variants");
|
|
13
|
+
var _Text = /*#__PURE__*/ _interop_require_default(require("./Text"));
|
|
14
|
+
var _Label = /*#__PURE__*/ _interop_require_default(require("./Label"));
|
|
15
|
+
var _Icon = /*#__PURE__*/ _interop_require_default(require("./Icon"));
|
|
16
|
+
var _polarisicons = require("@shopify/polaris-icons");
|
|
17
|
+
function _define_property(obj, key, value) {
|
|
18
|
+
if (key in obj) {
|
|
19
|
+
Object.defineProperty(obj, key, {
|
|
20
|
+
value: value,
|
|
21
|
+
enumerable: true,
|
|
22
|
+
configurable: true,
|
|
23
|
+
writable: true
|
|
24
|
+
});
|
|
25
|
+
} else {
|
|
26
|
+
obj[key] = value;
|
|
27
|
+
}
|
|
28
|
+
return obj;
|
|
29
|
+
}
|
|
30
|
+
function _interop_require_default(obj) {
|
|
31
|
+
return obj && obj.__esModule ? obj : {
|
|
32
|
+
default: obj
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function _object_spread(target) {
|
|
36
|
+
for(var i = 1; i < arguments.length; i++){
|
|
37
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
38
|
+
var ownKeys = Object.keys(source);
|
|
39
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
40
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
41
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
ownKeys.forEach(function(key) {
|
|
45
|
+
_define_property(target, key, source[key]);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
return target;
|
|
49
|
+
}
|
|
50
|
+
function ownKeys(object, enumerableOnly) {
|
|
51
|
+
var keys = Object.keys(object);
|
|
52
|
+
if (Object.getOwnPropertySymbols) {
|
|
53
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
54
|
+
if (enumerableOnly) {
|
|
55
|
+
symbols = symbols.filter(function(sym) {
|
|
56
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
keys.push.apply(keys, symbols);
|
|
60
|
+
}
|
|
61
|
+
return keys;
|
|
62
|
+
}
|
|
63
|
+
function _object_spread_props(target, source) {
|
|
64
|
+
source = source != null ? source : {};
|
|
65
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
66
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
67
|
+
} else {
|
|
68
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
69
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return target;
|
|
73
|
+
}
|
|
74
|
+
function _object_without_properties(source, excluded) {
|
|
75
|
+
if (source == null) return {};
|
|
76
|
+
var target = _object_without_properties_loose(source, excluded);
|
|
77
|
+
var key, i;
|
|
78
|
+
if (Object.getOwnPropertySymbols) {
|
|
79
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
80
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
81
|
+
key = sourceSymbolKeys[i];
|
|
82
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
83
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
84
|
+
target[key] = source[key];
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return target;
|
|
88
|
+
}
|
|
89
|
+
function _object_without_properties_loose(source, excluded) {
|
|
90
|
+
if (source == null) return {};
|
|
91
|
+
var target = {};
|
|
92
|
+
var sourceKeys = Object.keys(source);
|
|
93
|
+
var key, i;
|
|
94
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
95
|
+
key = sourceKeys[i];
|
|
96
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
97
|
+
target[key] = source[key];
|
|
98
|
+
}
|
|
99
|
+
return target;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* @component RadioButtonCardGroup
|
|
103
|
+
*
|
|
104
|
+
* @description A grouped radio selection component that renders options in a single bordered container with dividers between items, using card-styled radio inputs.
|
|
105
|
+
*
|
|
106
|
+
* @usage
|
|
107
|
+
* - DO: Use for single-select options that benefit from a compact grouped list layout with descriptions and icons.
|
|
108
|
+
* - DON'T: Use when each option needs its own standalone card appearance (use RadioButtonCard individually).
|
|
109
|
+
*
|
|
110
|
+
* @accessibility
|
|
111
|
+
* - Each option uses a native radio input (sr-only) wrapped in a label for keyboard accessibility and screen reader support.
|
|
112
|
+
* - All radio inputs share the same `name` attribute for native radio group behavior.
|
|
113
|
+
* - Focus-visible ring appears on keyboard navigation.
|
|
114
|
+
*
|
|
115
|
+
* @alternative
|
|
116
|
+
* - If you need standalone card-styled radio inputs, use `RadioButtonCard`.
|
|
117
|
+
* - If you need a simple inline radio/checkbox list, use `ChoiceList`.
|
|
118
|
+
*
|
|
119
|
+
* @param {Object} [props={}] - Component props.
|
|
120
|
+
* @param {string} [props.title] - Optional title rendered above the group.
|
|
121
|
+
* @param {React.ReactNode} [props.tooltip] - Tooltip content for the title.
|
|
122
|
+
* @param {boolean} [props.titleHidden=false] - Visually hides the title while keeping it accessible to screen readers.
|
|
123
|
+
* @param {Array<RadioButtonCardGroupOption>} [props.options=[]] - Array of option objects to render.
|
|
124
|
+
* @param {string} props.options[].value - The value of the option.
|
|
125
|
+
* @param {string} props.options[].label - The display label of the option.
|
|
126
|
+
* @param {string} [props.options[].description] - A description displayed below the label.
|
|
127
|
+
* @param {React.ReactNode} [props.options[].icon] - Optional icon JSX displayed on the left.
|
|
128
|
+
* @param {boolean} [props.options[].disabled=false] - Whether this specific option is disabled.
|
|
129
|
+
* @param {string|React.ReactNode} [props.options[].helpText] - Additional descriptive text for the option.
|
|
130
|
+
* @param {React.ReactNode} [props.options[].tooltip] - Tooltip content for this option's label.
|
|
131
|
+
* @param {Array<string>} [props.selected=[]] - Currently selected values. Array for API consistency with ChoiceList.
|
|
132
|
+
* @param {Function} [props.onChange] - Callback when selection changes. Receives updated array of selected values.
|
|
133
|
+
* @param {string} [props.name] - The name attribute for the radio inputs (groups them together).
|
|
134
|
+
* @param {string} [props.error] - Error message displayed below the group.
|
|
135
|
+
* @param {boolean} [props.disabled=false] - Disables all options.
|
|
136
|
+
* @param {boolean} [props.hideRadioButton=false] - Hides the radio button controls.
|
|
137
|
+
* @param {boolean} [props.allowDeselect=false] - When true, clicking a selected option deselects it.
|
|
138
|
+
* @param {"left"|"right"} [props.radioPosition="right"] - Position of the radio button control relative to the content.
|
|
139
|
+
* @param {Object} [restProps] - Additional props passed to the root element.
|
|
140
|
+
*
|
|
141
|
+
* @returns {JSX.Element} The rendered RadioButtonCardGroup component.
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* <RadioButtonCardGroup
|
|
145
|
+
* title="Select a plan"
|
|
146
|
+
* name="plan"
|
|
147
|
+
* options={[
|
|
148
|
+
* { value: "basic", label: "Basic", description: "For individuals" },
|
|
149
|
+
* { value: "pro", label: "Pro", description: "For teams" },
|
|
150
|
+
* { value: "enterprise", label: "Enterprise", description: "For organizations" },
|
|
151
|
+
* ]}
|
|
152
|
+
* selected={["basic"]}
|
|
153
|
+
* onChange={(selected) => setSelected(selected)}
|
|
154
|
+
* />
|
|
155
|
+
*/ var containerStyles = (0, _tailwindvariants.tv)({
|
|
156
|
+
base: "Litho-RadioButtonCardGroup border rounded-lg overflow-hidden",
|
|
157
|
+
variants: {
|
|
158
|
+
hasError: {
|
|
159
|
+
true: "border-form-border-error",
|
|
160
|
+
false: "border-edge-light"
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
defaultVariants: {
|
|
164
|
+
hasError: false
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
var itemStyles = (0, _tailwindvariants.tv)({
|
|
168
|
+
base: "Litho-RadioButtonCardGroup__Item p-3 pl-4 flex items-center gap-3 has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-form-focus has-[:focus-visible]:ring-inset",
|
|
169
|
+
variants: {
|
|
170
|
+
checked: {
|
|
171
|
+
true: "",
|
|
172
|
+
false: ""
|
|
173
|
+
},
|
|
174
|
+
disabled: {
|
|
175
|
+
true: "bg-tint-1",
|
|
176
|
+
false: "cursor-pointer hover"
|
|
177
|
+
},
|
|
178
|
+
isLast: {
|
|
179
|
+
true: "",
|
|
180
|
+
false: "border-b border-edge-subdued"
|
|
181
|
+
},
|
|
182
|
+
radioPosition: {
|
|
183
|
+
right: "justify-between",
|
|
184
|
+
left: ""
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
defaultVariants: {
|
|
188
|
+
radioPosition: "right"
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
// Replicated from RadioButtonCard — the radio circle control styles
|
|
192
|
+
var radioStyles = (0, _tailwindvariants.tv)({
|
|
193
|
+
base: "Litho-RadioButton__Control w-4.5 h-4.5 rounded-full border border-form-border flex items-center justify-center",
|
|
194
|
+
variants: {
|
|
195
|
+
disabled: {
|
|
196
|
+
true: "bg-form-bg-disabled border-form-border"
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
compoundVariants: [
|
|
200
|
+
{
|
|
201
|
+
hasError: true,
|
|
202
|
+
disabled: false,
|
|
203
|
+
checked: false,
|
|
204
|
+
class: "bg-form-bg-error border-form-border-error hover:bg-form-bg-error-low hover:ring hover:ring-form-focus-error"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
hasError: true,
|
|
208
|
+
disabled: false,
|
|
209
|
+
checked: true,
|
|
210
|
+
class: "bg-critical border-form-border-error hover:ring hover:ring-form-focus-error"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
hasError: false,
|
|
214
|
+
disabled: false,
|
|
215
|
+
checked: false,
|
|
216
|
+
class: "bg-form-bg border-form-border hover:border-form-border-focus hover:ring hover:ring-form-focus"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
hasError: false,
|
|
220
|
+
disabled: false,
|
|
221
|
+
checked: true,
|
|
222
|
+
class: "bg-form-accent border-form-border-focus hover:border-form-border-focus hover:ring hover:ring-form-focus"
|
|
223
|
+
}
|
|
224
|
+
]
|
|
225
|
+
});
|
|
226
|
+
function RadioButtonCardGroup() {
|
|
227
|
+
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
228
|
+
var title = props.title, tooltip = props.tooltip, _props_titleHidden = props.titleHidden, titleHidden = _props_titleHidden === void 0 ? false : _props_titleHidden, _props_options = props.options, options = _props_options === void 0 ? [] : _props_options, _props_selected = props.selected, selected = _props_selected === void 0 ? [] : _props_selected, onChange = props.onChange, name = props.name, error = props.error, _props_disabled = props.disabled, disabled = _props_disabled === void 0 ? false : _props_disabled, _props_hideRadioButton = props.hideRadioButton, hideRadioButton = _props_hideRadioButton === void 0 ? false : _props_hideRadioButton, _props_allowDeselect = props.allowDeselect, allowDeselect = _props_allowDeselect === void 0 ? false : _props_allowDeselect, _props_radioPosition = props.radioPosition, radioPosition = _props_radioPosition === void 0 ? "left" : _props_radioPosition, _props_labelFontWeight = props.labelFontWeight, labelFontWeight = _props_labelFontWeight === void 0 ? "semibold" : _props_labelFontWeight, restProps = _object_without_properties(props, [
|
|
229
|
+
"title",
|
|
230
|
+
"tooltip",
|
|
231
|
+
"titleHidden",
|
|
232
|
+
"options",
|
|
233
|
+
"selected",
|
|
234
|
+
"onChange",
|
|
235
|
+
"name",
|
|
236
|
+
"error",
|
|
237
|
+
"disabled",
|
|
238
|
+
"hideRadioButton",
|
|
239
|
+
"allowDeselect",
|
|
240
|
+
"radioPosition",
|
|
241
|
+
"labelFontWeight"
|
|
242
|
+
]);
|
|
243
|
+
var hasError = !!error;
|
|
244
|
+
var containerClasses = containerStyles({
|
|
245
|
+
hasError: hasError
|
|
246
|
+
});
|
|
247
|
+
var handleOptionChange = function(optionValue) {
|
|
248
|
+
if (allowDeselect && selected.includes(optionValue)) {
|
|
249
|
+
onChange === null || onChange === void 0 ? void 0 : onChange([]);
|
|
250
|
+
} else {
|
|
251
|
+
onChange === null || onChange === void 0 ? void 0 : onChange([
|
|
252
|
+
optionValue
|
|
253
|
+
]);
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", _object_spread_props(_object_spread({
|
|
257
|
+
className: "Litho-RadioButtonCardGroupContainer flex flex-col gap-1"
|
|
258
|
+
}, restProps), {
|
|
259
|
+
children: [
|
|
260
|
+
title && !titleHidden && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Label.default, {
|
|
261
|
+
as: "p",
|
|
262
|
+
tooltip: tooltip,
|
|
263
|
+
children: title
|
|
264
|
+
}),
|
|
265
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
266
|
+
className: containerClasses,
|
|
267
|
+
children: options.map(function(option, index) {
|
|
268
|
+
var isChecked = selected.includes(option.value);
|
|
269
|
+
var isDisabled = disabled || option.disabled;
|
|
270
|
+
var isLast = index === options.length - 1;
|
|
271
|
+
var itemClasses = itemStyles({
|
|
272
|
+
checked: isChecked,
|
|
273
|
+
disabled: isDisabled,
|
|
274
|
+
isLast: isLast,
|
|
275
|
+
radioPosition: radioPosition
|
|
276
|
+
});
|
|
277
|
+
var radioClasses = radioStyles({
|
|
278
|
+
checked: isChecked,
|
|
279
|
+
disabled: isDisabled,
|
|
280
|
+
hasError: hasError
|
|
281
|
+
});
|
|
282
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("label", {
|
|
283
|
+
className: itemClasses,
|
|
284
|
+
onClick: function() {
|
|
285
|
+
if (allowDeselect && isChecked && !isDisabled) {
|
|
286
|
+
onChange === null || onChange === void 0 ? void 0 : onChange([]);
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
children: [
|
|
290
|
+
!hideRadioButton && radioPosition === "left" && /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
291
|
+
className: "Litho-RadioButton__ControlContainer w-5 h-5 flex items-center flex-shrink-0",
|
|
292
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
293
|
+
className: radioClasses,
|
|
294
|
+
children: [
|
|
295
|
+
isChecked && !hasError && /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
296
|
+
className: "rounded-full w-1.5 h-1.5 ".concat(isDisabled ? "bg-form-input-fg-disabled" : "bg-form-input-fg-light")
|
|
297
|
+
}),
|
|
298
|
+
isChecked && hasError && /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
299
|
+
className: "rounded-full w-1.5 h-1.5 ".concat(isDisabled ? "bg-form-input-fg-disabled" : "bg-form-bg")
|
|
300
|
+
})
|
|
301
|
+
]
|
|
302
|
+
})
|
|
303
|
+
}),
|
|
304
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
305
|
+
className: "flex items-center gap-4",
|
|
306
|
+
children: [
|
|
307
|
+
option.icon && /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
308
|
+
className: "flex-shrink-0",
|
|
309
|
+
children: option.icon
|
|
310
|
+
}),
|
|
311
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
312
|
+
children: [
|
|
313
|
+
option.label && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Label.default, {
|
|
314
|
+
tooltip: option.tooltip,
|
|
315
|
+
disabled: isDisabled,
|
|
316
|
+
fontWeight: labelFontWeight,
|
|
317
|
+
as: "p",
|
|
318
|
+
children: option.label
|
|
319
|
+
}),
|
|
320
|
+
option.description && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
|
|
321
|
+
color: isDisabled ? "disabled" : "subdued",
|
|
322
|
+
children: option.description
|
|
323
|
+
}),
|
|
324
|
+
option.helpText && typeof option.helpText === "string" && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
|
|
325
|
+
color: isDisabled ? "disabled" : "subdued",
|
|
326
|
+
variant: "bodySm",
|
|
327
|
+
children: option.helpText
|
|
328
|
+
}),
|
|
329
|
+
option.helpText && typeof option.helpText !== "string" && option.helpText
|
|
330
|
+
]
|
|
331
|
+
})
|
|
332
|
+
]
|
|
333
|
+
}),
|
|
334
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("input", {
|
|
335
|
+
type: "radio",
|
|
336
|
+
name: name,
|
|
337
|
+
value: option.value,
|
|
338
|
+
checked: isChecked,
|
|
339
|
+
disabled: isDisabled,
|
|
340
|
+
onChange: function() {
|
|
341
|
+
return handleOptionChange(option.value);
|
|
342
|
+
},
|
|
343
|
+
className: "sr-only"
|
|
344
|
+
}),
|
|
345
|
+
!hideRadioButton && radioPosition === "right" && /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
346
|
+
className: "Litho-RadioButton__ControlContainer w-5 h-5 flex items-center",
|
|
347
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
348
|
+
className: radioClasses,
|
|
349
|
+
children: [
|
|
350
|
+
isChecked && !hasError && /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
351
|
+
className: "rounded-full w-1.5 h-1.5 ".concat(isDisabled ? "bg-form-input-fg-disabled" : "bg-form-input-fg-light")
|
|
352
|
+
}),
|
|
353
|
+
isChecked && hasError && /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
354
|
+
className: "rounded-full w-1.5 h-1.5 ".concat(isDisabled ? "bg-form-input-fg-disabled" : "bg-form-bg")
|
|
355
|
+
})
|
|
356
|
+
]
|
|
357
|
+
})
|
|
358
|
+
})
|
|
359
|
+
]
|
|
360
|
+
}, option.value);
|
|
361
|
+
})
|
|
362
|
+
}),
|
|
363
|
+
error && /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
364
|
+
className: "flex gap-2 items-center",
|
|
365
|
+
children: [
|
|
366
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Icon.default, {
|
|
367
|
+
source: _polarisicons.CircleAlertMajor,
|
|
368
|
+
color: "critical"
|
|
369
|
+
}),
|
|
370
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
|
|
371
|
+
color: "critical",
|
|
372
|
+
children: error
|
|
373
|
+
})
|
|
374
|
+
]
|
|
375
|
+
})
|
|
376
|
+
]
|
|
377
|
+
}));
|
|
378
|
+
}
|
|
379
|
+
var _default = RadioButtonCardGroup;
|
|
@@ -66,7 +66,39 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
66
66
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
67
67
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
68
68
|
}
|
|
69
|
-
|
|
69
|
+
/**
|
|
70
|
+
* @component RangeSlider
|
|
71
|
+
*
|
|
72
|
+
* @description A slider input for selecting a numeric value within a defined range, with optional label, prefix, suffix, and numeric text field output.
|
|
73
|
+
*
|
|
74
|
+
* @usage
|
|
75
|
+
* - DO: Use for selecting a numeric value within a continuous range (e.g., volume, price, percentage).
|
|
76
|
+
* - DON'T: Use for discrete option selection (use Select or Listbox).
|
|
77
|
+
*
|
|
78
|
+
* @accessibility
|
|
79
|
+
* - Renders a native `<input type="range">` element; ensure a descriptive label is provided via the `label` prop.
|
|
80
|
+
*
|
|
81
|
+
* @alternative
|
|
82
|
+
* - If you need a text-only numeric input, use `TextField` with `type="number"`.
|
|
83
|
+
*
|
|
84
|
+
* @param {Object} props - Component props.
|
|
85
|
+
* @param {string} [props.id] - The ID for the range input element.
|
|
86
|
+
* @param {string} [props.label] - Label displayed above the slider.
|
|
87
|
+
* @param {boolean} [props.labelHidden] - Whether the label is visually hidden.
|
|
88
|
+
* @param {string} [props.labelVariant] - Typography variant for the label.
|
|
89
|
+
* @param {string} [props.tooltip] - Tooltip content for the label.
|
|
90
|
+
* @param {boolean} [props.disabled] - Whether the slider is disabled.
|
|
91
|
+
* @param {number} [props.step=1] - Step increment for the slider.
|
|
92
|
+
* @param {React.ReactNode} [props.prefix] - Content displayed before the slider.
|
|
93
|
+
* @param {string} [props.prefixClasses=""] - Additional CSS classes for the prefix.
|
|
94
|
+
* @param {React.ReactNode} [props.suffix] - Content displayed in the output text field suffix.
|
|
95
|
+
* @param {number} [props.value] - The current value of the slider.
|
|
96
|
+
* @param {number} [props.min=0] - Minimum value of the slider.
|
|
97
|
+
* @param {number} [props.max=100] - Maximum value of the slider.
|
|
98
|
+
* @param {boolean} [props.output=true] - Whether to show the numeric output text field.
|
|
99
|
+
* @param {Function} [props.onChange] - Callback fired when the value changes.
|
|
100
|
+
* @returns {JSX.Element} The rendered RangeSlider component.
|
|
101
|
+
*/ var rangeStyles = (0, _tailwindvariants.tv)({
|
|
70
102
|
base: "Litho-RangeSlider__ActiveRange absolute left-0 top-1/2 -translate-y-1/2 rounded-l-full h-1 pointer-events-none",
|
|
71
103
|
variants: {
|
|
72
104
|
disabled: {
|
|
@@ -102,31 +134,7 @@ function useSyncedState(externalValue) {
|
|
|
102
134
|
setValue
|
|
103
135
|
];
|
|
104
136
|
}
|
|
105
|
-
|
|
106
|
-
* RangeSlider Component
|
|
107
|
-
*
|
|
108
|
-
* A range slider component that allows users to select a numeric value within a defined range.
|
|
109
|
-
*
|
|
110
|
-
* @component
|
|
111
|
-
* @param {Object} props - The properties for the RangeSlider component.
|
|
112
|
-
* @param {string} [props.id] - The unique ID for the slider. If not provided, a UUID will be generated.
|
|
113
|
-
* @param {string} [props.label] - The label text displayed for the slider.
|
|
114
|
-
* @param {boolean} [props.labelHidden=false] - If true, hides the label visually but keeps it accessible for screen readers.
|
|
115
|
-
* @param {string} [props.labelVariant] - Variant of the label style.
|
|
116
|
-
* @param {string} [props.tooltip] - Tooltip text for the label.
|
|
117
|
-
* @param {boolean} [props.disabled=false] - Disables the slider if true.
|
|
118
|
-
* @param {number} [props.step=1] - Step value for the slider increments.
|
|
119
|
-
* @param {string} [props.prefix] - Text to display before the slider input.
|
|
120
|
-
* @param {string} [props.prefixClasses=""] - Additional classes for the prefix text.
|
|
121
|
-
* @param {string} [props.suffix] - Text to display after the slider value input.
|
|
122
|
-
* @param {number} [props.value] - Initial value for the slider. Defaults to the minimum value.
|
|
123
|
-
* @param {number} [props.min=0] - Minimum value of the slider.
|
|
124
|
-
* @param {number} [props.max=100] - Maximum value of the slider.
|
|
125
|
-
* @param {boolean} [props.output=true] - Whether to display an output field for the slider value.
|
|
126
|
-
* @param {function} [props.onChange] - Callback function triggered when the slider value changes.
|
|
127
|
-
*
|
|
128
|
-
* @returns {JSX.Element} The rendered RangeSlider component.
|
|
129
|
-
*/ function RangeSlider() {
|
|
137
|
+
function RangeSlider() {
|
|
130
138
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
131
139
|
var _id = props.id, label = props.label, labelHidden = props.labelHidden, labelVariant = props.labelVariant, tooltip = props.tooltip, disabled = props.disabled, _props_step = props.step, step = _props_step === void 0 ? 1 : _props_step, prefix = props.prefix, _props_prefixClasses = props.prefixClasses, prefixClasses = _props_prefixClasses === void 0 ? "" : _props_prefixClasses, suffix = props.suffix, initialValue = props.value, _props_min = props.min, min = _props_min === void 0 ? 0 : _props_min, _props_max = props.max, max = _props_max === void 0 ? 100 : _props_max, _props_output = props.output, output = _props_output === void 0 ? true : _props_output, onChange = props.onChange;
|
|
132
140
|
var idValue = (0, _react.useId)();
|
|
@@ -17,19 +17,22 @@ function _interop_require_default(obj) {
|
|
|
17
17
|
default: obj
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
var styles = (0, _tailwindvariants.tv)({
|
|
21
|
-
base: "Litho-ResourceList flex flex-col min-w-72",
|
|
22
|
-
variants: {
|
|
23
|
-
divider: {
|
|
24
|
-
true: "divide-y divide-edge-default",
|
|
25
|
-
false: ""
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
20
|
/**
|
|
30
|
-
*
|
|
21
|
+
* @component ResourceList
|
|
22
|
+
*
|
|
23
|
+
* @description A structured list component for displaying collections of similar resources with optional selection, bulk actions, and pagination.
|
|
24
|
+
*
|
|
25
|
+
* @usage
|
|
26
|
+
* - DO: Display collections of similar resources with selection and bulk actions.
|
|
27
|
+
* - DON'T: Use for simple text lists (use List).
|
|
28
|
+
*
|
|
29
|
+
* @accessibility
|
|
30
|
+
* - Supports keyboard selection; ensure each item has a descriptive label for screen readers.
|
|
31
|
+
*
|
|
32
|
+
* @alternative
|
|
33
|
+
* - If you need a data table with sorting and columns, use `Table`.
|
|
34
|
+
* - If you need a simple list, use `List`.
|
|
31
35
|
*
|
|
32
|
-
* @component
|
|
33
36
|
* @param {Object} props - The component props.
|
|
34
37
|
* @param {Array} [props.items=[]] - List of items to display.
|
|
35
38
|
* @param {boolean} [props.loading=false] - Whether the list is in a loading state.
|
|
@@ -41,7 +44,16 @@ var styles = (0, _tailwindvariants.tv)({
|
|
|
41
44
|
* @param {boolean} [props.divider=true] - Whether to show dividers between items.
|
|
42
45
|
* @param {"none"|"small"|"large"} [props.gap="none"] - Gap size between items.
|
|
43
46
|
* @returns {JSX.Element} The rendered component.
|
|
44
|
-
*/
|
|
47
|
+
*/ var styles = (0, _tailwindvariants.tv)({
|
|
48
|
+
base: "Litho-ResourceList flex flex-col min-w-72",
|
|
49
|
+
variants: {
|
|
50
|
+
divider: {
|
|
51
|
+
true: "divide-y divide-edge-default",
|
|
52
|
+
false: ""
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
function ResourceList() {
|
|
45
57
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
46
58
|
var _props_items = props.items, items = _props_items === void 0 ? [] : _props_items, _props_loading = props.loading, loading = _props_loading === void 0 ? false : _props_loading, _props_emptyState = props.emptyState, emptyState = _props_emptyState === void 0 ? "No results found." : _props_emptyState, renderItem = props.renderItem, _props_resourceName = props.resourceName, resourceName = _props_resourceName === void 0 ? {
|
|
47
59
|
singular: "item",
|
|
@@ -80,9 +92,11 @@ var itemStyles = (0, _tailwindvariants.tv)({
|
|
|
80
92
|
}
|
|
81
93
|
});
|
|
82
94
|
/**
|
|
83
|
-
*
|
|
95
|
+
* @component ResourceList.Item
|
|
96
|
+
*
|
|
97
|
+
* @usage
|
|
98
|
+
* - DO: Use as direct children of ResourceList for each resource entry.
|
|
84
99
|
*
|
|
85
|
-
* @component
|
|
86
100
|
* @param {Object} props - The component props.
|
|
87
101
|
* @param {string} [props.id] - The ID of the item.
|
|
88
102
|
* @param {string} [props.accessibilityLabel] - Accessibility label for the item.
|
|
@@ -68,7 +68,43 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
68
68
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
69
69
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
/**
|
|
72
|
+
* @component Select
|
|
73
|
+
*
|
|
74
|
+
* @description A dropdown select input that renders native HTML select with label, help text, and error state support.
|
|
75
|
+
*
|
|
76
|
+
* @usage
|
|
77
|
+
* - DO: Use for choosing one option from a predefined list.
|
|
78
|
+
* - DON'T: Use when the list is very long or needs filtering (use Autocomplete).
|
|
79
|
+
*
|
|
80
|
+
* @accessibility
|
|
81
|
+
* - Renders a native `<select>` element with full keyboard and screen reader support. Always provide a `label`.
|
|
82
|
+
*
|
|
83
|
+
* @alternative
|
|
84
|
+
* - If you need searchable/filterable selection, use `Autocomplete`. If you need multi-select, use `ChoiceList`.
|
|
85
|
+
*
|
|
86
|
+
* @param {Object} props - The properties for the Select component.
|
|
87
|
+
* @param {Array} props.options - Array of option objects for the select dropdown. Options can include groups.
|
|
88
|
+
* @param {string} [props.label] - Label for the select input.
|
|
89
|
+
* @param {Object} [props.labelAction] - An action object for the label. Includes `onAction` and `content`.
|
|
90
|
+
* @param {boolean} [props.labelHidden] - Whether to hide the label visually.
|
|
91
|
+
* @param {boolean} [props.labelInline] - Whether to display the label inline with the select.
|
|
92
|
+
* @param {boolean} [props.disabled=false] - Whether the select is disabled.
|
|
93
|
+
* @param {string} [props.helpText] - Optional help text displayed below the select.
|
|
94
|
+
* @param {string} [props.placeholder] - Placeholder text for the select input.
|
|
95
|
+
* @param {string} props.id - The ID for the select input.
|
|
96
|
+
* @param {string} props.name - The name for the select input.
|
|
97
|
+
* @param {string} props.value - The selected value.
|
|
98
|
+
* @param {React.ReactNode|import("./Tooltip").TooltipContentObject} props.tooltip - Tooltip content for the select.
|
|
99
|
+
* @param {string|boolean} [props.error] - Error message or flag indicating the select has an error.
|
|
100
|
+
* @param {function} props.onChange - Callback for when the selected value changes.
|
|
101
|
+
* @param {function} props.onFocus - Callback for when the select gains focus.
|
|
102
|
+
* @param {function} props.onBlur - Callback for when the select loses focus.
|
|
103
|
+
* @param {boolean} [props.requiredIndicator] - Whether to show a required indicator next to the label.
|
|
104
|
+
* @param {string} [props.className] - Additional CSS classes to apply to the select container.
|
|
105
|
+
* @param {string} [props.contentClassName] - Additional CSS classes to apply to the select content area.
|
|
106
|
+
* @returns {JSX.Element} The rendered Select component.
|
|
107
|
+
*/ var styles = (0, _tailwindvariants.tv)({
|
|
72
108
|
base: "Litho-Select relative border border-form-border rounded-md",
|
|
73
109
|
variants: {
|
|
74
110
|
disabled: {
|
|
@@ -116,31 +152,7 @@ var styles = (0, _tailwindvariants.tv)({
|
|
|
116
152
|
var contentStyles = (0, _tailwindvariants.tv)({
|
|
117
153
|
base: "Litho-Select__Content min-h-7.5 pl-3 pr-2 flex items-center justify-between gap-2"
|
|
118
154
|
});
|
|
119
|
-
|
|
120
|
-
* @function Select
|
|
121
|
-
* @description A dropdown component that allows users to select an option from a list.
|
|
122
|
-
* @param {Object} props - The properties for the Select component.
|
|
123
|
-
* @param {Array} props.options - Array of option objects for the select dropdown. Options can include groups.
|
|
124
|
-
* @param {string} [props.label] - Label for the select input.
|
|
125
|
-
* @param {Object} [props.labelAction] - An action object for the label. Includes `onAction` and `content`.
|
|
126
|
-
* @param {boolean} [props.labelHidden] - Whether to hide the label visually.
|
|
127
|
-
* @param {boolean} [props.labelInline] - Whether to display the label inline with the select.
|
|
128
|
-
* @param {boolean} [props.disabled=false] - Whether the select is disabled.
|
|
129
|
-
* @param {string} [props.helpText] - Optional help text displayed below the select.
|
|
130
|
-
* @param {string} [props.placeholder] - Placeholder text for the select input.
|
|
131
|
-
* @param {string} props.id - The ID for the select input.
|
|
132
|
-
* @param {string} props.name - The name for the select input.
|
|
133
|
-
* @param {string} props.value - The selected value.
|
|
134
|
-
* @param {React.ReactNode|import("./Tooltip").TooltipContentObject} props.tooltip - Tooltip content for the select.
|
|
135
|
-
* @param {string|boolean} [props.error] - Error message or flag indicating the select has an error.
|
|
136
|
-
* @param {function} props.onChange - Callback for when the selected value changes.
|
|
137
|
-
* @param {function} props.onFocus - Callback for when the select gains focus.
|
|
138
|
-
* @param {function} props.onBlur - Callback for when the select loses focus.
|
|
139
|
-
* @param {boolean} [props.requiredIndicator] - Whether to show a required indicator next to the label.
|
|
140
|
-
* @param {string} [props.className] - Additional CSS classes to apply to the select container.
|
|
141
|
-
* @param {string} [props.contentClassName] - Additional CSS classes to apply to the select content area.
|
|
142
|
-
* @returns {JSX.Element} The rendered Select component.
|
|
143
|
-
*/ function Select() {
|
|
155
|
+
function Select() {
|
|
144
156
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
145
157
|
var options = props.options, label = props.label, tooltip = props.tooltip, labelAction = props.labelAction, labelHidden = props.labelHidden, labelInline = props.labelInline, _props_disabled = props.disabled, disabled = _props_disabled === void 0 ? false : _props_disabled, helpText = props.helpText, placeholder = props.placeholder, id = props.id, name = props.name, value = props.value, error = props.error, onChange = props.onChange, onFocus = props.onFocus, onBlur = props.onBlur, requiredIndicator = props.requiredIndicator, className = props.className, contentClassName = props.contentClassName;
|
|
146
158
|
var _useState = _sliced_to_array((0, _react.useState)(false), 2), focused = _useState[0], setFocused = _useState[1];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";
|
|
2
3
|
Object.defineProperty(exports, "__esModule", {
|
|
3
4
|
value: true
|
|
@@ -11,7 +12,37 @@ Object.defineProperty(exports, "default", {
|
|
|
11
12
|
var _jsxruntime = require("react/jsx-runtime");
|
|
12
13
|
var _tailwindvariants = require("tailwind-variants");
|
|
13
14
|
var _react = require("react");
|
|
14
|
-
|
|
15
|
+
/**
|
|
16
|
+
* @component SkeletonText
|
|
17
|
+
*
|
|
18
|
+
* @description A placeholder component that renders animated skeleton lines to represent loading text content.
|
|
19
|
+
*
|
|
20
|
+
* @usage
|
|
21
|
+
* - DO: Use as a content placeholder while text data is loading, matching the expected layout with `lines` and `type`.
|
|
22
|
+
* - DON'T: Use for non-text placeholders like images or charts; build custom skeleton layouts for those.
|
|
23
|
+
*
|
|
24
|
+
* @accessibility
|
|
25
|
+
* - Skeleton content is decorative; ensure the parent loading region has `aria-busy="true"`.
|
|
26
|
+
* - Do not use skeleton text as a replacement for meaningful content once data is available.
|
|
27
|
+
*
|
|
28
|
+
* @alternative
|
|
29
|
+
* - If you need a spinning indicator rather than a content placeholder, use `Spinner` instead.
|
|
30
|
+
* - If you need a page-level loading bar, use `Loading` instead.
|
|
31
|
+
*
|
|
32
|
+
* @param {Object} props - The component properties.
|
|
33
|
+
* @param {number} [props.lines=3] - The number of lines to render. Defaults to 3 for body text.
|
|
34
|
+
* @param {"body"|"heading"} [props.type="body"] - The type of skeleton text
|
|
35
|
+
* @param {"xs"|"sm"|"md"|"lg"|"xl"} [props.size="md"] - The size of the skeleton text
|
|
36
|
+
* @param {number} [props.width] - The width of the skeleton text lines. If not provided, random widths are generated.
|
|
37
|
+
* @param {boolean} [props.fullWidth=false] - Whether the skeleton text lines should be full width.
|
|
38
|
+
* @param {"start"|"center"|"end"} [props.align="start"] - The alignment of the skeleton text lines.
|
|
39
|
+
* @param {string} [props.className] - Additional class names to apply to the root element.
|
|
40
|
+
*
|
|
41
|
+
* @returns {JSX.Element} A JSX element rendering a skeleton placeholder text block.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* <SkeletonText lines={5} type="heading" size="lg" width={80} className="custom-class" />
|
|
45
|
+
*/ var styles = (0, _tailwindvariants.tv)({
|
|
15
46
|
base: "Litho-SkeletonText flex flex-col",
|
|
16
47
|
variants: {
|
|
17
48
|
gap: {
|
|
@@ -71,23 +102,7 @@ var lineStyles = (0, _tailwindvariants.tv)({
|
|
|
71
102
|
}
|
|
72
103
|
]
|
|
73
104
|
});
|
|
74
|
-
|
|
75
|
-
* SkeletonText component for displaying placeholder text content.
|
|
76
|
-
*
|
|
77
|
-
* @param {Object} props - The component properties.
|
|
78
|
-
* @param {number} [props.lines=3] - The number of lines to render. Defaults to 3 for body text.
|
|
79
|
-
* @param {"body"|"heading"} [props.type="body"] - The type of skeleton text
|
|
80
|
-
* @param {"xs"|"sm"|"md"|"lg"|"xl"} [props.size="md"] - The size of the skeleton text
|
|
81
|
-
* @param {number} [props.width] - The width of the skeleton text lines. If not provided, random widths are generated.
|
|
82
|
-
* @param {boolean} [props.fullWidth=false] - Whether the skeleton text lines should be full width.
|
|
83
|
-
* @param {"start"|"center"|"end"} [props.align="start"] - The alignment of the skeleton text lines.
|
|
84
|
-
* @param {string} [props.className] - Additional class names to apply to the root element.
|
|
85
|
-
*
|
|
86
|
-
* @returns {JSX.Element} A JSX element rendering a skeleton placeholder text block.
|
|
87
|
-
*
|
|
88
|
-
* @example
|
|
89
|
-
* <SkeletonText lines={5} type="heading" size="lg" width={80} className="custom-class" />
|
|
90
|
-
*/ function SkeletonText() {
|
|
105
|
+
function SkeletonText() {
|
|
91
106
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
92
107
|
var tmp = props.lines, _lines = tmp === void 0 ? 3 : tmp, _props_type = props.type, type = _props_type === void 0 ? "body" : _props_type, _props_size = props.size, size = _props_size === void 0 ? "md" : _props_size, _width = props.width, _props_fullWidth = props.fullWidth, fullWidth = _props_fullWidth === void 0 ? false : _props_fullWidth, className = props.className, _props_gap = props.gap, gap = _props_gap === void 0 ? "medium" : _props_gap, _props_align = props.align, align = _props_align === void 0 ? "start" : _props_align;
|
|
93
108
|
var lines = type === "heading" ? 1 : _lines;
|