@c9up/nebula 0.1.9 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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/lib/children.d.ts +30 -0
- 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/nebula.css +1 -1
- package/package.json +3 -3
- package/registry.json +18 -6
- package/src/atoms/Avatar.ts +141 -37
- package/src/atoms/index.ts +13 -1
- package/src/lib/children.ts +31 -0
- 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/organisms/Sheet.ts
CHANGED
|
@@ -7,15 +7,30 @@
|
|
|
7
7
|
* on the panel's own size, which only `translate-x-full` knows. That is why
|
|
8
8
|
* `slideFrom` produces a transition and not a keyframe animation.
|
|
9
9
|
*
|
|
10
|
+
* Sheet({ children: () => html`
|
|
11
|
+
* ${SheetTrigger({ children: "Filters" })}
|
|
12
|
+
* ${SheetContent({ side: "left", children: () => html`
|
|
13
|
+
* ${SheetHeader({ children: SheetTitle({ children: "Filters" }) })}
|
|
14
|
+
* ${SheetFooter({ children: SheetClose({ children: "Done" }) })}
|
|
15
|
+
* ` })}
|
|
16
|
+
* ` })
|
|
17
|
+
*
|
|
10
18
|
* `inset-y-0` for the side panels and `inset-x-0` for the top and bottom ones
|
|
11
19
|
* is what makes the sheet span its edge; the opposite axis takes the width or
|
|
12
20
|
* height. Getting that pair the wrong way round produces a panel floating in a
|
|
13
21
|
* corner, which is the usual first attempt.
|
|
14
22
|
*/
|
|
15
23
|
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
24
|
+
import {
|
|
25
|
+
component,
|
|
26
|
+
createContext,
|
|
27
|
+
html,
|
|
28
|
+
inject,
|
|
29
|
+
provide,
|
|
30
|
+
type TemplateResult,
|
|
31
|
+
} from "@c9up/aurora";
|
|
32
|
+
import type { Child, Parts, Slot } from "../lib/children.js";
|
|
33
|
+
import { slot } from "../lib/children.js";
|
|
19
34
|
import { cn } from "../lib/cn.js";
|
|
20
35
|
import { XIcon } from "../lib/icons.js";
|
|
21
36
|
import { uid } from "../lib/id.js";
|
|
@@ -26,22 +41,33 @@ import type { Side } from "../primitives/floating.js";
|
|
|
26
41
|
import { modalSurface } from "../primitives/modalSurface.js";
|
|
27
42
|
import { dialogBackdropClasses } from "./Dialog.js";
|
|
28
43
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
const panelBaseClasses =
|
|
45
|
+
"bg-background fixed z-50 flex flex-col gap-4 shadow-lg outline-none transition ease-in-out";
|
|
46
|
+
|
|
47
|
+
const closeButtonClasses =
|
|
48
|
+
"ring-offset-background focus-visible:ring-ring absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:pointer-events-none";
|
|
49
|
+
|
|
50
|
+
interface RegisteredContent {
|
|
51
|
+
readonly body: Child;
|
|
52
|
+
readonly side: Side;
|
|
53
|
+
readonly showCloseButton: boolean;
|
|
54
|
+
readonly class?: Reactive<string>;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
interface SheetApi {
|
|
58
|
+
readonly triggerId: string;
|
|
59
|
+
readonly panelId: string;
|
|
60
|
+
readonly titleId: string;
|
|
61
|
+
readonly descriptionId: string;
|
|
62
|
+
readonly open: () => boolean;
|
|
63
|
+
setOpen(next: boolean): void;
|
|
64
|
+
declareTitle(): void;
|
|
65
|
+
declareDescription(): void;
|
|
66
|
+
register(content: RegisteredContent): void;
|
|
43
67
|
}
|
|
44
68
|
|
|
69
|
+
const SheetContext = createContext<SheetApi>("Sheet");
|
|
70
|
+
|
|
45
71
|
/** Edge placement and the axis the panel is sized on. */
|
|
46
72
|
function panelClassesFor(side: Side): string {
|
|
47
73
|
if (side === "left") {
|
|
@@ -54,12 +80,21 @@ function panelClassesFor(side: Side): string {
|
|
|
54
80
|
return "inset-x-0 bottom-0 h-auto border-t";
|
|
55
81
|
}
|
|
56
82
|
|
|
83
|
+
export interface SheetProps {
|
|
84
|
+
open?: Reactive<boolean>;
|
|
85
|
+
defaultOpen?: boolean;
|
|
86
|
+
onOpenChange?: (open: boolean) => void;
|
|
87
|
+
children?: Parts;
|
|
88
|
+
}
|
|
89
|
+
|
|
57
90
|
export const Sheet = component<SheetProps>((props) => {
|
|
58
|
-
const side = props.side ?? "right";
|
|
59
91
|
const triggerId = uid("sheet-trigger");
|
|
60
92
|
const panelId = uid("sheet-panel");
|
|
61
93
|
const titleId = uid("sheet-title");
|
|
62
94
|
const descriptionId = uid("sheet-description");
|
|
95
|
+
let hasTitle = false;
|
|
96
|
+
let hasDescription = false;
|
|
97
|
+
let content: RegisteredContent | undefined;
|
|
63
98
|
|
|
64
99
|
const state = controllable<boolean>({
|
|
65
100
|
value: props.open,
|
|
@@ -67,78 +102,212 @@ export const Sheet = component<SheetProps>((props) => {
|
|
|
67
102
|
onChange: props.onOpenChange,
|
|
68
103
|
});
|
|
69
104
|
|
|
70
|
-
|
|
105
|
+
provide<SheetApi>(SheetContext, {
|
|
106
|
+
triggerId,
|
|
107
|
+
panelId,
|
|
108
|
+
titleId,
|
|
109
|
+
descriptionId,
|
|
71
110
|
open: () => state.current(),
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
role="dialog"
|
|
83
|
-
aria-modal="true"
|
|
84
|
-
aria-labelledby="${titleId}"
|
|
85
|
-
aria-describedby="${props.description === undefined ? undefined : descriptionId}"
|
|
86
|
-
tabindex="-1"
|
|
87
|
-
class="${cn(
|
|
88
|
-
"bg-background fixed z-50 flex flex-col gap-4 p-6 shadow-lg outline-none",
|
|
89
|
-
panelClassesFor(side),
|
|
90
|
-
slideFrom(side),
|
|
91
|
-
read(props.contentClass),
|
|
92
|
-
)}"
|
|
93
|
-
>
|
|
94
|
-
<div data-slot="sheet-header" class="flex flex-col gap-1.5">
|
|
95
|
-
<h2
|
|
96
|
-
id="${titleId}"
|
|
97
|
-
class="${cn(
|
|
98
|
-
"text-foreground font-semibold",
|
|
99
|
-
props.srOnlyTitle === true ? "sr-only" : "",
|
|
100
|
-
)}"
|
|
101
|
-
>${props.title}</h2>
|
|
102
|
-
${
|
|
103
|
-
props.description === undefined
|
|
104
|
-
? null
|
|
105
|
-
: html`<p id="${descriptionId}" class="text-muted-foreground text-sm">
|
|
106
|
-
${props.description}
|
|
107
|
-
</p>`
|
|
108
|
-
}
|
|
109
|
-
</div>
|
|
110
|
-
<div data-slot="sheet-body" class="flex-1 overflow-y-auto">${slot(props.children)}</div>
|
|
111
|
-
${
|
|
112
|
-
props.footer === undefined
|
|
113
|
-
? null
|
|
114
|
-
: html`<div data-slot="sheet-footer" class="mt-auto flex flex-col gap-2">
|
|
115
|
-
${slot(props.footer)}
|
|
116
|
-
</div>`
|
|
117
|
-
}
|
|
118
|
-
<button
|
|
119
|
-
type="button"
|
|
120
|
-
data-slot="sheet-close"
|
|
121
|
-
class="ring-offset-background focus-visible:ring-ring absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-2 focus-visible:outline-none"
|
|
122
|
-
@click="${() => state.set(false)}"
|
|
123
|
-
>
|
|
124
|
-
${XIcon({ class: "size-4" })}
|
|
125
|
-
<span class="sr-only">Close</span>
|
|
126
|
-
</button>
|
|
127
|
-
</div>
|
|
128
|
-
</div>`,
|
|
111
|
+
setOpen: (next) => state.set(next),
|
|
112
|
+
declareTitle() {
|
|
113
|
+
hasTitle = true;
|
|
114
|
+
},
|
|
115
|
+
declareDescription() {
|
|
116
|
+
hasDescription = true;
|
|
117
|
+
},
|
|
118
|
+
register(registered) {
|
|
119
|
+
content = registered;
|
|
120
|
+
},
|
|
129
121
|
});
|
|
130
122
|
|
|
131
|
-
|
|
132
|
-
|
|
123
|
+
const parts = props.children?.();
|
|
124
|
+
|
|
125
|
+
if (content !== undefined) {
|
|
126
|
+
const registered = content;
|
|
127
|
+
if (!hasTitle) {
|
|
128
|
+
console.warn(
|
|
129
|
+
"nebula: a Sheet has no SheetTitle. It will be announced only as “dialog”.",
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
modalSurface({
|
|
133
|
+
open: () => state.current(),
|
|
134
|
+
onClose: () => state.set(false),
|
|
135
|
+
panel: (root) => root.querySelector(`#${CSS.escape(panelId)}`),
|
|
136
|
+
returnFocus: () => document.getElementById(triggerId),
|
|
137
|
+
content: () =>
|
|
138
|
+
renderSurface(registered, {
|
|
139
|
+
panelId,
|
|
140
|
+
titleId: hasTitle ? titleId : undefined,
|
|
141
|
+
descriptionId: hasDescription ? descriptionId : undefined,
|
|
142
|
+
close: () => state.set(false),
|
|
143
|
+
}),
|
|
144
|
+
});
|
|
133
145
|
}
|
|
134
146
|
|
|
147
|
+
return html`${parts}`;
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
export interface SheetTriggerProps {
|
|
151
|
+
children?: Slot;
|
|
152
|
+
class?: Reactive<string>;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export const SheetTrigger = component<SheetTriggerProps>((props) => {
|
|
156
|
+
const sheet = inject(SheetContext);
|
|
135
157
|
return html`<button
|
|
136
158
|
type="button"
|
|
137
159
|
data-slot="sheet-trigger"
|
|
138
|
-
id="${triggerId}"
|
|
160
|
+
id="${sheet.triggerId}"
|
|
139
161
|
aria-haspopup="dialog"
|
|
140
|
-
aria-expanded="${() => (
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
162
|
+
aria-expanded="${() => (sheet.open() ? "true" : "false")}"
|
|
163
|
+
data-state="${() => (sheet.open() ? "open" : "closed")}"
|
|
164
|
+
class="${() => cn(read(props.class))}"
|
|
165
|
+
@click="${() => sheet.setOpen(true)}"
|
|
166
|
+
>${slot(props.children)}</button>`;
|
|
144
167
|
});
|
|
168
|
+
|
|
169
|
+
export interface SheetCloseProps {
|
|
170
|
+
children?: Slot;
|
|
171
|
+
class?: Reactive<string>;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export const SheetClose = component<SheetCloseProps>((props) => {
|
|
175
|
+
const sheet = inject(SheetContext);
|
|
176
|
+
return html`<button
|
|
177
|
+
type="button"
|
|
178
|
+
data-slot="sheet-close"
|
|
179
|
+
class="${() => cn(read(props.class))}"
|
|
180
|
+
@click="${() => sheet.setOpen(false)}"
|
|
181
|
+
>${slot(props.children)}</button>`;
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
export interface SheetOverlayProps {
|
|
185
|
+
class?: Reactive<string>;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export const SheetOverlay = component<SheetOverlayProps>(
|
|
189
|
+
(props) => html`<div
|
|
190
|
+
data-slot="sheet-overlay"
|
|
191
|
+
class="${() => cn(dialogBackdropClasses, read(props.class))}"
|
|
192
|
+
></div>`,
|
|
193
|
+
);
|
|
194
|
+
|
|
195
|
+
export interface SheetContentProps {
|
|
196
|
+
children?: Parts;
|
|
197
|
+
/** Which edge it comes from. Default `"right"`. */
|
|
198
|
+
side?: Side;
|
|
199
|
+
showCloseButton?: boolean;
|
|
200
|
+
class?: Reactive<string>;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* The panel.
|
|
205
|
+
*
|
|
206
|
+
* NAMED DEVIATION FROM NEBULA'S OWN PAST — there is no `sheet-body` wrapper
|
|
207
|
+
* any more. Upstream puts the padding on the header and footer and leaves the
|
|
208
|
+
* middle to the caller, and an extra flex child here would not sit where a
|
|
209
|
+
* design copied from upstream expects it. A long middle scrolls by wrapping it
|
|
210
|
+
* in `flex-1 overflow-y-auto`, which is what upstream's own examples do.
|
|
211
|
+
*/
|
|
212
|
+
export const SheetContent = component<SheetContentProps>((props) => {
|
|
213
|
+
const sheet = inject(SheetContext);
|
|
214
|
+
const body = props.children?.();
|
|
215
|
+
sheet.register({
|
|
216
|
+
body,
|
|
217
|
+
side: props.side ?? "right",
|
|
218
|
+
showCloseButton: props.showCloseButton ?? true,
|
|
219
|
+
class: props.class,
|
|
220
|
+
});
|
|
221
|
+
return html``;
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
export interface SheetSectionProps {
|
|
225
|
+
children?: Slot;
|
|
226
|
+
class?: Reactive<string>;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export const SheetHeader = component<SheetSectionProps>(
|
|
230
|
+
(props) => html`<div
|
|
231
|
+
data-slot="sheet-header"
|
|
232
|
+
class="${() => cn("flex flex-col gap-1.5 p-4", read(props.class))}"
|
|
233
|
+
>${slot(props.children)}</div>`,
|
|
234
|
+
);
|
|
235
|
+
|
|
236
|
+
export const SheetFooter = component<SheetSectionProps>(
|
|
237
|
+
(props) => html`<div
|
|
238
|
+
data-slot="sheet-footer"
|
|
239
|
+
class="${() => cn("mt-auto flex flex-col gap-2 p-4", read(props.class))}"
|
|
240
|
+
>${slot(props.children)}</div>`,
|
|
241
|
+
);
|
|
242
|
+
|
|
243
|
+
export interface SheetTitleProps {
|
|
244
|
+
children?: Slot;
|
|
245
|
+
/** Keep it for screen readers but out of the layout. */
|
|
246
|
+
srOnly?: boolean;
|
|
247
|
+
class?: Reactive<string>;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export const SheetTitle = component<SheetTitleProps>((props) => {
|
|
251
|
+
const sheet = inject(SheetContext);
|
|
252
|
+
sheet.declareTitle();
|
|
253
|
+
return html`<h2
|
|
254
|
+
id="${sheet.titleId}"
|
|
255
|
+
data-slot="sheet-title"
|
|
256
|
+
class="${() =>
|
|
257
|
+
cn(
|
|
258
|
+
"text-foreground font-semibold",
|
|
259
|
+
props.srOnly === true ? "sr-only" : "",
|
|
260
|
+
read(props.class),
|
|
261
|
+
)}"
|
|
262
|
+
>${slot(props.children)}</h2>`;
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
export const SheetDescription = component<SheetSectionProps>((props) => {
|
|
266
|
+
const sheet = inject(SheetContext);
|
|
267
|
+
sheet.declareDescription();
|
|
268
|
+
return html`<p
|
|
269
|
+
id="${sheet.descriptionId}"
|
|
270
|
+
data-slot="sheet-description"
|
|
271
|
+
class="${() => cn("text-muted-foreground text-sm", read(props.class))}"
|
|
272
|
+
>${slot(props.children)}</p>`;
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
interface SurfaceIds {
|
|
276
|
+
readonly panelId: string;
|
|
277
|
+
readonly titleId: string | undefined;
|
|
278
|
+
readonly descriptionId: string | undefined;
|
|
279
|
+
close(): void;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
function renderSurface(
|
|
283
|
+
registered: RegisteredContent,
|
|
284
|
+
ids: SurfaceIds,
|
|
285
|
+
): TemplateResult {
|
|
286
|
+
const corner = registered.showCloseButton
|
|
287
|
+
? html`<button
|
|
288
|
+
type="button"
|
|
289
|
+
data-slot="sheet-close"
|
|
290
|
+
class="${closeButtonClasses}"
|
|
291
|
+
@click="${() => ids.close()}"
|
|
292
|
+
>${XIcon({ class: "size-4" })}<span class="sr-only">Close</span></button>`
|
|
293
|
+
: null;
|
|
294
|
+
return html`<div data-slot="sheet-portal" class="${cn("fixed inset-0 z-50", fadeInOut)}">
|
|
295
|
+
<div data-slot="sheet-overlay" class="${dialogBackdropClasses}"></div>
|
|
296
|
+
<div
|
|
297
|
+
data-slot="sheet-content"
|
|
298
|
+
data-side="${registered.side}"
|
|
299
|
+
id="${ids.panelId}"
|
|
300
|
+
role="dialog"
|
|
301
|
+
aria-modal="true"
|
|
302
|
+
aria-labelledby="${ids.titleId}"
|
|
303
|
+
aria-describedby="${ids.descriptionId}"
|
|
304
|
+
tabindex="-1"
|
|
305
|
+
class="${cn(
|
|
306
|
+
panelBaseClasses,
|
|
307
|
+
panelClassesFor(registered.side),
|
|
308
|
+
slideFrom(registered.side),
|
|
309
|
+
read(registered.class),
|
|
310
|
+
)}"
|
|
311
|
+
>${registered.body}${corner}</div>
|
|
312
|
+
</div>`;
|
|
313
|
+
}
|