@askrjs/themes 0.0.23 → 0.0.24
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/README.md +4 -0
- package/capabilities.json +1 -1
- package/dist/components/command-palette/command-palette.d.ts +11 -0
- package/dist/components/command-palette/command-palette.js +153 -0
- package/dist/components/command-palette/command-palette.js.map +1 -0
- package/dist/components/command-palette/command-palette.types.d.ts +30 -0
- package/dist/components/command-palette/index.d.ts +3 -0
- package/dist/components/nav/nav.types.d.ts +1 -1
- package/dist/components.d.ts +4 -1
- package/dist/components.js +3 -2
- package/dist/entries/command.d.ts +4 -1
- package/dist/entries/command.js +2 -1
- package/dist/entries/tabs.js +1 -1
- package/dist/themes/default/index.css +38 -0
- package/package.json +6 -6
- package/src/components/command-palette/command-palette.tsx +242 -0
- package/src/components/command-palette/command-palette.types.ts +40 -0
- package/src/components/command-palette/index.ts +15 -0
- package/src/components.ts +8 -0
- package/src/entries/command.ts +15 -0
- package/src/parity.ts +1 -0
- package/src/themes/default/styles/display/catalog.css +38 -0
package/README.md
CHANGED
|
@@ -49,6 +49,10 @@ the batteries-included theme.
|
|
|
49
49
|
See [Acknowledgements](./docs/acknowledgements.md) for the open-source projects
|
|
50
50
|
that inspired parts of the design philosophy.
|
|
51
51
|
|
|
52
|
+
For documentation search and command launchers, use the accessible
|
|
53
|
+
`CommandPalette` composition from `@askrjs/themes/command`; it owns themed
|
|
54
|
+
presentation while `@askrjs/ui` supplies dialog focus and dismissal behavior.
|
|
55
|
+
|
|
52
56
|
Then set `data-theme` to `tabby`, `ginger`, `tuxedo`, `calico`, or `torty`.
|
|
53
57
|
For picker/toggle composition, import `CAT_THEME_OPTIONS` and `CAT_THEME_NAMES`
|
|
54
58
|
from `@askrjs/themes/theme`.
|
package/capabilities.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"intent": "component presets and layout helpers",
|
|
17
17
|
"package": "@askrjs/themes",
|
|
18
18
|
"import": "@askrjs/themes/components",
|
|
19
|
-
"exports": ["EmptyState", "Spinner", "Badge", "Stack", "Button"],
|
|
19
|
+
"exports": ["EmptyState", "Spinner", "Badge", "Stack", "Button", "CommandPalette"],
|
|
20
20
|
"constraints": ["presets compose headless @askrjs/ui primitives"],
|
|
21
21
|
"stability": "stable",
|
|
22
22
|
"docs": "https://github.com/askrjs/askr-themes/blob/main/THEMING.md",
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CommandPaletteContentProps, CommandPaletteLinkProps, CommandPaletteListProps, CommandPaletteProps, CommandPaletteTriggerAsChildProps, CommandPaletteTriggerProps } from "./command-palette.types.js";
|
|
2
|
+
import { JSX } from "@askrjs/askr/jsx-runtime";
|
|
3
|
+
//#region src/components/command-palette/command-palette.d.ts
|
|
4
|
+
declare function CommandPalette(props: CommandPaletteProps): JSX.Element;
|
|
5
|
+
declare function CommandPaletteTrigger(props: CommandPaletteTriggerProps): JSX.Element;
|
|
6
|
+
declare function CommandPaletteTrigger(props: CommandPaletteTriggerAsChildProps): JSX.Element;
|
|
7
|
+
declare function CommandPaletteContent(props: CommandPaletteContentProps): JSX.Element;
|
|
8
|
+
declare function CommandPaletteLink(props: CommandPaletteLinkProps): JSX.Element;
|
|
9
|
+
declare function CommandPaletteList(props: CommandPaletteListProps): JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { CommandPalette, CommandPaletteContent, CommandPaletteLink, CommandPaletteList, CommandPaletteTrigger };
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { classes } from "../_internal/classes.js";
|
|
2
|
+
import { Command } from "../catalog.js";
|
|
3
|
+
import { Dialog, DialogContent, DialogDescription, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "@askrjs/ui";
|
|
4
|
+
import { jsx, jsxs } from "@askrjs/askr/jsx-runtime";
|
|
5
|
+
import { defineScope, readScope, state } from "@askrjs/askr";
|
|
6
|
+
import { Link } from "@askrjs/askr/router";
|
|
7
|
+
import { controllableState } from "@askrjs/askr/foundations/state";
|
|
8
|
+
import { composeRefs } from "@askrjs/askr/foundations/utilities";
|
|
9
|
+
//#region src/components/command-palette/command-palette.tsx
|
|
10
|
+
const CommandPaletteContext = defineScope(null);
|
|
11
|
+
function readCommandPaletteContext() {
|
|
12
|
+
const context = readScope(CommandPaletteContext);
|
|
13
|
+
if (!context) throw new Error("CommandPalette components must be used within <CommandPalette>");
|
|
14
|
+
return context;
|
|
15
|
+
}
|
|
16
|
+
function CommandPalette(props) {
|
|
17
|
+
const { children, defaultOpen = false, onOpenChange, open, ...rest } = props;
|
|
18
|
+
const openState = controllableState({
|
|
19
|
+
defaultValue: defaultOpen,
|
|
20
|
+
onChange: onOpenChange,
|
|
21
|
+
value: open
|
|
22
|
+
});
|
|
23
|
+
const focusState = state({
|
|
24
|
+
open: false,
|
|
25
|
+
returnFocus: null,
|
|
26
|
+
trigger: null
|
|
27
|
+
})();
|
|
28
|
+
const isOpen = openState();
|
|
29
|
+
if (isOpen && !focusState.open && typeof document !== "undefined") {
|
|
30
|
+
const active = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
31
|
+
focusState.returnFocus = active && active !== document.body ? active : focusState.trigger instanceof HTMLElement ? focusState.trigger : null;
|
|
32
|
+
}
|
|
33
|
+
focusState.open = isOpen;
|
|
34
|
+
const restoreFocusSoon = () => {
|
|
35
|
+
const returnFocus = focusState.returnFocus;
|
|
36
|
+
if (!returnFocus) return;
|
|
37
|
+
queueMicrotask(() => {
|
|
38
|
+
queueMicrotask(() => {
|
|
39
|
+
if (returnFocus.isConnected) returnFocus.focus();
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
return /* @__PURE__ */ jsx(CommandPaletteContext, {
|
|
44
|
+
value: {
|
|
45
|
+
close: () => openState.set(false),
|
|
46
|
+
restoreFocusSoon,
|
|
47
|
+
setTrigger: (node) => {
|
|
48
|
+
focusState.trigger = node;
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
children: /* @__PURE__ */ jsx(Dialog, {
|
|
52
|
+
...rest,
|
|
53
|
+
open: isOpen,
|
|
54
|
+
onOpenChange: openState.set,
|
|
55
|
+
children
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function CommandPaletteTrigger(props) {
|
|
60
|
+
const palette = readCommandPaletteContext();
|
|
61
|
+
const ref = props.ref ? composeRefs(props.ref, palette.setTrigger) : palette.setTrigger;
|
|
62
|
+
if (props.asChild) return /* @__PURE__ */ jsx(DialogTrigger, {
|
|
63
|
+
...props,
|
|
64
|
+
ref
|
|
65
|
+
});
|
|
66
|
+
return /* @__PURE__ */ jsx(DialogTrigger, {
|
|
67
|
+
...props,
|
|
68
|
+
ref
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function preventDismiss(event, shouldDismiss) {
|
|
72
|
+
if (!shouldDismiss) event.preventDefault();
|
|
73
|
+
}
|
|
74
|
+
function CommandPaletteContent(props) {
|
|
75
|
+
const palette = readCommandPaletteContext();
|
|
76
|
+
const { children, class: className, closeOnBackdrop = true, closeOnEscape = true, description, initialFocus = "[data-slot=\"command-input\"]", onEscapeKeyDown, onInteractOutside, onPointerDownOutside, overlayProps, ref, title, ...rest } = props;
|
|
77
|
+
const focusInitialTarget = (node) => {
|
|
78
|
+
if (!node) {
|
|
79
|
+
palette.restoreFocusSoon();
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (initialFocus === false) return;
|
|
83
|
+
queueMicrotask(() => {
|
|
84
|
+
if (!node.isConnected) return;
|
|
85
|
+
(typeof initialFocus === "function" ? initialFocus() : node.querySelector(initialFocus))?.focus();
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
const contentRef = ref ? composeRefs(ref, focusInitialTarget) : focusInitialTarget;
|
|
89
|
+
return /* @__PURE__ */ jsxs(DialogPortal, { children: [/* @__PURE__ */ jsx(DialogOverlay, {
|
|
90
|
+
...overlayProps,
|
|
91
|
+
"data-command-palette-overlay": ""
|
|
92
|
+
}), /* @__PURE__ */ jsxs(DialogContent, {
|
|
93
|
+
...rest,
|
|
94
|
+
class: className,
|
|
95
|
+
"data-command-palette-content": "",
|
|
96
|
+
ref: contentRef,
|
|
97
|
+
onEscapeKeyDown: (event) => {
|
|
98
|
+
onEscapeKeyDown?.(event);
|
|
99
|
+
preventDismiss(event, closeOnEscape);
|
|
100
|
+
},
|
|
101
|
+
onInteractOutside: (event) => {
|
|
102
|
+
onInteractOutside?.(event);
|
|
103
|
+
preventDismiss(event, closeOnBackdrop);
|
|
104
|
+
},
|
|
105
|
+
onPointerDownOutside: (event) => {
|
|
106
|
+
onPointerDownOutside?.(event);
|
|
107
|
+
preventDismiss(event, closeOnBackdrop);
|
|
108
|
+
},
|
|
109
|
+
children: [
|
|
110
|
+
/* @__PURE__ */ jsx(DialogTitle, {
|
|
111
|
+
class: "sr-only",
|
|
112
|
+
children: title
|
|
113
|
+
}),
|
|
114
|
+
description ? /* @__PURE__ */ jsx(DialogDescription, {
|
|
115
|
+
class: "sr-only",
|
|
116
|
+
children: description
|
|
117
|
+
}) : null,
|
|
118
|
+
/* @__PURE__ */ jsx(Command, { children })
|
|
119
|
+
]
|
|
120
|
+
})] });
|
|
121
|
+
}
|
|
122
|
+
function composeBeforeNavigate(close, closeOnSelect, beforeNavigate, onPress) {
|
|
123
|
+
return (event) => {
|
|
124
|
+
beforeNavigate?.();
|
|
125
|
+
if (!event.defaultPrevented) onPress?.(event);
|
|
126
|
+
if (closeOnSelect && !event.defaultPrevented) close();
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function CommandPaletteLink(props) {
|
|
130
|
+
const { children, class: className, closeOnSelect = true, onBeforeNavigate, onPress, ...rest } = props;
|
|
131
|
+
const palette = readCommandPaletteContext();
|
|
132
|
+
return /* @__PURE__ */ jsx("li", {
|
|
133
|
+
"data-command-palette-result": "",
|
|
134
|
+
children: /* @__PURE__ */ jsx(Link, {
|
|
135
|
+
...rest,
|
|
136
|
+
class: className,
|
|
137
|
+
"data-slot": "command-item",
|
|
138
|
+
onPress: composeBeforeNavigate(palette.close, closeOnSelect, onBeforeNavigate, onPress),
|
|
139
|
+
children
|
|
140
|
+
})
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
function CommandPaletteList(props) {
|
|
144
|
+
const { children, class: className, ...rest } = props;
|
|
145
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
146
|
+
...rest,
|
|
147
|
+
class: classes(className),
|
|
148
|
+
"data-slot": "command-list",
|
|
149
|
+
children
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
//#endregion
|
|
153
|
+
export { CommandPalette, CommandPaletteContent, CommandPaletteLink, CommandPaletteList, CommandPaletteTrigger };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-palette.js","names":[],"sources":["../../../src/components/command-palette/command-palette.tsx"],"sourcesContent":["import type { JSX } from \"@askrjs/askr/jsx-runtime\";\nimport { Link } from \"@askrjs/askr/router\";\nimport { defineScope, readScope, state } from \"@askrjs/askr\";\nimport { controllableState } from \"@askrjs/askr/foundations/state\";\nimport { composeRefs, type Ref } from \"@askrjs/askr/foundations/utilities\";\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n} from \"@askrjs/ui\";\nimport { Command } from \"../catalog\";\nimport { classes } from \"../_internal/classes\";\nimport type {\n CommandPaletteContentProps,\n CommandPaletteLinkProps,\n CommandPaletteListProps,\n CommandPaletteProps,\n CommandPaletteTriggerAsChildProps,\n CommandPaletteTriggerProps,\n} from \"./command-palette.types\";\n\ntype CommandPaletteContextValue = {\n close: () => void;\n restoreFocusSoon: () => void;\n setTrigger: (node: Element | null) => void;\n};\n\nconst CommandPaletteContext = defineScope<CommandPaletteContextValue | null>(null);\n\nfunction readCommandPaletteContext(): CommandPaletteContextValue {\n const context = readScope(CommandPaletteContext);\n if (!context) {\n throw new Error(\"CommandPalette components must be used within <CommandPalette>\");\n }\n return context;\n}\n\nexport function CommandPalette(props: CommandPaletteProps): JSX.Element {\n const { children, defaultOpen = false, onOpenChange, open, ...rest } = props;\n const openState = controllableState({\n defaultValue: defaultOpen,\n onChange: onOpenChange,\n value: open,\n });\n const focusState = state({\n open: false,\n returnFocus: null as HTMLElement | null,\n trigger: null as Element | null,\n })();\n const isOpen = openState();\n\n if (isOpen && !focusState.open && typeof document !== \"undefined\") {\n const active = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n focusState.returnFocus =\n active && active !== document.body\n ? active\n : focusState.trigger instanceof HTMLElement\n ? focusState.trigger\n : null;\n }\n focusState.open = isOpen;\n\n const restoreFocusSoon = () => {\n const returnFocus = focusState.returnFocus;\n if (!returnFocus) {\n return;\n }\n\n queueMicrotask(() => {\n queueMicrotask(() => {\n if (returnFocus.isConnected) {\n returnFocus.focus();\n }\n });\n });\n };\n\n return (\n <CommandPaletteContext\n value={{\n close: () => openState.set(false),\n restoreFocusSoon,\n setTrigger: (node) => {\n focusState.trigger = node;\n },\n }}\n >\n <Dialog {...rest} open={isOpen} onOpenChange={openState.set}>\n {children}\n </Dialog>\n </CommandPaletteContext>\n );\n}\n\nexport function CommandPaletteTrigger(props: CommandPaletteTriggerProps): JSX.Element;\nexport function CommandPaletteTrigger(props: CommandPaletteTriggerAsChildProps): JSX.Element;\nexport function CommandPaletteTrigger(\n props: CommandPaletteTriggerProps | CommandPaletteTriggerAsChildProps,\n): JSX.Element {\n const palette = readCommandPaletteContext();\n const ref = props.ref\n ? composeRefs(props.ref as Ref<Element>, palette.setTrigger)\n : palette.setTrigger;\n\n if (props.asChild) {\n return <DialogTrigger {...props} ref={ref} />;\n }\n\n return <DialogTrigger {...props} ref={ref as Ref<HTMLButtonElement>} />;\n}\n\nfunction preventDismiss(event: Event, shouldDismiss: boolean): void {\n if (!shouldDismiss) {\n event.preventDefault();\n }\n}\n\nexport function CommandPaletteContent(props: CommandPaletteContentProps): JSX.Element {\n const palette = readCommandPaletteContext();\n const {\n children,\n class: className,\n closeOnBackdrop = true,\n closeOnEscape = true,\n description,\n initialFocus = '[data-slot=\"command-input\"]',\n onEscapeKeyDown,\n onInteractOutside,\n onPointerDownOutside,\n overlayProps,\n ref,\n title,\n ...rest\n } = props;\n const focusInitialTarget = (node: HTMLDivElement | null) => {\n if (!node) {\n palette.restoreFocusSoon();\n return;\n }\n\n if (initialFocus === false) {\n return;\n }\n\n queueMicrotask(() => {\n if (!node.isConnected) {\n return;\n }\n\n const target =\n typeof initialFocus === \"function\"\n ? initialFocus()\n : node.querySelector<HTMLElement>(initialFocus);\n target?.focus();\n });\n };\n const contentRef = ref\n ? composeRefs(ref as Ref<HTMLDivElement>, focusInitialTarget)\n : focusInitialTarget;\n\n return (\n <DialogPortal>\n <DialogOverlay {...overlayProps} data-command-palette-overlay=\"\" />\n <DialogContent\n {...rest}\n class={className}\n data-command-palette-content=\"\"\n ref={contentRef}\n onEscapeKeyDown={(event) => {\n onEscapeKeyDown?.(event);\n preventDismiss(event, closeOnEscape);\n }}\n onInteractOutside={(event) => {\n onInteractOutside?.(event);\n preventDismiss(event, closeOnBackdrop);\n }}\n onPointerDownOutside={(event) => {\n onPointerDownOutside?.(event);\n preventDismiss(event, closeOnBackdrop);\n }}\n >\n <DialogTitle class=\"sr-only\">{title}</DialogTitle>\n {description ? <DialogDescription class=\"sr-only\">{description}</DialogDescription> : null}\n <Command>{children}</Command>\n </DialogContent>\n </DialogPortal>\n );\n}\n\nfunction composeBeforeNavigate(\n close: () => void,\n closeOnSelect: boolean,\n beforeNavigate: CommandPaletteLinkProps[\"onBeforeNavigate\"],\n onPress: CommandPaletteLinkProps[\"onPress\"],\n): (event: Event) => void {\n return (event) => {\n beforeNavigate?.();\n if (!event.defaultPrevented) {\n onPress?.(event);\n }\n if (closeOnSelect && !event.defaultPrevented) {\n close();\n }\n };\n}\n\nexport function CommandPaletteLink(props: CommandPaletteLinkProps): JSX.Element {\n const {\n children,\n class: className,\n closeOnSelect = true,\n onBeforeNavigate,\n onPress,\n ...rest\n } = props;\n const palette = readCommandPaletteContext();\n return (\n <li data-command-palette-result=\"\">\n <Link\n {...rest}\n class={className}\n data-slot=\"command-item\"\n onPress={composeBeforeNavigate(palette.close, closeOnSelect, onBeforeNavigate, onPress)}\n >\n {children}\n </Link>\n </li>\n );\n}\n\nexport function CommandPaletteList(props: CommandPaletteListProps): JSX.Element {\n const { children, class: className, ...rest } = props;\n return (\n <ul {...rest} class={classes(className)} data-slot=\"command-list\">\n {children}\n </ul>\n );\n}\n"],"mappings":";;;;;;;;;AA+BA,MAAM,wBAAwB,YAA+C,IAAI;AAEjF,SAAS,4BAAwD;CAC/D,MAAM,UAAU,UAAU,qBAAqB;CAC/C,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,gEAAgE;CAElF,OAAO;AACT;AAEA,SAAgB,eAAe,OAAyC;CACtE,MAAM,EAAE,UAAU,cAAc,OAAO,cAAc,MAAM,GAAG,SAAS;CACvE,MAAM,YAAY,kBAAkB;EAClC,cAAc;EACd,UAAU;EACV,OAAO;CACT,CAAC;CACD,MAAM,aAAa,MAAM;EACvB,MAAM;EACN,aAAa;EACb,SAAS;CACX,CAAC,CAAC,CAAC;CACH,MAAM,SAAS,UAAU;CAEzB,IAAI,UAAU,CAAC,WAAW,QAAQ,OAAO,aAAa,aAAa;EACjE,MAAM,SAAS,SAAS,yBAAyB,cAAc,SAAS,gBAAgB;EACxF,WAAW,cACT,UAAU,WAAW,SAAS,OAC1B,SACA,WAAW,mBAAmB,cAC5B,WAAW,UACX;CACV;CACA,WAAW,OAAO;CAElB,MAAM,yBAAyB;EAC7B,MAAM,cAAc,WAAW;EAC/B,IAAI,CAAC,aACH;EAGF,qBAAqB;GACnB,qBAAqB;IACnB,IAAI,YAAY,aACd,YAAY,MAAM;GAEtB,CAAC;EACH,CAAC;CACH;CAEA,OACE,oBAAC,uBAAD;EACE,OAAO;GACL,aAAa,UAAU,IAAI,KAAK;GAChC;GACA,aAAa,SAAS;IACpB,WAAW,UAAU;GACvB;EACF;EAEA,UAAA,oBAAC,QAAD;GAAQ,GAAI;GAAM,MAAM;GAAQ,cAAc,UAAU;GACrD;EACK,CAAA;CACa,CAAA;AAE3B;AAIA,SAAgB,sBACd,OACa;CACb,MAAM,UAAU,0BAA0B;CAC1C,MAAM,MAAM,MAAM,MACd,YAAY,MAAM,KAAqB,QAAQ,UAAU,IACzD,QAAQ;CAEZ,IAAI,MAAM,SACR,OAAO,oBAAC,eAAD;EAAe,GAAI;EAAY;CAAM,CAAA;CAG9C,OAAO,oBAAC,eAAD;EAAe,GAAI;EAAY;CAAgC,CAAA;AACxE;AAEA,SAAS,eAAe,OAAc,eAA8B;CAClE,IAAI,CAAC,eACH,MAAM,eAAe;AAEzB;AAEA,SAAgB,sBAAsB,OAAgD;CACpF,MAAM,UAAU,0BAA0B;CAC1C,MAAM,EACJ,UACA,OAAO,WACP,kBAAkB,MAClB,gBAAgB,MAChB,aACA,eAAe,iCACf,iBACA,mBACA,sBACA,cACA,KACA,OACA,GAAG,SACD;CACJ,MAAM,sBAAsB,SAAgC;EAC1D,IAAI,CAAC,MAAM;GACT,QAAQ,iBAAiB;GACzB;EACF;EAEA,IAAI,iBAAiB,OACnB;EAGF,qBAAqB;GACnB,IAAI,CAAC,KAAK,aACR;GAOF,CAHE,OAAO,iBAAiB,aACpB,aAAa,IACb,KAAK,cAA2B,YAAY,EAAA,EAC1C,MAAM;EAChB,CAAC;CACH;CACA,MAAM,aAAa,MACf,YAAY,KAA4B,kBAAkB,IAC1D;CAEJ,OACE,qBAAC,cAAD,EAAA,UAAA,CACE,oBAAC,eAAD;EAAe,GAAI;EAAc,gCAA6B;CAAI,CAAA,GAClE,qBAAC,eAAD;EACE,GAAI;EACJ,OAAO;EACP,gCAA6B;EAC7B,KAAK;EACL,kBAAkB,UAAU;GAC1B,kBAAkB,KAAK;GACvB,eAAe,OAAO,aAAa;EACrC;EACA,oBAAoB,UAAU;GAC5B,oBAAoB,KAAK;GACzB,eAAe,OAAO,eAAe;EACvC;EACA,uBAAuB,UAAU;GAC/B,uBAAuB,KAAK;GAC5B,eAAe,OAAO,eAAe;EACvC;EAhBF,UAAA;GAkBE,oBAAC,aAAD;IAAa,OAAM;IAAW,UAAA;GAAmB,CAAA;GAChD,cAAc,oBAAC,mBAAD;IAAmB,OAAM;IAAW,UAAA;GAA+B,CAAA,IAAI;GACtF,oBAAC,SAAD,EAAU,SAAkB,CAAA;EACf;CACH,CAAA,CAAA,EAAA,CAAA;AAElB;AAEA,SAAS,sBACP,OACA,eACA,gBACA,SACwB;CACxB,QAAQ,UAAU;EAChB,iBAAiB;EACjB,IAAI,CAAC,MAAM,kBACT,UAAU,KAAK;EAEjB,IAAI,iBAAiB,CAAC,MAAM,kBAC1B,MAAM;CAEV;AACF;AAEA,SAAgB,mBAAmB,OAA6C;CAC9E,MAAM,EACJ,UACA,OAAO,WACP,gBAAgB,MAChB,kBACA,SACA,GAAG,SACD;CACJ,MAAM,UAAU,0BAA0B;CAC1C,OACE,oBAAC,MAAD;EAAI,+BAA4B;EAC9B,UAAA,oBAAC,MAAD;GACE,GAAI;GACJ,OAAO;GACP,aAAU;GACV,SAAS,sBAAsB,QAAQ,OAAO,eAAe,kBAAkB,OAAO;GAErF;EACG,CAAA;CACJ,CAAA;AAER;AAEA,SAAgB,mBAAmB,OAA6C;CAC9E,MAAM,EAAE,UAAU,OAAO,WAAW,GAAG,SAAS;CAChD,OACE,oBAAC,MAAD;EAAI,GAAI;EAAM,OAAO,QAAQ,SAAS;EAAG,aAAU;EAChD;CACC,CAAA;AAER"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { DialogContentProps, DialogOverlayProps, DialogProps, DialogTriggerAsChildProps, DialogTriggerProps } from "@askrjs/ui";
|
|
2
|
+
import { JSX } from "@askrjs/askr/jsx-runtime";
|
|
3
|
+
import { LinkProps } from "@askrjs/askr/router";
|
|
4
|
+
import { Ref } from "@askrjs/askr/foundations/utilities";
|
|
5
|
+
//#region src/components/command-palette/command-palette.types.d.ts
|
|
6
|
+
type CommandPaletteProps = DialogProps;
|
|
7
|
+
type CommandPaletteTriggerProps = DialogTriggerProps;
|
|
8
|
+
type CommandPaletteTriggerAsChildProps = DialogTriggerAsChildProps;
|
|
9
|
+
type CommandPaletteContentProps = Omit<DialogContentProps, "children" | "title" | "onEscapeKeyDown" | "onInteractOutside" | "onPointerDownOutside"> & {
|
|
10
|
+
children?: unknown;
|
|
11
|
+
title: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
initialFocus?: string | (() => HTMLElement | null) | false;
|
|
14
|
+
closeOnBackdrop?: boolean;
|
|
15
|
+
closeOnEscape?: boolean;
|
|
16
|
+
overlayProps?: DialogOverlayProps;
|
|
17
|
+
onEscapeKeyDown?: (event: KeyboardEvent) => void;
|
|
18
|
+
onInteractOutside?: (event: Event) => void;
|
|
19
|
+
onPointerDownOutside?: (event: PointerEvent) => void;
|
|
20
|
+
};
|
|
21
|
+
type CommandPaletteLinkProps = LinkProps & {
|
|
22
|
+
closeOnSelect?: boolean;
|
|
23
|
+
onBeforeNavigate?: () => void;
|
|
24
|
+
};
|
|
25
|
+
type CommandPaletteListProps = Omit<JSX.IntrinsicElements["ul"], "children" | "ref"> & {
|
|
26
|
+
children?: unknown;
|
|
27
|
+
ref?: Ref<HTMLUListElement>;
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
export { CommandPaletteContentProps, CommandPaletteLinkProps, CommandPaletteListProps, CommandPaletteProps, CommandPaletteTriggerAsChildProps, CommandPaletteTriggerProps };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { CommandPaletteContentProps, CommandPaletteLinkProps, CommandPaletteListProps, CommandPaletteProps, CommandPaletteTriggerAsChildProps, CommandPaletteTriggerProps } from "./command-palette.types.js";
|
|
2
|
+
import { CommandPalette, CommandPaletteContent, CommandPaletteLink, CommandPaletteList, CommandPaletteTrigger } from "./command-palette.js";
|
|
3
|
+
export { CommandPalette, CommandPaletteContent, type CommandPaletteContentProps, CommandPaletteLink, type CommandPaletteLinkProps, CommandPaletteList, type CommandPaletteListProps, type CommandPaletteProps, CommandPaletteTrigger, type CommandPaletteTriggerAsChildProps, type CommandPaletteTriggerProps };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { JSX } from "@askrjs/askr/jsx-runtime";
|
|
2
2
|
import { JSXElement } from "@askrjs/askr/foundations";
|
|
3
|
-
import { Ref } from "@askrjs/askr/foundations/utilities";
|
|
4
3
|
import { LinkProps } from "@askrjs/askr/router";
|
|
4
|
+
import { Ref } from "@askrjs/askr/foundations/utilities";
|
|
5
5
|
//#region src/components/nav/nav.types.d.ts
|
|
6
6
|
type NavLinkMatch = "prefix" | "exact";
|
|
7
7
|
type TabsOwnProps = {
|
package/dist/components.d.ts
CHANGED
|
@@ -23,6 +23,9 @@ import "./components/card/index.js";
|
|
|
23
23
|
import { CloseNativeProps, CloseOwnProps } from "./components/close/close.types.js";
|
|
24
24
|
import { Close } from "./components/close/close.js";
|
|
25
25
|
import "./components/close/index.js";
|
|
26
|
+
import { CommandPaletteContentProps, CommandPaletteLinkProps, CommandPaletteListProps, CommandPaletteProps, CommandPaletteTriggerAsChildProps, CommandPaletteTriggerProps } from "./components/command-palette/command-palette.types.js";
|
|
27
|
+
import { CommandPalette, CommandPaletteContent, CommandPaletteLink, CommandPaletteList, CommandPaletteTrigger } from "./components/command-palette/command-palette.js";
|
|
28
|
+
import "./components/command-palette/index.js";
|
|
26
29
|
import { ContainerProps } from "./components/container/container.types.js";
|
|
27
30
|
import { Container } from "./components/container/container.js";
|
|
28
31
|
import "./components/container/index.js";
|
|
@@ -90,4 +93,4 @@ import { CAT_THEME_NAMES, CAT_THEME_OPTIONS, CatThemeName, DEFAULT_THEME_OPTIONS
|
|
|
90
93
|
import "./components/theme/index.js";
|
|
91
94
|
import { AlertDescription, AlertTitle, Box, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Calendar, CalendarBody, CalendarCaption, CalendarCell, CalendarDay, CalendarGrid, CalendarHead, CalendarHeader, CalendarNav, CalendarNextButton, CalendarPreviousButton, CalendarRow, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, CatalogComponentProps, Combobox, ComboboxInput, ComboboxList, ComboboxOption, Command, CommandDialog, CommandEmpty, CommandGroup, CommandGroupHeading, CommandHeader, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DataTable, DatePicker, DatePickerInput, Direction, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, FieldContent, FieldDescription, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Inline, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemTitle, Kbd, NativeSelect, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, ResizableHandle, ResizablePanel, ResizablePanelGroup, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, Shell, ShellMain, ShellNav, Sonner, Stack, TabsContent, TabsList, TabsTrigger, Toaster, Typography, TypographyBlockquote, TypographyH1, TypographyH2, TypographyH3, TypographyH4, TypographyLead, TypographyList, TypographyMuted, TypographyP } from "./components/catalog.js";
|
|
92
95
|
import { Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Button, ButtonAsChildElement, ButtonAsChildProps, ButtonNativeProps, ButtonProps, ButtonSize, ButtonVariant, ButtonWidth, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, DebouncedInput, Dialog, Dialog as Drawer, Dialog as Sheet, DialogClose, DialogClose as DrawerClose, DialogClose as SheetClose, DialogContent, DialogContent as DrawerContent, DialogDescription, DialogDescription as DrawerDescription, DialogOverlay, DialogOverlay as DrawerOverlay, DialogOverlay as SheetOverlay, DialogPortal, DialogPortal as DrawerPortal, DialogPortal as SheetPortal, DialogProps, DialogTitle, DialogTitle as DrawerTitle, DialogTrigger, DialogTrigger as DrawerTrigger, DialogTrigger as SheetTrigger, Dropdown, Dropdown as ContextMenu, Dropdown as DropdownMenu, DropdownGroup, DropdownGroup as ContextMenuGroup, DropdownGroup as DropdownMenuGroup, DropdownItem, DropdownItem as ContextMenuItem, DropdownItem as DropdownMenuItem, DropdownItemVariant, DropdownLabel, DropdownLabel as ContextMenuLabel, DropdownLabel as DropdownMenuLabel, DropdownPortal, DropdownPortal as ContextMenuPortal, DropdownPortal as DropdownMenuPortal, DropdownSeparator, DropdownSeparator as ContextMenuSeparator, DropdownSeparator as DropdownMenuSeparator, DropdownTrigger, DropdownTrigger as ContextMenuTrigger, DropdownTrigger as DropdownMenuTrigger, DropdownTriggerSize, DropdownTriggerVariant, Form, HoverCard, HoverCardContent, HoverCardPortal, HoverCardTrigger, Input, Label, Menubar, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Popover, PopoverClose, PopoverContent, PopoverContentWidth, PopoverPortal, PopoverTrigger, Progress, ProgressCircle, ProgressCircleIndicator, ProgressIndicator, RadioGroup, RadioGroupItem, ScrollArea, ScrollAreaCorner, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, Select, SelectContent, SelectGroup, SelectItem, SelectItemText, SelectLabel, SelectPortal, SelectSeparator, SelectTrigger, SelectTriggerSize, SelectValue, Slider, SliderRange, SliderThumb, SliderTrack, Switch, Table, TableBody, TableCaption, TableCell, TableFoot, TableHead, TableHeaderCell, TableRow, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastHost, ToastTitle, ToastViewport, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipPortal, TooltipTrigger, VirtualList, VirtualListApi, VirtualListAsChildProps, VirtualListProps, VirtualListRowComponent, VirtualListRowComponentProps, VirtualListRowElement, VirtualListState, VirtualListViewport, VirtualTable, VirtualTableApi, VirtualTableAsChildProps, VirtualTableCellComponent, VirtualTableCellComponentProps, VirtualTableCellElement, VirtualTableColumn, VirtualTableProps, VirtualTableState, VirtualTableViewport, VirtualTableWidth, VisuallyHidden } from "@askrjs/ui";
|
|
93
|
-
export { Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, type AlertHeadingTag, type AlertProps, AlertTitle, type AlertVariant, Aside, type AsideProps, AspectRatio, type AspectRatioAsChildProps, type AspectRatioProps, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeAsChildProps, type BadgeOwnProps, type BadgeProps, Block, type BlockAlign, type BlockAsChildProps, type BlockBackground, type BlockDirection, type BlockDivProps, type BlockElement, type BlockElementProps, type BlockJustify, type BlockMargin, type BlockNativeProps, type BlockOwnProps, type BlockProps, type BlockRadius, type ResponsiveValue as BlockResponsiveValue, type BlockRowFrom, type BlockShadow, type BlockSize, type BlockSpace, type BlockSpanProps, type BlockZIndex, Box, Brand, BrandLabel, BrandMark, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonAsChildElement, type ButtonAsChildProps, ButtonGroup, type ButtonGroupOrientation, type ButtonGroupProps, type ButtonNativeProps, type ButtonProps, type ButtonSize, type ButtonVariant, type ButtonWidth, CAT_THEME_NAMES, CAT_THEME_OPTIONS, Calendar, CalendarBody, CalendarCaption, CalendarCell, CalendarDay, CalendarGrid, CalendarHead, CalendarHeader, CalendarNav, CalendarNextButton, CalendarPreviousButton, CalendarRow, Card, CardAction, type CardActionProps, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleHeadingTag, type CardTitleProps, type CardVariant, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type CatThemeName, CatalogComponentProps, Checkbox, Close, type CloseNativeProps, type CloseOwnProps, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxInput, ComboboxList, ComboboxOption, Command, CommandDialog, CommandEmpty, CommandGroup, CommandGroupHeading, CommandHeader, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Container, type ContainerProps, ContextMenu, DropdownContent as ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuSeparator, ContextMenuTrigger, DEFAULT_THEME_OPTIONS, DataTable, DatePicker, DatePickerInput, DebouncedInput, Dialog, DialogClose, DialogContent, DialogDescription, DialogOverlay, DialogPortal, type DialogProps, DialogTitle, DialogTrigger, Direction, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, Dropdown, DropdownContent, DropdownGroup, DropdownItem, type DropdownItemVariant, DropdownLabel, DropdownMenu, DropdownContent as DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuTrigger, DropdownPortal, DropdownSeparator, DropdownTrigger, type DropdownTriggerSize, type DropdownTriggerVariant, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateHeadingTag, type EmptyStateProps, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, type FieldErrorProps, FieldGroup, FieldHint, type FieldHintProps, FieldLabel, FieldLegend, type FieldProps, FieldSeparator, FieldSet, FieldTitle, Footer, FooterContent, type FooterContentProps, FooterDescription, type FooterDescriptionProps, FooterLink, type FooterLinkProps, FooterLinks, type FooterLinksProps, type FooterProps, FooterSection, type FooterSectionProps, FooterTitle, type FooterTitleProps, Form, Grid, type GridAlign, type GridColumns, type GridElement, type GridProps, Header, type HeaderProps, HoverCard, HoverCardContent, HoverCardPortal, HoverCardTrigger, Inline, Input, InputGroup, type InputGroupOrientation, type InputGroupProps, InputGroupText, type InputGroupTextAsChildProps, type InputGroupTextProps, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemTitle, Kbd, Label, Main, type MainProps, Menubar, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NativeSelect, Navbar as Nav, NavBrand, type NavBrandProps, NavDropdown, type NavDropdownProps, NavGroup, type NavGroupProps, NavItem, type NavItemAsChildProps, type NavItemProps, NavLink, type NavLinkProps, Navbar, type NavbarCollapseBreakpoint, type NavbarProps, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Page, PageHeader, type PageHeaderProps, type PageProps, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Pill, type PillProps, Pills, type PillsAsChildProps, type PillsProps, Popover, PopoverClose, PopoverContent, type PopoverContentWidth, PopoverPortal, PopoverTrigger, Progress, ProgressCircle, ProgressCircleIndicator, ProgressIndicator, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollAreaCorner, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, Section, type SectionProps, Select, SelectContent, SelectGroup, SelectItem, SelectItemText, SelectLabel, SelectPortal, SelectSeparator, SelectTrigger, type SelectTriggerSize, SelectValue, Separator, type SeparatorAsChildProps, type SeparatorNativeProps, type SeparatorOwnProps, type SeparatorProps, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Shell, ShellMain, ShellNav, Sidebar, type SidebarButtonProps, type SidebarCollapsible, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, type SidebarPartProps, type SidebarProps, SidebarRail, type SidebarRailProps, SidebarScope, type SidebarSide, type SidebarTooltipSide, SidebarTrigger, type SidebarVariant, Skeleton, type SkeletonAsChildProps, type SkeletonOwnProps, type SkeletonProps, Slider, SliderRange, SliderThumb, SliderTrack, Sonner, Spinner, type SpinnerOwnProps, type SpinnerProps, type SpinnerSize, Stack, Stat, StatDescription, StatLabel, StatValue, Switch, Tab, type TabProps, Table, TableBody, TableCaption, TableCell, TableFoot, TableHead, TableHeaderCell, TableRow, Tabs, type TabsAsChildProps, TabsContent, TabsList, type TabsProps, TabsTrigger, Text, type TextElement, type TextFont, type TextNumeric, type TextProps, type TextSize, type TextTone, type TextWeight, type TextWrap, Textarea, type ThemeName, type ThemeOption, ThemePicker, type ThemePickerProps, ThemeScope, type ThemeScopeProps, type ThemeScopeValue, ThemeToggle, type ThemeToggleProps, type ThemeToggleRenderContext, Toast, ToastAction, ToastClose, ToastDescription, ToastHost, ToastTitle, ToastViewport, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Toolbar, type ToolbarProps, Tooltip, TooltipContent, TooltipPortal, TooltipTrigger, Typography, TypographyBlockquote, TypographyH1, TypographyH2, TypographyH3, TypographyH4, TypographyLead, TypographyList, TypographyMuted, TypographyP, VirtualList, type VirtualListApi, type VirtualListAsChildProps, type VirtualListProps, type VirtualListRowComponent, type VirtualListRowComponentProps, type VirtualListRowElement, type VirtualListState, type VirtualListViewport, VirtualTable, type VirtualTableApi, type VirtualTableAsChildProps, type VirtualTableCellComponent, type VirtualTableCellComponentProps, type VirtualTableCellElement, type VirtualTableColumn, type VirtualTableProps, type VirtualTableState, type VirtualTableViewport, type VirtualTableWidth, VisuallyHidden, theme };
|
|
96
|
+
export { Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, type AlertHeadingTag, type AlertProps, AlertTitle, type AlertVariant, Aside, type AsideProps, AspectRatio, type AspectRatioAsChildProps, type AspectRatioProps, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeAsChildProps, type BadgeOwnProps, type BadgeProps, Block, type BlockAlign, type BlockAsChildProps, type BlockBackground, type BlockDirection, type BlockDivProps, type BlockElement, type BlockElementProps, type BlockJustify, type BlockMargin, type BlockNativeProps, type BlockOwnProps, type BlockProps, type BlockRadius, type ResponsiveValue as BlockResponsiveValue, type BlockRowFrom, type BlockShadow, type BlockSize, type BlockSpace, type BlockSpanProps, type BlockZIndex, Box, Brand, BrandLabel, BrandMark, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonAsChildElement, type ButtonAsChildProps, ButtonGroup, type ButtonGroupOrientation, type ButtonGroupProps, type ButtonNativeProps, type ButtonProps, type ButtonSize, type ButtonVariant, type ButtonWidth, CAT_THEME_NAMES, CAT_THEME_OPTIONS, Calendar, CalendarBody, CalendarCaption, CalendarCell, CalendarDay, CalendarGrid, CalendarHead, CalendarHeader, CalendarNav, CalendarNextButton, CalendarPreviousButton, CalendarRow, Card, CardAction, type CardActionProps, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleHeadingTag, type CardTitleProps, type CardVariant, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type CatThemeName, CatalogComponentProps, Checkbox, Close, type CloseNativeProps, type CloseOwnProps, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxInput, ComboboxList, ComboboxOption, Command, CommandDialog, CommandEmpty, CommandGroup, CommandGroupHeading, CommandHeader, CommandInput, CommandItem, CommandList, CommandPalette, CommandPaletteContent, type CommandPaletteContentProps, CommandPaletteLink, type CommandPaletteLinkProps, CommandPaletteList, type CommandPaletteListProps, type CommandPaletteProps, CommandPaletteTrigger, type CommandPaletteTriggerAsChildProps, type CommandPaletteTriggerProps, CommandSeparator, CommandShortcut, Container, type ContainerProps, ContextMenu, DropdownContent as ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuSeparator, ContextMenuTrigger, DEFAULT_THEME_OPTIONS, DataTable, DatePicker, DatePickerInput, DebouncedInput, Dialog, DialogClose, DialogContent, DialogDescription, DialogOverlay, DialogPortal, type DialogProps, DialogTitle, DialogTrigger, Direction, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, Dropdown, DropdownContent, DropdownGroup, DropdownItem, type DropdownItemVariant, DropdownLabel, DropdownMenu, DropdownContent as DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuTrigger, DropdownPortal, DropdownSeparator, DropdownTrigger, type DropdownTriggerSize, type DropdownTriggerVariant, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateHeadingTag, type EmptyStateProps, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, type FieldErrorProps, FieldGroup, FieldHint, type FieldHintProps, FieldLabel, FieldLegend, type FieldProps, FieldSeparator, FieldSet, FieldTitle, Footer, FooterContent, type FooterContentProps, FooterDescription, type FooterDescriptionProps, FooterLink, type FooterLinkProps, FooterLinks, type FooterLinksProps, type FooterProps, FooterSection, type FooterSectionProps, FooterTitle, type FooterTitleProps, Form, Grid, type GridAlign, type GridColumns, type GridElement, type GridProps, Header, type HeaderProps, HoverCard, HoverCardContent, HoverCardPortal, HoverCardTrigger, Inline, Input, InputGroup, type InputGroupOrientation, type InputGroupProps, InputGroupText, type InputGroupTextAsChildProps, type InputGroupTextProps, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemTitle, Kbd, Label, Main, type MainProps, Menubar, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NativeSelect, Navbar as Nav, NavBrand, type NavBrandProps, NavDropdown, type NavDropdownProps, NavGroup, type NavGroupProps, NavItem, type NavItemAsChildProps, type NavItemProps, NavLink, type NavLinkProps, Navbar, type NavbarCollapseBreakpoint, type NavbarProps, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Page, PageHeader, type PageHeaderProps, type PageProps, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Pill, type PillProps, Pills, type PillsAsChildProps, type PillsProps, Popover, PopoverClose, PopoverContent, type PopoverContentWidth, PopoverPortal, PopoverTrigger, Progress, ProgressCircle, ProgressCircleIndicator, ProgressIndicator, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollAreaCorner, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, Section, type SectionProps, Select, SelectContent, SelectGroup, SelectItem, SelectItemText, SelectLabel, SelectPortal, SelectSeparator, SelectTrigger, type SelectTriggerSize, SelectValue, Separator, type SeparatorAsChildProps, type SeparatorNativeProps, type SeparatorOwnProps, type SeparatorProps, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Shell, ShellMain, ShellNav, Sidebar, type SidebarButtonProps, type SidebarCollapsible, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, type SidebarPartProps, type SidebarProps, SidebarRail, type SidebarRailProps, SidebarScope, type SidebarSide, type SidebarTooltipSide, SidebarTrigger, type SidebarVariant, Skeleton, type SkeletonAsChildProps, type SkeletonOwnProps, type SkeletonProps, Slider, SliderRange, SliderThumb, SliderTrack, Sonner, Spinner, type SpinnerOwnProps, type SpinnerProps, type SpinnerSize, Stack, Stat, StatDescription, StatLabel, StatValue, Switch, Tab, type TabProps, Table, TableBody, TableCaption, TableCell, TableFoot, TableHead, TableHeaderCell, TableRow, Tabs, type TabsAsChildProps, TabsContent, TabsList, type TabsProps, TabsTrigger, Text, type TextElement, type TextFont, type TextNumeric, type TextProps, type TextSize, type TextTone, type TextWeight, type TextWrap, Textarea, type ThemeName, type ThemeOption, ThemePicker, type ThemePickerProps, ThemeScope, type ThemeScopeProps, type ThemeScopeValue, ThemeToggle, type ThemeToggleProps, type ThemeToggleRenderContext, Toast, ToastAction, ToastClose, ToastDescription, ToastHost, ToastTitle, ToastViewport, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Toolbar, type ToolbarProps, Tooltip, TooltipContent, TooltipPortal, TooltipTrigger, Typography, TypographyBlockquote, TypographyH1, TypographyH2, TypographyH3, TypographyH4, TypographyLead, TypographyList, TypographyMuted, TypographyP, VirtualList, type VirtualListApi, type VirtualListAsChildProps, type VirtualListProps, type VirtualListRowComponent, type VirtualListRowComponentProps, type VirtualListRowElement, type VirtualListState, type VirtualListViewport, VirtualTable, type VirtualTableApi, type VirtualTableAsChildProps, type VirtualTableCellComponent, type VirtualTableCellComponentProps, type VirtualTableCellElement, type VirtualTableColumn, type VirtualTableProps, type VirtualTableState, type VirtualTableViewport, type VirtualTableWidth, VisuallyHidden, theme };
|
package/dist/components.js
CHANGED
|
@@ -7,6 +7,8 @@ import { Block } from "./components/block/block.js";
|
|
|
7
7
|
import { Brand, BrandLabel, BrandMark } from "./components/brand/brand.js";
|
|
8
8
|
import { ButtonGroup } from "./components/button-group/button-group.js";
|
|
9
9
|
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./components/card/card.js";
|
|
10
|
+
import { AlertDescription, AlertTitle, Box, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Calendar, CalendarBody, CalendarCaption, CalendarCell, CalendarDay, CalendarGrid, CalendarHead, CalendarHeader, CalendarNav, CalendarNextButton, CalendarPreviousButton, CalendarRow, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Combobox, ComboboxInput, ComboboxList, ComboboxOption, Command, CommandDialog, CommandEmpty, CommandGroup, CommandGroupHeading, CommandHeader, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DataTable, DatePicker, DatePickerInput, Direction, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, FieldContent, FieldDescription, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Inline, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemTitle, Kbd, NativeSelect, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, ResizableHandle, ResizablePanel, ResizablePanelGroup, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, Shell, ShellMain, ShellNav, Sonner, Stack, TabsContent, TabsList, TabsTrigger, Toaster, Typography, TypographyBlockquote, TypographyH1, TypographyH2, TypographyH3, TypographyH4, TypographyLead, TypographyList, TypographyMuted, TypographyP } from "./components/catalog.js";
|
|
11
|
+
import { CommandPalette, CommandPaletteContent, CommandPaletteLink, CommandPaletteList, CommandPaletteTrigger } from "./components/command-palette/command-palette.js";
|
|
10
12
|
import { Container } from "./components/container/container.js";
|
|
11
13
|
import { EmptyState } from "./components/empty-state/empty-state.js";
|
|
12
14
|
import { Field, FieldError, FieldHint } from "./components/field/field.js";
|
|
@@ -30,6 +32,5 @@ import { Stat, StatDescription, StatLabel, StatValue } from "./components/stat/s
|
|
|
30
32
|
import { Text } from "./components/text/text.js";
|
|
31
33
|
import { Toolbar } from "./components/toolbar/toolbar.js";
|
|
32
34
|
import { CAT_THEME_NAMES, CAT_THEME_OPTIONS, DEFAULT_THEME_OPTIONS, ThemePicker, ThemeScope, ThemeToggle, theme } from "./components/theme/theme.js";
|
|
33
|
-
import { AlertDescription, AlertTitle, Box, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Calendar, CalendarBody, CalendarCaption, CalendarCell, CalendarDay, CalendarGrid, CalendarHead, CalendarHeader, CalendarNav, CalendarNextButton, CalendarPreviousButton, CalendarRow, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Combobox, ComboboxInput, ComboboxList, ComboboxOption, Command, CommandDialog, CommandEmpty, CommandGroup, CommandGroupHeading, CommandHeader, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DataTable, DatePicker, DatePickerInput, Direction, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, FieldContent, FieldDescription, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Inline, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemTitle, Kbd, NativeSelect, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, ResizableHandle, ResizablePanel, ResizablePanelGroup, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, Shell, ShellMain, ShellNav, Sonner, Stack, TabsContent, TabsList, TabsTrigger, Toaster, Typography, TypographyBlockquote, TypographyH1, TypographyH2, TypographyH3, TypographyH4, TypographyLead, TypographyList, TypographyMuted, TypographyP } from "./components/catalog.js";
|
|
34
35
|
import { Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Button, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, DebouncedInput, Dialog, Dialog as Drawer, Dialog as Sheet, DialogClose, DialogClose as DrawerClose, DialogClose as SheetClose, DialogContent, DialogContent as DrawerContent, DialogDescription, DialogDescription as DrawerDescription, DialogOverlay, DialogOverlay as DrawerOverlay, DialogOverlay as SheetOverlay, DialogPortal, DialogPortal as DrawerPortal, DialogPortal as SheetPortal, DialogTitle, DialogTitle as DrawerTitle, DialogTrigger, DialogTrigger as DrawerTrigger, DialogTrigger as SheetTrigger, Dropdown, Dropdown as ContextMenu, Dropdown as DropdownMenu, DropdownGroup, DropdownGroup as ContextMenuGroup, DropdownGroup as DropdownMenuGroup, DropdownItem, DropdownItem as ContextMenuItem, DropdownItem as DropdownMenuItem, DropdownLabel, DropdownLabel as ContextMenuLabel, DropdownLabel as DropdownMenuLabel, DropdownPortal, DropdownPortal as ContextMenuPortal, DropdownPortal as DropdownMenuPortal, DropdownSeparator, DropdownSeparator as ContextMenuSeparator, DropdownSeparator as DropdownMenuSeparator, DropdownTrigger, DropdownTrigger as ContextMenuTrigger, DropdownTrigger as DropdownMenuTrigger, Form, HoverCard, HoverCardContent, HoverCardPortal, HoverCardTrigger, Input, Label, Menubar, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Popover, PopoverClose, PopoverContent, PopoverPortal, PopoverTrigger, Progress, ProgressCircle, ProgressCircleIndicator, ProgressIndicator, RadioGroup, RadioGroupItem, ScrollArea, ScrollAreaCorner, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, Select, SelectContent, SelectGroup, SelectItem, SelectItemText, SelectLabel, SelectPortal, SelectSeparator, SelectTrigger, SelectValue, Slider, SliderRange, SliderThumb, SliderTrack, Switch, Table, TableBody, TableCaption, TableCell, TableFoot, TableHead, TableHeaderCell, TableRow, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastHost, ToastTitle, ToastViewport, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipPortal, TooltipTrigger, VirtualList, VirtualTable, VisuallyHidden } from "@askrjs/ui";
|
|
35
|
-
export { Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, Aside, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, Block, Box, Brand, BrandLabel, BrandMark, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, CAT_THEME_NAMES, CAT_THEME_OPTIONS, Calendar, CalendarBody, CalendarCaption, CalendarCell, CalendarDay, CalendarGrid, CalendarHead, CalendarHeader, CalendarNav, CalendarNextButton, CalendarPreviousButton, CalendarRow, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, Close, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxInput, ComboboxList, ComboboxOption, Command, CommandDialog, CommandEmpty, CommandGroup, CommandGroupHeading, CommandHeader, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Container, ContextMenu, DropdownContent as ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuSeparator, ContextMenuTrigger, DEFAULT_THEME_OPTIONS, DataTable, DatePicker, DatePickerInput, DebouncedInput, Dialog, DialogClose, DialogContent, DialogDescription, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Direction, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, Dropdown, DropdownContent, DropdownGroup, DropdownItem, DropdownLabel, DropdownMenu, DropdownContent as DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuTrigger, DropdownPortal, DropdownSeparator, DropdownTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldHint, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Footer, FooterContent, FooterDescription, FooterLink, FooterLinks, FooterSection, FooterTitle, Form, Grid, Header, HoverCard, HoverCardContent, HoverCardPortal, HoverCardTrigger, Inline, Input, InputGroup, InputGroupText, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemTitle, Kbd, Label, Main, Menubar, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NativeSelect, Navbar as Nav, NavBrand, NavDropdown, NavGroup, NavItem, NavLink, Navbar, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Page, PageHeader, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Pill, Pills, Popover, PopoverClose, PopoverContent, PopoverPortal, PopoverTrigger, Progress, ProgressCircle, ProgressCircleIndicator, ProgressIndicator, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollAreaCorner, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, Section, Select, SelectContent, SelectGroup, SelectItem, SelectItemText, SelectLabel, SelectPortal, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Shell, ShellMain, ShellNav, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarRail, SidebarScope, SidebarTrigger, Skeleton, Slider, SliderRange, SliderThumb, SliderTrack, Sonner, Spinner, Stack, Stat, StatDescription, StatLabel, StatValue, Switch, Tab, Table, TableBody, TableCaption, TableCell, TableFoot, TableHead, TableHeaderCell, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Text, Textarea, ThemePicker, ThemeScope, ThemeToggle, Toast, ToastAction, ToastClose, ToastDescription, ToastHost, ToastTitle, ToastViewport, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Toolbar, Tooltip, TooltipContent, TooltipPortal, TooltipTrigger, Typography, TypographyBlockquote, TypographyH1, TypographyH2, TypographyH3, TypographyH4, TypographyLead, TypographyList, TypographyMuted, TypographyP, VirtualList, VirtualTable, VisuallyHidden, theme };
|
|
36
|
+
export { Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, Aside, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, Block, Box, Brand, BrandLabel, BrandMark, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, CAT_THEME_NAMES, CAT_THEME_OPTIONS, Calendar, CalendarBody, CalendarCaption, CalendarCell, CalendarDay, CalendarGrid, CalendarHead, CalendarHeader, CalendarNav, CalendarNextButton, CalendarPreviousButton, CalendarRow, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, Close, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxInput, ComboboxList, ComboboxOption, Command, CommandDialog, CommandEmpty, CommandGroup, CommandGroupHeading, CommandHeader, CommandInput, CommandItem, CommandList, CommandPalette, CommandPaletteContent, CommandPaletteLink, CommandPaletteList, CommandPaletteTrigger, CommandSeparator, CommandShortcut, Container, ContextMenu, DropdownContent as ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuSeparator, ContextMenuTrigger, DEFAULT_THEME_OPTIONS, DataTable, DatePicker, DatePickerInput, DebouncedInput, Dialog, DialogClose, DialogContent, DialogDescription, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Direction, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, Dropdown, DropdownContent, DropdownGroup, DropdownItem, DropdownLabel, DropdownMenu, DropdownContent as DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuTrigger, DropdownPortal, DropdownSeparator, DropdownTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldHint, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Footer, FooterContent, FooterDescription, FooterLink, FooterLinks, FooterSection, FooterTitle, Form, Grid, Header, HoverCard, HoverCardContent, HoverCardPortal, HoverCardTrigger, Inline, Input, InputGroup, InputGroupText, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemTitle, Kbd, Label, Main, Menubar, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NativeSelect, Navbar as Nav, NavBrand, NavDropdown, NavGroup, NavItem, NavLink, Navbar, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Page, PageHeader, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Pill, Pills, Popover, PopoverClose, PopoverContent, PopoverPortal, PopoverTrigger, Progress, ProgressCircle, ProgressCircleIndicator, ProgressIndicator, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollAreaCorner, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, Section, Select, SelectContent, SelectGroup, SelectItem, SelectItemText, SelectLabel, SelectPortal, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Shell, ShellMain, ShellNav, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarRail, SidebarScope, SidebarTrigger, Skeleton, Slider, SliderRange, SliderThumb, SliderTrack, Sonner, Spinner, Stack, Stat, StatDescription, StatLabel, StatValue, Switch, Tab, Table, TableBody, TableCaption, TableCell, TableFoot, TableHead, TableHeaderCell, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Text, Textarea, ThemePicker, ThemeScope, ThemeToggle, Toast, ToastAction, ToastClose, ToastDescription, ToastHost, ToastTitle, ToastViewport, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Toolbar, Tooltip, TooltipContent, TooltipPortal, TooltipTrigger, Typography, TypographyBlockquote, TypographyH1, TypographyH2, TypographyH3, TypographyH4, TypographyLead, TypographyList, TypographyMuted, TypographyP, VirtualList, VirtualTable, VisuallyHidden, theme };
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
+
import { CommandPaletteContentProps, CommandPaletteLinkProps, CommandPaletteListProps, CommandPaletteProps, CommandPaletteTriggerAsChildProps, CommandPaletteTriggerProps } from "../components/command-palette/command-palette.types.js";
|
|
2
|
+
import { CommandPalette, CommandPaletteContent, CommandPaletteLink, CommandPaletteList, CommandPaletteTrigger } from "../components/command-palette/command-palette.js";
|
|
3
|
+
import "../components/command-palette/index.js";
|
|
1
4
|
import { Command, CommandDialog, CommandEmpty, CommandGroup, CommandGroupHeading, CommandHeader, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut } from "../components/catalog.js";
|
|
2
|
-
export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandGroupHeading, CommandHeader, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut };
|
|
5
|
+
export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandGroupHeading, CommandHeader, CommandInput, CommandItem, CommandList, CommandPalette, CommandPaletteContent, type CommandPaletteContentProps, CommandPaletteLink, type CommandPaletteLinkProps, CommandPaletteList, type CommandPaletteListProps, type CommandPaletteProps, CommandPaletteTrigger, type CommandPaletteTriggerAsChildProps, type CommandPaletteTriggerProps, CommandSeparator, CommandShortcut };
|
package/dist/entries/command.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { Command, CommandDialog, CommandEmpty, CommandGroup, CommandGroupHeading, CommandHeader, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut } from "../components/catalog.js";
|
|
2
|
-
|
|
2
|
+
import { CommandPalette, CommandPaletteContent, CommandPaletteLink, CommandPaletteList, CommandPaletteTrigger } from "../components/command-palette/command-palette.js";
|
|
3
|
+
export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandGroupHeading, CommandHeader, CommandInput, CommandItem, CommandList, CommandPalette, CommandPaletteContent, CommandPaletteLink, CommandPaletteList, CommandPaletteTrigger, CommandSeparator, CommandShortcut };
|
package/dist/entries/tabs.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Pill, Pills, Tab, Tabs } from "../components/nav/nav.js";
|
|
2
1
|
import { TabsContent, TabsList, TabsTrigger } from "../components/catalog.js";
|
|
2
|
+
import { Pill, Pills, Tab, Tabs } from "../components/nav/nav.js";
|
|
3
3
|
export { Pill, Pills, Tab, Tabs, TabsContent, TabsList, TabsTrigger };
|
|
@@ -3745,6 +3745,44 @@
|
|
|
3745
3745
|
overflow: hidden;
|
|
3746
3746
|
}
|
|
3747
3747
|
|
|
3748
|
+
:where([data-command-palette-content]) {
|
|
3749
|
+
max-block-size: min(36rem, 100dvh - 1rem);
|
|
3750
|
+
inline-size: min(42rem, 100vw - 1rem);
|
|
3751
|
+
padding: 0;
|
|
3752
|
+
overflow: hidden;
|
|
3753
|
+
}
|
|
3754
|
+
|
|
3755
|
+
:where([data-command-palette-content] [data-slot="command"]) {
|
|
3756
|
+
min-block-size: 0;
|
|
3757
|
+
}
|
|
3758
|
+
|
|
3759
|
+
:where([data-command-palette-result] > [data-slot="command-item"]) {
|
|
3760
|
+
min-block-size: var(--ak-density-control-height-md);
|
|
3761
|
+
padding: var(--ak-space-sm) var(--ak-space-md);
|
|
3762
|
+
border-radius: var(--ak-radius-md);
|
|
3763
|
+
color: inherit;
|
|
3764
|
+
cursor: pointer;
|
|
3765
|
+
align-items: center;
|
|
3766
|
+
text-decoration: none;
|
|
3767
|
+
display: flex;
|
|
3768
|
+
}
|
|
3769
|
+
|
|
3770
|
+
:where([data-command-palette-content] [data-slot="command-list"]) {
|
|
3771
|
+
margin: 0;
|
|
3772
|
+
padding: 0;
|
|
3773
|
+
list-style: none;
|
|
3774
|
+
}
|
|
3775
|
+
|
|
3776
|
+
:where([data-command-palette-result] > [data-slot="command-item"]:hover) {
|
|
3777
|
+
background: var(--ak-color-accent);
|
|
3778
|
+
color: var(--ak-color-accent-ink);
|
|
3779
|
+
}
|
|
3780
|
+
|
|
3781
|
+
:where([data-command-palette-result] > [data-slot="command-item"]:focus-visible) {
|
|
3782
|
+
box-shadow: inset 0 0 0 var(--ak-focus-ring-width) var(--ak-color-focus-ring);
|
|
3783
|
+
outline: none;
|
|
3784
|
+
}
|
|
3785
|
+
|
|
3748
3786
|
:where([data-slot="command-header"]) {
|
|
3749
3787
|
border-block-end: 1px solid var(--ak-color-border);
|
|
3750
3788
|
padding-inline: var(--ak-space-3);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@askrjs/themes",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.24",
|
|
4
4
|
"description": "Default theme tokens, styles, and component presets for Askr apps.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"askr",
|
|
@@ -119,11 +119,11 @@
|
|
|
119
119
|
"test:checks": "vp test run -c vitest.test.checks.config.ts"
|
|
120
120
|
},
|
|
121
121
|
"devDependencies": {
|
|
122
|
-
"@askrjs/askr": ">=0.0.
|
|
123
|
-
"@askrjs/ui": ">=0.0.
|
|
122
|
+
"@askrjs/askr": ">=0.0.88 <0.1.0",
|
|
123
|
+
"@askrjs/ui": ">=0.0.26 <0.1.0",
|
|
124
124
|
"@askrjs/vite": ">=0.0.12 <0.1.0",
|
|
125
125
|
"@tsdown/css": "0.22.14",
|
|
126
|
-
"@types/node": "^26.
|
|
126
|
+
"@types/node": "^26.2.0",
|
|
127
127
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
128
128
|
"@vitest/browser-playwright": "4.1.10",
|
|
129
129
|
"cross-env": "^10.1.0",
|
|
@@ -135,8 +135,8 @@
|
|
|
135
135
|
"vite-plus": "^0.2.8"
|
|
136
136
|
},
|
|
137
137
|
"peerDependencies": {
|
|
138
|
-
"@askrjs/askr": ">=0.0.
|
|
139
|
-
"@askrjs/ui": ">=0.0.
|
|
138
|
+
"@askrjs/askr": ">=0.0.88 <0.1.0",
|
|
139
|
+
"@askrjs/ui": ">=0.0.26 <0.1.0"
|
|
140
140
|
},
|
|
141
141
|
"engines": {
|
|
142
142
|
"node": ">=24.0.0"
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import type { JSX } from "@askrjs/askr/jsx-runtime";
|
|
2
|
+
import { Link } from "@askrjs/askr/router";
|
|
3
|
+
import { defineScope, readScope, state } from "@askrjs/askr";
|
|
4
|
+
import { controllableState } from "@askrjs/askr/foundations/state";
|
|
5
|
+
import { composeRefs, type Ref } from "@askrjs/askr/foundations/utilities";
|
|
6
|
+
import {
|
|
7
|
+
Dialog,
|
|
8
|
+
DialogContent,
|
|
9
|
+
DialogDescription,
|
|
10
|
+
DialogOverlay,
|
|
11
|
+
DialogPortal,
|
|
12
|
+
DialogTitle,
|
|
13
|
+
DialogTrigger,
|
|
14
|
+
} from "@askrjs/ui";
|
|
15
|
+
import { Command } from "../catalog";
|
|
16
|
+
import { classes } from "../_internal/classes";
|
|
17
|
+
import type {
|
|
18
|
+
CommandPaletteContentProps,
|
|
19
|
+
CommandPaletteLinkProps,
|
|
20
|
+
CommandPaletteListProps,
|
|
21
|
+
CommandPaletteProps,
|
|
22
|
+
CommandPaletteTriggerAsChildProps,
|
|
23
|
+
CommandPaletteTriggerProps,
|
|
24
|
+
} from "./command-palette.types";
|
|
25
|
+
|
|
26
|
+
type CommandPaletteContextValue = {
|
|
27
|
+
close: () => void;
|
|
28
|
+
restoreFocusSoon: () => void;
|
|
29
|
+
setTrigger: (node: Element | null) => void;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const CommandPaletteContext = defineScope<CommandPaletteContextValue | null>(null);
|
|
33
|
+
|
|
34
|
+
function readCommandPaletteContext(): CommandPaletteContextValue {
|
|
35
|
+
const context = readScope(CommandPaletteContext);
|
|
36
|
+
if (!context) {
|
|
37
|
+
throw new Error("CommandPalette components must be used within <CommandPalette>");
|
|
38
|
+
}
|
|
39
|
+
return context;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function CommandPalette(props: CommandPaletteProps): JSX.Element {
|
|
43
|
+
const { children, defaultOpen = false, onOpenChange, open, ...rest } = props;
|
|
44
|
+
const openState = controllableState({
|
|
45
|
+
defaultValue: defaultOpen,
|
|
46
|
+
onChange: onOpenChange,
|
|
47
|
+
value: open,
|
|
48
|
+
});
|
|
49
|
+
const focusState = state({
|
|
50
|
+
open: false,
|
|
51
|
+
returnFocus: null as HTMLElement | null,
|
|
52
|
+
trigger: null as Element | null,
|
|
53
|
+
})();
|
|
54
|
+
const isOpen = openState();
|
|
55
|
+
|
|
56
|
+
if (isOpen && !focusState.open && typeof document !== "undefined") {
|
|
57
|
+
const active = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
58
|
+
focusState.returnFocus =
|
|
59
|
+
active && active !== document.body
|
|
60
|
+
? active
|
|
61
|
+
: focusState.trigger instanceof HTMLElement
|
|
62
|
+
? focusState.trigger
|
|
63
|
+
: null;
|
|
64
|
+
}
|
|
65
|
+
focusState.open = isOpen;
|
|
66
|
+
|
|
67
|
+
const restoreFocusSoon = () => {
|
|
68
|
+
const returnFocus = focusState.returnFocus;
|
|
69
|
+
if (!returnFocus) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
queueMicrotask(() => {
|
|
74
|
+
queueMicrotask(() => {
|
|
75
|
+
if (returnFocus.isConnected) {
|
|
76
|
+
returnFocus.focus();
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<CommandPaletteContext
|
|
84
|
+
value={{
|
|
85
|
+
close: () => openState.set(false),
|
|
86
|
+
restoreFocusSoon,
|
|
87
|
+
setTrigger: (node) => {
|
|
88
|
+
focusState.trigger = node;
|
|
89
|
+
},
|
|
90
|
+
}}
|
|
91
|
+
>
|
|
92
|
+
<Dialog {...rest} open={isOpen} onOpenChange={openState.set}>
|
|
93
|
+
{children}
|
|
94
|
+
</Dialog>
|
|
95
|
+
</CommandPaletteContext>
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export function CommandPaletteTrigger(props: CommandPaletteTriggerProps): JSX.Element;
|
|
100
|
+
export function CommandPaletteTrigger(props: CommandPaletteTriggerAsChildProps): JSX.Element;
|
|
101
|
+
export function CommandPaletteTrigger(
|
|
102
|
+
props: CommandPaletteTriggerProps | CommandPaletteTriggerAsChildProps,
|
|
103
|
+
): JSX.Element {
|
|
104
|
+
const palette = readCommandPaletteContext();
|
|
105
|
+
const ref = props.ref
|
|
106
|
+
? composeRefs(props.ref as Ref<Element>, palette.setTrigger)
|
|
107
|
+
: palette.setTrigger;
|
|
108
|
+
|
|
109
|
+
if (props.asChild) {
|
|
110
|
+
return <DialogTrigger {...props} ref={ref} />;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return <DialogTrigger {...props} ref={ref as Ref<HTMLButtonElement>} />;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function preventDismiss(event: Event, shouldDismiss: boolean): void {
|
|
117
|
+
if (!shouldDismiss) {
|
|
118
|
+
event.preventDefault();
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function CommandPaletteContent(props: CommandPaletteContentProps): JSX.Element {
|
|
123
|
+
const palette = readCommandPaletteContext();
|
|
124
|
+
const {
|
|
125
|
+
children,
|
|
126
|
+
class: className,
|
|
127
|
+
closeOnBackdrop = true,
|
|
128
|
+
closeOnEscape = true,
|
|
129
|
+
description,
|
|
130
|
+
initialFocus = '[data-slot="command-input"]',
|
|
131
|
+
onEscapeKeyDown,
|
|
132
|
+
onInteractOutside,
|
|
133
|
+
onPointerDownOutside,
|
|
134
|
+
overlayProps,
|
|
135
|
+
ref,
|
|
136
|
+
title,
|
|
137
|
+
...rest
|
|
138
|
+
} = props;
|
|
139
|
+
const focusInitialTarget = (node: HTMLDivElement | null) => {
|
|
140
|
+
if (!node) {
|
|
141
|
+
palette.restoreFocusSoon();
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if (initialFocus === false) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
queueMicrotask(() => {
|
|
150
|
+
if (!node.isConnected) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const target =
|
|
155
|
+
typeof initialFocus === "function"
|
|
156
|
+
? initialFocus()
|
|
157
|
+
: node.querySelector<HTMLElement>(initialFocus);
|
|
158
|
+
target?.focus();
|
|
159
|
+
});
|
|
160
|
+
};
|
|
161
|
+
const contentRef = ref
|
|
162
|
+
? composeRefs(ref as Ref<HTMLDivElement>, focusInitialTarget)
|
|
163
|
+
: focusInitialTarget;
|
|
164
|
+
|
|
165
|
+
return (
|
|
166
|
+
<DialogPortal>
|
|
167
|
+
<DialogOverlay {...overlayProps} data-command-palette-overlay="" />
|
|
168
|
+
<DialogContent
|
|
169
|
+
{...rest}
|
|
170
|
+
class={className}
|
|
171
|
+
data-command-palette-content=""
|
|
172
|
+
ref={contentRef}
|
|
173
|
+
onEscapeKeyDown={(event) => {
|
|
174
|
+
onEscapeKeyDown?.(event);
|
|
175
|
+
preventDismiss(event, closeOnEscape);
|
|
176
|
+
}}
|
|
177
|
+
onInteractOutside={(event) => {
|
|
178
|
+
onInteractOutside?.(event);
|
|
179
|
+
preventDismiss(event, closeOnBackdrop);
|
|
180
|
+
}}
|
|
181
|
+
onPointerDownOutside={(event) => {
|
|
182
|
+
onPointerDownOutside?.(event);
|
|
183
|
+
preventDismiss(event, closeOnBackdrop);
|
|
184
|
+
}}
|
|
185
|
+
>
|
|
186
|
+
<DialogTitle class="sr-only">{title}</DialogTitle>
|
|
187
|
+
{description ? <DialogDescription class="sr-only">{description}</DialogDescription> : null}
|
|
188
|
+
<Command>{children}</Command>
|
|
189
|
+
</DialogContent>
|
|
190
|
+
</DialogPortal>
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function composeBeforeNavigate(
|
|
195
|
+
close: () => void,
|
|
196
|
+
closeOnSelect: boolean,
|
|
197
|
+
beforeNavigate: CommandPaletteLinkProps["onBeforeNavigate"],
|
|
198
|
+
onPress: CommandPaletteLinkProps["onPress"],
|
|
199
|
+
): (event: Event) => void {
|
|
200
|
+
return (event) => {
|
|
201
|
+
beforeNavigate?.();
|
|
202
|
+
if (!event.defaultPrevented) {
|
|
203
|
+
onPress?.(event);
|
|
204
|
+
}
|
|
205
|
+
if (closeOnSelect && !event.defaultPrevented) {
|
|
206
|
+
close();
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export function CommandPaletteLink(props: CommandPaletteLinkProps): JSX.Element {
|
|
212
|
+
const {
|
|
213
|
+
children,
|
|
214
|
+
class: className,
|
|
215
|
+
closeOnSelect = true,
|
|
216
|
+
onBeforeNavigate,
|
|
217
|
+
onPress,
|
|
218
|
+
...rest
|
|
219
|
+
} = props;
|
|
220
|
+
const palette = readCommandPaletteContext();
|
|
221
|
+
return (
|
|
222
|
+
<li data-command-palette-result="">
|
|
223
|
+
<Link
|
|
224
|
+
{...rest}
|
|
225
|
+
class={className}
|
|
226
|
+
data-slot="command-item"
|
|
227
|
+
onPress={composeBeforeNavigate(palette.close, closeOnSelect, onBeforeNavigate, onPress)}
|
|
228
|
+
>
|
|
229
|
+
{children}
|
|
230
|
+
</Link>
|
|
231
|
+
</li>
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
export function CommandPaletteList(props: CommandPaletteListProps): JSX.Element {
|
|
236
|
+
const { children, class: className, ...rest } = props;
|
|
237
|
+
return (
|
|
238
|
+
<ul {...rest} class={classes(className)} data-slot="command-list">
|
|
239
|
+
{children}
|
|
240
|
+
</ul>
|
|
241
|
+
);
|
|
242
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { LinkProps } from "@askrjs/askr/router";
|
|
2
|
+
import type { JSX } from "@askrjs/askr/jsx-runtime";
|
|
3
|
+
import type { Ref } from "@askrjs/askr/foundations/utilities";
|
|
4
|
+
import type {
|
|
5
|
+
DialogContentProps,
|
|
6
|
+
DialogOverlayProps,
|
|
7
|
+
DialogProps,
|
|
8
|
+
DialogTriggerAsChildProps,
|
|
9
|
+
DialogTriggerProps,
|
|
10
|
+
} from "@askrjs/ui";
|
|
11
|
+
|
|
12
|
+
export type CommandPaletteProps = DialogProps;
|
|
13
|
+
export type CommandPaletteTriggerProps = DialogTriggerProps;
|
|
14
|
+
export type CommandPaletteTriggerAsChildProps = DialogTriggerAsChildProps;
|
|
15
|
+
|
|
16
|
+
export type CommandPaletteContentProps = Omit<
|
|
17
|
+
DialogContentProps,
|
|
18
|
+
"children" | "title" | "onEscapeKeyDown" | "onInteractOutside" | "onPointerDownOutside"
|
|
19
|
+
> & {
|
|
20
|
+
children?: unknown;
|
|
21
|
+
title: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
initialFocus?: string | (() => HTMLElement | null) | false;
|
|
24
|
+
closeOnBackdrop?: boolean;
|
|
25
|
+
closeOnEscape?: boolean;
|
|
26
|
+
overlayProps?: DialogOverlayProps;
|
|
27
|
+
onEscapeKeyDown?: (event: KeyboardEvent) => void;
|
|
28
|
+
onInteractOutside?: (event: Event) => void;
|
|
29
|
+
onPointerDownOutside?: (event: PointerEvent) => void;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type CommandPaletteLinkProps = LinkProps & {
|
|
33
|
+
closeOnSelect?: boolean;
|
|
34
|
+
onBeforeNavigate?: () => void;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type CommandPaletteListProps = Omit<JSX.IntrinsicElements["ul"], "children" | "ref"> & {
|
|
38
|
+
children?: unknown;
|
|
39
|
+
ref?: Ref<HTMLUListElement>;
|
|
40
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export {
|
|
2
|
+
CommandPalette,
|
|
3
|
+
CommandPaletteContent,
|
|
4
|
+
CommandPaletteLink,
|
|
5
|
+
CommandPaletteList,
|
|
6
|
+
CommandPaletteTrigger,
|
|
7
|
+
} from "./command-palette";
|
|
8
|
+
export type {
|
|
9
|
+
CommandPaletteContentProps,
|
|
10
|
+
CommandPaletteLinkProps,
|
|
11
|
+
CommandPaletteListProps,
|
|
12
|
+
CommandPaletteProps,
|
|
13
|
+
CommandPaletteTriggerAsChildProps,
|
|
14
|
+
CommandPaletteTriggerProps,
|
|
15
|
+
} from "./command-palette.types";
|
package/src/components.ts
CHANGED
|
@@ -197,6 +197,13 @@ export {
|
|
|
197
197
|
CardTitle,
|
|
198
198
|
} from "./components/card";
|
|
199
199
|
export { Close } from "./components/close";
|
|
200
|
+
export {
|
|
201
|
+
CommandPalette,
|
|
202
|
+
CommandPaletteContent,
|
|
203
|
+
CommandPaletteLink,
|
|
204
|
+
CommandPaletteList,
|
|
205
|
+
CommandPaletteTrigger,
|
|
206
|
+
} from "./components/command-palette";
|
|
200
207
|
export { Container } from "./components/container";
|
|
201
208
|
export { EmptyState } from "./components/empty-state";
|
|
202
209
|
export { Field, FieldError, FieldHint } from "./components/field";
|
|
@@ -274,6 +281,7 @@ export type * from "./components/block";
|
|
|
274
281
|
export type * from "./components/button-group";
|
|
275
282
|
export type * from "./components/card";
|
|
276
283
|
export type * from "./components/close";
|
|
284
|
+
export type * from "./components/command-palette";
|
|
277
285
|
export type * from "./components/container";
|
|
278
286
|
export type * from "./components/empty-state";
|
|
279
287
|
export type * from "./components/field";
|
package/src/entries/command.ts
CHANGED
|
@@ -11,3 +11,18 @@ export {
|
|
|
11
11
|
CommandSeparator,
|
|
12
12
|
CommandShortcut,
|
|
13
13
|
} from "../components/catalog";
|
|
14
|
+
export {
|
|
15
|
+
CommandPalette,
|
|
16
|
+
CommandPaletteContent,
|
|
17
|
+
CommandPaletteLink,
|
|
18
|
+
CommandPaletteList,
|
|
19
|
+
CommandPaletteTrigger,
|
|
20
|
+
} from "../components/command-palette";
|
|
21
|
+
export type {
|
|
22
|
+
CommandPaletteContentProps,
|
|
23
|
+
CommandPaletteLinkProps,
|
|
24
|
+
CommandPaletteListProps,
|
|
25
|
+
CommandPaletteProps,
|
|
26
|
+
CommandPaletteTriggerAsChildProps,
|
|
27
|
+
CommandPaletteTriggerProps,
|
|
28
|
+
} from "../components/command-palette";
|
package/src/parity.ts
CHANGED
|
@@ -652,6 +652,44 @@
|
|
|
652
652
|
box-shadow: var(--ak-shadow-lg);
|
|
653
653
|
}
|
|
654
654
|
|
|
655
|
+
:where([data-command-palette-content]) {
|
|
656
|
+
inline-size: min(42rem, calc(100vw - 1rem));
|
|
657
|
+
max-block-size: min(36rem, calc(100dvh - 1rem));
|
|
658
|
+
overflow: hidden;
|
|
659
|
+
padding: 0;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
:where([data-command-palette-content] [data-slot="command"]) {
|
|
663
|
+
min-block-size: 0;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
:where([data-command-palette-result] > [data-slot="command-item"]) {
|
|
667
|
+
display: flex;
|
|
668
|
+
align-items: center;
|
|
669
|
+
min-block-size: var(--ak-density-control-height-md);
|
|
670
|
+
padding: var(--ak-space-sm) var(--ak-space-md);
|
|
671
|
+
border-radius: var(--ak-radius-md);
|
|
672
|
+
color: inherit;
|
|
673
|
+
text-decoration: none;
|
|
674
|
+
cursor: pointer;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
:where([data-command-palette-content] [data-slot="command-list"]) {
|
|
678
|
+
margin: 0;
|
|
679
|
+
padding: 0;
|
|
680
|
+
list-style: none;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
:where([data-command-palette-result] > [data-slot="command-item"]:hover) {
|
|
684
|
+
background: var(--ak-color-accent);
|
|
685
|
+
color: var(--ak-color-accent-ink);
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
:where([data-command-palette-result] > [data-slot="command-item"]:focus-visible) {
|
|
689
|
+
outline: none;
|
|
690
|
+
box-shadow: inset 0 0 0 var(--ak-focus-ring-width) var(--ak-color-focus-ring);
|
|
691
|
+
}
|
|
692
|
+
|
|
655
693
|
:where([data-slot="command-header"]) {
|
|
656
694
|
display: flex;
|
|
657
695
|
align-items: center;
|