@stackone/malachite 2.22.0 → 2.23.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,122 +1,122 @@
1
- import { jsx as e, jsxs as g, Fragment as it } from "react/jsx-runtime";
2
- import Gt, { useState as X, useRef as f, useEffect as Et, useCallback as St, useLayoutEffect as Dt, useInsertionEffect as qt, useId as Bt } from "react";
3
- import { createPortal as Xt } from "react-dom";
4
- import Yt, { useFormFieldIds as Qt } from "./BaseFormComponent.js";
5
- import Pt from "./CustomIcons/CaretDownIcon.js";
6
- import jt from "./CustomIcons/CloseIcon.js";
7
- import { FieldMessage as Ut } from "./FieldMessage.js";
8
- import Jt from "./LoadingInput.js";
9
- import te from "./Spinner.js";
10
- import vt from "./Tooltip.js";
11
- import { CONTROL_TEXT_SIZE_CLASS as Y, CONTROL_TEXT_SIZE as ee } from "./controlTextSize.js";
12
- import { computePanelGeometry as re, isContentSizedPanel as Wt, PANEL_VIEWPORT_PADDING_PX as ne, isTriggerOffscreen as ie, rectSignature as ae } from "./dropdownPanelPosition.js";
13
- import { getTriggerVisual as oe, DROPDOWN_TRIGGER_ATTR as Ot } from "./dropdownTriggerStyle.js";
14
- import { pushEscapeLayer as le } from "./escapeLayers.js";
15
- import { ensureDropdownPanelStyles as se } from "./optionRowStyles.js";
16
- import { overlayIdentity as ce } from "./portalOverlay.js";
17
- import { useTopLayer as de } from "./topLayer.js";
18
- const zt = {
1
+ import { jsx as e, jsxs as m, Fragment as rt } from "react/jsx-runtime";
2
+ import jt, { useState as B, useRef as g, useEffect as Et, useCallback as St, useLayoutEffect as Pt, useInsertionEffect as Bt, useId as Xt } from "react";
3
+ import { createPortal as Yt } from "react-dom";
4
+ import Qt, { useFormFieldIds as Ut } from "./BaseFormComponent.js";
5
+ import Wt from "./CustomIcons/CaretDownIcon.js";
6
+ import Ht from "./CustomIcons/CloseIcon.js";
7
+ import { FieldMessage as Jt } from "./FieldMessage.js";
8
+ import te from "./LoadingInput.js";
9
+ import ee from "./Spinner.js";
10
+ import xt from "./Tooltip.js";
11
+ import { CONTROL_TEXT_SIZE_CLASS as X, CONTROL_TEXT_SIZE as re } from "./controlTextSize.js";
12
+ import { computePanelGeometry as ne, isContentSizedPanel as Ot, PANEL_VIEWPORT_PADDING_PX as ie, isTriggerOffscreen as ae, rectSignature as oe } from "./dropdownPanelPosition.js";
13
+ import { getTriggerVisual as le, DROPDOWN_TRIGGER_ATTR as zt } from "./dropdownTriggerStyle.js";
14
+ import { pushEscapeLayer as se } from "./escapeLayers.js";
15
+ import { ensureDropdownPanelStyles as ce } from "./optionRowStyles.js";
16
+ import { overlayIdentity as de } from "./portalOverlay.js";
17
+ import { useTopLayer as ue } from "./topLayer.js";
18
+ const Ft = {
19
19
  display: "flex",
20
20
  alignItems: "center",
21
21
  justifyContent: "center",
22
22
  gap: 8,
23
23
  padding: "24px 16px",
24
24
  color: "var(--malachite-text-dimmed, rgb(161, 161, 161))"
25
- }, Tt = "var(--malachite-font-size-xsmall, 11px)", ue = "[data-dropdown-option]", Ct = (t) => Array.from((t == null ? void 0 : t.querySelectorAll(ue)) ?? []), pe = (t, n) => {
26
- const r = n.toLowerCase(), m = t.label.toLowerCase().includes(r), c = t.subtitle ? t.subtitle.toLowerCase().includes(r) : !1, u = t.rightSideText ? t.rightSideText.toLowerCase().includes(r) : !1;
27
- return m || c || u;
28
- }, bt = {
25
+ }, Tt = "var(--malachite-font-size-xsmall, 11px)", pe = "[data-dropdown-option]", Ct = (t) => Array.from((t == null ? void 0 : t.querySelectorAll(pe)) ?? []), he = (t, n) => {
26
+ const r = n.toLowerCase(), x = t.label.toLowerCase().includes(r), l = t.subtitle ? t.subtitle.toLowerCase().includes(r) : !1, d = t.rightSideText ? t.rightSideText.toLowerCase().includes(r) : !1;
27
+ return x || l || d;
28
+ }, vt = {
29
29
  small: "h-[var(--malachite-control-height-small,28px)]",
30
30
  medium: "h-[var(--malachite-control-height-medium,32px)]",
31
31
  large: "h-[var(--malachite-control-height-large,42px)]"
32
- }, he = {
33
- small: `${bt.small} px-2.5 py-1.5 ${Y.small}`,
34
- medium: `${bt.medium} px-3 py-1.5 ${Y.medium}`,
35
- large: `${bt.large} px-4 py-2.5 ${Y.large}`
36
32
  }, fe = {
37
- small: `min-h-[var(--malachite-control-height-small,28px)] px-2.5 py-1.5 ${Y.small}`,
38
- medium: `min-h-[var(--malachite-control-height-medium,32px)] px-3 py-1.5 ${Y.medium}`,
39
- large: `min-h-[var(--malachite-control-height-large,42px)] px-4 py-2.5 ${Y.large}`
33
+ small: `${vt.small} px-2.5 py-1.5 ${X.small}`,
34
+ medium: `${vt.medium} px-3 py-1.5 ${X.medium}`,
35
+ large: `${vt.large} px-4 py-2.5 ${X.large}`
40
36
  }, ge = {
37
+ small: `min-h-[var(--malachite-control-height-small,28px)] px-2.5 py-1.5 ${X.small}`,
38
+ medium: `min-h-[var(--malachite-control-height-medium,32px)] px-3 py-1.5 ${X.medium}`,
39
+ large: `min-h-[var(--malachite-control-height-large,42px)] px-4 py-2.5 ${X.large}`
40
+ }, me = {
41
41
  small: "right-[26px] size-4",
42
42
  medium: "right-[30px] size-4",
43
43
  large: "right-[38px] size-4"
44
- }, me = {
44
+ }, xe = {
45
45
  small: "top-[calc(var(--malachite-control-height-small,28px)/2)] -translate-y-1/2",
46
46
  medium: "top-[calc(var(--malachite-control-height-medium,32px)/2)] -translate-y-1/2",
47
47
  large: "top-[calc(var(--malachite-control-height-large,42px)/2)] -translate-y-1/2"
48
- }, xe = {
48
+ }, ve = {
49
49
  small: "rounded-[var(--malachite-radius-10,10px)]",
50
50
  medium: "rounded-xl",
51
51
  large: "rounded-[var(--malachite-radius-xxl,14px)]"
52
- }, Ft = () => !1, ve = {
52
+ }, Gt = () => !1, be = {
53
53
  display: "flex",
54
54
  flexDirection: "column",
55
55
  gap: 4
56
- }, be = (t, n, r) => t === "value" ? n : t === "subtitle" ? r : /* @__PURE__ */ g("span", { style: ve, children: [
56
+ }, ye = (t, n, r) => t === "value" ? n : t === "subtitle" ? r : /* @__PURE__ */ m("span", { style: be, children: [
57
57
  /* @__PURE__ */ e("span", { children: n }),
58
58
  /* @__PURE__ */ e("span", { children: r })
59
- ] }), ye = ({
59
+ ] }), we = ({
60
60
  wrap: t,
61
61
  id: n,
62
62
  children: r
63
- }) => t ? /* @__PURE__ */ e("span", { id: n, className: "min-w-0 flex items-center gap-2", children: r }) : /* @__PURE__ */ e(it, { children: r }), we = ({ row: t, children: n }) => t ? /* @__PURE__ */ e("span", { style: { display: "flex", alignItems: "center", gap: 8, minWidth: 0 }, children: n }) : /* @__PURE__ */ e(it, { children: n }), Ht = Gt.forwardRef(
63
+ }) => t ? /* @__PURE__ */ e("span", { id: n, className: "min-w-0 flex items-center gap-2", children: r }) : /* @__PURE__ */ e(rt, { children: r }), Se = ({ row: t, children: n }) => t ? /* @__PURE__ */ e("span", { style: { display: "flex", alignItems: "center", gap: 8, minWidth: 0 }, children: n }) : /* @__PURE__ */ e(rt, { children: n }), Mt = jt.forwardRef(
64
64
  ({
65
65
  isOpen: t,
66
66
  onClick: n,
67
67
  selectedItem: r,
68
- disabled: m = !1,
69
- error: c = !1,
70
- tone: u,
71
- placeholder: N,
72
- search: x = !1,
73
- showSubtitleInTrigger: w = !1,
68
+ disabled: x = !1,
69
+ error: l = !1,
70
+ tone: d,
71
+ placeholder: R,
72
+ search: v = !1,
73
+ showSubtitleInTrigger: y = !1,
74
74
  searchQuery: P = "",
75
- onSearchChange: R,
76
- onFocusOpen: L,
77
- onArrowDown: _,
75
+ onSearchChange: _,
76
+ onFocusOpen: k,
77
+ onArrowDown: N,
78
78
  size: h = "large",
79
- hasClear: S = !1,
79
+ hasClear: w = !1,
80
80
  onClear: o,
81
- clearLabel: v,
81
+ clearLabel: S,
82
82
  controlId: s,
83
- labelId: b,
84
- describedBy: l,
85
- required: Q = !1,
86
- ariaLabel: I,
87
- ariaLabelledBy: at,
88
- hasCallerId: T = !1
89
- }, k) => {
90
- const z = w && !x && !!(r != null && r.subtitle), ot = z ? fe[h] : he[h], lt = xe[h], F = `${s}-value`, U = `${s}-subtitle`, st = !b && !I && !T && z, ct = at ?? (b && !I ? `${b} ${F}` : void 0) ?? (st ? F : void 0), K = (a) => {
91
- a.key === "ArrowDown" && (a.preventDefault(), _ == null || _());
92
- }, y = f(null), C = f(null), dt = oe({ disabled: m, error: c, tone: u, open: t }), V = !t && !!r, $ = (r == null ? void 0 : r.triggerLabel) ?? (r == null ? void 0 : r.label), d = z ? r == null ? void 0 : r.subtitle : void 0, q = () => {
93
- const a = y.current;
83
+ labelId: u,
84
+ describedBy: W,
85
+ required: c = !1,
86
+ ariaLabel: F,
87
+ ariaLabelledBy: nt,
88
+ hasCallerId: bt = !1
89
+ }, b) => {
90
+ const C = y && !v && !!(r != null && r.subtitle), Y = C ? ge[h] : fe[h], it = ve[h], K = `${s}-value`, Q = `${s}-subtitle`, at = !u && !F && !bt && C, ot = nt ?? (u && !F ? `${u} ${K}` : void 0) ?? (at ? K : void 0), U = (a) => {
91
+ a.key === "ArrowDown" && (a.preventDefault(), N == null || N());
92
+ }, G = g(null), T = g(null), L = le({ disabled: x, error: l, tone: d, open: t }), lt = !t && !!r, $ = (r == null ? void 0 : r.triggerLabel) ?? (r == null ? void 0 : r.label), f = C ? r == null ? void 0 : r.subtitle : void 0, A = () => {
93
+ const a = G.current;
94
94
  return !!a && a.scrollWidth > a.clientWidth;
95
- }, yt = () => {
96
- const a = C.current;
95
+ }, st = () => {
96
+ const a = T.current;
97
97
  return !!a && a.scrollWidth > a.clientWidth;
98
- }, [ut, pt] = X("subtitle"), J = () => {
99
- const a = q(), tt = yt();
100
- return !a && !tt ? !1 : (pt(a && tt ? "both" : a ? "value" : "subtitle"), !0);
98
+ }, [yt, ct] = B("subtitle"), dt = () => {
99
+ const a = A(), ut = st();
100
+ return !a && !ut ? !1 : (ct(a && ut ? "both" : a ? "value" : "subtitle"), !0);
101
101
  };
102
- if (x && !m)
103
- return /* @__PURE__ */ g(
102
+ if (v && !x)
103
+ return /* @__PURE__ */ m(
104
104
  "div",
105
105
  {
106
- ref: k,
106
+ ref: b,
107
107
  className: `
108
- relative w-full ${ot} ${lt}
108
+ relative w-full ${Y} ${it}
109
109
  border border-solid
110
110
  transition-all duration-200
111
111
  flex items-center
112
112
  `,
113
- style: dt,
114
- [Ot]: "",
113
+ style: L,
114
+ [zt]: "",
115
115
  onClick: (a) => a.stopPropagation(),
116
116
  children: [
117
117
  (r == null ? void 0 : r.icon) && /* @__PURE__ */ e("span", { className: "flex shrink-0 items-center justify-center pr-2", children: r.icon }),
118
- /* @__PURE__ */ e(vt, { text: $, shouldShow: q, isShrinkable: !0, fill: !0, children: /* @__PURE__ */ g("div", { className: "relative flex-1 flex items-center", children: [
119
- V && /* @__PURE__ */ e(
118
+ /* @__PURE__ */ e(xt, { text: $, shouldShow: A, isShrinkable: !0, fill: !0, children: /* @__PURE__ */ m("div", { className: "relative flex-1 flex items-center", children: [
119
+ lt && /* @__PURE__ */ e(
120
120
  "span",
121
121
  {
122
122
  "aria-hidden": "true",
@@ -124,7 +124,7 @@ const zt = {
124
124
  children: /* @__PURE__ */ e(
125
125
  "span",
126
126
  {
127
- ref: y,
127
+ ref: G,
128
128
  className: `min-w-0 block truncate text-[length:inherit]
129
129
  text-[var(--malachite-text-primary)]`,
130
130
  children: $
@@ -137,37 +137,37 @@ const zt = {
137
137
  {
138
138
  id: s,
139
139
  type: "text",
140
- "aria-label": I,
141
- "aria-labelledby": at,
142
- "aria-invalid": c || void 0,
143
- "aria-required": Q || void 0,
144
- "aria-describedby": l,
140
+ "aria-label": F,
141
+ "aria-labelledby": nt,
142
+ "aria-invalid": l || void 0,
143
+ "aria-required": c || void 0,
144
+ "aria-describedby": W,
145
145
  value: t ? P : (r == null ? void 0 : r.label) ?? "",
146
146
  onChange: (a) => {
147
- a.stopPropagation(), R == null || R(a.target.value), t || n();
147
+ a.stopPropagation(), _ == null || _(a.target.value), t || n();
148
148
  },
149
149
  onFocus: () => {
150
- L == null || L();
150
+ k == null || k();
151
151
  },
152
- onKeyDown: K,
153
- placeholder: N ?? "Select Field",
152
+ onKeyDown: U,
153
+ placeholder: R ?? "Select Field",
154
154
  className: `flex-1 bg-transparent outline-none
155
155
  text-[length:inherit] font-normal
156
- placeholder:text-[var(--malachite-text-dimmed)] ${V ? "text-transparent" : "text-[var(--malachite-text-primary)]"}`
156
+ placeholder:text-[var(--malachite-text-dimmed)] ${lt ? "text-transparent" : "text-[var(--malachite-text-primary)]"}`
157
157
  }
158
158
  )
159
159
  ] }) }),
160
- S && /* @__PURE__ */ e(
160
+ w && /* @__PURE__ */ e(
161
161
  "button",
162
162
  {
163
163
  type: "button",
164
- "aria-label": v,
164
+ "aria-label": S,
165
165
  onClick: o,
166
166
  className: `flex shrink-0 items-center justify-center pl-2 cursor-pointer
167
167
  bg-transparent border-none p-0 text-[var(--malachite-text-placeholder)]
168
168
  hover:text-[var(--malachite-text-primary)] transition-colors
169
169
  rounded-full focus-visible:[outline:2px_solid_var(--malachite-text-primary)] focus-visible:outline-offset-2`,
170
- children: /* @__PURE__ */ e(jt, { size: 13 })
170
+ children: /* @__PURE__ */ e(Ht, { size: 13 })
171
171
  }
172
172
  ),
173
173
  /* @__PURE__ */ e("div", { className: "flex items-center justify-center pl-2", children: /* @__PURE__ */ e(
@@ -181,7 +181,7 @@ const zt = {
181
181
  },
182
182
  className: "flex items-center justify-center cursor-pointer bg-transparent border-none p-0",
183
183
  children: /* @__PURE__ */ e(
184
- Pt,
184
+ Wt,
185
185
  {
186
186
  size: 13,
187
187
  style: {
@@ -196,29 +196,29 @@ const zt = {
196
196
  ]
197
197
  }
198
198
  );
199
- const A = /* @__PURE__ */ g(
199
+ const V = /* @__PURE__ */ m(
200
200
  "button",
201
201
  {
202
- ref: k,
202
+ ref: b,
203
203
  id: s,
204
204
  type: "button",
205
- "aria-label": I,
206
- "aria-labelledby": ct,
207
- "aria-invalid": c || void 0,
208
- "aria-required": Q || void 0,
209
- "aria-describedby": [l, d ? U : void 0].filter(Boolean).join(" ") || void 0,
205
+ "aria-label": F,
206
+ "aria-labelledby": ot,
207
+ "aria-invalid": l || void 0,
208
+ "aria-required": c || void 0,
209
+ "aria-describedby": [W, f ? Q : void 0].filter(Boolean).join(" ") || void 0,
210
210
  onClick: (a) => {
211
211
  a.stopPropagation(), n();
212
212
  },
213
- onKeyDown: K,
214
- disabled: m,
215
- style: dt,
216
- [Ot]: "",
213
+ onKeyDown: U,
214
+ disabled: x,
215
+ style: L,
216
+ [zt]: "",
217
217
  className: `
218
- relative w-full ${ot} ${lt}
218
+ relative w-full ${Y} ${it}
219
219
  border border-solid
220
220
  transition-all duration-200
221
- flex ${z ? "items-start" : "items-center"} gap-3
221
+ flex ${C ? "items-start" : "items-center"} gap-3
222
222
  cursor-pointer
223
223
  disabled:cursor-not-allowed
224
224
  `,
@@ -226,50 +226,50 @@ const zt = {
226
226
  /* @__PURE__ */ e(
227
227
  "span",
228
228
  {
229
- id: d ? void 0 : F,
230
- className: `text-left flex-1 min-w-0 flex ${d ? "flex-col gap-1" : "items-center gap-2"}`,
231
- children: r ? /* @__PURE__ */ g(it, { children: [
232
- /* @__PURE__ */ g(ye, { wrap: !!d, id: F, children: [
229
+ id: f ? void 0 : K,
230
+ className: `text-left flex-1 min-w-0 flex ${f ? "flex-col gap-1" : "items-center gap-2"}`,
231
+ children: r ? /* @__PURE__ */ m(rt, { children: [
232
+ /* @__PURE__ */ m(we, { wrap: !!f, id: K, children: [
233
233
  r.icon && /* @__PURE__ */ e("span", { className: "flex items-center justify-center shrink-0", children: r.icon }),
234
234
  /* @__PURE__ */ e(
235
- vt,
235
+ xt,
236
236
  {
237
237
  text: $,
238
- shouldShow: d ? Ft : q,
239
- triggerAs: d ? "span" : "div",
238
+ shouldShow: f ? Gt : A,
239
+ triggerAs: f ? "span" : "div",
240
240
  isShrinkable: !0,
241
241
  children: /* @__PURE__ */ e(
242
242
  "span",
243
243
  {
244
- ref: y,
245
- className: `min-w-0 block truncate text-[length:inherit] ${m ? "text-[var(--malachite-text-placeholder)]" : "text-[var(--malachite-text-primary)]"}`,
244
+ ref: G,
245
+ className: `min-w-0 block truncate text-[length:inherit] ${x ? "text-[var(--malachite-text-placeholder)]" : "text-[var(--malachite-text-primary)]"}`,
246
246
  children: $
247
247
  }
248
248
  )
249
249
  }
250
250
  )
251
251
  ] }),
252
- d && /* @__PURE__ */ e(
252
+ f && /* @__PURE__ */ e(
253
253
  "span",
254
254
  {
255
- id: U,
256
- ref: C,
255
+ id: Q,
256
+ ref: T,
257
257
  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",
258
- children: d
258
+ children: f
259
259
  }
260
260
  )
261
261
  ] }) : /* @__PURE__ */ e(
262
262
  "span",
263
263
  {
264
- className: `flex-1 min-w-0 truncate text-[length:inherit] ${m ? "text-[var(--malachite-text-placeholder)]" : "text-[var(--malachite-text-dimmed)]"}`,
265
- children: N ?? "Select Field"
264
+ className: `flex-1 min-w-0 truncate text-[length:inherit] ${x ? "text-[var(--malachite-text-placeholder)]" : "text-[var(--malachite-text-dimmed)]"}`,
265
+ children: R ?? "Select Field"
266
266
  }
267
267
  )
268
268
  }
269
269
  ),
270
- S && /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "shrink-0 w-4" }),
270
+ w && /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "shrink-0 w-4" }),
271
271
  /* @__PURE__ */ e("span", { className: "flex items-center justify-center shrink-0", children: /* @__PURE__ */ e(
272
- Pt,
272
+ Wt,
273
273
  {
274
274
  size: 13,
275
275
  style: {
@@ -282,29 +282,29 @@ const zt = {
282
282
  ]
283
283
  }
284
284
  );
285
- return w && !x ? /* @__PURE__ */ e(
286
- vt,
285
+ return y && !v ? /* @__PURE__ */ e(
286
+ xt,
287
287
  {
288
- text: be(ut, $, d),
289
- shouldShow: d ? J : Ft,
288
+ text: ye(yt, $, f),
289
+ shouldShow: f ? dt : Gt,
290
290
  fill: !0,
291
291
  describesTrigger: !1,
292
- children: A
292
+ children: V
293
293
  }
294
- ) : A;
294
+ ) : V;
295
295
  }
296
296
  );
297
- Ht.displayName = "DropdownTrigger";
298
- const Se = ({
297
+ Mt.displayName = "DropdownTrigger";
298
+ const Te = ({
299
299
  item: t,
300
300
  selected: n,
301
301
  subtitleLayout: r,
302
- onItemSelected: m
302
+ onItemSelected: x
303
303
  }) => {
304
- const c = n ? "var(--malachite-accent-foreground, rgb(2, 122, 66))" : "var(--malachite-text-primary, rgb(10, 10, 10))", u = r === "stacked" && !!t.subtitle, N = `mal-${Bt().replace(/[^a-zA-Z0-9_-]/g, "")}`, x = `${N}-label`, w = `${N}-subtitle`, P = f(null), R = () => {
305
- const S = P.current;
306
- return !!S && S.scrollWidth > S.clientWidth + 1;
307
- }, L = 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))", _ = t.rightSideTextAlignment === "left" ? "flex-start" : "flex-end", h = (
304
+ const l = n ? "var(--malachite-accent-foreground, rgb(2, 122, 66))" : "var(--malachite-text-primary, rgb(10, 10, 10))", d = r === "stacked" && !!t.subtitle, R = `mal-${Xt().replace(/[^a-zA-Z0-9_-]/g, "")}`, v = `${R}-label`, y = `${R}-subtitle`, P = g(null), _ = () => {
305
+ const w = P.current;
306
+ return !!w && w.scrollWidth > w.clientWidth + 1;
307
+ }, k = 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))", N = t.rightSideTextAlignment === "left" ? "flex-start" : "flex-end", h = (
308
308
  // `role="option"` would be invalid — nothing here declares a `listbox`, and an
309
309
  // orphaned option is dropped from the a11y tree. `aria-current`, not
310
310
  // `aria-pressed`: these are one-of-many choices, not toggles. tabIndex={-1}
@@ -317,11 +317,11 @@ const Se = ({
317
317
  "data-dropdown-option": "",
318
318
  "data-selected": n,
319
319
  "aria-current": n || void 0,
320
- "aria-labelledby": t.subtitle ? x : void 0,
321
- "aria-describedby": t.subtitle ? w : void 0,
320
+ "aria-labelledby": t.subtitle ? v : void 0,
321
+ "aria-describedby": t.subtitle ? y : void 0,
322
322
  tabIndex: -1,
323
- onClick: (S) => {
324
- S.stopPropagation(), m(t);
323
+ onClick: (w) => {
324
+ w.stopPropagation(), x(t);
325
325
  },
326
326
  className: "malachite-dropdown-option",
327
327
  style: {
@@ -340,7 +340,7 @@ const Se = ({
340
340
  font: "inherit",
341
341
  color: "inherit"
342
342
  },
343
- children: /* @__PURE__ */ g(
343
+ children: /* @__PURE__ */ m(
344
344
  "span",
345
345
  {
346
346
  style: {
@@ -348,15 +348,15 @@ const Se = ({
348
348
  display: "flex",
349
349
  alignItems: "center",
350
350
  gap: 12,
351
- ...u ? { minWidth: 0 } : {}
351
+ ...d ? { minWidth: 0 } : {}
352
352
  },
353
353
  children: [
354
- /* @__PURE__ */ e("span", { style: { flex: 1, display: "block", ...u ? { minWidth: 0 } : {} }, children: /* @__PURE__ */ g(
354
+ /* @__PURE__ */ e("span", { style: { flex: 1, display: "block", ...d ? { minWidth: 0 } : {} }, children: /* @__PURE__ */ m(
355
355
  "span",
356
356
  {
357
- style: u ? { display: "flex", flexDirection: "column", gap: 2 } : { display: "flex", alignItems: "center", gap: 8 },
357
+ style: d ? { display: "flex", flexDirection: "column", gap: 2 } : { display: "flex", alignItems: "center", gap: 8 },
358
358
  children: [
359
- /* @__PURE__ */ g(we, { row: u && !!t.icon, children: [
359
+ /* @__PURE__ */ m(Se, { row: d && !!t.icon, children: [
360
360
  t.icon && /* @__PURE__ */ e(
361
361
  "span",
362
362
  {
@@ -372,10 +372,10 @@ const Se = ({
372
372
  /* @__PURE__ */ e(
373
373
  "span",
374
374
  {
375
- id: t.subtitle ? x : void 0,
375
+ id: t.subtitle ? v : void 0,
376
376
  style: {
377
377
  fontWeight: 400,
378
- color: c,
378
+ color: l,
379
379
  whiteSpace: "nowrap",
380
380
  overflow: "hidden",
381
381
  textOverflow: "ellipsis",
@@ -385,23 +385,23 @@ const Se = ({
385
385
  }
386
386
  )
387
387
  ] }),
388
- t.subtitle && (u ? /* @__PURE__ */ e(
388
+ t.subtitle && (d ? /* @__PURE__ */ e(
389
389
  "span",
390
390
  {
391
- id: w,
391
+ id: y,
392
392
  ref: P,
393
393
  style: {
394
394
  fontSize: Tt,
395
395
  fontWeight: 400,
396
396
  lineHeight: 1.4,
397
- color: n ? c : "var(--malachite-text-dimmed, rgb(161, 161, 161))",
397
+ color: n ? l : "var(--malachite-text-dimmed, rgb(161, 161, 161))",
398
398
  whiteSpace: "nowrap",
399
399
  overflow: "hidden",
400
400
  textOverflow: "ellipsis"
401
401
  },
402
402
  children: t.subtitle
403
403
  }
404
- ) : /* @__PURE__ */ g(it, { children: [
404
+ ) : /* @__PURE__ */ m(rt, { children: [
405
405
  /* @__PURE__ */ e(
406
406
  "span",
407
407
  {
@@ -417,7 +417,7 @@ const Se = ({
417
417
  /* @__PURE__ */ e(
418
418
  "span",
419
419
  {
420
- id: w,
420
+ id: y,
421
421
  style: {
422
422
  fontSize: Tt,
423
423
  fontWeight: 400,
@@ -443,7 +443,7 @@ const Se = ({
443
443
  minWidth: t.rightSideText ? "var(--malachite-text-right-side-text-min-width, 80px)" : 0,
444
444
  flexShrink: 1,
445
445
  display: "flex",
446
- justifyContent: _
446
+ justifyContent: N
447
447
  },
448
448
  children: t.rightSideText && /* @__PURE__ */ e(
449
449
  "span",
@@ -451,7 +451,7 @@ const Se = ({
451
451
  style: {
452
452
  fontSize: "var(--malachite-text-right-side-text-font-size, 12px)",
453
453
  fontWeight: 400,
454
- color: L,
454
+ color: k,
455
455
  whiteSpace: "nowrap",
456
456
  overflow: "hidden",
457
457
  textOverflow: "ellipsis",
@@ -468,55 +468,55 @@ const Se = ({
468
468
  }
469
469
  )
470
470
  );
471
- return u ? /* @__PURE__ */ e(
472
- vt,
471
+ return d ? /* @__PURE__ */ e(
472
+ xt,
473
473
  {
474
474
  text: t.subtitle,
475
- shouldShow: R,
475
+ shouldShow: _,
476
476
  isShrinkable: !0,
477
477
  describesTrigger: !1,
478
478
  children: h
479
479
  }
480
480
  ) : h;
481
- }, Mt = Gt.forwardRef((t, n) => {
481
+ }, Zt = jt.forwardRef((t, n) => {
482
482
  const {
483
483
  items: r,
484
- onItemSelected: m,
485
- selectedItem: c,
486
- menuLoading: u,
487
- emptyMessage: N,
488
- autoFocus: x,
489
- positioned: w,
484
+ onItemSelected: x,
485
+ selectedItem: l,
486
+ menuLoading: d,
487
+ emptyMessage: R,
488
+ autoFocus: v,
489
+ positioned: y,
490
490
  onDismiss: P,
491
- subtitleLayout: R,
492
- size: L,
493
- style: _
494
- } = t, h = f(null);
495
- qt(() => {
496
- se();
497
- }, []), de(h, !0), Et(() => {
491
+ subtitleLayout: _,
492
+ size: k,
493
+ style: N
494
+ } = t, h = g(null);
495
+ Bt(() => {
496
+ ce();
497
+ }, []), ue(h, !0), Et(() => {
498
498
  var s;
499
- if (!x || !w)
499
+ if (!v || !y)
500
500
  return;
501
501
  const o = Ct(h.current);
502
- (s = o.find((b) => b.dataset.selected === "true") ?? o[0] ?? h.current) == null || s.focus();
503
- }, [x, w]);
504
- const S = (o) => {
505
- var l;
502
+ (s = o.find((u) => u.dataset.selected === "true") ?? o[0] ?? h.current) == null || s.focus();
503
+ }, [v, y]);
504
+ const w = (o) => {
505
+ var W;
506
506
  if (o.key === "Tab") {
507
507
  P();
508
508
  return;
509
509
  }
510
- const v = Ct(h.current);
511
- if (v.length === 0)
510
+ const S = Ct(h.current);
511
+ if (S.length === 0)
512
512
  return;
513
- const s = v.indexOf(document.activeElement), b = {
513
+ const s = S.indexOf(document.activeElement), u = {
514
514
  ArrowDown: s + 1,
515
515
  ArrowUp: s - 1,
516
516
  Home: 0,
517
- End: v.length - 1
517
+ End: S.length - 1
518
518
  }[o.key];
519
- b !== void 0 && (o.preventDefault(), (l = v[Math.min(Math.max(b, 0), v.length - 1)]) == null || l.focus());
519
+ u !== void 0 && (o.preventDefault(), (W = S[Math.min(Math.max(u, 0), S.length - 1)]) == null || W.focus());
520
520
  };
521
521
  return /* @__PURE__ */ e(
522
522
  "div",
@@ -524,9 +524,9 @@ const Se = ({
524
524
  ref: (o) => {
525
525
  h.current = o, typeof n == "function" ? n(o) : n && (n.current = o);
526
526
  },
527
- ...ce("dropdown"),
527
+ ...de("dropdown"),
528
528
  tabIndex: -1,
529
- onKeyDown: S,
529
+ onKeyDown: w,
530
530
  style: {
531
531
  background: "var(--malachite-card-background, rgb(255, 255, 255))",
532
532
  border: "1px solid var(--malachite-card-border, rgb(232, 232, 232))",
@@ -534,13 +534,13 @@ const Se = ({
534
534
  boxShadow: "0px 2px 5px 0px rgba(0, 0, 0, 0.1)",
535
535
  maxHeight: 400,
536
536
  overflow: "hidden",
537
- fontSize: ee[L],
538
- ..._
537
+ fontSize: re[k],
538
+ ...N
539
539
  },
540
- children: u ? /* @__PURE__ */ g("div", { style: zt, children: [
541
- /* @__PURE__ */ e(te, { size: "xxxsmall" }),
540
+ children: d ? /* @__PURE__ */ m("div", { style: Ft, children: [
541
+ /* @__PURE__ */ e(ee, { size: "xxxsmall" }),
542
542
  /* @__PURE__ */ e("span", { children: "Loading…" })
543
- ] }) : r.length === 0 ? /* @__PURE__ */ e("div", { style: zt, children: N }) : /* @__PURE__ */ e(
543
+ ] }) : r.length === 0 ? /* @__PURE__ */ e("div", { style: Ft, children: R }) : /* @__PURE__ */ e(
544
544
  "div",
545
545
  {
546
546
  style: {
@@ -553,10 +553,10 @@ const Se = ({
553
553
  scrollbarWidth: "thin",
554
554
  scrollbarColor: "var(--malachite-text-placeholder, rgb(187, 187, 187)) transparent"
555
555
  },
556
- children: r.map((o, v) => {
557
- const s = r[v - 1], b = !!o.group && (!s || s.group !== o.group);
558
- return /* @__PURE__ */ g("div", { style: { flexShrink: 0 }, children: [
559
- b && /* @__PURE__ */ e(
556
+ children: r.map((o, S) => {
557
+ const s = r[S - 1], u = !!o.group && (!s || s.group !== o.group);
558
+ return /* @__PURE__ */ m("div", { style: { flexShrink: 0 }, children: [
559
+ u && /* @__PURE__ */ e(
560
560
  "div",
561
561
  {
562
562
  style: {
@@ -571,12 +571,12 @@ const Se = ({
571
571
  }
572
572
  ),
573
573
  /* @__PURE__ */ e(
574
- Se,
574
+ Te,
575
575
  {
576
576
  item: o,
577
- onItemSelected: m,
578
- subtitleLayout: R,
579
- selected: o.id === (c == null ? void 0 : c.id) || !1
577
+ onItemSelected: x,
578
+ subtitleLayout: _,
579
+ selected: o.id === (l == null ? void 0 : l.id) || !1
580
580
  }
581
581
  )
582
582
  ] }, o.id);
@@ -586,240 +586,242 @@ const Se = ({
586
586
  }
587
587
  );
588
588
  });
589
- Mt.displayName = "DropdownPanel";
590
- const je = ({
589
+ Zt.displayName = "DropdownPanel";
590
+ const He = ({
591
591
  items: t,
592
592
  onItemSelected: n,
593
593
  defaultValue: r,
594
- value: m,
595
- disabled: c = !1,
596
- error: u,
597
- tone: N,
598
- label: x,
599
- hint: w,
600
- tooltip: P,
601
- name: R,
602
- required: L = !1,
603
- requiredIndicator: _,
604
- loading: h,
605
- menuLoading: S,
606
- formControl: o,
607
- description: v,
608
- helperText: s,
609
- placeholder: b,
610
- search: l = !1,
611
- showSubtitleInTrigger: Q = !1,
612
- subtitleLayout: I = "inline",
613
- clearable: at = !1,
614
- size: T = "large",
615
- fullWidth: k = !1,
616
- id: z,
617
- "aria-label": ot,
618
- "aria-labelledby": lt
594
+ value: x,
595
+ disabled: l = !1,
596
+ error: d,
597
+ tone: R,
598
+ label: v,
599
+ hint: y,
600
+ rightSideContent: P,
601
+ tooltip: _,
602
+ name: k,
603
+ required: N = !1,
604
+ requiredIndicator: h,
605
+ loading: w,
606
+ menuLoading: o,
607
+ formControl: S,
608
+ description: s,
609
+ helperText: u,
610
+ placeholder: W,
611
+ search: c = !1,
612
+ showSubtitleInTrigger: F = !1,
613
+ subtitleLayout: nt = "inline",
614
+ clearable: bt = !1,
615
+ size: b = "large",
616
+ fullWidth: C = !1,
617
+ id: Y,
618
+ "aria-label": it,
619
+ "aria-labelledby": K
619
620
  }) => {
620
- const { controlId: F, labelId: U, descriptionId: st, hintId: ct, helperTextId: K } = Qt({
621
- id: z,
622
- label: x,
623
- description: v,
624
- hint: w,
621
+ const { controlId: Q, labelId: at, descriptionId: ot, hintId: U, helperTextId: G } = Ut({
622
+ id: Y,
623
+ label: v,
624
+ description: s,
625
+ hint: y,
625
626
  helperText: !0
626
- }), [y, C] = X(!1), [dt, V] = X(r), $ = m ?? dt, d = t.find((i) => i.id === $), q = at && $ !== void 0 && $ !== "" && !c, yt = Q && !l && !!(d != null && d.subtitle), ut = `Clear ${x ?? b ?? "selection"}`, pt = f(r);
627
+ }), [T, L] = B(!1), [lt, $] = B(r), f = x ?? lt, A = t.find((i) => i.id === f), st = bt && f !== void 0 && f !== "" && !l, yt = F && !c && !!(A != null && A.subtitle), ct = `Clear ${v ?? W ?? "selection"}`, dt = g(r);
627
628
  Et(() => {
628
- pt.current !== r && (pt.current = r, V(r));
629
+ dt.current !== r && (dt.current = r, $(r));
629
630
  }, [r]);
630
- const [J, A] = X(""), [a, tt] = X(!1), Lt = f(null), ht = f(null), G = f(null), [E, Nt] = X(null), ft = f(!0), B = St(() => {
631
+ const [V, a] = B(""), [ut, Lt] = B(!1), Nt = g(null), pt = g(null), j = g(null), [E, Rt] = B(null), ht = g(!0), q = St(() => {
631
632
  var p;
632
- const i = ht.current;
633
+ const i = pt.current;
633
634
  i && ((p = i instanceof HTMLButtonElement ? i : i.querySelector("input")) == null || p.focus());
634
- }, []), Rt = St(
635
+ }, []), _t = St(
635
636
  (i) => {
636
637
  var p;
637
- i.stopPropagation(), V(void 0), (p = j.current) == null || p.call(j, wt.current), n == null || n(void 0), l && (ft.current = !1), B();
638
+ i.stopPropagation(), $(void 0), (p = H.current) == null || p.call(H, wt.current), n == null || n(void 0), c && (ht.current = !1), q();
638
639
  },
639
- [n, l, B]
640
- ), _t = f(T), kt = f(k), W = St(() => {
640
+ [n, c, q]
641
+ ), kt = g(b), $t = g(C), O = St(() => {
641
642
  var p, D;
642
- const i = ht.current;
643
- i && Nt(
644
- re({
643
+ const i = pt.current;
644
+ i && Rt(
645
+ ne({
645
646
  triggerRect: i.getBoundingClientRect(),
646
- panelWidth: ((p = G.current) == null ? void 0 : p.offsetWidth) ?? 0,
647
- panelHeight: ((D = G.current) == null ? void 0 : D.offsetHeight) ?? 0,
648
- size: _t.current,
649
- fullWidth: kt.current,
647
+ panelWidth: ((p = j.current) == null ? void 0 : p.offsetWidth) ?? 0,
648
+ panelHeight: ((D = j.current) == null ? void 0 : D.offsetHeight) ?? 0,
649
+ size: kt.current,
650
+ fullWidth: $t.current,
650
651
  viewportWidth: window.innerWidth,
651
652
  viewportHeight: window.innerHeight
652
653
  })
653
654
  );
654
655
  }, []);
655
- Dt(() => {
656
- _t.current = T, kt.current = k, y && W();
657
- }, [T, k, y, W]), Et(() => {
658
- if (!y) {
659
- Nt(null), tt(!1);
656
+ Pt(() => {
657
+ kt.current = b, $t.current = C, T && O();
658
+ }, [b, C, T, O]), Et(() => {
659
+ if (!T) {
660
+ Rt(null), Lt(!1);
660
661
  return;
661
662
  }
662
- W();
663
- const i = (M) => {
664
- var nt;
665
- const O = M.composedPath(), Z = Lt.current, rt = G.current, xt = !!Z && O.includes(Z), $t = !!rt && O.includes(rt);
666
- !xt && !$t && (C(!1), l && A(""), (nt = H.current) == null || nt.call(H));
667
- }, p = le(() => {
668
- C(!1), l && A(""), B();
669
- }), D = () => W();
670
- let et = 0, gt = "";
671
- const mt = () => {
672
- const M = ht.current;
673
- if (M) {
674
- const O = M.getBoundingClientRect();
675
- if (ie(O, window.innerWidth, window.innerHeight)) {
676
- C(!1), l && A("");
663
+ O();
664
+ const i = (Z) => {
665
+ var et;
666
+ const z = Z.composedPath(), I = Nt.current, tt = j.current, mt = !!I && z.includes(I), At = !!tt && z.includes(tt);
667
+ !mt && !At && (L(!1), c && a(""), (et = M.current) == null || et.call(M));
668
+ }, p = se(() => {
669
+ L(!1), c && a(""), q();
670
+ }), D = () => O();
671
+ let J = 0, ft = "";
672
+ const gt = () => {
673
+ const Z = pt.current;
674
+ if (Z) {
675
+ const z = Z.getBoundingClientRect();
676
+ if (ae(z, window.innerWidth, window.innerHeight)) {
677
+ L(!1), c && a("");
677
678
  return;
678
679
  }
679
- const Z = ae(O);
680
- Z !== gt && (gt = Z, W());
680
+ const I = oe(z);
681
+ I !== ft && (ft = I, O());
681
682
  }
682
- et = requestAnimationFrame(mt);
683
+ J = requestAnimationFrame(gt);
683
684
  };
684
- return et = requestAnimationFrame(mt), document.addEventListener("mousedown", i), window.addEventListener("scroll", D, !0), window.addEventListener("resize", D), () => {
685
- cancelAnimationFrame(et), document.removeEventListener("mousedown", i), p(), window.removeEventListener("scroll", D, !0), window.removeEventListener("resize", D);
685
+ return J = requestAnimationFrame(gt), document.addEventListener("mousedown", i), window.addEventListener("scroll", D, !0), window.addEventListener("resize", D), () => {
686
+ cancelAnimationFrame(J), document.removeEventListener("mousedown", i), p(), window.removeEventListener("scroll", D, !0), window.removeEventListener("resize", D);
686
687
  };
687
- }, [y, l, W, B]), Dt(() => {
688
- y && G.current && W();
689
- }, [y, W]);
690
- const j = f(void 0), H = f(void 0), wt = f(""), Zt = (i) => {
688
+ }, [T, c, O, q]), Pt(() => {
689
+ T && j.current && O();
690
+ }, [T, O]);
691
+ const H = g(void 0), M = g(void 0), wt = g(""), It = (i) => {
691
692
  var p;
692
- V(i == null ? void 0 : i.id), (p = j.current) == null || p.call(j, (i == null ? void 0 : i.id) ?? wt.current), C(!1), l && (A(""), ft.current = !1), n == null || n(i == null ? void 0 : i.id), B();
693
- }, It = () => {
694
- C(!1), l && A(""), B();
693
+ $(i == null ? void 0 : i.id), (p = H.current) == null || p.call(H, (i == null ? void 0 : i.id) ?? wt.current), L(!1), c && (a(""), ht.current = !1), n == null || n(i == null ? void 0 : i.id), q();
695
694
  }, Kt = () => {
696
- const i = Ct(G.current)[0];
695
+ L(!1), c && a(""), q();
696
+ }, Vt = () => {
697
+ const i = Ct(j.current)[0];
697
698
  if (i) {
698
699
  i.focus();
699
700
  return;
700
701
  }
701
- tt(!0), C(!0);
702
- }, Vt = l && J ? t.filter((i) => pe(i, J)) : t;
702
+ Lt(!0), L(!0);
703
+ }, qt = c && V ? t.filter((i) => he(i, V)) : t;
703
704
  return /* @__PURE__ */ e(
704
- Yt,
705
+ Qt,
705
706
  {
706
- fullWidth: k,
707
- label: x,
708
- hint: w,
709
- tooltip: P,
710
- name: R,
711
- required: L,
712
- requiredIndicator: _,
713
- loading: h,
714
- formControl: o,
715
- description: v,
716
- controlId: F,
717
- labelId: U,
718
- descriptionId: st,
719
- hintId: ct,
707
+ fullWidth: C,
708
+ label: v,
709
+ hint: y,
710
+ rightSideContent: P,
711
+ tooltip: _,
712
+ name: k,
713
+ required: N,
714
+ requiredIndicator: h,
715
+ loading: w,
716
+ formControl: S,
717
+ description: s,
718
+ controlId: Q,
719
+ labelId: at,
720
+ descriptionId: ot,
721
+ hintId: U,
720
722
  loadingComponent: /* @__PURE__ */ e(
721
- Jt,
723
+ te,
722
724
  {
723
- heightClass: bt[T],
724
- helperText: !!s,
725
+ heightClass: vt[b],
726
+ helperText: !!u,
725
727
  helperTextMarginTop: !0
726
728
  }
727
729
  ),
728
- children: ({ error: i, message: p, onFieldChange: D, onFieldBlur: et, emptyValue: gt }) => {
729
- j.current = D, H.current = et, wt.current = gt;
730
- const mt = u ?? i, M = u === !1 ? void 0 : p, O = `${K}-error`, Z = [
731
- st,
732
- ct,
733
- s ? K : void 0,
734
- M ? O : void 0
730
+ children: ({ error: i, message: p, onFieldChange: D, onFieldBlur: J, emptyValue: ft }) => {
731
+ H.current = D, M.current = J, wt.current = ft;
732
+ const gt = d ?? i, Z = d === !1 ? void 0 : p, z = `${G}-error`, I = [
733
+ ot,
734
+ U,
735
+ u ? G : void 0,
736
+ Z ? z : void 0
735
737
  ].filter(Boolean).join(" ") || void 0;
736
- return /* @__PURE__ */ g(it, { children: [
737
- /* @__PURE__ */ g(
738
+ return /* @__PURE__ */ m(rt, { children: [
739
+ /* @__PURE__ */ m(
738
740
  "div",
739
741
  {
740
- ref: Lt,
742
+ ref: Nt,
741
743
  className: "relative w-full",
742
- onBlur: (rt) => {
743
- var nt, At;
744
- const xt = rt.relatedTarget;
745
- rt.currentTarget.contains(xt) || ((nt = G.current) == null ? void 0 : nt.contains(xt)) === !0 || (At = H.current) == null || At.call(H);
744
+ onBlur: (tt) => {
745
+ var et, Dt;
746
+ const mt = tt.relatedTarget;
747
+ tt.currentTarget.contains(mt) || ((et = j.current) == null ? void 0 : et.contains(mt)) === !0 || (Dt = M.current) == null || Dt.call(M);
746
748
  },
747
749
  children: [
748
- q && !l && /* @__PURE__ */ e(
750
+ st && !c && /* @__PURE__ */ e(
749
751
  "button",
750
752
  {
751
753
  type: "button",
752
- onClick: Rt,
753
- "aria-label": ut,
754
- className: `absolute ${yt ? me[T] : "top-1/2 -translate-y-1/2"} z-10 flex items-center
754
+ onClick: _t,
755
+ "aria-label": ct,
756
+ className: `absolute ${yt ? xe[b] : "top-1/2 -translate-y-1/2"} z-10 flex items-center
755
757
  justify-center rounded-full text-[var(--malachite-text-placeholder)]
756
758
  hover:text-[var(--malachite-text-primary)] transition-colors
757
- focus-visible:[outline:2px_solid_var(--malachite-text-primary)] focus-visible:outline-offset-2 ${ge[T]}`,
758
- children: /* @__PURE__ */ e(jt, { size: 13 })
759
+ focus-visible:[outline:2px_solid_var(--malachite-text-primary)] focus-visible:outline-offset-2 ${me[b]}`,
760
+ children: /* @__PURE__ */ e(Ht, { size: 13 })
759
761
  }
760
762
  ),
761
763
  /* @__PURE__ */ e(
762
- Ht,
764
+ Mt,
763
765
  {
764
- hasClear: q,
765
- onClear: Rt,
766
- clearLabel: ut,
767
- ref: ht,
768
- isOpen: y,
769
- onClick: () => !c && C(!y),
770
- selectedItem: d,
771
- disabled: c,
772
- error: mt,
773
- tone: N,
774
- placeholder: b,
775
- search: l,
776
- showSubtitleInTrigger: Q,
777
- searchQuery: J,
778
- onSearchChange: A,
766
+ hasClear: st,
767
+ onClear: _t,
768
+ clearLabel: ct,
769
+ ref: pt,
770
+ isOpen: T,
771
+ onClick: () => !l && L(!T),
772
+ selectedItem: A,
773
+ disabled: l,
774
+ error: gt,
775
+ tone: R,
776
+ placeholder: W,
777
+ search: c,
778
+ showSubtitleInTrigger: F,
779
+ searchQuery: V,
780
+ onSearchChange: a,
779
781
  onFocusOpen: () => {
780
- if (!ft.current) {
781
- ft.current = !0;
782
+ if (!ht.current) {
783
+ ht.current = !0;
782
784
  return;
783
785
  }
784
- C(!0);
786
+ L(!0);
785
787
  },
786
788
  onArrowDown: () => {
787
- c || Kt();
789
+ l || Vt();
788
790
  },
789
- size: T,
790
- controlId: F,
791
- hasCallerId: !!z,
792
- labelId: U,
793
- describedBy: Z,
794
- required: L,
795
- ariaLabel: ot,
796
- ariaLabelledBy: lt
791
+ size: b,
792
+ controlId: Q,
793
+ hasCallerId: !!Y,
794
+ labelId: at,
795
+ describedBy: I,
796
+ required: N,
797
+ ariaLabel: it,
798
+ ariaLabelledBy: K
797
799
  }
798
800
  ),
799
- y && Xt(
801
+ T && Yt(
800
802
  /* @__PURE__ */ e(
801
- Mt,
803
+ Zt,
802
804
  {
803
- ref: G,
805
+ ref: j,
804
806
  style: {
805
807
  position: "fixed",
806
808
  top: (E == null ? void 0 : E.top) ?? 0,
807
809
  left: (E == null ? void 0 : E.left) ?? 0,
808
- width: Wt(T, k) ? "auto" : E == null ? void 0 : E.width,
809
- maxWidth: Wt(T, k) ? `calc(100vw - ${ne * 2}px)` : void 0,
810
+ width: Ot(b, C) ? "auto" : E == null ? void 0 : E.width,
811
+ maxWidth: Ot(b, C) ? `calc(100vw - ${ie * 2}px)` : void 0,
810
812
  visibility: E ? "visible" : "hidden",
811
813
  opacity: E ? 1 : 0
812
814
  },
813
- items: Vt,
814
- onItemSelected: Zt,
815
- selectedItem: d,
816
- menuLoading: S,
815
+ items: qt,
816
+ onItemSelected: It,
817
+ selectedItem: A,
818
+ menuLoading: o,
817
819
  emptyMessage: t.length === 0 ? "No options available" : "No results found",
818
- subtitleLayout: I,
819
- size: T,
820
- autoFocus: !l || a,
820
+ subtitleLayout: nt,
821
+ size: b,
822
+ autoFocus: !c || ut,
821
823
  positioned: E !== null,
822
- onDismiss: It
824
+ onDismiss: Kt
823
825
  }
824
826
  ),
825
827
  document.body
@@ -827,21 +829,21 @@ const je = ({
827
829
  ]
828
830
  }
829
831
  ),
830
- s && /* @__PURE__ */ e(
832
+ u && /* @__PURE__ */ e(
831
833
  "div",
832
834
  {
833
- id: K,
835
+ id: G,
834
836
  className: "mt-1 text-[length:var(--malachite-font-size-small,13px)] text-left pl-2 text-[var(--malachite-text-dimmed,rgb(161,161,161))]",
835
- children: s
837
+ children: u
836
838
  }
837
839
  ),
838
- /* @__PURE__ */ e(Ut, { id: O, message: M, spaced: !0 })
840
+ /* @__PURE__ */ e(Jt, { id: z, message: Z, spaced: !0 })
839
841
  ] });
840
842
  }
841
843
  }
842
844
  );
843
845
  };
844
846
  export {
845
- je as Dropdown
847
+ He as Dropdown
846
848
  };
847
849
  //# sourceMappingURL=Dropdown.js.map