@eightshift/ui-components 6.0.13 → 6.1.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.
Files changed (79) hide show
  1. package/dist/{Button-JRIu2BnS.js → Button-BTCA69Lt.js} +9 -9
  2. package/dist/{Dialog-Dd1yqNus.js → Dialog-BbNWvB5_.js} +76 -57
  3. package/dist/{FieldError-DmVwL6Dj.js → FieldError-BPG0hKfB.js} +2 -2
  4. package/dist/{FocusScope-Dri1oBcH.js → FocusScope-BxT4xfe9.js} +6 -7
  5. package/dist/{Heading-eA6LXIKB.js → Heading-CY-_gt-U.js} +2 -2
  6. package/dist/{Input-Cuw9UbNb.js → Input-Wrnm2nxy.js} +8 -8
  7. package/dist/{Label-DPWyf-gp.js → Label-BDlf9vIY.js} +3 -2
  8. package/dist/{ListBox-DT1sFY3e.js → ListBox-yHUyUAAH.js} +28 -26
  9. package/dist/{OverlayArrow-DVJTTfZM.js → OverlayArrow-NzRV9wsn.js} +7 -7
  10. package/dist/{RadioGroup-Cp5cdBI_.js → RadioGroup-BFDueqHz.js} +14 -14
  11. package/dist/{SearchField-CLhr5PGZ.js → SearchField-CmRhtrQf.js} +12 -12
  12. package/dist/{SelectionManager-DbBiF5M8.js → SelectionManager-VgpR-1Ri.js} +33 -29
  13. package/dist/{Slider-CZV3HhHY.js → Slider-Bl5G0ZHE.js} +16 -15
  14. package/dist/{Text-Dae33gHp.js → Text-CjFEHSfr.js} +3 -2
  15. package/dist/{VisuallyHidden-eaCBtXhE.js → VisuallyHidden-DXVaR_RC.js} +2 -2
  16. package/dist/{animation-DY7CNkr6.js → animation-B2sADg3I.js} +1 -1
  17. package/dist/assets/style-admin.css +38 -54
  18. package/dist/assets/style-editor.css +38 -54
  19. package/dist/assets/style.css +38 -54
  20. package/dist/{color-swatch-CZj0jHZd.js → color-swatch-DtaLObbd.js} +4 -4
  21. package/dist/components/base-control/base-control.js +1 -1
  22. package/dist/components/button/button.js +9 -9
  23. package/dist/components/checkbox/checkbox.js +10 -10
  24. package/dist/components/color-pickers/color-picker.js +1 -1
  25. package/dist/components/color-pickers/color-swatch.js +1 -1
  26. package/dist/components/color-pickers/gradient-editor.js +1 -1
  27. package/dist/components/color-pickers/solid-color-picker.js +26 -22
  28. package/dist/components/expandable/expandable.js +8 -8
  29. package/dist/components/index.js +4 -2
  30. package/dist/components/input-field/input-field.js +10 -10
  31. package/dist/components/link-input/link-input.js +24 -23
  32. package/dist/components/matrix-align/matrix-align.js +1 -1
  33. package/dist/components/menu/menu.js +1 -1
  34. package/dist/components/modal/modal.js +19 -20
  35. package/dist/components/number-picker/number-picker.js +10 -10
  36. package/dist/components/options-panel/options-panel.js +1 -1
  37. package/dist/components/placeholders/file-picker-shell.js +48 -43
  38. package/dist/components/popover/popover.js +1 -1
  39. package/dist/components/radio/radio.js +2 -2
  40. package/dist/components/responsive/mini-responsive.js +1 -1
  41. package/dist/components/select/async-multi-select.js +7 -7
  42. package/dist/components/select/async-select.js +7 -7
  43. package/dist/components/select/multi-select.js +8 -8
  44. package/dist/components/select/shared.js +3 -3
  45. package/dist/components/select/single-select.js +8 -8
  46. package/dist/components/slider/column-config-slider.js +3 -3
  47. package/dist/components/slider/slider.js +3 -3
  48. package/dist/components/smart-image/image-analysis-worker-next.js +144 -0
  49. package/dist/components/smart-image/smart-image-next.js +294 -0
  50. package/dist/components/tabs/tabs.js +15 -14
  51. package/dist/components/toggle/switch.js +7 -7
  52. package/dist/components/toggle/toggle.js +1 -1
  53. package/dist/components/toggle-button/toggle-button.js +10 -7
  54. package/dist/components/tooltip/tooltip.js +5 -5
  55. package/dist/{context-DYYO3Ns3.js → context-iUFQCK8m.js} +1 -1
  56. package/dist/icons/icons.js +2 -2
  57. package/dist/index.js +3 -1
  58. package/dist/{proxy-B_RaYTfe.js → proxy-CgLBbUpw.js} +190 -35
  59. package/dist/{shared-Bg9lx3pE.js → shared-DSTKnPjF.js} +27 -24
  60. package/dist/{textSelection-Cq_Br7RW.js → textSelection-D_BSbtab.js} +1 -1
  61. package/dist/{useButton-CeuyDay5.js → useButton-DofKjCES.js} +3 -3
  62. package/dist/{useEvent-DoWvho2u.js → useEvent-ADVZr4I3.js} +1 -1
  63. package/dist/{useFilter-DYtfYPua.js → useFilter-Cqw0-KoB.js} +1 -1
  64. package/dist/{useFocusRing-WEswknAY.js → useFocusRing-Ct2N5S1b.js} +10 -5
  65. package/dist/{useFormReset-BDF1K4E4.js → useFormReset-KT27O1en.js} +1 -1
  66. package/dist/{useFormValidation-Dqzjv4jX.js → useFormValidation-DwbcW-pN.js} +2 -2
  67. package/dist/{useHover-CG39Ci3A.js → useHover-VPZwb-1l.js} +15 -14
  68. package/dist/{useLabel--3fT2XKM.js → useLabel-DzXzKZZZ.js} +2 -2
  69. package/dist/{useLabels-vzdDMGCX.js → useLabels-D8O3gOdV.js} +1 -1
  70. package/dist/{useListState-Bya9g7W8.js → useListState-jHobZH6F.js} +1 -1
  71. package/dist/{useLocalizedStringFormatter-M3L6Ge2c.js → useLocalizedStringFormatter-CEDs0LsA.js} +1 -1
  72. package/dist/{useNumberField-D6lsi3Vu.js → useNumberField-CrLevIP3.js} +50 -40
  73. package/dist/{useNumberFormatter-BWOyCamK.js → useNumberFormatter-CG_IQXp9.js} +1 -1
  74. package/dist/{usePress-B9w0X4Ur.js → usePress-BPCda-AF.js} +13 -7
  75. package/dist/{useSingleSelectListState-D9SqGLJ0.js → useSingleSelectListState-sLg_MnX8.js} +2 -2
  76. package/dist/{useToggle-Deq2xxQV.js → useToggle-D0-c9HPm.js} +4 -4
  77. package/dist/{useToggleState-j3o1PvdS.js → useToggleState-BhJn-Dz7.js} +1 -1
  78. package/dist/{utils-HC9_3Crc.js → utils-Cr3pLd9c.js} +77 -38
  79. package/package.json +13 -13
