@bzync/rui 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (263) hide show
  1. package/LICENSE +15 -0
  2. package/README.md +115 -0
  3. package/dist/autocomplete-CaysJRpk.cjs +1 -0
  4. package/dist/autocomplete-CfbfpcO4.js +453 -0
  5. package/dist/calendar-Bnld4G59.cjs +1 -0
  6. package/dist/calendar-CdICOROs.js +573 -0
  7. package/dist/charts-CxEy2c3M.js +1248 -0
  8. package/dist/charts-UDqS1BH1.cjs +1 -0
  9. package/dist/cn-BdjraxxU.cjs +1 -0
  10. package/dist/cn-DpgY2leY.js +1736 -0
  11. package/dist/component-styles-Ce56hn9T.js +16 -0
  12. package/dist/component-styles-TkZ7v6Ef.cjs +1 -0
  13. package/dist/components/accordion.cjs +1 -0
  14. package/dist/components/accordion.d.ts +22 -0
  15. package/dist/components/accordion.js +122 -0
  16. package/dist/components/alert.cjs +1 -0
  17. package/dist/components/alert.d.ts +13 -0
  18. package/dist/components/alert.js +165 -0
  19. package/dist/components/auth-backdrop.cjs +1 -0
  20. package/dist/components/auth-backdrop.d.ts +7 -0
  21. package/dist/components/auth-backdrop.js +10 -0
  22. package/dist/components/autocomplete/dropdown.d.ts +21 -0
  23. package/dist/components/autocomplete/icons.d.ts +8 -0
  24. package/dist/components/autocomplete/multi-trigger.d.ts +25 -0
  25. package/dist/components/autocomplete/single-trigger.d.ts +21 -0
  26. package/dist/components/autocomplete/types.d.ts +34 -0
  27. package/dist/components/autocomplete.cjs +1 -0
  28. package/dist/components/autocomplete.d.ts +5 -0
  29. package/dist/components/autocomplete.js +3 -0
  30. package/dist/components/avatar.cjs +1 -0
  31. package/dist/components/avatar.d.ts +17 -0
  32. package/dist/components/avatar.js +56 -0
  33. package/dist/components/badge.cjs +1 -0
  34. package/dist/components/badge.d.ts +12 -0
  35. package/dist/components/badge.js +32 -0
  36. package/dist/components/billing-interval-toggle.cjs +1 -0
  37. package/dist/components/billing-interval-toggle.d.ts +18 -0
  38. package/dist/components/billing-interval-toggle.js +39 -0
  39. package/dist/components/breadcrumb.cjs +1 -0
  40. package/dist/components/breadcrumb.d.ts +11 -0
  41. package/dist/components/breadcrumb.js +52 -0
  42. package/dist/components/button.cjs +1 -0
  43. package/dist/components/button.d.ts +17 -0
  44. package/dist/components/button.js +90 -0
  45. package/dist/components/calendar/month-view.d.ts +17 -0
  46. package/dist/components/calendar/types.d.ts +54 -0
  47. package/dist/components/calendar/week-view.d.ts +17 -0
  48. package/dist/components/calendar.cjs +1 -0
  49. package/dist/components/calendar.d.ts +3 -0
  50. package/dist/components/calendar.js +3 -0
  51. package/dist/components/callout.cjs +1 -0
  52. package/dist/components/callout.d.ts +9 -0
  53. package/dist/components/callout.js +131 -0
  54. package/dist/components/card.cjs +1 -0
  55. package/dist/components/card.d.ts +17 -0
  56. package/dist/components/card.js +59 -0
  57. package/dist/components/charts/bar-chart.d.ts +16 -0
  58. package/dist/components/charts/donut-chart.d.ts +10 -0
  59. package/dist/components/charts/funnel-chart.d.ts +8 -0
  60. package/dist/components/charts/gantt-chart.d.ts +15 -0
  61. package/dist/components/charts/heatmap-chart.d.ts +10 -0
  62. package/dist/components/charts/index.d.ts +11 -0
  63. package/dist/components/charts/line-chart.d.ts +16 -0
  64. package/dist/components/charts/multi-line-chart.d.ts +18 -0
  65. package/dist/components/charts/radar-chart.d.ts +13 -0
  66. package/dist/components/charts/scatter-chart.d.ts +24 -0
  67. package/dist/components/charts/shared.d.ts +15 -0
  68. package/dist/components/charts/waterfall-chart.d.ts +14 -0
  69. package/dist/components/charts.cjs +1 -0
  70. package/dist/components/charts.d.ts +2 -0
  71. package/dist/components/charts.js +2 -0
  72. package/dist/components/checkbox.cjs +1 -0
  73. package/dist/components/checkbox.d.ts +9 -0
  74. package/dist/components/checkbox.js +135 -0
  75. package/dist/components/code.cjs +7 -0
  76. package/dist/components/code.d.ts +23 -0
  77. package/dist/components/code.js +276 -0
  78. package/dist/components/command.cjs +1 -0
  79. package/dist/components/command.d.ts +29 -0
  80. package/dist/components/command.js +208 -0
  81. package/dist/components/confirm-dialog.cjs +1 -0
  82. package/dist/components/confirm-dialog.d.ts +14 -0
  83. package/dist/components/confirm-dialog.js +69 -0
  84. package/dist/components/copy-button.cjs +1 -0
  85. package/dist/components/copy-button.d.ts +8 -0
  86. package/dist/components/copy-button.js +87 -0
  87. package/dist/components/datatable/pagination-footer.d.ts +10 -0
  88. package/dist/components/datatable/rows-dropdown.d.ts +5 -0
  89. package/dist/components/datatable/skeleton-row.d.ts +3 -0
  90. package/dist/components/datatable/sort-icon.d.ts +4 -0
  91. package/dist/components/datatable/types.d.ts +30 -0
  92. package/dist/components/datatable.cjs +1 -0
  93. package/dist/components/datatable.d.ts +9 -0
  94. package/dist/components/datatable.js +3 -0
  95. package/dist/components/datepicker.cjs +1 -0
  96. package/dist/components/datepicker.d.ts +14 -0
  97. package/dist/components/datepicker.js +267 -0
  98. package/dist/components/drawer.cjs +1 -0
  99. package/dist/components/drawer.d.ts +18 -0
  100. package/dist/components/drawer.js +3 -0
  101. package/dist/components/dropdown-menu.cjs +1 -0
  102. package/dist/components/dropdown-menu.d.ts +26 -0
  103. package/dist/components/dropdown-menu.js +122 -0
  104. package/dist/components/empty-state.cjs +1 -0
  105. package/dist/components/empty-state.d.ts +10 -0
  106. package/dist/components/empty-state.js +68 -0
  107. package/dist/components/error-state.cjs +1 -0
  108. package/dist/components/error-state.d.ts +10 -0
  109. package/dist/components/error-state.js +80 -0
  110. package/dist/components/file-upload.cjs +1 -0
  111. package/dist/components/file-upload.d.ts +10 -0
  112. package/dist/components/file-upload.js +173 -0
  113. package/dist/components/form-field.cjs +1 -0
  114. package/dist/components/form-field.d.ts +10 -0
  115. package/dist/components/form-field.js +36 -0
  116. package/dist/components/info-button.cjs +1 -0
  117. package/dist/components/info-button.d.ts +4 -0
  118. package/dist/components/info-button.js +32 -0
  119. package/dist/components/input.cjs +1 -0
  120. package/dist/components/input.d.ts +19 -0
  121. package/dist/components/input.js +117 -0
  122. package/dist/components/kbd.cjs +1 -0
  123. package/dist/components/kbd.d.ts +6 -0
  124. package/dist/components/kbd.js +16 -0
  125. package/dist/components/label.cjs +1 -0
  126. package/dist/components/label.d.ts +6 -0
  127. package/dist/components/label.js +31 -0
  128. package/dist/components/layout.cjs +1 -0
  129. package/dist/components/layout.d.ts +51 -0
  130. package/dist/components/layout.js +117 -0
  131. package/dist/components/link.cjs +1 -0
  132. package/dist/components/link.d.ts +9 -0
  133. package/dist/components/link.js +48 -0
  134. package/dist/components/list.cjs +1 -0
  135. package/dist/components/list.d.ts +13 -0
  136. package/dist/components/list.js +46 -0
  137. package/dist/components/modal.cjs +1 -0
  138. package/dist/components/modal.d.ts +31 -0
  139. package/dist/components/modal.js +219 -0
  140. package/dist/components/navigation.cjs +1 -0
  141. package/dist/components/navigation.d.ts +42 -0
  142. package/dist/components/navigation.js +127 -0
  143. package/dist/components/number-input.cjs +1 -0
  144. package/dist/components/number-input.d.ts +16 -0
  145. package/dist/components/number-input.js +142 -0
  146. package/dist/components/otp-input.cjs +1 -0
  147. package/dist/components/otp-input.d.ts +13 -0
  148. package/dist/components/otp-input.js +71 -0
  149. package/dist/components/pagination.cjs +1 -0
  150. package/dist/components/pagination.d.ts +8 -0
  151. package/dist/components/pagination.js +77 -0
  152. package/dist/components/popover.cjs +1 -0
  153. package/dist/components/popover.d.ts +16 -0
  154. package/dist/components/popover.js +115 -0
  155. package/dist/components/progressbar.cjs +1 -0
  156. package/dist/components/progressbar.d.ts +15 -0
  157. package/dist/components/progressbar.js +108 -0
  158. package/dist/components/radio.cjs +1 -0
  159. package/dist/components/radio.d.ts +22 -0
  160. package/dist/components/radio.js +96 -0
  161. package/dist/components/richtext.cjs +1 -0
  162. package/dist/components/richtext.d.ts +10 -0
  163. package/dist/components/richtext.js +370 -0
  164. package/dist/components/select/option-list.d.ts +16 -0
  165. package/dist/components/select/select-multi.d.ts +2 -0
  166. package/dist/components/select/select-single.d.ts +2 -0
  167. package/dist/components/select/types.d.ts +54 -0
  168. package/dist/components/select/utils.d.ts +10 -0
  169. package/dist/components/select.cjs +1 -0
  170. package/dist/components/select.d.ts +3 -0
  171. package/dist/components/select.js +2 -0
  172. package/dist/components/seo.cjs +1 -0
  173. package/dist/components/seo.d.ts +45 -0
  174. package/dist/components/seo.js +64 -0
  175. package/dist/components/separator.cjs +1 -0
  176. package/dist/components/separator.d.ts +6 -0
  177. package/dist/components/separator.js +25 -0
  178. package/dist/components/skeleton.cjs +1 -0
  179. package/dist/components/skeleton.d.ts +37 -0
  180. package/dist/components/skeleton.js +146 -0
  181. package/dist/components/slider.cjs +1 -0
  182. package/dist/components/slider.d.ts +12 -0
  183. package/dist/components/slider.js +72 -0
  184. package/dist/components/snackbar.cjs +1 -0
  185. package/dist/components/snackbar.d.ts +35 -0
  186. package/dist/components/snackbar.js +220 -0
  187. package/dist/components/spinner.cjs +1 -0
  188. package/dist/components/spinner.d.ts +7 -0
  189. package/dist/components/spinner.js +31 -0
  190. package/dist/components/stat.cjs +1 -0
  191. package/dist/components/stat.d.ts +18 -0
  192. package/dist/components/stat.js +90 -0
  193. package/dist/components/status-dot.cjs +1 -0
  194. package/dist/components/status-dot.d.ts +10 -0
  195. package/dist/components/status-dot.js +29 -0
  196. package/dist/components/stepper.cjs +1 -0
  197. package/dist/components/stepper.d.ts +11 -0
  198. package/dist/components/stepper.js +67 -0
  199. package/dist/components/switch.cjs +1 -0
  200. package/dist/components/switch.d.ts +8 -0
  201. package/dist/components/switch.js +79 -0
  202. package/dist/components/table.cjs +1 -0
  203. package/dist/components/table.d.ts +12 -0
  204. package/dist/components/table.js +54 -0
  205. package/dist/components/tabs.cjs +1 -0
  206. package/dist/components/tabs.d.ts +22 -0
  207. package/dist/components/tabs.js +120 -0
  208. package/dist/components/tag.cjs +1 -0
  209. package/dist/components/tag.d.ts +12 -0
  210. package/dist/components/tag.js +58 -0
  211. package/dist/components/terminal/fs.d.ts +10 -0
  212. package/dist/components/terminal/shell-commands-sim.d.ts +5 -0
  213. package/dist/components/terminal/shell-commands.d.ts +16 -0
  214. package/dist/components/terminal/shell-run.d.ts +11 -0
  215. package/dist/components/terminal/terminal-block.d.ts +13 -0
  216. package/dist/components/terminal/terminal-emulator.d.ts +10 -0
  217. package/dist/components/terminal/types.d.ts +35 -0
  218. package/dist/components/terminal.cjs +1 -0
  219. package/dist/components/terminal.d.ts +2 -0
  220. package/dist/components/terminal.js +2 -0
  221. package/dist/components/textarea.cjs +1 -0
  222. package/dist/components/textarea.d.ts +13 -0
  223. package/dist/components/textarea.js +54 -0
  224. package/dist/components/theme-provider.cjs +1 -0
  225. package/dist/components/theme-provider.d.ts +89 -0
  226. package/dist/components/theme-provider.js +93 -0
  227. package/dist/components/theme-toggle.cjs +1 -0
  228. package/dist/components/theme-toggle.d.ts +9 -0
  229. package/dist/components/theme-toggle.js +4 -0
  230. package/dist/components/timeline.cjs +1 -0
  231. package/dist/components/timeline.d.ts +14 -0
  232. package/dist/components/timeline.js +54 -0
  233. package/dist/components/tooltip.cjs +1 -0
  234. package/dist/components/tooltip.d.ts +11 -0
  235. package/dist/components/tooltip.js +84 -0
  236. package/dist/components/tree.cjs +1 -0
  237. package/dist/components/tree.d.ts +16 -0
  238. package/dist/components/tree.js +92 -0
  239. package/dist/createLucideIcon-DDY8HuQR.js +42 -0
  240. package/dist/createLucideIcon-b_X_3fj-.cjs +1 -0
  241. package/dist/datatable-BB3v__r5.cjs +1 -0
  242. package/dist/datatable-DlBhUhuO.js +316 -0
  243. package/dist/drawer-Cbuh6qdL.cjs +1 -0
  244. package/dist/drawer-CqkVZT9Y.js +189 -0
  245. package/dist/focus-Dk1YWVPN.js +42 -0
  246. package/dist/focus-DmG6Ge7X.cjs +1 -0
  247. package/dist/index.cjs +1 -0
  248. package/dist/index.d.ts +70 -0
  249. package/dist/index.js +215 -0
  250. package/dist/lib/cn.d.ts +2 -0
  251. package/dist/lib/component-styles.d.ts +10 -0
  252. package/dist/select-Ch5fp1GT.js +461 -0
  253. package/dist/select-q0YCMhBP.cjs +1 -0
  254. package/dist/styles.css +3 -0
  255. package/dist/terminal-BOR2cFi1.js +1060 -0
  256. package/dist/terminal-CpraMs50.cjs +77 -0
  257. package/dist/theme-toggle-CnoiorKV.js +71 -0
  258. package/dist/theme-toggle-Dp1-24zH.cjs +1 -0
  259. package/dist/use-event-callback-DGkfO_uu.js +10 -0
  260. package/dist/use-event-callback-Du9_9eAi.cjs +1 -0
  261. package/dist/utils-CQ8pvCtk.js +72 -0
  262. package/dist/utils-DOFJTw8o.cjs +1 -0
  263. package/package.json +88 -0
