@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
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import { cn as e } from "../lib/utils.js";
3
3
  import { Icon as t } from "../lib/icon.js";
4
- import { Segmented as n } from "./segmented.js";
5
- import { selectableText as r } from "../lib/primitives.js";
6
- import { checkboxVariants as i } from "./checkbox.js";
7
- import { Popover as a, PopoverTrigger as o } from "./popover.js";
8
- import { DropdownMenu as s, DropdownMenuContent as c, DropdownMenuItem as l } from "./dropdown-menu.js";
4
+ import { selectableText as n } from "../lib/primitives.js";
5
+ import { Popover as r, PopoverTrigger as i } from "./popover.js";
6
+ import { DropdownMenu as a, DropdownMenuContent as o, DropdownMenuItem as s } from "./dropdown-menu.js";
7
+ import { Segmented as c } from "./segmented.js";
8
+ import { checkboxVariants as l } from "./checkbox.js";
9
9
  import { ListBox as u, listBoxItemVariants as d } from "./list-box.js";
10
10
  import { DATE_PRESETS as f, RELATIVE_UNITS as p, createFilter as m, describeFilter as h, describeValue as g, isDateValue as _, isFilterComplete as v, operatorLabel as y, operatorsFor as b, withOperator as x, withValue as S } from "../lib/filter.js";
11
11
  import { createContext as C, useCallback as w, useContext as T, useEffect as ee, useMemo as E, useRef as D, useState as O } from "react";
@@ -128,10 +128,10 @@ function ce(e) {
128
128
  kind: n
129
129
  };
130
130
  }
131
- function le({ label: n, placeholder: i, autoFocus: a, onBack: o }) {
131
+ function le({ label: r, placeholder: i, autoFocus: a, onBack: o }) {
132
132
  return /* @__PURE__ */ j(L, {
133
133
  "data-slot": "filter-search",
134
- "aria-label": n,
134
+ "aria-label": r,
135
135
  autoFocus: a,
136
136
  onKeyDown: (e) => {
137
137
  o && e.key === "Backspace" && e.target.value === "" && o();
@@ -144,7 +144,7 @@ function le({ label: n, placeholder: i, autoFocus: a, onBack: o }) {
144
144
  className: "shrink-0 text-foreground/70"
145
145
  }), /* @__PURE__ */ A(F, {
146
146
  placeholder: i,
147
- className: e("min-w-0 flex-1 appearance-none border-0 bg-transparent p-0 [font-family:inherit] text-subhead text-foreground outline-none placeholder:text-tertiary-foreground [&::-webkit-search-cancel-button]:appearance-none", r)
147
+ className: e("min-w-0 flex-1 appearance-none border-0 bg-transparent p-0 [font-family:inherit] text-subhead text-foreground outline-none placeholder:text-tertiary-foreground [&::-webkit-search-cancel-button]:appearance-none", n)
148
148
  })]
149
149
  });
150
150
  }
@@ -177,15 +177,15 @@ function Q({ id: e, icon: n, checked: r, trailing: i, children: a, onAction: o,
177
177
  ]
178
178
  });
179
179
  }
