@viglet/viglet-design-system 2026.3.8 → 2026.3.10

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 (105) hide show
  1. package/README.md +213 -16
  2. package/dist/badge-locale-Bij94NwL.cjs +1 -0
  3. package/dist/{badge-locale-BxI9TwkE.js → badge-locale-Du41PpLA.js} +183 -229
  4. package/dist/bento/bento-back-to-top.d.ts.map +1 -1
  5. package/dist/bento/bento-command-palette.d.ts +47 -12
  6. package/dist/bento/bento-command-palette.d.ts.map +1 -1
  7. package/dist/bento/bento-form-section.d.ts +7 -1
  8. package/dist/bento/bento-form-section.d.ts.map +1 -1
  9. package/dist/bento/bento-inline-edit.d.ts.map +1 -1
  10. package/dist/bento/bento-nav-rail.d.ts.map +1 -1
  11. package/dist/bento/bento-nav.d.ts +10 -2
  12. package/dist/bento/bento-nav.d.ts.map +1 -1
  13. package/dist/bento/bento-section-chrome.d.ts +5 -0
  14. package/dist/bento/bento-section-chrome.d.ts.map +1 -1
  15. package/dist/bento/bento-status-marker.d.ts.map +1 -1
  16. package/dist/bento/bento-tile.d.ts.map +1 -1
  17. package/dist/bento/index.d.ts +1 -1
  18. package/dist/bento/index.d.ts.map +1 -1
  19. package/dist/bento.cjs +1 -1
  20. package/dist/bento.es.js +473 -413
  21. package/dist/{breadcrumb.context-CGqjI0-U.js → breadcrumb.context-BssgEydx.js} +251 -239
  22. package/dist/breadcrumb.context-DLsiMS59.cjs +1 -0
  23. package/dist/components/app-switcher.d.ts.map +1 -1
  24. package/dist/components/badge-colorful.d.ts +9 -0
  25. package/dist/components/badge-colorful.d.ts.map +1 -1
  26. package/dist/components/login/login.d.ts.map +1 -1
  27. package/dist/components/router/grid.list.d.ts.map +1 -1
  28. package/dist/components/router/index.d.ts +1 -1
  29. package/dist/components/router/index.d.ts.map +1 -1
  30. package/dist/components/router/sticky.page.header.d.ts.map +1 -1
  31. package/dist/components/router/sub.page.d.ts.map +1 -1
  32. package/dist/components/router/sub.page.header.d.ts.map +1 -1
  33. package/dist/components/startup-first/startup-first.d.ts.map +1 -1
  34. package/dist/components/ui/breadcrumb.d.ts.map +1 -1
  35. package/dist/components/ui/dialog.d.ts.map +1 -1
  36. package/dist/components/ui/floating-formulas-bg.d.ts.map +1 -1
  37. package/dist/components/ui/glass-card.d.ts +10 -5
  38. package/dist/components/ui/glass-card.d.ts.map +1 -1
  39. package/dist/components/ui/icon-picker-dialog.d.ts.map +1 -1
  40. package/dist/components/ui/index.d.ts +6 -4
  41. package/dist/components/ui/index.d.ts.map +1 -1
  42. package/dist/components/ui/navigation-menu.d.ts +14 -0
  43. package/dist/components/ui/navigation-menu.d.ts.map +1 -1
  44. package/dist/components/ui/pagination.d.ts.map +1 -1
  45. package/dist/components/ui/pulse-ring.d.ts.map +1 -1
  46. package/dist/components/ui/resizable.d.ts.map +1 -1
  47. package/dist/components/ui/sheet.d.ts.map +1 -1
  48. package/dist/components/ui/sidebar.d.ts.map +1 -1
  49. package/dist/components/ui/sonner.d.ts +12 -0
  50. package/dist/components/ui/sonner.d.ts.map +1 -1
  51. package/dist/components/ui/stepper.d.ts.map +1 -1
  52. package/dist/components/ui/viglet-assistant.d.ts +60 -0
  53. package/dist/components/ui/viglet-assistant.d.ts.map +1 -0
  54. package/dist/components/ui/viglet-avatar.d.ts +42 -0
  55. package/dist/components/ui/viglet-avatar.d.ts.map +1 -0
  56. package/dist/exports.json +24 -5
  57. package/dist/floating-formulas-bg.cjs +1 -1
  58. package/dist/floating-formulas-bg.es.js +56 -55
  59. package/dist/hooks/index.d.ts +1 -0
  60. package/dist/hooks/index.d.ts.map +1 -1
  61. package/dist/hooks/use-assistant-notifications.d.ts +15 -0
  62. package/dist/hooks/use-assistant-notifications.d.ts.map +1 -0
  63. package/dist/i18n/index.d.ts +102 -0
  64. package/dist/i18n/index.d.ts.map +1 -1
  65. package/dist/i18n/locales/en/assistant.json.d.ts +22 -0
  66. package/dist/i18n/locales/en/bento.json.d.ts +5 -2
  67. package/dist/i18n/locales/en/common.json.d.ts +15 -1
  68. package/dist/i18n/locales/en/dialog.json.d.ts +2 -1
  69. package/dist/i18n/locales/en/language.json.d.ts +8 -0
  70. package/dist/i18n/locales/en/sidebar.json.d.ts +4 -1
  71. package/dist/i18n/locales/pt/assistant.json.d.ts +22 -0
  72. package/dist/i18n/locales/pt/bento.json.d.ts +5 -2
  73. package/dist/i18n/locales/pt/common.json.d.ts +15 -1
  74. package/dist/i18n/locales/pt/dialog.json.d.ts +2 -1
  75. package/dist/i18n/locales/pt/language.json.d.ts +8 -0
  76. package/dist/i18n/locales/pt/sidebar.json.d.ts +4 -1
  77. package/dist/i18n.cjs +1 -1
  78. package/dist/i18n.es.js +478 -2
  79. package/dist/index.cjs +1 -1
  80. package/dist/index.d.ts +0 -1
  81. package/dist/index.d.ts.map +1 -1
  82. package/dist/index.es.js +1318 -696
  83. package/dist/loading-provider-B6-R2ONB.cjs +1 -0
  84. package/dist/{loading-provider-CMnOuvdR.js → loading-provider-E3fbcekM.js} +33 -32
  85. package/dist/preset.css +3 -1
  86. package/dist/router.cjs +1 -1
  87. package/dist/router.es.js +135 -134
  88. package/dist/{user.context-kPAqKN4o.js → user.context-CPmUBBLa.js} +109 -99
  89. package/dist/user.context-xsJgPpcO.cjs +1 -0
  90. package/dist/utils-Fk5jmzzb.js +41 -0
  91. package/dist/utils-Oagwe_oa.cjs +1 -0
  92. package/dist/viglet-design-system.css +1 -1
  93. package/dist/vite/boot-loader.d.ts +33 -2
  94. package/dist/vite/boot-loader.d.ts.map +1 -1
  95. package/dist/vite.cjs +16 -5
  96. package/dist/vite.es.js +27 -14
  97. package/docs/BENTO-AUTHORING.md +20 -2
  98. package/docs/reference/grounds.dc.html +9 -9
  99. package/package.json +4 -3
  100. package/dist/badge-locale-sIsBdP_e.cjs +0 -7
  101. package/dist/breadcrumb.context-DYeZEC65.cjs +0 -1
  102. package/dist/i18n-DoNdMLEd.cjs +0 -1
  103. package/dist/i18n-DuNITbWa.js +0 -398
  104. package/dist/loading-provider-1mgM91iY.cjs +0 -1
  105. package/dist/user.context-r50nSWER.cjs +0 -1
