@stackone/malachite 2.47.2 → 2.48.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.
@@ -1,5 +1,5 @@
1
- import { jsx as e, jsxs as x, Fragment as bt } from "react/jsx-runtime";
2
- import Dt, { useState as F, useRef as g, useEffect as Pt, useCallback as Mt, useLayoutEffect as oe, useInsertionEffect as le, useId as se } from "react";
1
+ import { jsx as e, jsxs as v, Fragment as yt } from "react/jsx-runtime";
2
+ import Dt, { useState as F, useRef as m, useEffect as Ft, useCallback as Mt, useLayoutEffect as oe, useInsertionEffect as le, useId as se } from "react";
3
3
  import { createPortal as ce } from "react-dom";
4
4
  import de, { useFormFieldIds as ue } from "./BaseFormComponent.js";
5
5
  import Zt from "./CustomIcons/CaretDownIcon.js";
@@ -11,26 +11,26 @@ import { Tag as he } from "./Tag.js";
11
11
  import $t from "./Tooltip.js";
12
12
  import ge from "./Typography/MarkdownBlock.js";
13
13
  import { inlineMarkdownText as xe } from "./Typography/inlineMarkdown.js";
14
- import { getDeepActiveElement as _t } from "./activeElement.js";
15
- import { CONTROL_TEXT_SIZE_CLASS as nt, CONTROL_TEXT_SIZE as me } from "./controlTextSize.js";
14
+ import { getDeepActiveElement as Rt } from "./activeElement.js";
15
+ import { CONTROL_TEXT_SIZE_CLASS as it, CONTROL_TEXT_SIZE as me } from "./controlTextSize.js";
16
16
  import { controlWidthStyle as Ut } from "./controlWidth.js";
17
17
  import { getTriggerVisual as ve, DROPDOWN_TRIGGER_ATTR as Vt } from "./dropdownTriggerStyle.js";
18
18
  import { pushEscapeLayer as be } from "./escapeLayers.js";
19
- import { measureMenuGeometry as ye, isTriggerOffscreen as we, rectSignature as Se, MENU_MAX_HEIGHT_PX as Te, MENU_SPECS as gt } from "./floatingMenuGeometry.js";
19
+ import { measureMenuGeometry as ye, isTriggerOffscreen as we, rectSignature as Se, MENU_MAX_HEIGHT_PX as Te, MENU_SPECS as xt } from "./floatingMenuGeometry.js";
20
20
  import { FOCUS_RING as Ee } from "./focusRing.js";
21
- import { hasBadge as Lt } from "./hasBadge.js";
21
+ import { hasBadge as _t } from "./hasBadge.js";
22
22
  import { ensureDropdownPanelStyles as Ne } from "./optionRowStyles.js";
23
23
  import { usePopupLayer as Ce } from "./overlayLayers.js";
24
24
  import { useTopLayer as ke } from "./topLayer.js";
