@viglet/viglet-design-system 2026.3.9 → 2026.3.11

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 (259) hide show
  1. package/README.md +528 -44
  2. package/consumers.json +186 -0
  3. package/dist/badge-locale-CJkHDlPg.cjs +1 -0
  4. package/dist/badge-locale-DxDp8Q3S.js +397 -0
  5. package/dist/bento/bento-actions-menu.d.ts +8 -0
  6. package/dist/bento/bento-actions-menu.d.ts.map +1 -1
  7. package/dist/bento/bento-back-to-top.d.ts +9 -1
  8. package/dist/bento/bento-back-to-top.d.ts.map +1 -1
  9. package/dist/bento/bento-command-palette.d.ts +56 -9
  10. package/dist/bento/bento-command-palette.d.ts.map +1 -1
  11. package/dist/bento/bento-data-table.d.ts +81 -0
  12. package/dist/bento/bento-data-table.d.ts.map +1 -0
  13. package/dist/bento/bento-diff.d.ts +41 -0
  14. package/dist/bento/bento-diff.d.ts.map +1 -0
  15. package/dist/bento/bento-empty-state.d.ts +8 -1
  16. package/dist/bento/bento-empty-state.d.ts.map +1 -1
  17. package/dist/bento/bento-entity-shell.d.ts.map +1 -1
  18. package/dist/bento/bento-filter-bar.d.ts +60 -0
  19. package/dist/bento/bento-filter-bar.d.ts.map +1 -0
  20. package/dist/bento/bento-form-section.d.ts +14 -1
  21. package/dist/bento/bento-form-section.d.ts.map +1 -1
  22. package/dist/bento/bento-inline-edit.d.ts.map +1 -1
  23. package/dist/bento/bento-nav-rail.d.ts +13 -13
  24. package/dist/bento/bento-nav-rail.d.ts.map +1 -1
  25. package/dist/bento/bento-nav.d.ts +10 -2
  26. package/dist/bento/bento-nav.d.ts.map +1 -1
  27. package/dist/bento/bento-palette-trigger.d.ts +18 -0
  28. package/dist/bento/bento-palette-trigger.d.ts.map +1 -0
  29. package/dist/bento/bento-section-chrome.d.ts +19 -39
  30. package/dist/bento/bento-section-chrome.d.ts.map +1 -1
  31. package/dist/bento/bento-shell-shortcuts.d.ts +67 -0
  32. package/dist/bento/bento-shell-shortcuts.d.ts.map +1 -0
  33. package/dist/bento/bento-shell.d.ts +53 -0
  34. package/dist/bento/bento-shell.d.ts.map +1 -0
  35. package/dist/bento/bento-shortcuts-dialog.d.ts +9 -7
  36. package/dist/bento/bento-shortcuts-dialog.d.ts.map +1 -1
  37. package/dist/bento/bento-status-marker.d.ts +5 -2
  38. package/dist/bento/bento-status-marker.d.ts.map +1 -1
  39. package/dist/bento/bento-tile.d.ts.map +1 -1
  40. package/dist/bento/bento-user-menu.d.ts +9 -8
  41. package/dist/bento/bento-user-menu.d.ts.map +1 -1
  42. package/dist/bento/bento-version-rail.d.ts +31 -0
  43. package/dist/bento/bento-version-rail.d.ts.map +1 -0
  44. package/dist/bento/index.d.ts +15 -6
  45. package/dist/bento/index.d.ts.map +1 -1
  46. package/dist/bento.cjs +5 -1
  47. package/dist/bento.css +70 -4
  48. package/dist/bento.es.js +1778 -701
  49. package/dist/catalogue.json +5283 -0
  50. package/dist/components/app-footer.d.ts +7 -0
  51. package/dist/components/app-footer.d.ts.map +1 -1
  52. package/dist/components/app-switcher.d.ts.map +1 -1
  53. package/dist/components/backend-status.d.ts +19 -11
  54. package/dist/components/backend-status.d.ts.map +1 -1
  55. package/dist/components/badge-colorful.d.ts +13 -0
  56. package/dist/components/badge-colorful.d.ts.map +1 -1
  57. package/dist/components/badge-locale.d.ts +7 -0
  58. package/dist/components/badge-locale.d.ts.map +1 -1
  59. package/dist/components/error-boundary.d.ts +15 -13
  60. package/dist/components/error-boundary.d.ts.map +1 -1
  61. package/dist/components/language-select.d.ts +8 -0
  62. package/dist/components/language-select.d.ts.map +1 -1
  63. package/dist/components/login/login.d.ts +27 -0
  64. package/dist/components/login/login.d.ts.map +1 -1
  65. package/dist/components/mode-toggle.d.ts +9 -0
  66. package/dist/components/mode-toggle.d.ts.map +1 -1
  67. package/dist/components/nav-secondary.d.ts +7 -0
  68. package/dist/components/nav-secondary.d.ts.map +1 -1
  69. package/dist/components/router/dialog.delete.d.ts +8 -0
  70. package/dist/components/router/dialog.delete.d.ts.map +1 -1
  71. package/dist/components/router/gradient-button-link.d.ts +6 -0
  72. package/dist/components/router/gradient-button-link.d.ts.map +1 -1
  73. package/dist/components/router/index.d.ts +0 -11
  74. package/dist/components/router/index.d.ts.map +1 -1
  75. package/dist/components/router/loading-provider.d.ts +4 -0
  76. package/dist/components/router/loading-provider.d.ts.map +1 -1
  77. package/dist/components/startup-first/startup-first.d.ts +29 -0
  78. package/dist/components/startup-first/startup-first.d.ts.map +1 -1
  79. package/dist/components/ui/accordion.d.ts +17 -0
  80. package/dist/components/ui/accordion.d.ts.map +1 -1
  81. package/dist/components/ui/avatar.d.ts +14 -0
  82. package/dist/components/ui/avatar.d.ts.map +1 -1
  83. package/dist/components/ui/badge.d.ts +6 -0
  84. package/dist/components/ui/badge.d.ts.map +1 -1
  85. package/dist/components/ui/breadcrumb.d.ts +25 -0
  86. package/dist/components/ui/breadcrumb.d.ts.map +1 -1
  87. package/dist/components/ui/button.d.ts +15 -1
  88. package/dist/components/ui/button.d.ts.map +1 -1
  89. package/dist/components/ui/card.d.ts +27 -0
  90. package/dist/components/ui/card.d.ts.map +1 -1
  91. package/dist/components/ui/checkbox.d.ts +4 -0
  92. package/dist/components/ui/checkbox.d.ts.map +1 -1
  93. package/dist/components/ui/dialog.d.ts +36 -0
  94. package/dist/components/ui/dialog.d.ts.map +1 -1
  95. package/dist/components/ui/drawer.d.ts +35 -0
  96. package/dist/components/ui/drawer.d.ts.map +1 -1
  97. package/dist/components/ui/dropdown-menu.d.ts +53 -0
  98. package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
  99. package/dist/components/ui/floating-formulas-bg.d.ts +8 -0
  100. package/dist/components/ui/floating-formulas-bg.d.ts.map +1 -1
  101. package/dist/components/ui/form-actions.d.ts +7 -0
  102. package/dist/components/ui/form-actions.d.ts.map +1 -1
  103. package/dist/components/ui/form-item-two-columns.d.ts +7 -0
  104. package/dist/components/ui/form-item-two-columns.d.ts.map +1 -1
  105. package/dist/components/ui/form.d.ts +25 -0
  106. package/dist/components/ui/form.d.ts.map +1 -1
  107. package/dist/components/ui/glass-card.d.ts +18 -14
  108. package/dist/components/ui/glass-card.d.ts.map +1 -1
  109. package/dist/components/ui/gradient-button.d.ts +15 -1
  110. package/dist/components/ui/gradient-button.d.ts.map +1 -1
  111. package/dist/components/ui/gradient-switch.d.ts +6 -0
  112. package/dist/components/ui/gradient-switch.d.ts.map +1 -1
  113. package/dist/components/ui/hover-card.d.ts +14 -0
  114. package/dist/components/ui/hover-card.d.ts.map +1 -1
  115. package/dist/components/ui/icon-picker-dialog.d.ts.map +1 -1
  116. package/dist/components/ui/index.d.ts +6 -4
  117. package/dist/components/ui/index.d.ts.map +1 -1
  118. package/dist/components/ui/input.d.ts +6 -0
  119. package/dist/components/ui/input.d.ts.map +1 -1
  120. package/dist/components/ui/label.d.ts +4 -0
  121. package/dist/components/ui/label.d.ts.map +1 -1
  122. package/dist/components/ui/navigation-menu.d.ts +41 -0
  123. package/dist/components/ui/navigation-menu.d.ts.map +1 -1
  124. package/dist/components/ui/pagination.d.ts +25 -0
  125. package/dist/components/ui/pagination.d.ts.map +1 -1
  126. package/dist/components/ui/popover.d.ts +24 -0
  127. package/dist/components/ui/popover.d.ts.map +1 -1
  128. package/dist/components/ui/progress.d.ts +4 -0
  129. package/dist/components/ui/progress.d.ts.map +1 -1
  130. package/dist/components/ui/pulse-ring.d.ts +9 -11
  131. package/dist/components/ui/pulse-ring.d.ts.map +1 -1
  132. package/dist/components/ui/resizable.d.ts +11 -0
  133. package/dist/components/ui/resizable.d.ts.map +1 -1
  134. package/dist/components/ui/section-card.d.ts +9 -0
  135. package/dist/components/ui/section-card.d.ts.map +1 -1
  136. package/dist/components/ui/select.d.ts +36 -0
  137. package/dist/components/ui/select.d.ts.map +1 -1
  138. package/dist/components/ui/separator.d.ts +4 -0
  139. package/dist/components/ui/separator.d.ts.map +1 -1
  140. package/dist/components/ui/sheet.d.ts +29 -0
  141. package/dist/components/ui/sheet.d.ts.map +1 -1
  142. package/dist/components/ui/sidebar.d.ts +83 -0
  143. package/dist/components/ui/sidebar.d.ts.map +1 -1
  144. package/dist/components/ui/skeleton.d.ts +4 -0
  145. package/dist/components/ui/skeleton.d.ts.map +1 -1
  146. package/dist/components/ui/slider.d.ts +4 -0
  147. package/dist/components/ui/slider.d.ts.map +1 -1
  148. package/dist/components/ui/sonner.d.ts +16 -0
  149. package/dist/components/ui/sonner.d.ts.map +1 -1
  150. package/dist/components/ui/stepper.d.ts +8 -0
  151. package/dist/components/ui/stepper.d.ts.map +1 -1
  152. package/dist/components/ui/sticky-save-bar.d.ts +7 -0
  153. package/dist/components/ui/sticky-save-bar.d.ts.map +1 -1
  154. package/dist/components/ui/switch.d.ts +4 -0
  155. package/dist/components/ui/switch.d.ts.map +1 -1
  156. package/dist/components/ui/table.d.ts +31 -0
  157. package/dist/components/ui/table.d.ts.map +1 -1
  158. package/dist/components/ui/tabs.d.ts +16 -0
  159. package/dist/components/ui/tabs.d.ts.map +1 -1
  160. package/dist/components/ui/textarea.d.ts +4 -0
  161. package/dist/components/ui/textarea.d.ts.map +1 -1
  162. package/dist/components/ui/toggle-group.d.ts +7 -0
  163. package/dist/components/ui/toggle-group.d.ts.map +1 -1
  164. package/dist/components/ui/toggle.d.ts +4 -0
  165. package/dist/components/ui/toggle.d.ts.map +1 -1
  166. package/dist/components/ui/tooltip.d.ts +18 -0
  167. package/dist/components/ui/tooltip.d.ts.map +1 -1
  168. package/dist/components/ui/user-avatar.d.ts +2 -1
  169. package/dist/components/ui/user-avatar.d.ts.map +1 -1
  170. package/dist/components/ui/viglet-assistant.d.ts +103 -0
  171. package/dist/components/ui/viglet-assistant.d.ts.map +1 -0
  172. package/dist/components/ui/viglet-avatar.d.ts +44 -0
  173. package/dist/components/ui/viglet-avatar.d.ts.map +1 -0
  174. package/dist/contexts/breadcrumb.context.d.ts +7 -0
  175. package/dist/contexts/breadcrumb.context.d.ts.map +1 -1
  176. package/dist/contexts/user.context.d.ts +8 -0
  177. package/dist/contexts/user.context.d.ts.map +1 -1
  178. package/dist/exports.json +359 -30
  179. package/dist/floating-formulas-bg.cjs +1 -1
  180. package/dist/floating-formulas-bg.es.js +56 -55
  181. package/dist/hooks/index.d.ts +1 -0
  182. package/dist/hooks/index.d.ts.map +1 -1
  183. package/dist/hooks/use-assistant-notifications.d.ts +15 -0
  184. package/dist/hooks/use-assistant-notifications.d.ts.map +1 -0
  185. package/dist/i18n/index.d.ts +168 -0
  186. package/dist/i18n/index.d.ts.map +1 -1
  187. package/dist/i18n/locales/en/assistant.json.d.ts +25 -0
  188. package/dist/i18n/locales/en/bento.json.d.ts +48 -2
  189. package/dist/i18n/locales/en/common.json.d.ts +6 -1
  190. package/dist/i18n/locales/en/language.json.d.ts +8 -0
  191. package/dist/i18n/locales/pt/assistant.json.d.ts +25 -0
  192. package/dist/i18n/locales/pt/bento.json.d.ts +48 -2
  193. package/dist/i18n/locales/pt/common.json.d.ts +6 -1
  194. package/dist/i18n/locales/pt/language.json.d.ts +8 -0
  195. package/dist/i18n.cjs +1 -1
  196. package/dist/i18n.es.js +572 -2
  197. package/dist/index.cjs +1 -1
  198. package/dist/index.d.ts +0 -1
  199. package/dist/index.d.ts.map +1 -1
  200. package/dist/index.es.js +2280 -733
  201. package/dist/lib/busy.d.ts +26 -0
  202. package/dist/lib/busy.d.ts.map +1 -0
  203. package/dist/lib/corner-slot.d.ts +15 -0
  204. package/dist/lib/corner-slot.d.ts.map +1 -0
  205. package/dist/{loading-provider-BWWhhfEn.js → loading-provider-ClDkFPuv.js} +84 -81
  206. package/dist/loading-provider-DGuCfsl9.cjs +1 -0
  207. package/dist/preset.css +7 -10
  208. package/dist/router.cjs +1 -1
  209. package/dist/router.es.js +2 -776
  210. package/dist/user.context-Cr3GAQ_r.js +762 -0
  211. package/dist/user.context-hbdvmXOn.cjs +1 -0
  212. package/dist/utils-Fk5jmzzb.js +41 -0
  213. package/dist/utils-Oagwe_oa.cjs +1 -0
  214. package/dist/viglet-design-system.css +1 -1
  215. package/dist/vite/boot-loader.d.ts +33 -2
  216. package/dist/vite/boot-loader.d.ts.map +1 -1
  217. package/dist/vite.cjs +16 -5
  218. package/dist/vite.es.js +27 -14
  219. package/docs/BENTO-AUTHORING.md +81 -11
  220. package/docs/reference/grounds.dc.html +9 -9
  221. package/package.json +16 -4
  222. package/scripts/consumer-entries.mjs +209 -0
  223. package/scripts/lib/contrast.mjs +301 -0
  224. package/scripts/mcp.mjs +300 -0
  225. package/scripts/page-lint.mjs +428 -0
  226. package/scripts/page-reference.mjs +54 -10
  227. package/dist/badge-locale-CoEEv7s5.js +0 -581
  228. package/dist/badge-locale-hQyWhAKe.cjs +0 -7
  229. package/dist/breadcrumb.context-KQut7j8U.js +0 -917
  230. package/dist/breadcrumb.context-Vwc3lAlf.cjs +0 -1
  231. package/dist/components/router/blank-slate.d.ts +0 -21
  232. package/dist/components/router/blank-slate.d.ts.map +0 -1
  233. package/dist/components/router/grid.list.d.ts +0 -39
  234. package/dist/components/router/grid.list.d.ts.map +0 -1
  235. package/dist/components/router/internal.sidebar.d.ts +0 -61
  236. package/dist/components/router/internal.sidebar.d.ts.map +0 -1
  237. package/dist/components/router/nav-main.d.ts +0 -25
  238. package/dist/components/router/nav-main.d.ts.map +0 -1
  239. package/dist/components/router/nav-user.d.ts +0 -24
  240. package/dist/components/router/nav-user.d.ts.map +0 -1
  241. package/dist/components/router/page-content.d.ts +0 -12
  242. package/dist/components/router/page-content.d.ts.map +0 -1
  243. package/dist/components/router/page-header.d.ts +0 -23
  244. package/dist/components/router/page-header.d.ts.map +0 -1
  245. package/dist/components/router/page.d.ts +0 -22
  246. package/dist/components/router/page.d.ts.map +0 -1
  247. package/dist/components/router/sticky.page.header.d.ts +0 -85
  248. package/dist/components/router/sticky.page.header.d.ts.map +0 -1
  249. package/dist/components/router/sub.page.d.ts +0 -50
  250. package/dist/components/router/sub.page.d.ts.map +0 -1
  251. package/dist/components/router/sub.page.header.d.ts +0 -37
  252. package/dist/components/router/sub.page.header.d.ts.map +0 -1
  253. package/dist/i18n-DD3rQOWi.js +0 -426
  254. package/dist/i18n-DrBq-qJJ.cjs +0 -1
  255. package/dist/lib/react-markers.d.ts +0 -17
  256. package/dist/lib/react-markers.d.ts.map +0 -1
  257. package/dist/loading-provider-CmeMqLGk.cjs +0 -1
  258. package/dist/user.context-B9vIBzY5.cjs +0 -1
  259. package/dist/user.context-D1PxP4D4.js +0 -512
