@bysages/solid 0.1.1 → 0.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.
package/dist/index.mjs CHANGED
@@ -12,7 +12,7 @@ import { Avatar as Avatar$1 } from "@ark-ui/solid/avatar";
12
12
  import { DatePicker as DatePicker$1 } from "@ark-ui/solid/date-picker";
13
13
  import { Carousel as Carousel$1 } from "@ark-ui/solid/carousel";
14
14
  import { useEnvironmentContext } from "@ark-ui/solid/environment";
15
- import { useLocaleContext } from "@ark-ui/solid/locale";
15
+ import { useFilter, useLocaleContext } from "@ark-ui/solid/locale";
16
16
  import * as cascade from "@zag-js/cascade-select";
17
17
  import { normalizeProps, useMachine } from "@zag-js/solid";
18
18
  import { Checkbox as Checkbox$1 } from "@ark-ui/solid/checkbox";
@@ -50,7 +50,7 @@ import { RadioGroup as RadioGroup$1 } from "@ark-ui/solid/radio-group";
50
50
  import { RatingGroup as RatingGroup$1 } from "@ark-ui/solid/rating-group";
51
51
  import { ScrollArea as ScrollArea$1 } from "@ark-ui/solid/scroll-area";
52
52
  import { SegmentGroup as SegmentGroup$1 } from "@ark-ui/solid/segment-group";
53
- import { Select as Select$1 } from "@ark-ui/solid/select";
53
+ import { Select as Select$1, createListCollection } from "@ark-ui/solid/select";
54
54
  import { SignaturePad as SignaturePad$1 } from "@ark-ui/solid/signature-pad";
55
55
  import { Slider as Slider$1 } from "@ark-ui/solid/slider";
56
56
  import { Splitter as Splitter$1 } from "@ark-ui/solid/splitter";
@@ -203,8 +203,8 @@ injectComponentStyle("field");
203
203
  var _tmpl$$55 = /*#__PURE__*/ template(`<svg viewBox="0 0 16 16"width=14 height=14 aria-hidden=true fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=square><path d="M8 13V3M3.5 7.5 8 3l4.5 4.5">`);
204
204
  var _tmpl$2$28 = /*#__PURE__*/ template(`<svg viewBox="0 0 16 16"width=14 height=14 aria-hidden=true><rect x=4.5 y=4.5 width=7 height=7 fill=currentColor>`);
205
205
  var _tmpl$3$18 = /*#__PURE__*/ template(`<div data-scope=ai>`);
206
- var _tmpl$4$13 = /*#__PURE__*/ template(`<div data-scope=ai data-part=prompt-footer><div data-scope=ai data-part=prompt-end>`);
207
- var _tmpl$5$10 = /*#__PURE__*/ template(`<form><div data-scope=ai data-part=prompt-main>`);
206
+ var _tmpl$4$14 = /*#__PURE__*/ template(`<div data-scope=ai data-part=prompt-footer><div data-scope=ai data-part=prompt-end>`);
207
+ var _tmpl$5$11 = /*#__PURE__*/ template(`<form><div data-scope=ai data-part=prompt-main>`);
208
208
  function arrowUpGlyph() {
209
209
  return _tmpl$$55();
210
210
  }
@@ -278,7 +278,7 @@ function PromptInput(props) {
278
278
  });
279
279
  const trailing = () => own.footer != null ? own.trailing : own.trailing ?? seal();
