@eightshift/ui-components 5.3.3 → 5.5.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-npzfSoYo.js → Button-CQ5ZZJ2w.js} +8 -14
- package/dist/{Dialog-CQ8H6Noi.js → Dialog-BMgMUQuN.js} +81 -73
- package/dist/{FocusScope-DJApHXhY.js → FocusScope-B5vxRkHm.js} +1 -1
- package/dist/{Heading-bh1HU5HH.js → Heading-B5aEynOM.js} +1 -1
- package/dist/{Input-ChJaTNa5.js → Input-8yja_IHC.js} +6 -5
- package/dist/{ListBox-D0Stb4wr.js → ListBox-DggfiuO_.js} +28 -16
- package/dist/{OverlayArrow-DivvkAVb.js → OverlayArrow-DraDOoRn.js} +1 -1
- package/dist/{RSPContexts-2lR5GG9p.js → RSPContexts-CJ-HBf0L.js} +8 -4
- package/dist/{SearchField-jVsbJe1O.js → SearchField-DWGdCvnn.js} +24 -18
- package/dist/{Select-ciHB1pub.js → Select-BvggcFOX.js} +204 -68
- package/dist/SelectionIndicator-D7WMzeAW.js +7 -0
- package/dist/{SelectionManager-CabSdgMq.js → SelectionManager-B6-b5NM2.js} +98 -59
- package/dist/{Separator-BPvqJny4.js → Separator-B-xeqOkC.js} +6 -6
- package/dist/SharedElementTransition-fML-zIv6.js +12 -0
- package/dist/{Slider-ChP04COa.js → Slider-DfU6bRtH.js} +4 -4
- package/dist/{VisuallyHidden-X6SggVVO.js → VisuallyHidden-CgnIuZJ2.js} +1 -1
- package/dist/assets/style-admin.css +925 -79
- package/dist/assets/style-editor.css +925 -79
- package/dist/assets/style.css +925 -79
- package/dist/assets/wp-font-enhancements.css +1 -1
- package/dist/assets/wp-ui-enhancements.css +1 -1
- package/dist/components/button/button.js +75 -22
- package/dist/components/checkbox/checkbox.js +14 -10
- package/dist/components/color-pickers/solid-color-picker.js +8 -8
- package/dist/components/expandable/expandable.js +40 -10
- package/dist/components/index.js +4 -0
- package/dist/components/input-field/input-field.js +5 -5
- package/dist/components/link-input/link-input.js +32 -21
- package/dist/components/menu/menu.js +2 -2
- package/dist/components/modal/modal.js +34 -6
- package/dist/components/number-picker/number-picker.js +5 -4
- package/dist/components/options-panel/options-panel.js +1 -1
- package/dist/components/placeholders/file-picker-shell.js +130 -0
- package/dist/components/popover/popover.js +1 -1
- package/dist/components/radio/radio.js +20 -11
- package/dist/components/select/v2/async-multi-select.js +6 -6
- package/dist/components/select/v2/async-select.js +6 -6
- package/dist/components/select/v2/multi-select.js +7 -7
- package/dist/components/select/v2/shared.js +1 -1
- package/dist/components/select/v2/single-select.js +7 -7
- package/dist/components/slider/column-config-slider.js +1 -1
- package/dist/components/slider/slider.js +1 -1
- package/dist/components/smart-image/smart-image.js +117 -0
- package/dist/components/tabs/tabs.js +16 -10
- package/dist/components/toggle/switch.js +5 -5
- package/dist/components/toggle-button/toggle-button.js +10 -5
- package/dist/components/tooltip/tooltip.js +2 -2
- package/dist/icons/icons.js +10 -0
- package/dist/index.js +4 -0
- package/dist/{textSelection-k0u64dDA.js → textSelection-DbCKqaw8.js} +1 -1
- package/dist/{useButton-Bn4ZT295.js → useButton-v9ngEj50.js} +2 -2
- package/dist/{useDragAndDrop-DVLrIdEn.js → useDragAndDrop-C08ZXv4F.js} +5 -5
- package/dist/{useFilter-C4wo8Iii.js → useFilter-BlkUH1Ma.js} +1 -1
- package/dist/{useFocusRing-CUxgjvAY.js → useFocusRing-Cgm0R4Cf.js} +1 -1
- package/dist/{useFormValidation-CUtZcedF.js → useFormValidation-CeNsUGWK.js} +1 -1
- package/dist/{useHover-LmGemtHE.js → useHover-BRDW3y7-.js} +3 -1
- package/dist/{useListState-Xsk-aOvN.js → useListState-RdLrYsMP.js} +1 -1
- package/dist/{useNumberField-BCjjZWaz.js → useNumberField-D16dDfYF.js} +5 -5
- package/dist/{usePress-CBQIDzpQ.js → usePress-DJskZBH9.js} +4 -2
- package/dist/{useSingleSelectListState-DattSD7d.js → useSingleSelectListState-n0AVMr3Y.js} +2 -2
- package/dist/{useToggle-C8CedY6Z.js → useToggle-DSBDAfdw.js} +2 -2
- package/dist/{useToggleState-CiAradXs.js → useToggleState-CzN79ary.js} +1 -1
- package/dist/utilities/general.js +4142 -0
- package/dist/utilities/index.js +5 -0
- package/package.json +19 -15
- package/dist/context-DCAZLyDS.js +0 -7
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React__default, { forwardRef, createContext, useRef, useState, cloneElement } from "react";
|
|
3
3
|
import { _ as __ } from "../../default-i18n-CN_q3KUs.js";
|
|
4
|
-
import { a as $a049562f99e7db0e$export$f9c6924e160136d1, b as $3985021b0ad6602f$export$37fb8590cf2c088c, c as $a049562f99e7db0e$export$eb2fcfdbd7ba97d4, $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-
|
|
4
|
+
import { a as $a049562f99e7db0e$export$f9c6924e160136d1, b as $3985021b0ad6602f$export$37fb8590cf2c088c, c as $a049562f99e7db0e$export$eb2fcfdbd7ba97d4, $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-8yja_IHC.js";
|
|
5
5
|
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-DWVaNd2E.js";
|
|
6
|
-
import { a as $d2b4bc8c273e7be6$export$24d547caef80ccd1 } from "../../Button-
|
|
6
|
+
import { a as $d2b4bc8c273e7be6$export$24d547caef80ccd1 } from "../../Button-CQ5ZZJ2w.js";
|
|
7
7
|
import { a as $64fa3d84918910a7$export$29f1550f4b0d4415, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, f as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, g as $64fa3d84918910a7$export$ef03459518577ad4, h as $64fa3d84918910a7$export$4d86445c2cf5e3, i as $64fa3d84918910a7$export$2881499e37b75b9a } from "../../utils-cvK1vxO7.js";
|
|
8
8
|
import { $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "../../FieldError-B8BgFmIQ.js";
|
|
9
9
|
import { $ as $d3e0e05bdfcf66bd$export$c24727297075ec6a } from "../../Form-Cq3fu75_.js";
|
|
10
10
|
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-AxKZjtFm.js";
|
|
11
11
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-D2C6R0DK.js";
|
|
12
12
|
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-DMOmz986.js";
|
|
13
|
-
import { $ as $de67e98908f0c6ee$export$7f629e9dc1ecf37c, a as $81397a9303501bda$export$23f548e970bdf099 } from "../../useNumberField-
|
|
13
|
+
import { $ as $de67e98908f0c6ee$export$7f629e9dc1ecf37c, a as $81397a9303501bda$export$23f548e970bdf099 } from "../../useNumberField-D16dDfYF.js";
|
|
14
14
|
import { Button } from "../button/button.js";
|
|
15
15
|
import { icons } from "../../icons/icons.js";
|
|
16
16
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
@@ -108,7 +108,8 @@ const $b91743d66a0ed188$export$63c5fa0b2fdccd2e = /* @__PURE__ */ forwardRef(fun
|
|
|
108
108
|
type: "hidden",
|
|
109
109
|
name: props.name,
|
|
110
110
|
form: props.form,
|
|
111
|
-
value: isNaN(state.numberValue) ? "" : state.numberValue
|
|
111
|
+
value: isNaN(state.numberValue) ? "" : state.numberValue,
|
|
112
|
+
disabled: props.isDisabled || void 0
|
|
112
113
|
}));
|
|
113
114
|
});
|
|
114
115
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
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-B5aEynOM.js";
|
|
5
5
|
/**
|
|
6
6
|
* Component that provides a container panel for options, with an optional title.
|
|
7
7
|
* Best used within the Gutenberg sidebar, instead of the default `PanelBody` component.
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
3
|
+
import { icons } from "../../icons/icons.js";
|
|
4
|
+
import { cloneElement } from "react";
|
|
5
|
+
import "../../react-jsx-parser.min-VUl-CuCv.js";
|
|
6
|
+
import { truncateMiddle } from "../../utilities/text-helpers.js";
|
|
7
|
+
import { SmartImage } from "../smart-image/smart-image.js";
|
|
8
|
+
/**
|
|
9
|
+
* A shell for a file picker UI, handling both rich visual presentation (e.g. images) and simple file placeholders.
|
|
10
|
+
*
|
|
11
|
+
* @component
|
|
12
|
+
* @param {Object} props - Component props.
|
|
13
|
+
* @param {string} [props.url] - Current file URL.
|
|
14
|
+
* @param {ShellType} [props.type='file'] - File type icon override.
|
|
15
|
+
* @param {JSX.Element} [props.icon] - Icon to display within the button.
|
|
16
|
+
* @param {string} [props.className] - Classes to pass to the component.
|
|
17
|
+
* @param {JSX.Element|JSX.Element[]} [props.noUrlContent] - Content to display if no file is selected.
|
|
18
|
+
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
19
|
+
*
|
|
20
|
+
* @typedef {'image' | 'file'} ShellType
|
|
21
|
+
*
|
|
22
|
+
* @returns {JSX.Element} The FilePickerShell component.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* <FilePickerShell
|
|
26
|
+
* className='es:w-full'
|
|
27
|
+
* url='myfile.json'
|
|
28
|
+
* noUrlContent={<Button size='large'>Upload</Button>}
|
|
29
|
+
* >
|
|
30
|
+
* <Button flat>Replace</Button>
|
|
31
|
+
* <Button flat>Remove</Button>
|
|
32
|
+
* </FilePickerShell>
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* <FilePickerShell
|
|
36
|
+
* className='es:w-full'
|
|
37
|
+
* url='https://picsum.photos/300/200'
|
|
38
|
+
* noUrlContent={<Button size='large'>Upload</Button>}
|
|
39
|
+
* type='image'
|
|
40
|
+
* >
|
|
41
|
+
* <Button type='glass'>Replace</Button>
|
|
42
|
+
* <Button type='glass'>Remove</Button>
|
|
43
|
+
* </FilePickerShell>
|
|
44
|
+
*
|
|
45
|
+
* @preserve
|
|
46
|
+
*/
|
|
47
|
+
const FilePickerShell = (props) => {
|
|
48
|
+
const {
|
|
49
|
+
url,
|
|
50
|
+
type = "file",
|
|
51
|
+
icon = icons.file,
|
|
52
|
+
children,
|
|
53
|
+
className,
|
|
54
|
+
noUrlContent,
|
|
55
|
+
hidden
|
|
56
|
+
} = props;
|
|
57
|
+
if (hidden) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
if (!url) {
|
|
61
|
+
return noUrlContent && /* @__PURE__ */ jsx("div", { className: clsx("es:grid es:auto-cols-fr es:grid-flow-col es:gap-2 es:p-px es:w-full"), children: noUrlContent });
|
|
62
|
+
}
|
|
63
|
+
if (type !== "image") {
|
|
64
|
+
return /* @__PURE__ */ jsxs(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
className: clsx(
|
|
68
|
+
"es:border es:border-secondary-200 es:bg-white es:flex es:justify-between es:rounded-2xl es:isolate es:relative es:flex-col es:gap-2 es:overflow-clip es:aspect-3-2 es:group es:p-2",
|
|
69
|
+
className
|
|
70
|
+
),
|
|
71
|
+
children: [
|
|
72
|
+
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-secondary-50 es:inset-ring es:inset-ring-secondary-100 es:icon:text-secondary-500", children: [
|
|
73
|
+
icon,
|
|
74
|
+
/* @__PURE__ */ jsx("span", { className: "es:line-clamp-1", children: truncateMiddle(url, 34) })
|
|
75
|
+
] }),
|
|
76
|
+
children && /* @__PURE__ */ jsx("div", { className: "es:flex es:items-center-safe es:gap-2", children })
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
return /* @__PURE__ */ jsx(
|
|
82
|
+
SmartImage,
|
|
83
|
+
{
|
|
84
|
+
src: url,
|
|
85
|
+
alt: "",
|
|
86
|
+
className: ({ hasAnalysed, isTransparent, transparencyInfo }) => clsx(
|
|
87
|
+
hasAnalysed && transparencyInfo?.left && url && "es:pl-3",
|
|
88
|
+
hasAnalysed && transparencyInfo?.right && url && "es:pr-3",
|
|
89
|
+
hasAnalysed && transparencyInfo?.top && url && "es:pt-3",
|
|
90
|
+
hasAnalysed && transparencyInfo?.bottom && url && "es:pb-3",
|
|
91
|
+
hasAnalysed && isTransparent && "es:bg-white/60 es:object-contain es:mx-auto",
|
|
92
|
+
hasAnalysed && isTransparent && (transparencyInfo?.left || transparencyInfo?.right) && "es:w-full",
|
|
93
|
+
hasAnalysed && isTransparent && (transparencyInfo?.top || transparencyInfo?.bottom) && "es:h-full",
|
|
94
|
+
hasAnalysed && !isTransparent && "es:w-full es:aspect-3-2 es:object-cover",
|
|
95
|
+
hasAnalysed && "es:grow es:rounded-xl"
|
|
96
|
+
),
|
|
97
|
+
errorClassName: "es:aspect-3-2 es:rounded-2xl es:bg-gradient-to-br es:from-secondary-50 es:to-secondary-100 es:border es:border-secondary-200",
|
|
98
|
+
imageAnalysisSettings: { yFrom: 0.25, yTo: 0.75 },
|
|
99
|
+
children: ({ image, dominantColors, isDark, hasAnalysed, isTransparent }) => /* @__PURE__ */ jsxs(
|
|
100
|
+
"div",
|
|
101
|
+
{
|
|
102
|
+
className: clsx(
|
|
103
|
+
"es:border es:border-secondary-200 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",
|
|
104
|
+
hasAnalysed && !isTransparent && "es:group es:grid-rows-1",
|
|
105
|
+
hasAnalysed && isTransparent && "es:p-2 es:grid-rows-[minmax(0,_1fr)_auto] es:h-fit",
|
|
106
|
+
className
|
|
107
|
+
),
|
|
108
|
+
style: hasAnalysed && isTransparent ? { backgroundColor: `color-mix(in srgb, ${dominantColors[0]?.color || "#ffffff"} ${dominantColors[0]?.isDark ? 10 : 80}%, #ffffff)` } : {},
|
|
109
|
+
children: [
|
|
110
|
+
image,
|
|
111
|
+
!hasAnalysed && cloneElement(icons.loader, { className: "es:animate-spin es:size-8 es:text-accent-600 es:m-auto es:duration-3000" }),
|
|
112
|
+
hasAnalysed && children && /* @__PURE__ */ jsx(
|
|
113
|
+
"div",
|
|
114
|
+
{
|
|
115
|
+
className: clsx(
|
|
116
|
+
"es:flex es:items-center-safe es:gap-2",
|
|
117
|
+
!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"
|
|
118
|
+
),
|
|
119
|
+
children: typeof children === "function" ? children({ dominantColors, isDark, isTransparent }) : children
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
]
|
|
123
|
+
}
|
|
124
|
+
)
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
};
|
|
128
|
+
export {
|
|
129
|
+
FilePickerShell
|
|
130
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { e as $07b14b47974efb58$export$5b6b19405a83ff9d, f as $de32f1b87079253c$export$3ddf2d174ce01153, g as $de32f1b87079253c$export$2e1e1122cf0cba88 } from "../../Dialog-
|
|
2
|
+
import { e as $07b14b47974efb58$export$5b6b19405a83ff9d, f as $de32f1b87079253c$export$3ddf2d174ce01153, g as $de32f1b87079253c$export$2e1e1122cf0cba88 } from "../../Dialog-BMgMUQuN.js";
|
|
3
3
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
4
4
|
import { _ as __ } from "../../default-i18n-CN_q3KUs.js";
|
|
5
5
|
import { Button } from "../button/button.js";
|
|
@@ -3,17 +3,19 @@ import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$
|
|
|
3
3
|
import { b as $3ef42575df84b30b$export$9d1611c77c2fe928, d as $bdb11010cef70236$export$f680877a34711e37, a as $64fa3d84918910a7$export$29f1550f4b0d4415, l as $df56164dff5785e2$export$4338b53315abf666, m as $5dc95899b306f630$export$c9058316764c140e, g as $64fa3d84918910a7$export$ef03459518577ad4, h as $64fa3d84918910a7$export$4d86445c2cf5e3, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, f as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, i as $64fa3d84918910a7$export$2881499e37b75b9a } from "../../utils-cvK1vxO7.js";
|
|
4
4
|
import { a as $2baaea4c71418dea$export$294aa081a6c6f55d, $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "../../FieldError-B8BgFmIQ.js";
|
|
5
5
|
import { $ as $d3e0e05bdfcf66bd$export$c24727297075ec6a } from "../../Form-Cq3fu75_.js";
|
|
6
|
+
import { $ as $1d5b8b8664671ef2$export$c9549807523555e0 } from "../../SelectionIndicator-D7WMzeAW.js";
|
|
7
|
+
import { $ as $c8a5a149f625efcf$export$758399f318e6385a } from "../../SharedElementTransition-fML-zIv6.js";
|
|
6
8
|
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-AxKZjtFm.js";
|
|
7
9
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-D2C6R0DK.js";
|
|
8
10
|
import React__default, { useMemo, useState, forwardRef, createContext, cloneElement } from "react";
|
|
9
11
|
import { $ as $99facab73266f662$export$5add1d006293d136 } from "../../useFormReset-yV9VVy9R.js";
|
|
10
|
-
import { $ as $f6c31cce2adf654f$export$45712eceda6fad21 } from "../../usePress-
|
|
11
|
-
import { $ as $f645667febf57a63$export$4c014de7c8940b4c, x as $431fbd86ca7dc216$export$f21a1ffae260145a, a as $458b0a5536c1a7cf$export$40bfa8c7b0832715, w as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../useHover-
|
|
12
|
-
import { a as $e93e671b31057976$export$b8473d3665f3a75a, $ as $e5be200c675c3b3a$export$fc1a364ae1f3ff10 } from "../../useFormValidation-
|
|
13
|
-
import { a as $9bf71ea28793e738$export$2d6ec8fc375ceafa } from "../../FocusScope-
|
|
14
|
-
import { $ as $9ab94262bd0047c7$export$420e68273165f4ec, a as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-
|
|
12
|
+
import { $ as $f6c31cce2adf654f$export$45712eceda6fad21 } from "../../usePress-DJskZBH9.js";
|
|
13
|
+
import { $ as $f645667febf57a63$export$4c014de7c8940b4c, x as $431fbd86ca7dc216$export$f21a1ffae260145a, a as $458b0a5536c1a7cf$export$40bfa8c7b0832715, w as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../useHover-BRDW3y7-.js";
|
|
14
|
+
import { a as $e93e671b31057976$export$b8473d3665f3a75a, $ as $e5be200c675c3b3a$export$fc1a364ae1f3ff10 } from "../../useFormValidation-CeNsUGWK.js";
|
|
15
|
+
import { a as $9bf71ea28793e738$export$2d6ec8fc375ceafa } from "../../FocusScope-B5vxRkHm.js";
|
|
16
|
+
import { $ as $9ab94262bd0047c7$export$420e68273165f4ec, a as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-Cgm0R4Cf.js";
|
|
15
17
|
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-DMOmz986.js";
|
|
16
|
-
import { $ as $5c3e21d68f1c4674$export$439d29a4e110a164 } from "../../VisuallyHidden-
|
|
18
|
+
import { $ as $5c3e21d68f1c4674$export$439d29a4e110a164 } from "../../VisuallyHidden-CgnIuZJ2.js";
|
|
17
19
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
18
20
|
import { AnimatedVisibility } from "../animated-visibility/animated-visibility.js";
|
|
19
21
|
import { RichLabel } from "../rich-label/rich-label.js";
|
|
@@ -71,9 +73,12 @@ function $0d5c49892c1215da$export$37b0961d2f4751e2(props, state, ref) {
|
|
|
71
73
|
validationBehavior
|
|
72
74
|
}, state, ref);
|
|
73
75
|
return {
|
|
74
|
-
labelProps: $3ef42575df84b30b$export$9d1611c77c2fe928(labelProps, {
|
|
75
|
-
onClick: (e) => e.preventDefault()
|
|
76
|
-
|
|
76
|
+
labelProps: $3ef42575df84b30b$export$9d1611c77c2fe928(labelProps, useMemo(() => ({
|
|
77
|
+
onClick: (e) => e.preventDefault(),
|
|
78
|
+
// Prevent label from being focused when mouse down on it.
|
|
79
|
+
// Note, this does not prevent the input from being focused in the `click` event.
|
|
80
|
+
onMouseDown: (e) => e.preventDefault()
|
|
81
|
+
}), [])),
|
|
77
82
|
inputProps: $3ef42575df84b30b$export$9d1611c77c2fe928(domProps, {
|
|
78
83
|
...interactions,
|
|
79
84
|
type: "radio",
|
|
@@ -301,7 +306,7 @@ const $b6c3ddc6086f204d$export$a98f0dcb43a68a25 = /* @__PURE__ */ forwardRef(fun
|
|
|
301
306
|
validation
|
|
302
307
|
]
|
|
303
308
|
]
|
|
304
|
-
}, renderProps.children));
|
|
309
|
+
}, /* @__PURE__ */ React__default.createElement($c8a5a149f625efcf$export$758399f318e6385a, null, renderProps.children)));
|
|
305
310
|
});
|
|
306
311
|
const $b6c3ddc6086f204d$export$d7b12c4107be0d61 = /* @__PURE__ */ forwardRef(function Radio(props, ref) {
|
|
307
312
|
let { inputRef: userProvidedInputRef = null, ...otherProps } = props;
|
|
@@ -359,7 +364,11 @@ const $b6c3ddc6086f204d$export$d7b12c4107be0d61 = /* @__PURE__ */ forwardRef(fun
|
|
|
359
364
|
}, /* @__PURE__ */ React__default.createElement("input", {
|
|
360
365
|
...$3ef42575df84b30b$export$9d1611c77c2fe928(inputProps, focusProps),
|
|
361
366
|
ref: inputRef
|
|
362
|
-
})),
|
|
367
|
+
})), /* @__PURE__ */ React__default.createElement($1d5b8b8664671ef2$export$c9549807523555e0.Provider, {
|
|
368
|
+
value: {
|
|
369
|
+
isSelected
|
|
370
|
+
}
|
|
371
|
+
}, renderProps.children));
|
|
363
372
|
});
|
|
364
373
|
/**
|
|
365
374
|
* A simple radio button.
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { _ as __ } from "../../../default-i18n-CN_q3KUs.js";
|
|
3
3
|
import { BaseControl } from "../../base-control/base-control.js";
|
|
4
|
-
import { $ as $d2f53cda644affe3$export$2f2b9559550c7bbc, a as $440f4836bcb56932$export$b94867ecbd698f21 } from "../../../SearchField-
|
|
5
|
-
import { $ as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../../../Button-
|
|
6
|
-
import { g as $de32f1b87079253c$export$2e1e1122cf0cba88, e as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../../Dialog-
|
|
7
|
-
import { $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../../Input-
|
|
4
|
+
import { $ as $d2f53cda644affe3$export$2f2b9559550c7bbc, a as $440f4836bcb56932$export$b94867ecbd698f21 } from "../../../SearchField-DWGdCvnn.js";
|
|
5
|
+
import { $ as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../../../Button-CQ5ZZJ2w.js";
|
|
6
|
+
import { g as $de32f1b87079253c$export$2e1e1122cf0cba88, e as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../../Dialog-BMgMUQuN.js";
|
|
7
|
+
import { $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../../Input-8yja_IHC.js";
|
|
8
8
|
import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../../Label-DWVaNd2E.js";
|
|
9
|
-
import { $ as $eed445e0843c11d0$export$41f133550aa26f48, a as $eed445e0843c11d0$export$a11e76429ed99b4, b as $612b8eb6cb90e02d$export$62ed72bc21f6b8a6 } from "../../../ListBox-
|
|
9
|
+
import { $ as $eed445e0843c11d0$export$41f133550aa26f48, a as $eed445e0843c11d0$export$a11e76429ed99b4, b as $612b8eb6cb90e02d$export$62ed72bc21f6b8a6 } from "../../../ListBox-DggfiuO_.js";
|
|
10
10
|
import { $ as $514c0188e459b4c0$export$5f1af8db9871e1d6 } from "../../../Text-AxKZjtFm.js";
|
|
11
|
-
import { $ as $d8f176866e6dc039$export$2cfc5be7a55829f6 } from "../../../useDragAndDrop-
|
|
11
|
+
import { $ as $d8f176866e6dc039$export$2cfc5be7a55829f6 } from "../../../useDragAndDrop-C08ZXv4F.js";
|
|
12
12
|
import { useRef, useEffect, cloneElement } from "react";
|
|
13
13
|
import { icons } from "../../../icons/icons.js";
|
|
14
14
|
import "../../../react-jsx-parser.min-VUl-CuCv.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { _ as __ } from "../../../default-i18n-CN_q3KUs.js";
|
|
3
3
|
import { BaseControl } from "../../base-control/base-control.js";
|
|
4
|
-
import { $ as $d2f53cda644affe3$export$2f2b9559550c7bbc, a as $440f4836bcb56932$export$b94867ecbd698f21 } from "../../../SearchField-
|
|
5
|
-
import { $ as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../../../Button-
|
|
6
|
-
import { $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../../Input-
|
|
4
|
+
import { $ as $d2f53cda644affe3$export$2f2b9559550c7bbc, a as $440f4836bcb56932$export$b94867ecbd698f21 } from "../../../SearchField-DWGdCvnn.js";
|
|
5
|
+
import { $ as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../../../Button-CQ5ZZJ2w.js";
|
|
6
|
+
import { $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../../Input-8yja_IHC.js";
|
|
7
7
|
import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../../Label-DWVaNd2E.js";
|
|
8
|
-
import { $ as $eed445e0843c11d0$export$41f133550aa26f48 } from "../../../ListBox-
|
|
9
|
-
import { e as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../../Dialog-
|
|
10
|
-
import { $ as $82d7e5349645de74$export$ef9b1a59e592288f, a as $82d7e5349645de74$export$e288731fd71264f0, b as $82d7e5349645de74$export$ef445b55be0601bd } from "../../../Select-
|
|
8
|
+
import { $ as $eed445e0843c11d0$export$41f133550aa26f48 } from "../../../ListBox-DggfiuO_.js";
|
|
9
|
+
import { e as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../../Dialog-BMgMUQuN.js";
|
|
10
|
+
import { $ as $82d7e5349645de74$export$ef9b1a59e592288f, a as $82d7e5349645de74$export$e288731fd71264f0, b as $82d7e5349645de74$export$ef445b55be0601bd } from "../../../Select-BvggcFOX.js";
|
|
11
11
|
import { useRef, useEffect, cloneElement, useContext } from "react";
|
|
12
12
|
import { icons } from "../../../icons/icons.js";
|
|
13
13
|
import "../../../react-jsx-parser.min-VUl-CuCv.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { _ as __ } from "../../../default-i18n-CN_q3KUs.js";
|
|
3
3
|
import { BaseControl } from "../../base-control/base-control.js";
|
|
4
|
-
import { $ as $d2f53cda644affe3$export$2f2b9559550c7bbc, a as $440f4836bcb56932$export$b94867ecbd698f21 } from "../../../SearchField-
|
|
5
|
-
import { $ as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../../../Button-
|
|
6
|
-
import { g as $de32f1b87079253c$export$2e1e1122cf0cba88, e as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../../Dialog-
|
|
7
|
-
import { $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../../Input-
|
|
4
|
+
import { $ as $d2f53cda644affe3$export$2f2b9559550c7bbc, a as $440f4836bcb56932$export$b94867ecbd698f21 } from "../../../SearchField-DWGdCvnn.js";
|
|
5
|
+
import { $ as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../../../Button-CQ5ZZJ2w.js";
|
|
6
|
+
import { g as $de32f1b87079253c$export$2e1e1122cf0cba88, e as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../../Dialog-BMgMUQuN.js";
|
|
7
|
+
import { $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../../Input-8yja_IHC.js";
|
|
8
8
|
import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../../Label-DWVaNd2E.js";
|
|
9
|
-
import { $ as $eed445e0843c11d0$export$41f133550aa26f48, a as $eed445e0843c11d0$export$a11e76429ed99b4, b as $612b8eb6cb90e02d$export$62ed72bc21f6b8a6 } from "../../../ListBox-
|
|
9
|
+
import { $ as $eed445e0843c11d0$export$41f133550aa26f48, a as $eed445e0843c11d0$export$a11e76429ed99b4, b as $612b8eb6cb90e02d$export$62ed72bc21f6b8a6 } from "../../../ListBox-DggfiuO_.js";
|
|
10
10
|
import { $ as $514c0188e459b4c0$export$5f1af8db9871e1d6 } from "../../../Text-AxKZjtFm.js";
|
|
11
|
-
import { $ as $d8f176866e6dc039$export$2cfc5be7a55829f6 } from "../../../useDragAndDrop-
|
|
11
|
+
import { $ as $d8f176866e6dc039$export$2cfc5be7a55829f6 } from "../../../useDragAndDrop-C08ZXv4F.js";
|
|
12
12
|
import { useRef, cloneElement } from "react";
|
|
13
13
|
import { icons } from "../../../icons/icons.js";
|
|
14
14
|
import "../../../react-jsx-parser.min-VUl-CuCv.js";
|
|
@@ -17,7 +17,7 @@ import { RichLabel } from "../../rich-label/rich-label.js";
|
|
|
17
17
|
import { c as clsx } from "../../../utils-cvK1vxO7.js";
|
|
18
18
|
import { getValue, moveArrayItem } from "../shared.js";
|
|
19
19
|
import { truncateEnd } from "../../../utilities/text-helpers.js";
|
|
20
|
-
import { $ as $bb77f239b46e8c72$export$3274cf84b703fff } from "../../../useFilter-
|
|
20
|
+
import { $ as $bb77f239b46e8c72$export$3274cf84b703fff } from "../../../useFilter-BlkUH1Ma.js";
|
|
21
21
|
/**
|
|
22
22
|
* Multi-select menu.
|
|
23
23
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { a as $eed445e0843c11d0$export$a11e76429ed99b4 } from "../../../ListBox-
|
|
2
|
+
import { a as $eed445e0843c11d0$export$a11e76429ed99b4 } from "../../../ListBox-DggfiuO_.js";
|
|
3
3
|
import { c as clsx } from "../../../utils-cvK1vxO7.js";
|
|
4
4
|
import { icons } from "../../../icons/icons.js";
|
|
5
5
|
import "react";
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { _ as __ } from "../../../default-i18n-CN_q3KUs.js";
|
|
3
3
|
import { BaseControl } from "../../base-control/base-control.js";
|
|
4
|
-
import { $ as $d2f53cda644affe3$export$2f2b9559550c7bbc, a as $440f4836bcb56932$export$b94867ecbd698f21 } from "../../../SearchField-
|
|
5
|
-
import { $ as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../../../Button-
|
|
6
|
-
import { $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../../Input-
|
|
4
|
+
import { $ as $d2f53cda644affe3$export$2f2b9559550c7bbc, a as $440f4836bcb56932$export$b94867ecbd698f21 } from "../../../SearchField-DWGdCvnn.js";
|
|
5
|
+
import { $ as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../../../Button-CQ5ZZJ2w.js";
|
|
6
|
+
import { $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../../Input-8yja_IHC.js";
|
|
7
7
|
import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../../Label-DWVaNd2E.js";
|
|
8
|
-
import { $ as $eed445e0843c11d0$export$41f133550aa26f48 } from "../../../ListBox-
|
|
9
|
-
import { e as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../../Dialog-
|
|
10
|
-
import { $ as $82d7e5349645de74$export$ef9b1a59e592288f, a as $82d7e5349645de74$export$e288731fd71264f0, b as $82d7e5349645de74$export$ef445b55be0601bd } from "../../../Select-
|
|
8
|
+
import { $ as $eed445e0843c11d0$export$41f133550aa26f48 } from "../../../ListBox-DggfiuO_.js";
|
|
9
|
+
import { e as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../../Dialog-BMgMUQuN.js";
|
|
10
|
+
import { $ as $82d7e5349645de74$export$ef9b1a59e592288f, a as $82d7e5349645de74$export$e288731fd71264f0, b as $82d7e5349645de74$export$ef445b55be0601bd } from "../../../Select-BvggcFOX.js";
|
|
11
11
|
import { useRef, cloneElement, useContext } from "react";
|
|
12
12
|
import { icons } from "../../../icons/icons.js";
|
|
13
13
|
import "../../../react-jsx-parser.min-VUl-CuCv.js";
|
|
14
14
|
import { OptionItemBase } from "./shared.js";
|
|
15
15
|
import { RichLabel } from "../../rich-label/rich-label.js";
|
|
16
16
|
import { c as clsx } from "../../../utils-cvK1vxO7.js";
|
|
17
|
-
import { $ as $bb77f239b46e8c72$export$3274cf84b703fff } from "../../../useFilter-
|
|
17
|
+
import { $ as $bb77f239b46e8c72$export$3274cf84b703fff } from "../../../useFilter-BlkUH1Ma.js";
|
|
18
18
|
/**
|
|
19
19
|
* Select menu.
|
|
20
20
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { _ as __ } from "../../default-i18n-CN_q3KUs.js";
|
|
3
3
|
import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-DWVaNd2E.js";
|
|
4
|
-
import { $ as $6f909507e6374d18$export$472062a354075cee, a as $6f909507e6374d18$export$105594979f116971, b as $6f909507e6374d18$export$2c1b491743890dec, c as $6f909507e6374d18$export$a590f758a961cb5b } from "../../Slider-
|
|
4
|
+
import { $ as $6f909507e6374d18$export$472062a354075cee, a as $6f909507e6374d18$export$105594979f116971, b as $6f909507e6374d18$export$2c1b491743890dec, c as $6f909507e6374d18$export$a590f758a961cb5b } from "../../Slider-DfU6bRtH.js";
|
|
5
5
|
import { BaseControl } from "../base-control/base-control.js";
|
|
6
6
|
import { icons } from "../../icons/icons.js";
|
|
7
7
|
import { getColumnConfigOutputText } from "./utils.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { $ as $64fa3d84918910a7$export$fabf2dc03a41866e } from "../../utils-cvK1vxO7.js";
|
|
3
3
|
import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5, a as $01b77f81d0f07f68$export$75b6ee27786ba447 } from "../../Label-DWVaNd2E.js";
|
|
4
|
-
import { $ as $6f909507e6374d18$export$472062a354075cee, a as $6f909507e6374d18$export$105594979f116971, b as $6f909507e6374d18$export$2c1b491743890dec, c as $6f909507e6374d18$export$a590f758a961cb5b, d as $6f909507e6374d18$export$1e7083018727fa60 } from "../../Slider-
|
|
4
|
+
import { $ as $6f909507e6374d18$export$472062a354075cee, a as $6f909507e6374d18$export$105594979f116971, b as $6f909507e6374d18$export$2c1b491743890dec, c as $6f909507e6374d18$export$a590f758a961cb5b, d as $6f909507e6374d18$export$1e7083018727fa60 } from "../../Slider-DfU6bRtH.js";
|
|
5
5
|
import { BaseControl } from "../base-control/base-control.js";
|
|
6
6
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
7
7
|
import { NumberPicker } from "../number-picker/number-picker.js";
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { _ as __ } from "../../default-i18n-CN_q3KUs.js";
|
|
3
|
+
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
4
|
+
import { useState, cloneElement } from "react";
|
|
5
|
+
import { analyzeImage } from "../../utilities/general.js";
|
|
6
|
+
import { icons } from "../../icons/icons.js";
|
|
7
|
+
import "../../react-jsx-parser.min-VUl-CuCv.js";
|
|
8
|
+
import { DecorativeTooltip } from "../tooltip/tooltip.js";
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {Object} CustomImageProps
|
|
11
|
+
* @property {JSX.Element} [props.renderError] - Component to render if image analysis fails. `(error) => JSX:Element`.
|
|
12
|
+
* @property {string} [props.errorClassName] - Classes to pass to the default error view.
|
|
13
|
+
* @property {string} [props.processingClassName] - Classes to apply while the image is loading / being processed.
|
|
14
|
+
* @property {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
15
|
+
* @property {import('../../utilities/general').ImageAnalysisSettings} [imageAnalysisSettings] - Settings to pass to the image analysis function.
|
|
16
|
+
*
|
|
17
|
+
* @preserve
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* @typedef {Omit<JSX.IntrinsicElements['img'], 'crossOrigin'>} BaseImageProps
|
|
21
|
+
*
|
|
22
|
+
* @preserve
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* @typedef {CustomImageProps & BaseImageProps} ImageProps
|
|
26
|
+
*
|
|
27
|
+
* @preserve
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* Image that analyzes its contents and can apply different classes based on image transparency.
|
|
31
|
+
* It also provides a CSS variable with the image's dominant color, and optionally custom child rendering with all the data exposed.
|
|
32
|
+
*
|
|
33
|
+
* @component
|
|
34
|
+
* @param {ImageProps} props - Component props.
|
|
35
|
+
*
|
|
36
|
+
* @returns {JSX.Element} The SmartImage component.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* <SmartImage src='https://picsum.photos/600/400' />
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* <SmartImage src='https://picsum.photos/600/400'>
|
|
43
|
+
* {({ image, dominantColors, isDark }) => (
|
|
44
|
+
* <div style={{ backgroundColor: dominantColors[0].color }}>
|
|
45
|
+
* {image}
|
|
46
|
+
* <p style={{ color: isDark ? '#000000' : '#FFFFFF' }}>Lorem ipsum</p>
|
|
47
|
+
* </div>
|
|
48
|
+
* )}
|
|
49
|
+
* </SmartImage>
|
|
50
|
+
*
|
|
51
|
+
* @preserve
|
|
52
|
+
*/
|
|
53
|
+
const SmartImage = (props) => {
|
|
54
|
+
const { imageAnalysisSettings, errorClassName, processingClassName = "es:opacity-0 es:fixed", hidden, renderError, children, ...imageProps } = props;
|
|
55
|
+
const [isLoaded, setIsLoaded] = useState(false);
|
|
56
|
+
const [hasAnalysed, setHasAnalysed] = useState(false);
|
|
57
|
+
const [isTransparent, setIsTransparent] = useState(null);
|
|
58
|
+
const [transparencyInfo, setTransparencyInfo] = useState(null);
|
|
59
|
+
const [dominantColors, setDominantColors] = useState([]);
|
|
60
|
+
const [isDark, setIsDark] = useState(false);
|
|
61
|
+
const [error, setError] = useState(null);
|
|
62
|
+
if (hidden) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
const classFetchProps = { isLoaded, hasAnalysed, isTransparent, dominantColors, isDark, transparencyInfo };
|
|
66
|
+
const imageElement = /* @__PURE__ */ jsx(
|
|
67
|
+
"img",
|
|
68
|
+
{
|
|
69
|
+
decoding: "async",
|
|
70
|
+
...imageProps,
|
|
71
|
+
crossOrigin: "anonymous",
|
|
72
|
+
style: {
|
|
73
|
+
...imageProps.style || {},
|
|
74
|
+
"--es-img-dominant-color": dominantColors?.[0]?.color ?? ""
|
|
75
|
+
},
|
|
76
|
+
className: clsx(
|
|
77
|
+
"es:transition-opacity",
|
|
78
|
+
!hasAnalysed && processingClassName,
|
|
79
|
+
typeof imageProps.className === "function" ? imageProps.className(classFetchProps) : imageProps.className
|
|
80
|
+
),
|
|
81
|
+
onLoad: async (e) => {
|
|
82
|
+
setIsLoaded(true);
|
|
83
|
+
if (props.onLoad) {
|
|
84
|
+
props.onLoad(e);
|
|
85
|
+
}
|
|
86
|
+
if (!imageProps.src) {
|
|
87
|
+
setHasAnalysed(true);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const result = analyzeImage(e.target, imageAnalysisSettings);
|
|
91
|
+
if (result) {
|
|
92
|
+
const { isDark: dark, dominantColors: colors, isTransparent: transparent, transparencyInfo: transparencyInfo2 } = result;
|
|
93
|
+
setIsDark(dark);
|
|
94
|
+
setDominantColors(colors);
|
|
95
|
+
setIsTransparent(transparent);
|
|
96
|
+
setTransparencyInfo(transparencyInfo2);
|
|
97
|
+
}
|
|
98
|
+
setHasAnalysed(true);
|
|
99
|
+
},
|
|
100
|
+
onError: () => setError(new Error("Image failed to load")),
|
|
101
|
+
"data-is-transparent": isTransparent,
|
|
102
|
+
"data-is-dark": isDark
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
if (error && renderError) {
|
|
106
|
+
return renderError(error);
|
|
107
|
+
} else if (error) {
|
|
108
|
+
return /* @__PURE__ */ jsx("div", { className: clsx("es:flex es:flex-col es:gap-2 es:items-center-safe es:justify-center-safe es:p-2 es:motion-preset-fade", errorClassName), children: /* @__PURE__ */ jsx(DecorativeTooltip, { text: __("Error loading image", "eightshift-ui-components"), children: cloneElement(icons.imageError, { className: "es:text-secondary-500 es:size-8" }) }) });
|
|
109
|
+
}
|
|
110
|
+
if (!children) {
|
|
111
|
+
return imageElement;
|
|
112
|
+
}
|
|
113
|
+
return typeof children === "function" ? children({ image: imageElement, dominantColors, isDark, hasAnalysed, isTransparent, transparencyInfo }) : imageElement;
|
|
114
|
+
};
|
|
115
|
+
export {
|
|
116
|
+
SmartImage
|
|
117
|
+
};
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { e as $880e95eb8b93ba9a$export$ecf600387e221c37, m as $ae20dd8cbca75726$export$d6daf82dcd84e87c, f as $e1995378a142960e$export$18af5c7a9e9b3664, h as $e1995378a142960e$export$fb8073518f34e6ec, j as $7135fc7d473fd974$export$4feb769f8ddf26c5, n as $7135fc7d473fd974$export$a164736487e3f0ae, g as $e1995378a142960e$export$bf788dd355e3a401, o as $23b9f4fcf0fe224b$export$d68d59712b04d9d1, p as $7135fc7d473fd974$export$90e00781bc59d8f9 } from "../../SelectionManager-B6-b5NM2.js";
|
|
3
3
|
import { k as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, b as $3ef42575df84b30b$export$9d1611c77c2fe928, d as $bdb11010cef70236$export$f680877a34711e37, l as $df56164dff5785e2$export$4338b53315abf666, h as $64fa3d84918910a7$export$4d86445c2cf5e3, i as $64fa3d84918910a7$export$2881499e37b75b9a, a as $64fa3d84918910a7$export$29f1550f4b0d4415, $ as $64fa3d84918910a7$export$fabf2dc03a41866e } from "../../utils-cvK1vxO7.js";
|
|
4
|
+
import { $ as $1d5b8b8664671ef2$export$c9549807523555e0 } from "../../SelectionIndicator-D7WMzeAW.js";
|
|
5
|
+
import { $ as $c8a5a149f625efcf$export$758399f318e6385a } from "../../SharedElementTransition-fML-zIv6.js";
|
|
4
6
|
import { $ as $f39a9eba43920ace$export$86427a43e3e48ebb } from "../../Hidden-rE6uR-lr.js";
|
|
5
7
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-D2C6R0DK.js";
|
|
6
|
-
import { b as $cdc5a6778b766db2$export$a9d04c5684123369 } from "../../useListState-
|
|
8
|
+
import { b as $cdc5a6778b766db2$export$a9d04c5684123369 } from "../../useListState-RdLrYsMP.js";
|
|
7
9
|
import React__default, { useState, useMemo, useRef, useEffect, forwardRef, useContext, createContext, isValidElement, useId, cloneElement } from "react";
|
|
8
|
-
import { a as $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 } from "../../usePress-
|
|
9
|
-
import { $ as $f645667febf57a63$export$4c014de7c8940b4c, w as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../useHover-
|
|
10
|
+
import { a as $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 } from "../../usePress-DJskZBH9.js";
|
|
11
|
+
import { $ as $f645667febf57a63$export$4c014de7c8940b4c, w as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../useHover-BRDW3y7-.js";
|
|
10
12
|
import { $ as $313b98861ee5dd6c$export$d6875122194c7b44 } from "../../useLabels-Cdxi6JSa.js";
|
|
11
|
-
import { a as $9bf71ea28793e738$export$2d6ec8fc375ceafa } from "../../FocusScope-
|
|
13
|
+
import { a as $9bf71ea28793e738$export$2d6ec8fc375ceafa } from "../../FocusScope-B5vxRkHm.js";
|
|
12
14
|
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-DMOmz986.js";
|
|
13
|
-
import { a as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-
|
|
14
|
-
import { $ as $a0d645289fe9b86b$export$e7f05e985daf4b5f } from "../../useSingleSelectListState-
|
|
15
|
+
import { a as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-Cgm0R4Cf.js";
|
|
16
|
+
import { $ as $a0d645289fe9b86b$export$e7f05e985daf4b5f } from "../../useSingleSelectListState-n0AVMr3Y.js";
|
|
15
17
|
import { s as sprintf } from "../../sprintf-DmNrJSYG.js";
|
|
16
18
|
import { _ as __ } from "../../default-i18n-CN_q3KUs.js";
|
|
17
19
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
@@ -345,10 +347,10 @@ function $5e8ad37a45e1c704$var$TabListInner({ props, forwardedRef: ref }) {
|
|
|
345
347
|
...$3ef42575df84b30b$export$9d1611c77c2fe928(DOMProps, renderProps, tabListProps),
|
|
346
348
|
ref: objectRef,
|
|
347
349
|
"data-orientation": orientation || void 0
|
|
348
|
-
}, /* @__PURE__ */ React__default.createElement(CollectionRoot, {
|
|
350
|
+
}, /* @__PURE__ */ React__default.createElement($c8a5a149f625efcf$export$758399f318e6385a, null, /* @__PURE__ */ React__default.createElement(CollectionRoot, {
|
|
349
351
|
collection: state.collection,
|
|
350
352
|
persistedKeys: $7135fc7d473fd974$export$90e00781bc59d8f9(state.selectionManager.focusedKey)
|
|
351
|
-
}));
|
|
353
|
+
})));
|
|
352
354
|
}
|
|
353
355
|
class $5e8ad37a45e1c704$var$TabItemNode extends $23b9f4fcf0fe224b$export$d68d59712b04d9d1 {
|
|
354
356
|
}
|
|
@@ -396,7 +398,11 @@ const $5e8ad37a45e1c704$export$3e41faf802a29e71 = /* @__PURE__ */ $e1995378a1429
|
|
|
396
398
|
"data-focus-visible": isFocusVisible || void 0,
|
|
397
399
|
"data-pressed": isPressed || void 0,
|
|
398
400
|
"data-hovered": isHovered || void 0
|
|
399
|
-
},
|
|
401
|
+
}, /* @__PURE__ */ React__default.createElement($1d5b8b8664671ef2$export$c9549807523555e0.Provider, {
|
|
402
|
+
value: {
|
|
403
|
+
isSelected
|
|
404
|
+
}
|
|
405
|
+
}, renderProps.children));
|
|
400
406
|
});
|
|
401
407
|
const $5e8ad37a45e1c704$export$3d96ec278d3efce4 = /* @__PURE__ */ $f39a9eba43920ace$export$86427a43e3e48ebb(function TabPanel(props, forwardedRef) {
|
|
402
408
|
const state = useContext($5e8ad37a45e1c704$export$364712098d2aa57c);
|
|
@@ -2,11 +2,11 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { a as $64fa3d84918910a7$export$29f1550f4b0d4415, l as $df56164dff5785e2$export$4338b53315abf666, m as $5dc95899b306f630$export$c9058316764c140e, g as $64fa3d84918910a7$export$ef03459518577ad4, h as $64fa3d84918910a7$export$4d86445c2cf5e3, b as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "../../utils-cvK1vxO7.js";
|
|
3
3
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-D2C6R0DK.js";
|
|
4
4
|
import React__default, { forwardRef, createContext } from "react";
|
|
5
|
-
import { $ as $3017fa7ffdddec74$export$8042c6c013fd5226 } from "../../useToggleState-
|
|
6
|
-
import { $ as $d2c8e2b0480f3f34$export$cbe85ee05b554577 } from "../../useToggle-
|
|
7
|
-
import { a as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-
|
|
8
|
-
import { w as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../useHover-
|
|
9
|
-
import { $ as $5c3e21d68f1c4674$export$439d29a4e110a164 } from "../../VisuallyHidden-
|
|
5
|
+
import { $ as $3017fa7ffdddec74$export$8042c6c013fd5226 } from "../../useToggleState-CzN79ary.js";
|
|
6
|
+
import { $ as $d2c8e2b0480f3f34$export$cbe85ee05b554577 } from "../../useToggle-DSBDAfdw.js";
|
|
7
|
+
import { a as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-Cgm0R4Cf.js";
|
|
8
|
+
import { w as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../useHover-BRDW3y7-.js";
|
|
9
|
+
import { $ as $5c3e21d68f1c4674$export$439d29a4e110a164 } from "../../VisuallyHidden-CgnIuZJ2.js";
|
|
10
10
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
11
11
|
function $b418ec0c85c52f27$export$d853f7095ae95f88(props, state, ref) {
|
|
12
12
|
let { labelProps, inputProps, isSelected, isPressed, isDisabled, isReadOnly } = $d2c8e2b0480f3f34$export$cbe85ee05b554577(props, state, ref);
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { p as $ff5963eb1fccf552$export$e08e3b67e392101e, b as $3ef42575df84b30b$export$9d1611c77c2fe928, a as $64fa3d84918910a7$export$29f1550f4b0d4415, h as $64fa3d84918910a7$export$4d86445c2cf5e3 } from "../../utils-cvK1vxO7.js";
|
|
3
|
+
import { $ as $1d5b8b8664671ef2$export$c9549807523555e0 } from "../../SelectionIndicator-D7WMzeAW.js";
|
|
3
4
|
import React__default, { createContext, forwardRef, useContext } from "react";
|
|
4
5
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-D2C6R0DK.js";
|
|
5
|
-
import { $ as $3017fa7ffdddec74$export$8042c6c013fd5226 } from "../../useToggleState-
|
|
6
|
-
import { $ as $701a24aa0da5b062$export$ea18c227d4417cc3 } from "../../useButton-
|
|
7
|
-
import { a as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-
|
|
8
|
-
import { w as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../useHover-
|
|
6
|
+
import { $ as $3017fa7ffdddec74$export$8042c6c013fd5226 } from "../../useToggleState-CzN79ary.js";
|
|
7
|
+
import { $ as $701a24aa0da5b062$export$ea18c227d4417cc3 } from "../../useButton-v9ngEj50.js";
|
|
8
|
+
import { a as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-Cgm0R4Cf.js";
|
|
9
|
+
import { w as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../useHover-BRDW3y7-.js";
|
|
9
10
|
import { c as cva } from "../../index-Dq3gT5pW.js";
|
|
10
11
|
import { Tooltip } from "../tooltip/tooltip.js";
|
|
11
12
|
function $55f54f7887471b58$export$51e84d46ca0bc451(props, state, ref) {
|
|
@@ -100,7 +101,11 @@ const $efde0372d7a700fe$export$d2b052e7b4be1756 = /* @__PURE__ */ forwardRef(fun
|
|
|
100
101
|
"data-selected": isSelected || void 0,
|
|
101
102
|
"data-hovered": isHovered || void 0,
|
|
102
103
|
"data-focus-visible": isFocusVisible || void 0
|
|
103
|
-
}
|
|
104
|
+
}, /* @__PURE__ */ React__default.createElement($1d5b8b8664671ef2$export$c9549807523555e0.Provider, {
|
|
105
|
+
value: {
|
|
106
|
+
isSelected
|
|
107
|
+
}
|
|
108
|
+
}, renderProps.children));
|
|
104
109
|
});
|
|
105
110
|
/**
|
|
106
111
|
* @typedef {import('../tooltip/tooltip').TooltipProps} TooltipProps
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { $ as $fc909762b330b746$export$61c6a8c84e605fb6, a as $d3f049242431219c$export$45fda7c47f93fd48, c as $2a41e45df1593e64$export$d39e1813b3bdd0e1, b as $d3f049242431219c$export$6d3443f2c48bfc20, d as $44f671af83e7d9e0$export$2de4954e8ae13b9f, e as $44f671af83e7d9e0$export$746d02f47f4d381 } from "../../OverlayArrow-
|
|
2
|
+
import { $ as $fc909762b330b746$export$61c6a8c84e605fb6, a as $d3f049242431219c$export$45fda7c47f93fd48, c as $2a41e45df1593e64$export$d39e1813b3bdd0e1, b as $d3f049242431219c$export$6d3443f2c48bfc20, d as $44f671af83e7d9e0$export$2de4954e8ae13b9f, e as $44f671af83e7d9e0$export$746d02f47f4d381 } from "../../OverlayArrow-DraDOoRn.js";
|
|
3
3
|
import { n as $b5e257d569688ac6$export$535bd6ca7f90a273, b as $3ef42575df84b30b$export$9d1611c77c2fe928, d as $bdb11010cef70236$export$f680877a34711e37, i as $64fa3d84918910a7$export$2881499e37b75b9a, a as $64fa3d84918910a7$export$29f1550f4b0d4415, h as $64fa3d84918910a7$export$4d86445c2cf5e3 } from "../../utils-cvK1vxO7.js";
|
|
4
4
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-D2C6R0DK.js";
|
|
5
|
-
import { w as $6179b936705e76d3$export$ae780daf29e6d456, $ as $f645667febf57a63$export$4c014de7c8940b4c, u as $507fabe10e71c6fb$export$630ff653c5ada6a9, l as $507fabe10e71c6fb$export$b9b3dfddab17db27, y as $f645667febf57a63$export$13f3202a3e5ddd5 } from "../../useHover-
|
|
5
|
+
import { w as $6179b936705e76d3$export$ae780daf29e6d456, $ as $f645667febf57a63$export$4c014de7c8940b4c, u as $507fabe10e71c6fb$export$630ff653c5ada6a9, l as $507fabe10e71c6fb$export$b9b3dfddab17db27, y as $f645667febf57a63$export$13f3202a3e5ddd5 } from "../../useHover-BRDW3y7-.js";
|
|
6
6
|
import React__default, { useContext, useState, useMemo, useRef, useEffect, forwardRef, createContext } from "react";
|
|
7
7
|
import { a as $96b38030c423d352$export$9fc1347d4195ccb3 } from "../../PortalProvider---wyKpMr.js";
|
|
8
8
|
import { $ as $dbSRa$reactdom } from "../../index-D8-Zjpbd.js";
|