@eightshift/ui-components 5.6.0 → 6.0.0
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/{Button-BhEIfWLY.js → Button-BXjXzdW_.js} +13 -13
- package/dist/{Dialog-B8p4Ymh7.js → Dialog-D8bjn-nh.js} +404 -77
- package/dist/{FieldError-B8BgFmIQ.js → FieldError-DwBG6m1U.js} +2 -2
- package/dist/{FocusScope-B5vxRkHm.js → FocusScope-BMk5oZCk.js} +8 -8
- package/dist/{Heading-B5aEynOM.js → Heading-BmRX4BRL.js} +3 -3
- package/dist/{Hidden-rE6uR-lr.js → Hidden-Rfj-STx7.js} +4 -4
- package/dist/{Input-8yja_IHC.js → Input-CNNksOWg.js} +11 -11
- package/dist/{Label-DWVaNd2E.js → Label-D8a3eYb-.js} +4 -4
- package/dist/{List-Bll1lQEW.js → List-BGHOoFf0.js} +8 -8
- package/dist/{ListBox-CEpKw7yC.js → ListBox-Dd37zMvs.js} +40 -41
- package/dist/{OverlayArrow-DDfa8khI.js → OverlayArrow-DokC40S3.js} +6 -6
- package/dist/{PortalProvider---wyKpMr.js → PortalProvider-CHPnqDSH.js} +2 -2
- package/dist/RadioGroup-BVFvITWO.js +371 -0
- package/dist/{SearchField-D6mPli0i.js → SearchField-CHYnN-jt.js} +16 -16
- package/dist/{SelectionManager-D77bfEbg.js → SelectionManager-N8X7T_4D.js} +44 -46
- package/dist/{SharedElementTransition-BjRNHsjx.js → SharedElementTransition-BDT84GtD.js} +3 -3
- package/dist/{Slider-DfU6bRtH.js → Slider-CL5CM9S8.js} +23 -23
- package/dist/{Text-AxKZjtFm.js → Text-ztX6G1zR.js} +3 -3
- package/dist/{VisuallyHidden-CgnIuZJ2.js → VisuallyHidden-DTUuKFiI.js} +4 -4
- package/dist/assets/style-admin.css +12156 -2
- package/dist/assets/style-editor.css +12156 -2
- package/dist/assets/style.css +12162 -2
- package/dist/assets/wp-overrides/allow-full-width-blocks.css +6 -0
- package/dist/assets/wp-overrides/fix-label-text-case.css +29 -0
- package/dist/assets/wp-overrides/increase-sidebar-width.css +4 -0
- package/dist/assets/wp-overrides/make-block-messages-nicer.css +155 -0
- package/dist/assets/wp-overrides/replace-fonts.css +8 -0
- package/dist/assets/wp-overrides/restyle-tooltips.css +194 -0
- package/dist/assets/wp-overrides/round-corners.css +200 -0
- package/dist/assets/wp-overrides/unify-button-sizes.css +5 -0
- package/dist/clsx-DgYk2OaC.js +16 -0
- package/dist/{Color-WxFE7lQB.js → color-swatch-CFIuSPcO.js} +124 -6
- package/dist/components/animated-visibility/animated-visibility.js +25 -17
- package/dist/components/base-control/base-control.js +8 -5
- package/dist/components/base-control/container.js +204 -0
- package/dist/components/breakpoint-preview/breakpoint-preview.js +0 -1
- package/dist/components/button/button.js +249 -155
- package/dist/components/checkbox/checkbox.js +96 -37
- package/dist/components/color-pickers/color-picker.js +16 -7
- package/dist/components/color-pickers/color-swatch.js +5 -57
- package/dist/components/color-pickers/gradient-editor.js +161 -138
- package/dist/components/color-pickers/solid-color-picker.js +308 -206
- package/dist/components/component-toggle/component-toggle.js +12 -8
- package/dist/components/container-panel/container-panel.js +54 -31
- package/dist/components/draggable/draggable-handle.js +8 -7
- package/dist/components/draggable/draggable.js +2 -2
- package/dist/components/draggable-list/draggable-list-item.js +21 -12
- package/dist/components/draggable-list/draggable-list.js +19 -21
- package/dist/components/expandable/expandable.js +56 -28
- package/dist/components/index.js +7 -21
- package/dist/components/input-field/input-field.js +112 -35
- package/dist/components/item-collection/item-collection.js +1 -1
- package/dist/components/link-input/link-input.js +181 -121
- package/dist/components/matrix-align/matrix-align.js +54 -21
- package/dist/components/menu/menu.js +26 -34
- package/dist/components/modal/modal.js +31 -28
- package/dist/components/notice/notice.js +45 -28
- package/dist/components/number-picker/number-picker.js +151 -101
- package/dist/components/option-select/option-select.js +40 -4
- package/dist/components/options-panel/options-panel.js +52 -25
- package/dist/components/placeholders/file-picker-shell.js +10 -10
- package/dist/components/placeholders/file-placeholder.js +14 -6
- package/dist/components/placeholders/image-placeholder.js +14 -4
- package/dist/components/placeholders/media-placeholder.js +11 -4
- package/dist/components/popover/popover.js +14 -11
- package/dist/components/portal-provider/portal-provider.js +1 -1
- package/dist/components/radio/radio.js +118 -429
- package/dist/components/repeater/repeater-item.js +7 -10
- package/dist/components/repeater/repeater.js +9 -15
- package/dist/components/responsive/mini-responsive.js +53 -62
- package/dist/components/responsive/responsive-legacy.js +1 -2
- package/dist/components/responsive/responsive.js +27 -28
- package/dist/components/responsive-preview/responsive-preview.js +1 -2
- package/dist/components/rich-label/rich-label.js +5 -5
- package/dist/components/select/async-multi-select.js +467 -100
- package/dist/components/select/{v2/async-select.js → async-select.js} +182 -106
- package/dist/components/select/multi-select.js +437 -83
- package/dist/components/select/shared.js +14 -42
- package/dist/components/select/single-select.js +349 -54
- package/dist/components/slider/column-config-slider.js +138 -45
- package/dist/components/slider/slider.js +265 -205
- package/dist/components/slider/utils.js +32 -1
- package/dist/components/smart-image/smart-image.js +27 -6
- package/dist/components/smart-image/worker-inline.js +1 -1
- package/dist/components/spacer/spacer.js +2 -2
- package/dist/components/tabs/tabs.js +370 -101
- package/dist/components/toggle/switch.js +174 -39
- package/dist/components/toggle/toggle.js +6 -3
- package/dist/components/toggle-button/toggle-button.js +140 -56
- package/dist/components/tooltip/tooltip.js +27 -26
- package/dist/{context-DMOmz986.js → context-BQvmiUqb.js} +3 -3
- package/dist/{default-i18n-DBm-GqWM.js → default-i18n-CnQeC5Pl.js} +10 -10
- package/dist/{general-6STKQIrk.js → general-B6pOveVp.js} +13 -12
- package/dist/icons/icons.js +28 -9
- package/dist/icons/jsx-svg.js +1 -1
- package/dist/icons/spinner.js +3 -1
- package/dist/{index-Dq3gT5pW.js → index-BHpUy2Ix.js} +1 -1
- package/dist/{index-DjyEH0Gg.js → index-oFgxU4zs.js} +6 -4
- package/dist/index.js +6 -20
- package/dist/proxy-0B6wWuDe.js +7409 -0
- package/dist/{react-jsx-parser.min-VUl-CuCv.js → react-jsx-parser.min-B_hvYYa1.js} +5 -5
- package/dist/{Select-CHzjZxXy.js → shared-DwjRce5e.js} +170 -36
- package/dist/{textSelection-DbCKqaw8.js → textSelection-CwHUtNVX.js} +1 -1
- package/dist/{useButton-B2EaQJT_.js → useButton-DdZrS1Kz.js} +3 -3
- package/dist/{useEvent-BifIGnVS.js → useEvent-BD7Olibq.js} +1 -1
- package/dist/{useFilter-BPcJ-Jzv.js → useFilter-bhxeEDg8.js} +1 -1
- package/dist/{useFocusRing-Cgm0R4Cf.js → useFocusRing-D3b7Kh4P.js} +1 -1
- package/dist/{useFormReset-yV9VVy9R.js → useFormReset-WUv2PdFO.js} +1 -1
- package/dist/{useFormValidation-CeNsUGWK.js → useFormValidation-DQeXkyLm.js} +2 -2
- package/dist/{useHover-BRDW3y7-.js → useHover-Bycb7BsD.js} +7 -7
- package/dist/{useLabel-C8umX0gk.js → useLabel-Bnv4-T24.js} +2 -2
- package/dist/{useLabels-Cdxi6JSa.js → useLabels-B49ptFDX.js} +1 -1
- package/dist/{useListState-DZycqxCn.js → useListState-ZKhRO8ML.js} +1 -1
- package/dist/{useLocalizedStringFormatter-eaZiN2tE.js → useLocalizedStringFormatter-NETP-8H8.js} +1 -1
- package/dist/{useNumberField-CEA9Q4w_.js → useNumberField-D2fUHql3.js} +10 -10
- package/dist/{useNumberFormatter-BCmkV-7c.js → useNumberFormatter-DGvuRCn7.js} +1 -1
- package/dist/{usePress-BCEPS3hl.js → usePress-B8OteQMu.js} +6 -6
- package/dist/{useSingleSelectListState-BFZEfeqI.js → useSingleSelectListState-BBTu4shO.js} +2 -2
- package/dist/{useToggle-DNoP2bvV.js → useToggle-BZhaYwZl.js} +4 -4
- package/dist/{useToggleState-CzN79ary.js → useToggleState-VkXJjsru.js} +1 -1
- package/dist/utilities/general.js +2 -2
- package/dist/utilities/hash.js +30 -0
- package/dist/utilities/index.js +4 -6
- package/dist/{utils-cvK1vxO7.js → utils-DGpXyJOJ.js} +29 -42
- package/dist/workers/image-analysis.worker.js +3 -3
- package/package.json +26 -23
- package/dist/ColorSwatch-xVS3rMYS.js +0 -66
- package/dist/Select-ef7c0426.esm-BJmjGGzK.js +0 -2474
- package/dist/Separator-DcqCdD4k.js +0 -344
- package/dist/_commonjsHelpers-BhWcALO8.js +0 -38
- package/dist/assets/wp-font-enhancements.css +0 -2
- package/dist/assets/wp-ui-enhancements.css +0 -2
- package/dist/components/select/async-single-select.js +0 -138
- package/dist/components/select/custom-select-default-components.js +0 -38
- package/dist/components/select/multi-select-components.js +0 -8
- package/dist/components/select/react-select-component-wrappers.js +0 -90
- package/dist/components/select/styles.js +0 -49
- package/dist/components/select/v2/async-multi-select.js +0 -433
- package/dist/components/select/v2/multi-select.js +0 -404
- package/dist/components/select/v2/shared.js +0 -69
- package/dist/components/select/v2/single-select.js +0 -358
- package/dist/index-641ee5b8.esm-DiwvO-RP.js +0 -3139
- package/dist/modifiers.esm-BuJQPI1X.js +0 -31
- package/dist/multi-select-components-B3KuDyYd.js +0 -3744
- package/dist/react-select-async.esm-_4pk-41v.js +0 -107
- package/dist/react-select.esm-BeuAkAyY.js +0 -15
- package/dist/sha256-C56UDWfQ.js +0 -533
- package/dist/useDragAndDrop-DUXKDS0N.js +0 -3925
- package/dist/wp/wp-font-enhancements.js +0 -1
- package/dist/wp/wp-ui-enhancements.js +0 -1
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { $ as $
|
|
3
|
-
import { $ as $3674c52c6b3c5bce$export$27d2ad3c5815583e, a as $3674c52c6b3c5bce$export$d9b273488cd8ce6f, b as $3674c52c6b3c5bce$export$2ce376c2cc3355c8, c as $3674c52c6b3c5bce$export$4b1545b4f2016d26, d as $3674c52c6b3c5bce$export$ecabc99eeffab7ca } from "../../Dialog-B8p4Ymh7.js";
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { a as $3674c52c6b3c5bce$export$27d2ad3c5815583e, b as $3674c52c6b3c5bce$export$d9b273488cd8ce6f, c as $3674c52c6b3c5bce$export$2ce376c2cc3355c8, d as $3674c52c6b3c5bce$export$4b1545b4f2016d26, e as $431f98aba6844401$export$1ff3c3f08ae963c0, f as $3674c52c6b3c5bce$export$ecabc99eeffab7ca } from "../../Dialog-D8bjn-nh.js";
|
|
4
3
|
import { RichLabel } from "../rich-label/rich-label.js";
|
|
5
4
|
import { icons } from "../../icons/icons.js";
|
|
6
5
|
import { Button } from "../button/button.js";
|
|
7
6
|
import { Popover } from "../popover/popover.js";
|
|
8
7
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
9
8
|
import { cloneElement } from "react";
|
|
10
|
-
import { _ as __ } from "../../default-i18n-
|
|
9
|
+
import { _ as __ } from "../../default-i18n-CnQeC5Pl.js";
|
|
11
10
|
/**
|
|
12
11
|
* @typedef {import('../button/button').ButtonProps} ButtonProps
|
|
13
12
|
* @typedef {import('../popover/popover').PopoverProps} PopoverProps
|
|
@@ -121,8 +120,12 @@ const Menu = (props) => {
|
|
|
121
120
|
Popover,
|
|
122
121
|
{
|
|
123
122
|
"aria-label": ariaLabel,
|
|
123
|
+
popoverProps: {
|
|
124
|
+
maxHeight: Math.max(240, window.innerHeight * 0.42),
|
|
125
|
+
...popoverProps
|
|
126
|
+
},
|
|
124
127
|
...popoverProps,
|
|
125
|
-
className: clsx("es:p-
|
|
128
|
+
className: clsx("es:p-1.5 es:any-focus:outline-hidden", !manualWidth && "es:w-56", manualWidth && "es:max-w-80", popoverProps?.className),
|
|
126
129
|
wrapperClassName: clsx(!hasSubmenuItems && "es:overflow-y-auto", popoverProps?.wrapperClassName),
|
|
127
130
|
children: /* @__PURE__ */ jsx(
|
|
128
131
|
$3674c52c6b3c5bce$export$d9b273488cd8ce6f,
|
|
@@ -156,20 +159,11 @@ const Menu = (props) => {
|
|
|
156
159
|
*/
|
|
157
160
|
const MenuSection = (props) => {
|
|
158
161
|
const { children, label } = props;
|
|
159
|
-
return /* @__PURE__ */ jsxs(
|
|
160
|
-
|
|
161
|
-
{
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
label && "es:pt-2 es:first:pt-2.5 es:last:pb-0",
|
|
165
|
-
!label && "es:has-[>_:only-child]:pb-0"
|
|
166
|
-
),
|
|
167
|
-
children: [
|
|
168
|
-
label && /* @__PURE__ */ jsx($72a5793c14baf454$export$8b251419efc915eb, { className: "es:ml-2.5 es:text-sm es:text-secondary-500", children: label }),
|
|
169
|
-
children
|
|
170
|
-
]
|
|
171
|
-
}
|
|
172
|
-
);
|
|
162
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
163
|
+
/* @__PURE__ */ jsx(MenuSectionHeader, { hidden: !label, children: label }),
|
|
164
|
+
/* @__PURE__ */ jsx($3674c52c6b3c5bce$export$4b1545b4f2016d26, { className: "es:flex es:flex-col es:gap-1", children }),
|
|
165
|
+
/* @__PURE__ */ jsx(MenuSeparator, { className: "es:last:hidden" })
|
|
166
|
+
] });
|
|
173
167
|
};
|
|
174
168
|
/**
|
|
175
169
|
* A menu separator.
|
|
@@ -180,8 +174,8 @@ const MenuSection = (props) => {
|
|
|
180
174
|
*
|
|
181
175
|
* @preserve
|
|
182
176
|
*/
|
|
183
|
-
const MenuSeparator = () => {
|
|
184
|
-
return /* @__PURE__ */ jsx($431f98aba6844401$export$1ff3c3f08ae963c0, { className: "es:my-1 es:
|
|
177
|
+
const MenuSeparator = ({ className }) => {
|
|
178
|
+
return /* @__PURE__ */ jsx($431f98aba6844401$export$1ff3c3f08ae963c0, { className: clsx("es:my-1.5 es:w-fill es:h-px es:bg-surface-500/15 es:mx-1.5 es:rounded-full", className) });
|
|
185
179
|
};
|
|
186
180
|
/**
|
|
187
181
|
* A menu item.
|
|
@@ -238,18 +232,16 @@ const MenuItem = (props) => {
|
|
|
238
232
|
"aria-label": ariaLabel,
|
|
239
233
|
isDisabled: disabled,
|
|
240
234
|
className: clsx(
|
|
241
|
-
"es:
|
|
242
|
-
"es:
|
|
243
|
-
"es:last:mb-1",
|
|
244
|
-
"es:select-none es:rounded-xl es:py-1.5 es:px-2.5 es:text-sm es:transition",
|
|
235
|
+
"es:flex es:min-w-44 es:min-h-10 es:items-center es:gap-1.5",
|
|
236
|
+
"es:select-none es:rounded-xl es:py-1 es:px-3 es:text-sm es:transition",
|
|
245
237
|
"es:any-focus:outline-hidden",
|
|
246
238
|
"es:icon:shrink-0",
|
|
247
239
|
!disabled && "es:focus-visible:inset-ring",
|
|
248
|
-
!disabled && !(danger || primary) && "es:hover:bg-
|
|
240
|
+
!disabled && !(danger || primary) && "es:hover:bg-surface-600/5 es:focus-visible:inset-ring-secondary-950/10 es:focus-visible:bg-secondary-950/5 es:contrast-more:focus-visible:bg-accent-800",
|
|
249
241
|
!disabled && danger && "es:hover:bg-red-500/5 es:focus-visible:inset-ring-red-600/30 es:focus-visible:bg-red-600/5 es:hover:text-red-900 es:focus-visible:text-red-950 es:contrast-more:focus-visible:bg-red-800",
|
|
250
|
-
!disabled && primary && "es:hover:bg-accent-
|
|
242
|
+
!disabled && primary && "es:hover:bg-accent-600/6 es:focus-visible:inset-ring-accent-600/20 es:focus-visible:bg-accent-600/5 es:hover:text-accent-900 es:focus-visible:text-accent-950 es:contrast-more:focus-visible:bg-accent-700",
|
|
251
243
|
!disabled && "es:contrast-more:focus-visible:text-white! es:contrast-more:focus-visible:icon:text-white!",
|
|
252
|
-
disabled ? "es:text-
|
|
244
|
+
disabled ? "es:text-surface-400" : "es:text-surface-700",
|
|
253
245
|
className
|
|
254
246
|
),
|
|
255
247
|
onAction: onClick,
|
|
@@ -261,11 +253,11 @@ const MenuItem = (props) => {
|
|
|
261
253
|
icon: itemIcon,
|
|
262
254
|
label: children,
|
|
263
255
|
subtitle,
|
|
264
|
-
iconClassName: clsx(danger && "es:not-contrast-more:icon:text-red-700!", primary && "es:not-contrast-more:icon:text-accent-
|
|
256
|
+
iconClassName: clsx(danger && "es:not-contrast-more:icon:text-red-700!", primary && "es:not-contrast-more:icon:text-accent-700!"),
|
|
265
257
|
noColor: true
|
|
266
258
|
}
|
|
267
259
|
),
|
|
268
|
-
shortcut && /* @__PURE__ */ jsx("div", { className: "es:ml-auto es:pl-2 es:text-[0.6875rem] es:tracking-tight es:text-
|
|
260
|
+
shortcut && /* @__PURE__ */ jsx("div", { className: "es:ml-auto es:pl-2 es:text-[0.6875rem] es:tracking-tight es:text-surface-400 es:contrast-more:text-current es:shrink-0", children: shortcut }),
|
|
269
261
|
endIcon && /* @__PURE__ */ jsx("div", { className: clsx("es:shrink-0 es:icon:shrink-0", !shortcut && "es:ml-auto es:pl-2"), children: endIcon })
|
|
270
262
|
]
|
|
271
263
|
}
|
|
@@ -302,7 +294,7 @@ const SubMenuItem = (props) => {
|
|
|
302
294
|
}
|
|
303
295
|
return /* @__PURE__ */ jsxs($3674c52c6b3c5bce$export$ecabc99eeffab7ca, { children: [
|
|
304
296
|
cloneElement(trigger, {
|
|
305
|
-
endIcon: /* @__PURE__ */ jsx("span", { className: "es:text-
|
|
297
|
+
endIcon: /* @__PURE__ */ jsx("span", { className: "es:text-surface-500 es:contrast-more:text-current es:icon:size-3! es:icon:stroke-2!", children: icons.chevronRight })
|
|
306
298
|
}),
|
|
307
299
|
/* @__PURE__ */ jsx(
|
|
308
300
|
Popover,
|
|
@@ -310,7 +302,7 @@ const SubMenuItem = (props) => {
|
|
|
310
302
|
"aria-label": props["aria-label"] ?? __("Submenu", "eightshift-ui-components"),
|
|
311
303
|
offset: -1,
|
|
312
304
|
...popoverProps,
|
|
313
|
-
className: clsx("es:
|
|
305
|
+
className: clsx("es:any-focus:outline-hidden", !manualWidth && "es:w-56", manualWidth && "es:max-w-80", popoverProps?.className),
|
|
314
306
|
children: /* @__PURE__ */ jsx(
|
|
315
307
|
$3674c52c6b3c5bce$export$d9b273488cd8ce6f,
|
|
316
308
|
{
|
|
@@ -353,10 +345,10 @@ const MenuSectionHeader = (props) => {
|
|
|
353
345
|
{
|
|
354
346
|
...props,
|
|
355
347
|
className: clsx(
|
|
356
|
-
|
|
348
|
+
'es:mx-1 es:px-1 es:pt-1.5 es:pb-2 es:first:pt-2 es:flex es:min-w-44 es:items-center es:gap-1.5 es:font-variation-["wdth"_144,"wght"_350]',
|
|
357
349
|
"es:select-none es:text-sm",
|
|
358
350
|
"es:icon:shrink-0",
|
|
359
|
-
"es:text-
|
|
351
|
+
"es:text-surface-500/80",
|
|
360
352
|
className
|
|
361
353
|
),
|
|
362
354
|
isDisabled: true,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { $ as $5cb03073d3f54797$export$a8a3e93435678ff9 } from "../../Heading-
|
|
4
|
-
import {
|
|
2
|
+
import { j as $a11501f3d1d39e6c$export$ea8f71083e90600f, k as $49c51c25361d4cd2$export$ee0f7cc6afcd1c18, l as $337b884510726a0d$export$14c98a7594375490, m as $5e3802645cc19319$export$1c3ebcada18427bf, n as $de32f1b87079253c$export$d2f961adcb0afbe, o as $86ea4cb521eb2e37$export$2317d149ed6f78c4, p as $337b884510726a0d$export$c6fdb837b070b4ff, h as $de32f1b87079253c$export$2e1e1122cf0cba88, g as $de32f1b87079253c$export$3ddf2d174ce01153 } from "../../Dialog-D8bjn-nh.js";
|
|
3
|
+
import { $ as $5cb03073d3f54797$export$a8a3e93435678ff9 } from "../../Heading-BmRX4BRL.js";
|
|
4
|
+
import { m as $b5e257d569688ac6$export$535bd6ca7f90a273, a as $3ef42575df84b30b$export$9d1611c77c2fe928, $ as $64fa3d84918910a7$export$29f1550f4b0d4415, k as $df56164dff5785e2$export$4338b53315abf666, l as $5dc95899b306f630$export$c9058316764c140e, g as $64fa3d84918910a7$export$4d86445c2cf5e3, h as $64fa3d84918910a7$export$2881499e37b75b9a } from "../../utils-DGpXyJOJ.js";
|
|
5
5
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-D2C6R0DK.js";
|
|
6
|
-
import { c as $21f1aa98acb08317$export$c57958e35f31ed73, d as $cc38e7bd3fc7b213$export$2bb74740c4e19def } from "../../SelectionManager-
|
|
7
|
-
import
|
|
8
|
-
import { $ as $fc909762b330b746$export$61c6a8c84e605fb6, a as $d3f049242431219c$export$45fda7c47f93fd48, b as $d3f049242431219c$export$6d3443f2c48bfc20 } from "../../OverlayArrow-
|
|
6
|
+
import { c as $21f1aa98acb08317$export$c57958e35f31ed73, d as $cc38e7bd3fc7b213$export$2bb74740c4e19def } from "../../SelectionManager-N8X7T_4D.js";
|
|
7
|
+
import $dbSRa$react__default, { useState, useEffect, forwardRef, useContext, createContext, useRef, useMemo } from "react";
|
|
8
|
+
import { $ as $fc909762b330b746$export$61c6a8c84e605fb6, a as $d3f049242431219c$export$45fda7c47f93fd48, b as $d3f049242431219c$export$6d3443f2c48bfc20 } from "../../OverlayArrow-DokC40S3.js";
|
|
9
9
|
import { Button } from "../button/button.js";
|
|
10
|
-
import { _ as __ } from "../../default-i18n-
|
|
10
|
+
import { _ as __ } from "../../default-i18n-CnQeC5Pl.js";
|
|
11
11
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
12
12
|
import { icons } from "../../icons/icons.js";
|
|
13
|
-
import "../../react-jsx-parser.min-
|
|
13
|
+
import "../../react-jsx-parser.min-B_hvYYa1.js";
|
|
14
14
|
import { HStack } from "../layout/hstack.js";
|
|
15
15
|
let $5df64b3807dc15ee$var$visualViewport = typeof document !== "undefined" && window.visualViewport;
|
|
16
16
|
function $5df64b3807dc15ee$export$d699905dd57c73ca() {
|
|
@@ -107,13 +107,13 @@ const $f3f84453ead64de5$export$2b77a92f1a5ad772 = /* @__PURE__ */ forwardRef(fun
|
|
|
107
107
|
const invalidProps = Object.keys(props).filter((key) => invalidSet.has(key));
|
|
108
108
|
console.warn(`This modal is already wrapped in a ModalOverlay, props [${invalidProps.join(", ")}] should be placed on the ModalOverlay instead.`);
|
|
109
109
|
}
|
|
110
|
-
return /* @__PURE__ */
|
|
110
|
+
return /* @__PURE__ */ $dbSRa$react__default.createElement($f3f84453ead64de5$var$ModalContent, {
|
|
111
111
|
...props,
|
|
112
112
|
modalRef: ref
|
|
113
113
|
}, props.children);
|
|
114
114
|
}
|
|
115
115
|
let { isDismissable, isKeyboardDismissDisabled, isOpen, defaultOpen, onOpenChange, children, isEntering, isExiting, UNSTABLE_portalContainer, shouldCloseOnInteractOutside, ...otherProps } = props;
|
|
116
|
-
return /* @__PURE__ */
|
|
116
|
+
return /* @__PURE__ */ $dbSRa$react__default.createElement($f3f84453ead64de5$export$8948f78d83984c69, {
|
|
117
117
|
isDismissable,
|
|
118
118
|
isKeyboardDismissDisabled,
|
|
119
119
|
isOpen,
|
|
@@ -123,7 +123,7 @@ const $f3f84453ead64de5$export$2b77a92f1a5ad772 = /* @__PURE__ */ forwardRef(fun
|
|
|
123
123
|
isExiting,
|
|
124
124
|
UNSTABLE_portalContainer,
|
|
125
125
|
shouldCloseOnInteractOutside
|
|
126
|
-
}, /* @__PURE__ */
|
|
126
|
+
}, /* @__PURE__ */ $dbSRa$react__default.createElement($f3f84453ead64de5$var$ModalContent, {
|
|
127
127
|
...otherProps,
|
|
128
128
|
modalRef: ref
|
|
129
129
|
}, children));
|
|
@@ -143,7 +143,7 @@ function $f3f84453ead64de5$var$ModalOverlayWithForwardRef(props, ref) {
|
|
|
143
143
|
let isExiting = isOverlayExiting || isModalExiting || props.isExiting || false;
|
|
144
144
|
let isSSR = $b5e257d569688ac6$export$535bd6ca7f90a273();
|
|
145
145
|
if (!state.isOpen && !isExiting || isSSR) return null;
|
|
146
|
-
return /* @__PURE__ */
|
|
146
|
+
return /* @__PURE__ */ $dbSRa$react__default.createElement($f3f84453ead64de5$var$ModalOverlayInner, {
|
|
147
147
|
...props,
|
|
148
148
|
state,
|
|
149
149
|
isExiting,
|
|
@@ -178,10 +178,10 @@ function $f3f84453ead64de5$var$ModalOverlayInner({ UNSTABLE_portalContainer, ...
|
|
|
178
178
|
"--visual-viewport-height": viewport.height + "px",
|
|
179
179
|
"--page-height": pageHeight !== void 0 ? pageHeight + "px" : void 0
|
|
180
180
|
};
|
|
181
|
-
return /* @__PURE__ */
|
|
181
|
+
return /* @__PURE__ */ $dbSRa$react__default.createElement($337b884510726a0d$export$c6fdb837b070b4ff, {
|
|
182
182
|
isExiting: props.isExiting,
|
|
183
183
|
portalContainer: UNSTABLE_portalContainer
|
|
184
|
-
}, /* @__PURE__ */
|
|
184
|
+
}, /* @__PURE__ */ $dbSRa$react__default.createElement("div", {
|
|
185
185
|
...$3ef42575df84b30b$export$9d1611c77c2fe928($65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
|
|
186
186
|
global: true
|
|
187
187
|
}), underlayProps),
|
|
@@ -190,7 +190,7 @@ function $f3f84453ead64de5$var$ModalOverlayInner({ UNSTABLE_portalContainer, ...
|
|
|
190
190
|
ref: props.overlayRef,
|
|
191
191
|
"data-entering": entering || void 0,
|
|
192
192
|
"data-exiting": props.isExiting || void 0
|
|
193
|
-
}, /* @__PURE__ */
|
|
193
|
+
}, /* @__PURE__ */ $dbSRa$react__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
|
|
194
194
|
values: [
|
|
195
195
|
[
|
|
196
196
|
$f3f84453ead64de5$var$InternalModalContext,
|
|
@@ -226,7 +226,7 @@ function $f3f84453ead64de5$var$ModalContent(props) {
|
|
|
226
226
|
state
|
|
227
227
|
}
|
|
228
228
|
});
|
|
229
|
-
return /* @__PURE__ */
|
|
229
|
+
return /* @__PURE__ */ $dbSRa$react__default.createElement("div", {
|
|
230
230
|
...$3ef42575df84b30b$export$9d1611c77c2fe928($65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
|
|
231
231
|
global: true
|
|
232
232
|
}), modalProps),
|
|
@@ -234,7 +234,7 @@ function $f3f84453ead64de5$var$ModalContent(props) {
|
|
|
234
234
|
ref,
|
|
235
235
|
"data-entering": entering || void 0,
|
|
236
236
|
"data-exiting": isExiting || void 0
|
|
237
|
-
}, isDismissable && /* @__PURE__ */
|
|
237
|
+
}, isDismissable && /* @__PURE__ */ $dbSRa$react__default.createElement($86ea4cb521eb2e37$export$2317d149ed6f78c4, {
|
|
238
238
|
onDismiss: state.close
|
|
239
239
|
}), renderProps.children);
|
|
240
240
|
}
|
|
@@ -260,6 +260,7 @@ function $f3f84453ead64de5$var$ModalContent(props) {
|
|
|
260
260
|
* @param {boolean} [props.noCloseButton] - If `true`, the close button will not be displayed.
|
|
261
261
|
* @param {boolean} [props.noClickToDismiss] - If `true`, the modal will not close when clicking outside of it.
|
|
262
262
|
* @param {boolean} [props.noKeyboardDismiss] - If `true`, the modal will not close when pressing the `Esc` key.
|
|
263
|
+
* @param {boolean} [props.noBackdrop] - If `true`, the modal will not have a visible backdrop. Functionally, it'll still be there. For an experience without a backdrop, consider using the `Popover` component instead.
|
|
263
264
|
* @param {string} [props.className] - Classes to pass to the modal container.
|
|
264
265
|
* @param {string} [props.overlayClassName] - Classes to pass to the modal backdrop.
|
|
265
266
|
* @param {string} [props.actionsClassName] - Classes to pass to the modal footer (actions) container.
|
|
@@ -308,6 +309,7 @@ const ModalInternal = (props) => {
|
|
|
308
309
|
noCloseButton,
|
|
309
310
|
noClickToDismiss,
|
|
310
311
|
noKeyboardDismiss,
|
|
312
|
+
noBackdrop,
|
|
311
313
|
"aria-label": ariaLabel,
|
|
312
314
|
className,
|
|
313
315
|
headerClassName,
|
|
@@ -326,7 +328,8 @@ const ModalInternal = (props) => {
|
|
|
326
328
|
onOpenChange,
|
|
327
329
|
isKeyboardDismissDisabled: noKeyboardDismiss,
|
|
328
330
|
className: ({ isEntering, isExiting }) => clsx(
|
|
329
|
-
"es:fixed es:inset-0 es:z-9999 es:flex es:min-h-full es:items-center es:justify-center es:overflow-y-auto es:p-4
|
|
331
|
+
"es:fixed es:inset-0 es:z-9999 es:flex es:min-h-full es:items-center es:justify-center es:overflow-y-auto es:p-4",
|
|
332
|
+
!noBackdrop && "es:bg-accent-950/20 es:backdrop-blur-xs",
|
|
330
333
|
isEntering && "es:motion-opacity-in es:motion-duration-150",
|
|
331
334
|
isExiting && "es:motion-opacity-out es:motion-duration-150",
|
|
332
335
|
overlayClassName
|
|
@@ -336,32 +339,32 @@ const ModalInternal = (props) => {
|
|
|
336
339
|
$f3f84453ead64de5$export$2b77a92f1a5ad772,
|
|
337
340
|
{
|
|
338
341
|
className: ({ isEntering, isExiting }) => clsx(
|
|
339
|
-
"es:w-full es:max-w-lg es:overflow-hidden es:rounded-3xl es:
|
|
340
|
-
isEntering && "es:motion-
|
|
341
|
-
isExiting && "es:motion-
|
|
342
|
+
"es:w-full es:max-w-lg es:overflow-hidden es:rounded-3xl es:inset-ring es:inset-ring-surface-400/30 es:bg-white es:bg-linear-to-b es:from-accent-300/3 es:to-accent-300/1 es:text-left es:align-middle es:shadow-xl es:text-surface-900",
|
|
343
|
+
isEntering && "es:motion-scale-in-95 es:motion-fade-in es:motion-blur-in-xs es:motion-translate-y-in-[2rem] es:motion-duration-300 es:motion-ease-spring-smooth/scale",
|
|
344
|
+
isExiting && "es:motion-scale-out-95 es:motion-fade-out es:motion-blur-out-xs es:motion-translate-y-out-[2rem] es:motion-duration-250 es:motion-ease-spring-smooth/scale",
|
|
342
345
|
className
|
|
343
346
|
),
|
|
344
347
|
children: /* @__PURE__ */ jsx(
|
|
345
348
|
$de32f1b87079253c$export$3ddf2d174ce01153,
|
|
346
349
|
{
|
|
347
|
-
className: "es:relative es:text-sm es:outline-hidden",
|
|
350
|
+
className: clsx("es:relative es:text-sm es:outline-hidden", (!title || headerActions) && "es:pt-8"),
|
|
348
351
|
"aria-label": ariaLabel,
|
|
349
352
|
children: ({ close }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
350
|
-
/* @__PURE__ */ jsxs(HStack, { className: clsx(title && "es:px-
|
|
353
|
+
/* @__PURE__ */ jsxs(HStack, { className: clsx(title && "es:px-6 es:pt-6 es:justify-between", headerClassName), children: [
|
|
351
354
|
title && /* @__PURE__ */ jsx(
|
|
352
355
|
$5cb03073d3f54797$export$a8a3e93435678ff9,
|
|
353
356
|
{
|
|
354
|
-
className:
|
|
357
|
+
className: 'es:text-balance es:text-xl! es:my-0! es:text-accent-800 es:font-variation-["wdth"_200,"YTLC"_520,"wght"_425]',
|
|
355
358
|
slot: "title",
|
|
356
359
|
children: title
|
|
357
360
|
}
|
|
358
361
|
),
|
|
359
|
-
(!noCloseButton || headerActions) && /* @__PURE__ */ jsxs(HStack, { className: !title && "es:absolute es:top-
|
|
362
|
+
(!noCloseButton || headerActions) && /* @__PURE__ */ jsxs(HStack, { className: !title && "es:absolute es:top-3 es:right-3 es:z-20", children: [
|
|
360
363
|
headerActions,
|
|
361
364
|
!noCloseButton && /* @__PURE__ */ jsx(
|
|
362
365
|
Button,
|
|
363
366
|
{
|
|
364
|
-
className: !title && "es:bg-
|
|
367
|
+
className: !title && "es:bg-surface-50/60 es:backdrop-blur-lg",
|
|
365
368
|
onPress: close,
|
|
366
369
|
type: "ghost",
|
|
367
370
|
size: "small",
|
|
@@ -372,8 +375,8 @@ const ModalInternal = (props) => {
|
|
|
372
375
|
)
|
|
373
376
|
] })
|
|
374
377
|
] }),
|
|
375
|
-
children && /* @__PURE__ */ jsx("div", { className: clsx("es:p-
|
|
376
|
-
actions && /* @__PURE__ */ jsx(HStack, { className: clsx("es:justify-end es:px-
|
|
378
|
+
children && /* @__PURE__ */ jsx("div", { className: clsx("es:p-6 es:space-y-2.5", contentContainerClassName), children }),
|
|
379
|
+
actions && /* @__PURE__ */ jsx(HStack, { className: clsx("es:justify-end es:px-6 es:py-4", actionsClassName), children: actions })
|
|
377
380
|
] })
|
|
378
381
|
}
|
|
379
382
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
3
3
|
import { icons } from "../../icons/icons.js";
|
|
4
4
|
/**
|
|
@@ -12,6 +12,7 @@ import { icons } from "../../icons/icons.js";
|
|
|
12
12
|
* @param {string} [props.className] - Classes to pass to the notice.
|
|
13
13
|
* @param {NoticeType} [props.type='default'] - The type of the notice.
|
|
14
14
|
* @param {boolean} [props.alignIconToTitle=false] - If `true`, the icon will be aligned to the first row of title, instead of vertically centered.
|
|
15
|
+
* @param {boolean} [props.flat] - If `true`, component will look more flat. Useful for nested layer of controls.
|
|
15
16
|
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
16
17
|
*
|
|
17
18
|
* @returns {JSX.Element} The Notice component.
|
|
@@ -24,61 +25,75 @@ import { icons } from "../../icons/icons.js";
|
|
|
24
25
|
* @preserve
|
|
25
26
|
*/
|
|
26
27
|
const Notice = (props) => {
|
|
27
|
-
const { icon, label, subtitle, className, type = "default", alignIconToTitle = false, hidden } = props;
|
|
28
|
+
const { icon, label, subtitle, className, type = "default", alignIconToTitle = false, flat, hidden } = props;
|
|
28
29
|
if (hidden) {
|
|
29
30
|
return null;
|
|
30
31
|
}
|
|
31
32
|
const styles = {
|
|
32
33
|
info: {
|
|
33
34
|
icon: icons.info,
|
|
34
|
-
className: "es:
|
|
35
|
-
iconColorClassName: "es:text-blue-
|
|
36
|
-
textColorClassName: "es:text-blue-
|
|
37
|
-
subtitleColorClassName: "es:text-blue-950/
|
|
35
|
+
className: "es:inset-ring-blue-600/15 es:shadow-blue-800/5 es:from-blue-400/2 es:to-blue-600/5 es:inset-shadow-blue-500/10",
|
|
36
|
+
iconColorClassName: "es:text-blue-600",
|
|
37
|
+
textColorClassName: "es:text-blue-600",
|
|
38
|
+
subtitleColorClassName: "es:text-blue-950/55",
|
|
39
|
+
selectionClassName: "es:selection:bg-blue-100 es:selection:text-blue-700"
|
|
38
40
|
},
|
|
39
41
|
success: {
|
|
40
42
|
icon: icons.checkSquare,
|
|
41
|
-
className: "es:
|
|
43
|
+
className: "es:inset-ring-green-800/15 es:shadow-green-800/5 es:from-green-400/2 es:to-green-600/5 es:inset-shadow-green-500/10",
|
|
42
44
|
iconColorClassName: "es:text-green-600",
|
|
43
|
-
textColorClassName: "es:text-green-
|
|
44
|
-
subtitleColorClassName: "es:text-green-950/
|
|
45
|
+
textColorClassName: "es:text-green-600",
|
|
46
|
+
subtitleColorClassName: "es:text-green-950/55",
|
|
47
|
+
selectionClassName: "es:selection:bg-green-100 es:selection:text-green-700"
|
|
45
48
|
},
|
|
46
49
|
warning: {
|
|
47
50
|
icon: icons.warning,
|
|
48
|
-
className: "es:
|
|
49
|
-
iconColorClassName: "es:text-orange-
|
|
50
|
-
textColorClassName: "es:text-orange-
|
|
51
|
-
subtitleColorClassName: "es:text-orange-950/
|
|
51
|
+
className: "es:inset-ring-orange-800/15 es:shadow-orange-800/5 es:from-orange-400/2 es:to-orange-600/5 es:inset-shadow-orange-500/10",
|
|
52
|
+
iconColorClassName: "es:text-orange-600",
|
|
53
|
+
textColorClassName: "es:text-orange-600",
|
|
54
|
+
subtitleColorClassName: "es:text-orange-950/55",
|
|
55
|
+
selectionClassName: "es:selection:bg-orange-100 es:selection:text-orange-700"
|
|
52
56
|
},
|
|
53
57
|
error: {
|
|
54
58
|
icon: icons.errorCircle,
|
|
55
|
-
className: "es:
|
|
59
|
+
className: "es:inset-ring-red-800/15 es:shadow-red-800/5 es:from-red-400/2 es:to-red-600/5 es:inset-shadow-red-500/10",
|
|
56
60
|
iconColorClassName: "es:text-red-600",
|
|
57
61
|
textColorClassName: "es:text-red-700",
|
|
58
|
-
subtitleColorClassName: "es:text-red-
|
|
62
|
+
subtitleColorClassName: "es:text-red-950/55",
|
|
63
|
+
selectionClassName: "es:selection:bg-red-100 es:selection:text-red-700"
|
|
59
64
|
},
|
|
60
65
|
placeholder: {
|
|
61
66
|
icon: icons.componentGeneric,
|
|
62
|
-
className: "es:
|
|
67
|
+
className: "es:inset-ring-indigo-700/15 es:shadow-indigo-800/5 es:from-indigo-400/2 es:to-indigo-600/5 es:inset-shadow-indigo-500/10",
|
|
63
68
|
iconColorClassName: "es:text-indigo-600",
|
|
64
|
-
textColorClassName: "es:text-indigo-
|
|
65
|
-
subtitleColorClassName: "es:text-indigo-
|
|
69
|
+
textColorClassName: "es:text-indigo-600",
|
|
70
|
+
subtitleColorClassName: "es:text-indigo-900/55",
|
|
71
|
+
selectionClassName: "es:selection:bg-indigo-100 es:selection:text-indigo-700"
|
|
66
72
|
},
|
|
67
73
|
default: {
|
|
68
|
-
className: "es:
|
|
69
|
-
iconColorClassName: "es:text-
|
|
70
|
-
textColorClassName: "es:text-
|
|
71
|
-
subtitleColorClassName: "es:text-
|
|
74
|
+
className: "es:inset-ring-surface-700/10 es:shadow-surface-800/5 es:from-surface-400/2 es:to-surface-600/5 es:inset-shadow-surface-500/10",
|
|
75
|
+
iconColorClassName: "es:text-surface-500",
|
|
76
|
+
textColorClassName: "es:text-surface-500",
|
|
77
|
+
subtitleColorClassName: "es:text-surface-800/50",
|
|
78
|
+
selectionClassName: "es:selection:bg-accent-100 es:selection:text-accent-700"
|
|
72
79
|
}
|
|
73
80
|
};
|
|
74
|
-
return /* @__PURE__ */
|
|
81
|
+
return /* @__PURE__ */ jsxs(
|
|
75
82
|
"div",
|
|
76
83
|
{
|
|
77
84
|
className: clsx(
|
|
78
|
-
"es:grid es:grid-cols-[auto_1fr] es:grid-rows-[auto_auto]
|
|
85
|
+
"es:grid es:grid-cols-[auto_1fr] es:grid-rows-[auto_auto]",
|
|
86
|
+
"es:rounded-xl",
|
|
87
|
+
"es:bg-white",
|
|
88
|
+
"es:inset-ring",
|
|
89
|
+
"es:bg-linear-to-b es:from-35%",
|
|
90
|
+
"es:inset-shadow-sm",
|
|
91
|
+
flat ? "es:shadow-2xs" : "es:shadow-sm",
|
|
79
92
|
styles[type].className,
|
|
80
93
|
"es:icon:shrink-0",
|
|
81
|
-
|
|
94
|
+
"es:selection:p-2",
|
|
95
|
+
styles[type].selectionClassName,
|
|
96
|
+
icon || styles[type].icon ? "es:gap-x-2 es:py-3 es:pl-2.5 es:pr-3" : "es:py-3 es:px-3.5",
|
|
82
97
|
className
|
|
83
98
|
),
|
|
84
99
|
children: [
|
|
@@ -97,8 +112,9 @@ const Notice = (props) => {
|
|
|
97
112
|
"span",
|
|
98
113
|
{
|
|
99
114
|
className: clsx(
|
|
100
|
-
"es:col-span-2 es:col-start-2 es:text-balance es:text-
|
|
115
|
+
"es:col-span-2 es:col-start-2 es:text-balance es:text-14",
|
|
101
116
|
subtitle ? "es:self-end" : "es:row-span-2 es:self-center-safe",
|
|
117
|
+
'es:font-variation-["wdth"_110,"wght"_375,"YTLC"_520]',
|
|
102
118
|
styles[type].textColorClassName
|
|
103
119
|
),
|
|
104
120
|
children: label
|
|
@@ -108,7 +124,8 @@ const Notice = (props) => {
|
|
|
108
124
|
"span",
|
|
109
125
|
{
|
|
110
126
|
className: clsx(
|
|
111
|
-
"es:col-span-2 es:col-start-2 es:text-balance es:text-xs es:leading-tight es:pt-0.
|
|
127
|
+
"es:col-span-2 es:col-start-2 es:text-balance es:text-xs es:leading-tight es:pt-0.25",
|
|
128
|
+
'es:font-variation-["wdth"_76,"wght"_350]',
|
|
112
129
|
styles[type].subtitleColorClassName,
|
|
113
130
|
label ? "es:self-start" : "es:row-span-2 es:self-center-safe"
|
|
114
131
|
),
|
|
@@ -117,7 +134,7 @@ const Notice = (props) => {
|
|
|
117
134
|
)
|
|
118
135
|
]
|
|
119
136
|
}
|
|
120
|
-
)
|
|
137
|
+
);
|
|
121
138
|
};
|
|
122
139
|
export {
|
|
123
140
|
Notice
|