@devalok/shilp-sutra 0.57.0 → 0.60.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 (288) hide show
  1. package/MIGRATION.md +163 -0
  2. package/dist/_chunks/badge-group.js +75 -188
  3. package/dist/_chunks/badge-group.js.map +1 -1
  4. package/dist/_chunks/chat.js +244 -243
  5. package/dist/_chunks/chat.js.map +1 -1
  6. package/dist/_chunks/image-preview.js +71 -70
  7. package/dist/_chunks/image-preview.js.map +1 -1
  8. package/dist/_chunks/motion-preference.js +15 -0
  9. package/dist/_chunks/motion-preference.js.map +1 -0
  10. package/dist/_chunks/motion-provider.js +1 -1
  11. package/dist/_chunks/motion-provider.js.map +1 -1
  12. package/dist/_chunks/popover.js +50 -49
  13. package/dist/_chunks/popover.js.map +1 -1
  14. package/dist/_chunks/primitives-internal.js +29 -29
  15. package/dist/_chunks/primitives-internal.js.map +1 -1
  16. package/dist/_chunks/shared.js +48 -47
  17. package/dist/_chunks/shared.js.map +1 -1
  18. package/dist/_chunks/success.js +34 -34
  19. package/dist/_chunks/tree-view.js +1 -1
  20. package/dist/_chunks/tree-view.js.map +1 -1
  21. package/dist/ai/block-renderer.js +8 -8
  22. package/dist/ai/command-bar.js +65 -65
  23. package/dist/ai/command-bar.js.map +1 -1
  24. package/dist/ai/conversation.js +35 -35
  25. package/dist/ai/conversation.js.map +1 -1
  26. package/dist/ai/index.js +4 -4
  27. package/dist/composed/activity-feed.d.ts.map +1 -1
  28. package/dist/composed/activity-feed.js +108 -107
  29. package/dist/composed/activity-feed.js.map +1 -1
  30. package/dist/composed/avatar-group.js +3 -3
  31. package/dist/composed/avatar-group.js.map +1 -1
  32. package/dist/composed/bulk-action-bar.d.ts +9 -35
  33. package/dist/composed/bulk-action-bar.d.ts.map +1 -1
  34. package/dist/composed/bulk-action-bar.js +2 -139
  35. package/dist/composed/command-palette.js +137 -137
  36. package/dist/composed/command-palette.js.map +1 -1
  37. package/dist/composed/content-card.js +1 -1
  38. package/dist/composed/content-card.js.map +1 -1
  39. package/dist/composed/date-picker/index.js +5 -5
  40. package/dist/composed/date-picker/index.js.map +1 -1
  41. package/dist/composed/empty-state.js +4 -4
  42. package/dist/composed/file-preview/image-preview.d.ts.map +1 -1
  43. package/dist/composed/file-preview/shared.d.ts.map +1 -1
  44. package/dist/composed/file-preview/video-preview.d.ts.map +1 -1
  45. package/dist/composed/file-preview.js +151 -150
  46. package/dist/composed/file-preview.js.map +1 -1
  47. package/dist/composed/filter-bar.d.ts.map +1 -1
  48. package/dist/composed/filter-bar.js +53 -52
  49. package/dist/composed/filter-bar.js.map +1 -1
  50. package/dist/composed/form-section.d.ts.map +1 -1
  51. package/dist/composed/form-section.js +38 -37
  52. package/dist/composed/form-section.js.map +1 -1
  53. package/dist/composed/index.js +6 -5
  54. package/dist/composed/master-detail.d.ts.map +1 -1
  55. package/dist/composed/master-detail.js +1 -1
  56. package/dist/composed/master-detail.js.map +1 -1
  57. package/dist/composed/multi-select-popover.d.ts.map +1 -1
  58. package/dist/composed/multi-select-popover.js +109 -108
  59. package/dist/composed/multi-select-popover.js.map +1 -1
  60. package/dist/composed/rich-chat-input/attachment-strip.d.ts.map +1 -1
  61. package/dist/composed/rich-chat-input/reply-banner.d.ts.map +1 -1
  62. package/dist/composed/rich-chat-input/schedule-send.d.ts.map +1 -1
  63. package/dist/composed/rich-chat-input.d.ts.map +1 -1
  64. package/dist/composed/rich-chat-input.js +467 -466
  65. package/dist/composed/rich-chat-input.js.map +1 -1
  66. package/dist/composed/rich-text-editor.js +3 -3
  67. package/dist/composed/rich-text-editor.js.map +1 -1
  68. package/dist/composed/schedule-view.js +2 -2
  69. package/dist/composed/schedule-view.js.map +1 -1
  70. package/dist/composed/status-badge.d.ts.map +1 -1
  71. package/dist/composed/status-badge.js +29 -28
  72. package/dist/composed/status-badge.js.map +1 -1
  73. package/dist/motion/index.d.ts +1 -0
  74. package/dist/motion/index.d.ts.map +1 -1
  75. package/dist/motion/index.js +2 -15
  76. package/dist/motion/motion-preference.d.ts +36 -0
  77. package/dist/motion/motion-preference.d.ts.map +1 -0
  78. package/dist/motion/motion-provider.d.ts +2 -1
  79. package/dist/motion/motion-provider.d.ts.map +1 -1
  80. package/dist/motion/primitives-index.js +103 -102
  81. package/dist/motion/primitives-index.js.map +1 -1
  82. package/dist/motion/primitives.d.ts.map +1 -1
  83. package/dist/shell/bottom-navbar.js +19 -19
  84. package/dist/shell/bottom-navbar.js.map +1 -1
  85. package/dist/shell/index.d.ts +1 -1
  86. package/dist/shell/index.d.ts.map +1 -1
  87. package/dist/shell/notification-center.d.ts +17 -0
  88. package/dist/shell/notification-center.d.ts.map +1 -1
  89. package/dist/shell/notification-center.js +109 -104
  90. package/dist/shell/notification-center.js.map +1 -1
  91. package/dist/shell/notification-preferences.js +1 -1
  92. package/dist/shell/notification-preferences.js.map +1 -1
  93. package/dist/shell/top-bar.js +1 -1
  94. package/dist/shell/top-bar.js.map +1 -1
  95. package/dist/tokens/index.css +1 -0
  96. package/dist/tokens/palettes.css +292 -0
  97. package/dist/tokens/semantic.css +157 -11
  98. package/dist/tokens/shilp-sutra.css +1 -0
  99. package/dist/tokens/utilities.css +10 -7
  100. package/dist/ui/accordion.d.ts.map +1 -1
  101. package/dist/ui/accordion.js +27 -26
  102. package/dist/ui/accordion.js.map +1 -1
  103. package/dist/ui/alert-dialog.d.ts.map +1 -1
  104. package/dist/ui/alert-dialog.js +60 -59
  105. package/dist/ui/alert-dialog.js.map +1 -1
  106. package/dist/ui/alert.d.ts.map +1 -1
  107. package/dist/ui/alert.js +55 -113
  108. package/dist/ui/alert.js.map +1 -1
  109. package/dist/ui/autocomplete.js +80 -80
  110. package/dist/ui/autocomplete.js.map +1 -1
  111. package/dist/ui/avatar.d.ts.map +1 -1
  112. package/dist/ui/avatar.js +71 -70
  113. package/dist/ui/avatar.js.map +1 -1
  114. package/dist/ui/badge-indicator.d.ts +4 -8
  115. package/dist/ui/badge-indicator.d.ts.map +1 -1
  116. package/dist/ui/badge-indicator.js +3 -8
  117. package/dist/ui/badge-indicator.js.map +1 -1
  118. package/dist/ui/badge.d.ts +8 -1
  119. package/dist/ui/badge.d.ts.map +1 -1
  120. package/dist/ui/banner.d.ts.map +1 -1
  121. package/dist/ui/banner.js +42 -40
  122. package/dist/ui/banner.js.map +1 -1
  123. package/dist/ui/bulk-action-bar.d.ts +59 -0
  124. package/dist/ui/bulk-action-bar.d.ts.map +1 -0
  125. package/dist/ui/bulk-action-bar.js +145 -0
  126. package/dist/ui/bulk-action-bar.js.map +1 -0
  127. package/dist/ui/button-group.d.ts.map +1 -1
  128. package/dist/ui/button-group.js +3 -23
  129. package/dist/ui/button-group.js.map +1 -1
  130. package/dist/ui/button.d.ts +10 -1
  131. package/dist/ui/button.d.ts.map +1 -1
  132. package/dist/ui/button.js +79 -212
  133. package/dist/ui/button.js.map +1 -1
  134. package/dist/ui/card.d.ts.map +1 -1
  135. package/dist/ui/card.js +75 -72
  136. package/dist/ui/card.js.map +1 -1
  137. package/dist/ui/charts/radar-chart.d.ts.map +1 -1
  138. package/dist/ui/charts/radar-chart.js +1 -1
  139. package/dist/ui/charts/radar-chart.js.map +1 -1
  140. package/dist/ui/chat/message-list.d.ts.map +1 -1
  141. package/dist/ui/chat/message.d.ts.map +1 -1
  142. package/dist/ui/chat/typing-indicator.d.ts.map +1 -1
  143. package/dist/ui/checkbox.d.ts.map +1 -1
  144. package/dist/ui/checkbox.js +1 -1
  145. package/dist/ui/checkbox.js.map +1 -1
  146. package/dist/ui/code.js +1 -1
  147. package/dist/ui/code.js.map +1 -1
  148. package/dist/ui/color-input.d.ts.map +1 -1
  149. package/dist/ui/color-input.js +151 -150
  150. package/dist/ui/color-input.js.map +1 -1
  151. package/dist/ui/combobox.d.ts +14 -0
  152. package/dist/ui/combobox.d.ts.map +1 -1
  153. package/dist/ui/combobox.js +162 -158
  154. package/dist/ui/combobox.js.map +1 -1
  155. package/dist/ui/context-menu.d.ts.map +1 -1
  156. package/dist/ui/context-menu.js +70 -69
  157. package/dist/ui/context-menu.js.map +1 -1
  158. package/dist/ui/data-table-body.d.ts.map +1 -1
  159. package/dist/ui/data-table-body.js +4 -3
  160. package/dist/ui/data-table-body.js.map +1 -1
  161. package/dist/ui/data-table-bulk-actions.d.ts +26 -1
  162. package/dist/ui/data-table-bulk-actions.d.ts.map +1 -1
  163. package/dist/ui/data-table-bulk-actions.js +21 -46
  164. package/dist/ui/data-table-bulk-actions.js.map +1 -1
  165. package/dist/ui/data-table-context.d.ts +36 -2
  166. package/dist/ui/data-table-context.d.ts.map +1 -1
  167. package/dist/ui/data-table-context.js +25 -21
  168. package/dist/ui/data-table-context.js.map +1 -1
  169. package/dist/ui/data-table-header.d.ts.map +1 -1
  170. package/dist/ui/data-table-header.js +42 -40
  171. package/dist/ui/data-table-header.js.map +1 -1
  172. package/dist/ui/data-table-pagination.js +2 -2
  173. package/dist/ui/data-table-pagination.js.map +1 -1
  174. package/dist/ui/dialog.d.ts.map +1 -1
  175. package/dist/ui/dialog.js +61 -60
  176. package/dist/ui/dialog.js.map +1 -1
  177. package/dist/ui/dot.d.ts.map +1 -1
  178. package/dist/ui/dot.js +10 -41
  179. package/dist/ui/dot.js.map +1 -1
  180. package/dist/ui/dropdown-menu.d.ts.map +1 -1
  181. package/dist/ui/dropdown-menu.js +79 -78
  182. package/dist/ui/dropdown-menu.js.map +1 -1
  183. package/dist/ui/file-upload.d.ts.map +1 -1
  184. package/dist/ui/file-upload.js +116 -115
  185. package/dist/ui/file-upload.js.map +1 -1
  186. package/dist/ui/form.d.ts.map +1 -1
  187. package/dist/ui/form.js +27 -26
  188. package/dist/ui/form.js.map +1 -1
  189. package/dist/ui/hover-card.d.ts.map +1 -1
  190. package/dist/ui/hover-card.js +26 -25
  191. package/dist/ui/hover-card.js.map +1 -1
  192. package/dist/ui/icon.js +7 -7
  193. package/dist/ui/index.d.ts +3 -2
  194. package/dist/ui/index.d.ts.map +1 -1
  195. package/dist/ui/index.js +60 -59
  196. package/dist/ui/index.js.map +1 -1
  197. package/dist/ui/input.d.ts.map +1 -1
  198. package/dist/ui/input.js +7 -7
  199. package/dist/ui/input.js.map +1 -1
  200. package/dist/ui/menubar.d.ts.map +1 -1
  201. package/dist/ui/menubar.js +73 -72
  202. package/dist/ui/menubar.js.map +1 -1
  203. package/dist/ui/navigation-menu.d.ts.map +1 -1
  204. package/dist/ui/navigation-menu.js +80 -79
  205. package/dist/ui/navigation-menu.js.map +1 -1
  206. package/dist/ui/popover.d.ts.map +1 -1
  207. package/dist/ui/progress.d.ts.map +1 -1
  208. package/dist/ui/progress.js +72 -68
  209. package/dist/ui/progress.js.map +1 -1
  210. package/dist/ui/radio.d.ts.map +1 -1
  211. package/dist/ui/radio.js +35 -34
  212. package/dist/ui/radio.js.map +1 -1
  213. package/dist/ui/search-input.d.ts.map +1 -1
  214. package/dist/ui/search-input.js +28 -27
  215. package/dist/ui/search-input.js.map +1 -1
  216. package/dist/ui/select.d.ts.map +1 -1
  217. package/dist/ui/select.js +70 -69
  218. package/dist/ui/select.js.map +1 -1
  219. package/dist/ui/sidebar.d.ts.map +1 -1
  220. package/dist/ui/sidebar.js +4 -4
  221. package/dist/ui/sidebar.js.map +1 -1
  222. package/dist/ui/slider.d.ts +63 -9
  223. package/dist/ui/slider.d.ts.map +1 -1
  224. package/dist/ui/slider.js +74 -32
  225. package/dist/ui/slider.js.map +1 -1
  226. package/dist/ui/split-button.d.ts +8 -2
  227. package/dist/ui/split-button.d.ts.map +1 -1
  228. package/dist/ui/split-button.js +49 -95
  229. package/dist/ui/split-button.js.map +1 -1
  230. package/dist/ui/stat-card.d.ts.map +1 -1
  231. package/dist/ui/stat-card.js +89 -88
  232. package/dist/ui/stat-card.js.map +1 -1
  233. package/dist/ui/stat-flash.js +16 -16
  234. package/dist/ui/stepper.d.ts.map +1 -1
  235. package/dist/ui/stepper.js +63 -62
  236. package/dist/ui/stepper.js.map +1 -1
  237. package/dist/ui/switch.d.ts.map +1 -1
  238. package/dist/ui/switch.js +2 -2
  239. package/dist/ui/switch.js.map +1 -1
  240. package/dist/ui/table.d.ts.map +1 -1
  241. package/dist/ui/table.js +3 -3
  242. package/dist/ui/table.js.map +1 -1
  243. package/dist/ui/tabs.d.ts.map +1 -1
  244. package/dist/ui/tabs.js +67 -66
  245. package/dist/ui/tabs.js.map +1 -1
  246. package/dist/ui/textarea.d.ts.map +1 -1
  247. package/dist/ui/textarea.js +7 -7
  248. package/dist/ui/textarea.js.map +1 -1
  249. package/dist/ui/toast.d.ts.map +1 -1
  250. package/dist/ui/toast.js +196 -195
  251. package/dist/ui/toast.js.map +1 -1
  252. package/dist/ui/toggle.d.ts.map +1 -1
  253. package/dist/ui/toggle.js +24 -22
  254. package/dist/ui/toggle.js.map +1 -1
  255. package/dist/ui/tooltip.d.ts.map +1 -1
  256. package/dist/ui/tooltip.js +37 -36
  257. package/dist/ui/tooltip.js.map +1 -1
  258. package/dist/ui/tree-view/tree-item.d.ts.map +1 -1
  259. package/docs/components/composed/bulk-action-bar.md +14 -7
  260. package/docs/components/ui/bulk-action-bar.md +72 -0
  261. package/docs/recipes/customize-brand.md +58 -0
  262. package/docs/recipes/install-astro.md +1 -1
  263. package/docs/recipes/install-next-app-router.md +1 -1
  264. package/docs/recipes/install-next-pages.md +22 -1
  265. package/docs/recipes/install-remix.md +1 -1
  266. package/docs/recipes/install-tanstack-start.md +1 -1
  267. package/docs/recipes/install-vite.md +2 -1
  268. package/docs/recipes/server-components.md +7 -4
  269. package/docs/recipes/troubleshoot.md +1 -0
  270. package/llms.txt +2 -2
  271. package/make-kit/foundations/color.md +3 -1
  272. package/mcp-manifest.json +184 -151
  273. package/package.json +8 -2
  274. package/skill/SKILL.md +1 -1
  275. package/skill/references/components.md +2 -2
  276. package/skill/references/customize-brand.md +58 -0
  277. package/skill/references/server-components.md +7 -4
  278. package/skill/references/setup-astro.md +1 -1
  279. package/skill/references/setup-next-app-router.md +1 -1
  280. package/skill/references/setup-next-pages.md +22 -1
  281. package/skill/references/setup-remix.md +1 -1
  282. package/skill/references/setup-tanstack-start.md +1 -1
  283. package/skill/references/setup-vite.md +2 -1
  284. package/skill/references/troubleshoot.md +1 -0
  285. package/dist/composed/bulk-action-bar.js.map +0 -1
  286. package/dist/motion/check-motion-provider.d.ts +0 -2
  287. package/dist/motion/check-motion-provider.d.ts.map +0 -1
  288. package/dist/motion/index.js.map +0 -1
