@devalok/shilp-sutra 0.17.2 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (318) hide show
  1. package/dist/_chunks/avatar.js +21 -19
  2. package/dist/_chunks/button-group.js +27 -0
  3. package/dist/_chunks/button.js +53 -35
  4. package/dist/_chunks/card.js +50 -0
  5. package/dist/_chunks/checkbox.js +11 -9
  6. package/dist/_chunks/date-utils.js +13 -0
  7. package/dist/_chunks/form.js +20 -20
  8. package/dist/_chunks/link-context.js +19 -0
  9. package/dist/_chunks/motion.js +1376 -0
  10. package/dist/_chunks/motion2.js +35 -0
  11. package/dist/_chunks/primitives.js +3499 -3920
  12. package/dist/_chunks/sidebar.js +225 -211
  13. package/dist/_chunks/spinner.js +58 -28
  14. package/dist/_chunks/tiptap.js +1 -1
  15. package/dist/_chunks/tooltip.js +27 -10
  16. package/dist/_chunks/tree-view.js +180 -178
  17. package/dist/_chunks/use-calendar.js +531 -515
  18. package/dist/_chunks/utils.js +3 -3
  19. package/dist/_chunks/vendor-client.js +1792 -1049
  20. package/dist/_chunks/vendor-utils.js +5123 -1169
  21. package/dist/composed/activity-feed.d.ts.map +1 -1
  22. package/dist/composed/activity-feed.js +71 -74
  23. package/dist/composed/avatar-group.js +36 -36
  24. package/dist/composed/command-palette.d.ts +1 -1
  25. package/dist/composed/command-palette.d.ts.map +1 -1
  26. package/dist/composed/command-palette.js +207 -158
  27. package/dist/composed/confirm-dialog.d.ts +3 -5
  28. package/dist/composed/confirm-dialog.d.ts.map +1 -1
  29. package/dist/composed/confirm-dialog.js +46 -41
  30. package/dist/composed/content-card.d.ts +1 -1
  31. package/dist/composed/content-card.js +29 -29
  32. package/dist/composed/date-picker/calendar-grid.d.ts +1 -1
  33. package/dist/composed/date-picker/calendar-grid.d.ts.map +1 -1
  34. package/dist/composed/date-picker/date-picker.d.ts +1 -1
  35. package/dist/composed/date-picker/date-picker.d.ts.map +1 -1
  36. package/dist/composed/date-picker/date-range-picker.d.ts +1 -1
  37. package/dist/composed/date-picker/date-range-picker.d.ts.map +1 -1
  38. package/dist/composed/date-picker/date-time-picker.d.ts +1 -1
  39. package/dist/composed/date-picker/date-time-picker.d.ts.map +1 -1
  40. package/dist/composed/date-picker/month-picker.d.ts +1 -1
  41. package/dist/composed/date-picker/month-picker.d.ts.map +1 -1
  42. package/dist/composed/date-picker/presets.d.ts +1 -1
  43. package/dist/composed/date-picker/presets.d.ts.map +1 -1
  44. package/dist/composed/date-picker/time-picker.d.ts +1 -1
  45. package/dist/composed/date-picker/time-picker.d.ts.map +1 -1
  46. package/dist/composed/date-picker/year-picker.d.ts +1 -1
  47. package/dist/composed/date-picker/year-picker.d.ts.map +1 -1
  48. package/dist/composed/empty-state.d.ts +1 -0
  49. package/dist/composed/empty-state.d.ts.map +1 -1
  50. package/dist/composed/empty-state.js +51 -47
  51. package/dist/composed/error-boundary.d.ts +1 -1
  52. package/dist/composed/error-boundary.d.ts.map +1 -1
  53. package/dist/composed/error-boundary.js +48 -48
  54. package/dist/composed/extensions/mention-suggestion.d.ts +1 -1
  55. package/dist/composed/extensions/mention-suggestion.d.ts.map +1 -1
  56. package/dist/composed/global-loading.d.ts +1 -1
  57. package/dist/composed/global-loading.d.ts.map +1 -1
  58. package/dist/composed/global-loading.js +23 -20
  59. package/dist/composed/index.d.ts +2 -4
  60. package/dist/composed/index.d.ts.map +1 -1
  61. package/dist/composed/index.js +26 -29
  62. package/dist/composed/loading-skeleton.d.ts +1 -1
  63. package/dist/composed/loading-skeleton.d.ts.map +1 -1
  64. package/dist/composed/loading-skeleton.js +92 -87
  65. package/dist/composed/member-picker.d.ts +1 -1
  66. package/dist/composed/member-picker.d.ts.map +1 -1
  67. package/dist/composed/member-picker.js +47 -43
  68. package/dist/composed/page-header.js +36 -36
  69. package/dist/composed/page-skeletons.d.ts +9 -3
  70. package/dist/composed/page-skeletons.d.ts.map +1 -1
  71. package/dist/composed/page-skeletons.js +58 -58
  72. package/dist/composed/priority-indicator.js +19 -19
  73. package/dist/composed/rich-text-editor.d.ts +3 -3
  74. package/dist/composed/rich-text-editor.d.ts.map +1 -1
  75. package/dist/composed/rich-text-editor.js +316 -309
  76. package/dist/composed/schedule-view.js +88 -88
  77. package/dist/composed/simple-tooltip.d.ts +2 -5
  78. package/dist/composed/simple-tooltip.d.ts.map +1 -1
  79. package/dist/composed/simple-tooltip.js +19 -14
  80. package/dist/composed/status-badge.d.ts +2 -1
  81. package/dist/composed/status-badge.d.ts.map +1 -1
  82. package/dist/composed/status-badge.js +76 -63
  83. package/dist/hooks/index.d.ts +2 -1
  84. package/dist/hooks/index.d.ts.map +1 -1
  85. package/dist/hooks/index.js +3 -4
  86. package/dist/hooks/use-toast.d.ts +15 -45
  87. package/dist/hooks/use-toast.d.ts.map +1 -1
  88. package/dist/hooks/use-toast.js +2 -95
  89. package/dist/motion/index.d.ts +4 -0
  90. package/dist/motion/index.d.ts.map +1 -0
  91. package/dist/motion/index.js +10 -0
  92. package/dist/motion/motion-provider.d.ts +18 -0
  93. package/dist/motion/motion-provider.d.ts.map +1 -0
  94. package/dist/motion/motion-provider.js +24 -0
  95. package/dist/motion/primitives-index.d.ts +3 -0
  96. package/dist/motion/primitives-index.d.ts.map +1 -0
  97. package/dist/motion/primitives-index.js +11 -0
  98. package/dist/motion/primitives.d.ts +38 -0
  99. package/dist/motion/primitives.d.ts.map +1 -0
  100. package/dist/motion/primitives.js +187 -0
  101. package/dist/shell/app-command-palette.d.ts +14 -5
  102. package/dist/shell/app-command-palette.d.ts.map +1 -1
  103. package/dist/shell/app-command-palette.js +152 -130
  104. package/dist/shell/bottom-navbar.d.ts.map +1 -1
  105. package/dist/shell/bottom-navbar.js +90 -92
  106. package/dist/shell/command-registry.d.ts +23 -0
  107. package/dist/shell/command-registry.d.ts.map +1 -0
  108. package/dist/shell/command-registry.js +18 -0
  109. package/dist/shell/index.d.ts +2 -1
  110. package/dist/shell/index.d.ts.map +1 -1
  111. package/dist/shell/index.js +14 -11
  112. package/dist/shell/link-context.d.ts +6 -10
  113. package/dist/shell/link-context.d.ts.map +1 -1
  114. package/dist/shell/link-context.js +3 -16
  115. package/dist/shell/notification-center.d.ts.map +1 -1
  116. package/dist/shell/notification-center.js +137 -132
  117. package/dist/shell/notification-preferences.d.ts +10 -5
  118. package/dist/shell/notification-preferences.d.ts.map +1 -1
  119. package/dist/shell/notification-preferences.js +168 -165
  120. package/dist/shell/sidebar.js +119 -119
  121. package/dist/shell/top-bar.js +65 -65
  122. package/dist/tailwind/index.cjs +118 -297
  123. package/dist/tailwind/preset.d.ts.map +1 -1
  124. package/dist/tailwind/preset.js +118 -297
  125. package/dist/tokens/generate-scale.d.ts +86 -0
  126. package/dist/tokens/generate-scale.d.ts.map +1 -0
  127. package/dist/tokens/primitives.css +415 -187
  128. package/dist/tokens/semantic.css +244 -270
  129. package/dist/tokens/typography.css +6 -6
  130. package/dist/ui/accordion.d.ts.map +1 -1
  131. package/dist/ui/accordion.js +32 -22
  132. package/dist/ui/alert-dialog.d.ts +4 -1
  133. package/dist/ui/alert-dialog.d.ts.map +1 -1
  134. package/dist/ui/alert-dialog.js +114 -73
  135. package/dist/ui/alert.d.ts +6 -1
  136. package/dist/ui/alert.d.ts.map +1 -1
  137. package/dist/ui/alert.js +64 -49
  138. package/dist/ui/aspect-ratio.d.ts +2 -1
  139. package/dist/ui/aspect-ratio.d.ts.map +1 -1
  140. package/dist/ui/aspect-ratio.js +14 -4
  141. package/dist/ui/autocomplete.d.ts +11 -2
  142. package/dist/ui/autocomplete.d.ts.map +1 -1
  143. package/dist/ui/autocomplete.js +82 -57
  144. package/dist/ui/avatar.d.ts.map +1 -1
  145. package/dist/ui/avatar.js +45 -34
  146. package/dist/ui/badge.d.ts +1 -1
  147. package/dist/ui/badge.d.ts.map +1 -1
  148. package/dist/ui/badge.js +70 -65
  149. package/dist/ui/banner.d.ts.map +1 -1
  150. package/dist/ui/banner.js +53 -39
  151. package/dist/ui/breadcrumb.d.ts +2 -0
  152. package/dist/ui/breadcrumb.d.ts.map +1 -1
  153. package/dist/ui/breadcrumb.js +21 -21
  154. package/dist/ui/button.d.ts +10 -1
  155. package/dist/ui/button.d.ts.map +1 -1
  156. package/dist/ui/button.js +103 -67
  157. package/dist/ui/card.d.ts +2 -2
  158. package/dist/ui/card.d.ts.map +1 -1
  159. package/dist/ui/card.js +61 -53
  160. package/dist/ui/charts/_internal/animation.d.ts +1 -1
  161. package/dist/ui/charts/_internal/animation.d.ts.map +1 -1
  162. package/dist/ui/charts/area-chart.d.ts +3 -5
  163. package/dist/ui/charts/area-chart.d.ts.map +1 -1
  164. package/dist/ui/charts/bar-chart.d.ts +3 -5
  165. package/dist/ui/charts/bar-chart.d.ts.map +1 -1
  166. package/dist/ui/charts/chart-container.d.ts +2 -5
  167. package/dist/ui/charts/chart-container.d.ts.map +1 -1
  168. package/dist/ui/charts/gauge-chart.d.ts +3 -5
  169. package/dist/ui/charts/gauge-chart.d.ts.map +1 -1
  170. package/dist/ui/charts/index.js +1204 -1095
  171. package/dist/ui/charts/line-chart.d.ts +3 -5
  172. package/dist/ui/charts/line-chart.d.ts.map +1 -1
  173. package/dist/ui/charts/pie-chart.d.ts +2 -5
  174. package/dist/ui/charts/pie-chart.d.ts.map +1 -1
  175. package/dist/ui/charts/radar-chart.d.ts +3 -5
  176. package/dist/ui/charts/radar-chart.d.ts.map +1 -1
  177. package/dist/ui/charts/sparkline.d.ts +5 -5
  178. package/dist/ui/charts/sparkline.d.ts.map +1 -1
  179. package/dist/ui/checkbox.d.ts.map +1 -1
  180. package/dist/ui/checkbox.js +31 -19
  181. package/dist/ui/chip.d.ts +3 -2
  182. package/dist/ui/chip.d.ts.map +1 -1
  183. package/dist/ui/chip.js +62 -54
  184. package/dist/ui/code.js +16 -16
  185. package/dist/ui/collapsible.d.ts.map +1 -1
  186. package/dist/ui/collapsible.js +23 -15
  187. package/dist/ui/color-input.d.ts +1 -1
  188. package/dist/ui/color-input.d.ts.map +1 -1
  189. package/dist/ui/color-input.js +27 -27
  190. package/dist/ui/combobox.d.ts +2 -0
  191. package/dist/ui/combobox.d.ts.map +1 -1
  192. package/dist/ui/combobox.js +177 -166
  193. package/dist/ui/context-menu.d.ts +4 -2
  194. package/dist/ui/context-menu.d.ts.map +1 -1
  195. package/dist/ui/context-menu.js +146 -86
  196. package/dist/ui/data-table-toolbar.d.ts +3 -2
  197. package/dist/ui/data-table-toolbar.d.ts.map +1 -1
  198. package/dist/ui/data-table-toolbar.js +61 -59
  199. package/dist/ui/data-table.d.ts.map +1 -1
  200. package/dist/ui/data-table.js +289 -254
  201. package/dist/ui/dialog.d.ts +3 -1
  202. package/dist/ui/dialog.d.ts.map +1 -1
  203. package/dist/ui/dialog.js +114 -74
  204. package/dist/ui/dropdown-menu.d.ts +5 -3
  205. package/dist/ui/dropdown-menu.d.ts.map +1 -1
  206. package/dist/ui/dropdown-menu.js +150 -89
  207. package/dist/ui/file-upload.d.ts.map +1 -1
  208. package/dist/ui/file-upload.js +169 -127
  209. package/dist/ui/form.d.ts.map +1 -1
  210. package/dist/ui/form.js +29 -26
  211. package/dist/ui/hover-card.d.ts +1 -1
  212. package/dist/ui/hover-card.d.ts.map +1 -1
  213. package/dist/ui/hover-card.js +53 -21
  214. package/dist/ui/index.d.ts +18 -18
  215. package/dist/ui/index.d.ts.map +1 -1
  216. package/dist/ui/index.js +432 -449
  217. package/dist/ui/input-otp.d.ts +2 -0
  218. package/dist/ui/input-otp.d.ts.map +1 -1
  219. package/dist/ui/input-otp.js +7 -7
  220. package/dist/ui/input.d.ts.map +1 -1
  221. package/dist/ui/input.js +36 -34
  222. package/dist/ui/label.js +12 -12
  223. package/dist/ui/lib/date-utils.d.ts +6 -0
  224. package/dist/ui/lib/date-utils.d.ts.map +1 -0
  225. package/dist/ui/lib/index.d.ts +7 -0
  226. package/dist/ui/lib/index.d.ts.map +1 -0
  227. package/dist/ui/lib/link-context.d.ts +13 -0
  228. package/dist/ui/lib/link-context.d.ts.map +1 -0
  229. package/dist/ui/lib/motion.d.ts +44 -9
  230. package/dist/ui/lib/motion.d.ts.map +1 -1
  231. package/dist/ui/lib/use-ripple.d.ts.map +1 -1
  232. package/dist/ui/lib/utils.js +1 -1
  233. package/dist/ui/link.js +11 -11
  234. package/dist/ui/menubar.d.ts +4 -2
  235. package/dist/ui/menubar.d.ts.map +1 -1
  236. package/dist/ui/menubar.js +141 -97
  237. package/dist/ui/navigation-menu.d.ts +2 -0
  238. package/dist/ui/navigation-menu.d.ts.map +1 -1
  239. package/dist/ui/navigation-menu.js +176 -73
  240. package/dist/ui/number-input.d.ts.map +1 -1
  241. package/dist/ui/number-input.js +56 -49
  242. package/dist/ui/pagination.js +22 -22
  243. package/dist/ui/popover.d.ts +2 -1
  244. package/dist/ui/popover.d.ts.map +1 -1
  245. package/dist/ui/popover.js +54 -22
  246. package/dist/ui/progress.d.ts.map +1 -1
  247. package/dist/ui/progress.js +58 -42
  248. package/dist/ui/radio.js +19 -19
  249. package/dist/ui/search-input.d.ts.map +1 -1
  250. package/dist/ui/search-input.js +28 -33
  251. package/dist/ui/segmented-control.d.ts +2 -2
  252. package/dist/ui/segmented-control.d.ts.map +1 -1
  253. package/dist/ui/segmented-control.js +143 -124
  254. package/dist/ui/select.d.ts.map +1 -1
  255. package/dist/ui/select.js +72 -61
  256. package/dist/ui/separator.js +11 -11
  257. package/dist/ui/sheet.d.ts +1 -1
  258. package/dist/ui/sheet.d.ts.map +1 -1
  259. package/dist/ui/sheet.js +111 -75
  260. package/dist/ui/sidebar.d.ts +6 -1
  261. package/dist/ui/sidebar.d.ts.map +1 -1
  262. package/dist/ui/sidebar.js +27 -25
  263. package/dist/ui/skeleton.js +1 -1
  264. package/dist/ui/slider.d.ts +9 -0
  265. package/dist/ui/slider.d.ts.map +1 -1
  266. package/dist/ui/slider.js +33 -27
  267. package/dist/ui/spinner.d.ts +32 -25
  268. package/dist/ui/spinner.d.ts.map +1 -1
  269. package/dist/ui/spinner.js +199 -40
  270. package/dist/ui/stat-card.d.ts.map +1 -1
  271. package/dist/ui/stat-card.js +183 -116
  272. package/dist/ui/stepper.d.ts +22 -1
  273. package/dist/ui/stepper.d.ts.map +1 -1
  274. package/dist/ui/stepper.js +121 -43
  275. package/dist/ui/switch.d.ts.map +1 -1
  276. package/dist/ui/switch.js +39 -26
  277. package/dist/ui/table.d.ts +3 -0
  278. package/dist/ui/table.d.ts.map +1 -1
  279. package/dist/ui/table.js +47 -47
  280. package/dist/ui/tabs.d.ts +4 -1
  281. package/dist/ui/tabs.d.ts.map +1 -1
  282. package/dist/ui/tabs.js +94 -44
  283. package/dist/ui/text.d.ts +3 -3
  284. package/dist/ui/text.js +1 -1
  285. package/dist/ui/textarea.d.ts.map +1 -1
  286. package/dist/ui/textarea.js +29 -27
  287. package/dist/ui/toast-types.d.ts +43 -0
  288. package/dist/ui/toast-types.d.ts.map +1 -0
  289. package/dist/ui/toast-types.js +2 -0
  290. package/dist/ui/toast.d.ts +60 -26
  291. package/dist/ui/toast.d.ts.map +1 -1
  292. package/dist/ui/toast.js +535 -89
  293. package/dist/ui/toaster.d.ts +19 -23
  294. package/dist/ui/toaster.d.ts.map +1 -1
  295. package/dist/ui/toaster.js +31 -21
  296. package/dist/ui/toggle-group.d.ts +2 -2
  297. package/dist/ui/toggle-group.d.ts.map +1 -1
  298. package/dist/ui/toggle-group.js +29 -26
  299. package/dist/ui/toggle.d.ts +2 -2
  300. package/dist/ui/toggle.d.ts.map +1 -1
  301. package/dist/ui/toggle.js +21 -17
  302. package/dist/ui/tooltip.d.ts +2 -1
  303. package/dist/ui/tooltip.d.ts.map +1 -1
  304. package/dist/ui/tooltip.js +58 -21
  305. package/dist/ui/tree-view/tree-view.d.ts +1 -1
  306. package/dist/ui/tree-view/tree-view.d.ts.map +1 -1
  307. package/llms-full.txt +221 -102
  308. package/llms.txt +65 -12
  309. package/package.json +26 -8
  310. package/dist/_chunks/switch.js +0 -10
  311. package/dist/composed/upload-progress.d.ts +0 -33
  312. package/dist/composed/upload-progress.d.ts.map +0 -1
  313. package/dist/composed/upload-progress.js +0 -386
  314. package/dist/ui/lib/use-reduced-motion.d.ts +0 -4
  315. package/dist/ui/lib/use-reduced-motion.d.ts.map +0 -1
  316. package/dist/ui/transitions.d.ts +0 -17
  317. package/dist/ui/transitions.d.ts.map +0 -1
  318. package/dist/ui/transitions.js +0 -111
