@devalok/shilp-sutra 0.44.0 → 0.45.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 (131) hide show
  1. package/AGENTS.md +13 -11
  2. package/BREAKING.json +209 -27
  3. package/MIGRATION.md +34 -0
  4. package/README.md +12 -0
  5. package/dist/_chunks/badge-group.js +1 -0
  6. package/dist/_chunks/badge-group.js.map +1 -1
  7. package/dist/_chunks/block-shell.js +25 -0
  8. package/dist/_chunks/block-shell.js.map +1 -0
  9. package/dist/_chunks/chat.js +4 -2
  10. package/dist/_chunks/chat.js.map +1 -1
  11. package/dist/_chunks/document-preview.js +1 -1
  12. package/dist/_chunks/image-preview.js +4 -4
  13. package/dist/_chunks/shared.js +65 -78
  14. package/dist/_chunks/shared.js.map +1 -1
  15. package/dist/_chunks/success.js +108 -106
  16. package/dist/_chunks/success.js.map +1 -1
  17. package/dist/ai/blocks/block-shell.d.ts +19 -0
  18. package/dist/ai/blocks/block-shell.d.ts.map +1 -0
  19. package/dist/ai/blocks/block-table.d.ts.map +1 -1
  20. package/dist/ai/blocks/confirm.d.ts.map +1 -1
  21. package/dist/ai/blocks/error.d.ts.map +1 -1
  22. package/dist/ai/blocks/error.js +5 -5
  23. package/dist/ai/blocks/error.js.map +1 -1
  24. package/dist/ai/blocks/success.d.ts.map +1 -1
  25. package/dist/ai/blocks/text.d.ts.map +1 -1
  26. package/dist/ai/blocks/text.js +4 -3
  27. package/dist/ai/blocks/text.js.map +1 -1
  28. package/dist/composed/activity-feed.d.ts.map +1 -1
  29. package/dist/composed/activity-feed.js +14 -12
  30. package/dist/composed/activity-feed.js.map +1 -1
  31. package/dist/composed/file-preview/audio-preview.d.ts.map +1 -1
  32. package/dist/composed/file-preview/shared.d.ts +10 -0
  33. package/dist/composed/file-preview/shared.d.ts.map +1 -1
  34. package/dist/composed/file-preview/video-preview.d.ts.map +1 -1
  35. package/dist/composed/file-preview.js +149 -188
  36. package/dist/composed/file-preview.js.map +1 -1
  37. package/dist/composed/master-detail.d.ts.map +1 -1
  38. package/dist/composed/master-detail.js +13 -4
  39. package/dist/composed/master-detail.js.map +1 -1
  40. package/dist/composed/schedule-view.d.ts.map +1 -1
  41. package/dist/composed/schedule-view.js +52 -39
  42. package/dist/composed/schedule-view.js.map +1 -1
  43. package/dist/shell/notification-preferences.d.ts.map +1 -1
  44. package/dist/shell/notification-preferences.js +115 -114
  45. package/dist/shell/notification-preferences.js.map +1 -1
  46. package/dist/ui/badge-group.d.ts.map +1 -1
  47. package/dist/ui/card.d.ts +66 -16
  48. package/dist/ui/card.d.ts.map +1 -1
  49. package/dist/ui/card.js +85 -60
  50. package/dist/ui/card.js.map +1 -1
  51. package/dist/ui/chat/message.d.ts.map +1 -1
  52. package/dist/ui/color-input.d.ts.map +1 -1
  53. package/dist/ui/color-input.js +18 -18
  54. package/dist/ui/color-input.js.map +1 -1
  55. package/dist/ui/data-table-body.d.ts.map +1 -1
  56. package/dist/ui/data-table-body.js +94 -64
  57. package/dist/ui/data-table-body.js.map +1 -1
  58. package/dist/ui/data-table-card.d.ts.map +1 -1
  59. package/dist/ui/data-table-card.js +50 -43
  60. package/dist/ui/data-table-card.js.map +1 -1
  61. package/dist/ui/data-table-context.d.ts +0 -4
  62. package/dist/ui/data-table-context.d.ts.map +1 -1
  63. package/dist/ui/data-table-context.js +8 -12
  64. package/dist/ui/data-table-context.js.map +1 -1
  65. package/dist/ui/data-table-header.d.ts.map +1 -1
  66. package/dist/ui/data-table-header.js +2 -2
  67. package/dist/ui/data-table-header.js.map +1 -1
  68. package/dist/ui/data-table.d.ts.map +1 -1
  69. package/dist/ui/data-table.js +185 -182
  70. package/dist/ui/data-table.js.map +1 -1
  71. package/dist/ui/index.d.ts +3 -2
  72. package/dist/ui/index.d.ts.map +1 -1
  73. package/dist/ui/index.js +59 -58
  74. package/dist/ui/index.js.map +1 -1
  75. package/dist/ui/segmented-control.js +4 -4
  76. package/dist/ui/segmented-control.js.map +1 -1
  77. package/dist/ui/separator.d.ts +6 -5
  78. package/dist/ui/separator.d.ts.map +1 -1
  79. package/dist/ui/separator.js +7 -10
  80. package/dist/ui/separator.js.map +1 -1
  81. package/dist/ui/split-button.d.ts.map +1 -1
  82. package/dist/ui/split-button.js +62 -129
  83. package/dist/ui/split-button.js.map +1 -1
  84. package/dist/ui/stat-card.d.ts +7 -0
  85. package/dist/ui/stat-card.d.ts.map +1 -1
  86. package/dist/ui/stat-card.js +144 -126
  87. package/dist/ui/stat-card.js.map +1 -1
  88. package/dist/ui/table-row-link.d.ts +45 -0
  89. package/dist/ui/table-row-link.d.ts.map +1 -0
  90. package/dist/ui/table-row-link.js +16 -0
  91. package/dist/ui/table-row-link.js.map +1 -0
  92. package/dist/ui/table.d.ts +49 -5
  93. package/dist/ui/table.d.ts.map +1 -1
  94. package/dist/ui/table.js +39 -29
  95. package/dist/ui/table.js.map +1 -1
  96. package/dist/ui/toast-types.d.ts +10 -0
  97. package/dist/ui/toast-types.d.ts.map +1 -1
  98. package/dist/ui/toast.d.ts +6 -2
  99. package/dist/ui/toast.d.ts.map +1 -1
  100. package/dist/ui/toast.js +56 -54
  101. package/dist/ui/toast.js.map +1 -1
  102. package/docs/components/composed/content-card.md +2 -0
  103. package/docs/components/ui/button.md +3 -3
  104. package/docs/components/ui/card.md +27 -10
  105. package/docs/components/ui/color-input.md +2 -2
  106. package/docs/components/ui/data-table.md +8 -1
  107. package/docs/components/ui/segmented-control.md +2 -2
  108. package/docs/components/ui/separator.md +3 -1
  109. package/docs/components/ui/split-button.md +3 -0
  110. package/docs/components/ui/stat-card.md +10 -2
  111. package/docs/components/ui/table-row-link.md +41 -0
  112. package/docs/components/ui/table.md +69 -0
  113. package/docs/components/ui/toast.md +10 -6
  114. package/docs/recipes/install-next-app-router.md +1 -1
  115. package/docs/recipes/troubleshoot.md +1 -1
  116. package/llms.txt +159 -781
  117. package/make-kit/components/card.md +54 -16
  118. package/make-kit/components/table.md +45 -7
  119. package/make-kit/foundations/spacing.md +3 -1
  120. package/make-kit/foundations/surfaces.md +1 -1
  121. package/mcp-manifest.json +12349 -0
  122. package/mcp-manifest.schema.json +232 -0
  123. package/package.json +8 -3
  124. package/skill/README.md +0 -1
  125. package/skill/SKILL.md +9 -8
  126. package/skill/references/components.md +159 -781
  127. package/skill/references/setup-next-app-router.md +1 -1
  128. package/skill/references/troubleshoot.md +1 -1
  129. package/llms-full.txt +0 -7198
  130. package/llms-quick.txt +0 -251
  131. package/skill/references/components-full.md +0 -7200
