@devalok/shilp-sutra 0.17.2 → 0.18.1

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 (322) hide show
  1. package/dist/_chunks/framer.js +1376 -0
  2. package/dist/_chunks/link-context.js +19 -0
  3. package/dist/_chunks/motion-provider.js +24 -0
  4. package/dist/_chunks/primitives.js +3499 -3920
  5. package/dist/_chunks/tiptap.js +1 -1
  6. package/dist/_chunks/tree-view.js +183 -181
  7. package/dist/_chunks/use-calendar.js +531 -515
  8. package/dist/_chunks/vendor-client.js +1792 -1049
  9. package/dist/_chunks/vendor-utils.js +5123 -1169
  10. package/dist/composed/activity-feed.d.ts.map +1 -1
  11. package/dist/composed/activity-feed.js +75 -78
  12. package/dist/composed/avatar-group.js +33 -33
  13. package/dist/composed/command-palette.d.ts +1 -1
  14. package/dist/composed/command-palette.d.ts.map +1 -1
  15. package/dist/composed/command-palette.js +207 -158
  16. package/dist/composed/confirm-dialog.d.ts +3 -5
  17. package/dist/composed/confirm-dialog.d.ts.map +1 -1
  18. package/dist/composed/confirm-dialog.js +47 -42
  19. package/dist/composed/content-card.d.ts +1 -1
  20. package/dist/composed/content-card.js +30 -30
  21. package/dist/composed/date-picker/calendar-grid.d.ts +1 -1
  22. package/dist/composed/date-picker/calendar-grid.d.ts.map +1 -1
  23. package/dist/composed/date-picker/date-picker.d.ts +1 -1
  24. package/dist/composed/date-picker/date-picker.d.ts.map +1 -1
  25. package/dist/composed/date-picker/date-range-picker.d.ts +1 -1
  26. package/dist/composed/date-picker/date-range-picker.d.ts.map +1 -1
  27. package/dist/composed/date-picker/date-time-picker.d.ts +1 -1
  28. package/dist/composed/date-picker/date-time-picker.d.ts.map +1 -1
  29. package/dist/composed/date-picker/month-picker.d.ts +1 -1
  30. package/dist/composed/date-picker/month-picker.d.ts.map +1 -1
  31. package/dist/composed/date-picker/presets.d.ts +1 -1
  32. package/dist/composed/date-picker/presets.d.ts.map +1 -1
  33. package/dist/composed/date-picker/time-picker.d.ts +1 -1
  34. package/dist/composed/date-picker/time-picker.d.ts.map +1 -1
  35. package/dist/composed/date-picker/year-picker.d.ts +1 -1
  36. package/dist/composed/date-picker/year-picker.d.ts.map +1 -1
  37. package/dist/composed/empty-state.d.ts +1 -0
  38. package/dist/composed/empty-state.d.ts.map +1 -1
  39. package/dist/composed/empty-state.js +51 -47
  40. package/dist/composed/error-boundary.d.ts +1 -1
  41. package/dist/composed/error-boundary.d.ts.map +1 -1
  42. package/dist/composed/error-boundary.js +48 -48
  43. package/dist/composed/extensions/mention-suggestion.d.ts +1 -1
  44. package/dist/composed/extensions/mention-suggestion.d.ts.map +1 -1
  45. package/dist/composed/global-loading.d.ts +1 -1
  46. package/dist/composed/global-loading.d.ts.map +1 -1
  47. package/dist/composed/global-loading.js +22 -19
  48. package/dist/composed/index.d.ts +2 -4
  49. package/dist/composed/index.d.ts.map +1 -1
  50. package/dist/composed/index.js +26 -29
  51. package/dist/composed/lib/string-utils.d.ts +0 -1
  52. package/dist/composed/lib/string-utils.js +0 -1
  53. package/dist/composed/loading-skeleton.d.ts +1 -1
  54. package/dist/composed/loading-skeleton.d.ts.map +1 -1
  55. package/dist/composed/loading-skeleton.js +92 -87
  56. package/dist/composed/member-picker.d.ts +1 -1
  57. package/dist/composed/member-picker.d.ts.map +1 -1
  58. package/dist/composed/member-picker.js +47 -43
  59. package/dist/composed/page-header.js +36 -36
  60. package/dist/composed/page-skeletons.d.ts +9 -3
  61. package/dist/composed/page-skeletons.d.ts.map +1 -1
  62. package/dist/composed/page-skeletons.js +58 -58
  63. package/dist/composed/priority-indicator.js +24 -24
  64. package/dist/composed/rich-text-editor.d.ts +3 -3
  65. package/dist/composed/rich-text-editor.d.ts.map +1 -1
  66. package/dist/composed/rich-text-editor.js +317 -310
  67. package/dist/composed/schedule-view.js +84 -84
  68. package/dist/composed/simple-tooltip.d.ts +2 -5
  69. package/dist/composed/simple-tooltip.d.ts.map +1 -1
  70. package/dist/composed/simple-tooltip.js +19 -14
  71. package/dist/composed/status-badge.d.ts +2 -1
  72. package/dist/composed/status-badge.d.ts.map +1 -1
  73. package/dist/composed/status-badge.js +81 -68
  74. package/dist/hooks/index.d.ts +2 -1
  75. package/dist/hooks/index.d.ts.map +1 -1
  76. package/dist/hooks/index.js +3 -4
  77. package/dist/hooks/use-toast.d.ts +15 -45
  78. package/dist/hooks/use-toast.d.ts.map +1 -1
  79. package/dist/hooks/use-toast.js +2 -95
  80. package/dist/motion/index.d.ts +4 -0
  81. package/dist/motion/index.d.ts.map +1 -0
  82. package/dist/motion/index.js +12 -0
  83. package/dist/motion/motion-provider.d.ts +18 -0
  84. package/dist/motion/motion-provider.d.ts.map +1 -0
  85. package/dist/motion/primitives-index.d.ts +3 -0
  86. package/dist/motion/primitives-index.d.ts.map +1 -0
  87. package/dist/motion/primitives-index.js +187 -0
  88. package/dist/motion/primitives.d.ts +38 -0
  89. package/dist/motion/primitives.d.ts.map +1 -0
  90. package/dist/shell/app-command-palette.d.ts +14 -5
  91. package/dist/shell/app-command-palette.d.ts.map +1 -1
  92. package/dist/shell/app-command-palette.js +152 -130
  93. package/dist/shell/bottom-navbar.d.ts.map +1 -1
  94. package/dist/shell/bottom-navbar.js +90 -92
  95. package/dist/shell/command-registry.d.ts +23 -0
  96. package/dist/shell/command-registry.d.ts.map +1 -0
  97. package/dist/shell/command-registry.js +18 -0
  98. package/dist/shell/index.d.ts +2 -1
  99. package/dist/shell/index.d.ts.map +1 -1
  100. package/dist/shell/index.js +14 -11
  101. package/dist/shell/link-context.d.ts +6 -10
  102. package/dist/shell/link-context.d.ts.map +1 -1
  103. package/dist/shell/link-context.js +3 -16
  104. package/dist/shell/notification-center.d.ts.map +1 -1
  105. package/dist/shell/notification-center.js +129 -124
  106. package/dist/shell/notification-preferences.d.ts +10 -5
  107. package/dist/shell/notification-preferences.d.ts.map +1 -1
  108. package/dist/shell/notification-preferences.js +169 -165
  109. package/dist/shell/sidebar.js +104 -104
  110. package/dist/shell/top-bar.js +67 -67
  111. package/dist/tailwind/index.cjs +118 -297
  112. package/dist/tailwind/preset.d.ts.map +1 -1
  113. package/dist/tailwind/preset.js +118 -297
  114. package/dist/tokens/generate-scale.d.ts +86 -0
  115. package/dist/tokens/generate-scale.d.ts.map +1 -0
  116. package/dist/tokens/primitives.css +415 -187
  117. package/dist/tokens/semantic.css +244 -270
  118. package/dist/tokens/typography.css +6 -6
  119. package/dist/ui/accordion.d.ts.map +1 -1
  120. package/dist/ui/accordion.js +34 -24
  121. package/dist/ui/alert-dialog.d.ts +4 -1
  122. package/dist/ui/alert-dialog.d.ts.map +1 -1
  123. package/dist/ui/alert-dialog.js +115 -74
  124. package/dist/ui/alert.d.ts +6 -1
  125. package/dist/ui/alert.d.ts.map +1 -1
  126. package/dist/ui/alert.js +65 -50
  127. package/dist/ui/aspect-ratio.d.ts +2 -1
  128. package/dist/ui/aspect-ratio.d.ts.map +1 -1
  129. package/dist/ui/aspect-ratio.js +14 -4
  130. package/dist/ui/autocomplete.d.ts +11 -2
  131. package/dist/ui/autocomplete.d.ts.map +1 -1
  132. package/dist/ui/autocomplete.js +85 -60
  133. package/dist/ui/avatar.d.ts.map +1 -1
  134. package/dist/ui/avatar.js +46 -35
  135. package/dist/ui/badge.d.ts +1 -1
  136. package/dist/ui/badge.d.ts.map +1 -1
  137. package/dist/ui/badge.js +72 -67
  138. package/dist/ui/banner.d.ts.map +1 -1
  139. package/dist/ui/banner.js +54 -40
  140. package/dist/ui/breadcrumb.d.ts +2 -0
  141. package/dist/ui/breadcrumb.d.ts.map +1 -1
  142. package/dist/ui/breadcrumb.js +19 -19
  143. package/dist/ui/button-group.js +4 -4
  144. package/dist/ui/button.d.ts +10 -1
  145. package/dist/ui/button.d.ts.map +1 -1
  146. package/dist/ui/button.js +102 -66
  147. package/dist/ui/card.d.ts +2 -2
  148. package/dist/ui/card.d.ts.map +1 -1
  149. package/dist/ui/card.js +61 -53
  150. package/dist/ui/charts/_internal/animation.d.ts +1 -1
  151. package/dist/ui/charts/_internal/animation.d.ts.map +1 -1
  152. package/dist/ui/charts/area-chart.d.ts +3 -5
  153. package/dist/ui/charts/area-chart.d.ts.map +1 -1
  154. package/dist/ui/charts/bar-chart.d.ts +3 -5
  155. package/dist/ui/charts/bar-chart.d.ts.map +1 -1
  156. package/dist/ui/charts/chart-container.d.ts +2 -5
  157. package/dist/ui/charts/chart-container.d.ts.map +1 -1
  158. package/dist/ui/charts/gauge-chart.d.ts +3 -5
  159. package/dist/ui/charts/gauge-chart.d.ts.map +1 -1
  160. package/dist/ui/charts/index.js +1204 -1095
  161. package/dist/ui/charts/line-chart.d.ts +3 -5
  162. package/dist/ui/charts/line-chart.d.ts.map +1 -1
  163. package/dist/ui/charts/pie-chart.d.ts +2 -5
  164. package/dist/ui/charts/pie-chart.d.ts.map +1 -1
  165. package/dist/ui/charts/radar-chart.d.ts +3 -5
  166. package/dist/ui/charts/radar-chart.d.ts.map +1 -1
  167. package/dist/ui/charts/sparkline.d.ts +5 -5
  168. package/dist/ui/charts/sparkline.d.ts.map +1 -1
  169. package/dist/ui/checkbox.d.ts.map +1 -1
  170. package/dist/ui/checkbox.js +31 -19
  171. package/dist/ui/chip.d.ts +3 -2
  172. package/dist/ui/chip.d.ts.map +1 -1
  173. package/dist/ui/chip.js +58 -50
  174. package/dist/ui/code.js +16 -16
  175. package/dist/ui/collapsible.d.ts.map +1 -1
  176. package/dist/ui/collapsible.js +23 -15
  177. package/dist/ui/color-input.d.ts +1 -1
  178. package/dist/ui/color-input.d.ts.map +1 -1
  179. package/dist/ui/color-input.js +27 -27
  180. package/dist/ui/combobox.d.ts +2 -0
  181. package/dist/ui/combobox.d.ts.map +1 -1
  182. package/dist/ui/combobox.js +177 -166
  183. package/dist/ui/container.js +4 -4
  184. package/dist/ui/context-menu.d.ts +4 -2
  185. package/dist/ui/context-menu.d.ts.map +1 -1
  186. package/dist/ui/context-menu.js +147 -87
  187. package/dist/ui/data-table-toolbar.d.ts +3 -2
  188. package/dist/ui/data-table-toolbar.d.ts.map +1 -1
  189. package/dist/ui/data-table-toolbar.js +65 -63
  190. package/dist/ui/data-table.d.ts.map +1 -1
  191. package/dist/ui/data-table.js +275 -240
  192. package/dist/ui/dialog.d.ts +3 -1
  193. package/dist/ui/dialog.d.ts.map +1 -1
  194. package/dist/ui/dialog.js +114 -74
  195. package/dist/ui/dropdown-menu.d.ts +5 -3
  196. package/dist/ui/dropdown-menu.d.ts.map +1 -1
  197. package/dist/ui/dropdown-menu.js +151 -90
  198. package/dist/ui/file-upload.d.ts.map +1 -1
  199. package/dist/ui/file-upload.js +170 -128
  200. package/dist/ui/form.d.ts.map +1 -1
  201. package/dist/ui/form.js +30 -27
  202. package/dist/ui/hover-card.d.ts +1 -1
  203. package/dist/ui/hover-card.d.ts.map +1 -1
  204. package/dist/ui/hover-card.js +53 -21
  205. package/dist/ui/icon-button.js +9 -9
  206. package/dist/ui/index.d.ts +18 -18
  207. package/dist/ui/index.d.ts.map +1 -1
  208. package/dist/ui/index.js +322 -533
  209. package/dist/ui/input-otp.d.ts +2 -0
  210. package/dist/ui/input-otp.d.ts.map +1 -1
  211. package/dist/ui/input-otp.js +8 -8
  212. package/dist/ui/input.d.ts.map +1 -1
  213. package/dist/ui/input.js +35 -33
  214. package/dist/ui/label.js +12 -12
  215. package/dist/ui/lib/date-utils.d.ts +5 -0
  216. package/dist/ui/lib/date-utils.d.ts.map +1 -0
  217. package/dist/ui/lib/date-utils.js +12 -0
  218. package/dist/ui/lib/index.d.ts +7 -0
  219. package/dist/ui/lib/index.d.ts.map +1 -0
  220. package/dist/ui/lib/link-context.d.ts +13 -0
  221. package/dist/ui/lib/link-context.d.ts.map +1 -0
  222. package/dist/ui/lib/motion.d.ts +44 -9
  223. package/dist/ui/lib/motion.d.ts.map +1 -1
  224. package/dist/ui/lib/motion.js +34 -0
  225. package/dist/ui/lib/use-ripple.d.ts.map +1 -1
  226. package/dist/ui/lib/utils.js +1 -1
  227. package/dist/ui/link.js +11 -11
  228. package/dist/ui/menubar.d.ts +4 -2
  229. package/dist/ui/menubar.d.ts.map +1 -1
  230. package/dist/ui/menubar.js +142 -98
  231. package/dist/ui/navigation-menu.d.ts +2 -0
  232. package/dist/ui/navigation-menu.d.ts.map +1 -1
  233. package/dist/ui/navigation-menu.js +176 -73
  234. package/dist/ui/number-input.d.ts.map +1 -1
  235. package/dist/ui/number-input.js +58 -51
  236. package/dist/ui/pagination.js +23 -23
  237. package/dist/ui/popover.d.ts +2 -1
  238. package/dist/ui/popover.d.ts.map +1 -1
  239. package/dist/ui/popover.js +54 -22
  240. package/dist/ui/progress.d.ts.map +1 -1
  241. package/dist/ui/progress.js +58 -42
  242. package/dist/ui/radio.js +15 -15
  243. package/dist/ui/search-input.d.ts.map +1 -1
  244. package/dist/ui/search-input.js +28 -33
  245. package/dist/ui/segmented-control.d.ts +4 -2
  246. package/dist/ui/segmented-control.d.ts.map +1 -1
  247. package/dist/ui/segmented-control.js +146 -123
  248. package/dist/ui/select.d.ts.map +1 -1
  249. package/dist/ui/select.js +75 -64
  250. package/dist/ui/separator.js +12 -12
  251. package/dist/ui/sheet.d.ts +1 -1
  252. package/dist/ui/sheet.d.ts.map +1 -1
  253. package/dist/ui/sheet.js +111 -75
  254. package/dist/ui/sidebar.d.ts +6 -1
  255. package/dist/ui/sidebar.d.ts.map +1 -1
  256. package/dist/ui/sidebar.js +574 -36
  257. package/dist/ui/skeleton.js +2 -2
  258. package/dist/ui/slider.d.ts +9 -0
  259. package/dist/ui/slider.d.ts.map +1 -1
  260. package/dist/ui/slider.js +33 -27
  261. package/dist/ui/spinner.d.ts +32 -25
  262. package/dist/ui/spinner.d.ts.map +1 -1
  263. package/dist/ui/spinner.js +199 -40
  264. package/dist/ui/stack.js +1 -1
  265. package/dist/ui/stat-card.d.ts.map +1 -1
  266. package/dist/ui/stat-card.js +181 -114
  267. package/dist/ui/stepper.d.ts +23 -4
  268. package/dist/ui/stepper.d.ts.map +1 -1
  269. package/dist/ui/stepper.js +126 -48
  270. package/dist/ui/switch.d.ts.map +1 -1
  271. package/dist/ui/switch.js +39 -26
  272. package/dist/ui/table.d.ts +3 -0
  273. package/dist/ui/table.d.ts.map +1 -1
  274. package/dist/ui/table.js +29 -29
  275. package/dist/ui/tabs.d.ts +4 -1
  276. package/dist/ui/tabs.d.ts.map +1 -1
  277. package/dist/ui/tabs.js +94 -44
  278. package/dist/ui/text.d.ts +3 -3
  279. package/dist/ui/text.js +2 -2
  280. package/dist/ui/textarea.d.ts.map +1 -1
  281. package/dist/ui/textarea.js +27 -25
  282. package/dist/ui/toast-types.d.ts +43 -0
  283. package/dist/ui/toast-types.d.ts.map +1 -0
  284. package/dist/ui/toast-types.js +2 -0
  285. package/dist/ui/toast.d.ts +60 -26
  286. package/dist/ui/toast.d.ts.map +1 -1
  287. package/dist/ui/toast.js +535 -89
  288. package/dist/ui/toaster.d.ts +19 -23
  289. package/dist/ui/toaster.d.ts.map +1 -1
  290. package/dist/ui/toaster.js +31 -21
  291. package/dist/ui/toggle-group.d.ts +2 -2
  292. package/dist/ui/toggle-group.d.ts.map +1 -1
  293. package/dist/ui/toggle-group.js +29 -26
  294. package/dist/ui/toggle.d.ts +2 -2
  295. package/dist/ui/toggle.d.ts.map +1 -1
  296. package/dist/ui/toggle.js +21 -17
  297. package/dist/ui/tooltip.d.ts +2 -1
  298. package/dist/ui/tooltip.d.ts.map +1 -1
  299. package/dist/ui/tooltip.js +58 -21
  300. package/dist/ui/tree-view/tree-view.d.ts +1 -1
  301. package/dist/ui/tree-view/tree-view.d.ts.map +1 -1
  302. package/dist/ui/visually-hidden.js +3 -3
  303. package/llms-full.txt +3440 -1528
  304. package/llms.txt +67 -14
  305. package/package.json +50 -9
  306. package/dist/_chunks/avatar.js +0 -50
  307. package/dist/_chunks/button.js +0 -95
  308. package/dist/_chunks/checkbox.js +0 -14
  309. package/dist/_chunks/form.js +0 -27
  310. package/dist/_chunks/sidebar.js +0 -592
  311. package/dist/_chunks/spinner.js +0 -34
  312. package/dist/_chunks/switch.js +0 -10
  313. package/dist/_chunks/tooltip.js +0 -13
  314. package/dist/_chunks/utils.js +0 -17
  315. package/dist/composed/upload-progress.d.ts +0 -33
  316. package/dist/composed/upload-progress.d.ts.map +0 -1
  317. package/dist/composed/upload-progress.js +0 -386
  318. package/dist/ui/lib/use-reduced-motion.d.ts +0 -4
  319. package/dist/ui/lib/use-reduced-motion.d.ts.map +0 -1
  320. package/dist/ui/transitions.d.ts +0 -17
  321. package/dist/ui/transitions.d.ts.map +0 -1
  322. package/dist/ui/transitions.js +0 -111
