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