@deepfuture/dui-components 0.0.20 → 1.0.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/README.md +56 -65
- package/_install.js +11 -0
- package/accordion/accordion-item.d.ts +3 -20
- package/accordion/accordion-item.js +93 -292
- package/accordion/accordion.d.ts +3 -18
- package/accordion/accordion.js +9 -247
- package/accordion/index.d.ts +6 -6
- package/accordion/index.js +5 -5
- package/alert-dialog/alert-dialog-close.d.ts +3 -14
- package/alert-dialog/alert-dialog-close.js +4 -34
- package/alert-dialog/alert-dialog-popup.d.ts +3 -32
- package/alert-dialog/alert-dialog-popup.js +68 -317
- package/alert-dialog/alert-dialog-trigger.d.ts +3 -14
- package/alert-dialog/alert-dialog-trigger.js +4 -51
- package/alert-dialog/alert-dialog.d.ts +3 -30
- package/alert-dialog/alert-dialog.js +8 -158
- package/alert-dialog/index.d.ts +11 -11
- package/alert-dialog/index.js +9 -9
- package/all.d.ts +159 -123
- package/all.js +134 -231
- package/avatar/avatar.d.ts +3 -39
- package/avatar/avatar.js +18 -238
- package/avatar/index.d.ts +4 -4
- package/avatar/index.js +3 -3
- package/badge/badge.d.ts +3 -10
- package/badge/badge.js +88 -22
- package/badge/index.d.ts +2 -3
- package/badge/index.js +2 -3
- package/breadcrumb/breadcrumb-ellipsis.d.ts +3 -12
- package/breadcrumb/breadcrumb-ellipsis.js +8 -34
- package/breadcrumb/breadcrumb-item.d.ts +3 -11
- package/breadcrumb/breadcrumb-item.js +7 -26
- package/breadcrumb/breadcrumb-link.d.ts +3 -12
- package/breadcrumb/breadcrumb-link.js +16 -26
- package/breadcrumb/breadcrumb-page.d.ts +3 -11
- package/breadcrumb/breadcrumb-page.js +8 -31
- package/breadcrumb/breadcrumb-separator.d.ts +3 -12
- package/breadcrumb/breadcrumb-separator.js +8 -31
- package/breadcrumb/breadcrumb.d.ts +3 -12
- package/breadcrumb/breadcrumb.js +10 -33
- package/breadcrumb/index.d.ts +12 -13
- package/breadcrumb/index.js +12 -13
- package/button/button.d.ts +3 -32
- package/button/button.js +221 -165
- package/button/index.d.ts +3 -3
- package/button/index.js +3 -3
- package/calendar/calendar.d.ts +3 -31
- package/calendar/calendar.js +71 -481
- package/calendar/index.d.ts +3 -3
- package/calendar/index.js +3 -3
- package/card/card.d.ts +3 -27
- package/card/card.js +80 -163
- package/card/index.d.ts +2 -3
- package/card/index.js +2 -3
- package/card-grid/card-grid.d.ts +3 -15
- package/card-grid/card-grid.js +8 -106
- package/card-grid/index.d.ts +2 -3
- package/card-grid/index.js +2 -3
- package/checkbox/checkbox-group.d.ts +3 -34
- package/checkbox/checkbox-group.js +11 -188
- package/checkbox/checkbox.d.ts +3 -47
- package/checkbox/checkbox.js +43 -341
- package/checkbox/index.d.ts +6 -6
- package/checkbox/index.js +5 -5
- package/collapsible/collapsible.d.ts +3 -20
- package/collapsible/collapsible.js +83 -277
- package/collapsible/index.d.ts +3 -3
- package/collapsible/index.js +3 -3
- package/combobox/combobox.d.ts +3 -47
- package/combobox/combobox.js +136 -538
- package/combobox/index.d.ts +4 -4
- package/combobox/index.js +3 -3
- package/command/command-empty.d.ts +3 -8
- package/command/command-empty.js +10 -88
- package/command/command-group.d.ts +3 -13
- package/command/command-group.js +15 -114
- package/command/command-input.d.ts +3 -11
- package/command/command-input.js +20 -136
- package/command/command-item.d.ts +3 -18
- package/command/command-item.js +24 -212
- package/command/command-list.d.ts +3 -7
- package/command/command-list.js +11 -79
- package/command/command-separator.d.ts +3 -5
- package/command/command-separator.js +10 -11
- package/command/command-shortcut.d.ts +3 -5
- package/command/command-shortcut.js +9 -12
- package/command/command.d.ts +3 -23
- package/command/command.js +10 -339
- package/command/index.d.ts +17 -19
- package/command/index.js +16 -18
- package/data-table/data-table.d.ts +3 -57
- package/data-table/data-table.js +86 -449
- package/data-table/index.d.ts +3 -4
- package/data-table/index.js +2 -3
- package/dialog/dialog-close.d.ts +3 -14
- package/dialog/dialog-close.js +4 -34
- package/dialog/dialog-popup.d.ts +3 -34
- package/dialog/dialog-popup.js +70 -336
- package/dialog/dialog-trigger.d.ts +3 -14
- package/dialog/dialog-trigger.js +4 -51
- package/dialog/dialog.d.ts +3 -30
- package/dialog/dialog.js +8 -158
- package/dialog/index.d.ts +11 -11
- package/dialog/index.js +9 -9
- package/dropzone/dropzone.d.ts +3 -72
- package/dropzone/dropzone.js +29 -407
- package/dropzone/index.d.ts +4 -4
- package/dropzone/index.js +3 -3
- package/field/field.d.ts +3 -30
- package/field/field.js +34 -353
- package/field/index.d.ts +1 -0
- package/field/index.js +1 -0
- package/fieldset/fieldset.d.ts +3 -18
- package/fieldset/fieldset.js +21 -110
- package/fieldset/index.d.ts +1 -0
- package/fieldset/index.js +1 -0
- package/icon/icon.d.ts +3 -15
- package/icon/icon.js +4 -33
- package/icon/index.d.ts +2 -3
- package/icon/index.js +2 -3
- package/input/index.d.ts +3 -3
- package/input/index.js +3 -3
- package/input/input.d.ts +3 -49
- package/input/input.js +57 -238
- package/menu/index.d.ts +4 -5
- package/menu/index.js +4 -5
- package/menu/menu-item.d.ts +3 -13
- package/menu/menu-item.js +41 -91
- package/menu/menu.d.ts +3 -15
- package/menu/menu.js +27 -277
- package/menubar/index.d.ts +3 -4
- package/menubar/index.js +2 -3
- package/menubar/menubar.d.ts +3 -19
- package/menubar/menubar.js +12 -183
- package/number-field/index.d.ts +3 -3
- package/number-field/index.js +3 -3
- package/number-field/number-field.d.ts +3 -55
- package/number-field/number-field.js +205 -698
- package/package.json +126 -113
- package/popover/index.d.ts +11 -11
- package/popover/index.js +9 -9
- package/popover/popover-close.d.ts +3 -12
- package/popover/popover-close.js +4 -32
- package/popover/popover-popup.d.ts +3 -18
- package/popover/popover-popup.js +28 -205
- package/popover/popover-trigger.d.ts +3 -13
- package/popover/popover-trigger.js +4 -73
- package/popover/popover.d.ts +3 -29
- package/popover/popover.js +8 -207
- package/portal/index.d.ts +3 -4
- package/portal/index.js +2 -3
- package/portal/portal.d.ts +3 -27
- package/portal/portal.js +8 -157
- package/preview-card/index.d.ts +9 -9
- package/preview-card/index.js +7 -7
- package/preview-card/preview-card-popup.d.ts +3 -14
- package/preview-card/preview-card-popup.js +29 -193
- package/preview-card/preview-card-trigger.d.ts +3 -12
- package/preview-card/preview-card-trigger.js +4 -74
- package/preview-card/preview-card.d.ts +3 -33
- package/preview-card/preview-card.js +8 -239
- package/progress/index.d.ts +2 -3
- package/progress/index.js +2 -3
- package/progress/progress.d.ts +3 -17
- package/progress/progress.js +28 -130
- package/radio/index.d.ts +6 -6
- package/radio/index.js +5 -5
- package/radio/radio-group.d.ts +3 -37
- package/radio/radio-group.js +8 -200
- package/radio/radio.d.ts +3 -28
- package/radio/radio.js +38 -213
- package/scroll-area/index.d.ts +2 -3
- package/scroll-area/index.js +2 -3
- package/scroll-area/scroll-area.d.ts +3 -36
- package/scroll-area/scroll-area.js +25 -546
- package/select/index.d.ts +3 -4
- package/select/index.js +2 -3
- package/select/select.d.ts +3 -37
- package/select/select.js +115 -403
- package/separator/index.d.ts +2 -3
- package/separator/index.js +2 -3
- package/separator/separator.d.ts +3 -10
- package/separator/separator.js +23 -84
- package/sidebar/index.d.ts +29 -29
- package/sidebar/index.js +27 -32
- package/sidebar/sidebar-content.d.ts +3 -12
- package/sidebar/sidebar-content.js +7 -29
- package/sidebar/sidebar-footer.d.ts +3 -10
- package/sidebar/sidebar-footer.js +7 -20
- package/sidebar/sidebar-group-label.d.ts +3 -15
- package/sidebar/sidebar-group-label.js +17 -41
- package/sidebar/sidebar-group.d.ts +3 -13
- package/sidebar/sidebar-group.js +7 -24
- package/sidebar/sidebar-header.d.ts +3 -10
- package/sidebar/sidebar-header.js +7 -16
- package/sidebar/sidebar-inset.d.ts +3 -13
- package/sidebar/sidebar-inset.js +7 -28
- package/sidebar/sidebar-menu-button.d.ts +3 -26
- package/sidebar/sidebar-menu-button.js +60 -217
- package/sidebar/sidebar-menu-item.d.ts +3 -10
- package/sidebar/sidebar-menu-item.js +7 -19
- package/sidebar/sidebar-menu.d.ts +3 -12
- package/sidebar/sidebar-menu.js +7 -25
- package/sidebar/sidebar-provider.d.ts +3 -34
- package/sidebar/sidebar-provider.js +22 -232
- package/sidebar/sidebar-separator.d.ts +3 -10
- package/sidebar/sidebar-separator.js +9 -19
- package/sidebar/sidebar-trigger.d.ts +3 -14
- package/sidebar/sidebar-trigger.js +10 -46
- package/sidebar/sidebar.d.ts +3 -19
- package/sidebar/sidebar.js +65 -262
- package/slider/index.d.ts +3 -3
- package/slider/index.js +3 -3
- package/slider/slider.d.ts +3 -45
- package/slider/slider.js +97 -382
- package/spinner/index.d.ts +2 -3
- package/spinner/index.js +2 -3
- package/spinner/spinner.d.ts +3 -11
- package/spinner/spinner.js +20 -163
- package/split-button/index.d.ts +3 -1
- package/split-button/index.js +3 -1
- package/split-button/split-button.d.ts +3 -31
- package/split-button/split-button.js +307 -384
- package/stepper/index.d.ts +3 -3
- package/stepper/index.js +3 -3
- package/stepper/stepper.d.ts +3 -41
- package/stepper/stepper.js +57 -381
- package/switch/index.d.ts +3 -3
- package/switch/index.js +3 -3
- package/switch/switch.d.ts +3 -30
- package/switch/switch.js +63 -228
- package/tabs/index.d.ts +12 -12
- package/tabs/index.js +11 -11
- package/tabs/tab.d.ts +3 -14
- package/tabs/tab.js +33 -131
- package/tabs/tabs-indicator.d.ts +3 -9
- package/tabs/tabs-indicator.js +17 -22
- package/tabs/tabs-list.d.ts +3 -15
- package/tabs/tabs-list.js +14 -113
- package/tabs/tabs-panel.d.ts +3 -16
- package/tabs/tabs-panel.js +32 -114
- package/tabs/tabs.d.ts +3 -22
- package/tabs/tabs.js +8 -170
- package/textarea/index.d.ts +4 -4
- package/textarea/index.js +3 -3
- package/textarea/textarea.d.ts +3 -36
- package/textarea/textarea.js +63 -220
- package/toggle/index.d.ts +6 -6
- package/toggle/index.js +5 -5
- package/toggle/toggle-group.d.ts +3 -27
- package/toggle/toggle-group.js +9 -224
- package/toggle/toggle.d.ts +3 -26
- package/toggle/toggle.js +94 -178
- package/tokens/properties.css +361 -0
- package/tokens/prose.css +250 -0
- package/tokens/prose.d.ts +2 -0
- package/tokens/prose.js +4 -0
- package/tokens/tokens-raw.d.ts +2 -0
- package/tokens/tokens-raw.js +2 -0
- package/tokens/tokens.css +409 -0
- package/tokens/tokens.d.ts +2 -0
- package/tokens/tokens.js +5 -0
- package/toolbar/index.d.ts +2 -3
- package/toolbar/index.js +2 -3
- package/toolbar/toolbar.d.ts +3 -11
- package/toolbar/toolbar.js +25 -116
- package/tooltip/index.d.ts +9 -9
- package/tooltip/index.js +7 -7
- package/tooltip/tooltip-popup.d.ts +3 -14
- package/tooltip/tooltip-popup.js +32 -185
- package/tooltip/tooltip-trigger.d.ts +3 -14
- package/tooltip/tooltip-trigger.js +5 -148
- package/tooltip/tooltip.d.ts +3 -35
- package/tooltip/tooltip.js +8 -253
- package/trunc/index.d.ts +2 -3
- package/trunc/index.js +2 -3
- package/trunc/trunc.d.ts +3 -17
- package/trunc/trunc.js +10 -108
- package/_deprecated/center/center.d.ts +0 -14
- package/_deprecated/center/center.js +0 -37
- package/_deprecated/center/index.d.ts +0 -3
- package/_deprecated/center/index.js +0 -3
- package/_deprecated/center/register.js +0 -4
- package/_deprecated/hstack/hstack.d.ts +0 -25
- package/_deprecated/hstack/hstack.js +0 -187
- package/_deprecated/hstack/index.d.ts +0 -4
- package/_deprecated/hstack/index.js +0 -3
- package/_deprecated/hstack/register.d.ts +0 -1
- package/_deprecated/hstack/register.js +0 -4
- package/_deprecated/page-inset/index.d.ts +0 -3
- package/_deprecated/page-inset/index.js +0 -3
- package/_deprecated/page-inset/page-inset.d.ts +0 -28
- package/_deprecated/page-inset/page-inset.js +0 -151
- package/_deprecated/page-inset/register.d.ts +0 -1
- package/_deprecated/page-inset/register.js +0 -4
- package/_deprecated/vstack/index.d.ts +0 -3
- package/_deprecated/vstack/index.js +0 -3
- package/_deprecated/vstack/register.d.ts +0 -1
- package/_deprecated/vstack/register.js +0 -4
- package/_deprecated/vstack/vstack.d.ts +0 -17
- package/_deprecated/vstack/vstack.js +0 -125
- package/accordion/accordion-context.d.ts +0 -15
- package/accordion/accordion-context.js +0 -3
- package/alert-dialog/alert-dialog-context.d.ts +0 -13
- package/alert-dialog/alert-dialog-context.js +0 -3
- package/checkbox/checkbox-group-context.d.ts +0 -11
- package/checkbox/checkbox-group-context.js +0 -3
- package/command/command-context.d.ts +0 -30
- package/command/command-context.js +0 -3
- package/command/command-score.d.ts +0 -6
- package/command/command-score.js +0 -31
- package/dialog/dialog-context.d.ts +0 -13
- package/dialog/dialog-context.js +0 -3
- package/global.d.ts +0 -179
- package/menubar/menubar-context.d.ts +0 -9
- package/menubar/menubar-context.js +0 -2
- package/popover/popover-context.d.ts +0 -17
- package/popover/popover-context.js +0 -3
- package/preview-card/preview-card-context.d.ts +0 -16
- package/preview-card/preview-card-context.js +0 -3
- package/radio/radio-group-context.d.ts +0 -11
- package/radio/radio-group-context.js +0 -2
- package/sidebar/sidebar-context.d.ts +0 -15
- package/sidebar/sidebar-context.js +0 -3
- package/split-button/register.d.ts +0 -1
- package/split-button/register.js +0 -4
- package/tabs/tabs-context.d.ts +0 -8
- package/tabs/tabs-context.js +0 -2
- package/toggle/toggle-group-context.d.ts +0 -9
- package/toggle/toggle-group-context.js +0 -2
- package/tooltip/tooltip-context.d.ts +0 -17
- package/tooltip/tooltip-context.js +0 -3
- /package/{_deprecated/center/register.d.ts → _install.d.ts} +0 -0
package/dialog/dialog-popup.d.ts
CHANGED
|
@@ -1,36 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
* `<dui-dialog-popup>` — The popup overlay for the dialog.
|
|
5
|
-
*
|
|
6
|
-
* Renders a backdrop and a centered dialog popup with focus trapping.
|
|
7
|
-
* Handles open/close animations via `data-starting-style` / `data-ending-style`.
|
|
8
|
-
* Closes on backdrop click (unlike `<dui-alert-dialog-popup>`).
|
|
9
|
-
*
|
|
10
|
-
* Title and description are provided via named slots and rendered as
|
|
11
|
-
* semantic `<h2>` and `<p>` elements with ARIA linkage.
|
|
12
|
-
*
|
|
13
|
-
* @slot title - Title text for the dialog (rendered as `<h2>`).
|
|
14
|
-
* @slot description - Description text for the dialog (rendered as `<p>`).
|
|
15
|
-
* @slot - Default slot for dialog content (actions, form fields, etc.).
|
|
16
|
-
* @csspart backdrop - The overlay backdrop behind the dialog.
|
|
17
|
-
* @csspart popup - The dialog popup container.
|
|
18
|
-
* @csspart title - The heading element wrapping the title slot.
|
|
19
|
-
* @csspart description - The paragraph element wrapping the description slot.
|
|
20
|
-
*/
|
|
21
|
-
export declare class DuiDialogPopup extends LitElement {
|
|
22
|
-
#private;
|
|
23
|
-
static tagName: "dui-dialog-popup";
|
|
1
|
+
import { DuiDialogPopupPrimitive } from "@deepfuture/dui-primitives/dialog";
|
|
2
|
+
import "../_install.js";
|
|
3
|
+
export declare class DuiDialogPopup extends DuiDialogPopupPrimitive {
|
|
24
4
|
static styles: import("lit").CSSResult[];
|
|
25
|
-
/** Keep the popup in the DOM when closed. */
|
|
26
|
-
accessor keepMounted: boolean;
|
|
27
|
-
/** CSS selector within the popup to focus when the dialog opens. */
|
|
28
|
-
accessor initialFocus: string | undefined;
|
|
29
|
-
/** CSS selector in the document to focus when the dialog closes. */
|
|
30
|
-
accessor finalFocus: string | undefined;
|
|
31
|
-
/** Width of the popup (CSS value, e.g. "32rem" or "600px"). Defaults to 24rem. */
|
|
32
|
-
accessor width: string | undefined;
|
|
33
|
-
updated(): void;
|
|
34
|
-
willUpdate(changed: PropertyValues): void;
|
|
35
|
-
render(): TemplateResult;
|
|
36
5
|
}
|
package/dialog/dialog-popup.js
CHANGED
|
@@ -1,343 +1,77 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _, done = false;
|
|
8
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
9
|
-
var context = {};
|
|
10
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
11
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
12
|
-
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
13
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
14
|
-
if (kind === "accessor") {
|
|
15
|
-
if (result === void 0) continue;
|
|
16
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
17
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
|
18
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
|
19
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
20
|
-
}
|
|
21
|
-
else if (_ = accept(result)) {
|
|
22
|
-
if (kind === "field") initializers.unshift(_);
|
|
23
|
-
else descriptor[key] = _;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
27
|
-
done = true;
|
|
28
|
-
};
|
|
29
|
-
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
30
|
-
var useValue = arguments.length > 2;
|
|
31
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
32
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
33
|
-
}
|
|
34
|
-
return useValue ? value : void 0;
|
|
35
|
-
};
|
|
36
|
-
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
37
|
-
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
38
|
-
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
39
|
-
};
|
|
40
|
-
import { css, html, LitElement } from "lit";
|
|
41
|
-
import { property, state } from "lit/decorators.js";
|
|
42
|
-
import { ContextConsumer } from "@lit/context";
|
|
43
|
-
import { base } from "@deepfuture/dui-core/base";
|
|
44
|
-
import { getComposedFocusableElements, queryComposedAutofocus, } from "@deepfuture/dui-core/dom";
|
|
45
|
-
import { dialogContext } from "./dialog-context.js";
|
|
46
|
-
const hostStyles = css `
|
|
47
|
-
:host {
|
|
48
|
-
display: contents;
|
|
49
|
-
}
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
import { DuiDialogPopupPrimitive } from "@deepfuture/dui-primitives/dialog";
|
|
3
|
+
import "../_install.js";
|
|
4
|
+
const styles = css `
|
|
5
|
+
|
|
6
|
+
/* ── Backdrop ── */
|
|
50
7
|
|
|
51
|
-
:host(:not([mounted])) [part="backdrop"],
|
|
52
|
-
:host(:not([mounted])) [part="popup"] {
|
|
53
|
-
display: none;
|
|
54
|
-
}
|
|
55
|
-
`;
|
|
56
|
-
const componentStyles = css `
|
|
57
8
|
[part="backdrop"] {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
inset: 0;
|
|
61
|
-
z-index: 999;
|
|
9
|
+
background: var(--scrim);
|
|
10
|
+
transition: opacity var(--duration-fast) var(--ease-out-3);
|
|
62
11
|
}
|
|
63
12
|
|
|
13
|
+
[part="backdrop"][data-starting-style],
|
|
14
|
+
[part="backdrop"][data-ending-style] {
|
|
15
|
+
opacity: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* ── Popup ── */
|
|
19
|
+
|
|
64
20
|
[part="popup"] {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
21
|
+
margin-top: calc(-1 * var(--space-8));
|
|
22
|
+
padding: var(--space-6) var(--space-5) var(--space-5);
|
|
23
|
+
border-radius: var(--radius-lg);
|
|
24
|
+
outline: var(--border-width-thin) solid var(--border);
|
|
25
|
+
background: var(--surface-2);
|
|
26
|
+
color: var(--text-1);
|
|
27
|
+
font-family: var(--font-sans);
|
|
28
|
+
box-shadow: var(--shadow-lg);
|
|
29
|
+
transition-duration: var(--duration-fast);
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
gap: var(--space-5);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
[part="popup"][data-starting-style],
|
|
36
|
+
[part="popup"][data-ending-style] {
|
|
37
|
+
opacity: 0;
|
|
38
|
+
transform: translate(-50%, -50%) scale(0.9);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* ── Title ── */
|
|
42
|
+
|
|
43
|
+
[part="title"] {
|
|
44
|
+
font-family: var(--font-sans);
|
|
45
|
+
font-size: var(--text-base);
|
|
46
|
+
line-height: var(--text-base--line-height);
|
|
47
|
+
font-weight: var(--font-weight-semibold);
|
|
48
|
+
color: var(--text-1);
|
|
49
|
+
text-box: trim-both cap alphabetic;
|
|
50
|
+
text-wrap: pretty;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* ── Description ── */
|
|
54
|
+
|
|
55
|
+
[part="description"] {
|
|
56
|
+
margin: 0;
|
|
57
|
+
font-family: var(--font-sans);
|
|
58
|
+
font-size: var(--text-sm);
|
|
59
|
+
line-height: var(--text-sm--line-height);
|
|
60
|
+
color: var(--text-2);
|
|
61
|
+
text-box: trim-both cap alphabetic;
|
|
62
|
+
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* ── Reduced motion ── */
|
|
66
|
+
|
|
67
|
+
@media (prefers-reduced-motion: reduce) {
|
|
68
|
+
[part="backdrop"],
|
|
69
|
+
[part="popup"] {
|
|
70
|
+
transition-duration: 0s;
|
|
71
|
+
}
|
|
75
72
|
}
|
|
76
73
|
`;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
* Handles open/close animations via `data-starting-style` / `data-ending-style`.
|
|
82
|
-
* Closes on backdrop click (unlike `<dui-alert-dialog-popup>`).
|
|
83
|
-
*
|
|
84
|
-
* Title and description are provided via named slots and rendered as
|
|
85
|
-
* semantic `<h2>` and `<p>` elements with ARIA linkage.
|
|
86
|
-
*
|
|
87
|
-
* @slot title - Title text for the dialog (rendered as `<h2>`).
|
|
88
|
-
* @slot description - Description text for the dialog (rendered as `<p>`).
|
|
89
|
-
* @slot - Default slot for dialog content (actions, form fields, etc.).
|
|
90
|
-
* @csspart backdrop - The overlay backdrop behind the dialog.
|
|
91
|
-
* @csspart popup - The dialog popup container.
|
|
92
|
-
* @csspart title - The heading element wrapping the title slot.
|
|
93
|
-
* @csspart description - The paragraph element wrapping the description slot.
|
|
94
|
-
*/
|
|
95
|
-
let DuiDialogPopup = (() => {
|
|
96
|
-
let _classSuper = LitElement;
|
|
97
|
-
let _keepMounted_decorators;
|
|
98
|
-
let _keepMounted_initializers = [];
|
|
99
|
-
let _keepMounted_extraInitializers = [];
|
|
100
|
-
let _initialFocus_decorators;
|
|
101
|
-
let _initialFocus_initializers = [];
|
|
102
|
-
let _initialFocus_extraInitializers = [];
|
|
103
|
-
let _finalFocus_decorators;
|
|
104
|
-
let _finalFocus_initializers = [];
|
|
105
|
-
let _finalFocus_extraInitializers = [];
|
|
106
|
-
let _width_decorators;
|
|
107
|
-
let _width_initializers = [];
|
|
108
|
-
let _width_extraInitializers = [];
|
|
109
|
-
let _private_mounted_decorators;
|
|
110
|
-
let _private_mounted_initializers = [];
|
|
111
|
-
let _private_mounted_extraInitializers = [];
|
|
112
|
-
let _private_mounted_descriptor;
|
|
113
|
-
let _private_startingStyle_decorators;
|
|
114
|
-
let _private_startingStyle_initializers = [];
|
|
115
|
-
let _private_startingStyle_extraInitializers = [];
|
|
116
|
-
let _private_startingStyle_descriptor;
|
|
117
|
-
let _private_endingStyle_decorators;
|
|
118
|
-
let _private_endingStyle_initializers = [];
|
|
119
|
-
let _private_endingStyle_extraInitializers = [];
|
|
120
|
-
let _private_endingStyle_descriptor;
|
|
121
|
-
return class DuiDialogPopup extends _classSuper {
|
|
122
|
-
static {
|
|
123
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
124
|
-
_keepMounted_decorators = [property({ type: Boolean, attribute: "keep-mounted" })];
|
|
125
|
-
_initialFocus_decorators = [property({ attribute: "initial-focus" })];
|
|
126
|
-
_finalFocus_decorators = [property({ attribute: "final-focus" })];
|
|
127
|
-
_width_decorators = [property()];
|
|
128
|
-
_private_mounted_decorators = [state()];
|
|
129
|
-
_private_startingStyle_decorators = [state()];
|
|
130
|
-
_private_endingStyle_decorators = [state()];
|
|
131
|
-
__esDecorate(this, null, _keepMounted_decorators, { kind: "accessor", name: "keepMounted", static: false, private: false, access: { has: obj => "keepMounted" in obj, get: obj => obj.keepMounted, set: (obj, value) => { obj.keepMounted = value; } }, metadata: _metadata }, _keepMounted_initializers, _keepMounted_extraInitializers);
|
|
132
|
-
__esDecorate(this, null, _initialFocus_decorators, { kind: "accessor", name: "initialFocus", static: false, private: false, access: { has: obj => "initialFocus" in obj, get: obj => obj.initialFocus, set: (obj, value) => { obj.initialFocus = value; } }, metadata: _metadata }, _initialFocus_initializers, _initialFocus_extraInitializers);
|
|
133
|
-
__esDecorate(this, null, _finalFocus_decorators, { kind: "accessor", name: "finalFocus", static: false, private: false, access: { has: obj => "finalFocus" in obj, get: obj => obj.finalFocus, set: (obj, value) => { obj.finalFocus = value; } }, metadata: _metadata }, _finalFocus_initializers, _finalFocus_extraInitializers);
|
|
134
|
-
__esDecorate(this, null, _width_decorators, { kind: "accessor", name: "width", static: false, private: false, access: { has: obj => "width" in obj, get: obj => obj.width, set: (obj, value) => { obj.width = value; } }, metadata: _metadata }, _width_initializers, _width_extraInitializers);
|
|
135
|
-
__esDecorate(this, _private_mounted_descriptor = { get: __setFunctionName(function () { return this.#mounted_accessor_storage; }, "#mounted", "get"), set: __setFunctionName(function (value) { this.#mounted_accessor_storage = value; }, "#mounted", "set") }, _private_mounted_decorators, { kind: "accessor", name: "#mounted", static: false, private: true, access: { has: obj => #mounted in obj, get: obj => obj.#mounted, set: (obj, value) => { obj.#mounted = value; } }, metadata: _metadata }, _private_mounted_initializers, _private_mounted_extraInitializers);
|
|
136
|
-
__esDecorate(this, _private_startingStyle_descriptor = { get: __setFunctionName(function () { return this.#startingStyle_accessor_storage; }, "#startingStyle", "get"), set: __setFunctionName(function (value) { this.#startingStyle_accessor_storage = value; }, "#startingStyle", "set") }, _private_startingStyle_decorators, { kind: "accessor", name: "#startingStyle", static: false, private: true, access: { has: obj => #startingStyle in obj, get: obj => obj.#startingStyle, set: (obj, value) => { obj.#startingStyle = value; } }, metadata: _metadata }, _private_startingStyle_initializers, _private_startingStyle_extraInitializers);
|
|
137
|
-
__esDecorate(this, _private_endingStyle_descriptor = { get: __setFunctionName(function () { return this.#endingStyle_accessor_storage; }, "#endingStyle", "get"), set: __setFunctionName(function (value) { this.#endingStyle_accessor_storage = value; }, "#endingStyle", "set") }, _private_endingStyle_decorators, { kind: "accessor", name: "#endingStyle", static: false, private: true, access: { has: obj => #endingStyle in obj, get: obj => obj.#endingStyle, set: (obj, value) => { obj.#endingStyle = value; } }, metadata: _metadata }, _private_endingStyle_initializers, _private_endingStyle_extraInitializers);
|
|
138
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
139
|
-
}
|
|
140
|
-
static tagName = "dui-dialog-popup";
|
|
141
|
-
static styles = [base, hostStyles, componentStyles];
|
|
142
|
-
#keepMounted_accessor_storage = __runInitializers(this, _keepMounted_initializers, false);
|
|
143
|
-
/** Keep the popup in the DOM when closed. */
|
|
144
|
-
get keepMounted() { return this.#keepMounted_accessor_storage; }
|
|
145
|
-
set keepMounted(value) { this.#keepMounted_accessor_storage = value; }
|
|
146
|
-
#initialFocus_accessor_storage = (__runInitializers(this, _keepMounted_extraInitializers), __runInitializers(this, _initialFocus_initializers, undefined));
|
|
147
|
-
/** CSS selector within the popup to focus when the dialog opens. */
|
|
148
|
-
get initialFocus() { return this.#initialFocus_accessor_storage; }
|
|
149
|
-
set initialFocus(value) { this.#initialFocus_accessor_storage = value; }
|
|
150
|
-
#finalFocus_accessor_storage = (__runInitializers(this, _initialFocus_extraInitializers), __runInitializers(this, _finalFocus_initializers, undefined));
|
|
151
|
-
/** CSS selector in the document to focus when the dialog closes. */
|
|
152
|
-
get finalFocus() { return this.#finalFocus_accessor_storage; }
|
|
153
|
-
set finalFocus(value) { this.#finalFocus_accessor_storage = value; }
|
|
154
|
-
#width_accessor_storage = (__runInitializers(this, _finalFocus_extraInitializers), __runInitializers(this, _width_initializers, undefined));
|
|
155
|
-
/** Width of the popup (CSS value, e.g. "32rem" or "600px"). Defaults to 24rem. */
|
|
156
|
-
get width() { return this.#width_accessor_storage; }
|
|
157
|
-
set width(value) { this.#width_accessor_storage = value; }
|
|
158
|
-
#mounted_accessor_storage = (__runInitializers(this, _width_extraInitializers), __runInitializers(this, _private_mounted_initializers, false));
|
|
159
|
-
get #mounted() { return _private_mounted_descriptor.get.call(this); }
|
|
160
|
-
set #mounted(value) { return _private_mounted_descriptor.set.call(this, value); }
|
|
161
|
-
#startingStyle_accessor_storage = (__runInitializers(this, _private_mounted_extraInitializers), __runInitializers(this, _private_startingStyle_initializers, false));
|
|
162
|
-
get #startingStyle() { return _private_startingStyle_descriptor.get.call(this); }
|
|
163
|
-
set #startingStyle(value) { return _private_startingStyle_descriptor.set.call(this, value); }
|
|
164
|
-
#endingStyle_accessor_storage = (__runInitializers(this, _private_startingStyle_extraInitializers), __runInitializers(this, _private_endingStyle_initializers, false));
|
|
165
|
-
get #endingStyle() { return _private_endingStyle_descriptor.get.call(this); }
|
|
166
|
-
set #endingStyle(value) { return _private_endingStyle_descriptor.set.call(this, value); }
|
|
167
|
-
#previouslyFocused = __runInitializers(this, _private_endingStyle_extraInitializers);
|
|
168
|
-
#ctx = new ContextConsumer(this, {
|
|
169
|
-
context: dialogContext,
|
|
170
|
-
subscribe: true,
|
|
171
|
-
});
|
|
172
|
-
updated() {
|
|
173
|
-
const isOpen = this.#ctx.value?.open ?? false;
|
|
174
|
-
if (isOpen && !this.#mounted) {
|
|
175
|
-
this.#animateOpen();
|
|
176
|
-
}
|
|
177
|
-
else if (!isOpen && this.#mounted && !this.#endingStyle) {
|
|
178
|
-
this.#animateClose();
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
async #animateOpen() {
|
|
182
|
-
this.#previouslyFocused =
|
|
183
|
-
document.activeElement ?? undefined;
|
|
184
|
-
this.#mounted = true;
|
|
185
|
-
this.#startingStyle = true;
|
|
186
|
-
await new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r())));
|
|
187
|
-
this.#startingStyle = false;
|
|
188
|
-
await this.updateComplete;
|
|
189
|
-
this.#trapFocusIn();
|
|
190
|
-
}
|
|
191
|
-
#animateClose() {
|
|
192
|
-
this.#endingStyle = true;
|
|
193
|
-
const popup = this.shadowRoot?.querySelector('[part="popup"]');
|
|
194
|
-
if (!popup) {
|
|
195
|
-
this.#finishClose();
|
|
196
|
-
return;
|
|
197
|
-
}
|
|
198
|
-
let called = false;
|
|
199
|
-
const done = () => {
|
|
200
|
-
if (called)
|
|
201
|
-
return;
|
|
202
|
-
called = true;
|
|
203
|
-
popup.removeEventListener("transitionend", onEnd);
|
|
204
|
-
clearTimeout(timer);
|
|
205
|
-
this.#finishClose();
|
|
206
|
-
};
|
|
207
|
-
const onEnd = (e) => {
|
|
208
|
-
if (e.propertyName === "opacity") {
|
|
209
|
-
done();
|
|
210
|
-
}
|
|
211
|
-
};
|
|
212
|
-
popup.addEventListener("transitionend", onEnd);
|
|
213
|
-
const timer = setTimeout(done, 200);
|
|
214
|
-
}
|
|
215
|
-
#finishClose() {
|
|
216
|
-
if (!this.#endingStyle && !this.#mounted)
|
|
217
|
-
return;
|
|
218
|
-
this.#endingStyle = false;
|
|
219
|
-
if (!this.keepMounted) {
|
|
220
|
-
this.#mounted = false;
|
|
221
|
-
}
|
|
222
|
-
this.#restoreFocus();
|
|
223
|
-
}
|
|
224
|
-
#trapFocusIn() {
|
|
225
|
-
const popup = this.shadowRoot?.querySelector('[part="popup"]');
|
|
226
|
-
if (!popup)
|
|
227
|
-
return;
|
|
228
|
-
if (this.initialFocus) {
|
|
229
|
-
const target = popup.querySelector(this.initialFocus);
|
|
230
|
-
if (target) {
|
|
231
|
-
target.focus();
|
|
232
|
-
return;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
const autoEl = queryComposedAutofocus(popup);
|
|
236
|
-
if (autoEl) {
|
|
237
|
-
autoEl.focus();
|
|
238
|
-
return;
|
|
239
|
-
}
|
|
240
|
-
const focusables = getComposedFocusableElements(popup);
|
|
241
|
-
if (focusables.length > 0) {
|
|
242
|
-
focusables[0].focus();
|
|
243
|
-
return;
|
|
244
|
-
}
|
|
245
|
-
popup.focus();
|
|
246
|
-
}
|
|
247
|
-
#restoreFocus() {
|
|
248
|
-
if (this.finalFocus) {
|
|
249
|
-
const target = document.querySelector(this.finalFocus);
|
|
250
|
-
target?.focus();
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
|
-
this.#previouslyFocused?.focus();
|
|
254
|
-
this.#previouslyFocused = undefined;
|
|
255
|
-
}
|
|
256
|
-
#handleKeyDown = (e) => {
|
|
257
|
-
if (e.key === "Escape") {
|
|
258
|
-
e.preventDefault();
|
|
259
|
-
e.stopPropagation();
|
|
260
|
-
this.#ctx.value?.closeDialog();
|
|
261
|
-
}
|
|
262
|
-
if (e.key === "Tab") {
|
|
263
|
-
this.#handleTabTrap(e);
|
|
264
|
-
}
|
|
265
|
-
};
|
|
266
|
-
#handleTabTrap(e) {
|
|
267
|
-
const popup = this.shadowRoot?.querySelector('[part="popup"]');
|
|
268
|
-
if (!popup)
|
|
269
|
-
return;
|
|
270
|
-
const focusables = getComposedFocusableElements(popup);
|
|
271
|
-
if (focusables.length === 0) {
|
|
272
|
-
e.preventDefault();
|
|
273
|
-
return;
|
|
274
|
-
}
|
|
275
|
-
const first = focusables[0];
|
|
276
|
-
const last = focusables[focusables.length - 1];
|
|
277
|
-
const isFirst = first.matches(":focus");
|
|
278
|
-
const isLast = last.matches(":focus");
|
|
279
|
-
const popupHasFocus = !focusables.some((el) => el.matches(":focus"));
|
|
280
|
-
if (e.shiftKey && (isFirst || popupHasFocus)) {
|
|
281
|
-
e.preventDefault();
|
|
282
|
-
last.focus();
|
|
283
|
-
}
|
|
284
|
-
else if (!e.shiftKey && isLast) {
|
|
285
|
-
e.preventDefault();
|
|
286
|
-
first.focus();
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
#handleBackdropClick = () => {
|
|
290
|
-
this.#ctx.value?.closeDialog();
|
|
291
|
-
};
|
|
292
|
-
willUpdate(changed) {
|
|
293
|
-
if (changed.has("width")) {
|
|
294
|
-
if (this.width)
|
|
295
|
-
this.style.setProperty("--popup-width", this.width);
|
|
296
|
-
else
|
|
297
|
-
this.style.removeProperty("--popup-width");
|
|
298
|
-
}
|
|
299
|
-
if (this.#mounted || this.keepMounted) {
|
|
300
|
-
this.setAttribute("mounted", "");
|
|
301
|
-
}
|
|
302
|
-
else {
|
|
303
|
-
this.removeAttribute("mounted");
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
render() {
|
|
307
|
-
const isOpen = this.#ctx.value?.open ?? false;
|
|
308
|
-
const titleId = this.#ctx.value?.titleId ?? "";
|
|
309
|
-
const descriptionId = this.#ctx.value?.descriptionId ?? "";
|
|
310
|
-
if (!this.#mounted && !this.keepMounted) {
|
|
311
|
-
return html ``;
|
|
312
|
-
}
|
|
313
|
-
return html `
|
|
314
|
-
<div
|
|
315
|
-
part="backdrop"
|
|
316
|
-
?data-open="${isOpen && !this.#endingStyle}"
|
|
317
|
-
?data-closed="${!isOpen || this.#endingStyle}"
|
|
318
|
-
?data-starting-style="${this.#startingStyle}"
|
|
319
|
-
?data-ending-style="${this.#endingStyle}"
|
|
320
|
-
@click="${this.#handleBackdropClick}"
|
|
321
|
-
></div>
|
|
322
|
-
<div
|
|
323
|
-
part="popup"
|
|
324
|
-
role="dialog"
|
|
325
|
-
aria-modal="true"
|
|
326
|
-
aria-labelledby="${titleId}"
|
|
327
|
-
aria-describedby="${descriptionId}"
|
|
328
|
-
?data-open="${isOpen && !this.#endingStyle}"
|
|
329
|
-
?data-closed="${!isOpen || this.#endingStyle}"
|
|
330
|
-
?data-starting-style="${this.#startingStyle}"
|
|
331
|
-
?data-ending-style="${this.#endingStyle}"
|
|
332
|
-
tabindex="-1"
|
|
333
|
-
@keydown="${this.#handleKeyDown}"
|
|
334
|
-
>
|
|
335
|
-
<h2 part="title" id="${titleId}"><slot name="title"></slot></h2>
|
|
336
|
-
<p part="description" id="${descriptionId}"><slot name="description"></slot></p>
|
|
337
|
-
<slot></slot>
|
|
338
|
-
</div>
|
|
339
|
-
`;
|
|
340
|
-
}
|
|
341
|
-
};
|
|
342
|
-
})();
|
|
343
|
-
export { DuiDialogPopup };
|
|
74
|
+
export class DuiDialogPopup extends DuiDialogPopupPrimitive {
|
|
75
|
+
static styles = [...DuiDialogPopupPrimitive.styles, styles];
|
|
76
|
+
}
|
|
77
|
+
customElements.define(DuiDialogPopup.tagName, DuiDialogPopup);
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
* `<dui-dialog-trigger>` — Behavioral wrapper that opens the dialog.
|
|
5
|
-
*
|
|
6
|
-
* Wraps slotted content and opens the dialog on click.
|
|
7
|
-
*
|
|
8
|
-
* @slot - Content that triggers the dialog (usually a `<dui-button>`).
|
|
9
|
-
*/
|
|
10
|
-
export declare class DuiDialogTrigger extends LitElement {
|
|
11
|
-
#private;
|
|
12
|
-
static tagName: "dui-dialog-trigger";
|
|
13
|
-
static styles: import("lit").CSSResult[];
|
|
14
|
-
render(): TemplateResult;
|
|
1
|
+
import { DuiDialogTriggerPrimitive } from "@deepfuture/dui-primitives/dialog";
|
|
2
|
+
import "../_install.js";
|
|
3
|
+
export declare class DuiDialogTrigger extends DuiDialogTriggerPrimitive {
|
|
15
4
|
}
|
package/dialog/dialog-trigger.js
CHANGED
|
@@ -1,52 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import { base } from "@deepfuture/dui-core/base";
|
|
5
|
-
import { dialogContext } from "./dialog-context.js";
|
|
6
|
-
const hostStyles = css `
|
|
7
|
-
:host {
|
|
8
|
-
display: contents;
|
|
9
|
-
}
|
|
10
|
-
`;
|
|
11
|
-
const componentStyles = css `
|
|
12
|
-
.Trigger {
|
|
13
|
-
display: contents;
|
|
14
|
-
}
|
|
15
|
-
`;
|
|
16
|
-
/**
|
|
17
|
-
* `<dui-dialog-trigger>` — Behavioral wrapper that opens the dialog.
|
|
18
|
-
*
|
|
19
|
-
* Wraps slotted content and opens the dialog on click.
|
|
20
|
-
*
|
|
21
|
-
* @slot - Content that triggers the dialog (usually a `<dui-button>`).
|
|
22
|
-
*/
|
|
23
|
-
export class DuiDialogTrigger extends LitElement {
|
|
24
|
-
static tagName = "dui-dialog-trigger";
|
|
25
|
-
static styles = [base, hostStyles, componentStyles];
|
|
26
|
-
#ctx = new ContextConsumer(this, {
|
|
27
|
-
context: dialogContext,
|
|
28
|
-
subscribe: true,
|
|
29
|
-
});
|
|
30
|
-
#handleClick = () => {
|
|
31
|
-
this.#ctx.value?.openDialog();
|
|
32
|
-
};
|
|
33
|
-
render() {
|
|
34
|
-
const isOpen = this.#ctx.value?.open ?? false;
|
|
35
|
-
const triggerId = this.#ctx.value?.triggerId ?? "";
|
|
36
|
-
const dialogId = this.#ctx.value?.dialogId ?? "";
|
|
37
|
-
return html `
|
|
38
|
-
<span
|
|
39
|
-
class="Trigger"
|
|
40
|
-
part="trigger"
|
|
41
|
-
id="${triggerId}"
|
|
42
|
-
aria-haspopup="dialog"
|
|
43
|
-
aria-expanded="${isOpen}"
|
|
44
|
-
aria-controls="${isOpen ? dialogId : ""}"
|
|
45
|
-
?data-popup-open="${isOpen}"
|
|
46
|
-
@click="${this.#handleClick}"
|
|
47
|
-
>
|
|
48
|
-
<slot></slot>
|
|
49
|
-
</span>
|
|
50
|
-
`;
|
|
51
|
-
}
|
|
1
|
+
import { DuiDialogTriggerPrimitive } from "@deepfuture/dui-primitives/dialog";
|
|
2
|
+
import "../_install.js";
|
|
3
|
+
export class DuiDialogTrigger extends DuiDialogTriggerPrimitive {
|
|
52
4
|
}
|
|
5
|
+
customElements.define(DuiDialogTrigger.tagName, DuiDialogTrigger);
|
package/dialog/dialog.d.ts
CHANGED
|
@@ -1,32 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
export type DialogOpenChangeDetail = {
|
|
5
|
-
open: boolean;
|
|
6
|
-
};
|
|
7
|
-
export declare const openChangeEvent: (detail: DialogOpenChangeDetail) => CustomEvent<DialogOpenChangeDetail>;
|
|
8
|
-
/**
|
|
9
|
-
* `<dui-dialog>` — Root element for the dialog compound component.
|
|
10
|
-
*
|
|
11
|
-
* Manages open/close state and provides context to child elements.
|
|
12
|
-
* Does not render visible DOM — uses `display: contents`.
|
|
13
|
-
*
|
|
14
|
-
* Unlike `<dui-alert-dialog>`, this dialog closes on backdrop click,
|
|
15
|
-
* following WAI-ARIA `dialog` semantics for non-critical modals.
|
|
16
|
-
*
|
|
17
|
-
* @slot - Default slot for trigger, popup, and other dialog parts.
|
|
18
|
-
* @fires open-change - Fired when the dialog opens or closes. Detail: { open: boolean }
|
|
19
|
-
*/
|
|
20
|
-
export declare class DuiDialog extends LitElement {
|
|
21
|
-
#private;
|
|
22
|
-
static tagName: "dui-dialog";
|
|
1
|
+
import { DuiDialogPrimitive } from "@deepfuture/dui-primitives/dialog";
|
|
2
|
+
import "../_install.js";
|
|
3
|
+
export declare class DuiDialog extends DuiDialogPrimitive {
|
|
23
4
|
static styles: import("lit").CSSResult[];
|
|
24
|
-
/** Controls the dialog open state (controlled mode). */
|
|
25
|
-
accessor open: boolean | undefined;
|
|
26
|
-
/** Initial open state for uncontrolled mode. */
|
|
27
|
-
accessor defaultOpen: boolean;
|
|
28
|
-
accessor _ctx: DialogContext;
|
|
29
|
-
connectedCallback(): void;
|
|
30
|
-
willUpdate(): void;
|
|
31
|
-
render(): TemplateResult;
|
|
32
5
|
}
|