@@ -5,6 +5,7 @@ import "react";
5
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
+ import { __SmartImageNext } from "../smart-image/smart-image-next.js";
8
9
  /**
9
10
  * A shell for a file picker UI, handling both rich visual presentation (e.g. images) and simple file placeholders.
10
11
  *
@@ -53,6 +54,7 @@ const FilePickerShell = (props) => {
53
54
  className,
54
55
  noUrlContent,
55
56
  hidden,
57
+ __useSmartImageNext = false,
56
58
  ...rest
57
59
  } = props;
58
60
  if (hidden) {
@@ -67,11 +69,11 @@ const FilePickerShell = (props) => {
67
69
  {
68
70
  ...rest,
69
71
  className: clsx(
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",
72
+ "es:border es:border-surface-200 es:bg-surface-50 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
73
  className
72
74
  ),
73
75
  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-surface-50 es:inset-ring es:inset-ring-surface-100 es:icon:text-surface-500 es:text-surface-700 es:p-2", children: [
76
+ 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-white/50 es:inset-ring es:inset-ring-surface-100 es:icon:text-surface-500 es:text-surface-700 es:px-2 es:py-4", children: [
75
77
  icon,
76
78
  /* @__PURE__ */ jsx("span", { className: "es:line-clamp-1", children: truncateMiddle(url, 34) })
