@brycks/core-front 0.5.0 → 0.6.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.
Files changed (56) hide show
  1. package/dist/components/data/List/List.cjs +1 -1
  2. package/dist/components/data/List/List.cjs.map +1 -1
  3. package/dist/components/data/List/List.js +68 -148
  4. package/dist/components/data/List/List.js.map +1 -1
  5. package/dist/components/data/Table/Table.cjs +1 -1
  6. package/dist/components/data/Table/Table.cjs.map +1 -1
  7. package/dist/components/data/Table/Table.js +142 -224
  8. package/dist/components/data/Table/Table.js.map +1 -1
  9. package/dist/components/data/TreeView/TreeView.cjs +1 -1
  10. package/dist/components/data/TreeView/TreeView.cjs.map +1 -1
  11. package/dist/components/data/TreeView/TreeView.js +141 -182
  12. package/dist/components/data/TreeView/TreeView.js.map +1 -1
  13. package/dist/components/feedback/Drawer/Drawer.cjs +1 -22
  14. package/dist/components/feedback/Drawer/Drawer.cjs.map +1 -1
  15. package/dist/components/feedback/Drawer/Drawer.js +84 -184
  16. package/dist/components/feedback/Drawer/Drawer.js.map +1 -1
  17. package/dist/components/feedback/Modal/Modal.cjs +1 -1
  18. package/dist/components/feedback/Modal/Modal.cjs.map +1 -1
  19. package/dist/components/feedback/Modal/Modal.js +65 -150
  20. package/dist/components/feedback/Modal/Modal.js.map +1 -1
  21. package/dist/components/feedback/Toast/Toast.cjs +1 -10
  22. package/dist/components/feedback/Toast/Toast.cjs.map +1 -1
  23. package/dist/components/feedback/Toast/Toast.js +94 -187
  24. package/dist/components/feedback/Toast/Toast.js.map +1 -1
  25. package/dist/components/form/Checkbox/Checkbox.cjs +1 -1
  26. package/dist/components/form/Checkbox/Checkbox.js +11 -11
  27. package/dist/components/form/Combobox/Combobox.cjs +1 -6
  28. package/dist/components/form/Combobox/Combobox.cjs.map +1 -1
  29. package/dist/components/form/Combobox/Combobox.js +187 -283
  30. package/dist/components/form/Combobox/Combobox.js.map +1 -1
  31. package/dist/components/form/Input/Input.cjs +1 -1
  32. package/dist/components/form/Input/Input.cjs.map +1 -1
  33. package/dist/components/form/Input/Input.js +38 -133
  34. package/dist/components/form/Input/Input.js.map +1 -1
  35. package/dist/components/form/Select/Select.cjs +1 -1
  36. package/dist/components/form/Select/Select.cjs.map +1 -1
  37. package/dist/components/form/Select/Select.js +36 -82
  38. package/dist/components/form/Select/Select.js.map +1 -1
  39. package/dist/components/form/TagInput/TagInput.cjs +1 -1
  40. package/dist/components/form/TagInput/TagInput.js +8 -8
  41. package/dist/components/form/Textarea/Textarea.cjs +1 -1
  42. package/dist/components/form/Textarea/Textarea.cjs.map +1 -1
  43. package/dist/components/form/Textarea/Textarea.js +61 -95
  44. package/dist/components/form/Textarea/Textarea.js.map +1 -1
  45. package/dist/components/navigation/ContextMenu/ContextMenu.cjs +1 -1
  46. package/dist/components/navigation/ContextMenu/ContextMenu.js +9 -9
  47. package/dist/components/navigation/Menu/Menu.cjs +1 -1
  48. package/dist/components/navigation/Menu/Menu.cjs.map +1 -1
  49. package/dist/components/navigation/Menu/Menu.js +70 -135
  50. package/dist/components/navigation/Menu/Menu.js.map +1 -1
  51. package/dist/components/navigation/Pagination/Pagination.cjs +1 -1
  52. package/dist/components/navigation/Pagination/Pagination.cjs.map +1 -1
  53. package/dist/components/navigation/Pagination/Pagination.js +87 -157
  54. package/dist/components/navigation/Pagination/Pagination.js.map +1 -1
  55. package/dist/styles.css +1 -1
  56. package/package.json +1 -1