package/llms.txt CHANGED
@@ -4,6 +4,35 @@
4
4
  > Built on the same primitives as shadcn/ui but with key API differences.
5
5
  > Read this file BEFORE writing any UI code. Do NOT guess from shadcn/ui knowledge.
6
6
 
7
+ ## BREAKING CHANGES (v0.18.0 — Framer Motion + OKLCH)
8
+
9
+ **New runtime dependency:** `framer-motion@^12.36.0` (bundled). Karm consumers must install `framer-motion@^12.0.0` as peer dep.
10
+
11
+ **Transitions removed:** `Fade`, `Collapse`, `Grow`, `Slide` from `./ui/transitions` no longer exist. Use `MotionFade`, `MotionCollapse`, `MotionSlide` from `@devalok/shilp-sutra/motion/primitives`.
12
+
13
+ **CSS keyframe animations removed:** 18 keyframes (`fade-in`, `fade-out`, `slide-up`, `scale-in`, etc.) and their `animate-*` utilities removed from Tailwind preset. Use motion primitives instead.
14
+
15
+ **`useReducedMotion()` removed:** Use `<MotionProvider reducedMotion="user">` at app root.
16
+
17
+ **New motion system:**
18
+ - `import { MotionProvider, springs, tweens } from '@devalok/shilp-sutra/motion'`
19
+ - `import { MotionFade, MotionCollapse, MotionSlide, MotionPop, MotionScale, MotionStagger } from '@devalok/shilp-sutra/motion/primitives'`
20
+ - Springs: `springs.snappy`, `springs.smooth`, `springs.bouncy`, `springs.gentle`
21
+ - Tweens: `tweens.fade`, `tweens.colorShift`
22
+
23
+ **Spinner v2:** New props `state?: 'spinning' | 'success' | 'error'`, `variant?: 'filled' | 'bare'`, `delay?: number`, `onComplete?: () => void`
24
+
25
+ **Button `onClickAsync`:** New prop `onClickAsync?: (e) => Promise<void>` — auto-manages loading → success/error → idle states. `asyncFeedbackDuration?: number` (default 1500ms).
26
+
27
+ **Server safety changes:** EmptyState, StatusBadge, Spinner are NO LONGER server-safe (they now use Framer Motion). Remove from RSC imports.
28
+
29
+ **Build:** `framer-motion` and `sonner` moved from `dependencies` to `devDependencies` (bundled at build time — no consumer install needed for core, but karm consumers must install `framer-motion` as peer dep).
30
+
31
+ **New APIs in v0.18.0:**
32
+ - Combobox: `accessibleLabel?: string` — custom aria-label for trigger (falls back to placeholder)
33
+ - Slider: multi-thumb support — pass array `defaultValue={[25, 75]}` for range sliders
34
+ - StreamingText (karm): `isComplete?: boolean` — debounces aria-live, announces only on completion
35
+
7
36
  ## CHANGES (v0.16.0)
