@devalok/shilp-sutra 0.27.2 → 0.29.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 (250) hide show
  1. package/dist/_chunks/badge-group.js +299 -0
  2. package/dist/_chunks/framer.js +1915 -1980
  3. package/dist/_chunks/keybinding.js +4 -5
  4. package/dist/_chunks/primitives.js +3198 -3272
  5. package/dist/_chunks/sonner.js +29 -31
  6. package/dist/_chunks/stat-row.js +110 -131
  7. package/dist/_chunks/tiptap.js +42 -78
  8. package/dist/_chunks/tree-view.js +138 -149
  9. package/dist/_chunks/typing-indicator.js +565 -0
  10. package/dist/_chunks/use-calendar.js +416 -439
  11. package/dist/_chunks/vendor-client.js +977 -814
  12. package/dist/_chunks/vendor-utils.js +5 -5
  13. package/dist/ai/block-renderer.js +22 -22
  14. package/dist/ai/blocks/loading.d.ts.map +1 -1
  15. package/dist/ai/command-bar.d.ts.map +1 -1
  16. package/dist/ai/command-bar.js +241 -263
  17. package/dist/ai/conversation.d.ts.map +1 -1
  18. package/dist/ai/conversation.js +87 -107
  19. package/dist/composed/activity-feed.d.ts +2 -0
  20. package/dist/composed/activity-feed.d.ts.map +1 -1
  21. package/dist/composed/activity-feed.js +118 -90
  22. package/dist/composed/avatar-group.d.ts +1 -0
  23. package/dist/composed/avatar-group.d.ts.map +1 -1
  24. package/dist/composed/avatar-group.js +91 -67
  25. package/dist/composed/bulk-action-bar.d.ts.map +1 -1
  26. package/dist/composed/bulk-action-bar.js +29 -28
  27. package/dist/composed/command-palette.d.ts.map +1 -1
  28. package/dist/composed/command-palette.js +99 -113
  29. package/dist/composed/content-card.js +1 -1
  30. package/dist/composed/date-picker/calendar-grid.d.ts.map +1 -1
  31. package/dist/composed/date-picker/date-picker.d.ts.map +1 -1
  32. package/dist/composed/date-picker/date-range-picker.d.ts.map +1 -1
  33. package/dist/composed/date-picker/date-time-picker.d.ts.map +1 -1
  34. package/dist/composed/date-picker/time-picker.d.ts.map +1 -1
  35. package/dist/composed/deadline-indicator.d.ts.map +1 -1
  36. package/dist/composed/deadline-indicator.js +29 -28
  37. package/dist/composed/error-boundary.d.ts.map +1 -1
  38. package/dist/composed/error-boundary.js +30 -27
  39. package/dist/composed/extensions/file-attachment.d.ts.map +1 -1
  40. package/dist/composed/file-preview.d.ts.map +1 -1
  41. package/dist/composed/file-preview.js +261 -271
  42. package/dist/composed/filter-bar.d.ts.map +1 -1
  43. package/dist/composed/filter-bar.js +49 -48
  44. package/dist/composed/form-section.d.ts.map +1 -1
  45. package/dist/composed/form-section.js +12 -11
  46. package/dist/composed/global-loading.js +1 -1
  47. package/dist/composed/index.js +63 -63
  48. package/dist/composed/inline-edit.d.ts.map +1 -1
  49. package/dist/composed/inline-edit.js +55 -54
  50. package/dist/composed/markdown-viewer.d.ts.map +1 -1
  51. package/dist/composed/markdown-viewer.js +44 -43
  52. package/dist/composed/master-detail.d.ts.map +1 -1
  53. package/dist/composed/master-detail.js +35 -34
  54. package/dist/composed/multi-select-popover.d.ts.map +1 -1
  55. package/dist/composed/multi-select-popover.js +64 -64
  56. package/dist/composed/page-header.d.ts.map +1 -1
  57. package/dist/composed/page-header.js +31 -37
  58. package/dist/composed/priority-indicator.d.ts.map +1 -1
  59. package/dist/composed/priority-indicator.js +37 -36
  60. package/dist/composed/rich-text-editor.d.ts.map +1 -1
  61. package/dist/composed/rich-text-editor.js +287 -306
  62. package/dist/composed/schedule-view.js +62 -62
  63. package/dist/composed/status-badge.d.ts +4 -2
  64. package/dist/composed/status-badge.d.ts.map +1 -1
  65. package/dist/composed/status-badge.js +58 -45
  66. package/dist/shell/app-command-palette.d.ts.map +1 -1
  67. package/dist/shell/app-command-palette.js +93 -93
  68. package/dist/shell/bottom-navbar.d.ts.map +1 -1
  69. package/dist/shell/bottom-navbar.js +21 -20
  70. package/dist/shell/index.js +18 -18
  71. package/dist/shell/notification-center.d.ts.map +1 -1
  72. package/dist/shell/notification-center.js +96 -95
  73. package/dist/shell/notification-preferences.d.ts.map +1 -1
  74. package/dist/shell/notification-preferences.js +82 -85
  75. package/dist/shell/sidebar.js +59 -60
  76. package/dist/shell/top-bar.d.ts.map +1 -1
  77. package/dist/shell/top-bar.js +103 -103
  78. package/dist/tailwind/index.cjs +37 -4
  79. package/dist/tailwind/preset.d.ts.map +1 -1
  80. package/dist/tailwind/preset.js +38 -5
  81. package/dist/tokens/primitives.css +10 -0
  82. package/dist/tokens/semantic.css +70 -7
  83. package/dist/ui/accordion.d.ts +5 -2
  84. package/dist/ui/accordion.d.ts.map +1 -1
  85. package/dist/ui/accordion.js +44 -39
  86. package/dist/ui/alert-dialog.js +57 -57
  87. package/dist/ui/alert.d.ts +1 -1
  88. package/dist/ui/alert.d.ts.map +1 -1
  89. package/dist/ui/alert.js +30 -29
  90. package/dist/ui/aspect-ratio.js +4 -4
  91. package/dist/ui/autocomplete.js +56 -56
  92. package/dist/ui/avatar.js +2 -2
  93. package/dist/ui/badge-group.d.ts +22 -0
  94. package/dist/ui/badge-group.d.ts.map +1 -0
  95. package/dist/ui/badge-group.js +8 -0
  96. package/dist/ui/badge-indicator.d.ts +32 -0
  97. package/dist/ui/badge-indicator.d.ts.map +1 -0
  98. package/dist/ui/badge-indicator.js +54 -0
  99. package/dist/ui/badge.d.ts +27 -24
  100. package/dist/ui/badge.d.ts.map +1 -1
  101. package/dist/ui/badge.js +13 -129
  102. package/dist/ui/banner.d.ts +1 -1
  103. package/dist/ui/banner.d.ts.map +1 -1
  104. package/dist/ui/banner.js +27 -26
  105. package/dist/ui/breadcrumb.d.ts.map +1 -1
  106. package/dist/ui/breadcrumb.js +37 -36
  107. package/dist/ui/button-group.d.ts +12 -6
  108. package/dist/ui/button-group.d.ts.map +1 -1
  109. package/dist/ui/button-group.js +18 -18
  110. package/dist/ui/button-processing.d.ts +15 -0
  111. package/dist/ui/button-processing.d.ts.map +1 -0
  112. package/dist/ui/button-processing.js +77 -0
  113. package/dist/ui/button.d.ts +50 -25
  114. package/dist/ui/button.d.ts.map +1 -1
  115. package/dist/ui/button.js +243 -127
  116. package/dist/ui/card.js +20 -21
  117. package/dist/ui/charts/index.js +499 -508
  118. package/dist/ui/chat/date-separator.d.ts +12 -0
  119. package/dist/ui/chat/date-separator.d.ts.map +1 -0
  120. package/dist/ui/chat/index.d.ts +9 -0
  121. package/dist/ui/chat/index.d.ts.map +1 -0
  122. package/dist/ui/chat/index.js +12 -0
  123. package/dist/ui/chat/message-input.d.ts +16 -0
  124. package/dist/ui/chat/message-input.d.ts.map +1 -0
  125. package/dist/ui/chat/message-list.d.ts +24 -0
  126. package/dist/ui/chat/message-list.d.ts.map +1 -0
  127. package/dist/ui/chat/message.d.ts +108 -0
  128. package/dist/ui/chat/message.d.ts.map +1 -0
  129. package/dist/ui/chat/system-message.d.ts +11 -0
  130. package/dist/ui/chat/system-message.d.ts.map +1 -0
  131. package/dist/ui/chat/typing-indicator.d.ts +14 -0
  132. package/dist/ui/chat/typing-indicator.d.ts.map +1 -0
  133. package/dist/ui/chat/unread-separator.d.ts +12 -0
  134. package/dist/ui/chat/unread-separator.d.ts.map +1 -0
  135. package/dist/ui/checkbox.js +18 -18
  136. package/dist/ui/chip.d.ts +13 -62
  137. package/dist/ui/chip.d.ts.map +1 -1
  138. package/dist/ui/chip.js +10 -109
  139. package/dist/ui/collapsible.js +4 -4
  140. package/dist/ui/color-input.d.ts +19 -5
  141. package/dist/ui/color-input.d.ts.map +1 -1
  142. package/dist/ui/color-input.js +371 -79
  143. package/dist/ui/color-swatch.js +11 -11
  144. package/dist/ui/combobox.d.ts.map +1 -1
  145. package/dist/ui/combobox.js +74 -80
  146. package/dist/ui/context-menu.d.ts.map +1 -1
  147. package/dist/ui/context-menu.js +86 -85
  148. package/dist/ui/data-table-toolbar.d.ts.map +1 -1
  149. package/dist/ui/data-table-toolbar.js +51 -57
  150. package/dist/ui/data-table.d.ts.map +1 -1
  151. package/dist/ui/data-table.js +268 -296
  152. package/dist/ui/devalok-grain.d.ts +81 -0
  153. package/dist/ui/devalok-grain.d.ts.map +1 -0
  154. package/dist/ui/devalok-grain.js +69 -0
  155. package/dist/ui/dialog.d.ts.map +1 -1
  156. package/dist/ui/dialog.js +73 -72
  157. package/dist/ui/dropdown-menu.d.ts.map +1 -1
  158. package/dist/ui/dropdown-menu.js +93 -92
  159. package/dist/ui/file-upload.d.ts.map +1 -1
  160. package/dist/ui/file-upload.js +82 -82
  161. package/dist/ui/hover-card.js +29 -29
  162. package/dist/ui/icon-button.d.ts +7 -7
  163. package/dist/ui/icon-button.d.ts.map +1 -1
  164. package/dist/ui/icon-context.d.ts +15 -0
  165. package/dist/ui/icon-context.d.ts.map +1 -0
  166. package/dist/ui/icon-context.js +20 -0
  167. package/dist/ui/icon-group.d.ts +22 -0
  168. package/dist/ui/icon-group.d.ts.map +1 -0
  169. package/dist/ui/icon-group.js +32 -0
  170. package/dist/ui/icon.d.ts +57 -0
  171. package/dist/ui/icon.d.ts.map +1 -0
  172. package/dist/ui/icon.js +122 -0
  173. package/dist/ui/index.d.ts +8 -1
  174. package/dist/ui/index.d.ts.map +1 -1
  175. package/dist/ui/index.js +351 -329
  176. package/dist/ui/input-otp.d.ts.map +1 -1
  177. package/dist/ui/input-otp.js +21 -20
  178. package/dist/ui/input.d.ts +32 -11
  179. package/dist/ui/input.d.ts.map +1 -1
  180. package/dist/ui/input.js +149 -44
  181. package/dist/ui/label.js +1 -1
  182. package/dist/ui/lib/motion.d.ts +2 -0
  183. package/dist/ui/lib/motion.d.ts.map +1 -1
  184. package/dist/ui/lib/motion.js +13 -11
  185. package/dist/ui/lib/utils.js +1 -1
  186. package/dist/ui/menubar.d.ts.map +1 -1
  187. package/dist/ui/menubar.js +87 -86
  188. package/dist/ui/navigation-menu.d.ts.map +1 -1
  189. package/dist/ui/navigation-menu.js +23 -28
  190. package/dist/ui/number-input.d.ts.map +1 -1
  191. package/dist/ui/number-input.js +54 -53
  192. package/dist/ui/pagination.d.ts.map +1 -1
  193. package/dist/ui/pagination.js +45 -44
  194. package/dist/ui/popover.js +30 -30
  195. package/dist/ui/progress.d.ts +3 -1
  196. package/dist/ui/progress.d.ts.map +1 -1
  197. package/dist/ui/progress.js +43 -39
  198. package/dist/ui/radio.js +1 -1
  199. package/dist/ui/search-input.d.ts.map +1 -1
  200. package/dist/ui/search-input.js +47 -60
  201. package/dist/ui/segmented-control.js +1 -1
  202. package/dist/ui/select.d.ts.map +1 -1
  203. package/dist/ui/select.js +54 -53
  204. package/dist/ui/separator.js +5 -5
  205. package/dist/ui/sheet.d.ts.map +1 -1
  206. package/dist/ui/sheet.js +46 -45
  207. package/dist/ui/sidebar.d.ts.map +1 -1
  208. package/dist/ui/sidebar.js +196 -193
  209. package/dist/ui/skeleton.js +1 -1
  210. package/dist/ui/slider.js +1 -1
  211. package/dist/ui/spinner.js +74 -74
  212. package/dist/ui/stat-card.d.ts.map +1 -1
  213. package/dist/ui/stat-card.js +85 -86
  214. package/dist/ui/switch.d.ts +3 -0
  215. package/dist/ui/switch.d.ts.map +1 -1
  216. package/dist/ui/switch.js +40 -26
  217. package/dist/ui/tabs.js +43 -43
  218. package/dist/ui/text.js +1 -1
  219. package/dist/ui/textarea.js +10 -10
  220. package/dist/ui/toast.d.ts.map +1 -1
  221. package/dist/ui/toast.js +169 -169
  222. package/dist/ui/toggle-group.js +1 -1
  223. package/dist/ui/toggle.js +5 -5
  224. package/dist/ui/tooltip.js +41 -41
  225. package/dist/ui/tree-view/tree-item.d.ts.map +1 -1
  226. package/docs/components/_header.md +4 -4
  227. package/docs/components/composed/activity-feed.md +7 -0
  228. package/docs/components/composed/avatar-group.md +8 -5
  229. package/docs/components/composed/status-badge.md +14 -1
  230. package/docs/components/ui/accordion.md +5 -2
  231. package/docs/components/ui/badge-group.md +38 -0
  232. package/docs/components/ui/badge-indicator.md +40 -0
  233. package/docs/components/ui/badge.md +36 -5
  234. package/docs/components/ui/button-processing.md +15 -0
  235. package/docs/components/ui/button.md +40 -11
  236. package/docs/components/ui/chat.md +214 -0
  237. package/docs/components/ui/color-input.md +58 -4
  238. package/docs/components/ui/data-table.md +3 -0
  239. package/docs/components/ui/devalok-grain.md +55 -0
  240. package/docs/components/ui/icon-button.md +12 -5
  241. package/docs/components/ui/icon-context.md +38 -0
  242. package/docs/components/ui/icon-group.md +36 -0
  243. package/docs/components/ui/icon.md +47 -0
  244. package/docs/components/ui/input.md +32 -6
  245. package/docs/components/ui/progress.md +5 -0
  246. package/docs/components/ui/spinner.md +3 -0
  247. package/docs/components/ui/switch.md +13 -0
  248. package/llms-full.txt +724 -44
  249. package/llms.txt +38 -19
  250. package/package.json +8 -2
