@adea-ai/ui 0.82.1 → 0.83.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 (70) hide show
  1. package/dist/components/composites/appearance-editor/appearance-choices.d.ts.map +1 -1
  2. package/dist/components/composites/appearance-editor/appearance-choices.js +3 -3
  3. package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
  4. package/dist/components/composites/appearance-editor/appearance-rows.d.ts.map +1 -1
  5. package/dist/components/composites/appearance-editor/appearance-rows.js +13 -2
  6. package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
  7. package/dist/components/layout/orbit-layout/index.d.ts +3 -0
  8. package/dist/components/layout/orbit-layout/index.d.ts.map +1 -0
  9. package/dist/components/layout/orbit-layout/index.js +2 -0
  10. package/dist/components/layout/orbit-layout/orbit-layout.d.ts +38 -0
  11. package/dist/components/layout/orbit-layout/orbit-layout.d.ts.map +1 -0
  12. package/dist/components/layout/orbit-layout/orbit-layout.js +83 -0
  13. package/dist/components/layout/orbit-layout/orbit-layout.js.map +1 -0
  14. package/dist/components/layout/side-rail/side-rail.d.ts +1 -0
  15. package/dist/components/layout/side-rail/side-rail.d.ts.map +1 -1
  16. package/dist/components/layout/side-rail/side-rail.js +6 -2
  17. package/dist/components/layout/side-rail/side-rail.js.map +1 -1
  18. package/dist/components/layout/virtual-window/index.d.ts +3 -0
  19. package/dist/components/layout/virtual-window/index.d.ts.map +1 -0
  20. package/dist/components/layout/virtual-window/index.js +2 -0
  21. package/dist/components/layout/virtual-window/virtual-window.d.ts +22 -0
  22. package/dist/components/layout/virtual-window/virtual-window.d.ts.map +1 -0
  23. package/dist/components/layout/virtual-window/virtual-window.js +45 -0
  24. package/dist/components/layout/virtual-window/virtual-window.js.map +1 -0
  25. package/dist/components/ui/command/command.d.ts +5 -6
  26. package/dist/components/ui/command/command.d.ts.map +1 -1
  27. package/dist/components/ui/command/command.js +73 -15
  28. package/dist/components/ui/command/command.js.map +1 -1
  29. package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +3 -0
  30. package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts.map +1 -1
  31. package/dist/components/ui/dropdown-menu/dropdown-menu.js +7 -1
  32. package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
  33. package/dist/components/ui/status-chip/status-chip.d.ts +2 -0
  34. package/dist/components/ui/status-chip/status-chip.d.ts.map +1 -1
  35. package/dist/components/ui/status-chip/status-chip.js +26 -17
  36. package/dist/components/ui/status-chip/status-chip.js.map +1 -1
  37. package/dist/index.d.ts +2 -0
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +4 -2
  40. package/dist/lib/overlay.js +1 -1
  41. package/dist/lib/overlay.js.map +1 -1
  42. package/dist/r/command.json +2 -0
  43. package/dist/r/orbit-layout.json +22 -0
  44. package/dist/r/registry.json +46 -0
  45. package/dist/r/src/components/composites/appearance-editor/appearance-choices.tsx +3 -5
  46. package/dist/r/src/components/composites/appearance-editor/appearance-rows.tsx +9 -3
  47. package/dist/r/src/components/layout/orbit-layout/index.ts +8 -0
  48. package/dist/r/src/components/layout/orbit-layout/orbit-layout.tsx +112 -0
  49. package/dist/r/src/components/layout/side-rail/side-rail.tsx +8 -3
  50. package/dist/r/src/components/layout/virtual-window/index.ts +2 -0
  51. package/dist/r/src/components/layout/virtual-window/virtual-window.tsx +55 -0
  52. package/dist/r/src/components/ui/command/command.tsx +81 -29
  53. package/dist/r/src/components/ui/dropdown-menu/dropdown-menu.tsx +5 -1
  54. package/dist/r/src/components/ui/status-chip/status-chip.tsx +11 -2
  55. package/dist/r/src/lib/overlay.ts +1 -1
  56. package/dist/r/virtual-window.json +22 -0
  57. package/package.json +1 -1
  58. package/registry.json +46 -0
  59. package/src/components/composites/appearance-editor/appearance-choices.tsx +3 -5
  60. package/src/components/composites/appearance-editor/appearance-rows.tsx +9 -3
  61. package/src/components/layout/orbit-layout/index.ts +8 -0
  62. package/src/components/layout/orbit-layout/orbit-layout.tsx +112 -0
  63. package/src/components/layout/side-rail/side-rail.tsx +8 -3
  64. package/src/components/layout/virtual-window/index.ts +2 -0
  65. package/src/components/layout/virtual-window/virtual-window.tsx +55 -0
  66. package/src/components/ui/command/command.tsx +81 -29
  67. package/src/components/ui/dropdown-menu/dropdown-menu.tsx +5 -1
  68. package/src/components/ui/status-chip/status-chip.tsx +11 -2
  69. package/src/index.ts +2 -0
  70. package/src/lib/overlay.ts +1 -1
@@ -0,0 +1,22 @@
1
+ import type { ComponentProps, JSX } from 'solid-js';
2
+ /**
3
+ * VirtualWindow.
4
+ *
5
+ * Supplies the two geometry wrappers a virtualized viewport needs: a full-height
6
+ * scroll space and a translated window containing the mounted rows. The caller
7
+ * owns the scroll region, its semantics, keyboard model, and range calculation;
8
+ * this component only keeps those rows at their measured position.
9
+ */
10
+ export type VirtualWindowProps = Omit<ComponentProps<'div'>, 'children' | 'style'> & {
11
+ /** JSX style props are owned by this geometry primitive. */
12
+ style?: never;
13
+ /** The full scrollable height, in pixels. */
14
+ totalSize: number;
15
+ /** The mounted window's top offset from the start of the full list, in pixels. */
16
+ offset?: number;
17
+ /** Optional layout classes for the translated row container. */
18
+ contentClass?: string;
19
+ children?: JSX.Element;
20
+ };
21
+ export declare function VirtualWindow(props: VirtualWindowProps): JSX.Element;
22
+ //# sourceMappingURL=virtual-window.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"virtual-window.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/virtual-window/virtual-window.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAInD;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG;IACnF,4DAA4D;IAC5D,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAA;IACjB,kFAAkF;IAClF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,gEAAgE;IAChE,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CACvB,CAAA;AAMD,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,eA0BtD"}
@@ -0,0 +1,45 @@
1
+ import { cn } from "../../../lib/utils.js";
2
+ import { className, effect, insert, mergeProps, setStyleProperty, spread, template } from "solid-js/web";
3
+ import { splitProps } from "solid-js";
4
+ //#region src/components/layout/virtual-window/virtual-window.tsx
5
+ var _tmpl$ = /*#__PURE__*/ template(`<div><div data-slot=virtual-window-content>`);
6
+ function finitePixels(value) {
7
+ return `${Number.isFinite(value) ? value : 0}px`;
8
+ }
9
+ function VirtualWindow(props) {
10
+ const [local, rest] = splitProps(props, [
11
+ "class",
12
+ "children",
13
+ "totalSize",
14
+ "offset",
15
+ "contentClass",
16
+ "style"
17
+ ]);
18
+ return (() => {
19
+ var _el$ = _tmpl$(), _el$2 = _el$.firstChild;
20
+ spread(_el$, mergeProps(rest, {
21
+ "data-slot": "virtual-window-space",
22
+ get ["class"]() {
23
+ return cn("relative", local.class);
24
+ },
25
+ get style() {
26
+ return { height: finitePixels(Math.max(0, local.totalSize)) };
27
+ }
28
+ }), false, true);
29
+ insert(_el$2, () => local.children);
30
+ effect((_p$) => {
31
+ var _v$ = local.contentClass, _v$2 = `translateY(${finitePixels(local.offset ?? 0)})`;
32
+ _v$ !== _p$.e && className(_el$2, _p$.e = _v$);
33
+ _v$2 !== _p$.t && setStyleProperty(_el$2, "transform", _p$.t = _v$2);
34
+ return _p$;
35
+ }, {
36
+ e: void 0,
37
+ t: void 0
38
+ });
39
+ return _el$;
40
+ })();
41
+ }
42
+ //#endregion
43
+ export { VirtualWindow };
44
+
45
+ //# sourceMappingURL=virtual-window.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"virtual-window.js","names":["ComponentProps","JSX","splitProps","cn","VirtualWindowProps","Omit","style","totalSize","offset","contentClass","children","Element","finitePixels","value","Number","isFinite","VirtualWindow","props","local","rest","_el$","_tmpl$","_el$2","firstChild","_$spread","_$mergeProps","class","height","Math","max","_$insert","_$effect","_p$","_v$","_v$2","e","_$className","t","_$setStyleProperty","undefined","_$mergeProps","_$className","_$setStyleProperty"],"sources":["../../../../src/components/layout/virtual-window/virtual-window.tsx"],"sourcesContent":["import type { ComponentProps, JSX } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * VirtualWindow.\n *\n * Supplies the two geometry wrappers a virtualized viewport needs: a full-height\n * scroll space and a translated window containing the mounted rows. The caller\n * owns the scroll region, its semantics, keyboard model, and range calculation;\n * this component only keeps those rows at their measured position.\n */\nexport type VirtualWindowProps = Omit<ComponentProps<'div'>, 'children' | 'style'> & {\n /** JSX style props are owned by this geometry primitive. */\n style?: never\n /** The full scrollable height, in pixels. */\n totalSize: number\n /** The mounted window's top offset from the start of the full list, in pixels. */\n offset?: number\n /** Optional layout classes for the translated row container. */\n contentClass?: string\n children?: JSX.Element\n}\n\nfunction finitePixels(value: number): string {\n return `${Number.isFinite(value) ? value : 0}px`\n}\n\nexport function VirtualWindow(props: VirtualWindowProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'children',\n 'totalSize',\n 'offset',\n 'contentClass',\n 'style',\n ])\n\n return (\n <div\n {...rest}\n data-slot=\"virtual-window-space\"\n class={cn('relative', local.class)}\n style={{ height: finitePixels(Math.max(0, local.totalSize)) }}\n >\n <div\n data-slot=\"virtual-window-content\"\n class={local.contentClass}\n style={{ transform: `translateY(${finitePixels(local.offset ?? 0)})` }}\n >\n {local.children}\n </div>\n </div>\n )\n}\n"],"mappings":";;;;;AAwBA,SAASY,aAAaC,OAAuB;CAC3C,OAAO,GAAGC,OAAOC,SAASF,KAAK,IAAIA,QAAQ,EAAC;AAC9C;AAEA,SAAgBG,cAAcC,OAA2B;CACvD,MAAM,CAACC,OAAOC,QAAQjB,WAAWe,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;CAAO,CACR;CAED,cAAA;EAAA,IAAAG,OAAAC,OAAA,GAAAC,QAAAF,KAAAG;EAAAC,OAAAJ,MAAAK,WAEQN,MAAI;GAAA,aACE;GAAsB,KAAA,WAAA;IAAA,OACzBhB,GAAG,YAAYe,MAAMQ,KAAK;GAAC;GAAA,IAClCpB,QAAK;IAAA,OAAE,EAAEqB,QAAQf,aAAagB,KAAKC,IAAI,GAAGX,MAAMX,SAAS,CAAC,EAAE;GAAC;EAAA,CAAA,GAAA,OAAA,IAAA;EAAAuB,OAAAR,aAO1DJ,MAAMR,QAAQ;EAAAqB,QAAAC,QAAA;GAAA,IAAAC,MAHRf,MAAMT,cAAYyB,OACL,cAActB,aAAaM,MAAMV,UAAU,CAAC,EAAC;GAAGyB,QAAAD,IAAAG,KAAAC,UAAAd,OAAAU,IAAAG,IAAAF,GAAA;GAAAC,SAAAF,IAAAK,KAAAC,iBAAAhB,OAAA,aAAAU,IAAAK,IAAAH,IAAA;GAAA,OAAAF;EAAA,GAAA;GAAAG,GAAAI,KAAAA;GAAAF,GAAAE,KAAAA;EAAA,CAAA;EAAA,OAAAnB;CAAA,EAAA,CAAA;AAM5E"}
@@ -1,4 +1,5 @@
1
1
  import { CommandDialog as CmdkDialog, CommandEmpty as CmdkEmpty, CommandGroup as CmdkGroup, CommandInput as CmdkInput, CommandItem as CmdkItem, CommandList as CmdkList, CommandLoading as CmdkLoading, CommandRoot as CmdkRoot, CommandSeparator as CmdkSeparator } from 'cmdk-solid';
