@eightshift/ui-components 6.0.3 → 6.0.5

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 (64) hide show
  1. package/dist/assets/style-admin.css +116 -37
  2. package/dist/assets/style-editor.css +80 -37
  3. package/dist/assets/style.css +80 -37
  4. package/dist/{color-swatch-CFIuSPcO.js → color-swatch-BEBLRxTy.js} +1 -1
  5. package/dist/components/animated-visibility/animated-visibility.js +1 -1
  6. package/dist/components/base-control/base-control.js +1 -1
  7. package/dist/components/base-control/container.js +1 -1
  8. package/dist/components/breakpoint-preview/breakpoint-preview.js +1 -1
  9. package/dist/components/button/button.js +1 -1
  10. package/dist/components/checkbox/checkbox.js +1 -1
  11. package/dist/components/color-pickers/color-picker.js +2 -2
  12. package/dist/components/color-pickers/color-swatch.js +2 -2
  13. package/dist/components/color-pickers/gradient-editor.js +4 -4
  14. package/dist/components/color-pickers/solid-color-picker.js +4 -3
  15. package/dist/components/component-toggle/component-toggle.js +1 -1
  16. package/dist/components/container-panel/container-panel.js +1 -1
  17. package/dist/components/draggable/draggable-handle.js +2 -2
  18. package/dist/components/draggable/draggable.js +2 -2
  19. package/dist/components/draggable-list/draggable-list-item.js +2 -2
  20. package/dist/components/expandable/expandable.js +1 -1
  21. package/dist/components/index.js +1 -1
  22. package/dist/components/input-field/input-field.js +3 -3
  23. package/dist/components/layout/hstack.js +1 -1
  24. package/dist/components/layout/vstack.js +1 -1
  25. package/dist/components/link-input/link-input.js +13 -8
  26. package/dist/components/matrix-align/matrix-align.js +1 -1
  27. package/dist/components/menu/menu.js +1 -1
  28. package/dist/components/modal/modal.js +1 -1
  29. package/dist/components/notice/notice.js +1 -1
  30. package/dist/components/number-picker/number-picker.js +2 -2
  31. package/dist/components/options-panel/options-panel.js +1 -1
  32. package/dist/components/placeholders/file-picker-shell.js +12 -9
  33. package/dist/components/placeholders/file-placeholder.js +1 -2
  34. package/dist/components/popover/popover.js +1 -1
  35. package/dist/components/radio/radio.js +5 -5
  36. package/dist/components/repeater/repeater-item.js +1 -1
  37. package/dist/components/repeater/repeater.js +2 -2
  38. package/dist/components/responsive/mini-responsive.js +1 -1
  39. package/dist/components/responsive/responsive-legacy.js +1 -1
  40. package/dist/components/responsive/responsive.js +1 -1
  41. package/dist/components/rich-label/rich-label.js +1 -1
  42. package/dist/components/select/async-multi-select.js +22 -14
  43. package/dist/components/select/async-select.js +22 -14
  44. package/dist/components/select/multi-select.js +23 -15
  45. package/dist/components/select/shared.js +2 -2
  46. package/dist/components/select/single-select.js +23 -15
  47. package/dist/components/slider/column-config-slider.js +8 -5
  48. package/dist/components/smart-image/smart-image.js +30 -4
  49. package/dist/components/spacer/spacer.js +1 -1
  50. package/dist/components/tabs/tabs.js +2 -2
  51. package/dist/components/toggle/switch.js +1 -1
  52. package/dist/components/toggle/toggle.js +1 -1
  53. package/dist/components/toggle-button/toggle-button.js +0 -1
  54. package/dist/components/tooltip/tooltip.js +1 -1
  55. package/dist/{general-lYMgCPqJ.js → general-ChNQK6O9.js} +4 -4
  56. package/dist/icons/spinner.js +1 -1
  57. package/dist/index.js +1 -1
  58. package/dist/utilities/general.js +5 -5
  59. package/dist/utilities/hash.js +9 -0
  60. package/dist/utilities/index.js +14 -8
  61. package/dist/workers/image-analysis.worker.js +1 -1
  62. package/package.json +7 -7
  63. package/dist/lite-DVmmD_-j.js +0 -7
  64. package/dist/{shared-DwjRce5e.js → shared-DOxXagm0.js} +1 -1
@@ -2,11 +2,11 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { _ as __ } from "../../default-i18n-CnQeC5Pl.js";
3
3
  import { icons } from "../../icons/icons.js";
4
4
  import { upperFirst, camelCase } from "../../utilities/es-dash.js";
5
+ import { c as clsx } from "../../clsx-DgYk2OaC.js";
5
6
  import { BaseControl } from "../base-control/base-control.js";
6
7
  import { TriggeredPopover } from "../popover/popover.js";
