@brett_lamy/ui 5.1.0 → 5.2.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 (155) hide show
  1. package/dist/components/adaptive-pane.d.ts +12 -1
  2. package/dist/components/adaptive-pane.d.ts.map +1 -1
  3. package/dist/components/adaptive-pane.js +122 -19
  4. package/dist/components/avatar.d.ts +47 -5
  5. package/dist/components/avatar.d.ts.map +1 -1
  6. package/dist/components/avatar.js +101 -14
  7. package/dist/components/breadcrumb.d.ts +87 -0
  8. package/dist/components/breadcrumb.d.ts.map +1 -0
  9. package/dist/components/breadcrumb.js +312 -0
  10. package/dist/components/color-picker.js +15 -15
  11. package/dist/components/command-menu.js +13 -13
  12. package/dist/components/credenza.d.ts +5 -2
  13. package/dist/components/credenza.d.ts.map +1 -1
  14. package/dist/components/credenza.js +62 -60
  15. package/dist/components/date-picker.js +9 -9
  16. package/dist/components/edge-drawer.d.ts +7 -2
  17. package/dist/components/edge-drawer.d.ts.map +1 -1
  18. package/dist/components/edge-drawer.js +7 -4
  19. package/dist/components/filmstrip.d.ts +19 -0
  20. package/dist/components/filmstrip.d.ts.map +1 -0
  21. package/dist/components/filmstrip.js +59 -0
  22. package/dist/components/filter-input.js +4 -4
  23. package/dist/components/filter.js +62 -62
  24. package/dist/components/font-picker.d.ts +67 -0
  25. package/dist/components/font-picker.d.ts.map +1 -0
  26. package/dist/components/font-picker.js +373 -0
  27. package/dist/components/markdown-editor.d.ts +11 -0
  28. package/dist/components/markdown-editor.d.ts.map +1 -1
  29. package/dist/components/markdown-editor.js +72 -65
  30. package/dist/components/navigation-stack.d.ts.map +1 -1
  31. package/dist/components/navigation-stack.js +75 -65
  32. package/dist/components/number-morph.d.ts.map +1 -1
  33. package/dist/components/number-morph.js +5 -5
  34. package/dist/components/replay-preview.d.ts +2 -2
  35. package/dist/components/replay-preview.d.ts.map +1 -1
  36. package/dist/components/replay-preview.js +3 -3
  37. package/dist/components/result-table.js +10 -10
  38. package/dist/components/schema-tree.d.ts.map +1 -1
  39. package/dist/components/schema-tree.js +62 -131
  40. package/dist/components/segmented.d.ts +1 -1
  41. package/dist/components/segmented.d.ts.map +1 -1
  42. package/dist/components/segmented.js +1 -1
  43. package/dist/components/sidebar.d.ts.map +1 -1
  44. package/dist/components/sidebar.js +8 -4
  45. package/dist/components/split-view.d.ts +3 -1
  46. package/dist/components/split-view.d.ts.map +1 -1
  47. package/dist/components/split-view.js +211 -211
  48. package/dist/components/spreadsheet.d.ts +58 -0
  49. package/dist/components/spreadsheet.d.ts.map +1 -0
  50. package/dist/components/spreadsheet.js +804 -0
  51. package/dist/components/sql-console.d.ts.map +1 -1
  52. package/dist/components/sql-console.js +2 -1
  53. package/dist/components/sql-editor.js +8 -8
  54. package/dist/components/stl-viewer.d.ts +3 -0
  55. package/dist/components/stl-viewer.d.ts.map +1 -0
  56. package/dist/components/stl-viewer.js +2 -0
  57. package/dist/components/strudel-player.d.ts +3 -0
  58. package/dist/components/strudel-player.d.ts.map +1 -0
  59. package/dist/components/strudel-player.js +2 -0
  60. package/dist/components/strudel-rack.d.ts +3 -0
  61. package/dist/components/strudel-rack.d.ts.map +1 -0
  62. package/dist/components/strudel-rack.js +2 -0
  63. package/dist/components/strudel-syntax.d.ts +3 -0
  64. package/dist/components/strudel-syntax.d.ts.map +1 -0
  65. package/dist/components/strudel-syntax.js +2 -0
  66. package/dist/components/tabs.js +3 -3
  67. package/dist/components/tailscale-menu.d.ts +69 -0
  68. package/dist/components/tailscale-menu.d.ts.map +1 -0
  69. package/dist/components/tailscale-menu.js +202 -0
  70. package/dist/components/toggle-group.js +3 -3
  71. package/dist/components/tree.d.ts +82 -0
  72. package/dist/components/tree.d.ts.map +1 -0
  73. package/dist/components/tree.js +494 -0
  74. package/dist/components/video-preview.d.ts +46 -0
  75. package/dist/components/video-preview.d.ts.map +1 -0
  76. package/dist/components/video-preview.js +197 -0
  77. package/dist/components/video-timeline.d.ts +64 -0
  78. package/dist/components/video-timeline.d.ts.map +1 -0
  79. package/dist/components/video-timeline.js +479 -0
  80. package/dist/components/waveform.d.ts +23 -0
  81. package/dist/components/waveform.d.ts.map +1 -0
  82. package/dist/components/waveform.js +56 -0
  83. package/dist/ffmpeg-worker.js +118 -0
  84. package/dist/index.css +1 -1
  85. package/dist/index.d.ts +48 -4
  86. package/dist/index.d.ts.map +1 -1
  87. package/dist/index.js +145 -121
  88. package/dist/lib/csv.d.ts +28 -0
  89. package/dist/lib/csv.d.ts.map +1 -0
  90. package/dist/lib/csv.js +90 -0
  91. package/dist/lib/drawer-swipe.d.ts +31 -0
  92. package/dist/lib/drawer-swipe.d.ts.map +1 -0
  93. package/dist/lib/drawer-swipe.js +68 -0
  94. package/dist/lib/ffmpeg/index.d.ts +117 -0
  95. package/dist/lib/ffmpeg/index.d.ts.map +1 -0
  96. package/dist/lib/ffmpeg/index.js +204 -0
  97. package/dist/lib/ffmpeg/media.d.ts +39 -0
  98. package/dist/lib/ffmpeg/media.d.ts.map +1 -0
  99. package/dist/lib/ffmpeg/media.js +100 -0
  100. package/dist/lib/ffmpeg/react.d.ts +51 -0
  101. package/dist/lib/ffmpeg/react.d.ts.map +1 -0
  102. package/dist/lib/ffmpeg/react.js +113 -0
  103. package/dist/lib/google-fonts.d.ts +47 -0
  104. package/dist/lib/google-fonts.d.ts.map +1 -0
  105. package/dist/lib/google-fonts.generated.d.ts +2 -0
  106. package/dist/lib/google-fonts.generated.d.ts.map +1 -0
  107. package/dist/lib/google-fonts.generated.js +1925 -0
  108. package/dist/lib/google-fonts.js +112 -0
  109. package/dist/lib/icon.d.ts +6 -1
  110. package/dist/lib/icon.d.ts.map +1 -1
  111. package/dist/lib/icon.js +2 -0
  112. package/dist/lib/playback.d.ts +34 -0
  113. package/dist/lib/playback.d.ts.map +1 -0
  114. package/dist/lib/playback.js +79 -0
  115. package/dist/lib/spreadsheet-gpu.d.ts +9 -0
  116. package/dist/lib/spreadsheet-gpu.d.ts.map +1 -0
  117. package/dist/lib/spreadsheet-gpu.js +237 -0
  118. package/dist/lib/spreadsheet.d.ts +82 -0
  119. package/dist/lib/spreadsheet.d.ts.map +1 -0
  120. package/dist/lib/spreadsheet.js +162 -0
  121. package/dist/lib/syntax.d.ts +2 -6
  122. package/dist/lib/syntax.d.ts.map +1 -1
  123. package/dist/lib/syntax.js +53 -75
  124. package/dist/lib/tailscale-connect.d.ts +33 -0
  125. package/dist/lib/tailscale-connect.d.ts.map +1 -1
  126. package/dist/lib/tailscale-connect.js +221 -42
  127. package/dist/lib/tailscale-exit.d.ts +19 -0
  128. package/dist/lib/tailscale-exit.d.ts.map +1 -0
  129. package/dist/lib/tailscale-exit.js +14 -0
  130. package/dist/lib/tailscale-fake.d.ts +8 -0
  131. package/dist/lib/tailscale-fake.d.ts.map +1 -1
  132. package/dist/lib/tailscale-fake.js +51 -26
  133. package/dist/lib/tailscale-roots.d.ts +3 -0
  134. package/dist/lib/tailscale-roots.d.ts.map +1 -0
  135. package/dist/lib/tailscale-roots.js +4 -0
  136. package/dist/lib/tailscale.d.ts +23 -0
  137. package/dist/lib/tailscale.d.ts.map +1 -1
  138. package/dist/lib/tailscale.js +156 -94
  139. package/dist/lib/title-flight.d.ts +4 -0
  140. package/dist/lib/title-flight.d.ts.map +1 -1
  141. package/dist/lib/title-flight.js +15 -12
  142. package/dist/lib/tokens.generated.d.ts +2 -2
  143. package/dist/lib/tokens.generated.d.ts.map +1 -1
  144. package/dist/lib/tokens.generated.js +2 -2
  145. package/dist/lib/video-render.d.ts +38 -0
  146. package/dist/lib/video-render.d.ts.map +1 -0
  147. package/dist/lib/video-render.js +147 -0
  148. package/dist/lib/video-timeline.d.ts +154 -0
  149. package/dist/lib/video-timeline.d.ts.map +1 -0
  150. package/dist/lib/video-timeline.js +265 -0
  151. package/dist/lib/webgpu.d.ts +26 -0
  152. package/dist/lib/webgpu.d.ts.map +1 -0
  153. package/dist/lib/webgpu.js +28 -0
  154. package/dist/theme.css +3 -0
  155. package/package.json +8 -3