8
37
  - **DataTable server-side features**: `onSort` callback (manual sorting), `pagination` prop (server-side pagination with page/total/onPageChange), `selectedIds` + `selectableFilter` (controlled selection), `loading` shimmer, `emptyState` ReactNode, `singleExpand`, `stickyHeader`, `onRowClick`, `bulkActions` floating bar
9
38
  - **ActivityFeed**: New composed component — `@devalok/shilp-sutra/composed/activity-feed` — vertical timeline with colored dots, actor avatars, expandable detail, compact mode, load more
@@ -44,6 +73,18 @@
44
73
  - StatusBadge: Pass either `status` OR `color`, not both (discriminated union).
45
74
  - Input/Textarea: Now auto-inherit state, aria-describedby, aria-required from FormField context. Explicit props override.
46
75
 
76
+ ## BREAKING CHANGES (v0.18.0 — OKLCH token migration, continued)
77
+ - All color primitives migrated from hex (50-950 shades) to OKLCH (12 functional steps)
78
+ - Old shade numbers: --pink-50..950. New step numbers: --pink-1..12 (OKLCH values)
79
+ - Step purposes: 1=app-bg, 2=subtle-bg, 3=component-bg, 4=hover, 5=active, 6=border-subtle, 7=border, 8=border-strong, 9=solid/accent, 10=solid-hover, 11=lo-contrast-text, 12=hi-contrast-text
80
+ - New semantic tokens: --color-accent-{1-12}, --color-secondary-{1-12}, --color-surface-{1-4}, --color-surface-fg/fg-muted/fg-subtle/border
81
+ - Status tokens: --color-error-{3,7,9,11,fg}, --color-success-{3,7,9,11,fg}, --color-warning-{3,7,9,11,fg}, --color-info-{3,7,9,11,fg}
82
+ - New Tailwind utilities: accent-1..12, secondary-1..12, surface-1..4, status/category step utilities
83
+ - Backward compat: ALL old semantic token names preserved as aliases. --color-interactive still works → maps to --color-accent-9
84
+ - Consumer rebranding: override --color-accent-1..12 CSS vars OR use generateScale() utility with a seed color
85
+ - Dark mode: algorithmically derived (OKLCH curves), NOT hex overrides. Surfaces lighten with elevation.
86
+ - If you reference --pink-500 etc directly, migrate: 50→1, 100→2, 200→3, 300→4, 400→5, 500→7, 600→8, 700→9, 800→10, 900→11, 950→12
87
+
47
88
  ## Install & Setup