2
+ import { Dialog as KobalteDialog } from '@kobalte/core/dialog';
2
3
  import type { ComponentProps } from 'solid-js';
3
4
  /**
4
5
  * Command.
@@ -17,7 +18,8 @@ import type { ComponentProps } from 'solid-js';
17
18
  * wiring and the arrow-key navigation.
18
19
  */
19
20
  export declare function Command(props: ComponentProps<typeof CmdkRoot>): import("solid-js").JSX.Element;
20
- export declare function CommandDialog(props: ComponentProps<typeof CmdkDialog>): import("solid-js").JSX.Element;
21
+ type CommandDialogProps = ComponentProps<typeof CmdkDialog> & Pick<ComponentProps<typeof KobalteDialog.Content>, 'onCloseAutoFocus' | 'onOpenAutoFocus'>;
22
+ export declare function CommandDialog(props: CommandDialogProps): import("solid-js").JSX.Element;
21
23
  export declare function CommandInput(props: ComponentProps<typeof CmdkInput>): import("solid-js").JSX.Element;
22
24
  /**
23
25
  * The scrolling list.
@@ -45,13 +47,10 @@ export declare function CommandGroup(props: ComponentProps<typeof CmdkGroup>): i
45
47
  export declare function CommandItem(props: ComponentProps<typeof CmdkItem>): import("solid-js").JSX.Element;
46
48
  export declare function CommandSeparator(props: ComponentProps<typeof CmdkSeparator>): import("solid-js").JSX.Element;
47
49
  export declare function CommandLoading(props: ComponentProps<typeof CmdkLoading>): import("solid-js").JSX.Element;
48
- /**
49
- * The keyboard hint a palette item usually carries.
50
- * Muted canvas text can fail contrast on a raised or selected command row;
51
- * hierarchy comes from its size and monospace face, with the row's readable ink.
52
- */
50
+ /** The keyboard hint a palette item usually carries. */
53
51
  export declare function CommandShortcut(props: {
54
52
  class?: string;
55
53
  children?: ComponentProps<'span'>['children'];
56
54
  }): import("solid-js").JSX.Element;
55
+ export {};
57
56
  //# sourceMappingURL=command.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/command/command.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,IAAI,UAAU,EAC3B,YAAY,IAAI,SAAS,EACzB,YAAY,IAAI,SAAS,EACzB,YAAY,IAAI,SAAS,EACzB,WAAW,IAAI,QAAQ,EACvB,WAAW,IAAI,QAAQ,EACvB,cAAc,IAAI,WAAW,EAC7B,WAAW,IAAI,QAAQ,EACvB,gBAAgB,IAAI,aAAa,EAElC,MAAM,YAAY,CAAA;AAEnB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAW9C;;;;;;;;;;;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cn } from "../../../lib/utils.js";
2
2
  import { menuItem } from "../../../lib/overlay.js";
3
+ import { createDialogFocusRestoration } from "../dialog/dialog.js";
3
4
  import { className, createComponent, effect, insert, mergeProps, template, use } from "solid-js/web";
4
5
  import { Search } from "lucide-solid";
5
6
  import { createEffect, createSignal, splitProps } from "solid-js";
6
- import { CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandLoading, CommandRoot, CommandSeparator, useCommandState } from "cmdk-solid";
7
+ import { CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandLoading, CommandRoot, CommandSeparator, useCommandState } from "cmdk-solid";
8
+ import { Dialog } from "@kobalte/core/dialog";
7
9
  //#region src/components/ui/command/command.tsx
8
10
  var _tmpl$ = /*#__PURE__*/ template(`<div data-slot=command-input-wrapper class="flex h-11 items-center gap-2 border-b border-border px-3">`);
9
11
  var _tmpl$2 = /*#__PURE__*/ template(`<div class=contents>`);
10
12
  var _tmpl$3 = /*#__PURE__*/ template(`<span>`);
11
- var commandItem = menuItem.replace("data-[disabled]:pointer-events-none", "").replace("data-[disabled]:opacity-50", "");
13
+ var commandItem = menuItem.replace("data-[disabled]:pointer-events-none", "").replace("data-[disabled]:text-muted-foreground", "");
12
14
  /**
13
15
  * Command.
14
16
  *
@@ -31,11 +33,71 @@ function Command(props) {
31
33
  return cn("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-xl", local.class);
32
34
  } }, rest));
33
35
  }
34
- function CommandDialog$1(props) {
35
- const [local, rest] = splitProps(props, ["class"]);
36
- return createComponent(CommandDialog, mergeProps({ get contentClassName() {
37
- return cn("bg-popover text-popover-foreground fixed top-1/3 left-1/2 z-(--z-dialog) w-full max-w-lg -translate-x-1/2 -translate-y-1/2", "overflow-hidden rounded-xl border border-border shadow-xl", "data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95", "data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", local.class);
38
- } }, rest));
36
+ function CommandDialog(props) {
37
+ const [local, dialogProps, commandProps] = splitProps(props, [
38
+ "class",
39
+ "contentClassName",
40
+ "overlayClassName",
41
+ "container",
42
+ "onCloseAutoFocus",
43
+ "onOpenAutoFocus"
44
+ ], [
45
+ "open",
46
+ "defaultOpen",
47
+ "onOpenChange",
48
+ "id",
49
+ "modal",
50
+ "preventScroll",
51
+ "forceMount",
52
+ "translations"
53
+ ]);
54
+ const [isOpen, setIsOpen] = createSignal(dialogProps.open ?? dialogProps.defaultOpen ?? false);
55
+ createEffect(() => {
56
+ if (dialogProps.open !== void 0) setIsOpen(dialogProps.open);
57
+ });
58
+ const focus = createDialogFocusRestoration({
59
+ open: isOpen,
60
+ onCloseAutoFocus: local.onCloseAutoFocus,
61
+ onOpenAutoFocus: local.onOpenAutoFocus
62
+ });
63
+ return createComponent(Dialog, mergeProps(dialogProps, {
64
+ onOpenChange: (open) => {
65
+ setIsOpen(open);
66
+ dialogProps.onOpenChange?.(open);
67
+ },
68
+ get children() {
69
+ return createComponent(Dialog.Portal, {
70
+ get mount() {
71
+ return local.container;
72
+ },
73
+ get children() {
74
+ return [createComponent(Dialog.Overlay, {
75
+ "cmdk-overlay": "",
76
+ get ["class"]() {
77
+ return local.overlayClassName;
78
+ }
79
+ }), createComponent(Dialog.Content, {
80
+ get ["aria-label"]() {
81
+ return commandProps.label;
82
+ },
83
+ "cmdk-dialog": "",
84
+ get ["class"]() {
85
+ return cn("bg-popover text-popover-foreground fixed top-1/3 left-1/2 z-(--z-dialog) w-full max-w-lg -translate-x-1/2 -translate-y-1/2", "overflow-hidden rounded-xl border border-border shadow-xl", "data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95", "data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", local.class, local.contentClassName);
86
+ },
87
+ get onOpenAutoFocus() {
88
+ return focus.onOpenAutoFocus;
89
+ },
90
+ get onCloseAutoFocus() {
91
+ return focus.onCloseAutoFocus;
92
+ },
93
+ get children() {
94
+ return createComponent(Command, commandProps);
95
+ }
96
+ })];
97
+ }
98
+ });
99
+ }
100
+ }));
39
101
  }
40
102
  function CommandInput$1(props) {
41
103
  const [local, rest] = splitProps(props, ["class"]);
@@ -108,7 +170,7 @@ function CommandGroup$1(props) {
108
170
  function CommandItem$1(props) {
109
171
  const [local, rest] = splitProps(props, ["class"]);
110
172
  return createComponent(CommandItem, mergeProps({ get ["class"]() {
111
- return cn(commandItem, "data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50", "text-popover-foreground data-[selected=true]:bg-surface-hover data-[selected=true]:text-popover-foreground", local.class);
173
+ return cn(commandItem, "data-[disabled=true]:pointer-events-none data-[disabled=true]:text-muted-foreground", "group/command-item text-popover-foreground data-[selected=true]:bg-card data-[selected=true]:text-popover-foreground", local.class);
112
174
  } }, rest));
113
175
  }
114
176
  function CommandSeparator$1(props) {
@@ -123,20 +185,16 @@ function CommandLoading$1(props) {
123
185
  return cn("text-muted-foreground py-6 text-center text-sm", local.class);
124
186
  } }, rest));
125
187
  }
126
- /**
127
- * The keyboard hint a palette item usually carries.
128
- * Muted canvas text can fail contrast on a raised or selected command row;
129
- * hierarchy comes from its size and monospace face, with the row's readable ink.
130
- */
188
+ /** The keyboard hint a palette item usually carries. */
131
189
  function CommandShortcut(props) {
132
190
  return (() => {
133
191
  var _el$3 = _tmpl$3();
134
192
  insert(_el$3, () => props.children);
135
- effect(() => className(_el$3, cn("text-popover-foreground ms-auto font-mono text-2xs tracking-widest", props.class)));
193
+ effect(() => className(_el$3, cn("text-muted-foreground ms-auto font-mono text-2xs tracking-widest group-data-[selected=true]/command-item:text-foreground", props.class)));
136
194
  return _el$3;
137
195
  })();
138
196
  }
139
197
  //#endregion
140
- export { Command, CommandDialog$1 as CommandDialog, CommandEmpty$1 as CommandEmpty, CommandGroup$1 as CommandGroup, CommandInput$1 as CommandInput, CommandItem$1 as CommandItem, CommandList$1 as CommandList, CommandLoading$1 as CommandLoading, CommandSeparator$1 as CommandSeparator, CommandShortcut };
198
+ export { Command, CommandDialog, CommandEmpty$1 as CommandEmpty, CommandGroup$1 as CommandGroup, CommandInput$1 as CommandInput, CommandItem$1 as CommandItem, CommandList$1 as CommandList, CommandLoading$1 as CommandLoading, CommandSeparator$1 as CommandSeparator, CommandShortcut };
141
199
 
