@heymantle/litho 0.0.3 → 0.0.4
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/dist/cjs/components/ActionList.js +50 -16
- package/dist/cjs/components/AnnouncementBar.js +10 -3
- package/dist/cjs/components/AppProvider.js +10 -1
- package/dist/cjs/components/Autocomplete.js +33 -11
- package/dist/cjs/components/Badge.js +2 -1
- package/dist/cjs/components/Banner.js +35 -31
- package/dist/cjs/components/Box.js +5 -3
- package/dist/cjs/components/Button.js +34 -12
- package/dist/cjs/components/Card.js +5 -45
- package/dist/cjs/components/Checkbox.js +16 -6
- package/dist/cjs/components/ChoiceList.js +7 -4
- package/dist/cjs/components/ColorField.js +8 -3
- package/dist/cjs/components/DatePicker.js +13 -8
- package/dist/cjs/components/DropZone.js +33 -18
- package/dist/cjs/components/EmptyState.js +15 -7
- package/dist/cjs/components/Filters.js +32 -20
- package/dist/cjs/components/FooterHelp.js +7 -2
- package/dist/cjs/components/Form.js +18 -3
- package/dist/cjs/components/Frame.js +40 -15
- package/dist/cjs/components/FrameSaveBar.js +21 -12
- package/dist/cjs/components/Layout.js +3 -3
- package/dist/cjs/components/LayoutSection.js +2 -2
- package/dist/cjs/components/Link.js +6 -2
- package/dist/cjs/components/List.js +1 -0
- package/dist/cjs/components/Listbox.js +9 -4
- package/dist/cjs/components/Modal.js +26 -17
- package/dist/cjs/components/Navigation.js +30 -20
- package/dist/cjs/components/Page.js +8 -3
- package/dist/cjs/components/Pagination.js +11 -4
- package/dist/cjs/components/Pane.js +118 -35
- package/dist/cjs/components/Popover.js +59 -6
- package/dist/cjs/components/RangeSlider.js +11 -4
- package/dist/cjs/components/ResourceList.js +9 -3
- package/dist/cjs/components/Select.js +2 -0
- package/dist/cjs/components/Table.js +32 -19
- package/dist/cjs/components/Text.js +8 -5
- package/dist/cjs/components/TextField.js +23 -13
- package/dist/cjs/components/Thumbnail.js +7 -2
- package/dist/cjs/components/TimePicker.js +7 -2
- package/dist/cjs/components/Tip.js +10 -4
- package/dist/cjs/components/Tooltip.js +16 -8
- package/dist/cjs/components/TopBar.js +17 -9
- package/dist/cjs/dev/verify-publish.js +37 -4
- package/dist/cjs/postcss.config.js +21 -0
- package/dist/cjs/stories/ActionList.stories.js +365 -0
- package/dist/cjs/stories/AnnouncementBar.stories.js +244 -0
- package/dist/cjs/stories/Autocomplete.stories.js +871 -0
- package/dist/cjs/stories/Badge.stories.js +183 -0
- package/dist/cjs/stories/Banner.stories.js +201 -0
- package/dist/cjs/stories/Box.stories.js +599 -0
- package/dist/cjs/stories/Button.stories.js +325 -0
- package/dist/cjs/stories/ButtonGroup.stories.js +404 -0
- package/dist/cjs/stories/Card.stories.js +278 -0
- package/dist/cjs/stories/Checkbox.stories.js +266 -0
- package/dist/cjs/stories/ChoiceList.stories.js +884 -0
- package/dist/cjs/stories/Collapsible.stories.js +905 -0
- package/dist/cjs/stories/ColorField.stories.js +883 -0
- package/dist/cjs/stories/ContextualSaveBar.stories.js +970 -0
- package/dist/cjs/stories/DatePicker.stories.js +584 -0
- package/dist/cjs/stories/Divider.stories.js +759 -0
- package/dist/cjs/stories/DropZone.stories.js +1205 -0
- package/dist/cjs/stories/EmptyState.stories.js +296 -0
- package/dist/cjs/stories/Filters.stories.js +1353 -0
- package/dist/cjs/stories/FooterHelp.stories.js +869 -0
- package/dist/cjs/stories/Form.stories.js +940 -0
- package/dist/cjs/stories/Grid.stories.js +1199 -0
- package/dist/cjs/stories/HorizontalStack.stories.js +1064 -0
- package/dist/cjs/stories/Icon.stories.js +596 -0
- package/dist/cjs/stories/Image.stories.js +883 -0
- package/dist/cjs/stories/InlineError.stories.js +710 -0
- package/dist/cjs/stories/Label.stories.js +665 -0
- package/dist/cjs/stories/Layout.stories.js +685 -0
- package/dist/cjs/stories/LayoutSection.stories.js +1267 -0
- package/dist/cjs/stories/Link.stories.js +423 -0
- package/dist/cjs/stories/List.stories.js +1031 -0
- package/dist/cjs/stories/Listbox.stories.js +820 -0
- package/dist/cjs/stories/Loading.stories.js +900 -0
- package/dist/cjs/stories/Modal.stories.js +363 -0
- package/dist/cjs/stories/Navigation.stories.js +605 -0
- package/dist/cjs/stories/Page.stories.js +318 -0
- package/dist/cjs/stories/Pagination.stories.js +438 -0
- package/dist/cjs/stories/Pane.stories.js +1535 -0
- package/dist/cjs/stories/Popover.stories.js +637 -0
- package/dist/cjs/stories/PopoverManager.stories.js +1225 -0
- package/dist/cjs/stories/ProgressBar.stories.js +506 -0
- package/dist/cjs/stories/RadioButton.stories.js +642 -0
- package/dist/cjs/stories/RadioButtonCard.stories.js +816 -0
- package/dist/cjs/stories/RangeSlider.stories.js +892 -0
- package/dist/cjs/stories/ResourceList.stories.js +1067 -0
- package/dist/cjs/stories/Select.stories.js +413 -0
- package/dist/cjs/stories/SkeletonText.stories.js +776 -0
- package/dist/cjs/stories/Spinner.stories.js +396 -0
- package/dist/cjs/stories/Table.stories.js +628 -0
- package/dist/cjs/stories/Tabs.stories.js +723 -0
- package/dist/cjs/stories/Tag.stories.js +620 -0
- package/dist/cjs/stories/Text.stories.js +262 -0
- package/dist/cjs/stories/TextField.stories.js +377 -0
- package/dist/cjs/stories/Thumbnail.stories.js +859 -0
- package/dist/cjs/stories/TimePicker.stories.js +966 -0
- package/dist/cjs/stories/Tip.stories.js +753 -0
- package/dist/cjs/stories/Tooltip.stories.js +357 -0
- package/dist/cjs/stories/TopBar.stories.js +155 -0
- package/dist/cjs/stories/VerticalStack.stories.js +1287 -0
- package/dist/cjs/tailwind.config.js +17 -0
- package/dist/cjs/utilities/transformers.js +66 -0
- package/dist/cjs/vite.config.js +35 -0
- package/dist/esm/components/ActionList.js +41 -12
- package/dist/esm/components/AnnouncementBar.js +3 -1
- package/dist/esm/components/AppProvider.js +10 -1
- package/dist/esm/components/Autocomplete.js +21 -4
- package/dist/esm/components/Badge.js +2 -2
- package/dist/esm/components/Banner.js +20 -21
- package/dist/esm/components/Box.js +5 -4
- package/dist/esm/components/Button.js +24 -7
- package/dist/esm/components/Card.js +5 -4
- package/dist/esm/components/Checkbox.js +6 -1
- package/dist/esm/components/ChoiceList.js +7 -4
- package/dist/esm/components/ColorField.js +1 -1
- package/dist/esm/components/DatePicker.js +6 -1
- package/dist/esm/components/DropZone.js +14 -4
- package/dist/esm/components/EmptyState.js +4 -1
- package/dist/esm/components/Filters.js +10 -3
- package/dist/esm/components/FooterHelp.js +1 -1
- package/dist/esm/components/Form.js +18 -3
- package/dist/esm/components/Frame.js +18 -6
- package/dist/esm/components/FrameSaveBar.js +10 -6
- package/dist/esm/components/InlineError.js +1 -1
- package/dist/esm/components/Layout.js +4 -4
- package/dist/esm/components/LayoutSection.js +2 -2
- package/dist/esm/components/Link.js +6 -2
- package/dist/esm/components/List.js +1 -0
- package/dist/esm/components/Listbox.js +4 -4
- package/dist/esm/components/Modal.js +8 -4
- package/dist/esm/components/Navigation.js +16 -11
- package/dist/esm/components/Page.js +9 -4
- package/dist/esm/components/Pagination.js +3 -1
- package/dist/esm/components/Pane.js +114 -36
- package/dist/esm/components/Popover.js +18 -6
- package/dist/esm/components/RangeSlider.js +3 -1
- package/dist/esm/components/ResourceList.js +2 -1
- package/dist/esm/components/Select.js +2 -0
- package/dist/esm/components/Table.js +16 -3
- package/dist/esm/components/Text.js +8 -6
- package/dist/esm/components/TextField.js +6 -1
- package/dist/esm/components/Thumbnail.js +1 -1
- package/dist/esm/components/TimePicker.js +1 -1
- package/dist/esm/components/Tip.js +3 -2
- package/dist/esm/components/Tooltip.js +4 -1
- package/dist/esm/components/TopBar.js +7 -4
- package/dist/esm/dev/verify-publish.js +37 -4
- package/dist/esm/postcss.config.js +6 -0
- package/dist/esm/stories/ActionList.stories.js +327 -0
- package/dist/esm/stories/AnnouncementBar.stories.js +212 -0
- package/dist/esm/stories/Autocomplete.stories.js +833 -0
- package/dist/esm/stories/Badge.stories.js +138 -0
- package/dist/esm/stories/Banner.stories.js +159 -0
- package/dist/esm/stories/Box.stories.js +558 -0
- package/dist/esm/stories/Button.stories.js +277 -0
- package/dist/esm/stories/ButtonGroup.stories.js +357 -0
- package/dist/esm/stories/Card.stories.js +240 -0
- package/dist/esm/stories/Checkbox.stories.js +219 -0
- package/dist/esm/stories/ChoiceList.stories.js +834 -0
- package/dist/esm/stories/Collapsible.stories.js +867 -0
- package/dist/esm/stories/ColorField.stories.js +842 -0
- package/dist/esm/stories/ContextualSaveBar.stories.js +938 -0
- package/dist/esm/stories/DatePicker.stories.js +537 -0
- package/dist/esm/stories/Divider.stories.js +715 -0
- package/dist/esm/stories/DropZone.stories.js +1161 -0
- package/dist/esm/stories/EmptyState.stories.js +246 -0
- package/dist/esm/stories/Filters.stories.js +1315 -0
- package/dist/esm/stories/FooterHelp.stories.js +813 -0
- package/dist/esm/stories/Form.stories.js +905 -0
- package/dist/esm/stories/Grid.stories.js +1152 -0
- package/dist/esm/stories/HorizontalStack.stories.js +1011 -0
- package/dist/esm/stories/Icon.stories.js +555 -0
- package/dist/esm/stories/Image.stories.js +836 -0
- package/dist/esm/stories/InlineError.stories.js +666 -0
- package/dist/esm/stories/Label.stories.js +612 -0
- package/dist/esm/stories/Layout.stories.js +647 -0
- package/dist/esm/stories/LayoutSection.stories.js +1226 -0
- package/dist/esm/stories/Link.stories.js +379 -0
- package/dist/esm/stories/List.stories.js +975 -0
- package/dist/esm/stories/Listbox.stories.js +776 -0
- package/dist/esm/stories/Loading.stories.js +850 -0
- package/dist/esm/stories/Modal.stories.js +322 -0
- package/dist/esm/stories/Navigation.stories.js +567 -0
- package/dist/esm/stories/Page.stories.js +276 -0
- package/dist/esm/stories/Pagination.stories.js +394 -0
- package/dist/esm/stories/Pane.stories.js +1497 -0
- package/dist/esm/stories/Popover.stories.js +605 -0
- package/dist/esm/stories/PopoverManager.stories.js +1193 -0
- package/dist/esm/stories/ProgressBar.stories.js +465 -0
- package/dist/esm/stories/RadioButton.stories.js +598 -0
- package/dist/esm/stories/RadioButtonCard.stories.js +772 -0
- package/dist/esm/stories/RangeSlider.stories.js +845 -0
- package/dist/esm/stories/ResourceList.stories.js +1029 -0
- package/dist/esm/stories/Select.stories.js +363 -0
- package/dist/esm/stories/SkeletonText.stories.js +717 -0
- package/dist/esm/stories/Spinner.stories.js +355 -0
- package/dist/esm/stories/Table.stories.js +584 -0
- package/dist/esm/stories/Tabs.stories.js +685 -0
- package/dist/esm/stories/Tag.stories.js +573 -0
- package/dist/esm/stories/Text.stories.js +217 -0
- package/dist/esm/stories/TextField.stories.js +332 -0
- package/dist/esm/stories/Thumbnail.stories.js +806 -0
- package/dist/esm/stories/TimePicker.stories.js +910 -0
- package/dist/esm/stories/Tip.stories.js +706 -0
- package/dist/esm/stories/Tooltip.stories.js +313 -0
- package/dist/esm/stories/TopBar.stories.js +114 -0
- package/dist/esm/stories/VerticalStack.stories.js +1240 -0
- package/dist/esm/tailwind.config.js +7 -0
- package/dist/esm/utilities/transformers.js +47 -0
- package/dist/esm/vite.config.js +20 -0
- package/dist/types/components/ActionList.d.ts +122 -0
- package/dist/types/components/ActionList.d.ts.map +1 -0
- package/dist/types/components/AnnouncementBar.d.ts +21 -0
- package/dist/types/components/AnnouncementBar.d.ts.map +1 -0
- package/dist/types/components/AppProvider.d.ts +61 -0
- package/dist/types/components/AppProvider.d.ts.map +1 -0
- package/dist/types/components/Autocomplete.d.ts +130 -0
- package/dist/types/components/Autocomplete.d.ts.map +1 -0
- package/dist/types/components/Badge.d.ts +21 -0
- package/dist/types/components/Badge.d.ts.map +1 -0
- package/dist/types/components/Banner.d.ts +78 -0
- package/dist/types/components/Banner.d.ts.map +1 -0
- package/dist/types/components/Box.d.ts +70 -0
- package/dist/types/components/Box.d.ts.map +1 -0
- package/dist/types/components/Button.d.ts +123 -0
- package/dist/types/components/Button.d.ts.map +1 -0
- package/dist/types/components/ButtonGroup.d.ts +26 -0
- package/dist/types/components/ButtonGroup.d.ts.map +1 -0
- package/dist/types/components/Card.d.ts +139 -0
- package/dist/types/components/Card.d.ts.map +1 -0
- package/dist/types/components/Checkbox.d.ts +56 -0
- package/dist/types/components/Checkbox.d.ts.map +1 -0
- package/dist/types/components/ChoiceList.d.ts +69 -0
- package/dist/types/components/ChoiceList.d.ts.map +1 -0
- package/dist/types/components/Collapsible.d.ts +17 -0
- package/dist/types/components/Collapsible.d.ts.map +1 -0
- package/dist/types/components/ColorField.d.ts +36 -0
- package/dist/types/components/ColorField.d.ts.map +1 -0
- package/dist/types/components/ContextualSaveBar.d.ts +22 -0
- package/dist/types/components/ContextualSaveBar.d.ts.map +1 -0
- package/dist/types/components/DatePicker.d.ts +66 -0
- package/dist/types/components/DatePicker.d.ts.map +1 -0
- package/dist/types/components/Divider.d.ts +21 -0
- package/dist/types/components/Divider.d.ts.map +1 -0
- package/dist/types/components/DropZone.d.ts +108 -0
- package/dist/types/components/DropZone.d.ts.map +1 -0
- package/dist/types/components/EmptyState.d.ts +52 -0
- package/dist/types/components/EmptyState.d.ts.map +1 -0
- package/dist/types/components/Filters.d.ts +166 -0
- package/dist/types/components/Filters.d.ts.map +1 -0
- package/dist/types/components/FooterHelp.d.ts +21 -0
- package/dist/types/components/FooterHelp.d.ts.map +1 -0
- package/dist/types/components/Form.d.ts +39 -0
- package/dist/types/components/Form.d.ts.map +1 -0
- package/dist/types/components/Frame.d.ts +51 -0
- package/dist/types/components/Frame.d.ts.map +1 -0
- package/dist/types/components/FrameSaveBar.d.ts +8 -0
- package/dist/types/components/FrameSaveBar.d.ts.map +1 -0
- package/dist/types/components/Grid.d.ts +39 -0
- package/dist/types/components/Grid.d.ts.map +1 -0
- package/dist/types/components/HorizontalStack.d.ts +36 -0
- package/dist/types/components/HorizontalStack.d.ts.map +1 -0
- package/dist/types/components/Icon.d.ts +43 -0
- package/dist/types/components/Icon.d.ts.map +1 -0
- package/dist/types/components/Image.d.ts +45 -0
- package/dist/types/components/Image.d.ts.map +1 -0
- package/dist/types/components/InlineError.d.ts +22 -0
- package/dist/types/components/InlineError.d.ts.map +1 -0
- package/dist/types/components/Label.d.ts +28 -0
- package/dist/types/components/Label.d.ts.map +1 -0
- package/dist/types/components/Layout.d.ts +44 -0
- package/dist/types/components/Layout.d.ts.map +1 -0
- package/dist/types/components/LayoutSection.d.ts +24 -0
- package/dist/types/components/LayoutSection.d.ts.map +1 -0
- package/dist/types/components/Link.d.ts +38 -0
- package/dist/types/components/Link.d.ts.map +1 -0
- package/dist/types/components/List.d.ts +33 -0
- package/dist/types/components/List.d.ts.map +1 -0
- package/dist/types/components/Listbox.d.ts +34 -0
- package/dist/types/components/Listbox.d.ts.map +1 -0
- package/dist/types/components/Loading.d.ts +13 -0
- package/dist/types/components/Loading.d.ts.map +1 -0
- package/dist/types/components/Modal.d.ts +75 -0
- package/dist/types/components/Modal.d.ts.map +1 -0
- package/dist/types/components/Navigation.d.ts +105 -0
- package/dist/types/components/Navigation.d.ts.map +1 -0
- package/dist/types/components/Page.d.ts +59 -0
- package/dist/types/components/Page.d.ts.map +1 -0
- package/dist/types/components/Pagination.d.ts +39 -0
- package/dist/types/components/Pagination.d.ts.map +1 -0
- package/dist/types/components/Pane.d.ts +11 -0
- package/dist/types/components/Pane.d.ts.map +1 -0
- package/dist/types/components/Popover.d.ts +56 -0
- package/dist/types/components/Popover.d.ts.map +1 -0
- package/dist/types/components/PopoverManager.d.ts +3 -0
- package/dist/types/components/PopoverManager.d.ts.map +1 -0
- package/dist/types/components/ProgressBar.d.ts +24 -0
- package/dist/types/components/ProgressBar.d.ts.map +1 -0
- package/dist/types/components/RadioButton.d.ts +39 -0
- package/dist/types/components/RadioButton.d.ts.map +1 -0
- package/dist/types/components/RadioButtonCard.d.ts +41 -0
- package/dist/types/components/RadioButtonCard.d.ts.map +1 -0
- package/dist/types/components/RangeSlider.d.ts +44 -0
- package/dist/types/components/RangeSlider.d.ts.map +1 -0
- package/dist/types/components/ResourceList.d.ts +54 -0
- package/dist/types/components/ResourceList.d.ts.map +1 -0
- package/dist/types/components/Select.d.ts +48 -0
- package/dist/types/components/Select.d.ts.map +1 -0
- package/dist/types/components/SkeletonText.d.ts +28 -0
- package/dist/types/components/SkeletonText.d.ts.map +1 -0
- package/dist/types/components/Spinner.d.ts +18 -0
- package/dist/types/components/Spinner.d.ts.map +1 -0
- package/dist/types/components/Table.d.ts +197 -0
- package/dist/types/components/Table.d.ts.map +1 -0
- package/dist/types/components/Tabs.d.ts +41 -0
- package/dist/types/components/Tabs.d.ts.map +1 -0
- package/dist/types/components/Tag.d.ts +26 -0
- package/dist/types/components/Tag.d.ts.map +1 -0
- package/dist/types/components/Text.d.ts +32 -0
- package/dist/types/components/Text.d.ts.map +1 -0
- package/dist/types/components/TextField.d.ts +109 -0
- package/dist/types/components/TextField.d.ts.map +1 -0
- package/dist/types/components/Thumbnail.d.ts +18 -0
- package/dist/types/components/Thumbnail.d.ts.map +1 -0
- package/dist/types/components/TimePicker.d.ts +3 -0
- package/dist/types/components/TimePicker.d.ts.map +1 -0
- package/dist/types/components/Tip.d.ts +23 -0
- package/dist/types/components/Tip.d.ts.map +1 -0
- package/dist/types/components/Tooltip.d.ts +84 -0
- package/dist/types/components/Tooltip.d.ts.map +1 -0
- package/dist/types/components/TopBar.d.ts +43 -0
- package/dist/types/components/TopBar.d.ts.map +1 -0
- package/dist/types/components/VerticalStack.d.ts +27 -0
- package/dist/types/components/VerticalStack.d.ts.map +1 -0
- package/dist/types/index.d.ts +62 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/styles/Table.d.ts +1570 -0
- package/dist/types/styles/Table.d.ts.map +1 -0
- package/dist/types/utilities/dates.d.ts +46 -0
- package/dist/types/utilities/dates.d.ts.map +1 -0
- package/dist/types/utilities/transformers.d.ts +4 -0
- package/dist/types/utilities/transformers.d.ts.map +1 -0
- package/dist/types/utilities/useIndexResourceState.d.ts +21 -0
- package/dist/types/utilities/useIndexResourceState.d.ts.map +1 -0
- package/dist/types/utilities/useMounted.d.ts +2 -0
- package/dist/types/utilities/useMounted.d.ts.map +1 -0
- package/dist/types/utilities/useTableScrollState.d.ts +29 -0
- package/dist/types/utilities/useTableScrollState.d.ts.map +1 -0
- package/index.css +6 -0
- package/package.json +37 -6
|
@@ -13,7 +13,11 @@ var _jsxruntime = require("react/jsx-runtime");
|
|
|
13
13
|
var _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
14
14
|
var _tailwindvariants = require("tailwind-variants");
|
|
15
15
|
var _ButtonGroup = require("./ButtonGroup");
|
|
16
|
-
var
|
|
16
|
+
var _ActionList = /*#__PURE__*/ _interop_require_default(require("./ActionList"));
|
|
17
|
+
var _Icon = /*#__PURE__*/ _interop_require_default(require("./Icon"));
|
|
18
|
+
var _Popover = /*#__PURE__*/ _interop_require_default(require("./Popover"));
|
|
19
|
+
var _Spinner = /*#__PURE__*/ _interop_require_default(require("./Spinner"));
|
|
20
|
+
var _Tooltip = /*#__PURE__*/ _interop_require_default(require("./Tooltip"));
|
|
17
21
|
var _polarisicons = require("@shopify/polaris-icons");
|
|
18
22
|
var _AppProvider = require("./AppProvider");
|
|
19
23
|
function _array_like_to_array(arr, len) {
|
|
@@ -37,6 +41,11 @@ function _define_property(obj, key, value) {
|
|
|
37
41
|
}
|
|
38
42
|
return obj;
|
|
39
43
|
}
|
|
44
|
+
function _interop_require_default(obj) {
|
|
45
|
+
return obj && obj.__esModule ? obj : {
|
|
46
|
+
default: obj
|
|
47
|
+
};
|
|
48
|
+
}
|
|
40
49
|
function _getRequireWildcardCache(nodeInterop) {
|
|
41
50
|
if (typeof WeakMap !== "function") return null;
|
|
42
51
|
var cacheBabelInterop = new WeakMap();
|
|
@@ -224,6 +233,7 @@ var styles = (0, _tailwindvariants.tv)({
|
|
|
224
233
|
},
|
|
225
234
|
size: {
|
|
226
235
|
stepper: "min-h-3.5 rounded-sm",
|
|
236
|
+
mini: "min-h-5 min-w-5",
|
|
227
237
|
small: "min-h-7 min-w-7",
|
|
228
238
|
medium: "min-h-8",
|
|
229
239
|
large: "min-h-8"
|
|
@@ -496,12 +506,18 @@ var contentStyles = (0, _tailwindvariants.tv)({
|
|
|
496
506
|
false: ""
|
|
497
507
|
},
|
|
498
508
|
size: {
|
|
509
|
+
mini: "p-0",
|
|
499
510
|
small: "py-0.5",
|
|
500
511
|
large: "py-3",
|
|
501
512
|
medium: "py-1"
|
|
502
513
|
}
|
|
503
514
|
},
|
|
504
515
|
compoundVariants: [
|
|
516
|
+
{
|
|
517
|
+
size: "mini",
|
|
518
|
+
iconOnly: true,
|
|
519
|
+
class: "!px-0"
|
|
520
|
+
},
|
|
505
521
|
{
|
|
506
522
|
size: "small",
|
|
507
523
|
iconOnly: true,
|
|
@@ -751,7 +767,7 @@ var connectedDisclosureStyles = (0, _tailwindvariants.tv)({
|
|
|
751
767
|
* @param {string} [props.ariaDescribedBy] - ID of the element that describes the button.
|
|
752
768
|
* @param {boolean} [props.ariaChecked] - Whether the button is checked (for toggle buttons).
|
|
753
769
|
* @param {React.Component} [props.icon] - Icon component to display within the button.
|
|
754
|
-
* @param {
|
|
770
|
+
* @param {"default" | "primary" | "secondary" | "plain" | "link" | "destructive" | "highlight"} [props.iconColor='default'] - Color of the icon.
|
|
755
771
|
* @param {boolean} [props.primary=false] - Whether to show the primary button style.
|
|
756
772
|
* @param {boolean} [props.highlight=false] - Whether to show the highlight button style.
|
|
757
773
|
* @param {boolean} [props.link=false] - Whether to show a link style.
|
|
@@ -759,12 +775,12 @@ var connectedDisclosureStyles = (0, _tailwindvariants.tv)({
|
|
|
759
775
|
* @param {boolean} [props.disclosure=false] - Whether to show a disclosure arrow.
|
|
760
776
|
* @param {boolean} [props.disclosureRight=false] - Whether to show the disclosure on the right.
|
|
761
777
|
* @param {boolean} [props.plain=false] - Whether to show plain styling without background.
|
|
762
|
-
* @param {
|
|
778
|
+
* @param {"small" | "medium" | "large" | "stepper"} [props.size='medium'] - Size of the button ('small', 'medium', 'large', 'stepper').
|
|
763
779
|
* @param {boolean} [props.fullWidth] - Whether the button should take full width.
|
|
764
|
-
* @param {
|
|
780
|
+
* @param {"left" | "center" | "right"} [props.align='center'] - Alignment of the button content ('left', 'center', 'right').
|
|
765
781
|
* @param {string} [props.tooltip] - Tooltip to show when hovering over the button.
|
|
766
782
|
* @param {Object} [props.connectedDisclosure] - Configuration for connected disclosure menu.
|
|
767
|
-
* @param {Array} [props.connectedDisclosure.actions] - Actions to show in the disclosure menu.
|
|
783
|
+
* @param {Array<import("./ActionList").ActionListItem>} [props.connectedDisclosure.actions] - Actions to show in the disclosure menu.
|
|
768
784
|
* @param {string} [props.className] - Additional CSS classes for the button.
|
|
769
785
|
* @param {string} [props.contentClassName] - Additional CSS classes for the button content.
|
|
770
786
|
* @param {boolean} [props.rounded] - Whether to show fully rounded corners.
|
|
@@ -774,12 +790,15 @@ var connectedDisclosureStyles = (0, _tailwindvariants.tv)({
|
|
|
774
790
|
* @returns {JSX.Element} The rendered Button component.
|
|
775
791
|
*
|
|
776
792
|
* @example
|
|
793
|
+
* ```js
|
|
777
794
|
* // Basic button
|
|
778
795
|
* <Button onClick={() => console.log('Clicked')}>
|
|
779
796
|
* Click me
|
|
780
797
|
* </Button>
|
|
798
|
+
* ```
|
|
781
799
|
*
|
|
782
800
|
* @example
|
|
801
|
+
* ```js
|
|
783
802
|
* // Primary button with icon and loading state
|
|
784
803
|
* <Button
|
|
785
804
|
* primary
|
|
@@ -789,8 +808,10 @@ var connectedDisclosureStyles = (0, _tailwindvariants.tv)({
|
|
|
789
808
|
* >
|
|
790
809
|
* Save changes
|
|
791
810
|
* </Button>
|
|
811
|
+
* ```
|
|
792
812
|
*
|
|
793
813
|
* @example
|
|
814
|
+
* ```js
|
|
794
815
|
* // Button with connected disclosure
|
|
795
816
|
* <Button
|
|
796
817
|
* connectedDisclosure={{
|
|
@@ -802,9 +823,10 @@ var connectedDisclosureStyles = (0, _tailwindvariants.tv)({
|
|
|
802
823
|
* >
|
|
803
824
|
* More actions
|
|
804
825
|
* </Button>
|
|
826
|
+
* ```
|
|
805
827
|
*/ function Button() {
|
|
806
828
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
807
|
-
var darkMode = (0,
|
|
829
|
+
var darkMode = (0, _AppProvider.useDarkMode)().darkMode;
|
|
808
830
|
var _useState = _sliced_to_array((0, _react.useState)(false), 2), showConnectedDisclosurePopover = _useState[0], setShowConnectedDisclosurePopover = _useState[1];
|
|
809
831
|
var id = props.id, children = props.children, url = props.url, _props_disabled = props.disabled, disabled = _props_disabled === void 0 ? false : _props_disabled, external = props.external, target = props.target, submit = props.submit, _props_loading = props.loading, loading = _props_loading === void 0 ? false : _props_loading, _props_pressed = props.pressed, pressed = _props_pressed === void 0 ? false : _props_pressed, accessibilityLabel = props.accessibilityLabel, role = props.role, ariaControls = props.ariaControls, ariaExpanded = props.ariaExpanded, ariaDescribedBy = props.ariaDescribedBy, ariaChecked = props.ariaChecked, icon = props.icon, _iconColor = props.iconColor, _props_bordered = props.bordered, bordered = _props_bordered === void 0 ? false : _props_bordered, _props_primary = props.primary, primary = _props_primary === void 0 ? false : _props_primary, _props_highlight = props.highlight, highlight = _props_highlight === void 0 ? false : _props_highlight, _props_link = props.link, link = _props_link === void 0 ? false : _props_link, _props_destructive = props.destructive, destructive = _props_destructive === void 0 ? false : _props_destructive, _props_disclosure = props.disclosure, disclosure = _props_disclosure === void 0 ? false : _props_disclosure, _props_disclosureRight = props.disclosureRight, disclosureRight = _props_disclosureRight === void 0 ? false : _props_disclosureRight, _props_plain = props.plain, plain = _props_plain === void 0 ? false : _props_plain, _props_size = props.size, size = _props_size === void 0 ? "medium" : _props_size, fullWidth = props.fullWidth, _props_align = props.align, align = _props_align === void 0 ? "center" : _props_align, connectedDisclosure = props.connectedDisclosure, className = props.className, contentClassName = props.contentClassName, rounded = props.rounded, onClick = props.onClick, onMouseDown = props.onMouseDown, tooltip = props.tooltip, _props_tooltipAlignment = props.tooltipAlignment, tooltipAlignment = _props_tooltipAlignment === void 0 ? "right" : _props_tooltipAlignment, _props_tooltipPosition = props.tooltipPosition, tooltipPosition = _props_tooltipPosition === void 0 ? "above" : _props_tooltipPosition, shadow = props.shadow, restProps = _object_without_properties(props, [
|
|
810
832
|
"id",
|
|
@@ -938,14 +960,14 @@ var connectedDisclosureStyles = (0, _tailwindvariants.tv)({
|
|
|
938
960
|
children: [
|
|
939
961
|
loading && /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
|
|
940
962
|
className: "Litho-Button__Loading absolute inset-0 flex items-center justify-center",
|
|
941
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
963
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Spinner.default, {
|
|
942
964
|
size: "small",
|
|
943
965
|
color: "subdued"
|
|
944
966
|
})
|
|
945
967
|
}),
|
|
946
968
|
memoizedIcon && /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
|
|
947
969
|
className: iconClasses,
|
|
948
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
970
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Icon.default, {
|
|
949
971
|
source: memoizedIcon,
|
|
950
972
|
color: disabled ? "disabled" : _iconColor || iconColor
|
|
951
973
|
})
|
|
@@ -956,7 +978,7 @@ var connectedDisclosureStyles = (0, _tailwindvariants.tv)({
|
|
|
956
978
|
}),
|
|
957
979
|
disclosure && /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
|
|
958
980
|
className: "Litho-Button__DisclosureIcon relative -left-0.5",
|
|
959
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
981
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Icon.default, {
|
|
960
982
|
source: _polarisicons.CaretDownMinor,
|
|
961
983
|
color: disabled ? "disabled" : _iconColor || iconColor
|
|
962
984
|
})
|
|
@@ -975,7 +997,7 @@ var connectedDisclosureStyles = (0, _tailwindvariants.tv)({
|
|
|
975
997
|
},
|
|
976
998
|
children: [
|
|
977
999
|
content,
|
|
978
|
-
showConnectedDisclosure && /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
1000
|
+
showConnectedDisclosure && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Popover.default, {
|
|
979
1001
|
active: showConnectedDisclosurePopover,
|
|
980
1002
|
onClose: function() {
|
|
981
1003
|
return setShowConnectedDisclosurePopover(false);
|
|
@@ -996,7 +1018,7 @@ var connectedDisclosureStyles = (0, _tailwindvariants.tv)({
|
|
|
996
1018
|
return setShowConnectedDisclosurePopover(!showConnectedDisclosurePopover);
|
|
997
1019
|
}
|
|
998
1020
|
}),
|
|
999
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
1021
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ActionList.default, {
|
|
1000
1022
|
items: connectedDisclosureActions,
|
|
1001
1023
|
onActionAnyItem: function() {
|
|
1002
1024
|
return setShowConnectedDisclosurePopover(false);
|
|
@@ -1006,7 +1028,7 @@ var connectedDisclosureStyles = (0, _tailwindvariants.tv)({
|
|
|
1006
1028
|
]
|
|
1007
1029
|
});
|
|
1008
1030
|
if (!!tooltip) {
|
|
1009
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
1031
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_Tooltip.default, {
|
|
1010
1032
|
content: tooltip,
|
|
1011
1033
|
alignment: tooltipAlignment,
|
|
1012
1034
|
preferredPosition: tooltipPosition,
|
|
@@ -10,60 +10,19 @@ Object.defineProperty(exports, "default", {
|
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
var _jsxruntime = require("react/jsx-runtime");
|
|
13
|
-
var _react = /*#__PURE__*/
|
|
13
|
+
var _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
14
14
|
var _tailwindvariants = require("tailwind-variants");
|
|
15
|
-
var _AppProvider = require("../components/AppProvider");
|
|
16
15
|
var _Button = /*#__PURE__*/ _interop_require_default(require("./Button"));
|
|
17
16
|
var _Icon = /*#__PURE__*/ _interop_require_default(require("./Icon"));
|
|
18
17
|
var _Spinner = /*#__PURE__*/ _interop_require_default(require("./Spinner"));
|
|
19
18
|
var _Text = /*#__PURE__*/ _interop_require_default(require("./Text"));
|
|
20
19
|
var _Tooltip = /*#__PURE__*/ _interop_require_default(require("./Tooltip"));
|
|
20
|
+
var _Frame = require("./Frame");
|
|
21
21
|
function _interop_require_default(obj) {
|
|
22
22
|
return obj && obj.__esModule ? obj : {
|
|
23
23
|
default: obj
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
function _getRequireWildcardCache(nodeInterop) {
|
|
27
|
-
if (typeof WeakMap !== "function") return null;
|
|
28
|
-
var cacheBabelInterop = new WeakMap();
|
|
29
|
-
var cacheNodeInterop = new WeakMap();
|
|
30
|
-
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
31
|
-
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
32
|
-
})(nodeInterop);
|
|
33
|
-
}
|
|
34
|
-
function _interop_require_wildcard(obj, nodeInterop) {
|
|
35
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
36
|
-
return obj;
|
|
37
|
-
}
|
|
38
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
39
|
-
return {
|
|
40
|
-
default: obj
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
44
|
-
if (cache && cache.has(obj)) {
|
|
45
|
-
return cache.get(obj);
|
|
46
|
-
}
|
|
47
|
-
var newObj = {
|
|
48
|
-
__proto__: null
|
|
49
|
-
};
|
|
50
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
51
|
-
for(var key in obj){
|
|
52
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
53
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
54
|
-
if (desc && (desc.get || desc.set)) {
|
|
55
|
-
Object.defineProperty(newObj, key, desc);
|
|
56
|
-
} else {
|
|
57
|
-
newObj[key] = obj[key];
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
newObj.default = obj;
|
|
62
|
-
if (cache) {
|
|
63
|
-
cache.set(obj, newObj);
|
|
64
|
-
}
|
|
65
|
-
return newObj;
|
|
66
|
-
}
|
|
67
26
|
function _type_of(obj) {
|
|
68
27
|
"@swc/helpers - typeof";
|
|
69
28
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
@@ -229,7 +188,7 @@ var bodyStyles = (0, _tailwindvariants.tv)({
|
|
|
229
188
|
* @returns {React.ReactElement} The rendered Card component.
|
|
230
189
|
*/ var Card = function(param) {
|
|
231
190
|
var _param_allowOverflow = param.allowOverflow, allowOverflow = _param_allowOverflow === void 0 ? false : _param_allowOverflow, _param_roundedOnMobile = param.roundedOnMobile, roundedOnMobile = _param_roundedOnMobile === void 0 ? false : _param_roundedOnMobile, children = param.children, hideOnPrint = param.hideOnPrint, title = param.title, _param_titleVariant = param.titleVariant, titleVariant = _param_titleVariant === void 0 ? "headingMd" : _param_titleVariant, description = param.description, icon = param.icon, tooltip = param.tooltip, _param_tooltipPreferredPosition = param.tooltipPreferredPosition, tooltipPreferredPosition = _param_tooltipPreferredPosition === void 0 ? "above" : _param_tooltipPreferredPosition, _param_outlined = param.outlined, outlined = _param_outlined === void 0 ? false : _param_outlined, _param_highlighted = param.highlighted, highlighted = _param_highlighted === void 0 ? false : _param_highlighted, _param_subdued = param.subdued, subdued = _param_subdued === void 0 ? false : _param_subdued, _param_alternate = param.alternate, alternate = _param_alternate === void 0 ? false : _param_alternate, _param_padded = param.padded, padded = _param_padded === void 0 ? false : _param_padded, _param_loading = param.loading, loading = _param_loading === void 0 ? false : _param_loading, _param_paddedHalf = param.paddedHalf, paddedHalf = _param_paddedHalf === void 0 ? false : _param_paddedHalf, _param_removeHeaderBottomPadding = param.removeHeaderBottomPadding, removeHeaderBottomPadding = _param_removeHeaderBottomPadding === void 0 ? false : _param_removeHeaderBottomPadding, onClick = param.onClick, _param_emptyState = param.emptyState, emptyState = _param_emptyState === void 0 ? {} : _param_emptyState, action = param.action, className = param.className, headerClassName = param.headerClassName, accessory = param.accessory, _param_fullHeightBody = param.fullHeightBody, fullHeightBody = _param_fullHeightBody === void 0 ? false : _param_fullHeightBody, _param_fullWidthOnMobile = param.fullWidthOnMobile, fullWidthOnMobile = _param_fullWidthOnMobile === void 0 ? true : _param_fullWidthOnMobile, _param_shadow = param.shadow, shadow = _param_shadow === void 0 ? "default" : _param_shadow;
|
|
232
|
-
var embedded = (0,
|
|
191
|
+
var embedded = (0, _Frame.useFrame)().embedded;
|
|
233
192
|
var showHeader = !!(title || action);
|
|
234
193
|
var isClickable = !!onClick;
|
|
235
194
|
var classes = styles({
|
|
@@ -254,7 +213,8 @@ var bodyStyles = (0, _tailwindvariants.tv)({
|
|
|
254
213
|
var firstSectionDetected = false;
|
|
255
214
|
function process(child) {
|
|
256
215
|
if (/*#__PURE__*/ _react.default.isValidElement(child)) {
|
|
257
|
-
|
|
216
|
+
var _child_type;
|
|
217
|
+
if (((_child_type = child.type) === null || _child_type === void 0 ? void 0 : _child_type.displayName) === "Card.Section" && !firstSectionDetected) {
|
|
258
218
|
firstSectionDetected = true;
|
|
259
219
|
return /*#__PURE__*/ _react.default.cloneElement(child, {
|
|
260
220
|
isFirst: true,
|
|
@@ -10,8 +10,15 @@ Object.defineProperty(exports, "default", {
|
|
|
10
10
|
});
|
|
11
11
|
var _jsxruntime = require("react/jsx-runtime");
|
|
12
12
|
var _tailwindvariants = require("tailwind-variants");
|
|
13
|
-
var
|
|
13
|
+
var _Icon = /*#__PURE__*/ _interop_require_default(require("./Icon"));
|
|
14
|
+
var _Label = /*#__PURE__*/ _interop_require_default(require("./Label"));
|
|
15
|
+
var _Text = /*#__PURE__*/ _interop_require_default(require("./Text"));
|
|
14
16
|
var _polarisicons = require("@shopify/polaris-icons");
|
|
17
|
+
function _interop_require_default(obj) {
|
|
18
|
+
return obj && obj.__esModule ? obj : {
|
|
19
|
+
default: obj
|
|
20
|
+
};
|
|
21
|
+
}
|
|
15
22
|
var styles = (0, _tailwindvariants.tv)({
|
|
16
23
|
base: "Litho-Checkbox group flex gap-2 py-1",
|
|
17
24
|
variants: {
|
|
@@ -71,6 +78,9 @@ var checkboxStyles = (0, _tailwindvariants.tv)({
|
|
|
71
78
|
* @param {boolean} [props.checked=false] - Indicates whether the checkbox is checked.
|
|
72
79
|
* @param {boolean} [props.disabled=false] - Indicates whether the checkbox is disabled.
|
|
73
80
|
* @param {string} [props.helpText] - Additional descriptive text for the checkbox.
|
|
81
|
+
* @param {React.ReactNode|import("./Tooltip").TooltipContentObject} [props.tooltip] - Tooltip content for the checkbox label.
|
|
82
|
+
* @param {boolean} [props.indeterminate=false] - Indicates whether the checkbox is in an indeterminate state (mixed/partial selection).
|
|
83
|
+
* @param {string} [props.className] - Additional CSS classes to apply to the checkbox container.
|
|
74
84
|
* @param {function} [props.onChange] - Callback function called when the checkbox state changes.
|
|
75
85
|
* @param {function} [props.onFocus] - Callback function called when the checkbox gains focus.
|
|
76
86
|
* @param {function} [props.onBlur] - Callback function called when the checkbox loses focus.
|
|
@@ -138,12 +148,12 @@ var checkboxStyles = (0, _tailwindvariants.tv)({
|
|
|
138
148
|
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
139
149
|
className: checkboxClasses,
|
|
140
150
|
children: [
|
|
141
|
-
checked && /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
151
|
+
checked && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Icon.default, {
|
|
142
152
|
color: disabled ? "inputFgDisabled" : hasError ? "white" : "inputFg",
|
|
143
153
|
source: _polarisicons.TickMinor,
|
|
144
154
|
className: "pointer-events-none"
|
|
145
155
|
}),
|
|
146
|
-
!checked && indeterminate && /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
156
|
+
!checked && indeterminate && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Icon.default, {
|
|
147
157
|
color: disabled ? "inputFgDisabled" : hasError ? "white" : "inputFg",
|
|
148
158
|
source: _polarisicons.MinusMajor,
|
|
149
159
|
className: "pointer-events-none"
|
|
@@ -151,7 +161,7 @@ var checkboxStyles = (0, _tailwindvariants.tv)({
|
|
|
151
161
|
]
|
|
152
162
|
})
|
|
153
163
|
}),
|
|
154
|
-
label && !labelHidden && /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
164
|
+
label && !labelHidden && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Label.default, {
|
|
155
165
|
tooltip: tooltip,
|
|
156
166
|
disabled: disabled,
|
|
157
167
|
as: "p",
|
|
@@ -159,12 +169,12 @@ var checkboxStyles = (0, _tailwindvariants.tv)({
|
|
|
159
169
|
})
|
|
160
170
|
]
|
|
161
171
|
}),
|
|
162
|
-
helpText && /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
172
|
+
helpText && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
|
|
163
173
|
color: "subdued",
|
|
164
174
|
className: "pl-7",
|
|
165
175
|
children: helpText
|
|
166
176
|
}),
|
|
167
|
-
error && /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
177
|
+
error && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
|
|
168
178
|
color: "critical",
|
|
169
179
|
className: "pl-7",
|
|
170
180
|
children: error
|
|
@@ -51,6 +51,12 @@ var styles = (0, _tailwindvariants.tv)({
|
|
|
51
51
|
base: "Litho-ChoiceList flex flex-col gap-1"
|
|
52
52
|
});
|
|
53
53
|
/**
|
|
54
|
+
* @typedef {Object} ChoiceListItem
|
|
55
|
+
* @property {string} value - The value of the choice.
|
|
56
|
+
* @property {string} label - The display label of the choice.
|
|
57
|
+
* @property {boolean} [disabled=false] - Whether the choice is disabled.
|
|
58
|
+
* @property {React.ReactNode} [renderChildren] - A function that returns a React node to render as children of the choice.
|
|
59
|
+
*/ /**
|
|
54
60
|
* A ChoiceList component for rendering a list of selectable options.
|
|
55
61
|
*
|
|
56
62
|
* @component
|
|
@@ -59,10 +65,7 @@ var styles = (0, _tailwindvariants.tv)({
|
|
|
59
65
|
* @param {string} [props.title] - The title of the choice list.
|
|
60
66
|
* @param {boolean} [props.titleHidden=false] - Whether to hide the title visually.
|
|
61
67
|
* @param {boolean} [props.allowMultiple=false] - Whether multiple selections are allowed.
|
|
62
|
-
* @param {Array} props.choices - The available choices for selection.
|
|
63
|
-
* @param {string} props.choices[].value - The value of the choice.
|
|
64
|
-
* @param {string} props.choices[].label - The display label of the choice.
|
|
65
|
-
* @param {boolean} [props.choices[].disabled=false] - Whether the choice is disabled.
|
|
68
|
+
* @param {Array<ChoiceListItem>} props.choices - The available choices for selection.
|
|
66
69
|
* @param {Array} props.selected - The currently selected values.
|
|
67
70
|
* @param {Function} props.onChange - Callback when the selection changes. Receives the updated array of selected values.
|
|
68
71
|
* @param {string} [props.error] - Error message to display, if any.
|
|
@@ -13,7 +13,7 @@ var _jsxruntime = require("react/jsx-runtime");
|
|
|
13
13
|
var _react = require("react");
|
|
14
14
|
var _reactcolor = require("react-color");
|
|
15
15
|
var _tailwindvariants = require("tailwind-variants");
|
|
16
|
-
var
|
|
16
|
+
var _Text = /*#__PURE__*/ _interop_require_default(require("./Text"));
|
|
17
17
|
function _array_like_to_array(arr, len) {
|
|
18
18
|
if (len == null || len > arr.length) len = arr.length;
|
|
19
19
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
@@ -22,6 +22,11 @@ function _array_like_to_array(arr, len) {
|
|
|
22
22
|
function _array_with_holes(arr) {
|
|
23
23
|
if (Array.isArray(arr)) return arr;
|
|
24
24
|
}
|
|
25
|
+
function _interop_require_default(obj) {
|
|
26
|
+
return obj && obj.__esModule ? obj : {
|
|
27
|
+
default: obj
|
|
28
|
+
};
|
|
29
|
+
}
|
|
25
30
|
function _iterable_to_array_limit(arr, i) {
|
|
26
31
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
27
32
|
if (_i == null) return;
|
|
@@ -123,11 +128,11 @@ var colorCell = (0, _tailwindvariants.tv)({
|
|
|
123
128
|
/*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
124
129
|
className: "flex flex-col gap-0",
|
|
125
130
|
children: [
|
|
126
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
131
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
|
|
127
132
|
variant: "bodySm",
|
|
128
133
|
children: label
|
|
129
134
|
}),
|
|
130
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
135
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
|
|
131
136
|
variant: "bodySm",
|
|
132
137
|
color: "subdued",
|
|
133
138
|
children: value ? value.toUpperCase() : value
|
|
@@ -14,7 +14,12 @@ var _react = require("react");
|
|
|
14
14
|
var _tailwindvariants = require("tailwind-variants");
|
|
15
15
|
var _dayjs = /*#__PURE__*/ _interop_require_default(require("dayjs"));
|
|
16
16
|
var _reactdatepicker = /*#__PURE__*/ _interop_require_default(require("react-datepicker"));
|
|
17
|
-
var
|
|
17
|
+
var _Icon = /*#__PURE__*/ _interop_require_default(require("./Icon"));
|
|
18
|
+
var _Listbox = /*#__PURE__*/ _interop_require_default(require("./Listbox"));
|
|
19
|
+
var _Popover = /*#__PURE__*/ _interop_require_default(require("./Popover"));
|
|
20
|
+
var _Text = /*#__PURE__*/ _interop_require_default(require("./Text"));
|
|
21
|
+
var _TextField = /*#__PURE__*/ _interop_require_default(require("./TextField"));
|
|
22
|
+
var _TimePicker = /*#__PURE__*/ _interop_require_default(require("./TimePicker"));
|
|
18
23
|
var _polarisicons = require("@shopify/polaris-icons");
|
|
19
24
|
var _locale = require("date-fns/locale");
|
|
20
25
|
var _dates = require("../utilities/dates");
|
|
@@ -363,7 +368,7 @@ var getDateRange = function(param) {
|
|
|
363
368
|
className: presetContainerStyles({
|
|
364
369
|
rows: rows
|
|
365
370
|
}),
|
|
366
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
371
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Listbox.default, {
|
|
367
372
|
displayHorizontallyOnMobile: true,
|
|
368
373
|
options: presets.map(function(preset) {
|
|
369
374
|
return {
|
|
@@ -440,12 +445,12 @@ var getDateRange = function(param) {
|
|
|
440
445
|
className: buttonStyles({
|
|
441
446
|
disabled: prevMonthButtonDisabled
|
|
442
447
|
}),
|
|
443
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
448
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Icon.default, {
|
|
444
449
|
source: _polarisicons.ChevronLeftMinor
|
|
445
450
|
})
|
|
446
451
|
}),
|
|
447
452
|
/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
448
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(
|
|
453
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_Text.default, {
|
|
449
454
|
children: [
|
|
450
455
|
monthLabel,
|
|
451
456
|
" ",
|
|
@@ -459,7 +464,7 @@ var getDateRange = function(param) {
|
|
|
459
464
|
className: buttonStyles({
|
|
460
465
|
disabled: nextMonthButtonDisabled
|
|
461
466
|
}),
|
|
462
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
467
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Icon.default, {
|
|
463
468
|
source: _polarisicons.ChevronRightMinor
|
|
464
469
|
})
|
|
465
470
|
})
|
|
@@ -467,7 +472,7 @@ var getDateRange = function(param) {
|
|
|
467
472
|
});
|
|
468
473
|
}
|
|
469
474
|
}),
|
|
470
|
-
showTimePicker && !allowRange && /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
475
|
+
showTimePicker && !allowRange && /*#__PURE__*/ (0, _jsxruntime.jsx)(_TimePicker.default, {
|
|
471
476
|
value: formattedTime,
|
|
472
477
|
onChange: function(time) {
|
|
473
478
|
onChange({
|
|
@@ -486,7 +491,7 @@ var getDateRange = function(param) {
|
|
|
486
491
|
var startDateFormatted = startDate ? (0, _dayjs.default)(startDate).format(displayFormat) : null;
|
|
487
492
|
var endDateFormatted = endDate ? (0, _dayjs.default)(endDate).format(displayFormat) : null;
|
|
488
493
|
var displayValue = allowRange ? "".concat(startDateFormatted).concat(endDateFormatted && endDateFormatted !== startDateFormatted ? " to ".concat(endDateFormatted) : "") : value ? (0, _dayjs.default)(value).format(displayFormat) : "";
|
|
489
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
494
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_Popover.default, {
|
|
490
495
|
active: showPopover,
|
|
491
496
|
activatorDisplayType: "block",
|
|
492
497
|
maxWidth: "datePicker",
|
|
@@ -499,7 +504,7 @@ var getDateRange = function(param) {
|
|
|
499
504
|
onClick: function() {
|
|
500
505
|
return setShowPopover(!showPopover);
|
|
501
506
|
},
|
|
502
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
507
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_TextField.default, {
|
|
503
508
|
label: label,
|
|
504
509
|
labelAction: labelAction,
|
|
505
510
|
value: displayValue,
|
|
@@ -12,7 +12,14 @@ Object.defineProperty(exports, "default", {
|
|
|
12
12
|
var _jsxruntime = require("react/jsx-runtime");
|
|
13
13
|
var _react = require("react");
|
|
14
14
|
var _tailwindvariants = require("tailwind-variants");
|
|
15
|
-
var
|
|
15
|
+
var _Button = /*#__PURE__*/ _interop_require_default(require("./Button"));
|
|
16
|
+
var _Icon = /*#__PURE__*/ _interop_require_default(require("./Icon"));
|
|
17
|
+
var _InlineError = /*#__PURE__*/ _interop_require_default(require("./InlineError"));
|
|
18
|
+
var _Label = /*#__PURE__*/ _interop_require_default(require("./Label"));
|
|
19
|
+
var _Link = /*#__PURE__*/ _interop_require_default(require("./Link"));
|
|
20
|
+
var _SkeletonText = /*#__PURE__*/ _interop_require_default(require("./SkeletonText"));
|
|
21
|
+
var _Spinner = /*#__PURE__*/ _interop_require_default(require("./Spinner"));
|
|
22
|
+
var _Text = /*#__PURE__*/ _interop_require_default(require("./Text"));
|
|
16
23
|
var _polarisicons = require("@shopify/polaris-icons");
|
|
17
24
|
function _array_like_to_array(arr, len) {
|
|
18
25
|
if (len == null || len > arr.length) len = arr.length;
|
|
@@ -25,6 +32,11 @@ function _array_with_holes(arr) {
|
|
|
25
32
|
function _array_without_holes(arr) {
|
|
26
33
|
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
27
34
|
}
|
|
35
|
+
function _interop_require_default(obj) {
|
|
36
|
+
return obj && obj.__esModule ? obj : {
|
|
37
|
+
default: obj
|
|
38
|
+
};
|
|
39
|
+
}
|
|
28
40
|
function _iterable_to_array(iter) {
|
|
29
41
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
30
42
|
}
|
|
@@ -132,9 +144,12 @@ var dropZoneStyles = (0, _tailwindvariants.tv)({
|
|
|
132
144
|
* @returns {JSX.Element} DropZone component.
|
|
133
145
|
*/ function DropZone() {
|
|
134
146
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
135
|
-
var id = props.id, label = props.label, labelHidden = props.labelHidden, labelAction = props.labelAction, tooltip = props.tooltip, labelVariant = props.labelVariant, _props_type = props.type, type = _props_type === void 0 ? "file" : _props_type,
|
|
136
|
-
|
|
137
|
-
|
|
147
|
+
var id = props.id, label = props.label, labelHidden = props.labelHidden, labelAction = props.labelAction, tooltip = props.tooltip, labelVariant = props.labelVariant, _props_type = props.type, type = _props_type === void 0 ? "file" : _props_type, _accept = props.accept, _props_allowMultiple = props.allowMultiple, allowMultiple = _props_allowMultiple === void 0 ? false : _props_allowMultiple, _props_showDropZoneWhenDisabled = props.showDropZoneWhenDisabled, showDropZoneWhenDisabled = _props_showDropZoneWhenDisabled === void 0 ? true : _props_showDropZoneWhenDisabled, _disabled = props.disabled, onDrop = props.onDrop, onDropAccepted = props.onDropAccepted, onDropRejected = props.onDropRejected, helpText = props.helpText, error = props.error, _props_uploading = props.uploading, uploading = _props_uploading === void 0 ? false : _props_uploading, _props_uploadedFiles = props.uploadedFiles, uploadedFiles = _props_uploadedFiles === void 0 ? [] : _props_uploadedFiles, _props_uploadLabel = props.uploadLabel, uploadLabel = _props_uploadLabel === void 0 ? "Drag and drop files or click to upload" : _props_uploadLabel, _props_uploadingLabel = props.uploadingLabel, uploadingLabel = _props_uploadingLabel === void 0 ? "Uploading..." : _props_uploadingLabel, _props_dragLabel = props.dragLabel, dragLabel = _props_dragLabel === void 0 ? "Release to upload" : _props_dragLabel, tmp = props.showFilePreview, _showFilePreview = tmp === void 0 ? true : tmp, previewLoading = props.previewLoading, _props_previewRows = props.previewRows, previewRows = _props_previewRows === void 0 ? 2 : _props_previewRows, onRemove = props.onRemove, onFilePreviewClick = props.onFilePreviewClick, filename = props.filename;
|
|
148
|
+
var accept = _accept ? typeof _accept === "string" ? [
|
|
149
|
+
_accept
|
|
150
|
+
] : _accept : [
|
|
151
|
+
"*/*"
|
|
152
|
+
];
|
|
138
153
|
var inputRef = (0, _react.useRef)(null);
|
|
139
154
|
var _useState = _sliced_to_array((0, _react.useState)(false), 2), hasFocusWithin = _useState[0], setHasFocusWithin = _useState[1];
|
|
140
155
|
var _useState1 = _sliced_to_array((0, _react.useState)(false), 2), isDraggingOver = _useState1[0], setIsDraggingOver = _useState1[1];
|
|
@@ -266,7 +281,7 @@ var dropZoneStyles = (0, _tailwindvariants.tv)({
|
|
|
266
281
|
label && !labelHidden && /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
267
282
|
className: "flex justify-between items-end",
|
|
268
283
|
children: [
|
|
269
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
284
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Label.default, {
|
|
270
285
|
id: id,
|
|
271
286
|
hidden: labelHidden,
|
|
272
287
|
disabled: disabled,
|
|
@@ -274,7 +289,7 @@ var dropZoneStyles = (0, _tailwindvariants.tv)({
|
|
|
274
289
|
variant: labelVariant,
|
|
275
290
|
children: label
|
|
276
291
|
}),
|
|
277
|
-
labelAction && /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
292
|
+
labelAction && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Link.default, {
|
|
278
293
|
onClick: labelAction.onAction,
|
|
279
294
|
removeUnderline: true,
|
|
280
295
|
children: labelAction.content
|
|
@@ -316,13 +331,13 @@ var dropZoneStyles = (0, _tailwindvariants.tv)({
|
|
|
316
331
|
/*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
317
332
|
className: "flex items-center justify-center gap-2",
|
|
318
333
|
children: [
|
|
319
|
-
uploading ? /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
334
|
+
uploading ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_Spinner.default, {
|
|
320
335
|
size: "small"
|
|
321
|
-
}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
336
|
+
}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_Icon.default, {
|
|
322
337
|
source: typeIcon,
|
|
323
338
|
color: disabled ? "disabled" : "subdued"
|
|
324
339
|
}),
|
|
325
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
340
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
|
|
326
341
|
fontWeight: "medium",
|
|
327
342
|
color: disabled ? "disabled" : "subdued",
|
|
328
343
|
children: uploading ? uploadingLabel : isDraggingOver ? "".concat(dragLabel, " ").concat(dragFileCount, " file").concat(dragFileCount !== 1 ? "s" : "") : uploadLabel
|
|
@@ -331,11 +346,11 @@ var dropZoneStyles = (0, _tailwindvariants.tv)({
|
|
|
331
346
|
})
|
|
332
347
|
]
|
|
333
348
|
}),
|
|
334
|
-
error && /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
349
|
+
error && /*#__PURE__*/ (0, _jsxruntime.jsx)(_InlineError.default, {
|
|
335
350
|
message: error,
|
|
336
351
|
icon: _polarisicons.CircleAlertMajor
|
|
337
352
|
}),
|
|
338
|
-
helpText && /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
353
|
+
helpText && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
|
|
339
354
|
color: "subdued",
|
|
340
355
|
children: helpText
|
|
341
356
|
})
|
|
@@ -411,14 +426,14 @@ var previewStyles = (0, _tailwindvariants.tv)({
|
|
|
411
426
|
}),
|
|
412
427
|
/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
413
428
|
className: "w-20",
|
|
414
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
429
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_SkeletonText.default, {
|
|
415
430
|
lines: 2,
|
|
416
431
|
gap: "small"
|
|
417
432
|
})
|
|
418
433
|
})
|
|
419
434
|
]
|
|
420
435
|
}),
|
|
421
|
-
onRemove && /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
436
|
+
onRemove && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Button.default, {
|
|
422
437
|
size: "small",
|
|
423
438
|
icon: _polarisicons.CancelMajor,
|
|
424
439
|
disabled: true,
|
|
@@ -447,12 +462,12 @@ var previewStyles = (0, _tailwindvariants.tv)({
|
|
|
447
462
|
/*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
448
463
|
className: display === "row" ? "@lg:max-w-32" : "",
|
|
449
464
|
children: [
|
|
450
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
465
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
|
|
451
466
|
fontWeight: "medium",
|
|
452
467
|
truncate: true,
|
|
453
468
|
children: filename || file.fileName
|
|
454
469
|
}),
|
|
455
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
470
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
|
|
456
471
|
color: "subdued",
|
|
457
472
|
truncate: true,
|
|
458
473
|
variant: "bodySm",
|
|
@@ -462,7 +477,7 @@ var previewStyles = (0, _tailwindvariants.tv)({
|
|
|
462
477
|
})
|
|
463
478
|
]
|
|
464
479
|
}),
|
|
465
|
-
onRemove && /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
480
|
+
onRemove && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Button.default, {
|
|
466
481
|
size: "small",
|
|
467
482
|
icon: _polarisicons.CancelMajor,
|
|
468
483
|
tooltip: "Remove",
|
|
@@ -510,10 +525,10 @@ var thumbnailSizeStyles = (0, _tailwindvariants.tv)({
|
|
|
510
525
|
style: (file === null || file === void 0 ? void 0 : (_file_fileType = file.fileType) === null || _file_fileType === void 0 ? void 0 : _file_fileType.startsWith("image")) ? {
|
|
511
526
|
backgroundImage: "url(".concat(imagePreview, ")")
|
|
512
527
|
} : {},
|
|
513
|
-
children: loading ? /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
528
|
+
children: loading ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_Spinner.default, {
|
|
514
529
|
size: "small",
|
|
515
530
|
color: "subdued"
|
|
516
|
-
}) : file && !((_file_fileType1 = file.fileType) === null || _file_fileType1 === void 0 ? void 0 : _file_fileType1.startsWith("image")) && /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
531
|
+
}) : file && !((_file_fileType1 = file.fileType) === null || _file_fileType1 === void 0 ? void 0 : _file_fileType1.startsWith("image")) && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Icon.default, {
|
|
517
532
|
source: _polarisicons.FileMinor,
|
|
518
533
|
color: "subdued"
|
|
519
534
|
})
|