48
89
 
49
90
  pnpm add @devalok/shilp-sutra
@@ -63,8 +104,10 @@ import { Button } from '@devalok/shilp-sutra/ui/button'
63
104
  import { PageHeader } from '@devalok/shilp-sutra/composed/page-header'
64
105
  import { TopBar } from '@devalok/shilp-sutra/shell/top-bar'
65
106
 
107
+ // Toast (imperative, no hook needed):
108
+ import { toast } from '@devalok/shilp-sutra/ui/toast'
109
+
66
110
  // Hooks:
67
- import { useToast } from '@devalok/shilp-sutra/hooks/use-toast'
68
111
  import { useColorMode } from '@devalok/shilp-sutra/hooks/use-color-mode'
69
112
 
70
113
  // CSS tokens (import once at app root):
@@ -83,7 +126,7 @@ If you have shadcn/ui knowledge, these are the differences that WILL trip you up
83
126
  | size="default" | size="md" | All sizes: sm, md, lg (never "default") |
84
127
  | <Select size="lg"> | <SelectTrigger size="lg"> | Size goes on trigger, NOT root |
85
128
  | <Chip>text</Chip> | <Chip label="text" /> | Chip uses label prop, NOT children |
86
- | Toast variant="destructive" | Toast color="error" | Toast uses color= not variant= |
129
+ | useToast() + toast({ variant }) | toast.success('msg') | Imperative API, no hook needed |
87
130
  | Badge variant="destructive" | Badge variant="solid" color="error" | Two-axis: variant + color |