142
200
  //# sourceMappingURL=command.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"command.js","names":["CommandDialog","CmdkDialog","CommandEmpty","CmdkEmpty","CommandGroup","CmdkGroup","CommandInput","CmdkInput","CommandItem","CmdkItem","CommandList","CmdkList","CommandLoading","CmdkLoading","CommandRoot","CmdkRoot","CommandSeparator","CmdkSeparator","useCommandState","Search","ComponentProps","createEffect","createSignal","splitProps","menuItem","cn","commandItem","replace","Command","props","local","rest","_$createComponent","_$mergeProps","class","contentClassName","_el$","_tmpl$","_$insert","wrapper","setWrapper","HTMLDivElement","resultCount","state","filtered","count","root","selector","querySelector","setAttribute","_el$2","_tmpl$2","_$use","role","CommandShortcut","children","_el$3","_tmpl$3","_$effect","_$className","_$createComponent","CmdkRoot","_$mergeProps","CommandDialog","CmdkDialog","CommandInput","CmdkInput","CommandList","CmdkList","CommandEmpty","CmdkEmpty","CommandGroup","CmdkGroup","CommandItem","CmdkItem","CommandSeparator","CmdkSeparator","CommandLoading","CmdkLoading","_$className"],"sources":["../../../../src/components/ui/command/command.tsx"],"sourcesContent":["import {\n CommandDialog as CmdkDialog,\n CommandEmpty as CmdkEmpty,\n CommandGroup as CmdkGroup,\n CommandInput as CmdkInput,\n CommandItem as CmdkItem,\n CommandList as CmdkList,\n CommandLoading as CmdkLoading,\n CommandRoot as CmdkRoot,\n CommandSeparator as CmdkSeparator,\n useCommandState,\n} from 'cmdk-solid'\nimport { Search } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { createEffect, createSignal, splitProps } from 'solid-js'\nimport { menuItem } from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\n// cmdk emits data-disabled=\"false\" on enabled items; Kobalte omits it.\n// Presence selectors would dim and disable every command in an app palette.\nconst commandItem = menuItem\n .replace('data-[disabled]:pointer-events-none', '')\n .replace('data-[disabled]:opacity-50', '')\n\n/**\n * Command.\n *\n * The command palette: a filtered list of everything the user can do, ranked\n * by fuzzy match. It is the one place in an app where a keyboard-first surface\n * is the *primary* one, so it carries rules the rest of the system does not:\n *\n * - Every item must be reachable by typing its name. If a user has to\n * remember which group it lives in, the palette has failed at its job.\n * - Groups exist for reading, not for navigation. The ranking crosses them.\n * - The empty state is not an apology — it should offer the closest thing\n * the app could guess, or say plainly that nothing matched.\n *\n * cmdk-solid supplies the filter, the scoring, the `aria-activedescendant`\n * wiring and the arrow-key navigation.\n */\nexport function Command(props: ComponentProps<typeof CmdkRoot>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <CmdkRoot\n class={cn(\n 'bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-xl',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function CommandDialog(props: ComponentProps<typeof CmdkDialog>) {\n // cmdk's Dialog splits `contentClassName` onto the role=\"dialog\" content\n // element and routes every other prop (including `class`) to the inner\n // Command. The surface must live on the content: a `class` here styles the\n // Command (fixed, so visible) while the dialog element itself renders as an\n // unstyled zero-height wrapper at the end of body — invisible to role\n // queries and axe.\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <CmdkDialog\n contentClassName={cn(\n 'bg-popover text-popover-foreground fixed top-1/3 left-1/2 z-(--z-dialog) w-full max-w-lg -translate-x-1/2 -translate-y-1/2',\n 'overflow-hidden rounded-xl border border-border shadow-xl',\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function CommandInput(props: ComponentProps<typeof CmdkInput>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <div\n data-slot=\"command-input-wrapper\"\n class=\"flex h-11 items-center gap-2 border-b border-border px-3\"\n >\n <Search class=\"size-4 shrink-0 text-muted-foreground\" aria-hidden=\"true\" />\n <CmdkInput\n class={cn(\n 'h-full w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n local.class\n )}\n {...rest}\n />\n </div>\n )\n}\n\n/**\n * The scrolling list.\n *\n * Two DOM corrections, and both are deliberate. cmdk builds a `role=\"listbox\"`\n * whose children include two elements ARIA does not allow there:\n *\n * - a bare `<div cmdk-list-sizer>` with no role, wrapped around every group;\n * - a `<div cmdk-separator role=\"separator\">`, and `separator` is a menu and\n * toolbar role — inside a listbox the only owned elements may be `option`\n * and `group`.\n *\n * Both are pure presentation: the sizer is layout, and the separator is a\n * hairline between groups that the groups already structure. `role=\"presentation\"`\n * is their accurate role rather than a workaround — each is flattened out of the\n * accessibility tree, and the options inside are reached exactly as before.\n *\n * Written onto the mounted nodes rather than through props, because cmdk owns\n * this markup and does not forward a `ref`; in an effect rather than `onMount`,\n * because cmdk renders the sizer with the first item, after the list itself.\n */\nexport function CommandList(props: ComponentProps<typeof CmdkList>) {\n const [local, rest] = splitProps(props, ['class'])\n const [wrapper, setWrapper] = createSignal<HTMLDivElement>()\n const resultCount = useCommandState((state) => state.filtered.count)\n\n createEffect(() => {\n const root = wrapper()\n if (!root) return\n for (const selector of ['[cmdk-list-sizer]', '[cmdk-separator]']) {\n root.querySelector(selector)?.setAttribute('role', 'presentation')\n }\n\n /*\n * A `listbox` must own at least one `option`, so a listbox with nothing in it\n * is invalid ARIA — which is what a search with no matches produces. When\n * there are no results the list is inert, so it becomes presentational and\n * the empty message carries the information instead. It keeps its `id`, so\n * the input's `aria-controls` still resolves.\n */\n root\n .querySelector('[cmdk-list]')\n ?.setAttribute('role', resultCount() > 0 ? 'listbox' : 'presentation')\n })\n\n return (\n <div ref={setWrapper} class=\"contents\">\n <CmdkList\n class={cn('max-h-80 scroll-py-1 overflow-y-auto overflow-x-hidden p-1', local.class)}\n {...rest}\n />\n </div>\n )\n}\n\nexport function CommandEmpty(props: ComponentProps<typeof CmdkEmpty>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <CmdkEmpty\n /*\n * A status rather than plain text: when the list is presentational, this is\n * the only thing that tells a screen reader the search matched nothing.\n */\n role=\"status\"\n class={cn('text-muted-foreground py-8 text-center text-sm', local.class)}\n {...rest}\n />\n )\n}\n\nexport function CommandGroup(props: ComponentProps<typeof CmdkGroup>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <CmdkGroup\n class={cn(\n 'text-foreground overflow-hidden p-1',\n '[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-2xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:tracking-wide [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:uppercase',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function CommandItem(props: ComponentProps<typeof CmdkItem>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <CmdkItem\n class={cn(\n commandItem,\n 'data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50',\n 'text-popover-foreground data-[selected=true]:bg-surface-hover data-[selected=true]:text-popover-foreground',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function CommandSeparator(props: ComponentProps<typeof CmdkSeparator>) {\n const [local, rest] = splitProps(props, ['class'])\n return <CmdkSeparator class={cn('bg-border -mx-1 my-1 h-px', local.class)} {...rest} />\n}\n\nexport function CommandLoading(props: ComponentProps<typeof CmdkLoading>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <CmdkLoading\n class={cn('text-muted-foreground py-6 text-center text-sm', local.class)}\n {...rest}\n />\n )\n}\n\n/**\n * The keyboard hint a palette item usually carries.\n * Muted canvas text can fail contrast on a raised or selected command row;\n * hierarchy comes from its size and monospace face, with the row's readable ink.\n */\nexport function CommandShortcut(props: {\n class?: string\n children?: ComponentProps<'span'>['children']\n}) {\n return (\n <span\n class={cn('text-popover-foreground ms-auto font-mono text-2xs tracking-widest', props.class)}\n >\n {props.children}\n </span>\n )\n}\n"],"mappings":";;;;;;;;;;AAoBA,IAAM0B,cAAcF,SACjBG,QAAQ,uCAAuC,EAAE,CAAC,CAClDA,QAAQ,8BAA8B,EAAE;;;;;;;;;;;;;;;;;AAkB3C,SAAgBC,QAAQC,OAAwC;CAC9D,MAAM,CAACC,OAAOC,QAAQR,WAAWM,OAAO,CAAC,OAAO,CAAC;CAEjD,OAAAG,gBACGjB,aAAQkB,WAAA,EAAA,KAAA,WAAA;EAAA,OACAR,GACL,6FACAK,MAAMI,KACR;CAAC,EAAA,GACGH,IAAI,CAAA;AAGd;AAEA,SAAgB/B,gBAAc6B,OAA0C;CAOtE,MAAM,CAACC,OAAOC,QAAQR,WAAWM,OAAO,CAAC,OAAO,CAAC;CAEjD,OAAAG,gBACG/B,eAAUgC,WAAA,EAAA,IACTE,mBAAgB;EAAA,OAAEV,GAChB,8HACA,6DACA,6EACA,0EACAK,MAAMI,KACR;CAAC,EAAA,GACGH,IAAI,CAAA;AAGd;AAEA,SAAgBzB,eAAauB,OAAyC;CACpE,MAAM,CAACC,OAAOC,QAAQR,WAAWM,OAAO,CAAC,OAAO,CAAC;CAEjD,cAAA;EAAA,IAAAO,OAAAC,OAAA;EAAAC,OAAAF,MAAAJ,gBAKKb,QAAM;GAAA,SAAA;GAAA,eAAA;EAAA,CAAA,GAAA,IAAA;EAAAmB,OAAAF,MAAAJ,gBACNzB,cAAS0B,WAAA,EAAA,KAAA,WAAA;GAAA,OACDR,GACL,uFACA,mDACAK,MAAMI,KACR;EAAC,EAAA,GACGH,IAAI,CAAA,GAAA,IAAA;EAAA,OAAAK;CAAA,EAAA,CAAA;AAIhB;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAgB1B,cAAYmB,OAAwC;CAClE,MAAM,CAACC,OAAOC,QAAQR,WAAWM,OAAO,CAAC,OAAO,CAAC;CACjD,MAAM,CA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AAA,OACAR,GACLC,aACA,4EACA,8GACAI,MAAMI,KACR;CAAC,EAAA,GACGH,IAAI,CAAA;AAGd;AAEA,SAAgBf,mBAAiBa,OAA6C;CAC5E,MAAM,CAACC,OAAOC,QAAQR,WAAWM,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBAAQf,kBAAagB,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQR,GAAG,6BAA6BK,MAAMI,KAAK;CAAC,EAAA,GAAMH,IAAI,CAAA;AACrF;AAEA,SAAgBnB,iBAAeiB,OAA2C;CACxE,MAAM,CAACC,OAAOC,QAAQR,WAAWM,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBACGnB,gBAAWoB,WAAA,EAAA,KAAA,WAAA;EAAA,OACHR,GAAG,kDAAkDK,MAAMI,KAAK;CAAC,EAAA,GACpEH,IAAI,CAAA;AAGd;;;;;;AAOA,SAAgBuB,gBAAgBzB,OAG7B;CACD,cAAA;EAAA,IAAA2B,QAAAC,QAAA;EAAAnB,OAAAkB,aAIK3B,MAAM0B,QAAQ;EAAAG,aAAAC,UAAAH,OAFR/B,GAAG,sEAAsEI,MAAMK,KAAK,CAAC,CAAA;EAAA,OAAAsB;CAAA,EAAA,CAAA;AAKlG"}
