@eightshift/ui-components 5.6.1 → 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-CQ5ZZJ2w.js → Button-BXjXzdW_.js} +13 -13
- package/dist/{Dialog-BMgMUQuN.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-BiAnh5G5.js → List-BGHOoFf0.js} +8 -8
- package/dist/{ListBox-DggfiuO_.js → ListBox-Dd37zMvs.js} +40 -41
- package/dist/{OverlayArrow-DraDOoRn.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-DWGdCvnn.js → SearchField-CHYnN-jt.js} +16 -16
- package/dist/{SelectionManager-B6-b5NM2.js → SelectionManager-N8X7T_4D.js} +44 -46
- package/dist/{SharedElementTransition-fML-zIv6.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/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 -20
- 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 -9
- 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 -61
- package/dist/components/responsive/responsive-legacy.js +1 -1
- package/dist/components/responsive/responsive.js +27 -27
- package/dist/components/responsive-preview/responsive-preview.js +1 -1
- 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 -105
- 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 +25 -4
- 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-Ck8IV7xJ.js → general-B6pOveVp.js} +11 -10
- 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-D8-Zjpbd.js → index-oFgxU4zs.js} +3 -3
- 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-BvggcFOX.js → shared-DwjRce5e.js} +170 -36
- package/dist/{textSelection-DbCKqaw8.js → textSelection-CwHUtNVX.js} +1 -1
- package/dist/{useButton-v9ngEj50.js → useButton-DdZrS1Kz.js} +3 -3
- package/dist/{useEvent-BifIGnVS.js → useEvent-BD7Olibq.js} +1 -1
- package/dist/{useFilter-BlkUH1Ma.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-RdLrYsMP.js → useListState-ZKhRO8ML.js} +1 -1
- package/dist/{useLocalizedStringFormatter-eaZiN2tE.js → useLocalizedStringFormatter-NETP-8H8.js} +1 -1
- package/dist/{useNumberField-D16dDfYF.js → useNumberField-D2fUHql3.js} +10 -10
- package/dist/{useNumberFormatter-BCmkV-7c.js → useNumberFormatter-DGvuRCn7.js} +1 -1
- package/dist/{usePress-DJskZBH9.js → usePress-B8OteQMu.js} +6 -6
- package/dist/{useSingleSelectListState-n0AVMr3Y.js → useSingleSelectListState-BBTu4shO.js} +2 -2
- package/dist/{useToggle-DSBDAfdw.js → useToggle-BZhaYwZl.js} +4 -4
- package/dist/{useToggleState-CzN79ary.js → useToggleState-VkXJjsru.js} +1 -1
- package/dist/utilities/general.js +1 -1
- package/dist/utilities/index.js +1 -1
- package/dist/{utils-cvK1vxO7.js → utils-DGpXyJOJ.js} +29 -42
- package/dist/workers/image-analysis.worker.js +3 -3
- package/package.json +26 -22
- package/dist/ColorSwatch-xVS3rMYS.js +0 -66
- package/dist/Select-ef7c0426.esm-CmTkSxDx.js +0 -2474
- package/dist/Separator-B-xeqOkC.js +0 -344
- 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 -432
- package/dist/components/select/v2/multi-select.js +0 -403
- package/dist/components/select/v2/shared.js +0 -69
- package/dist/components/select/v2/single-select.js +0 -358
- package/dist/index-641ee5b8.esm-DVp0njHa.js +0 -3139
- package/dist/modifiers.esm-BuJQPI1X.js +0 -31
- package/dist/multi-select-components-CT_W0Cy9.js +0 -3744
- package/dist/react-select-async.esm-Zl1LPaPb.js +0 -107
- package/dist/react-select.esm-Bu36HujU.js +0 -15
- package/dist/useDragAndDrop-C08ZXv4F.js +0 -3925
- package/dist/wp/wp-font-enhancements.js +0 -1
- package/dist/wp/wp-ui-enhancements.js +0 -1
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { jsx, jsxs
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { a as $a049562f99e7db0e$export$f9c6924e160136d1, b as $3985021b0ad6602f$export$37fb8590cf2c088c, c as $a049562f99e7db0e$export$eb2fcfdbd7ba97d4, $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-
|
|
5
|
-
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-
|
|
6
|
-
import { a as $d2b4bc8c273e7be6$export$24d547caef80ccd1 } from "../../Button-
|
|
7
|
-
import {
|
|
8
|
-
import { $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "../../FieldError-
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import $dbSRa$react__default, { forwardRef, createContext, useRef } from "react";
|
|
3
|
+
import "../../default-i18n-CnQeC5Pl.js";
|
|
4
|
+
import { a as $a049562f99e7db0e$export$f9c6924e160136d1, b as $3985021b0ad6602f$export$37fb8590cf2c088c, c as $a049562f99e7db0e$export$eb2fcfdbd7ba97d4, $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-CNNksOWg.js";
|
|
5
|
+
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-D8a3eYb-.js";
|
|
6
|
+
import { a as $d2b4bc8c273e7be6$export$24d547caef80ccd1 } from "../../Button-BXjXzdW_.js";
|
|
7
|
+
import { $ as $64fa3d84918910a7$export$29f1550f4b0d4415, d as $64fa3d84918910a7$export$fabf2dc03a41866e, e as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, f as $64fa3d84918910a7$export$ef03459518577ad4, g as $64fa3d84918910a7$export$4d86445c2cf5e3, h as $64fa3d84918910a7$export$2881499e37b75b9a } from "../../utils-DGpXyJOJ.js";
|
|
8
|
+
import { $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "../../FieldError-DwBG6m1U.js";
|
|
9
9
|
import { $ as $d3e0e05bdfcf66bd$export$c24727297075ec6a } from "../../Form-Cq3fu75_.js";
|
|
10
|
-
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-
|
|
10
|
+
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-ztX6G1zR.js";
|
|
11
11
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-D2C6R0DK.js";
|
|
12
|
-
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-
|
|
13
|
-
import { $ as $de67e98908f0c6ee$export$7f629e9dc1ecf37c, a as $81397a9303501bda$export$23f548e970bdf099 } from "../../useNumberField-
|
|
14
|
-
import { Button } from "../button/button.js";
|
|
12
|
+
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-BQvmiUqb.js";
|
|
13
|
+
import { $ as $de67e98908f0c6ee$export$7f629e9dc1ecf37c, a as $81397a9303501bda$export$23f548e970bdf099 } from "../../useNumberField-D2fUHql3.js";
|
|
14
|
+
import { ButtonGroup, Button } from "../button/button.js";
|
|
15
15
|
import { icons } from "../../icons/icons.js";
|
|
16
16
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
17
17
|
import { BaseControl } from "../base-control/base-control.js";
|
|
18
|
+
import { c as cva } from "../../index-BHpUy2Ix.js";
|
|
18
19
|
const $b91743d66a0ed188$export$b414a48cf5dcbc11 = /* @__PURE__ */ createContext(null);
|
|
19
20
|
const $b91743d66a0ed188$export$6cc906c6cff9bec5 = /* @__PURE__ */ createContext(null);
|
|
20
21
|
const $b91743d66a0ed188$export$63c5fa0b2fdccd2e = /* @__PURE__ */ forwardRef(function NumberField(props, ref) {
|
|
@@ -49,7 +50,7 @@ const $b91743d66a0ed188$export$63c5fa0b2fdccd2e = /* @__PURE__ */ forwardRef(fun
|
|
|
49
50
|
global: true
|
|
50
51
|
});
|
|
51
52
|
delete DOMProps.id;
|
|
52
|
-
return /* @__PURE__ */
|
|
53
|
+
return /* @__PURE__ */ $dbSRa$react__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
|
|
53
54
|
values: [
|
|
54
55
|
[
|
|
55
56
|
$b91743d66a0ed188$export$6cc906c6cff9bec5,
|
|
@@ -96,7 +97,7 @@ const $b91743d66a0ed188$export$63c5fa0b2fdccd2e = /* @__PURE__ */ forwardRef(fun
|
|
|
96
97
|
validation
|
|
97
98
|
]
|
|
98
99
|
]
|
|
99
|
-
}, /* @__PURE__ */
|
|
100
|
+
}, /* @__PURE__ */ $dbSRa$react__default.createElement("div", {
|
|
100
101
|
...DOMProps,
|
|
101
102
|
...renderProps,
|
|
102
103
|
ref,
|
|
@@ -104,7 +105,7 @@ const $b91743d66a0ed188$export$63c5fa0b2fdccd2e = /* @__PURE__ */ forwardRef(fun
|
|
|
104
105
|
"data-disabled": props.isDisabled || void 0,
|
|
105
106
|
"data-required": props.isRequired || void 0,
|
|
106
107
|
"data-invalid": validation.isInvalid || void 0
|
|
107
|
-
}), props.name && /* @__PURE__ */
|
|
108
|
+
}), props.name && /* @__PURE__ */ $dbSRa$react__default.createElement("input", {
|
|
108
109
|
type: "hidden",
|
|
109
110
|
name: props.name,
|
|
110
111
|
form: props.form,
|
|
@@ -134,12 +135,13 @@ const $b91743d66a0ed188$export$63c5fa0b2fdccd2e = /* @__PURE__ */ forwardRef(fun
|
|
|
134
135
|
* @param {number} [props.fixedWidth] - If passed, sets the width of the input field to the provided number of characters. Useful if you have e.g. value from 1 to 1000, but you don't want the input field to change size when on lower values.
|
|
135
136
|
* @param {boolean} [props.inline] - If `true`, the number picker is displayed inline.
|
|
136
137
|
* @param {boolean} [props.noScrollToChange=false] - If `true`, the number picker does not change value when scrolling.
|
|
137
|
-
* @param {
|
|
138
|
+
* @param {InputSize} [props.size='default'] - Determines the input field size.
|
|
139
|
+
* @param {boolean} [props.flat] - If `true`, component will look more flat. Useful for nested layer of controls.
|
|
138
140
|
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
139
141
|
*
|
|
140
142
|
* @returns {JSX.Element} The NumberPicker component.
|
|
141
143
|
*
|
|
142
|
-
* @typedef {'
|
|
144
|
+
* @typedef {'small' | 'medium' | 'default' | 'large'} InputSize
|
|
143
145
|
*
|
|
144
146
|
* @example
|
|
145
147
|
* <NumberPicker
|
|
@@ -169,31 +171,78 @@ const NumberPicker = ({
|
|
|
169
171
|
inline,
|
|
170
172
|
noScrollToChange = false,
|
|
171
173
|
size = "default",
|
|
172
|
-
|
|
174
|
+
flat,
|
|
175
|
+
className,
|
|
173
176
|
hidden,
|
|
174
177
|
...props
|
|
175
178
|
}) => {
|
|
176
|
-
const [isInputFocused, setIsInputFocused] = useState(false);
|
|
177
179
|
if (hidden) {
|
|
178
180
|
return null;
|
|
179
181
|
}
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
182
|
+
const inputClass = cva(
|
|
183
|
+
[
|
|
184
|
+
"es:group",
|
|
185
|
+
"es:overflow-clip",
|
|
186
|
+
"es:flex es:items-center",
|
|
187
|
+
"es:leading-none",
|
|
188
|
+
"es:w-fit",
|
|
189
|
+
"es:rounded-lg es:focus-within:rounded-xl",
|
|
190
|
+
"es:transition-plus",
|
|
191
|
+
"es:inset-ring",
|
|
192
|
+
"es:focus-visible-within:ring-2 es:focus-visible-within:ring-accent-500/30",
|
|
193
|
+
"es:focus-visible-within:text-accent-950 es:focus-visible-within:inset-ring-accent-500",
|
|
194
|
+
"es:focus:placeholder:text-surface-400",
|
|
195
|
+
"es:text-13",
|
|
196
|
+
className
|
|
197
|
+
],
|
|
198
|
+
{
|
|
199
|
+
variants: {
|
|
200
|
+
size: {
|
|
201
|
+
small: ["es:min-h-8", "es:px-2.5 es:py-1"],
|
|
202
|
+
medium: ["es:min-h-9", "es:px-3 es:py-1"],
|
|
203
|
+
default: ["es:min-h-10", "es:px-3 es:py-1.5"],
|
|
204
|
+
large: ["es:min-h-12", "es:px-4 es:py-1.5"]
|
|
205
|
+
},
|
|
206
|
+
disabled: {
|
|
207
|
+
false: "es:selection:bg-surface-100 es:selection:text-accent-800",
|
|
208
|
+
true: "es:selection:bg-secondary-200 es:selection:text-secondary-600"
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
compoundVariants: [
|
|
212
|
+
{
|
|
213
|
+
flat: false,
|
|
214
|
+
disabled: false,
|
|
215
|
+
readOnly: false,
|
|
216
|
+
class: [
|
|
217
|
+
"es:bg-white",
|
|
218
|
+
"es:bg-linear-to-b es:from-secondary-100/0 es:to-secondary-100/50 es:from-25%",
|
|
219
|
+
"es:hover:from-surface-100/0 es:hover:to-surface-100/50",
|
|
220
|
+
"es:inset-ring-secondary-400/50 es:hover:inset-ring-surface-300 es:focus-within:inset-ring-surface-400",
|
|
221
|
+
"es:inset-shadow-sm es:inset-shadow-secondary-100/50",
|
|
222
|
+
"es:hover:placeholder:text-surface-400",
|
|
223
|
+
"es:placeholder:text-secondary-400",
|
|
224
|
+
"es:shadow-xs es:shadow-black/5"
|
|
225
|
+
]
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
flat: true,
|
|
229
|
+
disabled: false,
|
|
230
|
+
readOnly: false,
|
|
231
|
+
class: [
|
|
232
|
+
"es:inset-ring-secondary-100",
|
|
233
|
+
"es:focus-within:text-accent-950",
|
|
234
|
+
"es:placeholder:text-secondary-500/80",
|
|
235
|
+
"es:bg-secondary-100 es:focus-within:bg-surface-50",
|
|
236
|
+
"es:inset-ring-secondary-200/15 es:hover:inset-ring-secondary-200/65 es:focus-within:inset-ring-surface-200"
|
|
237
|
+
]
|
|
238
|
+
},
|
|
239
|
+
{ disabled: true, class: ["es:bg-secondary-50 es:inset-ring-secondary-200 es:text-secondary-400"] },
|
|
240
|
+
{ readOnly: true, flat: false, class: ["es:bg-secondary-50 es:inset-ring-secondary-300 es:text-secondary-400"] },
|
|
241
|
+
{ readOnly: true, flat: true, class: ["es:bg-secondary-50 es:inset-ring-secondary-300/60 es:text-secondary-400"] }
|
|
242
|
+
],
|
|
243
|
+
defaultVariants: { disabled: false, flat: false, size: "default", readOnly: false }
|
|
195
244
|
}
|
|
196
|
-
|
|
245
|
+
);
|
|
197
246
|
return /* @__PURE__ */ jsx(
|
|
198
247
|
$b91743d66a0ed188$export$63c5fa0b2fdccd2e,
|
|
199
248
|
{
|
|
@@ -215,75 +264,76 @@ const NumberPicker = ({
|
|
|
215
264
|
subtitle,
|
|
216
265
|
help,
|
|
217
266
|
inline,
|
|
218
|
-
className: "es:
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
sizes?.[size]?.field ?? sizes.default.field,
|
|
228
|
-
"es:disabled:shadow-none es:disabled:border-secondary-200 es:disabled:bg-secondary-50 es:disabled:text-secondary-500 es:disabled:cursor-default es:readonly:bg-secondary-50"
|
|
267
|
+
children: /* @__PURE__ */ jsxs("div", { className: "es:flex es:gap-1", children: [
|
|
268
|
+
/* @__PURE__ */ jsxs($a049562f99e7db0e$export$eb2fcfdbd7ba97d4, { className: inputClass({ disabled, flat, size, readOnly }), children: [
|
|
269
|
+
prefix && /* @__PURE__ */ jsx(
|
|
270
|
+
"span",
|
|
271
|
+
{
|
|
272
|
+
slot: "prefix",
|
|
273
|
+
className: 'es:mr-1 es:select-none es:leading-none es:text-current/60 es:font-variation-["wdth"_100,"wght"_400,"slnt"_-1] es:group-focus-within:text-surface-500',
|
|
274
|
+
children: prefix
|
|
275
|
+
}
|
|
229
276
|
),
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}
|
|
238
|
-
),
|
|
239
|
-
/* @__PURE__ */ jsx(
|
|
240
|
-
$3985021b0ad6602f$export$f5b8910cec6cf069,
|
|
241
|
-
{
|
|
242
|
-
onFocus: () => setIsInputFocused(true),
|
|
243
|
-
onBlur: () => setIsInputFocused(false),
|
|
244
|
-
className: "es:col-start-2 es:row-span-2 es:border-none! es:bg-transparent es:px-0! es:py-1! es:text-sm es:tabular-nums es:shadow-none! es:outline-hidden! es:selection:bg-accent-500/20 es:selection:text-accent-950 es:focus:shadow-none! es:any-focus:outline-hidden",
|
|
245
|
-
placeholder,
|
|
246
|
-
style: {
|
|
247
|
-
width: fixedWidth ? `${fixedWidth}ch` : `calc(${min < 0 ? "0.75ch + " : ""}${(max ?? 1e3)?.toString()?.length} * 1ch)`
|
|
248
|
-
},
|
|
249
|
-
"aria-label": ariaLabel ?? __("Enter a number", "eightshift-ui-components")
|
|
277
|
+
/* @__PURE__ */ jsx(
|
|
278
|
+
$3985021b0ad6602f$export$f5b8910cec6cf069,
|
|
279
|
+
{
|
|
280
|
+
className: 'es:tracking-wide es:font-variation-["wdth"_84,"YTLC"_520,"wght"_325,"slnt"_0,"YTFI"_788] es:placeholder-shown:font-variation-["wdth"_100,"YTLC"_500,"wght"_250,"slnt"_-8] es:any-focus:outline-hidden! es:p-px es:border-none! es:shadow-none! es:bg-transparent',
|
|
281
|
+
placeholder,
|
|
282
|
+
style: {
|
|
283
|
+
width: fixedWidth ? `calc(${fixedWidth}ch + 2px)` : `calc(${min < 0 ? "0.75ch + " : "0.5ch + "}${(max ?? 1e3)?.toString()?.length} * 1ch)`
|
|
250
284
|
}
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
285
|
+
}
|
|
286
|
+
),
|
|
287
|
+
/* @__PURE__ */ jsxs(
|
|
288
|
+
ButtonGroup,
|
|
289
|
+
{
|
|
290
|
+
className: clsx(
|
|
291
|
+
"es:hidden es:transition-discrete es:gap-0! es:transition es:pl-0.5 es:ease-spring-smooth es:duration-300 es:origin-left",
|
|
292
|
+
"es:starting:opacity-0 es:starting:blur-[2px] es:starting:translate-x-2",
|
|
293
|
+
"es:opacity-100 es:blur-none es:translate-x-0",
|
|
294
|
+
!disabled && !readOnly && "es:group-hover:flex es:group-focus-within:flex",
|
|
295
|
+
disabled && "es:hidden"
|
|
261
296
|
),
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
297
|
+
vertical: true,
|
|
298
|
+
children: [
|
|
299
|
+
/* @__PURE__ */ jsx(
|
|
300
|
+
Button,
|
|
301
|
+
{
|
|
302
|
+
type: "ghost",
|
|
303
|
+
className: clsx(
|
|
304
|
+
"es:col-start-4 es:w-4 es:disabled:opacity-40 es:text-current/80 es:group-focus-within:text-surface-500 es:icon:size-[0.65rem] es:icon:stroke-2",
|
|
305
|
+
size === "small" ? "es:h-3" : "es:h-3.5"
|
|
306
|
+
),
|
|
307
|
+
slot: "increment",
|
|
308
|
+
icon: icons.chevronUp
|
|
309
|
+
}
|
|
310
|
+
),
|
|
311
|
+
/* @__PURE__ */ jsx(
|
|
312
|
+
Button,
|
|
313
|
+
{
|
|
314
|
+
type: "ghost",
|
|
315
|
+
className: clsx(
|
|
316
|
+
"es:col-start-4 es:w-4 es:disabled:opacity-40 es:text-current/80 es:group-focus-within:text-surface-500 es:icon:size-[0.65rem] es:icon:stroke-2",
|
|
317
|
+
size === "small" ? "es:h-3" : "es:h-3.5"
|
|
318
|
+
),
|
|
319
|
+
slot: "decrement",
|
|
320
|
+
icon: icons.chevronDown
|
|
321
|
+
}
|
|
322
|
+
)
|
|
323
|
+
]
|
|
324
|
+
}
|
|
325
|
+
),
|
|
326
|
+
suffix && /* @__PURE__ */ jsx(
|
|
327
|
+
"span",
|
|
328
|
+
{
|
|
329
|
+
slot: "suffix",
|
|
330
|
+
className: 'es:ml-1 es:select-none es:leading-none es:text-current/60 es:font-variation-["wdth"_100,"wght"_400,"slnt"_-1] es:group-focus-within:text-surface-500',
|
|
331
|
+
children: suffix
|
|
332
|
+
}
|
|
333
|
+
)
|
|
334
|
+
] }),
|
|
335
|
+
children
|
|
336
|
+
] })
|
|
287
337
|
}
|
|
288
338
|
)
|
|
289
339
|
}
|
|
@@ -7,7 +7,7 @@ import { SubMenuItem, MenuSeparator, MenuItem, Menu } from "../menu/menu.js";
|
|
|
7
7
|
import { RadioButtonGroup, RadioButton } from "../radio/radio.js";
|
|
8
8
|
import { RichLabel } from "../rich-label/rich-label.js";
|
|
9
9
|
import { ToggleButton } from "../toggle-button/toggle-button.js";
|
|
10
|
-
import { _ as __ } from "../../default-i18n-
|
|
10
|
+
import { _ as __ } from "../../default-i18n-CnQeC5Pl.js";
|
|
11
11
|
/**
|
|
12
12
|
* A component that allows the user to select an option from a list of options.
|
|
13
13
|
*
|
|
@@ -126,11 +126,23 @@ const OptionSelect = (props) => {
|
|
|
126
126
|
subtitle: optionSubtitle,
|
|
127
127
|
separator: optionHasSeparator,
|
|
128
128
|
sectionTitle: optionSectionTitle,
|
|
129
|
+
sectionIcon: optionSectionIcon,
|
|
130
|
+
sectionSubtitle: optionSectionSubtitle,
|
|
131
|
+
sectionEndIcon: optionSectionEndIcon,
|
|
129
132
|
shortcut: optionShortcut,
|
|
130
133
|
disabled: optionDisabled
|
|
131
134
|
}) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
132
135
|
(optionHasSeparator === true || optionHasSeparator === "above") && /* @__PURE__ */ jsx(MenuSeparator, {}),
|
|
133
|
-
optionSectionTitle && /* @__PURE__ */ jsx(
|
|
136
|
+
optionSectionTitle && /* @__PURE__ */ jsx(
|
|
137
|
+
MenuItem,
|
|
138
|
+
{
|
|
139
|
+
icon: typeof optionSectionIcon === "string" ? icons?.[optionSectionIcon] : optionSectionIcon,
|
|
140
|
+
endIcon: typeof optionSectionEndIcon === "string" ? icons?.[optionSectionEndIcon] : optionSectionEndIcon,
|
|
141
|
+
subtitle: optionSectionSubtitle,
|
|
142
|
+
disabled: true,
|
|
143
|
+
children: optionSectionTitle
|
|
144
|
+
}
|
|
145
|
+
),
|
|
134
146
|
/* @__PURE__ */ jsxs(
|
|
135
147
|
MenuItem,
|
|
136
148
|
{
|
|
@@ -176,11 +188,23 @@ const OptionSelect = (props) => {
|
|
|
176
188
|
subtitle: optionSubtitle,
|
|
177
189
|
separator: optionHasSeparator,
|
|
178
190
|
sectionTitle: optionSectionTitle,
|
|
191
|
+
sectionIcon: optionSectionIcon,
|
|
192
|
+
sectionSubtitle: optionSectionSubtitle,
|
|
193
|
+
sectionEndIcon: optionSectionEndIcon,
|
|
179
194
|
shortcut: optionShortcut,
|
|
180
195
|
disabled: optionDisabled
|
|
181
196
|
}) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
182
197
|
(optionHasSeparator === true || optionHasSeparator === "above") && /* @__PURE__ */ jsx(MenuSeparator, {}),
|
|
183
|
-
optionSectionTitle && /* @__PURE__ */ jsx(
|
|
198
|
+
optionSectionTitle && /* @__PURE__ */ jsx(
|
|
199
|
+
MenuItem,
|
|
200
|
+
{
|
|
201
|
+
icon: typeof optionSectionIcon === "string" ? icons?.[optionSectionIcon] : optionSectionIcon,
|
|
202
|
+
endIcon: typeof optionSectionEndIcon === "string" ? icons?.[optionSectionEndIcon] : optionSectionEndIcon,
|
|
203
|
+
subtitle: optionSectionSubtitle,
|
|
204
|
+
disabled: true,
|
|
205
|
+
children: optionSectionTitle
|
|
206
|
+
}
|
|
207
|
+
),
|
|
184
208
|
/* @__PURE__ */ jsxs(
|
|
185
209
|
MenuItem,
|
|
186
210
|
{
|
|
@@ -325,11 +349,23 @@ const OptionSelect = (props) => {
|
|
|
325
349
|
subtitle: optionSubtitle,
|
|
326
350
|
separator: optionHasSeparator,
|
|
327
351
|
sectionTitle: optionSectionTitle,
|
|
352
|
+
sectionIcon: optionSectionIcon,
|
|
353
|
+
sectionSubtitle: optionSectionSubtitle,
|
|
354
|
+
sectionEndIcon: optionSectionEndIcon,
|
|
328
355
|
shortcut: optionShortcut,
|
|
329
356
|
disabled: optionDisabled
|
|
330
357
|
}) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
331
358
|
(optionHasSeparator === true || optionHasSeparator === "above") && /* @__PURE__ */ jsx(MenuSeparator, {}),
|
|
332
|
-
optionSectionTitle && /* @__PURE__ */ jsx(
|
|
359
|
+
optionSectionTitle && /* @__PURE__ */ jsx(
|
|
360
|
+
MenuItem,
|
|
361
|
+
{
|
|
362
|
+
icon: typeof optionSectionIcon === "string" ? icons?.[optionSectionIcon] : optionSectionIcon,
|
|
363
|
+
endIcon: typeof optionSectionEndIcon === "string" ? icons?.[optionSectionEndIcon] : optionSectionEndIcon,
|
|
364
|
+
subtitle: optionSectionSubtitle,
|
|
365
|
+
disabled: true,
|
|
366
|
+
children: optionSectionTitle
|
|
367
|
+
}
|
|
368
|
+
),
|
|
333
369
|
/* @__PURE__ */ jsxs(
|
|
334
370
|
MenuItem,
|
|
335
371
|
{
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
3
3
|
import { RichLabel } from "../rich-label/rich-label.js";
|
|
4
|
-
import { $ as $5cb03073d3f54797$export$a8a3e93435678ff9 } from "../../Heading-
|
|
4
|
+
import { $ as $5cb03073d3f54797$export$a8a3e93435678ff9 } from "../../Heading-BmRX4BRL.js";
|
|
5
|
+
import { cloneElement } from "react";
|
|
5
6
|
/**
|
|
6
7
|
* Component that provides a container panel for options, with an optional title.
|
|
7
8
|
* Best used within the Gutenberg sidebar, instead of the default `PanelBody` component.
|
|
@@ -30,24 +31,23 @@ const OptionsPanel = (props) => {
|
|
|
30
31
|
if (hidden) {
|
|
31
32
|
return null;
|
|
32
33
|
}
|
|
33
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
34
|
-
/* @__PURE__ */ jsxs("div", { className: clsx("es:
|
|
34
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
35
|
+
/* @__PURE__ */ jsxs("div", { className: clsx("es:overflow-clip es:max-w-lg", className), children: [
|
|
35
36
|
title && /* @__PURE__ */ jsx(
|
|
36
37
|
RichLabel,
|
|
37
38
|
{
|
|
38
39
|
icon,
|
|
39
40
|
label: title,
|
|
40
41
|
subtitle,
|
|
41
|
-
className: clsx(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
),
|
|
42
|
+
className: clsx("es:shrink-0 es:text-secondary-700 es:px-1 es:pt-5 es:pb-1"),
|
|
43
|
+
labelClassName: "es:text-lg es:leading-tight",
|
|
44
|
+
subtitleClassName: "es:text-base es:leading-tight",
|
|
45
45
|
noColor: true
|
|
46
46
|
}
|
|
47
47
|
),
|
|
48
|
-
/* @__PURE__ */ jsx("div", { className: "es:
|
|
48
|
+
/* @__PURE__ */ jsx("div", { className: "es:flex es:flex-col es:gap-1", children })
|
|
49
49
|
] }),
|
|
50
|
-
help && /* @__PURE__ */ jsx("span", { className: "es:mx-
|
|
50
|
+
help && /* @__PURE__ */ jsx("span", { className: "es:mx-1 es:mt-2 es:block es:text-sm es:text-secondary-400", children: help })
|
|
51
51
|
] });
|
|
52
52
|
};
|
|
53
53
|
/**
|
|
@@ -71,7 +71,19 @@ const OptionsPanelSection = ({ children, className, hidden }) => {
|
|
|
71
71
|
if (hidden) {
|
|
72
72
|
return null;
|
|
73
73
|
}
|
|
74
|
-
return /* @__PURE__ */ jsx(
|
|
74
|
+
return /* @__PURE__ */ jsx(
|
|
75
|
+
"div",
|
|
76
|
+
{
|
|
77
|
+
className: clsx(
|
|
78
|
+
"es:flex es:flex-col es:gap-5",
|
|
79
|
+
"es:p-4",
|
|
80
|
+
"es:bg-secondary-50 es:inset-ring es:inset-ring-secondary-100",
|
|
81
|
+
"es:rounded-md es:first:rounded-t-2xl es:last:rounded-b-2xl",
|
|
82
|
+
className
|
|
83
|
+
),
|
|
84
|
+
children
|
|
85
|
+
}
|
|
86
|
+
);
|
|
75
87
|
};
|
|
76
88
|
/**
|
|
77
89
|
* Component that provides a header for the top of an options page.
|
|
@@ -99,12 +111,12 @@ const OptionsPanelHeader = ({ children, sticky, title, className, actions, level
|
|
|
99
111
|
if (hidden) {
|
|
100
112
|
return null;
|
|
101
113
|
}
|
|
102
|
-
return /* @__PURE__ */ jsxs("div", { className: clsx("es:space-y-2.5", limitWidth && "es:max-w-
|
|
114
|
+
return /* @__PURE__ */ jsxs("div", { className: clsx("es:space-y-2.5", limitWidth && "es:max-w-2xl", sticky && "es:sticky es:top-0 es:z-10 es:bg-white", className), children: [
|
|
103
115
|
/* @__PURE__ */ jsxs("div", { className: "es:flex es:flex-wrap es:items-center es:justify-between es:gap-x-8 es:gap-y-4", children: [
|
|
104
116
|
/* @__PURE__ */ jsx(
|
|
105
117
|
$5cb03073d3f54797$export$a8a3e93435678ff9,
|
|
106
118
|
{
|
|
107
|
-
className:
|
|
119
|
+
className: 'es:text-3xl es:text-surface-800 es:font-variation-["wdth"_180,"YTLC"_540,"wght"_300]',
|
|
108
120
|
level,
|
|
109
121
|
children: title
|
|
110
122
|
}
|
|
@@ -119,12 +131,14 @@ const OptionsPanelHeader = ({ children, sticky, title, className, actions, level
|
|
|
119
131
|
*
|
|
120
132
|
* @component
|
|
121
133
|
* @param {Object} props - Component props.
|
|
134
|
+
* @param {JSX.Element} [props.icon] - Icon to show on the right.
|
|
122
135
|
* @param {string} [props.title] - Title to show.
|
|
123
136
|
* @param {string} [props.subtitle] - Subtitle to show.
|
|
124
137
|
* @param {Number} [props.level=2] - Heading level of the title.
|
|
125
138
|
* @param {string} [props.className] - Classes to pass to the container.
|
|
139
|
+
* @param {string} [props.iconClassName] - Classes to pass to the icon.
|
|
126
140
|
* @param {JSX.Element|JSX.Element[]} [props.actions] - Controls to show on the right side of the header.
|
|
127
|
-
* @param {boolean} [props.
|
|
141
|
+
* @param {boolean} [props.flat] - If `true`, component will look more flat. Useful for nested layer of controls.
|
|
128
142
|
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
129
143
|
*
|
|
130
144
|
* @returns {JSX.Element} The OptionsPanelIntro component.
|
|
@@ -134,21 +148,34 @@ const OptionsPanelHeader = ({ children, sticky, title, className, actions, level
|
|
|
134
148
|
*
|
|
135
149
|
* @preserve
|
|
136
150
|
*/
|
|
137
|
-
const OptionsPanelIntro = ({ title, subtitle, className, level = 3,
|
|
151
|
+
const OptionsPanelIntro = ({ icon, title, subtitle, className, iconClassName, level = 3, flat, hidden }) => {
|
|
138
152
|
if (hidden) {
|
|
139
153
|
return null;
|
|
140
154
|
}
|
|
141
|
-
return /* @__PURE__ */ jsxs(
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
155
|
+
return /* @__PURE__ */ jsxs(
|
|
156
|
+
"div",
|
|
157
|
+
{
|
|
158
|
+
className: clsx(
|
|
159
|
+
"es:relative es:overflow-clip",
|
|
160
|
+
"es:py-5 es:px-6 es:rounded-2xl es:max-w-lg",
|
|
161
|
+
"es:bg-surface-100 es:inset-ring es:inset-ring-surface-600/5",
|
|
162
|
+
!flat && "es:shadow-xs es:shadow-black/5",
|
|
163
|
+
className
|
|
164
|
+
),
|
|
165
|
+
children: [
|
|
166
|
+
/* @__PURE__ */ jsx(
|
|
167
|
+
$5cb03073d3f54797$export$a8a3e93435678ff9,
|
|
168
|
+
{
|
|
169
|
+
className: 'es:text-2xl es:my-0! es:text-accent-900 es:font-variation-["wdth"_180,"YTLC"_540,"wght"_350]',
|
|
170
|
+
level,
|
|
171
|
+
children: title
|
|
172
|
+
}
|
|
173
|
+
),
|
|
174
|
+
subtitle && /* @__PURE__ */ jsx("p", { className: 'es:text-13 es:my-0! es:text-surface-500 es:mt-0.75 es:font-variation-["wdth"_90,"YTLC"_560,"wght"_325]', children: subtitle }),
|
|
175
|
+
icon && cloneElement(icon, { className: clsx("es:absolute es:-top-2 es:right-2.5 es:rotate-12 es:text-surface-500/10 es:size-18", iconClassName) })
|
|
176
|
+
]
|
|
177
|
+
}
|
|
178
|
+
);
|
|
152
179
|
};
|
|
153
180
|
export {
|
|
154
181
|
OptionsPanel,
|
|
@@ -2,7 +2,7 @@ import { jsx, jsxs } 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
|
import "react";
|
|
5
|
-
import "../../react-jsx-parser.min-
|
|
5
|
+
import "../../react-jsx-parser.min-B_hvYYa1.js";
|
|
6
6
|
import { truncateMiddle } from "../../utilities/text-helpers.js";
|
|
7
7
|
import { SmartImage } from "../smart-image/smart-image.js";
|
|
8
8
|
/**
|
|
@@ -67,15 +67,15 @@ const FilePickerShell = (props) => {
|
|
|
67
67
|
{
|
|
68
68
|
...rest,
|
|
69
69
|
className: clsx(
|
|
70
|
-
"es:border es:border-
|
|
70
|
+
"es:border es:border-surface-200 es:bg-white es:bg-linear-to-br es:from-surface-50/5 es:to-surface-50/30 es:flex es:justify-between es:rounded-2xl es:isolate es:relative es:flex-col es:gap-2 es:overflow-clip es:group es:p-2",
|
|
71
71
|
className
|
|
72
72
|
),
|
|
73
73
|
children: [
|
|
74
|
-
type === "file" && /* @__PURE__ */ jsxs("div", { className: "es:grow es:flex es:flex-col es:gap-2 es:text-sm es:items-center-safe es:justify-center-safe es:font-mono es:icon:size-6 es:rounded-xl es:bg-
|
|
74
|
+
type === "file" && /* @__PURE__ */ jsxs("div", { className: "es:grow es:flex es:flex-col es:gap-2 es:text-sm es:items-center-safe es:justify-center-safe es:font-mono es:icon:size-6 es:rounded-xl es:bg-surface-50 es:inset-ring es:inset-ring-surface-100 es:icon:text-surface-500 es:text-surface-700 es:p-2", children: [
|
|
75
75
|
icon,
|
|
76
76
|
/* @__PURE__ */ jsx("span", { className: "es:line-clamp-1", children: truncateMiddle(url, 34) })
|
|
77
77
|
] }),
|
|
78
|
-
children && /* @__PURE__ */ jsx("div", { className: "es:flex es:items-center-safe es:gap-
|
|
78
|
+
children && /* @__PURE__ */ jsx("div", { className: "es:flex es:items-center-safe es:gap-0.75 es-button-group-h", children })
|
|
79
79
|
]
|
|
80
80
|
}
|
|
81
81
|
);
|
|
@@ -93,10 +93,10 @@ const FilePickerShell = (props) => {
|
|
|
93
93
|
hasAnalysed && isTransparent && "es:bg-white/60 es:object-contain es:mx-auto",
|
|
94
94
|
hasAnalysed && isTransparent && (transparencyInfo?.left || transparencyInfo?.right) && "es:w-full!",
|
|
95
95
|
hasAnalysed && isTransparent && (transparencyInfo?.top || transparencyInfo?.bottom) && "es:h-full!",
|
|
96
|
-
hasAnalysed && !isTransparent && "es:w-full es:aspect-3-2 es:object-cover",
|
|
97
|
-
hasAnalysed && "es:grow es:rounded-xl"
|
|
96
|
+
hasAnalysed && !isTransparent && "es:w-full! es:aspect-3-2 es:object-cover",
|
|
97
|
+
hasAnalysed && "es:grow es:rounded-xl es:h-fill!"
|
|
98
98
|
),
|
|
99
|
-
errorClassName: "es:aspect-3-2 es:rounded-2xl es:bg-
|
|
99
|
+
errorClassName: "es:aspect-3-2 es:rounded-2xl es:bg-linear-to-br es:from-white es:to-secondary-50 es:border es:border-dashed es:border-secondary-200",
|
|
100
100
|
imageAnalysisSettings: { yFrom: 0.25, yTo: 0.75 },
|
|
101
101
|
...rest,
|
|
102
102
|
children: ({ image, dominantColors, isDark, hasAnalysed, isTransparent }) => /* @__PURE__ */ jsxs(
|
|
@@ -106,7 +106,7 @@ const FilePickerShell = (props) => {
|
|
|
106
106
|
"es:border es:justify-between es:rounded-2xl es:isolate es:relative es:flex-col es:gap-y-2 es:grid es:grid-cols-1 es:overflow-clip es:aspect-3-2 es:transition",
|
|
107
107
|
hasAnalysed ? "es:border-secondary-200" : "es:border-secondary-200/0",
|
|
108
108
|
hasAnalysed && !isTransparent && "es:group es:grid-rows-1",
|
|
109
|
-
hasAnalysed && isTransparent && "es:p-2 es:grid-rows-[minmax(0,
|
|
109
|
+
hasAnalysed && isTransparent && "es:p-2 es:grid-rows-[minmax(0,1fr)_auto] es:h-fit",
|
|
110
110
|
!hasAnalysed && "es:shimmer-dark es:bg-secondary-50",
|
|
111
111
|
className
|
|
112
112
|
),
|
|
@@ -117,7 +117,8 @@ const FilePickerShell = (props) => {
|
|
|
117
117
|
"div",
|
|
118
118
|
{
|
|
119
119
|
className: clsx(
|
|
120
|
-
"es:flex es:items-center-safe es:gap-
|
|
120
|
+
"es:flex es:items-center-safe es:gap-0.75",
|
|
121
|
+
"es-button-group-h",
|
|
121
122
|
!isTransparent && "es:absolute es:bottom-2 es:left-2 es:right-2 es:translate-y-[125%] es:group-hover:translate-y-0 es:has-aria-expanded:translate-y-0 es:has-focus-visible:translate-y-0 es:transition-transform es:ease-spring-smooth"
|
|
122
123
|
),
|
|
123
124
|
children: typeof children === "function" ? children({ dominantColors, isDark, isTransparent }) : children
|