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