7
8
  import { $ as $b6c3ddc6086f204d$export$a98f0dcb43a68a25, a as $b6c3ddc6086f204d$export$d7b12c4107be0d61 } from "../../RadioGroup-BVFvITWO.js";
8
9
  import { RichLabel } from "../rich-label/rich-label.js";
9
- import { c as clsx } from "../../clsx-DgYk2OaC.js";
10
10
  /**
11
11
  * A component that can provide a 3x3 or a 2x2 grid of positions to pick from.
12
12
  * Replaces the default Gutenberg `AlignmentMatrixControl`/`BlockAlignmentMatrixControl`/`BlockAlignmentMatrixToolbar`.
@@ -4,7 +4,7 @@ import { RichLabel } from "../rich-label/rich-label.js";
4
4
  import { icons } from "../../icons/icons.js";
5
5
  import { Button } from "../button/button.js";
6
6
  import { Popover } from "../popover/popover.js";
7
- import { c as clsx } from "../../lite-DVmmD_-j.js";
7
+ import { c as clsx } from "../../clsx-DgYk2OaC.js";
8
8
  import { cloneElement } from "react";
9
9
  import { _ as __ } from "../../default-i18n-CnQeC5Pl.js";
10
10
  /**
@@ -8,7 +8,7 @@ import $dbSRa$react__default, { useState, useEffect, forwardRef, useContext, cre
8
8
  import { $ as $fc909762b330b746$export$61c6a8c84e605fb6, a as $d3f049242431219c$export$45fda7c47f93fd48, b as $d3f049242431219c$export$6d3443f2c48bfc20 } from "../../OverlayArrow-DokC40S3.js";
9
9
  import { Button } from "../button/button.js";
10
10
  import { _ as __ } from "../../default-i18n-CnQeC5Pl.js";
11
- import { c as clsx } from "../../lite-DVmmD_-j.js";
11
+ import { c as clsx } from "../../clsx-DgYk2OaC.js";
12
12
  import { icons } from "../../icons/icons.js";
13
13
  import "../../react-jsx-parser.min-B_hvYYa1.js";
14
14
  import { HStack } from "../layout/hstack.js";
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import { c as clsx } from "../../lite-DVmmD_-j.js";
2
+ import { c as clsx } from "../../clsx-DgYk2OaC.js";
3
3
  import { icons } from "../../icons/icons.js";
4
4
  /**
5
5
  * A simple notice component.
@@ -13,7 +13,7 @@ import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-BQ
13
13
  import { $ as $de67e98908f0c6ee$export$7f629e9dc1ecf37c, a as $81397a9303501bda$export$23f548e970bdf099 } from "../../useNumberField-D2fUHql3.js";
14
14
  import { ButtonGroup, Button } from "../button/button.js";
15
15
  import { icons } from "../../icons/icons.js";
16
- import { c as clsx } from "../../lite-DVmmD_-j.js";
16
+ import { c as clsx } from "../../clsx-DgYk2OaC.js";
17
17
  import { BaseControl } from "../base-control/base-control.js";
18
18
  import { c as cva } from "../../index-BHpUy2Ix.js";
19
19
  const $b91743d66a0ed188$export$b414a48cf5dcbc11 = /* @__PURE__ */ createContext(null);
