@spear-ai/spectral 1.11.2 → 1.11.3

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.
package/dist/Select.js CHANGED
@@ -6,16 +6,18 @@ import { LoaderIcon as n } from "./Icons/LoaderIcon.js";
6
6
  import { t as r } from "./twUtils-VNWgstKL.js";
7
7
  import { EmptyState as i, ErrorMessage as a, LoadingState as o, getAriaProps as s, getDropdownSurfaceClasses as c, getErrorMessageId as l, getFormFieldCSSProperties as ee, getOptionClasses as te, getStateClasses as ne, getTriggerClasses as re, groupOptions as ie, useFormFieldId as ae, useFormFieldState as oe } from "./utils/formFieldUtils.js";
8
8
  import { Label as u } from "./Label.js";
9
- import { a as d, c as f, d as p, f as m, h, i as g, l as se, m as ce, n as le, o as ue, p as de, r as fe, t as pe, u as me } from "./dist-fW81qjVl.js";
10
- import { useState as he } from "react";
9
+ import { useAutoDropdownHorizontalShift as d } from "./utils/dropdownPositioning.js";
10
+ import { a as f, c as p, d as m, f as h, h as se, i as ce, l as le, m as ue, n as de, o as fe, p as pe, r as me, t as he, u as ge } from "./dist-fW81qjVl.js";
11
+ import { useState as g } from "react";
11
12
  import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
12
13
  //#region src/components/Select/Select.tsx
