@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
|
@@ -12,8 +12,15 @@ Object.defineProperty(exports, "default", {
|
|
|
12
12
|
var _jsxruntime = require("react/jsx-runtime");
|
|
13
13
|
var _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
14
14
|
var _tailwindvariants = require("tailwind-variants");
|
|
15
|
-
var
|
|
15
|
+
var _Icon = /*#__PURE__*/ _interop_require_default(require("./Icon"));
|
|
16
|
+
var _Text = /*#__PURE__*/ _interop_require_default(require("./Text"));
|
|
17
|
+
var _Tooltip = /*#__PURE__*/ _interop_require_default(require("./Tooltip"));
|
|
16
18
|
var _polarisicons = require("@shopify/polaris-icons");
|
|
19
|
+
function _interop_require_default(obj) {
|
|
20
|
+
return obj && obj.__esModule ? obj : {
|
|
21
|
+
default: obj
|
|
22
|
+
};
|
|
23
|
+
}
|
|
17
24
|
function _getRequireWildcardCache(nodeInterop) {
|
|
18
25
|
if (typeof WeakMap !== "function") return null;
|
|
19
26
|
var cacheBabelInterop = new WeakMap();
|
|
@@ -94,18 +101,38 @@ var itemStyles = (0, _tailwindvariants.tv)({
|
|
|
94
101
|
}
|
|
95
102
|
});
|
|
96
103
|
/**
|
|
104
|
+
* @typedef {Object} SecondaryAction
|
|
105
|
+
* @property {React.FunctionComponent<React.SVGProps<SVGSVGElement>>} icon - The icon to display for the secondary action.
|
|
106
|
+
* @property {string} tooltip - The tooltip to display for the secondary action.
|
|
107
|
+
* @property {function} onAction - The function to call when the secondary action is selected.
|
|
108
|
+
*/ /**
|
|
109
|
+
* @typedef {Object} ActionListSection
|
|
110
|
+
* @property {string} title - The title of the section.
|
|
111
|
+
* @property {Array<ActionListItem>} items - The items to display in the section.
|
|
112
|
+
*/ /**
|
|
113
|
+
* @typedef {Object} ActionListItem - An object representing an item in the action list.
|
|
114
|
+
* @property {string} content - The text content of the action item.
|
|
115
|
+
* @property {boolean} disabled - Whether the action item is disabled.
|
|
116
|
+
* @property {boolean} destructive - Whether the action item is destructive.
|
|
117
|
+
* @property {React.FunctionComponent<React.SVGProps<SVGSVGElement>>} icon - The icon to display for the action item.
|
|
118
|
+
* @property {function} onAction - The function to call when the action item is selected.
|
|
119
|
+
* @property {React.ReactNode} prefix - The prefix to display for the action item.
|
|
120
|
+
* @property {string} imageUrl - The image to display for the action item.
|
|
121
|
+
* @property {string} url - The URL to navigate to when the action item is selected.
|
|
122
|
+
* @property {SecondaryAction} secondaryAction - The secondary action to display for the action item.
|
|
123
|
+
*/ /**
|
|
97
124
|
* ActionList component renders a list of actionable items with optional sections.
|
|
98
125
|
* Supports keyboard navigation and action triggers on item selection.
|
|
99
126
|
*
|
|
100
127
|
* @component
|
|
101
128
|
* @param {Object} props - Component properties.
|
|
102
|
-
* @param {Array} [props.sections] - Sections containing items for the action list.
|
|
103
|
-
*
|
|
104
|
-
* @param {Array} [props.items] - List of items to render in the action list when no sections are provided.
|
|
129
|
+
* @param {Array<{title: string, items: Array<ActionListItem>}>} [props.sections] - Sections containing items for the action list.
|
|
130
|
+
* @param {Array<ActionListItem>} [props.items] - List of items to render in the action list when no sections are provided.
|
|
105
131
|
* @param {string} [props.iconColor="subdued"] - Default color for icons in the action items.
|
|
106
132
|
* @param {function} [props.onActionAnyItem] - Callback function invoked whenever any action item is selected.
|
|
107
133
|
* @param {boolean} [props.fullWidth=false] - Whether to apply full width styling to the action list.
|
|
108
|
-
* @param {boolean} [props.
|
|
134
|
+
* @param {boolean} [props.padded=true] - Whether to apply padding to the action list.
|
|
135
|
+
* @param {string} [props.className] - Additional CSS classes to apply to the action list.
|
|
109
136
|
* @example
|
|
110
137
|
* const items = [{ content: 'Item 1', onAction: () => {} }];
|
|
111
138
|
* <ActionList items={items} />
|
|
@@ -164,7 +191,7 @@ var itemStyles = (0, _tailwindvariants.tv)({
|
|
|
164
191
|
}
|
|
165
192
|
var ActionListItem = function(param) {
|
|
166
193
|
var item = param.item, index = param.index;
|
|
167
|
-
var content = item.content, disabled = item.disabled, destructive = item.destructive, icon = item.icon, onAction = item.onAction, prefix = item.prefix, imageUrl = item.imageUrl, url = item.url, secondaryAction = item.secondaryAction;
|
|
194
|
+
var content = item.content, description = item.description, disabled = item.disabled, destructive = item.destructive, icon = item.icon, onAction = item.onAction, prefix = item.prefix, imageUrl = item.imageUrl, url = item.url, secondaryAction = item.secondaryAction;
|
|
168
195
|
var iconColor = disabled ? "disabled" : destructive ? "critical" : _iconColor;
|
|
169
196
|
var textColor = disabled ? "disabled" : destructive ? "critical" : "default";
|
|
170
197
|
var itemClasses = itemStyles({
|
|
@@ -177,7 +204,7 @@ var itemStyles = (0, _tailwindvariants.tv)({
|
|
|
177
204
|
e.stopPropagation();
|
|
178
205
|
secondaryAction.onAction();
|
|
179
206
|
},
|
|
180
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
207
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Icon.default, {
|
|
181
208
|
source: (secondaryAction === null || secondaryAction === void 0 ? void 0 : secondaryAction.icon) || _polarisicons.MobileHorizontalDotsMajor,
|
|
182
209
|
color: "subdued"
|
|
183
210
|
})
|
|
@@ -201,7 +228,7 @@ var itemStyles = (0, _tailwindvariants.tv)({
|
|
|
201
228
|
children: prefix
|
|
202
229
|
}) : icon ? /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
203
230
|
className: "Litho-ActionList__Item__Icon shrink-0",
|
|
204
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
231
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Icon.default, {
|
|
205
232
|
source: icon,
|
|
206
233
|
color: iconColor,
|
|
207
234
|
stroke: item === null || item === void 0 ? void 0 : item.iconStroke,
|
|
@@ -215,15 +242,22 @@ var itemStyles = (0, _tailwindvariants.tv)({
|
|
|
215
242
|
className: "w-5 h-5 rounded-sm"
|
|
216
243
|
})
|
|
217
244
|
}) : null,
|
|
218
|
-
/*#__PURE__*/ (0, _jsxruntime.
|
|
245
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
219
246
|
className: "flex-1",
|
|
220
|
-
children:
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
247
|
+
children: [
|
|
248
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
|
|
249
|
+
color: textColor,
|
|
250
|
+
truncate: true,
|
|
251
|
+
children: content
|
|
252
|
+
}),
|
|
253
|
+
description && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
|
|
254
|
+
color: "subdued",
|
|
255
|
+
variant: "bodySm",
|
|
256
|
+
children: description
|
|
257
|
+
})
|
|
258
|
+
]
|
|
225
259
|
}),
|
|
226
|
-
(secondaryAction === null || secondaryAction === void 0 ? void 0 : secondaryAction.tooltip) ? /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
260
|
+
(secondaryAction === null || secondaryAction === void 0 ? void 0 : secondaryAction.tooltip) ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_Tooltip.default, {
|
|
227
261
|
content: secondaryAction.tooltip,
|
|
228
262
|
children: secondaryActionContent
|
|
229
263
|
}) : secondaryActionContent
|
|
@@ -240,7 +274,7 @@ var itemStyles = (0, _tailwindvariants.tv)({
|
|
|
240
274
|
children: [
|
|
241
275
|
section.title && /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
242
276
|
className: "Litho-ActionList__SectionTitle px-2 py-1",
|
|
243
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
277
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
|
|
244
278
|
variant: "headingSm",
|
|
245
279
|
children: section.title
|
|
246
280
|
})
|
|
@@ -10,7 +10,13 @@ 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 _Text = /*#__PURE__*/ _interop_require_default(require("./Text"));
|
|
14
|
+
var _Icon = /*#__PURE__*/ _interop_require_default(require("./Icon"));
|
|
15
|
+
function _interop_require_default(obj) {
|
|
16
|
+
return obj && obj.__esModule ? obj : {
|
|
17
|
+
default: obj
|
|
18
|
+
};
|
|
19
|
+
}
|
|
14
20
|
var styles = (0, _tailwindvariants.tv)({
|
|
15
21
|
base: "Litho-AnnouncementBar text-center p-2 min-h-10 flex items-center justify-center bg-brand",
|
|
16
22
|
variants: {
|
|
@@ -39,6 +45,7 @@ var iconContainerStyles = (0, _tailwindvariants.tv)({
|
|
|
39
45
|
* @param {string} props.content - Text content to be displayed.
|
|
40
46
|
* @param {string} [props.icon] - Icon source name.
|
|
41
47
|
* @param {"bounce"} [props.animateIcon] - Animation type for the icon.
|
|
48
|
+
* @param {boolean} [props.fixed] - Whether to fix the announcement bar to the top of the page.
|
|
42
49
|
*
|
|
43
50
|
* @returns {JSX.Element} AnnouncementBar component.
|
|
44
51
|
*/ function AnnouncementBar() {
|
|
@@ -53,7 +60,7 @@ var iconContainerStyles = (0, _tailwindvariants.tv)({
|
|
|
53
60
|
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
54
61
|
className: "flex items-center justify-center gap-4",
|
|
55
62
|
children: [
|
|
56
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
63
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
|
|
57
64
|
fontWeight: "medium",
|
|
58
65
|
className: "text-md",
|
|
59
66
|
children: content
|
|
@@ -62,7 +69,7 @@ var iconContainerStyles = (0, _tailwindvariants.tv)({
|
|
|
62
69
|
className: iconContainerStyles({
|
|
63
70
|
animateIcon: animateIcon
|
|
64
71
|
}),
|
|
65
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
72
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Icon.default, {
|
|
66
73
|
source: icon
|
|
67
74
|
})
|
|
68
75
|
})
|
|
@@ -117,7 +117,16 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
117
117
|
}
|
|
118
118
|
var DarkModeContext = /*#__PURE__*/ (0, _react.createContext)(null);
|
|
119
119
|
var useDarkMode = function() {
|
|
120
|
-
|
|
120
|
+
var context = (0, _react.useContext)(DarkModeContext);
|
|
121
|
+
if (!context) {
|
|
122
|
+
return {
|
|
123
|
+
darkModeAvailable: false,
|
|
124
|
+
darkMode: false,
|
|
125
|
+
toggleDarkMode: function() {},
|
|
126
|
+
setDarkModeAvailable: function() {}
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
return context;
|
|
121
130
|
};
|
|
122
131
|
var FrameContext = /*#__PURE__*/ (0, _react.createContext)({
|
|
123
132
|
embedded: false,
|
|
@@ -12,7 +12,12 @@ Object.defineProperty(exports, "default", {
|
|
|
12
12
|
var _jsxruntime = require("react/jsx-runtime");
|
|
13
13
|
var _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
14
14
|
var _tailwindvariants = require("tailwind-variants");
|
|
15
|
-
var
|
|
15
|
+
var _Popover = /*#__PURE__*/ _interop_require_default(require("./Popover"));
|
|
16
|
+
var _TextField = /*#__PURE__*/ _interop_require_default(require("./TextField"));
|
|
17
|
+
var _Checkbox = /*#__PURE__*/ _interop_require_default(require("./Checkbox"));
|
|
18
|
+
var _Spinner = /*#__PURE__*/ _interop_require_default(require("./Spinner"));
|
|
19
|
+
var _Text = /*#__PURE__*/ _interop_require_default(require("./Text"));
|
|
20
|
+
var _Icon = /*#__PURE__*/ _interop_require_default(require("./Icon"));
|
|
16
21
|
var _polarisicons = require("@shopify/polaris-icons");
|
|
17
22
|
function _array_like_to_array(arr, len) {
|
|
18
23
|
if (len == null || len > arr.length) len = arr.length;
|
|
@@ -38,6 +43,11 @@ function _define_property(obj, key, value) {
|
|
|
38
43
|
}
|
|
39
44
|
return obj;
|
|
40
45
|
}
|
|
46
|
+
function _interop_require_default(obj) {
|
|
47
|
+
return obj && obj.__esModule ? obj : {
|
|
48
|
+
default: obj
|
|
49
|
+
};
|
|
50
|
+
}
|
|
41
51
|
function _getRequireWildcardCache(nodeInterop) {
|
|
42
52
|
if (typeof WeakMap !== "function") return null;
|
|
43
53
|
var cacheBabelInterop = new WeakMap();
|
|
@@ -185,18 +195,30 @@ function attachPropToTextField(children, prop) {
|
|
|
185
195
|
});
|
|
186
196
|
}
|
|
187
197
|
/**
|
|
198
|
+
* @typedef {Object} AutocompleteOption
|
|
199
|
+
* @property {string} label - The label to display for the option.
|
|
200
|
+
* @property {string} value - The value to associate with the option.
|
|
201
|
+
* @property {string} [title] - An optional title to display for the option.
|
|
202
|
+
* @property {boolean} [allowMultiple] - Whether multiple options can be selected.
|
|
203
|
+
* @property {string} [selected] - The value of the option that is currently selected.
|
|
204
|
+
* @property {function} [onSelect] - The function to call when the option is selected.
|
|
205
|
+
* @property {Array<AutocompleteOption>} [options] - An optional array of sub-options to display for the option.
|
|
206
|
+
*/ /**
|
|
207
|
+
* @typedef {Object} AutocompleteEmptyState
|
|
208
|
+
* @property {string} content - The content to display in the empty state.
|
|
209
|
+
* @property {React.ReactNode} icon - An optional icon to display in the empty state.
|
|
210
|
+
*/ /**
|
|
188
211
|
* Autocomplete component that provides a flexible dropdown menu with search and selection capabilities.
|
|
189
212
|
*
|
|
190
213
|
* @component
|
|
191
214
|
* @param {Object} props - The props for the Autocomplete component.
|
|
192
|
-
* @param {Array<
|
|
215
|
+
* @param {Array<AutocompleteOption>} props.options - The options to display in the dropdown.
|
|
193
216
|
* @param {Array<string>} props.selected - The currently selected option values.
|
|
194
217
|
* @param {"below"|"above"} [props.preferredPosition="below"] - The preferred position of the dropdown relative to the activator.
|
|
195
218
|
* @param {"left"|"center"|"right"} [props.preferredAlignment="left"] - The preferred alignment of the dropdown.
|
|
196
219
|
* @param {boolean} [props.allowMultiple=false] - Whether multiple options can be selected.
|
|
197
220
|
* @param {boolean} [props.loading=false] - Whether to show a loading spinner in the dropdown.
|
|
198
|
-
* @param {
|
|
199
|
-
* @param {React.ReactNode} [props.emptyState.icon] - An optional icon to display in the empty state.
|
|
221
|
+
* @param {AutocompleteEmptyState} [props.emptyState] - The content to display when there are no options.
|
|
200
222
|
* @param {function(Array<string>)} props.onSelect - Callback fired when the selection changes. Receives the new selected values.
|
|
201
223
|
* @param {React.ReactNode} props.textField - The activator for the dropdown, typically a `TextField` component.
|
|
202
224
|
* @param {string} [props.className] - Additional class names to apply to the component.
|
|
@@ -226,7 +248,7 @@ function attachPropToTextField(children, prop) {
|
|
|
226
248
|
var option = param.option, allowMultiple = param.allowMultiple, selected = param.selected, onSelect = param.onSelect, setShowOptionsPopover = param.setShowOptionsPopover;
|
|
227
249
|
var isChecked = selected.includes(option.value);
|
|
228
250
|
if (allowMultiple) {
|
|
229
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
251
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_Checkbox.default, {
|
|
230
252
|
label: option.label,
|
|
231
253
|
checked: isChecked,
|
|
232
254
|
onChange: function() {
|
|
@@ -252,7 +274,7 @@ function attachPropToTextField(children, prop) {
|
|
|
252
274
|
};
|
|
253
275
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
254
276
|
className: "".concat(classes).concat(className ? " ".concat(className) : ""),
|
|
255
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
277
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Popover.default, {
|
|
256
278
|
active: showOptionsPopover,
|
|
257
279
|
preferredPosition: preferredPosition,
|
|
258
280
|
preferredAlignment: preferredAlignment,
|
|
@@ -270,17 +292,17 @@ function attachPropToTextField(children, prop) {
|
|
|
270
292
|
zIndexOverride: zIndexOverride,
|
|
271
293
|
children: loading ? /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
272
294
|
className: "py-4 flex justify-center items-center",
|
|
273
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
295
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Spinner.default, {
|
|
274
296
|
size: "small"
|
|
275
297
|
})
|
|
276
298
|
}) : showEmptyState ? /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
277
299
|
className: "py-4 flex flex-col gap-1 justify-center items-center",
|
|
278
300
|
children: [
|
|
279
|
-
emptyState.icon && /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
301
|
+
emptyState.icon && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Icon.default, {
|
|
280
302
|
source: _polarisicons.SearchMinor,
|
|
281
303
|
color: "subdued"
|
|
282
304
|
}),
|
|
283
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
305
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
|
|
284
306
|
children: emptyState.content
|
|
285
307
|
})
|
|
286
308
|
]
|
|
@@ -289,7 +311,7 @@ function attachPropToTextField(children, prop) {
|
|
|
289
311
|
children: options.map(function(option, index) {
|
|
290
312
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
291
313
|
children: [
|
|
292
|
-
option.title && /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
314
|
+
option.title && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
|
|
293
315
|
variant: "bodyMd",
|
|
294
316
|
color: "subdued",
|
|
295
317
|
className: "pb-1",
|
|
@@ -336,7 +358,7 @@ Autocomplete.displayName = "Autocomplete";
|
|
|
336
358
|
* />
|
|
337
359
|
*/ Autocomplete.TextField = function AutocompleteTextField() {
|
|
338
360
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
339
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
361
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_TextField.default, _object_spread_props(_object_spread({}, props), {
|
|
340
362
|
onFocus: function() {
|
|
341
363
|
if (props.onTextFieldFocus) {
|
|
342
364
|
props.onTextFieldFocus();
|
|
@@ -197,7 +197,7 @@ var progressBadgeStyles = (0, _tailwindvariants.tv)({
|
|
|
197
197
|
}
|
|
198
198
|
});
|
|
199
199
|
/**
|
|
200
|
-
* Badge component with
|
|
200
|
+
* A Badge component that renders a small, colored label with a status or progress indicator. The badge can be configured with different statuses, progress states, and sizes.
|
|
201
201
|
*
|
|
202
202
|
* @component
|
|
203
203
|
* @param {object} props - Component properties.
|
|
@@ -205,6 +205,7 @@ var progressBadgeStyles = (0, _tailwindvariants.tv)({
|
|
|
205
205
|
* @param {"complete" | "incomplete" | "partiallyComplete" | null} [props.progress] - Progress state of the badge.
|
|
206
206
|
* @param {boolean} [props.capitalize] - Capitalize the first letter of the badge.
|
|
207
207
|
* @param {"default" | "info" | "success" | "warning" | "critical" | "attention" | "highlight"} [props.status="default"] - Status variant to style the badge.
|
|
208
|
+
* @param {string} [props.className] - Additional CSS classes to apply to the badge.
|
|
208
209
|
* @returns {JSX.Element} - Rendered Badge component with optional progress indicator.
|
|
209
210
|
*/ function Badge() {
|
|
210
211
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
@@ -10,8 +10,17 @@ 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 _Spinner = /*#__PURE__*/ _interop_require_default(require("./Spinner"));
|
|
15
|
+
var _Text = /*#__PURE__*/ _interop_require_default(require("./Text"));
|
|
16
|
+
var _Button = /*#__PURE__*/ _interop_require_default(require("./Button"));
|
|
17
|
+
var _Link = /*#__PURE__*/ _interop_require_default(require("./Link"));
|
|
14
18
|
var _polarisicons = require("@shopify/polaris-icons");
|
|
19
|
+
function _interop_require_default(obj) {
|
|
20
|
+
return obj && obj.__esModule ? obj : {
|
|
21
|
+
default: obj
|
|
22
|
+
};
|
|
23
|
+
}
|
|
15
24
|
var styles = (0, _tailwindvariants.tv)({
|
|
16
25
|
base: "Litho-Banner relative rounded-md shadow-card bg-surface-highest outline outline-tint-3"
|
|
17
26
|
});
|
|
@@ -96,33 +105,28 @@ var STATUS_STYLES = {
|
|
|
96
105
|
/**
|
|
97
106
|
* @typedef {'neutral' | 'critical' | 'highlight' | 'success' | 'warning' | 'info' | 'caution' | 'attention'} BannerStatus
|
|
98
107
|
*/ /**
|
|
108
|
+
* @typedef BannerAction
|
|
109
|
+
* @property {string} content - The button label text
|
|
110
|
+
* @property {boolean} [primary=false] - Whether the button should have primary styling
|
|
111
|
+
* @property {boolean} [disabled=false] - Whether the button is disabled
|
|
112
|
+
* @property {boolean} [loading=false] - Whether to show a loading state
|
|
113
|
+
* @property {Function} [onAction] - Click handler for the action
|
|
114
|
+
* @property {string} [url] - URL to navigate to when clicked (opens in new tab)
|
|
115
|
+
*/ /**
|
|
99
116
|
* A Banner component that displays a styled banner with customizable title, status, icon, actions, and dismiss functionality.
|
|
100
117
|
* The banner style and content change based on the provided props, allowing for various statuses and themes.
|
|
101
118
|
*
|
|
102
119
|
* @component
|
|
103
120
|
*
|
|
104
121
|
* @param {Object} props - The properties for configuring the Banner component.
|
|
105
|
-
* @param {string} [props.title
|
|
122
|
+
* @param {string} [props.title] - The title text for the banner. If not provided, no title will be displayed.
|
|
106
123
|
* @param {BannerStatus} [props.status='neutral'] - The status of the banner, which determines its color and icon.
|
|
107
|
-
* @param {Function} [props.onDismiss
|
|
108
|
-
* @param {React.ReactNode} [props.children
|
|
109
|
-
* @param {
|
|
110
|
-
* @param {
|
|
111
|
-
* @param {
|
|
112
|
-
* @param {boolean} [props.
|
|
113
|
-
* @param {boolean} [props.action.loading=false] - Whether to show a loading state
|
|
114
|
-
* @param {Function} [props.action.onAction] - Click handler for the action
|
|
115
|
-
* @param {string} [props.action.url] - URL to navigate to when clicked (opens in new tab)
|
|
116
|
-
* @param {Object} [props.secondaryAction=null] - Secondary action configuration object
|
|
117
|
-
* @param {string} props.secondaryAction.content - The action label text
|
|
118
|
-
* @param {boolean} [props.secondaryAction.link=false] - Whether to render as a link instead of a button
|
|
119
|
-
* @param {boolean} [props.secondaryAction.monochrome=false] - Whether the link should be monochrome (only applies if link=true)
|
|
120
|
-
* @param {boolean} [props.secondaryAction.disabled=false] - Whether the action is disabled
|
|
121
|
-
* @param {boolean} [props.secondaryAction.loading=false] - Whether to show a loading state
|
|
122
|
-
* @param {Function} [props.secondaryAction.onAction] - Click handler for the action
|
|
123
|
-
* @param {string} [props.secondaryAction.url] - URL to navigate to when clicked (opens in new tab)
|
|
124
|
-
* @param {FunctionComponent} [props.icon=null] - Custom icon to display on the banner. If not provided, a default icon is used based on the status.
|
|
125
|
-
* @param {boolean} [props.spinner=false] - Shows a spinner icon instead of a status icon when set to true.
|
|
124
|
+
* @param {Function} [props.onDismiss] - Callback function to handle the banner's dismiss action.
|
|
125
|
+
* @param {React.ReactNode} [props.children] - Additional content to display within the banner.
|
|
126
|
+
* @param {BannerAction} [props.action] - Primary action configuration object
|
|
127
|
+
* @param {BannerAction} [props.secondaryAction] - Secondary action configuration object
|
|
128
|
+
* @param {FunctionComponent} [props.icon] - Custom icon to display on the banner. If not provided, a default icon is used based on the status.
|
|
129
|
+
* @param {boolean} [props.spinner] - Shows a spinner icon instead of a status icon when set to true.
|
|
126
130
|
*
|
|
127
131
|
* @returns {JSX.Element} The rendered Banner component.
|
|
128
132
|
*
|
|
@@ -155,10 +159,10 @@ var STATUS_STYLES = {
|
|
|
155
159
|
/*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
156
160
|
className: "Litho-Banner__Icon_Container flex-none p-3 pr-2",
|
|
157
161
|
children: [
|
|
158
|
-
spinner && /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
162
|
+
spinner && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Spinner.default, {
|
|
159
163
|
size: "small"
|
|
160
164
|
}),
|
|
161
|
-
icon && !spinner && /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
165
|
+
icon && !spinner && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Icon.default, {
|
|
162
166
|
source: icon,
|
|
163
167
|
color: statusColors.icon || ""
|
|
164
168
|
}),
|
|
@@ -168,18 +172,18 @@ var STATUS_STYLES = {
|
|
|
168
172
|
"warning",
|
|
169
173
|
"attention",
|
|
170
174
|
"success"
|
|
171
|
-
].includes(status) && /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
175
|
+
].includes(status) && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Icon.default, {
|
|
172
176
|
source: _polarisicons.CircleInformationMajor,
|
|
173
177
|
color: statusColors.icon
|
|
174
178
|
}),
|
|
175
179
|
[
|
|
176
180
|
"warning",
|
|
177
181
|
"attention"
|
|
178
|
-
].includes(status) && /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
182
|
+
].includes(status) && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Icon.default, {
|
|
179
183
|
source: _polarisicons.CircleAlertMajor,
|
|
180
184
|
color: statusColors.icon
|
|
181
185
|
}),
|
|
182
|
-
status === "success" && /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
186
|
+
status === "success" && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Icon.default, {
|
|
183
187
|
source: _polarisicons.TickMinor,
|
|
184
188
|
color: statusColors.icon
|
|
185
189
|
})
|
|
@@ -189,7 +193,7 @@ var STATUS_STYLES = {
|
|
|
189
193
|
}),
|
|
190
194
|
/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
191
195
|
className: "Litho-Banner__Title grow py-3",
|
|
192
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
196
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
|
|
193
197
|
variant: "headingSm",
|
|
194
198
|
color: statusColors.fg,
|
|
195
199
|
children: title
|
|
@@ -202,7 +206,7 @@ var STATUS_STYLES = {
|
|
|
202
206
|
className: closeIconStyles({
|
|
203
207
|
status: status
|
|
204
208
|
}),
|
|
205
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
209
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Icon.default, {
|
|
206
210
|
source: _polarisicons.CancelMinor,
|
|
207
211
|
color: statusColors.icon
|
|
208
212
|
})
|
|
@@ -222,7 +226,7 @@ var STATUS_STYLES = {
|
|
|
222
226
|
(action || secondaryAction) && /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
223
227
|
className: "Litho-Banner__Actions flex items-center gap-2".concat((secondaryAction === null || secondaryAction === void 0 ? void 0 : secondaryAction.link) ? " gap-3" : "").concat(children ? " pt-2" : ""),
|
|
224
228
|
children: [
|
|
225
|
-
action && /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
229
|
+
action && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Button.default, {
|
|
226
230
|
primary: action.primary,
|
|
227
231
|
disabled: action.disabled,
|
|
228
232
|
loading: action.loading,
|
|
@@ -233,7 +237,7 @@ var STATUS_STYLES = {
|
|
|
233
237
|
},
|
|
234
238
|
children: action.content
|
|
235
239
|
}),
|
|
236
|
-
secondaryAction && !secondaryAction.link && /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
240
|
+
secondaryAction && !secondaryAction.link && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Button.default, {
|
|
237
241
|
disabled: secondaryAction.disabled,
|
|
238
242
|
loading: secondaryAction.loading,
|
|
239
243
|
onClick: secondaryAction.onAction || function() {
|
|
@@ -243,7 +247,7 @@ var STATUS_STYLES = {
|
|
|
243
247
|
},
|
|
244
248
|
children: secondaryAction.content
|
|
245
249
|
}),
|
|
246
|
-
secondaryAction && secondaryAction.link && /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
250
|
+
secondaryAction && secondaryAction.link && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Link.default, {
|
|
247
251
|
monochrome: secondaryAction.monochrome,
|
|
248
252
|
disabled: secondaryAction.disabled,
|
|
249
253
|
loading: secondaryAction.loading,
|
|
@@ -197,9 +197,11 @@ var styles = (0, _tailwindvariants.tv)({
|
|
|
197
197
|
* @param {number | string} [props.maxWidth] - Maximum CSS width.
|
|
198
198
|
* @param {number | string} [props.zIndex] - CSS z-index.
|
|
199
199
|
* @param {Object} [props.style] - Additional inline styles for the Box.
|
|
200
|
+
* @param {string} [props.className] - Additional CSS classes to apply to the Box.
|
|
201
|
+
* @param {Function} [props.onClick] - Click handler for the Box.
|
|
200
202
|
*
|
|
201
203
|
* @returns {JSX.Element} A rendered Box component with customized styling.
|
|
202
|
-
*/
|
|
204
|
+
*/ var Box = function() {
|
|
203
205
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
204
206
|
var _props_as = props.as, as = _props_as === void 0 ? 'div' : _props_as, background = props.background, borderColor = props.borderColor, borderBlockStartWidth = props.borderBlockStartWidth, borderBlockEndWidth = props.borderBlockEndWidth, borderInlineStartWidth = props.borderInlineStartWidth, borderInlineEndWidth = props.borderInlineEndWidth, borderRadius = props.borderRadius, children = props.children, id = props.id, height = props.height, width = props.width, minHeight = props.minHeight, maxHeight = props.maxHeight, minWidth = props.minWidth, maxWidth = props.maxWidth, overflow = props.overflow, overflowX = props.overflowX, overflowY = props.overflowY, padding = props.padding, paddingBlockStart = props.paddingBlockStart, paddingBlockEnd = props.paddingBlockEnd, paddingInlineStart = props.paddingInlineStart, paddingInlineEnd = props.paddingInlineEnd, position = props.position, zIndex = props.zIndex, onClick = props.onClick, style = props.style, className = props.className;
|
|
205
207
|
var classes = styles({
|
|
@@ -236,12 +238,12 @@ var styles = (0, _tailwindvariants.tv)({
|
|
|
236
238
|
maxWidth: maxWidth
|
|
237
239
|
});
|
|
238
240
|
var Element = as;
|
|
239
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
241
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
240
242
|
id: id,
|
|
241
243
|
className: "".concat(classes).concat(className ? " ".concat(className) : ""),
|
|
242
244
|
style: inlineStyles,
|
|
243
245
|
onClick: onClick,
|
|
244
246
|
children: children
|
|
245
247
|
});
|
|
246
|
-
}
|
|
248
|
+
};
|
|
247
249
|
var _default = Box;
|