package/dist/ui/button.js CHANGED
@@ -1,39 +1,53 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as C } from "react/jsx-runtime";
3
- import { c as J } from "../_chunks/vendor-utils.js";
4
- import { IconCheck as L, IconX as O } from "@tabler/icons-react";
5
- import { S as P, K as Q } from "../_chunks/primitives.js";
6
- import * as a from "react";
7
- import { useButtonGroup as U } from "./button-group.js";
8
- import { springs as Y } from "./lib/motion.js";
2
+ import { jsx as e, jsxs as j, Fragment as ue } from "react/jsx-runtime";
3
+ import { a as ge } from "../_chunks/vendor-utils.js";
4
+ import { IconCheck as ve, IconX as fe } from "@tabler/icons-react";
5
+ import { S as be, i as he } from "../_chunks/primitives.js";
6
+ import * as t from "react";
7
+ import { useButtonGroup as pe } from "./button-group.js";
8
+ import { Icon as xe } from "./icon.js";
9
+ import { IconProvider as we } from "./icon-context.js";
10
+ import { motionProps as Ne } from "./lib/motion.js";
11
+ import { ProcessingOverlay as ye } from "./button-processing.js";
9
12
  import { cn as c } from "./lib/utils.js";
10
- import { Spinner as Z } from "./spinner.js";
11
- import { A as _, m as $ } from "../_chunks/framer.js";
12
- const R = J(
13
- "inline-flex items-center justify-center gap-ds-03 whitespace-nowrap font-sans font-semibold select-none border border-transparent 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 disabled:cursor-not-allowed",
13
+ import { Spinner as T } from "./spinner.js";
14
+ import { u as ke, m as Se } from "../_chunks/framer.js";
15
+ const X = ge(
16
+ "relative inline-flex items-center justify-center whitespace-nowrap font-sans select-none overflow-hidden isolate 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 disabled:cursor-not-allowed disabled:saturate-[0.3] [&>span:not([data-grain])]:relative [&>span:not([data-grain])]:z-[2]",
14
17
  {
15
18
  variants: {
16
19
  variant: {
17
20
  solid: "",
18
- default: "",
19
- // alias → solid
20
- outline: "",
21
+ soft: "",
22
+ outline: "border",
21
23
  ghost: "",
22
- destructive: "",
23
- // alias → solid + error
24
- link: "text-info-11 underline-offset-4 hover:underline active:opacity-80"
24
+ link: "underline-offset-4 hover:underline active:opacity-80",
25
+ // Deprecated aliases
26
+ default: "",
27
+ destructive: ""
25
28
  },
26
29
  color: {
27
- default: "",
28
- error: ""
30
+ accent: "",
31
+ error: "",
32
+ success: "",
33
+ warning: "",
34
+ neutral: "",
35
+ // Deprecated alias
36
+ default: ""
37
+ },
38
+ weight: {
39
+ semibold: "font-semibold",
40
+ normal: "font-normal"
29
41
  },
30
42
  size: {
31
- xs: "h-ds-xs-plus rounded-ds-sm px-ds-03 text-ds-sm",
32
- sm: "h-ds-sm rounded-ds-md px-ds-04 text-ds-sm",
33
- md: "h-ds-md rounded-ds-md px-ds-05 text-ds-md",
34
- lg: "h-ds-lg rounded-ds-lg px-ds-06 text-ds-base",
43
+ xs: "h-ds-xs-plus rounded-ds-md px-ds-03 text-ds-sm gap-1",
44
+ sm: "h-ds-sm rounded-ds-md px-ds-04 text-ds-sm gap-1.5",
45
+ md: "h-ds-md rounded-ds-lg px-ds-05 text-ds-md gap-2",
46
+ lg: "h-ds-lg rounded-ds-xl px-ds-06 text-ds-base gap-2.5",
47
+ "compact-xs": "rounded-ds-md px-ds-02 py-[3px] text-ds-sm gap-1",
48
+ "compact-sm": "rounded-ds-md px-ds-03 py-[5px] text-ds-sm gap-1.5",
49
+ "compact-md": "rounded-ds-lg px-ds-04 py-ds-03 text-ds-md gap-2",
35
50
  icon: "h-ds-md w-ds-md rounded-ds-md",
36
- // alias → icon-md
37
51
  "icon-xs": "h-ds-xs-plus w-ds-xs-plus rounded-ds-sm",
38
52
  "icon-sm": "h-ds-sm w-ds-sm rounded-ds-md",
39
53
  "icon-md": "h-ds-md w-ds-md rounded-ds-md",
@@ -41,141 +55,243 @@ const R = J(
41
55
  }
42
56
  },
43
57
  compoundVariants: [
44
- // solid + default (primary)
45
- { variant: "solid", color: "default", className: "bg-accent-9 text-accent-fg hover:bg-accent-10 active:bg-accent-10 shadow-raised hover:shadow-brand" },
46
- // "default" alias same as solid + default
47
- { variant: "default", color: "default", className: "bg-accent-9 text-accent-fg hover:bg-accent-10 active:bg-accent-10 shadow-raised hover:shadow-brand" },
48
- { variant: "default", color: "error", className: "bg-error-9 text-accent-fg hover:bg-error-10 active:bg-error-10 shadow-raised" },
49
- // "destructive" alias solid + error
50
- { variant: "destructive", color: "default", className: "bg-error-9 text-accent-fg hover:bg-error-10 active:bg-error-10 shadow-raised" },
51
- { variant: "destructive", color: "error", className: "bg-error-9 text-accent-fg hover:bg-error-10 active:bg-error-10 shadow-raised" },
52
- // solid + error
53
- { variant: "solid", color: "error", className: "bg-error-9 text-accent-fg hover:bg-error-10 active:bg-error-10 shadow-raised" },
54
- // outline + default (secondary)
55
- { variant: "outline", color: "default", className: "bg-transparent text-accent-11 border-accent-7 hover:bg-accent-2 active:bg-surface-raised-active" },
56
- // outline + error (error-ghost)
57
- { variant: "outline", color: "error", className: "bg-transparent text-error-11 border border-error-7 hover:bg-error-3 active:bg-error-3" },
58
- // ghost + default
59
- { variant: "ghost", color: "default", className: "bg-transparent text-surface-fg-muted hover:bg-surface-raised hover:text-surface-fg active:bg-surface-raised-active" },
60
- // ghost + error
61
- { variant: "ghost", color: "error", className: "bg-transparent text-error-11 hover:bg-error-3 hover:text-error-11 active:bg-error-3" }
58
+ // ============ SOLID ============ (colored hover shadows — shadow tints with the button's own hue)
59
+ { variant: "solid", color: "accent", className: "bg-accent-9 text-accent-fg hover:bg-accent-10 shadow-raised hover:shadow-brand" },
60
+ { variant: "solid", color: "error", className: "bg-error-9 text-error-fg hover:bg-error-10 shadow-raised hover:shadow-error" },
61
+ { variant: "solid", color: "success", className: "bg-success-9 text-success-fg hover:bg-success-10 shadow-raised hover:shadow-success" },
62
+ { variant: "solid", color: "warning", className: "bg-warning-9 text-warning-fg hover:bg-warning-10 shadow-raised hover:shadow-warning" },
63
+ { variant: "solid", color: "neutral", className: "bg-neutral-5 text-surface-fg hover:bg-neutral-7 shadow-raised" },
64
+ // ============ SOFT ============
65
+ { variant: "soft", color: "accent", className: "bg-accent-3 text-accent-11 hover:bg-accent-4 active:bg-accent-5" },
66
+ { variant: "soft", color: "error", className: "bg-error-3 text-error-11 hover:bg-error-4 active:bg-error-5" },
67
+ { variant: "soft", color: "success", className: "bg-success-3 text-success-11 hover:bg-success-4 active:bg-success-5" },
68
+ { variant: "soft", color: "warning", className: "bg-warning-3 text-warning-11 hover:bg-warning-4 active:bg-warning-5" },
69
+ { variant: "soft", color: "neutral", className: "bg-surface-raised-hover text-surface-fg-muted hover:bg-surface-raised-active active:bg-neutral-5" },
70
+ // ============ OUTLINE ============
71
+ { variant: "outline", color: "accent", className: "bg-transparent text-accent-11 border-accent-7 hover:bg-accent-3 active:bg-accent-4" },
72
+ { variant: "outline", color: "error", className: "bg-transparent text-error-11 border-error-7 hover:bg-error-3 active:bg-error-4" },
73
+ { variant: "outline", color: "success", className: "bg-transparent text-success-11 border-success-7 hover:bg-success-3 active:bg-success-4" },
74
+ { variant: "outline", color: "warning", className: "bg-transparent text-warning-11 border-warning-7 hover:bg-warning-3 active:bg-warning-4" },
75
+ { variant: "outline", color: "neutral", className: "bg-transparent text-surface-fg border-surface-border-strong hover:bg-surface-raised-hover active:bg-surface-raised-active" },
76
+ // ============ GHOST ============
77
+ // ghost+accent uses neutral look for backward compat (most common ghost is toolbar/icon ghost)
78
+ { variant: "ghost", color: "accent", className: "bg-transparent text-surface-fg-muted hover:bg-surface-raised-hover hover:text-surface-fg active:bg-surface-raised-active" },
79
+ { variant: "ghost", color: "error", className: "bg-transparent text-error-11 hover:bg-error-3 active:bg-error-4" },
80
+ { variant: "ghost", color: "success", className: "bg-transparent text-success-11 hover:bg-success-3 active:bg-success-4" },
81
+ { variant: "ghost", color: "warning", className: "bg-transparent text-warning-11 hover:bg-warning-3 active:bg-warning-4" },
82
+ { variant: "ghost", color: "neutral", className: "bg-transparent text-surface-fg-muted hover:bg-surface-raised-hover hover:text-surface-fg active:bg-surface-raised-active" },
83
+ // ============ LINK ============
84
+ { variant: "link", color: "accent", className: "text-accent-11" },
85
+ { variant: "link", color: "error", className: "text-error-11" },
86
+ { variant: "link", color: "success", className: "text-success-11" },
87
+ { variant: "link", color: "warning", className: "text-warning-11" },
88
+ { variant: "link", color: "neutral", className: "text-surface-fg-muted" },
89
+ // ============ DEPRECATED ALIASES ============
90
+ // "default" variant → solid
91
+ { variant: "default", color: "accent", className: "bg-accent-9 text-accent-fg hover:bg-accent-10 shadow-raised hover:shadow-brand" },
92
+ { variant: "default", color: "error", className: "bg-error-9 text-error-fg hover:bg-error-10 shadow-raised" },
93
+ { variant: "default", color: "default", className: "bg-accent-9 text-accent-fg hover:bg-accent-10 shadow-raised hover:shadow-brand" },
94
+ // "destructive" → solid + error (ignores color prop)
95
+ { variant: "destructive", color: "accent", className: "bg-error-9 text-error-fg hover:bg-error-10 shadow-raised" },
96
+ { variant: "destructive", color: "error", className: "bg-error-9 text-error-fg hover:bg-error-10 shadow-raised" },
97
+ { variant: "destructive", color: "default", className: "bg-error-9 text-error-fg hover:bg-error-10 shadow-raised" },
98
+ // "default" color alias → accent
99
+ { variant: "solid", color: "default", className: "bg-accent-9 text-accent-fg hover:bg-accent-10 shadow-raised hover:shadow-brand" },
100
+ { variant: "soft", color: "default", className: "bg-accent-3 text-accent-11 hover:bg-accent-4 active:bg-accent-5" },
101
+ { variant: "outline", color: "default", className: "bg-transparent text-accent-11 border-accent-7 hover:bg-accent-3 active:bg-accent-4" },
102
+ { variant: "ghost", color: "default", className: "bg-transparent text-surface-fg-muted hover:bg-surface-raised-hover hover:text-surface-fg active:bg-surface-raised-active" },
103
+ { variant: "link", color: "default", className: "text-accent-11" }
62
104
  ],
63
105
  defaultVariants: {
64
106
  variant: "solid",
65
- color: "default",
107
+ color: "accent",
108
+ weight: "semibold",
66
109
  size: "md"
67
110
  }
68
111
  }
69
- ), W = {
70
- xs: "h-3.5 w-3.5 [&>svg]:h-3.5 [&>svg]:w-3.5",
71
- sm: "h-ico-sm w-ico-sm [&>svg]:h-ico-sm [&>svg]:w-ico-sm",
72
- md: "h-ico-sm w-ico-sm [&>svg]:h-ico-sm [&>svg]:w-ico-sm",
73
- lg: "h-ico-md w-ico-md [&>svg]:h-ico-md [&>svg]:w-ico-md",
74
- icon: "h-ico-sm w-ico-sm [&>svg]:h-ico-sm [&>svg]:w-ico-sm",
75
- "icon-xs": "h-3.5 w-3.5 [&>svg]:h-3.5 [&>svg]:w-3.5",
76
- "icon-sm": "h-ico-sm w-ico-sm [&>svg]:h-ico-sm [&>svg]:w-ico-sm",
77
- "icon-md": "h-ico-sm w-ico-sm [&>svg]:h-ico-sm [&>svg]:w-ico-sm",
78
- "icon-lg": "h-ico-md w-ico-md [&>svg]:h-ico-md [&>svg]:w-ico-md"
79
- }, ee = {
112
+ ), $ = {
113
+ xs: "px-ds-04",
114
+ sm: "px-ds-05",
115
+ md: "px-ds-06",
116
+ lg: "px-ds-07",
117
+ "compact-xs": "px-ds-03",
118
+ "compact-sm": "px-ds-04",
119
+ "compact-md": "px-ds-05"
120
+ }, Re = {
121
+ xs: { start: "-ml-0.5", end: "-mr-0.5" },
122
+ sm: { start: "-ml-1", end: "-mr-1" },
123
+ md: { start: "-ml-1.5", end: "-mr-1.5" },
124
+ lg: { start: "-ml-2", end: "-mr-2" },
125
+ "compact-xs": { start: "-ml-0.5", end: "-mr-0.5" },
126
+ "compact-sm": { start: "-ml-0.5", end: "-mr-0.5" },
127
+ "compact-md": { start: "-ml-1", end: "-mr-1" },
128
+ icon: { start: "", end: "" },
129
+ "icon-xs": { start: "", end: "" },
130
+ "icon-sm": { start: "", end: "" },
131
+ "icon-md": { start: "", end: "" },
132
+ "icon-lg": { start: "", end: "" }
133
+ }, A = {
80
134
  xs: "sm",
81
135
  sm: "sm",
82
136
  md: "sm",
83
137
  lg: "md",
138
+ "compact-xs": "sm",
139
+ "compact-sm": "sm",
140
+ "compact-md": "sm",
84
141
  icon: "sm",
85
142
  "icon-xs": "sm",
86
143
  "icon-sm": "sm",
87
144
  "icon-md": "sm",
88
145
  "icon-lg": "md"
89
- }, se = a.forwardRef(
146
+ }, ze = {
147
+ xs: "xs",
148
+ sm: "sm",
149
+ md: "md",
150
+ lg: "lg",
151
+ "compact-xs": "xs",
152
+ "compact-sm": "sm",
153
+ "compact-md": "md",
154
+ icon: "md",
155
+ "icon-xs": "xs",
156
+ "icon-sm": "sm",
157
+ "icon-md": "md",
158
+ "icon-lg": "lg"
159
+ }, Ce = t.forwardRef(
90
160
  ({
91
- className: h,
92
- variant: A,
93
- color: V,
94
- size: B,
95
- asChild: E = !1,
96
- startIcon: b,
97
- endIcon: p,
98
- loading: F = !1,
99
- loadingPosition: l = "start",
100
- fullWidth: x = !1,
101
- disabled: w,
102
- onClick: M,
103
- onClickAsync: m,
104
- asyncFeedbackDuration: T = 1500,
105
- children: n,
106
- ...N
107
- }, y) => {
108
- const u = U(), S = A ?? u.variant, z = V ?? u.color, i = B ?? u.size ?? "md", f = W[i], G = ee[i], [t, d] = a.useState("idle"), k = a.useRef(), o = a.useRef(!0);
109
- a.useEffect(() => () => {
110
- o.current = !1, clearTimeout(k.current);
161
+ className: B,
162
+ variant: H,
163
+ color: J,
164
+ weight: K,
165
+ size: L,
166
+ asChild: Q = !1,
167
+ shape: Y,
168
+ startIcon: h,
169
+ endIcon: y,
170
+ loading: D = !1,
171
+ loadingPosition: k = "start",
172
+ fullWidth: l = !1,
173
+ disabled: I,
174
+ onClick: W,
175
+ onClickAsync: S,
176
+ asyncFeedbackDuration: ee = 1500,
177
+ processing: m,
178
+ processingColor: re,
179
+ processingDisabled: R = !0,
180
+ children: O,
181
+ ..._
182
+ }, u) => {
183
+ const g = pe(), o = H ?? g.variant, p = J ?? g.color, F = K ?? g.weight ?? "semibold", x = Y ?? g.shape ?? "default", n = L ?? g.size ?? "md", V = ke(), P = t.useRef(null), G = t.useRef(null), z = t.useRef(void 0);
184
+ t.useEffect(() => {
185
+ const r = G.current, N = P.current;
186
+ if (!(!r || !N || l || V))
187
+ return z.current = requestAnimationFrame(() => {
188
+ N.style.width = "auto";
189
+ const q = r.offsetWidth;
190
+ q > 0 && (N.getBoundingClientRect(), N.style.width = `${q}px`);
191
+ }), () => {
192
+ z.current && cancelAnimationFrame(z.current);
193
+ };
194
+ });
195
+ const [i, w] = t.useState("idle"), M = t.useRef(void 0), v = t.useRef(!0);
196
+ t.useEffect(() => () => {
197
+ v.current = !1, clearTimeout(M.current);
111
198
  }, []);
112
- const I = (v) => {
113
- !m || t !== "idle" || (d("loading"), m(v).then(() => {
114
- o.current && d("success");
199
+ const se = (r) => {
200
+ !S || i !== "idle" || (w("loading"), S(r).then(() => {
201
+ v.current && w("success");
115
202
  }).catch(() => {
116
- o.current && d("error");
203
+ v.current && w("error");
117
204
  }).finally(() => {
118
- o.current && (k.current = setTimeout(() => {
119
- o.current && d("idle");
120
- }, T));
205
+ v.current && (M.current = setTimeout(() => {
206
+ v.current && w("idle");
207
+ }, ee));
121
208
  }));
122
- }, j = !!m, s = j ? t === "loading" : F, r = t === "success" || t === "error", g = s ? /* @__PURE__ */ e(Z, { size: G }) : null;
123
- if (E) {
124
- const v = {
209
+ }, C = !!S, a = C ? i === "loading" : D, s = i === "success" || i === "error", U = s ? void 0 : m === !0 ? "working" : m === !1 || !m ? C && i === "loading" && !m ? "working" : void 0 : m, d = !!U, te = re ?? (p === "default" ? "accent" : p) ?? "accent";
210
+ if (Q) {
211
+ const r = {
125
212
  className: c(
126
- R({ variant: S, color: z, size: i }),
127
- x && "w-full",
128
- h
213
+ X({ variant: o, color: p, weight: F, size: n }),
214
+ x === "pill" && "rounded-full",
215
+ x === "pill" && $[n],
216
+ l && "w-full",
217
+ B
129
218
  ),
130
- ref: y,
131
- disabled: w || s,
132
- "aria-busy": s || void 0,
133
- ...N
219
+ ref: u,
220
+ disabled: I || a,
221
+ "aria-busy": a || void 0,
222
+ ..._
134
223
  };
135
- return /* @__PURE__ */ e(P, { ...v, children: /* @__PURE__ */ e(Q, { children: n }) });
224
+ return /* @__PURE__ */ e(be, { ...r, children: /* @__PURE__ */ e(he, { children: O }) });
136
225
  }
137
- const K = () => s && l === "start" ? g : b ? /* @__PURE__ */ e("span", { className: c("inline-flex shrink-0 items-center justify-center", f), children: b }) : null, X = () => s && l === "end" ? g : p ? /* @__PURE__ */ e("span", { className: c("inline-flex shrink-0 items-center justify-center", f), children: p }) : null, q = () => s && l === "center" ? /* @__PURE__ */ C("span", { className: "relative inline-flex items-center justify-center", children: [
138
- /* @__PURE__ */ e("span", { className: "invisible", children: n }),
139
- /* @__PURE__ */ e("span", { className: "absolute inset-0 flex items-center justify-center", children: g })
140
- ] }) : n, D = r ? t === "success" ? "bg-success-9 text-accent-fg border-transparent hover:bg-success-9" : "bg-error-9 text-accent-fg border-transparent hover:bg-error-9" : void 0, H = r ? /* @__PURE__ */ e(_, { mode: "wait", children: /* @__PURE__ */ e(
141
- $.span,
226
+ const f = Re[n] ?? { start: "", end: "" }, Z = o === "solid" || o === "soft" || o === "outline", ae = () => a && k === "start" ? /* @__PURE__ */ e("span", { className: c("inline-flex shrink-0 items-center justify-center", h && f.start), children: /* @__PURE__ */ e(T, { size: A[n], variant: "bare" }) }) : h ? /* @__PURE__ */ e("span", { className: c("inline-flex shrink-0 items-center justify-center pointer-events-none", f.start, Z && "opacity-90"), children: h }) : null, ne = () => a && k === "end" ? /* @__PURE__ */ e("span", { className: c("inline-flex shrink-0 items-center justify-center", y && f.end), children: /* @__PURE__ */ e(T, { size: A[n], variant: "bare" }) }) : y ? /* @__PURE__ */ e("span", { className: c("inline-flex shrink-0 items-center justify-center pointer-events-none", f.end, Z && "opacity-90"), children: y }) : null, oe = t.Children.toArray(O), E = [], b = [];
227
+ oe.forEach((r) => {
228
+ t.isValidElement(r) && r.type?.displayName === "DevalokGrain" ? E.push(r) : b.push(r);
229
+ });
230
+ const ce = () => a && k === "center" ? /* @__PURE__ */ j("span", { className: "relative inline-flex items-center justify-center", children: [
231
+ /* @__PURE__ */ e("span", { className: "invisible", children: b }),
232
+ /* @__PURE__ */ e("span", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ e(T, { size: A[n], variant: "bare" }) })
233
+ ] }) : E.length > 0 ? /* @__PURE__ */ e("span", { children: b }) : /* @__PURE__ */ e(ue, { children: b }), ie = s ? i === "success" ? "bg-success-9 text-accent-fg border-transparent hover:bg-success-9" : "bg-error-9 text-accent-fg border-transparent hover:bg-error-9" : void 0, de = s ? /* @__PURE__ */ e("span", { className: c("inline-flex shrink-0 items-center justify-center pointer-events-none", h && f.start), children: /* @__PURE__ */ e(xe, { icon: i === "success" ? ve : fe, animate: "draw" }) }) : null, le = ze[n] ?? "md", me = /* @__PURE__ */ j(
234
+ Se.button,
142
235
  {
143
- initial: { opacity: 0, scale: 0.5 },
144
- animate: { opacity: 1, scale: 1 },
145
- exit: { opacity: 0, scale: 0.5 },
146
- transition: Y.bouncy,
147
- className: c("inline-flex shrink-0 items-center justify-center", f),
148
- children: t === "success" ? /* @__PURE__ */ e(L, { className: "h-full w-full" }) : /* @__PURE__ */ e(O, { className: "h-full w-full" })
149
- },
150
- t
151
- ) }) : null;
152
- return /* @__PURE__ */ C(
153
- "button",
154
- {
155
- ...N,
236
+ ...Ne(_),
156
237
  className: c(
157
- R({ variant: S, color: z, size: i }),
158
- x && "w-full",
159
- !s && !r && "active:scale-[0.95] transition-[color,background-color,border-color,box-shadow,transform] duration-fast-01 ease-productive-standard",
160
- D,
161
- r && "transition-colors duration-moderate-01 ease-productive-standard",
162
- h
238
+ X({
239
+ // When processing (and not showing async feedback), force soft variant so ants pop
240
+ variant: d && !s && o !== "ghost" && o !== "outline" && o !== "link" ? "soft" : o,
241
+ color: p,
242
+ weight: F,
243
+ size: n
244
+ }),
245
+ x === "pill" && "rounded-full",
246
+ x === "pill" && $[n],
247
+ l && "w-full",
248
+ // Asymmetric timing: hover-out is slow+relaxed, hover-in is fast+snappy (applied via hover: override)
249
+ !a && !s && "transition-[color,background-color,border-color,box-shadow,transform,filter] duration-moderate-01 ease-productive-exit",
250
+ !a && !s && "hover:duration-fast-02 hover:ease-productive-entrance",
251
+ !a && !s && "active:scale-[0.95] active:brightness-[0.92] active:saturate-[1.1] active:duration-[0ms]",
252
+ ie,
253
+ s && "transition-colors duration-moderate-01 ease-productive-standard",
254
+ d && R && "pointer-events-none cursor-default",
255
+ B
163
256
  ),
164
- ref: y,
165
- disabled: w || s || r,
166
- "aria-busy": s || void 0,
167
- onClick: j ? I : M,
257
+ ref: (r) => {
258
+ G.current = r, typeof u == "function" ? u(r) : u && (u.current = r);
259
+ },
260
+ disabled: I || a && !d,
261
+ "aria-busy": a || d || void 0,
262
+ "aria-disabled": d && R || void 0,
263
+ onClick: C ? se : d && R ? void 0 : W,
168
264
  children: [
169
- r ? H : K(),
170
- r ? n : q(),
171
- r ? null : X()
265
+ E,
266
+ s ? de : ae(),
267
+ s ? b : ce(),
268
+ s ? null : ne()
172
269
  ]
173
270
  }
174
271
  );
272
+ return /* @__PURE__ */ e(we, { size: le, children: /* @__PURE__ */ j(
273
+ "span",
274
+ {
275
+ ref: P,
276
+ className: c("relative inline-flex", l && "w-full"),
277
+ style: l || V ? void 0 : { transition: "width 0.2s cubic-bezier(0.25, 0.1, 0.25, 1)" },
278
+ children: [
279
+ me,
280
+ /* @__PURE__ */ e(
281
+ ye,
282
+ {
283
+ active: d,
284
+ speed: U ?? "working",
285
+ color: te
286
+ }
287
+ )
288
+ ]
289
+ }
290
+ ) });
175
291
  }
176
292
  );
177
- se.displayName = "Button";
293
+ Ce.displayName = "Button";
178
294
  export {
179
- se as Button,
180
- R as buttonVariants
295
+ Ce as Button,
296
+ X as buttonVariants
181
297
  };
package/dist/ui/card.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as t, jsxs as p } from "react/jsx-runtime";
3
3
  import * as s from "react";
4
- import { c as v } from "../_chunks/vendor-utils.js";
4
+ import { a as v } from "../_chunks/vendor-utils.js";
5
5
  import { tweens as w, springs as b, motionProps as g } from "./lib/motion.js";
6
6
  import { cn as o } from "./lib/utils.js";
7
7
  import { m } from "../_chunks/framer.js";
@@ -36,19 +36,18 @@ const x = v(
36
36
  right: "right-0 top-0 bottom-0 rounded-r-ds-lg",
37
37
  bottom: "bottom-0 left-0 right-0 rounded-b-ds-lg"
38
38
  };
39
- function R(r, a) {
40
- var e;
41
- return `${N[r] ?? ""} ${((e = y[r]) == null ? void 0 : e[a]) ?? ""}`;
39
+ function R(r, e) {
40
+ return `${N[r] ?? ""} ${y[r]?.[e] ?? ""}`;
42
41
  }
43
42
  function H(r) {
44
43
  return C[r] ?? r;
45
44
  }
46
45
  const P = s.forwardRef(
47
- ({ className: r, variant: a, interactive: e, accent: d, accentColor: u = "default", accentWidth: h = 3, children: n, ...i }, c) => {
46
+ ({ className: r, variant: e, interactive: a, accent: d, accentColor: u = "default", accentWidth: h = 3, children: n, ...i }, c) => {
48
47
  const l = o(
49
- x({ variant: a }),
48
+ x({ variant: e }),
50
49
  d && "relative overflow-hidden",
51
- e && "hover:shadow-raised-hover hover:border-surface-border-strong cursor-pointer transition-shadow duration-fast-02 ease-productive-standard",
50
+ a && "hover:shadow-raised-hover hover:border-surface-border-strong cursor-pointer transition-shadow duration-fast-02 ease-productive-standard",
52
51
  r
53
52
  ), f = d ? /* @__PURE__ */ t(
54
53
  m.span,
@@ -61,7 +60,7 @@ const P = s.forwardRef(
61
60
  style: { backgroundColor: H(u) }
62
61
  }
63
62
  ) : null;
64
- return e ? /* @__PURE__ */ p(
63
+ return a ? /* @__PURE__ */ p(
65
64
  m.div,
66
65
  {
67
66
  ref: c,
@@ -82,41 +81,41 @@ const P = s.forwardRef(
82
81
  }
83
82
  );
84
83
  P.displayName = "Card";
85
- const T = s.forwardRef(({ className: r, ...a }, e) => /* @__PURE__ */ t(
84
+ const T = s.forwardRef(({ className: r, ...e }, a) => /* @__PURE__ */ t(
86
85
  "div",
87
86
  {
88
- ref: e,
87
+ ref: a,
89
88
  className: o("flex flex-col space-y-ds-02b p-ds-06", r),
90
- ...a
89
+ ...e
91
90
  }
92
91
  ));
93
92
  T.displayName = "CardHeader";
94
- const j = s.forwardRef(({ className: r, ...a }, e) => /* @__PURE__ */ t(
93
+ const j = s.forwardRef(({ className: r, ...e }, a) => /* @__PURE__ */ t(
95
94
  "div",
96
95
  {
97
- ref: e,
96
+ ref: a,
98
97
  className: o("font-sans font-semibold leading-ds-none tracking-normal text-surface-fg", r),
99
- ...a
98
+ ...e
100
99
  }
101
100
  ));
102
101
  j.displayName = "CardTitle";
103
- const k = s.forwardRef(({ className: r, ...a }, e) => /* @__PURE__ */ t(
102
+ const k = s.forwardRef(({ className: r, ...e }, a) => /* @__PURE__ */ t(
104
103
  "div",
105
104
  {
106
- ref: e,
105
+ ref: a,
107
106
  className: o("text-ds-md text-surface-fg-muted", r),
108
- ...a
107
+ ...e
109
108
  }
110
109
  ));
111
110
  k.displayName = "CardDescription";
112
- const A = s.forwardRef(({ className: r, ...a }, e) => /* @__PURE__ */ t("div", { ref: e, className: o("p-ds-06 pt-0", r), ...a }));
111
+ const A = s.forwardRef(({ className: r, ...e }, a) => /* @__PURE__ */ t("div", { ref: a, className: o("p-ds-06 pt-0", r), ...e }));
113
112
  A.displayName = "CardContent";
114
- const D = s.forwardRef(({ className: r, ...a }, e) => /* @__PURE__ */ t(
113
+ const D = s.forwardRef(({ className: r, ...e }, a) => /* @__PURE__ */ t(
115
114
  "div",
116
115
  {
117
- ref: e,
116
+ ref: a,
118
117
  className: o("flex items-center p-ds-06 pt-0", r),
119
- ...a
118
+ ...e
120
119
  }
121
120
  ));
122
121
  D.displayName = "CardFooter";