@devalok/shilp-sutra 0.57.0 → 0.59.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 (258) hide show
  1. package/MIGRATION.md +91 -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/command-palette.js +137 -137
  31. package/dist/composed/command-palette.js.map +1 -1
  32. package/dist/composed/content-card.js +1 -1
  33. package/dist/composed/content-card.js.map +1 -1
  34. package/dist/composed/date-picker/index.js +5 -5
  35. package/dist/composed/date-picker/index.js.map +1 -1
  36. package/dist/composed/empty-state.js +4 -4
  37. package/dist/composed/file-preview/image-preview.d.ts.map +1 -1
  38. package/dist/composed/file-preview/shared.d.ts.map +1 -1
  39. package/dist/composed/file-preview/video-preview.d.ts.map +1 -1
  40. package/dist/composed/file-preview.js +151 -150
  41. package/dist/composed/file-preview.js.map +1 -1
  42. package/dist/composed/filter-bar.d.ts.map +1 -1
  43. package/dist/composed/filter-bar.js +53 -52
  44. package/dist/composed/filter-bar.js.map +1 -1
  45. package/dist/composed/form-section.d.ts.map +1 -1
  46. package/dist/composed/form-section.js +38 -37
  47. package/dist/composed/form-section.js.map +1 -1
  48. package/dist/composed/master-detail.d.ts.map +1 -1
  49. package/dist/composed/master-detail.js +1 -1
  50. package/dist/composed/master-detail.js.map +1 -1
  51. package/dist/composed/multi-select-popover.d.ts.map +1 -1
  52. package/dist/composed/multi-select-popover.js +109 -108
  53. package/dist/composed/multi-select-popover.js.map +1 -1
  54. package/dist/composed/rich-chat-input/attachment-strip.d.ts.map +1 -1
  55. package/dist/composed/rich-chat-input/reply-banner.d.ts.map +1 -1
  56. package/dist/composed/rich-chat-input/schedule-send.d.ts.map +1 -1
  57. package/dist/composed/rich-chat-input.d.ts.map +1 -1
  58. package/dist/composed/rich-chat-input.js +467 -466
  59. package/dist/composed/rich-chat-input.js.map +1 -1
  60. package/dist/composed/rich-text-editor.js +3 -3
  61. package/dist/composed/rich-text-editor.js.map +1 -1
  62. package/dist/composed/schedule-view.js +2 -2
  63. package/dist/composed/schedule-view.js.map +1 -1
  64. package/dist/composed/status-badge.d.ts.map +1 -1
  65. package/dist/composed/status-badge.js +29 -28
  66. package/dist/composed/status-badge.js.map +1 -1
  67. package/dist/motion/index.d.ts +1 -0
  68. package/dist/motion/index.d.ts.map +1 -1
  69. package/dist/motion/index.js +2 -15
  70. package/dist/motion/motion-preference.d.ts +36 -0
  71. package/dist/motion/motion-preference.d.ts.map +1 -0
  72. package/dist/motion/motion-provider.d.ts +2 -1
  73. package/dist/motion/motion-provider.d.ts.map +1 -1
  74. package/dist/motion/primitives-index.js +103 -102
  75. package/dist/motion/primitives-index.js.map +1 -1
  76. package/dist/motion/primitives.d.ts.map +1 -1
  77. package/dist/shell/bottom-navbar.js +19 -19
  78. package/dist/shell/bottom-navbar.js.map +1 -1
  79. package/dist/shell/index.d.ts +1 -1
  80. package/dist/shell/index.d.ts.map +1 -1
  81. package/dist/shell/notification-center.d.ts +17 -0
  82. package/dist/shell/notification-center.d.ts.map +1 -1
  83. package/dist/shell/notification-center.js +109 -104
  84. package/dist/shell/notification-center.js.map +1 -1
  85. package/dist/shell/notification-preferences.js +1 -1
  86. package/dist/shell/notification-preferences.js.map +1 -1
  87. package/dist/shell/top-bar.js +1 -1
  88. package/dist/shell/top-bar.js.map +1 -1
  89. package/dist/tokens/index.css +1 -0
  90. package/dist/tokens/palettes.css +292 -0
  91. package/dist/tokens/semantic.css +72 -8
  92. package/dist/tokens/shilp-sutra.css +1 -0
  93. package/dist/tokens/utilities.css +10 -7
  94. package/dist/ui/accordion.d.ts.map +1 -1
  95. package/dist/ui/accordion.js +27 -26
  96. package/dist/ui/accordion.js.map +1 -1
  97. package/dist/ui/alert-dialog.d.ts.map +1 -1
  98. package/dist/ui/alert-dialog.js +60 -59
  99. package/dist/ui/alert-dialog.js.map +1 -1
  100. package/dist/ui/alert.d.ts.map +1 -1
  101. package/dist/ui/alert.js +55 -113
  102. package/dist/ui/alert.js.map +1 -1
  103. package/dist/ui/autocomplete.js +80 -80
  104. package/dist/ui/autocomplete.js.map +1 -1
  105. package/dist/ui/avatar.d.ts.map +1 -1
  106. package/dist/ui/avatar.js +69 -68
  107. package/dist/ui/avatar.js.map +1 -1
  108. package/dist/ui/badge-indicator.d.ts +4 -8
  109. package/dist/ui/badge-indicator.d.ts.map +1 -1
  110. package/dist/ui/badge-indicator.js +3 -8
  111. package/dist/ui/badge-indicator.js.map +1 -1
  112. package/dist/ui/badge.d.ts +8 -1
  113. package/dist/ui/badge.d.ts.map +1 -1
  114. package/dist/ui/banner.d.ts.map +1 -1
  115. package/dist/ui/banner.js +42 -40
  116. package/dist/ui/banner.js.map +1 -1
  117. package/dist/ui/button-group.d.ts.map +1 -1
  118. package/dist/ui/button-group.js +3 -23
  119. package/dist/ui/button-group.js.map +1 -1
  120. package/dist/ui/button.d.ts +10 -1
  121. package/dist/ui/button.d.ts.map +1 -1
  122. package/dist/ui/button.js +79 -212
  123. package/dist/ui/button.js.map +1 -1
  124. package/dist/ui/card.d.ts.map +1 -1
  125. package/dist/ui/card.js +75 -72
  126. package/dist/ui/card.js.map +1 -1
  127. package/dist/ui/charts/radar-chart.d.ts.map +1 -1
  128. package/dist/ui/charts/radar-chart.js +1 -1
  129. package/dist/ui/charts/radar-chart.js.map +1 -1
  130. package/dist/ui/chat/message-list.d.ts.map +1 -1
  131. package/dist/ui/chat/message.d.ts.map +1 -1
  132. package/dist/ui/chat/typing-indicator.d.ts.map +1 -1
  133. package/dist/ui/code.js +1 -1
  134. package/dist/ui/code.js.map +1 -1
  135. package/dist/ui/color-input.d.ts.map +1 -1
  136. package/dist/ui/color-input.js +151 -150
  137. package/dist/ui/color-input.js.map +1 -1
  138. package/dist/ui/combobox.d.ts +14 -0
  139. package/dist/ui/combobox.d.ts.map +1 -1
  140. package/dist/ui/combobox.js +152 -148
  141. package/dist/ui/combobox.js.map +1 -1
  142. package/dist/ui/context-menu.d.ts.map +1 -1
  143. package/dist/ui/context-menu.js +70 -69
  144. package/dist/ui/context-menu.js.map +1 -1
  145. package/dist/ui/data-table-body.js +2 -2
  146. package/dist/ui/data-table-body.js.map +1 -1
  147. package/dist/ui/data-table-context.js +2 -2
  148. package/dist/ui/data-table-context.js.map +1 -1
  149. package/dist/ui/data-table-header.d.ts.map +1 -1
  150. package/dist/ui/data-table-header.js +41 -40
  151. package/dist/ui/data-table-header.js.map +1 -1
  152. package/dist/ui/data-table-pagination.js +2 -2
  153. package/dist/ui/data-table-pagination.js.map +1 -1
  154. package/dist/ui/dialog.d.ts.map +1 -1
  155. package/dist/ui/dialog.js +61 -60
  156. package/dist/ui/dialog.js.map +1 -1
  157. package/dist/ui/dot.d.ts.map +1 -1
  158. package/dist/ui/dot.js +10 -41
  159. package/dist/ui/dot.js.map +1 -1
  160. package/dist/ui/dropdown-menu.d.ts.map +1 -1
  161. package/dist/ui/dropdown-menu.js +79 -78
  162. package/dist/ui/dropdown-menu.js.map +1 -1
  163. package/dist/ui/file-upload.d.ts.map +1 -1
  164. package/dist/ui/file-upload.js +116 -115
  165. package/dist/ui/file-upload.js.map +1 -1
  166. package/dist/ui/form.d.ts.map +1 -1
  167. package/dist/ui/form.js +27 -26
  168. package/dist/ui/form.js.map +1 -1
  169. package/dist/ui/hover-card.d.ts.map +1 -1
  170. package/dist/ui/hover-card.js +26 -25
  171. package/dist/ui/hover-card.js.map +1 -1
  172. package/dist/ui/icon.js +7 -7
  173. package/dist/ui/index.d.ts +2 -2
  174. package/dist/ui/index.d.ts.map +1 -1
  175. package/dist/ui/index.js +3 -3
  176. package/dist/ui/index.js.map +1 -1
  177. package/dist/ui/input.js +1 -1
  178. package/dist/ui/input.js.map +1 -1
  179. package/dist/ui/menubar.d.ts.map +1 -1
  180. package/dist/ui/menubar.js +73 -72
  181. package/dist/ui/menubar.js.map +1 -1
  182. package/dist/ui/navigation-menu.d.ts.map +1 -1
  183. package/dist/ui/navigation-menu.js +80 -79
  184. package/dist/ui/navigation-menu.js.map +1 -1
  185. package/dist/ui/popover.d.ts.map +1 -1
  186. package/dist/ui/progress.d.ts.map +1 -1
  187. package/dist/ui/progress.js +72 -68
  188. package/dist/ui/progress.js.map +1 -1
  189. package/dist/ui/radio.d.ts.map +1 -1
  190. package/dist/ui/radio.js +32 -31
  191. package/dist/ui/radio.js.map +1 -1
  192. package/dist/ui/search-input.d.ts.map +1 -1
  193. package/dist/ui/search-input.js +28 -27
  194. package/dist/ui/search-input.js.map +1 -1
  195. package/dist/ui/select.d.ts.map +1 -1
  196. package/dist/ui/select.js +64 -63
  197. package/dist/ui/select.js.map +1 -1
  198. package/dist/ui/sidebar.d.ts.map +1 -1
  199. package/dist/ui/sidebar.js +4 -4
  200. package/dist/ui/sidebar.js.map +1 -1
  201. package/dist/ui/slider.d.ts +63 -9
  202. package/dist/ui/slider.d.ts.map +1 -1
  203. package/dist/ui/slider.js +74 -32
  204. package/dist/ui/slider.js.map +1 -1
  205. package/dist/ui/split-button.d.ts +8 -2
  206. package/dist/ui/split-button.d.ts.map +1 -1
  207. package/dist/ui/split-button.js +49 -95
  208. package/dist/ui/split-button.js.map +1 -1
  209. package/dist/ui/stat-card.d.ts.map +1 -1
  210. package/dist/ui/stat-card.js +89 -88
  211. package/dist/ui/stat-card.js.map +1 -1
  212. package/dist/ui/stat-flash.js +16 -16
  213. package/dist/ui/stepper.d.ts.map +1 -1
  214. package/dist/ui/stepper.js +63 -62
  215. package/dist/ui/stepper.js.map +1 -1
  216. package/dist/ui/table.js +3 -3
  217. package/dist/ui/table.js.map +1 -1
  218. package/dist/ui/tabs.d.ts.map +1 -1
  219. package/dist/ui/tabs.js +67 -66
  220. package/dist/ui/tabs.js.map +1 -1
  221. package/dist/ui/textarea.js +1 -1
  222. package/dist/ui/textarea.js.map +1 -1
  223. package/dist/ui/toast.d.ts.map +1 -1
  224. package/dist/ui/toast.js +195 -194
  225. package/dist/ui/toast.js.map +1 -1
  226. package/dist/ui/toggle.d.ts.map +1 -1
  227. package/dist/ui/toggle.js +24 -22
  228. package/dist/ui/toggle.js.map +1 -1
  229. package/dist/ui/tooltip.d.ts.map +1 -1
  230. package/dist/ui/tooltip.js +37 -36
  231. package/dist/ui/tooltip.js.map +1 -1
  232. package/dist/ui/tree-view/tree-item.d.ts.map +1 -1
  233. package/docs/recipes/customize-brand.md +58 -0
  234. package/docs/recipes/install-astro.md +1 -1
  235. package/docs/recipes/install-next-app-router.md +1 -1
  236. package/docs/recipes/install-next-pages.md +22 -1
  237. package/docs/recipes/install-remix.md +1 -1
  238. package/docs/recipes/install-tanstack-start.md +1 -1
  239. package/docs/recipes/install-vite.md +2 -1
  240. package/docs/recipes/server-components.md +7 -4
  241. package/docs/recipes/troubleshoot.md +1 -0
  242. package/llms.txt +1 -1
  243. package/mcp-manifest.json +9 -4
  244. package/package.json +3 -2
  245. package/skill/SKILL.md +1 -1
  246. package/skill/references/components.md +1 -1
  247. package/skill/references/customize-brand.md +58 -0
  248. package/skill/references/server-components.md +7 -4
  249. package/skill/references/setup-astro.md +1 -1
  250. package/skill/references/setup-next-app-router.md +1 -1
  251. package/skill/references/setup-next-pages.md +22 -1
  252. package/skill/references/setup-remix.md +1 -1
  253. package/skill/references/setup-tanstack-start.md +1 -1
  254. package/skill/references/setup-vite.md +2 -1
  255. package/skill/references/troubleshoot.md +1 -0
  256. package/dist/motion/check-motion-provider.d.ts +0 -2
  257. package/dist/motion/check-motion-provider.d.ts.map +0 -1
  258. package/dist/motion/index.js.map +0 -1
