@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
@@ -1,77 +1,78 @@
1
1
  "use client";
2
- import { jsxs as m, jsx as a } from "react/jsx-runtime";
2
+ import { jsxs as m, jsx as s } from "react/jsx-runtime";
3
3
  import * as t from "react";
4
- import { W as f, X as b, Y as y, Z as w, _ as g, $ as v, a0 as h, a1 as x, a2 as N, a3 as M, a4 as P, a5 as _, a6 as j, a7 as G, a8 as T } from "../_chunks/primitives.js";
5
- import { IconChevronRight as z, IconCheck as A, IconCircle as L } from "@tabler/icons-react";
4
+ import { Q as f, U as b, V as g, W as h, X as y, Y as w, Z as v, _ as x, $ as N, a0 as C, a1 as P, a2 as _, a3 as j, a4 as z, a5 as G } from "../_chunks/primitives.js";
5
+ import { IconChevronRight as T, IconCheck as U, IconCircle as A } from "@tabler/icons-react";
6
6
  import { cn as d } from "./lib/utils.js";
7
- import { tweens as D, springs as C } from "./lib/motion.js";
8
- import { A as R, m as S } from "../_chunks/framer.js";
9
- const I = t.createContext(!1), k = t.createContext(!1), U = ({
10
- open: s,
7
+ import { tweens as M, springs as D } from "./lib/motion.js";
8
+ import { Icon as R } from "./icon.js";
9
+ import { A as S, m as I } from "../_chunks/framer.js";
10
+ const k = t.createContext(!1), O = t.createContext(!1), L = ({
11
+ open: e,
11
12
  defaultOpen: o = !1,
12
- onOpenChange: e,
13
+ onOpenChange: a,
13
14
  ...r
14
15
  }) => {
15
- const [n, c] = t.useState(o), i = s !== void 0, l = i ? s : n, p = t.useCallback(
16
- (u) => {
17
- i || c(u), e == null || e(u);
16
+ const [n, c] = t.useState(o), i = e !== void 0, l = i ? e : n, u = t.useCallback(
17
+ (p) => {
18
+ i || c(p), a?.(p);
18
19
  },
19
- [i, e]
20
+ [i, a]
20
21
  );
21
- return /* @__PURE__ */ a(I.Provider, { value: l, children: /* @__PURE__ */ a(_, { open: l, onOpenChange: p, ...r }) });
22
+ return /* @__PURE__ */ s(k.Provider, { value: l, children: /* @__PURE__ */ s(_, { open: l, onOpenChange: u, ...r }) });
22
23
  };
23
- U.displayName = "DropdownMenu";
24
- const se = P, ae = j, oe = y, W = ({
25
- open: s,
24
+ L.displayName = "DropdownMenu";
25
+ const ae = P, re = j, te = g, Q = ({
26
+ open: e,
26
27
  defaultOpen: o = !1,
27
- onOpenChange: e,
28
+ onOpenChange: a,
28
29
  ...r
29
30
  }) => {
30
- const [n, c] = t.useState(o), i = s !== void 0, l = i ? s : n, p = t.useCallback(
31
- (u) => {
32
- i || c(u), e == null || e(u);
31
+ const [n, c] = t.useState(o), i = e !== void 0, l = i ? e : n, u = t.useCallback(
32
+ (p) => {
33
+ i || c(p), a?.(p);
33
34
  },
34
- [i, e]
35
+ [i, a]
35
36
  );
36
- return /* @__PURE__ */ a(k.Provider, { value: l, children: /* @__PURE__ */ a(T, { open: l, onOpenChange: p, ...r }) });
37
+ return /* @__PURE__ */ s(O.Provider, { value: l, children: /* @__PURE__ */ s(G, { open: l, onOpenChange: u, ...r }) });
37
38
  };
38
- W.displayName = "DropdownMenuSub";
39
- const re = G, X = t.forwardRef(({ className: s, inset: o, children: e, ...r }, n) => /* @__PURE__ */ m(
39
+ Q.displayName = "DropdownMenuSub";
40
+ const ne = z, V = t.forwardRef(({ className: e, inset: o, children: a, ...r }, n) => /* @__PURE__ */ m(
40
41
  f,
41
42
  {
42
43
  ref: n,
43
44
  className: d(
44
45
  "flex cursor-default select-none items-center gap-ds-03 rounded-ds-md px-ds-03 py-ds-02b text-ds-md outline-none focus:bg-surface-raised data-[state=open]:bg-surface-raised [&_svg]:pointer-events-none [&_svg]:h-ico-sm [&_svg]:w-ico-sm [&_svg]:shrink-0",
45
46
  o && "pl-ds-07",
46
- s
47
+ e
47
48
  ),
48
49
  ...r,
49
50
  children: [
50
- e,
51
- /* @__PURE__ */ a(z, { className: "ml-auto" })
51
+ a,
52
+ /* @__PURE__ */ s(R, { icon: T, size: "sm", className: "ml-auto" })
52
53
  ]
53
54
  }
54
55
  ));
55
- X.displayName = f.displayName;
56
- const Y = t.forwardRef(({ className: s, children: o, ...e }, r) => {
57
- const n = t.useContext(k);
58
- return /* @__PURE__ */ a(R, { children: n && /* @__PURE__ */ a(
56
+ V.displayName = f.displayName;
57
+ const W = t.forwardRef(({ className: e, children: o, ...a }, r) => {
58
+ const n = t.useContext(O);
59
+ return /* @__PURE__ */ s(S, { children: n && /* @__PURE__ */ s(
59
60
  b,
60
61
  {
61
62
  ref: r,
62
63
  forceMount: !0,
63
64
  asChild: !0,
64
- ...e,
65
- children: /* @__PURE__ */ a(
66
- S.div,
65
+ ...a,
66
+ children: /* @__PURE__ */ s(
67
+ I.div,
67
68
  {
68
69
  initial: { opacity: 0, scale: 0.95 },
69
70
  animate: { opacity: 1, scale: 1 },
70
71
  exit: { opacity: 0, scale: 0.95 },
71
- transition: { ...C.snappy, opacity: D.fade },
72
+ transition: { ...D.snappy, opacity: M.fade },
72
73
  className: d(
73
74
  "z-popover min-w-[8rem] overflow-hidden rounded-ds-lg border border-surface-border-strong bg-surface-overlay p-ds-02 text-surface-fg shadow-floating",
74
- s
75
+ e
75
76
  ),
76
77
  children: o
77
78
  }
@@ -79,128 +80,128 @@ const Y = t.forwardRef(({ className: s, children: o, ...e }, r) => {
79
80
  }
80
81
  ) });
81
82
  });
82
- Y.displayName = b.displayName;
83
- const Z = t.forwardRef(({ className: s, sideOffset: o = 4, children: e, ...r }, n) => {
84
- const c = t.useContext(I);
85
- return /* @__PURE__ */ a(R, { children: c && /* @__PURE__ */ a(y, { forceMount: !0, children: /* @__PURE__ */ a(
86
- w,
83
+ W.displayName = b.displayName;
84
+ const X = t.forwardRef(({ className: e, sideOffset: o = 4, children: a, ...r }, n) => {
85
+ const c = t.useContext(k);
86
+ return /* @__PURE__ */ s(S, { children: c && /* @__PURE__ */ s(g, { forceMount: !0, children: /* @__PURE__ */ s(
87
+ h,
87
88
  {
88
89
  ref: n,
89
90
  sideOffset: o,
90
91
  forceMount: !0,
91
92
  asChild: !0,
92
93
  ...r,
93
- children: /* @__PURE__ */ a(
94
- S.div,
94
+ children: /* @__PURE__ */ s(
95
+ I.div,
95
96
  {
96
97
  initial: { opacity: 0, scale: 0.95 },
97
98
  animate: { opacity: 1, scale: 1 },
98
99
  exit: { opacity: 0, scale: 0.95 },
99
- transition: { ...C.snappy, opacity: D.fade },
100
+ transition: { ...D.snappy, opacity: M.fade },
100
101
  className: d(
101
102
  "z-popover min-w-[8rem] rounded-ds-lg border border-surface-border-strong bg-surface-overlay p-ds-02 text-surface-fg shadow-floating",
102
- s
103
+ e
103
104
  ),
104
- children: e
105
+ children: a
105
106
  }
106
107
  )
107
108
  }
108
109
  ) }) });
109
110
  });
110
- Z.displayName = w.displayName;
111
- const $ = t.forwardRef(({ className: s, inset: o, ...e }, r) => /* @__PURE__ */ a(
112
- g,
111
+ X.displayName = h.displayName;
112
+ const Y = t.forwardRef(({ className: e, inset: o, ...a }, r) => /* @__PURE__ */ s(
113
+ y,
113
114
  {
114
115
  ref: r,
115
116
  className: d(
116
117
  "relative flex cursor-default select-none items-center gap-ds-03 rounded-ds-md px-ds-03 py-ds-02b text-ds-md outline-none transition-colors duration-fast-01 ease-productive-standard hover:bg-surface-raised focus:bg-surface-raised focus:text-surface-fg active:bg-surface-raised-hover data-[disabled]:pointer-events-none data-[disabled]:opacity-action-disabled [&>svg]:h-ico-sm [&>svg]:w-ico-sm [&>svg]:shrink-0",
117
118
  o && "pl-ds-07",
118
- s
119
+ e
119
120
  ),
120
- ...e
121
+ ...a
121
122
  }
122
123
  ));
123
- $.displayName = g.displayName;
124
- const q = t.forwardRef(({ className: s, children: o, checked: e, ...r }, n) => /* @__PURE__ */ m(
125
- v,
124
+ Y.displayName = y.displayName;
125
+ const Z = t.forwardRef(({ className: e, children: o, checked: a, ...r }, n) => /* @__PURE__ */ m(
126
+ w,
126
127
  {
127
128
  ref: n,
128
129
  className: d(
129
130
  "relative flex cursor-default select-none items-center rounded-ds-md py-ds-02b pl-ds-07 pr-ds-03 text-ds-md outline-none transition-colors duration-fast-01 ease-productive-standard hover:bg-surface-raised focus:bg-surface-raised focus:text-surface-fg active:bg-surface-raised-hover data-[disabled]:pointer-events-none data-[disabled]:opacity-action-disabled",
130
- s
131
+ e
131
132
  ),
132
- checked: e,
133
+ checked: a,
133
134
  ...r,
134
135
  children: [
135
- /* @__PURE__ */ a("span", { className: "absolute left-ds-03 flex h-ico-sm w-ico-sm items-center justify-center", children: /* @__PURE__ */ a(h, { children: /* @__PURE__ */ a(A, { className: "h-ico-sm w-ico-sm" }) }) }),
136
+ /* @__PURE__ */ s("span", { className: "absolute left-ds-03 flex h-ico-sm w-ico-sm items-center justify-center", children: /* @__PURE__ */ s(v, { children: /* @__PURE__ */ s(R, { icon: U, size: "sm" }) }) }),
136
137
  o
137
138
  ]
138
139
  }
139
140
  ));
140
- q.displayName = v.displayName;
141
- const B = t.forwardRef(({ className: s, children: o, ...e }, r) => /* @__PURE__ */ m(
141
+ Z.displayName = w.displayName;
142
+ const $ = t.forwardRef(({ className: e, children: o, ...a }, r) => /* @__PURE__ */ m(
142
143
  x,
143
144
  {
144
145
  ref: r,
145
146
  className: d(
146
147
  "relative flex cursor-default select-none items-center rounded-ds-md py-ds-02b pl-ds-07 pr-ds-03 text-ds-md outline-none transition-colors duration-fast-01 ease-productive-standard hover:bg-surface-raised focus:bg-surface-raised focus:text-surface-fg active:bg-surface-raised-hover data-[disabled]:pointer-events-none data-[disabled]:opacity-action-disabled",
147
- s
148
+ e
148
149
  ),
149
- ...e,
150
+ ...a,
150
151
  children: [
151
- /* @__PURE__ */ a("span", { className: "absolute left-ds-03 flex h-ico-sm w-ico-sm items-center justify-center", children: /* @__PURE__ */ a(h, { children: /* @__PURE__ */ a(L, { className: "h-2 w-2 fill-current" }) }) }),
152
+ /* @__PURE__ */ s("span", { className: "absolute left-ds-03 flex h-ico-sm w-ico-sm items-center justify-center", children: /* @__PURE__ */ s(v, { children: /* @__PURE__ */ s(A, { className: "h-2 w-2 fill-current" }) }) }),
152
153
  o
153
154
  ]
154
155
  }
155
156
  ));
156
- B.displayName = x.displayName;
157
- const E = t.forwardRef(({ className: s, inset: o, ...e }, r) => /* @__PURE__ */ a(
157
+ $.displayName = x.displayName;
158
+ const q = t.forwardRef(({ className: e, inset: o, ...a }, r) => /* @__PURE__ */ s(
158
159
  N,
159
160
  {
160
161
  ref: r,
161
162
  className: d(
162
163
  "px-ds-03 py-ds-02b text-ds-md font-semibold",
163
164
  o && "pl-ds-07",
164
- s
165
+ e
165
166
  ),
166
- ...e
167
+ ...a
167
168
  }
168
169
  ));
169
- E.displayName = N.displayName;
170
- const F = t.forwardRef(({ className: s, ...o }, e) => /* @__PURE__ */ a(
171
- M,
170
+ q.displayName = N.displayName;
171
+ const B = t.forwardRef(({ className: e, ...o }, a) => /* @__PURE__ */ s(
172
+ C,
172
173
  {
173
- ref: e,
174
- className: d("-mx-ds-01 my-ds-02 h-px bg-surface-border", s),
174
+ ref: a,
175
+ className: d("-mx-ds-01 my-ds-02 h-px bg-surface-border", e),
175
176
  ...o
176
177
  }
177
178
  ));
178
- F.displayName = M.displayName;
179
- const H = ({
180
- className: s,
179
+ B.displayName = C.displayName;
180
+ const E = ({
181
+ className: e,
181
182
  ...o
182
- }) => /* @__PURE__ */ a(
183
+ }) => /* @__PURE__ */ s(
183
184
  "span",
184
185
  {
185
- className: d("ml-auto text-ds-sm text-surface-fg-subtle", s),
186
+ className: d("ml-auto text-ds-sm text-surface-fg-subtle", e),
186
187
  ...o
187
188
  }
188
189
  );
189
- H.displayName = "DropdownMenuShortcut";
190
+ E.displayName = "DropdownMenuShortcut";
190
191
  export {
191
- U as DropdownMenu,
192
- q as DropdownMenuCheckboxItem,
193
- Z as DropdownMenuContent,
194
- ae as DropdownMenuGroup,
195
- $ as DropdownMenuItem,
196
- E as DropdownMenuLabel,
197
- oe as DropdownMenuPortal,
198
- re as DropdownMenuRadioGroup,
199
- B as DropdownMenuRadioItem,
200
- F as DropdownMenuSeparator,
201
- H as DropdownMenuShortcut,
202
- W as DropdownMenuSub,
203
- Y as DropdownMenuSubContent,
204
- X as DropdownMenuSubTrigger,
205
- se as DropdownMenuTrigger
192
+ L as DropdownMenu,
193
+ Z as DropdownMenuCheckboxItem,
194
+ X as DropdownMenuContent,
195
+ re as DropdownMenuGroup,
196
+ Y as DropdownMenuItem,
197
+ q as DropdownMenuLabel,
198
+ te as DropdownMenuPortal,
199
+ ne as DropdownMenuRadioGroup,
200
+ $ as DropdownMenuRadioItem,
201
+ B as DropdownMenuSeparator,
202
+ E as DropdownMenuShortcut,
203
+ Q as DropdownMenuSub,
204
+ W as DropdownMenuSubContent,
205
+ V as DropdownMenuSubTrigger,
206
+ ae as DropdownMenuTrigger
206
207
  };
@@ -1 +1 @@
1
- {"version":3,"file":"file-upload.d.ts","sourceRoot":"","sources":["../../src/ui/file-upload.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAO9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,SAAS,CAAC;IAC7D,yDAAyD;IACzD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,0BAA0B;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,+CAA+C;IAC/C,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAA;IAChC,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,wDAAwD;IACxD,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,eAAe;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,mBAAmB;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,sBAAsB;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAuBD,QAAA,MAAM,UAAU,wFAkUf,CAAA;AAGD,OAAO,EAAE,UAAU,EAAE,CAAA"}
1
+ {"version":3,"file":"file-upload.d.ts","sourceRoot":"","sources":["../../src/ui/file-upload.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAQ9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,SAAS,CAAC;IAC7D,yDAAyD;IACzD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,0BAA0B;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,+CAA+C;IAC/C,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAA;IAChC,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,wDAAwD;IACxD,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,eAAe;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,mBAAmB;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,sBAAsB;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAuBD,QAAA,MAAM,UAAU,wFAkUf,CAAA;AAGD,OAAO,EAAE,UAAU,EAAE,CAAA"}
@@ -1,52 +1,52 @@
1
1
  "use client";
2
2
  import { jsxs as p, jsx as t } from "react/jsx-runtime";
3
3
  import * as r from "react";
4
- import { IconPaperclip as X, IconCheck as Z, IconUpload as q } from "@tabler/icons-react";
4
+ import { IconPaperclip as Z, IconCheck as q, IconUpload as G } from "@tabler/icons-react";
5
5
  import { cn as h } from "./lib/utils.js";
6
- import { springs as D, tweens as N } from "./lib/motion.js";
6
+ import { springs as w, tweens as N } from "./lib/motion.js";
7
7
  import { Spinner as B } from "./spinner.js";
8
+ import { Icon as I } from "./icon.js";
8
9
  import { m as c, A as M } from "../_chunks/framer.js";
9
- const G = 10 * 1024 * 1024;
10
- function H(a, l) {
11
- return l.split(",").map((i) => i.trim()).some((i) => i.startsWith(".") ? a.name.toLowerCase().endsWith(i.toLowerCase()) : i.endsWith("/*") ? a.type.startsWith(i.slice(0, i.indexOf("/") + 1)) : a.type === i);
10
+ const H = 10 * 1024 * 1024;
11
+ function J(a, l) {
12
+ return l.split(",").map((s) => s.trim()).some((s) => s.startsWith(".") ? a.name.toLowerCase().endsWith(s.toLowerCase()) : s.endsWith("/*") ? a.type.startsWith(s.slice(0, s.indexOf("/") + 1)) : a.type === s);
12
13
  }
13
14
  function U(a) {
14
15
  return a < 1024 ? `${a} B` : a < 1024 * 1024 ? `${(a / 1024).toFixed(1)} KB` : `${(a / (1024 * 1024)).toFixed(1)} MB`;
15
16
  }
16
- const J = r.forwardRef(
17
+ const Q = r.forwardRef(
17
18
  ({
18
19
  accept: a,
19
- maxSize: l = G,
20
- multiple: i = !1,
20
+ maxSize: l = H,
21
+ multiple: s = !1,
21
22
  uploading: o = !1,
22
23
  progress: x = 0,
23
24
  onFiles: A,
24
- error: I,
25
+ error: F,
25
26
  compact: W = !1,
26
- disabled: s = !1,
27
- className: F,
27
+ disabled: n = !1,
28
+ className: E,
28
29
  label: v,
29
30
  sublabel: j,
30
- ...E
31
- }, L) => {
32
- const y = r.useRef(null), [b, d] = r.useState(!1), [z, f] = r.useState(
31
+ ...L
32
+ }, R) => {
33
+ const y = r.useRef(null), [b, f] = r.useState(!1), [K, d] = r.useState(
33
34
  null
34
- ), g = r.useRef(!1), k = r.useRef(!1), u = I || z, C = r.useCallback(() => {
35
- var e;
36
- s || o || (e = y.current) == null || e.click();
37
- }, [s, o]), m = r.useCallback(
35
+ ), g = r.useRef(!1), k = r.useRef(!1), u = F || K, C = r.useCallback(() => {
36
+ n || o || y.current?.click();
37
+ }, [n, o]), m = r.useCallback(
38
38
  (e) => {
39
- f(null);
40
- for (const n of e) {
41
- if (n.size > l) {
42
- f(
43
- `File "${n.name}" exceeds the maximum size of ${U(l)}`
39
+ d(null);
40
+ for (const i of e) {
41
+ if (i.size > l) {
42
+ d(
43
+ `File "${i.name}" exceeds the maximum size of ${U(l)}`
44
44
  );
45
45
  return;
46
46
  }
47
- if (a && !H(n, a)) {
48
- f(
49
- `File "${n.name}" is not an accepted file type`
47
+ if (a && !J(i, a)) {
48
+ d(
49
+ `File "${i.name}" is not an accepted file type`
50
50
  );
51
51
  return;
52
52
  }
@@ -54,47 +54,47 @@ const J = r.forwardRef(
54
54
  A(e);
55
55
  },
56
56
  [l, a, A]
57
- ), R = r.useCallback(
57
+ ), $ = r.useCallback(
58
58
  (e) => {
59
59
  k.current = !0;
60
- const n = e.target.files;
61
- !n || n.length === 0 || (m(Array.from(n)), e.target.value = "");
60
+ const i = e.target.files;
61
+ !i || i.length === 0 || (m(Array.from(i)), e.target.value = "");
62
62
  },
63
63
  [m]
64
- ), $ = r.useCallback(() => {
64
+ ), P = r.useCallback(() => {
65
65
  g.current = !0, k.current = !1;
66
- }, []), P = r.useCallback(() => {
67
- g.current && !k.current && a && f("File type is not accepted"), g.current = !1;
68
- }, [a]), K = r.useCallback(
66
+ }, []), z = r.useCallback(() => {
67
+ g.current && !k.current && a && d("File type is not accepted"), g.current = !1;
68
+ }, [a]), S = r.useCallback(
69
69
  (e) => {
70
- e.preventDefault(), e.stopPropagation(), !s && !o && d(!0);
70
+ e.preventDefault(), e.stopPropagation(), !n && !o && f(!0);
71
71
  },
72
- [s, o]
73
- ), S = r.useCallback(
72
+ [n, o]
73
+ ), T = r.useCallback(
74
74
  (e) => {
75
- e.preventDefault(), e.stopPropagation(), !s && !o && d(!0);
75
+ e.preventDefault(), e.stopPropagation(), !n && !o && f(!0);
76
76
  },
77
- [s, o]
78
- ), T = r.useCallback(
77
+ [n, o]
78
+ ), _ = r.useCallback(
79
79
  (e) => {
80
- e.preventDefault(), e.stopPropagation(), d(!1);
80
+ e.preventDefault(), e.stopPropagation(), f(!1);
81
81
  },
82
82
  []
83
- ), _ = r.useCallback(
83
+ ), V = r.useCallback(
84
84
  (e) => {
85
- if (e.preventDefault(), e.stopPropagation(), d(!1), s || o) return;
86
- const n = e.dataTransfer.files;
87
- !n || n.length === 0 || m(Array.from(n));
85
+ if (e.preventDefault(), e.stopPropagation(), f(!1), n || o) return;
86
+ const i = e.dataTransfer.files;
87
+ !i || i.length === 0 || m(Array.from(i));
88
88
  },
89
- [s, o, m]
90
- ), O = v ?? "Drop files here or click to browse", V = j ?? `Max file size: ${U(l)}`, w = r.useId();
91
- return W ? /* @__PURE__ */ p("div", { ref: L, className: h("inline-flex flex-col", F), ...E, children: [
89
+ [n, o, m]
90
+ ), O = v ?? "Drop files here or click to browse", X = j ?? `Max file size: ${U(l)}`, D = r.useId();
91
+ return W ? /* @__PURE__ */ p("div", { ref: R, className: h("inline-flex flex-col", E), ...L, children: [
92
92
  /* @__PURE__ */ p(
93
93
  "button",
94
94
  {
95
95
  type: "button",
96
96
  onClick: C,
97
- disabled: s,
97
+ disabled: n,
98
98
  className: h(
99
99
  "inline-flex items-center gap-ds-02 rounded-ds-md px-ds-03 py-ds-02",
100
100
  "text-ds-sm font-medium",
@@ -105,7 +105,7 @@ const J = r.forwardRef(
105
105
  "transition-colors"
106
106
  ),
107
107
  children: [
108
- o ? /* @__PURE__ */ t(B, { size: "sm" }) : /* @__PURE__ */ t(X, { className: "h-ico-sm w-ico-sm" }),
108
+ o ? /* @__PURE__ */ t(B, { size: "sm" }) : /* @__PURE__ */ t(I, { icon: Z, size: "sm" }),
109
109
  v ?? "Attach files"
110
110
  ]
111
111
  }
@@ -114,18 +114,18 @@ const J = r.forwardRef(
114
114
  "input",
115
115
  {
116
116
  ref: y,
117
- id: w,
117
+ id: D,
118
118
  type: "file",
119
119
  className: "sr-only",
120
120
  style: { visibility: "hidden" },
121
121
  "aria-hidden": "true",
122
122
  "aria-label": v ?? "Attach files",
123
123
  accept: a,
124
- multiple: i,
125
- disabled: s,
126
- onChange: R,
127
- onClick: $,
128
- onFocus: P,
124
+ multiple: s,
125
+ disabled: n,
126
+ onChange: $,
127
+ onClick: P,
128
+ onFocus: z,
129
129
  tabIndex: -1
130
130
  }
131
131
  ),
@@ -141,25 +141,25 @@ const J = r.forwardRef(
141
141
  ] }) : /* @__PURE__ */ p(
142
142
  "div",
143
143
  {
144
- ref: L,
145
- ...E,
144
+ ref: R,
145
+ ...L,
146
146
  role: "presentation",
147
- className: h("flex flex-col", F),
147
+ className: h("flex flex-col", E),
148
148
  "data-drag-active": b ? "true" : void 0,
149
- onDragEnter: K,
150
- onDragOver: S,
151
- onDragLeave: T,
152
- onDrop: _,
149
+ onDragEnter: S,
150
+ onDragOver: T,
151
+ onDragLeave: _,
152
+ onDrop: V,
153
153
  children: [
154
154
  /* @__PURE__ */ p(
155
155
  c.div,
156
156
  {
157
157
  role: "button",
158
158
  tabIndex: 0,
159
- "aria-disabled": s || void 0,
160
- onClick: s ? void 0 : C,
159
+ "aria-disabled": n || void 0,
160
+ onClick: n ? void 0 : C,
161
161
  onKeyDown: (e) => {
162
- !s && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), C());
162
+ !n && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), C());
163
163
  },
164
164
  className: h(
165
165
  "flex flex-col items-center justify-center gap-ds-03 rounded-ds-lg",
@@ -167,12 +167,12 @@ const J = r.forwardRef(
167
167
  "cursor-pointer",
168
168
  "border-surface-border-strong bg-surface-raised-hover",
169
169
  b && "border-accent-7 bg-accent-2",
170
- s && "opacity-action-disabled cursor-not-allowed"
170
+ n && "opacity-action-disabled cursor-not-allowed"
171
171
  ),
172
172
  animate: {
173
173
  scale: b ? 1.02 : 1
174
174
  },
175
- transition: D.snappy,
175
+ transition: w.snappy,
176
176
  children: [
177
177
  /* @__PURE__ */ t(M, { mode: "wait", children: o ? /* @__PURE__ */ t(
178
178
  c.div,
@@ -184,14 +184,14 @@ const J = r.forwardRef(
184
184
  children: /* @__PURE__ */ t(B, { size: "md" })
185
185
  },
186
186
  "spinner"
187
- ) : x === 100 && !I ? /* @__PURE__ */ t(
187
+ ) : x === 100 && !F ? /* @__PURE__ */ t(
188
188
  c.div,
189
189
  {
190
190
  initial: { opacity: 0, scale: 0.5 },
191
191
  animate: { opacity: 1, scale: 1 },
192
192
  exit: { opacity: 0, scale: 0.5 },
193
- transition: D.bouncy,
194
- children: /* @__PURE__ */ t(Z, { className: "h-ds-sm w-ds-sm text-success-11" })
193
+ transition: w.bouncy,
194
+ children: /* @__PURE__ */ t(I, { icon: q, size: "2xl", className: "text-success-11" })
195
195
  },
196
196
  "complete"
197
197
  ) : /* @__PURE__ */ t(
@@ -201,11 +201,11 @@ const J = r.forwardRef(
201
201
  animate: { opacity: 1 },
202
202
  exit: { opacity: 0 },
203
203
  transition: N.fade,
204
- children: /* @__PURE__ */ t(q, { className: "h-ds-sm w-ds-sm text-surface-fg-subtle" })
204
+ children: /* @__PURE__ */ t(I, { icon: G, size: "2xl", className: "text-surface-fg-subtle" })
205
205
  },
206
206
  "upload"
207
207
  ) }),
208
- /* @__PURE__ */ t("span", { id: w + "-label", className: "text-ds-sm text-surface-fg-muted", children: O }),
208
+ /* @__PURE__ */ t("span", { id: D + "-label", className: "text-ds-sm text-surface-fg-muted", children: O }),
209
209
  o ? /* @__PURE__ */ t("div", { className: "w-full max-w-xs", children: /* @__PURE__ */ t(
210
210
  "div",
211
211
  {
@@ -219,11 +219,11 @@ const J = r.forwardRef(
219
219
  {
220
220
  className: "h-full rounded-ds-full bg-accent-9",
221
221
  animate: { width: `${x}%` },
222
- transition: D.smooth
222
+ transition: w.smooth
223
223
  }
224
224
  )
225
225
  }
226
- ) }) : /* @__PURE__ */ t("span", { className: "text-ds-xs text-surface-fg-subtle", children: V })
226
+ ) }) : /* @__PURE__ */ t("span", { className: "text-ds-xs text-surface-fg-subtle", children: X })
227
227
  ]
228
228
  }
229
229
  ),
@@ -231,18 +231,18 @@ const J = r.forwardRef(
231
231
  "input",
232
232
  {
233
233
  ref: y,
234
- id: w,
234
+ id: D,
235
235
  type: "file",
236
236
  className: "sr-only",
237
237
  style: { visibility: "hidden" },
238
238
  "aria-hidden": "true",
239
239
  "aria-label": O,
240
240
  accept: a,
241
- multiple: i,
242
- disabled: s,
243
- onChange: R,
244
- onClick: $,
245
- onFocus: P,
241
+ multiple: s,
242
+ disabled: n,
243
+ onChange: $,
244
+ onClick: P,
245
+ onFocus: z,
246
246
  tabIndex: -1
247
247
  }
248
248
  ),
@@ -263,7 +263,7 @@ const J = r.forwardRef(
263
263
  );
264
264
  }
265
265
  );
266
- J.displayName = "FileUpload";
266
+ Q.displayName = "FileUpload";
267
267
  export {
268
- J as FileUpload
268
+ Q as FileUpload
269
269
  };