@@ -1,15 +1,16 @@
1
- import { D as e, F as t, H as n, M as r, U as i, k as a, l as o, u as s } from "./badge-locale-BxI9TwkE.js";
1
+ import { t as e } from "./utils-Fk5jmzzb.js";
2
+ import { D as t, F as n, H as r, M as i, k as a, l as o, u as s } from "./badge-locale-Du41PpLA.js";
2
3
  import c, { createContext as l, useCallback as u, useContext as d, useEffect as f, useRef as p, useState as m } from "react";
3
4
  import { jsx as h, jsxs as g } from "react/jsx-runtime";
4
5
  import * as _ from "@radix-ui/react-avatar";
5
6
  import { Slot as v } from "@radix-ui/react-slot";
6
7
  import { cva as y } from "class-variance-authority";
7
- import { IconChevronDown as b, IconLoader2 as x, IconSearch as S, IconSparkles as C, IconTrash as w } from "@tabler/icons-react";
8
- import { useTranslation as T } from "react-i18next";
8
+ import { useTranslation as b } from "react-i18next";
9
+ import { IconChevronDown as x, IconLoader2 as S, IconSearch as C, IconSparkles as w, IconTrash as T } from "@tabler/icons-react";
9
10
  import { Icon as E } from "@iconify/react";
10
11
  import { useTheme as D } from "next-themes";
11
12
  import { Toaster as O, toast as k } from "sonner";
