@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
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** @type {import('tailwindcss').Config} */ "use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return _default;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
var _default = {
|
|
12
|
+
content: [
|
|
13
|
+
"./components/**/*.{js,jsx,ts,tsx}",
|
|
14
|
+
"./stories/**/*.{js,jsx,ts,tsx,mdx}",
|
|
15
|
+
"./.storybook/**/*.{js,jsx,ts,tsx}"
|
|
16
|
+
]
|
|
17
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get extractComponents () {
|
|
13
|
+
return extractComponents;
|
|
14
|
+
},
|
|
15
|
+
get extractRenderContent () {
|
|
16
|
+
return extractRenderContent;
|
|
17
|
+
},
|
|
18
|
+
get transformStorySource () {
|
|
19
|
+
return transformStorySource;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
var transformStorySource = function(code) {
|
|
23
|
+
// Look for render function and extract its content
|
|
24
|
+
// This regex looks for render: () => and captures everything until the next comma or end of string
|
|
25
|
+
var renderMatch = code.match(/render:\s*\(\)\s*=>\s*([\s\S]*?)(?=,\s*parameters|,\s*args|$)/);
|
|
26
|
+
if (renderMatch) {
|
|
27
|
+
var jsxContent = renderMatch[1].trim();
|
|
28
|
+
// Handle different ways the JSX might end
|
|
29
|
+
// Remove trailing semicolon only if it's the very last character
|
|
30
|
+
if (jsxContent.endsWith(';')) {
|
|
31
|
+
jsxContent = jsxContent.slice(0, -1).trim();
|
|
32
|
+
}
|
|
33
|
+
// If the content is wrapped in parentheses, remove them
|
|
34
|
+
if (jsxContent.startsWith('(') && jsxContent.endsWith(')')) {
|
|
35
|
+
jsxContent = jsxContent.slice(1, -1).trim();
|
|
36
|
+
}
|
|
37
|
+
return jsxContent;
|
|
38
|
+
}
|
|
39
|
+
return code;
|
|
40
|
+
};
|
|
41
|
+
var extractComponents = function(componentName) {
|
|
42
|
+
return function(code) {
|
|
43
|
+
var componentRegex = new RegExp("<".concat(componentName, "[^>]*>[\\s\\S]*?<\\/").concat(componentName, ">"), 'g');
|
|
44
|
+
var matches = code.match(componentRegex);
|
|
45
|
+
if (matches) {
|
|
46
|
+
return matches.join('\n\n');
|
|
47
|
+
}
|
|
48
|
+
return code;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
var extractRenderContent = function(code) {
|
|
52
|
+
var renderMatch = code.match(/render:\s*\(\)\s*=>\s*([\s\S]*?)(?=,\s*parameters|,\s*args|$)/);
|
|
53
|
+
if (renderMatch) {
|
|
54
|
+
var jsxContent = renderMatch[1].trim();
|
|
55
|
+
// Remove trailing semicolon
|
|
56
|
+
if (jsxContent.endsWith(';')) {
|
|
57
|
+
jsxContent = jsxContent.slice(0, -1).trim();
|
|
58
|
+
}
|
|
59
|
+
// Remove wrapper parentheses
|
|
60
|
+
if (jsxContent.startsWith('(') && jsxContent.endsWith(')')) {
|
|
61
|
+
jsxContent = jsxContent.slice(1, -1).trim();
|
|
62
|
+
}
|
|
63
|
+
return jsxContent;
|
|
64
|
+
}
|
|
65
|
+
return code;
|
|
66
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return _default;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
var _vite = require("vite");
|
|
12
|
+
var _pluginreact = /*#__PURE__*/ _interop_require_default(require("@vitejs/plugin-react"));
|
|
13
|
+
var _postcss = /*#__PURE__*/ _interop_require_default(require("@tailwindcss/postcss"));
|
|
14
|
+
function _interop_require_default(obj) {
|
|
15
|
+
return obj && obj.__esModule ? obj : {
|
|
16
|
+
default: obj
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
var _default = (0, _vite.defineConfig)({
|
|
20
|
+
plugins: [
|
|
21
|
+
(0, _pluginreact.default)()
|
|
22
|
+
],
|
|
23
|
+
esbuild: {
|
|
24
|
+
loader: 'jsx',
|
|
25
|
+
include: /src\/.*\.[jt]sx?$/,
|
|
26
|
+
exclude: []
|
|
27
|
+
},
|
|
28
|
+
optimizeDeps: {
|
|
29
|
+
esbuildOptions: {
|
|
30
|
+
loader: {
|
|
31
|
+
'.js': 'jsx'
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
});
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import React, { useEffect, useRef } from "react";
|
|
4
4
|
import { tv } from "tailwind-variants";
|
|
5
|
-
import
|
|
5
|
+
import Icon from "./Icon.js";
|
|
6
|
+
import Text from "./Text.js";
|
|
7
|
+
import Tooltip from "./Tooltip.js";
|
|
6
8
|
import { MobileHorizontalDotsMajor } from "@shopify/polaris-icons";
|
|
7
9
|
var styles = tv({
|
|
8
10
|
base: "Litho-ActionList",
|
|
@@ -43,18 +45,38 @@ var itemStyles = tv({
|
|
|
43
45
|
}
|
|
44
46
|
});
|
|
45
47
|
/**
|
|
48
|
+
* @typedef {Object} SecondaryAction
|
|
49
|
+
* @property {React.FunctionComponent<React.SVGProps<SVGSVGElement>>} icon - The icon to display for the secondary action.
|
|
50
|
+
* @property {string} tooltip - The tooltip to display for the secondary action.
|
|
51
|
+
* @property {function} onAction - The function to call when the secondary action is selected.
|
|
52
|
+
*/ /**
|
|
53
|
+
* @typedef {Object} ActionListSection
|
|
54
|
+
* @property {string} title - The title of the section.
|
|
55
|
+
* @property {Array<ActionListItem>} items - The items to display in the section.
|
|
56
|
+
*/ /**
|
|
57
|
+
* @typedef {Object} ActionListItem - An object representing an item in the action list.
|
|
58
|
+
* @property {string} content - The text content of the action item.
|
|
59
|
+
* @property {boolean} disabled - Whether the action item is disabled.
|
|
60
|
+
* @property {boolean} destructive - Whether the action item is destructive.
|
|
61
|
+
* @property {React.FunctionComponent<React.SVGProps<SVGSVGElement>>} icon - The icon to display for the action item.
|
|
62
|
+
* @property {function} onAction - The function to call when the action item is selected.
|
|
63
|
+
* @property {React.ReactNode} prefix - The prefix to display for the action item.
|
|
64
|
+
* @property {string} imageUrl - The image to display for the action item.
|
|
65
|
+
* @property {string} url - The URL to navigate to when the action item is selected.
|
|
66
|
+
* @property {SecondaryAction} secondaryAction - The secondary action to display for the action item.
|
|
67
|
+
*/ /**
|
|
46
68
|
* ActionList component renders a list of actionable items with optional sections.
|
|
47
69
|
* Supports keyboard navigation and action triggers on item selection.
|
|
48
70
|
*
|
|
49
71
|
* @component
|
|
50
72
|
* @param {Object} props - Component properties.
|
|
51
|
-
* @param {Array} [props.sections] - Sections containing items for the action list.
|
|
52
|
-
*
|
|
53
|
-
* @param {Array} [props.items] - List of items to render in the action list when no sections are provided.
|
|
73
|
+
* @param {Array<{title: string, items: Array<ActionListItem>}>} [props.sections] - Sections containing items for the action list.
|
|
74
|
+
* @param {Array<ActionListItem>} [props.items] - List of items to render in the action list when no sections are provided.
|
|
54
75
|
* @param {string} [props.iconColor="subdued"] - Default color for icons in the action items.
|
|
55
76
|
* @param {function} [props.onActionAnyItem] - Callback function invoked whenever any action item is selected.
|
|
56
77
|
* @param {boolean} [props.fullWidth=false] - Whether to apply full width styling to the action list.
|
|
57
|
-
* @param {boolean} [props.
|
|
78
|
+
* @param {boolean} [props.padded=true] - Whether to apply padding to the action list.
|
|
79
|
+
* @param {string} [props.className] - Additional CSS classes to apply to the action list.
|
|
58
80
|
* @example
|
|
59
81
|
* const items = [{ content: 'Item 1', onAction: () => {} }];
|
|
60
82
|
* <ActionList items={items} />
|
|
@@ -113,7 +135,7 @@ var itemStyles = tv({
|
|
|
113
135
|
}
|
|
114
136
|
var ActionListItem = function(param) {
|
|
115
137
|
var item = param.item, index = param.index;
|
|
116
|
-
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;
|
|
138
|
+
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;
|
|
117
139
|
var iconColor = disabled ? "disabled" : destructive ? "critical" : _iconColor;
|
|
118
140
|
var textColor = disabled ? "disabled" : destructive ? "critical" : "default";
|
|
119
141
|
var itemClasses = itemStyles({
|
|
@@ -164,13 +186,20 @@ var itemStyles = tv({
|
|
|
164
186
|
className: "w-5 h-5 rounded-sm"
|
|
165
187
|
})
|
|
166
188
|
}) : null,
|
|
167
|
-
/*#__PURE__*/
|
|
189
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
168
190
|
className: "flex-1",
|
|
169
|
-
children:
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
191
|
+
children: [
|
|
192
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
193
|
+
color: textColor,
|
|
194
|
+
truncate: true,
|
|
195
|
+
children: content
|
|
196
|
+
}),
|
|
197
|
+
description && /*#__PURE__*/ _jsx(Text, {
|
|
198
|
+
color: "subdued",
|
|
199
|
+
variant: "bodySm",
|
|
200
|
+
children: description
|
|
201
|
+
})
|
|
202
|
+
]
|
|
174
203
|
}),
|
|
175
204
|
(secondaryAction === null || secondaryAction === void 0 ? void 0 : secondaryAction.tooltip) ? /*#__PURE__*/ _jsx(Tooltip, {
|
|
176
205
|
content: secondaryAction.tooltip,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { tv } from "tailwind-variants";
|
|
3
|
-
import
|
|
3
|
+
import Text from "./Text.js";
|
|
4
|
+
import Icon from "./Icon.js";
|
|
4
5
|
var styles = tv({
|
|
5
6
|
base: "Litho-AnnouncementBar text-center p-2 min-h-10 flex items-center justify-center bg-brand",
|
|
6
7
|
variants: {
|
|
@@ -29,6 +30,7 @@ var iconContainerStyles = tv({
|
|
|
29
30
|
* @param {string} props.content - Text content to be displayed.
|
|
30
31
|
* @param {string} [props.icon] - Icon source name.
|
|
31
32
|
* @param {"bounce"} [props.animateIcon] - Animation type for the icon.
|
|
33
|
+
* @param {boolean} [props.fixed] - Whether to fix the announcement bar to the top of the page.
|
|
32
34
|
*
|
|
33
35
|
* @returns {JSX.Element} AnnouncementBar component.
|
|
34
36
|
*/ function AnnouncementBar() {
|
|
@@ -57,7 +57,16 @@ import React, { createContext, useState, useEffect, useContext } from "react";
|
|
|
57
57
|
/**
|
|
58
58
|
* @returns {DarkModeContextType}
|
|
59
59
|
*/ export var useDarkMode = function() {
|
|
60
|
-
|
|
60
|
+
var context = useContext(DarkModeContext);
|
|
61
|
+
if (!context) {
|
|
62
|
+
return {
|
|
63
|
+
darkModeAvailable: false,
|
|
64
|
+
darkMode: false,
|
|
65
|
+
toggleDarkMode: function() {},
|
|
66
|
+
setDarkModeAvailable: function() {}
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
return context;
|
|
61
70
|
};
|
|
62
71
|
export var FrameContext = /*#__PURE__*/ createContext({
|
|
63
72
|
embedded: false,
|
|
@@ -112,7 +112,12 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
112
112
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
113
113
|
import React, { cloneElement, isValidElement, useState } from "react";
|
|
114
114
|
import { tv } from "tailwind-variants";
|
|
115
|
-
import
|
|
115
|
+
import Popover from "./Popover.js";
|
|
116
|
+
import TextField from "./TextField.js";
|
|
117
|
+
import Checkbox from "./Checkbox.js";
|
|
118
|
+
import Spinner from "./Spinner.js";
|
|
119
|
+
import Text from "./Text.js";
|
|
120
|
+
import Icon from "./Icon.js";
|
|
116
121
|
import { SearchMinor } from "@shopify/polaris-icons";
|
|
117
122
|
var styles = tv({
|
|
118
123
|
base: "Litho-Autocomplete flex flex-col"
|
|
@@ -134,18 +139,30 @@ function attachPropToTextField(children, prop) {
|
|
|
134
139
|
});
|
|
135
140
|
}
|
|
136
141
|
/**
|
|
142
|
+
* @typedef {Object} AutocompleteOption
|
|
143
|
+
* @property {string} label - The label to display for the option.
|
|
144
|
+
* @property {string} value - The value to associate with the option.
|
|
145
|
+
* @property {string} [title] - An optional title to display for the option.
|
|
146
|
+
* @property {boolean} [allowMultiple] - Whether multiple options can be selected.
|
|
147
|
+
* @property {string} [selected] - The value of the option that is currently selected.
|
|
148
|
+
* @property {function} [onSelect] - The function to call when the option is selected.
|
|
149
|
+
* @property {Array<AutocompleteOption>} [options] - An optional array of sub-options to display for the option.
|
|
150
|
+
*/ /**
|
|
151
|
+
* @typedef {Object} AutocompleteEmptyState
|
|
152
|
+
* @property {string} content - The content to display in the empty state.
|
|
153
|
+
* @property {React.ReactNode} icon - An optional icon to display in the empty state.
|
|
154
|
+
*/ /**
|
|
137
155
|
* Autocomplete component that provides a flexible dropdown menu with search and selection capabilities.
|
|
138
156
|
*
|
|
139
157
|
* @component
|
|
140
158
|
* @param {Object} props - The props for the Autocomplete component.
|
|
141
|
-
* @param {Array<
|
|
159
|
+
* @param {Array<AutocompleteOption>} props.options - The options to display in the dropdown.
|
|
142
160
|
* @param {Array<string>} props.selected - The currently selected option values.
|
|
143
161
|
* @param {"below"|"above"} [props.preferredPosition="below"] - The preferred position of the dropdown relative to the activator.
|
|
144
162
|
* @param {"left"|"center"|"right"} [props.preferredAlignment="left"] - The preferred alignment of the dropdown.
|
|
145
163
|
* @param {boolean} [props.allowMultiple=false] - Whether multiple options can be selected.
|
|
146
164
|
* @param {boolean} [props.loading=false] - Whether to show a loading spinner in the dropdown.
|
|
147
|
-
* @param {
|
|
148
|
-
* @param {React.ReactNode} [props.emptyState.icon] - An optional icon to display in the empty state.
|
|
165
|
+
* @param {AutocompleteEmptyState} [props.emptyState] - The content to display when there are no options.
|
|
149
166
|
* @param {function(Array<string>)} props.onSelect - Callback fired when the selection changes. Receives the new selected values.
|
|
150
167
|
* @param {React.ReactNode} props.textField - The activator for the dropdown, typically a `TextField` component.
|
|
151
168
|
* @param {string} [props.className] - Additional class names to apply to the component.
|
|
@@ -187,7 +187,7 @@ var progressBadgeStyles = tv({
|
|
|
187
187
|
}
|
|
188
188
|
});
|
|
189
189
|
/**
|
|
190
|
-
* Badge component with
|
|
190
|
+
* 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.
|
|
191
191
|
*
|
|
192
192
|
* @component
|
|
193
193
|
* @param {object} props - Component properties.
|
|
@@ -195,6 +195,7 @@ var progressBadgeStyles = tv({
|
|
|
195
195
|
* @param {"complete" | "incomplete" | "partiallyComplete" | null} [props.progress] - Progress state of the badge.
|
|
196
196
|
* @param {boolean} [props.capitalize] - Capitalize the first letter of the badge.
|
|
197
197
|
* @param {"default" | "info" | "success" | "warning" | "critical" | "attention" | "highlight"} [props.status="default"] - Status variant to style the badge.
|
|
198
|
+
* @param {string} [props.className] - Additional CSS classes to apply to the badge.
|
|
198
199
|
* @returns {JSX.Element} - Rendered Badge component with optional progress indicator.
|
|
199
200
|
*/ function Badge() {
|
|
200
201
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
@@ -221,5 +222,4 @@ var progressBadgeStyles = tv({
|
|
|
221
222
|
]
|
|
222
223
|
});
|
|
223
224
|
}
|
|
224
|
-
;
|
|
225
225
|
export default Badge;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { tv } from "tailwind-variants";
|
|
3
|
-
import
|
|
3
|
+
import Icon from "./Icon.js";
|
|
4
|
+
import Spinner from "./Spinner.js";
|
|
5
|
+
import Text from "./Text.js";
|
|
6
|
+
import Button from "./Button.js";
|
|
7
|
+
import Link from "./Link.js";
|
|
4
8
|
import { CancelMinor, CircleAlertMajor, CircleInformationMajor, TickMinor } from "@shopify/polaris-icons";
|
|
5
9
|
var styles = tv({
|
|
6
10
|
base: "Litho-Banner relative rounded-md shadow-card bg-surface-highest outline outline-tint-3"
|
|
@@ -86,33 +90,28 @@ var STATUS_STYLES = {
|
|
|
86
90
|
/**
|
|
87
91
|
* @typedef {'neutral' | 'critical' | 'highlight' | 'success' | 'warning' | 'info' | 'caution' | 'attention'} BannerStatus
|
|
88
92
|
*/ /**
|
|
93
|
+
* @typedef BannerAction
|
|
94
|
+
* @property {string} content - The button label text
|
|
95
|
+
* @property {boolean} [primary=false] - Whether the button should have primary styling
|
|
96
|
+
* @property {boolean} [disabled=false] - Whether the button is disabled
|
|
97
|
+
* @property {boolean} [loading=false] - Whether to show a loading state
|
|
98
|
+
* @property {Function} [onAction] - Click handler for the action
|
|
99
|
+
* @property {string} [url] - URL to navigate to when clicked (opens in new tab)
|
|
100
|
+
*/ /**
|
|
89
101
|
* A Banner component that displays a styled banner with customizable title, status, icon, actions, and dismiss functionality.
|
|
90
102
|
* The banner style and content change based on the provided props, allowing for various statuses and themes.
|
|
91
103
|
*
|
|
92
104
|
* @component
|
|
93
105
|
*
|
|
94
106
|
* @param {Object} props - The properties for configuring the Banner component.
|
|
95
|
-
* @param {string} [props.title
|
|
107
|
+
* @param {string} [props.title] - The title text for the banner. If not provided, no title will be displayed.
|
|
96
108
|
* @param {BannerStatus} [props.status='neutral'] - The status of the banner, which determines its color and icon.
|
|
97
|
-
* @param {Function} [props.onDismiss
|
|
98
|
-
* @param {React.ReactNode} [props.children
|
|
99
|
-
* @param {
|
|
100
|
-
* @param {
|
|
101
|
-
* @param {
|
|
102
|
-
* @param {boolean} [props.
|
|
103
|
-
* @param {boolean} [props.action.loading=false] - Whether to show a loading state
|
|
104
|
-
* @param {Function} [props.action.onAction] - Click handler for the action
|
|
105
|
-
* @param {string} [props.action.url] - URL to navigate to when clicked (opens in new tab)
|
|
106
|
-
* @param {Object} [props.secondaryAction=null] - Secondary action configuration object
|
|
107
|
-
* @param {string} props.secondaryAction.content - The action label text
|
|
108
|
-
* @param {boolean} [props.secondaryAction.link=false] - Whether to render as a link instead of a button
|
|
109
|
-
* @param {boolean} [props.secondaryAction.monochrome=false] - Whether the link should be monochrome (only applies if link=true)
|
|
110
|
-
* @param {boolean} [props.secondaryAction.disabled=false] - Whether the action is disabled
|
|
111
|
-
* @param {boolean} [props.secondaryAction.loading=false] - Whether to show a loading state
|
|
112
|
-
* @param {Function} [props.secondaryAction.onAction] - Click handler for the action
|
|
113
|
-
* @param {string} [props.secondaryAction.url] - URL to navigate to when clicked (opens in new tab)
|
|
114
|
-
* @param {FunctionComponent} [props.icon=null] - Custom icon to display on the banner. If not provided, a default icon is used based on the status.
|
|
115
|
-
* @param {boolean} [props.spinner=false] - Shows a spinner icon instead of a status icon when set to true.
|
|
109
|
+
* @param {Function} [props.onDismiss] - Callback function to handle the banner's dismiss action.
|
|
110
|
+
* @param {React.ReactNode} [props.children] - Additional content to display within the banner.
|
|
111
|
+
* @param {BannerAction} [props.action] - Primary action configuration object
|
|
112
|
+
* @param {BannerAction} [props.secondaryAction] - Secondary action configuration object
|
|
113
|
+
* @param {FunctionComponent} [props.icon] - Custom icon to display on the banner. If not provided, a default icon is used based on the status.
|
|
114
|
+
* @param {boolean} [props.spinner] - Shows a spinner icon instead of a status icon when set to true.
|
|
116
115
|
*
|
|
117
116
|
* @returns {JSX.Element} The rendered Banner component.
|
|
118
117
|
*
|
|
@@ -187,9 +187,11 @@ var styles = tv({
|
|
|
187
187
|
* @param {number | string} [props.maxWidth] - Maximum CSS width.
|
|
188
188
|
* @param {number | string} [props.zIndex] - CSS z-index.
|
|
189
189
|
* @param {Object} [props.style] - Additional inline styles for the Box.
|
|
190
|
+
* @param {string} [props.className] - Additional CSS classes to apply to the Box.
|
|
191
|
+
* @param {Function} [props.onClick] - Click handler for the Box.
|
|
190
192
|
*
|
|
191
193
|
* @returns {JSX.Element} A rendered Box component with customized styling.
|
|
192
|
-
*/
|
|
194
|
+
*/ var Box = function() {
|
|
193
195
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
194
196
|
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;
|
|
195
197
|
var classes = styles({
|
|
@@ -226,13 +228,12 @@ var styles = tv({
|
|
|
226
228
|
maxWidth: maxWidth
|
|
227
229
|
});
|
|
228
230
|
var Element = as;
|
|
229
|
-
return /*#__PURE__*/ _jsx(
|
|
231
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
230
232
|
id: id,
|
|
231
233
|
className: "".concat(classes).concat(className ? " ".concat(className) : ""),
|
|
232
234
|
style: inlineStyles,
|
|
233
235
|
onClick: onClick,
|
|
234
236
|
children: children
|
|
235
237
|
});
|
|
236
|
-
}
|
|
237
|
-
;
|
|
238
|
+
};
|
|
238
239
|
export default Box;
|
|
@@ -128,9 +128,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
128
128
|
import React, { useContext, useMemo, useState } from "react";
|
|
129
129
|
import { tv } from "tailwind-variants";
|
|
130
130
|
import { ButtonGroupContext } from "./ButtonGroup.js";
|
|
131
|
-
import
|
|
131
|
+
import ActionList from "./ActionList.js";
|
|
132
|
+
import Icon from "./Icon.js";
|
|
133
|
+
import Popover from "./Popover.js";
|
|
134
|
+
import Spinner from "./Spinner.js";
|
|
135
|
+
import Tooltip from "./Tooltip.js";
|
|
132
136
|
import { CaretDownMinor } from "@shopify/polaris-icons";
|
|
133
|
-
import {
|
|
137
|
+
import { useDarkMode } from "./AppProvider.js";
|
|
134
138
|
var styles = tv({
|
|
135
139
|
base: "Litho-Button relative flex items-center justify-center rounded-md border border-transparent overflow-hidden",
|
|
136
140
|
variants: {
|
|
@@ -173,6 +177,7 @@ var styles = tv({
|
|
|
173
177
|
},
|
|
174
178
|
size: {
|
|
175
179
|
stepper: "min-h-3.5 rounded-sm",
|
|
180
|
+
mini: "min-h-5 min-w-5",
|
|
176
181
|
small: "min-h-7 min-w-7",
|
|
177
182
|
medium: "min-h-8",
|
|
178
183
|
large: "min-h-8"
|
|
@@ -445,12 +450,18 @@ var contentStyles = tv({
|
|
|
445
450
|
false: ""
|
|
446
451
|
},
|
|
447
452
|
size: {
|
|
453
|
+
mini: "p-0",
|
|
448
454
|
small: "py-0.5",
|
|
449
455
|
large: "py-3",
|
|
450
456
|
medium: "py-1"
|
|
451
457
|
}
|
|
452
458
|
},
|
|
453
459
|
compoundVariants: [
|
|
460
|
+
{
|
|
461
|
+
size: "mini",
|
|
462
|
+
iconOnly: true,
|
|
463
|
+
class: "!px-0"
|
|
464
|
+
},
|
|
454
465
|
{
|
|
455
466
|
size: "small",
|
|
456
467
|
iconOnly: true,
|
|
@@ -700,7 +711,7 @@ var connectedDisclosureStyles = tv({
|
|
|
700
711
|
* @param {string} [props.ariaDescribedBy] - ID of the element that describes the button.
|
|
701
712
|
* @param {boolean} [props.ariaChecked] - Whether the button is checked (for toggle buttons).
|
|
702
713
|
* @param {React.Component} [props.icon] - Icon component to display within the button.
|
|
703
|
-
* @param {
|
|
714
|
+
* @param {"default" | "primary" | "secondary" | "plain" | "link" | "destructive" | "highlight"} [props.iconColor='default'] - Color of the icon.
|
|
704
715
|
* @param {boolean} [props.primary=false] - Whether to show the primary button style.
|
|
705
716
|
* @param {boolean} [props.highlight=false] - Whether to show the highlight button style.
|
|
706
717
|
* @param {boolean} [props.link=false] - Whether to show a link style.
|
|
@@ -708,12 +719,12 @@ var connectedDisclosureStyles = tv({
|
|
|
708
719
|
* @param {boolean} [props.disclosure=false] - Whether to show a disclosure arrow.
|
|
709
720
|
* @param {boolean} [props.disclosureRight=false] - Whether to show the disclosure on the right.
|
|
710
721
|
* @param {boolean} [props.plain=false] - Whether to show plain styling without background.
|
|
711
|
-
* @param {
|
|
722
|
+
* @param {"small" | "medium" | "large" | "stepper"} [props.size='medium'] - Size of the button ('small', 'medium', 'large', 'stepper').
|
|
712
723
|
* @param {boolean} [props.fullWidth] - Whether the button should take full width.
|
|
713
|
-
* @param {
|
|
724
|
+
* @param {"left" | "center" | "right"} [props.align='center'] - Alignment of the button content ('left', 'center', 'right').
|
|
714
725
|
* @param {string} [props.tooltip] - Tooltip to show when hovering over the button.
|
|
715
726
|
* @param {Object} [props.connectedDisclosure] - Configuration for connected disclosure menu.
|
|
716
|
-
* @param {Array} [props.connectedDisclosure.actions] - Actions to show in the disclosure menu.
|
|
727
|
+
* @param {Array<import("./ActionList").ActionListItem>} [props.connectedDisclosure.actions] - Actions to show in the disclosure menu.
|
|
717
728
|
* @param {string} [props.className] - Additional CSS classes for the button.
|
|
718
729
|
* @param {string} [props.contentClassName] - Additional CSS classes for the button content.
|
|
719
730
|
* @param {boolean} [props.rounded] - Whether to show fully rounded corners.
|
|
@@ -723,12 +734,15 @@ var connectedDisclosureStyles = tv({
|
|
|
723
734
|
* @returns {JSX.Element} The rendered Button component.
|
|
724
735
|
*
|
|
725
736
|
* @example
|
|
737
|
+
* ```js
|
|
726
738
|
* // Basic button
|
|
727
739
|
* <Button onClick={() => console.log('Clicked')}>
|
|
728
740
|
* Click me
|
|
729
741
|
* </Button>
|
|
742
|
+
* ```
|
|
730
743
|
*
|
|
731
744
|
* @example
|
|
745
|
+
* ```js
|
|
732
746
|
* // Primary button with icon and loading state
|
|
733
747
|
* <Button
|
|
734
748
|
* primary
|
|
@@ -738,8 +752,10 @@ var connectedDisclosureStyles = tv({
|
|
|
738
752
|
* >
|
|
739
753
|
* Save changes
|
|
740
754
|
* </Button>
|
|
755
|
+
* ```
|
|
741
756
|
*
|
|
742
757
|
* @example
|
|
758
|
+
* ```js
|
|
743
759
|
* // Button with connected disclosure
|
|
744
760
|
* <Button
|
|
745
761
|
* connectedDisclosure={{
|
|
@@ -751,9 +767,10 @@ var connectedDisclosureStyles = tv({
|
|
|
751
767
|
* >
|
|
752
768
|
* More actions
|
|
753
769
|
* </Button>
|
|
770
|
+
* ```
|
|
754
771
|
*/ function Button() {
|
|
755
772
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
756
|
-
var darkMode =
|
|
773
|
+
var darkMode = useDarkMode().darkMode;
|
|
757
774
|
var _useState = _sliced_to_array(useState(false), 2), showConnectedDisclosurePopover = _useState[0], setShowConnectedDisclosurePopover = _useState[1];
|
|
758
775
|
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, [
|
|
759
776
|
"id",
|
|
@@ -4,14 +4,14 @@ function _type_of(obj) {
|
|
|
4
4
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
5
5
|
}
|
|
6
6
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
7
|
-
import React
|
|
7
|
+
import React from "react";
|
|
8
8
|
import { tv } from "tailwind-variants";
|
|
9
|
-
import { FrameContext } from "./AppProvider.js";
|
|
10
9
|
import Button from "./Button.js";
|
|
11
10
|
import Icon from "./Icon.js";
|
|
12
11
|
import Spinner from "./Spinner.js";
|
|
13
12
|
import Text from "./Text.js";
|
|
14
13
|
import Tooltip from "./Tooltip.js";
|
|
14
|
+
import { useFrame } from "./Frame.js";
|
|
15
15
|
var styles = tv({
|
|
16
16
|
base: "Litho-Card relative",
|
|
17
17
|
variants: {
|
|
@@ -173,7 +173,7 @@ var bodyStyles = tv({
|
|
|
173
173
|
* @returns {React.ReactElement} The rendered Card component.
|
|
174
174
|
*/ var Card = function(param) {
|
|
175
175
|
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;
|
|
176
|
-
var embedded =
|
|
176
|
+
var embedded = useFrame().embedded;
|
|
177
177
|
var showHeader = !!(title || action);
|
|
178
178
|
var isClickable = !!onClick;
|
|
179
179
|
var classes = styles({
|
|
@@ -198,7 +198,8 @@ var bodyStyles = tv({
|
|
|
198
198
|
var firstSectionDetected = false;
|
|
199
199
|
function process(child) {
|
|
200
200
|
if (/*#__PURE__*/ React.isValidElement(child)) {
|
|
201
|
-
|
|
201
|
+
var _child_type;
|
|
202
|
+
if (((_child_type = child.type) === null || _child_type === void 0 ? void 0 : _child_type.displayName) === "Card.Section" && !firstSectionDetected) {
|
|
202
203
|
firstSectionDetected = true;
|
|
203
204
|
return /*#__PURE__*/ React.cloneElement(child, {
|
|
204
205
|
isFirst: true,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { tv } from "tailwind-variants";
|
|
3
|
-
import
|
|
3
|
+
import Icon from "./Icon.js";
|
|
4
|
+
import Label from "./Label.js";
|
|
5
|
+
import Text from "./Text.js";
|
|
4
6
|
import { TickMinor, MinusMajor } from "@shopify/polaris-icons";
|
|
5
7
|
var styles = tv({
|
|
6
8
|
base: "Litho-Checkbox group flex gap-2 py-1",
|
|
@@ -61,6 +63,9 @@ var checkboxStyles = tv({
|
|
|
61
63
|
* @param {boolean} [props.checked=false] - Indicates whether the checkbox is checked.
|
|
62
64
|
* @param {boolean} [props.disabled=false] - Indicates whether the checkbox is disabled.
|
|
63
65
|
* @param {string} [props.helpText] - Additional descriptive text for the checkbox.
|
|
66
|
+
* @param {React.ReactNode|import("./Tooltip").TooltipContentObject} [props.tooltip] - Tooltip content for the checkbox label.
|
|
67
|
+
* @param {boolean} [props.indeterminate=false] - Indicates whether the checkbox is in an indeterminate state (mixed/partial selection).
|
|
68
|
+
* @param {string} [props.className] - Additional CSS classes to apply to the checkbox container.
|
|
64
69
|
* @param {function} [props.onChange] - Callback function called when the checkbox state changes.
|
|
65
70
|
* @param {function} [props.onFocus] - Callback function called when the checkbox gains focus.
|
|
66
71
|
* @param {function} [props.onBlur] - Callback function called when the checkbox loses focus.
|
|
@@ -36,6 +36,12 @@ var styles = tv({
|
|
|
36
36
|
base: "Litho-ChoiceList flex flex-col gap-1"
|
|
37
37
|
});
|
|
38
38
|
/**
|
|
39
|
+
* @typedef {Object} ChoiceListItem
|
|
40
|
+
* @property {string} value - The value of the choice.
|
|
41
|
+
* @property {string} label - The display label of the choice.
|
|
42
|
+
* @property {boolean} [disabled=false] - Whether the choice is disabled.
|
|
43
|
+
* @property {React.ReactNode} [renderChildren] - A function that returns a React node to render as children of the choice.
|
|
44
|
+
*/ /**
|
|
39
45
|
* A ChoiceList component for rendering a list of selectable options.
|
|
40
46
|
*
|
|
41
47
|
* @component
|
|
@@ -44,10 +50,7 @@ var styles = tv({
|
|
|
44
50
|
* @param {string} [props.title] - The title of the choice list.
|
|
45
51
|
* @param {boolean} [props.titleHidden=false] - Whether to hide the title visually.
|
|
46
52
|
* @param {boolean} [props.allowMultiple=false] - Whether multiple selections are allowed.
|
|
47
|
-
* @param {Array} props.choices - The available choices for selection.
|
|
48
|
-
* @param {string} props.choices[].value - The value of the choice.
|
|
49
|
-
* @param {string} props.choices[].label - The display label of the choice.
|
|
50
|
-
* @param {boolean} [props.choices[].disabled=false] - Whether the choice is disabled.
|
|
53
|
+
* @param {Array<ChoiceListItem>} props.choices - The available choices for selection.
|
|
51
54
|
* @param {Array} props.selected - The currently selected values.
|
|
52
55
|
* @param {Function} props.onChange - Callback when the selection changes. Receives the updated array of selected values.
|
|
53
56
|
* @param {string} [props.error] - Error message to display, if any.
|
|
@@ -49,7 +49,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
49
49
|
import { useState } from "react";
|
|
50
50
|
import { SketchPicker } from "react-color";
|
|
51
51
|
import { tv } from "tailwind-variants";
|
|
52
|
-
import
|
|
52
|
+
import Text from "./Text.js";
|
|
53
53
|
var colorContainer = tv({
|
|
54
54
|
base: "Litho-ColorField relative flex items-center gap-2 cursor-pointer px-1 py-1 rounded-md w-full-plus-2 -left-1",
|
|
55
55
|
variants: {
|
|
@@ -118,7 +118,12 @@ import { useEffect, useState } from "react";
|
|
|
118
118
|
import { tv } from "tailwind-variants";
|
|
119
119
|
import dayjs from "dayjs";
|
|
120
120
|
import ReactDatePicker from "react-datepicker";
|
|
121
|
-
import
|
|
121
|
+
import Icon from "./Icon.js";
|
|
122
|
+
import Listbox from "./Listbox.js";
|
|
123
|
+
import Popover from "./Popover.js";
|
|
124
|
+
import Text from "./Text.js";
|
|
125
|
+
import TextField from "./TextField.js";
|
|
126
|
+
import TimePicker from "./TimePicker.js";
|
|
122
127
|
import { CalendarMinor, CalendarTimeMinor, ChevronLeftMinor, ChevronRightMinor } from "@shopify/polaris-icons";
|
|
123
128
|
import { enUS } from "date-fns/locale";
|
|
124
129
|
import { NOW_TODAY, DAY_FORMAT, DAY_TIME_FORMAT, TIME_FORMAT, MONTHS, RANGE_PRESETS, HOURLY_RANGE_PRESETS, DATE_LOCALE_MAP, isValidDate } from "../utilities/dates.js";
|