280
280
  return (() => {
281
- var _el$4 = _tmpl$5$10(), _el$5 = _el$4.firstChild;
281
+ var _el$4 = _tmpl$5$11(), _el$5 = _el$4.firstChild;
282
282
  spread(_el$4, mergeProps(rest, {
283
283
  "data-scope": "ai",
284
284
  "data-part": "prompt",
@@ -317,7 +317,7 @@ function PromptInput(props) {
317
317
  return own.footer != null;
318
318
  },
319
319
  get children() {
320
- var _el$6 = _tmpl$4$13(), _el$7 = _el$6.firstChild;
320
+ var _el$6 = _tmpl$4$14(), _el$7 = _el$6.firstChild;
321
321
  insert(_el$6, () => own.footer, _el$7);
322
322
  insert(_el$7, () => own.footerEnd, null);
323
323
  insert(_el$7, seal, null);
@@ -371,19 +371,91 @@ function Reasoning(props) {
371
371
  }
372
372
  injectComponentStyle("ai");
373
373
  //#endregion
374
+ //#region src/components/ai-response/code-copy.ts
375
+ /** The two glyphs a copy affordance needs: the stamp and its
376
+ * confirmation. Inline SVG keeps the enhancement framework-agnostic —
377
+ * it lives beside the renderer's generated code HTML. */
378
+ const COPY_CODE_ICON = `<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>`;
379
+ const COPIED_CODE_ICON = `<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg>`;
380
+ /** How long the confirmation stays before the stamp returns. */
381
+ const REVERT_MS = 1500;
382
+ /** Make sure every fenced block under `host` carries its copy stamp.
383
+ * The stamp anchors to a wrapper outside the scrolling `pre` — inside,
384
+ * it would fix to the overflow area and travel out of view with the
385
+ * code. The renderer rebuilds the markdown as one HTML string on every
386
+ * stream tick, so this stays idempotent and cheap enough to re-run
387
+ * after each patch. */
388
+ function decorateCodeCopy(host, copyLabel) {
389
+ for (const pre of host.querySelectorAll("pre")) {
390
+ let body = pre.parentElement;
391
+ if (!body || body.getAttribute("data-part") !== "code-body") {
392
+ body = document.createElement("div");
393
+ body.setAttribute("data-scope", "ai");
394
+ body.setAttribute("data-part", "code-body");
395
+ pre.replaceWith(body);
396
+ body.appendChild(pre);
397
+ }
398
+ let button = body.querySelector("[data-part=\"code-copy\"]");
399
+ if (!button) {
400
+ button = document.createElement("button");
401
+ button.type = "button";
402
+ button.setAttribute("data-scope", "ai");
403
+ button.setAttribute("data-part", "code-copy");
404
+ button.innerHTML = COPY_CODE_ICON;
405
+ body.appendChild(button);
406
+ }
407
+ button.title = copyLabel;
408
+ button.setAttribute("aria-label", copyLabel);
409
+ }
410
+ }
411
+ /** The one delegated click for the whole response: copy the block's
412
+ * text and confirm in place, then return the stamp after a beat. */
413
+ async function clickCodeCopy(event, copyLabel, copiedLabel) {
414
+ const button = event.target?.closest("[data-part=\"code-copy\"]");
415
+ const pre = button?.closest("[data-part=\"code-body\"]")?.querySelector("pre");
416
+ if (!button || !pre) return;
417
+ await navigator.clipboard.writeText(pre.textContent ?? "");
418
+ button.innerHTML = COPIED_CODE_ICON;
419
+ button.setAttribute("data-state", "copied");
420
+ button.title = copiedLabel;
421
+ button.setAttribute("aria-label", copiedLabel);
422
+ setTimeout(() => {
423
+ if (!button.isConnected) return;
424
+ button.innerHTML = COPY_CODE_ICON;
425
+ button.removeAttribute("data-state");
426
+ button.title = copyLabel;
427
+ button.setAttribute("aria-label", copyLabel);
428
+ }, REVERT_MS);
429
+ }
430
+ //#endregion
374
431
  //#region src/components/ai-response/index.tsx
375
432
  var _tmpl$$52 = /*#__PURE__*/ template(`<div>`);
376
433
  /** Markdown set on the paper. Rendering goes through
377
434
  * `@tanstack/markdown`, whose defaults leave raw HTML and executable
378
435
  * links inert — streaming-safe by construction. */
379
436
  function Response(props) {
380
- const [own, rest] = splitProps(props, ["content", "highlighter"]);
437
+ const [own, rest] = splitProps(props, [
438
+ "content",
439
+ "highlighter",
440
+ "copyLabel",
441
+ "copiedLabel"
442
+ ]);
381
443
  const html = createMemo(() => renderHtml(own.content, own.highlighter ? { highlighter: own.highlighter } : void 0));
444
+ let root;
445
+ onMount(() => createEffect(() => {
446
+ html();
447
+ if (root) decorateCodeCopy(root, own.copyLabel ?? "Copy code");
448
+ }));
449
+ const onClick = (event) => {
450
+ clickCodeCopy(event, own.copyLabel ?? "Copy code", own.copiedLabel ?? "Copied");
451
+ };
382
452
  return (() => {
383
453
  var _el$ = _tmpl$$52();
454
+ use((el) => root = el, _el$);
384
455
  spread(_el$, mergeProps(rest, {
385
456
  "data-scope": "ai",
386
457
  "data-part": "response",
458
+ "onClick": onClick,
387
459
  get innerHTML() {
388
460
  return html();
389
461
  }
@@ -446,9 +518,9 @@ injectComponentStyle("ai");
446
518
  var _tmpl$$50 = /*#__PURE__*/ template(`<span>`);
447
519
  var _tmpl$2$25 = /*#__PURE__*/ template(`<span data-scope=ai data-part=tool-status>`);
448
520
  var _tmpl$3$17 = /*#__PURE__*/ template(`<span data-scope=ai data-part=tool-label>Input`);
449
- var _tmpl$4$12 = /*#__PURE__*/ template(`<pre>`);
450
- var _tmpl$5$9 = /*#__PURE__*/ template(`<span data-scope=ai data-part=tool-label>Output`);
451
- var _tmpl$6$6 = /*#__PURE__*/ template(`<div data-scope=ai data-part=tool-body>`);
521
+ var _tmpl$4$13 = /*#__PURE__*/ template(`<pre>`);
522
+ var _tmpl$5$10 = /*#__PURE__*/ template(`<span data-scope=ai data-part=tool-label>Output`);
523
+ var _tmpl$6$7 = /*#__PURE__*/ template(`<div data-scope=ai data-part=tool-body>`);
452
524
  /** A tool call: the shared collapsible as the vessel — the name it was
453
525
  * reached by and the state it reached in on the trigger, its input and
454
526
  * output folded inside. */
@@ -483,14 +555,14 @@ function Tool(props) {
483
555
  } })
484
556
  ];
485
557
  } }), createComponent(Collapsible.Content, { get children() {
486
- var _el$3 = _tmpl$6$6();
558
+ var _el$3 = _tmpl$6$7();
487
559
  insert(_el$3, createComponent(Show, {
488
560
  get when() {
489
561
  return own.input !== void 0;
490
562
  },
491
563
  get children() {
492
564
  return [_tmpl$3$17(), (() => {
493
- var _el$5 = _tmpl$4$12();
565
+ var _el$5 = _tmpl$4$13();
494
566
  insert(_el$5, () => own.input);
495
567
  return _el$5;
496
568
  })()];
@@ -501,8 +573,8 @@ function Tool(props) {
501
573
  return own.output !== void 0;
502
574
  },
503
575
  get children() {
504
- return [_tmpl$5$9(), (() => {
505
- var _el$7 = _tmpl$4$12();
576
+ return [_tmpl$5$10(), (() => {
577
+ var _el$7 = _tmpl$4$13();
506
578
  insert(_el$7, () => own.output);
507
579
  return _el$7;
508
580
  })()];
@@ -576,8 +648,8 @@ injectComponentStyle("ai");
576
648
  var _tmpl$$48 = /*#__PURE__*/ template(`<svg viewBox="0 0 16 16"aria-hidden=true fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=square><rect x=2.5 y=3.5 width=11 height=9></rect><path d="M2.5 10.5 6 7l3 3 2-1.5 2.5 2"></path><circle cx=6 cy=6 r=0.75 fill=currentColor stroke=none>`);
577
649
  var _tmpl$2$24 = /*#__PURE__*/ template(`<svg viewBox="0 0 16 16"aria-hidden=true fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=square><path d="M4 2.5h5l3 3V13.5H4z"></path><path d="M9 2.5v3h3">`);
578
650
  var _tmpl$3$16 = /*#__PURE__*/ template(`<svg viewBox="0 0 16 16"width=12 height=12 aria-hidden=true fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=square><path d="M4 4l8 8M12 4l-8 8">`);
579
- var _tmpl$4$11 = /*#__PURE__*/ template(`<span><span></span><button type=button data-remove>`);
580
- var _tmpl$5$8 = /*#__PURE__*/ template(`<span>`);
651
+ var _tmpl$4$12 = /*#__PURE__*/ template(`<span><span></span><button type=button data-remove>`);
652
+ var _tmpl$5$9 = /*#__PURE__*/ template(`<span>`);
581
653
  function imageGlyph() {
582
654
  return _tmpl$$48();
583
655
  }
@@ -625,7 +697,7 @@ function Attachment(props) {
625
697
  "onRemove"
626
698
  ]);
627
699
  return (() => {
628
- var _el$4 = _tmpl$4$11(), _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling;
700
+ var _el$4 = _tmpl$4$12(), _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling;
629
701
  spread(_el$4, mergeProps(rest, {
630
702
  "data-scope": "ai",
631
703
  "data-part": "attachment",
@@ -641,7 +713,7 @@ function Attachment(props) {
641
713
  insert(_el$4, (() => {
642
714
  var _c$2 = memo(() => own.size !== void 0);
643
715
  return () => _c$2() ? (() => {
644
- var _el$7 = _tmpl$5$8();
716
+ var _el$7 = _tmpl$5$9();
645
717
  insert(_el$7, () => humanSize(own.size));
646
718
  return _el$7;
647
719
  })() : null;
@@ -655,7 +727,7 @@ function Attachment(props) {
655
727
  /** The row the files ride in — a wrapping line of chips. */
656
728
  function Attachments(props) {
657
729
  return (() => {
658
- var _el$8 = _tmpl$5$8();
730
+ var _el$8 = _tmpl$5$9();
659
731
  spread(_el$8, mergeProps(props, {
660
732
  "data-scope": "ai",
661
733
  "data-part": "attachments"
@@ -670,7 +742,7 @@ delegateEvents(["click"]);
670
742
  var _tmpl$$47 = /*#__PURE__*/ template(`<svg width=16 height=16 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.75 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path>`);
671
743
  var _tmpl$2$23 = /*#__PURE__*/ template(`<div>`);
672
744
  var _tmpl$3$15 = /*#__PURE__*/ template(`<span data-scope=alert data-part=icon>`);
673
- var _tmpl$4$10 = /*#__PURE__*/ template(`<p>`);
745
+ var _tmpl$4$11 = /*#__PURE__*/ template(`<p>`);
674
746
  const StatusContext = createContext(() => "ink");
675
747
  function glyph(status) {
676
748
  const paths = {
@@ -727,7 +799,7 @@ function Body$2(props) {
727
799
  }
728
800
  function Title$4(props) {
729
801
  return (() => {
730
- var _el$6 = _tmpl$4$10();
802
+ var _el$6 = _tmpl$4$11();
731
803
  spread(_el$6, mergeProps(props, {
732
804
  "data-scope": "alert",
733
805
  "data-part": "title"
@@ -737,7 +809,7 @@ function Title$4(props) {
737
809
  }
738
810
  function Description$5(props) {
739
811
  return (() => {
740
- var _el$7 = _tmpl$4$10();
812
+ var _el$7 = _tmpl$4$11();
741
813
  spread(_el$7, mergeProps(props, {
742
814
  "data-scope": "alert",
743
815
  "data-part": "description"
@@ -848,11 +920,14 @@ function AutoComplete(props) {
848
920
  }
849
921
  injectComponentStyle("combobox");
850
922
  //#endregion
851
- //#region src/components/avatar/index.ts
852
- /** Ark's Avatar, dressed in the paper-and-ink system: a circular seal on
853
- * inset paper that holds initials until the image loads over them. The
854
- * API is Ark's own — Root, Image, Fallback. */
855
- const Avatar = Avatar$1;
923
+ //#region src/components/avatar/index.tsx
924
+ function AvatarRoot(props) {
925
+ const [own, rest] = splitProps(props, ["size"]);
926
+ return createComponent(Avatar$1.Root, mergeProps(rest, { get ["data-size"]() {
927
+ return own.size;
928
+ } }));
929
+ }
930
+ const Avatar = Object.assign({}, Avatar$1, { Root: AvatarRoot });
856
931
  injectComponentStyle("avatar");
857
932
  //#endregion
858
933
  //#region src/components/avatar-group/index.tsx
@@ -877,26 +952,55 @@ var _tmpl$2$22 = /*#__PURE__*/ template(`<svg width=16 height=16 viewBox="0 0 24
877
952
  * floating control rises at the page's corner and returns the reader to
878
953
  * the top. The scroll itself stays native — `window.scrollTo` defers to
879
954
  * the stylesheet's `scroll-behavior: smooth`, which reduced motion turns
880
- * back into an instant jump. The button stays mounted either way so the
881
- * entrance is a transition, never a pop.
955
+ * back into an instant jump (a moored control asks the media query
956
+ * directly, since a scroller of its own has no stylesheet to defer to).
957
+ * The button stays mounted either way so the entrance is a transition,
958
+ * never a pop.
882
959
  *
883
960
  * The control itself is the shared `Button` (outline, square) — the
884
961
  * paper, hairline and halo are its; this family owns only the floating
885
962
  * and the entrance.
886
963
  */
887
964
  function BackTop(props) {
888
- const [own, rest] = splitProps(props, ["threshold", "label"]);
965
+ const [own, rest] = splitProps(props, [
966
+ "threshold",
967
+ "label",
968
+ "scrollEl"
969
+ ]);
889
970
  const [visible, setVisible] = createSignal(false);
971
+ const scroller = () => own.scrollEl?.() ?? null;
890
972
  const onScroll = () => {
891
- setVisible(window.scrollY > (own.threshold ?? 400));
973
+ const el = scroller();
974
+ setVisible((el ? el.scrollTop : window.scrollY) > (own.threshold ?? 400));
975
+ };
976
+ const toTop = () => {
977
+ const el = scroller();
978
+ if (!el) {
979
+ window.scrollTo({ top: 0 });
980
+ return;
981
+ }
982
+ const reduce = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
983
+ el.scrollTo({
984
+ top: 0,
985
+ behavior: reduce ? "auto" : "smooth"
986
+ });
892
987
  };
893
988
  onMount(() => {
989
+ const el = scroller();
894
990
  onScroll();
895
- window.addEventListener("scroll", onScroll, { passive: true });
991
+ if (el) el.addEventListener("scroll", onScroll, { passive: true });
992
+ else window.addEventListener("scroll", onScroll, { passive: true });
993
+ });
994
+ onCleanup(() => {
995
+ const el = scroller();
996
+ if (el) el.removeEventListener("scroll", onScroll);
997
+ else window.removeEventListener("scroll", onScroll);
896
998
  });
897
- onCleanup(() => window.removeEventListener("scroll", onScroll));
898
999
  return (() => {
899
1000
  var _el$ = _tmpl$$44();
1001
+ spread(_el$, mergeProps({ get ["data-state"]() {
1002
+ return visible() ? "shown" : "hidden";
1003
+ } }, () => scroller() ? { "data-container": "" } : {}), false, true);
900
1004
  insert(_el$, createComponent(Button, mergeProps(rest, {
901
1005
  variant: "outline",
902
1006
  square: true,
@@ -910,12 +1014,11 @@ function BackTop(props) {
910
1014
  get tabindex() {
911
1015
  return visible() ? 0 : -1;
912
1016
  },
913
- onClick: () => window.scrollTo({ top: 0 }),
1017
+ onClick: toTop,
914
1018
  get children() {
915
1019
  return rest.children ?? chevronUp();
916
1020
  }
917
1021
  })));
918
- effect(() => setAttribute(_el$, "data-state", visible() ? "shown" : "hidden"));
919
1022
  return _el$;
920
1023
  })();
921
1024
  }
@@ -1319,17 +1422,57 @@ injectComponentStyle("card");
1319
1422
  const Carousel = Carousel$1;
1320
1423
  injectComponentStyle("carousel");
1321
1424
  //#endregion
1425
+ //#region src/components/input/index.tsx
1426
+ var _tmpl$$38 = /*#__PURE__*/ template(`<input>`);
1427
+ /** The bare text input: the field recipe — border, surface, focus halo —
1428
+ * on a native control. Standing alone it styles itself from the `invalid`
1429
+ * prop; inside a `Field.Root` it consumes the field context, picking up
1430
+ * the label id, the described-by wiring and the invalid state for free,
1431
+ * which is also the seam the Form validation layer will drive. Disabled
1432
+ * rides the native attribute. */
1433
+ function Input(props) {
1434
+ const field = useFieldContext();
1435
+ const [own, rest] = splitProps(props, [
1436
+ "value",
1437
+ "size",
1438
+ "invalid",
1439
+ "onValueChange"
1440
+ ]);
1441
+ return (() => {
1442
+ var _el$ = _tmpl$$38();
1443
+ spread(_el$, mergeProps(() => mergeProps$1(() => field?.().getInputProps() ?? {}, rest, {
1444
+ get value() {
1445
+ return own.value;
1446
+ },
1447
+ "data-scope": "input",
1448
+ "data-part": "root",
1449
+ get "data-size"() {
1450
+ return own.size ?? "md";
1451
+ },
1452
+ get "data-invalid"() {
1453
+ return own.invalid || field?.().getInputProps()["data-invalid"] != null ? "" : void 0;
1454
+ },
1455
+ onInput: (event) => own.onValueChange?.(event.currentTarget.value)
1456
+ })), false, false);
1457
+ return _el$;
1458
+ })();
1459
+ }
1460
+ injectComponentStyle("input");
1461
+ //#endregion
1322
1462
  //#region src/components/cascade-select/index.tsx
1323
- var _tmpl$$38 = /*#__PURE__*/ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="m6 9 6 6 6-6">`);
1463
+ var _tmpl$$37 = /*#__PURE__*/ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="m6 9 6 6 6-6">`);
1324
1464
  var _tmpl$2$19 = /*#__PURE__*/ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="m9 18 6-6-6-6">`);
1325
1465
  var _tmpl$3$13 = /*#__PURE__*/ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=3 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="m5 12.5 5 5L19 7">`);
1326
- var _tmpl$4$9 = /*#__PURE__*/ template(`<ul>`);
1327
- var _tmpl$5$7 = /*#__PURE__*/ template(`<span data-part=branch-indicator aria-hidden=true>`);
1328
- var _tmpl$6$5 = /*#__PURE__*/ template(`<li><span></span><span>`);
1329
- var _tmpl$7$2 = /*#__PURE__*/ template(`<div><div>`);
1330
- var _tmpl$8$2 = /*#__PURE__*/ template(`<div><div><button><span></span><span>`);
1466
+ var _tmpl$4$10 = /*#__PURE__*/ template(`<ul>`);
1467
+ var _tmpl$5$8 = /*#__PURE__*/ template(`<span data-part=branch-indicator aria-hidden=true>`);
1468
+ var _tmpl$6$6 = /*#__PURE__*/ template(`<li><span></span><span>`);
1469
+ var _tmpl$7$2 = /*#__PURE__*/ template(`<div data-part=search>`);
1470
+ var _tmpl$8$2 = /*#__PURE__*/ template(`<div><div>`);
1471
+ var _tmpl$9$2 = /*#__PURE__*/ template(`<div><div><button><span></span><span>`);
1472
+ var _tmpl$0$2 = /*#__PURE__*/ template(`<p data-part=empty>Nothing matches`);
1473
+ var _tmpl$1$2 = /*#__PURE__*/ template(`<button type=button data-part=match>`);
1331
1474
  function chevronDown$1() {
1332
- return _tmpl$$38();
1475
+ return _tmpl$$37();
1333
1476
  }
1334
1477
  function chevronRight() {
1335
1478
  return _tmpl$2$19();
@@ -1342,7 +1485,9 @@ function checkGlyph$2() {
1342
1485
  * dissolves open beside it, until a leaf click settles the whole path.
1343
1486
  * `value` is the selected path (or paths, when `multiple`) — the
1344
1487
  * joined labels ride the trigger. `highlightTrigger: "hover"` turns the
1345
- * classic cascading menu: pointing is enough to unfold.
1488
+ * classic cascading menu: pointing is enough to unfold. `filterable`
1489
+ * swaps the corridor for a flat list of matching paths while a query
1490
+ * runs — each hit still reads as its full route.
1346
1491
  */
1347
1492
  function CascadeSelect(props) {
1348
1493
  const [own, rest] = splitProps(props, [
@@ -1350,6 +1495,7 @@ function CascadeSelect(props) {
1350
1495
  "data",
1351
1496
  "placeholder",
1352
1497
  "highlightTrigger",
1498
+ "filterable",
1353
1499
  "multiple",
1354
1500
  "disabled",
1355
1501
  "onValueChange"
@@ -1381,6 +1527,42 @@ function CascadeSelect(props) {
1381
1527
  }
1382
1528
  }));
1383
1529
  const api = createMemo(() => cascade.connect(service, normalizeProps));
1530
+ const [query, setQuery] = createSignal("");
1531
+ const filterFns = useFilter({ sensitivity: "base" });
1532
+ const filtering = () => own.filterable && query().trim().length > 0;
1533
+ /** The corridor's answer to a query: every leaf whose route matches —
1534
+ * the query may land on any hop, and the whole route still shows. */
1535
+ const matchPaths = createMemo(() => {
1536
+ if (!filtering()) return [];
1537
+ const q = query().trim();
1538
+ const hits = [];
1539
+ const walk = (nodes, path, labels, matched) => {
1540
+ for (const node of nodes ?? []) {
1541
+ const hit = matched || filterFns().contains(node.label, q);
1542
+ const nextPath = [...path, node.value];
1543
+ const nextLabels = [...labels, node.label];
1544
+ if (node.children?.length) walk(node.children, nextPath, nextLabels, hit);
1545
+ else if (hit) hits.push({
1546
+ path: nextPath,
1547
+ labels: nextLabels
1548
+ });
1549
+ }
1550
+ };
1551
+ walk(own.data, [], [], false);
1552
+ return hits;
1553
+ });
1554
+ const isSelected = (path) => (own.value ?? []).some((p) => p.join("/") === path.join("/"));
1555
+ function pickMatch(path) {
1556
+ if (own.multiple) {
1557
+ const current = own.value ?? [];
1558
+ const key = path.join("/");
1559
+ const next = current.some((p) => p.join("/") === key) ? current.filter((p) => p.join("/") !== key) : [...current, path];
1560
+ api().setValue(next);
1561
+ } else {
1562
+ api().selectValue(path);
1563
+ api().setOpen(false);
1564
+ }
1565
+ }
1384
1566
  /** The machine's `valueAsString` only updates through its select
1385
1567
  * event, so an externally-set `value` would render the
1386
1568
  * placeholder forever — resolve the labels from the data instead. */
@@ -1410,7 +1592,7 @@ function CascadeSelect(props) {
1410
1592
  const nodeState = () => api().getItemState(nodeProps);
1411
1593
  const children = collection().getNodeChildren(node);
1412
1594
  const list = (() => {
1413
- var _el$4 = _tmpl$4$9();
1595
+ var _el$4 = _tmpl$4$10();
1414
1596
  spread(_el$4, mergeProps(() => mergeProps$1(() => api().getListProps(nodeProps))), false, true);
1415
1597
  insert(_el$4, createComponent(For, {
1416
1598
  each: children,
@@ -1423,7 +1605,7 @@ function CascadeSelect(props) {
1423
1605
  };
1424
1606
  const itemState = () => api().getItemState(itemProps);
1425
1607
  return (() => {
1426
- var _el$5 = _tmpl$6$5(), _el$6 = _el$5.firstChild, _el$8 = _el$6.nextSibling;
1608
+ var _el$5 = _tmpl$6$6(), _el$6 = _el$5.firstChild, _el$8 = _el$6.nextSibling;
1427
1609
  spread(_el$5, mergeProps(() => mergeProps$1(() => api().getItemProps(itemProps))), false, true);
1428
1610
  spread(_el$6, mergeProps(() => mergeProps$1(() => api().getItemTextProps(itemProps))), false, true);
1429
1611
  insert(_el$6, () => item.label);
@@ -1432,7 +1614,7 @@ function CascadeSelect(props) {
1432
1614
  return itemState().hasChildren;
1433
1615
  },
1434
1616
  get children() {
1435
- var _el$7 = _tmpl$5$7();
1617
+ var _el$7 = _tmpl$5$8();
1436
1618
  insert(_el$7, chevronRight);
1437
1619
  return _el$7;
1438
1620
  }
@@ -1449,27 +1631,83 @@ function CascadeSelect(props) {
1449
1631
  return [list, next != null && collection().isBranchNode(next) ? renderColumn(next, [...indexPath, nodeState().highlightedIndex], [...valuePath, collection().getNodeValue(next)]) : null];
1450
1632
  }
1451
1633
  return (() => {
1452
- var _el$9 = _tmpl$8$2(), _el$0 = _el$9.firstChild, _el$1 = _el$0.firstChild, _el$10 = _el$1.firstChild, _el$11 = _el$10.nextSibling;
1634
+ var _el$9 = _tmpl$9$2(), _el$0 = _el$9.firstChild, _el$1 = _el$0.firstChild, _el$10 = _el$1.firstChild, _el$11 = _el$10.nextSibling;
1453
1635
  spread(_el$9, mergeProps(rest, () => mergeProps$1(() => api().getRootProps())), false, true);
1454
1636
  spread(_el$0, mergeProps(() => mergeProps$1(() => api().getControlProps())), false, true);
1455
- spread(_el$1, mergeProps(() => mergeProps$1(() => api().getTriggerProps(), { get disabled() {
1456
- return own.disabled || void 0;
1457
- } })), false, true);
1637
+ spread(_el$1, mergeProps(() => mergeProps$1(() => api().getTriggerProps(), {
1638
+ get disabled() {
1639
+ return own.disabled || void 0;
1640
+ },
1641
+ onclick(event) {
1642
+ api().getTriggerProps().onclick?.(event);
1643
+ setQuery("");
1644
+ }
1645
+ })), false, true);
1458
1646
  spread(_el$10, mergeProps(() => mergeProps$1(() => api().getValueTextProps())), false, true);
1459
1647
  insert(_el$10, () => display() ?? own.placeholder ?? "Select…");
1460
1648
  spread(_el$11, mergeProps(() => mergeProps$1(() => api().getIndicatorProps())), false, true);
1461
1649
  insert(_el$11, chevronDown$1);
1462
1650
  insert(_el$9, createComponent(Portal, { get children() {
1463
- var _el$12 = _tmpl$7$2(), _el$13 = _el$12.firstChild;
1651
+ var _el$12 = _tmpl$8$2(), _el$13 = _el$12.firstChild;
1464
1652
  spread(_el$12, mergeProps(() => mergeProps$1(() => api().getPositionerProps())), false, true);
1465
1653
  spread(_el$13, mergeProps(() => mergeProps$1(() => api().getContentProps())), false, true);
1466
- insert(_el$13, () => renderColumn(collection().rootNode, [], []));
1654
+ insert(_el$13, createComponent(Show, {
1655
+ get when() {
1656
+ return own.filterable;
1657
+ },
1658
+ get children() {
1659
+ var _el$14 = _tmpl$7$2();
1660
+ insert(_el$14, createComponent(Input, {
1661
+ size: "sm",
1662
+ get value() {
1663
+ return query();
1664
+ },
1665
+ onValueChange: setQuery,
1666
+ placeholder: "Filter…",
1667
+ "aria-label": "Filter options"
1668
+ }));
1669
+ return _el$14;
1670
+ }
1671
+ }), null);
1672
+ insert(_el$13, createComponent(Show, {
1673
+ get when() {
1674
+ return !filtering();
1675
+ },
1676
+ get fallback() {
1677
+ return createComponent(Show, {
1678
+ get when() {
1679
+ return matchPaths().length > 0;
1680
+ },
1681
+ get fallback() {
1682
+ return _tmpl$0$2();
1683
+ },
1684
+ get children() {
1685
+ return createComponent(For, {
1686
+ get each() {
1687
+ return matchPaths();
1688
+ },
1689
+ children: (hit) => (() => {
1690
+ var _el$16 = _tmpl$1$2();
1691
+ _el$16.$$click = () => pickMatch(hit.path);
1692
+ insert(_el$16, () => hit.labels.join(" / "));
1693
+ effect(() => setAttribute(_el$16, "data-selected", isSelected(hit.path) || void 0));
1694
+ return _el$16;
1695
+ })()
1696
+ });
1697
+ }
1698
+ });
1699
+ },
1700
+ get children() {
1701
+ return renderColumn(collection().rootNode, [], []);
1702
+ }
1703
+ }), null);
1467
1704
  return _el$12;
1468
1705
  } }), null);
1469
1706
  return _el$9;
1470
1707
  })();
1471
1708
  }
1472
1709
  injectComponentStyle("cascade-select");
1710
+ delegateEvents(["click"]);
1473
1711
  //#endregion
1474
1712
  //#region src/components/checkbox/index.ts
1475
1713
  /** Ark's Checkbox, dressed in the paper-and-ink system: a square-cut seal
@@ -1480,26 +1718,32 @@ const Checkbox = Checkbox$1;
1480
1718
  injectComponentStyle("checkbox");
1481
1719
  //#endregion
1482
1720
  //#region src/components/checkbox-group/index.tsx
1483
- var _tmpl$$37 = /*#__PURE__*/ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=3 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="m5 12.5 5 5L19 7">`);
1721
+ var _tmpl$$36 = /*#__PURE__*/ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=3 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="m5 12.5 5 5L19 7">`);
1484
1722
  var _tmpl$2$18 = /*#__PURE__*/ template(`<div>`);
1485
1723
  function checkGlyph$1() {
1486
- return _tmpl$$37();
1724
+ return _tmpl$$36();
1487
1725
  }
1488
1726
  /**
1489
1727
  * One question, many answers: a labelled stack (or row) of the seal-cut
1490
1728
  * checkboxes bound to a single array. Toggling a box adds or removes its
1491
1729
  * value; the group itself is semantics (`role="group"`), the boxes stay
1492
- * the machine-driven originals.
1730
+ * the machine-driven originals. Inside a `Field.Root` the group picks up
1731
+ * the field context, so the invalid and disabled states a Form routes to
1732
+ * its name dress every box at once.
1493
1733
  */
1494
1734
  function CheckboxGroup(props) {
1735
+ const field = useFieldContext();
1495
1736
  const [own, rest] = splitProps(props, [
1496
1737
  "value",
1497
1738
  "options",
1498
1739
  "layout",
1740
+ "invalid",
1499
1741
  "disabled",
1500
1742
  "onValueChange"
1501
1743
  ]);
1502
1744
  const selected = () => new Set(own.value ?? []);
1745
+ const isInvalid = () => own.invalid || field?.().invalid === true;
1746
+ const isDisabled = () => own.disabled || field?.().disabled === true;
1503
1747
  function toggle(value) {
1504
1748
  const next = new Set(selected());
1505
1749
  if (next.has(value)) next.delete(value);
@@ -1514,6 +1758,9 @@ function CheckboxGroup(props) {
1514
1758
  "data-part": "root",
1515
1759
  get ["data-layout"]() {
1516
1760
  return own.layout ?? "vertical";
1761
+ },
1762
+ get ["data-invalid"]() {
1763
+ return isInvalid() ? "" : void 0;
1517
1764
  }
1518
1765
  }), false, true);
1519
1766
  insert(_el$2, createComponent(For, {
@@ -1524,8 +1771,11 @@ function CheckboxGroup(props) {
1524
1771
  get checked() {
1525
1772
  return selected().has(option.value);
1526
1773
  },
1774
+ get invalid() {
1775
+ return isInvalid();
1776
+ },
1527
1777
  get disabled() {
1528
- return own.disabled || option.disabled === true;
1778
+ return isDisabled() || option.disabled === true;
1529
1779
  },
1530
1780
  onCheckedChange: () => toggle(option.value),
1531
1781
  get children() {
@@ -1550,7 +1800,7 @@ injectComponentStyle("checkbox-group");
1550
1800
  injectComponentStyle("checkbox");
1551
1801
  //#endregion
1552
1802
  //#region src/components/chip/index.tsx
1553
- var _tmpl$$36 = /*#__PURE__*/ template(`<span>`);
1803
+ var _tmpl$$35 = /*#__PURE__*/ template(`<span>`);
1554
1804
  function Chip(props) {
1555
1805
  const [own, rest] = splitProps(props, [
1556
1806
  "value",
@@ -1559,7 +1809,7 @@ function Chip(props) {
1559
1809
  "variant"
1560
1810
  ]);
1561
1811
  return (() => {
1562
- var _el$ = _tmpl$$36();
1812
+ var _el$ = _tmpl$$35();
1563
1813
  spread(_el$, mergeProps(rest, {
1564
1814
  "data-scope": "chip",
1565
1815
  "data-part": "root",
@@ -1609,11 +1859,11 @@ const Combobox = Combobox$1;
1609
1859
  injectComponentStyle("combobox");
1610
1860
  //#endregion
1611
1861
  //#region src/components/command/index.tsx
1612
- var _tmpl$$35 = /*#__PURE__*/ template(`<span data-scope=command data-part=item-hint>`);
1862
+ var _tmpl$$34 = /*#__PURE__*/ template(`<span data-scope=command data-part=item-hint>`);
1613
1863
  var _tmpl$2$17 = /*#__PURE__*/ template(`<div>`);
1614
1864
  var _tmpl$3$12 = /*#__PURE__*/ template(`<span>`);
1615
- var _tmpl$4$8 = /*#__PURE__*/ template(`<input>`);
1616
- var _tmpl$5$6 = /*#__PURE__*/ template(`<div data-scope=command data-part=empty>`);
1865
+ var _tmpl$4$9 = /*#__PURE__*/ template(`<input>`);
1866
+ var _tmpl$5$7 = /*#__PURE__*/ template(`<div data-scope=command data-part=empty>`);
1617
1867
  /** A command row: the machine's item grafted onto a vessel of our own,
1618
1868
  * the label riding the machine's item text. */
1619
1869
  function Row(props) {
@@ -1641,7 +1891,7 @@ function Row(props) {
1641
1891
  return props.entry.hint;
1642
1892
  },
1643
1893
  get children() {
1644
- var _el$2 = _tmpl$$35();
1894
+ var _el$2 = _tmpl$$34();
1645
1895
  insert(_el$2, () => props.entry.hint);
1646
1896
  return _el$2;
1647
1897
  }
@@ -1754,7 +2004,7 @@ function Command(props) {
1754
2004
  },
1755
2005
  get children() {
1756
2006
  return [createComponent(Combobox$1.Input, { asChild: (inputProps) => (() => {
1757
- var _el$6 = _tmpl$4$8();
2007
+ var _el$6 = _tmpl$4$9();
1758
2008
  spread(_el$6, mergeProps(inputProps, {
1759
2009
  "type": "text",
1760
2010
  get placeholder() {
@@ -1818,7 +2068,7 @@ function Command(props) {
1818
2068
  return sections().length === 0;
1819
2069
  },
1820
2070
  get children() {
1821
- var _el$8 = _tmpl$5$6();
2071
+ var _el$8 = _tmpl$5$7();
1822
2072
  insert(_el$8, () => own.emptyText ?? "No matching commands");
1823
2073
  return _el$8;
1824
2074
  }
@@ -1839,12 +2089,12 @@ injectComponentStyle("command");
1839
2089
  injectComponentStyle("dialog");
1840
2090
  //#endregion
1841
2091
  //#region src/components/comment/index.tsx
1842
- var _tmpl$$34 = /*#__PURE__*/ template(`<div data-scope=comment data-part=avatar>`);
2092
+ var _tmpl$$33 = /*#__PURE__*/ template(`<div data-scope=comment data-part=avatar>`);
1843
2093
  var _tmpl$2$16 = /*#__PURE__*/ template(`<span data-scope=comment data-part=author>`);
1844
2094
  var _tmpl$3$11 = /*#__PURE__*/ template(`<time data-scope=comment data-part=datetime>`);
1845
- var _tmpl$4$7 = /*#__PURE__*/ template(`<header data-scope=comment data-part=header>`);
1846
- var _tmpl$5$5 = /*#__PURE__*/ template(`<div data-scope=comment data-part=actions>`);
1847
- var _tmpl$6$4 = /*#__PURE__*/ template(`<article><div data-scope=comment data-part=body><div data-scope=comment data-part=content>`);
2095
+ var _tmpl$4$8 = /*#__PURE__*/ template(`<header data-scope=comment data-part=header>`);
2096
+ var _tmpl$5$6 = /*#__PURE__*/ template(`<div data-scope=comment data-part=actions>`);
2097
+ var _tmpl$6$5 = /*#__PURE__*/ template(`<article><div data-scope=comment data-part=body><div data-scope=comment data-part=content>`);
1848
2098
  /**
1849
2099
  * A voice on the record: the portrait hangs left (the `avatar` prop),
1850
2100
  * the body carries the byline from `author` and `datetime`, the ink is
@@ -1859,7 +2109,7 @@ function Comment(props) {
1859
2109
  "children"
1860
2110
  ]);
1861
2111
  return (() => {
1862
- var _el$ = _tmpl$6$4(), _el$3 = _el$.firstChild, _el$7 = _el$3.firstChild;
2112
+ var _el$ = _tmpl$6$5(), _el$3 = _el$.firstChild, _el$7 = _el$3.firstChild;
1863
2113
  spread(_el$, mergeProps(rest, {
1864
2114
  "data-scope": "comment",
1865
2115
  "data-part": "root"
@@ -1869,7 +2119,7 @@ function Comment(props) {
1869
2119
  return own.avatar;
1870
2120
  },
1871
2121
  get children() {
1872
- var _el$2 = _tmpl$$34();
2122
+ var _el$2 = _tmpl$$33();
1873
2123
  insert(_el$2, () => own.avatar);
1874
2124
  return _el$2;
1875
2125
  }
@@ -1879,7 +2129,7 @@ function Comment(props) {
1879
2129
  return own.author || own.datetime;
1880
2130
  },
1881
2131
  get children() {
1882
- var _el$4 = _tmpl$4$7();
2132
+ var _el$4 = _tmpl$4$8();
1883
2133
  insert(_el$4, createComponent(Show, {
1884
2134
  get when() {
1885
2135
  return own.author;
@@ -1910,7 +2160,7 @@ function Comment(props) {
1910
2160
  return own.actions;
1911
2161
  },
1912
2162
  get children() {
1913
- var _el$8 = _tmpl$5$5();
2163
+ var _el$8 = _tmpl$5$6();
1914
2164
  insert(_el$8, () => own.actions);
1915
2165
  return _el$8;
1916
2166
  }
@@ -1921,7 +2171,7 @@ function Comment(props) {
1921
2171
  injectComponentStyle("comment");
1922
2172
  //#endregion
1923
2173
  //#region src/components/config-provider/index.tsx
1924
- var _tmpl$$33 = /*#__PURE__*/ template(`<div>`);
2174
+ var _tmpl$$32 = /*#__PURE__*/ template(`<div>`);
1925
2175
  /** Solid context for the provider's snapshot — a custom part reads it
1926
2176
  * with `useContext(ConfigContextKey)`. */
1927
2177
  const ConfigContextKey = createContext(() => ({}));
@@ -1954,7 +2204,7 @@ function ConfigProvider(props) {
1954
2204
  locale: own.locale
1955
2205
  }),
1956
2206
  get children() {
1957
- var _el$ = _tmpl$$33();
2207
+ var _el$ = _tmpl$$32();
1958
2208
  spread(_el$, mergeProps(rest, {
1959
2209
  "data-scope": "config-provider",
1960
2210
  "data-part": "root",
@@ -1978,11 +2228,11 @@ function ConfigProvider(props) {
1978
2228
  }
1979
2229
  //#endregion
1980
2230
  //#region src/components/container/index.tsx
1981
- var _tmpl$$32 = /*#__PURE__*/ template(`<div>`);
2231
+ var _tmpl$$31 = /*#__PURE__*/ template(`<div>`);
1982
2232
  function Container(props) {
1983
2233
  const [own, rest] = splitProps(props, ["size", "padding"]);
1984
2234
  return (() => {
1985
- var _el$ = _tmpl$$32();
2235
+ var _el$ = _tmpl$$31();
1986
2236
  spread(_el$, mergeProps(rest, {
1987
2237
  "data-scope": "container",
1988
2238
  "data-part": "root",
@@ -2017,11 +2267,11 @@ const DatePicker = DatePicker$1;
2017
2267
  injectComponentStyle("date-picker");
2018
2268
  //#endregion
2019
2269
  //#region src/components/descriptions/index.tsx
2020
- var _tmpl$$31 = /*#__PURE__*/ template(`<dl>`);
2270
+ var _tmpl$$30 = /*#__PURE__*/ template(`<dl>`);
2021
2271
  function Root$6(props) {
2022
2272
  const [own, rest] = splitProps(props, ["layout"]);
2023
2273
  return (() => {
2024
- var _el$ = _tmpl$$31();
2274
+ var _el$ = _tmpl$$30();
2025
2275
  spread(_el$, mergeProps(rest, {
2026
2276
  "data-scope": "descriptions",
2027
2277
  "data-part": "root",
@@ -2071,43 +2321,6 @@ injectComponentStyle("dialog");
2071
2321
  const Drawer = Drawer$1;
2072
2322
  injectComponentStyle("drawer");
2073
2323
  //#endregion
2074
- //#region src/components/input/index.tsx
2075
- var _tmpl$$30 = /*#__PURE__*/ template(`<input>`);
2076
- /** The bare text input: the field recipe — border, surface, focus halo —
2077
- * on a native control. Standing alone it styles itself from the `invalid`
2078
- * prop; inside a `Field.Root` it consumes the field context, picking up
2079
- * the label id, the described-by wiring and the invalid state for free,
2080
- * which is also the seam the Form validation layer will drive. Disabled
2081
- * rides the native attribute. */
2082
- function Input(props) {
2083
- const field = useFieldContext();
2084
- const [own, rest] = splitProps(props, [
2085
- "value",
2086
- "size",
2087
- "invalid",
2088
- "onValueChange"
2089
- ]);
2090
- return (() => {
2091
- var _el$ = _tmpl$$30();
2092
- spread(_el$, mergeProps(() => mergeProps$1(() => field?.().getInputProps() ?? {}, rest, {
2093
- get value() {
2094
- return own.value;
2095
- },
2096
- "data-scope": "input",
2097
- "data-part": "root",
2098
- get "data-size"() {
2099
- return own.size ?? "md";
2100
- },
2101
- get "data-invalid"() {
2102
- return own.invalid || field?.().getInputProps()["data-invalid"] != null ? "" : void 0;
2103
- },
2104
- onInput: (event) => own.onValueChange?.(event.currentTarget.value)
2105
- })), false, false);
2106
- return _el$;
2107
- })();
2108
- }
2109
- injectComponentStyle("input");
2110
- //#endregion
2111
2324
  //#region src/components/dynamic-input/index.tsx
2112
2325
  var _tmpl$$29 = /*#__PURE__*/ template(`<div><div data-scope=dynamic-input data-part=add>`);
2113
2326
  var _tmpl$2$15 = /*#__PURE__*/ template(`<div data-scope=dynamic-input data-part=row>`);
@@ -2692,8 +2905,8 @@ injectComponentStyle("icon");
2692
2905
  var _tmpl$$23 = /*#__PURE__*/ template(`<svg><rect x=3 y=4 width=18 height=16 rx=1.5></svg>`, false, true, false);
2693
2906
  var _tmpl$2$12 = /*#__PURE__*/ template(`<svg><circle cx=9 cy=10 r=1.5></svg>`, false, true, false);
2694
2907
  var _tmpl$3$9 = /*#__PURE__*/ template(`<svg><path d="m5.5 17.5 4.5-5 3 3.5 2.5-3 3 4.5"></svg>`, false, true, false);
2695
- var _tmpl$4$6 = /*#__PURE__*/ template(`<div data-scope=image data-part=fallback>`);
2696
- var _tmpl$5$4 = /*#__PURE__*/ template(`<figure><img data-scope=image data-part=img decoding=async>`, true, false, false);
2908
+ var _tmpl$4$7 = /*#__PURE__*/ template(`<div data-scope=image data-part=fallback>`);
2909
+ var _tmpl$5$5 = /*#__PURE__*/ template(`<figure><img data-scope=image data-part=img decoding=async>`, true, false, false);
2697
2910
  /** The mark for a source that never arrived: a quiet mountain-and-sun,
2698
2911
  * drawn in the stylesheet's stroke and hidden from the reader. */
2699
2912
  function placeholderGlyph() {
@@ -2714,7 +2927,7 @@ function Image(props) {
2714
2927
  const [state, setState] = createSignal("loading");
2715
2928
  createEffect(on(() => own.src, () => setState("loading")));
2716
2929
  return (() => {
2717
- var _el$4 = _tmpl$5$4(), _el$5 = _el$4.firstChild;
2930
+ var _el$4 = _tmpl$5$5(), _el$5 = _el$4.firstChild;
2718
2931
  spread(_el$4, mergeProps(rest, {
2719
2932
  "data-scope": "image",
2720
2933
  "data-part": "root",
@@ -2732,7 +2945,7 @@ function Image(props) {
2732
2945
  return state() === "error";
2733
2946
  },
2734
2947
  get children() {
2735
- var _el$6 = _tmpl$4$6();
2948
+ var _el$6 = _tmpl$4$7();
2736
2949
  insert(_el$6, () => own.fallback ?? placeholderGlyph());
2737
2950
  return _el$6;
2738
2951
  }
@@ -2765,9 +2978,9 @@ injectComponentStyle("image-cropper");
2765
2978
  var _tmpl$$22 = /*#__PURE__*/ template(`<svg><circle cx=11 cy=11 r=7></svg>`, false, true, false);
2766
2979
  var _tmpl$2$11 = /*#__PURE__*/ template(`<svg><path d="m16.2 16.2 4.8 4.8"></svg>`, false, true, false);
2767
2980
  var _tmpl$3$8 = /*#__PURE__*/ template(`<svg><path d="M8 11h6"></svg>`, false, true, false);
2768
- var _tmpl$4$5 = /*#__PURE__*/ template(`<svg><path d="M11 8v6"></svg>`, false, true, false);
2769
- var _tmpl$5$3 = /*#__PURE__*/ template(`<svg><path d="M20.49 12A8.5 8.5 0 1 1 18 6.06"></svg>`, false, true, false);
2770
- var _tmpl$6$3 = /*#__PURE__*/ template(`<svg><path d="M20.5 3.5v4h-4"></svg>`, false, true, false);
2981
+ var _tmpl$4$6 = /*#__PURE__*/ template(`<svg><path d="M11 8v6"></svg>`, false, true, false);
2982
+ var _tmpl$5$4 = /*#__PURE__*/ template(`<svg><path d="M20.49 12A8.5 8.5 0 1 1 18 6.06"></svg>`, false, true, false);
2983
+ var _tmpl$6$4 = /*#__PURE__*/ template(`<svg><path d="M20.5 3.5v4h-4"></svg>`, false, true, false);
2771
2984
  var _tmpl$7$1 = /*#__PURE__*/ template(`<svg><path d="m6 6 12 12"></svg>`, false, true, false);
2772
2985
  var _tmpl$8$1 = /*#__PURE__*/ template(`<svg><path d="M18 6 6 18"></svg>`, false, true, false);
2773
2986
  var _tmpl$9$1 = /*#__PURE__*/ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden=true>`);
@@ -2782,14 +2995,14 @@ const TOOL_GLYPHS = {
2782
2995
  _tmpl$$22(),
2783
2996
  _tmpl$2$11(),
2784
2997
  _tmpl$3$8(),
2785
- _tmpl$4$5()
2998
+ _tmpl$4$6()
2786
2999
  ],
2787
3000
  zoomOut: () => [
2788
3001
  _tmpl$$22(),
2789
3002
  _tmpl$2$11(),
2790
3003
  _tmpl$3$8()
2791
3004
  ],
2792
- rotate: () => [_tmpl$5$3(), _tmpl$6$3()],
3005
+ rotate: () => [_tmpl$5$4(), _tmpl$6$4()],
2793
3006
  close: () => [_tmpl$7$1(), _tmpl$8$1()]
2794
3007
  };
2795
3008
  function ImageViewer(props) {
@@ -2959,16 +3172,15 @@ injectComponentStyle("kbd");
2959
3172
  var _tmpl$$19 = /*#__PURE__*/ template(`<div>`);
2960
3173
  var _tmpl$2$10 = /*#__PURE__*/ template(`<header>`);
2961
3174
  var _tmpl$3$7 = /*#__PURE__*/ template(`<main>`);
2962
- var _tmpl$4$4 = /*#__PURE__*/ template(`<footer>`);
2963
- var _tmpl$5$2 = /*#__PURE__*/ template(`<div data-scope=layout data-part=sider-resize role=separator aria-orientation=vertical tabindex=0 aria-label="Resize sidebar">`);
2964
- var _tmpl$6$2 = /*#__PURE__*/ template(`<aside>`);
3175
+ var _tmpl$4$5 = /*#__PURE__*/ template(`<footer>`);
3176
+ var _tmpl$5$3 = /*#__PURE__*/ template(`<div data-scope=layout data-part=sider-resize role=separator aria-orientation=vertical tabindex=0 aria-label="Resize sidebar">`);
3177
+ var _tmpl$6$3 = /*#__PURE__*/ template(`<aside>`);
2965
3178
  const LayoutContext = createContext();
2966
3179
  /**
2967
3180
  * The application skeleton: Root, Header, Sider, Content, Footer —
2968
- * the admin arrangement (Element Plus / AntD keep the same anatomy)
2969
- * dressed in the paper-and-ink surfaces. The root is a full-height
2970
- * grid; a declared `sider` turns the columns around to meet whichever
2971
- * edge the rail stands on.
3181
+ * the admin arrangement dressed in the paper-and-ink surfaces. The
3182
+ * root is a full-height grid; a declared `sider` turns the columns
3183
+ * around to meet whichever edge the rail stands on.
2972
3184
  */
2973
3185
  function LayoutRoot(props) {
2974
3186
  const [own, rest] = splitProps(props, ["sider"]);
@@ -3009,7 +3221,7 @@ function LayoutContent(props) {
3009
3221
  }
3010
3222
  function LayoutFooter(props) {
3011
3223
  return (() => {
3012
- var _el$4 = _tmpl$4$4();
3224
+ var _el$4 = _tmpl$4$5();
3013
3225
  spread(_el$4, mergeProps(props, {
3014
3226
  "data-scope": "layout",
3015
3227
  "data-part": "footer"
@@ -3080,7 +3292,7 @@ function LayoutSider(props) {
3080
3292
  own.onWidthChange?.(`${next}px`);
3081
3293
  };
3082
3294
  const handle = () => own.resizable && !collapsed() ? (() => {
3083
- var _el$5 = _tmpl$5$2();
3295
+ var _el$5 = _tmpl$5$3();
3084
3296
  _el$5.$$keydown = onKeyDown;
3085
3297
  _el$5.$$pointerup = onPointerUp;
3086
3298
  _el$5.$$pointermove = onPointerMove;
@@ -3098,7 +3310,7 @@ function LayoutSider(props) {
3098
3310
  })() : null;
3099
3311
  const foldedWidth = () => own.collapsedWidth ?? "3.5rem";
3100
3312
  return (() => {
3101
- var _el$6 = _tmpl$6$2();
3313
+ var _el$6 = _tmpl$6$3();
3102
3314
  use((el) => rail = el, _el$6);
3103
3315
  spread(_el$6, mergeProps(rest, {
3104
3316
  get style() {
@@ -3169,7 +3381,7 @@ injectComponentStyle("link");
3169
3381
  var _tmpl$$17 = /*#__PURE__*/ template(`<ul>`);
3170
3382
  var _tmpl$2$9 = /*#__PURE__*/ template(`<div data-scope=list data-part=title>`);
3171
3383
  var _tmpl$3$6 = /*#__PURE__*/ template(`<div data-scope=list data-part=description>`);
3172
- var _tmpl$4$3 = /*#__PURE__*/ template(`<div>`);
3384
+ var _tmpl$4$4 = /*#__PURE__*/ template(`<div>`);
3173
3385
  /** A ledger of rows: Root is the list, Item one row, Leading the mark
3174
3386
  * before the words, Content the title and its quiet echo, Actions the
3175
3387
  * way out. The bordered variant draws the hairlines; the hoverable
@@ -3215,7 +3427,7 @@ function Content$1(props) {
3215
3427
  "children"
3216
3428
  ]);
3217
3429
  return (() => {
3218
- var _el$2 = _tmpl$4$3();
3430
+ var _el$2 = _tmpl$4$4();
3219
3431
  spread(_el$2, mergeProps(rest, {
3220
3432
  "data-scope": "list",
3221
3433
  "data-part": "content"
@@ -3911,7 +4123,7 @@ injectComponentStyle("progress");
3911
4123
  var _tmpl$$10 = /*#__PURE__*/ template(`<div data-scope=progress-group data-part=legend>`);
3912
4124
  var _tmpl$2$4 = /*#__PURE__*/ template(`<div><div data-scope=progress-group data-part=track>`);
3913
4125
  var _tmpl$3$4 = /*#__PURE__*/ template(`<div data-scope=progress-group data-part=segment role=progressbar aria-valuemin=0>`);
3914
- var _tmpl$4$2 = /*#__PURE__*/ template(`<div data-scope=progress-group data-part=legend-item><span data-scope=progress-group data-part=swatch aria-hidden=true></span><span data-scope=progress-group data-part=legend-label></span><span data-scope=progress-group data-part=legend-value>`);
4126
+ var _tmpl$4$3 = /*#__PURE__*/ template(`<div data-scope=progress-group data-part=legend-item><span data-scope=progress-group data-part=swatch aria-hidden=true></span><span data-scope=progress-group data-part=legend-label></span><span data-scope=progress-group data-part=legend-value>`);
3915
4127
  function ProgressGroup(props) {
3916
4128
  const [own, rest] = splitProps(props, [
3917
4129
  "segments",
@@ -3965,7 +4177,7 @@ function ProgressGroup(props) {
3965
4177
  return own.segments;
3966
4178
  },
3967
4179
  children: (segment, index) => (() => {
3968
- var _el$5 = _tmpl$4$2(), _el$7 = _el$5.firstChild.nextSibling, _el$8 = _el$7.nextSibling;
4180
+ var _el$5 = _tmpl$4$3(), _el$7 = _el$5.firstChild.nextSibling, _el$8 = _el$7.nextSibling;
3969
4181
  insert(_el$7, () => nameOf(segment, index()));
3970
4182
  insert(_el$8, () => String(segment.value));
3971
4183
  effect(() => setAttribute(_el$5, "data-pigment", segment.pigment));
@@ -4344,21 +4556,34 @@ const Switch = Switch$1;
4344
4556
  injectComponentStyle("switch");
4345
4557
  //#endregion
4346
4558
  //#region src/components/table/index.tsx
4347
- var _tmpl$$3 = /*#__PURE__*/ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2.5 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="m9 6 6 6-6 6">`);
4348
- var _tmpl$2$2 = /*#__PURE__*/ template(`<input type=checkbox>`);
4349
- var _tmpl$3$2 = /*#__PURE__*/ template(`<div data-scope=table data-part=cell-main><button type=button data-scope=table data-part=expander>`);
4350
- var _tmpl$4$1 = /*#__PURE__*/ template(`<div role=cell data-scope=table data-part=cell>`);
4351
- var _tmpl$5$1 = /*#__PURE__*/ template(`<div role=row data-scope=table data-part=row>`);
4352
- var _tmpl$6$1 = /*#__PURE__*/ template(`<div role=columnheader data-scope=table data-part=header-cell>`);
4353
- var _tmpl$7 = /*#__PURE__*/ template(`<input type=text data-scope=table data-part=header-filter placeholder=Filter>`);
4354
- var _tmpl$8 = /*#__PURE__*/ template(`<div data-scope=table data-part=root><div data-scope=table data-part=viewport><div role=table data-scope=table data-part=table><div role=rowgroup data-scope=table data-part=header></div><div role=rowgroup data-scope=table data-part=body>`);
4355
- var _tmpl$9 = /*#__PURE__*/ template(`<div data-scope=table data-part=toolbar><input type=search data-scope=table data-part=global-filter aria-label="Filter all columns">`);
4356
- var _tmpl$0 = /*#__PURE__*/ template(`<div role=columnheader data-scope=table data-part=header-cell><input type=checkbox>`);
4357
- var _tmpl$1 = /*#__PURE__*/ template(`<div data-scope=table data-part=empty>`);
4358
- var _tmpl$10 = /*#__PURE__*/ template(`<div role=rowgroup data-scope=table data-part=footer>`);
4359
- var _tmpl$11 = /*#__PURE__*/ template(`<div role=columnheader data-scope=table data-part=footer-cell>`);
4360
- var _tmpl$12 = /*#__PURE__*/ template(`<div data-scope=table data-part=pagination><button type=button data-scope=table data-part=page-button>Prev</button><button type=button data-scope=table data-part=page-button>Next</button><select data-scope=table data-part=page-size aria-label="Rows per page"></select><span data-scope=table data-part=page-status>`);
4361
- var _tmpl$13 = /*#__PURE__*/ template(`<option>`);
4559
+ var _tmpl$$3 = /*#__PURE__*/ template(`<svg viewBox="0 0 24 24"width=14 height=14 fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path>`);
4560
+ var _tmpl$2$2 = /*#__PURE__*/ template(`<svg viewBox="0 0 24 24"width=14 height=14 fill=none stroke=currentColor stroke-width=2.5 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="m6 9 6 6 6-6">`);
4561
+ var _tmpl$3$2 = /*#__PURE__*/ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2.5 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="m9 6 6 6-6 6">`);
4562
+ var _tmpl$4$2 = /*#__PURE__*/ template(`<input type=checkbox>`);
4563
+ var _tmpl$5$2 = /*#__PURE__*/ template(`<div data-scope=table data-part=cell-main><button type=button data-scope=table data-part=expander>`);
4564
+ var _tmpl$6$2 = /*#__PURE__*/ template(`<div role=cell data-scope=table data-part=cell>`);
4565
+ var _tmpl$7 = /*#__PURE__*/ template(`<div role=row data-scope=table data-part=row>`);
4566
+ var _tmpl$8 = /*#__PURE__*/ template(`<div role=columnheader data-scope=table data-part=header-cell>`);
4567
+ var _tmpl$9 = /*#__PURE__*/ template(`<input type=text data-scope=table data-part=header-filter placeholder=Filter>`);
4568
+ var _tmpl$0 = /*#__PURE__*/ template(`<div data-scope=table data-part=root><div data-scope=table data-part=viewport><div role=table data-scope=table data-part=table><div role=rowgroup data-scope=table data-part=header></div><div role=rowgroup data-scope=table data-part=body>`);
4569
+ var _tmpl$1 = /*#__PURE__*/ template(`<div data-scope=table data-part=toolbar><input type=search data-scope=table data-part=global-filter aria-label="Filter all columns">`);
4570
+ var _tmpl$10 = /*#__PURE__*/ template(`<div role=columnheader data-scope=table data-part=header-cell><input type=checkbox>`);
4571
+ var _tmpl$11 = /*#__PURE__*/ template(`<div data-scope=table data-part=empty>`);
4572
+ var _tmpl$12 = /*#__PURE__*/ template(`<div role=rowgroup data-scope=table data-part=footer>`);
4573
+ var _tmpl$13 = /*#__PURE__*/ template(`<div role=columnheader data-scope=table data-part=footer-cell>`);
4574
+ var _tmpl$14 = /*#__PURE__*/ template(`<div data-scope=table data-part=pagination><span data-scope=table data-part=page-status></span><div data-scope=table data-part=page-nav>`);
4575
+ /** The pagination bar's arrows — thin chevrons for the row of seals. */
4576
+ function pageGlyph(direction) {
4577
+ return (() => {
4578
+ var _el$ = _tmpl$$3(), _el$2 = _el$.firstChild;
4579
+ setAttribute(_el$2, "d", direction === "start" ? "m15 18-6-6 6-6" : "m9 18 6-6-6-6");
4580
+ return _el$;
4581
+ })();
4582
+ }
4583
+ /** The page-size select's pointing chevron. */
4584
+ function chevronDownGlyph() {
4585
+ return _tmpl$2$2();
4586
+ }
4362
4587
  const SELECT_COL_ID = "__select";
4363
4588
  const SELECT_COL_WIDTH = 48;
4364
4589
  /** The list holding `id` and the index inside it, or null when absent. */
@@ -4409,7 +4634,7 @@ function mark(el, attr, on) {
4409
4634
  if (on) el.setAttribute(attr, "");
4410
4635
  else el.removeAttribute(attr);
4411
4636
  }
4412
- const chevronGlyph = _tmpl$$3();
4637
+ const chevronGlyph = _tmpl$3$2();
4413
4638
  function DataTable(props) {
4414
4639
  if (props.virtual && props.merge) console.warn("[DataTable] `virtual` and `merge` are mutually exclusive; merge wins.");
4415
4640
  /** Features follow the construction-time switches: sorting, selection,
@@ -4717,26 +4942,26 @@ function DataTable(props) {
4717
4942
  };
4718
4943
  let content;
4719
4944
  if (column.id === SELECT_COL_ID) content = (() => {
4720
- var _el$2 = _tmpl$2$2();
4721
- spread(_el$2, mergeProps({ get checked() {
4945
+ var _el$5 = _tmpl$4$2();
4946
+ spread(_el$5, mergeProps({ get checked() {
4722
4947
  return row.getIsSelected();
4723
4948
  } }, { indeterminate: false }, {
4724
4949
  "aria-label": "Select row",
4725
4950
  "onchange": () => row.toggleSelected(!row.getIsSelected())
4726
4951
  }), false, false);
4727
- return _el$2;
4952
+ return _el$5;
4728
4953
  })();
4729
4954
  else if (isExpandHost) content = (() => {
4730
- var _el$3 = _tmpl$3$2(), _el$4 = _el$3.firstChild;
4731
- _el$4.$$click = () => row.toggleExpanded();
4732
- insert(_el$4, chevronGlyph);
4733
- insert(_el$3, createComponent(FlexRender, { cell }), null);
4955
+ var _el$6 = _tmpl$5$2(), _el$7 = _el$6.firstChild;
4956
+ _el$7.$$click = () => row.toggleExpanded();
4957
+ insert(_el$7, chevronGlyph);
4958
+ insert(_el$6, createComponent(FlexRender, { cell }), null);
4734
4959
  effect((_p$) => {
4735
4960
  var _v$ = String(row.depth), _v$2 = row.getIsExpanded() || void 0, _v$3 = !row.getCanExpand() || void 0, _v$4 = row.getIsExpanded() ? "Collapse row" : "Expand row";
4736
- _v$ !== _p$.e && setStyleProperty(_el$3, "--bs-table-depth", _p$.e = _v$);
4737
- _v$2 !== _p$.t && setAttribute(_el$4, "data-expanded", _p$.t = _v$2);
4738
- _v$3 !== _p$.a && setAttribute(_el$4, "data-leaf", _p$.a = _v$3);
4739
- _v$4 !== _p$.o && setAttribute(_el$4, "aria-label", _p$.o = _v$4);
4961
+ _v$ !== _p$.e && setStyleProperty(_el$6, "--bs-table-depth", _p$.e = _v$);
4962
+ _v$2 !== _p$.t && setAttribute(_el$7, "data-expanded", _p$.t = _v$2);
4963
+ _v$3 !== _p$.a && setAttribute(_el$7, "data-leaf", _p$.a = _v$3);
4964
+ _v$4 !== _p$.o && setAttribute(_el$7, "aria-label", _p$.o = _v$4);
4740
4965
  return _p$;
4741
4966
  }, {
4742
4967
  e: void 0,
@@ -4744,17 +4969,17 @@ function DataTable(props) {
4744
4969
  a: void 0,
4745
4970
  o: void 0
4746
4971
  });
4747
- return _el$3;
4972
+ return _el$6;
4748
4973
  })();
4749
4974
  else content = createComponent(FlexRender, { cell });
4750
4975
  return (() => {
4751
- var _el$5 = _tmpl$4$1();
4752
- setAttribute(_el$5, "data-spanned", rowSpan > 1 ? "" : void 0);
4753
- spread(_el$5, mergeProps({ get ["data-numeric"]() {
4976
+ var _el$8 = _tmpl$6$2();
4977
+ setAttribute(_el$8, "data-spanned", rowSpan > 1 ? "" : void 0);
4978
+ spread(_el$8, mergeProps({ get ["data-numeric"]() {
4754
4979
  return column.columnDef.meta?.numeric ? "" : void 0;
4755
4980
  } }, pin, { "style": style }), false, true);
4756
- insert(_el$5, content);
4757
- return _el$5;
4981
+ insert(_el$8, content);
4982
+ return _el$8;
4758
4983
  })();
4759
4984
  }
4760
4985
  function renderRow(row, virtualItem) {
@@ -4767,14 +4992,14 @@ function DataTable(props) {
4767
4992
  } : {};
4768
4993
  const draggable = rowDraggable();
4769
4994
  return (() => {
4770
- var _el$6 = _tmpl$5$1();
4771
- addEventListener(_el$6, "dragend", draggable ? onRowDragEnd : void 0);
4772
- addEventListener(_el$6, "drop", draggable ? (e) => onRowDrop(row, e) : void 0);
4773
- addEventListener(_el$6, "dragleave", draggable ? onRowDragLeave : void 0);
4774
- addEventListener(_el$6, "dragover", draggable ? (e) => onRowDragOver(row, e) : void 0);
4775
- addEventListener(_el$6, "dragstart", draggable ? (e) => onRowDragStart(row, e) : void 0);
4776
- setAttribute(_el$6, "draggable", draggable || void 0);
4777
- insert(_el$6, createComponent(For, {
4995
+ var _el$9 = _tmpl$7();
4996
+ addEventListener(_el$9, "dragend", draggable ? onRowDragEnd : void 0);
4997
+ addEventListener(_el$9, "drop", draggable ? (e) => onRowDrop(row, e) : void 0);
4998
+ addEventListener(_el$9, "dragleave", draggable ? onRowDragLeave : void 0);
4999
+ addEventListener(_el$9, "dragover", draggable ? (e) => onRowDragOver(row, e) : void 0);
5000
+ addEventListener(_el$9, "dragstart", draggable ? (e) => onRowDragStart(row, e) : void 0);
5001
+ setAttribute(_el$9, "draggable", draggable || void 0);
5002
+ insert(_el$9, createComponent(For, {
4778
5003
  get each() {
4779
5004
  return row.getVisibleCells();
4780
5005
  },
@@ -4782,14 +5007,14 @@ function DataTable(props) {
4782
5007
  }));
4783
5008
  effect((_p$) => {
4784
5009
  var _v$5 = row.getIsSelected() || void 0, _v$6 = style$1;
4785
- _v$5 !== _p$.e && setAttribute(_el$6, "data-selected", _p$.e = _v$5);
4786
- _p$.t = style(_el$6, _v$6, _p$.t);
5010
+ _v$5 !== _p$.e && setAttribute(_el$9, "data-selected", _p$.e = _v$5);
5011
+ _p$.t = style(_el$9, _v$6, _p$.t);
4787
5012
  return _p$;
4788
5013
  }, {
4789
5014
  e: void 0,
4790
5015
  t: void 0
4791
5016
  });
4792
- return _el$6;
5017
+ return _el$9;
4793
5018
  })();
4794
5019
  }
4795
5020
  function renderHeaderCell(header) {
@@ -4799,13 +5024,13 @@ function DataTable(props) {
4799
5024
  const canFilter = props.filterable && column.getCanFilter();
4800
5025
  const canDrag = !!props.reorderable && column.id !== SELECT_COL_ID && !column.getIsPinned();
4801
5026
  return (() => {
4802
- var _el$7 = _tmpl$6$1();
4803
- setAttribute(_el$7, "data-sortable", canSort || void 0);
4804
- setAttribute(_el$7, "data-sort", sorted || void 0);
4805
- setAttribute(_el$7, "data-draggable", canDrag || void 0);
4806
- setAttribute(_el$7, "draggable", canDrag || void 0);
4807
- setAttribute(_el$7, "aria-sort", sorted === "asc" ? "ascending" : sorted === "desc" ? "descending" : void 0);
4808
- spread(_el$7, mergeProps({
5027
+ var _el$0 = _tmpl$8();
5028
+ setAttribute(_el$0, "data-sortable", canSort || void 0);
5029
+ setAttribute(_el$0, "data-sort", sorted || void 0);
5030
+ setAttribute(_el$0, "data-draggable", canDrag || void 0);
5031
+ setAttribute(_el$0, "draggable", canDrag || void 0);
5032
+ setAttribute(_el$0, "aria-sort", sorted === "asc" ? "ascending" : sorted === "desc" ? "descending" : void 0);
5033
+ spread(_el$0, mergeProps({
4809
5034
  get ["data-numeric"]() {
4810
5035
  return column.columnDef.meta?.numeric ? "" : void 0;
4811
5036
  },
@@ -4820,43 +5045,43 @@ function DataTable(props) {
4820
5045
  "ondrop": canDrag ? (e) => onColDrop(column, e) : void 0,
4821
5046
  "ondragend": canDrag ? onColDragEnd : void 0
4822
5047
  }), false, true);
4823
- insert(_el$7, (() => {
4824
- var _c$ = memo(() => !!header.isPlaceholder);
5048
+ insert(_el$0, (() => {
5049
+ var _c$ = memo(() => !!(header.isPlaceholder || header.column.columnDef.header === ""));
4825
5050
  return () => _c$() ? null : createComponent(FlexRender, { header });
4826
5051
  })(), null);
4827
- insert(_el$7, canFilter ? (() => {
4828
- var _el$8 = _tmpl$7();
4829
- _el$8.$$input = (e) => column.setFilterValue(e.target.value);
4830
- _el$8.addEventListener("dragstart", (e) => e.stopPropagation());
4831
- _el$8.$$click = (e) => e.stopPropagation();
4832
- setAttribute(_el$8, "draggable", false);
4833
- effect(() => setAttribute(_el$8, "aria-label", `Filter ${column.id}`));
4834
- effect(() => _el$8.value = column.getFilterValue() ?? "");
4835
- return _el$8;
5052
+ insert(_el$0, canFilter ? (() => {
5053
+ var _el$1 = _tmpl$9();
5054
+ _el$1.$$input = (e) => column.setFilterValue(e.target.value);
5055
+ _el$1.addEventListener("dragstart", (e) => e.stopPropagation());
5056
+ _el$1.$$click = (e) => e.stopPropagation();
5057
+ setAttribute(_el$1, "draggable", false);
5058
+ effect(() => setAttribute(_el$1, "aria-label", `Filter ${column.id}`));
5059
+ effect(() => _el$1.value = column.getFilterValue() ?? "");
5060
+ return _el$1;
4836
5061
  })() : null, null);
4837
- return _el$7;
5062
+ return _el$0;
4838
5063
  })();
4839
5064
  }
4840
5065
  return (() => {
4841
- var _el$9 = _tmpl$8(), _el$0 = _el$9.firstChild, _el$1 = _el$0.firstChild, _el$10 = _el$1.firstChild, _el$11 = _el$10.nextSibling;
4842
- insert(_el$9, (() => {
4843
- var _c$2 = memo(() => !!props.filterable);
5066
+ var _el$10 = _tmpl$0(), _el$11 = _el$10.firstChild, _el$12 = _el$11.firstChild, _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling;
5067
+ insert(_el$10, (() => {
5068
+ var _c$2 = memo(() => !!(props.filterable && (props.showToolbar ?? true)));
4844
5069
  return () => _c$2() ? (() => {
4845
- var _el$12 = _tmpl$9(), _el$13 = _el$12.firstChild;
4846
- _el$13.$$input = (e) => table.setGlobalFilter(e.target.value);
4847
- effect(() => setAttribute(_el$13, "placeholder", props.globalFilterPlaceholder));
4848
- effect(() => _el$13.value = table.atoms.globalFilter.get() ?? "");
4849
- return _el$12;
5070
+ var _el$15 = _tmpl$1(), _el$16 = _el$15.firstChild;
5071
+ _el$16.$$input = (e) => table.setGlobalFilter(e.target.value);
5072
+ effect(() => setAttribute(_el$16, "placeholder", props.globalFilterPlaceholder));
5073
+ effect(() => _el$16.value = table.atoms.globalFilter.get() ?? "");
5074
+ return _el$15;
4850
5075
  })() : null;
4851
- })(), _el$0);
4852
- use(setViewport, _el$0);
4853
- insert(_el$10, createComponent(For, {
5076
+ })(), _el$11);
5077
+ use(setViewport, _el$11);
5078
+ insert(_el$13, createComponent(For, {
4854
5079
  get each() {
4855
5080
  return table.getHeaderGroups();
4856
5081
  },
4857
5082
  children: (group) => (() => {
4858
- var _el$14 = _tmpl$5$1();
4859
- insert(_el$14, createComponent(For, {
5083
+ var _el$17 = _tmpl$7();
5084
+ insert(_el$17, createComponent(For, {
4860
5085
  get each() {
4861
5086
  return group.headers;
4862
5087
  },
@@ -4865,21 +5090,21 @@ function DataTable(props) {
4865
5090
  if (column.id !== SELECT_COL_ID) return renderHeaderCell(header);
4866
5091
  const all = table.getIsAllRowsSelected();
4867
5092
  return (() => {
4868
- var _el$15 = _tmpl$0(), _el$16 = _el$15.firstChild;
4869
- spread(_el$15, mergeProps(() => pinAttrs(column)), false, true);
4870
- _el$16.checked = all;
4871
- spread(_el$16, mergeProps(() => ({ indeterminate: table.getIsSomeRowsSelected() && !all }), {
5093
+ var _el$18 = _tmpl$10(), _el$19 = _el$18.firstChild;
5094
+ spread(_el$18, mergeProps(() => pinAttrs(column)), false, true);
5095
+ _el$19.checked = all;
5096
+ spread(_el$19, mergeProps(() => ({ indeterminate: table.getIsSomeRowsSelected() && !all }), {
4872
5097
  "aria-label": "Select all rows",
4873
5098
  "onchange": () => table.toggleAllRowsSelected(!all)
4874
5099
  }), false, false);
4875
- return _el$15;
5100
+ return _el$18;
4876
5101
  })();
4877
5102
  }
4878
5103
  }));
4879
- return _el$14;
5104
+ return _el$17;
4880
5105
  })()
4881
5106
  }));
4882
- insert(_el$11, (() => {
5107
+ insert(_el$14, (() => {
4883
5108
  var _c$3 = memo(() => !!virtual());
4884
5109
  return () => _c$3() ? createComponent(For, {
4885
5110
  get each() {
@@ -4893,80 +5118,142 @@ function DataTable(props) {
4893
5118
  children: (row) => renderRow(row)
4894
5119
  });
4895
5120
  })(), null);
4896
- insert(_el$11, (() => {
5121
+ insert(_el$14, (() => {
4897
5122
  var _c$4 = memo(() => rows().length === 0);
4898
5123
  return () => _c$4() ? (() => {
4899
- var _el$17 = _tmpl$1();
4900
- insert(_el$17, () => props.emptyText);
4901
- return _el$17;
5124
+ var _el$20 = _tmpl$11();
5125
+ insert(_el$20, () => props.emptyText);
5126
+ return _el$20;
4902
5127
  })() : null;
4903
5128
  })(), null);
4904
- insert(_el$1, (() => {
5129
+ insert(_el$12, (() => {
4905
5130
  var _c$5 = memo(() => !!(props.stickyFooter && table.getFooterGroups().some((group) => group.headers.some((header) => header.column.columnDef.footer))));
4906
5131
  return () => _c$5() ? (() => {
4907
- var _el$18 = _tmpl$10();
4908
- insert(_el$18, createComponent(For, {
5132
+ var _el$21 = _tmpl$12();
5133
+ insert(_el$21, createComponent(For, {
4909
5134
  get each() {
4910
5135
  return table.getFooterGroups();
4911
5136
  },
4912
5137
  children: (group) => (() => {
4913
- var _el$19 = _tmpl$5$1();
4914
- insert(_el$19, createComponent(For, {
5138
+ var _el$22 = _tmpl$7();
5139
+ insert(_el$22, createComponent(For, {
4915
5140
  get each() {
4916
5141
  return group.headers;
4917
5142
  },
4918
5143
  children: (header) => (() => {
4919
- var _el$20 = _tmpl$11();
4920
- spread(_el$20, mergeProps({ get ["data-numeric"]() {
5144
+ var _el$23 = _tmpl$13();
5145
+ spread(_el$23, mergeProps({ get ["data-numeric"]() {
4921
5146
  return header.column.columnDef.meta?.numeric ? "" : void 0;
4922
5147
  } }, () => pinAttrs(header.column)), false, true);
4923
- insert(_el$20, (() => {
5148
+ insert(_el$23, (() => {
4924
5149
  var _c$7 = memo(() => !!header.isPlaceholder);
4925
5150
  return () => _c$7() ? null : createComponent(FlexRender, { footer: header });
4926
5151
  })());
4927
- return _el$20;
5152
+ return _el$23;
4928
5153
  })()
4929
5154
  }));
4930
- return _el$19;
5155
+ return _el$22;
4931
5156
  })()
4932
5157
  }));
4933
- return _el$18;
5158
+ return _el$21;
4934
5159
  })() : null;
4935
5160
  })(), null);
4936
- insert(_el$9, (() => {
5161
+ insert(_el$10, (() => {
4937
5162
  var _c$6 = memo(() => !!props.paginated);
4938
5163
  return () => _c$6() ? (() => {
4939
- var _el$21 = _tmpl$12(), _el$22 = _el$21.firstChild, _el$23 = _el$22.nextSibling, _el$24 = _el$23.nextSibling, _el$25 = _el$24.nextSibling;
4940
- _el$22.$$click = () => table.previousPage();
4941
- _el$23.$$click = () => table.nextPage();
4942
- _el$24.addEventListener("change", (e) => table.setPageSize(Number(e.target.value)));
4943
- insert(_el$24, createComponent(For, {
4944
- get each() {
4945
- return props.pageSizeOptions ?? [
5164
+ var _el$24 = _tmpl$14(), _el$25 = _el$24.firstChild, _el$26 = _el$25.nextSibling;
5165
+ insert(_el$25, () => `${table.getRowCount()} rows`);
5166
+ insert(_el$26, createComponent(Select.Root, {
5167
+ get collection() {
5168
+ return createListCollection({ items: (props.pageSizeOptions ?? [
4946
5169
  10,
4947
5170
  20,
4948
5171
  50
4949
- ];
5172
+ ]).map((size) => ({
5173
+ label: `${size} / page`,
5174
+ value: String(size)
5175
+ })) });
4950
5176
  },
4951
- children: (size) => (() => {
4952
- var _el$26 = _tmpl$13();
4953
- _el$26.value = size;
4954
- insert(_el$26, `${size} / page`);
4955
- return _el$26;
4956
- })()
4957
- }));
4958
- insert(_el$25, () => `Page ${table.atoms.pagination.get().pageIndex + 1} of ${table.getPageCount()} · ${table.getRowCount()} rows`);
4959
- effect((_p$) => {
4960
- var _v$10 = !table.getCanPreviousPage(), _v$11 = !table.getCanNextPage();
4961
- _v$10 !== _p$.e && (_el$22.disabled = _p$.e = _v$10);
4962
- _v$11 !== _p$.t && (_el$23.disabled = _p$.t = _v$11);
4963
- return _p$;
4964
- }, {
4965
- e: void 0,
4966
- t: void 0
4967
- });
4968
- effect(() => _el$24.value = table.atoms.pagination.get().pageSize);
4969
- return _el$21;
5177
+ get value() {
5178
+ return [String(table.atoms.pagination.get().pageSize)];
5179
+ },
5180
+ onValueChange: (details) => table.setPageSize(Number(details.value[0])),
5181
+ positioning: { placement: "top-start" },
5182
+ get children() {
5183
+ return [createComponent(Select.Control, { get children() {
5184
+ return createComponent(Select.Trigger, {
5185
+ "aria-label": "Rows per page",
5186
+ get children() {
5187
+ return [createComponent(Select.ValueText, {}), createComponent(Select.Indicator, { get children() {
5188
+ return chevronDownGlyph();
5189
+ } })];
5190
+ }
5191
+ });
5192
+ } }), createComponent(Select.Positioner, { get children() {
5193
+ return createComponent(Select.Content, { get children() {
5194
+ return createComponent(For, {
5195
+ get each() {
5196
+ return (props.pageSizeOptions ?? [
5197
+ 10,
5198
+ 20,
5199
+ 50
5200
+ ]).map((size) => ({
5201
+ label: `${size} / page`,
5202
+ value: String(size)
5203
+ }));
5204
+ },
5205
+ children: (item) => createComponent(Select.Item, {
5206
+ item,
5207
+ get children() {
5208
+ return [createComponent(Select.ItemText, { get children() {
5209
+ return item.label;
5210
+ } }), createComponent(Select.ItemIndicator, { children: "✓" })];
5211
+ }
5212
+ })
5213
+ });
5214
+ } });
5215
+ } })];
5216
+ }
5217
+ }), null);
5218
+ insert(_el$26, createComponent(Pagination.Root, {
5219
+ get count() {
5220
+ return table.getRowCount();
5221
+ },
5222
+ get pageSize() {
5223
+ return table.atoms.pagination.get().pageSize;
5224
+ },
5225
+ get page() {
5226
+ return table.atoms.pagination.get().pageIndex + 1;
5227
+ },
5228
+ onPageChange: (details) => table.setPageIndex(details.page - 1),
5229
+ get children() {
5230
+ return [
5231
+ createComponent(Pagination.PrevTrigger, { get children() {
5232
+ return pageGlyph("start");
5233
+ } }),
5234
+ createComponent(Pagination.Context, { children: (scope) => createComponent(For, {
5235
+ get each() {
5236
+ return scope().pages;
5237
+ },
5238
+ children: (page, index) => page.type === "ellipsis" ? createComponent(Pagination.Ellipsis, { get index() {
5239
+ return index();
5240
+ } }) : createComponent(Pagination.Item, {
5241
+ type: "page",
5242
+ get value() {
5243
+ return page.value;
5244
+ },
5245
+ get children() {
5246
+ return String(page.value);
5247
+ }
5248
+ })
5249
+ }) }),
5250
+ createComponent(Pagination.NextTrigger, { get children() {
5251
+ return pageGlyph("end");
5252
+ } })
5253
+ ];
5254
+ }
5255
+ }), null);
5256
+ return _el$24;
4970
5257
  })() : null;
4971
5258
  })(), null);
4972
5259
  effect((_p$) => {
@@ -4974,11 +5261,11 @@ function DataTable(props) {
4974
5261
  position: "relative",
4975
5262
  "block-size": `${virtualizer.getTotalSize()}px`
4976
5263
  } : void 0;
4977
- _v$7 !== _p$.e && setAttribute(_el$9, "data-reorderable", _p$.e = _v$7);
4978
- _v$8 !== _p$.t && setStyleProperty(_el$9, "--bs-table-row-height", _p$.t = _v$8);
4979
- _v$9 !== _p$.a && setStyleProperty(_el$1, "--bs-table-cols", _p$.a = _v$9);
4980
- _v$0 !== _p$.o && setAttribute(_el$11, "data-merge", _p$.o = _v$0);
4981
- _p$.i = style(_el$11, _v$1, _p$.i);
5264
+ _v$7 !== _p$.e && setAttribute(_el$10, "data-reorderable", _p$.e = _v$7);
5265
+ _v$8 !== _p$.t && setStyleProperty(_el$10, "--bs-table-row-height", _p$.t = _v$8);
5266
+ _v$9 !== _p$.a && setStyleProperty(_el$12, "--bs-table-cols", _p$.a = _v$9);
5267
+ _v$0 !== _p$.o && setAttribute(_el$14, "data-merge", _p$.o = _v$0);
5268
+ _p$.i = style(_el$14, _v$1, _p$.i);
4982
5269
  return _p$;
4983
5270
  }, {
4984
5271
  e: void 0,
@@ -4987,7 +5274,7 @@ function DataTable(props) {
4987
5274
  o: void 0,
4988
5275
  i: void 0
4989
5276
  });
4990
- return _el$9;
5277
+ return _el$10;
4991
5278
  })();
4992
5279
  }
4993
5280
  injectComponentStyle("table");
@@ -5112,9 +5399,9 @@ injectComponentStyle("toggle-group");
5112
5399
  var _tmpl$$2 = /*#__PURE__*/ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=3 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="m5 12.5 5 5L19 7">`);
5113
5400
  var _tmpl$2$1 = /*#__PURE__*/ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.75 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path>`);
5114
5401
  var _tmpl$3$1 = /*#__PURE__*/ template(`<div data-scope=transfer data-part=search>`);
5115
- var _tmpl$4 = /*#__PURE__*/ template(`<div data-scope=transfer data-part=panel><div data-scope=transfer data-part=head><span data-scope=transfer data-part=title></span><span data-scope=transfer data-part=count></span></div><div data-scope=transfer data-part=list>`);
5116
- var _tmpl$5 = /*#__PURE__*/ template(`<p data-scope=transfer data-part=empty>Nothing here`);
5117
- var _tmpl$6 = /*#__PURE__*/ template(`<div><div data-scope=transfer data-part=operations>`);
5402
+ var _tmpl$4$1 = /*#__PURE__*/ template(`<div data-scope=transfer data-part=panel><div data-scope=transfer data-part=head><span data-scope=transfer data-part=title></span><span data-scope=transfer data-part=count></span></div><div data-scope=transfer data-part=list>`);
5403
+ var _tmpl$5$1 = /*#__PURE__*/ template(`<p data-scope=transfer data-part=empty>Nothing here`);
5404
+ var _tmpl$6$1 = /*#__PURE__*/ template(`<div><div data-scope=transfer data-part=operations>`);
5118
5405
  function checkGlyph() {
5119
5406
  return _tmpl$$2();
5120
5407
  }
@@ -5164,7 +5451,7 @@ function Transfer(props) {
5164
5451
  }
5165
5452
  function panel(side, title, query, setQuery, checked, setChecked, items) {
5166
5453
  return (() => {
5167
- var _el$4 = _tmpl$4(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling, _el$9 = _el$5.nextSibling;
5454
+ var _el$4 = _tmpl$4$1(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling, _el$9 = _el$5.nextSibling;
5168
5455
  setAttribute(_el$4, "data-side", side);
5169
5456
  insert(_el$6, title);
5170
5457
  insert(_el$7, () => String(items.length));
@@ -5191,7 +5478,7 @@ function Transfer(props) {
5191
5478
  return items.length > 0;
5192
5479
  },
5193
5480
  get fallback() {
5194
- return _tmpl$5();
5481
+ return _tmpl$5$1();
5195
5482
  },
5196
5483
  get children() {
5197
5484
  return createComponent(For, {
@@ -5228,7 +5515,7 @@ function Transfer(props) {
5228
5515
  })();
5229
5516
  }
5230
5517
  return (() => {
5231
- var _el$1 = _tmpl$6(), _el$10 = _el$1.firstChild;
5518
+ var _el$1 = _tmpl$6$1(), _el$10 = _el$1.firstChild;
5232
5519
  spread(_el$1, mergeProps(rest, {
5233
5520
  "data-scope": "transfer",
5234
5521
  "data-part": "root"
@@ -5287,7 +5574,10 @@ injectComponentStyle("tour");
5287
5574
  //#region src/components/tree-select/index.tsx
5288
5575
  var _tmpl$$1 = /*#__PURE__*/ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="m9 18 6-6-6-6">`);
5289
5576
  var _tmpl$2 = /*#__PURE__*/ template(`<span>`);
5290
- var _tmpl$3 = /*#__PURE__*/ template(`<button><span data-part=chevron aria-hidden=true>`);
5577
+ var _tmpl$3 = /*#__PURE__*/ template(`<div data-scope=tree-select data-part=search>`);
5578
+ var _tmpl$4 = /*#__PURE__*/ template(`<div data-scope=tree-select data-part=body>`);
5579
+ var _tmpl$5 = /*#__PURE__*/ template(`<button><span data-part=chevron aria-hidden=true>`);
5580
+ var _tmpl$6 = /*#__PURE__*/ template(`<p data-scope=tree-select data-part=empty>Nothing matches`);
5291
5581
  function chevron() {
5292
5582
  return _tmpl$$1();
5293
5583
  }
@@ -5295,17 +5585,21 @@ function chevron() {
5295
5585
  * A tree behind a field: the control reads like an input, the vessel
5296
5586
  * below walks the hierarchy, and one leaf click closes the deal. Single
5297
5587
  * selection — the chosen label rides on the control, its value rides in
5298
- * `value`.
5588
+ * `value`. `filterable` puts a filter line at the top of the vessel;
5589
+ * matches keep their ancestors and the branches fan open.
5299
5590
  */
5300
5591
  function TreeSelect(props) {
5301
5592
  const [own, rest] = splitProps(props, [
5302
5593
  "value",
5303
5594
  "data",
5304
5595
  "placeholder",
5596
+ "filterable",
5305
5597
  "disabled",
5306
5598
  "onValueChange"
5307
5599
  ]);
5308
5600
  const [open, setOpen] = createSignal(false);
5601
+ const [query, setQuery] = createSignal("");
5602
+ const filterFns = useFilter({ sensitivity: "base" });
5309
5603
  const collection = createMemo(() => createTreeCollection$1({
5310
5604
  nodeToValue: (node) => node.value,
5311
5605
  nodeToString: (node) => node.label,
@@ -5315,7 +5609,23 @@ function TreeSelect(props) {
5315
5609
  children: own.data
5316
5610
  }
5317
5611
  }));
5612
+ const filtering = () => own.filterable && query().trim().length > 0;
5613
+ /** The collection pruned to the matches — each hit keeping its
5614
+ * ancestors, so a deep match still reads inside its hierarchy. */
5615
+ const visibleCollection = createMemo(() => filtering() ? collection().filter((node) => filterFns().contains(node.label, query().trim())) : collection());
5318
5616
  const firstLevel = () => (own.data ?? []).map((node) => node.value);
5617
+ const expandedWhileFiltering = () => {
5618
+ if (!filtering()) return void 0;
5619
+ const values = [];
5620
+ const walk = (nodes) => {
5621
+ for (const node of nodes) if (node.children?.length) {
5622
+ values.push(node.value);
5623
+ walk(node.children);
5624
+ }
5625
+ };
5626
+ walk(visibleCollection().rootNode.children ?? []);
5627
+ return values;
5628
+ };
5319
5629
  const label = () => {
5320
5630
  let found;
5321
5631
  const walk = (nodes) => {
@@ -5390,15 +5700,18 @@ function TreeSelect(props) {
5390
5700
  get open() {
5391
5701
  return open();
5392
5702
  },
5393
- onOpenChange: (details) => setOpen(details.open),
5703
+ onOpenChange: (details) => {
5704
+ setOpen(details.open);
5705
+ if (!details.open) setQuery("");
5706
+ },
5394
5707
  positioning: {
5395
5708
  sameWidth: true,
5396
5709
  placement: "bottom-start"
5397
5710
  },
5398
5711
  get children() {
5399
5712
  return [createComponent(Popover$1.Trigger, { asChild: (propsFn) => (() => {
5400
- var _el$3 = _tmpl$3(), _el$4 = _el$3.firstChild;
5401
- spread(_el$3, mergeProps(propsFn, {
5713
+ var _el$5 = _tmpl$5(), _el$6 = _el$5.firstChild;
5714
+ spread(_el$5, mergeProps(propsFn, {
5402
5715
  "type": "button",
5403
5716
  "data-scope": "tree-select",
5404
5717
  "data-part": "control",
@@ -5412,43 +5725,72 @@ function TreeSelect(props) {
5412
5725
  return own.disabled;
5413
5726
  }
5414
5727
  }), false, true);
5415
- insert(_el$3, () => label() ?? own.placeholder ?? "Select…", _el$4);
5416
- insert(_el$4, chevron);
5417
- return _el$3;
5728
+ insert(_el$5, () => label() ?? own.placeholder ?? "Select…", _el$6);
5729
+ insert(_el$6, chevron);
5730
+ return _el$5;
5418
5731
  })() }), createComponent(Portal, { get children() {
5419
5732
  return createComponent(Popover$1.Positioner, { get children() {
5420
5733
  return createComponent(Popover$1.Content, {
5421
5734
  "data-scope": "tree-select",
5422
5735
  "data-part": "content",
5423
5736
  get children() {
5424
- return createComponent(TreeView$1.Root, {
5425
- get collection() {
5426
- return collection();
5737
+ return [createComponent(Show, {
5738
+ get when() {
5739
+ return own.filterable;
5427
5740
  },
5428
- selectionMode: "single",
5429
- get selectedValue() {
5430
- return memo(() => !!own.value)() ? [own.value] : [];
5431
- },
5432
- get defaultExpandedValue() {
5433
- return firstLevel();
5434
- },
5435
- onSelectionChange: pick,
5436
5741
  get children() {
5437
- return createComponent(TreeView$1.Tree, { get children() {
5438
- return createComponent(For, {
5439
- get each() {
5440
- return collection().rootNode.children;
5441
- },
5442
- children: (node, index) => createComponent(Row, {
5443
- node,
5444
- get indexPath() {
5445
- return [index()];
5446
- }
5447
- })
5448
- });
5449
- } });
5742
+ var _el$3 = _tmpl$3();
5743
+ insert(_el$3, createComponent(Input, {
5744
+ size: "sm",
5745
+ get value() {
5746
+ return query();
5747
+ },
5748
+ onValueChange: setQuery,
5749
+ placeholder: "Filter…",
5750
+ "aria-label": "Filter options"
5751
+ }));
5752
+ return _el$3;
5450
5753
  }
5451
- });
5754
+ }), (() => {
5755
+ var _el$4 = _tmpl$4();
5756
+ insert(_el$4, createComponent(Show, {
5757
+ get when() {
5758
+ return (visibleCollection().rootNode.children ?? []).length > 0;
5759
+ },
5760
+ get fallback() {
5761
+ return _tmpl$6();
5762
+ },
5763
+ get children() {
5764
+ return createComponent(TreeView$1.Root, mergeProps({
5765
+ get collection() {
5766
+ return visibleCollection();
5767
+ },
5768
+ selectionMode: "single",
5769
+ get selectedValue() {
5770
+ return memo(() => !!own.value)() ? [own.value] : [];
5771
+ }
5772
+ }, () => filtering() ? { expandedValue: expandedWhileFiltering() } : { defaultExpandedValue: firstLevel() }, {
5773
+ onSelectionChange: pick,
5774
+ get children() {
5775
+ return createComponent(TreeView$1.Tree, { get children() {
5776
+ return createComponent(For, {
5777
+ get each() {
5778
+ return visibleCollection().rootNode.children;
5779
+ },
5780
+ children: (node, index) => createComponent(Row, {
5781
+ node,
5782
+ get indexPath() {
5783
+ return [index()];
5784
+ }
5785
+ })
5786
+ });
5787
+ } });
5788
+ }
5789
+ }));
5790
+ }
5791
+ }));
5792
+ return _el$4;
5793
+ })()];
5452
5794
  }
5453
5795
  });
5454
5796
  } });