@devalok/shilp-sutra 0.44.1 → 0.45.1

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