180
- function de({ field: n, value: r, onChange: a, onBack: o }) {
181
- let { contains: s } = H({ sensitivity: "base" }), c = n.options ?? [];
180
+ function de({ field: n, value: r, onChange: i, onBack: a }) {
181
+ let { contains: o } = H({ sensitivity: "base" }), s = n.options ?? [];
182
182
  return /* @__PURE__ */ j(M, {
183
- filter: (e, t) => s(e, t),
183
+ filter: (e, t) => o(e, t),
184
184
  children: [/* @__PURE__ */ A(le, {
185
185
  label: `Search ${n.label.toLowerCase()}`,
186
186
  placeholder: `Search ${n.label.toLowerCase()}…`,
187
187
  autoFocus: !0,
188
- onBack: o
188
+ onBack: a
189
189
  }), /* @__PURE__ */ A(u, {
190
190
  variant: "popup",
191
191
  "aria-label": n.label,
@@ -193,10 +193,10 @@ function de({ field: n, value: r, onChange: a, onBack: o }) {
193
193
  escapeKeyBehavior: "none",
194
194
  selectedKeys: new Set(r),
195
195
  onSelectionChange: (e) => {
196
- let t = new Set(e === "all" ? c.map((e) => e.value) : [...e].map(String));
197
- a([...c.map((e) => e.value).filter((e) => t.has(e)), ...[...t].filter((e) => !c.some((t) => t.value === e))]);
196
+ let t = new Set(e === "all" ? s.map((e) => e.value) : [...e].map(String));
197
+ i([...s.map((e) => e.value).filter((e) => t.has(e)), ...[...t].filter((e) => !s.some((t) => t.value === e))]);
198
198
  },
199
- items: c.map((e) => ({
199
+ items: s.map((e) => ({
200
200
  ...e,
201
201
  id: e.value
202
202
  })),
@@ -209,7 +209,7 @@ function de({ field: n, value: r, onChange: a, onBack: o }) {
209
209
  children: [
210
210
  /* @__PURE__ */ A("span", {
211
211
  "aria-hidden": "true",
212
- className: e(i({ shape: "square" }), "size-4.5"),
212
+ className: e(l({ shape: "square" }), "size-4.5"),
213
213
  children: /* @__PURE__ */ A(t, {
214
214
  name: "check",
215
215
  size: 12,
@@ -257,8 +257,8 @@ function fe({ value: e, onChange: t, onDone: n }) {
257
257
  })]
258
258
  });
259
259
  }
260
- function pe({ field: t, value: n, onChange: i, onDone: a, onBack: o }) {
261
- let s = t.kind === "number", c = typeof n == "number" || typeof n == "string" ? String(n) : "", [l, u] = O(c), d = D(c), f = (e) => {
260
+ function pe({ field: t, value: r, onChange: i, onDone: a, onBack: o }) {
261
+ let s = t.kind === "number", c = typeof r == "number" || typeof r == "string" ? String(r) : "", [l, u] = O(c), d = D(c), f = (e) => {
262
262
  let t = l.trim();
263
263
  t === "" || s && !Number.isFinite(Number(t)) || (t !== d.current && (d.current = t, i(s ? Number(t) : t)), e && a?.());
264
264
  };
@@ -277,7 +277,7 @@ function pe({ field: t, value: n, onChange: i, onDone: a, onBack: o }) {
277
277
  e.key === "Enter" ? (e.preventDefault(), f(!0)) : e.key === "Backspace" && l === "" && o && o();
278
278
  },
279
279
  onBlur: () => f(!1),
280
- className: e("box-border h-9 w-full rounded-lg border-0 bg-input px-3 [font-family:inherit] text-subhead text-foreground outline-none placeholder:text-tertiary-foreground data-focused:ring-2 data-focused:ring-ring/45", r)
280
+ className: e("box-border h-9 w-full rounded-lg border-0 bg-input px-3 [font-family:inherit] text-subhead text-foreground outline-none placeholder:text-tertiary-foreground data-focused:ring-2 data-focused:ring-ring/45", n)
281
281
  })
282
282
  }), /* @__PURE__ */ j("div", {
283
283
  className: "flex items-center justify-between gap-2 text-caption text-foreground/70",
@@ -291,16 +291,16 @@ function pe({ field: t, value: n, onChange: i, onDone: a, onBack: o }) {
291
291
  });
292
292
  }
293
293
  var me = /^\d{4}-\d{2}-\d{2}$/;
294
- function he({ operator: t, value: i, onChange: a, onDone: o }) {
295
- let s = _(i) ? i : void 0, c = s?.type === "relative" ? s : {
294
+ function he({ operator: t, value: r, onChange: i, onDone: a }) {
295
+ let o = _(r) ? r : void 0, s = o?.type === "relative" ? o : {
296
296
  type: "relative",
297
297
  amount: 7,
298
298
  unit: "day"
299
- }, [l, d] = O(String(c.amount)), [m, h] = O(s?.type === "date" ? s.date : ""), g = "rounded-lg border-0 bg-input px-3 [font-family:inherit] text-subhead text-foreground outline-none data-focused:ring-2 data-focused:ring-ring/45";
299
+ }, [l, d] = O(String(s.amount)), [m, h] = O(o?.type === "date" ? o.date : ""), g = "rounded-lg border-0 bg-input px-3 [font-family:inherit] text-subhead text-foreground outline-none data-focused:ring-2 data-focused:ring-ring/45";
300
300
  if (t === "in_the_last") {
301
301
  let t = (e, t) => {
302
302
  let n = Math.floor(Number(e));
303
- Number.isFinite(n) && n > 0 && a({
303
+ Number.isFinite(n) && n > 0 && i({
304
304
  type: "relative",
305
305
  amount: n,
306
306
  unit: t
@@ -312,7 +312,7 @@ function he({ operator: t, value: i, onChange: a, onDone: o }) {
312
312
  "aria-label": "How many",
313
313
  value: l,
314
314
  onChange: (e) => {
315
- d(e), t(e, c.unit);
315
+ d(e), t(e, s.unit);
316
316
  },
317
317
  type: "number",
318
318
  inputMode: "numeric",
@@ -320,13 +320,13 @@ function he({ operator: t, value: i, onChange: a, onDone: o }) {
320
320
  autoFocus: !0,
321
321
  min: 1,
322
322
  onKeyDown: (e) => {
323
- e.key === "Enter" && (e.preventDefault(), t(l, c.unit), o?.());
323
+ e.key === "Enter" && (e.preventDefault(), t(l, s.unit), a?.());
324
324
  },
325
- className: e("box-border h-9 w-full tabular-nums", g, r)
325
+ className: e("box-border h-9 w-full tabular-nums", g, n)
326
326
  })
327
- }), /* @__PURE__ */ A(n, {
327
+ }), /* @__PURE__ */ A(c, {
328
328
  "aria-label": "Unit",
329
- value: c.unit,
329
+ value: s.unit,
330
330
  onChange: (e) => t(l, e),
331
331
  options: p.map((e) => ({
332
332
  id: e,
@@ -336,10 +336,10 @@ function he({ operator: t, value: i, onChange: a, onDone: o }) {
336
336
  });
337
337
  }
338
338
  let v = (e) => {
339
- me.test(m) && (s?.type !== "date" || s.date !== m) && a({
339
+ me.test(m) && (o?.type !== "date" || o.date !== m) && i({
340
340
  type: "date",
341
341
  date: m
342
- }), e && me.test(m) && o?.();
342
+ }), e && me.test(m) && a?.();
343
343
  };
344
344
  return /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A(u, {
345
345
  variant: "popup",
@@ -349,12 +349,12 @@ function he({ operator: t, value: i, onChange: a, onDone: o }) {
349
349
  children: f.map((e) => /* @__PURE__ */ A(Q, {
350
350
  id: e.id,
351
351
  textValue: e.label,
352
- checked: s?.type === "preset" && s.preset === e.id,
352
+ checked: o?.type === "preset" && o.preset === e.id,
353
353
  onAction: () => {
354
- a({
354
+ i({
355
355
  type: "preset",
356
356
  preset: e.id
357
- }), o?.();
357
+ }), a?.();
358
358
  },
359
359
  children: e.label
360
360
  }, e.id))
@@ -370,7 +370,7 @@ function he({ operator: t, value: i, onChange: a, onDone: o }) {
370
370
  onKeyDown: (e) => {
371
371
  e.key === "Enter" && (e.preventDefault(), v(!0));
372
372
  },
373
- className: e("box-border h-9 w-full", g, r)
373
+ className: e("box-border h-9 w-full", g, n)
374
374
  })
375
375
  })
376
376
  })] });
@@ -407,31 +407,31 @@ function $({ field: e, operator: t, value: n, onChange: r, onDone: i, onBack: a
407
407
  function ge(e) {
408
408
  return e instanceof Element && !!e.closest("input, textarea, select, [contenteditable=\"\"], [contenteditable=\"true\"], [role=\"textbox\"], [role=\"searchbox\"], [role=\"combobox\"]");
409
409
  }
410
- function _e({ fields: n, state: r, hotkey: i = null, children: s, label: c = "Filter", isOpen: l, defaultOpen: f = !1, onOpenChange: p, placement: h = "bottom start", className: g, popoverClassName: _, allowDuplicates: v }) {
411
- let y = K(), b = n ?? y?.fields ?? [], x = y ?? r, C = v ?? y?.allowDuplicates ?? !1, [T, E] = O(f), D = l ?? T, [k, F] = O(null), [L, R] = O(null), { contains: z } = H({ sensitivity: "base" }), B = w((e) => {
410
+ function _e({ fields: n, state: a, hotkey: o = null, children: s, label: c = "Filter", isOpen: l, defaultOpen: f = !1, onOpenChange: p, placement: h = "bottom start", className: g, popoverClassName: _, allowDuplicates: v }) {
411
+ let y = K(), b = n ?? y?.fields ?? [], x = y ?? a, C = v ?? y?.allowDuplicates ?? !1, [T, E] = O(f), D = l ?? T, [k, F] = O(null), [L, R] = O(null), { contains: z } = H({ sensitivity: "base" }), B = w((e) => {
412
412
  e && (F(null), R(null)), E(e), p?.(e);
413
413
  }, [p]);
414
414
  if (ee(() => {
415
- if (!i) return;
416
- let e = i.toLowerCase(), t = (t) => {
415
+ if (!o) return;
416
+ let e = o.toLowerCase(), t = (t) => {
417
417
  t.defaultPrevented || t.metaKey || t.ctrlKey || t.altKey || t.key.toLowerCase() !== e || ge(t.target) || t.target instanceof Element && t.target.closest("[role=\"dialog\"], [role=\"alertdialog\"], [role=\"menu\"]") || (t.preventDefault(), B(!0));
418
418
  };
419
419
  return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
420
- }, [i, B]), !x) return null;
420
+ }, [o, B]), !x) return null;
421
421
  let V = L ? x.filters.find((e) => e.id === L) : void 0, U = new Set(x.filters.map((e) => e.field)), W = b.filter((e) => C || !U.has(e.id));
422
- return /* @__PURE__ */ j(o, {
422
+ return /* @__PURE__ */ j(i, {
423
423
  isOpen: D,
424
424
  onOpenChange: B,
425
425
  children: [s ?? /* @__PURE__ */ j(N, {
426
426
  "data-slot": "filter-menu-trigger",
427
- "aria-keyshortcuts": i ? i.toUpperCase() : void 0,
427
+ "aria-keyshortcuts": o ? o.toUpperCase() : void 0,
428
428
  className: e(X, g),
429
429
  children: [/* @__PURE__ */ A(t, {
430
430
  name: "filter-circle",
431
431
  size: 16,
432
432
  sw: 2
433
433
  }), c]
434
- }), /* @__PURE__ */ A(a, {
434
+ }), /* @__PURE__ */ A(r, {
435
435
  "data-slot": "filter-menu",
436
436
  placement: h,
437
437
  className: e("w-64 min-w-0 overflow-hidden", _),
@@ -515,18 +515,18 @@ function _e({ fields: n, state: r, hotkey: i = null, children: s, label: c = "Fi
515
515
  });
516
516
  }
517
517
  function ve({ filter: t, field: n, onChange: r }) {
518
- let i = Array.isArray(t.value) ? t.value.length : 2, a = y(t.operator, i), o = b(n.kind);
519
- return o.length < 2 ? /* @__PURE__ */ A("span", {
518
+ let i = Array.isArray(t.value) ? t.value.length : 2, c = y(t.operator, i), l = b(n.kind);
519
+ return l.length < 2 ? /* @__PURE__ */ A("span", {
520
520
  "data-slot": "filter-chip-operator",
521
521
  className: e(J, "text-foreground/70"),
522
- children: a
523
- }) : /* @__PURE__ */ j(s, { children: [/* @__PURE__ */ A(N, {
522
+ children: c
523
+ }) : /* @__PURE__ */ j(a, { children: [/* @__PURE__ */ A(N, {
524
524
  "data-slot": "filter-chip-operator",
525
525
  "data-part": "operator",
526
- "aria-label": `${n.label} operator: ${a}`,
526
+ "aria-label": `${n.label} operator: ${c}`,
527
527
  className: e(J, Y, "text-foreground/70"),
528
- children: a
529
- }), /* @__PURE__ */ A(c, {
528
+ children: c
529
+ }), /* @__PURE__ */ A(o, {
530
530
  placement: "bottom start",
531
531
  "aria-label": `${n.label} operator`,
532
532
  selectionMode: "single",
@@ -537,7 +537,7 @@ function ve({ filter: t, field: n, onChange: r }) {
537
537
  i && i !== t.operator && r(x(n, t, i));
538
538
  },
539
539
  popoverClassName: "min-w-44",
540
- children: o.map((e) => /* @__PURE__ */ A(l, {
540
+ children: l.map((e) => /* @__PURE__ */ A(s, {
541
541
  id: e,
542
542
  textValue: y(e, 2),
543
543
  className: "min-h-9 py-1.5 text-subhead",
@@ -545,9 +545,9 @@ function ve({ filter: t, field: n, onChange: r }) {
545
545
  }, e))
546
546
  })] });
547
547
  }
548
- function ye({ filter: t, field: n, locale: r, onChange: i }) {
549
- let [s, c] = O(!1), l = g(t, n, r);
550
- return /* @__PURE__ */ j(o, {
548
+ function ye({ filter: t, field: n, locale: a, onChange: o }) {
549
+ let [s, c] = O(!1), l = g(t, n, a);
550
+ return /* @__PURE__ */ j(i, {
551
551
  isOpen: s,
552
552
  onOpenChange: c,
553
553
  children: [/* @__PURE__ */ A(N, {
@@ -558,9 +558,9 @@ function ye({ filter: t, field: n, locale: r, onChange: i }) {
558
558
  children: /* @__PURE__ */ A(se, {
559
559
  filter: t,
560
560
  field: n,
561
- locale: r
561
+ locale: a
562
562
  })
563
- }), /* @__PURE__ */ A(a, {
563
+ }), /* @__PURE__ */ A(r, {
564
564
  placement: "bottom start",
565
565
  className: "w-64 min-w-0 overflow-hidden",
566
566
  children: /* @__PURE__ */ A(P, {
@@ -570,7 +570,7 @@ function ye({ filter: t, field: n, locale: r, onChange: i }) {
570
570
  field: n,
571
571
  operator: t.operator,
572
572
  value: t.value,
573
- onChange: (e) => i(S(n, t, e)),
573
+ onChange: (e) => o(S(n, t, e)),
574
574
  onDone: () => c(!1)
575
575
  })
576
576
  })
@@ -666,8 +666,8 @@ function Se({ className: t, children: n = "Clear all", ...r }) {
666
666
  }) : null;
667
667
  }
668
668
  function Ce({ className: n }) {
669
- let { filters: r, match: i, setMatch: a, announce: o } = q();
670
- return r.length < 2 ? null : /* @__PURE__ */ j(s, { children: [/* @__PURE__ */ j(N, {
669
+ let { filters: r, match: i, setMatch: c, announce: l } = q();
670
+ return r.length < 2 ? null : /* @__PURE__ */ j(a, { children: [/* @__PURE__ */ j(N, {
671
671
  "data-slot": "filter-match",
672
672
  "aria-label": `Match mode: ${i === "all" ? "all filters" : "any filter"}`,
673
673
  className: e(X, n),
@@ -681,7 +681,7 @@ function Ce({ className: n }) {
681
681
  className: "opacity-60"
682
682
  })
683
683
  ]
684
- }), /* @__PURE__ */ j(c, {
684
+ }), /* @__PURE__ */ j(o, {
685
685
  placement: "bottom start",
686
686
  "aria-label": "Match mode",
687
687
  selectionMode: "single",
@@ -689,15 +689,15 @@ function Ce({ className: n }) {
689
689
  selectedKeys: [i],
690
690
  onSelectionChange: (e) => {
691
691
  let t = [...e][0];
692
- t && t !== i && (a(t), o(t === "all" ? "Matching all filters" : "Matching any filter"));
692
+ t && t !== i && (c(t), l(t === "all" ? "Matching all filters" : "Matching any filter"));
693
693
  },
694
694
  popoverClassName: "min-w-48",
695
- children: [/* @__PURE__ */ A(l, {
695
+ children: [/* @__PURE__ */ A(s, {
696
696
  id: "all",
697
697
  textValue: "Match all filters",
698
698
  className: "min-h-9 py-1.5 text-subhead",
699
699
  children: "Match all filters"
700
- }), /* @__PURE__ */ A(l, {
700
+ }), /* @__PURE__ */ A(s, {
701
701
  id: "any",
702
702
  textValue: "Match any filter",
703
703
  className: "min-h-9 py-1.5 text-subhead",
@@ -0,0 +1,67 @@
1
+ import { ButtonProps as AriaButtonProps } from 'react-aria-components';
2
+ import { VariantProps } from 'class-variance-authority';
3
+ import { PopoverProps } from './popover';
4
+ import { FontCategory, GoogleFont } from '../lib/google-fonts';
5
+ export declare const fontListItemVariants: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
6
+ export interface FontListProps {
7
+ /** The family in use; null for the system font. */
8
+ value: string | null;
9
+ onChange: (family: string | null) => void;
10
+ /** The family being previewed as the list is hovered or arrowed through (null: the system font), and `undefined`
11
+ * when nothing is (the pointer left the list, or it closed). */
12
+ onPreview?: (family: string | null | undefined) => void;
13
+ /** The families offered (default: the most popular Google Fonts families). */
14
+ fonts?: readonly GoogleFont[];
15
+ /** Offer the system font (null) first. Default true. */
16
+ allowSystem?: boolean;
17
+ /** What the system font is called. Default “System”. */
18
+ systemLabel?: string;
19
+ /** The category the filter starts on. Default `all`. */
20
+ defaultCategory?: FontCategory | 'all';
21
+ autoFocus?: boolean;
22
+ className?: string;
23
+ }
24
+ /** The list alone: search, category filter, and the families. */
25
+ export declare function FontList({ value, onChange, onPreview, fonts, allowSystem, systemLabel, ...rest }: FontListProps): import("react/jsx-runtime").JSX.Element;
26
+ export declare const fontPickerTriggerVariants: (props?: ({
27
+ size?: "default" | "sm" | null | undefined;
28
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
29
+ export interface FontPickerProps extends Omit<FontListProps, 'autoFocus' | 'className'>, VariantProps<typeof fontPickerTriggerVariants> {
30
+ 'aria-label'?: string;
31
+ isDisabled?: boolean;
32
+ /** Where the list opens. Default below, start-aligned. */
33
+ placement?: PopoverProps['placement'];
34
+ className?: string;
35
+ /** More props for the trigger button. */
36
+ triggerProps?: Omit<AriaButtonProps, 'children' | 'className' | 'isDisabled'>;
37
+ }
38
+ /** A trigger showing the family in its own face, opening the FontList in a popover. */
39
+ export declare function FontPicker({ value, onChange, onPreview, size, isDisabled, placement, className, triggerProps, 'aria-label': ariaLabel, systemLabel, ...list }: FontPickerProps): import("react/jsx-runtime").JSX.Element;
40
+ export declare const fontStackPickerVariants: (props?: ({
41
+ size?: "default" | "sm" | null | undefined;
42
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
43
+ export interface FontStackPickerProps extends VariantProps<typeof fontStackPickerVariants> {
44
+ /** The families, the one to use first: fontStack(value) is the CSS font-family. */
45
+ value: readonly string[];
46
+ onChange: (families: string[]) => void;
47
+ /** As the list is hovered or arrowed through: the stack with that family in front (how it would look added), and
48
+ * `undefined` when the preview ends. */
49
+ onPreview?: (families: string[] | undefined) => void;
50
+ /** At most this many families. Default 3. */
51
+ maxCount?: number;
52
+ /** The families offered (default: the most popular Google Fonts families). */
53
+ fonts?: readonly GoogleFont[];
54
+ /** The category the list's filter starts on (a monospace stack: `monospace`). Default `all`. */
55
+ defaultCategory?: FontCategory | 'all';
56
+ /** What the field says while the stack is empty. Default “Add a font”. */
57
+ placeholder?: string;
58
+ 'aria-label'?: string;
59
+ isDisabled?: boolean;
60
+ /** Where the list opens. Default below, start-aligned. */
61
+ placement?: PopoverProps['placement'];
62
+ className?: string;
63
+ }
64
+ /** A font stack as chips (drag one, or press its handle and use the arrow keys, to reorder; × removes it), and a
65
+ button that opens the list to add or remove families. */
66
+ export declare function FontStackPicker({ value, onChange, onPreview, maxCount, fonts, defaultCategory, placeholder, 'aria-label': ariaLabel, isDisabled, placement, size, className, }: FontStackPickerProps): import("react/jsx-runtime").JSX.Element;
67
+ //# sourceMappingURL=font-picker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"font-picker.d.ts","sourceRoot":"","sources":["../../src/components/font-picker.tsx"],"names":[],"mappings":"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"}