77
79
  ] }),
@@ -80,57 +82,60 @@ const FilePickerShell = (props) => {
80
82
  }
81
83
  );
82
84
  }
85
+ const ComponentToRender = __useSmartImageNext ? __SmartImageNext : SmartImage;
83
86
  return /* @__PURE__ */ jsx(
84
- SmartImage,
87
+ ComponentToRender,
85
88
  {
86
89
  src: url,
87
90
  alt: "",
88
- className: ({ hasAnalysed, isTransparent, transparencyInfo, isDark }) => clsx(
89
- hasAnalysed && transparencyInfo?.left && url && "es:pl-3",
90
- hasAnalysed && transparencyInfo?.right && url && "es:pr-3",
91
- hasAnalysed && transparencyInfo?.top && url && "es:pt-3",
92
- hasAnalysed && transparencyInfo?.bottom && url && "es:pb-3",
93
- hasAnalysed && isTransparent && isDark && "es:bg-white/60 es:object-contain es:mx-auto",
94
- hasAnalysed && isTransparent && !isDark && "es:bg-black/60 es:object-contain es:mx-auto",
91
+ className: ({ hasAnalysed, isTransparent, transparencyInfo, isDark, hasError }) => clsx(
92
+ hasAnalysed && isTransparent && url && "es:p-4",
93
+ hasAnalysed && isTransparent && isDark && "es:object-contain es:mx-auto",
94
+ hasAnalysed && isTransparent && !isDark && "es:object-contain es:mx-auto",
95
95
  hasAnalysed && isTransparent && (transparencyInfo?.left || transparencyInfo?.right) && "es:w-full!",
96
96
  hasAnalysed && isTransparent && (transparencyInfo?.top || transparencyInfo?.bottom) && "es:h-full!",
97
97
  hasAnalysed && !isTransparent && "es:w-full! es:aspect-3-2 es:object-cover",
98
- hasAnalysed && "es:grow es:rounded-xl es:h-fill!"
98
+ hasAnalysed && "es:grow es:rounded-xl es:h-fill!",
99
+ hasError && "es:rounded-xl"
99
100
  ),
100
- 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",
101
+ errorClassName: !__useSmartImageNext && "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",
101
102
  imageAnalysisSettings: { yFrom: 0.25, yTo: 0.75 },
102
103
  ...rest,
103
- children: ({ image, dominantColors, isDark, hasAnalysed, isTransparent, hasError, errorBadge }) => /* @__PURE__ */ jsxs(
104
- "div",
105
- {
106
- className: clsx(
107
- "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",
108
- !hasError && hasAnalysed ? "es:border-secondary-200" : "es:border-secondary-200/0",
109
- !hasError && hasAnalysed && !isTransparent && "es:group es:grid-rows-1",
110
- !hasError && hasAnalysed && isTransparent && "es:p-2 es:grid-rows-[minmax(0,1fr)_auto] es:h-fit",
111
- !hasAnalysed && "es:shimmer-dark es:bg-secondary-50",
112
- hasError && "es:flex es:items-center es:justify-center",
113
- className
114
- ),
115
- style: !hasError && hasAnalysed && isTransparent ? { backgroundColor: `color-mix(in srgb, ${dominantColors[0]?.color || "#ffffff"} ${dominantColors[0]?.isDark ? 10 : 80}%, #ffffff)` } : {},
116
- children: [
117
- image,
118
- hasError && errorBadge,
119
- children && /* @__PURE__ */ jsx(
120
- "div",
121
- {
122
- className: clsx(
123
- "es:flex es:items-center-safe es:gap-0.75",
124
- "es-button-group-h",
125
- !hasError && !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",
126
- hasError && "es:absolute es:bottom-2 es:left-2 es:right-2"
127
- ),
128
- children: typeof children === "function" ? children({ dominantColors, isDark, isTransparent, hasError }) : children
129
- }
130
- )
131
- ]
132
- }
133
- )
104
+ children: ({ image, dominantColors, isDark, hasAnalysed, isTransparent, hasError, errorBadge }) => {
105
+ const dominantDisplayColor = dominantColors?.find((c) => c.saturation > 0.25) || dominantColors?.[0];
106
+ return /* @__PURE__ */ jsxs(
107
+ "div",
108
+ {
109
+ className: clsx(
110
+ "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",
111
+ !hasError && hasAnalysed ? "es:border-secondary-200" : "es:border-secondary-200/0",
112
+ !hasError && hasAnalysed && !isTransparent && "es:group es:grid-rows-1",
113
+ (hasAnalysed && isTransparent || hasError) && "es:p-2 es:grid-rows-[minmax(0,1fr)_auto] es:h-fit",
114
+ !hasError && !hasAnalysed && "es:shimmer-dark es:bg-surface-100",
115
+ hasError && "es:bg-surface-50 es:border-surface-100",
116
+ className
117
+ ),
118
+ style: !hasError && hasAnalysed && isTransparent ? {
119
+ backgroundColor: `color-mix(in srgb, ${dominantDisplayColor?.color || "#ffffff"} ${dominantDisplayColor?.isDark ? 5 : 25}%, ${dominantDisplayColor?.isDark ? "#ffffff" : "#000000"})`
120
+ } : {},
121
+ children: [
122
+ !hasError && image,
123
+ hasError && errorBadge,
124
+ children && /* @__PURE__ */ jsx(
125
+ "div",
126
+ {
127
+ className: clsx(
128
+ "es:flex es:items-center-safe es:gap-0.75",
129
+ "es-button-group-h",
130
+ !hasError && !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"
131
+ ),
132
+ children: typeof children === "function" ? children({ dominantColors, isDark, isTransparent, hasError }) : children
133
+ }
134
+ )
135
+ ]
136
+ }
137
+ );
138
+ }
134
139
  }
135
140
  );
136
141
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { $ as $07b14b47974efb58$export$5b6b19405a83ff9d, g as $de32f1b87079253c$export$3ddf2d174ce01153, h as $de32f1b87079253c$export$2e1e1122cf0cba88 } from "../../Dialog-Dd1yqNus.js";
2
+ import { f as $07b14b47974efb58$export$5b6b19405a83ff9d, g as $de32f1b87079253c$export$3ddf2d174ce01153, h as $de32f1b87079253c$export$2e1e1122cf0cba88 } from "../../Dialog-BbNWvB5_.js";
3
3
  import { c as clsx } from "../../clsx-DgYk2OaC.js";
4
4
  import { _ as __ } from "../../default-i18n-CnQeC5Pl.js";
5
5
  import { Button } from "../button/button.js";
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-DPWyf-gp.js";
3
- import { a as $b6c3ddc6086f204d$export$d7b12c4107be0d61, $ as $b6c3ddc6086f204d$export$a98f0dcb43a68a25 } from "../../RadioGroup-Cp5cdBI_.js";
2
+ import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-BDlf9vIY.js";
3
+ import { a as $b6c3ddc6086f204d$export$d7b12c4107be0d61, $ as $b6c3ddc6086f204d$export$a98f0dcb43a68a25 } from "../../RadioGroup-BFDueqHz.js";
4
4
  import { c as clsx } from "../../clsx-DgYk2OaC.js";
5
5
  import { AnimatedVisibility } from "../animated-visibility/animated-visibility.js";
6
6
  import { RichLabel } from "../rich-label/rich-label.js";
@@ -12,7 +12,7 @@ import { ButtonGroup, Button } from "../button/button.js";
12
12
  import { BaseControl } from "../base-control/base-control.js";
13
13
  import { TriggeredPopover } from "../popover/popover.js";
14
14
  import { OptionSelect } from "../option-select/option-select.js";
15
- import { $ as $514c0188e459b4c0$export$5f1af8db9871e1d6 } from "../../Text-Dae33gHp.js";
15
+ import { $ as $514c0188e459b4c0$export$5f1af8db9871e1d6 } from "../../Text-CjFEHSfr.js";
16
16
  /**
17
17
  * A compact, inline version of `Responsive`. Allows the user to set different values for different breakpoints.
18
18
  *
@@ -2,13 +2,13 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { s as sprintf } from "../../sprintf-DmNrJSYG.js";
3
3
  import { _ as __, a as _n } from "../../default-i18n-CnQeC5Pl.js";
4
4
  import { BaseControl } from "../base-control/base-control.js";
5
- import { $ as $d2f53cda644affe3$export$2f2b9559550c7bbc, a as $440f4836bcb56932$export$b94867ecbd698f21 } from "../../SearchField-CLhr5PGZ.js";
6
- import { $ as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../../Button-JRIu2BnS.js";
7
- import { $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-Cuw9UbNb.js";
8
- import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-DPWyf-gp.js";
9
- import { $ as $eed445e0843c11d0$export$41f133550aa26f48 } from "../../ListBox-DT1sFY3e.js";
10
- import { $ as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../Dialog-Dd1yqNus.js";
11
- import { $ as $82d7e5349645de74$export$ef9b1a59e592288f, a as $82d7e5349645de74$export$e288731fd71264f0, S as SelectClearButton, O as OptionItemBase } from "../../shared-Bg9lx3pE.js";
5
+ import { $ as $d2f53cda644affe3$export$2f2b9559550c7bbc, a as $440f4836bcb56932$export$b94867ecbd698f21 } from "../../SearchField-CmRhtrQf.js";
6
+ import { $ as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../../Button-BTCA69Lt.js";
7
+ import { $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-Wrnm2nxy.js";
8
+ import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-BDlf9vIY.js";
9
+ import { $ as $eed445e0843c11d0$export$41f133550aa26f48 } from "../../ListBox-yHUyUAAH.js";
10
+ import { f as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../Dialog-BbNWvB5_.js";
11
+ import { $ as $82d7e5349645de74$export$ef9b1a59e592288f, a as $82d7e5349645de74$export$e288731fd71264f0, S as SelectClearButton, O as OptionItemBase } from "../../shared-DSTKnPjF.js";
12
12
  import { useRef, cloneElement } from "react";
13
13
  import { icons } from "../../icons/icons.js";
14
14
  import "../../react-jsx-parser.min-B_hvYYa1.js";
@@ -1,13 +1,13 @@
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-CLhr5PGZ.js";
5
- import { $ as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../../Button-JRIu2BnS.js";
6
- import { $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-Cuw9UbNb.js";
7
- import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-DPWyf-gp.js";
8
- import { $ as $eed445e0843c11d0$export$41f133550aa26f48 } from "../../ListBox-DT1sFY3e.js";
9
- import { $ as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../Dialog-Dd1yqNus.js";
10
- import { $ as $82d7e5349645de74$export$ef9b1a59e592288f, a as $82d7e5349645de74$export$e288731fd71264f0, S as SelectClearButton, O as OptionItemBase } from "../../shared-Bg9lx3pE.js";
4
+ import { $ as $d2f53cda644affe3$export$2f2b9559550c7bbc, a as $440f4836bcb56932$export$b94867ecbd698f21 } from "../../SearchField-CmRhtrQf.js";
5
+ import { $ as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../../Button-BTCA69Lt.js";
6
+ import { $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-Wrnm2nxy.js";
7
+ import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-BDlf9vIY.js";
8
+ import { $ as $eed445e0843c11d0$export$41f133550aa26f48 } from "../../ListBox-yHUyUAAH.js";
9
+ import { f as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../Dialog-BbNWvB5_.js";
10
+ import { $ as $82d7e5349645de74$export$ef9b1a59e592288f, a as $82d7e5349645de74$export$e288731fd71264f0, S as SelectClearButton, O as OptionItemBase } from "../../shared-DSTKnPjF.js";
11
11
  import { useRef, cloneElement } from "react";
12
12
  import { icons } from "../../icons/icons.js";
13
13
  import "../../react-jsx-parser.min-B_hvYYa1.js";
@@ -2,13 +2,13 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { s as sprintf } from "../../sprintf-DmNrJSYG.js";
3
3
  import { _ as __, a as _n } from "../../default-i18n-CnQeC5Pl.js";
4
4
  import { BaseControl } from "../base-control/base-control.js";
5
- import { $ as $d2f53cda644affe3$export$2f2b9559550c7bbc, a as $440f4836bcb56932$export$b94867ecbd698f21 } from "../../SearchField-CLhr5PGZ.js";
6
- import { $ as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../../Button-JRIu2BnS.js";
7
- import { $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-Cuw9UbNb.js";
8
- import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-DPWyf-gp.js";
9
- import { $ as $eed445e0843c11d0$export$41f133550aa26f48 } from "../../ListBox-DT1sFY3e.js";
10
- import { $ as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../Dialog-Dd1yqNus.js";
11
- import { g as getValue, $ as $82d7e5349645de74$export$ef9b1a59e592288f, a as $82d7e5349645de74$export$e288731fd71264f0, S as SelectClearButton, O as OptionItemBase } from "../../shared-Bg9lx3pE.js";
5
+ import { $ as $d2f53cda644affe3$export$2f2b9559550c7bbc, a as $440f4836bcb56932$export$b94867ecbd698f21 } from "../../SearchField-CmRhtrQf.js";
6
+ import { $ as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../../Button-BTCA69Lt.js";
7
+ import { $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-Wrnm2nxy.js";
8
+ import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-BDlf9vIY.js";
9
+ import { $ as $eed445e0843c11d0$export$41f133550aa26f48 } from "../../ListBox-yHUyUAAH.js";
10
+ import { f as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../Dialog-BbNWvB5_.js";
11
+ import { g as getValue, $ as $82d7e5349645de74$export$ef9b1a59e592288f, a as $82d7e5349645de74$export$e288731fd71264f0, S as SelectClearButton, O as OptionItemBase } from "../../shared-DSTKnPjF.js";
12
12
  import { useRef, cloneElement, isValidElement } from "react";
13
13
  import { icons } from "../../icons/icons.js";
14
14
  import "../../react-jsx-parser.min-B_hvYYa1.js";
@@ -19,7 +19,7 @@ import { TriggeredPopover } from "../popover/popover.js";
19
19
  import { DraggableList } from "../draggable-list/draggable-list.js";
20
20
  import { DraggableListItem } from "../draggable-list/draggable-list-item.js";
21
21
  import { randomId } from "../../utilities/hash.js";
22
- import { $ as $bb77f239b46e8c72$export$3274cf84b703fff } from "../../useFilter-DYtfYPua.js";
22
+ import { $ as $bb77f239b46e8c72$export$3274cf84b703fff } from "../../useFilter-Cqw0-KoB.js";
23
23
  /**
24
24
  * Multi-select menu.
25
25
  *
@@ -1,8 +1,8 @@
1
1
  import "react/jsx-runtime";
2
2
  import "../../default-i18n-CnQeC5Pl.js";
3
- import "../../Button-JRIu2BnS.js";
4
- import "../../ListBox-DT1sFY3e.js";
5
- import { O, S, g, m } from "../../shared-Bg9lx3pE.js";
3
+ import "../../Button-BTCA69Lt.js";
4
+ import "../../ListBox-yHUyUAAH.js";
5
+ import { O, S, g, m } from "../../shared-DSTKnPjF.js";
6
6
  import "../../icons/icons.js";
7
7
  import "react";
8
8
  import "../../react-jsx-parser.min-B_hvYYa1.js";
@@ -1,13 +1,13 @@
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-CLhr5PGZ.js";
5
- import { $ as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../../Button-JRIu2BnS.js";
6
- import { $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-Cuw9UbNb.js";
7
- import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-DPWyf-gp.js";
8
- import { $ as $eed445e0843c11d0$export$41f133550aa26f48 } from "../../ListBox-DT1sFY3e.js";
9
- import { $ as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../Dialog-Dd1yqNus.js";
10
- import { $ as $82d7e5349645de74$export$ef9b1a59e592288f, a as $82d7e5349645de74$export$e288731fd71264f0, S as SelectClearButton, O as OptionItemBase } from "../../shared-Bg9lx3pE.js";
4
+ import { $ as $d2f53cda644affe3$export$2f2b9559550c7bbc, a as $440f4836bcb56932$export$b94867ecbd698f21 } from "../../SearchField-CmRhtrQf.js";
5
+ import { $ as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../../Button-BTCA69Lt.js";
6
+ import { $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-Wrnm2nxy.js";
7
+ import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-BDlf9vIY.js";
8
+ import { $ as $eed445e0843c11d0$export$41f133550aa26f48 } from "../../ListBox-yHUyUAAH.js";
9
+ import { f as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../Dialog-BbNWvB5_.js";
10
+ import { $ as $82d7e5349645de74$export$ef9b1a59e592288f, a as $82d7e5349645de74$export$e288731fd71264f0, S as SelectClearButton, O as OptionItemBase } from "../../shared-DSTKnPjF.js";
11
11
  import { useRef, cloneElement } from "react";
12
12
  import { icons } from "../../icons/icons.js";
13
13
  import "../../react-jsx-parser.min-B_hvYYa1.js";
@@ -15,7 +15,7 @@ import { c as clsx } from "../../clsx-DgYk2OaC.js";
15
15
  import { RichLabel } from "../rich-label/rich-label.js";
16
16
  import { c as cva } from "../../index-BHpUy2Ix.js";
17
17
  import { randomId } from "../../utilities/hash.js";
18
- import { $ as $bb77f239b46e8c72$export$3274cf84b703fff } from "../../useFilter-DYtfYPua.js";
18
+ import { $ as $bb77f239b46e8c72$export$3274cf84b703fff } from "../../useFilter-Cqw0-KoB.js";
19
19
  /**
20
20
  * Select menu.
21
21
  *
@@ -1,13 +1,13 @@
1
1
  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
- import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-DPWyf-gp.js";
5
- import { $ as $6f909507e6374d18$export$472062a354075cee, a as $6f909507e6374d18$export$105594979f116971, b as $6f909507e6374d18$export$2c1b491743890dec, c as $6f909507e6374d18$export$a590f758a961cb5b } from "../../Slider-CZV3HhHY.js";
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-Bl5G0ZHE.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-B_RaYTfe.js";
10
+ import { A as AnimatePresence, m as motion } from "../../proxy-CgLBbUpw.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
- import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-DPWyf-gp.js";
4
- import { $ as $6f909507e6374d18$export$472062a354075cee, a as $6f909507e6374d18$export$105594979f116971, b as $6f909507e6374d18$export$2c1b491743890dec, c as $6f909507e6374d18$export$a590f758a961cb5b } from "../../Slider-CZV3HhHY.js";
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-Bl5G0ZHE.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-B_RaYTfe.js";
10
+ import { A as AnimatePresence, m as motion } from "../../proxy-CgLBbUpw.js";
11
11
  /**
12
12
  * A single/multi-thumb slider component.
13
13
  *
@@ -0,0 +1,144 @@
1
+ const getSaturation = (r, g, b) => {
2
+ const red = r / 255;
3
+ const green = g / 255;
4
+ const blue = b / 255;
5
+ const max = Math.max(red, green, blue);
6
+ const min = Math.min(red, green, blue);
7
+ const delta = max - min;
8
+ if (max < 0.05) {
9
+ return 0;
10
+ }
11
+ let saturation = 0;
12
+ if (max !== 0) {
13
+ saturation = delta / max;
14
+ }
15
+ return parseFloat(saturation.toFixed(3));
16
+ };
17
+ const rgbToHex = (r, g, b) => "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1).toUpperCase();
18
+ self.onmessage = (e) => {
19
+ const { buffer, width, height, config } = e.data;
20
+ const { maxColors = 5, threshold = 96, transparencyThreshold = 255 } = config;
21
+ const stride = 4;
22
+ const isTransparent = (idx) => buffer[idx + 3] < transparencyThreshold;
23
+ const getIdx = (x, y) => (y * width + x) * stride;
24
+ const corners = {
25
+ topLeft: isTransparent(getIdx(0, 0)),
26
+ topRight: isTransparent(getIdx(width - 1, 0)),
27
+ bottomLeft: isTransparent(getIdx(0, height - 1)),
28
+ bottomRight: isTransparent(getIdx(width - 1, height - 1))
29
+ };
30
+ const sides = { top: false, bottom: false, left: false, right: false };
31
+ for (let x = 0; x < width; x += 5) {
32
+ if (!sides.top && isTransparent(getIdx(x, 0))) {
33
+ sides.top = true;
34
+ }
35
+ if (!sides.bottom && isTransparent(getIdx(x, height - 1))) {
36
+ sides.bottom = true;
37
+ }
38
+ }
39
+ for (let y = 0; y < height; y += 5) {
40
+ if (!sides.left && isTransparent(getIdx(0, y))) {
41
+ sides.left = true;
42
+ }
43
+ if (!sides.right && isTransparent(getIdx(width - 1, y))) {
44
+ sides.right = true;
45
+ }
46
+ }
47
+ let internalTransparent = false;
48
+ const borderIsSolid = !Object.values(sides).some((v) => v);
49
+ if (borderIsSolid) {
50
+ const len = buffer.length;
51
+ const step = Math.floor(len / 100);
52
+ for (let i = 0; i < len; i += step) {
53
+ const idx = i - i % 4;
54
+ if (buffer[idx + 3] < 255) {
55
+ internalTransparent = true;
56
+ break;
57
+ }
58
+ }
59
+ } else {
60
+ internalTransparent = true;
61
+ }
62
+ const colorCounts = {};
63
+ const samplingRate = 20;
64
+ let totalSampledPixels = 0;
65
+ let sumR = 0;
66
+ let sumG = 0;
67
+ let sumB = 0;
68
+ for (let i = 0; i < buffer.length; i += stride * samplingRate) {
69
+ const rRaw = buffer[i];
70
+ const gRaw = buffer[i + 1];
71
+ const bRaw = buffer[i + 2];
72
+ const a = buffer[i + 3];
73
+ if (a < 250) continue;
74
+ totalSampledPixels++;
75
+ sumR += rRaw;
76
+ sumG += gRaw;
77
+ sumB += bRaw;
78
+ const q = 5;
79
+ const r = Math.round(rRaw / q) * q;
80
+ const g = Math.round(gRaw / q) * q;
81
+ const b = Math.round(bRaw / q) * q;
82
+ const key = `${r},${g},${b}`;
83
+ colorCounts[key] = (colorCounts[key] || 0) + 1;
84
+ }
85
+ let averageColor = null;
86
+ if (totalSampledPixels > 0) {
87
+ const avgR = Math.round(sumR / totalSampledPixels);
88
+ const avgG = Math.round(sumG / totalSampledPixels);
89
+ const avgB = Math.round(sumB / totalSampledPixels);
90
+ const avgLum = 0.2126 * avgR + 0.7152 * avgG + 0.0722 * avgB;
91
+ averageColor = {
92
+ color: rgbToHex(avgR, avgG, avgB),
93
+ isDark: avgLum <= 128,
94
+ saturation: getSaturation(avgR, avgG, avgB)
95
+ };
96
+ }
97
+ const sortedRawColors = Object.entries(colorCounts).map(([key, count]) => {
98
+ const [r, g, b] = key.split(",").map(Number);
99
+ return { r, g, b, count };
100
+ }).sort((a, b) => b.count - a.count);
101
+ const distinctPalette = [];
102
+ for (const candidate of sortedRawColors) {
103
+ if (distinctPalette.length >= maxColors) break;
104
+ let isSimilar = false;
105
+ for (const existing of distinctPalette) {
106
+ 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));
107
+ if (dist < threshold) {
108
+ existing.count += candidate.count;
109
+ isSimilar = true;
110
+ break;
111
+ }
112
+ }
113
+ if (!isSimilar) {
114
+ distinctPalette.push({ ...candidate });
115
+ }
116
+ }
117
+ const palette = distinctPalette.map((item) => {
118
+ const percentage = parseFloat((item.count / totalSampledPixels).toFixed(3));
119
+ const lum = 0.2126 * item.r + 0.7152 * item.g + 0.0722 * item.b;
120
+ return {
121
+ color: rgbToHex(item.r, item.g, item.b),
122
+ area: percentage,
123
+ isDark: lum <= 128,
124
+ saturation: getSaturation(item.r, item.g, item.b)
125
+ };
126
+ });
127
+ self.postMessage({
128
+ dominantColors: palette,
129
+ averageColor,
130
+ isDark: palette[0]?.isDark || false,
131
+ isTransparent: internalTransparent || Object.values(corners).some((v) => v) || Object.values(sides).some((v) => v),
132
+ transparencyInfo: {
133
+ any: internalTransparent,
134
+ left: sides.left,
135
+ right: sides.right,
136
+ top: sides.top,
137
+ bottom: sides.bottom,
138
+ topLeftCorner: corners.topLeft,
139
+ topRightCorner: corners.topRight,
140
+ bottomLeftCorner: corners.bottomLeft,
141
+ bottomRightCorner: corners.bottomRight
142
+ }
143
+ });
144
+ };