package/dist/ui/slider.js CHANGED
@@ -1,30 +1,36 @@
1
1
  "use client";
2
- import { jsxs as r, jsx as e } from "react/jsx-runtime";
3
- import * as t from "react";
4
- import { aC as a, aD as c, aE as n, aF as d } from "../_chunks/primitives.js";
5
- import { c as f } from "../_chunks/utils.js";
6
- const m = t.forwardRef(({ className: s, "aria-label": o, ...i }, l) => /* @__PURE__ */ r(
7
- a,
8
- {
9
- ref: l,
10
- className: f(
11
- "relative flex w-full touch-none select-none items-center",
12
- s
13
- ),
14
- ...i,
15
- children: [
16
- /* @__PURE__ */ e(c, { className: "relative h-ds-02b w-full grow overflow-hidden rounded-ds-full bg-field", children: /* @__PURE__ */ e(n, { className: "absolute h-full bg-interactive" }) }),
17
- /* @__PURE__ */ e(
18
- d,
19
- {
20
- "aria-label": o,
21
- className: "block h-ico-sm w-ico-sm rounded-ds-full border-2 border-interactive bg-layer-01 shadow-01 transition-[color,transform] duration-fast-02 hover:scale-110 active:scale-125 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-[0.38]"
22
- }
23
- )
24
- ]
25
- }
26
- ));
27
- m.displayName = a.displayName;
2
+ import { jsxs as d, jsx as e } from "react/jsx-runtime";
3
+ import * as f from "react";
4
+ import { aA as r, aB as m, aC as b, aD as u } from "../_chunks/primitives.js";
5
+ import { c as h } from "../_chunks/utils.js";
6
+ const g = f.forwardRef(({ className: i, "aria-label": l, value: a, defaultValue: s, ...c }, n) => {
7
+ const o = (a ?? s ?? [0]).length;
8
+ return /* @__PURE__ */ d(
9
+ r,
10
+ {
11
+ ref: n,
12
+ value: a,
13
+ defaultValue: s,
14
+ className: h(
15
+ "relative flex w-full touch-none select-none items-center",
16
+ i
17
+ ),
18
+ ...c,
19
+ children: [
20
+ /* @__PURE__ */ e(m, { className: "relative h-ds-02b w-full grow overflow-hidden rounded-ds-full bg-surface-3", children: /* @__PURE__ */ e(b, { className: "absolute h-full bg-accent-9" }) }),
21
+ Array.from({ length: o }, (v, t) => /* @__PURE__ */ e(
22
+ u,
23
+ {
24
+ "aria-label": o === 1 ? l : void 0,
25
+ className: "block h-ico-sm w-ico-sm rounded-ds-full border-2 border-accent-7 bg-surface-1 shadow-01 transition-[color,transform] duration-fast-02 hover:scale-110 active:scale-125 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-action-disabled"
26
+ },
27
+ t
28
+ ))
29
+ ]
30
+ }
31
+ );
32
+ });
33
+ g.displayName = r.displayName;
28
34
  export {
29
- m as Slider
35
+ g as Slider
30
36
  };
