@c9up/nebula 0.1.9 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atoms/Avatar.d.ts +36 -9
- package/dist/atoms/Avatar.js +66 -27
- package/dist/atoms/index.d.ts +1 -1
- package/dist/atoms/index.js +1 -1
- package/dist/configure.d.ts +6 -0
- package/dist/configure.js +4 -22
- package/dist/lib/children.d.ts +30 -0
- package/dist/lib/id.d.ts +13 -29
- package/dist/lib/id.js +13 -39
- package/dist/lib/motion.d.ts +10 -0
- package/dist/lib/motion.js +10 -0
- package/dist/molecules/Accordion.d.ts +36 -15
- package/dist/molecules/Accordion.js +68 -45
- package/dist/molecules/Breadcrumb.d.ts +29 -11
- package/dist/molecules/Breadcrumb.js +52 -52
- package/dist/molecules/Collapsible.d.ts +18 -17
- package/dist/molecules/Collapsible.js +42 -34
- package/dist/molecules/Field.d.ts +66 -30
- package/dist/molecules/Field.js +106 -55
- package/dist/molecules/InputGroup.d.ts +39 -21
- package/dist/molecules/InputGroup.js +43 -27
- package/dist/molecules/InputOTP.d.ts +26 -3
- package/dist/molecules/InputOTP.js +109 -76
- package/dist/molecules/Message.js +5 -4
- package/dist/molecules/Pagination.d.ts +36 -11
- package/dist/molecules/Pagination.js +58 -74
- package/dist/molecules/RadioGroup.d.ts +25 -17
- package/dist/molecules/RadioGroup.js +47 -43
- package/dist/molecules/Resizable.d.ts +32 -7
- package/dist/molecules/Resizable.js +76 -49
- package/dist/molecules/Tabs.d.ts +49 -11
- package/dist/molecules/Tabs.js +107 -51
- package/dist/molecules/ToggleGroup.d.ts +16 -10
- package/dist/molecules/ToggleGroup.js +37 -21
- package/dist/molecules/index.d.ts +11 -11
- package/dist/molecules/index.js +11 -11
- package/dist/organisms/AlertDialog.d.ts +80 -28
- package/dist/organisms/AlertDialog.js +192 -67
- package/dist/organisms/Carousel.d.ts +25 -3
- package/dist/organisms/Carousel.js +75 -43
- package/dist/organisms/Combobox.d.ts +2 -1
- package/dist/organisms/Combobox.js +46 -16
- package/dist/organisms/Command.d.ts +73 -32
- package/dist/organisms/Command.js +209 -131
- package/dist/organisms/CommandDialog.js +5 -5
- package/dist/organisms/ContextMenu.d.ts +41 -19
- package/dist/organisms/ContextMenu.js +112 -71
- package/dist/organisms/DataTable.js +42 -8
- package/dist/organisms/Dialog.d.ts +97 -31
- package/dist/organisms/Dialog.js +193 -68
- package/dist/organisms/Drawer.d.ts +33 -10
- package/dist/organisms/Drawer.js +130 -52
- package/dist/organisms/DropdownMenu.d.ts +58 -11
- package/dist/organisms/DropdownMenu.js +137 -50
- package/dist/organisms/Form.js +9 -11
- package/dist/organisms/HoverCard.d.ts +39 -19
- package/dist/organisms/HoverCard.js +116 -40
- package/dist/organisms/Menubar.d.ts +55 -19
- package/dist/organisms/Menubar.js +166 -82
- package/dist/organisms/NavigationMenu.d.ts +77 -31
- package/dist/organisms/NavigationMenu.js +169 -98
- package/dist/organisms/Popover.d.ts +72 -12
- package/dist/organisms/Popover.js +132 -25
- package/dist/organisms/Questionnaire.js +5 -5
- package/dist/organisms/Select.d.ts +99 -18
- package/dist/organisms/Select.js +253 -111
- package/dist/organisms/Sheet.d.ts +57 -13
- package/dist/organisms/Sheet.js +141 -54
- package/dist/organisms/Sidebar.d.ts +146 -56
- package/dist/organisms/Sidebar.js +236 -128
- package/dist/organisms/Tooltip.d.ts +88 -14
- package/dist/organisms/Tooltip.js +210 -47
- package/dist/organisms/index.d.ts +15 -15
- package/dist/organisms/index.js +15 -15
- package/dist/primitives/floating.js +25 -0
- package/dist/primitives/floatingSurface.d.ts +11 -0
- package/dist/primitives/floatingSurface.js +8 -0
- package/dist/primitives/menu.d.ts +45 -1
- package/dist/primitives/menu.js +45 -14
- package/dist/primitives/menuParts.d.ts +113 -0
- package/dist/primitives/menuParts.js +207 -0
- package/dist/stubs.d.ts +13 -0
- package/dist/stubs.js +14 -0
- package/nebula.css +1 -1
- package/package.json +4 -3
- package/registry.json +18 -6
- package/src/atoms/Avatar.ts +141 -37
- package/src/atoms/index.ts +13 -1
- package/src/configure.ts +10 -23
- package/src/lib/children.ts +31 -0
- package/src/lib/id.ts +11 -39
- package/src/lib/motion.ts +12 -0
- package/src/molecules/Accordion.ts +120 -60
- package/src/molecules/Breadcrumb.ts +77 -76
- package/src/molecules/Collapsible.ts +77 -41
- package/src/molecules/Field.ts +187 -72
- package/src/molecules/InputGroup.ts +88 -35
- package/src/molecules/InputOTP.ts +150 -86
- package/src/molecules/Message.ts +6 -4
- package/src/molecules/Pagination.ts +96 -101
- package/src/molecules/RadioGroup.ts +70 -59
- package/src/molecules/Resizable.ts +138 -75
- package/src/molecules/Tabs.ts +187 -74
- package/src/molecules/ToggleGroup.ts +77 -38
- package/src/molecules/index.ts +85 -8
- package/src/organisms/AlertDialog.ts +319 -82
- package/src/organisms/Carousel.ts +129 -52
- package/src/organisms/Combobox.ts +64 -19
- package/src/organisms/Command.ts +342 -159
- package/src/organisms/CommandDialog.ts +6 -6
- package/src/organisms/ContextMenu.ts +185 -83
- package/src/organisms/DataTable.ts +56 -10
- package/src/organisms/Dialog.ts +312 -102
- package/src/organisms/Drawer.ts +219 -71
- package/src/organisms/DropdownMenu.ts +219 -61
- package/src/organisms/Form.ts +48 -34
- package/src/organisms/HoverCard.ts +187 -53
- package/src/organisms/Menubar.ts +247 -87
- package/src/organisms/NavigationMenu.ts +306 -128
- package/src/organisms/Popover.ts +215 -39
- package/src/organisms/Questionnaire.ts +9 -6
- package/src/organisms/Select.ts +397 -130
- package/src/organisms/Sheet.ts +252 -83
- package/src/organisms/Sidebar.ts +438 -185
- package/src/organisms/Tooltip.ts +315 -65
- package/src/organisms/index.ts +284 -14
- package/src/primitives/floating.ts +33 -0
- package/src/primitives/floatingSurface.ts +19 -0
- package/src/primitives/menu.ts +79 -18
- package/src/primitives/menuParts.ts +371 -0
- package/src/stubs.ts +16 -0
- package/stubs/config/nebula.stub +21 -0
package/dist/molecules/Tabs.d.ts
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Tabs — one panel visible at a time.
|
|
3
3
|
*
|
|
4
|
+
* Tabs({ defaultValue: "account", children: () => html`
|
|
5
|
+
* ${TabsList({ children: html`
|
|
6
|
+
* ${TabsTrigger({ value: "account", children: "Account" })}
|
|
7
|
+
* ${TabsTrigger({ value: "password", children: "Password" })}
|
|
8
|
+
* ` })}
|
|
9
|
+
* ${TabsContent({ value: "account", children: "…" })}
|
|
10
|
+
* ${TabsContent({ value: "password", children: "…" })}
|
|
11
|
+
* ` })
|
|
12
|
+
*
|
|
4
13
|
* The WAI-ARIA tabs pattern in full: the tab list is a single tab stop with
|
|
5
14
|
* arrows moving between tabs, each tab points at its panel with
|
|
6
|
-
* `aria-controls`, and each panel points back with `aria-labelledby`.
|
|
15
|
+
* `aria-controls`, and each panel points back with `aria-labelledby`. A
|
|
16
|
+
* trigger and its panel find each other through the shared `value` — the ids
|
|
17
|
+
* are minted once per value by the context, so neither has to know the other
|
|
18
|
+
* exists.
|
|
7
19
|
*
|
|
8
20
|
* Activation is automatic — moving to a tab selects it — which is the right
|
|
9
21
|
* default when panels are already rendered and switching costs nothing. The
|
|
@@ -15,23 +27,49 @@
|
|
|
15
27
|
* the accessibility tree, which is the behaviour `display: none` would give
|
|
16
28
|
* without also removing them from the DOM.
|
|
17
29
|
*/
|
|
18
|
-
import type {
|
|
30
|
+
import type { Parts, Slot } from "../lib/children.js";
|
|
31
|
+
import { type VariantProps } from "../lib/cva.js";
|
|
19
32
|
import { type Reactive } from "../lib/props.js";
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
33
|
+
export declare const tabsListVariants: (props?: (import("../index.js").VariantSelection<{
|
|
34
|
+
variant: {
|
|
35
|
+
default: string;
|
|
36
|
+
line: string;
|
|
37
|
+
};
|
|
38
|
+
}> & import("../index.js").ClassOverrides) | undefined) => string;
|
|
39
|
+
export type TabsListVariants = VariantProps<typeof tabsListVariants>;
|
|
26
40
|
export interface TabsProps {
|
|
27
|
-
|
|
28
|
-
/** Selected at first render. Defaults to the first enabled tab. */
|
|
41
|
+
/** Selected at first render. Defaults to the first trigger built. */
|
|
29
42
|
defaultValue?: string;
|
|
43
|
+
value?: Reactive<string | undefined>;
|
|
30
44
|
orientation?: "horizontal" | "vertical";
|
|
31
45
|
/** Selecting follows focus. Default `true`. */
|
|
32
46
|
activateOnFocus?: boolean;
|
|
33
47
|
onValueChange?: (value: string) => void;
|
|
34
48
|
class?: Reactive<string>;
|
|
35
|
-
|
|
49
|
+
children?: Parts;
|
|
36
50
|
}
|
|
37
51
|
export declare const Tabs: (props?: TabsProps | undefined) => import("@c9up/aurora").TemplateResult;
|
|
52
|
+
export interface TabsListProps extends TabsListVariants {
|
|
53
|
+
children?: Slot;
|
|
54
|
+
class?: Reactive<string>;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The row of triggers, and the single tab stop that holds them.
|
|
58
|
+
*
|
|
59
|
+
* `rovingFocus` is wired here rather than in `Tabs`: it needs the element the
|
|
60
|
+
* tabs are actually in, and only this part has one.
|
|
61
|
+
*/
|
|
62
|
+
export declare const TabsList: (props?: TabsListProps | undefined) => import("@c9up/aurora").TemplateResult;
|
|
63
|
+
export interface TabsTriggerProps {
|
|
64
|
+
value: string;
|
|
65
|
+
children?: Slot;
|
|
66
|
+
disabled?: boolean;
|
|
67
|
+
class?: Reactive<string>;
|
|
68
|
+
}
|
|
69
|
+
export declare const TabsTrigger: (props?: TabsTriggerProps | undefined) => import("@c9up/aurora").TemplateResult;
|
|
70
|
+
export interface TabsContentProps {
|
|
71
|
+
value: string;
|
|
72
|
+
children?: Slot;
|
|
73
|
+
class?: Reactive<string>;
|
|
74
|
+
}
|
|
75
|
+
export declare const TabsContent: (props?: TabsContentProps | undefined) => import("@c9up/aurora").TemplateResult;
|
package/dist/molecules/Tabs.js
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Tabs — one panel visible at a time.
|
|
3
3
|
*
|
|
4
|
+
* Tabs({ defaultValue: "account", children: () => html`
|
|
5
|
+
* ${TabsList({ children: html`
|
|
6
|
+
* ${TabsTrigger({ value: "account", children: "Account" })}
|
|
7
|
+
* ${TabsTrigger({ value: "password", children: "Password" })}
|
|
8
|
+
* ` })}
|
|
9
|
+
* ${TabsContent({ value: "account", children: "…" })}
|
|
10
|
+
* ${TabsContent({ value: "password", children: "…" })}
|
|
11
|
+
* ` })
|
|
12
|
+
*
|
|
4
13
|
* The WAI-ARIA tabs pattern in full: the tab list is a single tab stop with
|
|
5
14
|
* arrows moving between tabs, each tab points at its panel with
|
|
6
|
-
* `aria-controls`, and each panel points back with `aria-labelledby`.
|
|
15
|
+
* `aria-controls`, and each panel points back with `aria-labelledby`. A
|
|
16
|
+
* trigger and its panel find each other through the shared `value` — the ids
|
|
17
|
+
* are minted once per value by the context, so neither has to know the other
|
|
18
|
+
* exists.
|
|
7
19
|
*
|
|
8
20
|
* Activation is automatic — moving to a tab selects it — which is the right
|
|
9
21
|
* default when panels are already rendered and switching costs nothing. The
|
|
@@ -15,95 +27,139 @@
|
|
|
15
27
|
* the accessibility tree, which is the behaviour `display: none` would give
|
|
16
28
|
* without also removing them from the DOM.
|
|
17
29
|
*/
|
|
18
|
-
import { component, html, onMount, onUnmount, signal } from "@c9up/aurora";
|
|
30
|
+
import { component, createContext, html, inject, onMount, onUnmount, provide, signal, } from "@c9up/aurora";
|
|
19
31
|
import { slot } from "../lib/children.js";
|
|
20
32
|
import { cn } from "../lib/cn.js";
|
|
33
|
+
import { cva } from "../lib/cva.js";
|
|
21
34
|
import { uid } from "../lib/id.js";
|
|
22
35
|
import { read } from "../lib/props.js";
|
|
23
36
|
import { rovingFocus } from "../primitives/rovingFocus.js";
|
|
37
|
+
export const tabsListVariants = cva("group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none", {
|
|
38
|
+
variants: {
|
|
39
|
+
variant: {
|
|
40
|
+
default: "bg-muted",
|
|
41
|
+
line: "gap-1 bg-transparent",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
defaultVariants: { variant: "default" },
|
|
45
|
+
});
|
|
46
|
+
const triggerClasses = "relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4";
|
|
47
|
+
/** The filled look: the active tab gets a surface of its own. */
|
|
48
|
+
const triggerSurfaceClasses = "data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent";
|
|
49
|
+
/** The underlined look: a rule along the active tab's edge, faded in. */
|
|
50
|
+
const triggerUnderlineClasses = "after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100";
|
|
51
|
+
const TabsContext = createContext("Tabs");
|
|
24
52
|
export const Tabs = component((props) => {
|
|
25
53
|
const orientation = props.orientation ?? "horizontal";
|
|
26
|
-
const
|
|
27
|
-
const active = signal(props.defaultValue ?? first?.value ?? "");
|
|
28
|
-
const listId = uid("tabs-list");
|
|
29
|
-
// Ids are minted once per tab, up front, because a tab and its panel each
|
|
30
|
-
// need to name the other — one of them has to know both before rendering.
|
|
54
|
+
const internal = signal(props.defaultValue ?? "");
|
|
31
55
|
const ids = new Map();
|
|
32
|
-
|
|
33
|
-
|
|
56
|
+
function active() {
|
|
57
|
+
const external = read(props.value);
|
|
58
|
+
return external === undefined ? internal() : external;
|
|
34
59
|
}
|
|
35
60
|
function select(value) {
|
|
36
61
|
if (active() === value)
|
|
37
62
|
return;
|
|
38
|
-
|
|
63
|
+
internal(value);
|
|
39
64
|
props.onValueChange?.(value);
|
|
40
65
|
}
|
|
66
|
+
provide(TabsContext, {
|
|
67
|
+
orientation,
|
|
68
|
+
activateOnFocus: props.activateOnFocus !== false,
|
|
69
|
+
active,
|
|
70
|
+
select,
|
|
71
|
+
ids(value) {
|
|
72
|
+
let found = ids.get(value);
|
|
73
|
+
if (found === undefined) {
|
|
74
|
+
found = { tab: uid("tab"), panel: uid("tab-panel") };
|
|
75
|
+
ids.set(value, found);
|
|
76
|
+
}
|
|
77
|
+
return found;
|
|
78
|
+
},
|
|
79
|
+
registerTrigger(value, disabled) {
|
|
80
|
+
if (disabled)
|
|
81
|
+
return;
|
|
82
|
+
if (props.defaultValue !== undefined || internal() !== "")
|
|
83
|
+
return;
|
|
84
|
+
internal(value);
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
return html `<div
|
|
88
|
+
data-slot="tabs"
|
|
89
|
+
data-orientation="${orientation}"
|
|
90
|
+
class="${() => cn("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col", read(props.class))}"
|
|
91
|
+
>${props.children?.()}</div>`;
|
|
92
|
+
});
|
|
93
|
+
/**
|
|
94
|
+
* The row of triggers, and the single tab stop that holds them.
|
|
95
|
+
*
|
|
96
|
+
* `rovingFocus` is wired here rather than in `Tabs`: it needs the element the
|
|
97
|
+
* tabs are actually in, and only this part has one.
|
|
98
|
+
*/
|
|
99
|
+
export const TabsList = component((props) => {
|
|
100
|
+
const tabs = inject(TabsContext);
|
|
101
|
+
const listId = uid("tabs-list");
|
|
41
102
|
let group;
|
|
42
103
|
onMount(() => {
|
|
43
104
|
group = rovingFocus({
|
|
44
105
|
container: () => document.getElementById(listId),
|
|
45
106
|
itemSelector: "[role='tab']",
|
|
46
|
-
orientation,
|
|
107
|
+
orientation: tabs.orientation,
|
|
47
108
|
onFocusChange: (item) => {
|
|
48
|
-
if (
|
|
109
|
+
if (!tabs.activateOnFocus)
|
|
49
110
|
return;
|
|
50
111
|
const value = item.getAttribute("data-value");
|
|
51
112
|
if (value !== null)
|
|
52
|
-
select(value);
|
|
113
|
+
tabs.select(value);
|
|
53
114
|
},
|
|
54
115
|
onSelect: (item) => {
|
|
55
116
|
const value = item.getAttribute("data-value");
|
|
56
117
|
if (value !== null)
|
|
57
|
-
select(value);
|
|
118
|
+
tabs.select(value);
|
|
58
119
|
},
|
|
59
120
|
});
|
|
60
121
|
group.sync();
|
|
61
122
|
});
|
|
62
123
|
onUnmount(() => group?.destroy());
|
|
63
124
|
return html `<div
|
|
64
|
-
data-slot="tabs"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
id="${listId}"
|
|
72
|
-
aria-orientation="${orientation}"
|
|
73
|
-
class="${() => cn("bg-muted text-muted-foreground inline-flex w-fit items-center justify-center rounded-lg p-[3px]", orientation === "vertical" ? "flex-col" : "h-9", read(props.listClass))}"
|
|
74
|
-
>
|
|
75
|
-
${props.items.map((item) => renderTab(item, ids, active, select))}
|
|
76
|
-
</div>
|
|
77
|
-
${props.items.map((item) => renderPanel(item, ids, active))}
|
|
78
|
-
</div>`;
|
|
125
|
+
data-slot="tabs-list"
|
|
126
|
+
id="${listId}"
|
|
127
|
+
role="tablist"
|
|
128
|
+
data-variant="${props.variant ?? "default"}"
|
|
129
|
+
aria-orientation="${tabs.orientation}"
|
|
130
|
+
class="${() => cn(tabsListVariants({ variant: props.variant }), read(props.class))}"
|
|
131
|
+
>${slot(props.children)}</div>`;
|
|
79
132
|
});
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
-
const
|
|
133
|
+
export const TabsTrigger = component((props) => {
|
|
134
|
+
const tabs = inject(TabsContext);
|
|
135
|
+
const ids = tabs.ids(props.value);
|
|
136
|
+
tabs.registerTrigger(props.value, props.disabled === true);
|
|
137
|
+
const selected = () => tabs.active() === props.value;
|
|
83
138
|
return html `<button
|
|
84
139
|
type="button"
|
|
85
|
-
role="tab"
|
|
86
140
|
data-slot="tabs-trigger"
|
|
87
|
-
|
|
141
|
+
id="${ids.tab}"
|
|
142
|
+
role="tab"
|
|
143
|
+
data-value="${props.value}"
|
|
88
144
|
data-state="${() => (selected() ? "active" : "inactive")}"
|
|
89
|
-
data-disabled="${
|
|
90
|
-
id="${id?.tab}"
|
|
145
|
+
data-disabled="${props.disabled === true ? "" : undefined}"
|
|
91
146
|
aria-selected="${() => (selected() ? "true" : "false")}"
|
|
92
|
-
aria-controls="${
|
|
93
|
-
?disabled="${
|
|
94
|
-
class="
|
|
95
|
-
@click="${() => select(
|
|
96
|
-
>${
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const
|
|
147
|
+
aria-controls="${ids.panel}"
|
|
148
|
+
?disabled="${props.disabled === true}"
|
|
149
|
+
class="${() => cn(triggerClasses, triggerSurfaceClasses, triggerUnderlineClasses, read(props.class))}"
|
|
150
|
+
@click="${() => tabs.select(props.value)}"
|
|
151
|
+
>${slot(props.children)}</button>`;
|
|
152
|
+
});
|
|
153
|
+
export const TabsContent = component((props) => {
|
|
154
|
+
const tabs = inject(TabsContext);
|
|
155
|
+
const ids = tabs.ids(props.value);
|
|
100
156
|
return html `<div
|
|
101
|
-
role="tabpanel"
|
|
102
157
|
data-slot="tabs-content"
|
|
103
|
-
id="${
|
|
104
|
-
|
|
158
|
+
id="${ids.panel}"
|
|
159
|
+
role="tabpanel"
|
|
160
|
+
aria-labelledby="${ids.tab}"
|
|
105
161
|
tabindex="0"
|
|
106
|
-
?hidden="${() => active() !==
|
|
107
|
-
class="flex-1 outline-none"
|
|
108
|
-
>${slot(
|
|
109
|
-
}
|
|
162
|
+
?hidden="${() => tabs.active() !== props.value}"
|
|
163
|
+
class="${() => cn("flex-1 outline-none", read(props.class))}"
|
|
164
|
+
>${slot(props.children)}</div>`;
|
|
165
|
+
});
|
|
@@ -15,23 +15,29 @@
|
|
|
15
15
|
* to weld the row into one shape.
|
|
16
16
|
*/
|
|
17
17
|
import { type ToggleVariants } from "../atoms/Toggle.js";
|
|
18
|
-
import type {
|
|
18
|
+
import type { Parts, Slot } from "../lib/children.js";
|
|
19
19
|
import { type Reactive } from "../lib/props.js";
|
|
20
|
-
export interface ToggleGroupItem {
|
|
21
|
-
value: string;
|
|
22
|
-
label: Child;
|
|
23
|
-
/** Required when the label is an icon alone. */
|
|
24
|
-
ariaLabel?: string;
|
|
25
|
-
disabled?: boolean;
|
|
26
|
-
}
|
|
27
20
|
export interface ToggleGroupProps {
|
|
28
|
-
items: readonly ToggleGroupItem[];
|
|
29
21
|
type?: "single" | "multiple";
|
|
30
22
|
defaultValue?: string | readonly string[];
|
|
31
23
|
variant?: Reactive<ToggleVariants["variant"]>;
|
|
32
24
|
size?: Reactive<ToggleVariants["size"]>;
|
|
25
|
+
/** `"0"` joins the items into one bar; `"default"` spaces them. */
|
|
26
|
+
spacing?: "default" | "0";
|
|
33
27
|
disabled?: Reactive<boolean>;
|
|
34
|
-
class?: Reactive<string>;
|
|
35
28
|
onValueChange?: (value: readonly string[]) => void;
|
|
29
|
+
class?: Reactive<string>;
|
|
30
|
+
children?: Parts;
|
|
36
31
|
}
|
|
37
32
|
export declare const ToggleGroup: (props?: ToggleGroupProps | undefined) => import("@c9up/aurora").TemplateResult;
|
|
33
|
+
export interface ToggleGroupItemProps {
|
|
34
|
+
value: string;
|
|
35
|
+
children?: Slot;
|
|
36
|
+
/** Required when the label is an icon alone. */
|
|
37
|
+
ariaLabel?: string;
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
variant?: ToggleVariants["variant"];
|
|
40
|
+
size?: ToggleVariants["size"];
|
|
41
|
+
class?: Reactive<string>;
|
|
42
|
+
}
|
|
43
|
+
export declare const ToggleGroupItem: (props?: ToggleGroupItemProps | undefined) => import("@c9up/aurora").TemplateResult;
|
|
@@ -14,12 +14,15 @@
|
|
|
14
14
|
* standalone one cannot drift apart. Only the corner rounding is overridden,
|
|
15
15
|
* to weld the row into one shape.
|
|
16
16
|
*/
|
|
17
|
-
import { component, html, signal } from "@c9up/aurora";
|
|
17
|
+
import { component, createContext, html, inject, provide, signal, } from "@c9up/aurora";
|
|
18
18
|
import { toggleVariants } from "../atoms/Toggle.js";
|
|
19
|
+
import { slot } from "../lib/children.js";
|
|
19
20
|
import { cn } from "../lib/cn.js";
|
|
20
21
|
import { read, readOr } from "../lib/props.js";
|
|
22
|
+
const ToggleGroupContext = createContext("ToggleGroup");
|
|
21
23
|
export const ToggleGroup = component((props) => {
|
|
22
24
|
const type = props.type ?? "single";
|
|
25
|
+
const spacing = props.spacing ?? "0";
|
|
23
26
|
const selected = signal(props.defaultValue === undefined
|
|
24
27
|
? []
|
|
25
28
|
: typeof props.defaultValue === "string"
|
|
@@ -37,32 +40,45 @@ export const ToggleGroup = component((props) => {
|
|
|
37
40
|
selected(next);
|
|
38
41
|
props.onValueChange?.(next);
|
|
39
42
|
}
|
|
43
|
+
provide(ToggleGroupContext, {
|
|
44
|
+
type,
|
|
45
|
+
variant: read(props.variant),
|
|
46
|
+
size: read(props.size),
|
|
47
|
+
spacing,
|
|
48
|
+
disabled: () => readOr(props.disabled, false),
|
|
49
|
+
isOn: (value) => selected().includes(value),
|
|
50
|
+
toggle,
|
|
51
|
+
});
|
|
40
52
|
return html `<div
|
|
41
53
|
data-slot="toggle-group"
|
|
42
54
|
role="${type === "single" ? "radiogroup" : "group"}"
|
|
43
|
-
class="${() => cn("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs", read(props.class))}"
|
|
44
55
|
data-variant="${() => readOr(props.variant, "default")}"
|
|
45
|
-
|
|
46
|
-
${
|
|
47
|
-
|
|
56
|
+
data-size="${() => readOr(props.size, "default")}"
|
|
57
|
+
data-spacing="${spacing}"
|
|
58
|
+
class="${() => cn("group/toggle-group flex w-fit items-center rounded-md data-[spacing=default]:gap-1 data-[spacing=default]:data-[variant=outline]:shadow-xs", read(props.class))}"
|
|
59
|
+
>${props.children?.()}</div>`;
|
|
48
60
|
});
|
|
49
|
-
|
|
50
|
-
const
|
|
61
|
+
export const ToggleGroupItem = component((props) => {
|
|
62
|
+
const group = inject(ToggleGroupContext);
|
|
63
|
+
const on = () => group.isOn(props.value);
|
|
64
|
+
const single = group.type === "single";
|
|
51
65
|
return html `<button
|
|
52
66
|
type="button"
|
|
53
67
|
data-slot="toggle-group-item"
|
|
54
68
|
data-state="${() => (on() ? "on" : "off")}"
|
|
55
|
-
data-value="${
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
+
data-value="${props.value}"
|
|
70
|
+
data-variant="${group.variant ?? props.variant ?? "default"}"
|
|
71
|
+
data-size="${group.size ?? props.size ?? "default"}"
|
|
72
|
+
data-spacing="${group.spacing}"
|
|
73
|
+
role="${single ? "radio" : undefined}"
|
|
74
|
+
aria-checked="${() => (single ? (on() ? "true" : "false") : undefined)}"
|
|
75
|
+
aria-pressed="${() => (single ? undefined : on() ? "true" : "false")}"
|
|
76
|
+
aria-label="${props.ariaLabel}"
|
|
77
|
+
?disabled="${() => props.disabled === true || group.disabled()}"
|
|
78
|
+
class="${() => cn(toggleVariants({
|
|
79
|
+
variant: group.variant ?? props.variant,
|
|
80
|
+
size: group.size ?? props.size,
|
|
81
|
+
}), "w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10", "data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l", "aria-checked:bg-accent aria-checked:text-accent-foreground", read(props.class))}"
|
|
82
|
+
@click="${() => group.toggle(props.value)}"
|
|
83
|
+
>${slot(props.children)}</button>`;
|
|
84
|
+
});
|
|
@@ -14,25 +14,25 @@
|
|
|
14
14
|
* clarity. The rendered markup is unchanged, so shadcn's CSS and its examples
|
|
15
15
|
* still read across.
|
|
16
16
|
*/
|
|
17
|
-
export { Accordion, type AccordionItem, type AccordionProps, } from "./Accordion.js";
|
|
17
|
+
export { Accordion, AccordionContent, type AccordionContentProps, AccordionItem, type AccordionItemProps, type AccordionProps, AccordionTrigger, type AccordionTriggerProps, } from "./Accordion.js";
|
|
18
18
|
export { Alert, AlertDescription, type AlertProps, AlertTitle, type AlertVariants, alertVariants, } from "./Alert.js";
|
|
19
19
|
export { Attachment, type AttachmentProps, formatBytes, } from "./Attachment.js";
|
|
20
|
-
export { Breadcrumb, type
|
|
20
|
+
export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, type BreadcrumbLinkProps, BreadcrumbList, BreadcrumbPage, type BreadcrumbProps, BreadcrumbSeparator, } from "./Breadcrumb.js";
|
|
21
21
|
export { Bubble, type BubbleProps, type BubbleReaction, type BubbleVariants, bubbleVariants, } from "./Bubble.js";
|
|
22
22
|
export { ButtonGroup, type ButtonGroupProps, ButtonGroupSeparator, ButtonGroupText, } from "./ButtonGroup.js";
|
|
23
23
|
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, CardTitle, } from "./Card.js";
|
|
24
|
-
export { Collapsible, type CollapsibleProps } from "./Collapsible.js";
|
|
24
|
+
export { Collapsible, CollapsibleContent, type CollapsibleContentProps, type CollapsibleProps, CollapsibleTrigger, type CollapsibleTriggerProps, } from "./Collapsible.js";
|
|
25
25
|
export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, type EmptyProps, EmptyTitle, } from "./Empty.js";
|
|
26
|
-
export { Field, FieldGroup, type FieldIds, type FieldProps, FieldSeparator, fieldIds, } from "./Field.js";
|
|
27
|
-
export { InputGroup, InputGroupAddon, InputGroupInput, type InputGroupProps, inputGroupControlClasses, } from "./InputGroup.js";
|
|
28
|
-
export { InputOTP, type InputOTPProps } from "./InputOTP.js";
|
|
26
|
+
export { Field, FieldContent, FieldDescription, FieldError, type FieldErrorProps, FieldGroup, type FieldIds, FieldLabel, FieldLegend, type FieldLegendProps, type FieldProps, type FieldSectionProps, FieldSeparator, type FieldSeparatorProps, FieldSet, FieldTitle, fieldIds, } from "./Field.js";
|
|
27
|
+
export { InputGroup, InputGroupAddon, type InputGroupAddonProps, InputGroupButton, type InputGroupButtonProps, InputGroupInput, type InputGroupProps, InputGroupText, InputGroupTextarea, type InputGroupTextProps, inputGroupControlClasses, } from "./InputGroup.js";
|
|
28
|
+
export { InputOTP, InputOTPGroup, type InputOTPGroupProps, type InputOTPProps, InputOTPSeparator, type InputOTPSeparatorProps, InputOTPSlot, type InputOTPSlotProps, } from "./InputOTP.js";
|
|
29
29
|
export { Item, ItemActions, ItemContent, ItemDescription, ItemGroup, ItemMedia, type ItemProps, ItemSeparator, ItemTitle, type ItemVariants, itemVariants, } from "./Item.js";
|
|
30
30
|
export { Message, type MessageProps } from "./Message.js";
|
|
31
|
-
export { type PageSlot, Pagination, type PaginationProps, pageWindow, } from "./Pagination.js";
|
|
31
|
+
export { type PageSlot, Pagination, PaginationContent, PaginationEllipsis, type PaginationEllipsisProps, PaginationItem, PaginationLink, type PaginationLinkProps, PaginationNext, PaginationPrevious, type PaginationProps, type PaginationStepProps, pageWindow, } from "./Pagination.js";
|
|
32
32
|
export { Picture, type PictureProps } from "./Picture.js";
|
|
33
|
-
export { RadioGroup, type
|
|
34
|
-
export {
|
|
33
|
+
export { RadioGroup, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps, } from "./RadioGroup.js";
|
|
34
|
+
export { ResizableHandle, type ResizableHandleProps, ResizablePanel, ResizablePanelGroup, type ResizablePanelGroupProps, type ResizablePanelProps, } from "./Resizable.js";
|
|
35
35
|
export { Table, TableBody, TableCaption, TableCell, type TableCellProps, TableFooter, TableHead, TableHeader, type TableProps, TableRow, type TableRowProps, } from "./Table.js";
|
|
36
|
-
export { type
|
|
37
|
-
export { ToggleGroup, type
|
|
36
|
+
export { Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsListVariants, type TabsProps, TabsTrigger, type TabsTriggerProps, tabsListVariants, } from "./Tabs.js";
|
|
37
|
+
export { ToggleGroup, ToggleGroupItem, type ToggleGroupItemProps, type ToggleGroupProps, } from "./ToggleGroup.js";
|
|
38
38
|
export { Blockquote, H1, H2, H3, H4, InlineCode, Large, Lead, List, Muted, P, Small, type TypographyProps, } from "./Typography.js";
|
package/dist/molecules/index.js
CHANGED
|
@@ -14,25 +14,25 @@
|
|
|
14
14
|
* clarity. The rendered markup is unchanged, so shadcn's CSS and its examples
|
|
15
15
|
* still read across.
|
|
16
16
|
*/
|
|
17
|
-
export { Accordion, } from "./Accordion.js";
|
|
17
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, } from "./Accordion.js";
|
|
18
18
|
export { Alert, AlertDescription, AlertTitle, alertVariants, } from "./Alert.js";
|
|
19
19
|
export { Attachment, formatBytes, } from "./Attachment.js";
|
|
20
|
-
export { Breadcrumb } from "./Breadcrumb.js";
|
|
20
|
+
export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, } from "./Breadcrumb.js";
|
|
21
21
|
export { Bubble, bubbleVariants, } from "./Bubble.js";
|
|
22
22
|
export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, } from "./ButtonGroup.js";
|
|
23
23
|
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from "./Card.js";
|
|
24
|
-
export { Collapsible } from "./Collapsible.js";
|
|
24
|
+
export { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "./Collapsible.js";
|
|
25
25
|
export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, } from "./Empty.js";
|
|
26
|
-
export { Field, FieldGroup, FieldSeparator, fieldIds, } from "./Field.js";
|
|
27
|
-
export { InputGroup, InputGroupAddon, InputGroupInput, inputGroupControlClasses, } from "./InputGroup.js";
|
|
28
|
-
export { InputOTP } from "./InputOTP.js";
|
|
26
|
+
export { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, fieldIds, } from "./Field.js";
|
|
27
|
+
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, inputGroupControlClasses, } from "./InputGroup.js";
|
|
28
|
+
export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, } from "./InputOTP.js";
|
|
29
29
|
export { Item, ItemActions, ItemContent, ItemDescription, ItemGroup, ItemMedia, ItemSeparator, ItemTitle, itemVariants, } from "./Item.js";
|
|
30
30
|
export { Message } from "./Message.js";
|
|
31
|
-
export { Pagination, pageWindow, } from "./Pagination.js";
|
|
31
|
+
export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, pageWindow, } from "./Pagination.js";
|
|
32
32
|
export { Picture } from "./Picture.js";
|
|
33
|
-
export { RadioGroup, } from "./RadioGroup.js";
|
|
34
|
-
export {
|
|
33
|
+
export { RadioGroup, RadioGroupItem, } from "./RadioGroup.js";
|
|
34
|
+
export { ResizableHandle, ResizablePanel, ResizablePanelGroup, } from "./Resizable.js";
|
|
35
35
|
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, } from "./Table.js";
|
|
36
|
-
export { Tabs } from "./Tabs.js";
|
|
37
|
-
export { ToggleGroup, } from "./ToggleGroup.js";
|
|
36
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger, tabsListVariants, } from "./Tabs.js";
|
|
37
|
+
export { ToggleGroup, ToggleGroupItem, } from "./ToggleGroup.js";
|
|
38
38
|
export { Blockquote, H1, H2, H3, H4, InlineCode, Large, Lead, List, Muted, P, Small, } from "./Typography.js";
|
|
@@ -1,40 +1,92 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* AlertDialog — a modal that interrupts to ask
|
|
2
|
+
* AlertDialog — a modal that interrupts to ask a question.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* AlertDialog({ children: () => html`
|
|
5
|
+
* ${AlertDialogTrigger({ children: "Delete" })}
|
|
6
|
+
* ${AlertDialogContent({ children: () => html`
|
|
7
|
+
* ${AlertDialogHeader({ children: html`
|
|
8
|
+
* ${AlertDialogTitle({ children: "Delete this?" })}
|
|
9
|
+
* ${AlertDialogDescription({ children: "It cannot be undone." })}
|
|
10
|
+
* ` })}
|
|
11
|
+
* ${AlertDialogFooter({ children: html`
|
|
12
|
+
* ${AlertDialogCancel({ children: "Cancel" })}
|
|
13
|
+
* ${AlertDialogAction({ children: "Delete", variant: "destructive" })}
|
|
14
|
+
* ` })}
|
|
15
|
+
* ` })}
|
|
16
|
+
* ` })
|
|
7
17
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* -
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
+
* Everything that distinguishes it from a Dialog is about refusing to let the
|
|
19
|
+
* question be dismissed by accident:
|
|
20
|
+
*
|
|
21
|
+
* - `role="alertdialog"`, which tells a screen reader this interrupts.
|
|
22
|
+
* - No outside-click dismissal. A decision has to be made, and clicking past
|
|
23
|
+
* it is not one.
|
|
24
|
+
* - Focus lands on the CANCEL button, not the confirming action. The safe
|
|
25
|
+
* choice is the one a hurried Enter should hit.
|
|
26
|
+
*
|
|
27
|
+
* Escape still closes, and it cancels rather than confirms — it is the
|
|
28
|
+
* keyboard spelling of the same safe way out.
|
|
18
29
|
*/
|
|
19
|
-
import type
|
|
20
|
-
import { type
|
|
30
|
+
import { type TemplateResult } from "@c9up/aurora";
|
|
31
|
+
import { type ButtonVariants } from "../atoms/Button.js";
|
|
32
|
+
import type { Parts, Slot } from "../lib/children.js";
|
|
21
33
|
import { type Reactive } from "../lib/props.js";
|
|
22
34
|
export interface AlertDialogProps {
|
|
23
|
-
trigger?: Slot;
|
|
24
|
-
title: Child;
|
|
25
|
-
description: Child;
|
|
26
|
-
/** Label for the confirming action. Default `"Continue"`. */
|
|
27
|
-
actionLabel?: Child;
|
|
28
|
-
/** Label for the way out. Default `"Cancel"`. */
|
|
29
|
-
cancelLabel?: Child;
|
|
30
|
-
/** Styles the action as destructive. */
|
|
31
|
-
destructive?: boolean;
|
|
32
35
|
open?: Reactive<boolean>;
|
|
33
36
|
defaultOpen?: boolean;
|
|
34
37
|
onOpenChange?: (open: boolean) => void;
|
|
35
38
|
onConfirm?: () => void;
|
|
36
39
|
onCancel?: () => void;
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
children?: Parts;
|
|
41
|
+
}
|
|
42
|
+
export declare const AlertDialog: (props?: AlertDialogProps | undefined) => TemplateResult;
|
|
43
|
+
export interface AlertDialogTriggerProps {
|
|
44
|
+
children?: Slot;
|
|
45
|
+
class?: Reactive<string>;
|
|
46
|
+
}
|
|
47
|
+
export declare const AlertDialogTrigger: (props?: AlertDialogTriggerProps | undefined) => TemplateResult;
|
|
48
|
+
export interface AlertDialogContentProps {
|
|
49
|
+
children?: Parts;
|
|
50
|
+
size?: "default" | "sm";
|
|
51
|
+
class?: Reactive<string>;
|
|
39
52
|
}
|
|
40
|
-
export declare const
|
|
53
|
+
export declare const AlertDialogContent: (props?: AlertDialogContentProps | undefined) => TemplateResult;
|
|
54
|
+
export interface AlertDialogSectionProps {
|
|
55
|
+
children?: Slot;
|
|
56
|
+
class?: Reactive<string>;
|
|
57
|
+
}
|
|
58
|
+
export declare const AlertDialogOverlay: (props?: AlertDialogSectionProps | undefined) => TemplateResult;
|
|
59
|
+
export interface AlertDialogPortalProps {
|
|
60
|
+
children?: Slot;
|
|
61
|
+
container?: () => Element | null;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Mount children outside the component's own DOM position.
|
|
65
|
+
*
|
|
66
|
+
* `AlertDialogContent` does not need it — the dialog portals its whole overlay
|
|
67
|
+
* through `modalSurface`, which also owns the trap and the scroll lock. It is
|
|
68
|
+
* exported because upstream exports it, doing here what its name says rather
|
|
69
|
+
* than standing in as a passthrough.
|
|
70
|
+
*/
|
|
71
|
+
export declare const AlertDialogPortal: (props?: AlertDialogPortalProps | undefined) => TemplateResult;
|
|
72
|
+
export declare const AlertDialogHeader: (props?: AlertDialogSectionProps | undefined) => TemplateResult;
|
|
73
|
+
export declare const AlertDialogFooter: (props?: AlertDialogSectionProps | undefined) => TemplateResult;
|
|
74
|
+
/** An icon block above the title — a warning glyph, a product mark. */
|
|
75
|
+
export declare const AlertDialogMedia: (props?: AlertDialogSectionProps | undefined) => TemplateResult;
|
|
76
|
+
export declare const AlertDialogTitle: (props?: AlertDialogSectionProps | undefined) => TemplateResult;
|
|
77
|
+
export declare const AlertDialogDescription: (props?: AlertDialogSectionProps | undefined) => TemplateResult;
|
|
78
|
+
export interface AlertDialogButtonProps {
|
|
79
|
+
children?: Slot;
|
|
80
|
+
variant?: ButtonVariants["variant"];
|
|
81
|
+
size?: ButtonVariants["size"];
|
|
82
|
+
class?: Reactive<string>;
|
|
83
|
+
}
|
|
84
|
+
/** The confirming action. */
|
|
85
|
+
export declare const AlertDialogAction: (props?: AlertDialogButtonProps | undefined) => TemplateResult;
|
|
86
|
+
/**
|
|
87
|
+
* The way out, and where focus lands.
|
|
88
|
+
*
|
|
89
|
+
* The safe choice is the one a hurried Enter should hit, which is why the
|
|
90
|
+
* surface focuses this rather than the action beside it.
|
|
91
|
+
*/
|
|
92
|
+
export declare const AlertDialogCancel: (props?: AlertDialogButtonProps | undefined) => TemplateResult;
|