@@ -277,7 +277,7 @@ const NumberPicker = ({
277
277
  /* @__PURE__ */ jsx(
278
278
  $3985021b0ad6602f$export$f5b8910cec6cf069,
279
279
  {
280
- className: 'es:tracking-wide es:font-variation-["wdth"_84,"YTLC"_520,"wght"_325,"slnt"_0,"YTFI"_788] es:placeholder-shown:font-variation-["wdth"_100,"YTLC"_500,"wght"_250,"slnt"_-8] es:any-focus:outline-hidden! es:p-px es:border-none! es:shadow-none! es:bg-transparent',
280
+ className: 'es:font-variation-["wdth"_84,"YTLC"_520,"wght"_325,"slnt"_0,"YTFI"_788] es:placeholder-shown:font-variation-["wdth"_100,"YTLC"_500,"wght"_250,"slnt"_-8] es:any-focus:outline-hidden! es:p-px es:border-none! es:shadow-none! es:bg-transparent es:text-13!',
281
281
  placeholder,
282
282
  style: {
283
283
  width: fixedWidth ? `calc(${fixedWidth}ch + 2px)` : `calc(${min < 0 ? "1ch + " : "0.75ch + "}${Math.max((max ?? 1e3)?.toString()?.length, (placeholder ?? "")?.length)} * 1ch)`
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import { c as clsx } from "../../lite-DVmmD_-j.js";
2
+ import { c as clsx } from "../../clsx-DgYk2OaC.js";
3
3
  import { RichLabel } from "../rich-label/rich-label.js";
4
4
  import { $ as $5cb03073d3f54797$export$a8a3e93435678ff9 } from "../../Heading-BmRX4BRL.js";
5
5
  import { cloneElement } from "react";
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { c as clsx } from "../../lite-DVmmD_-j.js";
2
+ import { c as clsx } from "../../clsx-DgYk2OaC.js";
3
3
  import { icons } from "../../icons/icons.js";
4
4
  import "react";
5
5
  import "../../react-jsx-parser.min-B_hvYYa1.js";
@@ -99,29 +99,32 @@ const FilePickerShell = (props) => {
99
99
  errorClassName: "es:aspect-3-2 es:rounded-2xl es:bg-linear-to-br es:from-white es:to-secondary-50 es:border es:border-dashed es:border-secondary-200",
100
100
  imageAnalysisSettings: { yFrom: 0.25, yTo: 0.75 },
101
101
  ...rest,
102
- children: ({ image, dominantColors, isDark, hasAnalysed, isTransparent }) => /* @__PURE__ */ jsxs(
102
+ children: ({ image, dominantColors, isDark, hasAnalysed, isTransparent, hasError, errorBadge }) => /* @__PURE__ */ jsxs(
103
103
  "div",
104
104
  {
105
105
  className: clsx(
106
106
  "es:border es:justify-between es:rounded-2xl es:isolate es:relative es:flex-col es:gap-y-2 es:grid es:grid-cols-1 es:overflow-clip es:aspect-3-2 es:transition",
107
- hasAnalysed ? "es:border-secondary-200" : "es:border-secondary-200/0",
108
- hasAnalysed && !isTransparent && "es:group es:grid-rows-1",
109
- hasAnalysed && isTransparent && "es:p-2 es:grid-rows-[minmax(0,1fr)_auto] es:h-fit",
107
+ !hasError && hasAnalysed ? "es:border-secondary-200" : "es:border-secondary-200/0",
108
+ !hasError && hasAnalysed && !isTransparent && "es:group es:grid-rows-1",
109
+ !hasError && hasAnalysed && isTransparent && "es:p-2 es:grid-rows-[minmax(0,1fr)_auto] es:h-fit",
110
110
  !hasAnalysed && "es:shimmer-dark es:bg-secondary-50",
111
+ hasError && "es:flex es:items-center es:justify-center",
111
112
  className
112
113
  ),
113
- style: hasAnalysed && isTransparent ? { backgroundColor: `color-mix(in srgb, ${dominantColors[0]?.color || "#ffffff"} ${dominantColors[0]?.isDark ? 10 : 80}%, #ffffff)` } : {},
114
+ style: !hasError && hasAnalysed && isTransparent ? { backgroundColor: `color-mix(in srgb, ${dominantColors[0]?.color || "#ffffff"} ${dominantColors[0]?.isDark ? 10 : 80}%, #ffffff)` } : {},
114
115
  children: [
115
116
  image,
116
- hasAnalysed && children && /* @__PURE__ */ jsx(
117
+ hasError && errorBadge,
118
+ children && /* @__PURE__ */ jsx(
117
119
  "div",
118
120
  {
119
121
  className: clsx(
120
122
  "es:flex es:items-center-safe es:gap-0.75",
121
123
  "es-button-group-h",
122
- !isTransparent && "es:absolute es:bottom-2 es:left-2 es:right-2 es:translate-y-[125%] es:group-hover:translate-y-0 es:has-aria-expanded:translate-y-0 es:has-focus-visible:translate-y-0 es:transition-transform es:ease-spring-smooth"
124
+ !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",
125
+ hasError && "es:absolute es:bottom-2 es:left-2 es:right-2"
123
126
  ),
124
- children: typeof children === "function" ? children({ dominantColors, isDark, isTransparent }) : children
127
+ children: typeof children === "function" ? children({ dominantColors, isDark, isTransparent, hasError }) : children
125
128
  }
126
129
  )
127
130
  ]
@@ -38,8 +38,7 @@ const FilePlaceholder = (props) => {
38
38
  "es:inset-ring es:inset-ring-surface-300/40",
39
39
  "es:inset-shadow-xs es:inset-shadow-surface-50/50",
40
40
  "es:text-surface-800",
41
- !flat && "es:shadow-xs es:shadow-black/5",
42
- "es:cursor-pointer"
41
+ !flat && "es:shadow-xs es:shadow-black/5"
43
42
  ],
44
43
  !fileName && "es:bg-secondary-100 es:text-secondary-500"
45
44
  ),
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { $ as $07b14b47974efb58$export$5b6b19405a83ff9d, g as $de32f1b87079253c$export$3ddf2d174ce01153, h as $de32f1b87079253c$export$2e1e1122cf0cba88 } from "../../Dialog-D8bjn-nh.js";
3
- import { c as clsx } from "../../lite-DVmmD_-j.js";
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";
6
6
  /**
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-D8a3eYb-.js";
3
3
  import { a as $b6c3ddc6086f204d$export$d7b12c4107be0d61, $ as $b6c3ddc6086f204d$export$a98f0dcb43a68a25 } from "../../RadioGroup-BVFvITWO.js";
4
- import { c as clsx } from "../../lite-DVmmD_-j.js";
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";
7
7
  import { BaseControl } from "../base-control/base-control.js";
@@ -118,12 +118,12 @@ const RadioButton = (props) => {
118
118
  compoundVariants: [
119
119
  {
120
120
  design: ["segmented", "segmentedHorizontal"],
121
- class: ["es:px-3 es:py-2 es:w-fill es:inset-ring", "es:transition-plus es:duration-300 es:ease-spring-snappy", !flat && "es:shadow-xs es:shadow-black/5"]
121
+ class: ["es:px-3 es:py-2 es:w-fill es:inset-ring es:min-h-13", "es:transition-plus es:duration-300", !flat && "es:shadow-xs es:shadow-black/5"]
122
122
  },
123
123
  {
124
124
  checked: false,
125
125
  design: ["segmented", "segmentedHorizontal"],
126
- class: "es:bg-secondary-50 es:inset-ring-secondary-200/50 es:rounded-md es:hover:rounded-xl"
126
+ class: ["es:bg-white es:bg-linear-to-b es:from-secondary-50/75 es:to-secondary-100/50 es:from-25% es:inset-ring-secondary-200/50", "es:rounded-md es:hover:rounded-18"]
127
127
  },
128
128
  {
129
129
  checked: true,
@@ -131,8 +131,8 @@ const RadioButton = (props) => {
131
131
  class: "es:bg-surface-100 es:text-accent-900 es:inset-ring-accent-600/10 es:rounded-3xl"
132
132
  },
133
133
  //
134
- { design: "segmented", checked: false, class: "es:first:rounded-t-xl es:last:rounded-b-xl es:before-current:rounded-b-xl es:after-current:rounded-t-xl" },
135
- { design: "segmentedHorizontal", checked: false, class: "es:first:rounded-l-xl es:last:rounded-r-xl es:before-current:rounded-l-xl es:after-current:rounded-r-xl" }
134
+ { design: "segmented", checked: false, class: "es:first:rounded-t-2xl es:last:rounded-b-2xl es:before-current:rounded-b-2xl es:after-current:rounded-t-2xl" },
135
+ { design: "segmentedHorizontal", checked: false, class: "es:first:rounded-l-2xl es:last:rounded-r-2xl es:before-current:rounded-r-2xl es:after-current:rounded-l-2xl" }
136
136
  ],
137
137
  defaultVariants: {
138
138
  design: "default",
@@ -2,7 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Button } from "../button/button.js";
3
3
  import { Menu, MenuSeparator, MenuItem } from "../menu/menu.js";
4
4
  import { icons } from "../../icons/icons.js";
5
- import { c as clsx } from "../../lite-DVmmD_-j.js";
5
+ import { c as clsx } from "../../clsx-DgYk2OaC.js";
6
6
  import { useContext } from "react";
7
7
  import { Expandable } from "../expandable/expandable.js";
8
8
  import { _ as __ } from "../../default-i18n-CnQeC5Pl.js";
@@ -6,7 +6,7 @@ import { icons } from "../../icons/icons.js";
6
6
  import { BaseControl } from "../base-control/base-control.js";
7
7
  import { AnimatedVisibility } from "../animated-visibility/animated-visibility.js";
8
8
  import { RepeaterContext } from "./repeater-context.js";
9
- import { c as clsx } from "../../lite-DVmmD_-j.js";
9
+ import { c as clsx } from "../../clsx-DgYk2OaC.js";
10
10
  import { L as List, a as arrayRemove, b as arrayMove } from "../../List-BGHOoFf0.js";
11
11
  import { Menu, MenuItem, MenuSeparator } from "../menu/menu.js";
12
12
  /**
@@ -215,7 +215,7 @@ const Repeater = (props) => {
215
215
  allOpen,
216
216
  setAllOpen,
217
217
  setOpenItems,
218
- isItemOpen: openItems[item.id] ?? allOpen,
218
+ isItemOpen: openItems?.[item?.id] ?? allOpen,
219
219
  noDuplicateButton
220
220
  },
221
221
  children: children({
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import { cloneElement } from "react";
3
3
  import { DecorativeTooltip } from "../tooltip/tooltip.js";
4
- import { c as clsx } from "../../lite-DVmmD_-j.js";
4
+ import { c as clsx } from "../../clsx-DgYk2OaC.js";
5
5
  import { s as sprintf } from "../../sprintf-DmNrJSYG.js";
6
6
  import { _ as __ } from "../../default-i18n-CnQeC5Pl.js";
7
7
  import { BreakpointPreview } from "../breakpoint-preview/breakpoint-preview.js";
@@ -1,7 +1,7 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
2
  import { useState } from "react";
3
3
  import { DecorativeTooltip } from "../tooltip/tooltip.js";
4
- import { c as clsx } from "../../lite-DVmmD_-j.js";
4
+ import { c as clsx } from "../../clsx-DgYk2OaC.js";
5
5
  import { s as sprintf } from "../../sprintf-DmNrJSYG.js";
6
6
  import { _ as __ } from "../../default-i18n-CnQeC5Pl.js";
7
7
  import { BreakpointPreview } from "../breakpoint-preview/breakpoint-preview.js";
@@ -1,7 +1,7 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
2
  import { useState } from "react";
3
3
  import { DecorativeTooltip } from "../tooltip/tooltip.js";
4
- import { c as clsx } from "../../lite-DVmmD_-j.js";
4
+ import { c as clsx } from "../../clsx-DgYk2OaC.js";
5
5
  import { s as sprintf } from "../../sprintf-DmNrJSYG.js";
6
6
  import { _ as __ } from "../../default-i18n-CnQeC5Pl.js";
7
7
  import { BreakpointPreview } from "../breakpoint-preview/breakpoint-preview.js";
@@ -1,5 +1,5 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import { c as clsx } from "../../lite-DVmmD_-j.js";
2
+ import { c as clsx } from "../../clsx-DgYk2OaC.js";
3
3
  /**
4
4
  * Component that displays a label, with an optional icon and subtitle.
5
5
  *
@@ -8,18 +8,19 @@ import { $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-CNNk
8
8
  import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-D8a3eYb-.js";
9
9
  import { $ as $eed445e0843c11d0$export$41f133550aa26f48 } from "../../ListBox-Dd37zMvs.js";
10
10
  import { $ as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../Dialog-D8bjn-nh.js";
11
- import { $ as $82d7e5349645de74$export$ef9b1a59e592288f, a as $82d7e5349645de74$export$e288731fd71264f0, S as SelectClearButton, O as OptionItemBase } from "../../shared-DwjRce5e.js";
11
+ import { $ as $82d7e5349645de74$export$ef9b1a59e592288f, a as $82d7e5349645de74$export$e288731fd71264f0, S as SelectClearButton, O as OptionItemBase } from "../../shared-DOxXagm0.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";
15
15
  import { Spinner } from "../../icons/spinner.js";
16
16
  import { RichLabel } from "../rich-label/rich-label.js";
17
17
  import { unescapeHTML } from "../../utilities/text-helpers.js";
18
+ import { randomId } from "../../utilities/hash.js";
19
+ import { c as clsx } from "../../clsx-DgYk2OaC.js";
18
20
  import { c as cva } from "../../index-BHpUy2Ix.js";
19
21
  import { TriggeredPopover } from "../popover/popover.js";
20
22
  import { DraggableList } from "../draggable-list/draggable-list.js";
21
23
  import { DraggableListItem } from "../draggable-list/draggable-list-item.js";
22
- import { c as clsx } from "../../clsx-DgYk2OaC.js";
23
24
  import { $ as $f86e6c1ec7da6ebb$export$bc3384a35de93d66 } from "../../useAsyncList-D52mQcrH.js";
24
25
  /**
25
26
  * Async multi-select menu.
@@ -180,6 +181,19 @@ const AsyncMultiSelect = (props) => {
180
181
  };
181
182
  const ref = useRef();
182
183
  const currentValueKeys = value?.map((item) => item?.value ?? item);
184
+ const buttonClass = cva("es:any-focus:outline-hidden es:text-start es:size-full es:inline-block es:group es:overflow-x-clip", {
185
+ variants: {
186
+ size: {
187
+ small: ["es:min-h-8", "es:px-2.5"],
188
+ medium: ["es:min-h-9", "es:px-3"],
189
+ default: ["es:min-h-10", "es:px-3"],
190
+ large: ["es:min-h-12", "es:px-4"]
191
+ }
192
+ },
193
+ defaultVariants: {
194
+ size: "default"
195
+ }
196
+ });
183
197
  const selectClass = cva(
184
198
  [
185
199
  "es:relative",
@@ -199,12 +213,6 @@ const AsyncMultiSelect = (props) => {
199
213
  ],
200
214
  {
201
215
  variants: {
202
- size: {
203
- small: ["es:min-h-8", "es:px-2.5"],
204
- medium: ["es:min-h-9", "es:px-3"],
205
- default: ["es:min-h-10", "es:px-3"],
206
- large: ["es:min-h-12", "es:px-4"]
207
- },
208
216
  disabled: {
209
217
  false: "es:selection:bg-surface-100 es:selection:text-accent-800",
210
218
  true: "es:selection:bg-secondary-200 es:selection:text-secondary-600"
@@ -273,7 +281,7 @@ const AsyncMultiSelect = (props) => {
273
281
  className: selectClass({ disabled, flat, size }),
274
282
  ref,
275
283
  children: [
276
- /* @__PURE__ */ jsxs($d2b4bc8c273e7be6$export$353f5b6fc5456de1, { className: "es:any-focus:outline-hidden es:text-start es:size-full es:inline-block es:group es:overflow-x-clip", children: [
284
+ /* @__PURE__ */ jsxs($d2b4bc8c273e7be6$export$353f5b6fc5456de1, { className: buttonClass({ size }), children: [
277
285
  /* @__PURE__ */ jsx($82d7e5349645de74$export$e288731fd71264f0, { className: "es:select-none es:pointer-events-none", children: ({ isPlaceholder, selectedItems }) => {
278
286
  const [selectedItem] = selectedItems;
279
287
  if (!currentValueKeys?.length || isPlaceholder) {
@@ -432,9 +440,9 @@ const AsyncMultiSelect = (props) => {
432
440
  {
433
441
  placeholder: __("Search...", "eightshift-ui-components"),
434
442
  className: clsx(
435
- "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",
436
- "es:bg-accent-900/8 es:m-1.5 es:rounded-3xl es:border-none",
437
- "es:inset-ring es:inset-ring-accent-950/7 es:focus:inset-ring-accent-950/20",
443
+ "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",
444
+ "es:bg-accent-900/8 es:m-1.5 es:rounded-3xl es:border-none!",
445
+ "es:inset-ring! es:inset-ring-accent-950/7 es:focus:inset-ring-accent-950/20",
438
446
  "es:text-accent-950 es:placeholder:text-accent-700/50",
439
447
  "es:transition"
440
448
  )
@@ -446,7 +454,7 @@ const AsyncMultiSelect = (props) => {
446
454
  "aria-label": __("Clear", "eightshift-ui-components"),
447
455
  className: clsx(
448
456
  "es:absolute es:right-3 es:top-0 es:bottom-0 es:my-auto es:border-none es:bg-transparent",
449
- "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 es:cursor-pointer",
457
+ "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",
450
458
  "es:peer-placeholder-shown:opacity-0"
451
459
  ),
452
460
  children: icons.clearAlt
@@ -487,7 +495,7 @@ const AsyncMultiSelect = (props) => {
487
495
  return /* @__PURE__ */ jsxs(
488
496
  OptionItemBase,
489
497
  {
490
- id: item?.value,
498
+ id: item?.value ?? randomId(8),
491
499
  className: item?.className,
492
500
  selectIndicator: true,
493
501
  children: [
@@ -7,15 +7,16 @@ import { $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-CNNk
7
7
  import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-D8a3eYb-.js";
8
8
  import { $ as $eed445e0843c11d0$export$41f133550aa26f48 } from "../../ListBox-Dd37zMvs.js";
9
9
  import { $ as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../Dialog-D8bjn-nh.js";
10
- import { $ as $82d7e5349645de74$export$ef9b1a59e592288f, a as $82d7e5349645de74$export$e288731fd71264f0, S as SelectClearButton, O as OptionItemBase } from "../../shared-DwjRce5e.js";
10
+ import { $ as $82d7e5349645de74$export$ef9b1a59e592288f, a as $82d7e5349645de74$export$e288731fd71264f0, S as SelectClearButton, O as OptionItemBase } from "../../shared-DOxXagm0.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";
14
14
  import { Spinner } from "../../icons/spinner.js";
15
15
  import { RichLabel } from "../rich-label/rich-label.js";
16
16
  import { unescapeHTML } from "../../utilities/text-helpers.js";
17
- import { c as cva } from "../../index-BHpUy2Ix.js";
17
+ import { randomId } from "../../utilities/hash.js";
18
18
  import { c as clsx } from "../../clsx-DgYk2OaC.js";
19
+ import { c as cva } from "../../index-BHpUy2Ix.js";
19
20
  import { $ as $f86e6c1ec7da6ebb$export$bc3384a35de93d66 } from "../../useAsyncList-D52mQcrH.js";
20
21
  /**
21
22
  * Select menu with async loading.
@@ -147,6 +148,19 @@ const AsyncSelect = (props) => {
147
148
  if (hidden) {
148
149
  return null;
149
150
  }
151
+ const buttonClass = cva("es:any-focus:outline-hidden es:text-start es:size-full es:inline-block es:group es:overflow-x-clip", {
152
+ variants: {
153
+ size: {
154
+ small: ["es:min-h-8", "es:px-2.5"],
155
+ medium: ["es:min-h-9", "es:px-3"],
156
+ default: ["es:min-h-10", "es:px-3"],
157
+ large: ["es:min-h-12", "es:px-4"]
158
+ }
159
+ },
160
+ defaultVariants: {
161
+ size: "default"
162
+ }
163
+ });
150
164
  const selectClass = cva(
151
165
  [
152
166
  "es:relative",
@@ -166,12 +180,6 @@ const AsyncSelect = (props) => {
166
180
  ],
167
181
  {
168
182
  variants: {
169
- size: {
170
- small: ["es:min-h-8", "es:px-2.5"],
171
- medium: ["es:min-h-9", "es:px-3"],
172
- default: ["es:min-h-10", "es:px-3"],
173
- large: ["es:min-h-12", "es:px-4"]
174
- },
175
183
  disabled: {
176
184
  false: "es:selection:bg-surface-100 es:selection:text-accent-800",
177
185
  true: "es:selection:bg-secondary-200 es:selection:text-secondary-600"
@@ -257,7 +265,7 @@ const AsyncSelect = (props) => {
257
265
  className: selectClass({ disabled, flat, size }),
258
266
  ref,
259
267
  children: [
260
- /* @__PURE__ */ jsxs($d2b4bc8c273e7be6$export$353f5b6fc5456de1, { className: "es:any-focus:outline-hidden es:text-start es:size-full es:inline-block es:group es:overflow-x-clip", children: [
268
+ /* @__PURE__ */ jsxs($d2b4bc8c273e7be6$export$353f5b6fc5456de1, { className: buttonClass({ size }), children: [
261
269
  /* @__PURE__ */ jsx($82d7e5349645de74$export$e288731fd71264f0, { children: ({ isPlaceholder, selectedItems }) => {
262
270
  const [selectedItem] = selectedItems;
263
271
  if (!isPlaceholder && selectedItem && customValueDisplay) {
@@ -354,9 +362,9 @@ const AsyncSelect = (props) => {
354
362
  {
355
363
  placeholder: __("Search...", "eightshift-ui-components"),
356
364
  className: clsx(
357
- "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",
358
- "es:bg-accent-900/8 es:m-1.5 es:rounded-3xl es:border-none",
359
- "es:inset-ring es:inset-ring-accent-950/7 es:focus:inset-ring-accent-950/20",
365
+ "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",
366
+ "es:bg-accent-900/8 es:m-1.5 es:rounded-3xl es:border-none!",
367
+ "es:inset-ring! es:inset-ring-accent-950/7 es:focus:inset-ring-accent-950/20",
360
368
  "es:text-accent-950 es:placeholder:text-accent-700/50",
361
369
  "es:transition"
362
370
  )
@@ -368,7 +376,7 @@ const AsyncSelect = (props) => {
368
376
  "aria-label": __("Clear", "eightshift-ui-components"),
369
377
  className: clsx(
370
378
  "es:absolute es:right-3 es:top-0 es:bottom-0 es:my-auto es:border-none es:bg-transparent",
371
- "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 es:cursor-pointer",
379
+ "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",
372
380
  "es:peer-placeholder-shown:opacity-0"
373
381
  ),
374
382
  children: icons.clearAlt
@@ -407,7 +415,7 @@ const AsyncSelect = (props) => {
407
415
  return /* @__PURE__ */ jsxs(
408
416
  OptionItemBase,
409
417
  {
410
- id: item?.value,
418
+ id: item?.value ?? randomId(8),
411
419
  className: item?.className,
412
420
  selectIndicator: true,
413
421
  children: [
@@ -8,16 +8,17 @@ import { $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-CNNk
8
8
  import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-D8a3eYb-.js";
9
9
  import { $ as $eed445e0843c11d0$export$41f133550aa26f48 } from "../../ListBox-Dd37zMvs.js";
10
10
  import { $ as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../Dialog-D8bjn-nh.js";
11
- import { g as getValue, $ as $82d7e5349645de74$export$ef9b1a59e592288f, a as $82d7e5349645de74$export$e288731fd71264f0, S as SelectClearButton, O as OptionItemBase } from "../../shared-DwjRce5e.js";
11
+ import { g as getValue, $ as $82d7e5349645de74$export$ef9b1a59e592288f, a as $82d7e5349645de74$export$e288731fd71264f0, S as SelectClearButton, O as OptionItemBase } from "../../shared-DOxXagm0.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";
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 { TriggeredPopover } from "../popover/popover.js";
18
19
  import { DraggableList } from "../draggable-list/draggable-list.js";
19
20
  import { DraggableListItem } from "../draggable-list/draggable-list-item.js";
20
- import { c as clsx } from "../../clsx-DgYk2OaC.js";
21
+ import { randomId } from "../../utilities/hash.js";
21
22
  import { $ as $bb77f239b46e8c72$export$3274cf84b703fff } from "../../useFilter-bhxeEDg8.js";
22
23
  /**
23
24
  * Multi-select menu.
@@ -138,6 +139,19 @@ const MultiSelect = (props) => {
138
139
  if (hidden) {
139
140
  return null;
140
141
  }
142
+ const buttonClass = cva("es:any-focus:outline-hidden es:text-start es:size-full es:inline-block es:group es:overflow-x-clip", {
143
+ variants: {
144
+ size: {
145
+ small: ["es:min-h-8", "es:px-2.5"],
146
+ medium: ["es:min-h-9", "es:px-3"],
147
+ default: ["es:min-h-10", "es:px-3"],
148
+ large: ["es:min-h-12", "es:px-4"]
149
+ }
150
+ },
151
+ defaultVariants: {
152
+ size: "default"
153
+ }
154
+ });
141
155
  const selectClass = cva(
142
156
  [
143
157
  "es:relative",
@@ -157,12 +171,6 @@ const MultiSelect = (props) => {
157
171
  ],
158
172
  {
159
173
  variants: {
160
- size: {
161
- small: ["es:min-h-8", "es:px-2.5"],
162
- medium: ["es:min-h-9", "es:px-3"],
163
- default: ["es:min-h-10", "es:px-3"],
164
- large: ["es:min-h-12", "es:px-4"]
165
- },
166
174
  disabled: {
167
175
  false: "es:selection:bg-surface-100 es:selection:text-accent-800",
168
176
  true: "es:selection:bg-secondary-200 es:selection:text-secondary-600"
@@ -228,7 +236,7 @@ const MultiSelect = (props) => {
228
236
  className: selectClass({ disabled, flat, size }),
229
237
  ref,
230
238
  children: [
231
- /* @__PURE__ */ jsxs($d2b4bc8c273e7be6$export$353f5b6fc5456de1, { className: "es:any-focus:outline-hidden es:text-start es:size-full es:inline-block es:group es:overflow-x-clip", children: [
239
+ /* @__PURE__ */ jsxs($d2b4bc8c273e7be6$export$353f5b6fc5456de1, { className: buttonClass({ size }), children: [
232
240
  /* @__PURE__ */ jsx($82d7e5349645de74$export$e288731fd71264f0, { className: "es:select-none es:pointer-events-none", children: ({ isPlaceholder, selectedItems }) => {
233
241
  const [selectedItem] = selectedItems;
234
242
  if (!currentValueKeys?.length || isPlaceholder) {
@@ -380,9 +388,9 @@ const MultiSelect = (props) => {
380
388
  {
381
389
  placeholder: __("Search...", "eightshift-ui-components"),
382
390
  className: clsx(
383
- "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",
384
- "es:bg-accent-900/8 es:m-1.5 es:rounded-3xl es:border-none",
385
- "es:inset-ring es:inset-ring-accent-950/7 es:focus:inset-ring-accent-950/20",
391
+ "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",
392
+ "es:bg-accent-900/8 es:m-1.5 es:rounded-3xl es:border-none!",
393
+ "es:inset-ring! es:inset-ring-accent-950/7 es:focus:inset-ring-accent-950/20",
386
394
  "es:text-accent-950 es:placeholder:text-accent-700/50",
387
395
  "es:transition"
388
396
  )
@@ -394,7 +402,7 @@ const MultiSelect = (props) => {
394
402
  "aria-label": __("Clear", "eightshift-ui-components"),
395
403
  className: clsx(
396
404
  "es:absolute es:right-3 es:top-0 es:bottom-0 es:my-auto es:border-none es:bg-transparent",
397
- "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 es:cursor-pointer",
405
+ "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",
398
406
  "es:peer-placeholder-shown:opacity-0"
399
407
  ),
400
408
  children: icons.clearAlt
@@ -427,7 +435,7 @@ const MultiSelect = (props) => {
427
435
  return /* @__PURE__ */ jsxs(
428
436
  OptionItemBase,
429
437
  {
430
- id: item.value,
438
+ id: item?.value ?? randomId(8),
431
439
  className: item?.className,
432
440
  selectIndicator: true,
433
441
  children: [
@@ -472,7 +480,7 @@ const MultiSelect = (props) => {
472
480
  return /* @__PURE__ */ jsxs(
473
481
  OptionItemBase,
474
482
  {
475
- id: item.value,
483
+ id: item?.value ?? randomId(8),
476
484
  className: item?.className,
477
485
  selectIndicator: true,
478
486
  children: [
@@ -2,12 +2,12 @@ import "react/jsx-runtime";
2
2
  import "../../default-i18n-CnQeC5Pl.js";
3
3
  import "../../Button-BXjXzdW_.js";
4
4
  import "../../ListBox-Dd37zMvs.js";
5
- import { O, S, g, m } from "../../shared-DwjRce5e.js";
5
+ import { O, S, g, m } from "../../shared-DOxXagm0.js";
6
6
  import "../../icons/icons.js";
7
7
  import "react";
8
8
  import "../../react-jsx-parser.min-B_hvYYa1.js";
9
- import "../animated-visibility/animated-visibility.js";
10
9
  import "../../clsx-DgYk2OaC.js";
10
+ import "../animated-visibility/animated-visibility.js";
11
11
  export {
12
12
  O as OptionItemBase,
13
13
  S as SelectClearButton,