@@ -1,38 +1,45 @@
1
+ "use client";
1
2
  import * as React from 'react';
2
3
  /**
3
- * Props for Spinner — an animated loading indicator rendered as an SVG circle with a `role="status"`
4
- * wrapper and a visually-hidden "Loading..." text for screen readers.
4
+ * Props for Spinner — an animated arc spinner with optional success (checkmark) and error (X)
5
+ * state transitions, powered by Framer Motion.
5
6
  *
6
- * **Sizes:** `sm` (icon-sm) | `md` (icon-md, default) | `lg` (icon-lg)
7
+ * **Sizes:** `sm` (16px) | `md` (20px, default) | `lg` (24px)
7
8
  *
8
- * **Accessibility:** The spinner renders `<span role="status"><svg>...</svg><span className="sr-only">Loading...</span></span>`.
9
- * You don't need to add `aria-label` the sr-only text is already present.
9
+ * **States:**
10
+ * - `spinning` (default): Rotating arc with Material Design-style pulse
11
+ * - `success`: Arc completes to filled green circle, white checkmark draws in
12
+ * - `error`: Arc completes to filled red circle, white X draws in
10
13
  *
11
- * **Note:** `<Button>` has built-in `loading` + `loadingPosition` — prefer that over composing manually.
14
+ * **Variants:**
15
+ * - `filled` (default): Semantic colored fill + white icon — for standalone contexts
16
+ * - `bare`: No fill, icon uses `currentColor` — for embedding in buttons, toolbars, etc.
12
17
  *
13
- * @example
14
- * // Inline loading indicator next to button text:
15
- * <div className="flex items-center gap-ds-03">
16
- * <Spinner size="sm" />
17
- * <span>Saving...</span>
18
- * </div>
19
- *
20
- * @example
21
- * // Full-page centered loading state:
22
- * <div className="flex h-screen items-center justify-center">
23
- * <Spinner size="lg" />
24
- * </div>
18
+ * **Accessibility:** `role="status"` with sr-only text that updates per state.
19
+ * Respects `prefers-reduced-motion` shows static icons with opacity crossfades.
25
20
  *
26
21
  * @example
27
- * // Spinner inside a card while data loads:
28
- * <Card className="flex items-center justify-center min-h-[120px]">
29
- * <Spinner />
30
- * </Card>
31
- * // These are just a few ways feel free to combine props creatively!
22
+ * <Spinner /> // basic arc spinner
23
+ * <Spinner size="sm" /> // small
24
+ * <Spinner state="success" /> // filled green circle + white check
25
+ * <Spinner state="success" variant="bare" /> // just the check, currentColor
26
+ * <Spinner state="error" /> // filled red circle + white X
27
+ * <Spinner delay={150} /> // no render until 150ms
28
+ * <Spinner state="success" onComplete={handleDone} /> // callback after animation
32
29
  */