1
+ {"version":3,"file":"command.js","names":["CommandDialog","CmdkDialog","CommandEmpty","CmdkEmpty","CommandGroup","CmdkGroup","CommandInput","CmdkInput","CommandItem","CmdkItem","CommandList","CmdkList","CommandLoading","CmdkLoading","CommandRoot","CmdkRoot","CommandSeparator","CmdkSeparator","useCommandState","Dialog","KobalteDialog","Search","ComponentProps","createEffect","createSignal","splitProps","createDialogFocusRestoration","menuItem","cn","commandItem","replace","Command","props","local","rest","_$createComponent","_$mergeProps","class","CommandDialogProps","Pick","Content","dialogProps","commandProps","isOpen","setIsOpen","open","defaultOpen","undefined","focus","onCloseAutoFocus","onOpenAutoFocus","onOpenChange","children","Portal","mount","container","Overlay","overlayClassName","aria-label","label","contentClassName","_el$","_tmpl$","_$insert","wrapper","setWrapper","HTMLDivElement","resultCount","state","filtered","count","root","selector","querySelector","setAttribute","_el$2","_tmpl$2","_$use","role","CommandShortcut","_el$3","_tmpl$3","_$effect","_$className","_$createComponent","CmdkRoot","_$mergeProps","KobalteDialog","CommandInput","CmdkInput","CommandList","CmdkList","CommandEmpty","CmdkEmpty","CommandGroup","CmdkGroup","CommandItem","CmdkItem","CommandSeparator","CmdkSeparator","CommandLoading","CmdkLoading","_$className"],"sources":["../../../../src/components/ui/command/command.tsx"],"sourcesContent":["import {\n CommandDialog as CmdkDialog,\n CommandEmpty as CmdkEmpty,\n CommandGroup as CmdkGroup,\n CommandInput as CmdkInput,\n CommandItem as CmdkItem,\n CommandList as CmdkList,\n CommandLoading as CmdkLoading,\n CommandRoot as CmdkRoot,\n CommandSeparator as CmdkSeparator,\n useCommandState,\n} from 'cmdk-solid'\nimport { Dialog as KobalteDialog } from '@kobalte/core/dialog'\nimport { Search } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { createEffect, createSignal, splitProps } from 'solid-js'\nimport { createDialogFocusRestoration } from '../dialog/dialog'\nimport { menuItem } from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\n// cmdk emits data-disabled=\"false\" on enabled items, unlike the presence-only\n// attributes Kobalte menu rows use. Apply those shared disabled styles only when\n// cmdk's value is true.\nconst commandItem = menuItem\n .replace('data-[disabled]:pointer-events-none', '')\n .replace('data-[disabled]:text-muted-foreground', '')\n\n/**\n * Command.\n *\n * The command palette: a filtered list of everything the user can do, ranked\n * by fuzzy match. It is the one place in an app where a keyboard-first surface\n * is the *primary* one, so it carries rules the rest of the system does not:\n *\n * - Every item must be reachable by typing its name. If a user has to\n * remember which group it lives in, the palette has failed at its job.\n * - Groups exist for reading, not for navigation. The ranking crosses them.\n * - The empty state is not an apology — it should offer the closest thing\n * the app could guess, or say plainly that nothing matched.\n *\n * cmdk-solid supplies the filter, the scoring, the `aria-activedescendant`\n * wiring and the arrow-key navigation.\n */\nexport function Command(props: ComponentProps<typeof CmdkRoot>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <CmdkRoot\n class={cn(\n 'bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-xl',\n local.class\n )}\n {...rest}\n />\n )\n}\n\ntype CommandDialogProps = ComponentProps<typeof CmdkDialog> &\n Pick<ComponentProps<typeof KobalteDialog.Content>, 'onCloseAutoFocus' | 'onOpenAutoFocus'>\n\nexport function CommandDialog(props: CommandDialogProps) {\n // cmdk-solid's Dialog does not forward Content autofocus props: unknown\n // props fall through to its Command root. Compose Kobalte's dialog surface\n // here so Escape and other close paths can restore focus to the real opener.\n // Preserve the shared wrapper's `class` contract on the dialog surface;\n // `contentClassName` adds to it, while the nested Command keeps its own API.\n const [local, dialogProps, commandProps] = splitProps(\n props,\n [\n 'class',\n 'contentClassName',\n 'overlayClassName',\n 'container',\n 'onCloseAutoFocus',\n 'onOpenAutoFocus',\n ],\n [\n 'open',\n 'defaultOpen',\n 'onOpenChange',\n 'id',\n 'modal',\n 'preventScroll',\n 'forceMount',\n 'translations',\n ]\n )\n const [isOpen, setIsOpen] = createSignal(dialogProps.open ?? dialogProps.defaultOpen ?? false)\n\n createEffect(() => {\n if (dialogProps.open !== undefined) setIsOpen(dialogProps.open)\n })\n\n const focus = createDialogFocusRestoration({\n open: isOpen,\n onCloseAutoFocus: local.onCloseAutoFocus,\n onOpenAutoFocus: local.onOpenAutoFocus,\n })\n\n return (\n <KobalteDialog\n {...dialogProps}\n onOpenChange={(open) => {\n setIsOpen(open)\n dialogProps.onOpenChange?.(open)\n }}\n >\n <KobalteDialog.Portal mount={local.container}>\n <KobalteDialog.Overlay cmdk-overlay=\"\" class={local.overlayClassName} />\n <KobalteDialog.Content\n aria-label={commandProps.label}\n cmdk-dialog=\"\"\n class={cn(\n 'bg-popover text-popover-foreground fixed top-1/3 left-1/2 z-(--z-dialog) w-full max-w-lg -translate-x-1/2 -translate-y-1/2',\n 'overflow-hidden rounded-xl border border-border shadow-xl',\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n local.class,\n local.contentClassName\n )}\n onOpenAutoFocus={focus.onOpenAutoFocus}\n onCloseAutoFocus={focus.onCloseAutoFocus}\n >\n <Command {...commandProps} />\n </KobalteDialog.Content>\n </KobalteDialog.Portal>\n </KobalteDialog>\n )\n}\n\nexport function CommandInput(props: ComponentProps<typeof CmdkInput>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <div\n data-slot=\"command-input-wrapper\"\n class=\"flex h-11 items-center gap-2 border-b border-border px-3\"\n >\n <Search class=\"size-4 shrink-0 text-muted-foreground\" aria-hidden=\"true\" />\n <CmdkInput\n class={cn(\n 'h-full w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n local.class\n )}\n {...rest}\n />\n </div>\n )\n}\n\n/**\n * The scrolling list.\n *\n * Two DOM corrections, and both are deliberate. cmdk builds a `role=\"listbox\"`\n * whose children include two elements ARIA does not allow there:\n *\n * - a bare `<div cmdk-list-sizer>` with no role, wrapped around every group;\n * - a `<div cmdk-separator role=\"separator\">`, and `separator` is a menu and\n * toolbar role — inside a listbox the only owned elements may be `option`\n * and `group`.\n *\n * Both are pure presentation: the sizer is layout, and the separator is a\n * hairline between groups that the groups already structure. `role=\"presentation\"`\n * is their accurate role rather than a workaround — each is flattened out of the\n * accessibility tree, and the options inside are reached exactly as before.\n *\n * Written onto the mounted nodes rather than through props, because cmdk owns\n * this markup and does not forward a `ref`; in an effect rather than `onMount`,\n * because cmdk renders the sizer with the first item, after the list itself.\n */\nexport function CommandList(props: ComponentProps<typeof CmdkList>) {\n const [local, rest] = splitProps(props, ['class'])\n const [wrapper, setWrapper] = createSignal<HTMLDivElement>()\n const resultCount = useCommandState((state) => state.filtered.count)\n\n createEffect(() => {\n const root = wrapper()\n if (!root) return\n for (const selector of ['[cmdk-list-sizer]', '[cmdk-separator]']) {\n root.querySelector(selector)?.setAttribute('role', 'presentation')\n }\n\n /*\n * A `listbox` must own at least one `option`, so a listbox with nothing in it\n * is invalid ARIA — which is what a search with no matches produces. When\n * there are no results the list is inert, so it becomes presentational and\n * the empty message carries the information instead. It keeps its `id`, so\n * the input's `aria-controls` still resolves.\n */\n root\n .querySelector('[cmdk-list]')\n ?.setAttribute('role', resultCount() > 0 ? 'listbox' : 'presentation')\n })\n\n return (\n <div ref={setWrapper} class=\"contents\">\n <CmdkList\n class={cn('max-h-80 scroll-py-1 overflow-y-auto overflow-x-hidden p-1', local.class)}\n {...rest}\n />\n </div>\n )\n}\n\nexport function CommandEmpty(props: ComponentProps<typeof CmdkEmpty>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <CmdkEmpty\n /*\n * A status rather than plain text: when the list is presentational, this is\n * the only thing that tells a screen reader the search matched nothing.\n */\n role=\"status\"\n class={cn('text-muted-foreground py-8 text-center text-sm', local.class)}\n {...rest}\n />\n )\n}\n\nexport function CommandGroup(props: ComponentProps<typeof CmdkGroup>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <CmdkGroup\n class={cn(\n 'text-foreground overflow-hidden p-1',\n '[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-2xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:tracking-wide [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:uppercase',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function CommandItem(props: ComponentProps<typeof CmdkItem>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <CmdkItem\n class={cn(\n commandItem,\n 'data-[disabled=true]:pointer-events-none data-[disabled=true]:text-muted-foreground',\n 'group/command-item text-popover-foreground data-[selected=true]:bg-card data-[selected=true]:text-popover-foreground',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function CommandSeparator(props: ComponentProps<typeof CmdkSeparator>) {\n const [local, rest] = splitProps(props, ['class'])\n return <CmdkSeparator class={cn('bg-border -mx-1 my-1 h-px', local.class)} {...rest} />\n}\n\nexport function CommandLoading(props: ComponentProps<typeof CmdkLoading>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <CmdkLoading\n class={cn('text-muted-foreground py-6 text-center text-sm', local.class)}\n {...rest}\n />\n )\n}\n\n/** The keyboard hint a palette item usually carries. */\nexport function CommandShortcut(props: {\n class?: string\n children?: ComponentProps<'span'>['children']\n}) {\n return (\n <span\n class={cn(\n 'text-muted-foreground ms-auto font-mono text-2xs tracking-widest group-data-[selected=true]/command-item:text-foreground',\n props.class\n )}\n >\n {props.children}\n </span>\n )\n}\n"],"mappings":";;;;;;;;;;;;AAuBA,IAAM6B,cAAcF,SACjBG,QAAQ,uCAAuC,EAAE,CAAC,CAClDA,QAAQ,yCAAyC,EAAE;;;;;;;;;;;;;;;;;AAkBtD,SAAgBC,QAAQC,OAAwC;CAC9D,MAAM,CAACC,OAAOC,QAAQT,WAAWO,OAAO,CAAC,OAAO,CAAC;CAEjD,OAAAG,gBACGpB,aAAQqB,WAAA,EAAA,KAAA,WAAA;EAAA,OACAR,GACL,6FACAK,MAAMI,KACR;CAAC,EAAA,GACGH,IAAI,CAAA;AAGd;AAKA,SAAgBlC,cAAcgC,OAA2B;CAMvD,MAAM,CAACC,OAAOQ,aAAaC,gBAAgBjB,WACzCO,OACA;EACE;EACA;EACA;EACA;EACA;EACA;CAAiB,GAEnB;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAc,CAElB;CACA,MAAM,CAACW,QAAQC,aAAapB,aAAaiB,YAAYI,QAAQJ,YAAYK,eAAe,KAAK;CAE7FvB,mBAAmB;EACjB,IAAIkB,YAAYI,SAASE,KAAAA,GAAWH,UAAUH,YAAYI,IAAI;CAChE,CAAC;CAED,MAAMG,QAAQtB,6BAA6B;EACzCmB,MAAMF;EACNM,kBAAkBhB,MAAMgB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AClE,MAAM,CAACC,OAAOC,QAAQT,WAAWO,OAAO,CAAC,OAAO,CAAC;CAEjD,OAAAG,gBACG1B,aAAQ2B,WAAA,EAAA,KAAA,WAAA;EAAA,OACAR,GACLC,aACA,uFACA,wHACAI,MAAMI,KACR;CAAC,EAAA,GACGH,IAAI,CAAA;AAGd;AAEA,SAAgBlB,mBAAiBgB,OAA6C;CAC5E,MAAM,CAACC,OAAOC,QAAQT,WAAWO,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBAAQlB,kBAAamB,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQR,GAAG,6BAA6BK,MAAMI,KAAK;CAAC,EAAA,GAAMH,IAAI,CAAA;AACrF;AAEA,SAAgBtB,iBAAeoB,OAA2C;CACxE,MAAM,CAACC,OAAOC,QAAQT,WAAWO,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBACGtB,gBAAWuB,WAAA,EAAA,KAAA,WAAA;EAAA,OACHR,GAAG,kDAAkDK,MAAMI,KAAK;CAAC,EAAA,GACpEH,IAAI,CAAA;AAGd;;AAGA,SAAgB6C,gBAAgB/C,OAG7B;CACD,cAAA;EAAA,IAAAgD,QAAAC,QAAA;EAAAlB,OAAAiB,aAOKhD,MAAMoB,QAAQ;EAAA8B,aAAAC,UAAAH,OALRpD,GACL,4HACAI,MAAMK,KACR,CAAC,CAAA;EAAA,OAAA2C;CAAA,EAAA,CAAA;AAKP"}
@@ -11,6 +11,9 @@ import type { ComponentProps } from 'solid-js';
11
11
  * Kobalte supplies the full menu contract — arrow keys, typeahead, the roving
