@heymantle/litho 0.0.1
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/LICENSE +21 -0
- package/README.md +90 -0
- package/dist/cjs/components/ActionList.js +267 -0
- package/dist/cjs/components/AnnouncementBar.js +73 -0
- package/dist/cjs/components/AppProvider.js +245 -0
- package/dist/cjs/components/Autocomplete.js +351 -0
- package/dist/cjs/components/Badge.js +234 -0
- package/dist/cjs/components/Banner.js +264 -0
- package/dist/cjs/components/Box.js +247 -0
- package/dist/cjs/components/Button.js +1018 -0
- package/dist/cjs/components/ButtonGroup.js +196 -0
- package/dist/cjs/components/Card.js +593 -0
- package/dist/cjs/components/Checkbox.js +175 -0
- package/dist/cjs/components/ChoiceList.js +160 -0
- package/dist/cjs/components/Collapsible.js +42 -0
- package/dist/cjs/components/ColorField.js +159 -0
- package/dist/cjs/components/ContextualSaveBar.js +53 -0
- package/dist/cjs/components/DatePicker.js +547 -0
- package/dist/cjs/components/Divider.js +50 -0
- package/dist/cjs/components/DropZone.js +547 -0
- package/dist/cjs/components/EmptyState.js +111 -0
- package/dist/cjs/components/Filters.js +874 -0
- package/dist/cjs/components/FooterHelp.js +48 -0
- package/dist/cjs/components/Form.js +44 -0
- package/dist/cjs/components/Frame.js +386 -0
- package/dist/cjs/components/FrameSaveBar.js +239 -0
- package/dist/cjs/components/Grid.js +151 -0
- package/dist/cjs/components/HorizontalStack.js +180 -0
- package/dist/cjs/components/Icon.js +346 -0
- package/dist/cjs/components/Image.js +191 -0
- package/dist/cjs/components/InlineError.js +57 -0
- package/dist/cjs/components/Label.js +78 -0
- package/dist/cjs/components/Layout.js +228 -0
- package/dist/cjs/components/LayoutSection.js +133 -0
- package/dist/cjs/components/Link.js +128 -0
- package/dist/cjs/components/List.js +69 -0
- package/dist/cjs/components/Listbox.js +211 -0
- package/dist/cjs/components/Loading.js +103 -0
- package/dist/cjs/components/Modal.js +449 -0
- package/dist/cjs/components/Navigation.js +331 -0
- package/dist/cjs/components/Page.js +529 -0
- package/dist/cjs/components/Pagination.js +109 -0
- package/dist/cjs/components/Pane.js +128 -0
- package/dist/cjs/components/Popover.js +365 -0
- package/dist/cjs/components/PopoverManager.js +34 -0
- package/dist/cjs/components/ProgressBar.js +124 -0
- package/dist/cjs/components/RadioButton.js +172 -0
- package/dist/cjs/components/RadioButtonCard.js +193 -0
- package/dist/cjs/components/RangeSlider.js +235 -0
- package/dist/cjs/components/ResourceList.js +105 -0
- package/dist/cjs/components/Select.js +300 -0
- package/dist/cjs/components/SkeletonText.js +130 -0
- package/dist/cjs/components/Spinner.js +72 -0
- package/dist/cjs/components/Table.js +1184 -0
- package/dist/cjs/components/Tabs.js +421 -0
- package/dist/cjs/components/Tag.js +165 -0
- package/dist/cjs/components/Text.js +274 -0
- package/dist/cjs/components/TextField.js +584 -0
- package/dist/cjs/components/Thumbnail.js +73 -0
- package/dist/cjs/components/TimePicker.js +23 -0
- package/dist/cjs/components/Tip.js +220 -0
- package/dist/cjs/components/Tooltip.js +431 -0
- package/dist/cjs/components/TopBar.js +210 -0
- package/dist/cjs/components/VerticalStack.js +161 -0
- package/dist/cjs/index.js +308 -0
- package/dist/cjs/styles/Table.js +591 -0
- package/dist/cjs/utilities/dates.js +339 -0
- package/dist/cjs/utilities/useIndexResourceState.js +175 -0
- package/dist/cjs/utilities/useMounted.js +67 -0
- package/dist/cjs/utilities/useTableScrollState.js +142 -0
- package/dist/esm/components/ActionList.js +216 -0
- package/dist/esm/components/AnnouncementBar.js +63 -0
- package/dist/esm/components/AppProvider.js +185 -0
- package/dist/esm/components/Autocomplete.js +300 -0
- package/dist/esm/components/Badge.js +225 -0
- package/dist/esm/components/Banner.js +254 -0
- package/dist/esm/components/Box.js +238 -0
- package/dist/esm/components/Button.js +967 -0
- package/dist/esm/components/ButtonGroup.js +137 -0
- package/dist/esm/components/Card.js +537 -0
- package/dist/esm/components/Checkbox.js +165 -0
- package/dist/esm/components/ChoiceList.js +145 -0
- package/dist/esm/components/Collapsible.js +32 -0
- package/dist/esm/components/ColorField.js +149 -0
- package/dist/esm/components/ContextualSaveBar.js +43 -0
- package/dist/esm/components/DatePicker.js +532 -0
- package/dist/esm/components/Divider.js +41 -0
- package/dist/esm/components/DropZone.js +537 -0
- package/dist/esm/components/EmptyState.js +101 -0
- package/dist/esm/components/Filters.js +823 -0
- package/dist/esm/components/FooterHelp.js +38 -0
- package/dist/esm/components/Form.js +35 -0
- package/dist/esm/components/Frame.js +376 -0
- package/dist/esm/components/FrameSaveBar.js +229 -0
- package/dist/esm/components/Grid.js +142 -0
- package/dist/esm/components/HorizontalStack.js +171 -0
- package/dist/esm/components/Icon.js +296 -0
- package/dist/esm/components/Image.js +141 -0
- package/dist/esm/components/InlineError.js +43 -0
- package/dist/esm/components/Label.js +63 -0
- package/dist/esm/components/Layout.js +164 -0
- package/dist/esm/components/LayoutSection.js +82 -0
- package/dist/esm/components/Link.js +119 -0
- package/dist/esm/components/List.js +61 -0
- package/dist/esm/components/Listbox.js +201 -0
- package/dist/esm/components/Loading.js +93 -0
- package/dist/esm/components/Modal.js +390 -0
- package/dist/esm/components/Navigation.js +321 -0
- package/dist/esm/components/Page.js +473 -0
- package/dist/esm/components/Pagination.js +99 -0
- package/dist/esm/components/Pane.js +118 -0
- package/dist/esm/components/Popover.js +350 -0
- package/dist/esm/components/PopoverManager.js +24 -0
- package/dist/esm/components/ProgressBar.js +114 -0
- package/dist/esm/components/RadioButton.js +157 -0
- package/dist/esm/components/RadioButtonCard.js +178 -0
- package/dist/esm/components/RangeSlider.js +225 -0
- package/dist/esm/components/ResourceList.js +95 -0
- package/dist/esm/components/Select.js +285 -0
- package/dist/esm/components/SkeletonText.js +120 -0
- package/dist/esm/components/Spinner.js +63 -0
- package/dist/esm/components/Table.js +1129 -0
- package/dist/esm/components/Tabs.js +366 -0
- package/dist/esm/components/Tag.js +151 -0
- package/dist/esm/components/Text.js +265 -0
- package/dist/esm/components/TextField.js +533 -0
- package/dist/esm/components/Thumbnail.js +63 -0
- package/dist/esm/components/TimePicker.js +13 -0
- package/dist/esm/components/Tip.js +169 -0
- package/dist/esm/components/Tooltip.js +380 -0
- package/dist/esm/components/TopBar.js +200 -0
- package/dist/esm/components/VerticalStack.js +152 -0
- package/dist/esm/index.js +61 -0
- package/dist/esm/styles/Table.js +581 -0
- package/dist/esm/utilities/dates.js +289 -0
- package/dist/esm/utilities/useIndexResourceState.js +158 -0
- package/dist/esm/utilities/useMounted.js +57 -0
- package/dist/esm/utilities/useTableScrollState.js +132 -0
- package/index.css +1137 -0
- package/package.json +53 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
function _array_like_to_array(arr, len) {
|
|
3
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
4
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
5
|
+
return arr2;
|
|
6
|
+
}
|
|
7
|
+
function _array_with_holes(arr) {
|
|
8
|
+
if (Array.isArray(arr)) return arr;
|
|
9
|
+
}
|
|
10
|
+
function _iterable_to_array_limit(arr, i) {
|
|
11
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
12
|
+
if (_i == null) return;
|
|
13
|
+
var _arr = [];
|
|
14
|
+
var _n = true;
|
|
15
|
+
var _d = false;
|
|
16
|
+
var _s, _e;
|
|
17
|
+
try {
|
|
18
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
19
|
+
_arr.push(_s.value);
|
|
20
|
+
if (i && _arr.length === i) break;
|
|
21
|
+
}
|
|
22
|
+
} catch (err) {
|
|
23
|
+
_d = true;
|
|
24
|
+
_e = err;
|
|
25
|
+
} finally{
|
|
26
|
+
try {
|
|
27
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
28
|
+
} finally{
|
|
29
|
+
if (_d) throw _e;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return _arr;
|
|
33
|
+
}
|
|
34
|
+
function _non_iterable_rest() {
|
|
35
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
36
|
+
}
|
|
37
|
+
function _sliced_to_array(arr, i) {
|
|
38
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
39
|
+
}
|
|
40
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
41
|
+
if (!o) return;
|
|
42
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
43
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
44
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
45
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
46
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
47
|
+
}
|
|
48
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
49
|
+
import { FrameContext } from "./AppProvider.js";
|
|
50
|
+
import { useContext, useState } from "react";
|
|
51
|
+
import { MobileAcceptMajor } from "@shopify/polaris-icons";
|
|
52
|
+
import { tv } from "tailwind-variants";
|
|
53
|
+
import { Icon } from "../index.js";
|
|
54
|
+
var styles = tv({
|
|
55
|
+
base: "Litho-Listbox__Option rounded-md cursor-pointer min-h-8 py-1 flex items-center justify-between pl-3 focus:outline-hidden active:ring-0",
|
|
56
|
+
variants: {
|
|
57
|
+
showIcon: {
|
|
58
|
+
true: "gap-2 pr-2",
|
|
59
|
+
false: "pr-3"
|
|
60
|
+
},
|
|
61
|
+
selected: {
|
|
62
|
+
true: "text-tab-active-fg bg-tab-active-bg hover:bg-tab-active-bg-hover active:bg-tab-active-bg-active",
|
|
63
|
+
false: "text-normal hover:text-highest hover"
|
|
64
|
+
},
|
|
65
|
+
removeVisualFocus: {
|
|
66
|
+
true: "",
|
|
67
|
+
false: "focus:ring-2 focus:ring-form-accent focus:border-form-border-accent"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
var containerStyles = tv({
|
|
72
|
+
base: "flex gap-0.5",
|
|
73
|
+
variants: {
|
|
74
|
+
displayHorizontallyOnMobile: {
|
|
75
|
+
true: "flex-row overflow-x-auto max-w-full pb-3 @sm:pb-0 @sm:flex-col",
|
|
76
|
+
false: "flex-col"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
defaultVariants: {
|
|
80
|
+
displayHorizontallyOnMobile: false
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
/**
|
|
84
|
+
* A customizable Listbox component for displaying a list of options with selectable states.
|
|
85
|
+
* The component supports keyboard navigation and optional icons for selected items.
|
|
86
|
+
*
|
|
87
|
+
* @component
|
|
88
|
+
* @param {Object} props - The properties object.
|
|
89
|
+
* @param {Array<Object>} props.options - Array of options to render in the listbox.
|
|
90
|
+
* Each option should be an object with the following properties:
|
|
91
|
+
* - `label` {string}: The display label of the option.
|
|
92
|
+
* - `value` {string | number}: The unique value of the option.
|
|
93
|
+
* - `selected` {boolean}: Whether the option is currently selected.
|
|
94
|
+
* - `onAction` {function}: A callback function invoked when the option is clicked or "Enter" is pressed.
|
|
95
|
+
* @param {boolean} [props.showIcon=false] - Determines whether to display an icon next to selected options.
|
|
96
|
+
* @param {React.ReactNode} [props.icon=MobileAcceptMajor] - The icon to display for selected options (default is `MobileAcceptMajor`).
|
|
97
|
+
* @param {boolean} [props.displayHorizontallyOnMobile=false] - Determines whether to display the listbox horizontally on mobile.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* const options = [
|
|
101
|
+
* { label: "Option 1", value: "opt1", selected: false, onAction: () => console.log("Option 1 clicked") },
|
|
102
|
+
* { label: "Option 2", value: "opt2", selected: true, onAction: () => console.log("Option 2 clicked") },
|
|
103
|
+
* ];
|
|
104
|
+
*
|
|
105
|
+
* <Listbox options={options} showIcon={true} icon={CustomIcon} />
|
|
106
|
+
*
|
|
107
|
+
* @returns {JSX.Element} The rendered Listbox component.
|
|
108
|
+
*/ function Listbox() {
|
|
109
|
+
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
110
|
+
var options = props.options, _props_showIcon = props.showIcon, showIcon = _props_showIcon === void 0 ? false : _props_showIcon, _props_displayHorizontallyOnMobile = props.displayHorizontallyOnMobile, displayHorizontallyOnMobile = _props_displayHorizontallyOnMobile === void 0 ? false : _props_displayHorizontallyOnMobile, _props_icon = props.icon, icon = _props_icon === void 0 ? MobileAcceptMajor : _props_icon;
|
|
111
|
+
var screenSizes = useContext(FrameContext).screenSizes;
|
|
112
|
+
var _useState = _sliced_to_array(useState(null), 2), removeVisualFocus = _useState[0], setRemoveVisualFocus = _useState[1];
|
|
113
|
+
var handleKeyDown = function(e, index) {
|
|
114
|
+
if (!options.length) return;
|
|
115
|
+
var currentElement = e.target;
|
|
116
|
+
var siblings = currentElement.parentNode.children;
|
|
117
|
+
switch(e.key){
|
|
118
|
+
case "ArrowDown":
|
|
119
|
+
e.preventDefault();
|
|
120
|
+
var nextElement = siblings[index + 1] || siblings[0];
|
|
121
|
+
nextElement.focus();
|
|
122
|
+
break;
|
|
123
|
+
case "ArrowUp":
|
|
124
|
+
e.preventDefault();
|
|
125
|
+
var prevElement = siblings[index - 1] || siblings[siblings.length - 1];
|
|
126
|
+
prevElement.focus();
|
|
127
|
+
break;
|
|
128
|
+
case "Enter":
|
|
129
|
+
var _options_index;
|
|
130
|
+
e.preventDefault();
|
|
131
|
+
if ((_options_index = options[index]) === null || _options_index === void 0 ? void 0 : _options_index.onAction) {
|
|
132
|
+
options[index].onAction();
|
|
133
|
+
}
|
|
134
|
+
break;
|
|
135
|
+
case "Escape":
|
|
136
|
+
e.preventDefault();
|
|
137
|
+
currentElement.blur();
|
|
138
|
+
break;
|
|
139
|
+
default:
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
var handleClick = function(e, index) {
|
|
144
|
+
var _options_index_onAction, _options_index;
|
|
145
|
+
(_options_index = options[index]) === null || _options_index === void 0 ? void 0 : (_options_index_onAction = _options_index.onAction) === null || _options_index_onAction === void 0 ? void 0 : _options_index_onAction.call(_options_index);
|
|
146
|
+
setRemoveVisualFocus(index);
|
|
147
|
+
if (window.innerWidth <= screenSizes.sm) {
|
|
148
|
+
e.currentTarget.scrollIntoView({
|
|
149
|
+
behavior: "smooth",
|
|
150
|
+
block: "nearest",
|
|
151
|
+
inline: "center"
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
if (!options.length) {
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
159
|
+
role: "listbox",
|
|
160
|
+
className: containerStyles({
|
|
161
|
+
displayHorizontallyOnMobile: displayHorizontallyOnMobile
|
|
162
|
+
}),
|
|
163
|
+
children: options.map(function(option, index) {
|
|
164
|
+
var selected = option.selected, label = option.label, value = option.value, onAction = option.onAction;
|
|
165
|
+
var classes = styles({
|
|
166
|
+
selected: selected,
|
|
167
|
+
showIcon: showIcon,
|
|
168
|
+
removeVisualFocus: removeVisualFocus === index
|
|
169
|
+
});
|
|
170
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
171
|
+
role: "option",
|
|
172
|
+
"aria-selected": selected,
|
|
173
|
+
className: classes,
|
|
174
|
+
tabIndex: 0,
|
|
175
|
+
onClick: function(e) {
|
|
176
|
+
return handleClick(e, index);
|
|
177
|
+
},
|
|
178
|
+
onBlur: function() {
|
|
179
|
+
return setRemoveVisualFocus(null);
|
|
180
|
+
},
|
|
181
|
+
onKeyDown: function(e) {
|
|
182
|
+
return handleKeyDown(e, index);
|
|
183
|
+
},
|
|
184
|
+
children: [
|
|
185
|
+
/*#__PURE__*/ _jsx("div", {
|
|
186
|
+
className: "whitespace-nowrap pointer-events-none w-full",
|
|
187
|
+
children: label
|
|
188
|
+
}),
|
|
189
|
+
showIcon && /*#__PURE__*/ _jsx("div", {
|
|
190
|
+
className: "w-5 h-5 pointer-events-none",
|
|
191
|
+
children: selected && /*#__PURE__*/ _jsx(Icon, {
|
|
192
|
+
source: icon || MobileAcceptMajor,
|
|
193
|
+
color: "link"
|
|
194
|
+
})
|
|
195
|
+
})
|
|
196
|
+
]
|
|
197
|
+
}, value);
|
|
198
|
+
})
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
export default Listbox;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
function _array_like_to_array(arr, len) {
|
|
3
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
4
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
5
|
+
return arr2;
|
|
6
|
+
}
|
|
7
|
+
function _array_with_holes(arr) {
|
|
8
|
+
if (Array.isArray(arr)) return arr;
|
|
9
|
+
}
|
|
10
|
+
function _iterable_to_array_limit(arr, i) {
|
|
11
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
12
|
+
if (_i == null) return;
|
|
13
|
+
var _arr = [];
|
|
14
|
+
var _n = true;
|
|
15
|
+
var _d = false;
|
|
16
|
+
var _s, _e;
|
|
17
|
+
try {
|
|
18
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
19
|
+
_arr.push(_s.value);
|
|
20
|
+
if (i && _arr.length === i) break;
|
|
21
|
+
}
|
|
22
|
+
} catch (err) {
|
|
23
|
+
_d = true;
|
|
24
|
+
_e = err;
|
|
25
|
+
} finally{
|
|
26
|
+
try {
|
|
27
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
28
|
+
} finally{
|
|
29
|
+
if (_d) throw _e;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return _arr;
|
|
33
|
+
}
|
|
34
|
+
function _non_iterable_rest() {
|
|
35
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
36
|
+
}
|
|
37
|
+
function _sliced_to_array(arr, i) {
|
|
38
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
39
|
+
}
|
|
40
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
41
|
+
if (!o) return;
|
|
42
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
43
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
44
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
45
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
46
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
47
|
+
}
|
|
48
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
49
|
+
import { useEffect, useState } from "react";
|
|
50
|
+
/**
|
|
51
|
+
* A loading progress bar component that animates over a specified duration.
|
|
52
|
+
*
|
|
53
|
+
* @component
|
|
54
|
+
* @param {Object} props - The props object.
|
|
55
|
+
* @param {number} [props.maxDuration=10000] - The maximum duration (in milliseconds) for the loading progress bar to reach 100%.
|
|
56
|
+
* @returns {JSX.Element} A fixed progress bar displayed at the top of the page.
|
|
57
|
+
*/ function Loading() {
|
|
58
|
+
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
59
|
+
var _props_maxDuration = props.maxDuration, maxDuration = _props_maxDuration === void 0 ? 10000 : _props_maxDuration;
|
|
60
|
+
var _useState = _sliced_to_array(useState(0), 2), progress = _useState[0], setProgress = _useState[1];
|
|
61
|
+
useEffect(function() {
|
|
62
|
+
var startTime = Date.now();
|
|
63
|
+
var interval = 16;
|
|
64
|
+
var maxProgress = 100;
|
|
65
|
+
var updateProgress = function() {
|
|
66
|
+
var elapsedTime = Date.now() - startTime;
|
|
67
|
+
var fractionOfDuration = elapsedTime / maxDuration;
|
|
68
|
+
var easedProgress = maxProgress * (1 - Math.pow(1 - fractionOfDuration, 3));
|
|
69
|
+
if (elapsedTime >= maxDuration || easedProgress >= maxProgress) {
|
|
70
|
+
setProgress(maxProgress);
|
|
71
|
+
clearInterval(timer);
|
|
72
|
+
} else {
|
|
73
|
+
setProgress(easedProgress);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
var timer = setInterval(updateProgress, interval);
|
|
77
|
+
return function() {
|
|
78
|
+
return clearInterval(timer);
|
|
79
|
+
};
|
|
80
|
+
}, [
|
|
81
|
+
maxDuration
|
|
82
|
+
]);
|
|
83
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
84
|
+
className: "Litho-Loading fixed top-0 left-0 right-0 h-[3px]",
|
|
85
|
+
children: /*#__PURE__*/ _jsx("div", {
|
|
86
|
+
className: "h-full bg-brand-saturated transition-all duration-100 ease-out",
|
|
87
|
+
style: {
|
|
88
|
+
width: "".concat(progress, "%")
|
|
89
|
+
}
|
|
90
|
+
})
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
export default Loading;
|
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
function _array_like_to_array(arr, len) {
|
|
3
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
4
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
5
|
+
return arr2;
|
|
6
|
+
}
|
|
7
|
+
function _array_with_holes(arr) {
|
|
8
|
+
if (Array.isArray(arr)) return arr;
|
|
9
|
+
}
|
|
10
|
+
function _iterable_to_array_limit(arr, i) {
|
|
11
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
12
|
+
if (_i == null) return;
|
|
13
|
+
var _arr = [];
|
|
14
|
+
var _n = true;
|
|
15
|
+
var _d = false;
|
|
16
|
+
var _s, _e;
|
|
17
|
+
try {
|
|
18
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
19
|
+
_arr.push(_s.value);
|
|
20
|
+
if (i && _arr.length === i) break;
|
|
21
|
+
}
|
|
22
|
+
} catch (err) {
|
|
23
|
+
_d = true;
|
|
24
|
+
_e = err;
|
|
25
|
+
} finally{
|
|
26
|
+
try {
|
|
27
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
28
|
+
} finally{
|
|
29
|
+
if (_d) throw _e;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return _arr;
|
|
33
|
+
}
|
|
34
|
+
function _non_iterable_rest() {
|
|
35
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
36
|
+
}
|
|
37
|
+
function _sliced_to_array(arr, i) {
|
|
38
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
39
|
+
}
|
|
40
|
+
function _type_of(obj) {
|
|
41
|
+
"@swc/helpers - typeof";
|
|
42
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
43
|
+
}
|
|
44
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
45
|
+
if (!o) return;
|
|
46
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
47
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
48
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
49
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
50
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
51
|
+
}
|
|
52
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
53
|
+
import { ArrowLeftMinor, CancelMajor } from "@shopify/polaris-icons";
|
|
54
|
+
import React, { createContext, useContext, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
55
|
+
import { createPortal } from "react-dom";
|
|
56
|
+
import { tv } from "tailwind-variants";
|
|
57
|
+
import { FrameContext } from "./AppProvider.js";
|
|
58
|
+
import { Button, Icon, Spinner, Text, Tooltip } from "../index.js";
|
|
59
|
+
export var ModalContext = /*#__PURE__*/ createContext(false);
|
|
60
|
+
var containerStyles = tv({
|
|
61
|
+
base: "Litho-ModalContainer fixed inset-0 block flex flex-col justify-end md:justify-center items-center pointer-events-none"
|
|
62
|
+
});
|
|
63
|
+
var styles = tv({
|
|
64
|
+
base: "Litho-Modal relative bg-surface-highest shadow-modal dark:shadow-modal-dark w-full mx-auto pointer-events-auto flex flex-col overflow-hidden",
|
|
65
|
+
variants: {
|
|
66
|
+
size: {
|
|
67
|
+
default: "max-w-200 md:max-w-160 md:rounded-md max-h-[calc(100vh-40px)]",
|
|
68
|
+
large: "max-w-300 md:rounded-md max-h-[calc(100vh-40px)]",
|
|
69
|
+
full: "h-full max-w-full max-h-screen"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
defaultVariants: {
|
|
73
|
+
size: "default"
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
var overlayStyles = tv({
|
|
77
|
+
base: "Litho-ModalOverlay fixed inset-0 block bg-tint-10 dark:bg-tint-25"
|
|
78
|
+
});
|
|
79
|
+
var headerStyles = tv({
|
|
80
|
+
base: "Litho-ModalHeader min-h-15 flex items-center py-2 pl-4 pr-3 flex-none",
|
|
81
|
+
variants: {
|
|
82
|
+
hasChildren: {
|
|
83
|
+
true: "border-b",
|
|
84
|
+
false: ""
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
defaultVariants: {
|
|
88
|
+
hasChildren: true
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
var sectionStyles = tv({
|
|
92
|
+
base: "Litho-ModalSection border-b border-edge-default last:border-b-0",
|
|
93
|
+
variants: {
|
|
94
|
+
flush: {
|
|
95
|
+
true: "",
|
|
96
|
+
false: "p-4"
|
|
97
|
+
},
|
|
98
|
+
showHeader: {
|
|
99
|
+
true: "pt-2",
|
|
100
|
+
false: ""
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
defaultVariants: {
|
|
104
|
+
flush: false
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
/**
|
|
108
|
+
* Modal component for displaying a customizable dialog.
|
|
109
|
+
*
|
|
110
|
+
* @param {Object} props - The component props.
|
|
111
|
+
* @param {React.ReactNode} [props.children] - The content of the modal.
|
|
112
|
+
* @param {string} [props.title] - The title of the modal.
|
|
113
|
+
* @param {string} [props.subtitle] - The subtitle of the modal.
|
|
114
|
+
* @param {boolean} [props.open=false] - Whether the modal is open.
|
|
115
|
+
* @param {Function} [props.onClose] - Callback function for closing the modal.
|
|
116
|
+
* @param {boolean} [props.sectioned=false] - Whether the modal content should be sectioned.
|
|
117
|
+
* @param {Object} [props.primaryAction] - The primary action for the modal.
|
|
118
|
+
* @param {string} [props.primaryAction.content] - Content of the primary action button.
|
|
119
|
+
* @param {Function} [props.primaryAction.onAction] - Callback for the primary action.
|
|
120
|
+
* @param {boolean} [props.primaryAction.loading=false] - Whether the primary action is loading.
|
|
121
|
+
* @param {boolean} [props.primaryAction.disabled=false] - Whether the primary action is disabled.
|
|
122
|
+
* @param {boolean} [props.primaryAction.destructive=false] - Whether the primary action is destructive.
|
|
123
|
+
* @param {Object} [props.secondaryAction] - The secondary action for the modal.
|
|
124
|
+
* @param {string} [props.secondaryAction.content] - Content of the secondary action button.
|
|
125
|
+
* @param {Function} [props.secondaryAction.onAction] - Callback for the secondary action.
|
|
126
|
+
* @param {boolean} [props.secondaryAction.disabled=false] - Whether the secondary action is disabled.
|
|
127
|
+
* @param {Object[]} [props.secondaryActions=[]] - Additional secondary actions.
|
|
128
|
+
* @param {Object} [props.destructiveAction] - A destructive action for the modal.
|
|
129
|
+
* @param {boolean} [props.loading=false] - Whether the modal is in a loading state.
|
|
130
|
+
* @param {string} [props.size="default"] - The size of the modal (default, large, or full).
|
|
131
|
+
* @param {React.ReactNode} [props.leftAccessory] - Left accessory content in the footer.
|
|
132
|
+
* @param {boolean} [props.hideCloseButton=false] - Whether to hide the close button.
|
|
133
|
+
* @param {number} [props.zIndexOverride=1000] - The z-index of the modal.
|
|
134
|
+
* @returns {React.ReactPortal|null} The rendered modal component or null if not open.
|
|
135
|
+
*/ function Modal() {
|
|
136
|
+
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
137
|
+
var children = props.children, title = props.title, subtitle = props.subtitle, open = props.open, onClose = props.onClose, sectioned = props.sectioned, primaryAction = props.primaryAction, secondaryAction = props.secondaryAction, _props_secondaryActions = props.secondaryActions, secondaryActions = _props_secondaryActions === void 0 ? [] : _props_secondaryActions, destructiveAction = props.destructiveAction, loading = props.loading, _props_size = props.size, size = _props_size === void 0 ? "default" : _props_size, leftAccessory = props.leftAccessory, _props_hideCloseButton = props.hideCloseButton, hideCloseButton = _props_hideCloseButton === void 0 ? false : _props_hideCloseButton, backAction = props.backAction, zIndexOverride = props.zIndexOverride;
|
|
138
|
+
var setModalIsOpen = useContext(FrameContext).setModalIsOpen;
|
|
139
|
+
var modalContentRef = useRef(null);
|
|
140
|
+
var hasChildren = !!children;
|
|
141
|
+
var classes = styles({
|
|
142
|
+
sectioned: sectioned,
|
|
143
|
+
size: size
|
|
144
|
+
});
|
|
145
|
+
var containerClasses = containerStyles();
|
|
146
|
+
var headerClasses = headerStyles({
|
|
147
|
+
hasChildren: hasChildren
|
|
148
|
+
});
|
|
149
|
+
var overlayClasses = overlayStyles();
|
|
150
|
+
var sectionClasses = sectionStyles();
|
|
151
|
+
var _useState = _sliced_to_array(useState(null), 2), container = _useState[0], setContainer = _useState[1];
|
|
152
|
+
useEffect(function() {
|
|
153
|
+
var div = document.createElement("div");
|
|
154
|
+
div.className = "@container Litho-ModalPortal";
|
|
155
|
+
setContainer(div);
|
|
156
|
+
document.body.appendChild(div);
|
|
157
|
+
return function() {
|
|
158
|
+
document.body.removeChild(div);
|
|
159
|
+
};
|
|
160
|
+
}, []);
|
|
161
|
+
useEffect(function() {
|
|
162
|
+
setModalIsOpen(open);
|
|
163
|
+
if (!open || !onClose) return;
|
|
164
|
+
var handleKeyDown = function(event) {
|
|
165
|
+
if (event.key === "Escape") {
|
|
166
|
+
onClose();
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
170
|
+
return function() {
|
|
171
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
172
|
+
};
|
|
173
|
+
}, [
|
|
174
|
+
open,
|
|
175
|
+
onClose
|
|
176
|
+
]);
|
|
177
|
+
// Focus first input when modal opens
|
|
178
|
+
useLayoutEffect(function() {
|
|
179
|
+
if (open && container && modalContentRef.current) {
|
|
180
|
+
var focusable = modalContentRef.current.querySelector('input:not([type="hidden"]), select, textarea');
|
|
181
|
+
if (focusable) focusable.focus();
|
|
182
|
+
}
|
|
183
|
+
}, [
|
|
184
|
+
open,
|
|
185
|
+
container
|
|
186
|
+
]);
|
|
187
|
+
if (!open) {
|
|
188
|
+
return null;
|
|
189
|
+
}
|
|
190
|
+
var showFooter = primaryAction || secondaryActions.length > 0 || destructiveAction || leftAccessory;
|
|
191
|
+
return container && /*#__PURE__*/ createPortal(/*#__PURE__*/ _jsxs(ModalContext.Provider, {
|
|
192
|
+
value: true,
|
|
193
|
+
children: [
|
|
194
|
+
/*#__PURE__*/ _jsx("div", {
|
|
195
|
+
className: containerClasses,
|
|
196
|
+
style: zIndexOverride ? {
|
|
197
|
+
zIndex: zIndexOverride
|
|
198
|
+
} : {},
|
|
199
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
200
|
+
className: classes,
|
|
201
|
+
ref: modalContentRef,
|
|
202
|
+
children: [
|
|
203
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
204
|
+
className: headerClasses,
|
|
205
|
+
children: [
|
|
206
|
+
backAction && /*#__PURE__*/ _jsx("div", {
|
|
207
|
+
className: "Litho-ModalHeader__BackAction pr-3",
|
|
208
|
+
children: /*#__PURE__*/ _jsx(Button, {
|
|
209
|
+
plain: true,
|
|
210
|
+
onClick: backAction,
|
|
211
|
+
icon: ArrowLeftMinor
|
|
212
|
+
})
|
|
213
|
+
}),
|
|
214
|
+
(title || subtitle) && /*#__PURE__*/ _jsxs("div", {
|
|
215
|
+
className: "flex flex-1 flex-col gap-0",
|
|
216
|
+
children: [
|
|
217
|
+
title && /*#__PURE__*/ _jsx(Text, {
|
|
218
|
+
variant: "headingLg",
|
|
219
|
+
fontWeight: "semibold",
|
|
220
|
+
children: title
|
|
221
|
+
}),
|
|
222
|
+
subtitle && /*#__PURE__*/ _jsx(Text, {
|
|
223
|
+
variant: "bodyMd",
|
|
224
|
+
color: "subdued",
|
|
225
|
+
children: subtitle
|
|
226
|
+
})
|
|
227
|
+
]
|
|
228
|
+
}),
|
|
229
|
+
onClose && !hideCloseButton && /*#__PURE__*/ _jsx(Button, {
|
|
230
|
+
plain: true,
|
|
231
|
+
icon: CancelMajor,
|
|
232
|
+
onClick: onClose
|
|
233
|
+
})
|
|
234
|
+
]
|
|
235
|
+
}),
|
|
236
|
+
hasChildren && /*#__PURE__*/ _jsx("div", {
|
|
237
|
+
className: "Litho-ModalBody grow overflow-y-auto overscroll-contain",
|
|
238
|
+
children: loading ? /*#__PURE__*/ _jsx("div", {
|
|
239
|
+
className: "flex justify-center items-center h-full py-12",
|
|
240
|
+
children: /*#__PURE__*/ _jsx(Spinner, {})
|
|
241
|
+
}) : sectioned ? /*#__PURE__*/ _jsx("div", {
|
|
242
|
+
className: sectionClasses,
|
|
243
|
+
children: children
|
|
244
|
+
}) : children
|
|
245
|
+
}),
|
|
246
|
+
showFooter ? /*#__PURE__*/ _jsxs("div", {
|
|
247
|
+
className: "Litho-ModalFooter min-h-15 flex items-center justify-between border-t py-2 px-4 flex-none",
|
|
248
|
+
children: [
|
|
249
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
250
|
+
className: "flex gap-2",
|
|
251
|
+
children: [
|
|
252
|
+
destructiveAction && /*#__PURE__*/ _jsx(Button, {
|
|
253
|
+
destructive: destructiveAction.destructive === false ? false : true,
|
|
254
|
+
onClick: destructiveAction.onAction,
|
|
255
|
+
loading: destructiveAction.loading,
|
|
256
|
+
icon: destructiveAction.icon,
|
|
257
|
+
disabled: destructiveAction.disabled,
|
|
258
|
+
primary: destructiveAction.primary,
|
|
259
|
+
url: destructiveAction.url,
|
|
260
|
+
tooltip: destructiveAction.tooltip,
|
|
261
|
+
tooltipAlignment: destructiveAction.tooltipAlignment,
|
|
262
|
+
children: destructiveAction.content || "Delete"
|
|
263
|
+
}),
|
|
264
|
+
leftAccessory && leftAccessory
|
|
265
|
+
]
|
|
266
|
+
}),
|
|
267
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
268
|
+
className: "flex gap-2",
|
|
269
|
+
children: [
|
|
270
|
+
(secondaryActions === null || secondaryActions === void 0 ? void 0 : secondaryActions.length) > 0 && secondaryActions.map(function(action) {
|
|
271
|
+
return /*#__PURE__*/ _jsx(Button, {
|
|
272
|
+
onClick: action.onAction,
|
|
273
|
+
disabled: action.disabled,
|
|
274
|
+
url: action.url,
|
|
275
|
+
tooltip: action.tooltip,
|
|
276
|
+
tooltipAlignment: action.tooltipAlignment,
|
|
277
|
+
children: action.content
|
|
278
|
+
}, action.content);
|
|
279
|
+
}),
|
|
280
|
+
secondaryAction && /*#__PURE__*/ _jsx(Button, {
|
|
281
|
+
onClick: secondaryAction.onAction,
|
|
282
|
+
disabled: secondaryAction.disabled,
|
|
283
|
+
url: secondaryAction.url,
|
|
284
|
+
tooltip: secondaryAction.tooltip,
|
|
285
|
+
tooltipAlignment: secondaryAction.tooltipAlignment,
|
|
286
|
+
children: secondaryAction.content || "Cancel"
|
|
287
|
+
}),
|
|
288
|
+
primaryAction && /*#__PURE__*/ _jsx(Button, {
|
|
289
|
+
primary: true,
|
|
290
|
+
icon: primaryAction.icon,
|
|
291
|
+
onClick: primaryAction.onAction,
|
|
292
|
+
loading: primaryAction.loading,
|
|
293
|
+
disabled: primaryAction.disabled,
|
|
294
|
+
destructive: primaryAction.destructive,
|
|
295
|
+
url: primaryAction.url,
|
|
296
|
+
tooltip: primaryAction.tooltip,
|
|
297
|
+
tooltipAlignment: primaryAction.tooltipAlignment,
|
|
298
|
+
children: primaryAction.content || "Save"
|
|
299
|
+
})
|
|
300
|
+
]
|
|
301
|
+
})
|
|
302
|
+
]
|
|
303
|
+
}) : null
|
|
304
|
+
]
|
|
305
|
+
})
|
|
306
|
+
}),
|
|
307
|
+
/*#__PURE__*/ _jsx("div", {
|
|
308
|
+
className: overlayClasses,
|
|
309
|
+
onClick: onClose,
|
|
310
|
+
style: zIndexOverride ? {
|
|
311
|
+
zIndex: zIndexOverride - 1
|
|
312
|
+
} : {}
|
|
313
|
+
})
|
|
314
|
+
]
|
|
315
|
+
}), container);
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Section component for use within the Modal.
|
|
319
|
+
*
|
|
320
|
+
* @param {Object} props - The component props.
|
|
321
|
+
* @param {React.ReactNode} [props.children] - The content of the section.
|
|
322
|
+
* @param {boolean} [props.flush=false] - Whether the section should be flush with no padding.
|
|
323
|
+
* @returns {JSX.Element} The rendered section.
|
|
324
|
+
*/ function Section() {
|
|
325
|
+
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
326
|
+
var children = props.children, flush = props.flush, title = props.title, _props_titleVariant = props.titleVariant, titleVariant = _props_titleVariant === void 0 ? "headingSm" : _props_titleVariant, description = props.description, action = props.action, icon = props.icon, accessory = props.accessory, tooltip = props.tooltip;
|
|
327
|
+
var showHeader = !!(title || action);
|
|
328
|
+
var sectionClasses = sectionStyles({
|
|
329
|
+
flush: flush,
|
|
330
|
+
showHeader: showHeader
|
|
331
|
+
});
|
|
332
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
333
|
+
className: sectionClasses,
|
|
334
|
+
children: [
|
|
335
|
+
showHeader && /*#__PURE__*/ _jsxs("div", {
|
|
336
|
+
className: "Litho-ModalSection__SectionHeader min-h-9 md:min-h-10",
|
|
337
|
+
children: [
|
|
338
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
339
|
+
className: "flex items-center justify-between gap-1",
|
|
340
|
+
children: [
|
|
341
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
342
|
+
className: "flex items-center gap-2 min-h-8",
|
|
343
|
+
children: [
|
|
344
|
+
icon && typeof icon === "function" && /*#__PURE__*/ _jsx(Icon, {
|
|
345
|
+
source: icon,
|
|
346
|
+
color: "subdued"
|
|
347
|
+
}),
|
|
348
|
+
icon && (typeof icon === "undefined" ? "undefined" : _type_of(icon)) === "object" && icon,
|
|
349
|
+
title && typeof title === "string" ? /*#__PURE__*/ _jsx(Text, {
|
|
350
|
+
variant: titleVariant,
|
|
351
|
+
children: title
|
|
352
|
+
}) : title,
|
|
353
|
+
tooltip && /*#__PURE__*/ _jsx(Tooltip, {
|
|
354
|
+
content: tooltip,
|
|
355
|
+
preferredPosition: "above"
|
|
356
|
+
})
|
|
357
|
+
]
|
|
358
|
+
}),
|
|
359
|
+
accessory && /*#__PURE__*/ _jsx("div", {
|
|
360
|
+
className: "Litho-ModalSection__HeaderAccessory pr-2",
|
|
361
|
+
children: accessory
|
|
362
|
+
}),
|
|
363
|
+
action && /*#__PURE__*/ _jsx("div", {
|
|
364
|
+
className: "Litho-ModalSection__HeaderAction relative left-2",
|
|
365
|
+
children: action.content ? /*#__PURE__*/ _jsx(Button, {
|
|
366
|
+
link: true,
|
|
367
|
+
onClick: action.onAction,
|
|
368
|
+
primary: action.primary,
|
|
369
|
+
destructive: action.destructive,
|
|
370
|
+
icon: action.icon,
|
|
371
|
+
loading: action.loading,
|
|
372
|
+
disabled: action.disabled,
|
|
373
|
+
connectedDisclosure: action.connectedDisclosure,
|
|
374
|
+
children: action.content
|
|
375
|
+
}) : action
|
|
376
|
+
})
|
|
377
|
+
]
|
|
378
|
+
}),
|
|
379
|
+
description && /*#__PURE__*/ _jsx(Text, {
|
|
380
|
+
color: "subdued",
|
|
381
|
+
children: description
|
|
382
|
+
})
|
|
383
|
+
]
|
|
384
|
+
}),
|
|
385
|
+
children
|
|
386
|
+
]
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
Modal.Section = Section;
|
|
390
|
+
export default Modal;
|