88
131
  | Alert + AlertTitle + AlertDescription | <Alert title="..." color="error"> | Single component, not compound |
89
132
  | Form + FormField + FormItem + FormLabel + FormControl + FormDescription + FormMessage | FormField + Label + Input + FormHelperText + useFormField() | Simpler API, hook-based a11y wiring |
@@ -101,7 +144,7 @@ Examples:
101
144
  <Badge variant="solid" color="success">Active</Badge> // green solid badge
102
145
  <Alert variant="filled" color="warning">Warning!</Alert> // yellow filled alert
103
146
 
104
- Components with two-axis system: Button, Badge, Alert, Chip, Toast, Banner, Progress, StatusBadge
147
+ Components with two-axis system: Button, Badge, Alert, Chip, Banner, Progress, StatusBadge
105
148
 
106
149
  ## Component Quick Reference
107
150
 
@@ -125,14 +168,14 @@ Components with two-axis system: Button, Badge, Alert, Chip, Toast, Banner, Prog
125
168
  ### Feedback & Notifications
126
169
  - Alert: variant(subtle|filled|outline) color(info|success|warning|error|neutral) + title, onDismiss
127
170
  - Banner: color(info|success|warning|error|neutral) + title, onDismiss
128
- - Toast: color(neutral|success|warning|error|info) — REQUIRES <Toaster> at layout root + useToast()
171
+ - Toast: imperative API via toast.success/error/warning/info/loading/message/undo/promise/upload/custom — REQUIRES <Toaster> at layout root
129
172
  - Spinner: size(sm|md|lg) — renders with role="status"
130
173
  - Progress: track size(sm|md|lg), indicator color(default|success|warning|error)
131
174
 
132
175
  NOTIFICATION SELECTION GUIDE:
133
176
  - Alert: inline contextual feedback within a form or page section
134
177
  - Banner: persistent page-level notification above content
135
- - Toast: transient notification triggered by user action (needs Toaster + useToast)
178
+ - Toast: transient notification triggered by user action (needs <Toaster>, then call toast.success() etc.)
136
179
 
137
180
  ### Data Display
138
181
  - Badge: variant(subtle|solid|outline) color(default|info|success|error|warning|brand|accent + 7 category colors) size(xs|sm|md|lg) + onDismiss
@@ -192,8 +235,8 @@ NOTIFICATION SELECTION GUIDE:
192
235
  - MonthPicker: month grid — currentYear, selectedMonth(0-11), onMonthSelect, minDate, maxDate
193
236
  - Presets: date range quick-select buttons — presets(PresetKey[]), onSelect(start, end). Keys: today, yesterday, last7days, last30days, thisMonth, lastMonth, thisYear
194
237
  - useCalendar: hook for calendar month state — returns currentMonth, goToPreviousMonth, goToNextMonth, goToMonth, goToYear
195
- - UploadProgress: file upload tracker files(UploadFile[]), onRemove, onRetry, onDismissAll, variant(default|compact), showSize. Status: pending|uploading|processing|complete|error. Also exports formatFileSize()
196
- - RichTextEditor: Tiptap editor — bold/italic/underline/strike/highlight, headings, blockquote, lists (bullet/ordered/task), code, links, images (paste/drop/upload), file attachments, @mentions, emoji picker + :shortcode:, text alignment, HR. Props: onImageUpload?, onFileUpload?, mentions?, onMentionSearch?, onMentionSelect?
238
+ - (UploadProgress REMOVEDupload tracking is now built into toast.upload())
239
+ - RichTextEditor: Tiptap editor — bold/italic/underline/strike/highlight, headings, blockquote, lists (bullet/ordered/task), code, links, images (paste/drop/upload), file attachments, @mentions, emoji picker + :shortcode:, text alignment, HR. Props: onImageUpload?, onFileUpload?, mentions?, onMentionSearch?, onMentionSelect?(item: MentionItem)
197
240
  - RichTextViewer: read-only renderer for RichTextEditor HTML content (renders all above content types)
198
241
  - ActivityFeed: items(ActivityItem[]), onLoadMore, loading, hasMore, emptyState, compact, maxInitialItems. Type: ActivityItem = { id, actor?, action, timestamp, icon?, color?, detail? }
199
242
  - CommandPalette, MemberPicker
@@ -221,11 +264,21 @@ NOTIFICATION SELECTION GUIDE:
221
264
  - AppCommandPalette: user, isAdmin, onNavigate, onSearch, searchResults, isSearching, onSearchResultSelect. Types: SearchResult = { id, title, snippet?, entityType, projectId?, metadata? }, AppCommandPaletteUser = { name, role? }
222
265
  - LinkProvider: wraps app with router-agnostic Link component — component(ForwardRefComponent), children. useLink() hook returns the Link component.
223
266
 
224
- ### Motion Tokens
225
- - motion(category, mode) => CSS cubic-bezier string. duration(token) => CSS duration string. easings: Record<MotionMode, Record<MotionCategory, string>>. durations: Record<DurationToken, string> = { instant: '0ms', fast-01: '70ms', fast-02: '110ms', moderate-01: '150ms', moderate-02: '240ms', slow-01: '400ms', slow-02: '700ms' }
267
+ ### Motion System (Framer Motion)
268
+ - Setup: Wrap app root with `<MotionProvider>` from `@devalok/shilp-sutra/motion`. Handles reduced-motion detection globally.
269
+ - Import presets: `import { springs, tweens, stagger } from '@devalok/shilp-sutra/motion'`
270
+ - Import primitives: `import { MotionFade, MotionScale, MotionPop, MotionSlide, MotionCollapse, MotionStagger, MotionStaggerItem } from '@devalok/shilp-sutra/motion/primitives'`
271
+ - Spring presets (spatial: position, scale, size): snappy (buttons/hover), smooth (dialogs/panels), bouncy (toasts/pop-ins), gentle (collapse/expand)
272
+ - Tween presets (non-spatial: opacity, color): fade (opacity enter/exit), colorShift (hover color/bg)
273
+ - All primitives take `show: boolean` to control mount/unmount via AnimatePresence
274
+ - MotionSlide: additional `direction` prop (up|down|left|right)
275
+ - MotionStagger + MotionStaggerItem: orchestrated stagger with configurable `delay` (default 0.04s)
276
+ - All primitives support `layout`, `layoutId`, `whileInView`, `viewportOnce`, `preset` props
277
+ - useMotion() hook returns { springs, tweens, reducedMotion: boolean }
278
+ - Old Fade/Collapse/Grow/Slide from @devalok/shilp-sutra/ui/transitions are REMOVED — use Motion* equivalents
226
279
 