12
- var A = n("circle-check", [["circle", {
13
+ var A = r("circle-check", [["circle", {
13
14
  cx: "12",
14
15
  cy: "12",
15
16
  r: "10",
@@ -17,7 +18,7 @@ var A = n("circle-check", [["circle", {
17
18
  }], ["path", {
18
19
  d: "m9 12 2 2 4-4",
19
20
  key: "dzmm74"
20
- }]]), j = n("info", [
21
+ }]]), j = r("info", [
21
22
  ["circle", {
22
23
  cx: "12",
23
24
  cy: "12",
@@ -32,10 +33,10 @@ var A = n("circle-check", [["circle", {
32
33
  d: "M12 8h.01",
33
34
  key: "e9boi3"
34
35
  }]
35
- ]), M = n("loader-circle", [["path", {
36
+ ]), M = r("loader-circle", [["path", {
36
37
  d: "M21 12a9 9 0 1 1-6.219-8.56",
37
38
  key: "13zald"
38
- }]]), N = n("octagon-x", [
39
+ }]]), N = r("octagon-x", [
39
40
  ["path", {
40
41
  d: "m15 9-6 6",
41
42
  key: "1uzhvr"
@@ -48,7 +49,7 @@ var A = n("circle-check", [["circle", {
48
49
  d: "m9 9 6 6",
49
50
  key: "z0biqf"
50
51
  }]
51
- ]), P = n("triangle-alert", [
52
+ ]), P = r("triangle-alert", [
52
53
  ["path", {
53
54
  d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
54
55
  key: "wmoenq"
@@ -85,13 +86,13 @@ var A = n("circle-check", [["circle", {
85
86
  size: "default"
86
87
  }
87
88
  });
88
- function I({ className: e, variant: t, size: n, asChild: r = !1, ...a }) {
89
- return /* @__PURE__ */ h(r ? v : "button", {
89
+ function I({ className: t, variant: n, size: r, asChild: i = !1, ...a }) {
90
+ return /* @__PURE__ */ h(i ? v : "button", {
90
91
  "data-slot": "button",
91
- className: i(F({
92
- variant: t,
93
- size: n,
94
- className: e
92
+ className: e(F({
93
+ variant: n,
94
+ size: r,
95
+ className: t
95
96
  })),
96
97
  ...a
97
98
  });
@@ -106,83 +107,91 @@ var L = [
106
107
  "solar",
107
108
  "heroicons"
108
109
  ], R = L.join(",");
109
- async function z(e, t) {
110
+ async function z(e, t, n) {
110
111
  try {
111
- let n = await fetch(`https://api.iconify.design/search?query=${encodeURIComponent(e)}&limit=${t}&prefixes=${R}`);
112
- if (n.ok) return (await n.json()).icons ?? [];
112
+ let r = await fetch(`https://api.iconify.design/search?query=${encodeURIComponent(e)}&limit=${t}&prefixes=${R}`, { signal: n });
113
+ if (r.ok) return (await r.json()).icons ?? [];
113
114
  } catch {}
114
115
  return [];
115
116
  }
116
- function B({ open: n, onOpenChange: i, value: c, onSelect: l, onClear: d, title: _, description: v, suggestKeywords: y }) {
117
- let { t: b } = T(), [D, O] = m(""), [k, A] = m([]), [j, M] = m(!1), N = p(null), [P, F] = m(!1), [I, R] = m([]), B = p(0), [V, H] = m(null), U = u(async (e) => {
118
- let t = ++B.current, n = () => t === B.current;
117
+ function B({ open: e, onOpenChange: r, value: c, onSelect: l, onClear: d, title: _, description: v, suggestKeywords: y }) {
118
+ let { t: x } = b(), [D, O] = m(""), [k, A] = m([]), [j, M] = m(!1), N = p(null), [P, F] = m(!1), [I, R] = m([]), B = p(0), [V, H] = m(null), U = u(async (e, t) => {
119
+ let n = ++B.current, r = () => n === B.current && !t.aborted;
119
120
  if (!e.trim()) {
120
121
  A([]);
121
122
  return;
122
123
  }
123
124
  M(!0);
124
125
  try {
125
- let t = await z(e, 60);
126
- n() && A(t);
126
+ let n = await z(e, 60, t);
127
+ r() && A(n);
127
128
  } catch {
128
- n() && A([]);
129
+ r() && A([]);
129
130
  } finally {
130
- n() && M(!1);
131
+ r() && M(!1);
131
132
  }
132
133
  }, []);
133
- f(() => (N.current && clearTimeout(N.current), N.current = setTimeout(() => U(D), 350), () => {
134
- N.current && clearTimeout(N.current);
135
- }), [D, U]);
136
- function W(e) {
137
- l(e), i(!1), O(""), A([]), R([]), H(null);
134
+ f(() => {
135
+ let e = new AbortController();
136
+ return N.current && clearTimeout(N.current), N.current = setTimeout(() => U(D, e.signal), 350), () => {
137
+ N.current && clearTimeout(N.current), e.abort();
138
+ };
139
+ }, [D, U]);
140
+ let W = p(null);
141
+ f(() => () => W.current?.abort(), []);
142
+ function G(e) {
143
+ l(e), r(!1), O(""), A([]), R([]), H(null);
138
144
  }
139
- async function G() {
140
- if (!(!y || P)) {
141
- F(!0), R([]), H(null);
142
- try {
143
- let e = (await y({
144
- title: _,
145
- description: v
146
- })).filter((e) => typeof e == "string" && e.trim()).slice(0, 5), t = [];
147
- for (let n of e) t.push({
148
- keyword: n.trim(),
149
- icons: await z(n.trim(), 30)
145
+ async function K() {
146
+ if (!y || P) return;
147
+ let e = new AbortController();
148
+ W.current = e, F(!0), R([]), H(null);
149
+ try {
150
+ let t = (await y({
151
+ title: _,
152
+ description: v
153
+ })).filter((e) => typeof e == "string" && e.trim()).slice(0, 5), n = [];
154
+ for (let r of t) {
155
+ if (e.signal.aborted) return;
156
+ n.push({
157
+ keyword: r.trim(),
158
+ icons: await z(r.trim(), 30, e.signal)
150
159
  });
151
- R(t);
152
- } catch {
153
- R([]);
154
- } finally {
155
- F(!1);
156
160
  }
161
+ e.signal.aborted || R(n);
162
+ } catch {
163
+ e.signal.aborted || R([]);
164
+ } finally {
165
+ e.signal.aborted || F(!1);
157
166
  }
158
167
  }
159
- let K = V ? I.find((e) => e.keyword === V)?.icons ?? [] : I.flatMap((e) => e.icons.slice(0, 3)), q = !!y && !!(_?.trim() ?? v?.trim());
160
- return /* @__PURE__ */ h(e, {
161
- open: n,
162
- onOpenChange: i,
168
+ let q = V ? I.find((e) => e.keyword === V)?.icons ?? [] : I.flatMap((e) => e.icons.slice(0, 3)), J = !!y && !!(_?.trim() ?? v?.trim());
169
+ return /* @__PURE__ */ h(t, {
170
+ open: e,
171
+ onOpenChange: r,
163
172
  children: /* @__PURE__ */ g(a, {
164
173
  className: "flex max-h-[80vh] flex-col sm:max-w-lg",
165
174
  children: [
166
- /* @__PURE__ */ h(r, { children: /* @__PURE__ */ h(t, { children: b("forms.iconPicker.chooseAnIcon", { defaultValue: "Choose an icon" }) }) }),
175
+ /* @__PURE__ */ h(i, { children: /* @__PURE__ */ h(n, { children: x("forms.iconPicker.chooseAnIcon", { defaultValue: "Choose an icon" }) }) }),
167
176
  /* @__PURE__ */ g("div", {
168
177
  className: "flex gap-2",
169
178
  children: [/* @__PURE__ */ g("div", {
170
179
  className: "relative flex-1",
171
- children: [/* @__PURE__ */ h(S, { className: "absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }), /* @__PURE__ */ h(o, {
180
+ children: [/* @__PURE__ */ h(C, { className: "absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }), /* @__PURE__ */ h(o, {
172
181
  value: D,
173
182
  onChange: (e) => O(e.target.value),
174
- placeholder: b("forms.iconPicker.searchIcons", { defaultValue: "Search icons" }),
183
+ placeholder: x("forms.iconPicker.searchIcons", { defaultValue: "Search icons" }),
175
184
  className: "pl-9",
176
185
  autoFocus: !0
177
186
  })]
178
- }), q && /* @__PURE__ */ g(s, {
187
+ }), J && /* @__PURE__ */ g(s, {
179
188
  type: "button",
180
189
  size: "sm",
181
190
  variant: "outline",
182
- onClick: G,
191
+ onClick: K,
183
192
  disabled: P,
184
193
  className: "shrink-0 gap-1.5",
185
- children: [P ? /* @__PURE__ */ h(x, { className: "size-4 animate-spin" }) : /* @__PURE__ */ h(C, { className: "size-4" }), b("forms.iconPicker.aiSuggest", { defaultValue: "Suggest" })]
194
+ children: [P ? /* @__PURE__ */ h(S, { className: "size-4 animate-spin" }) : /* @__PURE__ */ h(w, { className: "size-4" }), x("forms.iconPicker.aiSuggest", { defaultValue: "Suggest" })]
186
195
  })]
187
196
  }),
188
197
  I.length > 0 && /* @__PURE__ */ g("div", {
@@ -190,7 +199,7 @@ function B({ open: n, onOpenChange: i, value: c, onSelect: l, onClear: d, title:
190
199
  children: [
191
200
  /* @__PURE__ */ g("div", {
192
201
  className: "mb-2 flex items-center gap-1.5 text-xs font-medium vg-accent-text",
193
- children: [/* @__PURE__ */ h(C, { className: "size-3.5" }), b("forms.iconPicker.aiSuggestions", { defaultValue: "Suggestions" })]
202
+ children: [/* @__PURE__ */ h(w, { className: "size-3.5" }), x("forms.iconPicker.aiSuggestions", { defaultValue: "Suggestions" })]
194
203
  }),
195
204
  /* @__PURE__ */ h("div", {
196
205
  className: "mb-3 flex flex-wrap gap-1.5",
@@ -206,9 +215,9 @@ function B({ open: n, onOpenChange: i, value: c, onSelect: l, onClear: d, title:
206
215
  }),
207
216
  /* @__PURE__ */ h("div", {
208
217
  className: "flex max-h-60 flex-wrap gap-2 overflow-y-auto",
209
- children: K.map((e) => /* @__PURE__ */ g("button", {
218
+ children: q.map((e) => /* @__PURE__ */ g("button", {
210
219
  type: "button",
211
- onClick: () => W(e),
220
+ onClick: () => G(e),
212
221
  className: `flex cursor-pointer flex-col items-center gap-1 rounded-lg p-2 transition-all hover:bg-[var(--vg-accent-surface)] ${c === e ? "border border-[var(--vg-accent-line)] bg-[var(--vg-accent-surface-strong)] vg-accent-text" : "border border-[var(--vg-accent-line)]"}`,
213
222
  title: e,
214
223
  children: [/* @__PURE__ */ h(E, {
@@ -227,30 +236,30 @@ function B({ open: n, onOpenChange: i, value: c, onSelect: l, onClear: d, title:
227
236
  children: [
228
237
  j && /* @__PURE__ */ h("div", {
229
238
  className: "flex h-32 items-center justify-center text-sm text-muted-foreground",
230
- children: b("forms.iconPicker.searching", { defaultValue: "Searching…" })
239
+ children: x("forms.iconPicker.searching", { defaultValue: "Searching…" })
231
240
  }),
232
241
  !j && D && k.length === 0 && /* @__PURE__ */ h("div", {
233
242
  className: "flex h-32 items-center justify-center text-sm text-muted-foreground",
234
- children: b("forms.iconPicker.noIconsFound", {
243
+ children: x("forms.iconPicker.noIconsFound", {
235
244
  query: D,
236
245
  defaultValue: "No icons found for “{{query}}”"
237
246
  })
238
247
  }),
239
248
  !j && !D && k.length === 0 && I.length === 0 && /* @__PURE__ */ g("div", {
240
249
  className: "flex h-32 flex-col items-center justify-center gap-2 px-4 text-center text-sm text-muted-foreground",
241
- children: [/* @__PURE__ */ h("span", { children: b("forms.iconPicker.typeToSearch", {
250
+ children: [/* @__PURE__ */ h("span", { children: x("forms.iconPicker.typeToSearch", {
242
251
  count: L.length,
243
252
  defaultValue: "Type to search {{count}} icon collections"
244
- }) }), q && /* @__PURE__ */ h("span", {
253
+ }) }), J && /* @__PURE__ */ h("span", {
245
254
  className: "text-xs leading-relaxed",
246
- children: b("forms.iconPicker.orClickAi", { defaultValue: "…or let the title and description suggest some" })
255
+ children: x("forms.iconPicker.orClickAi", { defaultValue: "…or let the title and description suggest some" })
247
256
  })]
248
257
  }),
249
258
  k.length > 0 && /* @__PURE__ */ h("div", {
250
259
  className: "grid grid-cols-6 gap-1.5 p-1",
251
260
  children: k.map((e) => /* @__PURE__ */ g("button", {
252
261
  type: "button",
253
- onClick: () => W(e),
262
+ onClick: () => G(e),
254
263
  className: `flex cursor-pointer flex-col items-center justify-center gap-1 rounded-lg p-2 transition-all hover:bg-muted ${c === e ? "border border-[var(--vg-accent-line)] bg-[var(--vg-accent-surface)] vg-accent-text" : "border border-transparent hover:border-border"}`,
255
264
  title: e,
256
265
  children: [/* @__PURE__ */ h(E, {
@@ -282,14 +291,14 @@ function B({ open: n, onOpenChange: i, value: c, onSelect: l, onClear: d, title:
282
291
  type: "button",
283
292
  variant: "outline",
284
293
  onClick: () => {
285
- d(), i(!1);
294
+ d(), r(!1);
286
295
  },
287
- children: [/* @__PURE__ */ h(w, { className: "size-4" }), b("forms.common.remove", { defaultValue: "Remove" })]
296
+ children: [/* @__PURE__ */ h(T, { className: "size-4" }), x("forms.common.remove", { defaultValue: "Remove" })]
288
297
  }), /* @__PURE__ */ h(s, {
289
298
  size: "sm",
290
299
  type: "button",
291
- onClick: () => i(!1),
292
- children: b("forms.iconPicker.done", { defaultValue: "Done" })
300
+ onClick: () => r(!1),
301
+ children: x("forms.iconPicker.done", { defaultValue: "Done" })
293
302
  })]
294
303
  })]
295
304
  })
@@ -345,79 +354,80 @@ var V = {
345
354
  toggle: () => {},
346
355
  variant: "blue"
347
356
  });
348
- function U({ variant: e = "blue", defaultOpen: t = !0, children: n, className: r }) {
349
- let [a, o] = m(t);
357
+ function U({ variant: t = "blue", defaultOpen: n = !0, children: r, className: i }) {
358
+ let [a, o] = m(n);
350
359
  return /* @__PURE__ */ h(H.Provider, {
351
360
  value: {
352
361
  open: a,
353
362
  toggle: () => o((e) => !e),
354
- variant: e
363
+ variant: t
355
364
  },
356
365
  children: /* @__PURE__ */ h("div", {
357
- className: i("rounded-xl border overflow-hidden", r),
358
- children: n
366
+ className: e("rounded-xl border overflow-hidden", i),
367
+ children: r
359
368
  })
360
369
  });
361
370
  }
362
- function W({ icon: e, title: t, description: n, className: r }) {
371
+ function W({ icon: t, title: n, description: r, className: i }) {
363
372
  let { open: a, toggle: o, variant: s } = d(H), c = V[s];
364
373
  return /* @__PURE__ */ g("button", {
365
374
  type: "button",
366
375
  onClick: o,
367
- className: i("flex w-full items-center gap-3 px-5 py-4 bg-muted/40 border-b cursor-pointer hover:bg-muted/60 transition-colors", r),
376
+ className: e("flex w-full items-center gap-3 px-5 py-4 bg-muted/40 border-b cursor-pointer hover:bg-muted/60 transition-colors", i),
368
377
  children: [
369
378
  /* @__PURE__ */ h("div", {
370
379
  className: `flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-linear-to-br ${c.bg} ring-1 ${c.ring}`,
371
- children: /* @__PURE__ */ h(e, { className: `size-4 ${c.color}` })
380
+ children: /* @__PURE__ */ h(t, { className: `size-4 ${c.color}` })
372
381
  }),
373
382
  /* @__PURE__ */ g("div", {
374
383
  className: "min-w-0 text-left",
375
384
  children: [/* @__PURE__ */ h("h3", {
376
385
  className: "text-sm font-semibold text-foreground",
377
- children: t
378
- }), n && /* @__PURE__ */ h("p", {
379
- className: "text-xs text-muted-foreground",
380
386
  children: n
387
+ }), r && /* @__PURE__ */ h("p", {
388
+ className: "text-xs text-muted-foreground",
389
+ children: r
381
390
  })]
382
391
  }),
383
- /* @__PURE__ */ h(b, { className: i("ml-auto size-4 text-muted-foreground shrink-0 transition-transform duration-200", a && "rotate-180") })
392
+ /* @__PURE__ */ h(x, { className: e("ml-auto size-4 text-muted-foreground shrink-0 transition-transform duration-200", a && "rotate-180") })
384
393
  ]
385
394
  });
386
395
  }
387
- function G({ icon: e, title: t, description: n, className: r }) {
396
+ function G({ icon: t, title: n, description: r, className: i }) {
388
397
  let { variant: a } = d(H), o = V[a];
389
398
  return /* @__PURE__ */ g("div", {
390
- className: i("flex items-center gap-3 px-5 py-4 bg-muted/40 border-b", r),
399
+ className: e("flex items-center gap-3 px-5 py-4 bg-muted/40 border-b", i),
391
400
  children: [/* @__PURE__ */ h("div", {
392
401
  className: `flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-linear-to-br ${o.bg} ring-1 ${o.ring}`,
393
- children: /* @__PURE__ */ h(e, { className: `size-4 ${o.color}` })
402
+ children: /* @__PURE__ */ h(t, { className: `size-4 ${o.color}` })
394
403
  }), /* @__PURE__ */ g("div", {
395
404
  className: "min-w-0",
396
405
  children: [/* @__PURE__ */ h("h3", {
397
406
  className: "text-sm font-semibold text-foreground",
398
- children: t
399
- }), n && /* @__PURE__ */ h("p", {
400
- className: "text-xs text-muted-foreground",
401
407
  children: n
408
+ }), r && /* @__PURE__ */ h("p", {
409
+ className: "text-xs text-muted-foreground",
410
+ children: r
402
411
  })]
403
412
  })]
404
413
  });
405
414
  }
406
- function K({ children: e, className: t }) {
407
- let { open: n } = d(H);
408
- return n ? /* @__PURE__ */ h("div", {
409
- className: i("p-5 space-y-6", t),
410
- children: e
415
+ function K({ children: t, className: n }) {
416
+ let { open: r } = d(H);
417
+ return r ? /* @__PURE__ */ h("div", {
418
+ className: e("p-5 space-y-6", n),
419
+ children: t
411
420
  }) : null;
412
421
  }
413
422
  U.Header = W, U.StaticHeader = G, U.Content = K;
414
423
  //#endregion
415
424
  //#region src/components/ui/sonner.tsx
416
425
  var q = ({ ...e }) => {
417
- let { theme: t = "system" } = D();
426
+ let { theme: t = "system" } = D(), { t: n } = b();
418
427
  return /* @__PURE__ */ h(O, {
419
428
  theme: t,
420
429
  className: "toaster group",
430
+ containerAriaLabel: n("common.notifications", { defaultValue: "Notifications" }),
421
431
  icons: {
422
432
  success: /* @__PURE__ */ h(A, { className: "size-4" }),
423
433
  info: /* @__PURE__ */ h(j, { className: "size-4" }),
@@ -449,15 +459,15 @@ function J({ givenName: e, familyName: t, name: n }) {
449
459
  }
450
460
  return "U";
451
461
  }
452
- function Y({ className: e, givenName: t, familyName: n, name: r, src: a, alt: o, children: s, ...c }) {
462
+ function Y({ className: t, givenName: n, familyName: r, name: i, src: a, alt: o, children: s, ...c }) {
453
463
  let l = J({
454
- givenName: t,
455
- familyName: n,
456
- name: r
457
- }), u = o ?? r ?? [t, n].filter(Boolean).join(" ");
464
+ givenName: n,
465
+ familyName: r,
466
+ name: i
467
+ }), u = o ?? i ?? [n, r].filter(Boolean).join(" ");
458
468
  return /* @__PURE__ */ g(_.Root, {
459
469
  "data-slot": "user-avatar",
460
- className: i("relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full size-8", "bg-muted text-muted-foreground text-xs font-semibold", "ring-1 ring-border", e),
470
+ className: e("relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full size-8", "bg-muted text-muted-foreground text-xs font-semibold", "ring-1 ring-border", t),
461
471
  ...c,
462
472
  children: [a && /* @__PURE__ */ h(_.Image, {
463
473
  "data-slot": "user-avatar-image",
@@ -509,4 +519,4 @@ function Q() {
509
519
  return e;
510
520
  }
511
521
  //#endregion
512
- export { q as a, B as c, J as i, I as l, Q as n, k as o, Y as r, U as s, Z as t, F as u };
522
+ export { q as a, V as c, F as d, J as i, B as l, Q as n, k as o, Y as r, U as s, Z as t, I as u };
@@ -0,0 +1 @@
1
+ const e=require("./rolldown-runtime-BocRIvOZ.cjs"),t=require("./utils-Oagwe_oa.cjs"),n=require("./badge-locale-Bij94NwL.cjs");let r=require("react");r=e.t(r,1);let i=require("react/jsx-runtime"),a=require("@radix-ui/react-avatar");a=e.t(a,1);let o=require("@radix-ui/react-slot"),s=require("class-variance-authority"),c=require("react-i18next"),l=require("@tabler/icons-react"),u=require("@iconify/react"),d=require("next-themes"),f=require("sonner");var p=n.H(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),m=n.H(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),h=n.H(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),g=n.H(`octagon-x`,[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),_=n.H(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),v=(0,s.cva)(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all cursor-pointer disabled:cursor-not-allowed disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,sm:`h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function y({className:e,variant:n,size:r,asChild:a=!1,...s}){return(0,i.jsx)(a?o.Slot:`button`,{"data-slot":`button`,className:t.t(v({variant:n,size:r,className:e})),...s})}var b=[`lucide`,`tabler`,`mdi`,`ph`,`solar`,`heroicons`],x=b.join(`,`);async function S(e,t,n){try{let r=await fetch(`https://api.iconify.design/search?query=${encodeURIComponent(e)}&limit=${t}&prefixes=${x}`,{signal:n});if(r.ok)return(await r.json()).icons??[]}catch{}return[]}function C({open:e,onOpenChange:t,value:a,onSelect:o,onClear:s,title:d,description:f,suggestKeywords:p}){let{t:m}=(0,c.useTranslation)(),[h,g]=(0,r.useState)(``),[_,v]=(0,r.useState)([]),[y,x]=(0,r.useState)(!1),C=(0,r.useRef)(null),[w,T]=(0,r.useState)(!1),[E,D]=(0,r.useState)([]),O=(0,r.useRef)(0),[k,A]=(0,r.useState)(null),j=(0,r.useCallback)(async(e,t)=>{let n=++O.current,r=()=>n===O.current&&!t.aborted;if(!e.trim()){v([]);return}x(!0);try{let n=await S(e,60,t);r()&&v(n)}catch{r()&&v([])}finally{r()&&x(!1)}},[]);(0,r.useEffect)(()=>{let e=new AbortController;return C.current&&clearTimeout(C.current),C.current=setTimeout(()=>j(h,e.signal),350),()=>{C.current&&clearTimeout(C.current),e.abort()}},[h,j]);let M=(0,r.useRef)(null);(0,r.useEffect)(()=>()=>M.current?.abort(),[]);function N(e){o(e),t(!1),g(``),v([]),D([]),A(null)}async function P(){if(!p||w)return;let e=new AbortController;M.current=e,T(!0),D([]),A(null);try{let t=(await p({title:d,description:f})).filter(e=>typeof e==`string`&&e.trim()).slice(0,5),n=[];for(let r of t){if(e.signal.aborted)return;n.push({keyword:r.trim(),icons:await S(r.trim(),30,e.signal)})}e.signal.aborted||D(n)}catch{e.signal.aborted||D([])}finally{e.signal.aborted||T(!1)}}let F=k?E.find(e=>e.keyword===k)?.icons??[]:E.flatMap(e=>e.icons.slice(0,3)),I=!!p&&!!(d?.trim()??f?.trim());return(0,i.jsx)(n.D,{open:e,onOpenChange:t,children:(0,i.jsxs)(n.k,{className:`flex max-h-[80vh] flex-col sm:max-w-lg`,children:[(0,i.jsx)(n.M,{children:(0,i.jsx)(n.F,{children:m(`forms.iconPicker.chooseAnIcon`,{defaultValue:`Choose an icon`})})}),(0,i.jsxs)(`div`,{className:`flex gap-2`,children:[(0,i.jsxs)(`div`,{className:`relative flex-1`,children:[(0,i.jsx)(l.IconSearch,{className:`absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground`}),(0,i.jsx)(n.l,{value:h,onChange:e=>g(e.target.value),placeholder:m(`forms.iconPicker.searchIcons`,{defaultValue:`Search icons`}),className:`pl-9`,autoFocus:!0})]}),I&&(0,i.jsxs)(n.u,{type:`button`,size:`sm`,variant:`outline`,onClick:P,disabled:w,className:`shrink-0 gap-1.5`,children:[w?(0,i.jsx)(l.IconLoader2,{className:`size-4 animate-spin`}):(0,i.jsx)(l.IconSparkles,{className:`size-4`}),m(`forms.iconPicker.aiSuggest`,{defaultValue:`Suggest`})]})]}),E.length>0&&(0,i.jsxs)(`div`,{className:`rounded-lg border border-[var(--vg-accent-line)] bg-[var(--vg-accent-surface)] p-3`,children:[(0,i.jsxs)(`div`,{className:`mb-2 flex items-center gap-1.5 text-xs font-medium vg-accent-text`,children:[(0,i.jsx)(l.IconSparkles,{className:`size-3.5`}),m(`forms.iconPicker.aiSuggestions`,{defaultValue:`Suggestions`})]}),(0,i.jsx)(`div`,{className:`mb-3 flex flex-wrap gap-1.5`,children:E.map(e=>(0,i.jsxs)(`button`,{type:`button`,onClick:()=>A(k===e.keyword?null:e.keyword),className:`cursor-pointer rounded-full px-3 py-1 text-xs font-medium transition-all ${k===e.keyword?`vg-accent-solid text-white`:`bg-[var(--vg-accent-surface)] text-[var(--vg-accent-fg)] hover:bg-[var(--vg-accent-surface-strong)]`}`,children:[e.keyword,(0,i.jsx)(`span`,{className:`ml-1 opacity-60`,children:e.icons.length})]},e.keyword))}),(0,i.jsx)(`div`,{className:`flex max-h-60 flex-wrap gap-2 overflow-y-auto`,children:F.map(e=>(0,i.jsxs)(`button`,{type:`button`,onClick:()=>N(e),className:`flex cursor-pointer flex-col items-center gap-1 rounded-lg p-2 transition-all hover:bg-[var(--vg-accent-surface)] ${a===e?`border border-[var(--vg-accent-line)] bg-[var(--vg-accent-surface-strong)] vg-accent-text`:`border border-[var(--vg-accent-line)]`}`,title:e,children:[(0,i.jsx)(u.Icon,{icon:e,className:`size-7`}),(0,i.jsx)(`span`,{className:`max-w-[80px] truncate text-center text-[9px] leading-tight text-muted-foreground`,children:e.split(`:`)[1]??e})]},e))})]}),(0,i.jsxs)(`div`,{className:`max-h-[400px] min-h-[200px] flex-1 overflow-y-auto`,children:[y&&(0,i.jsx)(`div`,{className:`flex h-32 items-center justify-center text-sm text-muted-foreground`,children:m(`forms.iconPicker.searching`,{defaultValue:`Searching…`})}),!y&&h&&_.length===0&&(0,i.jsx)(`div`,{className:`flex h-32 items-center justify-center text-sm text-muted-foreground`,children:m(`forms.iconPicker.noIconsFound`,{query:h,defaultValue:`No icons found for “{{query}}”`})}),!y&&!h&&_.length===0&&E.length===0&&(0,i.jsxs)(`div`,{className:`flex h-32 flex-col items-center justify-center gap-2 px-4 text-center text-sm text-muted-foreground`,children:[(0,i.jsx)(`span`,{children:m(`forms.iconPicker.typeToSearch`,{count:b.length,defaultValue:`Type to search {{count}} icon collections`})}),I&&(0,i.jsx)(`span`,{className:`text-xs leading-relaxed`,children:m(`forms.iconPicker.orClickAi`,{defaultValue:`…or let the title and description suggest some`})})]}),_.length>0&&(0,i.jsx)(`div`,{className:`grid grid-cols-6 gap-1.5 p-1`,children:_.map(e=>(0,i.jsxs)(`button`,{type:`button`,onClick:()=>N(e),className:`flex cursor-pointer flex-col items-center justify-center gap-1 rounded-lg p-2 transition-all hover:bg-muted ${a===e?`border border-[var(--vg-accent-line)] bg-[var(--vg-accent-surface)] vg-accent-text`:`border border-transparent hover:border-border`}`,title:e,children:[(0,i.jsx)(u.Icon,{icon:e,className:`size-6`}),(0,i.jsx)(`span`,{className:`w-full truncate text-center text-[9px] leading-tight text-muted-foreground`,children:e.split(`:`)[1]??e})]},e))})]}),a&&(0,i.jsxs)(`div`,{className:`flex items-center justify-between border-t pt-2`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsx)(u.Icon,{icon:a,className:`size-5`}),(0,i.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:a})]}),(0,i.jsxs)(`div`,{className:`flex gap-2`,children:[s&&(0,i.jsxs)(n.u,{size:`sm`,type:`button`,variant:`outline`,onClick:()=>{s(),t(!1)},children:[(0,i.jsx)(l.IconTrash,{className:`size-4`}),m(`forms.common.remove`,{defaultValue:`Remove`})]}),(0,i.jsx)(n.u,{size:`sm`,type:`button`,onClick:()=>t(!1),children:m(`forms.iconPicker.done`,{defaultValue:`Done`})})]})]})]})})}var w={blue:{color:`text-blue-600 dark:text-blue-400`,bg:`from-blue-500/10 to-indigo-500/10 dark:from-blue-500/20 dark:to-indigo-500/20`,ring:`ring-blue-500/10 dark:ring-blue-400/10`},violet:{color:`text-violet-600 dark:text-violet-400`,bg:`from-violet-500/10 to-purple-500/10 dark:from-violet-500/20 dark:to-purple-500/20`,ring:`ring-violet-500/10 dark:ring-violet-400/10`},emerald:{color:`text-emerald-600 dark:text-emerald-400`,bg:`from-emerald-500/10 to-teal-500/10 dark:from-emerald-500/20 dark:to-teal-500/20`,ring:`ring-emerald-500/10 dark:ring-emerald-400/10`},amber:{color:`text-amber-600 dark:text-amber-400`,bg:`from-amber-500/10 to-orange-500/10 dark:from-amber-500/20 dark:to-orange-500/20`,ring:`ring-amber-500/10 dark:ring-amber-400/10`},rose:{color:`text-rose-600 dark:text-rose-400`,bg:`from-rose-500/10 to-pink-500/10 dark:from-rose-500/20 dark:to-pink-500/20`,ring:`ring-rose-500/10 dark:ring-rose-400/10`},cyan:{color:`text-cyan-600 dark:text-cyan-400`,bg:`from-cyan-500/10 to-sky-500/10 dark:from-cyan-500/20 dark:to-sky-500/20`,ring:`ring-cyan-500/10 dark:ring-cyan-400/10`},orange:{color:`text-orange-600 dark:text-orange-400`,bg:`from-orange-500/10 to-amber-500/10 dark:from-orange-500/20 dark:to-amber-500/20`,ring:`ring-orange-500/10 dark:ring-orange-400/10`},slate:{color:`text-slate-600 dark:text-slate-400`,bg:`from-slate-500/10 to-gray-500/10 dark:from-slate-500/20 dark:to-gray-500/20`,ring:`ring-slate-500/10 dark:ring-slate-400/10`}},T=(0,r.createContext)({open:!0,toggle:()=>{},variant:`blue`});function E({variant:e=`blue`,defaultOpen:n=!0,children:a,className:o}){let[s,c]=(0,r.useState)(n);return(0,i.jsx)(T.Provider,{value:{open:s,toggle:()=>c(e=>!e),variant:e},children:(0,i.jsx)(`div`,{className:t.t(`rounded-xl border overflow-hidden`,o),children:a})})}function D({icon:e,title:n,description:a,className:o}){let{open:s,toggle:c,variant:u}=(0,r.useContext)(T),d=w[u];return(0,i.jsxs)(`button`,{type:`button`,onClick:c,className:t.t(`flex w-full items-center gap-3 px-5 py-4 bg-muted/40 border-b cursor-pointer hover:bg-muted/60 transition-colors`,o),children:[(0,i.jsx)(`div`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-linear-to-br ${d.bg} ring-1 ${d.ring}`,children:(0,i.jsx)(e,{className:`size-4 ${d.color}`})}),(0,i.jsxs)(`div`,{className:`min-w-0 text-left`,children:[(0,i.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:n}),a&&(0,i.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:a})]}),(0,i.jsx)(l.IconChevronDown,{className:t.t(`ml-auto size-4 text-muted-foreground shrink-0 transition-transform duration-200`,s&&`rotate-180`)})]})}function O({icon:e,title:n,description:a,className:o}){let{variant:s}=(0,r.useContext)(T),c=w[s];return(0,i.jsxs)(`div`,{className:t.t(`flex items-center gap-3 px-5 py-4 bg-muted/40 border-b`,o),children:[(0,i.jsx)(`div`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-linear-to-br ${c.bg} ring-1 ${c.ring}`,children:(0,i.jsx)(e,{className:`size-4 ${c.color}`})}),(0,i.jsxs)(`div`,{className:`min-w-0`,children:[(0,i.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:n}),a&&(0,i.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:a})]})]})}function k({children:e,className:n}){let{open:a}=(0,r.useContext)(T);return a?(0,i.jsx)(`div`,{className:t.t(`p-5 space-y-6`,n),children:e}):null}E.Header=D,E.StaticHeader=O,E.Content=k;var A=({...e})=>{let{theme:t=`system`}=(0,d.useTheme)(),{t:n}=(0,c.useTranslation)();return(0,i.jsx)(f.Toaster,{theme:t,className:`toaster group`,containerAriaLabel:n(`common.notifications`,{defaultValue:`Notifications`}),icons:{success:(0,i.jsx)(p,{className:`size-4`}),info:(0,i.jsx)(m,{className:`size-4`}),warning:(0,i.jsx)(_,{className:`size-4`}),error:(0,i.jsx)(g,{className:`size-4`}),loading:(0,i.jsx)(h,{className:`size-4 animate-spin`})},style:{"--normal-bg":`var(--vg-popover)`,"--normal-text":`var(--vg-popover-foreground)`,"--normal-border":`var(--vg-border)`,"--border-radius":`var(--vg-radius)`},...e})};function j({givenName:e,familyName:t,name:n}){let r=(e??``).trim(),i=(t??``).trim();if(r||i){let e=r?r[0]:``,t=i.split(/\s+/).filter(Boolean),n=`${e}${t.length>0?t[t.length-1][0]:``}`.toUpperCase();if(n)return n}let a=(n??``).trim();if(a){let e=a.split(/\s+/).filter(Boolean);return e.length===1?e[0][0].toUpperCase():`${e[0][0]}${e[e.length-1][0]}`.toUpperCase()}return`U`}function M({className:e,givenName:n,familyName:r,name:o,src:s,alt:c,children:l,...u}){let d=j({givenName:n,familyName:r,name:o}),f=c??o??[n,r].filter(Boolean).join(` `);return(0,i.jsxs)(a.Root,{"data-slot":`user-avatar`,className:t.t(`relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full size-8`,`bg-muted text-muted-foreground text-xs font-semibold`,`ring-1 ring-border`,e),...u,children:[s&&(0,i.jsx)(a.Image,{"data-slot":`user-avatar-image`,src:s,alt:f,className:`aspect-square size-full object-cover`}),(0,i.jsx)(a.Fallback,{"data-slot":`user-avatar-fallback`,className:`flex size-full items-center justify-center`,delayMs:s?600:0,children:l??d})]})}var N=r.default.createContext(null);function P({children:e,fetchUser:t}){let[n,a]=r.default.useState({}),[o,s]=r.default.useState(`loading`),[c,l]=r.default.useState(null),u=r.default.useRef(0),d=r.default.useCallback(()=>{let e=++u.current;t().then(t=>{e===u.current&&(a(t),l(null),s(`ready`))},t=>{e===u.current&&(l(t),s(`failed`))})},[t]);r.default.useEffect(()=>{d()},[d]);let f=r.default.useMemo(()=>({user:n,refreshUser:d,status:o,error:c}),[n,d,o,c]);return(0,i.jsx)(N,{value:f,children:e})}function F(){let e=r.default.useContext(N);if(!e)throw Error(`useCurrentUser must be used within UserProvider`);return e}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return v}});
@@ -0,0 +1,41 @@
1
+ import { clsx as e } from "clsx";
2
+ import { twMerge as t } from "tailwind-merge";
3
+ //#region src/lib/utils.ts
4
+ function n(...n) {
5
+ return t(e(n));
6
+ }
7
+ function r(e) {
8
+ let [t = "", n] = e.trim().replaceAll("-", "_").toUpperCase().split("_");
9
+ return {
10
+ language: t,
11
+ region: n?.length === 2 ? n : null
12
+ };
13
+ }
14
+ var i = (e, t = 10) => {
15
+ if (!e || e.length <= t) return e ?? "";
16
+ if (t < 3) return "...".slice(0, Math.max(t, 0));
17
+ let n = t - 3, r = Math.ceil(n / 2), i = Math.floor(n / 2);
18
+ return e.substring(0, r) + "..." + e.substring(e.length - i);
19
+ }, a = (e) => {
20
+ let { region: t } = r(e);
21
+ return t ? t.split("").map((e) => String.fromCodePoint((e.codePointAt(0) ?? 0) + 127397)).join("") : "🌐";
22
+ }, o = (e) => {
23
+ let t = 0;
24
+ for (let n = 0; n < e.length; n++) t = (e.codePointAt(n) ?? 0) + ((t << 5) - t);
25
+ let n = Math.abs(t) % 360;
26
+ return {
27
+ h: n,
28
+ light: {
29
+ bg: `hsl(${n}, 70%, 95%)`,
30
+ text: `hsl(${n}, 70%, 20%)`,
31
+ border: `hsl(${n}, 70%, 90%)`
32
+ },
33
+ dark: {
34
+ bg: `hsl(${n}, 50%, 15%)`,
35
+ text: `hsl(${n}, 80%, 80%)`,
36
+ border: `hsl(${n}, 50%, 25%)`
37
+ }
38
+ };
39
+ };
40
+ //#endregion
41
+ export { i as a, r as i, a as n, o as r, n as t };
@@ -0,0 +1 @@
1
+ let e=require("clsx"),t=require("tailwind-merge");function n(...n){return(0,t.twMerge)((0,e.clsx)(n))}function r(e){let[t=``,n]=e.trim().replaceAll(`-`,`_`).toUpperCase().split(`_`);return{language:t,region:n?.length===2?n:null}}var i=(e,t=10)=>{if(!e||e.length<=t)return e??``;if(t<3)return`...`.slice(0,Math.max(t,0));let n=t-3,r=Math.ceil(n/2),i=Math.floor(n/2);return e.substring(0,r)+`...`+e.substring(e.length-i)},a=e=>{let{region:t}=r(e);return t?t.split(``).map(e=>String.fromCodePoint((e.codePointAt(0)??0)+127397)).join(``):`🌐`},o=e=>{let t=0;for(let n=0;n<e.length;n++)t=(e.codePointAt(n)??0)+((t<<5)-t);let n=Math.abs(t)%360;return{h:n,light:{bg:`hsl(${n}, 70%, 95%)`,text:`hsl(${n}, 70%, 20%)`,border:`hsl(${n}, 70%, 90%)`},dark:{bg:`hsl(${n}, 50%, 15%)`,text:`hsl(${n}, 80%, 80%)`,border:`hsl(${n}, 50%, 25%)`}}};Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});