@@ -1,358 +1,262 @@
1
- import { jsxs as f, jsx as t, Fragment as xe } from "react/jsx-runtime";
2
- import { forwardRef as Ce, useState as g, useRef as W, useMemo as U, useEffect as I, useCallback as L } from "react";
3
- import { createPortal as Se } from "react-dom";
4
- import { cx as $e } from "../../../utils/styles.js";
5
- import { useId as ze } from "../../../hooks/useId.js";
6
- import { durations as w, easings as x } from "../../../design-system/tokens/motion.js";
7
- import { iconSizes as j, componentPaddingX as E, componentHeights as B, componentGap as Ie } from "../../../design-system/primitives/sizing.js";
8
- import { fontSizes as M } from "../../../design-system/tokens/typography.js";
9
- import { spacing as a } from "../../../design-system/tokens/spacing.js";
10
- const Le = {
11
- sm: { height: B.sm, fontSize: M.base - 1, padding: E.sm, iconSize: j.sm },
12
- md: { height: B.md, fontSize: M.base, padding: E.md, iconSize: j.md },
13
- lg: { height: B.lg, fontSize: M.md, padding: E.lg, iconSize: j.lg }
14
- }, Ee = (C, p) => {
15
- const c = p.toLowerCase();
16
- return C.label.toLowerCase().includes(c) || C.value.toLowerCase().includes(c) || (C.description?.toLowerCase().includes(c) ?? !1);
1
+ import { jsxs as m, jsx as t } from "react/jsx-runtime";
2
+ import { forwardRef as ne, useState as k, useRef as D, useMemo as j, useEffect as C, useCallback as N } from "react";
3
+ import { createPortal as se } from "react-dom";
4
+ import { cx as g } from "../../../utils/styles.js";
5
+ import { useId as ce } from "../../../hooks/useId.js";
6
+ import { spacing as ie } from "../../../design-system/tokens/spacing.js";
7
+ const ae = (v, b) => {
8
+ const a = b.toLowerCase();
9
+ return v.label.toLowerCase().includes(a) || v.value.toLowerCase().includes(a) || (v.description?.toLowerCase().includes(a) ?? !1);
17
10
  };
18
- function Me() {
11
+ function le() {
19
12
  return /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ t("path", { d: "M4 6l4 4 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
20
13
  }
21
- function Re() {
14
+ function de() {
22
15
  return /* @__PURE__ */ t("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ t("path", { d: "M4 4l6 6M10 4l-6 6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) });
23
16
  }
24
- const Oe = Ce(function({
25
- options: p,
26
- value: c,
27
- defaultValue: J = null,
28
- onChange: P,
29
- onInputChange: F,
30
- placeholder: Q = "Select or search...",
31
- size: T = "md",
32
- disabled: b = !1,
33
- isInvalid: A = !1,
34
- required: Z = !1,
35
- clearable: _ = !0,
36
- "aria-label": N,
37
- "aria-labelledby": ee,
38
- filterFn: Y = Ee,
39
- emptyText: re = "No options found",
40
- isLoading: q = !1,
41
- loadingText: te = "Loading…",
42
- creatable: R = !1,
43
- onCreate: O,
44
- createLabel: oe = (h) => `Create "${h}"`,
45
- clearLabel: ne = "Clear selection",
46
- listboxLabel: ie = "Options",
47
- className: ae,
48
- testId: se
49
- }, S) {
50
- const h = ze("combobox-listbox"), [le, de] = g(J), [i, y] = g(""), [r, m] = g(!1), [n, s] = g(-1), [H, K] = g(!1), $ = W(null), z = W(null), V = W(null), l = c !== void 0 ? c : le, v = Le[T], d = U(
51
- () => p.find((e) => e.value === l),
52
- [p, l]
53
- ), u = U(() => i ? p.filter((e) => Y(e, i)) : p, [p, i, Y]);
54
- I(() => {
55
- !r && d ? y(d.label) : !r && !l && y("");
56
- }, [r, d, l]);
57
- const k = L(
17
+ const be = ne(function({
18
+ options: b,
19
+ value: a,
20
+ defaultValue: S = null,
21
+ onChange: M,
22
+ onInputChange: R,
23
+ placeholder: A = "Select or search...",
24
+ size: z = "md",
25
+ disabled: w = !1,
26
+ isInvalid: $ = !1,
27
+ required: F = !1,
28
+ clearable: K = !0,
29
+ "aria-label": B,
30
+ "aria-labelledby": V,
31
+ filterFn: O = ae,
32
+ emptyText: q = "No options found",
33
+ isLoading: P = !1,
34
+ loadingText: T = "Loading…",
35
+ creatable: L = !1,
36
+ onCreate: I,
37
+ createLabel: U = (p) => `Create "${p}"`,
38
+ clearLabel: X = "Clear selection",
39
+ listboxLabel: Y = "Options",
40
+ className: G,
41
+ testId: H
42
+ }, y) {
43
+ const p = ce("combobox-listbox"), [J, Q] = k(S), [s, f] = k(""), [o, u] = k(!1), [n, c] = k(-1), _ = D(null), x = D(null), W = D(null), l = a !== void 0 ? a : J, i = j(
44
+ () => b.find((e) => e.value === l),
45
+ [b, l]
46
+ ), d = j(() => s ? b.filter((e) => O(e, s)) : b, [b, s, O]);
47
+ C(() => {
48
+ !o && i ? f(i.label) : !o && !l && f("");
49
+ }, [o, i, l]);
50
+ const h = N(
58
51
  (e) => {
59
- c === void 0 && de(e), P?.(e), m(!1), s(-1), z.current?.focus();
52
+ a === void 0 && Q(e), M?.(e), u(!1), c(-1), x.current?.focus();
60
53
  },
61
- [c, P]
62
- ), ce = L(
54
+ [a, M]
55
+ ), Z = N(
63
56
  (e) => {
64
- const o = e.target.value;
65
- y(o), F?.(o), r || m(!0), s(0);
57
+ const r = e.target.value;
58
+ f(r), R?.(r), o || u(!0), c(0);
66
59
  },
67
- [r, F]
68
- ), ue = L(
60
+ [o, R]
61
+ ), ee = N(
69
62
  (e) => {
70
- e.stopPropagation(), k(null), y(""), z.current?.focus();
63
+ e.stopPropagation(), h(null), f(""), x.current?.focus();
71
64
  },
72
- [k]
73
- ), fe = L(
65
+ [h]
66
+ ), oe = N(
74
67
  (e) => {
75
68
  switch (e.key) {
76
69
  case "ArrowDown":
77
- e.preventDefault(), r ? s((o) => Math.min(o + 1, u.length - 1)) : (m(!0), s(0));
70
+ e.preventDefault(), o ? c((r) => Math.min(r + 1, d.length - 1)) : (u(!0), c(0));
78
71
  break;
79
72
  case "ArrowUp":
80
- e.preventDefault(), r && s((o) => Math.max(o - 1, 0));
73
+ e.preventDefault(), o && c((r) => Math.max(r - 1, 0));
81
74
  break;
82
75
  case "Enter":
83
- e.preventDefault(), r && n >= 0 && u[n] ? u[n].disabled || k(u[n].value) : R && i && u.length === 0 && O?.(i);
76
+ e.preventDefault(), o && n >= 0 && d[n] ? d[n].disabled || h(d[n].value) : L && s && d.length === 0 && I?.(s);
84
77
  break;
85
78
  case "Escape":
86
- e.preventDefault(), m(!1), s(-1), d && y(d.label);
79
+ e.preventDefault(), u(!1), c(-1), i && f(i.label);
87
80
  break;
88
81
  case "Tab":
89
- r && (m(!1), s(-1));
82
+ o && (u(!1), c(-1));
90
83
  break;
91
84
  }
92
85
  },
93
- [r, n, u, k, R, i, O, d]
86
+ [o, n, d, h, L, s, I, i]
94
87
  );
95
- I(() => {
96
- if (!r) return;
97
- const e = (o) => {
98
- $.current?.contains(o.target) || (m(!1), s(-1), d && y(d.label));
88
+ C(() => {
89
+ if (!o) return;
90
+ const e = (r) => {
91
+ _.current?.contains(r.target) || (u(!1), c(-1), i && f(i.label));
99
92
  };
100
93
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
101
- }, [r, d]), I(() => {
102
- if (!r || n < 0) return;
103
- V.current?.children[n]?.scrollIntoView({ block: "nearest" });
104
- }, [r, n]);
105
- const [D, pe] = g({ top: 0, left: 0, width: 0 });
106
- I(() => {
107
- if (!r || !$.current) return;
94
+ }, [o, i]), C(() => {
95
+ if (!o || n < 0) return;
96
+ W.current?.children[n]?.scrollIntoView({ block: "nearest" });
97
+ }, [o, n]);
98
+ const [E, te] = k({ top: 0, left: 0, width: 0 });
99
+ C(() => {
100
+ if (!o || !_.current) return;
108
101
  const e = () => {
109
- const o = $.current.getBoundingClientRect();
110
- pe({
111
- top: o.bottom + window.scrollY + a[1],
112
- left: o.left + window.scrollX,
113
- width: o.width
102
+ const r = _.current.getBoundingClientRect();
103
+ te({
104
+ top: r.bottom + window.scrollY + ie[1],
105
+ left: r.left + window.scrollX,
106
+ width: r.width
114
107
  });
115
108
  };
116
109
  return e(), window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
117
110
  window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
118
111
  };
119
- }, [r]);
120
- const be = {
121
- position: "relative",
122
- display: "inline-flex",
123
- width: "100%"
124
- }, me = {
125
- position: "relative",
126
- display: "flex",
127
- alignItems: "center",
128
- width: "100%",
129
- height: v.height,
130
- backgroundColor: b ? "var(--brycks-background-muted)" : "var(--brycks-background-default)",
131
- border: `1px solid ${A ? "var(--brycks-error-default)" : H ? "var(--brycks-primary-default)" : "var(--brycks-border-default)"}`,
132
- borderRadius: "var(--brycks-radius-md)",
133
- transition: `all ${w.fast}ms ${x.easeOut}`,
134
- cursor: b ? "not-allowed" : "text",
135
- boxShadow: H ? "var(--brycks-focus-ring)" : void 0
136
- }, he = {
137
- flex: 1,
138
- height: "100%",
139
- padding: `0 ${v.padding}px`,
140
- paddingRight: a[10],
141
- fontSize: v.fontSize,
142
- color: b ? "var(--brycks-foreground-disabled)" : "var(--brycks-foreground-default)",
143
- backgroundColor: "transparent",
144
- border: "none",
145
- outline: "none",
146
- cursor: b ? "not-allowed" : "text"
147
- }, ye = {
148
- position: "absolute",
149
- right: v.padding,
150
- display: "flex",
151
- alignItems: "center",
152
- gap: a[1],
153
- pointerEvents: "none"
154
- }, ve = {
155
- display: "flex",
156
- alignItems: "center",
157
- justifyContent: "center",
158
- width: a[5],
159
- height: a[5],
160
- color: "var(--brycks-foreground-muted)",
161
- cursor: "pointer",
162
- borderRadius: "var(--brycks-radius-sm)",
163
- transition: `all ${w.fast}ms ${x.easeOut}`,
164
- pointerEvents: "auto"
165
- }, ge = {
166
- display: "flex",
167
- alignItems: "center",
168
- justifyContent: "center",
169
- color: "var(--brycks-foreground-muted)",
170
- transform: r ? "rotate(180deg)" : "rotate(0)",
171
- transition: `transform ${w.fast}ms ${x.easeOut}`
172
- }, ke = {
173
- position: "absolute",
174
- top: D.top,
175
- left: D.left,
176
- width: D.width,
177
- maxHeight: 300,
178
- overflowY: "auto",
179
- backgroundColor: "var(--brycks-background-elevated)",
180
- border: "1px solid var(--brycks-border-default)",
181
- borderRadius: "var(--brycks-radius-lg)",
182
- boxShadow: "var(--brycks-shadow-lg)",
183
- zIndex: "var(--brycks-z-dropdown)",
184
- padding: a[1],
185
- animation: `brycks-dropdown-in ${w.quick}ms ${x.easeOut}`
186
- }, X = (e, o, we) => ({
187
- display: "flex",
188
- alignItems: "center",
189
- gap: Ie.md,
190
- padding: `${a[2]}px ${E.sm}px`,
191
- fontSize: v.fontSize,
192
- color: o ? "var(--brycks-foreground-disabled)" : "var(--brycks-foreground-default)",
193
- backgroundColor: e ? "var(--brycks-background-muted)" : we ? "var(--brycks-primary-muted)" : "transparent",
194
- borderRadius: "var(--brycks-radius-md)",
195
- cursor: o ? "not-allowed" : "pointer",
196
- transition: `background-color ${w.fast}ms ${x.easeOut}`
197
- }), G = {
198
- padding: `${a[4]}px ${a[3]}px`,
199
- fontSize: v.fontSize,
200
- color: "var(--brycks-foreground-muted)",
201
- textAlign: "center"
112
+ }, [o]);
113
+ const re = {
114
+ top: E.top,
115
+ left: E.left,
116
+ width: E.width
202
117
  };
203
- return /* @__PURE__ */ f(
118
+ return /* @__PURE__ */ m(
204
119
  "div",
205
120
  {
206
- ref: $,
207
- className: $e("brycks-combobox", `brycks-combobox--${T}`, ae),
208
- style: be,
209
- "data-testid": se,
121
+ ref: _,
122
+ className: g("brycks-combobox", `brycks-combobox--${z}`, G),
123
+ "data-testid": H,
210
124
  children: [
211
- /* @__PURE__ */ f(
125
+ /* @__PURE__ */ m(
212
126
  "div",
213
127
  {
214
- style: me,
215
- onClick: () => !b && z.current?.focus(),
128
+ className: g(
129
+ "brycks-combobox__wrapper",
130
+ $ && "brycks-combobox__wrapper--invalid",
131
+ w && "brycks-combobox__wrapper--disabled"
132
+ ),
133
+ onClick: () => !w && x.current?.focus(),
216
134
  children: [
217
135
  /* @__PURE__ */ t(
218
136
  "input",
219
137
  {
220
138
  ref: (e) => {
221
- z.current = e, typeof S == "function" ? S(e) : S && (S.current = e);
139
+ x.current = e, typeof y == "function" ? y(e) : y && (y.current = e);
222
140
  },
223
141
  type: "text",
224
142
  role: "combobox",
225
- "aria-expanded": r,
143
+ "aria-expanded": o,
226
144
  "aria-haspopup": "listbox",
227
145
  "aria-autocomplete": "list",
228
- "aria-controls": r ? h : void 0,
229
- "aria-activedescendant": r && n >= 0 ? `${h}-option-${n}` : void 0,
230
- "aria-invalid": A,
231
- "aria-required": Z,
232
- "aria-label": N,
233
- "aria-labelledby": ee,
234
- value: i,
235
- placeholder: Q,
236
- disabled: b,
237
- style: he,
238
- onChange: ce,
239
- onKeyDown: fe,
146
+ "aria-controls": o ? p : void 0,
147
+ "aria-activedescendant": o && n >= 0 ? `${p}-option-${n}` : void 0,
148
+ "aria-invalid": $,
149
+ "aria-required": F,
150
+ "aria-label": B,
151
+ "aria-labelledby": V,
152
+ value: s,
153
+ placeholder: A,
154
+ disabled: w,
155
+ className: "brycks-combobox__input",
156
+ onChange: Z,
157
+ onKeyDown: oe,
240
158
  onFocus: () => {
241
- K(!0), m(!0);
242
- },
243
- onBlur: () => K(!1)
159
+ u(!0);
160
+ }
244
161
  }
245
162
  ),
246
- /* @__PURE__ */ f("div", { style: ye, children: [
247
- _ && l && !b && /* @__PURE__ */ t(
163
+ /* @__PURE__ */ m("div", { className: "brycks-combobox__icons", children: [
164
+ K && l && !w && /* @__PURE__ */ t(
248
165
  "button",
249
166
  {
250
167
  type: "button",
251
- "aria-label": ne,
252
- style: ve,
253
- onClick: ue,
254
- onMouseEnter: (e) => {
255
- e.currentTarget.style.backgroundColor = "var(--brycks-background-muted)", e.currentTarget.style.color = "var(--brycks-foreground-default)";
256
- },
257
- onMouseLeave: (e) => {
258
- e.currentTarget.style.backgroundColor = "transparent", e.currentTarget.style.color = "var(--brycks-foreground-muted)";
259
- },
260
- children: /* @__PURE__ */ t(Re, {})
168
+ "aria-label": X,
169
+ className: "brycks-combobox__clear",
170
+ onClick: ee,
171
+ children: /* @__PURE__ */ t(de, {})
261
172
  }
262
173
  ),
263
- /* @__PURE__ */ t("span", { style: ge, children: /* @__PURE__ */ t(Me, {}) })
174
+ /* @__PURE__ */ t("span", { className: g("brycks-combobox__chevron", o && "brycks-combobox__chevron--open"), children: /* @__PURE__ */ t(le, {}) })
264
175
  ] })
265
176
  ]
266
177
  }
267
178
  ),
268
- r && Se(
269
- /* @__PURE__ */ f(xe, { children: [
270
- /* @__PURE__ */ t("style", { children: `
271
- @keyframes brycks-dropdown-in {
272
- from { opacity: 0; transform: translateY(-4px); }
273
- to { opacity: 1; transform: translateY(0); }
274
- }
275
- ` }),
276
- /* @__PURE__ */ t(
277
- "ul",
278
- {
279
- ref: V,
280
- id: h,
281
- role: "listbox",
282
- "aria-label": N || ie,
283
- "aria-busy": q || void 0,
284
- style: ke,
285
- children: q ? /* @__PURE__ */ t("li", { style: G, role: "status", "aria-live": "polite", children: /* @__PURE__ */ f("span", { style: { display: "inline-flex", alignItems: "center", justifyContent: "center", gap: a[2] }, children: [
286
- /* @__PURE__ */ f(
287
- "svg",
288
- {
289
- width: "16",
290
- height: "16",
291
- viewBox: "0 0 24 24",
292
- fill: "none",
293
- className: "brycks-animate-spin",
294
- "aria-hidden": "true",
295
- children: [
296
- /* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", opacity: "0.2" }),
297
- /* @__PURE__ */ t("path", { d: "M12 2C6.47715 2 2 6.47715 2 12", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round" })
298
- ]
299
- }
300
- ),
301
- te
302
- ] }) }) : u.length > 0 ? u.map((e, o) => /* @__PURE__ */ f(
303
- "li",
179
+ o && se(
180
+ /* @__PURE__ */ t(
181
+ "ul",
182
+ {
183
+ ref: W,
184
+ id: p,
185
+ role: "listbox",
186
+ "aria-label": B || Y,
187
+ "aria-busy": P || void 0,
188
+ className: "brycks-combobox__dropdown",
189
+ style: re,
190
+ children: P ? /* @__PURE__ */ t("li", { className: "brycks-combobox__empty", role: "status", "aria-live": "polite", children: /* @__PURE__ */ m("span", { className: "brycks-combobox__loading", children: [
191
+ /* @__PURE__ */ m(
192
+ "svg",
304
193
  {
305
- id: `${h}-option-${o}`,
306
- role: "option",
307
- "aria-selected": e.value === l,
308
- "aria-disabled": e.disabled,
309
- style: X(o === n, !!e.disabled, e.value === l),
310
- onClick: () => !e.disabled && k(e.value),
311
- onMouseEnter: () => s(o),
194
+ width: "16",
195
+ height: "16",
196
+ viewBox: "0 0 24 24",
197
+ fill: "none",
198
+ className: "brycks-animate-spin",
199
+ "aria-hidden": "true",
312
200
  children: [
313
- e.icon && /* @__PURE__ */ t("span", { style: { flexShrink: 0 }, children: e.icon }),
314
- /* @__PURE__ */ f("div", { style: { flex: 1, minWidth: 0 }, children: [
315
- /* @__PURE__ */ t("div", { style: { fontWeight: e.value === l ? 500 : 400 }, children: e.label }),
316
- e.description && /* @__PURE__ */ t("div", { style: { fontSize: M.sm, color: "var(--brycks-foreground-muted)" }, children: e.description })
317
- ] }),
318
- e.value === l && /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", style: { flexShrink: 0 }, children: /* @__PURE__ */ t(
319
- "path",
320
- {
321
- d: "M3 8l3 3 7-7",
322
- stroke: "var(--brycks-primary-default)",
323
- strokeWidth: "2",
324
- strokeLinecap: "round",
325
- strokeLinejoin: "round"
326
- }
327
- ) })
201
+ /* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", opacity: "0.2" }),
202
+ /* @__PURE__ */ t("path", { d: "M12 2C6.47715 2 2 6.47715 2 12", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round" })
328
203
  ]
329
- },
330
- e.value
331
- )) : /* @__PURE__ */ t("li", { style: G, children: R && i ? /* @__PURE__ */ t(
332
- "button",
333
- {
334
- type: "button",
335
- style: {
336
- ...X(!0, !1, !1),
337
- width: "100%",
338
- border: "none",
339
- cursor: "pointer"
340
- },
341
- onClick: () => O?.(i),
342
- children: oe(i)
343
204
  }
344
- ) : re })
345
- }
346
- )
347
- ] }),
205
+ ),
206
+ T
207
+ ] }) }) : d.length > 0 ? d.map((e, r) => /* @__PURE__ */ m(
208
+ "li",
209
+ {
210
+ id: `${p}-option-${r}`,
211
+ role: "option",
212
+ "aria-selected": e.value === l,
213
+ "aria-disabled": e.disabled,
214
+ className: g(
215
+ "brycks-combobox__option",
216
+ e.value === l && "brycks-combobox__option--selected",
217
+ r === n && "brycks-combobox__option--active",
218
+ e.disabled && "brycks-combobox__option--disabled"
219
+ ),
220
+ onClick: () => !e.disabled && h(e.value),
221
+ onMouseEnter: () => c(r),
222
+ children: [
223
+ e.icon && /* @__PURE__ */ t("span", { className: "brycks-combobox__option-icon", children: e.icon }),
224
+ /* @__PURE__ */ m("div", { className: "brycks-combobox__option-body", children: [
225
+ /* @__PURE__ */ t("div", { className: "brycks-combobox__option-label", children: e.label }),
226
+ e.description && /* @__PURE__ */ t("div", { className: "brycks-combobox__option-description", children: e.description })
227
+ ] }),
228
+ e.value === l && /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", className: "brycks-combobox__option-check", children: /* @__PURE__ */ t(
229
+ "path",
230
+ {
231
+ d: "M3 8l3 3 7-7",
232
+ stroke: "var(--brycks-primary-default)",
233
+ strokeWidth: "2",
234
+ strokeLinecap: "round",
235
+ strokeLinejoin: "round"
236
+ }
237
+ ) })
238
+ ]
239
+ },
240
+ e.value
241
+ )) : /* @__PURE__ */ t("li", { className: "brycks-combobox__empty", children: L && s ? /* @__PURE__ */ t(
242
+ "button",
243
+ {
244
+ type: "button",
245
+ className: "brycks-combobox__option brycks-combobox__option--active brycks-combobox__option--create",
246
+ onClick: () => I?.(s),
247
+ children: U(s)
248
+ }
249
+ ) : q })
250
+ }
251
+ ),
348
252
  document.body
349
253
  )
350
254
  ]
351
255
  }
352
256
  );
353
257
  });
354
- Oe.displayName = "Combobox";
258
+ be.displayName = "Combobox";
355
259
  export {
356
- Oe as Combobox
260
+ be as Combobox
357
261
  };
358
262
  //# sourceMappingURL=Combobox.js.map