@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,142 @@
1
+ "use client";
2
+ import { t as e } from "../cn-DpgY2leY.js";
3
+ import { o as t, t as n } from "../component-styles-Ce56hn9T.js";
4
+ import { forwardRef as r, useEffect as i, useId as a, useRef as o, useState as s } from "react";
5
+ import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
6
+ //#region src/components/number-input.tsx
7
+ var d = {
8
+ sm: {
9
+ wrap: "h-7 text-xs",
10
+ btn: "w-6",
11
+ input: "w-16"
12
+ },
13
+ md: {
14
+ wrap: "h-9 text-sm",
15
+ btn: "w-8",
16
+ input: "w-20"
17
+ },
18
+ lg: {
19
+ wrap: "h-11 text-sm",
20
+ btn: "w-9",
21
+ input: "w-24"
22
+ }
23
+ }, f = r(({ className: r, label: f, hint: p, error: m, size: h = "md", min: g = -Infinity, max: _ = Infinity, step: v = 1, value: y, defaultValue: b = 0, onChange: x, disabled: S, id: C, autoComplete: w = "on", fullWidth: T = !1, formatDisplay: E, onFocus: D, onBlur: O, onKeyDown: k, required: A, ...j }, M) => {
24
+ let N = a(), P = C ?? N, F = `${P}-message`, [I, L] = s(b), R = y ?? I, z = d[h], B = v.toString().includes(".") ? v.toString().split(".")[1].length : 0, V = (e) => B > 0 ? Math.round(e * 10 ** B) / 10 ** B : Math.round(e), H = (e) => Math.min(_, Math.max(g, e));
25
+ function U(e) {
26
+ let t = H(V(e));
27
+ y === void 0 && L(t), x?.(t), G(String(t));
28
+ }
29
+ i(() => {
30
+ y !== void 0 && L(y);
31
+ }, [y]);
32
+ let [W, G] = s(() => String(R)), K = o(!1);
33
+ i(() => {
34
+ K.current || G(String(R));
35
+ }, [R]);
36
+ function q(e) {
37
+ G(e);
38
+ }
39
+ function J(e) {
40
+ K.current = !1;
41
+ let t = Number(W);
42
+ U(Number.isNaN(t) ? R : t), O?.(e);
43
+ }
44
+ function Y(e) {
45
+ k?.(e), !e.defaultPrevented && e.key === "Enter" && e.currentTarget.blur();
46
+ }
47
+ return /* @__PURE__ */ u("div", {
48
+ className: e(t, !T && "w-auto", r),
49
+ children: [
50
+ f && /* @__PURE__ */ u("label", {
51
+ htmlFor: P,
52
+ className: "text-sm font-medium leading-5 text-foreground",
53
+ children: [f, A && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("span", {
54
+ "aria-hidden": "true",
55
+ className: "ml-1 text-destructive",
56
+ children: "*"
57
+ }), /* @__PURE__ */ l("span", {
58
+ className: "sr-only",
59
+ children: " (required)"
60
+ })] })]
61
+ }),
62
+ /* @__PURE__ */ u("div", {
63
+ className: e("inline-flex items-center overflow-hidden rounded-[var(--radius-md)]", n, z.wrap, T && "flex w-full", m && "border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/20", S && "opacity-50"),
64
+ children: [
65
+ /* @__PURE__ */ l("button", {
66
+ type: "button",
67
+ "aria-label": f ? `Decrease ${f}` : "Decrease value",
68
+ tabIndex: -1,
69
+ disabled: S || R <= g,
70
+ onClick: () => U(R - v),
71
+ className: e("flex items-center justify-center shrink-0 border-r border-border", "text-muted-foreground hover:bg-muted hover:text-foreground", "disabled:opacity-40 disabled:cursor-not-allowed transition-colors", z.btn),
72
+ children: /* @__PURE__ */ l("svg", {
73
+ width: "10",
74
+ height: "10",
75
+ viewBox: "0 0 24 24",
76
+ fill: "none",
77
+ stroke: "currentColor",
78
+ strokeWidth: "3",
79
+ strokeLinecap: "round",
80
+ children: /* @__PURE__ */ l("path", { d: "M5 12h14" })
81
+ })
82
+ }),
83
+ /* @__PURE__ */ l("input", {
84
+ ref: M,
85
+ type: "number",
86
+ id: P,
87
+ required: A,
88
+ "aria-invalid": m ? !0 : void 0,
89
+ "aria-describedby": m || p ? F : void 0,
90
+ "aria-valuetext": E?.(R),
91
+ autoComplete: w,
92
+ min: Number.isFinite(g) ? g : void 0,
93
+ max: Number.isFinite(_) ? _ : void 0,
94
+ step: v,
95
+ value: W,
96
+ disabled: S,
97
+ onFocus: (e) => {
98
+ K.current = !0, D?.(e);
99
+ },
100
+ onChange: (e) => q(e.target.value),
101
+ onBlur: J,
102
+ onKeyDown: Y,
103
+ className: e("flex-1 text-center bg-transparent text-foreground outline-none tabular-nums", "[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none", "disabled:cursor-not-allowed", T ? "min-w-0" : z.input),
104
+ ...j
105
+ }),
106
+ /* @__PURE__ */ l("button", {
107
+ type: "button",
108
+ "aria-label": f ? `Increase ${f}` : "Increase value",
109
+ tabIndex: -1,
110
+ disabled: S || R >= _,
111
+ onClick: () => U(R + v),
112
+ className: e("flex items-center justify-center shrink-0 border-l border-border", "text-muted-foreground hover:bg-muted hover:text-foreground", "disabled:opacity-40 disabled:cursor-not-allowed transition-colors", z.btn),
113
+ children: /* @__PURE__ */ l("svg", {
114
+ width: "10",
115
+ height: "10",
116
+ viewBox: "0 0 24 24",
117
+ fill: "none",
118
+ stroke: "currentColor",
119
+ strokeWidth: "3",
120
+ strokeLinecap: "round",
121
+ children: /* @__PURE__ */ l("path", { d: "M12 5v14M5 12h14" })
122
+ })
123
+ })
124
+ ]
125
+ }),
126
+ m && /* @__PURE__ */ l("p", {
127
+ id: F,
128
+ "aria-live": "polite",
129
+ className: "text-xs leading-5 text-destructive",
130
+ children: m
131
+ }),
132
+ p && !m && /* @__PURE__ */ l("p", {
133
+ id: F,
134
+ className: "text-xs leading-5 text-muted-foreground",
135
+ children: p
136
+ })
137
+ ]
138
+ });
139
+ });
140
+ f.displayName = "NumberInput";
141
+ //#endregion
142
+ export { f as NumberInput };
@@ -0,0 +1 @@
1
+ "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs");let t=require("react"),n=require("react/jsx-runtime");function r({length:r=6,value:i,onChange:a,onComplete:o,label:s,hint:c,error:l,disabled:u,className:d,masked:f=!1}){let p=(0,t.useId)(),[m,h]=(0,t.useState)(``),g=(i??m).split(``).slice(0,r),_=(0,t.useRef)([]);function v(e){i===void 0&&h(e),a?.(e),e.length===r&&o?.(e)}function y(e,t){if(!/^\d*$/.test(t))return;let n=g.slice();n[e]=t.slice(-1),v(n.join(``).slice(0,r)),t&&e<r-1&&_.current[e+1]?.focus()}function b(e,t){if(t.key===`Backspace`){if(g[e]){let t=g.slice();t[e]=``,v(t.join(``))}else e>0&&_.current[e-1]?.focus()}else t.key===`ArrowLeft`&&e>0?_.current[e-1]?.focus():t.key===`ArrowRight`&&e<r-1&&_.current[e+1]?.focus()}function x(e){e.preventDefault();let t=e.clipboardData.getData(`text`).replace(/\D/g,``).slice(0,r);v(t),_.current[Math.min(t.length,r-1)]?.focus()}return(0,n.jsxs)(`div`,{className:e.t(`flex flex-col gap-1.5`,d),children:[s&&(0,n.jsx)(`label`,{htmlFor:`${p}-0`,className:`text-sm font-medium text-slate-600 dark:text-slate-300`,children:s}),(0,n.jsx)(`div`,{className:`flex items-center gap-2`,children:Array.from({length:r}).map((t,r)=>(0,n.jsx)(`input`,{ref:e=>{_.current[r]=e},id:`${p}-${r}`,name:`${p}-${r}`,type:f?`password`:`text`,inputMode:`numeric`,pattern:`\\d*`,maxLength:1,autoComplete:r===0?`one-time-code`:`off`,value:g[r]??``,disabled:u,onChange:e=>y(r,e.target.value),onKeyDown:e=>b(r,e),onPaste:x,onFocus:e=>e.target.select(),className:e.t(`w-10 h-12 text-center text-lg font-semibold rounded-lg border bg-black/4 dark:bg-white/4`,`text-gray-900 dark:text-white outline-none transition-colors`,`focus:ring-2 focus:ring-accent-500/30`,l?`border-red-500/40 focus:border-red-500/50`:`border-slate-300 dark:border-white/10 focus:border-accent-500/40`,u&&`opacity-50 cursor-not-allowed`)},r))}),l&&(0,n.jsx)(`p`,{className:`text-xs text-red-400`,children:l}),c&&!l&&(0,n.jsx)(`p`,{className:`text-xs text-slate-500`,children:c})]})}exports.OtpInput=r;
@@ -0,0 +1,13 @@
1
+ export interface OtpInputProps {
2
+ length?: number;
3
+ value?: string;
4
+ onChange?: (value: string) => void;
5
+ onComplete?: (value: string) => void;
6
+ label?: string;
7
+ hint?: string;
8
+ error?: string;
9
+ disabled?: boolean;
10
+ className?: string;
11
+ masked?: boolean;
12
+ }
13
+ export declare function OtpInput({ length, value: controlledValue, onChange, onComplete, label, hint, error, disabled, className, masked, }: OtpInputProps): import("react").JSX.Element;
@@ -0,0 +1,71 @@
1
+ "use client";
2
+ import { t as e } from "../cn-DpgY2leY.js";
3
+ import { useId as t, useRef as n, useState as r } from "react";
4
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
+ //#region src/components/otp-input.tsx
6
+ function o({ length: o = 6, value: s, onChange: c, onComplete: l, label: u, hint: d, error: f, disabled: p, className: m, masked: h = !1 }) {
7
+ let g = t(), [_, v] = r(""), y = (s ?? _).split("").slice(0, o), b = n([]);
8
+ function x(e) {
9
+ s === void 0 && v(e), c?.(e), e.length === o && l?.(e);
10
+ }
11
+ function S(e, t) {
12
+ if (!/^\d*$/.test(t)) return;
13
+ let n = y.slice();
14
+ n[e] = t.slice(-1), x(n.join("").slice(0, o)), t && e < o - 1 && b.current[e + 1]?.focus();
15
+ }
16
+ function C(e, t) {
17
+ if (t.key === "Backspace") {
18
+ if (y[e]) {
19
+ let t = y.slice();
20
+ t[e] = "", x(t.join(""));
21
+ } else e > 0 && b.current[e - 1]?.focus();
22
+ } else t.key === "ArrowLeft" && e > 0 ? b.current[e - 1]?.focus() : t.key === "ArrowRight" && e < o - 1 && b.current[e + 1]?.focus();
23
+ }
24
+ function w(e) {
25
+ e.preventDefault();
26
+ let t = e.clipboardData.getData("text").replace(/\D/g, "").slice(0, o);
27
+ x(t), b.current[Math.min(t.length, o - 1)]?.focus();
28
+ }
29
+ return /* @__PURE__ */ a("div", {
30
+ className: e("flex flex-col gap-1.5", m),
31
+ children: [
32
+ u && /* @__PURE__ */ i("label", {
33
+ htmlFor: `${g}-0`,
34
+ className: "text-sm font-medium text-slate-600 dark:text-slate-300",
35
+ children: u
36
+ }),
37
+ /* @__PURE__ */ i("div", {
38
+ className: "flex items-center gap-2",
39
+ children: Array.from({ length: o }).map((t, n) => /* @__PURE__ */ i("input", {
40
+ ref: (e) => {
41
+ b.current[n] = e;
42
+ },
43
+ id: `${g}-${n}`,
44
+ name: `${g}-${n}`,
45
+ type: h ? "password" : "text",
46
+ inputMode: "numeric",
47
+ pattern: "\\d*",
48
+ maxLength: 1,
49
+ autoComplete: n === 0 ? "one-time-code" : "off",
50
+ value: y[n] ?? "",
51
+ disabled: p,
52
+ onChange: (e) => S(n, e.target.value),
53
+ onKeyDown: (e) => C(n, e),
54
+ onPaste: w,
55
+ onFocus: (e) => e.target.select(),
56
+ className: e("w-10 h-12 text-center text-lg font-semibold rounded-lg border bg-black/4 dark:bg-white/4", "text-gray-900 dark:text-white outline-none transition-colors", "focus:ring-2 focus:ring-accent-500/30", f ? "border-red-500/40 focus:border-red-500/50" : "border-slate-300 dark:border-white/10 focus:border-accent-500/40", p && "opacity-50 cursor-not-allowed")
57
+ }, n))
58
+ }),
59
+ f && /* @__PURE__ */ i("p", {
60
+ className: "text-xs text-red-400",
61
+ children: f
62
+ }),
63
+ d && !f && /* @__PURE__ */ i("p", {
64
+ className: "text-xs text-slate-500",
65
+ children: d
66
+ })
67
+ ]
68
+ });
69
+ }
70
+ //#endregion
71
+ export { o as OtpInput };
@@ -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("react/jsx-runtime");function r(e,t){return Array.from({length:t-e+1},(t,n)=>e+n)}function i(e,t,n){if(t<=7)return r(1,t);let i=Math.max(2,e-n),a=Math.min(t-1,e+n),o=i>2,s=a<t-1;return!o&&s?[...r(1,3+n*2),`…`,t]:o&&!s?[1,`…`,...r(t-2-n*2,t)]:[1,`…`,...r(i,a),`…`,t]}var a=(0,n.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,n.jsx)(`path`,{d:`m15 18-6-6 6-6`})}),o=(0,n.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,n.jsx)(`path`,{d:`m9 18 6-6-6-6`})});function s({page:r,totalPages:s,onPageChange:c,siblingCount:l=1,className:u}){if(s<=1)return null;let d=i(r,s,l);function f(i,a,o,s=!1){return(0,n.jsx)(`button`,{type:`button`,disabled:o,onClick:()=>!o&&c(a),"aria-current":s?`page`:void 0,"aria-label":typeof i==`number`?`Page ${i}`:a<r?`Previous page`:`Next page`,className:e.t(`flex items-center justify-center min-w-8 h-8 px-2 rounded-[var(--radius-md)] border text-sm font-medium transition-colors`,t.s,s?`border-accent-200 bg-accent-50 text-accent-700 dark:border-accent-500/20 dark:bg-accent-500/15 dark:text-accent-300`:`border-transparent text-muted-foreground hover:bg-muted hover:text-foreground`,o&&`opacity-40 cursor-not-allowed pointer-events-none`),children:i},typeof i==`number`?i:`${i}-${a}`)}return(0,n.jsxs)(`nav`,{className:e.t(`flex items-center gap-1`,u),"aria-label":`Pagination`,children:[f(a,r-1,r<=1),d.map((e,t)=>e===`…`?(0,n.jsx)(`span`,{className:`flex items-end justify-center w-8 h-8 text-slate-500 text-sm pb-1`,children:`…`},`dots-${t}`):f(e,e,!1,e===r)),f(o,r+1,r>=s)]})}exports.Pagination=s;
@@ -0,0 +1,8 @@
1
+ export interface PaginationProps {
2
+ page: number;
3
+ totalPages: number;
4
+ onPageChange: (page: number) => void;
5
+ siblingCount?: number;
6
+ className?: string;
7
+ }
8
+ export declare function Pagination({ page, totalPages, onPageChange, siblingCount, className, }: PaginationProps): import("react").JSX.Element | null;
@@ -0,0 +1,77 @@
1
+ "use client";
2
+ import { t as e } from "../cn-DpgY2leY.js";
3
+ import { s as t } from "../component-styles-Ce56hn9T.js";
4
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
5
+ //#region src/components/pagination.tsx
6
+ function i(e, t) {
7
+ return Array.from({ length: t - e + 1 }, (t, n) => e + n);
8
+ }
9
+ function a(e, t, n) {
10
+ if (t <= 7) return i(1, t);
11
+ let r = Math.max(2, e - n), a = Math.min(t - 1, e + n), o = r > 2, s = a < t - 1;
12
+ return !o && s ? [
13
+ ...i(1, 3 + n * 2),
14
+ "…",
15
+ t
16
+ ] : o && !s ? [
17
+ 1,
18
+ "…",
19
+ ...i(t - 2 - n * 2, t)
20
+ ] : [
21
+ 1,
22
+ "…",
23
+ ...i(r, a),
24
+ "…",
25
+ t
26
+ ];
27
+ }
28
+ var o = /* @__PURE__ */ n("svg", {
29
+ width: "14",
30
+ height: "14",
31
+ viewBox: "0 0 24 24",
32
+ fill: "none",
33
+ stroke: "currentColor",
34
+ strokeWidth: "2.5",
35
+ strokeLinecap: "round",
36
+ strokeLinejoin: "round",
37
+ children: /* @__PURE__ */ n("path", { d: "m15 18-6-6 6-6" })
38
+ }), s = /* @__PURE__ */ n("svg", {
39
+ width: "14",
40
+ height: "14",
41
+ viewBox: "0 0 24 24",
42
+ fill: "none",
43
+ stroke: "currentColor",
44
+ strokeWidth: "2.5",
45
+ strokeLinecap: "round",
46
+ strokeLinejoin: "round",
47
+ children: /* @__PURE__ */ n("path", { d: "m9 18 6-6-6-6" })
48
+ });
49
+ function c({ page: i, totalPages: c, onPageChange: l, siblingCount: u = 1, className: d }) {
50
+ if (c <= 1) return null;
51
+ let f = a(i, c, u);
52
+ function p(r, a, o, s = !1) {
53
+ return /* @__PURE__ */ n("button", {
54
+ type: "button",
55
+ disabled: o,
56
+ onClick: () => !o && l(a),
57
+ "aria-current": s ? "page" : void 0,
58
+ "aria-label": typeof r == "number" ? `Page ${r}` : a < i ? "Previous page" : "Next page",
59
+ className: e("flex items-center justify-center min-w-8 h-8 px-2 rounded-[var(--radius-md)] border text-sm font-medium transition-colors", t, s ? "border-accent-200 bg-accent-50 text-accent-700 dark:border-accent-500/20 dark:bg-accent-500/15 dark:text-accent-300" : "border-transparent text-muted-foreground hover:bg-muted hover:text-foreground", o && "opacity-40 cursor-not-allowed pointer-events-none"),
60
+ children: r
61
+ }, typeof r == "number" ? r : `${r}-${a}`);
62
+ }
63
+ return /* @__PURE__ */ r("nav", {
64
+ className: e("flex items-center gap-1", d),
65
+ "aria-label": "Pagination",
66
+ children: [
67
+ p(o, i - 1, i <= 1),
68
+ f.map((e, t) => e === "…" ? /* @__PURE__ */ n("span", {
69
+ className: "flex items-end justify-center w-8 h-8 text-slate-500 text-sm pb-1",
70
+ children: "…"
71
+ }, `dots-${t}`) : p(e, e, !1, e === i)),
72
+ p(s, i + 1, i >= c)
73
+ ]
74
+ });
75
+ }
76
+ //#endregion
77
+ export { c as Pagination };
@@ -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");var i={top:{container:`bottom-full mb-2`,initial:{y:4}},bottom:{container:`top-full mt-2`,initial:{y:-4}},left:{container:`right-full mr-2`,initial:{x:4}},right:{container:`left-full ml-2`,initial:{x:-4}}},a={top:{start:`left-0`,center:`left-1/2 -translate-x-1/2`,end:`right-0`},bottom:{start:`left-0`,center:`left-1/2 -translate-x-1/2`,end:`right-0`},left:{start:`top-0`,center:`top-1/2 -translate-y-1/2`,end:`bottom-0`},right:{start:`top-0`,center:`top-1/2 -translate-y-1/2`,end:`bottom-0`}};function o({trigger:o,children:s,side:c=`bottom`,align:l=`start`,className:u,open:d,onOpenChange:f,ariaLabel:p=`Popover`}){let[m,h]=(0,n.useState)(!1),g=d??m,_=(0,n.useRef)(null),v=(0,n.useId)();function y(){let e=!g;d===void 0&&h(e),f?.(e)}function b(){d===void 0&&h(!1),f?.(!1)}(0,n.useEffect)(()=>{function e(e){_.current?.contains(e.target)||b()}function t(e){e.key===`Escape`&&g&&(e.preventDefault(),b(),_.current?.querySelector(`[aria-haspopup="dialog"]`)?.focus())}return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[v,g]);let{container:x,initial:S}=i[c],C=a[c][l],w=(0,n.isValidElement)(o)?(0,n.cloneElement)(o,{"aria-haspopup":`dialog`,"aria-expanded":g,"aria-controls":v,onClick:e=>{o.props.onClick?.(e),e.defaultPrevented||y()}}):(0,r.jsx)(`button`,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":g,"aria-controls":v,onClick:y,children:o});return(0,r.jsxs)(`div`,{ref:_,className:`relative inline-flex`,children:[w,(0,r.jsx)(t.AnimatePresence,{children:g&&(0,r.jsx)(t.motion.div,{id:v,role:`dialog`,"aria-label":p,initial:{opacity:0,...S},animate:{opacity:1,y:0,x:0},exit:{opacity:0,...S},transition:{duration:.13},className:e.t(`absolute z-50 min-w-[180px] rounded-[var(--radius-lg)] border border-border bg-surface-raised shadow-floating`,x,C,u),children:s})})]})}function s({className:t,children:n,...i}){return(0,r.jsx)(`div`,{className:e.t(`p-3`,t),...i,children:n})}exports.Popover=o,exports.PopoverContent=s;
@@ -0,0 +1,16 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ type PopoverSide = "top" | "bottom" | "left" | "right";
3
+ type PopoverAlign = "start" | "center" | "end";
4
+ export interface PopoverProps {
5
+ trigger: ReactNode;
6
+ children: ReactNode;
7
+ side?: PopoverSide;
8
+ align?: PopoverAlign;
9
+ className?: string;
10
+ open?: boolean;
11
+ onOpenChange?: (open: boolean) => void;
12
+ ariaLabel?: string;
13
+ }
14
+ export declare function Popover({ trigger, children, side, align, className, open: controlledOpen, onOpenChange, ariaLabel, }: PopoverProps): import("react").JSX.Element;
15
+ export declare function PopoverContent({ className, children, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
16
+ export {};
@@ -0,0 +1,115 @@
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, useId as o, useRef as s, useState as c } from "react";
5
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
6
+ //#region src/components/popover.tsx
7
+ var d = {
8
+ top: {
9
+ container: "bottom-full mb-2",
10
+ initial: { y: 4 }
11
+ },
12
+ bottom: {
13
+ container: "top-full mt-2",
14
+ initial: { y: -4 }
15
+ },
16
+ left: {
17
+ container: "right-full mr-2",
18
+ initial: { x: 4 }
19
+ },
20
+ right: {
21
+ container: "left-full ml-2",
22
+ initial: { x: -4 }
23
+ }
24
+ }, f = {
25
+ top: {
26
+ start: "left-0",
27
+ center: "left-1/2 -translate-x-1/2",
28
+ end: "right-0"
29
+ },
30
+ bottom: {
31
+ start: "left-0",
32
+ center: "left-1/2 -translate-x-1/2",
33
+ end: "right-0"
34
+ },
35
+ left: {
36
+ start: "top-0",
37
+ center: "top-1/2 -translate-y-1/2",
38
+ end: "bottom-0"
39
+ },
40
+ right: {
41
+ start: "top-0",
42
+ center: "top-1/2 -translate-y-1/2",
43
+ end: "bottom-0"
44
+ }
45
+ };
46
+ function p({ trigger: p, children: m, side: h = "bottom", align: g = "start", className: _, open: v, onOpenChange: y, ariaLabel: b = "Popover" }) {
47
+ let [x, S] = c(!1), C = v ?? x, w = s(null), T = o();
48
+ function E() {
49
+ let e = !C;
50
+ v === void 0 && S(e), y?.(e);
51
+ }
52
+ function D() {
53
+ v === void 0 && S(!1), y?.(!1);
54
+ }
55
+ a(() => {
56
+ function e(e) {
57
+ w.current?.contains(e.target) || D();
58
+ }
59
+ function t(e) {
60
+ e.key === "Escape" && C && (e.preventDefault(), D(), w.current?.querySelector("[aria-haspopup=\"dialog\"]")?.focus());
61
+ }
62
+ return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
63
+ document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
64
+ };
65
+ }, [T, C]);
66
+ let { container: O, initial: k } = d[h], A = f[h][g], j = i(p) ? r(p, {
67
+ "aria-haspopup": "dialog",
68
+ "aria-expanded": C,
69
+ "aria-controls": T,
70
+ onClick: (e) => {
71
+ p.props.onClick?.(e), e.defaultPrevented || E();
72
+ }
73
+ }) : /* @__PURE__ */ l("button", {
74
+ type: "button",
75
+ "aria-haspopup": "dialog",
76
+ "aria-expanded": C,
77
+ "aria-controls": T,
78
+ onClick: E,
79
+ children: p
80
+ });
81
+ return /* @__PURE__ */ u("div", {
82
+ ref: w,
83
+ className: "relative inline-flex",
84
+ children: [j, /* @__PURE__ */ l(t, { children: C && /* @__PURE__ */ l(n.div, {
85
+ id: T,
86
+ role: "dialog",
87
+ "aria-label": b,
88
+ initial: {
89
+ opacity: 0,
90
+ ...k
91
+ },
92
+ animate: {
93
+ opacity: 1,
94
+ y: 0,
95
+ x: 0
96
+ },
97
+ exit: {
98
+ opacity: 0,
99
+ ...k
100
+ },
101
+ transition: { duration: .13 },
102
+ className: e("absolute z-50 min-w-[180px] rounded-[var(--radius-lg)] border border-border bg-surface-raised shadow-floating", O, A, _),
103
+ children: m
104
+ }) })]
105
+ });
106
+ }
107
+ function m({ className: t, children: n, ...r }) {
108
+ return /* @__PURE__ */ l("div", {
109
+ className: e("p-3", t),
110
+ ...r,
111
+ children: n
112
+ });
113
+ }
114
+ //#endregion
115
+ export { p as Popover, m as PopoverContent };
@@ -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/jsx-runtime");var r={default:`bg-black/6 dark:bg-white/6`,success:`bg-emerald-500/10`,warning:`bg-amber-500/10`,error:`bg-red-500/10`,info:`bg-sky-500/10`},i={default:`bg-accent-500`,success:`bg-emerald-500`,warning:`bg-amber-500`,error:`bg-red-500`,info:`bg-sky-500`},a={default:`text-accent-400`,success:`text-emerald-400`,warning:`text-amber-400`,error:`text-red-400`,info:`text-sky-400`},o={xs:`h-1`,sm:`h-1.5`,md:`h-2`,lg:`h-3`};function s({value:s=0,variant:c=`default`,size:l=`md`,label:u,showValue:d=!1,indeterminate:f=!1,steps:p,animated:m=!0,className:h,...g}){let _=Math.min(100,Math.max(0,s)),v=u!==void 0||d;if(p!==void 0&&p>0){let s=Math.round(_/100*p);return(0,n.jsxs)(`div`,{className:e.t(`flex flex-col gap-1.5`,h),...g,children:[v&&(0,n.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[u&&(0,n.jsx)(`span`,{className:`text-xs text-slate-500 dark:text-slate-400`,children:u}),d&&(0,n.jsxs)(`span`,{className:e.t(`text-xs font-medium tabular-nums ml-auto`,a[c]),children:[s,`/`,p]})]}),(0,n.jsx)(`div`,{className:`flex gap-1`,children:Array.from({length:p}).map((a,u)=>(0,n.jsx)(t.motion.div,{className:e.t(`flex-1 rounded-full`,o[l],u<s?i[c]:r[c]),initial:m?{opacity:.4}:void 0,animate:m?{opacity:1}:void 0,transition:{delay:u*.04,duration:.2}},u))})]})}return(0,n.jsxs)(`div`,{className:e.t(`flex flex-col gap-1.5`,h),...g,children:[v&&(0,n.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[u&&(0,n.jsx)(`span`,{className:`text-xs text-slate-500 dark:text-slate-400`,children:u}),d&&!f&&(0,n.jsxs)(`span`,{className:e.t(`text-xs font-medium tabular-nums ml-auto`,a[c]),children:[_,`%`]})]}),(0,n.jsx)(`div`,{role:`progressbar`,"aria-valuenow":f?void 0:_,"aria-valuemin":0,"aria-valuemax":100,className:e.t(`w-full overflow-hidden rounded-full`,o[l],r[c]),children:f?(0,n.jsx)(t.motion.div,{className:e.t(`h-full w-1/3 rounded-full`,i[c]),animate:{x:[`-100%`,`400%`]},transition:{duration:1.4,repeat:1/0,ease:`easeInOut`}}):(0,n.jsx)(t.motion.div,{className:e.t(`h-full rounded-full`,i[c]),initial:m?{width:0}:{width:`${_}%`},animate:{width:`${_}%`},transition:{duration:.5,ease:[.25,.46,.45,.94]}})})]})}exports.Progressbar=s;
@@ -0,0 +1,15 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export type ProgressVariant = "default" | "success" | "warning" | "error" | "info";
3
+ export type ProgressSize = "xs" | "sm" | "md" | "lg";
4
+ export interface ProgressbarProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
5
+ value?: number;
6
+ variant?: ProgressVariant;
7
+ size?: ProgressSize;
8
+ label?: string;
9
+ showValue?: boolean;
10
+ indeterminate?: boolean;
11
+ /** Render as segmented steps instead of a continuous bar */
12
+ steps?: number;
13
+ animated?: boolean;
14
+ }
15
+ export declare function Progressbar({ value, variant, size, label, showValue, indeterminate, steps, animated, className, ...props }: ProgressbarProps): import("react").JSX.Element;
@@ -0,0 +1,108 @@
1
+ "use client";
2
+ import { t as e } from "../cn-DpgY2leY.js";
3
+ import { motion as t } from "framer-motion";
4
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
5
+ //#region src/components/progressbar.tsx
6
+ var i = {
7
+ default: "bg-black/6 dark:bg-white/6",
8
+ success: "bg-emerald-500/10",
9
+ warning: "bg-amber-500/10",
10
+ error: "bg-red-500/10",
11
+ info: "bg-sky-500/10"
12
+ }, a = {
13
+ default: "bg-accent-500",
14
+ success: "bg-emerald-500",
15
+ warning: "bg-amber-500",
16
+ error: "bg-red-500",
17
+ info: "bg-sky-500"
18
+ }, o = {
19
+ default: "text-accent-400",
20
+ success: "text-emerald-400",
21
+ warning: "text-amber-400",
22
+ error: "text-red-400",
23
+ info: "text-sky-400"
24
+ }, s = {
25
+ xs: "h-1",
26
+ sm: "h-1.5",
27
+ md: "h-2",
28
+ lg: "h-3"
29
+ };
30
+ function c({ value: c = 0, variant: l = "default", size: u = "md", label: d, showValue: f = !1, indeterminate: p = !1, steps: m, animated: h = !0, className: g, ..._ }) {
31
+ let v = Math.min(100, Math.max(0, c)), y = d !== void 0 || f;
32
+ if (m !== void 0 && m > 0) {
33
+ let c = Math.round(v / 100 * m);
34
+ return /* @__PURE__ */ r("div", {
35
+ className: e("flex flex-col gap-1.5", g),
36
+ ..._,
37
+ children: [y && /* @__PURE__ */ r("div", {
38
+ className: "flex items-center justify-between gap-2",
39
+ children: [d && /* @__PURE__ */ n("span", {
40
+ className: "text-xs text-slate-500 dark:text-slate-400",
41
+ children: d
42
+ }), f && /* @__PURE__ */ r("span", {
43
+ className: e("text-xs font-medium tabular-nums ml-auto", o[l]),
44
+ children: [
45
+ c,
46
+ "/",
47
+ m
48
+ ]
49
+ })]
50
+ }), /* @__PURE__ */ n("div", {
51
+ className: "flex gap-1",
52
+ children: Array.from({ length: m }).map((r, o) => /* @__PURE__ */ n(t.div, {
53
+ className: e("flex-1 rounded-full", s[u], o < c ? a[l] : i[l]),
54
+ initial: h ? { opacity: .4 } : void 0,
55
+ animate: h ? { opacity: 1 } : void 0,
56
+ transition: {
57
+ delay: o * .04,
58
+ duration: .2
59
+ }
60
+ }, o))
61
+ })]
62
+ });
63
+ }
64
+ return /* @__PURE__ */ r("div", {
65
+ className: e("flex flex-col gap-1.5", g),
66
+ ..._,
67
+ children: [y && /* @__PURE__ */ r("div", {
68
+ className: "flex items-center justify-between gap-2",
69
+ children: [d && /* @__PURE__ */ n("span", {
70
+ className: "text-xs text-slate-500 dark:text-slate-400",
71
+ children: d
72
+ }), f && !p && /* @__PURE__ */ r("span", {
73
+ className: e("text-xs font-medium tabular-nums ml-auto", o[l]),
74
+ children: [v, "%"]
75
+ })]
76
+ }), /* @__PURE__ */ n("div", {
77
+ role: "progressbar",
78
+ "aria-valuenow": p ? void 0 : v,
79
+ "aria-valuemin": 0,
80
+ "aria-valuemax": 100,
81
+ className: e("w-full overflow-hidden rounded-full", s[u], i[l]),
82
+ children: p ? /* @__PURE__ */ n(t.div, {
83
+ className: e("h-full w-1/3 rounded-full", a[l]),
84
+ animate: { x: ["-100%", "400%"] },
85
+ transition: {
86
+ duration: 1.4,
87
+ repeat: Infinity,
88
+ ease: "easeInOut"
89
+ }
90
+ }) : /* @__PURE__ */ n(t.div, {
91
+ className: e("h-full rounded-full", a[l]),
92
+ initial: h ? { width: 0 } : { width: `${v}%` },
93
+ animate: { width: `${v}%` },
94
+ transition: {
95
+ duration: .5,
96
+ ease: [
97
+ .25,
98
+ .46,
99
+ .45,
100
+ .94
101
+ ]
102
+ }
103
+ })
104
+ })]
105
+ });
106
+ }
107
+ //#endregion
108
+ export { c as Progressbar };
@@ -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.createContext)(null);function o(){let e=(0,r.useContext)(a);if(!e)throw Error(`Radio must be inside <RadioGroup>`);return e}function s({name:n,value:o,onChange:s,disabled:c,label:l,hint:u,error:d,orientation:f=`vertical`,className:p,children:m}){let h=(0,r.useId)(),g=n??h,_=`${g}-label`,v=`${g}-message`;return(0,i.jsxs)(`div`,{className:e.t(t.o,p),children:[l&&(0,i.jsx)(`p`,{id:_,className:`text-sm font-medium leading-5 text-foreground`,children:l}),(0,i.jsx)(a.Provider,{value:{name:g,value:o,onChange:s,disabled:c},children:(0,i.jsx)(`div`,{role:`radiogroup`,"aria-labelledby":l?_:void 0,"aria-invalid":d?!0:void 0,"aria-describedby":d||u?v:void 0,className:e.t(`flex gap-2`,f===`vertical`?`flex-col`:`flex-row flex-wrap`),children:m})}),d&&(0,i.jsx)(`p`,{id:v,"aria-live":`polite`,className:`text-xs leading-5 text-destructive`,children:d}),u&&!d&&(0,i.jsx)(`p`,{id:v,className:`text-xs leading-5 text-muted-foreground`,children:u})]})}function c({value:t,label:a,description:s,disabled:c,className:l}){let{name:u,value:d,onChange:f,disabled:p}=o(),m=(0,r.useId)(),h=d===t,g=c??p;return(0,i.jsxs)(`label`,{htmlFor:m,className:e.t(`flex items-start gap-2.5 cursor-pointer`,g&&`cursor-not-allowed opacity-50`,l),children:[(0,i.jsxs)(`div`,{className:`relative mt-0.5 shrink-0 w-4 h-4`,children:[(0,i.jsx)(`input`,{type:`radio`,id:m,name:u,value:t,checked:h,disabled:g,onChange:()=>f(t),className:`peer absolute inset-0 z-10 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed`}),(0,i.jsx)(`div`,{className:e.t(`w-4 h-4 rounded-full border-2 flex items-center justify-center transition-colors duration-[120ms] peer-focus-visible:ring-2 peer-focus-visible:ring-focus-ring/35 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-bg`,h?`bg-primary border-primary`:`bg-transparent border-black/25 dark:border-white/25`),children:h&&(0,i.jsx)(n.motion.span,{initial:{scale:0},animate:{scale:1},transition:{type:`spring`,stiffness:600,damping:30},className:`w-1.5 h-1.5 rounded-full bg-white`})})]}),(a||s)&&(0,i.jsxs)(`div`,{className:`min-w-0`,children:[a&&(0,i.jsx)(`p`,{className:`text-sm font-medium text-foreground leading-snug`,children:a}),s&&(0,i.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:s})]})]})}exports.Radio=c,exports.RadioGroup=s;
@@ -0,0 +1,22 @@
1
+ import { ReactNode } from 'react';
2
+ export interface RadioGroupProps {
3
+ name?: string;
4
+ value: string;
5
+ onChange: (value: string) => void;
6
+ disabled?: boolean;
7
+ label?: string;
8
+ hint?: string;
9
+ error?: string;
10
+ orientation?: "vertical" | "horizontal";
11
+ className?: string;
12
+ children: ReactNode;
13
+ }
14
+ export declare function RadioGroup({ name: externalName, value, onChange, disabled, label, hint, error, orientation, className, children, }: RadioGroupProps): import("react").JSX.Element;
15
+ export interface RadioProps {
16
+ value: string;
17
+ label?: string;
18
+ description?: string;
19
+ disabled?: boolean;
20
+ className?: string;
21
+ }
22
+ export declare function Radio({ value, label, description, disabled: localDisabled, className }: RadioProps): import("react").JSX.Element;