12
12
  * highlight, Escape to close and return focus — which is exactly what a
13
13
  * hand-rolled `div` with click handlers gets wrong.
14
+ * Menus are nonmodal by default so their generated focus guards do not become
15
+ * invalid direct children of the ARIA menu. Set `modal` explicitly when the
16
+ * surrounding interaction needs modal containment.
14
17
  *
15
18
  * The `destructive` variant marks the row with a status-coloured edge and
16
19
  * highlighted tint while keeping its label on the body foreground. Pairing it
@@ -1 +1 @@
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AU7D;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,cAAc,CAAC,OAAO,mBAAmB,CAAC,UAAU,CAAC,kCAkB7D"}
@@ -18,13 +18,19 @@ var _tmpl$2 = /*#__PURE__*/ template(`<span data-slot=dropdown-menu-shortcut>`);
18
18
  * Kobalte supplies the full menu contract — arrow keys, typeahead, the roving
19
19
  * highlight, Escape to close and return focus — which is exactly what a
20
20
  * hand-rolled `div` with click handlers gets wrong.
21
+ * Menus are nonmodal by default so their generated focus guards do not become
22
+ * invalid direct children of the ARIA menu. Set `modal` explicitly when the
23
+ * surrounding interaction needs modal containment.
21
24
  *
22
25
  * The `destructive` variant marks the row with a status-coloured edge and
23
26
  * highlighted tint while keeping its label on the body foreground. Pairing it
24
27
  * with an AlertDialog is the caller's job.
25
28
  */
26
29
  function DropdownMenu$1(props) {
27
- return createComponent(DropdownMenu, props);
30
+ const [local, rest] = splitProps(props, ["modal"]);
31
+ return createComponent(DropdownMenu, mergeProps({ get modal() {
32
+ return local.modal ?? false;
33
+ } }, rest));
28
34
  }