227
280
  ### Hooks
228
- - useToast(): returns { toast, toasts, dismiss } toast({ title, description, color }). Also: import { toast } from '@devalok/shilp-sutra/hooks/use-toast' for imperative usage without hook
281
+ - toast: imperative API — import { toast } from '@devalok/shilp-sutra/ui/toast'. Methods: toast.success/error/warning/info/loading/message/undo/promise/upload/custom/dismiss. useToast() is deprecated.
229
282
  - useColorMode(): returns { colorMode, setColorMode, toggleColorMode }
230
283
  - useMobile(): returns boolean (true if viewport < 768px)
231
284
  - useLink(): returns router-agnostic Link component from LinkProvider context (shell/link-context)
@@ -233,8 +286,8 @@ NOTIFICATION SELECTION GUIDE:
233
286
  ## Server-Safe Components (no "use client")
234
287
 
235
288
  These can be imported directly in Next.js Server Components:
236
- - UI: Text, Skeleton, Spinner, Stack, Container, Table (and sub-components), Code, VisuallyHidden
237
- - Composed: ContentCard, EmptyState, PageHeader, LoadingSkeleton, PageSkeletons, PriorityIndicator, StatusBadge
289
+ - UI: Text, Skeleton, Stack, Container, Table (and sub-components), Code, VisuallyHidden
290
+ - Composed: ContentCard, PageHeader, LoadingSkeleton, PageSkeletons, PriorityIndicator
238
291
 
239
292
  Use per-component imports for server components:
240
293
  import { Text } from '@devalok/shilp-sutra/ui/text'
@@ -248,8 +301,8 @@ DO NOT use barrel imports in Server Components — they include "use client" com
248
301
  - DO NOT use size="default" — use size="md" (or sm, lg)
249
302
  - DO NOT put size on <Select> — put it on <SelectTrigger size="md">
250
303
  - DO NOT use <Chip>text</Chip> — use <Chip label="text" />
251
- - DO NOT use <Toast variant="..."> — use <Toast color="error">
252
- - DO NOT use color="danger" — use color="error"
304
+ - DO NOT use useToast() hook — use import { toast } from '@devalok/shilp-sutra/ui/toast' (imperative)
305
+ - DO NOT use toast({ title, color }) object syntax — use toast.success('message'), toast.error('message'), etc.
253
306
  - DO NOT call toast() without <Toaster /> mounted at your layout root
254
307
  - DO NOT use <Alert><AlertTitle>...</AlertTitle></Alert> — use <Alert title="..." />
255
308
  - DO NOT import from barrel in Next.js Server Components — use per-component imports
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devalok/shilp-sutra",
3
- "version": "0.17.2",
3
+ "version": "0.18.1",
4
4
  "description": "Devalok Design System — tokens, components, and patterns for Next.js",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -308,6 +308,11 @@
308
308
  "default": "./dist/ui/toast.js",
309
309
  "types": "./dist/ui/toast.d.ts"
310
310
  },
311
+ "./ui/toast-types": {
312
+ "import": "./dist/ui/toast-types.js",
313
+ "default": "./dist/ui/toast-types.js",
314
+ "types": "./dist/ui/toast-types.d.ts"
315
+ },
311
316
  "./ui/toaster": {
312
317
  "import": "./dist/ui/toaster.js",
313
318
  "default": "./dist/ui/toaster.js",
@@ -328,11 +333,6 @@
328
333
  "default": "./dist/ui/tooltip.js",
329
334
  "types": "./dist/ui/tooltip.d.ts"
330
335
  },
331
- "./ui/transitions": {
332
- "import": "./dist/ui/transitions.js",
333
- "default": "./dist/ui/transitions.js",
334
- "types": "./dist/ui/transitions.d.ts"
335
- },
336
336
  "./ui/visually-hidden": {
337
337
  "import": "./dist/ui/visually-hidden.js",
338
338
  "default": "./dist/ui/visually-hidden.js",
@@ -353,6 +353,11 @@
353
353
  "default": "./dist/composed/index.js",
354
354
  "types": "./dist/composed/index.d.ts"
355
355
  },
356
+ "./composed/activity-feed": {
357
+ "import": "./dist/composed/activity-feed.js",
358
+ "default": "./dist/composed/activity-feed.js",
359
+ "types": "./dist/composed/activity-feed.d.ts"
360
+ },
356
361
  "./composed/avatar-group": {
357
362
  "import": "./dist/composed/avatar-group.js",
358
363
  "default": "./dist/composed/avatar-group.js",
@@ -478,6 +483,11 @@
478
483
  "default": "./dist/shell/top-bar.js",
479
484
  "types": "./dist/shell/top-bar.d.ts"
480
485
  },
486
+ "./shell/command-registry": {
487
+ "import": "./dist/shell/command-registry.js",
488
+ "default": "./dist/shell/command-registry.js",
489
+ "types": "./dist/shell/command-registry.d.ts"
490
+ },
481
491
  "./hooks": {
482
492
  "import": "./dist/hooks/index.js",
483
493
  "default": "./dist/hooks/index.js",
@@ -504,6 +514,12 @@
504
514
  "default": "./dist/tailwind/index.js",
505
515
  "types": "./dist/tailwind/index.d.ts"
506
516
  },
517
+ "./tailwind/preset": {
518
+ "require": "./dist/tailwind/index.cjs",
519
+ "import": "./dist/tailwind/preset.js",
520
+ "default": "./dist/tailwind/preset.js",
521
+ "types": "./dist/tailwind/preset.d.ts"
522
+ },
507
523
  "./utils": {
508
524
  "import": "./dist/ui/lib/utils.js",
509
525
  "default": "./dist/ui/lib/utils.js",
@@ -515,10 +531,30 @@
515
531
  "default": "./dist/ui/lib/utils.js",
516
532
  "types": "./dist/ui/lib/utils.d.ts"
517
533
  },
534
+ "./ui/lib/motion": {
535
+ "import": "./dist/ui/lib/motion.js",
536
+ "default": "./dist/ui/lib/motion.js",
537
+ "types": "./dist/ui/lib/motion.d.ts"
538
+ },
539
+ "./ui/lib/date-utils": {
540
+ "import": "./dist/ui/lib/date-utils.js",
541
+ "default": "./dist/ui/lib/date-utils.js",
542
+ "types": "./dist/ui/lib/date-utils.d.ts"
543
+ },
518
544
  "./composed/lib/string-utils": {
519
545
  "import": "./dist/composed/lib/string-utils.js",
520
546
  "default": "./dist/composed/lib/string-utils.js",
521
547
  "types": "./dist/composed/lib/string-utils.d.ts"
548
+ },
549
+ "./motion": {
550
+ "import": "./dist/motion/index.js",
551
+ "default": "./dist/motion/index.js",
552
+ "types": "./dist/motion/index.d.ts"
553
+ },
554
+ "./motion/primitives": {
555
+ "import": "./dist/motion/primitives-index.js",
556
+ "default": "./dist/motion/primitives-index.js",
557
+ "types": "./dist/motion/primitives-index.d.ts"
522
558
  }