@@ -0,0 +1,267 @@
1
+ "use client";
2
+ import { t as e } from "../cn-DpgY2leY.js";
3
+ import { c as t, o as n, t as r } from "../component-styles-Ce56hn9T.js";
4
+ import { AnimatePresence as i, motion as a } from "framer-motion";
5
+ import { useEffect as o, useId as s, useRef as c, useState as l } from "react";
6
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
7
+ //#region src/components/datepicker.tsx
8
+ var f = [
9
+ "Su",
10
+ "Mo",
11
+ "Tu",
12
+ "We",
13
+ "Th",
14
+ "Fr",
15
+ "Sa"
16
+ ], p = [
17
+ "January",
18
+ "February",
19
+ "March",
20
+ "April",
21
+ "May",
22
+ "June",
23
+ "July",
24
+ "August",
25
+ "September",
26
+ "October",
27
+ "November",
28
+ "December"
29
+ ];
30
+ function m(e) {
31
+ return `${p[e.getMonth()].slice(0, 3)} ${e.getDate()}, ${e.getFullYear()}`;
32
+ }
33
+ function h(e, t) {
34
+ return new Date(e, t + 1, 0).getDate();
35
+ }
36
+ function g(e, t) {
37
+ return new Date(e, t, 1).getDay();
38
+ }
39
+ function _(e, t) {
40
+ return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate();
41
+ }
42
+ function v({ value: v, onChange: y, label: b, hint: x, error: S, placeholder: C = "Select date…", disabled: w, clearable: T = !0, minDate: E, maxDate: D, className: O }) {
43
+ let [k, A] = l(null), j = v === void 0 ? k : v, M = /* @__PURE__ */ new Date(), [N, P] = l(!1), [F, I] = l((j ?? M).getFullYear()), [L, R] = l((j ?? M).getMonth()), z = c(null), B = s(), V = `${B}-message`;
44
+ function H(e) {
45
+ v === void 0 && A(e), y?.(e), P(!1);
46
+ }
47
+ function U(e) {
48
+ e.stopPropagation(), v === void 0 && A(null), y?.(null);
49
+ }
50
+ function W() {
51
+ L === 0 ? (R(11), I((e) => e - 1)) : R((e) => e - 1);
52
+ }
53
+ function G() {
54
+ L === 11 ? (R(0), I((e) => e + 1)) : R((e) => e + 1);
55
+ }
56
+ o(() => {
57
+ function e(e) {
58
+ z.current?.contains(e.target) || P(!1);
59
+ }
60
+ function t(e) {
61
+ e.key === "Escape" && P(!1);
62
+ }
63
+ return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
64
+ document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
65
+ };
66
+ }, []);
67
+ let K = h(F, L), q = g(F, L), J = [...Array(q).fill(null), ...Array.from({ length: K }, (e, t) => t + 1)];
68
+ return /* @__PURE__ */ d("div", {
69
+ ref: z,
70
+ className: e("relative", n, O),
71
+ children: [
72
+ b && /* @__PURE__ */ u("label", {
73
+ htmlFor: B,
74
+ className: "text-sm font-medium leading-5 text-foreground",
75
+ children: b
76
+ }),
77
+ /* @__PURE__ */ d("button", {
78
+ type: "button",
79
+ id: B,
80
+ "aria-expanded": N,
81
+ "aria-haspopup": "dialog",
82
+ "aria-invalid": S ? !0 : void 0,
83
+ "aria-describedby": S || x ? V : void 0,
84
+ disabled: w,
85
+ onClick: () => P((e) => !e),
86
+ className: e("flex h-9 w-full items-center gap-2 rounded-[var(--radius-md)] px-3 text-left outline-none", r, "focus:border-accent-500 focus:ring-2 focus:ring-focus-ring/20", S && "border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/20", w && "opacity-50 cursor-not-allowed"),
87
+ children: [
88
+ /* @__PURE__ */ d("svg", {
89
+ width: "14",
90
+ height: "14",
91
+ viewBox: "0 0 24 24",
92
+ fill: "none",
93
+ stroke: "currentColor",
94
+ strokeWidth: "2",
95
+ strokeLinecap: "round",
96
+ strokeLinejoin: "round",
97
+ className: "text-slate-500 shrink-0",
98
+ children: [
99
+ /* @__PURE__ */ u("rect", {
100
+ width: "18",
101
+ height: "18",
102
+ x: "3",
103
+ y: "4",
104
+ rx: "2",
105
+ ry: "2"
106
+ }),
107
+ /* @__PURE__ */ u("line", {
108
+ x1: "16",
109
+ x2: "16",
110
+ y1: "2",
111
+ y2: "6"
112
+ }),
113
+ /* @__PURE__ */ u("line", {
114
+ x1: "8",
115
+ x2: "8",
116
+ y1: "2",
117
+ y2: "6"
118
+ }),
119
+ /* @__PURE__ */ u("line", {
120
+ x1: "3",
121
+ x2: "21",
122
+ y1: "10",
123
+ y2: "10"
124
+ })
125
+ ]
126
+ }),
127
+ /* @__PURE__ */ u("span", {
128
+ className: e("flex-1 text-sm truncate", j ? "text-foreground" : "text-muted-foreground"),
129
+ children: j ? m(j) : C
130
+ }),
131
+ T && j && !w && /* @__PURE__ */ u("span", {
132
+ role: "button",
133
+ tabIndex: -1,
134
+ onClick: U,
135
+ className: "shrink-0 text-slate-500 hover:text-slate-700 dark:hover:text-slate-300 transition-colors",
136
+ children: /* @__PURE__ */ u("svg", {
137
+ width: "10",
138
+ height: "10",
139
+ viewBox: "0 0 24 24",
140
+ fill: "none",
141
+ stroke: "currentColor",
142
+ strokeWidth: "3",
143
+ strokeLinecap: "round",
144
+ strokeLinejoin: "round",
145
+ children: /* @__PURE__ */ u("path", { d: "M18 6 6 18M6 6l12 12" })
146
+ })
147
+ })
148
+ ]
149
+ }),
150
+ /* @__PURE__ */ u(i, { children: N && /* @__PURE__ */ d(a.div, {
151
+ initial: {
152
+ opacity: 0,
153
+ y: -4,
154
+ scaleY: .97
155
+ },
156
+ animate: {
157
+ opacity: 1,
158
+ y: 0,
159
+ scaleY: 1
160
+ },
161
+ exit: {
162
+ opacity: 0,
163
+ y: -4,
164
+ scaleY: .97
165
+ },
166
+ transition: { duration: .13 },
167
+ style: { originY: 0 },
168
+ role: "dialog",
169
+ "aria-label": "Choose date",
170
+ className: "absolute left-0 top-full z-50 mt-1.5 w-[min(18rem,calc(100vw-2rem))] rounded-[var(--radius-lg)] border border-border bg-surface-raised p-3 shadow-floating",
171
+ children: [
172
+ /* @__PURE__ */ d("div", {
173
+ className: "flex items-center justify-between mb-3",
174
+ children: [
175
+ /* @__PURE__ */ u("button", {
176
+ type: "button",
177
+ onClick: W,
178
+ "aria-label": "Previous month",
179
+ className: e(t, "size-7"),
180
+ children: /* @__PURE__ */ u("svg", {
181
+ width: "14",
182
+ height: "14",
183
+ viewBox: "0 0 24 24",
184
+ fill: "none",
185
+ stroke: "currentColor",
186
+ strokeWidth: "2.5",
187
+ strokeLinecap: "round",
188
+ strokeLinejoin: "round",
189
+ children: /* @__PURE__ */ u("path", { d: "m15 18-6-6 6-6" })
190
+ })
191
+ }),
192
+ /* @__PURE__ */ d("span", {
193
+ "aria-live": "polite",
194
+ className: "text-sm font-semibold text-foreground",
195
+ children: [
196
+ p[L],
197
+ " ",
198
+ F
199
+ ]
200
+ }),
201
+ /* @__PURE__ */ u("button", {
202
+ type: "button",
203
+ onClick: G,
204
+ "aria-label": "Next month",
205
+ className: e(t, "size-7"),
206
+ children: /* @__PURE__ */ u("svg", {
207
+ width: "14",
208
+ height: "14",
209
+ viewBox: "0 0 24 24",
210
+ fill: "none",
211
+ stroke: "currentColor",
212
+ strokeWidth: "2.5",
213
+ strokeLinecap: "round",
214
+ strokeLinejoin: "round",
215
+ children: /* @__PURE__ */ u("path", { d: "m9 18 6-6-6-6" })
216
+ })
217
+ })
218
+ ]
219
+ }),
220
+ /* @__PURE__ */ u("div", {
221
+ className: "grid grid-cols-7 gap-0.5 mb-1",
222
+ children: f.map((e) => /* @__PURE__ */ u("div", {
223
+ "aria-hidden": "true",
224
+ className: "text-center text-[10px] font-semibold text-muted-foreground py-1",
225
+ children: e
226
+ }, e))
227
+ }),
228
+ /* @__PURE__ */ u("div", {
229
+ className: "grid grid-cols-7 gap-0.5",
230
+ children: J.map((t, n) => {
231
+ if (!t) return /* @__PURE__ */ u("div", {}, `empty-${n}`);
232
+ let r = new Date(F, L, t), i = j ? _(r, j) : !1, a = _(r, M), o = E && r < E || D && r > D;
233
+ return /* @__PURE__ */ u("button", {
234
+ type: "button",
235
+ disabled: !!o,
236
+ onClick: () => H(r),
237
+ "aria-label": r.toLocaleDateString(void 0, {
238
+ weekday: "long",
239
+ year: "numeric",
240
+ month: "long",
241
+ day: "numeric"
242
+ }),
243
+ "aria-pressed": i,
244
+ "aria-current": a ? "date" : void 0,
245
+ className: e("h-8 w-full rounded-md text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring/35", i ? "bg-primary text-primary-foreground font-medium" : a ? "border border-accent-500/40 text-accent-400 hover:bg-accent-500/10" : "text-slate-700 dark:text-slate-200 hover:bg-black/6 dark:hover:bg-white/6", o && "opacity-30 cursor-not-allowed"),
246
+ children: t
247
+ }, t);
248
+ })
249
+ })
250
+ ]
251
+ }) }),
252
+ S && /* @__PURE__ */ u("p", {
253
+ id: V,
254
+ "aria-live": "polite",
255
+ className: "text-xs leading-5 text-destructive",
256
+ children: S
257
+ }),
258
+ x && !S && /* @__PURE__ */ u("p", {
259
+ id: V,
260
+ className: "text-xs leading-5 text-muted-foreground",
261
+ children: x
262
+ })
263
+ ]
264
+ });
265
+ }
266
+ //#endregion
267
+ export { v as DatePicker };
@@ -0,0 +1 @@
1
+ "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../drawer-Cbuh6qdL.cjs");exports.Drawer=e.t;
@@ -0,0 +1,18 @@
1
+ import { ReactNode } from 'react';
2
+ export interface DrawerProps {
3
+ open: boolean;
4
+ onClose: () => void;
5
+ position?: "left" | "right" | "bottom";
6
+ title?: ReactNode;
7
+ children: ReactNode;
8
+ width?: number | string;
9
+ className?: string;
10
+ overlayClassName?: string;
11
+ panelClassName?: string;
12
+ unstyled?: boolean;
13
+ ariaLabel?: string;
14
+ closeAriaLabel?: string;
15
+ closeOnEscape?: boolean;
16
+ closeOnOverlayClick?: boolean;
17
+ }
18
+ export declare function Drawer({ open, onClose, position, title, children, width, className, overlayClassName, panelClassName, unstyled, ariaLabel, closeAriaLabel, closeOnEscape, closeOnOverlayClick, }: DrawerProps): import('react').ReactPortal | null;
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ import { t as e } from "../drawer-CqkVZT9Y.js";
3
+ export { e as Drawer };
@@ -0,0 +1 @@
1
+ "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs");let t=require("framer-motion"),n=require("react"),r=require("react/jsx-runtime");function i(e){return`items`in e}var a={bottom:`top-full mt-1.5`,top:`bottom-full mb-1.5`},o={start:`left-0`,end:`right-0`,center:`left-1/2 -translate-x-1/2`},s={bottom:{y:-4},top:{y:4}};function c({trigger:c,items:l,side:u=`bottom`,align:d=`start`,className:f,ariaLabel:p=`Actions menu`}){let[m,h]=(0,n.useState)(!1),g=(0,n.useRef)(null),_=(0,n.useRef)(null);(0,n.useEffect)(()=>{function e(e){g.current?.contains(e.target)||h(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]),(0,n.useEffect)(()=>{m&&_.current?.querySelector(`[role="menuitem"]:not(:disabled)`)?.focus()},[m]);function v(){h(!1),g.current?.querySelector(`[aria-haspopup="menu"]`)?.focus()}function y(e){let t=Array.from(_.current?.querySelectorAll(`[role="menuitem"]:not(:disabled)`)??[]),n=t.indexOf(document.activeElement);e.key===`Escape`?(e.preventDefault(),v()):[`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key)&&t.length>0&&(e.preventDefault(),t[e.key===`Home`?0:e.key===`End`?t.length-1:(Math.max(n,0)+(e.key===`ArrowDown`?1:-1)+t.length)%t.length]?.focus())}function b(t,n){return(0,r.jsxs)(`button`,{type:`button`,disabled:t.disabled,role:`menuitem`,onClick:()=>{t.disabled||(t.onClick?.(),h(!1))},className:e.t(`flex min-h-9 items-center gap-2.5 w-full px-3 py-2 text-sm rounded-md transition-colors text-left focus-visible:outline-none focus-visible:bg-surface-muted`,t.destructive?`text-destructive hover:bg-destructive/10`:`text-foreground hover:bg-surface-muted`,t.disabled&&`opacity-40 cursor-not-allowed pointer-events-none`),children:[t.icon&&(0,r.jsx)(`span`,{className:e.t(`shrink-0`,t.destructive?`text-red-400`:`text-slate-500 dark:text-slate-400`),children:t.icon}),(0,r.jsx)(`span`,{className:`flex-1 min-w-0 truncate`,children:t.label}),t.shortcut&&(0,r.jsx)(`span`,{className:`text-[10px] text-slate-500 shrink-0 font-mono`,children:t.shortcut})]},n)}let x=(0,n.isValidElement)(c)?(0,n.cloneElement)(c,{"aria-haspopup":`menu`,"aria-expanded":m,onClick:e=>{c.props.onClick?.(e),e.defaultPrevented||h(e=>!e)}}):(0,r.jsx)(`button`,{type:`button`,"aria-haspopup":`menu`,"aria-expanded":m,onClick:()=>h(e=>!e),children:c});return(0,r.jsxs)(`div`,{ref:g,className:`relative inline-flex`,children:[x,(0,r.jsx)(t.AnimatePresence,{children:m&&(0,r.jsx)(t.motion.div,{ref:_,role:`menu`,"aria-label":p,onKeyDown:y,initial:{opacity:0,scaleY:.96,...s[u]},animate:{opacity:1,scaleY:1,y:0},exit:{opacity:0,scaleY:.96,...s[u]},transition:{duration:.13},style:{originY:u===`bottom`?0:1},className:e.t(`absolute z-50 min-w-[180px] rounded-[var(--radius-lg)] border border-border bg-surface-raised shadow-floating`,`p-1`,a[u],o[d],f),children:l.map((e,t)=>i(e)?(0,r.jsxs)(`div`,{children:[t>0&&(0,r.jsx)(`div`,{role:`separator`,className:`my-1 border-t border-border`}),e.group&&(0,r.jsx)(`p`,{className:`px-3 pt-1.5 pb-1 text-xs font-medium text-muted-foreground`,children:e.group}),e.items.map((e,t)=>b(e,t))]},t):b(e,t))})})]})}exports.DropdownMenu=c;
@@ -0,0 +1,26 @@
1
+ import { ReactNode } from 'react';
2
+ export interface DropdownMenuItem {
3
+ label: string;
4
+ icon?: ReactNode;
5
+ shortcut?: string;
6
+ destructive?: boolean;
7
+ disabled?: boolean;
8
+ onClick?: () => void;
9
+ }
10
+ export interface DropdownMenuGroup {
11
+ group?: string;
12
+ items: DropdownMenuItem[];
13
+ }
14
+ export type DropdownMenuSection = DropdownMenuItem | DropdownMenuGroup;
15
+ type Side = "bottom" | "top";
16
+ type Align = "start" | "end" | "center";
17
+ export interface DropdownMenuProps {
18
+ trigger: ReactNode;
19
+ items: DropdownMenuSection[];
20
+ side?: Side;
21
+ align?: Align;
22
+ className?: string;
23
+ ariaLabel?: string;
24
+ }
25
+ export declare function DropdownMenu({ trigger, items, side, align, className, ariaLabel, }: DropdownMenuProps): import("react").JSX.Element;
26
+ export {};
@@ -0,0 +1,122 @@
1
+ "use client";
2
+ import { t as e } from "../cn-DpgY2leY.js";
3
+ import { AnimatePresence as t, motion as n } from "framer-motion";
4
+ import { cloneElement as r, isValidElement as i, useEffect as a, useRef as o, useState as s } from "react";
5
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
6
+ //#region src/components/dropdown-menu.tsx
7
+ function u(e) {
8
+ return "items" in e;
9
+ }
10
+ var d = {
11
+ bottom: "top-full mt-1.5",
12
+ top: "bottom-full mb-1.5"
13
+ }, f = {
14
+ start: "left-0",
15
+ end: "right-0",
16
+ center: "left-1/2 -translate-x-1/2"
17
+ }, p = {
18
+ bottom: { y: -4 },
19
+ top: { y: 4 }
20
+ };
21
+ function m({ trigger: m, items: h, side: g = "bottom", align: _ = "start", className: v, ariaLabel: y = "Actions menu" }) {
22
+ let [b, x] = s(!1), S = o(null), C = o(null);
23
+ a(() => {
24
+ function e(e) {
25
+ S.current?.contains(e.target) || x(!1);
26
+ }
27
+ return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
28
+ }, []), a(() => {
29
+ b && C.current?.querySelector("[role=\"menuitem\"]:not(:disabled)")?.focus();
30
+ }, [b]);
31
+ function w() {
32
+ x(!1), S.current?.querySelector("[aria-haspopup=\"menu\"]")?.focus();
33
+ }
34
+ function T(e) {
35
+ let t = Array.from(C.current?.querySelectorAll("[role=\"menuitem\"]:not(:disabled)") ?? []), n = t.indexOf(document.activeElement);
36
+ e.key === "Escape" ? (e.preventDefault(), w()) : [
37
+ "ArrowDown",
38
+ "ArrowUp",
39
+ "Home",
40
+ "End"
41
+ ].includes(e.key) && t.length > 0 && (e.preventDefault(), t[e.key === "Home" ? 0 : e.key === "End" ? t.length - 1 : (Math.max(n, 0) + (e.key === "ArrowDown" ? 1 : -1) + t.length) % t.length]?.focus());
42
+ }
43
+ function E(t, n) {
44
+ return /* @__PURE__ */ l("button", {
45
+ type: "button",
46
+ disabled: t.disabled,
47
+ role: "menuitem",
48
+ onClick: () => {
49
+ t.disabled || (t.onClick?.(), x(!1));
50
+ },
51
+ className: e("flex min-h-9 items-center gap-2.5 w-full px-3 py-2 text-sm rounded-md transition-colors text-left focus-visible:outline-none focus-visible:bg-surface-muted", t.destructive ? "text-destructive hover:bg-destructive/10" : "text-foreground hover:bg-surface-muted", t.disabled && "opacity-40 cursor-not-allowed pointer-events-none"),
52
+ children: [
53
+ t.icon && /* @__PURE__ */ c("span", {
54
+ className: e("shrink-0", t.destructive ? "text-red-400" : "text-slate-500 dark:text-slate-400"),
55
+ children: t.icon
56
+ }),
57
+ /* @__PURE__ */ c("span", {
58
+ className: "flex-1 min-w-0 truncate",
59
+ children: t.label
60
+ }),
61
+ t.shortcut && /* @__PURE__ */ c("span", {
62
+ className: "text-[10px] text-slate-500 shrink-0 font-mono",
63
+ children: t.shortcut
64
+ })
65
+ ]
66
+ }, n);
67
+ }
68
+ let D = i(m) ? r(m, {
69
+ "aria-haspopup": "menu",
70
+ "aria-expanded": b,
71
+ onClick: (e) => {
72
+ m.props.onClick?.(e), e.defaultPrevented || x((e) => !e);
73
+ }
74
+ }) : /* @__PURE__ */ c("button", {
75
+ type: "button",
76
+ "aria-haspopup": "menu",
77
+ "aria-expanded": b,
78
+ onClick: () => x((e) => !e),
79
+ children: m
80
+ });
81
+ return /* @__PURE__ */ l("div", {
82
+ ref: S,
83
+ className: "relative inline-flex",
84
+ children: [D, /* @__PURE__ */ c(t, { children: b && /* @__PURE__ */ c(n.div, {
85
+ ref: C,
86
+ role: "menu",
87
+ "aria-label": y,
88
+ onKeyDown: T,
89
+ initial: {
90
+ opacity: 0,
91
+ scaleY: .96,
92
+ ...p[g]
93
+ },
94
+ animate: {
95
+ opacity: 1,
96
+ scaleY: 1,
97
+ y: 0
98
+ },
99
+ exit: {
100
+ opacity: 0,
101
+ scaleY: .96,
102
+ ...p[g]
103
+ },
104
+ transition: { duration: .13 },
105
+ style: { originY: g === "bottom" ? 0 : 1 },
106
+ className: e("absolute z-50 min-w-[180px] rounded-[var(--radius-lg)] border border-border bg-surface-raised shadow-floating", "p-1", d[g], f[_], v),
107
+ children: h.map((e, t) => u(e) ? /* @__PURE__ */ l("div", { children: [
108
+ t > 0 && /* @__PURE__ */ c("div", {
109
+ role: "separator",
110
+ className: "my-1 border-t border-border"
111
+ }),
112
+ e.group && /* @__PURE__ */ c("p", {
113
+ className: "px-3 pt-1.5 pb-1 text-xs font-medium text-muted-foreground",
114
+ children: e.group
115
+ }),
116
+ e.items.map((e, t) => E(e, t))
117
+ ] }, t) : E(e, t))
118
+ }) })]
119
+ });
120
+ }
121
+ //#endregion
122
+ export { m as DropdownMenu };
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs");let t=require("react/jsx-runtime");var n={sm:{wrap:`py-6`,icon:`w-5 h-5`,title:`text-sm`,desc:`text-xs`,iconWrap:`w-8 h-8`},md:{wrap:`py-10`,icon:`w-6 h-6`,title:`text-base`,desc:`text-sm`,iconWrap:`w-9 h-9`},lg:{wrap:`py-12`,icon:`w-7 h-7`,title:`text-lg`,desc:`text-sm`,iconWrap:`w-10 h-10`}},r=({className:e})=>(0,t.jsxs)(`svg`,{className:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,t.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,t.jsx)(`path`,{d:`m21 21-4.35-4.35`})]});function i({icon:i,title:a,description:o,action:s,className:c,size:l=`md`}){let u=n[l];return(0,t.jsxs)(`div`,{className:e.t(`flex flex-col items-center justify-center text-center px-4`,u.wrap,c),children:[(0,t.jsx)(`div`,{className:e.t(`mb-3 flex items-center justify-center text-muted-foreground`,u.iconWrap),children:i?(0,t.jsx)(`span`,{className:e.t(`inline-flex items-center justify-center text-muted-foreground`,u.icon),children:i}):(0,t.jsx)(r,{className:e.t(`text-muted-foreground`,u.icon)})}),(0,t.jsx)(`p`,{className:e.t(`font-semibold text-foreground`,u.title),children:a}),o&&(0,t.jsx)(`p`,{className:e.t(`mt-1.5 max-w-sm leading-5 text-muted-foreground`,u.desc),children:o}),s&&(0,t.jsx)(`div`,{className:`mt-4`,children:s})]})}exports.EmptyState=i;
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from 'react';
2
+ export interface EmptyStateProps {
3
+ icon?: ReactNode;
4
+ title: string;
5
+ description?: string;
6
+ action?: ReactNode;
7
+ className?: string;
8
+ size?: "sm" | "md" | "lg";
9
+ }
10
+ export declare function EmptyState({ icon, title, description, action, className, size, }: EmptyStateProps): import("react").JSX.Element;
@@ -0,0 +1,68 @@
1
+ import { t as e } from "../cn-DpgY2leY.js";
2
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ //#region src/components/empty-state.tsx
4
+ var r = {
5
+ sm: {
6
+ wrap: "py-6",
7
+ icon: "w-5 h-5",
8
+ title: "text-sm",
9
+ desc: "text-xs",
10
+ iconWrap: "w-8 h-8"
11
+ },
12
+ md: {
13
+ wrap: "py-10",
14
+ icon: "w-6 h-6",
15
+ title: "text-base",
16
+ desc: "text-sm",
17
+ iconWrap: "w-9 h-9"
18
+ },
19
+ lg: {
20
+ wrap: "py-12",
21
+ icon: "w-7 h-7",
22
+ title: "text-lg",
23
+ desc: "text-sm",
24
+ iconWrap: "w-10 h-10"
25
+ }
26
+ }, i = ({ className: e }) => /* @__PURE__ */ n("svg", {
27
+ className: e,
28
+ viewBox: "0 0 24 24",
29
+ fill: "none",
30
+ stroke: "currentColor",
31
+ strokeWidth: "1.5",
32
+ strokeLinecap: "round",
33
+ strokeLinejoin: "round",
34
+ children: [/* @__PURE__ */ t("circle", {
35
+ cx: "11",
36
+ cy: "11",
37
+ r: "8"
38
+ }), /* @__PURE__ */ t("path", { d: "m21 21-4.35-4.35" })]
39
+ });
40
+ function a({ icon: a, title: o, description: s, action: c, className: l, size: u = "md" }) {
41
+ let d = r[u];
42
+ return /* @__PURE__ */ n("div", {
43
+ className: e("flex flex-col items-center justify-center text-center px-4", d.wrap, l),
44
+ children: [
45
+ /* @__PURE__ */ t("div", {
46
+ className: e("mb-3 flex items-center justify-center text-muted-foreground", d.iconWrap),
47
+ children: a ? /* @__PURE__ */ t("span", {
48
+ className: e("inline-flex items-center justify-center text-muted-foreground", d.icon),
49
+ children: a
50
+ }) : /* @__PURE__ */ t(i, { className: e("text-muted-foreground", d.icon) })
51
+ }),
52
+ /* @__PURE__ */ t("p", {
53
+ className: e("font-semibold text-foreground", d.title),
54
+ children: o
55
+ }),
56
+ s && /* @__PURE__ */ t("p", {
57
+ className: e("mt-1.5 max-w-sm leading-5 text-muted-foreground", d.desc),
58
+ children: s
59
+ }),
60
+ c && /* @__PURE__ */ t("div", {
61
+ className: "mt-4",
62
+ children: c
63
+ })
64
+ ]
65
+ });
66
+ }
67
+ //#endregion
68
+ export { a as EmptyState };
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("./button.cjs");let n=require("react/jsx-runtime");function r({title:r=`Something went wrong`,description:i=`An unexpected error occurred. Please try again.`,error:a,onRetry:o,action:s,className:c}){let l=a instanceof Error?a.message:a;return(0,n.jsxs)(`div`,{role:`alert`,className:e.t(`flex flex-col items-center justify-center text-center px-4 py-10`,c),children:[(0,n.jsx)(`div`,{className:`mb-3 flex size-9 items-center justify-center text-destructive`,children:(0,n.jsxs)(`svg`,{"aria-hidden":`true`,width:`22`,height:`22`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,n.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,n.jsx)(`line`,{x1:`12`,y1:`8`,x2:`12`,y2:`12`}),(0,n.jsx)(`line`,{x1:`12`,y1:`16`,x2:`12.01`,y2:`16`})]})}),(0,n.jsx)(`p`,{className:`text-base font-semibold text-foreground`,children:r}),(0,n.jsx)(`p`,{className:`mt-1.5 max-w-sm text-sm leading-5 text-muted-foreground`,children:i}),l&&(0,n.jsx)(`p`,{className:`mt-3 max-w-sm break-all rounded-md border border-destructive/20 bg-destructive/5 px-3 py-2 font-mono text-xs text-destructive`,children:l}),(o||s)&&(0,n.jsxs)(`div`,{className:`mt-5 flex items-center gap-3`,children:[o&&(0,n.jsx)(t.Button,{variant:`outline`,size:`sm`,onClick:o,icon:(0,n.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,n.jsx)(`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`}),(0,n.jsx)(`path`,{d:`M3 3v5h5`})]}),children:`Try again`}),s]})]})}exports.ErrorState=r;
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from 'react';
2
+ export interface ErrorStateProps {
3
+ title?: string;
4
+ description?: string;
5
+ error?: string | Error;
6
+ onRetry?: () => void;
7
+ action?: ReactNode;
8
+ className?: string;
9
+ }
10
+ export declare function ErrorState({ title, description, error, onRetry, action, className, }: ErrorStateProps): import("react").JSX.Element;
@@ -0,0 +1,80 @@
1
+ import { t as e } from "../cn-DpgY2leY.js";
2
+ import { Button as t } from "./button.js";
3
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
+ //#region src/components/error-state.tsx
5
+ function i({ title: i = "Something went wrong", description: a = "An unexpected error occurred. Please try again.", error: o, onRetry: s, action: c, className: l }) {
6
+ let u = o instanceof Error ? o.message : o;
7
+ return /* @__PURE__ */ r("div", {
8
+ role: "alert",
9
+ className: e("flex flex-col items-center justify-center text-center px-4 py-10", l),
10
+ children: [
11
+ /* @__PURE__ */ n("div", {
12
+ className: "mb-3 flex size-9 items-center justify-center text-destructive",
13
+ children: /* @__PURE__ */ r("svg", {
14
+ "aria-hidden": "true",
15
+ width: "22",
16
+ height: "22",
17
+ viewBox: "0 0 24 24",
18
+ fill: "none",
19
+ stroke: "currentColor",
20
+ strokeWidth: "1.75",
21
+ strokeLinecap: "round",
22
+ strokeLinejoin: "round",
23
+ children: [
24
+ /* @__PURE__ */ n("circle", {
25
+ cx: "12",
26
+ cy: "12",
27
+ r: "10"
28
+ }),
29
+ /* @__PURE__ */ n("line", {
30
+ x1: "12",
31
+ y1: "8",
32
+ x2: "12",
33
+ y2: "12"
34
+ }),
35
+ /* @__PURE__ */ n("line", {
36
+ x1: "12",
37
+ y1: "16",
38
+ x2: "12.01",
39
+ y2: "16"
40
+ })
41
+ ]
42
+ })
43
+ }),
44
+ /* @__PURE__ */ n("p", {
45
+ className: "text-base font-semibold text-foreground",
46
+ children: i
47
+ }),
48
+ /* @__PURE__ */ n("p", {
49
+ className: "mt-1.5 max-w-sm text-sm leading-5 text-muted-foreground",
50
+ children: a
51
+ }),
52
+ u && /* @__PURE__ */ n("p", {
53
+ className: "mt-3 max-w-sm break-all rounded-md border border-destructive/20 bg-destructive/5 px-3 py-2 font-mono text-xs text-destructive",
54
+ children: u
55
+ }),
56
+ (s || c) && /* @__PURE__ */ r("div", {
57
+ className: "mt-5 flex items-center gap-3",
58
+ children: [s && /* @__PURE__ */ n(t, {
59
+ variant: "outline",
60
+ size: "sm",
61
+ onClick: s,
62
+ icon: /* @__PURE__ */ r("svg", {
63
+ width: "13",
64
+ height: "13",
65
+ viewBox: "0 0 24 24",
66
+ fill: "none",
67
+ stroke: "currentColor",
68
+ strokeWidth: "2.5",
69
+ strokeLinecap: "round",
70
+ strokeLinejoin: "round",
71
+ children: [/* @__PURE__ */ n("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }), /* @__PURE__ */ n("path", { d: "M3 3v5h5" })]
72
+ }),
73
+ children: "Try again"
74
+ }), c]
75
+ })
76
+ ]
77
+ });
78
+ }
79
+ //#endregion
80
+ export { i as ErrorState };
@@ -0,0 +1 @@
1
+ "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-TkZ7v6Ef.cjs");let n=require("framer-motion"),r=require("react"),i=require("react/jsx-runtime");var a=(0,r.forwardRef)(({className:a,label:o,hint:s,error:c,accept:l,maxSizeMB:u,onFilesChange:d,disabled:f,multiple:p,id:m,...h},g)=>{let[_,v]=(0,r.useState)(!1),[y,b]=(0,r.useState)([]),[x,S]=(0,r.useState)(``),C=(0,r.useRef)(null),w=(0,r.useId)(),T=m??w,E=`${T}-message`,D=u&&(u>=1024?`${u/1024}GB`:`${u}MB`);function O(e){if(!e)return;let t=Array.from(e);if(u){let e=t.find(e=>e.size>u*1024*1024);if(e){S(`${e.name} exceeds ${D}`);return}}S(``);let n=p?[...y,...t]:t;b(n),d?.(n)}function k(e){let t=y.filter((t,n)=>n!==e);b(t),d?.(t)}function A(e){e.preventDefault(),v(!1),!f&&O(e.dataTransfer.files)}let j=c??x;return(0,i.jsxs)(`div`,{className:e.t(t.o,a),children:[o&&(0,i.jsx)(`label`,{htmlFor:T,className:`text-sm font-medium leading-5 text-foreground`,children:o}),(0,i.jsxs)(`label`,{htmlFor:T,onDragOver:e=>{e.preventDefault(),f||v(!0)},onDragLeave:()=>v(!1),onDrop:A,className:e.t(`relative flex flex-col items-center justify-center gap-2 rounded-[var(--radius-lg)] border border-dashed px-4 py-7 text-center cursor-pointer transition-colors focus-within:ring-2 focus-within:ring-focus-ring/25`,_?`border-accent-500/60 bg-accent-500/6`:j?`border-red-500/40 bg-red-500/4`:`border-border-strong bg-surface-muted/50 hover:border-accent-500/60 hover:bg-muted`,f&&`opacity-50 cursor-not-allowed pointer-events-none`),children:[(0,i.jsx)(`input`,{ref:e=>{C.current=e,typeof g==`function`?g(e):g&&(g.current=e)},type:`file`,id:T,accept:l,multiple:p,disabled:f,"aria-invalid":j?!0:void 0,"aria-describedby":j||s?E:void 0,className:`sr-only`,onChange:e=>O(e.target.files),...h}),(0,i.jsxs)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`text-muted-foreground`,children:[(0,i.jsx)(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,i.jsx)(`polyline`,{points:`17 8 12 3 7 8`}),(0,i.jsx)(`line`,{x1:`12`,y1:`3`,x2:`12`,y2:`15`})]}),(0,i.jsxs)(`div`,{children:[(0,i.jsxs)(`p`,{className:`text-sm font-medium text-foreground`,children:[`Drop files here or `,(0,i.jsx)(`span`,{className:`text-accent-700 dark:text-accent-300`,children:`browse`})]}),(l||u)&&(0,i.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:[l&&`Accepts ${l}`,D&&`Max ${D}`].filter(Boolean).join(` · `)})]})]}),(0,i.jsx)(n.AnimatePresence,{initial:!1,children:y.length>0&&(0,i.jsx)(n.motion.ul,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},className:`flex flex-col gap-1 overflow-hidden`,children:y.map((t,n)=>(0,i.jsxs)(`li`,{className:`flex items-center gap-2 rounded-[var(--radius-md)] border border-border bg-surface-muted px-3 py-2`,children:[(0,i.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`text-slate-400 shrink-0`,children:[(0,i.jsx)(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z`}),(0,i.jsx)(`polyline`,{points:`14 2 14 8 20 8`})]}),(0,i.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-foreground`,children:t.name}),(0,i.jsxs)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground`,children:[(t.size/1024).toFixed(0),`KB`]}),(0,i.jsx)(`button`,{type:`button`,onClick:()=>k(n),"aria-label":`Remove ${t.name}`,className:e.t(`shrink-0 rounded-sm text-muted-foreground hover:text-destructive transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring/35 focus-visible:ring-offset-2 focus-visible:ring-offset-bg`),children:(0,i.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,i.jsx)(`path`,{d:`M18 6 6 18M6 6l12 12`})})})]},`${t.name}-${n}`))})}),j&&(0,i.jsx)(`p`,{id:E,"aria-live":`polite`,className:`text-xs leading-5 text-destructive`,children:j}),s&&!j&&(0,i.jsx)(`p`,{id:E,className:`text-xs leading-5 text-muted-foreground`,children:s})]})});a.displayName=`FileUpload`,exports.FileUpload=a;
@@ -0,0 +1,10 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ export interface FileUploadProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
3
+ label?: string;
4
+ hint?: string;
5
+ error?: string;
6
+ accept?: string;
7
+ maxSizeMB?: number;
8
+ onFilesChange?: (files: File[]) => void;
9
+ }
10
+ export declare const FileUpload: import('react').ForwardRefExoticComponent<FileUploadProps & import('react').RefAttributes<HTMLInputElement>>;