@@ -1,24 +1,25 @@
1
1
  "use client";
2
2
  import { springs as e, tweens as t } from "../ui/lib/motion.js";
3
- import { cn as n } from "../ui/lib/utils.js";
4
- import { Icon as r } from "../ui/icon.js";
5
- import { Skeleton as i } from "../ui/skeleton.js";
6
- import { BadgeCompound as a } from "../_chunks/badge-group.js";
7
- import { Button as o } from "../ui/button.js";
8
- import { TruncatedText as s } from "../ui/truncated-text.js";
9
- import { ErrorFallback as c, MediaSlider as l, VolumeControl as u, formatTime as d } from "../_chunks/shared.js";
10
- import * as f from "react";
11
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
12
- import { IconDownload as h, IconMaximize as g, IconPlayerPause as _, IconPlayerPlay as v } from "@tabler/icons-react";
13
- import { AnimatePresence as y, motion as b } from "framer-motion";
3
+ import { MotionPreference as n } from "../_chunks/motion-preference.js";
4
+ import { cn as r } from "../ui/lib/utils.js";
5
+ import { Icon as i } from "../ui/icon.js";
6
+ import { Skeleton as a } from "../ui/skeleton.js";
7
+ import { BadgeCompound as o } from "../_chunks/badge-group.js";
8
+ import { Button as s } from "../ui/button.js";
9
+ import { TruncatedText as c } from "../ui/truncated-text.js";
10
+ import { ErrorFallback as l, MediaSlider as u, VolumeControl as d, formatTime as f } from "../_chunks/shared.js";
11
+ import * as p from "react";
12
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
13
+ import { IconDownload as g, IconMaximize as _, IconPlayerPause as v, IconPlayerPlay as y } from "@tabler/icons-react";
14
+ import { AnimatePresence as b, motion as x } from "framer-motion";
14
15
  //#region src/composed/file-preview/audio-preview.tsx