523
559
  },
524
560
  "files": [
@@ -529,8 +565,10 @@
529
565
  "llms-full.txt"
530
566
  ],
531
567
  "scripts": {
532
- "build": "vite build && pnpm build:tokens && node scripts/fix-dts-primitives.mjs && node scripts/inject-use-client.mjs && node scripts/build-tailwind-cjs.mjs",
568
+ "build": "vite build && pnpm build:tokens && node scripts/fix-dts-primitives.mjs && node scripts/inject-use-client.mjs && node scripts/build-tailwind-cjs.mjs && pnpm build:docs",
533
569
  "build:tokens": "node scripts/copy-tokens.mjs",
570
+ "build:docs": "node scripts/build-component-docs.mjs",
571
+ "build:docs:check": "node scripts/build-component-docs.mjs --check",
534
572
  "typecheck": "tsc --noEmit",
535
573
  "lint": "eslint src/",
536
574
  "test": "vitest run",
@@ -647,10 +685,13 @@
647
685
  "input-otp": "^1.4.2",
648
686
  "react-markdown": "^10.1.0",
649
687
  "react-remove-scroll": "^2.6.3",
650
- "tailwind-merge": "^3.0.1"
688
+ "tailwind-merge": "^3.0.1",
689
+ "framer-motion": "^12.36.0",
690
+ "sonner": "^2.0.7"
651
691
  },
652
692
  "engines": {
653
693
  "node": ">=20.0.0"
654
694
  },
655
- "packageManager": "pnpm@10.0.0"
695
+ "packageManager": "pnpm@10.0.0",
696
+ "dependencies": {}
656
697
  }