25
- import { tooltipLines as It, isCut as xt } from "./truncatedLines.js";
26
- const Re = Dt.lazy(() => import("./ActionMenuTagHost.js")), Xt = ({ id: t, text: a, disabled: r }) => /* @__PURE__ */ e(
25
+ import { tooltipLines as It, isCut as mt } from "./truncatedLines.js";
26
+ const Le = Dt.lazy(() => import("./ActionMenuTagHost.js")), Xt = ({ id: t, text: a, disabled: r }) => /* @__PURE__ */ e(
27
27
  "span",
28
28
  {
29
29
  id: t,
30
30
  className: `flex min-w-0 max-w-[40%] [flex-shrink:3] ${r ? "opacity-60" : ""}`,
31
31
  children: /* @__PURE__ */ e(he, { value: a, paddingSize: "compact", fontSize: "xsmall", textTransform: "none" })
32
32
  }
33
- ), te = /[*`[<&\\]/, mt = ({ text: t }) => te.test(t) ? /* @__PURE__ */ e(
33
+ ), te = /[*`[<&\\]/, vt = ({ text: t }) => te.test(t) ? /* @__PURE__ */ e(
34
34
  ge,
35
35
  {
36
36
  text: t,
@@ -47,21 +47,21 @@ const Re = Dt.lazy(() => import("./ActionMenuTagHost.js")), Xt = ({ id: t, text:
47
47
  gap: 8,
48
48
  padding: "24px 16px",
49
49
  color: "var(--malachite-text-dimmed, rgb(161, 161, 161))"
50
- }, Ft = "var(--malachite-font-size-xsmall, 11px)", _e = "[data-dropdown-option]", Wt = (t) => Array.from((t == null ? void 0 : t.querySelectorAll(_e)) ?? []), Le = (t) => te.test(t) ? xe(t) : t.replace(/\s+/g, " "), $e = (t, a) => {
51
- const r = a.toLowerCase(), u = t.label.toLowerCase().includes(r), d = t.subtitle ? Le(t.subtitle).toLowerCase().includes(r) : !1, S = t.rightSideText ? t.rightSideText.toLowerCase().includes(r) : !1;
50
+ }, Pt = "var(--malachite-font-size-xsmall, 11px)", Re = "[data-dropdown-option]", Wt = (t) => Array.from((t == null ? void 0 : t.querySelectorAll(Re)) ?? []), _e = (t) => te.test(t) ? xe(t) : t.replace(/\s+/g, " "), $e = (t, a) => {
51
+ const r = a.toLowerCase(), u = t.label.toLowerCase().includes(r), d = t.subtitle ? _e(t.subtitle).toLowerCase().includes(r) : !1, S = t.rightSideText ? t.rightSideText.toLowerCase().includes(r) : !1;
52
52
  return u || d || S;
53
- }, vt = {
53
+ }, bt = {
54
54
  small: "h-[var(--malachite-control-height-small,28px)]",
55
55
  medium: "h-[var(--malachite-control-height-medium,32px)]",
56
56
  large: "h-[var(--malachite-control-height-large,42px)]"
57
57
  }, De = {
58
- small: `${vt.small} px-2.5 py-1.5 ${nt.small}`,
59
- medium: `${vt.medium} px-3 py-1.5 ${nt.medium}`,
60
- large: `${vt.large} px-4 py-2.5 ${nt.large}`
58
+ small: `${bt.small} px-2.5 py-1.5 ${it.small}`,
59
+ medium: `${bt.medium} px-3 py-1.5 ${it.medium}`,
60
+ large: `${bt.large} px-4 py-2.5 ${it.large}`
61
61
  }, Oe = {
62
- small: `min-h-[var(--malachite-control-height-small,28px)] px-2.5 py-1.5 ${nt.small}`,
63
- medium: `min-h-[var(--malachite-control-height-medium,32px)] px-3 py-1.5 ${nt.medium}`,
64
- large: `min-h-[var(--malachite-control-height-large,42px)] px-4 py-2.5 ${nt.large}`
62
+ small: `min-h-[var(--malachite-control-height-small,28px)] px-2.5 py-1.5 ${it.small}`,
63
+ medium: `min-h-[var(--malachite-control-height-medium,32px)] px-3 py-1.5 ${it.medium}`,
64
+ large: `min-h-[var(--malachite-control-height-large,42px)] px-4 py-2.5 ${it.large}`
65
65
  }, ze = {
66
66
  small: "right-[26px] size-4",
67
67
  medium: "right-[30px] size-4",
@@ -74,11 +74,11 @@ const Re = Dt.lazy(() => import("./ActionMenuTagHost.js")), Xt = ({ id: t, text:
74
74
  small: "rounded-[var(--malachite-radius-10,10px)]",
75
75
  medium: "rounded-xl",
76
76
  large: "rounded-[var(--malachite-radius-xxl,14px)]"
77
- }, Qt = () => !1, Fe = ({
77
+ }, Qt = () => !1, Pe = ({
78
78
  wrap: t,
79
79
  id: a,
80
80
  children: r
81
- }) => t ? /* @__PURE__ */ e("span", { id: a, className: "min-w-0 flex items-center gap-2", children: r }) : /* @__PURE__ */ e(bt, { children: r }), Pe = ({ row: t, children: a }) => t ? /* @__PURE__ */ e("span", { style: { display: "flex", alignItems: "center", gap: 8, minWidth: 0 }, children: a }) : /* @__PURE__ */ e(bt, { children: a }), ee = Dt.forwardRef(
81
+ }) => t ? /* @__PURE__ */ e("span", { id: a, className: "min-w-0 flex items-center gap-2", children: r }) : /* @__PURE__ */ e(yt, { children: r }), Fe = ({ row: t, children: a }) => t ? /* @__PURE__ */ e("span", { style: { display: "flex", alignItems: "center", gap: 8, minWidth: 0 }, children: a }) : /* @__PURE__ */ e(yt, { children: a }), ee = Dt.forwardRef(
82
82
  ({
83
83
  isOpen: t,
84
84
  onClick: a,
@@ -86,55 +86,55 @@ const Re = Dt.lazy(() => import("./ActionMenuTagHost.js")), Xt = ({ id: t, text:
86
86
  disabled: u = !1,
87
87
  error: d = !1,
88
88
  tone: S,
89
- placeholder: N,
89
+ placeholder: k,
90
90
  search: p = !1,
91
91
  showSubtitleInTrigger: T = !1,
92
- searchQuery: L = "",
93
- onSearchChange: C,
94
- onFocusOpen: k,
95
- onArrowDown: y,
92
+ searchQuery: $ = "",
93
+ onSearchChange: L,
94
+ onFocusOpen: E,
95
+ onArrowDown: w,
96
96
  onTabAway: R,
97
- size: E = "large",
98
- hasClear: m = !1,
99
- onClear: P,
97
+ size: N = "large",
98
+ hasClear: h = !1,
99
+ onClear: D,
100
100
  clearLabel: W,
101
101
  controlId: i,
102
102
  labelId: c,
103
103
  describedBy: o,
104
- required: f = !1,
105
- ariaLabel: w,
106
- ariaLabelledBy: yt,
107
- hasCallerId: $ = !1
104
+ required: g = !1,
105
+ ariaLabel: x,
106
+ ariaLabelledBy: G,
107
+ hasCallerId: C = !1
108
108
  }, wt) => {
109
- const D = T && !p && !!(r != null && r.subtitle), it = D ? Oe[E] : De[E], at = Me[E], G = `${i}-value`, St = `${i}-subtitle`, O = `${i}-tag`, ot = !p || u, j = ot && !!(r != null && r.triggerTag), lt = !ot && !t && !!(r != null && r.triggerTag), st = j ? `${G} ${O}` : G, ct = !c && !w && !$ && (D || j), v = yt ?? (c && !w ? `${c} ${st}` : void 0) ?? (ct ? st : void 0), _ = j && !(v != null && v.split(" ").includes(O)), Tt = (l) => {
109
+ const O = T && !p && !!(r != null && r.subtitle), at = O ? Oe[N] : De[N], ot = Me[N], j = `${i}-value`, St = `${i}-subtitle`, z = `${i}-tag`, lt = !p || u, H = lt && !!(r != null && r.triggerTag), st = !lt && !t && !!(r != null && r.triggerTag), ct = H ? `${j} ${z}` : j, dt = !c && !x && !C && (O || H), b = G ?? (c && !x ? `${c} ${ct}` : void 0) ?? (dt ? ct : void 0), _ = H && !(b != null && b.split(" ").includes(z)), Tt = (l) => {
110
110
  if (l.key === "Tab") {
111
111
  R == null || R();
112
112
  return;
113
113
  }
114
- l.key === "ArrowDown" && (l.preventDefault(), y == null || y());
115
- }, H = g(null), J = g(null), z = ve({ disabled: u, error: d, tone: S, open: t }), dt = !t && !!r, K = (r == null ? void 0 : r.triggerLabel) ?? (r == null ? void 0 : r.label), b = D ? r == null ? void 0 : r.subtitle : void 0, I = () => xt(H.current), [tt, A] = F({ value: !1, subtitle: !0 }), Ot = () => {
116
- const l = I(), et = xt(J.current);
117
- return !l && !et ? !1 : (A({ value: l, subtitle: et }), !0);
114
+ l.key === "ArrowDown" && (l.preventDefault(), w == null || w());
115
+ }, K = m(null), I = m(null), A = ve({ disabled: u, error: d, tone: S, open: t }), ut = !t && !!r, B = (r == null ? void 0 : r.triggerLabel) ?? (r == null ? void 0 : r.label), y = O ? r == null ? void 0 : r.subtitle : void 0, tt = () => mt(K.current), [et, M] = F({ value: !1, subtitle: !0 }), Ot = () => {
116
+ const l = tt(), rt = mt(I.current);
117
+ return !l && !rt ? !1 : (M({ value: l, subtitle: rt }), !0);
118
118
  };
119
119
  if (p && !u)
120
- return /* @__PURE__ */ x(
120
+ return /* @__PURE__ */ v(
121
121
  "div",
122
122
  {
123
123
  ref: wt,
124
124
  className: `
125
- relative w-full ${it} ${at}
125
+ relative w-full ${at} ${ot}
126
126
  border border-solid
127
127
  transition-all duration-200
128
128
  flex items-center
129
129
  `,
130
- style: z,
130
+ style: A,
131
131
  [Vt]: "",
132
132
  "data-open": t || void 0,
133
133
  onClick: (l) => l.stopPropagation(),
134
134
  children: [
135
135
  (r == null ? void 0 : r.icon) && /* @__PURE__ */ e("span", { className: "flex shrink-0 items-center justify-center pr-2", children: r.icon }),
136
- /* @__PURE__ */ e($t, { text: K, shouldShow: I, isShrinkable: !0, fill: !0, children: /* @__PURE__ */ x("div", { className: "relative flex-1 flex items-center min-w-0", children: [
137
- dt && /* @__PURE__ */ e(
136
+ /* @__PURE__ */ e($t, { text: B, shouldShow: tt, isShrinkable: !0, fill: !0, children: /* @__PURE__ */ v("div", { className: "relative flex-1 flex items-center min-w-0", children: [
137
+ ut && /* @__PURE__ */ e(
138
138
  "span",
139
139
  {
140
140
  "aria-hidden": "true",
@@ -142,10 +142,10 @@ const Re = Dt.lazy(() => import("./ActionMenuTagHost.js")), Xt = ({ id: t, text:
142
142
  children: /* @__PURE__ */ e(
143
143
  "span",
144
144
  {
145
- ref: H,
145
+ ref: K,
146
146
  className: `min-w-0 block truncate text-[length:inherit]
147
147
  text-[var(--malachite-text-primary)]`,
148
- children: K
148
+ children: B
149
149
  }
150
150
  )
151
151
  }
@@ -155,36 +155,36 @@ const Re = Dt.lazy(() => import("./ActionMenuTagHost.js")), Xt = ({ id: t, text:
155
155
  {
156
156
  id: i,
157
157
  type: "text",
158
- "aria-label": w,
159
- "aria-labelledby": yt,
158
+ "aria-label": x,
159
+ "aria-labelledby": G,
160
160
  "aria-invalid": d || void 0,
161
- "aria-required": f || void 0,
162
- "aria-describedby": [o, lt ? O : void 0].filter(Boolean).join(" ") || void 0,
163
- value: t ? L : (r == null ? void 0 : r.label) ?? "",
161
+ "aria-required": g || void 0,
162
+ "aria-describedby": [o, st ? z : void 0].filter(Boolean).join(" ") || void 0,
163
+ value: t ? $ : (r == null ? void 0 : r.label) ?? "",
164
164
  onChange: (l) => {
165
- l.stopPropagation(), C == null || C(l.target.value), t || a();
165
+ l.stopPropagation(), L == null || L(l.target.value), t || a();
166
166
  },
167
167
  onFocus: () => {
168
- k == null || k();
168
+ E == null || E();
169
169
  },
170
170
  onKeyDown: Tt,
171
- placeholder: N ?? "Select Field",
171
+ placeholder: k ?? "Select Field",
172
172
  className: `flex-1 min-w-0 bg-transparent outline-none
173
173
  text-[length:inherit] font-normal
174
- placeholder:text-[var(--malachite-text-dimmed)] ${dt ? "text-transparent" : "text-[var(--malachite-text-primary)]"}`
174
+ placeholder:text-[var(--malachite-text-dimmed)] ${ut ? "text-transparent" : "text-[var(--malachite-text-primary)]"}`
175
175
  }
176
176
  )
177
177
  ] }) }),
178
- lt && (r == null ? void 0 : r.triggerTag) && /* @__PURE__ */ x(bt, { children: [
178
+ st && (r == null ? void 0 : r.triggerTag) && /* @__PURE__ */ v(yt, { children: [
179
179
  /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "w-2 shrink-0" }),
180
- /* @__PURE__ */ e(Xt, { id: O, text: r.triggerTag })
180
+ /* @__PURE__ */ e(Xt, { id: z, text: r.triggerTag })
181
181
  ] }),
182
- m && /* @__PURE__ */ e(
182
+ h && /* @__PURE__ */ e(
183
183
  "button",
184
184
  {
185
185
  type: "button",
186
186
  "aria-label": W,
187
- onClick: P,
187
+ onClick: D,
188
188
  className: `flex shrink-0 items-center justify-center pl-2 cursor-pointer
189
189
  bg-transparent border-none p-0 text-[var(--malachite-text-placeholder)]
190
190
  hover:text-[var(--malachite-text-primary)] transition-colors
@@ -218,33 +218,33 @@ const Re = Dt.lazy(() => import("./ActionMenuTagHost.js")), Xt = ({ id: t, text:
218
218
  ]
219
219
  }
220
220
  );
221
- const ut = /* @__PURE__ */ x(
221
+ const pt = /* @__PURE__ */ v(
222
222
  "button",
223
223
  {
224
224
  ref: wt,
225
225
  id: i,
226
226
  type: "button",
227
- "aria-label": w,
228
- "aria-labelledby": v,
227
+ "aria-label": x,
228
+ "aria-labelledby": b,
229
229
  "aria-invalid": d || void 0,
230
- "aria-required": f || void 0,
230
+ "aria-required": g || void 0,
231
231
  "aria-describedby": [
232
232
  o,
233
- b ? St : void 0,
234
- _ ? O : void 0
233
+ y ? St : void 0,
234
+ _ ? z : void 0
235
235
  ].filter(Boolean).join(" ") || void 0,
236
236
  onClick: (l) => {
237
237
  l.stopPropagation(), a(l.detail === 0);
238
238
  },
239
239
  onKeyDown: Tt,
240
240
  disabled: u,
241
- style: z,
241
+ style: A,
242
242
  [Vt]: "",
243
243
  className: `
244
- relative w-full ${it} ${at}
244
+ relative w-full ${at} ${ot}
245
245
  border border-solid
246
246
  transition-all duration-200
247
- flex ${D ? "items-start" : "items-center"} gap-3
247
+ flex ${O ? "items-start" : "items-center"} gap-3
248
248
  cursor-pointer
249
249
  disabled:cursor-not-allowed ${Ee}
250
250
  `,
@@ -252,49 +252,49 @@ const Re = Dt.lazy(() => import("./ActionMenuTagHost.js")), Xt = ({ id: t, text:
252
252
  /* @__PURE__ */ e(
253
253
  "span",
254
254
  {
255
- id: b ? void 0 : G,
256
- className: `text-left ${j ? "flex-[1_1_auto]" : "flex-1"} min-w-0 flex ${b ? "flex-col gap-1" : "items-center gap-2"}`,
257
- children: r ? /* @__PURE__ */ x(bt, { children: [
258
- /* @__PURE__ */ x(Fe, { wrap: !!b, id: G, children: [
255
+ id: y ? void 0 : j,
256
+ className: `text-left ${H ? "flex-[1_1_auto]" : "flex-1"} min-w-0 flex ${y ? "flex-col gap-1" : "items-center gap-2"}`,
257
+ children: r ? /* @__PURE__ */ v(yt, { children: [
258
+ /* @__PURE__ */ v(Pe, { wrap: !!y, id: j, children: [
259
259
  r.icon && /* @__PURE__ */ e("span", { className: "flex items-center justify-center shrink-0", children: r.icon }),
260
260
  /* @__PURE__ */ e(
261
261
  $t,
262
262
  {
263
- text: K,
264
- shouldShow: b ? Qt : I,
263
+ text: B,
264
+ shouldShow: y ? Qt : tt,
265
265
  triggerAs: "span",
266
266
  isShrinkable: !0,
267
267
  children: /* @__PURE__ */ e(
268
268
  "span",
269
269
  {
270
- ref: H,
270
+ ref: K,
271
271
  className: `min-w-0 block truncate text-[length:inherit] ${u ? "text-[var(--malachite-text-placeholder)]" : "text-[var(--malachite-text-primary)]"}`,
272
- children: K
272
+ children: B
273
273
  }
274
274
  )
275
275
  }
276
276
  )
277
277
  ] }),
278
- b && /* @__PURE__ */ e(
278
+ y && /* @__PURE__ */ e(
279
279
  "span",
280
280
  {
281
281
  id: St,
282
- ref: J,
282
+ ref: I,
283
283
  className: "min-w-0 block truncate text-[length:var(--malachite-font-size-xsmall,11px)] text-[var(--malachite-text-secondary,rgb(123,123,123))] leading-normal",
284
- children: /* @__PURE__ */ e(mt, { text: b })
284
+ children: /* @__PURE__ */ e(vt, { text: y })
285
285
  }
286
286
  )
287
287
  ] }) : /* @__PURE__ */ e(
288
288
  "span",
289
289
  {
290
290
  className: `flex-1 min-w-0 truncate text-[length:inherit] ${u ? "text-[var(--malachite-text-placeholder)]" : "text-[var(--malachite-text-dimmed)]"}`,
291
- children: N ?? "Select Field"
291
+ children: k ?? "Select Field"
292
292
  }
293
293
  )
294
294
  }
295
295
  ),
296
- (r == null ? void 0 : r.triggerTag) && /* @__PURE__ */ e(Xt, { id: O, text: r.triggerTag, disabled: u }),
297
- m && /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "shrink-0 w-4" }),
296
+ (r == null ? void 0 : r.triggerTag) && /* @__PURE__ */ e(Xt, { id: z, text: r.triggerTag, disabled: u }),
297
+ h && /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "shrink-0 w-4" }),
298
298
  /* @__PURE__ */ e("span", { className: "flex items-center justify-center shrink-0", children: /* @__PURE__ */ e(
299
299
  Zt,
300
300
  {
@@ -313,18 +313,18 @@ const Re = Dt.lazy(() => import("./ActionMenuTagHost.js")), Xt = ({ id: t, text:
313
313
  $t,
314
314
  {
315
315
  text: It([
316
- ["value", tt.value && K],
316
+ ["value", et.value && B],
317
317
  [
318
318
  "subtitle",
319
- tt.subtitle && b && /* @__PURE__ */ e(mt, { text: b })
319
+ et.subtitle && y && /* @__PURE__ */ e(vt, { text: y })
320
320
  ]
321
321
  ]),
322
- shouldShow: b ? Ot : Qt,
322
+ shouldShow: y ? Ot : Qt,
323
323
  fill: !0,
324
324
  describesTrigger: !1,
325
- children: ut
325
+ children: pt
326
326
  }
327
- ) : ut;
327
+ ) : pt;
328
328
  }
329
329
  );
330
330
  ee.displayName = "DropdownTrigger";
@@ -335,10 +335,10 @@ const We = ({
335
335
  subtitleLayout: u,
336
336
  onItemSelected: d
337
337
  }) => {
338
- const S = a ? "var(--malachite-accent-foreground, rgb(2, 122, 66))" : "var(--malachite-text-primary, rgb(10, 10, 10))", N = u === "stacked" && !!t.subtitle, p = `mal-${se().replace(/[^a-zA-Z0-9_-]/g, "")}`, T = `${p}-label`, L = `${p}-subtitle`, C = `${p}-badge`, k = g(null), y = g(null), R = g(null), [E, m] = F({ label: !0, subtitle: !0, rightSide: !0 }), P = () => {
339
- const o = xt(k.current), f = xt(y.current), w = xt(R.current);
340
- return !o && !f && !w ? !1 : (m({ label: o, subtitle: f, rightSide: w }), !0);
341
- }, W = t.rightSideTextVariant === "primary" ? "var(--malachite-text-right-side-text-primary, rgb(10, 10, 10))" : "var(--malachite-text-right-side-text-muted, rgb(123, 123, 123))", i = t.rightSideTextAlignment === "left" ? "flex-start" : "flex-end", c = (
338
+ const S = a ? "var(--malachite-accent-foreground, rgb(2, 122, 66))" : "var(--malachite-text-primary, rgb(10, 10, 10))", k = u === "stacked" && !!t.subtitle, p = `mal-${se().replace(/[^a-zA-Z0-9_-]/g, "")}`, T = `${p}-label`, $ = `${p}-subtitle`, L = `${p}-badge`, E = t.badgePlacement === "label", w = _t(t.badge) ? /* @__PURE__ */ e("span", { id: L, style: { flexShrink: 0, display: "flex" }, children: /* @__PURE__ */ e(Dt.Suspense, { fallback: null, children: /* @__PURE__ */ e(Le, { children: t.badge }) }) }) : null, R = m(null), N = m(null), h = m(null), [D, W] = F({ label: !0, subtitle: !0, rightSide: !0 }), i = () => {
339
+ const x = mt(R.current), G = mt(N.current), C = mt(h.current);
340
+ return !x && !G && !C ? !1 : (W({ label: x, subtitle: G, rightSide: C }), !0);
341
+ }, c = t.rightSideTextVariant === "primary" ? "var(--malachite-text-right-side-text-primary, rgb(10, 10, 10))" : "var(--malachite-text-right-side-text-muted, rgb(123, 123, 123))", o = t.rightSideTextAlignment === "left" ? "flex-start" : "flex-end", g = (
342
342
  // `role="option"` would be invalid — nothing here declares a `listbox`, and an
343
343
  // orphaned option is dropped from the a11y tree. `aria-current`, not
344
344
  // `aria-pressed`: these are one-of-many choices, not toggles. tabIndex={-1}
@@ -351,14 +351,14 @@ const We = ({
351
351
  "data-dropdown-option": "",
352
352
  "data-selected": a,
353
353
  "aria-current": a || void 0,
354
- "aria-labelledby": t.subtitle || Lt(t.badge) ? T : void 0,
354
+ "aria-labelledby": t.subtitle || _t(t.badge) ? T : void 0,
355
355
  "aria-describedby": [
356
- t.subtitle ? L : void 0,
357
- Lt(t.badge) ? C : void 0
356
+ t.subtitle ? $ : void 0,
357
+ _t(t.badge) ? L : void 0
358
358
  ].filter(Boolean).join(" ") || void 0,
359
359
  tabIndex: -1,
360
- onClick: (o) => {
361
- o.stopPropagation(), d(t);
360
+ onClick: (x) => {
361
+ x.stopPropagation(), d(t);
362
362
  },
363
363
  className: "malachite-dropdown-option",
364
364
  style: {
@@ -377,7 +377,7 @@ const We = ({
377
377
  font: "inherit",
378
378
  color: "inherit"
379
379
  },
380
- children: /* @__PURE__ */ x(
380
+ children: /* @__PURE__ */ v(
381
381
  "span",
382
382
  {
383
383
  style: {
@@ -388,12 +388,12 @@ const We = ({
388
388
  minWidth: 0
389
389
  },
390
390
  children: [
391
- /* @__PURE__ */ e("span", { style: { flex: "1 1 auto", display: "block", minWidth: 0 }, children: /* @__PURE__ */ x(
391
+ /* @__PURE__ */ e("span", { style: { flex: "1 1 auto", display: "block", minWidth: 0 }, children: /* @__PURE__ */ v(
392
392
  "span",
393
393
  {
394
- style: N ? { display: "flex", flexDirection: "column", gap: 2 } : { display: "flex", alignItems: "center", gap: 8 },
394
+ style: k ? { display: "flex", flexDirection: "column", gap: 2 } : { display: "flex", alignItems: "center", gap: 8 },
395
395
  children: [
396
- /* @__PURE__ */ x(Pe, { row: N && !!t.icon, children: [
396
+ /* @__PURE__ */ v(Fe, { row: k && (!!t.icon || E && !!w), children: [
397
397
  t.icon && /* @__PURE__ */ e(
398
398
  "span",
399
399
  {
@@ -409,8 +409,8 @@ const We = ({
409
409
  /* @__PURE__ */ e(
410
410
  "span",
411
411
  {
412
- id: t.subtitle || Lt(t.badge) ? T : void 0,
413
- ref: k,
412
+ id: t.subtitle || _t(t.badge) ? T : void 0,
413
+ ref: R,
414
414
  style: {
415
415
  fontWeight: 400,
416
416
  color: S,
@@ -421,15 +421,16 @@ const We = ({
421
421
  },
422
422
  children: t.label
423
423
  }
424
- )
424
+ ),
425
+ E && w
425
426
  ] }),
426
- t.subtitle && (N ? /* @__PURE__ */ e(
427
+ t.subtitle && (k ? /* @__PURE__ */ e(
427
428
  "span",
428
429
  {
429
- id: L,
430
- ref: y,
430
+ id: $,
431
+ ref: N,
431
432
  style: {
432
- fontSize: Ft,
433
+ fontSize: Pt,
433
434
  fontWeight: 400,
434
435
  lineHeight: 1.4,
435
436
  color: a ? S : "var(--malachite-text-dimmed, rgb(161, 161, 161))",
@@ -437,9 +438,9 @@ const We = ({
437
438
  overflow: "hidden",
438
439
  textOverflow: "ellipsis"
439
440
  },
440
- children: /* @__PURE__ */ e(mt, { text: t.subtitle })
441
+ children: /* @__PURE__ */ e(vt, { text: t.subtitle })
441
442
  }
442
- ) : /* @__PURE__ */ x(
443
+ ) : /* @__PURE__ */ v(
443
444
  "span",
444
445
  {
445
446
  style: {
@@ -457,7 +458,7 @@ const We = ({
457
458
  "span",
458
459
  {
459
460
  style: {
460
- fontSize: Ft,
461
+ fontSize: Pt,
461
462
  fontWeight: 400,
462
463
  color: "var(--malachite-text-secondary, rgb(123, 123, 123))",
463
464
  flexShrink: 0
@@ -468,10 +469,10 @@ const We = ({
468
469
  /* @__PURE__ */ e(
469
470
  "span",
470
471
  {
471
- id: L,
472
- ref: y,
472
+ id: $,
473
+ ref: N,
473
474
  style: {
474
- fontSize: Ft,
475
+ fontSize: Pt,
475
476
  fontWeight: 400,
476
477
  color: "var(--malachite-text-secondary, rgb(123, 123, 123))",
477
478
  whiteSpace: "nowrap",
@@ -479,7 +480,7 @@ const We = ({
479
480
  textOverflow: "ellipsis",
480
481
  minWidth: 0
481
482
  },
482
- children: /* @__PURE__ */ e(mt, { text: t.subtitle })
483
+ children: /* @__PURE__ */ e(vt, { text: t.subtitle })
483
484
  }
484
485
  )
485
486
  ]
@@ -497,16 +498,16 @@ const We = ({
497
498
  minWidth: t.rightSideText ? "var(--malachite-text-right-side-text-min-width, 80px)" : 0,
498
499
  flexShrink: 1,
499
500
  display: "flex",
500
- justifyContent: i
501
+ justifyContent: o
501
502
  },
502
503
  children: t.rightSideText && /* @__PURE__ */ e(
503
504
  "span",
504
505
  {
505
- ref: R,
506
+ ref: h,
506
507
  style: {
507
508
  fontSize: "var(--malachite-text-right-side-text-font-size, 12px)",
508
509
  fontWeight: 400,
509
- color: W,
510
+ color: c,
510
511
  whiteSpace: "nowrap",
511
512
  overflow: "hidden",
512
513
  textOverflow: "ellipsis",
@@ -517,7 +518,7 @@ const We = ({
517
518
  )
518
519
  }
519
520
  ),
520
- Lt(t.badge) && /* @__PURE__ */ e("span", { id: C, style: { flexShrink: 0, display: "flex" }, children: /* @__PURE__ */ e(Dt.Suspense, { fallback: null, children: /* @__PURE__ */ e(Re, { children: t.badge }) }) })
521
+ !E && w
521
522
  ]
522
523
  }
523
524
  )
@@ -528,18 +529,18 @@ const We = ({
528
529
  $t,
529
530
  {
530
531
  text: It([
531
- ["label", E.label && t.label],
532
+ ["label", D.label && t.label],
532
533
  [
533
534
  "subtitle",
534
- E.subtitle && t.subtitle && /* @__PURE__ */ e(mt, { text: t.subtitle })
535
+ D.subtitle && t.subtitle && /* @__PURE__ */ e(vt, { text: t.subtitle })
535
536
  ],
536
- ["rightSide", E.rightSide && t.rightSideText]
537
+ ["rightSide", D.rightSide && t.rightSideText]
537
538
  ]),
538
- shouldShow: P,
539
+ shouldShow: i,
539
540
  showOnFocus: r,
540
541
  isShrinkable: !0,
541
542
  describesTrigger: !1,
542
- children: c
543
+ children: g
543
544
  }
544
545
  );
545
546
  }, re = Dt.forwardRef((t, a) => {
@@ -548,80 +549,80 @@ const We = ({
548
549
  onItemSelected: u,
549
550
  selectedItem: d,
550
551
  menuLoading: S,
551
- emptyMessage: N,
552
+ emptyMessage: k,
552
553
  autoFocus: p,
553
554
  positioned: T,
554
- onDismiss: L,
555
- keyboardNavigation: C,
556
- onKeyboardNavigation: k,
557
- subtitleLayout: y,
555
+ onDismiss: $,
556
+ keyboardNavigation: L,
557
+ onKeyboardNavigation: E,
558
+ subtitleLayout: w,
558
559
  size: R,
559
- style: E
560
- } = t, m = g(null), P = Ce("dropdown", !0, m);
560
+ style: N
561
+ } = t, h = m(null), D = Ce("dropdown", !0, h);
561
562
  return le(() => {
562
563
  Ne();
563
- }, []), ke(m, !0), Pt(() => {
564
+ }, []), ke(h, !0), Ft(() => {
564
565
  var o;
565
566
  if (!p || !T)
566
567
  return;
567
- const i = Wt(m.current);
568
- (o = i.find((f) => f.dataset.selected === "true") ?? i[0] ?? m.current) == null || o.focus();
568
+ const i = Wt(h.current);
569
+ (o = i.find((g) => g.dataset.selected === "true") ?? i[0] ?? h.current) == null || o.focus();
569
570
  }, [p, T]), /* @__PURE__ */ e(
570
571
  "div",
571
572
  {
572
573
  ref: (i) => {
573
- m.current = i, typeof a == "function" ? a(i) : a && (a.current = i);
574
+ h.current = i, typeof a == "function" ? a(i) : a && (a.current = i);
574
575
  },
575
- ...P,
576
+ ...D,
576
577
  tabIndex: -1,
577
578
  onKeyDown: (i) => {
578
- var w;
579
+ var x;
579
580
  if (i.key === "Tab") {
580
- L();
581
+ $();
581
582
  return;
582
583
  }
583
- const c = Wt(m.current);
584
+ const c = Wt(h.current);
584
585
  if (c.length === 0)
585
586
  return;
586
- const o = c.indexOf(document.activeElement), f = {
587
+ const o = c.indexOf(document.activeElement), g = {
587
588
  ArrowDown: o + 1,
588
589
  ArrowUp: o - 1,
589
590
  Home: 0,
590
591
  End: c.length - 1
591
592
  }[i.key];
592
- f !== void 0 && (i.preventDefault(), k(), (w = c[Math.min(Math.max(f, 0), c.length - 1)]) == null || w.focus());
593
+ g !== void 0 && (i.preventDefault(), E(), (x = c[Math.min(Math.max(g, 0), c.length - 1)]) == null || x.focus());
593
594
  },
594
595
  style: {
595
- background: gt.standard.background,
596
- border: gt.standard.border,
597
- borderRadius: gt.standard.radius,
598
- boxShadow: gt.standard.shadow,
596
+ background: xt.standard.background,
597
+ border: xt.standard.border,
598
+ borderRadius: xt.standard.radius,
599
+ boxShadow: xt.standard.shadow,
599
600
  maxHeight: Te,
600
601
  overflow: "hidden",
601
602
  display: "flex",
602
603
  flexDirection: "column",
603
604
  fontSize: me[R],
604
- ...E
605
+ ...N
605
606
  },
606
- children: S ? /* @__PURE__ */ x("div", { style: Yt, children: [
607
+ children: S ? /* @__PURE__ */ v("div", { style: Yt, children: [
607
608
  /* @__PURE__ */ e(fe, { size: "xxxsmall" }),
608
609
  /* @__PURE__ */ e("span", { children: "Loading…" })
609
- ] }) : r.length === 0 ? /* @__PURE__ */ e("div", { style: Yt, children: N }) : /* @__PURE__ */ e(
610
+ ] }) : r.length === 0 ? /* @__PURE__ */ e("div", { style: Yt, children: k }) : /* @__PURE__ */ e(
610
611
  "div",
611
612
  {
612
613
  style: {
613
614
  display: "flex",
614
615
  flexDirection: "column",
615
616
  gap: 4,
616
- padding: gt.standard.padding,
617
+ padding: xt.standard.padding,
617
618
  overflowY: "auto",
618
619
  scrollbarWidth: "thin",
619
620
  scrollbarColor: "var(--malachite-text-placeholder, rgb(187, 187, 187)) transparent"
620
621
  },
621
622
  children: r.map((i, c) => {
622
- const o = r[c - 1], f = !!i.group && (!o || o.group !== i.group);
623
- return /* @__PURE__ */ x("div", { style: { flexShrink: 0 }, children: [
624
- f && /* @__PURE__ */ e(
623
+ const o = r[c - 1], g = !!i.group && (!o || o.group !== i.group);
624
+ return /* @__PURE__ */ v("div", { style: { flexShrink: 0 }, children: [
625
+ g && /* @__PURE__ */ e(
625
626
  "div",
626
627
  {
627
628
  style: {
@@ -640,9 +641,9 @@ const We = ({
640
641
  {
641
642
  item: i,
642
643
  onItemSelected: u,
643
- subtitleLayout: y,
644
+ subtitleLayout: w,
644
645
  selected: i.id === (d == null ? void 0 : d.id) || !1,
645
- showTooltipOnFocus: C
646
+ showTooltipOnFocus: L
646
647
  }
647
648
  )
648
649
  ] }, i.id);
@@ -660,212 +661,212 @@ const ur = ({
660
661
  value: u,
661
662
  disabled: d = !1,
662
663
  error: S,
663
- tone: N,
664
+ tone: k,
664
665
  label: p,
665
666
  hint: T,
666
- rightSideContent: L,
667
- tooltip: C,
668
- name: k,
669
- required: y = !1,
667
+ rightSideContent: $,
668
+ tooltip: L,
669
+ name: E,
670
+ required: w = !1,
670
671
  requiredIndicator: R,
671
- loading: E,
672
- menuLoading: m,
673
- formControl: P,
672
+ loading: N,
673
+ menuLoading: h,
674
+ formControl: D,
674
675
  description: W,
675
676
  helperText: i,
676
677
  placeholder: c,
677
678
  search: o = !1,
678
- showSubtitleInTrigger: f = !1,
679
- subtitleLayout: w = "inline",
680
- clearable: yt = !1,
681
- size: $ = "large",
679
+ showSubtitleInTrigger: g = !1,
680
+ subtitleLayout: x = "inline",
681
+ clearable: G = !1,
682
+ size: C = "large",
682
683
  fullWidth: wt = !1,
683
- width: D,
684
- minWidth: it,
685
- menuAlign: at = "start",
686
- id: G,
684
+ width: O,
685
+ minWidth: at,
686
+ menuAlign: ot = "start",
687
+ id: j,
687
688
  "aria-label": St,
688
- "aria-labelledby": O
689
+ "aria-labelledby": z
689
690
  }) => {
690
- const { controlId: ot, labelId: j, descriptionId: lt, hintId: st, helperTextId: ct } = ue({
691
- id: G,
691
+ const { controlId: lt, labelId: H, descriptionId: st, hintId: ct, helperTextId: dt } = ue({
692
+ id: j,
692
693
  label: p,
693
694
  description: W,
694
695
  hint: T,
695
696
  helperText: !0
696
- }), [v, _] = F(!1), [Tt, H] = F(r), J = u ?? Tt, z = t.find((n) => n.id === J), dt = yt && J !== void 0 && J !== "" && !d, K = f && !o && !!(z != null && z.subtitle), b = `Clear ${p ?? c ?? "selection"}`, I = g(r);
697
- Pt(() => {
698
- I.current !== r && (I.current = r, H(r));
697
+ }), [b, _] = F(!1), [Tt, K] = F(r), I = u ?? Tt, A = t.find((n) => n.id === I), ut = G && I !== void 0 && I !== "" && !d, B = g && !o && !!(A != null && A.subtitle), y = `Clear ${p ?? c ?? "selection"}`, tt = m(r);
698
+ Ft(() => {
699
+ tt.current !== r && (tt.current = r, K(r));
699
700
  }, [r]);
700
- const [tt, A] = F(""), [Ot, ut] = F(!1), [l, et] = F(!1), zt = g(null), Et = g(null), B = g(null), [h, Gt] = F(null), Nt = g(!0), Z = Mt(() => {
701
+ const [et, M] = F(""), [Ot, pt] = F(!1), [l, rt] = F(!1), zt = m(null), Et = m(null), Z = m(null), [f, Gt] = F(null), Nt = m(!0), q = Mt(() => {
701
702
  const n = Et.current, s = n instanceof HTMLButtonElement ? n : (n == null ? void 0 : n.querySelector("input")) ?? null;
702
- if (!(!s || s === _t())) {
703
+ if (!(!s || s === Rt())) {
703
704
  if (!o) {
704
705
  s.focus();
705
706
  return;
706
707
  }
707
- Nt.current = !1, s.focus(), _t() !== s && (Nt.current = !0);
708
+ Nt.current = !1, s.focus(), Rt() !== s && (Nt.current = !0);
708
709
  }
709
710
  }, [o]), jt = Mt(
710
711
  (n) => {
711
712
  var s;
712
- n.stopPropagation(), H(void 0), (s = U.current) == null || s.call(U, At.current), a == null || a(void 0), Z();
713
+ n.stopPropagation(), K(void 0), (s = V.current) == null || s.call(V, At.current), a == null || a(void 0), q();
713
714
  },
714
- [a, Z]
715
- ), q = Mt(() => {
715
+ [a, q]
716
+ ), U = Mt(() => {
716
717
  const n = Et.current;
717
718
  n && Gt(
718
- ye(B.current, {
719
+ ye(Z.current, {
719
720
  triggerRect: n.getBoundingClientRect(),
720
721
  preset: "standard",
721
- minWidth: it,
722
- align: at === "end" ? "right" : "left",
722
+ minWidth: at,
723
+ align: ot === "end" ? "right" : "left",
723
724
  viewportWidth: window.innerWidth,
724
725
  viewportHeight: window.innerHeight
725
726
  })
726
727
  );
727
- }, [it, at]);
728
- Pt(() => {
729
- if (!v) {
730
- Gt(null), ut(!1);
728
+ }, [at, ot]);
729
+ Ft(() => {
730
+ if (!b) {
731
+ Gt(null), pt(!1);
731
732
  return;
732
733
  }
733
- q();
734
- const n = (X) => {
735
- var ft, ht, Bt;
736
- const M = X.composedPath(), Y = zt.current, Q = B.current, Rt = !!Y && M.includes(Y), Kt = !!Q && M.includes(Q);
737
- !Rt && !Kt && (_(!1), o && A(""), (ft = B.current) != null && ft.contains(_t()) && Z(), (ht = zt.current) != null && ht.contains(_t()) || (Bt = V.current) == null || Bt.call(V));
734
+ U();
735
+ const n = (Y) => {
736
+ var ht, gt, Bt;
737
+ const P = Y.composedPath(), Q = zt.current, J = Z.current, Lt = !!Q && P.includes(Q), Kt = !!J && P.includes(J);
738
+ !Lt && !Kt && (_(!1), o && M(""), (ht = Z.current) != null && ht.contains(Rt()) && q(), (gt = zt.current) != null && gt.contains(Rt()) || (Bt = X.current) == null || Bt.call(X));
738
739
  }, s = be(() => {
739
- _(!1), o && A(""), Z();
740
- }), rt = () => q();
741
- let pt = 0, Ct = "";
740
+ _(!1), o && M(""), q();
741
+ }), nt = () => U();
742
+ let ft = 0, Ct = "";
742
743
  const kt = () => {
743
- const X = Et.current;
744
- if (X) {
745
- const M = X.getBoundingClientRect();
746
- if (we(M, window.innerWidth, window.innerHeight)) {
747
- _(!1), o && A("");
744
+ const Y = Et.current;
745
+ if (Y) {
746
+ const P = Y.getBoundingClientRect();
747
+ if (we(P, window.innerWidth, window.innerHeight)) {
748
+ _(!1), o && M("");
748
749
  return;
749
750
  }
750
- const Y = Se(M);
751
- Y !== Ct && (Ct = Y, q());
751
+ const Q = Se(P);
752
+ Q !== Ct && (Ct = Q, U());
752
753
  }
753
- pt = requestAnimationFrame(kt);
754
+ ft = requestAnimationFrame(kt);
754
755
  };
755
- return pt = requestAnimationFrame(kt), document.addEventListener("mousedown", n), window.addEventListener("scroll", rt, !0), window.addEventListener("resize", rt), () => {
756
- cancelAnimationFrame(pt), document.removeEventListener("mousedown", n), s(), window.removeEventListener("scroll", rt, !0), window.removeEventListener("resize", rt);
756
+ return ft = requestAnimationFrame(kt), document.addEventListener("mousedown", n), window.addEventListener("scroll", nt, !0), window.addEventListener("resize", nt), () => {
757
+ cancelAnimationFrame(ft), document.removeEventListener("mousedown", n), s(), window.removeEventListener("scroll", nt, !0), window.removeEventListener("resize", nt);
757
758
  };
758
- }, [v, o, q, Z]), oe(() => {
759
- if (!v)
759
+ }, [b, o, U, q]), oe(() => {
760
+ if (!b)
760
761
  return;
761
- q();
762
- const n = B.current;
762
+ U();
763
+ const n = Z.current;
763
764
  if (!n || typeof ResizeObserver > "u")
764
765
  return;
765
- const s = new ResizeObserver(() => q());
766
+ const s = new ResizeObserver(() => U());
766
767
  return s.observe(n), () => s.disconnect();
767
- }, [v, q]);
768
- const U = g(void 0), V = g(void 0), At = g(""), ne = (n) => {
768
+ }, [b, U]);
769
+ const V = m(void 0), X = m(void 0), At = m(""), ne = (n) => {
769
770
  var s;
770
- H(n == null ? void 0 : n.id), (s = U.current) == null || s.call(U, (n == null ? void 0 : n.id) ?? At.current), _(!1), o && A(""), a == null || a(n == null ? void 0 : n.id), Z();
771
+ K(n == null ? void 0 : n.id), (s = V.current) == null || s.call(V, (n == null ? void 0 : n.id) ?? At.current), _(!1), o && M(""), a == null || a(n == null ? void 0 : n.id), q();
771
772
  }, Ht = () => {
772
- _(!1), o && A(""), Z();
773
+ _(!1), o && M(""), q();
773
774
  }, ie = () => {
774
- et(!0);
775
- const n = Wt(B.current)[0];
775
+ rt(!0);
776
+ const n = Wt(Z.current)[0];
776
777
  if (n) {
777
778
  n.focus();
778
779
  return;
779
780
  }
780
- ut(!0), _(!0);
781
- }, ae = o && tt ? t.filter((n) => $e(n, tt)) : t;
781
+ pt(!0), _(!0);
782
+ }, ae = o && et ? t.filter((n) => $e(n, et)) : t;
782
783
  return /* @__PURE__ */ e(
783
784
  de,
784
785
  {
785
786
  fullWidth: wt,
786
787
  label: p,
787
788
  hint: T,
788
- rightSideContent: L,
789
- tooltip: C,
790
- name: k,
791
- required: y,
789
+ rightSideContent: $,
790
+ tooltip: L,
791
+ name: E,
792
+ required: w,
792
793
  requiredIndicator: R,
793
- loading: E,
794
- formControl: P,
794
+ loading: N,
795
+ formControl: D,
795
796
  description: W,
796
- controlId: ot,
797
- labelId: j,
798
- descriptionId: lt,
799
- hintId: st,
800
- loadingComponent: D === void 0 ? /* @__PURE__ */ e(
797
+ controlId: lt,
798
+ labelId: H,
799
+ descriptionId: st,
800
+ hintId: ct,
801
+ loadingComponent: O === void 0 ? /* @__PURE__ */ e(
801
802
  qt,
802
803
  {
803
- heightClass: vt[$],
804
+ heightClass: bt[C],
804
805
  helperText: !!i,
805
806
  helperTextMarginTop: !0
806
807
  }
807
- ) : /* @__PURE__ */ e("div", { style: Ut(D), children: /* @__PURE__ */ e(
808
+ ) : /* @__PURE__ */ e("div", { style: Ut(O), children: /* @__PURE__ */ e(
808
809
  qt,
809
810
  {
810
- heightClass: vt[$],
811
+ heightClass: bt[C],
811
812
  helperText: !!i,
812
813
  helperTextMarginTop: !0
813
814
  }
814
815
  ) }),
815
- children: ({ error: n, message: s, onFieldChange: rt, onFieldBlur: pt, emptyValue: Ct }) => {
816
- U.current = rt, V.current = pt, At.current = Ct;
817
- const kt = S ?? n, X = S === !1 ? void 0 : s, M = `${ct}-error`, Y = [
818
- lt,
816
+ children: ({ error: n, message: s, onFieldChange: nt, onFieldBlur: ft, emptyValue: Ct }) => {
817
+ V.current = nt, X.current = ft, At.current = Ct;
818
+ const kt = S ?? n, Y = S === !1 ? void 0 : s, P = `${dt}-error`, Q = [
819
819
  st,
820
- i ? ct : void 0,
821
- X ? M : void 0
820
+ ct,
821
+ i ? dt : void 0,
822
+ Y ? P : void 0
822
823
  ].filter(Boolean).join(" ") || void 0;
823
- return /* @__PURE__ */ x(bt, { children: [
824
- /* @__PURE__ */ x(
824
+ return /* @__PURE__ */ v(yt, { children: [
825
+ /* @__PURE__ */ v(
825
826
  "div",
826
827
  {
827
828
  ref: zt,
828
829
  className: "relative w-full",
829
- style: Ut(D),
830
- onBlur: (Q) => {
831
- var ft, ht;
832
- const Rt = Q.relatedTarget;
833
- Q.currentTarget.contains(Rt) || ((ft = B.current) == null ? void 0 : ft.contains(Rt)) === !0 || (ht = V.current) == null || ht.call(V);
830
+ style: Ut(O),
831
+ onBlur: (J) => {
832
+ var ht, gt;
833
+ const Lt = J.relatedTarget;
834
+ J.currentTarget.contains(Lt) || ((ht = Z.current) == null ? void 0 : ht.contains(Lt)) === !0 || (gt = X.current) == null || gt.call(X);
834
835
  },
835
836
  children: [
836
- dt && !o && /* @__PURE__ */ e(
837
+ ut && !o && /* @__PURE__ */ e(
837
838
  "button",
838
839
  {
839
840
  type: "button",
840
841
  onClick: jt,
841
- "aria-label": b,
842
- className: `absolute ${K ? Ae[$] : "top-1/2 -translate-y-1/2"} z-10 flex items-center
842
+ "aria-label": y,
843
+ className: `absolute ${B ? Ae[C] : "top-1/2 -translate-y-1/2"} z-10 flex items-center
843
844
  justify-center rounded-full text-[var(--malachite-text-placeholder)]
844
845
  hover:text-[var(--malachite-text-primary)] transition-colors
845
- focus-visible:[outline:2px_solid_var(--malachite-text-primary)] focus-visible:outline-offset-2 ${ze[$]}`,
846
+ focus-visible:[outline:2px_solid_var(--malachite-text-primary)] focus-visible:outline-offset-2 ${ze[C]}`,
846
847
  children: /* @__PURE__ */ e(Jt, { size: 13 })
847
848
  }
848
849
  ),
849
850
  /* @__PURE__ */ e(
850
851
  ee,
851
852
  {
852
- hasClear: dt,
853
+ hasClear: ut,
853
854
  onClear: jt,
854
- clearLabel: b,
855
+ clearLabel: y,
855
856
  ref: Et,
856
- isOpen: v,
857
- onClick: (Q) => {
858
- d || (et(!!Q), _(!v));
857
+ isOpen: b,
858
+ onClick: (J) => {
859
+ d || (rt(!!J), _(!b));
859
860
  },
860
- selectedItem: z,
861
+ selectedItem: A,
861
862
  disabled: d,
862
863
  error: kt,
863
- tone: N,
864
+ tone: k,
864
865
  placeholder: c,
865
866
  search: o,
866
- showSubtitleInTrigger: f,
867
- searchQuery: tt,
868
- onSearchChange: A,
867
+ showSubtitleInTrigger: g,
868
+ searchQuery: et,
869
+ onSearchChange: M,
869
870
  onFocusOpen: () => {
870
871
  if (!Nt.current) {
871
872
  Nt.current = !0;
@@ -877,44 +878,44 @@ const ur = ({
877
878
  d || ie();
878
879
  },
879
880
  onTabAway: () => {
880
- v && Ht();
881
+ b && Ht();
881
882
  },
882
- size: $,
883
- controlId: ot,
884
- hasCallerId: !!G,
885
- labelId: j,
886
- describedBy: Y,
887
- required: y,
883
+ size: C,
884
+ controlId: lt,
885
+ hasCallerId: !!j,
886
+ labelId: H,
887
+ describedBy: Q,
888
+ required: w,
888
889
  ariaLabel: St,
889
- ariaLabelledBy: O
890
+ ariaLabelledBy: z
890
891
  }
891
892
  ),
892
- v && ce(
893
+ b && ce(
893
894
  /* @__PURE__ */ e(
894
895
  re,
895
896
  {
896
- ref: B,
897
+ ref: Z,
897
898
  style: {
898
899
  position: "fixed",
899
- top: (h == null ? void 0 : h.top) ?? 0,
900
- left: (h == null ? void 0 : h.left) ?? 0,
901
- width: h == null ? void 0 : h.width,
902
- maxHeight: h == null ? void 0 : h.maxHeight,
903
- visibility: h ? "visible" : "hidden",
904
- opacity: h ? 1 : 0
900
+ top: (f == null ? void 0 : f.top) ?? 0,
901
+ left: (f == null ? void 0 : f.left) ?? 0,
902
+ width: f == null ? void 0 : f.width,
903
+ maxHeight: f == null ? void 0 : f.maxHeight,
904
+ visibility: f ? "visible" : "hidden",
905
+ opacity: f ? 1 : 0
905
906
  },
906
907
  items: ae,
907
908
  onItemSelected: ne,
908
- selectedItem: z,
909
- menuLoading: m,
909
+ selectedItem: A,
910
+ menuLoading: h,
910
911
  emptyMessage: t.length === 0 ? "No options available" : "No results found",
911
- subtitleLayout: w,
912
- size: $,
912
+ subtitleLayout: x,
913
+ size: C,
913
914
  autoFocus: !o || Ot,
914
- positioned: h !== null,
915
+ positioned: f !== null,
915
916
  onDismiss: Ht,
916
917
  keyboardNavigation: l,
917
- onKeyboardNavigation: () => et(!0)
918
+ onKeyboardNavigation: () => rt(!0)
918
919
  }
919
920
  ),
920
921
  document.body
@@ -925,12 +926,12 @@ const ur = ({
925
926
  i && /* @__PURE__ */ e(
926
927
  "div",
927
928
  {
928
- id: ct,
929
+ id: dt,
929
930
  className: "mt-1 text-[length:var(--malachite-font-size-small,13px)] text-left pl-2 text-[var(--malachite-text-dimmed,rgb(161,161,161))]",
930
931
  children: i
931
932
  }
932
933
  ),
933
- /* @__PURE__ */ e(pe, { id: M, message: X, spaced: !0 })
934
+ /* @__PURE__ */ e(pe, { id: P, message: Y, spaced: !0 })
934
935
  ] });
935
936
  }
936
937
  }