13
14
  var b = (b) => {
14
- let x = "value" in b, { align: S = "start", alignOffset: C = 0, avoidCollisions: w = !0, className: T, collisionBoundary: E, collisionPadding: D = 10, defaultValue: O, dropdownWidth: k = "trigger", emptyMessage: A = "No options found", errorMessage: j, id: M, label: N, labelClassName: P, loadingMessage: F = "Loading…", name: I, onChange: L, options: R = [], placeholder: z = "Select an option", position: B = "popper", ref: ge, side: _e = "bottom", sideOffset: ve = 4, state: V = "default", value: H, "aria-label": ye, "aria-describedby": be, ...U } = b, W = x ? H ?? "" : H, [G, xe] = he(!1), K = ae(M, I), q = l(K), J = k === "trigger" ? "var(--radix-select-trigger-width)" : k === "content" ? "max-content" : k, Y = k === "trigger" || k === "content" ? k : "custom", Se = {
15
- "--spectral-select-content-width": J,
16
- width: B === "item-aligned" ? J : void 0
17
- }, { isDisabled: X, isLoading: Z, isInvalid: Ce } = oe(U.disabled, V), we = s(V, be, U.required, q), { groups: Q, ungrouped: $ } = ie(R), Te = () => {
18
- if (Z) return /* @__PURE__ */ v(o, {
15
+ let x = "value" in b, { align: S = "start", alignOffset: C = 0, avoidCollisions: w = !0, className: T, collisionBoundary: E, collisionPadding: D = 10, defaultValue: O, dropdownWidth: k = "trigger", emptyMessage: A = "No options found", errorMessage: j, id: M, label: N, labelClassName: P, loadingMessage: F = "Loading…", name: I, onChange: L, options: R = [], placeholder: _e = "Select an option", position: z = "popper", ref: ve, side: ye = "bottom", sideOffset: be = 4, state: B = "default", value: V, "aria-label": xe, "aria-describedby": Se, ...H } = b, U = x ? V ?? "" : V, [W, Ce] = g(!1), { dropdownShiftStyle: we, setDropdownElement: Te } = d(W), G = ae(M, I), K = l(G), q = k === "trigger" ? "var(--radix-select-trigger-width)" : k === "content" ? "max-content" : k, J = k === "trigger" || k === "content" ? k : "custom", Ee = {
16
+ "--spectral-select-content-width": q,
17
+ width: z === "item-aligned" ? q : void 0,
18
+ ...we
19
+ }, { isDisabled: Y, isLoading: X, isInvalid: De } = oe(H.disabled, B), Z = s(B, Se, H.required, K), { groups: Q, ungrouped: $ } = ie(R), Oe = () => {
20
+ if (X) return /* @__PURE__ */ v(o, {
19
21
  "data-testid": "spectral-select-loading",
20
22
  message: F
21
23
  });
@@ -24,17 +26,17 @@ var b = (b) => {
24
26
  message: A
25
27
  });
26
28
  let t = (t) => {
27
- let n = W === t.value;
28
- return /* @__PURE__ */ y(g, {
29
+ let n = U === t.value;
30
+ return /* @__PURE__ */ y(ce, {
29
31
  className: r(te(!!t.disabled, !1, n), "relative flex w-full cursor-pointer items-center"),
30
32
  "data-testid": "spectral-select-item",
31
33
  disabled: t.disabled,
32
34
  value: t.value,
33
- children: [/* @__PURE__ */ v(ue, {
35
+ children: [/* @__PURE__ */ v(fe, {
34
36
  "data-testid": "spectral-select-item-text",
35
37
  className: "block truncate",
36
38
  children: t.label
37
- }), /* @__PURE__ */ v(d, {
39
+ }), /* @__PURE__ */ v(f, {
38
40
  "data-testid": "spectral-select-item-selected-indicator",
39
41
  asChild: !0,
40
42
  children: /* @__PURE__ */ v("span", {
@@ -44,13 +46,13 @@ var b = (b) => {
44
46
  })]
45
47
  }, t.value);
46
48
  };
47
- return /* @__PURE__ */ y(_, { children: [$.length > 0 && /* @__PURE__ */ y(_, { children: [$.map(t), Object.keys(Q).length > 0 && /* @__PURE__ */ v(m, {
49
+ return /* @__PURE__ */ y(_, { children: [$.length > 0 && /* @__PURE__ */ y(_, { children: [$.map(t), Object.keys(Q).length > 0 && /* @__PURE__ */ v(h, {
48
50
  className: "-mx-1 my-1 h-px bg-border-secondary",
49
51
  "data-testid": "spectral-select-separator"
50
- })] }), Object.entries(Q).map(([e, n], i) => /* @__PURE__ */ y(le, {
52
+ })] }), Object.entries(Q).map(([e, n], i) => /* @__PURE__ */ y(de, {
51
53
  "data-testid": "spectral-select-group",
52
54
  children: [
53
- i > 0 && /* @__PURE__ */ v(m, {
55
+ i > 0 && /* @__PURE__ */ v(h, {
54
56
  className: "-mx-1 my-1 h-px bg-border-secondary",
55
57
  "data-testid": "spectral-select-group-separator"
56
58
  }),
@@ -67,72 +69,73 @@ var b = (b) => {
67
69
  className: "w-full",
68
70
  children: [
69
71
  N && /* @__PURE__ */ v(u, {
70
- className: r("mb-2 block text-text-primary", P, X && "text-text-secondary"),
72
+ className: r("mb-2 block text-text-primary", P, Y && "text-text-secondary"),
71
73
  "data-testid": "spectral-select-label",
72
- htmlFor: K,
74
+ htmlFor: G,
73
75
  children: N
74
76
  }),
75
- /* @__PURE__ */ y(se, {
77
+ /* @__PURE__ */ y(le, {
76
78
  "data-testid": "spectral-select",
77
79
  defaultValue: O,
78
- disabled: X,
80
+ disabled: Y,
79
81
  name: I,
80
- onOpenChange: xe,
82
+ onOpenChange: Ce,
81
83
  onValueChange: L,
82
- open: G,
83
- required: U.required,
84
- value: W,
85
- children: [/* @__PURE__ */ v(de, {
86
- "aria-controls": K,
87
- "aria-expanded": G,
88
- "aria-label": ye ?? N,
84
+ open: W,
85
+ required: H.required,
86
+ value: U,
87
+ children: [/* @__PURE__ */ v(pe, {
88
+ "aria-controls": G,
89
+ "aria-expanded": W,
90
+ "aria-label": xe ?? N,
89
91
  asChild: !0,
90
- className: r(re(!1, V), ne(V), "text-input-text data-placeholder:text-input-text!", T),
92
+ className: r(re(!1, B), ne(B), "text-input-text data-placeholder:text-input-text-placeholder!", T),
91
93
  "data-slot": "select-trigger",
92
- "data-state": V,
94
+ "data-state": B,
93
95
  "data-testid": "spectral-select-trigger",
94
- id: K,
95
- ref: ge,
96
+ id: G,
97
+ ref: ve,
96
98
  role: "combobox",
97
99
  style: ee(),
98
- ...we,
99
- ...U,
100
+ ...Z,
101
+ ...H,
100
102
  children: /* @__PURE__ */ y("button", {
101
- className: "min-w-0 gap-2 [&>span]:min-w-0 grid w-full cursor-pointer grid-cols-[minmax(0,1fr)_auto] items-center overflow-hidden text-left whitespace-nowrap text-input-text! data-placeholder:text-input-text! [&>span]:block [&>span]:overflow-hidden [&>span]:text-ellipsis [&>span]:whitespace-nowrap [&>span[data-placeholder]]:text-input-text!",
103
+ className: "min-w-0 gap-2 [&>span]:min-w-0 grid w-full cursor-pointer grid-cols-[minmax(0,1fr)_auto] items-center overflow-hidden text-left whitespace-nowrap text-input-text! data-placeholder:text-input-text-placeholder! [&>span]:block [&>span]:overflow-hidden [&>span]:text-ellipsis [&>span]:whitespace-nowrap [&>span[data-placeholder]]:text-input-text-placeholder!",
102
104
  type: "button",
103
- disabled: X,
104
- children: [/* @__PURE__ */ v(ce, {
105
- className: "min-w-0 block max-w-full flex-1 truncate text-left whitespace-nowrap text-input-text! data-placeholder:text-input-text!",
105
+ disabled: Y,
106
+ children: [/* @__PURE__ */ v(ue, {
107
+ className: "min-w-0 block max-w-full flex-1 truncate text-left whitespace-nowrap text-input-text! data-placeholder:text-input-text-placeholder!",
106
108
  "data-testid": "spectral-select-value",
107
- placeholder: z
108
- }), /* @__PURE__ */ v(fe, {
109
+ placeholder: _e
110
+ }), /* @__PURE__ */ v(me, {
109
111
  asChild: !0,
110
112
  children: /* @__PURE__ */ v("div", {
111
113
  className: "flex shrink-0 cursor-pointer items-center",
112
- children: Z ? /* @__PURE__ */ v(n, { size: 20 }) : /* @__PURE__ */ v(t, {
113
- className: r("transition-transform duration-200", G && "rotate-180"),
114
+ children: X ? /* @__PURE__ */ v(n, { size: 20 }) : /* @__PURE__ */ v(t, {
115
+ className: r("transition-transform duration-200", W && "rotate-180"),
114
116
  size: 20
115
117
  })
116
118
  })
117
119
  })]
118
120
  })
119
- }), /* @__PURE__ */ v(f, { children: /* @__PURE__ */ y(pe, {
121
+ }), /* @__PURE__ */ v(p, { children: /* @__PURE__ */ y(he, {
120
122
  align: S,
121
123
  alignOffset: C,
122
124
  avoidCollisions: w,
123
- className: r("relative z-50 motion-safe:data-[state=closed]:animate-out motion-safe:data-[state=open]:animate-in", c(), "motion-safe:data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95", "max-h-[min(var(--radix-select-content-available-height),300px)] motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=top]:slide-in-from-bottom-2", "min-w-32 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto", B === "popper" && "data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1"),
125
+ className: r("relative z-50 motion-safe:data-[state=closed]:animate-out motion-safe:data-[state=open]:animate-in", c(), "motion-safe:data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95", "max-h-[min(var(--radix-select-content-available-height),300px)] motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=top]:slide-in-from-bottom-2", "min-w-32 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto", z === "popper" && "data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1"),
124
126
  collisionBoundary: E,
125
127
  collisionPadding: D,
126
- "data-dropdown-width-mode": Y,
127
- "data-dropdown-width-value": Y === "custom" ? k : void 0,
128
+ "data-dropdown-width-mode": J,
129
+ "data-dropdown-width-value": J === "custom" ? k : void 0,
128
130
  "data-slot": "select-content",
129
131
  "data-testid": "spectral-select-content",
130
- position: B,
131
- side: _e,
132
- sideOffset: ve,
133
- style: Se,
132
+ position: z,
133
+ ref: Te,
134
+ side: ye,
135
+ sideOffset: be,
136
+ style: Ee,
134
137
  children: [
135
- /* @__PURE__ */ v(p, {
138
+ /* @__PURE__ */ v(m, {
136
139
  className: "py-1 flex cursor-default items-center justify-center",
137
140
  "data-testid": "spectral-select-scroll-up-button",
138
141
  children: /* @__PURE__ */ v(t, {
@@ -141,15 +144,15 @@ var b = (b) => {
141
144
  size: 18
142
145
  })
143
146
  }),
144
- /* @__PURE__ */ v(h, {
147
+ /* @__PURE__ */ v(se, {
145
148
  asChild: !0,
146
149
  children: /* @__PURE__ */ v("div", {
147
- className: r("p-1", B === "popper" && "scroll-my-1 h-(--radix-select-trigger-height) w-(--spectral-select-content-width) min-w-(--spectral-select-content-width)"),
150
+ className: r("p-1", z === "popper" && "scroll-my-1 h-(--radix-select-trigger-height) w-(--spectral-select-content-width) min-w-(--spectral-select-content-width)"),
148
151
  "data-testid": "spectral-select-items",
149
- children: Te()
152
+ children: Oe()
150
153
  })
151
154
  }),
152
- /* @__PURE__ */ v(me, {
155
+ /* @__PURE__ */ v(ge, {
153
156
  className: "py-1 flex cursor-default items-center justify-center",
154
157
  "data-testid": "spectral-select-scroll-down-button",
155
158
  children: /* @__PURE__ */ v(t, {
@@ -160,9 +163,9 @@ var b = (b) => {
160
163
  ]
161
164
  }) })]
162
165
  }),
163
- Ce && j && /* @__PURE__ */ v(a, {
166
+ De && j && /* @__PURE__ */ v(a, {
164
167
  "data-testid": "spectral-select-error-message",
165
- id: q,
168
+ id: K,
166
169
  message: j
167
170
  })
168
171
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/primitives/select.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAA6B,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAErF,OAAO,EAAU,KAAK,cAAc,EAAE,MAAM,OAAO,CAAA;AA6CnD,eAAO,MAAM,MAAM,GAAI,cAAc,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,4CAE/E,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,cAAc,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,4CAErF,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,yBAAyB,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,4CAEhG,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,kDAM3B,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,GAAG;IAClD,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;CACxB,4CAoBA,CAAA;AAED,KAAK,kBAAkB,GAAG,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,GAAG;IACzE,aAAa,CAAC,EAAE,aAAa,CAAA;CAC9B,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,4GAA8I,kBAAkB,4CAoD7L,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,yBAAyB,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,4CAEhG,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,mCAAmC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,4CAkBxG,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,yBAAyB,cAAc,CAAC,OAAO,eAAe,CAAC,SAAS,CAAC,4CAExG,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,yBAAyB,cAAc,CAAC,OAAO,eAAe,CAAC,cAAc,CAAC,4CAMlH,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAI,yBAAyB,cAAc,CAAC,OAAO,eAAe,CAAC,gBAAgB,CAAC,4CAMtH,CAAA"}
1
+ {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/primitives/select.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AAEzD,OAAO,EAA6B,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAErF,OAAO,EAAU,KAAK,cAAc,EAAE,MAAM,OAAO,CAAA;AA6CnD,eAAO,MAAM,MAAM,GAAI,cAAc,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,4CAE/E,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,cAAc,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,4CAErF,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,yBAAyB,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,4CAEhG,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,kDAM3B,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,GAAG;IAClD,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;CACxB,4CAoBA,CAAA;AAED,KAAK,kBAAkB,GAAG,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,GAAG;IACzE,aAAa,CAAC,EAAE,aAAa,CAAA;CAC9B,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,4GAA8I,kBAAkB,4CAwD7L,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,yBAAyB,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,4CAEhG,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,mCAAmC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,4CAkBxG,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,yBAAyB,cAAc,CAAC,OAAO,eAAe,CAAC,SAAS,CAAC,4CAExG,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,yBAAyB,cAAc,CAAC,OAAO,eAAe,CAAC,cAAc,CAAC,4CAMlH,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAI,yBAAyB,cAAc,CAAC,OAAO,eAAe,CAAC,gBAAgB,CAAC,4CAMtH,CAAA"}
@@ -4,22 +4,23 @@ import { ChevronDownIcon as t } from "../Icons/ChevronDownIcon.js";
4
4
  import { ChevronUpIcon as n } from "../Icons/ChevronUpIcon.js";
5
5
  import { t as r } from "../twUtils-VNWgstKL.js";
6
6
  import { getDropdownSurfaceClasses as i } from "../utils/formFieldUtils.js";
7
- import { a, c as o, d as s, f as c, h as l, i as u, l as d, m as f, n as p, o as m, p as h, r as g, s as _, t as v, u as y } from "../dist-fW81qjVl.js";
8
- import { useRef as b } from "react";
9
- import { jsx as x, jsxs as S } from "react/jsx-runtime";
7
+ import { useAutoDropdownHorizontalShift as a } from "../utils/dropdownPositioning.js";
8
+ import { a as o, c as s, d as c, f as l, h as u, i as d, l as f, m as p, n as m, o as h, p as g, r as _, s as v, t as y, u as b } from "../dist-fW81qjVl.js";
9
+ import { useRef as x } from "react";
10
+ import { jsx as S, jsxs as C } from "react/jsx-runtime";
10
11
  //#region src/primitives/select.tsx
11
- var C = 12, w = (e) => {
12
+ var w = 12, T = (e) => {
12
13
  let t = document.querySelectorAll("[aria-controls]");
13
14
  for (let n of t) if (n.getAttribute("aria-controls") === e) return n;
14
15
  return null;
15
- }, T = (e) => {
16
+ }, E = (e) => {
16
17
  let t = e.id;
17
18
  if (!t) return;
18
- let n = w(t);
19
+ let n = T(t);
19
20
  if (!n) return;
20
21
  let r = n.closest("[data-slot=\"dialog-content\"]");
21
22
  if (!r) return;
22
- let i = e.getBoundingClientRect(), a = r.getBoundingClientRect(), o = i.bottom - a.bottom + C;
23
+ let i = e.getBoundingClientRect(), a = r.getBoundingClientRect(), o = i.bottom - a.bottom + w;
23
24
  if (o > 0) {
24
25
  r.scrollTo({
25
26
  top: r.scrollTop + o,
@@ -27,98 +28,100 @@ var C = 12, w = (e) => {
27
28
  });
28
29
  return;
29
30
  }
30
- let s = a.top - i.top + C;
31
+ let s = a.top - i.top + w;
31
32
  s > 0 && r.scrollTo({
32
33
  top: Math.max(0, r.scrollTop - s),
33
34
  behavior: "smooth"
34
35
  });
35
- }, E = ({ ...e }) => /* @__PURE__ */ x(d, {
36
+ }, D = ({ ...e }) => /* @__PURE__ */ S(f, {
36
37
  "data-slot": "select",
37
38
  ...e
38
- }), D = ({ ...e }) => /* @__PURE__ */ x(p, {
39
+ }), O = ({ ...e }) => /* @__PURE__ */ S(m, {
39
40
  "data-slot": "select-group",
40
41
  ...e
41
- }), O = ({ className: e, ...t }) => /* @__PURE__ */ x(f, {
42
- className: r("min-w-0 block max-w-full flex-1 truncate text-left whitespace-nowrap text-input-text! data-placeholder:text-input-text!", e),
42
+ }), k = ({ className: e, ...t }) => /* @__PURE__ */ S(p, {
43
+ className: r("min-w-0 block max-w-full flex-1 truncate text-left whitespace-nowrap text-input-text! data-placeholder:text-input-text-placeholder!", e),
43
44
  "data-slot": "select-value",
44
45
  ...t
45
- }), k = ({ asChild: e, children: n, className: i, size: a = "default", ...o }) => /* @__PURE__ */ S(h, {
46
+ }), A = ({ asChild: e, children: n, className: i, size: a = "default", ...o }) => /* @__PURE__ */ C(g, {
46
47
  asChild: e,
47
- className: r("[&_svg:not([class*='text-'])]:text-text-placeholder focus-visible:border-ring focus-visible:ring-ring/50 gap-2 rounded-md px-3 py-2 text-sm shadow-xs h-9 *:data-[slot=select-value]:gap-2 [&_svg:not([class*='size-'])]:size-4 min-w-0 *:data-[slot=select-value]:min-w-0 flex w-fit cursor-pointer items-center justify-between border border-input-border bg-transparent text-input-text! transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-danger-400 data-placeholder:text-input-text! *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center data-[state=open]:**:data-[slot=select-chevron]:rotate-180 [&_svg]:pointer-events-none [&_svg]:shrink-0", i),
48
+ className: r("[&_svg:not([class*='text-'])]:text-text-placeholder focus-visible:border-ring focus-visible:ring-ring/50 gap-2 rounded-md px-3 py-2 text-sm shadow-xs h-9 *:data-[slot=select-value]:gap-2 [&_svg:not([class*='size-'])]:size-4 min-w-0 *:data-[slot=select-value]:min-w-0 flex w-fit cursor-pointer items-center justify-between border border-input-border bg-transparent text-input-text! transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-danger-400 data-placeholder:text-input-text-placeholder! *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center data-[state=open]:**:data-[slot=select-chevron]:rotate-180 [&_svg]:pointer-events-none [&_svg]:shrink-0", i),
48
49
  "data-size": a,
49
50
  "data-slot": "select-trigger",
50
51
  ...o,
51
- children: [n, !e && /* @__PURE__ */ x(g, {
52
+ children: [n, !e && /* @__PURE__ */ S(_, {
52
53
  asChild: !0,
53
- children: /* @__PURE__ */ x(t, {
54
+ children: /* @__PURE__ */ S(t, {
54
55
  className: "size-4 opacity-50 transition-transform duration-200",
55
56
  "data-slot": "select-chevron"
56
57
  })
57
58
  })]
58
- }), A = ({ align: e = "center", children: t, className: n, dropdownWidth: a = "trigger", onCloseAutoFocus: s, onFocusCapture: c, position: u = "popper", style: d, ...f }) => {
59
- let p = b(!1), m = a === "trigger" ? "var(--radix-select-trigger-width)" : a === "content" ? "max-content" : a, h = a === "trigger" || a === "content" ? a : "custom", g = (e) => {
60
- if (c?.(e), p.current) return;
61
- p.current = !0;
59
+ }), j = ({ align: e = "center", children: t, className: n, dropdownWidth: o = "trigger", onCloseAutoFocus: c, onFocusCapture: l, position: d = "popper", style: f, ...p }) => {
60
+ let m = x(!1), { dropdownShiftStyle: h, recalculateDropdownPosition: g, setDropdownElement: _ } = a(), v = o === "trigger" ? "var(--radix-select-trigger-width)" : o === "content" ? "max-content" : o, b = o === "trigger" || o === "content" ? o : "custom", w = (e) => {
61
+ if (l?.(e), m.current) return;
62
+ m.current = !0;
62
63
  let t = e.currentTarget;
63
64
  requestAnimationFrame(() => {
64
- T(t);
65
+ E(t), g();
65
66
  });
66
- }, _ = (e) => {
67
- p.current = !1, s?.(e);
67
+ }, T = (e) => {
68
+ m.current = !1, c?.(e);
68
69
  };
69
- return /* @__PURE__ */ x(o, { children: /* @__PURE__ */ S(v, {
70
+ return /* @__PURE__ */ S(s, { children: /* @__PURE__ */ C(y, {
70
71
  align: e,
71
- className: r("min-w-32 relative z-50 max-h-[--radix-select-content-available-height] origin-[--radix-select-content-transform-origin] overflow-x-hidden overflow-y-auto text-text-primary motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 motion-safe:data-[state=closed]:animate-out motion-safe:data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:animate-in motion-safe:data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95", i(), u === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", n),
72
- "data-dropdown-width-mode": h,
73
- "data-dropdown-width-value": h === "custom" ? a : void 0,
72
+ className: r("min-w-32 relative z-50 max-h-[--radix-select-content-available-height] origin-[--radix-select-content-transform-origin] overflow-x-hidden overflow-y-auto text-text-primary motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 motion-safe:data-[state=closed]:animate-out motion-safe:data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:animate-in motion-safe:data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95", i(), d === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", n),
73
+ "data-dropdown-width-mode": b,
74
+ "data-dropdown-width-value": b === "custom" ? o : void 0,
74
75
  "data-slot": "select-content",
75
- onCloseAutoFocus: _,
76
- onFocusCapture: g,
77
- position: u,
76
+ onCloseAutoFocus: T,
77
+ onFocusCapture: w,
78
+ position: d,
79
+ ref: _,
78
80
  style: {
79
- ...d,
80
- width: m
81
+ ...f,
82
+ width: v,
83
+ ...h
81
84
  },
82
- ...f,
85
+ ...p,
83
86
  children: [
84
- /* @__PURE__ */ x(P, {}),
85
- /* @__PURE__ */ x(l, {
86
- className: r("p-1", u === "popper" && "scroll-my-1 h-(--radix-select-trigger-height) w-full min-w-full"),
87
+ /* @__PURE__ */ S(F, {}),
88
+ /* @__PURE__ */ S(u, {
89
+ className: r("p-1", d === "popper" && "scroll-my-1 h-(--radix-select-trigger-height) w-full min-w-full"),
87
90
  "data-slot": "select-viewport",
88
91
  children: t
89
92
  }),
90
- /* @__PURE__ */ x(F, {})
93
+ /* @__PURE__ */ S(I, {})
91
94
  ]
92
95
  }) });
93
- }, j = ({ className: e, ...t }) => /* @__PURE__ */ x(_, {
96
+ }, M = ({ className: e, ...t }) => /* @__PURE__ */ S(v, {
94
97
  className: r("px-2 py-1.5 text-xs text-text-primary", e),
95
98
  "data-slot": "select-label",
96
99
  ...t
97
- }), M = ({ className: t, children: n, ...i }) => /* @__PURE__ */ S(u, {
100
+ }), N = ({ className: t, children: n, ...i }) => /* @__PURE__ */ C(d, {
98
101
  className: r("gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm [&_svg:not([class*='size-'])]:size-4 *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-none select-none hover:border-input-border--hover hover:bg-accent hover:text-text-inverted! focus:border-input-border--focus focus:bg-accent focus:text-text-inverted! data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-accent data-highlighted:text-text-inverted! [&_svg]:pointer-events-none [&_svg]:shrink-0 hover:[&_svg]:text-text-inverted! focus:[&_svg]:text-text-inverted! data-highlighted:[&_svg]:text-text-inverted! *:[span]:last:flex *:[span]:last:items-center", t),
99
102
  "data-slot": "select-item",
100
103
  ...i,
101
- children: [/* @__PURE__ */ x("span", {
104
+ children: [/* @__PURE__ */ S("span", {
102
105
  className: "right-2 size-3.5 absolute flex items-center justify-center",
103
- children: /* @__PURE__ */ x(a, { children: /* @__PURE__ */ x(e, { className: "size-4" }) })
104
- }), /* @__PURE__ */ x(m, {
106
+ children: /* @__PURE__ */ S(o, { children: /* @__PURE__ */ S(e, { className: "size-4" }) })
107
+ }), /* @__PURE__ */ S(h, {
105
108
  className: "min-w-0 block max-w-full truncate whitespace-nowrap",
106
109
  children: n
107
110
  })]
108
- }), N = ({ className: e, ...t }) => /* @__PURE__ */ x(c, {
111
+ }), P = ({ className: e, ...t }) => /* @__PURE__ */ S(l, {
109
112
  className: r("bg-border -mx-1 my-1 pointer-events-none h-px", e),
110
113
  "data-slot": "select-separator",
111
114
  ...t
112
- }), P = ({ className: e, ...t }) => /* @__PURE__ */ x(s, {
115
+ }), F = ({ className: e, ...t }) => /* @__PURE__ */ S(c, {
113
116
  className: r("py-1 flex cursor-default items-center justify-center", e),
114
117
  "data-slot": "select-scroll-up-button",
115
118
  ...t,
116
- children: /* @__PURE__ */ x(n, { className: "size-4" })
117
- }), F = ({ className: e, ...n }) => /* @__PURE__ */ x(y, {
119
+ children: /* @__PURE__ */ S(n, { className: "size-4" })
120
+ }), I = ({ className: e, ...n }) => /* @__PURE__ */ S(b, {
118
121
  className: r("py-1 flex cursor-default items-center justify-center", e),
119
122
  "data-slot": "select-scroll-down-button",
120
123
  ...n,
121
- children: /* @__PURE__ */ x(t, { className: "size-4" })
124
+ children: /* @__PURE__ */ S(t, { className: "size-4" })
122
125
  });
123
126
  //#endregion
124
- export { E as Select, A as SelectContent, D as SelectGroup, M as SelectItem, j as SelectLabel, F as SelectScrollDownButton, P as SelectScrollUpButton, N as SelectSeparator, k as SelectTrigger, O as SelectValue };
127
+ export { D as Select, j as SelectContent, O as SelectGroup, N as SelectItem, M as SelectLabel, I as SelectScrollDownButton, F as SelectScrollUpButton, P as SelectSeparator, A as SelectTrigger, k as SelectValue };