@@ -1,50 +0,0 @@
1
- "use client";
2
- import { jsxs as p, jsx as l } from "react/jsx-runtime";
3
- import * as i from "react";
4
- import { R as n, I as o, F as t } from "./primitives.js";
5
- import { e as u } from "./vendor-utils.js";
6
- import { c as r } from "./utils.js";
7
- const h = u("relative flex shrink-0 overflow-hidden", {
8
- variants: {
9
- size: {
10
- xs: "h-ds-xs w-ds-xs",
11
- sm: "h-ds-sm w-ds-sm",
12
- md: "h-ds-md w-ds-md",
13
- lg: "h-ds-lg w-ds-lg",
14
- xl: "h-ds-xl w-ds-xl"
15
- },
16
- shape: {
17
- circle: "rounded-ds-full",
18
- square: "rounded-ds-none",
19
- rounded: "rounded-ds-md"
20
- }
21
- },
22
- defaultVariants: { size: "md", shape: "circle" }
23
- }), w = {
24
- online: "bg-success",
25
- offline: "bg-layer-03",
26
- busy: "bg-error",
27
- away: "bg-warning"
28
- }, x = {
29
- online: "Online",
30
- offline: "Offline",
31
- busy: "Busy",
32
- away: "Away"
33
- }, b = {
34
- xs: "h-ds-02b w-ds-02b",
35
- sm: "h-[8px] w-[8px]",
36
- md: "h-ds-03 w-ds-03",
37
- lg: "h-[12px] w-[12px]",
38
- xl: "h-ds-04 w-ds-04"
39
- }, g = i.forwardRef(({ className: a, size: s, shape: e, status: d, children: m, ...f }, c) => p("span", { className: "relative inline-flex shrink-0", children: [l(n, { ref: c, className: r(h({ size: s, shape: e }), a), ...f, children: m }), d && l("span", { className: r("absolute bottom-0 right-0 rounded-ds-full ring-2 ring-layer-01", w[d], b[s ?? "md"]), role: "img", "aria-label": x[d] })] }));
40
- g.displayName = n.displayName;
41
- const y = i.forwardRef(({ className: a, ...s }, e) => l(o, { ref: e, className: r("aspect-square h-full w-full", a), ...s }));
42
- y.displayName = o.displayName;
43
- const v = i.forwardRef(({ className: a, ...s }, e) => l(t, { ref: e, className: r("flex h-full w-full items-center justify-center rounded-ds-full bg-interactive-subtle text-interactive", a), ...s }));
44
- v.displayName = t.displayName;
45
- export {
46
- g as A,
47
- y as a,
48
- v as b,
49
- h as c
50
- };
@@ -1,95 +0,0 @@
1
- "use client";
2
- import { jsx as r, jsxs as x } from "react/jsx-runtime";
3
- import { e as V } from "./vendor-utils.js";
4
- import { S as R, a as E } from "./primitives.js";
5
- import * as G from "react";
6
- import { u as M, S as q } from "./spinner.js";
7
- import { c as s } from "./utils.js";
8
- const p = V("inline-flex items-center justify-center gap-ds-03 whitespace-nowrap font-sans font-semibold select-none border border-transparent transition-[color,background-color,border-color,box-shadow,transform] duration-fast-01 ease-productive-standard active:translate-y-px 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]", {
9
- variants: {
10
- variant: {
11
- solid: "",
12
- default: "",
13
- // alias → solid
14
- outline: "",
15
- ghost: "",
16
- destructive: "",
17
- // alias → solid + error
18
- link: "text-text-link underline-offset-4 hover:underline active:opacity-[0.8]"
19
- },
20
- color: {
21
- default: "",
22
- error: ""
23
- },
24
- size: {
25
- sm: "h-ds-sm rounded-ds-md px-ds-04 text-ds-sm",
26
- md: "h-ds-md rounded-ds-md px-ds-05 text-ds-md",
27
- lg: "h-ds-lg rounded-ds-lg px-ds-06 text-ds-base",
28
- icon: "h-ds-md w-ds-md rounded-ds-md",
29
- // alias → icon-md
30
- "icon-sm": "h-ds-sm w-ds-sm rounded-ds-md",
31
- "icon-md": "h-ds-md w-ds-md rounded-ds-md",
32
- "icon-lg": "h-ds-lg w-ds-lg rounded-ds-lg"
33
- }
34
- },
35
- compoundVariants: [
36
- // solid + default (primary)
37
- { variant: "solid", color: "default", className: "bg-interactive text-text-on-color hover:bg-interactive-hover active:bg-interactive-active shadow-01 hover:shadow-brand" },
38
- // "default" alias → same as solid + default
39
- { variant: "default", color: "default", className: "bg-interactive text-text-on-color hover:bg-interactive-hover active:bg-interactive-active shadow-01 hover:shadow-brand" },
40
- { variant: "default", color: "error", className: "bg-error text-text-on-color hover:bg-error-hover active:bg-error-hover shadow-01" },
41
- // "destructive" alias → solid + error
42
- { variant: "destructive", color: "default", className: "bg-error text-text-on-color hover:bg-error-hover active:bg-error-hover shadow-01" },
43
- { variant: "destructive", color: "error", className: "bg-error text-text-on-color hover:bg-error-hover active:bg-error-hover shadow-01" },
44
- // solid + error
45
- { variant: "solid", color: "error", className: "bg-error text-text-on-color hover:bg-error-hover active:bg-error-hover shadow-01" },
46
- // outline + default (secondary)
47
- { variant: "outline", color: "default", className: "bg-transparent text-interactive border-border-interactive hover:bg-interactive-subtle active:bg-layer-active" },
48
- // outline + error (error-ghost)
49
- { variant: "outline", color: "error", className: "bg-transparent text-error border border-border-error hover:bg-error-surface active:bg-error-surface" },
50
- // ghost + default
51
- { variant: "ghost", color: "default", className: "bg-transparent text-text-secondary hover:bg-layer-02 hover:text-text-primary active:bg-layer-active" },
52
- // ghost + error
53
- { variant: "ghost", color: "error", className: "bg-transparent text-error hover:bg-error-surface hover:text-error active:bg-error-surface" }
54
- ],
55
- defaultVariants: {
56
- variant: "solid",
57
- color: "default",
58
- size: "md"
59
- }
60
- }), A = {
61
- sm: "h-ico-sm w-ico-sm [&>svg]:h-ico-sm [&>svg]:w-ico-sm",
62
- md: "h-ico-sm w-ico-sm [&>svg]:h-ico-sm [&>svg]:w-ico-sm",
63
- lg: "h-ico-md w-ico-md [&>svg]:h-ico-md [&>svg]:w-ico-md",
64
- icon: "h-ico-sm w-ico-sm [&>svg]:h-ico-sm [&>svg]:w-ico-sm",
65
- "icon-sm": "h-ico-sm w-ico-sm [&>svg]:h-ico-sm [&>svg]:w-ico-sm",
66
- "icon-md": "h-ico-sm w-ico-sm [&>svg]:h-ico-sm [&>svg]:w-ico-sm",
67
- "icon-lg": "h-ico-md w-ico-md [&>svg]:h-ico-md [&>svg]:w-ico-md"
68
- }, D = {
69
- sm: "sm",
70
- md: "sm",
71
- lg: "md",
72
- icon: "sm",
73
- "icon-sm": "sm",
74
- "icon-md": "sm",
75
- "icon-lg": "md"
76
- }, F = G.forwardRef(({ className: c, variant: w, color: N, size: y, asChild: S = !1, startIcon: d, endIcon: l, loading: e = !1, loadingPosition: t = "start", fullWidth: m = !1, disabled: v, children: a, ...u }, h) => {
77
- const i = M(), b = w ?? i.variant, f = N ?? i.color, o = y ?? i.size ?? "md", g = A[o], z = D[o], n = e ? r(q, { size: z }) : null;
78
- if (S) {
79
- const C = {
80
- className: s(p({ variant: b, color: f, size: o }), m && "w-full", c),
81
- ref: h,
82
- disabled: v || e,
83
- "aria-busy": e || void 0,
84
- ...u
85
- };
86
- return r(R, { ...C, children: r(E, { children: a }) });
87
- }
88
- const j = () => e && t === "start" ? n : d ? r("span", { className: s("inline-flex shrink-0 items-center justify-center", g), children: d }) : null, k = () => e && t === "end" ? n : l ? r("span", { className: s("inline-flex shrink-0 items-center justify-center", g), children: l }) : null, B = () => e && t === "center" ? x("span", { className: "relative inline-flex items-center justify-center", children: [r("span", { className: "invisible", children: a }), r("span", { className: "absolute inset-0 flex items-center justify-center", children: n })] }) : a;
89
- return x("button", { className: s(p({ variant: b, color: f, size: o }), m && "w-full", c), ref: h, disabled: v || e, "aria-busy": e || void 0, ...u, children: [j(), B(), k()] });
90
- });
91
- F.displayName = "Button";
92
- export {
93
- F as B,
94
- p as b
95
- };
@@ -1,14 +0,0 @@
1
- "use client";
2
- import { jsx as e } from "react/jsx-runtime";
3
- import { C as r, b as d } from "./primitives.js";
4
- import { IconMinus as m, IconCheck as l } from "@tabler/icons-react";
5
- import * as f from "react";
6
- import { c as b } from "./utils.js";
7
- const h = f.forwardRef(({ className: i, error: o, indeterminate: a, checked: c, ...s }, n) => {
8
- const t = a ? "indeterminate" : c;
9
- return e(r, { ref: n, checked: t, className: b("peer flex items-center justify-center h-ico-md w-ico-md shrink-0 rounded-ds-sm", "border border-border-strong", "bg-field", "transition-colors duration-fast-01", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2", "disabled:cursor-not-allowed disabled:opacity-[0.38]", "data-[state=checked]:bg-interactive data-[state=checked]:border-interactive data-[state=checked]:text-text-on-color", "data-[state=indeterminate]:bg-interactive data-[state=indeterminate]:border-interactive data-[state=indeterminate]:text-text-on-color", o && "border-border-error", i), ...s, children: e(d, { className: "flex items-center justify-center text-current animate-check-pop", children: t === "indeterminate" ? e(m, { className: "h-ico-sm w-ico-sm" }) : e(l, { className: "h-3 w-3" }) }) });
10
- });
11
- h.displayName = r.displayName;
12
- export {
13
- h as C
14
- };
@@ -1,27 +0,0 @@
1
- "use client";
2
- import { jsx as c } from "react/jsx-runtime";
3
- import * as e from "react";
4
- import { c as i } from "./utils.js";
5
- const x = e.createContext({}), m = e.forwardRef(({ className: s, helperTextId: o, state: a = "helper", required: l, children: n, ...t }, r) => {
6
- const d = e.useId(), p = o || `${d}-helper`;
7
- return c(x.Provider, { value: { state: a, helperTextId: p, required: l }, children: c("div", { ref: r, className: i("flex flex-col gap-ds-02", s), ...t, children: n }) });
8
- });
9
- m.displayName = "FormField";
10
- const u = {
11
- helper: "text-text-helper",
12
- error: "text-text-error",
13
- warning: "text-text-warning",
14
- success: "text-text-success"
15
- }, f = e.forwardRef(({ className: s, id: o, state: a, ...l }, n) => {
16
- const t = e.useContext(x), r = a ?? t.state ?? "helper", d = o ?? t.helperTextId;
17
- return c("p", { ref: n, id: d, role: r === "error" ? "alert" : void 0, className: i("text-ds-sm", u[r], s), ...l });
18
- });
19
- f.displayName = "FormHelperText";
20
- function C() {
21
- return e.useContext(x);
22
- }
23
- export {
24
- m as F,
25
- f as a,
26
- C as u
27
- };