15
- function x({ url: e, fileName: t, onError: n }) {
16
- let i = f.useRef(null), a = f.useRef(null), [h, g] = f.useState(!1), [y, b] = f.useState(0), [x, S] = f.useState(0), [C, w] = f.useState(0), [T, E] = f.useState(1), [D, O] = f.useState(!1), [k, A] = f.useState(!1);
17
- f.useEffect(() => {
16
+ function S({ url: e, fileName: t, onError: n }) {
17
+ let r = p.useRef(null), a = p.useRef(null), [o, g] = p.useState(!1), [_, b] = p.useState(0), [x, S] = p.useState(0), [C, w] = p.useState(0), [T, E] = p.useState(1), [D, O] = p.useState(!1), [k, A] = p.useState(!1);
18
+ p.useEffect(() => {
18
19
  function e(e) {
19
20
  let t = a.current;
20
21
  if (!t || !t.contains(document.activeElement) && document.activeElement !== t) return;
21
- let n = i.current;
22
+ let n = r.current;
22
23
  if (n) switch (e.key) {
23
24
  case " ":
24
25
  e.preventDefault(), g((e) => (e ? n.pause() : n.play(), !e));
@@ -37,40 +38,40 @@ function x({ url: e, fileName: t, onError: n }) {
37
38
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
38
39
  }, []);
39
40
  function j() {
40
- i.current && (h ? i.current.pause() : i.current.play(), g(!h));
41
+ r.current && (o ? r.current.pause() : r.current.play(), g(!o));
41
42
  }
42
43
  function M(e) {
43
- !i.current || !x || (i.current.currentTime = e / 100 * x);
44
+ !r.current || !x || (r.current.currentTime = e / 100 * x);
44
45
  }
45
46
  function N() {
46
- if (!i.current) return;
47
+ if (!r.current) return;
47
48
  let e = !D;
48
- O(e), i.current.muted = e;
49
+ O(e), r.current.muted = e;
49
50
  }
50
- return k ? /* @__PURE__ */ p(c, {
51
+ return k ? /* @__PURE__ */ m(l, {
51
52
  message: "Could not load audio",
52
53
  url: e
53
- }) : /* @__PURE__ */ m("div", {
54
+ }) : /* @__PURE__ */ h("div", {
54
55
  ref: a,
55
56
  className: "rounded-surface bg-surface-panel overflow-hidden",
56
57
  tabIndex: -1,
57
58
  children: [
58
- /* @__PURE__ */ p("audio", {
59
- ref: i,
59
+ /* @__PURE__ */ m("audio", {
60
+ ref: r,
60
61
  src: e,
61
62
  onTimeUpdate: () => {
62
- i.current && (w(i.current.currentTime), i.current.duration && b(i.current.currentTime / i.current.duration * 100));
63
+ r.current && (w(r.current.currentTime), r.current.duration && b(r.current.currentTime / r.current.duration * 100));
63
64
  },
64
- onLoadedMetadata: () => S(i.current?.duration ?? 0),
65
+ onLoadedMetadata: () => S(r.current?.duration ?? 0),
65
66
  onEnded: () => g(!1),
66
67
  onError: () => {
67
68
  A(!0), n?.("Audio failed to load");
68
69
  }
69
70
  }),
70
- /* @__PURE__ */ p("div", {
71
+ /* @__PURE__ */ m("div", {
71
72
  className: "px-ds-03 pt-ds-02",
72
- children: /* @__PURE__ */ p(l, {
73
- value: y,
73
+ children: /* @__PURE__ */ m(u, {
74
+ value: _,
74
75
  max: 100,
75
76
  step: .1,
76
77
  onValueChange: M,
@@ -78,46 +79,46 @@ function x({ url: e, fileName: t, onError: n }) {
78
79
  ariaLabel: "Audio progress"
79
80
  })
80
81
  }),
81
- /* @__PURE__ */ m("div", {
82
+ /* @__PURE__ */ h("div", {
82
83
  className: "flex items-center gap-ds-04 px-ds-05 py-ds-04",
83
84
  children: [
84
- /* @__PURE__ */ p(o, {
85
+ /* @__PURE__ */ m(s, {
85
86
  variant: "solid",
86
87
  size: "icon-sm",
87
88
  onClick: j,
88
- "aria-label": h ? "Pause" : "Play",
89
- title: h ? "Pause" : "Play",
89
+ "aria-label": o ? "Pause" : "Play",
90
+ title: o ? "Pause" : "Play",
90
91
  className: "shrink-0",
91
- children: h ? /* @__PURE__ */ p(r, {
92
- icon: _,
93
- size: "sm"
94
- }) : /* @__PURE__ */ p(r, {
92
+ children: o ? /* @__PURE__ */ m(i, {
95
93
  icon: v,
94
+ size: "sm"
95
+ }) : /* @__PURE__ */ m(i, {
96
+ icon: y,
96
97
  size: "sm",
97
98
  className: "ml-0.5"
98
99
  })
99
100
  }),
100
- /* @__PURE__ */ m("div", {
101
+ /* @__PURE__ */ h("div", {
101
102
  className: "flex-1 min-w-0",
102
- children: [t && /* @__PURE__ */ p(s, {
103
+ children: [t && /* @__PURE__ */ m(c, {
103
104
  as: "p",
104
105
  mode: "middle",
105
106
  className: "text-body-sm font-semibold text-surface-fg",
106
107
  children: t
107
- }), /* @__PURE__ */ m("p", {
108
+ }), /* @__PURE__ */ h("p", {
108
109
  className: "text-caption font-mono text-surface-fg-muted tabular-nums",
109
110
  children: [
110
- d(C),
111
+ f(C),
111
112
  " / ",
112
- d(x)
113
+ f(x)
113
114
  ]
114
115
  })]
115
116
  }),
116
- /* @__PURE__ */ p(u, {
117
+ /* @__PURE__ */ m(d, {
117
118
  volume: T,
118
119
  muted: D,
119
120
  onVolumeChange: (e) => {
120
- E(e), i.current && (i.current.volume = e), e > 0 && D && (O(!1), i.current && (i.current.muted = !1));
121
+ E(e), r.current && (r.current.volume = e), e > 0 && D && (O(!1), r.current && (r.current.muted = !1));
121
122
  },
122
123
  onMuteToggle: N,
123
124
  variant: "light"
@@ -129,28 +130,28 @@ function x({ url: e, fileName: t, onError: n }) {
129
130
  }
130
131
  //#endregion
131
132
  //#region src/composed/file-preview/embed-preview.tsx
132
- function S({ url: e, embedUrl: n, onError: r }) {
133
- let [a, o] = f.useState(!1), [s, l] = f.useState(!1);
134
- return f.useEffect(() => {
133
+ function C({ url: e, embedUrl: n, onError: r }) {
134
+ let [i, o] = p.useState(!1), [s, c] = p.useState(!1);
135
+ return p.useEffect(() => {
135
136
  let e = setTimeout(() => {
136
- a || (l(!0), r?.("Embed timed out"));
137
+ i || (c(!0), r?.("Embed timed out"));
137
138
  }, 15e3);
138
139
  return () => clearTimeout(e);
139
- }, [a, r]), s ? /* @__PURE__ */ p(c, {
140
+ }, [i, r]), s ? /* @__PURE__ */ m(l, {
140
141
  message: "Could not load embed",
141
142
  url: e
142
- }) : /* @__PURE__ */ m("div", {
143
+ }) : /* @__PURE__ */ h("div", {
143
144
  className: "relative w-full rounded-control overflow-hidden",
144
145
  style: { aspectRatio: "16 / 9" },
145
- children: [!a && /* @__PURE__ */ p(i, { className: "absolute inset-0" }), /* @__PURE__ */ p(b.iframe, {
146
+ children: [!i && /* @__PURE__ */ m(a, { className: "absolute inset-0" }), /* @__PURE__ */ m(x.iframe, {
146
147
  src: n,
147
148
  title: "Embedded content",
148
149
  onLoad: () => o(!0),
149
150
  onError: () => {
150
- l(!0), r?.("Embed failed to load");
151
+ c(!0), r?.("Embed failed to load");
151
152
  },
152
153
  initial: { opacity: 0 },
153
- animate: { opacity: +!!a },
154
+ animate: { opacity: +!!i },
154
155
  transition: t.fade,
155
156
  className: "absolute inset-0 h-full w-full border-none",
156
157
  allowFullScreen: !0
@@ -159,7 +160,7 @@ function S({ url: e, embedUrl: n, onError: r }) {
159
160
  }
160
161
  //#endregion
161
162
  //#region src/composed/file-preview/video-preview.tsx
162
- var C = [
163
+ var w = [
163
164
  .5,
164
165
  .75,
165
166
  1,
@@ -167,19 +168,19 @@ var C = [
167
168
  1.5,
168
169
  2
169
170
  ];
170
- function w({ url: n, onError: i }) {
171
- let a = f.useRef(null), o = f.useRef(null), [s, h] = f.useState(!1), [x, S] = f.useState(0), [w, T] = f.useState(0), [E, D] = f.useState(0), [O, k] = f.useState(!1), [A, j] = f.useState(!1), [M, N] = f.useState(!0), [P, F] = f.useState(1), I = f.useRef(P);
172
- I.current = P;
173
- let L = f.useRef(void 0);
174
- f.useEffect(() => () => clearTimeout(L.current), []), f.useEffect(() => {
171
+ function T({ url: r, onError: a }) {
172
+ let o = p.useRef(null), s = p.useRef(null), [c, g] = p.useState(!1), [S, C] = p.useState(0), [T, E] = p.useState(0), [D, O] = p.useState(0), [k, A] = p.useState(!1), [j, M] = p.useState(!1), [N, P] = p.useState(!0), [F, I] = p.useState(1), L = p.useRef(F);
173
+ L.current = F;
174
+ let R = p.useRef(void 0);
175
+ p.useEffect(() => () => clearTimeout(R.current), []), p.useEffect(() => {
175
176
  function e(e) {
176
- let t = o.current;
177
+ let t = s.current;
177
178
  if (!t || !t.contains(document.activeElement) && document.activeElement !== t) return;
178
- let n = a.current;
179
+ let n = o.current;
179
180
  if (n) switch (e.key) {
180
181
  case " ":
181
182
  case "k":
182
- e.preventDefault(), h((e) => (e ? n.pause() : n.play(), !e));
183
+ e.preventDefault(), g((e) => (e ? n.pause() : n.play(), !e));
183
184
  break;
184
185
  case "ArrowRight":
185
186
  e.preventDefault(), n.currentTime = Math.min(n.duration, n.currentTime + 5);
@@ -194,63 +195,63 @@ function w({ url: n, onError: i }) {
194
195
  e.preventDefault(), n.currentTime = Math.min(n.duration, n.currentTime + 10);
195
196
  break;
196
197
  case "m":
197
- e.preventDefault(), k((e) => (n.muted = !e, !e));
198
+ e.preventDefault(), A((e) => (n.muted = !e, !e));
198
199
  break;
199
200
  case "f":
200
201
  e.preventDefault(), n.requestFullscreen?.();
201
202
  break;
202
203
  case ">":
203
- e.preventDefault(), R(1);
204
+ e.preventDefault(), z(1);
204
205
  break;
205
206
  case "<":
206
- e.preventDefault(), R(-1);
207
+ e.preventDefault(), z(-1);
207
208
  break;
208
209
  }
209
210
  }
210
211
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
211
212
  }, []);
212
- function R(e) {
213
- let t = C.indexOf(I.current), n = C[Math.max(0, Math.min(C.length - 1, t + e))];
214
- F(n), a.current && (a.current.playbackRate = n);
213
+ function z(e) {
214
+ let t = w.indexOf(L.current), n = w[Math.max(0, Math.min(w.length - 1, t + e))];
215
+ I(n), o.current && (o.current.playbackRate = n);
215
216
  }
216
- function z() {
217
- a.current && (s ? a.current.pause() : a.current.play(), h(!s));
217
+ function B() {
218
+ o.current && (c ? o.current.pause() : o.current.play(), g(!c));
218
219
  }
219
- function B(e) {
220
- !a.current || !w || (a.current.currentTime = e / 100 * w);
220
+ function V(e) {
221
+ !o.current || !T || (o.current.currentTime = e / 100 * T);
221
222
  }
222
- function V() {
223
- N(!0), clearTimeout(L.current), s && (L.current = setTimeout(() => N(!1), 3e3));
223
+ function H() {
224
+ P(!0), clearTimeout(R.current), c && (R.current = setTimeout(() => P(!1), 3e3));
224
225
  }
225
- return A ? /* @__PURE__ */ p(c, {
226
+ return j ? /* @__PURE__ */ m(l, {
226
227
  message: "Could not load video",
227
- url: n
228
- }) : /* @__PURE__ */ m("div", {
229
- ref: o,
228
+ url: r
229
+ }) : /* @__PURE__ */ m(n, { children: /* @__PURE__ */ h("div", {
230
+ ref: s,
230
231
  className: "group relative rounded-control bg-black overflow-hidden",
231
- onMouseMove: V,
232
- onMouseLeave: () => s && N(!1),
232
+ onMouseMove: H,
233
+ onMouseLeave: () => c && P(!1),
233
234
  tabIndex: -1,
234
235
  children: [
235
- /* @__PURE__ */ p("video", {
236
- ref: a,
237
- src: n,
236
+ /* @__PURE__ */ m("video", {
237
+ ref: o,
238
+ src: r,
238
239
  className: "max-h-[70vh] w-full",
239
- onClick: z,
240
- muted: O,
240
+ onClick: B,
241
+ muted: k,
241
242
  onTimeUpdate: () => {
242
- a.current && (D(a.current.currentTime), a.current.duration && S(a.current.currentTime / a.current.duration * 100));
243
+ o.current && (O(o.current.currentTime), o.current.duration && C(o.current.currentTime / o.current.duration * 100));
243
244
  },
244
- onLoadedMetadata: () => T(a.current?.duration ?? 0),
245
+ onLoadedMetadata: () => E(o.current?.duration ?? 0),
245
246
  onEnded: () => {
246
- h(!1), N(!0);
247
+ g(!1), P(!0);
247
248
  },
248
249
  onError: () => {
249
- j(!0), i?.("Video failed to load");
250
+ M(!0), a?.("Video failed to load");
250
251
  },
251
252
  playsInline: !0
252
253
  }),
253
- !s && /* @__PURE__ */ p(b.button, {
254
+ !c && /* @__PURE__ */ m(x.button, {
254
255
  initial: {
255
256
  opacity: 0,
256
257
  scale: .8
@@ -260,19 +261,19 @@ function w({ url: n, onError: i }) {
260
261
  scale: 1
261
262
  },
262
263
  transition: e.snappy,
263
- onClick: z,
264
+ onClick: B,
264
265
  className: "absolute inset-0 flex items-center justify-center bg-black/30",
265
266
  "aria-label": "Play video",
266
- children: /* @__PURE__ */ p("div", {
267
+ children: /* @__PURE__ */ m("div", {
267
268
  className: "flex h-14 w-14 items-center justify-center rounded-pill bg-white/90 shadow-floating",
268
- children: /* @__PURE__ */ p(r, {
269
- icon: v,
269
+ children: /* @__PURE__ */ m(i, {
270
+ icon: y,
270
271
  size: "xl",
271
272
  className: "text-surface-fg ml-0.5"
272
273
  })
273
274
  })
274
275
  }),
275
- /* @__PURE__ */ p(y, { children: M && w > 0 && /* @__PURE__ */ m(b.div, {
276
+ /* @__PURE__ */ m(b, { children: N && T > 0 && /* @__PURE__ */ h(x.div, {
276
277
  initial: {
277
278
  opacity: 0,
278
279
  y: 10
@@ -287,63 +288,63 @@ function w({ url: n, onError: i }) {
287
288
  },
288
289
  transition: t.fade,
289
290
  className: "absolute bottom-0 left-0 right-0 bg-linear-to-t from-black/80 to-transparent px-ds-04 pb-ds-04 pt-ds-08",
290
- children: [/* @__PURE__ */ p(l, {
291
+ children: [/* @__PURE__ */ m(u, {
291
292
  className: "mb-ds-03",
292
- value: x,
293
+ value: S,
293
294
  max: 100,
294
295
  step: .1,
295
- onValueChange: B,
296
+ onValueChange: V,
296
297
  tone: "dark",
297
298
  ariaLabel: "Video progress"
298
- }), /* @__PURE__ */ m("div", {
299
+ }), /* @__PURE__ */ h("div", {
299
300
  className: "flex items-center gap-ds-03",
300
301
  children: [
301
- /* @__PURE__ */ p("button", {
302
- onClick: z,
302
+ /* @__PURE__ */ m("button", {
303
+ onClick: B,
303
304
  className: "text-white hover:text-white/80",
304
- "aria-label": s ? "Pause" : "Play",
305
- title: s ? "Pause" : "Play",
306
- children: s ? /* @__PURE__ */ p(r, {
307
- icon: _,
308
- size: "lg"
309
- }) : /* @__PURE__ */ p(r, {
305
+ "aria-label": c ? "Pause" : "Play",
306
+ title: c ? "Pause" : "Play",
307
+ children: c ? /* @__PURE__ */ m(i, {
310
308
  icon: v,
311
309
  size: "lg"
310
+ }) : /* @__PURE__ */ m(i, {
311
+ icon: y,
312
+ size: "lg"
312
313
  })
313
314
  }),
314
- /* @__PURE__ */ p(u, {
315
- volume: +!O,
316
- muted: O,
315
+ /* @__PURE__ */ m(d, {
316
+ volume: +!k,
317
+ muted: k,
317
318
  onVolumeChange: (e) => {
318
- a.current && (a.current.volume = e), e > 0 && O && (k(!1), a.current && (a.current.muted = !1));
319
+ o.current && (o.current.volume = e), e > 0 && k && (A(!1), o.current && (o.current.muted = !1));
319
320
  },
320
321
  onMuteToggle: () => {
321
- k(!O), a.current && (a.current.muted = !O);
322
+ A(!k), o.current && (o.current.muted = !k);
322
323
  },
323
324
  variant: "dark"
324
325
  }),
325
- /* @__PURE__ */ m("span", {
326
+ /* @__PURE__ */ h("span", {
326
327
  className: "text-body-sm font-mono text-white/70 tabular-nums",
327
328
  children: [
328
- d(E),
329
+ f(D),
329
330
  " / ",
330
- d(w)
331
+ f(T)
331
332
  ]
332
333
  }),
333
- /* @__PURE__ */ p("div", { className: "flex-1" }),
334
- /* @__PURE__ */ m("button", {
335
- onClick: () => R(1),
334
+ /* @__PURE__ */ m("div", { className: "flex-1" }),
335
+ /* @__PURE__ */ h("button", {
336
+ onClick: () => z(1),
336
337
  className: "text-body-sm font-mono text-white/70 hover:text-white px-1 rounded-control-inner hover:bg-white/10 transition-colors",
337
- "aria-label": `Playback speed: ${P}x`,
338
- children: [P, "x"]
338
+ "aria-label": `Playback speed: ${F}x`,
339
+ children: [F, "x"]
339
340
  }),
340
- /* @__PURE__ */ p("button", {
341
- onClick: () => a.current?.requestFullscreen?.(),
341
+ /* @__PURE__ */ m("button", {
342
+ onClick: () => o.current?.requestFullscreen?.(),
342
343
  className: "text-white hover:text-white/80",
343
344
  "aria-label": "Fullscreen (F)",
344
345
  title: "Fullscreen",
345
- children: /* @__PURE__ */ p(r, {
346
- icon: g,
346
+ children: /* @__PURE__ */ m(i, {
347
+ icon: _,
347
348
  size: "sm"
348
349
  })
349
350
  })
@@ -351,12 +352,12 @@ function w({ url: n, onError: i }) {
351
352
  })]
352
353
  }) })
353
354
  ]
354
- });
355
+ }) });
355
356
  }
356
357
  //#endregion
357
358
  //#region src/composed/file-preview.tsx
358
- var T = f.lazy(() => import("../_chunks/image-preview.js")), E = f.lazy(() => import("../_chunks/document-preview.js"));
359
- function D(e, t) {
359
+ var E = p.lazy(() => import("../_chunks/image-preview.js")), D = p.lazy(() => import("../_chunks/document-preview.js"));
360
+ function O(e, t) {
360
361
  if (t) {
361
362
  if (t.startsWith("image/")) return "image";
362
363
  if (t === "application/pdf") return "pdf";
@@ -386,7 +387,7 @@ function D(e, t) {
386
387
  "flac"
387
388
  ].includes(n ?? "") ? "audio" : e.includes("figma.com") || e.includes("loom.com") || e.includes("youtube.com") || e.includes("youtu.be") || e.includes("vimeo.com") ? "embed" : "image";
388
389
  }
389
- function O(e) {
390
+ function k(e) {
390
391
  let t = e.match(/(?:youtube\.com\/watch\?v=|youtu\.be\/)([^&?]+)/);
391
392
  if (t) return `https://www.youtube.com/embed/${t[1]}`;
392
393
  let n = e.match(/vimeo\.com\/(\d+)/);
@@ -395,62 +396,62 @@ function O(e) {
395
396
  let r = e.match(/loom\.com\/share\/([^?]+)/);
396
397
  return r ? `https://www.loom.com/embed/${r[1]}` : e;
397
398
  }
398
- function k({ url: e, type: t, mimeType: c, alt: l, initialPage: u = 1, fileName: d, fileSize: g, onError: _, className: v, ...y }) {
399
- let b = t ?? D(e, c), C = /* @__PURE__ */ p(i, { className: "h-64 w-full rounded-control" });
400
- return /* @__PURE__ */ m("div", {
401
- className: n("flex flex-col gap-ds-03", v),
399
+ function A({ url: e, type: t, mimeType: n, alt: l, initialPage: u = 1, fileName: d, fileSize: f, onError: _, className: v, ...y }) {
400
+ let b = t ?? O(e, n), x = /* @__PURE__ */ m(a, { className: "h-64 w-full rounded-control" });
401
+ return /* @__PURE__ */ h("div", {
402
+ className: r("flex flex-col gap-ds-03", v),
402
403
  ...y,
403
404
  children: [
404
- (d || g) && /* @__PURE__ */ m("div", {
405
+ (d || f) && /* @__PURE__ */ h("div", {
405
406
  className: "flex items-center gap-ds-03",
406
- children: [d && /* @__PURE__ */ p(s, {
407
+ children: [d && /* @__PURE__ */ m(c, {
407
408
  mode: "middle",
408
409
  className: "min-w-0 text-body-sm font-semibold text-surface-fg",
409
410
  children: d
410
- }), g && /* @__PURE__ */ p(a, {
411
+ }), f && /* @__PURE__ */ m(o, {
411
412
  variant: "subtle",
412
413
  size: "xs",
413
- children: g
414
+ children: f
414
415
  })]
415
416
  }),
416
- b === "image" && /* @__PURE__ */ p(f.Suspense, {
417
- fallback: C,
418
- children: /* @__PURE__ */ p(T, {
417
+ b === "image" && /* @__PURE__ */ m(p.Suspense, {
418
+ fallback: x,
419
+ children: /* @__PURE__ */ m(E, {
419
420
  url: e,
420
421
  alt: l,
421
422
  onError: _
422
423
  })
423
424
  }),
424
- b === "pdf" && /* @__PURE__ */ p(f.Suspense, {
425
- fallback: C,
426
- children: /* @__PURE__ */ p(E, {
425
+ b === "pdf" && /* @__PURE__ */ m(p.Suspense, {
426
+ fallback: x,
427
+ children: /* @__PURE__ */ m(D, {
427
428
  url: e,
428
429
  initialPage: u,
429
430
  onError: _
430
431
  })
431
432
  }),
432
- b === "video" && /* @__PURE__ */ p(w, {
433
+ b === "video" && /* @__PURE__ */ m(T, {
433
434
  url: e,
434
435
  onError: _
435
436
  }),
436
- b === "audio" && /* @__PURE__ */ p(x, {
437
+ b === "audio" && /* @__PURE__ */ m(S, {
437
438
  url: e,
438
439
  fileName: d,
439
440
  onError: _
440
441
  }),
441
- b === "embed" && /* @__PURE__ */ p(S, {
442
+ b === "embed" && /* @__PURE__ */ m(C, {
442
443
  url: e,
443
- embedUrl: O(e),
444
+ embedUrl: k(e),
444
445
  onError: _
445
446
  }),
446
- b !== "audio" && /* @__PURE__ */ p("div", {
447
+ b !== "audio" && /* @__PURE__ */ m("div", {
447
448
  className: "flex justify-end",
448
- children: /* @__PURE__ */ p(o, {
449
+ children: /* @__PURE__ */ m(s, {
449
450
  variant: "ghost",
450
451
  size: "xs",
451
- startIcon: /* @__PURE__ */ p(r, { icon: h }),
452
+ startIcon: /* @__PURE__ */ m(i, { icon: g }),
452
453
  asChild: !0,
453
- children: /* @__PURE__ */ p("a", {
454
+ children: /* @__PURE__ */ m("a", {
454
455
  href: e,
455
456
  download: !0,
456
457
  target: "_blank",
@@ -463,4 +464,4 @@ function k({ url: e, type: t, mimeType: c, alt: l, initialPage: u = 1, fileName:
463
464
  });
464
465
  }
465
466
  //#endregion
466
- export { k as FilePreview };
467
+ export { A as FilePreview };