33
- export interface SpinnerProps extends React.SVGAttributes<SVGSVGElement> {
30
+ export interface SpinnerProps {
31
+ /** sm | md | lg — maps to icon size tokens. Default: 'md' */
34
32
  size?: 'sm' | 'md' | 'lg';
33
+ /** Current state. Default: 'spinning' */
34
+ state?: 'spinning' | 'success' | 'error';
35
+ /** Visual variant for success/error states. Default: 'filled' */
36
+ variant?: 'filled' | 'bare';
37
+ /** Delay in ms before showing (avoids flicker). Default: 0 */
38
+ delay?: number;
39
+ /** Fires when success/error transition animation completes */
40
+ onComplete?: () => void;
41
+ className?: string;
35
42
  }
36
- declare const Spinner: React.ForwardRefExoticComponent<SpinnerProps & React.RefAttributes<SVGSVGElement>>;
43
+ declare const Spinner: React.ForwardRefExoticComponent<SpinnerProps & React.RefAttributes<HTMLSpanElement>>;
37
44
  export { Spinner };
38
45
  //# sourceMappingURL=spinner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../src/ui/spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAS9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,WAAW,YAAa,SAAQ,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC;IACtE,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;CAC1B;AAED,QAAA,MAAM,OAAO,oFA6BZ,CAAA;AAGD,OAAO,EAAE,OAAO,EAAE,CAAA"}
1
+ {"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../src/ui/spinner.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAoB9B;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,WAAW,YAAY;IAC3B,6DAA6D;IAC7D,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;IACzB,yCAAyC;IACzC,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAAA;IACxC,iEAAiE;IACjE,OAAO,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAA;IAC3B,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,8DAA8D;IAC9D,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAyBD,QAAA,MAAM,OAAO,sFAqOZ,CAAA;AAGD,OAAO,EAAE,OAAO,EAAE,CAAA"}
@@ -1,47 +1,206 @@
1
- import { jsxs as r, jsx as o } from "react/jsx-runtime";
2
- import * as a from "react";
3
- import { c } from "../_chunks/utils.js";
4
- const l = {
1
+ "use client";
2
+ import { jsxs as M, jsx as t } from "react/jsx-runtime";
3
+ import * as g from "react";
4
+ import { c as $ } from "../_chunks/utils.js";
5
+ import { u as C, m as l, A as L } from "../_chunks/motion.js";
6
+ const N = {
5
7
  sm: "h-ico-sm w-ico-sm",
6
8
  md: "h-ico-md w-ico-md",
7
9
  lg: "h-ico-lg w-ico-lg"
8
- }, t = a.forwardRef(
9
- ({ size: s = "md", className: e, ...i }, n) => /* @__PURE__ */ r("span", { role: "status", children: [
10
- /* @__PURE__ */ r(
11
- "svg",
12
- {
13
- ref: n,
14
- className: c("animate-spin motion-reduce:animate-none", l[s], e),
15
- viewBox: "0 0 24 24",
16
- fill: "none",
17
- xmlns: "http://www.w3.org/2000/svg",
18
- ...i,
19
- children: [
20
- /* @__PURE__ */ o(
21
- "circle",
22
- {
23
- cx: "12",
24
- cy: "12",
25
- r: "10",
26
- stroke: "var(--color-border-subtle)",
27
- strokeWidth: "4",
28
- fill: "none"
29
- }
30
- ),
31
- /* @__PURE__ */ o(
32
- "path",
33
- {
34
- d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z",
35
- fill: "var(--color-interactive)"
36
- }
37
- )
38
- ]
10
+ }, S = { sm: 3, md: 3, lg: 4 }, K = { sm: 1.8, md: 2, lg: 2.5 }, o = 10, e = 2 * Math.PI * o, T = {
11
+ spinning: "Loading...",
12
+ success: "Complete",
13
+ error: "Error"
14
+ }, F = {
15
+ spinning: "var(--color-accent-9)",
16
+ success: "var(--color-success-9)",
17
+ error: "var(--color-error-9)"
18
+ }, P = "M7 12.5l3 3 7-7", b = "M8 8l8 8M16 8l-8 8", j = "M5 12.5l4 4 10-10", U = "M6 6l12 12M18 6l-12 12", B = g.forwardRef(
19
+ ({ size: m = "md", state: n = "spinning", variant: O = "filled", delay: d = 0, onComplete: i, className: E }, I) => {
20
+ const a = C(), [_, x] = g.useState(d === 0);
21
+ if (g.useEffect(() => {
22
+ if (d <= 0) {
23
+ x(!0);
24
+ return;
39
25
  }
40
- ),
41
- /* @__PURE__ */ o("span", { className: "sr-only", children: "Loading..." })
42
- ] })
26
+ const W = setTimeout(() => x(!0), d);
27
+ return () => clearTimeout(W);
28
+ }, [d]), !_) return null;
29
+ const s = S[m], u = K[m], h = n === "spinning", c = n === "success" || n === "error", r = O === "filled", p = F[n], k = r ? "white" : "currentColor", A = r ? P : j, R = r ? b : U, y = 0.4, w = 0.3, v = 0.25, f = r ? 0.5 : 0.35, D = 0.35;
30
+ return /* @__PURE__ */ M("span", { ref: I, role: "status", className: $("inline-flex", E), children: [
31
+ /* @__PURE__ */ M(
32
+ "svg",
33
+ {
34
+ className: N[m],
35
+ viewBox: "0 0 24 24",
36
+ fill: "none",
37
+ xmlns: "http://www.w3.org/2000/svg",
38
+ children: [
39
+ a ? !(c && !r) && /* @__PURE__ */ t(
40
+ "circle",
41
+ {
42
+ cx: "12",
43
+ cy: "12",
44
+ r: o,
45
+ stroke: "var(--color-surface-border)",
46
+ strokeWidth: s,
47
+ fill: "none"
48
+ }
49
+ ) : /* @__PURE__ */ t(
50
+ l.circle,
51
+ {
52
+ cx: "12",
53
+ cy: "12",
54
+ r: o,
55
+ stroke: "var(--color-surface-border)",
56
+ strokeWidth: s,
57
+ fill: "none",
58
+ animate: { opacity: c && !r ? 0 : 1 },
59
+ transition: { duration: 0.2, delay: c && !r ? y : 0 }
60
+ }
61
+ ),
62
+ a ? /* @__PURE__ */ t(
63
+ "circle",
64
+ {
65
+ cx: "12",
66
+ cy: "12",
67
+ r: o,
68
+ stroke: p,
69
+ strokeWidth: s,
70
+ fill: "none",
71
+ strokeLinecap: "round",
72
+ strokeDasharray: h ? `${e * 0.75} ${e * 0.25}` : `${e} 0`,
73
+ style: {
74
+ transformOrigin: "center",
75
+ transform: h ? "rotate(-90deg)" : void 0,
76
+ opacity: c && !r ? 0 : 1
77
+ }
78
+ }
79
+ ) : /* @__PURE__ */ t(
80
+ l.circle,
81
+ {
82
+ cx: "12",
83
+ cy: "12",
84
+ r: o,
85
+ stroke: p,
86
+ strokeWidth: s,
87
+ fill: "none",
88
+ strokeLinecap: "round",
89
+ style: { transformOrigin: "center" },
90
+ animate: h ? {
91
+ rotate: [0, 360],
92
+ strokeDasharray: [
93
+ `${e * 0.1} ${e * 0.9}`,
94
+ `${e * 0.75} ${e * 0.25}`,
95
+ `${e * 0.1} ${e * 0.9}`
96
+ ]
97
+ } : {
98
+ rotate: 0,
99
+ strokeDasharray: `${e} 0`,
100
+ // In bare mode, fade out the arc after it completes
101
+ ...!r && { opacity: 0 }
102
+ },
103
+ transition: h ? {
104
+ rotate: { duration: 1, repeat: 1 / 0, ease: "linear" },
105
+ strokeDasharray: { duration: 1.5, repeat: 1 / 0, ease: "easeInOut" }
106
+ } : {
107
+ rotate: { duration: 0.3, ease: "easeOut" },
108
+ strokeDasharray: { duration: y, ease: "easeInOut" },
109
+ ...!r && { opacity: { duration: 0.2, delay: y } }
110
+ }
111
+ }
112
+ ),
113
+ /* @__PURE__ */ t(L, { children: c && r && (a ? /* @__PURE__ */ t(
114
+ "circle",
115
+ {
116
+ cx: "12",
117
+ cy: "12",
118
+ r: o + s / 2,
119
+ fill: p,
120
+ stroke: "none"
121
+ },
122
+ "fill-static"
123
+ ) : /* @__PURE__ */ t(
124
+ l.circle,
125
+ {
126
+ cx: "12",
127
+ cy: "12",
128
+ r: o + s / 2,
129
+ fill: p,
130
+ stroke: "none",
131
+ initial: { opacity: 0 },
132
+ animate: { opacity: 1 },
133
+ transition: { duration: v, delay: w, ease: "easeOut" },
134
+ style: { transformOrigin: "center" }
135
+ },
136
+ "fill"
137
+ )) }),
138
+ /* @__PURE__ */ t(L, { children: n === "success" && (a ? /* @__PURE__ */ t(
139
+ "path",
140
+ {
141
+ d: A,
142
+ stroke: k,
143
+ strokeWidth: u,
144
+ strokeLinecap: "round",
145
+ strokeLinejoin: "round",
146
+ fill: "none"
147
+ },
148
+ "check-static"
149
+ ) : /* @__PURE__ */ t(
150
+ l.path,
151
+ {
152
+ d: A,
153
+ stroke: k,
154
+ strokeWidth: u,
155
+ strokeLinecap: "round",
156
+ strokeLinejoin: "round",
157
+ fill: "none",
158
+ initial: { pathLength: 0, opacity: 0 },
159
+ animate: { pathLength: 1, opacity: 1 },
160
+ transition: {
161
+ pathLength: { duration: D, ease: "easeOut", delay: f },
162
+ opacity: { duration: 0.1, delay: f }
163
+ },
164
+ onAnimationComplete: () => i == null ? void 0 : i()
165
+ },
166
+ "check"
167
+ )) }),
168
+ /* @__PURE__ */ t(L, { children: n === "error" && (a ? /* @__PURE__ */ t(
169
+ "path",
170
+ {
171
+ d: R,
172
+ stroke: k,
173
+ strokeWidth: u,
174
+ strokeLinecap: "round",
175
+ fill: "none"
176
+ },
177
+ "x-static"
178
+ ) : /* @__PURE__ */ t(
179
+ l.path,
180
+ {
181
+ d: R,
182
+ stroke: k,
183
+ strokeWidth: u,
184
+ strokeLinecap: "round",
185
+ fill: "none",
186
+ initial: { pathLength: 0, opacity: 0 },
187
+ animate: { pathLength: 1, opacity: 1 },
188
+ transition: {
189
+ pathLength: { duration: D, ease: "easeOut", delay: f },
190
+ opacity: { duration: 0.1, delay: f }
191
+ },
192
+ onAnimationComplete: () => i == null ? void 0 : i()
193
+ },
194
+ "x"
195
+ )) })
196
+ ]
197
+ }
198
+ ),
199
+ /* @__PURE__ */ t("span", { className: "sr-only", children: T[n] })
200
+ ] });
201
+ }
43
202
  );
44
- t.displayName = "Spinner";
203
+ B.displayName = "Spinner";
45
204
  export {
46
- t as Spinner
205
+ B as Spinner
47
206
  };
@@ -1 +1 @@
1
- {"version":3,"file":"stat-card.d.ts","sourceRoot":"","sources":["../../src/ui/stat-card.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAM,WAAW,aAAc,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACzE,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,uDAAuD;IACvD,KAAK,CAAC,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