@@ -6,22 +6,22 @@ import { n as i } from "../_chunks/badge-group.js";
6
6
  import { Button as a } from "../ui/button.js";
7
7
  import { Skeleton as o } from "../ui/skeleton.js";
8
8
  import { TruncatedText as s } from "../ui/truncated-text.js";
9
- import { a as c, i as l, t as u } from "../_chunks/shared.js";
10
- import * as d from "react";
11
- import { jsx as f, jsxs as p } from "react/jsx-runtime";
12
- import { IconDownload as m, IconMaximize as h, IconPlayerPause as g, IconPlayerPlay as _ } from "@tabler/icons-react";
13
- import { AnimatePresence as v, motion as y } from "framer-motion";
9
+ import { a as c, n as l, o as u, t 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";
14
14
  //#region src/composed/file-preview/audio-preview.tsx
15
- function b({ url: e, fileName: t, onError: n }) {
16
- let i = d.useRef(null), o = d.useRef(null), [m, h] = d.useState(!1), [v, y] = d.useState(0), [b, x] = d.useState(0), [S, C] = d.useState(0), [w, T] = d.useState(1), [E, D] = d.useState(!1), [O, k] = d.useState(!1), [A, j] = d.useState(null);
17
- d.useEffect(() => {
15
+ function x({ url: e, fileName: t, onError: n }) {
16
+ let i = f.useRef(null), o = 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(() => {
18
18
  function e(e) {
19
19
  let t = o.current;
20
20
  if (!t || !t.contains(document.activeElement) && document.activeElement !== t) return;
21
21
  let n = i.current;
22
22
  if (n) switch (e.key) {
23
23
  case " ":
24
- e.preventDefault(), h((e) => (e ? n.pause() : n.play(), !e));
24
+ e.preventDefault(), g((e) => (e ? n.pause() : n.play(), !e));
25
25
  break;
26
26
  case "ArrowRight":
27
27
  e.preventDefault(), n.currentTime = Math.min(n.duration || 0, n.currentTime + 5);
@@ -30,122 +30,96 @@ function b({ url: e, fileName: t, onError: n }) {
30
30
  e.preventDefault(), n.currentTime = Math.max(0, n.currentTime - 5);
31
31
  break;
32
32
  case "m":
33
- e.preventDefault(), D((e) => (n.muted = !e, !e));
33
+ e.preventDefault(), O((e) => (n.muted = !e, !e));
34
34
  break;
35
35
  }
36
36
  }
37
37
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
38
38
  }, []);
39
- function M() {
40
- i.current && (m ? i.current.pause() : i.current.play(), h(!m));
41
- }
42
- function N(e) {
43
- if (!i.current || !b) return;
44
- let t = e.currentTarget.getBoundingClientRect(), n = Math.max(0, Math.min(1, (e.clientX - t.left) / t.width));
45
- i.current.currentTime = n * b;
39
+ function j() {
40
+ i.current && (h ? i.current.pause() : i.current.play(), g(!h));
46
41
  }
47
- function P(e) {
48
- if (!b) return;
49
- let t = e.currentTarget.getBoundingClientRect();
50
- j((e.clientX - t.left) / t.width * b);
42
+ function M(e) {
43
+ !i.current || !x || (i.current.currentTime = e / 100 * x);
51
44
  }
52
- function F() {
45
+ function N() {
53
46
  if (!i.current) return;
54
- let e = !E;
55
- D(e), i.current.muted = e;
47
+ let e = !D;
48
+ O(e), i.current.muted = e;
56
49
  }
57
- return O ? /* @__PURE__ */ f(u, {
50
+ return k ? /* @__PURE__ */ p(d, {
58
51
  message: "Could not load audio",
59
52
  url: e
60
- }) : /* @__PURE__ */ p("div", {
53
+ }) : /* @__PURE__ */ m("div", {
61
54
  ref: o,
62
55
  className: "rounded-surface bg-surface-raised shadow-raised overflow-hidden",
63
56
  tabIndex: -1,
64
57
  children: [
65
- /* @__PURE__ */ f("audio", {
58
+ /* @__PURE__ */ p("audio", {
66
59
  ref: i,
67
60
  src: e,
68
61
  onTimeUpdate: () => {
69
- i.current && (C(i.current.currentTime), i.current.duration && y(i.current.currentTime / i.current.duration * 100));
62
+ i.current && (w(i.current.currentTime), i.current.duration && b(i.current.currentTime / i.current.duration * 100));
70
63
  },
71
- onLoadedMetadata: () => x(i.current?.duration ?? 0),
72
- onEnded: () => h(!1),
64
+ onLoadedMetadata: () => S(i.current?.duration ?? 0),
65
+ onEnded: () => g(!1),
73
66
  onError: () => {
74
- k(!0), n?.("Audio failed to load");
67
+ A(!0), n?.("Audio failed to load");
75
68
  }
76
69
  }),
77
70
  /* @__PURE__ */ p("div", {
78
- className: "relative h-1 w-full cursor-pointer bg-surface-sunken group/bar",
79
- onClick: N,
80
- onMouseMove: P,
81
- onMouseLeave: () => j(null),
82
- role: "slider",
83
- "aria-label": "Audio progress",
84
- "aria-valuenow": Math.round(v),
85
- "aria-valuemin": 0,
86
- "aria-valuemax": 100,
87
- tabIndex: 0,
88
- children: [
89
- /* @__PURE__ */ f("div", {
90
- className: "absolute left-0 top-0 h-full bg-accent-9 transition-[width] duration-75",
91
- style: { width: `${v}%` }
92
- }),
93
- A !== null && /* @__PURE__ */ f("div", {
94
- className: "absolute -top-7 -translate-x-1/2 rounded-control-inner bg-surface-overlay px-1.5 py-0.5 text-[10px] font-mono text-surface-fg shadow-floating pointer-events-none",
95
- style: { left: `${A / (b || 1) * 100}%` },
96
- children: c(A)
97
- }),
98
- /* @__PURE__ */ f("div", {
99
- className: "absolute top-1/2 -translate-y-1/2 h-2.5 w-2.5 rounded-pill bg-accent-9 shadow-raised opacity-0 group-hover/bar:opacity-100 transition-opacity",
100
- style: {
101
- left: `${v}%`,
102
- marginLeft: "-5px"
103
- }
104
- })
105
- ]
71
+ className: "px-ds-03 pt-ds-02",
72
+ children: /* @__PURE__ */ p(l, {
73
+ value: y,
74
+ max: 100,
75
+ step: .1,
76
+ onValueChange: M,
77
+ tone: "light",
78
+ ariaLabel: "Audio progress"
79
+ })
106
80
  }),
107
- /* @__PURE__ */ p("div", {
81
+ /* @__PURE__ */ m("div", {
108
82
  className: "flex items-center gap-ds-04 px-ds-05 py-ds-04",
109
83
  children: [
110
- /* @__PURE__ */ f(a, {
84
+ /* @__PURE__ */ p(a, {
111
85
  variant: "solid",
112
86
  size: "icon-sm",
113
- onClick: M,
114
- "aria-label": m ? "Pause" : "Play",
115
- title: m ? "Pause" : "Play",
87
+ onClick: j,
88
+ "aria-label": h ? "Pause" : "Play",
89
+ title: h ? "Pause" : "Play",
116
90
  className: "shrink-0",
117
- children: m ? /* @__PURE__ */ f(r, {
118
- icon: g,
119
- size: "sm"
120
- }) : /* @__PURE__ */ f(r, {
91
+ children: h ? /* @__PURE__ */ p(r, {
121
92
  icon: _,
93
+ size: "sm"
94
+ }) : /* @__PURE__ */ p(r, {
95
+ icon: v,
122
96
  size: "sm",
123
97
  className: "ml-0.5"
124
98
  })
125
99
  }),
126
- /* @__PURE__ */ p("div", {
100
+ /* @__PURE__ */ m("div", {
127
101
  className: "flex-1 min-w-0",
128
- children: [t && /* @__PURE__ */ f(s, {
102
+ children: [t && /* @__PURE__ */ p(s, {
129
103
  as: "p",
130
104
  mode: "middle",
131
105
  className: "text-ds-sm font-semibold text-surface-fg",
132
106
  children: t
133
- }), /* @__PURE__ */ p("p", {
107
+ }), /* @__PURE__ */ m("p", {
134
108
  className: "text-ds-xs font-mono text-surface-fg-muted tabular-nums",
135
109
  children: [
136
- c(S),
110
+ u(C),
137
111
  " / ",
138
- c(b)
112
+ u(x)
139
113
  ]
140
114
  })]
141
115
  }),
142
- /* @__PURE__ */ f(l, {
143
- volume: w,
144
- muted: E,
116
+ /* @__PURE__ */ p(c, {
117
+ volume: T,
118
+ muted: D,
145
119
  onVolumeChange: (e) => {
146
- T(e), i.current && (i.current.volume = e), e > 0 && E && (D(!1), i.current && (i.current.muted = !1));
120
+ E(e), i.current && (i.current.volume = e), e > 0 && D && (O(!1), i.current && (i.current.muted = !1));
147
121
  },
148
- onMuteToggle: F,
122
+ onMuteToggle: N,
149
123
  variant: "light"
150
124
  })
151
125
  ]
@@ -155,20 +129,20 @@ function b({ url: e, fileName: t, onError: n }) {
155
129
  }
156
130
  //#endregion
157
131
  //#region src/composed/file-preview/embed-preview.tsx
158
- function x({ url: e, embedUrl: n, onError: r }) {
159
- let [i, a] = d.useState(!1), [s, c] = d.useState(!1);
160
- return d.useEffect(() => {
132
+ function S({ url: e, embedUrl: n, onError: r }) {
133
+ let [i, a] = f.useState(!1), [s, c] = f.useState(!1);
134
+ return f.useEffect(() => {
161
135
  let e = setTimeout(() => {
162
136
  i || (c(!0), r?.("Embed timed out"));
163
137
  }, 15e3);
164
138
  return () => clearTimeout(e);
165
- }, [i, r]), s ? /* @__PURE__ */ f(u, {
139
+ }, [i, r]), s ? /* @__PURE__ */ p(d, {
166
140
  message: "Could not load embed",
167
141
  url: e
168
- }) : /* @__PURE__ */ p("div", {
142
+ }) : /* @__PURE__ */ m("div", {
169
143
  className: "relative w-full rounded-control overflow-hidden",
170
144
  style: { aspectRatio: "16 / 9" },
171
- children: [!i && /* @__PURE__ */ f(o, { className: "absolute inset-0" }), /* @__PURE__ */ f(y.iframe, {
145
+ children: [!i && /* @__PURE__ */ p(o, { className: "absolute inset-0" }), /* @__PURE__ */ p(b.iframe, {
172
146
  src: n,
173
147
  title: "Embedded content",
174
148
  onLoad: () => a(!0),
@@ -185,7 +159,7 @@ function x({ url: e, embedUrl: n, onError: r }) {
185
159
  }
186
160
  //#endregion
187
161
  //#region src/composed/file-preview/video-preview.tsx
188
- var S = [
162
+ var C = [
189
163
  .5,
190
164
  .75,
191
165
  1,
@@ -193,9 +167,9 @@ var S = [
193
167
  1.5,
194
168
  2
195
169
  ];
196
- function C({ url: n, onError: i }) {
197
- let a = d.useRef(null), o = d.useRef(null), [s, m] = d.useState(!1), [b, x] = d.useState(0), [C, w] = d.useState(0), [T, E] = d.useState(0), [D, O] = d.useState(!1), [k, A] = d.useState(!1), [j, M] = d.useState(!0), [N, P] = d.useState(1), F = d.useRef(void 0);
198
- d.useEffect(() => () => clearTimeout(F.current), []), d.useEffect(() => {
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(void 0);
172
+ f.useEffect(() => () => clearTimeout(I.current), []), f.useEffect(() => {
199
173
  function e(e) {
200
174
  let t = o.current;
201
175
  if (!t || !t.contains(document.activeElement) && document.activeElement !== t) return;
@@ -203,7 +177,7 @@ function C({ url: n, onError: i }) {
203
177
  if (n) switch (e.key) {
204
178
  case " ":
205
179
  case "k":
206
- e.preventDefault(), m((e) => (e ? n.pause() : n.play(), !e));
180
+ e.preventDefault(), h((e) => (e ? n.pause() : n.play(), !e));
207
181
  break;
208
182
  case "ArrowRight":
209
183
  e.preventDefault(), n.currentTime = Math.min(n.duration, n.currentTime + 5);
@@ -218,65 +192,63 @@ function C({ url: n, onError: i }) {
218
192
  e.preventDefault(), n.currentTime = Math.min(n.duration, n.currentTime + 10);
219
193
  break;
220
194
  case "m":
221
- e.preventDefault(), O((e) => (n.muted = !e, !e));
195
+ e.preventDefault(), k((e) => (n.muted = !e, !e));
222
196
  break;
223
197
  case "f":
224
198
  e.preventDefault(), n.requestFullscreen?.();
225
199
  break;
226
200
  case ">":
227
- e.preventDefault(), I(1);
201
+ e.preventDefault(), L(1);
228
202
  break;
229
203
  case "<":
230
- e.preventDefault(), I(-1);
204
+ e.preventDefault(), L(-1);
231
205
  break;
232
206
  }
233
207
  }
234
208
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
235
209
  }, []);
236
- function I(e) {
237
- let t = S.indexOf(N), n = S[Math.max(0, Math.min(S.length - 1, t + e))];
238
- P(n), a.current && (a.current.playbackRate = n);
210
+ function L(e) {
211
+ let t = C.indexOf(P), n = C[Math.max(0, Math.min(C.length - 1, t + e))];
212
+ F(n), a.current && (a.current.playbackRate = n);
239
213
  }
240
- function L() {
241
- a.current && (s ? a.current.pause() : a.current.play(), m(!s));
214
+ function R() {
215
+ a.current && (s ? a.current.pause() : a.current.play(), h(!s));
242
216
  }
243
- function R(e) {
244
- if (!a.current || !C) return;
245
- let t = e.currentTarget.getBoundingClientRect(), n = (e.clientX - t.left) / t.width;
246
- a.current.currentTime = n * C;
217
+ function z(e) {
218
+ !a.current || !w || (a.current.currentTime = e / 100 * w);
247
219
  }
248
- function z() {
249
- M(!0), clearTimeout(F.current), s && (F.current = setTimeout(() => M(!1), 3e3));
220
+ function B() {
221
+ N(!0), clearTimeout(I.current), s && (I.current = setTimeout(() => N(!1), 3e3));
250
222
  }
251
- return k ? /* @__PURE__ */ f(u, {
223
+ return A ? /* @__PURE__ */ p(d, {
252
224
  message: "Could not load video",
253
225
  url: n
254
- }) : /* @__PURE__ */ p("div", {
226
+ }) : /* @__PURE__ */ m("div", {
255
227
  ref: o,
256
228
  className: "group relative rounded-control bg-black overflow-hidden",
257
- onMouseMove: z,
258
- onMouseLeave: () => s && M(!1),
229
+ onMouseMove: B,
230
+ onMouseLeave: () => s && N(!1),
259
231
  tabIndex: -1,
260
232
  children: [
261
- /* @__PURE__ */ f("video", {
233
+ /* @__PURE__ */ p("video", {
262
234
  ref: a,
263
235
  src: n,
264
236
  className: "max-h-[70vh] w-full",
265
- onClick: L,
266
- muted: D,
237
+ onClick: R,
238
+ muted: O,
267
239
  onTimeUpdate: () => {
268
- a.current && (E(a.current.currentTime), a.current.duration && x(a.current.currentTime / a.current.duration * 100));
240
+ a.current && (D(a.current.currentTime), a.current.duration && S(a.current.currentTime / a.current.duration * 100));
269
241
  },
270
- onLoadedMetadata: () => w(a.current?.duration ?? 0),
242
+ onLoadedMetadata: () => T(a.current?.duration ?? 0),
271
243
  onEnded: () => {
272
- m(!1), M(!0);
244
+ h(!1), N(!0);
273
245
  },
274
246
  onError: () => {
275
- A(!0), i?.("Video failed to load");
247
+ j(!0), i?.("Video failed to load");
276
248
  },
277
249
  playsInline: !0
278
250
  }),
279
- !s && /* @__PURE__ */ f(y.button, {
251
+ !s && /* @__PURE__ */ p(b.button, {
280
252
  initial: {
281
253
  opacity: 0,
282
254
  scale: .8
@@ -286,19 +258,19 @@ function C({ url: n, onError: i }) {
286
258
  scale: 1
287
259
  },
288
260
  transition: e.snappy,
289
- onClick: L,
261
+ onClick: R,
290
262
  className: "absolute inset-0 flex items-center justify-center bg-black/30",
291
263
  "aria-label": "Play video",
292
- children: /* @__PURE__ */ f("div", {
264
+ children: /* @__PURE__ */ p("div", {
293
265
  className: "flex h-14 w-14 items-center justify-center rounded-pill bg-white/90 shadow-floating",
294
- children: /* @__PURE__ */ f(r, {
295
- icon: _,
266
+ children: /* @__PURE__ */ p(r, {
267
+ icon: v,
296
268
  size: "xl",
297
269
  className: "text-surface-fg ml-0.5"
298
270
  })
299
271
  })
300
272
  }),
301
- /* @__PURE__ */ f(v, { children: j && C > 0 && /* @__PURE__ */ p(y.div, {
273
+ /* @__PURE__ */ p(y, { children: M && w > 0 && /* @__PURE__ */ m(b.div, {
302
274
  initial: {
303
275
  opacity: 0,
304
276
  y: 10
@@ -313,74 +285,63 @@ function C({ url: n, onError: i }) {
313
285
  },
314
286
  transition: t.fade,
315
287
  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",
316
- children: [/* @__PURE__ */ p("div", {
317
- className: "relative h-1 w-full cursor-pointer rounded-pill bg-white/30 mb-ds-03 group/progress",
318
- onClick: R,
319
- role: "slider",
320
- "aria-label": "Video progress",
321
- "aria-valuenow": Math.round(b),
322
- "aria-valuemin": 0,
323
- "aria-valuemax": 100,
324
- tabIndex: 0,
325
- children: [/* @__PURE__ */ f("div", {
326
- className: "absolute left-0 top-0 h-full rounded-pill bg-white transition-[width] duration-75",
327
- style: { width: `${b}%` }
328
- }), /* @__PURE__ */ f("div", {
329
- className: "absolute top-1/2 -translate-y-1/2 h-3 w-3 rounded-pill bg-white shadow-raised opacity-0 group-hover/progress:opacity-100 transition-opacity",
330
- style: {
331
- left: `${b}%`,
332
- marginLeft: "-6px"
333
- }
334
- })]
335
- }), /* @__PURE__ */ p("div", {
288
+ children: [/* @__PURE__ */ p(l, {
289
+ className: "mb-ds-03",
290
+ value: x,
291
+ max: 100,
292
+ step: .1,
293
+ onValueChange: z,
294
+ tone: "dark",
295
+ ariaLabel: "Video progress"
296
+ }), /* @__PURE__ */ m("div", {
336
297
  className: "flex items-center gap-ds-03",
337
298
  children: [
338
- /* @__PURE__ */ f("button", {
339
- onClick: L,
299
+ /* @__PURE__ */ p("button", {
300
+ onClick: R,
340
301
  className: "text-white hover:text-white/80",
341
302
  "aria-label": s ? "Pause" : "Play",
342
303
  title: s ? "Pause" : "Play",
343
- children: s ? /* @__PURE__ */ f(r, {
344
- icon: g,
345
- size: "lg"
346
- }) : /* @__PURE__ */ f(r, {
304
+ children: s ? /* @__PURE__ */ p(r, {
347
305
  icon: _,
348
306
  size: "lg"
307
+ }) : /* @__PURE__ */ p(r, {
308
+ icon: v,
309
+ size: "lg"
349
310
  })
350
311
  }),
351
- /* @__PURE__ */ f(l, {
352
- volume: +!D,
353
- muted: D,
312
+ /* @__PURE__ */ p(c, {
313
+ volume: +!O,
314
+ muted: O,
354
315
  onVolumeChange: (e) => {
355
- a.current && (a.current.volume = e), e > 0 && D && (O(!1), a.current && (a.current.muted = !1));
316
+ a.current && (a.current.volume = e), e > 0 && O && (k(!1), a.current && (a.current.muted = !1));
356
317
  },
357
318
  onMuteToggle: () => {
358
- O(!D), a.current && (a.current.muted = !D);
319
+ k(!O), a.current && (a.current.muted = !O);
359
320
  },
360
321
  variant: "dark"
361
322
  }),
362
- /* @__PURE__ */ p("span", {
323
+ /* @__PURE__ */ m("span", {
363
324
  className: "text-[11px] font-mono text-white/70 tabular-nums",
364
325
  children: [
365
- c(T),
326
+ u(E),
366
327
  " / ",
367
- c(C)
328
+ u(w)
368
329
  ]
369
330
  }),
370
- /* @__PURE__ */ f("div", { className: "flex-1" }),
371
- /* @__PURE__ */ p("button", {
372
- onClick: () => I(1),
331
+ /* @__PURE__ */ p("div", { className: "flex-1" }),
332
+ /* @__PURE__ */ m("button", {
333
+ onClick: () => L(1),
373
334
  className: "text-[11px] font-mono text-white/70 hover:text-white px-1 rounded-control-inner hover:bg-white/10 transition-colors",
374
- "aria-label": `Playback speed: ${N}x`,
375
- children: [N, "x"]
335
+ "aria-label": `Playback speed: ${P}x`,
336
+ children: [P, "x"]
376
337
  }),
377
- /* @__PURE__ */ f("button", {
338
+ /* @__PURE__ */ p("button", {
378
339
  onClick: () => a.current?.requestFullscreen?.(),
379
340
  className: "text-white hover:text-white/80",
380
341
  "aria-label": "Fullscreen (F)",
381
342
  title: "Fullscreen",
382
- children: /* @__PURE__ */ f(r, {
383
- icon: h,
343
+ children: /* @__PURE__ */ p(r, {
344
+ icon: g,
384
345
  size: "sm"
385
346
  })
386
347
  })
@@ -392,8 +353,8 @@ function C({ url: n, onError: i }) {
392
353
  }
393
354
  //#endregion
394
355
  //#region src/composed/file-preview.tsx
395
- var w = d.lazy(() => import("../_chunks/image-preview.js")), T = d.lazy(() => import("../_chunks/document-preview.js"));
396
- function E(e, t) {
356
+ var T = f.lazy(() => import("../_chunks/image-preview.js")), E = f.lazy(() => import("../_chunks/document-preview.js"));
357
+ function D(e, t) {
397
358
  if (t) {
398
359
  if (t.startsWith("image/")) return "image";
399
360
  if (t === "application/pdf") return "pdf";
@@ -423,7 +384,7 @@ function E(e, t) {
423
384
  "flac"
424
385
  ].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";
425
386
  }
426
- function D(e) {
387
+ function O(e) {
427
388
  let t = e.match(/(?:youtube\.com\/watch\?v=|youtu\.be\/)([^&?]+)/);
428
389
  if (t) return `https://www.youtube.com/embed/${t[1]}`;
429
390
  let n = e.match(/vimeo\.com\/(\d+)/);
@@ -432,62 +393,62 @@ function D(e) {
432
393
  let r = e.match(/loom\.com\/share\/([^?]+)/);
433
394
  return r ? `https://www.loom.com/embed/${r[1]}` : e;
434
395
  }
435
- function O({ url: e, type: t, mimeType: c, alt: l, initialPage: u = 1, fileName: h, fileSize: g, onError: _, className: v, ...y }) {
436
- let S = t ?? E(e, c), O = /* @__PURE__ */ f(o, { className: "h-64 w-full rounded-control" });
437
- return /* @__PURE__ */ p("div", {
396
+ function k({ url: e, type: t, mimeType: c, alt: l, initialPage: u = 1, fileName: d, fileSize: g, onError: _, className: v, ...y }) {
397
+ let b = t ?? D(e, c), C = /* @__PURE__ */ p(o, { className: "h-64 w-full rounded-control" });
398
+ return /* @__PURE__ */ m("div", {
438
399
  className: n("flex flex-col gap-ds-03", v),
439
400
  ...y,
440
401
  children: [
441
- (h || g) && /* @__PURE__ */ p("div", {
402
+ (d || g) && /* @__PURE__ */ m("div", {
442
403
  className: "flex items-center gap-ds-03",
443
- children: [h && /* @__PURE__ */ f(s, {
404
+ children: [d && /* @__PURE__ */ p(s, {
444
405
  mode: "middle",
445
406
  className: "min-w-0 text-ds-sm font-semibold text-surface-fg",
446
- children: h
447
- }), g && /* @__PURE__ */ f(i, {
407
+ children: d
408
+ }), g && /* @__PURE__ */ p(i, {
448
409
  variant: "subtle",
449
410
  size: "xs",
450
411
  children: g
451
412
  })]
452
413
  }),
453
- S === "image" && /* @__PURE__ */ f(d.Suspense, {
454
- fallback: O,
455
- children: /* @__PURE__ */ f(w, {
414
+ b === "image" && /* @__PURE__ */ p(f.Suspense, {
415
+ fallback: C,
416
+ children: /* @__PURE__ */ p(T, {
456
417
  url: e,
457
418
  alt: l,
458
419
  onError: _
459
420
  })
460
421
  }),
461
- S === "pdf" && /* @__PURE__ */ f(d.Suspense, {
462
- fallback: O,
463
- children: /* @__PURE__ */ f(T, {
422
+ b === "pdf" && /* @__PURE__ */ p(f.Suspense, {
423
+ fallback: C,
424
+ children: /* @__PURE__ */ p(E, {
464
425
  url: e,
465
426
  initialPage: u,
466
427
  onError: _
467
428
  })
468
429
  }),
469
- S === "video" && /* @__PURE__ */ f(C, {
430
+ b === "video" && /* @__PURE__ */ p(w, {
470
431
  url: e,
471
432
  onError: _
472
433
  }),
473
- S === "audio" && /* @__PURE__ */ f(b, {
434
+ b === "audio" && /* @__PURE__ */ p(x, {
474
435
  url: e,
475
- fileName: h,
436
+ fileName: d,
476
437
  onError: _
477
438
  }),
478
- S === "embed" && /* @__PURE__ */ f(x, {
439
+ b === "embed" && /* @__PURE__ */ p(S, {
479
440
  url: e,
480
- embedUrl: D(e),
441
+ embedUrl: O(e),
481
442
  onError: _
482
443
  }),
483
- S !== "audio" && /* @__PURE__ */ f("div", {
444
+ b !== "audio" && /* @__PURE__ */ p("div", {
484
445
  className: "flex justify-end",
485
- children: /* @__PURE__ */ f(a, {
446
+ children: /* @__PURE__ */ p(a, {
486
447
  variant: "ghost",
487
448
  size: "xs",
488
- startIcon: /* @__PURE__ */ f(r, { icon: m }),
449
+ startIcon: /* @__PURE__ */ p(r, { icon: h }),
489
450
  asChild: !0,
490
- children: /* @__PURE__ */ f("a", {
451
+ children: /* @__PURE__ */ p("a", {
491
452
  href: e,
492
453
  download: !0,
493
454
  target: "_blank",
@@ -500,4 +461,4 @@ function O({ url: e, type: t, mimeType: c, alt: l, initialPage: u = 1, fileName:
500
461
  });
501
462
  }
502
463
  //#endregion
503
- export { O as FilePreview };
464
+ export { k as FilePreview };