@@ -0,0 +1,312 @@
1
+ "use client";
2
+ import { cn as e } from "../lib/utils.js";
3
+ import { Icon as t } from "../lib/icon.js";
4
+ import { DropdownMenu as n, DropdownMenuContent as r, DropdownMenuItem as i, DropdownMenuSub as a } from "./dropdown-menu.js";
5
+ import { Children as o, createContext as s, isValidElement as c, useCallback as l, useContext as u, useLayoutEffect as d, useMemo as f, useRef as p, useState as m } from "react";
6
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
7
+ import { Breadcrumb as v, Breadcrumbs as y, Button as b, Link as x } from "react-aria-components";
8
+ import { cva as S } from "class-variance-authority";
9
+ //#region src/components/breadcrumb.tsx
10
+ function C(e, t, n = 0, r = 0, { keepHead: i = 1, keepTail: a = 1 } = {}) {
11
+ let o = e.length, s = {
12
+ head: o,
13
+ tail: 0
14
+ }, c = Math.max(0, Math.min(i, o)), l = Math.max(0, a);
15
+ if (t <= 0 || o - c <= l) return s;
16
+ let u = (t, n) => {
17
+ let r = 0;
18
+ for (let i = t; i < n; i++) r += e[i];
19
+ return r;
20
+ };
21
+ if (u(0, o) + (o - 1) * n <= t) return s;
22
+ let d = (e) => u(0, c) + r + u(o - e, o) + (c + e) * n;
23
+ for (let e = o - c - 1; e > l; e--) if (d(e) <= t) return {
24
+ head: c,
25
+ tail: e
26
+ };
27
+ return {
28
+ head: c,
29
+ tail: l
30
+ };
31
+ }
32
+ var w = S("relative block w-full min-w-0 overflow-clip whitespace-nowrap text-foreground [overflow-clip-margin:4px]", {
33
+ variants: { size: {
34
+ sm: "text-caption",
35
+ default: "text-footnote",
36
+ lg: "text-subhead"
37
+ } },
38
+ defaultVariants: { size: "default" }
39
+ }), T = S([
40
+ "bl-btn box-border inline-flex max-w-full min-w-0 items-center rounded-md border-0 bg-transparent text-foreground/70 no-underline [font-family:inherit] whitespace-nowrap outline-none transition-colors motion-reduce:transition-none",
41
+ "data-current:text-foreground",
42
+ "data-focus-visible:ring-2 data-focus-visible:ring-ring"
43
+ ], {
44
+ variants: {
45
+ size: {
46
+ sm: "h-5 gap-1 px-1",
47
+ default: "h-6 gap-1.5 px-1.5",
48
+ lg: "h-7 gap-1.5 px-2"
49
+ },
50
+ interactive: {
51
+ true: "cursor-pointer data-hovered:bg-secondary data-hovered:text-foreground data-pressed:bg-secondary-strong aria-expanded:bg-secondary aria-expanded:text-foreground data-disabled:cursor-default",
52
+ false: "cursor-default"
53
+ }
54
+ },
55
+ defaultVariants: {
56
+ size: "default",
57
+ interactive: !0
58
+ }
59
+ }), E = {
60
+ sm: 13,
61
+ default: 14,
62
+ lg: 16
63
+ }, D = {
64
+ sm: 12,
65
+ default: 13,
66
+ lg: 15
67
+ }, O = s({ size: "default" }), k = s(!1), A = (e, n) => typeof e == "string" ? /* @__PURE__ */ g(t, {
68
+ name: e,
69
+ size: n
70
+ }) : e;
71
+ function j({ className: n, children: r, ...i }) {
72
+ let { size: a } = u(O);
73
+ return /* @__PURE__ */ g("span", {
74
+ "data-slot": "breadcrumb-separator",
75
+ "aria-hidden": !0,
76
+ className: e("grid shrink-0 place-items-center px-0.5 text-tertiary-foreground", n),
77
+ ...i,
78
+ children: r ?? /* @__PURE__ */ g(t, {
79
+ name: "chevron-right",
80
+ size: D[a],
81
+ sw: 2.2
82
+ })
83
+ });
84
+ }
85
+ function M() {
86
+ let { separator: e } = u(O);
87
+ return e === null ? null : /* @__PURE__ */ g(j, { children: e });
88
+ }
89
+ var N = "min-h-9 py-1.5 text-subhead leading-5";
90
+ function P({ entry: e }) {
91
+ let t = {
92
+ id: e.id,
93
+ textValue: e.textValue ?? (typeof e.label == "string" ? e.label : void 0),
94
+ icon: e.icon ? A(e.icon, 18) : void 0,
95
+ className: N
96
+ };
97
+ return e.items?.length ? /* @__PURE__ */ _(a, { children: [/* @__PURE__ */ g(i, {
98
+ ...t,
99
+ children: e.label
100
+ }), /* @__PURE__ */ g(F, {
101
+ entries: e.items,
102
+ selectedId: e.selectedId
103
+ })] }) : /* @__PURE__ */ g(i, {
104
+ ...t,
105
+ href: e.href,
106
+ onAction: e.onPress,
107
+ children: e.label
108
+ });
109
+ }
110
+ function F({ entries: e, selectedId: t }) {
111
+ let n = t != null;
112
+ return /* @__PURE__ */ g(r, {
113
+ placement: "bottom start",
114
+ offset: 4,
115
+ popoverClassName: "min-w-44",
116
+ selectionMode: n ? "single" : "none",
117
+ selectedKeys: n ? [t] : void 0,
118
+ disallowEmptySelection: n,
119
+ children: e.map((e) => /* @__PURE__ */ g(P, { entry: e }, e.id))
120
+ });
121
+ }
122
+ function I({ icon: e, children: t }) {
123
+ let { size: n } = u(O);
124
+ return /* @__PURE__ */ _(h, { children: [e ? /* @__PURE__ */ g("span", {
125
+ className: "grid shrink-0 place-items-center",
126
+ children: A(e, E[n])
127
+ }) : null, t != null && t !== !1 ? /* @__PURE__ */ g("span", {
128
+ className: "min-w-0 truncate",
129
+ children: t
130
+ }) : null] });
131
+ }
132
+ var L = (t, n) => e("flex min-w-0 items-center", t ? "shrink" : "shrink-0", n);
133
+ function R({ isCurrent: e, icon: t, href: r, onPress: i, items: a, selectedId: o, children: s }) {
134
+ let { size: c } = u(O), l = /* @__PURE__ */ g(I, {
135
+ icon: t,
136
+ children: s
137
+ }), d = !!(r || i), f;
138
+ return f = a?.length ? /* @__PURE__ */ _(n, { children: [/* @__PURE__ */ g(b, {
139
+ "data-slot": "breadcrumb-link",
140
+ "data-current": e || void 0,
141
+ "aria-current": e ? "page" : void 0,
142
+ className: T({ size: c }),
143
+ children: l
144
+ }), /* @__PURE__ */ g(F, {
145
+ entries: a,
146
+ selectedId: o
147
+ })] }) : d || e ? /* @__PURE__ */ g(x, {
148
+ "data-slot": "breadcrumb-link",
149
+ href: r,
150
+ onPress: i,
151
+ ...d ? { isDisabled: !1 } : null,
152
+ className: T({
153
+ size: c,
154
+ interactive: d
155
+ }),
156
+ children: l
157
+ }) : /* @__PURE__ */ g("span", {
158
+ "data-slot": "breadcrumb-link",
159
+ className: T({
160
+ size: c,
161
+ interactive: !1
162
+ }),
163
+ children: l
164
+ }), /* @__PURE__ */ _(h, { children: [f, e ? null : /* @__PURE__ */ g(M, {})] });
165
+ }
166
+ function z({ icon: e, className: t, children: n }) {
167
+ let { size: r } = u(O);
168
+ return /* @__PURE__ */ _("li", {
169
+ className: L(!1, t),
170
+ children: [/* @__PURE__ */ g("span", {
171
+ className: T({
172
+ size: r,
173
+ interactive: !1
174
+ }),
175
+ children: /* @__PURE__ */ g(I, {
176
+ icon: e,
177
+ children: n
178
+ })
179
+ }), /* @__PURE__ */ g(M, {})]
180
+ });
181
+ }
182
+ function B({ id: e, label: t, children: n, className: r, ...i }) {
183
+ let a = u(k), o = n ?? t;
184
+ return a ? /* @__PURE__ */ g(z, {
185
+ icon: i.icon,
186
+ className: r,
187
+ children: o
188
+ }) : /* @__PURE__ */ g(v, {
189
+ id: e,
190
+ "data-slot": "breadcrumb-item",
191
+ className: ({ isCurrent: e }) => L(e, r),
192
+ children: ({ isCurrent: e }) => /* @__PURE__ */ g(R, {
193
+ ...i,
194
+ isCurrent: e,
195
+ children: o
196
+ })
197
+ });
198
+ }
199
+ function V({ items: e, label: r = "More", className: i }) {
200
+ let a = u(k), { size: o } = u(O), s = /* @__PURE__ */ g("span", {
201
+ className: "grid shrink-0 place-items-center",
202
+ children: /* @__PURE__ */ g(t, {
203
+ name: "ellipsis",
204
+ size: E[o] + 2
205
+ })
206
+ });
207
+ return a ? /* @__PURE__ */ _("li", {
208
+ "data-ellipsis": "",
209
+ className: L(!1, i),
210
+ children: [/* @__PURE__ */ g("span", {
211
+ className: T({
212
+ size: o,
213
+ interactive: !1
214
+ }),
215
+ children: s
216
+ }), /* @__PURE__ */ g(M, {})]
217
+ }) : /* @__PURE__ */ g(v, {
218
+ "data-slot": "breadcrumb-ellipsis",
219
+ className: ({ isCurrent: e }) => L(e, i),
220
+ children: ({ isCurrent: t }) => /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _(n, { children: [/* @__PURE__ */ g(b, {
221
+ "data-slot": "breadcrumb-link",
222
+ "aria-label": r,
223
+ className: T({ size: o }),
224
+ children: s
225
+ }), /* @__PURE__ */ g(F, { entries: e })] }), t ? null : /* @__PURE__ */ g(M, {})] })
226
+ });
227
+ }
228
+ var H = (e, t) => !!e && e.available === t.available && e.separator === t.separator && e.ellipsis === t.ellipsis && e.widths.length === t.widths.length && e.widths.every((e, n) => e === t.widths[n]);
229
+ function U(e) {
230
+ let t = getComputedStyle(e);
231
+ return e.clientWidth - (parseFloat(t.paddingLeft) || 0) - (parseFloat(t.paddingRight) || 0);
232
+ }
233
+ var W = (e) => {
234
+ let { id: t, label: n, children: r, icon: i, href: a, onPress: o, items: s, selectedId: c } = e.props;
235
+ return {
236
+ id: t ?? e.key ?? "",
237
+ label: r ?? n,
238
+ icon: i,
239
+ href: a,
240
+ onPress: o,
241
+ items: s,
242
+ selectedId: c
243
+ };
244
+ };
245
+ function G({ items: t, children: n, size: r, separator: i, collapse: a = !0, ellipsisLabel: s, keepHead: u, keepTail: h, className: v, "aria-label": b = "Breadcrumb", ...x }) {
246
+ let S = r ?? "default", T = f(() => t ? t.map((e) => /* @__PURE__ */ g(B, { ...e }, e.id)) : o.toArray(n).filter(c), [t, n]), E = p(null), D = p(null), [A, j] = m(null), M = l(() => {
247
+ let e = E.current, t = D.current;
248
+ if (!e || !t) return;
249
+ let n = Array.from(t.children), r = t.querySelector("[data-slot=breadcrumb-separator]")?.offsetWidth ?? 0, i = n.map((e) => Math.max(0, e.offsetWidth - r)), a = {
250
+ widths: i.slice(0, -1),
251
+ separator: r,
252
+ ellipsis: i[i.length - 1] ?? 0,
253
+ available: U(e)
254
+ };
255
+ j((e) => H(e, a) ? e : a);
256
+ }, []);
257
+ d(() => {
258
+ a && M();
259
+ }), d(() => {
260
+ if (!a) return;
261
+ let e = !0, t = () => {
262
+ e && M();
263
+ }, n = typeof ResizeObserver > "u" ? null : new ResizeObserver(t);
264
+ return n && (E.current && n.observe(E.current), D.current && n.observe(D.current)), document.fonts?.ready.then(t), () => {
265
+ e = !1, n?.disconnect();
266
+ };
267
+ }, [a, M]);
268
+ let N = a && A && A.widths.length === T.length ? C(A.widths, A.available, A.separator, A.ellipsis, {
269
+ keepHead: u,
270
+ keepTail: h
271
+ }) : null, P = N ? T.length - N.head - N.tail : 0, F = N && P > 0 ? [
272
+ ...T.slice(0, N.head),
273
+ /* @__PURE__ */ g(V, {
274
+ label: s,
275
+ items: T.slice(N.head, T.length - N.tail).map(W)
276
+ }, "breadcrumb-ellipsis"),
277
+ ...T.slice(T.length - N.tail)
278
+ ] : T, I = f(() => ({
279
+ size: S,
280
+ separator: i
281
+ }), [S, i]);
282
+ return /* @__PURE__ */ g(O.Provider, {
283
+ value: I,
284
+ children: /* @__PURE__ */ _("nav", {
285
+ ref: E,
286
+ "data-slot": "breadcrumb",
287
+ "aria-label": b,
288
+ className: e(w({ size: r }), v),
289
+ ...x,
290
+ children: [/* @__PURE__ */ g(y, {
291
+ "data-slot": "breadcrumb-list",
292
+ className: "m-0 flex min-w-0 list-none items-center p-0",
293
+ children: F
294
+ }), a ? /* @__PURE__ */ g("div", {
295
+ "data-slot": "breadcrumb-measure",
296
+ "aria-hidden": !0,
297
+ inert: !0,
298
+ className: "pointer-events-none invisible absolute top-0 left-0 size-0 overflow-hidden",
299
+ children: /* @__PURE__ */ g(k.Provider, {
300
+ value: !0,
301
+ children: /* @__PURE__ */ _("ol", {
302
+ ref: D,
303
+ className: "m-0 flex w-max list-none p-0",
304
+ children: [T, /* @__PURE__ */ g(V, { items: [] })]
305
+ })
306
+ })
307
+ }) : null]
308
+ })
309
+ });
310
+ }
311
+ //#endregion
312
+ export { G as Breadcrumb, V as BreadcrumbEllipsis, B as BreadcrumbItem, j as BreadcrumbSeparator, T as breadcrumbItemVariants, w as breadcrumbVariants, C as fitBreadcrumbs };
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { cn as e } from "../lib/utils.js";
3
- import { Button as t } from "./button.js";
4
- import { Label as n } from "./label.js";
5
- import { Popover as r } from "./popover.js";
3
+ import { Popover as t } from "./popover.js";
4
+ import { Button as n } from "./button.js";
5
+ import { Label as r } from "./label.js";
6
6
  import { ColorField as i, ColorFieldGroup as a, ColorFieldInput as o, ColorFieldSwatch as s, ColorSwatch as c } from "./color-field.js";