package/dist/ui/banner.js CHANGED
@@ -1,36 +1,37 @@
1
1
  "use client";
2
2
  import { motionProps as e, springs as t } from "./lib/motion.js";
3
- import { cn as n } from "./lib/utils.js";
4
- import { Icon as r } from "./icon.js";
5
- import * as i from "react";
6
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
- import { IconAlertCircle as s, IconAlertTriangle as c, IconCircleCheck as l, IconInfoCircle as u, IconX as d } from "@tabler/icons-react";
8
- import { AnimatePresence as f, motion as p } from "framer-motion";
9
- import { cva as m } from "class-variance-authority";
3
+ import { MotionPreference as n } from "../_chunks/motion-preference.js";
4
+ import { cn as r } from "./lib/utils.js";
5
+ import { Icon as i } from "./icon.js";
6
+ import * as a from "react";
7
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
8
+ import { IconAlertCircle as c, IconAlertTriangle as l, IconCircleCheck as u, IconInfoCircle as d, IconX as f } from "@tabler/icons-react";
9
+ import { AnimatePresence as p, motion as m } from "framer-motion";
10
+ import { cva as h } from "class-variance-authority";
10
11
  //#region src/ui/banner.tsx
11
- var h = m("flex flex-wrap items-center gap-ds-04 px-ds-06 py-ds-04 text-body-md font-medium border-b", {
12
+ var g = h("flex flex-wrap items-center gap-ds-04 px-ds-06 py-ds-04 text-body-md font-medium border-b", {
12
13
  variants: { color: {
13
- info: "bg-info-3 border-info-7 text-info-11",
14
- success: "bg-success-3 border-success-7 text-success-11",
15
- warning: "bg-warning-3 border-warning-7 text-warning-11",
16
- error: "bg-error-3 border-error-7 text-error-11",
14
+ info: "bg-palette-soft border-palette-border text-palette-text",
15
+ success: "bg-palette-soft border-palette-border text-palette-text",
16
+ warning: "bg-palette-soft border-palette-border text-palette-text",
17
+ error: "bg-palette-soft border-palette-border text-palette-text",
17
18
  neutral: "bg-surface-panel border-surface-border-strong text-surface-fg [&>svg]:text-surface-fg-muted"
18
19
  } },
19
20
  defaultVariants: { color: "info" }
20
- }), g = {
21
- info: u,
22
- success: l,
23
- warning: c,
24
- error: s,
25
- neutral: u
26
- }, _ = i.forwardRef(({ className: s, color: c = "info", actions: l, onDismiss: u, children: m, ..._ }, v) => {
27
- let y = g[c ?? "info"], [b, x] = i.useState(!0), S = i.useCallback(() => {
28
- x(!1);
21
+ }), _ = {
22
+ info: d,
23
+ success: u,
24
+ warning: l,
25
+ error: c,
26
+ neutral: d
27
+ }, v = a.forwardRef(({ className: c, color: l = "info", actions: u, onDismiss: d, children: h, ...v }, y) => {
28
+ let b = _[l ?? "info"], [x, S] = a.useState(!0), C = a.useCallback(() => {
29
+ S(!1);
29
30
  }, []);
30
- return /* @__PURE__ */ a(f, {
31
- onExitComplete: u,
32
- children: b && /* @__PURE__ */ o(p.div, {
33
- ref: v,
31
+ return /* @__PURE__ */ o(n, { children: /* @__PURE__ */ o(p, {
32
+ onExitComplete: d,
33
+ children: x && /* @__PURE__ */ s(m.div, {
34
+ ref: y,
34
35
  initial: {
35
36
  height: "auto",
36
37
  opacity: 1
@@ -40,38 +41,39 @@ var h = m("flex flex-wrap items-center gap-ds-04 px-ds-06 py-ds-04 text-body-md
40
41
  opacity: 0
41
42
  },
42
43
  transition: t.snappy,
43
- className: n(h({ color: c }), "overflow-hidden", s),
44
+ "data-palette": l,
45
+ className: r(g({ color: l }), "overflow-hidden", c),
44
46
  role: "alert",
45
- ...e(_),
47
+ ...e(v),
46
48
  children: [
47
- /* @__PURE__ */ a(r, {
48
- icon: y,
49
+ /* @__PURE__ */ o(i, {
50
+ icon: b,
49
51
  size: "md",
50
52
  className: "shrink-0"
51
53
  }),
52
- /* @__PURE__ */ a("div", {
54
+ /* @__PURE__ */ o("div", {
53
55
  className: "min-w-0 flex-1",
54
- children: m
56
+ children: h
55
57
  }),
56
- l && /* @__PURE__ */ a("div", {
58
+ u && /* @__PURE__ */ o("div", {
57
59
  className: "flex shrink-0 items-center gap-ds-02 [&_button]:transition-colors [&_button]:duration-moderate-01 [&_button]:ease-productive-standard [&_button:hover]:bg-current/10",
58
- children: l
60
+ children: u
59
61
  }),
60
- u && /* @__PURE__ */ a("button", {
62
+ d && /* @__PURE__ */ o("button", {
61
63
  type: "button",
62
- onClick: S,
64
+ onClick: C,
63
65
  className: "shrink-0 min-h-ds-xs min-w-ds-xs flex items-center justify-center rounded-control-inner transition-colors duration-moderate-01 ease-productive-standard hover:bg-current/10 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9",
64
66
  "aria-label": "Dismiss",
65
67
  title: "Dismiss",
66
- children: /* @__PURE__ */ a(r, {
67
- icon: d,
68
+ children: /* @__PURE__ */ o(i, {
69
+ icon: f,
68
70
  size: "sm"
69
71
  })
70
72
  })
71
73
  ]
72
74
  })
73
- });
75
+ }) });
74
76
  });
75
- _.displayName = "Banner";
77
+ v.displayName = "Banner";
76
78
  //#endregion
77
- export { _ as Banner, h as bannerVariants };
79
+ export { v as Banner, g as bannerVariants };
@@ -1 +1 @@
1
- {"version":3,"file":"banner.js","names":[],"sources":["../../src/ui/banner.tsx"],"sourcesContent":["'use client'\n\nimport { IconAlertCircle, IconAlertTriangle,IconCircleCheck, IconInfoCircle, IconX } from '@tabler/icons-react'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { AnimatePresence,motion } from 'framer-motion'\nimport * as React from 'react'\n\nimport { Icon } from './icon'\nimport { motionProps,springs } from './lib/motion'\nimport { cn } from './lib/utils'\n\nconst bannerVariants = cva(\n 'flex flex-wrap items-center gap-ds-04 px-ds-06 py-ds-04 text-body-md font-medium border-b',\n {\n variants: {\n color: {\n info:\n 'bg-info-3 border-info-7 text-info-11',\n success:\n 'bg-success-3 border-success-7 text-success-11',\n warning:\n 'bg-warning-3 border-warning-7 text-warning-11',\n error:\n 'bg-error-3 border-error-7 text-error-11',\n neutral:\n 'bg-surface-panel border-surface-border-strong text-surface-fg [&>svg]:text-surface-fg-muted',\n },\n },\n defaultVariants: { color: 'info' },\n },\n)\n\nconst BANNER_ICONS: Record<string, React.ForwardRefExoticComponent<any>> = {\n info: IconInfoCircle,\n success: IconCircleCheck,\n warning: IconAlertTriangle,\n error: IconAlertCircle,\n neutral: IconInfoCircle,\n}\n\n/**\n * Props for Banner — a full-width notification strip with a colored icon, message, optional\n * action slot, and an optional dismiss button. Renders with `role=\"alert\"`.\n *\n * **Colors:** `info` (default) | `success` | `warning` | `error` | `neutral`\n *\n * **Banner vs Alert:** Banner spans the full width of its container (e.g., top of a page or section).\n * Alert is an inline block inside page content. Use Banner for system-level announcements.\n *\n * **`actions` slot:** Accepts any React node(s) — typically one or more `<Button variant=\"ghost\" size=\"sm\">`.\n * Multiple actions wrap gracefully on narrow viewports.\n * **Dismissible:** Provide `onDismiss` to show an × button.\n *\n * @example\n * // Maintenance warning at top of the dashboard:\n * <Banner color=\"warning\">\n * Scheduled maintenance on Sunday 2am–4am UTC. Expect brief downtime.\n * </Banner>\n *\n * @example\n * // Success banner with a CTA action button:\n * <Banner color=\"success\" actions={<Button variant=\"ghost\" size=\"sm\">View report</Button>}>\n * Your export is ready.\n * </Banner>\n *\n * @example\n * // Dismissible info banner for a new feature announcement:\n * <Banner color=\"info\" onDismiss={() => markAsSeen('feature-x')}>\n * New: You can now assign tasks directly from the calendar view.\n * </Banner>\n * // These are just a few ways — feel free to combine props creatively!\n */\nexport interface BannerProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color'>,\n VariantProps<typeof bannerVariants> {\n /** Action slot — accepts any React node(s), typically ghost Buttons. */\n actions?: React.ReactNode\n onDismiss?: () => void\n}\n\nconst Banner = React.forwardRef<HTMLDivElement, BannerProps>(\n ({ className, color = 'info', actions, onDismiss, children, ...props }, ref) => {\n const BannerIcon = BANNER_ICONS[color ?? 'info']\n const [isVisible, setIsVisible] = React.useState(true)\n\n const handleDismiss = React.useCallback(() => {\n setIsVisible(false)\n }, [])\n\n return (\n <AnimatePresence onExitComplete={onDismiss}>\n {isVisible && (\n <motion.div\n ref={ref}\n initial={{ height: 'auto', opacity: 1 }}\n exit={{ height: 0, opacity: 0 }}\n transition={springs.snappy}\n className={cn(bannerVariants({ color }), 'overflow-hidden', className)}\n role=\"alert\"\n {...motionProps(props)}\n >\n <Icon icon={BannerIcon} size=\"md\" className=\"shrink-0\" />\n <div className=\"min-w-0 flex-1\">{children}</div>\n {actions && (\n <div className=\"flex shrink-0 items-center gap-ds-02 [&_button]:transition-colors [&_button]:duration-moderate-01 [&_button]:ease-productive-standard [&_button:hover]:bg-current/10\">{actions}</div>\n )}\n {onDismiss && (\n <button\n type=\"button\"\n onClick={handleDismiss}\n className=\"shrink-0 min-h-ds-xs min-w-ds-xs flex items-center justify-center rounded-control-inner transition-colors duration-moderate-01 ease-productive-standard hover:bg-current/10 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9\"\n aria-label=\"Dismiss\"\n title=\"Dismiss\"\n >\n <Icon icon={IconX} size=\"sm\" />\n </button>\n )}\n </motion.div>\n )}\n </AnimatePresence>\n )\n },\n)\nBanner.displayName = 'Banner'\n\nexport { Banner, bannerVariants }\n"],"mappings":";;;;;;;;;;AAWA,IAAM,IAAiB,EACrB,6FACA;CACE,UAAU,EACR,OAAO;EACL,MACE;EACF,SACE;EACF,SACE;EACF,OACE;EACF,SACE;CACJ,EACF;CACA,iBAAiB,EAAE,OAAO,OAAO;AACnC,CACF,GAEM,IAAqE;CACzE,MAAS;CACT,SAAS;CACT,SAAS;CACT,OAAS;CACT,SAAS;AACX,GA0CM,IAAS,EAAM,YAClB,EAAE,cAAW,WAAQ,QAAQ,YAAS,cAAW,aAAU,GAAG,KAAS,MAAQ;CAC9E,IAAM,IAAa,EAAa,KAAS,SACnC,CAAC,GAAW,KAAgB,EAAM,SAAS,EAAI,GAE/C,IAAgB,EAAM,kBAAkB;EAC5C,EAAa,EAAK;CACpB,GAAG,CAAC,CAAC;CAEL,OACE,kBAAC,GAAD;EAAiB,gBAAgB;YAC9B,KACC,kBAAC,EAAO,KAAR;GACO;GACL,SAAS;IAAE,QAAQ;IAAQ,SAAS;GAAE;GACtC,MAAM;IAAE,QAAQ;IAAG,SAAS;GAAE;GAC9B,YAAY,EAAQ;GACpB,WAAW,EAAG,EAAe,EAAE,SAAM,CAAC,GAAG,mBAAmB,CAAS;GACrE,MAAK;GACL,GAAI,EAAY,CAAK;aAPvB;IASE,kBAAC,GAAD;KAAM,MAAM;KAAY,MAAK;KAAK,WAAU;IAAY,CAAA;IACxD,kBAAC,OAAD;KAAK,WAAU;KAAkB;IAAc,CAAA;IAC9C,KACC,kBAAC,OAAD;KAAK,WAAU;eAAwK;IAAa,CAAA;IAErM,KACC,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACT,WAAU;KACV,cAAW;KACX,OAAM;eAEN,kBAAC,GAAD;MAAM,MAAM;MAAO,MAAK;KAAM,CAAA;IACxB,CAAA;GAEA;;CAEC,CAAA;AAErB,CACF;AACA,EAAO,cAAc"}
1
+ {"version":3,"file":"banner.js","names":[],"sources":["../../src/ui/banner.tsx"],"sourcesContent":["'use client'\n\nimport { IconAlertCircle, IconAlertTriangle,IconCircleCheck, IconInfoCircle, IconX } from '@tabler/icons-react'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { AnimatePresence,motion } from 'framer-motion'\nimport * as React from 'react'\n\nimport { MotionPreference } from '../motion/motion-preference'\nimport { Icon } from './icon'\nimport { motionProps,springs } from './lib/motion'\nimport { cn } from './lib/utils'\n\nconst bannerVariants = cva(\n 'flex flex-wrap items-center gap-ds-04 px-ds-06 py-ds-04 text-body-md font-medium border-b',\n {\n variants: {\n // A banner is a full-bleed strip, so it takes the `soft` fill (step 3)\n // rather than the fainter `subtle` a Card uses — the two are separate\n // roles precisely so that difference survives.\n color: {\n info: 'bg-palette-soft border-palette-border text-palette-text',\n success: 'bg-palette-soft border-palette-border text-palette-text',\n warning: 'bg-palette-soft border-palette-border text-palette-text',\n error: 'bg-palette-soft border-palette-border text-palette-text',\n // Neutral is a plain strip, not a grey coloured one: surface ground,\n // full-contrast label, icon stepped back.\n neutral:\n 'bg-surface-panel border-surface-border-strong text-surface-fg [&>svg]:text-surface-fg-muted',\n },\n },\n defaultVariants: { color: 'info' },\n },\n)\n\nconst BANNER_ICONS: Record<string, React.ForwardRefExoticComponent<any>> = {\n info: IconInfoCircle,\n success: IconCircleCheck,\n warning: IconAlertTriangle,\n error: IconAlertCircle,\n neutral: IconInfoCircle,\n}\n\n/**\n * Props for Banner — a full-width notification strip with a colored icon, message, optional\n * action slot, and an optional dismiss button. Renders with `role=\"alert\"`.\n *\n * **Colors:** `info` (default) | `success` | `warning` | `error` | `neutral`\n *\n * **Banner vs Alert:** Banner spans the full width of its container (e.g., top of a page or section).\n * Alert is an inline block inside page content. Use Banner for system-level announcements.\n *\n * **`actions` slot:** Accepts any React node(s) — typically one or more `<Button variant=\"ghost\" size=\"sm\">`.\n * Multiple actions wrap gracefully on narrow viewports.\n * **Dismissible:** Provide `onDismiss` to show an × button.\n *\n * @example\n * // Maintenance warning at top of the dashboard:\n * <Banner color=\"warning\">\n * Scheduled maintenance on Sunday 2am–4am UTC. Expect brief downtime.\n * </Banner>\n *\n * @example\n * // Success banner with a CTA action button:\n * <Banner color=\"success\" actions={<Button variant=\"ghost\" size=\"sm\">View report</Button>}>\n * Your export is ready.\n * </Banner>\n *\n * @example\n * // Dismissible info banner for a new feature announcement:\n * <Banner color=\"info\" onDismiss={() => markAsSeen('feature-x')}>\n * New: You can now assign tasks directly from the calendar view.\n * </Banner>\n * // These are just a few ways — feel free to combine props creatively!\n */\nexport interface BannerProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color'>,\n VariantProps<typeof bannerVariants> {\n /** Action slot — accepts any React node(s), typically ghost Buttons. */\n actions?: React.ReactNode\n onDismiss?: () => void\n}\n\nconst Banner = React.forwardRef<HTMLDivElement, BannerProps>(\n ({ className, color = 'info', actions, onDismiss, children, ...props }, ref) => {\n const BannerIcon = BANNER_ICONS[color ?? 'info']\n const [isVisible, setIsVisible] = React.useState(true)\n\n const handleDismiss = React.useCallback(() => {\n setIsVisible(false)\n }, [])\n\n return (\n <MotionPreference>\n <AnimatePresence onExitComplete={onDismiss}>\n {isVisible && (\n <motion.div\n ref={ref}\n initial={{ height: 'auto', opacity: 1 }}\n exit={{ height: 0, opacity: 0 }}\n transition={springs.snappy}\n data-palette={color}\n className={cn(bannerVariants({ color }), 'overflow-hidden', className)}\n role=\"alert\"\n {...motionProps(props)}\n >\n <Icon icon={BannerIcon} size=\"md\" className=\"shrink-0\" />\n <div className=\"min-w-0 flex-1\">{children}</div>\n {actions && (\n <div className=\"flex shrink-0 items-center gap-ds-02 [&_button]:transition-colors [&_button]:duration-moderate-01 [&_button]:ease-productive-standard [&_button:hover]:bg-current/10\">{actions}</div>\n )}\n {onDismiss && (\n <button\n type=\"button\"\n onClick={handleDismiss}\n className=\"shrink-0 min-h-ds-xs min-w-ds-xs flex items-center justify-center rounded-control-inner transition-colors duration-moderate-01 ease-productive-standard hover:bg-current/10 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9\"\n aria-label=\"Dismiss\"\n title=\"Dismiss\"\n >\n <Icon icon={IconX} size=\"sm\" />\n </button>\n )}\n </motion.div>\n )}\n </AnimatePresence>\n </MotionPreference>\n )\n },\n)\nBanner.displayName = 'Banner'\n\nexport { Banner, bannerVariants }\n"],"mappings":";;;;;;;;;;;AAYA,IAAM,IAAiB,EACrB,6FACA;CACE,UAAU,EAIR,OAAO;EACL,MAAM;EACN,SAAS;EACT,SAAS;EACT,OAAO;EAGP,SACE;CACJ,EACF;CACA,iBAAiB,EAAE,OAAO,OAAO;AACnC,CACF,GAEM,IAAqE;CACzE,MAAS;CACT,SAAS;CACT,SAAS;CACT,OAAS;CACT,SAAS;AACX,GA0CM,IAAS,EAAM,YAClB,EAAE,cAAW,WAAQ,QAAQ,YAAS,cAAW,aAAU,GAAG,KAAS,MAAQ;CAC9E,IAAM,IAAa,EAAa,KAAS,SACnC,CAAC,GAAW,KAAgB,EAAM,SAAS,EAAI,GAE/C,IAAgB,EAAM,kBAAkB;EAC5C,EAAa,EAAK;CACpB,GAAG,CAAC,CAAC;CAEL,OACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;EAAiB,gBAAgB;YAC9B,KACC,kBAAC,EAAO,KAAR;GACO;GACL,SAAS;IAAE,QAAQ;IAAQ,SAAS;GAAE;GACtC,MAAM;IAAE,QAAQ;IAAG,SAAS;GAAE;GAC9B,YAAY,EAAQ;GACpB,gBAAc;GACd,WAAW,EAAG,EAAe,EAAE,SAAM,CAAC,GAAG,mBAAmB,CAAS;GACrE,MAAK;GACL,GAAI,EAAY,CAAK;aARvB;IAUE,kBAAC,GAAD;KAAM,MAAM;KAAY,MAAK;KAAK,WAAU;IAAY,CAAA;IACxD,kBAAC,OAAD;KAAK,WAAU;KAAkB;IAAc,CAAA;IAC9C,KACC,kBAAC,OAAD;KAAK,WAAU;eAAwK;IAAa,CAAA;IAErM,KACC,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACT,WAAU;KACV,cAAW;KACX,OAAM;eAEN,kBAAC,GAAD;MAAM,MAAM;MAAO,MAAK;KAAM,CAAA;IACxB,CAAA;GAEA;;CAEC,CAAA,EACD,CAAA;AAEtB,CACF;AACA,EAAO,cAAc"}
@@ -0,0 +1,59 @@
1
+ import { Button } from './button.js';
2
+ import { IconInput } from './lib/icon-input.js';
3
+ import * as React from 'react';
4
+ type ButtonColor = React.ComponentProps<typeof Button>['color'];
5
+ export interface BulkActionBarAction {
6
+ label: string;
7
+ icon?: IconInput;
8
+ onClick: () => void;
9
+ /** Any Button color. @default 'accent' (or 'error' for destructive). */
10
+ color?: ButtonColor;
11
+ disabled?: boolean;
12
+ /** Show a pending spinner on the action (e.g. slow bulk op in flight). */
13
+ loading?: boolean;
14
+ /** Show inline confirmation before executing the action. */
15
+ requiresConfirmation?: boolean;
16
+ /** Custom confirmation message. @default 'Are you sure?' */
17
+ confirmMessage?: string;
18
+ }
19
+ export interface BulkActionBarProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children' | 'color' | 'onDrag' | 'onDragStart' | 'onDragEnd' | 'onAnimationStart' | 'onAnimationEnd' | 'onAnimationIteration' | 'style'> {
20
+ show: boolean;
21
+ count: number;
22
+ onClearSelection: () => void;
23
+ actions: BulkActionBarAction[];
24
+ /** Total items available for selection (enables "Select all"). */
25
+ totalCount?: number;
26
+ /** Called when the user clicks "Select all". */
27
+ onSelectAll?: () => void;
28
+ /**
29
+ * Where the bar sits, and — as a consequence — whether it is portalled.
30
+ *
31
+ * `bottom` / `top` pin it to the viewport and render through a portal to
32
+ * `document.body`. `inline` renders it in flow, in place, with no portal.
33
+ *
34
+ * Position and portalling are one prop rather than two because they are not
35
+ * independent: a portal escapes its ancestors' stacking context, so a
36
+ * portalled bar inside a Dialog or Sheet floats over the page rather than
37
+ * belonging to the overlay. `inline` is the answer there, and it can only
38
+ * work in flow.
39
+ *
40
+ * Every system surveyed before building this — Carbon, Polaris, Material —
41
+ * renders its bulk bar in flow, anchored to whatever holds the selection.
42
+ * The default stays `bottom` because that is what this component already did.
43
+ *
44
+ * @default 'bottom'
45
+ */
46
+ placement?: BulkActionsPlacement;
47
+ }
48
+ /** Where the bar sits. `inline` is the only one that is not portalled. */
49
+ export type BulkActionsPlacement = 'bottom' | 'top' | 'inline';
50
+ /**
51
+ * BulkActionBar — floating selection toolbar. Follows the ARIA toolbar model:
52
+ * a single tab stop with roving focus (Arrow keys / Home / End) across ALL
53
+ * controls (Select-all, actions, Clear), focus landing on the real buttons so
54
+ * Enter/Space activate them. Arrow direction mirrors under `dir="rtl"`. Escape
55
+ * clears the selection (or cancels a pending confirmation).
56
+ */
57
+ declare const BulkActionBar: React.ForwardRefExoticComponent<BulkActionBarProps & React.RefAttributes<HTMLDivElement>>;
58
+ export { BulkActionBar };
59
+ //# sourceMappingURL=bulk-action-bar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bulk-action-bar.d.ts","sourceRoot":"","sources":["../../src/ui/bulk-action-bar.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAIjD,KAAK,WAAW,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC,OAAO,CAAC,CAAA;AAE/D,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,wEAAwE;IACxE,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,4DAA4D;IAC5D,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,4DAA4D;IAC5D,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,kBACf,SAAQ,IAAI,CACV,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAEpC,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,aAAa,GAAG,WAAW,GAAG,kBAAkB,GAAG,gBAAgB,GAAG,sBAAsB,GAAG,OAAO,CACzI;IACD,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,gBAAgB,EAAE,MAAM,IAAI,CAAA;IAC5B,OAAO,EAAE,mBAAmB,EAAE,CAAA;IAC9B,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,IAAI,CAAA;IACxB;;;;;;;;;;;;;;;;;OAiBG;IACH,SAAS,CAAC,EAAE,oBAAoB,CAAA;CACjC;AAED,0EAA0E;AAC1E,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,KAAK,GAAG,QAAQ,CAAA;AAS9D;;;;;;GAMG;AACH,QAAA,MAAM,aAAa,2FAqLlB,CAAA;AAGD,OAAO,EAAE,aAAa,EAAE,CAAA"}
@@ -0,0 +1,145 @@
1
+ "use client";
2
+ import { springs as e } from "./lib/motion.js";
3
+ import { cn as t } from "./lib/utils.js";
4
+ import { Icon as n } from "./icon.js";
5
+ import { BadgeCompound as r } from "../_chunks/badge-group.js";
6
+ import { Button as i } from "./button.js";
7
+ import * as a from "react";
8
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
9
+ import { createPortal as c } from "react-dom";
10
+ import { IconX as l } from "@tabler/icons-react";
11
+ import { AnimatePresence as u, motion as d, useReducedMotion as f } from "framer-motion";
12
+ //#region src/ui/bulk-action-bar.tsx
13
+ var p = {
14
+ bottom: "fixed bottom-ds-06 start-1/2 z-sticky -translate-x-1/2",
15
+ top: "fixed top-ds-06 start-1/2 z-sticky -translate-x-1/2",
16
+ inline: "relative"
17
+ }, m = a.forwardRef(function({ show: m, count: h, onClearSelection: g, actions: _, totalCount: v, onSelectAll: y, placement: b = "bottom", className: x, ...S }, C) {
18
+ let w = f(), [T, E] = a.useState(!1), [D, O] = a.useState(0), [k, A] = a.useState(null), j = a.useRef([]), M = a.useRef(null), N = v != null && v > h && !!y, P = +!!N, F = P + _.length + 1;
19
+ a.useEffect(() => {
20
+ E(!0);
21
+ }, []), a.useEffect(() => {
22
+ O(0), A(null);
23
+ }, [_.length]), a.useEffect(() => {
24
+ k != null && M.current?.focus();
25
+ }, [k]);
26
+ let I = (e) => {
27
+ let t = (e + F) % F;
28
+ O(t), j.current[t]?.focus();
29
+ };
30
+ function L(e) {
31
+ if (e.key === "Escape") {
32
+ e.preventDefault(), k == null ? g() : (A(null), I(D));
33
+ return;
34
+ }
35
+ if (k != null) return;
36
+ let t = e.currentTarget.dir === "rtl" || document.dir === "rtl", n = t ? "ArrowLeft" : "ArrowRight", r = t ? "ArrowRight" : "ArrowLeft";
37
+ e.key === n ? (e.preventDefault(), I(D + 1)) : e.key === r ? (e.preventDefault(), I(D - 1)) : e.key === "Home" ? (e.preventDefault(), I(0)) : e.key === "End" && (e.preventDefault(), I(F - 1));
38
+ }
39
+ let R = b !== "inline";
40
+ if (R && !T) return null;
41
+ let z = w ? { duration: 0 } : e.smooth, B = b === "top" ? {
42
+ y: -100,
43
+ opacity: 0
44
+ } : {
45
+ y: 100,
46
+ opacity: 0
47
+ }, V = /* @__PURE__ */ o(u, { children: m && /* @__PURE__ */ s(d.div, {
48
+ ref: C,
49
+ initial: w || !R ? { opacity: 0 } : B,
50
+ animate: w || !R ? { opacity: 1 } : {
51
+ y: 0,
52
+ opacity: 1
53
+ },
54
+ exit: w || !R ? { opacity: 0 } : B,
55
+ transition: z,
56
+ className: t(p[b], "flex items-center gap-ds-04 rounded-surface bg-surface-overlay px-ds-05 py-ds-03 shadow-floating", x),
57
+ role: "toolbar",
58
+ "aria-label": "Bulk actions",
59
+ onKeyDown: L,
60
+ ...S,
61
+ children: [
62
+ /* @__PURE__ */ s(r, {
63
+ variant: "solid",
64
+ size: "sm",
65
+ children: [h, " selected"]
66
+ }),
67
+ N && /* @__PURE__ */ s(i, {
68
+ ref: (e) => {
69
+ j.current[0] = e;
70
+ },
71
+ variant: "link",
72
+ size: "xs",
73
+ tabIndex: D === 0 ? 0 : -1,
74
+ onClick: y,
75
+ children: ["Select all ", v]
76
+ }),
77
+ /* @__PURE__ */ o("div", {
78
+ className: "flex items-center gap-ds-02",
79
+ children: _.map((e, t) => {
80
+ let n = P + t;
81
+ return k === t ? /* @__PURE__ */ s("div", {
82
+ role: "group",
83
+ "aria-live": "assertive",
84
+ className: "flex items-center gap-ds-02",
85
+ children: [
86
+ /* @__PURE__ */ o("span", {
87
+ className: "whitespace-nowrap text-body-sm text-surface-fg-muted",
88
+ children: e.confirmMessage ?? "Are you sure?"
89
+ }),
90
+ /* @__PURE__ */ o(i, {
91
+ ref: M,
92
+ variant: "solid",
93
+ size: "sm",
94
+ color: e.color === "error" ? "error" : e.color ?? "accent",
95
+ onClick: () => {
96
+ A(null), e.onClick();
97
+ },
98
+ children: "Confirm"
99
+ }),
100
+ /* @__PURE__ */ o(i, {
101
+ variant: "ghost",
102
+ size: "sm",
103
+ onClick: () => {
104
+ A(null), I(n);
105
+ },
106
+ children: "Cancel"
107
+ })
108
+ ]
109
+ }, e.label) : /* @__PURE__ */ o(i, {
110
+ ref: (e) => {
111
+ j.current[n] = e;
112
+ },
113
+ variant: e.color === "error" ? "solid" : "ghost",
114
+ size: "sm",
115
+ color: e.color ?? "accent",
116
+ disabled: e.disabled,
117
+ loading: e.loading,
118
+ startIcon: e.icon ?? void 0,
119
+ tabIndex: D === n ? 0 : -1,
120
+ onClick: e.requiresConfirmation ? () => A(t) : e.onClick,
121
+ children: e.label
122
+ }, e.label);
123
+ })
124
+ }),
125
+ /* @__PURE__ */ o(i, {
126
+ ref: (e) => {
127
+ j.current[F - 1] = e;
128
+ },
129
+ variant: "ghost",
130
+ size: "icon-sm",
131
+ tabIndex: D === F - 1 ? 0 : -1,
132
+ onClick: g,
133
+ "aria-label": "Clear selection",
134
+ children: /* @__PURE__ */ o(n, {
135
+ icon: l,
136
+ size: "sm"
137
+ })
138
+ })
139
+ ]
140
+ }) });
141
+ return R ? c(V, document.body) : V;
142
+ });
143
+ m.displayName = "BulkActionBar";
144
+ //#endregion
145
+ export { m as BulkActionBar };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bulk-action-bar.js","names":[],"sources":["../../src/ui/bulk-action-bar.tsx"],"sourcesContent":["'use client'\n\nimport { IconX } from '@tabler/icons-react'\nimport { AnimatePresence, motion, useReducedMotion } from 'framer-motion'\nimport * as React from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { Badge } from './badge'\nimport { Button } from './button'\nimport { Icon } from './icon'\nimport type { IconInput } from './lib/icon-input'\nimport { springs } from './lib/motion'\nimport { cn } from './lib/utils'\n\ntype ButtonColor = React.ComponentProps<typeof Button>['color']\n\nexport interface BulkActionBarAction {\n label: string\n icon?: IconInput\n onClick: () => void\n /** Any Button color. @default 'accent' (or 'error' for destructive). */\n color?: ButtonColor\n disabled?: boolean\n /** Show a pending spinner on the action (e.g. slow bulk op in flight). */\n loading?: boolean\n /** Show inline confirmation before executing the action. */\n requiresConfirmation?: boolean\n /** Custom confirmation message. @default 'Are you sure?' */\n confirmMessage?: string\n}\n\nexport interface BulkActionBarProps\n extends Omit<\n React.HTMLAttributes<HTMLDivElement>,\n // Keys whose types collide with framer-motion's HTMLMotionProps.\n 'children' | 'color' | 'onDrag' | 'onDragStart' | 'onDragEnd' | 'onAnimationStart' | 'onAnimationEnd' | 'onAnimationIteration' | 'style'\n > {\n show: boolean\n count: number\n onClearSelection: () => void\n actions: BulkActionBarAction[]\n /** Total items available for selection (enables \"Select all\"). */\n totalCount?: number\n /** Called when the user clicks \"Select all\". */\n onSelectAll?: () => void\n /**\n * Where the bar sits, and — as a consequence — whether it is portalled.\n *\n * `bottom` / `top` pin it to the viewport and render through a portal to\n * `document.body`. `inline` renders it in flow, in place, with no portal.\n *\n * Position and portalling are one prop rather than two because they are not\n * independent: a portal escapes its ancestors' stacking context, so a\n * portalled bar inside a Dialog or Sheet floats over the page rather than\n * belonging to the overlay. `inline` is the answer there, and it can only\n * work in flow.\n *\n * Every system surveyed before building this — Carbon, Polaris, Material —\n * renders its bulk bar in flow, anchored to whatever holds the selection.\n * The default stays `bottom` because that is what this component already did.\n *\n * @default 'bottom'\n */\n placement?: BulkActionsPlacement\n}\n\n/** Where the bar sits. `inline` is the only one that is not portalled. */\nexport type BulkActionsPlacement = 'bottom' | 'top' | 'inline'\n\nconst PLACEMENT_CLASSES: Record<BulkActionsPlacement, string> = {\n bottom: 'fixed bottom-ds-06 start-1/2 z-sticky -translate-x-1/2',\n top: 'fixed top-ds-06 start-1/2 z-sticky -translate-x-1/2',\n // No `fixed`, no transform — it takes part in the layout it is placed in.\n inline: 'relative',\n}\n\n/**\n * BulkActionBar — floating selection toolbar. Follows the ARIA toolbar model:\n * a single tab stop with roving focus (Arrow keys / Home / End) across ALL\n * controls (Select-all, actions, Clear), focus landing on the real buttons so\n * Enter/Space activate them. Arrow direction mirrors under `dir=\"rtl\"`. Escape\n * clears the selection (or cancels a pending confirmation).\n */\nconst BulkActionBar = React.forwardRef<HTMLDivElement, BulkActionBarProps>(\n function BulkActionBar(\n {\n show,\n count,\n onClearSelection,\n actions,\n totalCount,\n onSelectAll,\n placement = 'bottom',\n className,\n ...props\n },\n forwardedRef,\n ) {\n const reduced = useReducedMotion()\n const [mounted, setMounted] = React.useState(false)\n const [focusedIndex, setFocusedIndex] = React.useState(0)\n const [confirming, setConfirming] = React.useState<number | null>(null)\n const controlRefs = React.useRef<Array<HTMLButtonElement | null>>([])\n const confirmRef = React.useRef<HTMLButtonElement | null>(null)\n\n const hasSelectAll = totalCount != null && totalCount > count && !!onSelectAll\n const selectAllOffset = hasSelectAll ? 1 : 0\n const total = selectAllOffset + actions.length + 1 // + Clear\n\n React.useEffect(() => { setMounted(true) }, [])\n React.useEffect(() => { setFocusedIndex(0); setConfirming(null) }, [actions.length])\n // Move focus to Confirm when a confirmation opens.\n React.useEffect(() => {\n if (confirming != null) confirmRef.current?.focus()\n }, [confirming])\n\n const focusAt = (i: number) => {\n const clamped = (i + total) % total\n setFocusedIndex(clamped)\n controlRefs.current[clamped]?.focus()\n }\n\n function handleKeyDown(e: React.KeyboardEvent<HTMLDivElement>) {\n if (e.key === 'Escape') {\n e.preventDefault()\n if (confirming != null) { setConfirming(null); focusAt(focusedIndex) }\n else onClearSelection()\n return\n }\n if (confirming != null) return // roving suspended during confirm\n const rtl = e.currentTarget.dir === 'rtl' || document.dir === 'rtl'\n const fwd = rtl ? 'ArrowLeft' : 'ArrowRight'\n const back = rtl ? 'ArrowRight' : 'ArrowLeft'\n if (e.key === fwd) { e.preventDefault(); focusAt(focusedIndex + 1) }\n else if (e.key === back) { e.preventDefault(); focusAt(focusedIndex - 1) }\n else if (e.key === 'Home') { e.preventDefault(); focusAt(0) }\n else if (e.key === 'End') { e.preventDefault(); focusAt(total - 1) }\n }\n\n const portalled = placement !== 'inline'\n\n // The mount gate exists only so `document.body` is available for the\n // portal. An inline bar has no portal, so gating it would cost a\n // server-render for no reason and flash on hydrate.\n if (portalled && !mounted) return null\n\n const slideTransition = reduced ? { duration: 0 } : springs.smooth\n // Slide from the edge it is pinned to; inline just fades, since there is\n // no edge for it to arrive from.\n const offscreen =\n placement === 'top' ? { y: -100, opacity: 0 } : { y: 100, opacity: 0 }\n\n const tree = (\n <AnimatePresence>\n {show && (\n <motion.div\n ref={forwardedRef}\n initial={reduced || !portalled ? { opacity: 0 } : offscreen}\n animate={reduced || !portalled ? { opacity: 1 } : { y: 0, opacity: 1 }}\n exit={reduced || !portalled ? { opacity: 0 } : offscreen}\n transition={slideTransition}\n className={cn(\n PLACEMENT_CLASSES[placement],\n 'flex items-center gap-ds-04 rounded-surface bg-surface-overlay px-ds-05 py-ds-03 shadow-floating',\n className,\n )}\n role=\"toolbar\"\n // A stable name describing PURPOSE, not state. The count is\n // already announced by the Badge below and by the live region on\n // \"Select all\"; putting it in the toolbar's accessible name too\n // means the name changes on every selection change, which a screen\n // reader re-announces. Overridable via aria-label.\n aria-label=\"Bulk actions\"\n onKeyDown={handleKeyDown}\n {...props}\n >\n <Badge variant=\"solid\" size=\"sm\">{count} selected</Badge>\n\n {hasSelectAll && (\n <Button\n ref={(el) => { controlRefs.current[0] = el }}\n variant=\"link\"\n size=\"xs\"\n tabIndex={focusedIndex === 0 ? 0 : -1}\n onClick={onSelectAll}\n >\n Select all {totalCount}\n </Button>\n )}\n\n <div className=\"flex items-center gap-ds-02\">\n {actions.map((action, i) => {\n const controlIndex = selectAllOffset + i\n const isConfirming = confirming === i\n if (isConfirming) {\n return (\n <div\n key={action.label}\n role=\"group\"\n aria-live=\"assertive\"\n className=\"flex items-center gap-ds-02\"\n >\n <span className=\"whitespace-nowrap text-body-sm text-surface-fg-muted\">\n {action.confirmMessage ?? 'Are you sure?'}\n </span>\n <Button\n ref={confirmRef}\n variant=\"solid\"\n size=\"sm\"\n color={action.color === 'error' ? 'error' : (action.color ?? 'accent')}\n onClick={() => { setConfirming(null); action.onClick() }}\n >\n Confirm\n </Button>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => { setConfirming(null); focusAt(controlIndex) }}\n >\n Cancel\n </Button>\n </div>\n )\n }\n return (\n <Button\n key={action.label}\n ref={(el) => { controlRefs.current[controlIndex] = el }}\n // Destructive actions stay solid. Ghost is right for the\n // rest — the bar itself is already the affordance — but a\n // Delete that looks like every other button is the one\n // place where quietness costs something.\n variant={action.color === 'error' ? 'solid' : 'ghost'}\n size=\"sm\"\n color={action.color ?? 'accent'}\n disabled={action.disabled}\n loading={action.loading}\n startIcon={action.icon ?? undefined}\n tabIndex={focusedIndex === controlIndex ? 0 : -1}\n onClick={action.requiresConfirmation ? () => setConfirming(i) : action.onClick}\n >\n {action.label}\n </Button>\n )\n })}\n </div>\n\n <Button\n ref={(el) => { controlRefs.current[total - 1] = el }}\n variant=\"ghost\"\n size=\"icon-sm\"\n tabIndex={focusedIndex === total - 1 ? 0 : -1}\n onClick={onClearSelection}\n aria-label=\"Clear selection\"\n >\n <Icon icon={IconX} size=\"sm\" />\n </Button>\n </motion.div>\n )}\n </AnimatePresence>\n )\n\n return portalled ? createPortal(tree, document.body) : tree\n },\n)\nBulkActionBar.displayName = 'BulkActionBar'\n\nexport { BulkActionBar }\n"],"mappings":";;;;;;;;;;;;AAqEA,IAAM,IAA0D;CAC9D,QAAQ;CACR,KAAK;CAEL,QAAQ;AACV,GASM,IAAgB,EAAM,WAC1B,SACE,EACE,SACA,UACA,qBACA,YACA,eACA,gBACA,eAAY,UACZ,cACA,G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C,KAAK,CAAC,aAAa,GAAG,SAAS,CAsBjC;AAID,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAC3F,2EAA2E;IAC3E,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;IAChC,yEAAyE;IACzE,KAAK,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;IAC5B,0EAA0E;IAC1E,MAAM,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAA;IAC9B,yEAAyE;IACzE,KAAK,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;IAC5B,wEAAwE;IACxE,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC1B,iCAAiC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,8CAA8C;IAC9C,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;IACvC,oFAAoF;IACpF,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,iDAAiD;IACjD,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AA0BD,QAAA,MAAM,WAAW,yFA8DhB,CAAA;AAGD,OAAO,EAAE,WAAW,EAAE,CAAA"}
@@ -43,29 +43,8 @@ function c(e, t) {
43
43
  }
44
44
  }
45
45
  function l(e, t) {
46
- if (e === "solid") {
47
- let e = {
48
- accent: "bg-accent-11/20",
49
- error: "bg-error-11/20",
50
- success: "bg-success-11/20",
51
- warning: "bg-warning-11/20",
52
- info: "bg-info-11/20",
53
- neutral: "bg-neutral-8/30"
54
- };
55
- return e[t ?? "accent"] ?? e.accent;
56
- }
57
- if (e === "soft") {
58
- let e = {
59
- accent: "bg-accent-5",
60
- error: "bg-error-5",
61
- success: "bg-success-5",
62
- warning: "bg-warning-5",
63
- info: "bg-info-5",
64
- neutral: "bg-neutral-4"
65
- };
66
- return e[t ?? "accent"] ?? e.accent;
67
- }
68
- return "bg-surface-border";
46
+ let n = t === "neutral";
47
+ return e === "solid" ? n ? "bg-neutral-8/30" : "bg-palette-solid-active/20" : e === "soft" ? n ? "bg-neutral-4" : "bg-palette-soft-active" : "bg-surface-border";
69
48
  }
70
49
  var u = t.forwardRef(({ className: o, variant: s, color: c, weight: u, shape: d, size: f, disabled: p, orientation: m = "horizontal", attached: h = !0, fullWidth: g, children: _, ...v }, y) => {
71
50
  let b = g || m === "vertical", x = t.useMemo(() => ({
@@ -103,6 +82,7 @@ var u = t.forwardRef(({ className: o, variant: s, color: c, weight: u, shape: d,
103
82
  let u = o > 0 && s !== "outline";
104
83
  return /* @__PURE__ */ r(t.Fragment, { children: [u && /* @__PURE__ */ n("div", {
105
84
  "aria-hidden": !0,
85
+ "data-palette": c ?? void 0,
106
86
  className: e("shrink-0 self-stretch", m === "horizontal" ? "w-px" : "h-px", l(s ?? void 0, c ?? void 0))
107
87
  }), /* @__PURE__ */ n(a.Provider, {
108
88
  value: { position: w(o) },
@@ -1 +1 @@
1
- {"version":3,"file":"button-group.js","names":[],"sources":["../../src/ui/button-group.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\n\nimport type { ButtonProps } from './button'\nimport { cn } from './lib/utils'\n\n// ── Context ─────────────────────────────────────────────────────\n\nexport type ButtonGroupPosition = 'first' | 'middle' | 'last' | 'only'\n\ninterface ButtonGroupContextValue {\n variant?: ButtonProps['variant']\n color?: ButtonProps['color']\n weight?: ButtonProps['weight']\n shape?: ButtonProps['shape']\n size?: ButtonProps['size']\n disabled?: boolean\n orientation?: 'horizontal' | 'vertical'\n attached?: boolean\n /** Internal: signals Button children to stretch to fill available width */\n _stretch?: boolean\n}\n\n// Separate context for position (changes per child) vs group settings (same for all)\ninterface ButtonGroupItemContext {\n position: ButtonGroupPosition\n}\n\nconst ButtonGroupContext = React.createContext<ButtonGroupContextValue>({})\nconst ButtonGroupItemContext = React.createContext<ButtonGroupItemContext | null>(null)\n\nexport function useButtonGroup() {\n return React.useContext(ButtonGroupContext)\n}\n\nexport function useButtonGroupItem() {\n return React.useContext(ButtonGroupItemContext)\n}\n\n// ── Radius helper (consumed by Button internally) ───────────────\n\n/**\n * Returns inline style for border-radius AND border-collapse based on position\n * in an attached ButtonGroup. Inner borders are removed (not overlapped) to\n * guarantee consistent 1px borders regardless of wrapper nesting.\n */\nexport function getGroupPositionStyle(\n position: ButtonGroupPosition,\n orientation: 'horizontal' | 'vertical',\n): React.CSSProperties | undefined {\n if (position === 'only') return undefined\n\n if (orientation === 'horizontal') {\n switch (position) {\n case 'first':\n return { borderTopRightRadius: 0, borderBottomRightRadius: 0, borderRightWidth: 0 }\n case 'middle':\n return { borderRadius: 0, borderRightWidth: 0 }\n case 'last':\n return { borderTopLeftRadius: 0, borderBottomLeftRadius: 0 }\n }\n } else {\n switch (position) {\n case 'first':\n return { borderBottomLeftRadius: 0, borderBottomRightRadius: 0, borderBottomWidth: 0 }\n case 'middle':\n return { borderRadius: 0, borderBottomWidth: 0 }\n case 'last':\n return { borderTopLeftRadius: 0, borderTopRightRadius: 0 }\n }\n }\n}\n\n// ── Props ───────────────────────────────────────────────────────\n\nexport interface ButtonGroupProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color'> {\n /** Shared variant applied to all child Buttons (children can override). */\n variant?: ButtonProps['variant']\n /** Shared color applied to all child Buttons (children can override). */\n color?: ButtonProps['color']\n /** Shared weight applied to all child Buttons (children can override). */\n weight?: ButtonProps['weight']\n /** Shared shape applied to all child Buttons (children can override). */\n shape?: ButtonProps['shape']\n /** Shared size applied to all child Buttons (children can override). */\n size?: ButtonProps['size']\n /** Disable all child Buttons. */\n disabled?: boolean\n /** Layout direction. @default 'horizontal' */\n orientation?: 'horizontal' | 'vertical'\n /** Whether buttons are visually attached (merged) or spaced apart. @default true */\n attached?: boolean\n /** Stretch to full width of parent container. */\n fullWidth?: boolean\n}\n\n// ── Divider colors (for non-outline variants that lack visible borders) ──\n\nfunction getDividerColor(variant?: string, color?: string): string {\n if (variant === 'solid') {\n const map: Record<string, string> = {\n accent: 'bg-accent-11/20', error: 'bg-error-11/20', success: 'bg-success-11/20',\n warning: 'bg-warning-11/20', info: 'bg-info-11/20', neutral: 'bg-neutral-8/30',\n }\n return map[color ?? 'accent'] ?? map.accent\n }\n if (variant === 'soft') {\n const map: Record<string, string> = {\n accent: 'bg-accent-5', error: 'bg-error-5', success: 'bg-success-5',\n warning: 'bg-warning-5', info: 'bg-info-5', neutral: 'bg-neutral-4',\n }\n return map[color ?? 'accent'] ?? map.accent\n }\n // ghost, link, etc.\n return 'bg-surface-border'\n}\n\n// ── Component ───────────────────────────────────────────────────\n\nconst ButtonGroup = React.forwardRef<HTMLDivElement, ButtonGroupProps>(\n ({ className, variant, color, weight, shape, size, disabled, orientation = 'horizontal', attached = true, fullWidth, children, ...props }, ref) => {\n const shouldStretch = fullWidth || orientation === 'vertical'\n const groupValue = React.useMemo(\n () => ({ variant, color, weight, shape, size, disabled, orientation, attached, _stretch: shouldStretch }),\n [variant, color, weight, shape, size, disabled, orientation, attached, shouldStretch],\n )\n\n const validChildren = React.Children.toArray(children).filter(React.isValidElement)\n const total = validChildren.length\n\n function getPosition(index: number): ButtonGroupPosition {\n if (total === 1) return 'only'\n if (index === 0) return 'first'\n if (index === total - 1) return 'last'\n return 'middle'\n }\n\n return (\n <ButtonGroupContext.Provider value={groupValue}>\n <div\n ref={ref}\n role=\"group\"\n className={cn(\n 'inline-flex',\n fullWidth && 'w-full',\n fullWidth && orientation === 'horizontal' && '[&>*]:flex-1',\n orientation === 'horizontal' ? 'flex-row' : 'flex-col items-stretch',\n !attached && 'gap-ds-02',\n // Focus isolation — lift focused/hovered button above siblings\n '[&>*:focus-within]:z-10 [&>*:hover]:z-10',\n className,\n )}\n {...props}\n >\n {attached\n ? validChildren.map((child, i) => {\n const needsDivider = i > 0 && variant !== 'outline'\n return (\n <React.Fragment key={i}>\n {needsDivider && (\n <div\n aria-hidden\n className={cn(\n 'shrink-0 self-stretch',\n orientation === 'horizontal' ? 'w-px' : 'h-px',\n getDividerColor(variant ?? undefined, color ?? undefined),\n )}\n />\n )}\n <ButtonGroupItemContext.Provider value={{ position: getPosition(i) }}>\n {child}\n </ButtonGroupItemContext.Provider>\n </React.Fragment>\n )\n })\n : children}\n </div>\n </ButtonGroupContext.Provider>\n )\n },\n)\nButtonGroup.displayName = 'ButtonGroup'\n\nexport { ButtonGroup }\n"],"mappings":";;;;;AA6BA,IAAM,IAAqB,EAAM,cAAuC,CAAC,CAAC,GACpE,IAAyB,EAAM,cAA6C,IAAI;AAEtF,SAAgB,IAAiB;CAC/B,OAAO,EAAM,WAAW,CAAkB;AAC5C;AAEA,SAAgB,IAAqB;CACnC,OAAO,EAAM,WAAW,CAAsB;AAChD;AASA,SAAgB,EACd,GACA,GACiC;CAC7B,UAAa,QAEjB,IAAI,MAAgB,cAClB,QAAQ,GAAR;EACE,KAAK,SACH,OAAO;GAAE,sBAAsB;GAAG,yBAAyB;GAAG,kBAAkB;EAAE;EACpF,KAAK,UACH,OAAO;GAAE,cAAc;GAAG,kBAAkB;EAAE;EAChD,KAAK,QACH,OAAO;GAAE,qBAAqB;GAAG,wBAAwB;EAAE;CAC/D;MAEA,QAAQ,GAAR;EACE,KAAK,SACH,OAAO;GAAE,wBAAwB;GAAG,yBAAyB;GAAG,mBAAmB;EAAE;EACvF,KAAK,UACH,OAAO;GAAE,cAAc;GAAG,mBAAmB;EAAE;EACjD,KAAK,QACH,OAAO;GAAE,qBAAqB;GAAG,sBAAsB;EAAE;CAC7D;AAEJ;AA2BA,SAAS,EAAgB,GAAkB,GAAwB;CACjE,IAAI,MAAY,SAAS;EACvB,IAAM,IAA8B;GAClC,QAAQ;GAAmB,OAAO;GAAkB,SAAS;GAC7D,SAAS;GAAoB,MAAM;GAAiB,SAAS;EAC/D;EACA,OAAO,EAAI,KAAS,aAAa,EAAI;CACvC;CACA,IAAI,MAAY,QAAQ;EACtB,IAAM,IAA8B;GAClC,QAAQ;GAAe,OAAO;GAAc,SAAS;G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D,CAAA;CACsB,CAAA;AAEjC,CACF;AACA,EAAY,cAAc"}
1
+ {"version":3,"file":"button-group.js","names":[],"sources":["../../src/ui/button-group.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\n\nimport type { ButtonProps } from './button'\nimport { cn } from './lib/utils'\n\n// ── Context ─────────────────────────────────────────────────────\n\nexport type ButtonGroupPosition = 'first' | 'middle' | 'last' | 'only'\n\ninterface ButtonGroupContextValue {\n variant?: ButtonProps['variant']\n color?: ButtonProps['color']\n weight?: ButtonProps['weight']\n shape?: ButtonProps['shape']\n size?: ButtonProps['size']\n disabled?: boolean\n orientation?: 'horizontal' | 'vertical'\n attached?: boolean\n /** Internal: signals Button children to stretch to fill available width */\n _stretch?: boolean\n}\n\n// Separate context for position (changes per child) vs group settings (same for all)\ninterface ButtonGroupItemContext {\n position: ButtonGroupPosition\n}\n\nconst ButtonGroupContext = React.createContext<ButtonGroupContextValue>({})\nconst ButtonGroupItemContext = React.createContext<ButtonGroupItemContext | null>(null)\n\nexport function useButtonGroup() {\n return React.useContext(ButtonGroupContext)\n}\n\nexport function useButtonGroupItem() {\n return React.useContext(ButtonGroupItemContext)\n}\n\n// ── Radius helper (consumed by Button internally) ───────────────\n\n/**\n * Returns inline style for border-radius AND border-collapse based on position\n * in an attached ButtonGroup. Inner borders are removed (not overlapped) to\n * guarantee consistent 1px borders regardless of wrapper nesting.\n */\nexport function getGroupPositionStyle(\n position: ButtonGroupPosition,\n orientation: 'horizontal' | 'vertical',\n): React.CSSProperties | undefined {\n if (position === 'only') return undefined\n\n if (orientation === 'horizontal') {\n switch (position) {\n case 'first':\n return { borderTopRightRadius: 0, borderBottomRightRadius: 0, borderRightWidth: 0 }\n case 'middle':\n return { borderRadius: 0, borderRightWidth: 0 }\n case 'last':\n return { borderTopLeftRadius: 0, borderBottomLeftRadius: 0 }\n }\n } else {\n switch (position) {\n case 'first':\n return { borderBottomLeftRadius: 0, borderBottomRightRadius: 0, borderBottomWidth: 0 }\n case 'middle':\n return { borderRadius: 0, borderBottomWidth: 0 }\n case 'last':\n return { borderTopLeftRadius: 0, borderTopRightRadius: 0 }\n }\n }\n}\n\n// ── Props ───────────────────────────────────────────────────────\n\nexport interface ButtonGroupProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color'> {\n /** Shared variant applied to all child Buttons (children can override). */\n variant?: ButtonProps['variant']\n /** Shared color applied to all child Buttons (children can override). */\n color?: ButtonProps['color']\n /** Shared weight applied to all child Buttons (children can override). */\n weight?: ButtonProps['weight']\n /** Shared shape applied to all child Buttons (children can override). */\n shape?: ButtonProps['shape']\n /** Shared size applied to all child Buttons (children can override). */\n size?: ButtonProps['size']\n /** Disable all child Buttons. */\n disabled?: boolean\n /** Layout direction. @default 'horizontal' */\n orientation?: 'horizontal' | 'vertical'\n /** Whether buttons are visually attached (merged) or spaced apart. @default true */\n attached?: boolean\n /** Stretch to full width of parent container. */\n fullWidth?: boolean\n}\n\n// ── Divider colors (for non-outline variants that lack visible borders) ──\n\n// One line per variant instead of one per variant × colour. The hue comes from\n// `data-palette` on the divider, which mirrors the group's own colour.\n//\n// `neutral` diverges in both cases, and both predate this work: its solid\n// divider is 30% rather than 20% (a flat grey needs more presence than a\n// saturated one to read at 1px), and its soft divider sits one step lighter\n// than the role gives. SplitButton carries the same two, which is a sign the\n// divergence belongs to neutral rather than to either component.\nfunction getDividerColor(variant?: string, color?: string): string {\n const isNeutral = color === 'neutral'\n if (variant === 'solid') {\n return isNeutral ? 'bg-neutral-8/30' : 'bg-palette-solid-active/20'\n }\n if (variant === 'soft') {\n return isNeutral ? 'bg-neutral-4' : 'bg-palette-soft-active'\n }\n // ghost, link, etc.\n return 'bg-surface-border'\n}\n\n// ── Component ───────────────────────────────────────────────────\n\nconst ButtonGroup = React.forwardRef<HTMLDivElement, ButtonGroupProps>(\n ({ className, variant, color, weight, shape, size, disabled, orientation = 'horizontal', attached = true, fullWidth, children, ...props }, ref) => {\n const shouldStretch = fullWidth || orientation === 'vertical'\n const groupValue = React.useMemo(\n () => ({ variant, color, weight, shape, size, disabled, orientation, attached, _stretch: shouldStretch }),\n [variant, color, weight, shape, size, disabled, orientation, attached, shouldStretch],\n )\n\n const validChildren = React.Children.toArray(children).filter(React.isValidElement)\n const total = validChildren.length\n\n function getPosition(index: number): ButtonGroupPosition {\n if (total === 1) return 'only'\n if (index === 0) return 'first'\n if (index === total - 1) return 'last'\n return 'middle'\n }\n\n return (\n <ButtonGroupContext.Provider value={groupValue}>\n <div\n ref={ref}\n role=\"group\"\n className={cn(\n 'inline-flex',\n fullWidth && 'w-full',\n fullWidth && orientation === 'horizontal' && '[&>*]:flex-1',\n orientation === 'horizontal' ? 'flex-row' : 'flex-col items-stretch',\n !attached && 'gap-ds-02',\n // Focus isolation — lift focused/hovered button above siblings\n '[&>*:focus-within]:z-10 [&>*:hover]:z-10',\n className,\n )}\n {...props}\n >\n {attached\n ? validChildren.map((child, i) => {\n const needsDivider = i > 0 && variant !== 'outline'\n return (\n <React.Fragment key={i}>\n {needsDivider && (\n <div\n aria-hidden\n data-palette={color ?? undefined}\n className={cn(\n 'shrink-0 self-stretch',\n orientation === 'horizontal' ? 'w-px' : 'h-px',\n getDividerColor(variant ?? undefined, color ?? undefined),\n )}\n />\n )}\n <ButtonGroupItemContext.Provider value={{ position: getPosition(i) }}>\n {child}\n </ButtonGroupItemContext.Provider>\n </React.Fragment>\n )\n })\n : children}\n </div>\n </ButtonGroupContext.Provider>\n )\n },\n)\nButtonGroup.displayName = 'ButtonGroup'\n\nexport { ButtonGroup }\n"],"mappings":";;;;;AA6BA,IAAM,IAAqB,EAAM,cAAuC,CAAC,CAAC,GACpE,IAAyB,EAAM,cAA6C,IAAI;AAEtF,SAAgB,IAAiB;CAC/B,OAAO,EAAM,WAAW,CAAkB;AAC5C;AAEA,SAAgB,IAAqB;CACnC,OAAO,EAAM,WAAW,CAAsB;AAChD;AASA,SAAgB,EACd,GACA,GACiC;CAC7B,UAAa,QAEjB,IAAI,MAAgB,cAClB,QAA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7C,MAAgB,eAAe,aAAa,0BAC5C,CAAC,KAAY,aAEb,4CACA,CACF;GACA,GAAI;aAEH,IACG,EAAc,KAAK,GAAO,MAAM;IAC9B,IAAM,IAAe,IAAI,KAAK,MAAY;IAC1C,OACE,kBAAC,EAAM,UAAP,EAAA,UAAA,CACG,KACC,kBAAC,OAAD;KACE,eAAA;KACA,gBAAc,KAAS,KAAA;KACvB,WAAW,EACT,yBACA,MAAgB,eAAe,SAAS,QACxC,EAAgB,KAAW,KAAA,GAAW,KAAS,KAAA,CAAS,CAC1D;IACD,CAAA,GAEH,kBAAC,EAAuB,UAAxB;KAAiC,OAAO,EAAE,UAAU,EAAY,CAAC,EAAE;eAChE;IAC8B,CAAA,CACnB,EAAA,GAfK,CAeL;GAEpB,CAAC,IACD;EACD,CAAA;CACsB,CAAA;AAEjC,CACF;AACA,EAAY,cAAc"}
@@ -59,7 +59,16 @@ export declare const buttonVariants: (props?: ({
59
59
  * Edit
60
60
  * </Button>
61
61
  */
62
- export interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'color'>, VariantProps<typeof buttonVariants> {
62
+ export interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'color'>, Omit<VariantProps<typeof buttonVariants>, 'color'> {
63
+ /**
64
+ * Palette name. The six built-ins keep their exact previous appearance; any
65
+ * other palette registered in CSS (`[data-palette='…']`) now works too, which
66
+ * it could not before.
67
+ *
68
+ * Widened from a closed union to `union | (string & {})`, so every existing
69
+ * value still type-checks — a widening, not a narrowing.
70
+ */
71
+ color?: NonNullable<VariantProps<typeof buttonVariants>['color']> | (string & {});
63
72
  asChild?: boolean;
64
73
  /** Button shape — 'pill' applies rounded-pill for chip/tag-like buttons */
65
74
  shape?: 'default' | 'pill';
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/ui/button.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA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