29
35
  function DropdownMenuTrigger(props) {
30
36
  return createComponent(DropdownMenu.Trigger, props);
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown-menu.js","names":["DropdownMenu","KobalteDropdownMenu","Check","ChevronRight","Circle","ComponentProps","splitProps","menuContentPadding","destructiveMenuItem","menuItem","menuLabel","menuSeparator","overlayMotion","overlaySurface","popoverArrow","cn","props","_$createComponent","DropdownMenuTrigger","Trigger","DropdownMenuPortal","Portal","DropdownMenuContentProps","Content","hideArrow","portalMount","HTMLElement","DropdownMenuContent","local","rest","mount","children","_$mergeProps","class","_$memo","Arrow","DropdownMenuItem","Item","variant","shortcut","_el$","_tmpl$","_$insert","DropdownMenuShortcut","_el$2","_tmpl$2","_$spread","DropdownMenuCheckboxItem","CheckboxItem","ItemIndicator","DropdownMenuRadioGroup","RadioGroup","DropdownMenuRadioItem","RadioItem","DropdownMenuLabel","GroupLabel","DropdownMenuGroup","Group","DropdownMenuSeparator","Separator","DropdownMenuSub","Sub","DropdownMenuSubTrigger","SubTrigger","DropdownMenuSubContent","SubContent","DropdownMenu","_$createComponent","KobalteDropdownMenu","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/dropdown-menu/dropdown-menu.tsx"],"sourcesContent":["import { DropdownMenu as KobalteDropdownMenu } from '@kobalte/core/dropdown-menu'\nimport { Check, ChevronRight, Circle } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport {\n menuContentPadding,\n destructiveMenuItem,\n menuItem,\n menuLabel,\n menuSeparator,\n overlayMotion,\n overlaySurface,\n popoverArrow,\n} from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\n/**\n * DropdownMenu.\n *\n * A list of actions on a trigger, with radio groups for persistent choices\n * that fit naturally in a compact menu. Use Select for form inputs whose\n * selected value needs the field-style control, and Popover for arbitrary\n * content.\n *\n * Kobalte supplies the full menu contract — arrow keys, typeahead, the roving\n * highlight, Escape to close and return focus — which is exactly what a\n * hand-rolled `div` with click handlers gets wrong.\n *\n * The `destructive` variant marks the row with a status-coloured edge and\n * highlighted tint while keeping its label on the body foreground. Pairing it\n * with an AlertDialog is the caller's job.\n */\nexport function DropdownMenu(props: ComponentProps<typeof KobalteDropdownMenu>) {\n return <KobalteDropdownMenu {...props} />\n}\n\nexport function DropdownMenuTrigger(props: ComponentProps<typeof KobalteDropdownMenu.Trigger>) {\n return <KobalteDropdownMenu.Trigger {...props} />\n}\n\nexport function DropdownMenuPortal(props: ComponentProps<typeof KobalteDropdownMenu.Portal>) {\n return <KobalteDropdownMenu.Portal {...props} />\n}\n\nexport type DropdownMenuContentProps = ComponentProps<typeof KobalteDropdownMenu.Content> & {\n hideArrow?: boolean\n /** Mount under an owner element such as a modal, keeping the menu in its accessible subtree. */\n portalMount?: HTMLElement\n}\n\nexport function DropdownMenuContent(props: DropdownMenuContentProps) {\n const [local, rest] = splitProps(props, ['class', 'hideArrow', 'children', 'portalMount'])\n\n return (\n <KobalteDropdownMenu.Portal mount={local.portalMount}>\n <KobalteDropdownMenu.Content\n class={cn(\n overlaySurface,\n overlayMotion,\n 'z-(--z-menu) min-w-[10rem] origin-(--kb-menu-content-transform-origin) overflow-hidden',\n menuContentPadding,\n local.class\n )}\n {...rest}\n >\n {!local.hideArrow && <KobalteDropdownMenu.Arrow aria-hidden=\"true\" class={popoverArrow} />}\n {local.children}\n </KobalteDropdownMenu.Content>\n </KobalteDropdownMenu.Portal>\n )\n}\n\nexport function DropdownMenuItem(\n props: ComponentProps<typeof KobalteDropdownMenu.Item> & {\n /** Colour the row as a destructive action. Confirm it separately. */\n variant?: 'default' | 'destructive'\n /** Draw a shortcut hint at the trailing edge of the row. */\n shortcut?: string\n }\n) {\n const [local, rest] = splitProps(props, ['class', 'variant', 'shortcut', 'children'])\n\n return (\n <KobalteDropdownMenu.Item\n class={cn(\n menuItem,\n {\n [destructiveMenuItem]: local.variant === 'destructive',\n },\n local.class\n )}\n {...rest}\n >\n {local.children}\n {local.shortcut ? (\n <span class=\"text-muted-foreground ms-auto font-mono text-2xs tracking-widest\">\n {local.shortcut}\n </span>\n ) : null}\n </KobalteDropdownMenu.Item>\n )\n}\n\n/**\n * The chord drawn at a row's trailing edge.\n *\n * A component as well as the `shortcut` prop on an item, because a caller composing\n * a row by hand needs the same treatment — and because the alternative is every\n * caller inventing the same mono-and-dimmed span.\n */\nexport function DropdownMenuShortcut(props: ComponentProps<'span'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n class={cn('text-muted-foreground ms-auto font-mono text-2xs tracking-widest', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DropdownMenuCheckboxItem(\n props: ComponentProps<typeof KobalteDropdownMenu.CheckboxItem>\n) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteDropdownMenu.CheckboxItem class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n {local.children}\n <KobalteDropdownMenu.ItemIndicator class=\"absolute end-2 flex size-4 items-center justify-center\">\n <Check class=\"size-4\" />\n </KobalteDropdownMenu.ItemIndicator>\n </KobalteDropdownMenu.CheckboxItem>\n )\n}\n\nexport function DropdownMenuRadioGroup(\n props: ComponentProps<typeof KobalteDropdownMenu.RadioGroup>\n) {\n return <KobalteDropdownMenu.RadioGroup {...props} />\n}\n\nexport function DropdownMenuRadioItem(props: ComponentProps<typeof KobalteDropdownMenu.RadioItem>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteDropdownMenu.RadioItem class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n {local.children}\n <KobalteDropdownMenu.ItemIndicator class=\"absolute end-2 flex size-4 items-center justify-center\">\n <Circle class=\"size-2 fill-current\" />\n </KobalteDropdownMenu.ItemIndicator>\n </KobalteDropdownMenu.RadioItem>\n )\n}\n\nexport function DropdownMenuLabel(props: ComponentProps<typeof KobalteDropdownMenu.GroupLabel>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDropdownMenu.GroupLabel class={cn(menuLabel, local.class)} {...rest} />\n}\n\nexport function DropdownMenuGroup(props: ComponentProps<typeof KobalteDropdownMenu.Group>) {\n return <KobalteDropdownMenu.Group {...props} />\n}\n\nexport function DropdownMenuSeparator(props: ComponentProps<typeof KobalteDropdownMenu.Separator>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDropdownMenu.Separator class={cn(menuSeparator, local.class)} {...rest} />\n}\n\nexport function DropdownMenuSub(props: ComponentProps<typeof KobalteDropdownMenu.Sub>) {\n return <KobalteDropdownMenu.Sub {...props} />\n}\n\nexport function DropdownMenuSubTrigger(\n props: ComponentProps<typeof KobalteDropdownMenu.SubTrigger>\n) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteDropdownMenu.SubTrigger class={cn(menuItem, local.class)} {...rest}>\n {local.children}\n <ChevronRight class=\"ms-auto size-4\" />\n </KobalteDropdownMenu.SubTrigger>\n )\n}\n\nexport function DropdownMenuSubContent(\n props: ComponentProps<typeof KobalteDropdownMenu.SubContent>\n) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteDropdownMenu.Portal>\n <KobalteDropdownMenu.SubContent\n class={cn(\n overlaySurface,\n overlayMotion,\n 'z-(--z-menu) min-w-[8rem] origin-(--kb-menu-content-transform-origin) overflow-hidden',\n menuContentPadding,\n local.class\n )}\n {...rest}\n />\n </KobalteDropdownMenu.Portal>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,SAAgBA,eAAagB,OAAmD;CAC9E,OAAAC,gBAAQhB,cAAwBe,KAAK;AACvC;AAEA,SAAgBE,oBAAoBF,OAA2D;CAC7F,OAAAC,gBAAQhB,aAAoBkB,SAAYH,KAAK;AAC/C;AAEA,SAAgBI,mBAAmBJ,OAA0D;CAC3F,OAAAC,gBAAQhB,aAAoBoB,QAAWL,KAAK;AAC9C;AAQA,SAAgBW,oBAAoBX,OAAiC;CACnE,MAAM,CAACY,OAAOC,QAAQvB,WAAWU,OAAO;EAAC;EAAS;EAAa;EAAY;CAAa,CAAC;CAEzF,OAAAC,gBACGhB,aAAoBoB,QAAM;EAAA,IAACS,QAAK;GAAA,OAAEF,MAAMH;EAAW;EAAA,IAAAM,WAAA;GAAA,OAAAd,gBACjDhB,aAAoBsB,SAAOS,WAAA,EAAA,KAAA,WAAA;IAAA,OACnBjB,GACLF,gBACAD,eACA,0FAAA,OAEAgB,MAAMK,KACR;GAAC,EAAA,GACGJ,MAAI,EAAA,IAAAE,WAAA;IAAA,OAAA,CAAAG,WAEPA,WAAA,CAAA,CAAA,CAACN,MAAMJ,SAAS,CAAA,CAAA,KAAAP,gBAAKhB,aAAoBkC,OAAK;KAAA,eAAA;KAAA,SAAA;IAAuC,CAAA,CAAI,GAAAD,WACzFN,MAAMG,QAAQ,CAAA;GAAA,EAAA,CAAA,CAAA;EAAA;CAAA,CAAA;AAIvB;AAEA,SAAgBK,iBACdpB,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B,gBAAgB5C,OAAuD;CACrF,OAAAC,gBAAQhB,aAAoB4D,KAAQ7C,KAAK;AAC3C;AAEA,SAAgB8C,uBACd9C,OACA;CACA,MAAM,CAACY,OAAOC,QAAQvB,WAAWU,OAAO,CAAC,SAAS,UAAU,CAAC;CAE7D,OAAAC,gBACGhB,aAAoB8D,YAAU/B,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQjB,GAAGN,UAAUmB,MAAMK,KAAK;CAAC,EAAA,GAAMJ,MAAI,EAAA,IAAAE,WAAA;EAAA,OAAA,CAAAG,WACvEN,MAAMG,QAAQ,GAAAd,gBACdd,cAAY,EAAA,SAAA,iBAAA,CAAA,CAAA;CAAA,EAAA,CAAA,CAAA;AAGnB;AAEA,SAAgB6D,uBACdhD,OACA;CACA,MAAM,CAACY,OAAOC,QAAQvB,WAAWU,OAAO,CAAC,OAAO,CAAC;CAEjD,OAAAC,gBACGhB,aAAoBoB,QAAM,EAAA,IAAAU,WAAA;EAAA,OAAAd,gBACxBhB,aAAoBgE,YAAUjC,WAAA,EAAA,KAAA,WAAA;GAAA,OACtBjB,GACLF,gBACAD,eACA,yFAAA,OAEAgB,MAAMK,KACR;EAAC,EAAA,GACGJ,IAAI,CAAA;CAAA,EAAA,CAAA;AAIhB"}
1
+ {"version":3,"file":"dropdown-menu.js","names":["DropdownMenu","KobalteDropdownMenu","Check","ChevronRight","Circle","ComponentProps","splitProps","menuContentPadding","destructiveMenuItem","menuItem","menuLabel","menuSeparator","overlayMotion","overlaySurface","popoverArrow","cn","props","local","rest","_$createComponent","_$mergeProps","modal","DropdownMenuTrigger","Trigger","DropdownMenuPortal","Portal","DropdownMenuContentProps","Content","hideArrow","portalMount","HTMLElement","DropdownMenuContent","mount","children","class","_$memo","Arrow","DropdownMenuItem","Item","variant","shortcut","_el$","_tmpl$","_$insert","DropdownMenuShortcut","_el$2","_tmpl$2","_$spread","DropdownMenuCheckboxItem","CheckboxItem","ItemIndicator","DropdownMenuRadioGroup","RadioGroup","DropdownMenuRadioItem","RadioItem","DropdownMenuLabel","GroupLabel","DropdownMenuGroup","Group","DropdownMenuSeparator","Separator","DropdownMenuSub","Sub","DropdownMenuSubTrigger","SubTrigger","DropdownMenuSubContent","SubContent","DropdownMenu","_$createComponent","KobalteDropdownMenu","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/dropdown-menu/dropdown-menu.tsx"],"sourcesContent":["import { DropdownMenu as KobalteDropdownMenu } from '@kobalte/core/dropdown-menu'\nimport { Check, ChevronRight, Circle } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport {\n menuContentPadding,\n destructiveMenuItem,\n menuItem,\n menuLabel,\n menuSeparator,\n overlayMotion,\n overlaySurface,\n popoverArrow,\n} from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\n/**\n * DropdownMenu.\n *\n * A list of actions on a trigger, with radio groups for persistent choices\n * that fit naturally in a compact menu. Use Select for form inputs whose\n * selected value needs the field-style control, and Popover for arbitrary\n * content.\n *\n * Kobalte supplies the full menu contract — arrow keys, typeahead, the roving\n * highlight, Escape to close and return focus — which is exactly what a\n * hand-rolled `div` with click handlers gets wrong.\n * Menus are nonmodal by default so their generated focus guards do not become\n * invalid direct children of the ARIA menu. Set `modal` explicitly when the\n * surrounding interaction needs modal containment.\n *\n * The `destructive` variant marks the row with a status-coloured edge and\n * highlighted tint while keeping its label on the body foreground. Pairing it\n * with an AlertDialog is the caller's job.\n */\nexport function DropdownMenu(props: ComponentProps<typeof KobalteDropdownMenu>) {\n const [local, rest] = splitProps(props, ['modal'])\n return <KobalteDropdownMenu modal={local.modal ?? false} {...rest} />\n}\n\nexport function DropdownMenuTrigger(props: ComponentProps<typeof KobalteDropdownMenu.Trigger>) {\n return <KobalteDropdownMenu.Trigger {...props} />\n}\n\nexport function DropdownMenuPortal(props: ComponentProps<typeof KobalteDropdownMenu.Portal>) {\n return <KobalteDropdownMenu.Portal {...props} />\n}\n\nexport type DropdownMenuContentProps = ComponentProps<typeof KobalteDropdownMenu.Content> & {\n hideArrow?: boolean\n /** Mount under an owner element such as a modal, keeping the menu in its accessible subtree. */\n portalMount?: HTMLElement\n}\n\nexport function DropdownMenuContent(props: DropdownMenuContentProps) {\n const [local, rest] = splitProps(props, ['class', 'hideArrow', 'children', 'portalMount'])\n\n return (\n <KobalteDropdownMenu.Portal mount={local.portalMount}>\n <KobalteDropdownMenu.Content\n class={cn(\n overlaySurface,\n overlayMotion,\n 'z-(--z-menu) min-w-[10rem] origin-(--kb-menu-content-transform-origin) overflow-hidden',\n menuContentPadding,\n local.class\n )}\n {...rest}\n >\n {!local.hideArrow && <KobalteDropdownMenu.Arrow aria-hidden=\"true\" class={popoverArrow} />}\n {local.children}\n </KobalteDropdownMenu.Content>\n </KobalteDropdownMenu.Portal>\n )\n}\n\nexport function DropdownMenuItem(\n props: ComponentProps<typeof KobalteDropdownMenu.Item> & {\n /** Colour the row as a destructive action. Confirm it separately. */\n variant?: 'default' | 'destructive'\n /** Draw a shortcut hint at the trailing edge of the row. */\n shortcut?: string\n }\n) {\n const [local, rest] = splitProps(props, ['class', 'variant', 'shortcut', 'children'])\n\n return (\n <KobalteDropdownMenu.Item\n class={cn(\n menuItem,\n {\n [destructiveMenuItem]: local.variant === 'destructive',\n },\n local.class\n )}\n {...rest}\n >\n {local.children}\n {local.shortcut ? (\n <span class=\"text-muted-foreground ms-auto font-mono text-2xs tracking-widest\">\n {local.shortcut}\n </span>\n ) : null}\n </KobalteDropdownMenu.Item>\n )\n}\n\n/**\n * The chord drawn at a row's trailing edge.\n *\n * A component as well as the `shortcut` prop on an item, because a caller composing\n * a row by hand needs the same treatment — and because the alternative is every\n * caller inventing the same mono-and-dimmed span.\n */\nexport function DropdownMenuShortcut(props: ComponentProps<'span'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n class={cn('text-muted-foreground ms-auto font-mono text-2xs tracking-widest', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DropdownMenuCheckboxItem(\n props: ComponentProps<typeof KobalteDropdownMenu.CheckboxItem>\n) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteDropdownMenu.CheckboxItem class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n {local.children}\n <KobalteDropdownMenu.ItemIndicator class=\"absolute end-2 flex size-4 items-center justify-center\">\n <Check class=\"size-4\" />\n </KobalteDropdownMenu.ItemIndicator>\n </KobalteDropdownMenu.CheckboxItem>\n )\n}\n\nexport function DropdownMenuRadioGroup(\n props: ComponentProps<typeof KobalteDropdownMenu.RadioGroup>\n) {\n return <KobalteDropdownMenu.RadioGroup {...props} />\n}\n\nexport function DropdownMenuRadioItem(props: ComponentProps<typeof KobalteDropdownMenu.RadioItem>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteDropdownMenu.RadioItem class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n {local.children}\n <KobalteDropdownMenu.ItemIndicator class=\"absolute end-2 flex size-4 items-center justify-center\">\n <Circle class=\"size-2 fill-current\" />\n </KobalteDropdownMenu.ItemIndicator>\n </KobalteDropdownMenu.RadioItem>\n )\n}\n\nexport function DropdownMenuLabel(props: ComponentProps<typeof KobalteDropdownMenu.GroupLabel>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDropdownMenu.GroupLabel class={cn(menuLabel, local.class)} {...rest} />\n}\n\nexport function DropdownMenuGroup(props: ComponentProps<typeof KobalteDropdownMenu.Group>) {\n return <KobalteDropdownMenu.Group {...props} />\n}\n\nexport function DropdownMenuSeparator(props: ComponentProps<typeof KobalteDropdownMenu.Separator>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDropdownMenu.Separator class={cn(menuSeparator, local.class)} {...rest} />\n}\n\nexport function DropdownMenuSub(props: ComponentProps<typeof KobalteDropdownMenu.Sub>) {\n return <KobalteDropdownMenu.Sub {...props} />\n}\n\nexport function DropdownMenuSubTrigger(\n props: ComponentProps<typeof KobalteDropdownMenu.SubTrigger>\n) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteDropdownMenu.SubTrigger class={cn(menuItem, local.class)} {...rest}>\n {local.children}\n <ChevronRight class=\"ms-auto size-4\" />\n </KobalteDropdownMenu.SubTrigger>\n )\n}\n\nexport function DropdownMenuSubContent(\n props: ComponentProps<typeof KobalteDropdownMenu.SubContent>\n) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteDropdownMenu.Portal>\n <KobalteDropdownMenu.SubContent\n class={cn(\n overlaySurface,\n overlayMotion,\n 'z-(--z-menu) min-w-[8rem] origin-(--kb-menu-content-transform-origin) overflow-hidden',\n menuContentPadding,\n local.class\n )}\n {...rest}\n />\n </KobalteDropdownMenu.Portal>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,SAAgBA,eAAagB,OAAmD;CAC9E,MAAM,CAACC,OAAOC,QAAQZ,WAAWU,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBAAQlB,cAAmBmB,WAAA,EAAA,IAACC,QAAK;EAAA,OAAEJ,MAAMI,SAAS;CAAK,EAAA,GAAMH,IAAI,CAAA;AACnE;AAEA,SAAgBI,oBAAoBN,OAA2D;CAC7F,OAAAG,gBAAQlB,aAAoBsB,SAAYP,KAAK;AAC/C;AAEA,SAAgBQ,mBAAmBR,OAA0D;CAC3F,OAAAG,gBAAQlB,aAAoBwB,QAAWT,KAAK;AAC9C;AAQA,SAAgBe,oBAAoBf,OAAiC;CACnE,MAAM,CAACC,OAAOC,QAAQZ,WAAWU,OAAO;EAAC;EAAS;EAAa;EAAY;CAAa,CAAC;CAEzF,OAAAG,gBACGlB,aAAoBwB,QAAM;EAAA,IAACO,QAAK;GAAA,OAAEf,MAAMY;EAAW;EAAA,IAAAI,WAAA;GAAA,OAAAd,gBACjDlB,aAAoB0B,SAAOP,WAAA,EAAA,KAAA,WAAA;IAAA,OACnBL,GACLF,gBACAD,e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<'span'>, 'children'> & {
35
35
  tone?: StatusTone;
36
36
  label: string;
37
+ /** Visually hide the text while preserving it for assistive technology. */
38
+ compact?: boolean;
37
39
  /** Why the status is what it is. Shown in a tooltip; omit for a self-evident label. */
38
40
  detail?: string;
39
41
  /** A trailing slot: a timestamp, a retry affordance, a count. */
@@ -1 +1 @@
1
- {"version":3,"file":"status-chip.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/status-chip/status-chip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,cAAc,EAAE,KAAK,GAAG,EAAE,MAAM,UAAU,CAAA;AAK1E;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,iBAAiB;;8EAY5B,CAAA;AAWF,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAA;AAE1F,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,GAAG;IACvE,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,uFAAuF;IACvF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,iEAAiE;IACjE,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CACvB,CAAA;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,eAgChD;AAED,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;IACjC,gCAAgC;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,UAAU,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAC,CAAA;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE;IAChC,OAAO,EAAE,SAAS,WAAW,EAAE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,gFAAgF;IAChF,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,eAeA"}
@@ -4,7 +4,7 @@ import { Tooltip, TooltipContent, TooltipTrigger } from "../tooltip/tooltip.js";
4
4
  import { className, createComponent, effect, insert, mergeProps, spread, template } from "solid-js/web";
5
5
  import { Show, splitProps } from "solid-js";
6
6
  //#region src/components/ui/status-chip/status-chip.tsx
7
- var _tmpl$ = /*#__PURE__*/ template(`<span><span aria-hidden=true>`);
7
+ var _tmpl$ = /*#__PURE__*/ template(`<span><span aria-hidden=true></span><span>`);
8
8
  var _tmpl$2 = /*#__PURE__*/ template(`<dl>`);
9
9
  var _tmpl$3 = /*#__PURE__*/ template(`<dt class=text-muted-foreground>`);
10
10
  var _tmpl$4 = /*#__PURE__*/ template(`<div class="flex items-baseline justify-between gap-4"><dd>`);
@@ -59,18 +59,27 @@ function StatusChip(props) {
59
59
  const [local, rest] = splitProps(props, [
60
60
  "tone",
61
61
  "label",
62
+ "compact",
62
63
  "detail",
63
64
  "trailing",
64
65
  "class"
65
66
  ]);
66
67
  const chip = (() => {
67
- var _el$ = _tmpl$(), _el$2 = _el$.firstChild;
68
+ var _el$ = _tmpl$(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
68
69
  spread(_el$, mergeProps({ get ["class"]() {
69
70
  return cn("inline-flex w-fit items-center gap-1.5 text-xs font-medium whitespace-nowrap", labelTone[local.tone ?? "neutral"], local.class);
70
71
  } }, rest), false, true);
71
- insert(_el$, () => local.label, null);
72
+ insert(_el$3, () => local.label);
72
73
  insert(_el$, () => local.trailing, null);
73
- effect(() => className(_el$2, statusDotVariants({ tone: local.tone })));
74
+ effect((_p$) => {
75
+ var _v$ = statusDotVariants({ tone: local.tone }), _v$2 = cn(local.compact && "sr-only");
76
+ _v$ !== _p$.e && className(_el$2, _p$.e = _v$);
77
+ _v$2 !== _p$.t && className(_el$3, _p$.t = _v$2);
78
+ return _p$;
79
+ }, {
80
+ e: void 0,
81
+ t: void 0
82
+ });
74
83
  return _el$;
75
84
  })();
76
85
  return createComponent(Show, {
@@ -107,20 +116,20 @@ function StatusChip(props) {
107
116
  */
108
117
  function StatusList(props) {
109
118
  return (() => {
110
- var _el$3 = _tmpl$2();
111
- insert(_el$3, () => props.entries.map((entry) => (() => {
112
- var _el$4 = _tmpl$4(), _el$6 = _el$4.firstChild;
113
- insert(_el$4, createComponent(Show, {
119
+ var _el$4 = _tmpl$2();
120
+ insert(_el$4, () => props.entries.map((entry) => (() => {
121
+ var _el$5 = _tmpl$4(), _el$7 = _el$5.firstChild;
122
+ insert(_el$5, createComponent(Show, {
114
123
  get when() {
115
124
  return !props.compact;
116
125
  },
117
126
  get children() {
118
- var _el$5 = _tmpl$3();
119
- insert(_el$5, () => entry.name);
120
- return _el$5;
127
+ var _el$6 = _tmpl$3();
128
+ insert(_el$6, () => entry.name);
129
+ return _el$6;
121
130
  }
122
- }), _el$6);
123
- insert(_el$6, createComponent(StatusChip, {
131
+ }), _el$7);
132
+ insert(_el$7, createComponent(StatusChip, {
124
133
  get tone() {
125
134
  return entry.tone;
126
135
  },
@@ -131,11 +140,11 @@ function StatusList(props) {
131
140
  return entry.detail;
132
141
  }
133
142
  }));
134
- effect(() => className(_el$6, cn(!props.compact && "shrink-0")));
135
- return _el$4;
143
+ effect(() => className(_el$7, cn(!props.compact && "shrink-0")));
144
+ return _el$5;
136
145
  })()));
137
- effect(() => className(_el$3, cn("grid gap-2 text-sm", props.class)));
138
- return _el$3;
146
+ effect(() => className(_el$4, cn("grid gap-2 text-sm", props.class)));
147
+ return _el$4;
139
148
  })();
140
149
  }
141
150
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"status-chip.js","names":["Show","splitProps","ComponentProps","JSX","cva","cn","Tooltip","TooltipContent","TooltipTrigger","statusDotVariants","variants","tone","neutral","success","warning","danger","info","unknown","defaultVariants","labelTone","Record","StatusTone","StatusChipProps","Omit","label","detail","trailing","Element","StatusChip","props","local","rest","chip","_el$","_tmpl$","_el$2","firstChild","_$spread","_$mergeProps","class","_$insert","_$effect","_$className","_$createComponent","when","fallback","children","as","hideArrow","StatusEntry","Readonly","id","name","StatusList","entries","compact","_el$3","_tmpl$2","map","entry","_el$4","_tmpl$4","_el$6","_el$5","_tmpl$3","_$mergeProps","_$className","_$createComponent"],"sources":["../../../../src/components/ui/status-chip/status-chip.tsx"],"sourcesContent":["import { Show, splitProps, type ComponentProps, type JSX } from 'solid-js'\nimport { cva } from '#lib/variants'\nimport { cn } from '#lib/utils'\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../tooltip'\n\n/**\n * StatusChip.\n *\n * A state, said in one word, with the reason available on hover. It exists\n * because a status readout has three parts that are always the same three parts —\n * a tone, a label, and the detail that justifies the label — and rendering them\n * ad hoc produces the two failures this component is here to prevent: a colour\n * with no text (unreadable to anyone who cannot see it) and a bare word with no\n * explanation (\"Needs configuration\" — of what?).\n *\n * The tones are deliberately not a rainbow. Six cover what a status can actually\n * mean:\n *\n * - `neutral` — fine, and there is nothing to say about it.\n * - `success` — a check passed, a capability is ready, a job finished.\n * - `warning` — degraded, or needs a decision from the user.\n * - `danger` — blocked, failed, unrecoverable without intervention.\n * - `info` — in flight or scheduled; work is happening, nothing is wrong.\n * - `unknown` — the honest absence of information.\n *\n * `unknown` is not the same as `neutral`, and collapsing them is the mistake\n * worth avoiding: \"this is idle\" and \"we have not been told yet\" are different\n * facts, and a product that shows the second as the first is lying quietly. The\n * ring is hollow so it also reads as different in greyscale.\n *\n * The dot is `aria-hidden` and the label carries the meaning, so a tone is never\n * the only signal.\n */\nexport const statusDotVariants = cva('size-2 shrink-0 rounded-full', {\n variants: {\n tone: {\n neutral: 'bg-muted-foreground',\n success: 'bg-success',\n warning: 'bg-warning',\n danger: 'bg-destructive',\n info: 'bg-info',\n unknown: 'border border-muted-foreground bg-transparent',\n },\n },\n defaultVariants: { tone: 'neutral' },\n})\n\nconst labelTone: Record<StatusTone, string> = {\n neutral: 'text-foreground',\n success: 'text-foreground',\n warning: 'text-foreground',\n danger: 'text-foreground',\n info: 'text-foreground',\n unknown: 'text-muted-foreground',\n}\n\nexport type StatusTone = 'neutral' | 'success' | 'warning' | 'danger' | 'info' | 'unknown'\n\nexport type StatusChipProps = Omit<ComponentProps<'span'>, 'children'> & {\n tone?: StatusTone\n label: string\n /** Why the status is what it is. Shown in a tooltip; omit for a self-evident label. */\n detail?: string\n /** A trailing slot: a timestamp, a retry affordance, a count. */\n trailing?: JSX.Element\n}\n\nexport function StatusChip(props: StatusChipProps) {\n const [local, rest] = splitProps(props, ['tone', 'label', 'detail', 'trailing', 'class'])\n\n const chip = (\n <span\n class={cn(\n 'inline-flex w-fit items-center gap-1.5 text-xs font-medium whitespace-nowrap',\n labelTone[local.tone ?? 'neutral'],\n local.class\n )}\n {...rest}\n >\n <span class={statusDotVariants({ tone: local.tone })} aria-hidden=\"true\" />\n {local.label}\n {local.trailing}\n </span>\n )\n\n return (\n <Show when={local.detail} fallback={chip}>\n {(detail) => (\n <Tooltip>\n <TooltipTrigger as=\"span\" class=\"inline-flex\">\n {chip}\n </TooltipTrigger>\n <TooltipContent data-slot=\"tooltip-content\" hideArrow>\n {detail()}\n </TooltipContent>\n </Tooltip>\n )}\n </Show>\n )\n}\n\nexport type StatusEntry = Readonly<{\n /** A stable key for the row. */\n id: string\n /** What is being reported — \"Configuration\", \"Runtime\", \"Sync\". */\n name: string\n tone: StatusTone\n label: string\n detail?: string\n}>\n\n/**\n * StatusList.\n *\n * The several-facts-about-one-thing shape: an agent with a configuration state, a\n * runtime state and an activity state; a service with a build, a deploy and a\n * health check. It is a definition list rather than a table because there is no\n * column to sort or compare — the rows are facets of a single subject, and a\n * screen reader should hear them as such.\n *\n * Fixed width on the name column is what makes a column of these scannable; the\n * rows line up without a table's semantics.\n */\nexport function StatusList(props: {\n entries: readonly StatusEntry[]\n class?: string\n /** Hide the name column and show only the chips — for a compact badge strip. */\n compact?: boolean\n}) {\n return (\n <dl class={cn('grid gap-2 text-sm', props.class)}>\n {props.entries.map((entry) => (\n <div class=\"flex items-baseline justify-between gap-4\">\n <Show when={!props.compact}>\n <dt class=\"text-muted-foreground\">{entry.name}</dt>\n </Show>\n <dd class={cn(!props.compact && 'shrink-0')}>\n <StatusChip tone={entry.tone} label={entry.label} detail={entry.detail} />\n </dd>\n </div>\n ))}\n </dl>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,IAAaS,oBAAoBL,IAAI,gCAAgC;CACnEM,UAAU,EACRC,MAAM;EACJC,SAAS;EACTC,SAAS;EACTC,SAAS;EACTC,QAAQ;EACRC,MAAM;EACNC,SAAS;CACX,EACF;CACAC,iBAAiB,EAAEP,MAAM,UAAU;AACrC,CAAC;AAED,IAAMQ,YAAwC;CAC5CP,SAAS;CACTC,SAAS;CACTC,SAAS;CACTC,QAAQ;CACRC,MAAM;CACNC,SAAS;AACX;AAaA,SAAgBW,WAAWC,OAAwB;CACjD,MAAM,CAACC,OAAOC,QAAQ9B,WAAW4B,OAAO;EAAC;EAAQ;EAAS;EAAU;EAAY;CAAO,CAAC;CAExF,MAAMG,cAAI;EAAA,IAAAC,OAAAC,OAAA,GAAAC,QAAAF,KAAAG;EAAAC,OAAAJ,MAAAK,WAAA,EAAA,KAAA,WAAA;GAAA,OAECjC,GACL,gFACAc,UAAUW,MAAMnB,QAAQ,YACxBmB,MAAMS,KACR;EAAC,EAAA,GACGR,IAAI,GAAA,OAAA,IAAA;EAAAS,OAAAP,YAGPH,MAAMN,OAAK,IAAA;EAAAgB,OAAAP,YACXH,MAAMJ,UAAQ,IAAA;EAAAe,aAAAC,UAAAP,OAFF1B,kBAAkB,EAAEE,MAAMmB,MAAMnB,KAAK,CAAC,CAAC,CAAA;EAAA,OAAAsB;CAAA,EAAA,CAAA;CAMxD,OAAAU,gBACG3C,MAAI;EAAA,IAAC4C,OAAI;GAAA,OAAEd,MAAML;EAAM;EAAEoB,UAAUb;EAAIc,WACpCrB,WAAMkB,gBACLrC,SAAO,EAAA,IAAAwC,WAAA;GAAA,OAAA,CAAAH,gBACLnC,gBAAc;IAACuC,IAAE;IAAA,SAAA;IAAAD,UACfd;GAAI,CAAA,GAAAW,gBAENpC,gBAAc;IAAA,aAAA;IAA6ByC,WAAS;IAAA,IAAAF,WAAA;KAAA,OAClDrB,OAAO;IAAC;GAAA,CAAA,CAAA;EAAA,EAAA,CAAA;CAGd,CAAA;AAGP;;;;;;;;;;;;;AAwBA,SAAgB4B,WAAWxB,OAKxB;CACD,cAAA;EAAA,IAAA2B,QAAAC,QAAA;EAAAjB,OAAAgB,aAEK3B,MAAMyB,QAAQI,KAAKC,iBAAK;GAAA,IAAAC,QAAAC,QAAA,GAAAC,QAAAF,MAAAxB;GAAAI,OAAAoB,OAAAjB,gBAEpB3C,MAAI;IAAA,IAAC4C,OAAI;KAAA,OAAE,CAACf,MAAM0B;IAAO;IAAA,IAAAT,WAAA;KAAA,IAAAiB,QAAAC,QAAA;KAAAxB,OAAAuB,aACWJ,MAAMP,IAAI;KAAA,OAAAW;IAAA;GAAA,CAAA,GAAAD,KAAA;GAAAtB,OAAAsB,OAAAnB,gBAG5Cf,YAAU;IAAA,IAACjB,OAAI;KAAA,OAAEgD,MAAMhD;IAAI;IAAA,IAAEa,QAAK;KAAA,OAAEmC,MAAMnC;IAAK;IAAA,IAAEC,SAAM;KAAA,OAAEkC,MAAMlC;IAAM;GAAA,CAAA,CAAA;GAAAgB,aAAAC,UAAAoB,OAD7DzD,GAAG,CAACwB,MAAM0B,WAAW,UAAU,CAAC,CAAA;GAAA,OAAAK;EAAA,EAAA,CAAA,CAI9C,CAAC;EAAAnB,aAAAC,UAAAc,OAVOnD,GAAG,sBAAsBwB,MAAMU,KAAK,CAAC,CAAA;EAAA,OAAAiB;CAAA,EAAA,CAAA;AAapD"}
1
+ {"version":3,"file":"status-chip.js","names":["Show","splitProps","ComponentProps","JSX","cva","cn","Tooltip","TooltipContent","TooltipTrigger","statusDotVariants","variants","tone","neutral","success","warning","danger","info","unknown","defaultVariants","labelTone","Record","StatusTone","StatusChipProps","Omit","label","compact","detail","trailing","Element","StatusChip","props","local","rest","chip","_el$","_tmpl$","_el$2","firstChild","_el$3","nextSibling","_$spread","_$mergeProps","class","_$insert","_$effect","_p$","_v$","_v$2","e","_$className","t","undefined","_$createComponent","when","fallback","children","as","hideArrow","StatusEntry","Readonly","id","name","StatusList","entries","_el$4","_tmpl$2","map","entry","_el$5","_tmpl$4","_el$7","_el$6","_tmpl$3","_$mergeProps","_$className","_$createComponent"],"sources":["../../../../src/components/ui/status-chip/status-chip.tsx"],"sourcesContent":["import { Show, splitProps, type ComponentProps, type JSX } from 'solid-js'\nimport { cva } from '#lib/variants'\nimport { cn } from '#lib/utils'\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../tooltip'\n\n/**\n * StatusChip.\n *\n * A state, said in one word, with the reason available on hover. It exists\n * because a status readout has three parts that are always the same three parts —\n * a tone, a label, and the detail that justifies the label — and rendering them\n * ad hoc produces the two failures this component is here to prevent: a colour\n * with no text (unreadable to anyone who cannot see it) and a bare word with no\n * explanation (\"Needs configuration\" — of what?).\n *\n * The tones are deliberately not a rainbow. Six cover what a status can actually\n * mean:\n *\n * - `neutral` — fine, and there is nothing to say about it.\n * - `success` — a check passed, a capability is ready, a job finished.\n * - `warning` — degraded, or needs a decision from the user.\n * - `danger` — blocked, failed, unrecoverable without intervention.\n * - `info` — in flight or scheduled; work is happening, nothing is wrong.\n * - `unknown` — the honest absence of information.\n *\n * `unknown` is not the same as `neutral`, and collapsing them is the mistake\n * worth avoiding: \"this is idle\" and \"we have not been told yet\" are different\n * facts, and a product that shows the second as the first is lying quietly. The\n * ring is hollow so it also reads as different in greyscale.\n *\n * The dot is `aria-hidden` and the label carries the meaning, so a tone is never\n * the only signal.\n */\nexport const statusDotVariants = cva('size-2 shrink-0 rounded-full', {\n variants: {\n tone: {\n neutral: 'bg-muted-foreground',\n success: 'bg-success',\n warning: 'bg-warning',\n danger: 'bg-destructive',\n info: 'bg-info',\n unknown: 'border border-muted-foreground bg-transparent',\n },\n },\n defaultVariants: { tone: 'neutral' },\n})\n\nconst labelTone: Record<StatusTone, string> = {\n neutral: 'text-foreground',\n success: 'text-foreground',\n warning: 'text-foreground',\n danger: 'text-foreground',\n info: 'text-foreground',\n unknown: 'text-muted-foreground',\n}\n\nexport type StatusTone = 'neutral' | 'success' | 'warning' | 'danger' | 'info' | 'unknown'\n\nexport type StatusChipProps = Omit<ComponentProps<'span'>, 'children'> & {\n tone?: StatusTone\n label: string\n /** Visually hide the text while preserving it for assistive technology. */\n compact?: boolean\n /** Why the status is what it is. Shown in a tooltip; omit for a self-evident label. */\n detail?: string\n /** A trailing slot: a timestamp, a retry affordance, a count. */\n trailing?: JSX.Element\n}\n\nexport function StatusChip(props: StatusChipProps) {\n const [local, rest] = splitProps(props, [\n 'tone',\n 'label',\n 'compact',\n 'detail',\n 'trailing',\n 'class',\n ])\n\n const chip = (\n <span\n class={cn(\n 'inline-flex w-fit items-center gap-1.5 text-xs font-medium whitespace-nowrap',\n labelTone[local.tone ?? 'neutral'],\n local.class\n )}\n {...rest}\n >\n <span class={statusDotVariants({ tone: local.tone })} aria-hidden=\"true\" />\n <span class={cn(local.compact && 'sr-only')}>{local.label}</span>\n {local.trailing}\n </span>\n )\n\n return (\n <Show when={local.detail} fallback={chip}>\n {(detail) => (\n <Tooltip>\n <TooltipTrigger as=\"span\" class=\"inline-flex\">\n {chip}\n </TooltipTrigger>\n <TooltipContent data-slot=\"tooltip-content\" hideArrow>\n {detail()}\n </TooltipContent>\n </Tooltip>\n )}\n </Show>\n )\n}\n\nexport type StatusEntry = Readonly<{\n /** A stable key for the row. */\n id: string\n /** What is being reported — \"Configuration\", \"Runtime\", \"Sync\". */\n name: string\n tone: StatusTone\n label: string\n detail?: string\n}>\n\n/**\n * StatusList.\n *\n * The several-facts-about-one-thing shape: an agent with a configuration state, a\n * runtime state and an activity state; a service with a build, a deploy and a\n * health check. It is a definition list rather than a table because there is no\n * column to sort or compare — the rows are facets of a single subject, and a\n * screen reader should hear them as such.\n *\n * Fixed width on the name column is what makes a column of these scannable; the\n * rows line up without a table's semantics.\n */\nexport function StatusList(props: {\n entries: readonly StatusEntry[]\n class?: string\n /** Hide the name column and show only the chips — for a compact badge strip. */\n compact?: boolean\n}) {\n return (\n <dl class={cn('grid gap-2 text-sm', props.class)}>\n {props.entries.map((entry) => (\n <div class=\"flex items-baseline justify-between gap-4\">\n <Show when={!props.compact}>\n <dt class=\"text-muted-foreground\">{entry.name}</dt>\n </Show>\n <dd class={cn(!props.compact && 'shrink-0')}>\n <StatusChip tone={entry.tone} label={entry.label} detail={entry.detail} />\n </dd>\n </div>\n ))}\n </dl>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,IAAaS,oBAAoBL,IAAI,gCAAgC;CACnEM,UAAU,EACRC,MAAM;EACJC,SAAS;EACTC,SAAS;EACTC,SAAS;EACTC,QAAQ;EACRC,MAAM;EACNC,SAAS;CACX,EACF;CACAC,iBAAiB,EAAEP,MAAM,UAAU;AACrC,CAAC;AAED,IAAMQ,YAAwC;CAC5CP,SAAS;CACTC,SAAS;CACTC,SAAS;CACTC,QAAQ;CACRC,MAAM;CACNC,SAAS;AACX;AAeA,SAAgBY,WAAWC,OAAwB;CACjD,MAAM,CAACC,OAAOC,QAAQ/B,WAAW6B,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;CAAO,CACR;CAED,MAAMG,cAAI;EAAA,IAAAC,OAAAC,OAAA,GAAAC,QAAAF,KAAAG,YAAAC,QAAAF,MAAAG;EAAAC,OAAAN,MAAAO,WAAA,EAAA,KAAA,WAAA;GAAA,OAECpC,GACL,gFACAc,UAAUY,MAAMpB,QAAQ,YACxBoB,MAAMW,KACR;EAAC,EAAA,GACGV,IAAI,GAAA,OAAA,IAAA;EAAAW,OAAAL,aAGsCP,MAAMP,KAAK;EAAAmB,OAAAT,YACxDH,MAAMJ,UAAQ,IAAA;EAAAi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AA,OAAEwD,MAAMxD;IAAI;IAAA,IAAEa,QAAK;KAAA,OAAE2C,MAAM3C;IAAK;IAAA,IAAEE,SAAM;KAAA,OAAEyC,MAAMzC;IAAM;GAAA,CAAA,CAAA;GAAAkB,aAAAK,UAAAqB,OAD7DjE,GAAG,CAACyB,MAAML,WAAW,UAAU,CAAC,CAAA;GAAA,OAAA2C;EAAA,EAAA,CAAA,CAI9C,CAAC;EAAAxB,aAAAK,UAAAe,OAVO3D,GAAG,sBAAsByB,MAAMY,KAAK,CAAC,CAAA;EAAA,OAAAsB;CAAA,EAAA,CAAA;AAapD"}
package/dist/index.d.ts CHANGED
@@ -73,6 +73,8 @@ export * from './components/ui/toggle-group';
73
73
  export * from './components/ui/tooltip';
74
74
  export * from './components/motion';
75
75
  export * from './components/layout/split-layout';
76
+ export * from './components/layout/orbit-layout';
77
+ export * from './components/layout/virtual-window';
76
78
  export * from './components/layout/app-shell';
77
79
  export * from './components/layout/page';
78
80
  export * from './components/layout/panel';