@@ -1,512 +0,0 @@
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-CoEEv7s5.js";
2
- import c, { createContext as l, useCallback as u, useContext as d, useEffect as f, useRef as p, useState as m } from "react";
3
- import { jsx as h, jsxs as g } from "react/jsx-runtime";
4
- import * as _ from "@radix-ui/react-avatar";
5
- import { Slot as v } from "@radix-ui/react-slot";
6
- import { cva as y } from "class-variance-authority";
7
- import { useTranslation as b } from "react-i18next";
8
- import { IconChevronDown as x, IconLoader2 as S, IconSearch as C, IconSparkles as w, IconTrash as T } from "@tabler/icons-react";
9
- import { Icon as E } from "@iconify/react";
10
- import { useTheme as D } from "next-themes";
11
- import { Toaster as O, toast as k } from "sonner";
12
- var A = n("circle-check", [["circle", {
13
- cx: "12",
14
- cy: "12",
15
- r: "10",
16
- key: "1mglay"
17
- }], ["path", {
18
- d: "m9 12 2 2 4-4",
19
- key: "dzmm74"
20
- }]]), j = n("info", [
21
- ["circle", {
22
- cx: "12",
23
- cy: "12",
24
- r: "10",
25
- key: "1mglay"
26
- }],
27
- ["path", {
28
- d: "M12 16v-4",
29
- key: "1dtifu"
30
- }],
31
- ["path", {
32
- d: "M12 8h.01",
33
- key: "e9boi3"
34
- }]
35
- ]), M = n("loader-circle", [["path", {
36
- d: "M21 12a9 9 0 1 1-6.219-8.56",
37
- key: "13zald"
38
- }]]), N = n("octagon-x", [
39
- ["path", {
40
- d: "m15 9-6 6",
41
- key: "1uzhvr"
42
- }],
43
- ["path", {
44
- 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",
45
- key: "2d38gg"
46
- }],
47
- ["path", {
48
- d: "m9 9 6 6",
49
- key: "z0biqf"
50
- }]
51
- ]), P = n("triangle-alert", [
52
- ["path", {
53
- 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
- key: "wmoenq"
55
- }],
56
- ["path", {
57
- d: "M12 9v4",
58
- key: "juzpu7"
59
- }],
60
- ["path", {
61
- d: "M12 17h.01",
62
- key: "p32p05"
63
- }]
64
- ]), F = y("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", {
65
- variants: {
66
- variant: {
67
- default: "bg-primary text-primary-foreground hover:bg-primary/90",
68
- destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
69
- 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",
70
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
71
- ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
72
- link: "text-primary underline-offset-4 hover:underline"
73
- },
74
- size: {
75
- default: "h-9 px-4 py-2 has-[>svg]:px-3",
76
- sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
77
- lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
78
- icon: "size-9",
79
- "icon-sm": "size-8",
80
- "icon-lg": "size-10"
81
- }
82
- },
83
- defaultVariants: {
84
- variant: "default",
85
- size: "default"
86
- }
87
- });
88
- function I({ className: e, variant: t, size: n, asChild: r = !1, ...a }) {
89
- return /* @__PURE__ */ h(r ? v : "button", {
90
- "data-slot": "button",
91
- className: i(F({
92
- variant: t,
93
- size: n,
94
- className: e
95
- })),
96
- ...a
97
- });
98
- }
99
- //#endregion
100
- //#region src/components/ui/icon-picker-dialog.tsx
101
- var L = [
102
- "lucide",
103
- "tabler",
104
- "mdi",
105
- "ph",
106
- "solar",
107
- "heroicons"
108
- ], R = L.join(",");
109
- async function z(e, t) {
110
- 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 ?? [];
113
- } catch {}
114
- return [];
115
- }
116
- function B({ open: n, onOpenChange: i, value: c, onSelect: l, onClear: d, title: _, description: v, suggestKeywords: y }) {
117
- 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) => {
118
- let t = ++B.current, n = () => t === B.current;
119
- if (!e.trim()) {
120
- A([]);
121
- return;
122
- }
123
- M(!0);
124
- try {
125
- let t = await z(e, 60);
126
- n() && A(t);
127
- } catch {
128
- n() && A([]);
129
- } finally {
130
- n() && M(!1);
131
- }
132
- }, []);
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);
138
- }
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)
150
- });
151
- R(t);
152
- } catch {
153
- R([]);
154
- } finally {
155
- F(!1);
156
- }
157
- }
158
- }
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,
163
- children: /* @__PURE__ */ g(a, {
164
- className: "flex max-h-[80vh] flex-col sm:max-w-lg",
165
- children: [
166
- /* @__PURE__ */ h(r, { children: /* @__PURE__ */ h(t, { children: x("forms.iconPicker.chooseAnIcon", { defaultValue: "Choose an icon" }) }) }),
167
- /* @__PURE__ */ g("div", {
168
- className: "flex gap-2",
169
- children: [/* @__PURE__ */ g("div", {
170
- className: "relative flex-1",
171
- children: [/* @__PURE__ */ h(C, { className: "absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }), /* @__PURE__ */ h(o, {
172
- value: D,
173
- onChange: (e) => O(e.target.value),
174
- placeholder: x("forms.iconPicker.searchIcons", { defaultValue: "Search icons" }),
175
- className: "pl-9",
176
- autoFocus: !0
177
- })]
178
- }), q && /* @__PURE__ */ g(s, {
179
- type: "button",
180
- size: "sm",
181
- variant: "outline",
182
- onClick: G,
183
- disabled: P,
184
- className: "shrink-0 gap-1.5",
185
- children: [P ? /* @__PURE__ */ h(S, { className: "size-4 animate-spin" }) : /* @__PURE__ */ h(w, { className: "size-4" }), x("forms.iconPicker.aiSuggest", { defaultValue: "Suggest" })]
186
- })]
187
- }),
188
- I.length > 0 && /* @__PURE__ */ g("div", {
189
- className: "rounded-lg border border-[var(--vg-accent-line)] bg-[var(--vg-accent-surface)] p-3",
190
- children: [
191
- /* @__PURE__ */ g("div", {
192
- className: "mb-2 flex items-center gap-1.5 text-xs font-medium vg-accent-text",
193
- children: [/* @__PURE__ */ h(w, { className: "size-3.5" }), x("forms.iconPicker.aiSuggestions", { defaultValue: "Suggestions" })]
194
- }),
195
- /* @__PURE__ */ h("div", {
196
- className: "mb-3 flex flex-wrap gap-1.5",
197
- children: I.map((e) => /* @__PURE__ */ g("button", {
198
- type: "button",
199
- onClick: () => H(V === e.keyword ? null : e.keyword),
200
- className: `cursor-pointer rounded-full px-3 py-1 text-xs font-medium transition-all ${V === e.keyword ? "vg-accent-solid text-white" : "bg-[var(--vg-accent-surface)] text-[var(--vg-accent-fg)] hover:bg-[var(--vg-accent-surface-strong)]"}`,
201
- children: [e.keyword, /* @__PURE__ */ h("span", {
202
- className: "ml-1 opacity-60",
203
- children: e.icons.length
204
- })]
205
- }, e.keyword))
206
- }),
207
- /* @__PURE__ */ h("div", {
208
- className: "flex max-h-60 flex-wrap gap-2 overflow-y-auto",
209
- children: K.map((e) => /* @__PURE__ */ g("button", {
210
- type: "button",
211
- onClick: () => W(e),
212
- 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
- title: e,
214
- children: [/* @__PURE__ */ h(E, {
215
- icon: e,
216
- className: "size-7"
217
- }), /* @__PURE__ */ h("span", {
218
- className: "max-w-[80px] truncate text-center text-[9px] leading-tight text-muted-foreground",
219
- children: e.split(":")[1] ?? e
220
- })]
221
- }, e))
222
- })
223
- ]
224
- }),
225
- /* @__PURE__ */ g("div", {
226
- className: "max-h-[400px] min-h-[200px] flex-1 overflow-y-auto",
227
- children: [
228
- j && /* @__PURE__ */ h("div", {
229
- className: "flex h-32 items-center justify-center text-sm text-muted-foreground",
230
- children: x("forms.iconPicker.searching", { defaultValue: "Searching…" })
231
- }),
232
- !j && D && k.length === 0 && /* @__PURE__ */ h("div", {
233
- className: "flex h-32 items-center justify-center text-sm text-muted-foreground",
234
- children: x("forms.iconPicker.noIconsFound", {
235
- query: D,
236
- defaultValue: "No icons found for “{{query}}”"
237
- })
238
- }),
239
- !j && !D && k.length === 0 && I.length === 0 && /* @__PURE__ */ g("div", {
240
- 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: x("forms.iconPicker.typeToSearch", {
242
- count: L.length,
243
- defaultValue: "Type to search {{count}} icon collections"
244
- }) }), q && /* @__PURE__ */ h("span", {
245
- className: "text-xs leading-relaxed",
246
- children: x("forms.iconPicker.orClickAi", { defaultValue: "…or let the title and description suggest some" })
247
- })]
248
- }),
249
- k.length > 0 && /* @__PURE__ */ h("div", {
250
- className: "grid grid-cols-6 gap-1.5 p-1",
251
- children: k.map((e) => /* @__PURE__ */ g("button", {
252
- type: "button",
253
- onClick: () => W(e),
254
- 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
- title: e,
256
- children: [/* @__PURE__ */ h(E, {
257
- icon: e,
258
- className: "size-6"
259
- }), /* @__PURE__ */ h("span", {
260
- className: "w-full truncate text-center text-[9px] leading-tight text-muted-foreground",
261
- children: e.split(":")[1] ?? e
262
- })]
263
- }, e))
264
- })
265
- ]
266
- }),
267
- c && /* @__PURE__ */ g("div", {
268
- className: "flex items-center justify-between border-t pt-2",
269
- children: [/* @__PURE__ */ g("div", {
270
- className: "flex items-center gap-2",
271
- children: [/* @__PURE__ */ h(E, {
272
- icon: c,
273
- className: "size-5"
274
- }), /* @__PURE__ */ h("span", {
275
- className: "font-mono text-xs text-muted-foreground",
276
- children: c
277
- })]
278
- }), /* @__PURE__ */ g("div", {
279
- className: "flex gap-2",
280
- children: [d && /* @__PURE__ */ g(s, {
281
- size: "sm",
282
- type: "button",
283
- variant: "outline",
284
- onClick: () => {
285
- d(), i(!1);
286
- },
287
- children: [/* @__PURE__ */ h(T, { className: "size-4" }), x("forms.common.remove", { defaultValue: "Remove" })]
288
- }), /* @__PURE__ */ h(s, {
289
- size: "sm",
290
- type: "button",
291
- onClick: () => i(!1),
292
- children: x("forms.iconPicker.done", { defaultValue: "Done" })
293
- })]
294
- })]
295
- })
296
- ]
297
- })
298
- });
299
- }
300
- //#endregion
301
- //#region src/components/ui/section-card.tsx
302
- var V = {
303
- blue: {
304
- color: "text-blue-600 dark:text-blue-400",
305
- bg: "from-blue-500/10 to-indigo-500/10 dark:from-blue-500/20 dark:to-indigo-500/20",
306
- ring: "ring-blue-500/10 dark:ring-blue-400/10"
307
- },
308
- violet: {
309
- color: "text-violet-600 dark:text-violet-400",
310
- bg: "from-violet-500/10 to-purple-500/10 dark:from-violet-500/20 dark:to-purple-500/20",
311
- ring: "ring-violet-500/10 dark:ring-violet-400/10"
312
- },
313
- emerald: {
314
- color: "text-emerald-600 dark:text-emerald-400",
315
- bg: "from-emerald-500/10 to-teal-500/10 dark:from-emerald-500/20 dark:to-teal-500/20",
316
- ring: "ring-emerald-500/10 dark:ring-emerald-400/10"
317
- },
318
- amber: {
319
- color: "text-amber-600 dark:text-amber-400",
320
- bg: "from-amber-500/10 to-orange-500/10 dark:from-amber-500/20 dark:to-orange-500/20",
321
- ring: "ring-amber-500/10 dark:ring-amber-400/10"
322
- },
323
- rose: {
324
- color: "text-rose-600 dark:text-rose-400",
325
- bg: "from-rose-500/10 to-pink-500/10 dark:from-rose-500/20 dark:to-pink-500/20",
326
- ring: "ring-rose-500/10 dark:ring-rose-400/10"
327
- },
328
- cyan: {
329
- color: "text-cyan-600 dark:text-cyan-400",
330
- bg: "from-cyan-500/10 to-sky-500/10 dark:from-cyan-500/20 dark:to-sky-500/20",
331
- ring: "ring-cyan-500/10 dark:ring-cyan-400/10"
332
- },
333
- orange: {
334
- color: "text-orange-600 dark:text-orange-400",
335
- bg: "from-orange-500/10 to-amber-500/10 dark:from-orange-500/20 dark:to-amber-500/20",
336
- ring: "ring-orange-500/10 dark:ring-orange-400/10"
337
- },
338
- slate: {
339
- color: "text-slate-600 dark:text-slate-400",
340
- bg: "from-slate-500/10 to-gray-500/10 dark:from-slate-500/20 dark:to-gray-500/20",
341
- ring: "ring-slate-500/10 dark:ring-slate-400/10"
342
- }
343
- }, H = l({
344
- open: !0,
345
- toggle: () => {},
346
- variant: "blue"
347
- });
348
- function U({ variant: e = "blue", defaultOpen: t = !0, children: n, className: r }) {
349
- let [a, o] = m(t);
350
- return /* @__PURE__ */ h(H.Provider, {
351
- value: {
352
- open: a,
353
- toggle: () => o((e) => !e),
354
- variant: e
355
- },
356
- children: /* @__PURE__ */ h("div", {
357
- className: i("rounded-xl border overflow-hidden", r),
358
- children: n
359
- })
360
- });
361
- }
362
- function W({ icon: e, title: t, description: n, className: r }) {
363
- let { open: a, toggle: o, variant: s } = d(H), c = V[s];
364
- return /* @__PURE__ */ g("button", {
365
- type: "button",
366
- 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),
368
- children: [
369
- /* @__PURE__ */ h("div", {
370
- 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}` })
372
- }),
373
- /* @__PURE__ */ g("div", {
374
- className: "min-w-0 text-left",
375
- children: [/* @__PURE__ */ h("h3", {
376
- className: "text-sm font-semibold text-foreground",
377
- children: t
378
- }), n && /* @__PURE__ */ h("p", {
379
- className: "text-xs text-muted-foreground",
380
- children: n
381
- })]
382
- }),
383
- /* @__PURE__ */ h(x, { className: i("ml-auto size-4 text-muted-foreground shrink-0 transition-transform duration-200", a && "rotate-180") })
384
- ]
385
- });
386
- }
387
- function G({ icon: e, title: t, description: n, className: r }) {
388
- let { variant: a } = d(H), o = V[a];
389
- return /* @__PURE__ */ g("div", {
390
- className: i("flex items-center gap-3 px-5 py-4 bg-muted/40 border-b", r),
391
- children: [/* @__PURE__ */ h("div", {
392
- 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}` })
394
- }), /* @__PURE__ */ g("div", {
395
- className: "min-w-0",
396
- children: [/* @__PURE__ */ h("h3", {
397
- className: "text-sm font-semibold text-foreground",
398
- children: t
399
- }), n && /* @__PURE__ */ h("p", {
400
- className: "text-xs text-muted-foreground",
401
- children: n
402
- })]
403
- })]
404
- });
405
- }
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
411
- }) : null;
412
- }
413
- U.Header = W, U.StaticHeader = G, U.Content = K;
414
- //#endregion
415
- //#region src/components/ui/sonner.tsx
416
- var q = ({ ...e }) => {
417
- let { theme: t = "system" } = D();
418
- return /* @__PURE__ */ h(O, {
419
- theme: t,
420
- className: "toaster group",
421
- icons: {
422
- success: /* @__PURE__ */ h(A, { className: "size-4" }),
423
- info: /* @__PURE__ */ h(j, { className: "size-4" }),
424
- warning: /* @__PURE__ */ h(P, { className: "size-4" }),
425
- error: /* @__PURE__ */ h(N, { className: "size-4" }),
426
- loading: /* @__PURE__ */ h(M, { className: "size-4 animate-spin" })
427
- },
428
- style: {
429
- "--normal-bg": "var(--vg-popover)",
430
- "--normal-text": "var(--vg-popover-foreground)",
431
- "--normal-border": "var(--vg-border)",
432
- "--border-radius": "var(--vg-radius)"
433
- },
434
- ...e
435
- });
436
- };
437
- //#endregion
438
- //#region src/components/ui/user-avatar.tsx
439
- function J({ givenName: e, familyName: t, name: n }) {
440
- let r = (e ?? "").trim(), i = (t ?? "").trim();
441
- if (r || i) {
442
- let e = r ? r[0] : "", t = i.split(/\s+/).filter(Boolean), n = `${e}${t.length > 0 ? t[t.length - 1][0] : ""}`.toUpperCase();
443
- if (n) return n;
444
- }
445
- let a = (n ?? "").trim();
446
- if (a) {
447
- let e = a.split(/\s+/).filter(Boolean);
448
- return e.length === 1 ? e[0][0].toUpperCase() : `${e[0][0]}${e[e.length - 1][0]}`.toUpperCase();
449
- }
450
- return "U";
451
- }
452
- function Y({ className: e, givenName: t, familyName: n, name: r, src: a, alt: o, children: s, ...c }) {
453
- let l = J({
454
- givenName: t,
455
- familyName: n,
456
- name: r
457
- }), u = o ?? r ?? [t, n].filter(Boolean).join(" ");
458
- return /* @__PURE__ */ g(_.Root, {
459
- "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),
461
- ...c,
462
- children: [a && /* @__PURE__ */ h(_.Image, {
463
- "data-slot": "user-avatar-image",
464
- src: a,
465
- alt: u,
466
- className: "aspect-square size-full object-cover"
467
- }), /* @__PURE__ */ h(_.Fallback, {
468
- "data-slot": "user-avatar-fallback",
469
- className: "flex size-full items-center justify-center",
470
- delayMs: a ? 600 : 0,
471
- children: s ?? l
472
- })]
473
- });
474
- }
475
- //#endregion
476
- //#region src/contexts/user.context.tsx
477
- var X = c.createContext(null);
478
- function Z({ children: e, fetchUser: t }) {
479
- let [n, r] = c.useState({}), [i, a] = c.useState("loading"), [o, s] = c.useState(null), l = c.useRef(0), u = c.useCallback(() => {
480
- let e = ++l.current;
481
- t().then((t) => {
482
- e === l.current && (r(t), s(null), a("ready"));
483
- }, (t) => {
484
- e === l.current && (s(t), a("failed"));
485
- });
486
- }, [t]);
487
- c.useEffect(() => {
488
- u();
489
- }, [u]);
490
- let d = c.useMemo(() => ({
491
- user: n,
492
- refreshUser: u,
493
- status: i,
494
- error: o
495
- }), [
496
- n,
497
- u,
498
- i,
499
- o
500
- ]);
501
- return /* @__PURE__ */ h(X, {
502
- value: d,
503
- children: e
504
- });
505
- }
506
- function Q() {
507
- let e = c.useContext(X);
508
- if (!e) throw Error("useCurrentUser must be used within UserProvider");
509
- return e;
510
- }
511
- //#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 };