@eightshift/ui-components 6.1.0 → 6.2.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-BTCA69Lt.js → Button-CFnNdpNZ.js} +3 -3
- package/dist/{Dialog-BbNWvB5_.js → Dialog-DDfABlp4.js} +38 -29
- package/dist/{FocusScope-BxT4xfe9.js → FocusScope-BJhC1-1e.js} +1 -1
- package/dist/{Input-Wrnm2nxy.js → Input-B4X6-x6r.js} +4 -4
- package/dist/{List-CWheI3JH.js → List-CQFXnN4w.js} +1 -1
- package/dist/{ListBox-yHUyUAAH.js → ListBox-ByPsaVVK.js} +15 -13
- package/dist/{OverlayArrow-NzRV9wsn.js → OverlayArrow-Dy0qw7WL.js} +1 -1
- package/dist/{PortalProvider-CHPnqDSH.js → PortalProvider-BQ1X8vGX.js} +1 -1
- package/dist/{RadioGroup-BFDueqHz.js → RadioGroup-CjCAbUr4.js} +8 -8
- package/dist/{SearchField-CmRhtrQf.js → SearchField-BME59dt-.js} +5 -5
- package/dist/{SelectionManager-VgpR-1Ri.js → SelectionManager-iru59gc4.js} +36 -35
- package/dist/{SharedElementTransition-B_vnQ1uR.js → SharedElementTransition-CtoWSaF0.js} +1 -1
- package/dist/{Slider-Bl5G0ZHE.js → Slider-BIbaMdUE.js} +6 -6
- package/dist/{VisuallyHidden-DXVaR_RC.js → VisuallyHidden-CqnizvzQ.js} +1 -1
- package/dist/{animation-B2sADg3I.js → animation-Dfl8uEb3.js} +1 -1
- package/dist/assets/style-admin.css +9 -0
- package/dist/assets/style-editor.css +9 -0
- package/dist/assets/style.css +9 -0
- package/dist/{color-swatch-DtaLObbd.js → color-swatch-bUFkK7ox.js} +2 -2
- package/dist/components/button/button.js +3 -3
- package/dist/components/checkbox/checkbox.js +7 -7
- package/dist/components/color-pickers/color-picker.js +1 -1
- package/dist/components/color-pickers/color-swatch.js +1 -1
- package/dist/components/color-pickers/gradient-editor.js +2 -2
- package/dist/components/color-pickers/solid-color-picker.js +11 -11
- package/dist/components/draggable/draggable-handle.js +1 -1
- package/dist/components/draggable/draggable.js +841 -633
- package/dist/components/draggable-list/draggable-list-item.js +1 -1
- package/dist/components/draggable-list/draggable-list.js +1 -1
- package/dist/components/expandable/expandable.js +6 -6
- package/dist/components/index.js +1 -1
- package/dist/components/input-field/input-field.js +3 -3
- package/dist/components/link-input/link-input.js +13 -13
- package/dist/components/matrix-align/matrix-align.js +1 -1
- package/dist/components/menu/menu.js +1 -1
- package/dist/components/modal/modal.js +6 -6
- package/dist/components/number-picker/number-picker.js +4 -4
- package/dist/components/placeholders/file-picker-shell.js +1 -1
- package/dist/components/popover/popover.js +1 -1
- package/dist/components/portal-provider/portal-provider.js +1 -1
- package/dist/components/radio/radio.js +1 -1
- package/dist/components/repeater/repeater.js +1 -1
- package/dist/components/rich-label/rich-label.js +6 -2
- package/dist/components/select/async-multi-select.js +126 -67
- package/dist/components/select/async-select.js +82 -42
- package/dist/components/select/multi-select.js +153 -113
- package/dist/components/select/shared.js +6 -5
- package/dist/components/select/single-select.js +154 -112
- package/dist/components/slider/column-config-slider.js +2 -2
- package/dist/components/slider/slider.js +2 -2
- package/dist/components/smart-image/smart-image-next.js +1 -1
- package/dist/components/smart-image/smart-image.js +2 -2
- package/dist/components/smart-image/worker-inline.js +1 -1
- package/dist/components/tabs/tabs.js +9 -9
- package/dist/components/toggle/switch.js +5 -5
- package/dist/components/toggle-button/toggle-button.js +4 -4
- package/dist/components/tooltip/tooltip.js +6 -6
- package/dist/{general-C8Q0dvEx.js → general-BfKmjm56.js} +3 -4
- package/dist/icons/jsx-svg.js +1 -1
- package/dist/{index-sSixe2j_.js → index-BL5gdWX4.js} +52 -52
- package/dist/index.js +1 -1
- package/dist/{proxy-CgLBbUpw.js → proxy-DFlYXk07.js} +130 -47
- package/dist/{react-jsx-parser.min-B_hvYYa1.js → react-jsx-parser.min-DAh4myol.js} +35 -35
- package/dist/{shared-DSTKnPjF.js → shared-HdRrpnhs.js} +48 -14
- package/dist/{textSelection-D_BSbtab.js → textSelection-CeoEP4rL.js} +1 -1
- package/dist/{useButton-DofKjCES.js → useButton-5YL_nmpZ.js} +2 -2
- package/dist/{useEvent-ADVZr4I3.js → useEvent-Zze2g7CX.js} +1 -1
- package/dist/{useFilter-Cqw0-KoB.js → useFilter-NhAlifsK.js} +1 -1
- package/dist/{useFocusRing-Ct2N5S1b.js → useFocusRing-rUOwLdTK.js} +1 -1
- package/dist/{useFormReset-KT27O1en.js → useFormReset-BxtOoO5Q.js} +1 -1
- package/dist/{useFormValidation-DwbcW-pN.js → useFormValidation-DTmPrTD8.js} +2 -2
- package/dist/{useHover-VPZwb-1l.js → useHover-CmyvqeWX.js} +4 -4
- package/dist/{useListState-jHobZH6F.js → useListState-HOvCQJFf.js} +1 -1
- package/dist/{useNumberField-CrLevIP3.js → useNumberField-CTkI-U9a.js} +7 -7
- package/dist/{usePress-BPCda-AF.js → usePress-CNefMs8d.js} +3 -3
- package/dist/{useSingleSelectListState-sLg_MnX8.js → useSingleSelectListState-BtrMHGeE.js} +2 -2
- package/dist/{useToggle-D0-c9HPm.js → useToggle-CFFOmZWi.js} +3 -3
- package/dist/{useToggleState-BhJn-Dz7.js → useToggleState-BWrKKisg.js} +1 -1
- package/dist/utilities/general.js +1 -1
- package/dist/utilities/index.js +1 -1
- package/dist/workers/image-analysis.worker.js +1 -1
- package/package.json +12 -12
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { _ as __ } from "../../default-i18n-CnQeC5Pl.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 $
|
|
4
|
+
import { $ as $d2f53cda644affe3$export$2f2b9559550c7bbc, a as $440f4836bcb56932$export$b94867ecbd698f21 } from "../../SearchField-BME59dt-.js";
|
|
5
|
+
import { $ as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../../Button-CFnNdpNZ.js";
|
|
6
|
+
import { f as $07b14b47974efb58$export$5b6b19405a83ff9d, i as $72a5793c14baf454$export$8b251419efc915eb } from "../../Dialog-DDfABlp4.js";
|
|
7
|
+
import { $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-B4X6-x6r.js";
|
|
7
8
|
import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-BDlf9vIY.js";
|
|
8
|
-
import { $ as $eed445e0843c11d0$export$41f133550aa26f48 } from "../../ListBox-
|
|
9
|
-
import {
|
|
10
|
-
import { $ as $
|
|
11
|
-
import { useRef, cloneElement } from "react";
|
|
9
|
+
import { $ as $eed445e0843c11d0$export$41f133550aa26f48, a as $eed445e0843c11d0$export$dca12b0bb56e4fc } from "../../ListBox-ByPsaVVK.js";
|
|
10
|
+
import { g as getGroupedOptions, $ as $82d7e5349645de74$export$ef9b1a59e592288f, a as $82d7e5349645de74$export$e288731fd71264f0, S as SelectClearButton, O as OptionItemBase } from "../../shared-HdRrpnhs.js";
|
|
11
|
+
import { $ as $e1995378a142960e$export$fb8073518f34e6ec } from "../../SelectionManager-iru59gc4.js";
|
|
12
|
+
import { useRef, useState, useMemo, cloneElement } from "react";
|
|
12
13
|
import { icons } from "../../icons/icons.js";
|
|
13
|
-
import "../../react-jsx-parser.min-
|
|
14
|
+
import "../../react-jsx-parser.min-DAh4myol.js";
|
|
14
15
|
import { c as clsx } from "../../clsx-DgYk2OaC.js";
|
|
15
16
|
import { RichLabel } from "../rich-label/rich-label.js";
|
|
16
17
|
import { c as cva } from "../../index-BHpUy2Ix.js";
|
|
17
18
|
import { randomId } from "../../utilities/hash.js";
|
|
18
|
-
import { $ as $bb77f239b46e8c72$export$3274cf84b703fff } from "../../useFilter-
|
|
19
|
+
import { $ as $bb77f239b46e8c72$export$3274cf84b703fff } from "../../useFilter-NhAlifsK.js";
|
|
19
20
|
/**
|
|
20
21
|
* Select menu.
|
|
21
22
|
*
|
|
@@ -31,6 +32,8 @@ import { $ as $bb77f239b46e8c72$export$3274cf84b703fff } from "../../useFilter-C
|
|
|
31
32
|
* @param {string|{label: string, value: string, metadata: Object<string, any>?}} props.value - Current value of the select.
|
|
32
33
|
* @param {Function} props.onChange - Function to call when the value changes.
|
|
33
34
|
* @param {boolean} [props.simpleValue=false] - If `true`, instead of using a `{label: '', value: ''}` value type, a string is used (just the value).
|
|
35
|
+
* @param {string} [props.groupKey] - If provided, the options will be grouped by this key.
|
|
36
|
+
* @param {Object} [props.groupValueMapping] - If provided, the group headers will be mapped to these labels/icons.
|
|
34
37
|
* @param {boolean} [props.clearable] - Whether the select is clearable.
|
|
35
38
|
* @param {boolean} [props.disabled] - Whether the select is disabled.
|
|
36
39
|
* @param {string} [props.placeholder] - Placeholder text to show when no value is selected.
|
|
@@ -78,6 +81,8 @@ const Select = (props) => {
|
|
|
78
81
|
onChange,
|
|
79
82
|
options,
|
|
80
83
|
simpleValue = false,
|
|
84
|
+
groupKey,
|
|
85
|
+
groupValueMapping,
|
|
81
86
|
disabled = false,
|
|
82
87
|
clearable = false,
|
|
83
88
|
placeholder = __("Select...", "eightshift-ui-components"),
|
|
@@ -93,8 +98,44 @@ const Select = (props) => {
|
|
|
93
98
|
...rest
|
|
94
99
|
} = props;
|
|
95
100
|
const ref = useRef();
|
|
96
|
-
const
|
|
101
|
+
const [searchTerm, setSearchTerm] = useState("");
|
|
97
102
|
const { contains } = $bb77f239b46e8c72$export$3274cf84b703fff({ sensitivity: "base" });
|
|
103
|
+
const filteredOptions = useMemo(() => {
|
|
104
|
+
if (!searchable || searchTerm.length === 0) {
|
|
105
|
+
return options;
|
|
106
|
+
}
|
|
107
|
+
return options?.filter((item) => {
|
|
108
|
+
return contains(item.label ?? "", searchTerm) || contains(item?.subtitle ?? "", searchTerm);
|
|
109
|
+
});
|
|
110
|
+
}, [options, searchable, searchTerm, contains]);
|
|
111
|
+
const groupedOptions = useMemo(() => getGroupedOptions(filteredOptions, groupKey, groupValueMapping), [filteredOptions, groupKey, groupValueMapping]);
|
|
112
|
+
const currentValue = simpleValue ? value ?? null : value?.value ?? null;
|
|
113
|
+
const renderItem = (item) => {
|
|
114
|
+
let icon2 = item?.icon ?? null;
|
|
115
|
+
if (typeof item?.icon === "string") {
|
|
116
|
+
icon2 = icons?.[item.icon] ?? null;
|
|
117
|
+
}
|
|
118
|
+
return /* @__PURE__ */ jsxs(
|
|
119
|
+
OptionItemBase,
|
|
120
|
+
{
|
|
121
|
+
id: item?.value ?? randomId(8),
|
|
122
|
+
className: item?.className,
|
|
123
|
+
selectIndicator: true,
|
|
124
|
+
children: [
|
|
125
|
+
customMenuOption && customMenuOption(item),
|
|
126
|
+
!customMenuOption && /* @__PURE__ */ jsx(
|
|
127
|
+
RichLabel,
|
|
128
|
+
{
|
|
129
|
+
icon: icon2,
|
|
130
|
+
label: item?.label,
|
|
131
|
+
subtitle: item?.subtitle,
|
|
132
|
+
noColor: true
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
};
|
|
98
139
|
if (hidden) {
|
|
99
140
|
return null;
|
|
100
141
|
}
|
|
@@ -173,6 +214,11 @@ const Select = (props) => {
|
|
|
173
214
|
{
|
|
174
215
|
isDisabled: disabled,
|
|
175
216
|
value: currentValue,
|
|
217
|
+
onOpenChange: (isOpen) => {
|
|
218
|
+
if (!isOpen) {
|
|
219
|
+
setSearchTerm("");
|
|
220
|
+
}
|
|
221
|
+
},
|
|
176
222
|
onChange: (selected) => {
|
|
177
223
|
if (selected === null || selected === void 0) {
|
|
178
224
|
onChange(null);
|
|
@@ -190,12 +236,7 @@ const Select = (props) => {
|
|
|
190
236
|
if (item && "id" in item) {
|
|
191
237
|
delete item.id;
|
|
192
238
|
}
|
|
193
|
-
onChange(
|
|
194
|
-
label: item?.label,
|
|
195
|
-
value: item?.value,
|
|
196
|
-
subtitle: item?.subtitle,
|
|
197
|
-
meta: item?.meta
|
|
198
|
-
});
|
|
239
|
+
onChange(item);
|
|
199
240
|
},
|
|
200
241
|
placeholder,
|
|
201
242
|
...rest,
|
|
@@ -296,92 +337,96 @@ const Select = (props) => {
|
|
|
296
337
|
maxHeight: 240,
|
|
297
338
|
triggerRef: ref,
|
|
298
339
|
children: [
|
|
299
|
-
searchable && /* @__PURE__ */ jsxs(
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
$3985021b0ad6602f$export$f5b8910cec6cf069,
|
|
309
|
-
{
|
|
310
|
-
placeholder: __("Search...", "eightshift-ui-components"),
|
|
311
|
-
className: clsx(
|
|
312
|
-
"es:peer es:size-full es:h-9.5 es:outline-hidden! es:pl-3.5 es:pr-9 es:shadow-none! es:text-13! es:placeholder:text-surface-500 es:[&::-webkit-search-cancel-button]:hidden",
|
|
313
|
-
"es:bg-accent-900/8 es:m-1.5 es:rounded-3xl es:border-none!",
|
|
314
|
-
"es:inset-ring! es:inset-ring-accent-950/7 es:focus:inset-ring-accent-950/20",
|
|
315
|
-
"es:text-accent-950 es:placeholder:text-accent-700/50",
|
|
316
|
-
"es:transition"
|
|
317
|
-
)
|
|
318
|
-
}
|
|
319
|
-
),
|
|
320
|
-
/* @__PURE__ */ jsx(
|
|
321
|
-
$d2b4bc8c273e7be6$export$353f5b6fc5456de1,
|
|
322
|
-
{
|
|
323
|
-
"aria-label": __("Clear", "eightshift-ui-components"),
|
|
324
|
-
className: clsx(
|
|
325
|
-
"es:absolute es:right-3 es:top-0 es:bottom-0 es:my-auto es:border-none es:bg-transparent",
|
|
326
|
-
"es:flex es:size-7 es:items-center es:justify-center es:rounded-3xl es:text-sm es:text-surface-700 es:transition es:hover:bg-accent-50 es:hover:text-accent-800 es:any-focus:outline-hidden es:focus:ring-2 es:focus:ring-accent-500/50 es:disabled:text-secondary-300",
|
|
327
|
-
"es:peer-placeholder-shown:opacity-0"
|
|
328
|
-
),
|
|
329
|
-
children: icons.clearAlt
|
|
330
|
-
}
|
|
331
|
-
)
|
|
332
|
-
]
|
|
333
|
-
}
|
|
334
|
-
),
|
|
335
|
-
/* @__PURE__ */ jsx(
|
|
336
|
-
$eed445e0843c11d0$export$41f133550aa26f48,
|
|
337
|
-
{
|
|
338
|
-
className: "es:space-y-0.75 es:p-1.5 es:pt-0 es:any-focus:outline-hidden es:h-full es:overflow-y-auto es:rounded-t-xl",
|
|
339
|
-
items: options,
|
|
340
|
-
renderEmptyState: () => /* @__PURE__ */ jsx(
|
|
341
|
-
RichLabel,
|
|
340
|
+
searchable && /* @__PURE__ */ jsxs(
|
|
341
|
+
$d2f53cda644affe3$export$2f2b9559550c7bbc,
|
|
342
|
+
{
|
|
343
|
+
filter: () => true,
|
|
344
|
+
inputValue: searchTerm,
|
|
345
|
+
onInputChange: setSearchTerm,
|
|
346
|
+
children: [
|
|
347
|
+
/* @__PURE__ */ jsxs(
|
|
348
|
+
$440f4836bcb56932$export$b94867ecbd698f21,
|
|
342
349
|
{
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
350
|
+
"aria-label": __("Search", "eightshift-ui-components"),
|
|
351
|
+
className: "es:flex es:items-center es:relative",
|
|
352
|
+
autoFocus: true,
|
|
353
|
+
children: [
|
|
354
|
+
/* @__PURE__ */ jsx(
|
|
355
|
+
$3985021b0ad6602f$export$f5b8910cec6cf069,
|
|
356
|
+
{
|
|
357
|
+
placeholder: __("Search...", "eightshift-ui-components"),
|
|
358
|
+
className: clsx(
|
|
359
|
+
"es:peer es:size-full es:h-9.5 es:outline-hidden! es:pl-3.5 es:pr-9 es:shadow-none! es:text-13! es:placeholder:text-surface-500 es:[&::-webkit-search-cancel-button]:hidden",
|
|
360
|
+
"es:bg-accent-900/8 es:m-1.5 es:rounded-3xl! es:border-none!",
|
|
361
|
+
"es:inset-ring! es:inset-ring-accent-950/7 es:focus:inset-ring-accent-950/20",
|
|
362
|
+
"es:text-accent-950 es:placeholder:text-accent-700/50",
|
|
363
|
+
"es:transition"
|
|
364
|
+
)
|
|
365
|
+
}
|
|
366
|
+
),
|
|
367
|
+
/* @__PURE__ */ jsx(
|
|
368
|
+
$d2b4bc8c273e7be6$export$353f5b6fc5456de1,
|
|
369
|
+
{
|
|
370
|
+
slot: "clear",
|
|
371
|
+
"aria-label": __("Clear", "eightshift-ui-components"),
|
|
372
|
+
className: clsx(
|
|
373
|
+
"es:absolute es:right-3 es:top-0 es:bottom-0 es:my-auto es:border-none es:bg-transparent",
|
|
374
|
+
"es:flex es:size-7 es:items-center es:justify-center es:rounded-3xl es:text-sm es:text-surface-700 es:transition es:hover:bg-accent-50 es:hover:text-accent-800 es:any-focus:outline-hidden es:focus:ring-2 es:focus:ring-accent-500/50 es:disabled:text-secondary-300",
|
|
375
|
+
"es:peer-placeholder-shown:opacity-0"
|
|
376
|
+
),
|
|
377
|
+
children: icons.clearAlt
|
|
378
|
+
}
|
|
379
|
+
)
|
|
380
|
+
]
|
|
349
381
|
}
|
|
350
382
|
),
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
383
|
+
/* @__PURE__ */ jsxs(
|
|
384
|
+
$eed445e0843c11d0$export$41f133550aa26f48,
|
|
385
|
+
{
|
|
386
|
+
className: "es:space-y-0.75 es:p-1.5 es:pt-0 es:any-focus:outline-hidden es:h-full es:overflow-y-auto es:rounded-t-xl",
|
|
387
|
+
renderEmptyState: () => /* @__PURE__ */ jsx(
|
|
388
|
+
RichLabel,
|
|
389
|
+
{
|
|
390
|
+
icon: icons.searchEmpty,
|
|
391
|
+
label: __("No results", "eightshift-ui-components"),
|
|
392
|
+
subtitle: __("Try a different search term", "eightshift-ui-components"),
|
|
393
|
+
className: "es:min-h-14 es:p-2 es:w-fit es:mx-auto es:motion-preset-slide-up es:motion-ease-spring-bouncy es:motion-duration-200 es:shrink-0",
|
|
394
|
+
iconClassName: "es:text-accent-700 es:icon:size-7!",
|
|
395
|
+
noColor: true
|
|
396
|
+
}
|
|
397
|
+
),
|
|
398
|
+
children: [
|
|
399
|
+
groupedOptions && /* @__PURE__ */ jsx($e1995378a142960e$export$fb8073518f34e6ec, { items: groupedOptions, children: (item) => /* @__PURE__ */ jsxs(
|
|
400
|
+
$eed445e0843c11d0$export$dca12b0bb56e4fc,
|
|
401
|
+
{
|
|
402
|
+
id: item.key,
|
|
403
|
+
className: "es:flex es:flex-col es:gap-0.75",
|
|
404
|
+
children: [
|
|
405
|
+
/* @__PURE__ */ jsx($72a5793c14baf454$export$8b251419efc915eb, { className: "es:px-2.5 es:pb-1 es:pt-3 es:select-none", children: /* @__PURE__ */ jsx(
|
|
406
|
+
RichLabel,
|
|
407
|
+
{
|
|
408
|
+
icon: item?.icon,
|
|
409
|
+
label: item?.label,
|
|
410
|
+
subtitle: item?.subtitle,
|
|
411
|
+
endIcon: item?.endIcon,
|
|
412
|
+
fullWidth: true
|
|
413
|
+
}
|
|
414
|
+
) }),
|
|
415
|
+
/* @__PURE__ */ jsx($e1995378a142960e$export$fb8073518f34e6ec, { items: item.options, children: (subItem) => renderItem(subItem) })
|
|
416
|
+
]
|
|
417
|
+
}
|
|
418
|
+
) }),
|
|
419
|
+
!groupedOptions && /* @__PURE__ */ jsx($e1995378a142960e$export$fb8073518f34e6ec, { items: searchable ? filteredOptions : options, children: (item) => renderItem(item) })
|
|
420
|
+
]
|
|
355
421
|
}
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
selectIndicator: true,
|
|
362
|
-
children: [
|
|
363
|
-
customMenuOption && customMenuOption(item),
|
|
364
|
-
!customMenuOption && /* @__PURE__ */ jsx(
|
|
365
|
-
RichLabel,
|
|
366
|
-
{
|
|
367
|
-
icon: icon2,
|
|
368
|
-
label: item?.label,
|
|
369
|
-
subtitle: item?.subtitle,
|
|
370
|
-
noColor: true
|
|
371
|
-
}
|
|
372
|
-
)
|
|
373
|
-
]
|
|
374
|
-
}
|
|
375
|
-
);
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
)
|
|
379
|
-
] }),
|
|
380
|
-
!searchable && /* @__PURE__ */ jsx(
|
|
422
|
+
)
|
|
423
|
+
]
|
|
424
|
+
}
|
|
425
|
+
),
|
|
426
|
+
!searchable && /* @__PURE__ */ jsxs(
|
|
381
427
|
$eed445e0843c11d0$export$41f133550aa26f48,
|
|
382
428
|
{
|
|
383
429
|
className: "es:space-y-0.75 es:p-1.5 es:any-focus:outline-hidden es:h-full es:overflow-y-auto es:rounded-t-xl",
|
|
384
|
-
items: options,
|
|
385
430
|
renderEmptyState: () => /* @__PURE__ */ jsx(
|
|
386
431
|
RichLabel,
|
|
387
432
|
{
|
|
@@ -393,32 +438,29 @@ const Select = (props) => {
|
|
|
393
438
|
noColor: true
|
|
394
439
|
}
|
|
395
440
|
),
|
|
396
|
-
children:
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
icon2 = icons?.[item.icon] ?? null;
|
|
400
|
-
}
|
|
401
|
-
return /* @__PURE__ */ jsxs(
|
|
402
|
-
OptionItemBase,
|
|
441
|
+
children: [
|
|
442
|
+
groupedOptions && /* @__PURE__ */ jsx($e1995378a142960e$export$fb8073518f34e6ec, { items: groupedOptions, children: (item) => /* @__PURE__ */ jsxs(
|
|
443
|
+
$eed445e0843c11d0$export$dca12b0bb56e4fc,
|
|
403
444
|
{
|
|
404
|
-
id: item.
|
|
405
|
-
className:
|
|
406
|
-
selectIndicator: true,
|
|
445
|
+
id: item.key,
|
|
446
|
+
className: "es:flex es:flex-col es:gap-0.75",
|
|
407
447
|
children: [
|
|
408
|
-
|
|
409
|
-
!customMenuOption && /* @__PURE__ */ jsx(
|
|
448
|
+
/* @__PURE__ */ jsx($72a5793c14baf454$export$8b251419efc915eb, { className: "es:px-2.5 es:pb-1 es:pt-3 es:select-none", children: /* @__PURE__ */ jsx(
|
|
410
449
|
RichLabel,
|
|
411
450
|
{
|
|
412
|
-
icon:
|
|
451
|
+
icon: item?.icon,
|
|
413
452
|
label: item?.label,
|
|
414
453
|
subtitle: item?.subtitle,
|
|
415
|
-
|
|
454
|
+
endIcon: item?.endIcon,
|
|
455
|
+
fullWidth: true
|
|
416
456
|
}
|
|
417
|
-
)
|
|
457
|
+
) }),
|
|
458
|
+
/* @__PURE__ */ jsx($e1995378a142960e$export$fb8073518f34e6ec, { items: item.options, children: (subItem) => renderItem(subItem) })
|
|
418
459
|
]
|
|
419
460
|
}
|
|
420
|
-
)
|
|
421
|
-
|
|
461
|
+
) }),
|
|
462
|
+
!groupedOptions && /* @__PURE__ */ jsx($e1995378a142960e$export$fb8073518f34e6ec, { items: options, children: (item) => renderItem(item) })
|
|
463
|
+
]
|
|
422
464
|
}
|
|
423
465
|
)
|
|
424
466
|
]
|
|
@@ -2,12 +2,12 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
|
2
2
|
import { s as sprintf } from "../../sprintf-DmNrJSYG.js";
|
|
3
3
|
import { _ as __ } from "../../default-i18n-CnQeC5Pl.js";
|
|
4
4
|
import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-BDlf9vIY.js";
|
|
5
|
-
import { $ as $6f909507e6374d18$export$472062a354075cee, a as $6f909507e6374d18$export$105594979f116971, b as $6f909507e6374d18$export$2c1b491743890dec, c as $6f909507e6374d18$export$a590f758a961cb5b } from "../../Slider-
|
|
5
|
+
import { $ as $6f909507e6374d18$export$472062a354075cee, a as $6f909507e6374d18$export$105594979f116971, b as $6f909507e6374d18$export$2c1b491743890dec, c as $6f909507e6374d18$export$a590f758a961cb5b } from "../../Slider-BIbaMdUE.js";
|
|
6
6
|
import { BaseControl } from "../base-control/base-control.js";
|
|
7
7
|
import { icons } from "../../icons/icons.js";
|
|
8
8
|
import { getColumnConfigOutputText } from "./utils.js";
|
|
9
9
|
import { c as clsx } from "../../clsx-DgYk2OaC.js";
|
|
10
|
-
import { A as AnimatePresence, m as motion } from "../../proxy-
|
|
10
|
+
import { A as AnimatePresence, m as motion } from "../../proxy-DFlYXk07.js";
|
|
11
11
|
/**
|
|
12
12
|
* A two-thumb slider for selecting a range of columns.
|
|
13
13
|
*
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from "react";
|
|
3
3
|
import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-BDlf9vIY.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-BIbaMdUE.js";
|
|
5
5
|
import { BaseControl } from "../base-control/base-control.js";
|
|
6
6
|
import { c as clsx } from "../../clsx-DgYk2OaC.js";
|
|
7
7
|
import { NumberPicker } from "../number-picker/number-picker.js";
|
|
8
8
|
import { generateMarkers, generateGridTemplate } from "./utils.js";
|
|
9
9
|
import { HStack } from "../layout/hstack.js";
|
|
10
|
-
import { A as AnimatePresence, m as motion } from "../../proxy-
|
|
10
|
+
import { A as AnimatePresence, m as motion } from "../../proxy-DFlYXk07.js";
|
|
11
11
|
/**
|
|
12
12
|
* A single/multi-thumb slider component.
|
|
13
13
|
*
|
|
@@ -3,7 +3,7 @@ import { _ as __ } from "../../default-i18n-CnQeC5Pl.js";
|
|
|
3
3
|
import { c as clsx } from "../../clsx-DgYk2OaC.js";
|
|
4
4
|
import { useState, useRef, useEffect, cloneElement } from "react";
|
|
5
5
|
import { icons } from "../../icons/icons.js";
|
|
6
|
-
import "../../react-jsx-parser.min-
|
|
6
|
+
import "../../react-jsx-parser.min-DAh4myol.js";
|
|
7
7
|
import { DecorativeTooltip } from "../tooltip/tooltip.js";
|
|
8
8
|
import { cyrb64Hash } from "../../utilities/hash.js";
|
|
9
9
|
const WORKER_CODE = "const getSaturation = (r, g, b) => {\n // Convert 0-255 to 0-1 range.\n const red = r / 255;\n const green = g / 255;\n const blue = b / 255;\n\n const max = Math.max(red, green, blue);\n const min = Math.min(red, green, blue);\n const delta = max - min;\n\n // If the maximum brightness is less than ~5% (approx RGB 13),\n // the human eye just sees \"black\", regardless of the color math.\n if (max < 0.05) {\n return 0;\n }\n\n // Standard HSV Calculation\n let saturation = 0;\n\n if (max !== 0) {\n saturation = delta / max;\n }\n\n return parseFloat(saturation.toFixed(3));\n};\n\n// Helper to convert RGB to Hex\nconst rgbToHex = (r, g, b) => '#' + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1).toUpperCase();\n\nself.onmessage = (e) => {\n const { buffer, width, height, config } = e.data;\n const { maxColors = 5, threshold = 96, transparencyThreshold = 255 } = config;\n const stride = 4;\n\n // [1] Check transparency.\n const isTransparent = (idx) => buffer[idx + 3] < transparencyThreshold;\n const getIdx = (x, y) => (y * width + x) * stride;\n\n const corners = {\n topLeft: isTransparent(getIdx(0, 0)),\n topRight: isTransparent(getIdx(width - 1, 0)),\n bottomLeft: isTransparent(getIdx(0, height - 1)),\n bottomRight: isTransparent(getIdx(width - 1, height - 1)),\n };\n\n const sides = { top: false, bottom: false, left: false, right: false };\n\n // Scan top/bottom.\n for (let x = 0; x < width; x += 5) {\n if (!sides.top && isTransparent(getIdx(x, 0))) {\n sides.top = true;\n }\n\n if (!sides.bottom && isTransparent(getIdx(x, height - 1))) {\n sides.bottom = true;\n }\n }\n\n // Scan left/right.\n for (let y = 0; y < height; y += 5) {\n if (!sides.left && isTransparent(getIdx(0, y))) {\n sides.left = true;\n }\n\n if (!sides.right && isTransparent(getIdx(width - 1, y))) {\n sides.right = true;\n }\n }\n\n // Internal transparency check\n let internalTransparent = false;\n const borderIsSolid = !Object.values(sides).some((v) => v);\n\n if (borderIsSolid) {\n const len = buffer.length;\n const step = Math.floor(len / 100);\n\n for (let i = 0; i < len; i += step) {\n const idx = i - (i % 4);\n\n if (buffer[idx + 3] < 255) {\n internalTransparent = true;\n break;\n }\n }\n } else {\n internalTransparent = true;\n }\n\n // [2] Analyze colors (Dominant + average)\n const colorCounts = {};\n const samplingRate = 20;\n let totalSampledPixels = 0;\n\n // Accumulators for Average Color\n let sumR = 0;\n let sumG = 0;\n let sumB = 0;\n\n for (let i = 0; i < buffer.length; i += stride * samplingRate) {\n const rRaw = buffer[i];\n const gRaw = buffer[i + 1];\n const bRaw = buffer[i + 2];\n const a = buffer[i + 3];\n\n // Strict alpha check (ignores anti-aliased SVG edges)\n if (a < 250) continue;\n\n totalSampledPixels++;\n\n // 1. Add to Average Sums (Use raw values for accuracy)\n sumR += rRaw;\n sumG += gRaw;\n sumB += bRaw;\n\n // 2. Add to Dominant Color Buckets (Quantized)\n const q = 5;\n const r = Math.round(rRaw / q) * q;\n const g = Math.round(gRaw / q) * q;\n const b = Math.round(bRaw / q) * q;\n\n const key = `${r},${g},${b}`;\n colorCounts[key] = (colorCounts[key] || 0) + 1;\n }\n\n // [3] Calculate Average Color\n let averageColor = null;\n\n if (totalSampledPixels > 0) {\n const avgR = Math.round(sumR / totalSampledPixels);\n const avgG = Math.round(sumG / totalSampledPixels);\n const avgB = Math.round(sumB / totalSampledPixels);\n const avgLum = 0.2126 * avgR + 0.7152 * avgG + 0.0722 * avgB;\n\n averageColor = {\n color: rgbToHex(avgR, avgG, avgB),\n isDark: avgLum <= 128,\n saturation: getSaturation(avgR, avgG, avgB),\n };\n }\n\n // [4] Process Dominant Colors\n const sortedRawColors = Object.entries(colorCounts)\n .map(([key, count]) => {\n const [r, g, b] = key.split(',').map(Number);\n\n return { r, g, b, count };\n })\n .sort((a, b) => b.count - a.count);\n\n const distinctPalette = [];\n\n for (const candidate of sortedRawColors) {\n if (distinctPalette.length >= maxColors) break;\n\n let isSimilar = false;\n\n for (const existing of distinctPalette) {\n const dist = Math.sqrt(Math.pow(candidate.r - existing.r, 2) + Math.pow(candidate.g - existing.g, 2) + Math.pow(candidate.b - existing.b, 2));\n\n if (dist < threshold) {\n existing.count += candidate.count;\n isSimilar = true;\n break;\n }\n }\n\n if (!isSimilar) {\n distinctPalette.push({ ...candidate });\n }\n }\n\n const palette = distinctPalette.map((item) => {\n const percentage = parseFloat((item.count / totalSampledPixels).toFixed(3));\n const lum = 0.2126 * item.r + 0.7152 * item.g + 0.0722 * item.b;\n\n return {\n color: rgbToHex(item.r, item.g, item.b),\n area: percentage,\n isDark: lum <= 128,\n saturation: getSaturation(item.r, item.g, item.b),\n };\n });\n\n self.postMessage({\n dominantColors: palette,\n averageColor,\n isDark: palette[0]?.isDark || false,\n isTransparent: internalTransparent || Object.values(corners).some((v) => v) || Object.values(sides).some((v) => v),\n transparencyInfo: {\n any: internalTransparent,\n left: sides.left,\n right: sides.right,\n top: sides.top,\n bottom: sides.bottom,\n topLeftCorner: corners.topLeft,\n topRightCorner: corners.topRight,\n bottomLeftCorner: corners.bottomLeft,\n bottomRightCorner: corners.bottomRight,\n },\n });\n};\n";
|
|
@@ -3,12 +3,12 @@ import { _ as __ } from "../../default-i18n-CnQeC5Pl.js";
|
|
|
3
3
|
import { c as clsx } from "../../clsx-DgYk2OaC.js";
|
|
4
4
|
import { useState, useRef, useEffect, cloneElement } from "react";
|
|
5
5
|
import { icons } from "../../icons/icons.js";
|
|
6
|
-
import "../../react-jsx-parser.min-
|
|
6
|
+
import "../../react-jsx-parser.min-DAh4myol.js";
|
|
7
7
|
import { DecorativeTooltip } from "../tooltip/tooltip.js";
|
|
8
8
|
import { useImageAnalysisWorker } from "../../utilities/web-workers.js";
|
|
9
9
|
import workerInline from "./worker-inline.js";
|
|
10
10
|
import { cyrb64Hash } from "../../utilities/hash.js";
|
|
11
|
-
import { b as analyzeImage } from "../../general-
|
|
11
|
+
import { b as analyzeImage } from "../../general-BfKmjm56.js";
|
|
12
12
|
/**
|
|
13
13
|
* @typedef {Object} CustomImageProps
|
|
14
14
|
* @property {JSX.Element} [props.renderError] - Component to render if image analysis fails. `(error) => JSX:Element`.
|