7
7
  import { useContext as l } from "react";
8
8
  import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
@@ -27,17 +27,17 @@ function E({ className: t, colorSpace: n = "hsb", xChannel: r = "saturation", yC
27
27
  children: /* @__PURE__ */ d(T, {})
28
28
  });
29
29
  }
30
- function D({ className: t, label: r, showValue: i, ...a }) {
30
+ function D({ className: t, label: n, showValue: i, ...a }) {
31
31
  let o = a.channel === "alpha";
32
32
  return /* @__PURE__ */ f(g, {
33
33
  "data-slot": "color-slider",
34
34
  className: C(t, (t) => e("group flex w-full flex-col gap-1.5 data-disabled:opacity-50", t)),
35
35
  ...a,
36
- children: [r || i ? /* @__PURE__ */ f("div", {
36
+ children: [n || i ? /* @__PURE__ */ f("div", {
37
37
  className: "flex items-center justify-between text-footnote",
38
- children: [r ? /* @__PURE__ */ d(n, {
38
+ children: [n ? /* @__PURE__ */ d(r, {
39
39
  variant: "field",
40
- children: r
40
+ children: n
41
41
  }) : /* @__PURE__ */ d("span", {}), i ? /* @__PURE__ */ d(x, { className: "px-1 text-foreground/70 tabular-nums" }) : null]
42
42
  }) : null, /* @__PURE__ */ d(S, {
43
43
  className: "h-6 w-full rounded-full",
@@ -69,12 +69,12 @@ var A = {
69
69
  default: "h-11 rounded-ctl text-body",
70
70
  lg: "h-[50px] rounded-xl text-body"
71
71
  };
72
- function j({ className: n, size: r = "default", showValue: i = !0, ...a }) {
72
+ function j({ className: t, size: r = "default", showValue: i = !0, ...a }) {
73
73
  let o = l(h);
74
- return /* @__PURE__ */ f(t, {
74
+ return /* @__PURE__ */ f(n, {
75
75
  "data-slot": "color-picker-trigger",
76
76
  variant: "secondary",
77
- className: C(n, (t) => e("w-full justify-start bg-input px-3 font-normal text-foreground data-hovered:bg-secondary aria-expanded:ring-[1.5px] aria-expanded:ring-primary aria-expanded:ring-inset", A[r], t)),
77
+ className: C(t, (t) => e("w-full justify-start bg-input px-3 font-normal text-foreground data-hovered:bg-secondary aria-expanded:ring-[1.5px] aria-expanded:ring-primary aria-expanded:ring-inset", A[r], t)),
78
78
  ...a,
79
79
  children: [/* @__PURE__ */ d(c, {}), i && o?.color ? /* @__PURE__ */ d("span", {
80
80
  className: "tabular-nums",
@@ -82,8 +82,8 @@ function j({ className: n, size: r = "default", showValue: i = !0, ...a }) {
82
82
  }) : null]
83
83
  });
84
84
  }
85
- function M({ swatches: t, alpha: n, children: c, className: l, placement: p = "bottom start", ...m }) {
86
- return /* @__PURE__ */ d(r, {
85
+ function M({ swatches: n, alpha: r, children: c, className: l, placement: p = "bottom start", ...m }) {
86
+ return /* @__PURE__ */ d(t, {
87
87
  "data-slot": "color-picker-content",
88
88
  placement: p,
89
89
  className: C(l, (t) => e("w-64 min-w-0", t)),
@@ -98,7 +98,7 @@ function M({ swatches: t, alpha: n, children: c, className: l, placement: p = "b
98
98
  channel: "hue",
99
99
  "aria-label": "Hue"
100
100
  }),
101
- n ? /* @__PURE__ */ d(D, {
101
+ r ? /* @__PURE__ */ d(D, {
102
102
  channel: "alpha",
103
103
  "aria-label": "Opacity"
104
104
  }) : null,
@@ -109,9 +109,9 @@ function M({ swatches: t, alpha: n, children: c, className: l, placement: p = "b
109
109
  children: [/* @__PURE__ */ d(s, { className: "size-5" }), /* @__PURE__ */ d(o, {})]
110
110
  })
111
111
  }),
112
- t?.length ? /* @__PURE__ */ d(O, {
112
+ n?.length ? /* @__PURE__ */ d(O, {
113
113
  "aria-label": "Preset colors",
114
- children: t.map((e) => /* @__PURE__ */ d(k, { color: e }, e))
114
+ children: n.map((e) => /* @__PURE__ */ d(k, { color: e }, e))
115
115
  }) : null
116
116
  ] })
117
117
  })
@@ -5,8 +5,8 @@ import { Icon as r } from "../lib/icon.js";
5
5
  import { IconSwap as i } from "./icon-swap.js";
6
6
  import { AnimatedHeight as a, ContentSwap as o } from "./animated-height.js";
7
7
  import { useThemeScopeProps as s } from "../lib/theme.js";
8
- import { Kbd as c } from "./kbd.js";
9
- import { overlayZ as l, selectableText as u } from "../lib/primitives.js";
8
+ import { overlayZ as c, selectableText as l } from "../lib/primitives.js";
9
+ import { Kbd as u } from "./kbd.js";
10
10
  import { AnimatePresence as d, motion as f, useReducedMotion as p } from "framer-motion";
11
11
  import { Children as m, createContext as h, isValidElement as g, useCallback as _, useContext as v, useEffect as y, useId as b, useImperativeHandle as x, useLayoutEffect as S, useMemo as C, useRef as w, useState as T, useSyncExternalStore as E } from "react";
12
12
  import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
@@ -273,7 +273,7 @@ function Y(e, t, n = !0) {
273
273
  return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
274
274
  }, [e, n]);
275
275
  }
276
- function ee({ variant: t = "inline", isOpen: n, defaultOpen: r = !1, onOpenChange: i, hotkey: a, query: o, onQueryChange: c, defaultPages: u, onPageChange: d, loop: f = !0, closeOnSelect: p, escapeBehavior: m = "close", filter: h = !0, ranking: g = "group", menuRef: v, "aria-label": y = "Command menu", className: b, style: x, overlayClassName: S, container: C, children: w }) {
276
+ function ee({ variant: t = "inline", isOpen: n, defaultOpen: r = !1, onOpenChange: i, hotkey: a, query: o, onQueryChange: l, defaultPages: u, onPageChange: d, loop: f = !0, closeOnSelect: p, escapeBehavior: m = "close", filter: h = !0, ranking: g = "group", menuRef: v, "aria-label": y = "Command menu", className: b, style: x, overlayClassName: S, container: C, children: w }) {
277
277
  let [E, D] = T(r), k = n ?? E, P = _((e) => {
278
278
  n === void 0 && D(e), i?.(e);
279
279
  }, [n, i]);
@@ -283,7 +283,7 @@ function ee({ variant: t = "inline", isOpen: n, defaultOpen: r = !1, onOpenChang
283
283
  open: k,
284
284
  setOpen: P,
285
285
  queryProp: o,
286
- onQueryChange: c,
286
+ onQueryChange: l,
287
287
  defaultPages: u,
288
288
  onPageChange: d,
289
289
  loop: f,
@@ -306,7 +306,7 @@ function ee({ variant: t = "inline", isOpen: n, defaultOpen: r = !1, onOpenChang
306
306
  onOpenChange: P,
307
307
  isDismissable: !0,
308
308
  isKeyboardDismissDisabled: !0,
309
- className: e("absolute inset-0 flex items-start justify-center bg-overlay px-4 pt-[min(14vh,120px)] data-entering:animate-bl-fade-in data-exiting:animate-bl-fade-out", l, F.className, S),
309
+ className: e("absolute inset-0 flex items-start justify-center bg-overlay px-4 pt-[min(14vh,120px)] data-entering:animate-bl-fade-in data-exiting:animate-bl-fade-out", c, F.className, S),
310
310
  children: /* @__PURE__ */ O(M, {
311
311
  "data-slot": "command-modal",
312
312
  className: "w-full max-w-[600px] outline-none data-entering:animate-bl-pop-in data-exiting:animate-bl-pop-out motion-reduce:data-entering:animate-bl-fade-in motion-reduce:data-exiting:animate-bl-fade-out",
@@ -507,7 +507,7 @@ function te({ variant: t, setOpen: n, queryProp: r, onQueryChange: i, defaultPag
507
507
  })
508
508
  });
509
509
  }
510
- function X({ placeholder: a = "Search…", backButton: o = !0, pageTitle: s = !0, trailing: c, className: l, style: m, autoFocus: h = !0, ...g }) {
510
+ function X({ placeholder: a = "Search…", backButton: o = !0, pageTitle: s = !0, trailing: c, className: u, style: m, autoFocus: h = !0, ...g }) {
511
511
  let { store: _, inputRef: v, listId: b, menuId: x, query: S, setQuery: C, depth: w, pop: T } = U("CommandInput"), E = z(_, (e) => e.pages.get(e.page)), D = z(_, (e) => e.active ? e.items.get(e.active)?.domId : void 0), A = p(), j = E?.placeholder ?? (w > 0 ? "Search…" : a), M = o && w > 0;
512
512
  return y(() => {
513
513
  h && v.current?.focus({ preventScroll: !0 });
@@ -590,7 +590,7 @@ function X({ placeholder: a = "Search…", backButton: o = !0, pageTitle: s = !0
590
590
  outline: "none",
591
591
  ...m
592
592
  },
593
- className: e("h-full min-w-0 flex-1 border-0 bg-transparent p-0 font-[inherit] text-callout text-foreground outline-none placeholder:text-tertiary-foreground", u, l),
593
+ className: e("h-full min-w-0 flex-1 border-0 bg-transparent p-0 font-[inherit] text-callout text-foreground outline-none placeholder:text-tertiary-foreground", l, u),
594
594
  ...g
595
595
  }),
596
596
  c
@@ -827,7 +827,7 @@ function ae({ className: t }) {
827
827
  });
828
828
  }
829
829
  function oe({ legend: i = !0, className: a, children: o }) {
830
- let { depth: s } = U("CommandFooter"), l = p(), u = Array.isArray(i) ? i.map((e, t) => ({
830
+ let { depth: s } = U("CommandFooter"), c = p(), l = Array.isArray(i) ? i.map((e, t) => ({
831
831
  ...e,
832
832
  id: `${t}-${e.label}`
833
833
  })) : i ? [
@@ -868,9 +868,9 @@ function oe({ legend: i = !0, className: a, children: o }) {
868
868
  className: e("flex h-11 shrink-0 items-center gap-4 border-t border-border bg-secondary/40 px-3 text-footnote text-muted-foreground", a),
869
869
  children: [/* @__PURE__ */ O(d, {
870
870
  initial: !1,
871
- children: u.map((e) => /* @__PURE__ */ k(f.span, {
872
- layout: !l && "position",
873
- initial: l ? { opacity: 0 } : {
871
+ children: l.map((e) => /* @__PURE__ */ k(f.span, {
872
+ layout: !c && "position",
873
+ initial: c ? { opacity: 0 } : {
874
874
  opacity: 0,
875
875
  scale: .9,
876
876
  filter: "blur(3px)"
@@ -885,13 +885,13 @@ function oe({ legend: i = !0, className: a, children: o }) {
885
885
  scale: .9,
886
886
  transition: t.out
887
887
  },
888
- transition: l ? { duration: .12 } : {
888
+ transition: c ? { duration: .12 } : {
889
889
  layout: n.smooth,
890
890
  scale: n.snappy,
891
891
  default: t.in
892
892
  },
893
893
  className: "inline-flex items-center gap-1.5 whitespace-nowrap",
894
- children: [e.keys.map((e, t) => /* @__PURE__ */ O(c, {
894
+ children: [e.keys.map((e, t) => /* @__PURE__ */ O(u, {
895
895
  className: "h-6 min-w-6 rounded-md px-1.5 text-[12.5px] text-foreground",
896
896
  children: e
897
897
  }, t)), /* @__PURE__ */ O("span", { children: e.label })]
@@ -6,16 +6,19 @@ export declare const credenzaVariants: (props?: ({
6
6
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
7
  export interface CredenzaProps extends VariantProps<typeof credenzaVariants> {
8
8
  open: boolean;
9
- onClose: () => void;
9
+ /** The user dismissed it: Escape, a press on the scrim, the close button or a drag down. */
10
+ onClose?: () => void;
10
11
  onBack?: () => void;
11
12
  canBack?: boolean;
12
13
  /** Key of the current morphing view — changing it cross-fades and re-measures the body. */
13
14
  view?: string;
14
15
  title?: ReactNode;
15
16
  compact?: boolean | null;
17
+ /** `false`: nothing the user does closes it (no close button, Escape, scrim or drag) — only `open`. Default `true`. */
18
+ isDismissable?: boolean;
16
19
  children?: ReactNode;
17
20
  className?: string;
18
21
  style?: CSSProperties;
19
22
  }
20
- export declare function Credenza({ open, onClose, onBack, canBack, view, title, compact, children, className, style }: CredenzaProps): import("react/jsx-runtime").JSX.Element;
23
+ export declare function Credenza({ open, onClose, onBack, canBack, view, title, compact, isDismissable, children, className, style }: CredenzaProps): import("react/jsx-runtime").JSX.Element;
21
24
  //# sourceMappingURL=credenza.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"credenza.d.ts","sourceRoot":"","sources":["../../src/components/credenza.tsx"],"names":[],"mappings":"AACA,OAAO,EAA4B,KAAK,aAAa,EAA4C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAI/H,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,mFAAmF;AACnF,eAAO,MAAM,gBAAgB;;8EAW5B,CAAC;AAoBF,MAAM,WAAW,aAAc,SAAQ,YAAY,CAAC,OAAO,gBAAgB,CAAC;IAC1E,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2FAA2F;IAC3F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACzB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,aAAa,2CAiI3H"}
1
+ {"version":3,"file":"credenza.d.ts","sourceRoot":"","sources":["../../src/components/credenza.tsx"],"names":[],"mappings":"AACA,OAAO,EAA4B,KAAK,aAAa,EAA4C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAI/H,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,mFAAmF;AACnF,eAAO,MAAM,gBAAgB;;8EAW5B,CAAC;AAuBF,MAAM,WAAW,aAAc,SAAQ,YAAY,CAAC,OAAO,gBAAgB,CAAC;IAC1E,IAAI,EAAE,OAAO,CAAC;IACd,4FAA4F;IAC5F,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2FAA2F;IAC3F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACzB,uHAAuH;IACvH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,aAAoB,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,aAAa,2CAyIjJ"}