@gemologic/sheen 0.1.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +19 -0
- package/README.md +32 -0
- package/dist/core.d.ts +52 -0
- package/dist/core.js +29 -0
- package/dist/formisch.d.ts +5 -0
- package/dist/formisch.js +22 -0
- package/dist/forms.d.ts +34 -0
- package/dist/forms.js +18 -0
- package/dist/index.d.ts +144 -0
- package/dist/index.js +75 -0
- package/dist/layout/Layout.d.ts +28 -0
- package/dist/layout/Layout.js +121 -0
- package/dist/metadata.d.ts +46 -0
- package/dist/metadata.js +47 -0
- package/dist/navigation.d.ts +30 -0
- package/dist/navigation.js +16 -0
- package/dist/overlays.d.ts +28 -0
- package/dist/overlays.js +15 -0
- package/dist/primitives/Accordion.d.ts +16 -0
- package/dist/primitives/Accordion.js +223 -0
- package/dist/primitives/ActivityTimeline.d.ts +20 -0
- package/dist/primitives/ActivityTimeline.js +104 -0
- package/dist/primitives/AlertDialog.d.ts +7 -0
- package/dist/primitives/AlertDialog.js +8 -0
- package/dist/primitives/Avatar.d.ts +22 -0
- package/dist/primitives/Avatar.js +115 -0
- package/dist/primitives/Breadcrumb.d.ts +11 -0
- package/dist/primitives/Breadcrumb.js +66 -0
- package/dist/primitives/Button.d.ts +11 -0
- package/dist/primitives/Button.js +59 -0
- package/dist/primitives/ButtonGroup.d.ts +7 -0
- package/dist/primitives/ButtonGroup.js +33 -0
- package/dist/primitives/Checkbox.d.ts +22 -0
- package/dist/primitives/Checkbox.js +93 -0
- package/dist/primitives/CheckboxGroup.d.ts +18 -0
- package/dist/primitives/CheckboxGroup.js +122 -0
- package/dist/primitives/Collapsible.d.ts +9 -0
- package/dist/primitives/Collapsible.js +72 -0
- package/dist/primitives/Combobox.d.ts +41 -0
- package/dist/primitives/Combobox.js +684 -0
- package/dist/primitives/CommandPalette.d.ts +42 -0
- package/dist/primitives/CommandPalette.js +319 -0
- package/dist/primitives/ConfirmDialog.d.ts +11 -0
- package/dist/primitives/ConfirmDialog.js +42 -0
- package/dist/primitives/ContextMenu.d.ts +16 -0
- package/dist/primitives/ContextMenu.js +132 -0
- package/dist/primitives/DescriptionList.d.ts +11 -0
- package/dist/primitives/DescriptionList.js +44 -0
- package/dist/primitives/Dialog.d.ts +21 -0
- package/dist/primitives/Dialog.js +141 -0
- package/dist/primitives/Drawer.d.ts +9 -0
- package/dist/primitives/Drawer.js +21 -0
- package/dist/primitives/DropdownMenu.d.ts +59 -0
- package/dist/primitives/DropdownMenu.js +441 -0
- package/dist/primitives/EditableTextField.d.ts +11 -0
- package/dist/primitives/EditableTextField.js +126 -0
- package/dist/primitives/EmptyState.d.ts +7 -0
- package/dist/primitives/EmptyState.js +45 -0
- package/dist/primitives/Field.d.ts +18 -0
- package/dist/primitives/Field.js +72 -0
- package/dist/primitives/FileDropzone.d.ts +40 -0
- package/dist/primitives/FileDropzone.js +261 -0
- package/dist/primitives/IconButton.d.ts +8 -0
- package/dist/primitives/IconButton.js +34 -0
- package/dist/primitives/Input.d.ts +7 -0
- package/dist/primitives/Input.js +55 -0
- package/dist/primitives/InputGroup.d.ts +7 -0
- package/dist/primitives/InputGroup.js +73 -0
- package/dist/primitives/Link.d.ts +7 -0
- package/dist/primitives/Link.js +35 -0
- package/dist/primitives/LinkTooltip.d.ts +11 -0
- package/dist/primitives/LinkTooltip.js +88 -0
- package/dist/primitives/NavList.d.ts +17 -0
- package/dist/primitives/NavList.js +143 -0
- package/dist/primitives/Notice.d.ts +8 -0
- package/dist/primitives/Notice.js +64 -0
- package/dist/primitives/NumberField.d.ts +22 -0
- package/dist/primitives/NumberField.js +177 -0
- package/dist/primitives/Pagination.d.ts +12 -0
- package/dist/primitives/Pagination.js +127 -0
- package/dist/primitives/Popover.d.ts +12 -0
- package/dist/primitives/Popover.js +103 -0
- package/dist/primitives/Progress.d.ts +17 -0
- package/dist/primitives/Progress.js +98 -0
- package/dist/primitives/RadioGroup.d.ts +19 -0
- package/dist/primitives/RadioGroup.js +173 -0
- package/dist/primitives/Resizable.d.ts +36 -0
- package/dist/primitives/Resizable.js +196 -0
- package/dist/primitives/ScrollArea.d.ts +6 -0
- package/dist/primitives/ScrollArea.js +178 -0
- package/dist/primitives/SearchInput.d.ts +12 -0
- package/dist/primitives/SearchInput.js +89 -0
- package/dist/primitives/SegmentedControl.d.ts +25 -0
- package/dist/primitives/SegmentedControl.js +188 -0
- package/dist/primitives/Select.d.ts +24 -0
- package/dist/primitives/Select.js +320 -0
- package/dist/primitives/Separator.d.ts +6 -0
- package/dist/primitives/Separator.js +31 -0
- package/dist/primitives/ShortcutPending.d.ts +6 -0
- package/dist/primitives/ShortcutPending.js +40 -0
- package/dist/primitives/ShortcutProvider.d.ts +32 -0
- package/dist/primitives/ShortcutProvider.js +172 -0
- package/dist/primitives/ShortcutScope.d.ts +6 -0
- package/dist/primitives/ShortcutScope.js +29 -0
- package/dist/primitives/ShortcutSheet.d.ts +5 -0
- package/dist/primitives/ShortcutSheet.js +87 -0
- package/dist/primitives/Skeleton.d.ts +5 -0
- package/dist/primitives/Skeleton.js +23 -0
- package/dist/primitives/Slider.d.ts +35 -0
- package/dist/primitives/Slider.js +210 -0
- package/dist/primitives/Spinner.d.ts +7 -0
- package/dist/primitives/Spinner.js +44 -0
- package/dist/primitives/Status.d.ts +15 -0
- package/dist/primitives/Status.js +78 -0
- package/dist/primitives/Stepper.d.ts +32 -0
- package/dist/primitives/Stepper.js +147 -0
- package/dist/primitives/Surface.d.ts +11 -0
- package/dist/primitives/Surface.js +58 -0
- package/dist/primitives/Switch.d.ts +4 -0
- package/dist/primitives/Switch.js +7 -0
- package/dist/primitives/Table.d.ts +23 -0
- package/dist/primitives/Table.js +101 -0
- package/dist/primitives/Tabs.d.ts +17 -0
- package/dist/primitives/Tabs.js +157 -0
- package/dist/primitives/TagInput.d.ts +33 -0
- package/dist/primitives/TagInput.js +288 -0
- package/dist/primitives/Textarea.d.ts +8 -0
- package/dist/primitives/Textarea.js +106 -0
- package/dist/primitives/Toast.d.ts +10 -0
- package/dist/primitives/Toast.js +78 -0
- package/dist/primitives/Toaster.d.ts +9 -0
- package/dist/primitives/Toaster.js +183 -0
- package/dist/primitives/Tooltip.d.ts +13 -0
- package/dist/primitives/Tooltip.js +84 -0
- package/dist/primitives/Tree.d.ts +23 -0
- package/dist/primitives/Tree.js +275 -0
- package/dist/primitives/Typography.d.ts +16 -0
- package/dist/primitives/Typography.js +82 -0
- package/dist/primitives/boolean-input-state.d.ts +14 -0
- package/dist/primitives/boolean-input-state.js +39 -0
- package/dist/primitives/button-variants.d.ts +9 -0
- package/dist/primitives/button-variants.js +7 -0
- package/dist/primitives/choice-options.d.ts +7 -0
- package/dist/primitives/choice-options.js +35 -0
- package/dist/primitives/create-confirm.d.ts +15 -0
- package/dist/primitives/create-confirm.js +49 -0
- package/dist/primitives/create-toaster.d.ts +51 -0
- package/dist/primitives/create-toaster.js +87 -0
- package/dist/primitives/link-focus.d.ts +2 -0
- package/dist/primitives/link-focus.js +38 -0
- package/dist/primitives/menu-focus.d.ts +3 -0
- package/dist/primitives/menu-focus.js +32 -0
- package/dist/primitives/tooltip-layer.d.ts +14 -0
- package/dist/primitives/tooltip-layer.js +84 -0
- package/dist/theme/ThemeProvider.d.ts +59 -0
- package/dist/theme/ThemeProvider.js +239 -0
- package/dist/theme/intl.d.ts +6 -0
- package/dist/theme/intl.js +13 -0
- package/dist/theme/keyboard-script.d.ts +2 -0
- package/dist/theme/keyboard-script.js +6 -0
- package/dist/theme/layers.d.ts +7 -0
- package/dist/theme/layers.js +23 -0
- package/dist/theme/messages.d.ts +235 -0
- package/dist/theme/messages.js +115 -0
- package/dist/theme/script.d.ts +9 -0
- package/dist/theme/script.js +49 -0
- package/dist/theme/state.d.ts +27 -0
- package/dist/theme/state.js +55 -0
- package/dist/utils/browser-status.d.ts +5 -0
- package/dist/utils/browser-status.js +22 -0
- package/dist/utils/cn.d.ts +3 -0
- package/dist/utils/cn.js +7 -0
- package/dist/utils/optimistic.d.ts +6 -0
- package/dist/utils/optimistic.js +16 -0
- package/dist/utils/polymorphic.d.ts +1 -0
- package/dist/utils/shortcut-platform.d.ts +2 -0
- package/dist/utils/shortcut-platform.js +10 -0
- package/dist/utils/shortcut-registry.d.ts +61 -0
- package/dist/utils/shortcut-registry.js +186 -0
- package/package.json +100 -0
- package/src/core.ts +55 -0
- package/src/formisch.ts +28 -0
- package/src/forms.ts +34 -0
- package/src/index.ts +144 -0
- package/src/layout/Layout.tsx +43 -0
- package/src/metadata.d.ts +46 -0
- package/src/metadata.ts +66 -0
- package/src/navigation.ts +30 -0
- package/src/overlays.ts +28 -0
- package/src/primitives/Accordion.tsx +145 -0
- package/src/primitives/ActivityTimeline.tsx +72 -0
- package/src/primitives/AlertDialog.tsx +8 -0
- package/src/primitives/Avatar.tsx +85 -0
- package/src/primitives/Breadcrumb.tsx +41 -0
- package/src/primitives/Button.tsx +27 -0
- package/src/primitives/ButtonGroup.tsx +18 -0
- package/src/primitives/Checkbox.tsx +51 -0
- package/src/primitives/CheckboxGroup.tsx +73 -0
- package/src/primitives/Collapsible.tsx +43 -0
- package/src/primitives/Combobox.tsx +402 -0
- package/src/primitives/CommandPalette.tsx +234 -0
- package/src/primitives/ConfirmDialog.tsx +25 -0
- package/src/primitives/ContextMenu.tsx +100 -0
- package/src/primitives/DescriptionList.tsx +26 -0
- package/src/primitives/Dialog.tsx +81 -0
- package/src/primitives/Drawer.tsx +26 -0
- package/src/primitives/DropdownMenu.tsx +221 -0
- package/src/primitives/EditableTextField.tsx +91 -0
- package/src/primitives/EmptyState.tsx +21 -0
- package/src/primitives/Field.tsx +38 -0
- package/src/primitives/FileDropzone.tsx +189 -0
- package/src/primitives/IconButton.tsx +22 -0
- package/src/primitives/Input.tsx +17 -0
- package/src/primitives/InputGroup.tsx +23 -0
- package/src/primitives/Link.tsx +19 -0
- package/src/primitives/LinkTooltip.tsx +31 -0
- package/src/primitives/NavList.tsx +58 -0
- package/src/primitives/Notice.tsx +25 -0
- package/src/primitives/NumberField.tsx +168 -0
- package/src/primitives/Pagination.tsx +64 -0
- package/src/primitives/Popover.tsx +44 -0
- package/src/primitives/Progress.tsx +62 -0
- package/src/primitives/RadioGroup.tsx +104 -0
- package/src/primitives/Resizable.tsx +170 -0
- package/src/primitives/ScrollArea.tsx +115 -0
- package/src/primitives/SearchInput.tsx +98 -0
- package/src/primitives/SegmentedControl.tsx +140 -0
- package/src/primitives/Select.tsx +171 -0
- package/src/primitives/Separator.tsx +13 -0
- package/src/primitives/ShortcutPending.tsx +21 -0
- package/src/primitives/ShortcutProvider.tsx +179 -0
- package/src/primitives/ShortcutScope.tsx +17 -0
- package/src/primitives/ShortcutSheet.tsx +35 -0
- package/src/primitives/Skeleton.tsx +12 -0
- package/src/primitives/Slider.tsx +153 -0
- package/src/primitives/Spinner.tsx +19 -0
- package/src/primitives/Status.tsx +33 -0
- package/src/primitives/Stepper.tsx +106 -0
- package/src/primitives/Surface.tsx +21 -0
- package/src/primitives/Switch.tsx +9 -0
- package/src/primitives/Table.tsx +57 -0
- package/src/primitives/Tabs.tsx +96 -0
- package/src/primitives/TagInput.tsx +282 -0
- package/src/primitives/Textarea.tsx +77 -0
- package/src/primitives/Toast.tsx +36 -0
- package/src/primitives/Toaster.tsx +175 -0
- package/src/primitives/Tooltip.tsx +41 -0
- package/src/primitives/Tree.tsx +256 -0
- package/src/primitives/Typography.tsx +39 -0
- package/src/primitives/boolean-input-state.ts +65 -0
- package/src/primitives/button-variants.ts +20 -0
- package/src/primitives/choice-options.ts +39 -0
- package/src/primitives/create-confirm.tsx +56 -0
- package/src/primitives/create-toaster.ts +128 -0
- package/src/primitives/link-focus.ts +38 -0
- package/src/primitives/menu-focus.ts +43 -0
- package/src/primitives/tooltip-layer.tsx +53 -0
- package/src/styles.css +655 -0
- package/src/theme/ThemeProvider.tsx +215 -0
- package/src/theme/intl.ts +14 -0
- package/src/theme/keyboard-script.ts +4 -0
- package/src/theme/layers.ts +16 -0
- package/src/theme/messages.ts +157 -0
- package/src/theme/script.ts +70 -0
- package/src/theme/state.ts +48 -0
- package/src/utils/browser-status.ts +36 -0
- package/src/utils/cn.ts +5 -0
- package/src/utils/optimistic.ts +22 -0
- package/src/utils/polymorphic.ts +1 -0
- package/src/utils/shortcut-platform.ts +4 -0
- package/src/utils/shortcut-registry.ts +216 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
export interface CommandPaletteCommand {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly label: string;
|
|
5
|
+
readonly group: string;
|
|
6
|
+
readonly keywords?: readonly string[];
|
|
7
|
+
readonly disabled?: boolean;
|
|
8
|
+
readonly run: () => void | Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export interface CommandPaletteStaticSource {
|
|
11
|
+
readonly kind: "static";
|
|
12
|
+
readonly id: string;
|
|
13
|
+
readonly commands: readonly CommandPaletteCommand[];
|
|
14
|
+
}
|
|
15
|
+
export interface CommandPaletteRemoteSource {
|
|
16
|
+
readonly kind: "remote";
|
|
17
|
+
readonly id: string;
|
|
18
|
+
readonly initialCommands?: readonly CommandPaletteCommand[];
|
|
19
|
+
readonly minimumQueryLength?: number;
|
|
20
|
+
readonly search: (query: string, signal: AbortSignal) => Promise<readonly CommandPaletteCommand[]>;
|
|
21
|
+
}
|
|
22
|
+
export type CommandPaletteSource = CommandPaletteStaticSource | CommandPaletteRemoteSource;
|
|
23
|
+
export interface CommandPaletteRecents {
|
|
24
|
+
readonly initialIds: readonly string[];
|
|
25
|
+
readonly limit?: number;
|
|
26
|
+
readonly save: (ids: readonly string[]) => void | Promise<void>;
|
|
27
|
+
readonly onError: (error: unknown) => void;
|
|
28
|
+
}
|
|
29
|
+
export interface CommandPaletteProps {
|
|
30
|
+
readonly sources: readonly CommandPaletteSource[];
|
|
31
|
+
readonly open?: boolean;
|
|
32
|
+
readonly defaultOpen?: boolean;
|
|
33
|
+
readonly onOpenChange?: (open: boolean) => void;
|
|
34
|
+
readonly recents?: CommandPaletteRecents;
|
|
35
|
+
readonly shortcutScope?: string;
|
|
36
|
+
readonly onSourceError?: (sourceId: string, error: unknown) => void;
|
|
37
|
+
readonly onCommandError?: (commandId: string, error: unknown) => void;
|
|
38
|
+
readonly class?: string;
|
|
39
|
+
}
|
|
40
|
+
/** Deterministic fuzzy rank used by cmdk: exact, prefix, substring, then subsequence. */
|
|
41
|
+
export declare function commandPaletteFilter(value: string, search: string, keywords?: readonly string[]): number;
|
|
42
|
+
export declare function CommandPalette(props: CommandPaletteProps): JSX.Element;
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { useTheme as e } from "../theme/ThemeProvider.js";
|
|
2
|
+
import { cn as t } from "../utils/cn.js";
|
|
3
|
+
import { useModalShortcutScope as n, useShortcut as r, useShortcutCommands as i } from "./ShortcutProvider.js";
|
|
4
|
+
import { Kbd as a, Text as o } from "./Typography.js";
|
|
5
|
+
import { createComponent as s, insert as c, mergeProps as l, template as u } from "solid-js/web";
|
|
6
|
+
import { For as d, Show as f, createEffect as p, createMemo as m, createSignal as h, createUniqueId as g, onCleanup as _, splitProps as v } from "solid-js";
|
|
7
|
+
import * as y from "@kobalte/core/dialog";
|
|
8
|
+
import { Command as b } from "cmdk-solid";
|
|
9
|
+
//#region src/primitives/CommandPalette.tsx
|
|
10
|
+
var x = /*#__PURE__*/ u("<span>"), S = /*#__PURE__*/ u("<div role=alert>");
|
|
11
|
+
function C(e, t) {
|
|
12
|
+
let n = e.trim();
|
|
13
|
+
if (!n) throw Error(`CommandPalette ${t} must be nonempty`);
|
|
14
|
+
return n;
|
|
15
|
+
}
|
|
16
|
+
function w(e, t) {
|
|
17
|
+
let n = /* @__PURE__ */ new Set();
|
|
18
|
+
return Object.freeze(e.map((e) => {
|
|
19
|
+
let r = C(e.id, `${t} command id`);
|
|
20
|
+
if (n.has(r)) throw Error(`CommandPalette ${t} has duplicate command id: ${r}`);
|
|
21
|
+
n.add(r), C(e.label, `${r} label`), C(e.group, `${r} group`);
|
|
22
|
+
for (let t of e.keywords ?? []) C(t, `${r} keyword`);
|
|
23
|
+
return e;
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
function T(e, t) {
|
|
27
|
+
let n = Array.from(e.toLocaleLowerCase("en-US")), r = Array.from(t.toLocaleLowerCase("en-US")), i = 0, a = 0;
|
|
28
|
+
for (let e of r) {
|
|
29
|
+
let t = n.indexOf(e, i);
|
|
30
|
+
if (t < 0) return 0;
|
|
31
|
+
a += t - i, i = t + 1;
|
|
32
|
+
}
|
|
33
|
+
return Math.max(.1, .55 - a / Math.max(n.length, 1) * .2);
|
|
34
|
+
}
|
|
35
|
+
function E(e, t, n = []) {
|
|
36
|
+
let r = t.trim().toLocaleLowerCase("en-US");
|
|
37
|
+
if (!r) return 1;
|
|
38
|
+
let i = [e, ...n].map((e) => e.toLocaleLowerCase("en-US")), a = 0;
|
|
39
|
+
for (let e of i) a = e === r ? Math.max(a, 1) : e.startsWith(r) ? Math.max(a, .9) : e.includes(r) ? Math.max(a, .7) : Math.max(a, T(e, r));
|
|
40
|
+
return a;
|
|
41
|
+
}
|
|
42
|
+
function D(e) {
|
|
43
|
+
let t = /* @__PURE__ */ new Set();
|
|
44
|
+
for (let n of e) {
|
|
45
|
+
let e = C(n, "recent id");
|
|
46
|
+
if (t.has(e)) throw Error(`CommandPalette has duplicate recent id: ${e}`);
|
|
47
|
+
t.add(e);
|
|
48
|
+
}
|
|
49
|
+
return Object.freeze([...t]);
|
|
50
|
+
}
|
|
51
|
+
function O(u) {
|
|
52
|
+
let C = e(), T = i(), [O] = v(u, [
|
|
53
|
+
"sources",
|
|
54
|
+
"open",
|
|
55
|
+
"defaultOpen",
|
|
56
|
+
"onOpenChange",
|
|
57
|
+
"recents",
|
|
58
|
+
"shortcutScope",
|
|
59
|
+
"onSourceError",
|
|
60
|
+
"onCommandError",
|
|
61
|
+
"class"
|
|
62
|
+
]), [ee, k] = h(O.defaultOpen ?? !1), [A, j] = h(""), [M, N] = h(!1), [P, F] = h(), [I, L] = h(D(O.recents?.initialIds ?? [])), R = O.sources.flatMap((e) => e.kind === "remote" ? e.initialCommands ?? [] : []), [z, B] = h(w(R, "initial remote results")), V = 0, H = () => O.open === void 0 ? ee() : O.open, U = (e) => {
|
|
63
|
+
e !== H() && (O.open === void 0 && k(e), e || j(""), O.onOpenChange?.(e));
|
|
64
|
+
}, W = g();
|
|
65
|
+
r({
|
|
66
|
+
keys: "mod+k",
|
|
67
|
+
scope: O.shortcutScope ?? "global",
|
|
68
|
+
label: C.messages().openCommandPalette,
|
|
69
|
+
group: "Navigation",
|
|
70
|
+
run: () => U(!H())
|
|
71
|
+
}), n(() => `command-palette:${W}`, H), p(() => {
|
|
72
|
+
H() && _(C.layers.register(W));
|
|
73
|
+
});
|
|
74
|
+
let G = m((e) => H() ? C.layers.zIndex(W) : e ?? 100), K = m(() => w(O.sources.flatMap((e) => e.kind === "static" ? e.commands : []), "static sources"));
|
|
75
|
+
p(() => {
|
|
76
|
+
let e = A().trim(), t = O.sources.flatMap((t) => t.kind === "remote" && e.length >= (t.minimumQueryLength ?? 1) ? [t] : []), n = ++V;
|
|
77
|
+
if (!t.length) {
|
|
78
|
+
N(!1), F(void 0);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
let r = new AbortController();
|
|
82
|
+
N(!0), F(void 0), Promise.all(t.map(async (t) => ({
|
|
83
|
+
source: t,
|
|
84
|
+
commands: await t.search(e, r.signal)
|
|
85
|
+
}))).then((e) => {
|
|
86
|
+
if (n !== V || r.signal.aborted) return;
|
|
87
|
+
let t = /* @__PURE__ */ new Set(), i = e.flatMap((e) => w(e.commands, `source ${e.source.id}`)).map((e) => {
|
|
88
|
+
if (t.has(e.id)) throw Error(`CommandPalette remote sources have duplicate command id: ${e.id}`);
|
|
89
|
+
return t.add(e.id), e;
|
|
90
|
+
});
|
|
91
|
+
B(Object.freeze(i)), N(!1);
|
|
92
|
+
}).catch((e) => {
|
|
93
|
+
if (!(n !== V || r.signal.aborted)) {
|
|
94
|
+
N(!1), F(C.messages().commandSourceFailed);
|
|
95
|
+
for (let n of t) O.onSourceError?.(n.id, e);
|
|
96
|
+
}
|
|
97
|
+
}), _(() => r.abort());
|
|
98
|
+
});
|
|
99
|
+
let q = m(() => T.bindings().filter((e) => !e.shadowed).map((e) => Object.freeze({
|
|
100
|
+
id: `shortcut:${e.id}`,
|
|
101
|
+
label: e.label,
|
|
102
|
+
group: e.group,
|
|
103
|
+
keywords: [
|
|
104
|
+
e.keys,
|
|
105
|
+
e.displayKeys,
|
|
106
|
+
e.scope
|
|
107
|
+
],
|
|
108
|
+
disabled: e.keys === "mod+k" && e.label === C.messages().openCommandPalette,
|
|
109
|
+
run: () => {
|
|
110
|
+
T.run(e.id);
|
|
111
|
+
}
|
|
112
|
+
}))), J = m(() => {
|
|
113
|
+
let e = [
|
|
114
|
+
...K(),
|
|
115
|
+
...z(),
|
|
116
|
+
...q()
|
|
117
|
+
], t = /* @__PURE__ */ new Set();
|
|
118
|
+
for (let n of e) {
|
|
119
|
+
if (t.has(n.id)) throw Error(`CommandPalette has duplicate command id: ${n.id}`);
|
|
120
|
+
t.add(n.id);
|
|
121
|
+
}
|
|
122
|
+
return e;
|
|
123
|
+
}), Y = m(() => new Map(J().map((e) => [e.id, e]))), X = m(() => A().trim() ? [] : I().flatMap((e) => {
|
|
124
|
+
let t = Y().get(e);
|
|
125
|
+
return t && !t.disabled ? [t] : [];
|
|
126
|
+
})), Z = m(() => new Set(X().map((e) => e.id))), Q = m(() => [...new Set(J().filter((e) => !Z().has(e.id)).map((e) => e.group))]), te = (e) => {
|
|
127
|
+
let t = O.recents;
|
|
128
|
+
if (!t || e.startsWith("shortcut:")) return;
|
|
129
|
+
let n = t.limit ?? 5;
|
|
130
|
+
if (!Number.isSafeInteger(n) || n < 1) throw Error("CommandPalette recent limit must be a positive integer");
|
|
131
|
+
let r = Object.freeze([e, ...I().filter((t) => t !== e)].slice(0, n));
|
|
132
|
+
L(r);
|
|
133
|
+
try {
|
|
134
|
+
let e = t.save(r);
|
|
135
|
+
e instanceof Promise && e.catch(t.onError);
|
|
136
|
+
} catch (e) {
|
|
137
|
+
t.onError(e);
|
|
138
|
+
}
|
|
139
|
+
}, ne = (e) => {
|
|
140
|
+
if (!e.disabled) {
|
|
141
|
+
U(!1), te(e.id);
|
|
142
|
+
try {
|
|
143
|
+
let t = e.run();
|
|
144
|
+
t instanceof Promise && t.catch((t) => O.onCommandError?.(e.id, t));
|
|
145
|
+
} catch (t) {
|
|
146
|
+
O.onCommandError?.(e.id, t);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}, $ = (e) => {
|
|
150
|
+
let t = () => T.bindings().find((t) => `shortcut:${t.id}` === e.id);
|
|
151
|
+
return s(b.Item, l({
|
|
152
|
+
get value() {
|
|
153
|
+
return `${e.id} ${e.label}`;
|
|
154
|
+
},
|
|
155
|
+
get keywords() {
|
|
156
|
+
return [...e.keywords ?? []];
|
|
157
|
+
}
|
|
158
|
+
}, () => e.disabled === void 0 ? {} : { disabled: e.disabled }, {
|
|
159
|
+
onSelect: () => ne(e),
|
|
160
|
+
get children() {
|
|
161
|
+
return [(() => {
|
|
162
|
+
var t = x();
|
|
163
|
+
return c(t, () => e.label), t;
|
|
164
|
+
})(), s(f, {
|
|
165
|
+
get when() {
|
|
166
|
+
return t();
|
|
167
|
+
},
|
|
168
|
+
children: (e) => s(a, { get children() {
|
|
169
|
+
return e().displayKeys;
|
|
170
|
+
} })
|
|
171
|
+
})];
|
|
172
|
+
}
|
|
173
|
+
}));
|
|
174
|
+
};
|
|
175
|
+
return s(y.Root, {
|
|
176
|
+
get open() {
|
|
177
|
+
return H();
|
|
178
|
+
},
|
|
179
|
+
onOpenChange: U,
|
|
180
|
+
get children() {
|
|
181
|
+
return s(f, {
|
|
182
|
+
get when() {
|
|
183
|
+
return C.portal();
|
|
184
|
+
},
|
|
185
|
+
children: (e) => s(y.Portal, {
|
|
186
|
+
get mount() {
|
|
187
|
+
return e();
|
|
188
|
+
},
|
|
189
|
+
get children() {
|
|
190
|
+
return [s(y.Overlay, {
|
|
191
|
+
class: "sheen-command-overlay",
|
|
192
|
+
get style() {
|
|
193
|
+
return { "z-index": G() };
|
|
194
|
+
}
|
|
195
|
+
}), s(y.Content, {
|
|
196
|
+
class: "sheen-command-dialog",
|
|
197
|
+
get style() {
|
|
198
|
+
return { "z-index": G() + 1 };
|
|
199
|
+
},
|
|
200
|
+
get "aria-label"() {
|
|
201
|
+
return C.messages().commandPalette;
|
|
202
|
+
},
|
|
203
|
+
onEscapeKeyDown: (e) => {
|
|
204
|
+
C.layers.isTop(W) || e.preventDefault();
|
|
205
|
+
},
|
|
206
|
+
get children() {
|
|
207
|
+
return s(b, {
|
|
208
|
+
get class() {
|
|
209
|
+
return t("sheen-command-palette", O.class);
|
|
210
|
+
},
|
|
211
|
+
get label() {
|
|
212
|
+
return C.messages().commandPalette;
|
|
213
|
+
},
|
|
214
|
+
filter: (e, t, n) => E(e, t, n),
|
|
215
|
+
loop: !0,
|
|
216
|
+
get "data-refreshing"() {
|
|
217
|
+
return M() || void 0;
|
|
218
|
+
},
|
|
219
|
+
get children() {
|
|
220
|
+
return [s(b.Input, {
|
|
221
|
+
get value() {
|
|
222
|
+
return A();
|
|
223
|
+
},
|
|
224
|
+
onValueChange: j,
|
|
225
|
+
get placeholder() {
|
|
226
|
+
return C.messages().searchCommands;
|
|
227
|
+
},
|
|
228
|
+
get "aria-label"() {
|
|
229
|
+
return C.messages().searchCommands;
|
|
230
|
+
}
|
|
231
|
+
}), s(b.List, {
|
|
232
|
+
get label() {
|
|
233
|
+
return C.messages().commandResults;
|
|
234
|
+
},
|
|
235
|
+
get children() {
|
|
236
|
+
return [
|
|
237
|
+
s(f, {
|
|
238
|
+
get when() {
|
|
239
|
+
return M();
|
|
240
|
+
},
|
|
241
|
+
get children() {
|
|
242
|
+
return s(b.Loading, {
|
|
243
|
+
get label() {
|
|
244
|
+
return C.messages().loading;
|
|
245
|
+
},
|
|
246
|
+
get children() {
|
|
247
|
+
return C.messages().refreshingCommands;
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
}),
|
|
252
|
+
s(f, {
|
|
253
|
+
get when() {
|
|
254
|
+
return P();
|
|
255
|
+
},
|
|
256
|
+
children: (e) => (() => {
|
|
257
|
+
var t = S();
|
|
258
|
+
return c(t, s(o, {
|
|
259
|
+
tone: "muted",
|
|
260
|
+
get children() {
|
|
261
|
+
return e();
|
|
262
|
+
}
|
|
263
|
+
})), t;
|
|
264
|
+
})()
|
|
265
|
+
}),
|
|
266
|
+
s(b.Empty, { get children() {
|
|
267
|
+
return C.messages().noResults;
|
|
268
|
+
} }),
|
|
269
|
+
s(f, {
|
|
270
|
+
get when() {
|
|
271
|
+
return X().length;
|
|
272
|
+
},
|
|
273
|
+
get children() {
|
|
274
|
+
return s(b.Group, {
|
|
275
|
+
get heading() {
|
|
276
|
+
return C.messages().recentCommands;
|
|
277
|
+
},
|
|
278
|
+
get children() {
|
|
279
|
+
return s(d, {
|
|
280
|
+
get each() {
|
|
281
|
+
return X();
|
|
282
|
+
},
|
|
283
|
+
children: $
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
}),
|
|
289
|
+
s(d, {
|
|
290
|
+
get each() {
|
|
291
|
+
return Q();
|
|
292
|
+
},
|
|
293
|
+
children: (e) => s(b.Group, {
|
|
294
|
+
heading: e,
|
|
295
|
+
get children() {
|
|
296
|
+
return s(d, {
|
|
297
|
+
get each() {
|
|
298
|
+
return J().filter((t) => t.group === e && !Z().has(t.id));
|
|
299
|
+
},
|
|
300
|
+
children: $
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
})
|
|
304
|
+
})
|
|
305
|
+
];
|
|
306
|
+
}
|
|
307
|
+
})];
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
})];
|
|
312
|
+
}
|
|
313
|
+
})
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
//#endregion
|
|
319
|
+
export { O as CommandPalette, E as commandPaletteFilter };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
import type { AlertDialogProps } from "./AlertDialog.tsx";
|
|
3
|
+
export interface ConfirmDialogProps extends Omit<AlertDialogProps, "children" | "footer" | "trigger" | "initialFocus" | "closeLabel" | "dismissible" | "defaultOpen" | "onOpenChange"> {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onConfirm: () => void;
|
|
6
|
+
onCancel: () => void;
|
|
7
|
+
confirmLabel?: string;
|
|
8
|
+
cancelLabel?: string;
|
|
9
|
+
tone?: "accent" | "danger";
|
|
10
|
+
}
|
|
11
|
+
export declare function ConfirmDialog(props: ConfirmDialogProps): JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { useTheme as e } from "../theme/ThemeProvider.js";
|
|
2
|
+
import { Button as t } from "./Button.js";
|
|
3
|
+
import { AlertDialog as n } from "./AlertDialog.js";
|
|
4
|
+
import { createComponent as r, mergeProps as i } from "solid-js/web";
|
|
5
|
+
//#region src/primitives/ConfirmDialog.tsx
|
|
6
|
+
function a(a) {
|
|
7
|
+
let o = e();
|
|
8
|
+
return r(n, i({
|
|
9
|
+
get title() {
|
|
10
|
+
return a.title;
|
|
11
|
+
},
|
|
12
|
+
get description() {
|
|
13
|
+
return a.description;
|
|
14
|
+
},
|
|
15
|
+
get open() {
|
|
16
|
+
return a.open;
|
|
17
|
+
}
|
|
18
|
+
}, () => a.contentId === void 0 ? {} : { contentId: a.contentId }, () => a.class === void 0 ? {} : { class: a.class }, () => a.returnFocus === void 0 ? {} : { returnFocus: a.returnFocus }, () => a.shortcutScope === void 0 ? {} : { shortcutScope: a.shortcutScope }, {
|
|
19
|
+
get closeLabel() {
|
|
20
|
+
return a.cancelLabel ?? o.messages().cancel;
|
|
21
|
+
},
|
|
22
|
+
onOpenChange: (e) => {
|
|
23
|
+
e || a.onCancel();
|
|
24
|
+
},
|
|
25
|
+
get footer() {
|
|
26
|
+
return r(t, {
|
|
27
|
+
variant: "solid",
|
|
28
|
+
get tone() {
|
|
29
|
+
return a.tone ?? "accent";
|
|
30
|
+
},
|
|
31
|
+
get onClick() {
|
|
32
|
+
return a.onConfirm;
|
|
33
|
+
},
|
|
34
|
+
get children() {
|
|
35
|
+
return a.confirmLabel ?? o.messages().confirm;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
export { a as ConfirmDialog };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
import type { MenuItem } from "./DropdownMenu.tsx";
|
|
3
|
+
interface ContextMenuOptions {
|
|
4
|
+
/** Shared menu model. An empty collection leaves the native browser menu available. */
|
|
5
|
+
readonly items: readonly MenuItem[];
|
|
6
|
+
readonly disabled?: boolean;
|
|
7
|
+
readonly onOpenChange?: (open: boolean) => void;
|
|
8
|
+
readonly menuClass?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ContextMenuProps extends ContextMenuOptions, JSX.HTMLAttributes<HTMLElement> {
|
|
11
|
+
/** Supported native trigger semantics. */
|
|
12
|
+
readonly as?: "div" | "tr" | "li";
|
|
13
|
+
}
|
|
14
|
+
/** A pointer/keyboard context menu whose trigger stays the requested native element. */
|
|
15
|
+
export declare function ContextMenu(props: ContextMenuProps): JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { useTheme as e } from "../theme/ThemeProvider.js";
|
|
2
|
+
import { cn as t } from "../utils/cn.js";
|
|
3
|
+
import { useShortcutKeyboardOwner as n } from "./ShortcutProvider.js";
|
|
4
|
+
import { createMenuFocusRecovery as r } from "./menu-focus.js";
|
|
5
|
+
import { MenuItems as i, validateMenuTree as a } from "./DropdownMenu.js";
|
|
6
|
+
import { createComponent as o, memo as s, mergeProps as c } from "solid-js/web";
|
|
7
|
+
import { Show as l, createEffect as u, createMemo as d, createSignal as f, createUniqueId as p, onCleanup as m, splitProps as h } from "solid-js";
|
|
8
|
+
import { MenuContent as g, MenuPortal as _, MenuRoot as v } from "@kobalte/core/menu";
|
|
9
|
+
import { Polymorphic as y } from "@kobalte/core/polymorphic";
|
|
10
|
+
//#region src/primitives/ContextMenu.tsx
|
|
11
|
+
function b(e, t) {
|
|
12
|
+
typeof e == "function" ? e(t) : Array.isArray(e) && typeof e[0] == "function" && e[0](e[1], t);
|
|
13
|
+
}
|
|
14
|
+
function x(x) {
|
|
15
|
+
let S = e(), C = p(), [w, T] = h(x, [
|
|
16
|
+
"as",
|
|
17
|
+
"items",
|
|
18
|
+
"disabled",
|
|
19
|
+
"onOpenChange",
|
|
20
|
+
"menuClass",
|
|
21
|
+
"children"
|
|
22
|
+
]), E = d(() => (a(w.items), w.items)), D = () => w.disabled === !0 || E().length === 0, [O, k] = f(!1), [A, j] = f({
|
|
23
|
+
x: 0,
|
|
24
|
+
y: 0
|
|
25
|
+
}), M = (e) => {
|
|
26
|
+
e === O() || e && D() || (k(e), w.onOpenChange?.(e));
|
|
27
|
+
}, [N, P] = f();
|
|
28
|
+
n(N, O), r(N, O), u(() => {
|
|
29
|
+
O() && m(S.layers.register(C));
|
|
30
|
+
});
|
|
31
|
+
let F = d((e) => O() ? S.layers.zIndex(C) : e ?? 100), I = () => T.id ?? `${C}-trigger`;
|
|
32
|
+
function L() {
|
|
33
|
+
queueMicrotask(() => {
|
|
34
|
+
let e = document.getElementById(I());
|
|
35
|
+
e instanceof HTMLElement && e.isConnected && e.focus({ preventScroll: !0 });
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return u(() => {
|
|
39
|
+
if (!O()) return;
|
|
40
|
+
let e = (e) => {
|
|
41
|
+
e.key === "Escape" && S.layers.isTop(C) && L();
|
|
42
|
+
};
|
|
43
|
+
document.addEventListener("keydown", e, !0), m(() => document.removeEventListener("keydown", e, !0));
|
|
44
|
+
}), o(v, {
|
|
45
|
+
id: C,
|
|
46
|
+
get open() {
|
|
47
|
+
return O();
|
|
48
|
+
},
|
|
49
|
+
onOpenChange: M,
|
|
50
|
+
getAnchorRect: A,
|
|
51
|
+
modal: !1,
|
|
52
|
+
gutter: 2,
|
|
53
|
+
shift: 2,
|
|
54
|
+
get placement() {
|
|
55
|
+
return S.state().direction === "rtl" ? "left-start" : "right-start";
|
|
56
|
+
},
|
|
57
|
+
get children() {
|
|
58
|
+
return [o(y, c({ get as() {
|
|
59
|
+
return w.as ?? "div";
|
|
60
|
+
} }, T, {
|
|
61
|
+
get id() {
|
|
62
|
+
return I();
|
|
63
|
+
},
|
|
64
|
+
get "aria-haspopup"() {
|
|
65
|
+
return D() ? void 0 : "menu";
|
|
66
|
+
},
|
|
67
|
+
get "aria-expanded"() {
|
|
68
|
+
return s(() => !!(w.as === "tr" || D()))() ? void 0 : O();
|
|
69
|
+
},
|
|
70
|
+
onContextMenu: (e) => {
|
|
71
|
+
if (b(T.onContextMenu, e), e.defaultPrevented || D()) return;
|
|
72
|
+
e.preventDefault(), e.stopPropagation();
|
|
73
|
+
let t = e.currentTarget, n = t instanceof Element ? t.getBoundingClientRect() : void 0;
|
|
74
|
+
j(e.clientX || e.clientY || !n ? {
|
|
75
|
+
x: e.clientX,
|
|
76
|
+
y: e.clientY
|
|
77
|
+
} : {
|
|
78
|
+
x: n.x,
|
|
79
|
+
y: n.bottom
|
|
80
|
+
}), M(!0);
|
|
81
|
+
},
|
|
82
|
+
get children() {
|
|
83
|
+
return w.children;
|
|
84
|
+
}
|
|
85
|
+
})), o(l, {
|
|
86
|
+
get when() {
|
|
87
|
+
return s(() => !!D())() ? void 0 : S.portal();
|
|
88
|
+
},
|
|
89
|
+
children: (e) => o(_, {
|
|
90
|
+
get mount() {
|
|
91
|
+
return e();
|
|
92
|
+
},
|
|
93
|
+
get children() {
|
|
94
|
+
return o(g, {
|
|
95
|
+
ref: P,
|
|
96
|
+
get class() {
|
|
97
|
+
return t("sheen-menu", w.menuClass);
|
|
98
|
+
},
|
|
99
|
+
"data-kb-top-layer": "true",
|
|
100
|
+
get "aria-hidden"() {
|
|
101
|
+
return !O() || void 0;
|
|
102
|
+
},
|
|
103
|
+
get inert() {
|
|
104
|
+
return !O();
|
|
105
|
+
},
|
|
106
|
+
get style() {
|
|
107
|
+
return { "z-index": F() };
|
|
108
|
+
},
|
|
109
|
+
onCloseAutoFocus: () => queueMicrotask(() => {
|
|
110
|
+
let e = document.getElementById(I()), t = document.activeElement;
|
|
111
|
+
e instanceof HTMLElement && e.isConnected && (t === document.body || t === null || (N()?.contains(t) ?? !1)) && e.focus({ preventScroll: !0 });
|
|
112
|
+
}),
|
|
113
|
+
onKeyDown: (e) => {
|
|
114
|
+
!e.defaultPrevented && e.key === "Escape" && O() && S.layers.isTop(C) && (e.preventDefault(), M(!1));
|
|
115
|
+
},
|
|
116
|
+
onEscapeKeyDown: (e) => {
|
|
117
|
+
S.layers.isTop(C) ? L() : e.preventDefault();
|
|
118
|
+
},
|
|
119
|
+
get children() {
|
|
120
|
+
return o(i, { get items() {
|
|
121
|
+
return E();
|
|
122
|
+
} });
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
})
|
|
127
|
+
})];
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
//#endregion
|
|
132
|
+
export { x as ContextMenu };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
export interface DescriptionListProps extends JSX.HTMLAttributes<HTMLDListElement> {
|
|
3
|
+
layout?: "stacked" | "columns";
|
|
4
|
+
}
|
|
5
|
+
export type DescriptionTermProps = JSX.HTMLAttributes<HTMLElement>;
|
|
6
|
+
export interface DescriptionDetailsProps extends JSX.HTMLAttributes<HTMLElement> {
|
|
7
|
+
numeric?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function DescriptionList(props: DescriptionListProps): JSX.Element;
|
|
10
|
+
export declare function DescriptionTerm(props: DescriptionTermProps): JSX.Element;
|
|
11
|
+
export declare function DescriptionDetails(props: DescriptionDetailsProps): JSX.Element;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { cn as e } from "../utils/cn.js";
|
|
2
|
+
import { mergeProps as t, spread as n, template as r } from "solid-js/web";
|
|
3
|
+
import { splitProps as i } from "solid-js";
|
|
4
|
+
//#region src/primitives/DescriptionList.tsx
|
|
5
|
+
var a = /*#__PURE__*/ r("<dl>"), o = /*#__PURE__*/ r("<dt>"), s = /*#__PURE__*/ r("<dd>");
|
|
6
|
+
function c(r) {
|
|
7
|
+
let [o, s] = i(r, ["class", "layout"]);
|
|
8
|
+
return (() => {
|
|
9
|
+
var r = a();
|
|
10
|
+
return n(r, t(s, {
|
|
11
|
+
get class() {
|
|
12
|
+
return e("sheen-description-list", o.class);
|
|
13
|
+
},
|
|
14
|
+
get "data-layout"() {
|
|
15
|
+
return o.layout ?? "stacked";
|
|
16
|
+
}
|
|
17
|
+
}), !1, !1), r;
|
|
18
|
+
})();
|
|
19
|
+
}
|
|
20
|
+
function l(r) {
|
|
21
|
+
let [a, s] = i(r, ["class"]);
|
|
22
|
+
return (() => {
|
|
23
|
+
var r = o();
|
|
24
|
+
return n(r, t(s, { get class() {
|
|
25
|
+
return e("sheen-description-term", a.class);
|
|
26
|
+
} }), !1, !1), r;
|
|
27
|
+
})();
|
|
28
|
+
}
|
|
29
|
+
function u(r) {
|
|
30
|
+
let [a, o] = i(r, ["class", "numeric"]);
|
|
31
|
+
return (() => {
|
|
32
|
+
var r = s();
|
|
33
|
+
return n(r, t(o, {
|
|
34
|
+
get class() {
|
|
35
|
+
return e("sheen-description-details", a.class);
|
|
36
|
+
},
|
|
37
|
+
get "data-numeric"() {
|
|
38
|
+
return a.numeric || void 0;
|
|
39
|
+
}
|
|
40
|
+
}), !1, !1), r;
|
|
41
|
+
})();
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { u as DescriptionDetails, c as DescriptionList, l as DescriptionTerm };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { JSX, ParentProps } from "solid-js";
|
|
2
|
+
export interface DialogProps extends ParentProps {
|
|
3
|
+
title: string;
|
|
4
|
+
contentId?: string;
|
|
5
|
+
trigger?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
open?: boolean;
|
|
8
|
+
defaultOpen?: boolean;
|
|
9
|
+
onOpenChange?: (open: boolean) => void;
|
|
10
|
+
dismissible?: boolean;
|
|
11
|
+
closeLabel?: string;
|
|
12
|
+
initialFocus?: () => HTMLElement | undefined;
|
|
13
|
+
returnFocus?: () => HTMLElement | undefined;
|
|
14
|
+
shortcutScope?: string;
|
|
15
|
+
class?: string;
|
|
16
|
+
footer?: JSX.Element;
|
|
17
|
+
}
|
|
18
|
+
export declare function ModalFrame(props: DialogProps & {
|
|
19
|
+
alert?: boolean;
|
|
20
|
+
}): JSX.Element;
|
|
21
|
+
export declare function Dialog(props: DialogProps): JSX.Element;
|