@deepfuture/dui-components 0.0.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/accordion/accordion-context.d.ts +15 -0
- package/accordion/accordion-context.js +3 -0
- package/accordion/accordion-item.d.ts +22 -0
- package/accordion/accordion-item.js +254 -0
- package/accordion/accordion.d.ts +20 -0
- package/accordion/accordion.js +185 -0
- package/accordion/index.d.ts +3 -0
- package/accordion/index.js +2 -0
- package/accordion/register.d.ts +1 -0
- package/accordion/register.js +8 -0
- package/alert-dialog/alert-dialog-close.d.ts +15 -0
- package/alert-dialog/alert-dialog-close.js +35 -0
- package/alert-dialog/alert-dialog-context.d.ts +13 -0
- package/alert-dialog/alert-dialog-context.js +3 -0
- package/alert-dialog/alert-dialog-popup.d.ts +34 -0
- package/alert-dialog/alert-dialog-popup.js +260 -0
- package/alert-dialog/alert-dialog-trigger.d.ts +15 -0
- package/alert-dialog/alert-dialog-trigger.js +52 -0
- package/alert-dialog/alert-dialog.d.ts +30 -0
- package/alert-dialog/alert-dialog.js +97 -0
- package/alert-dialog/index.d.ts +6 -0
- package/alert-dialog/index.js +4 -0
- package/alert-dialog/register.d.ts +1 -0
- package/alert-dialog/register.js +16 -0
- package/all.d.ts +86 -0
- package/all.js +191 -0
- package/avatar/avatar.d.ts +41 -0
- package/avatar/avatar.js +188 -0
- package/avatar/index.d.ts +2 -0
- package/avatar/index.js +1 -0
- package/avatar/register.d.ts +1 -0
- package/avatar/register.js +4 -0
- package/badge/badge.d.ts +14 -0
- package/badge/badge.js +43 -0
- package/badge/index.d.ts +2 -0
- package/badge/index.js +1 -0
- package/badge/register.d.ts +1 -0
- package/badge/register.js +4 -0
- package/breadcrumb/breadcrumb-ellipsis.d.ts +14 -0
- package/breadcrumb/breadcrumb-ellipsis.js +39 -0
- package/breadcrumb/breadcrumb-item.d.ts +13 -0
- package/breadcrumb/breadcrumb-item.js +31 -0
- package/breadcrumb/breadcrumb-link.d.ts +14 -0
- package/breadcrumb/breadcrumb-link.js +32 -0
- package/breadcrumb/breadcrumb-page.d.ts +13 -0
- package/breadcrumb/breadcrumb-page.js +36 -0
- package/breadcrumb/breadcrumb-separator.d.ts +14 -0
- package/breadcrumb/breadcrumb-separator.js +36 -0
- package/breadcrumb/breadcrumb.d.ts +14 -0
- package/breadcrumb/breadcrumb.js +38 -0
- package/breadcrumb/index.d.ts +6 -0
- package/breadcrumb/index.js +6 -0
- package/breadcrumb/register.d.ts +1 -0
- package/breadcrumb/register.js +14 -0
- package/button/button.d.ts +38 -0
- package/button/button.js +143 -0
- package/button/index.d.ts +2 -0
- package/button/index.js +1 -0
- package/button/register.d.ts +1 -0
- package/button/register.js +4 -0
- package/calendar/calendar.d.ts +33 -0
- package/calendar/calendar.js +428 -0
- package/calendar/index.d.ts +1 -0
- package/calendar/index.js +1 -0
- package/calendar/register.d.ts +1 -0
- package/calendar/register.js +4 -0
- package/center/center.d.ts +14 -0
- package/center/center.js +37 -0
- package/center/index.d.ts +1 -0
- package/center/index.js +1 -0
- package/center/register.d.ts +1 -0
- package/center/register.js +4 -0
- package/checkbox/checkbox-group-context.d.ts +11 -0
- package/checkbox/checkbox-group-context.js +3 -0
- package/checkbox/checkbox-group.d.ts +34 -0
- package/checkbox/checkbox-group.js +128 -0
- package/checkbox/checkbox.d.ts +46 -0
- package/checkbox/checkbox.js +314 -0
- package/checkbox/index.d.ts +3 -0
- package/checkbox/index.js +2 -0
- package/checkbox/register.d.ts +1 -0
- package/checkbox/register.js +8 -0
- package/collapsible/collapsible.d.ts +22 -0
- package/collapsible/collapsible.js +227 -0
- package/collapsible/index.d.ts +1 -0
- package/collapsible/index.js +1 -0
- package/collapsible/register.d.ts +1 -0
- package/collapsible/register.js +4 -0
- package/combobox/combobox.d.ts +46 -0
- package/combobox/combobox.js +524 -0
- package/combobox/index.d.ts +2 -0
- package/combobox/index.js +1 -0
- package/combobox/register.d.ts +1 -0
- package/combobox/register.js +4 -0
- package/command/command-context.d.ts +30 -0
- package/command/command-context.js +3 -0
- package/command/command-empty.d.ts +10 -0
- package/command/command-empty.js +50 -0
- package/command/command-group.d.ts +15 -0
- package/command/command-group.js +79 -0
- package/command/command-input.d.ts +13 -0
- package/command/command-input.js +106 -0
- package/command/command-item.d.ts +20 -0
- package/command/command-item.js +175 -0
- package/command/command-list.d.ts +9 -0
- package/command/command-list.js +43 -0
- package/command/command-score.d.ts +6 -0
- package/command/command-score.js +31 -0
- package/command/command-separator.d.ts +7 -0
- package/command/command-separator.js +15 -0
- package/command/command-shortcut.d.ts +7 -0
- package/command/command-shortcut.js +16 -0
- package/command/command.d.ts +25 -0
- package/command/command.js +278 -0
- package/command/index.d.ts +10 -0
- package/command/index.js +9 -0
- package/command/register.d.ts +1 -0
- package/command/register.js +22 -0
- package/data-table/data-table.d.ts +59 -0
- package/data-table/data-table.js +416 -0
- package/data-table/index.d.ts +2 -0
- package/data-table/index.js +1 -0
- package/data-table/register.d.ts +1 -0
- package/data-table/register.js +4 -0
- package/dialog/dialog-close.d.ts +15 -0
- package/dialog/dialog-close.js +35 -0
- package/dialog/dialog-context.d.ts +13 -0
- package/dialog/dialog-context.js +3 -0
- package/dialog/dialog-popup.d.ts +36 -0
- package/dialog/dialog-popup.js +277 -0
- package/dialog/dialog-trigger.d.ts +15 -0
- package/dialog/dialog-trigger.js +52 -0
- package/dialog/dialog.d.ts +30 -0
- package/dialog/dialog.js +97 -0
- package/dialog/index.d.ts +6 -0
- package/dialog/index.js +4 -0
- package/dialog/register.d.ts +1 -0
- package/dialog/register.js +16 -0
- package/dropzone/dropzone.d.ts +74 -0
- package/dropzone/dropzone.js +357 -0
- package/dropzone/index.d.ts +2 -0
- package/dropzone/index.js +1 -0
- package/dropzone/register.d.ts +1 -0
- package/dropzone/register.js +4 -0
- package/field/field-context.d.ts +20 -0
- package/field/field-context.js +2 -0
- package/field/index.d.ts +2 -0
- package/field/index.js +1 -0
- package/global.d.ts +189 -0
- package/hstack/hstack.d.ts +25 -0
- package/hstack/hstack.js +141 -0
- package/hstack/index.d.ts +2 -0
- package/hstack/index.js +1 -0
- package/hstack/register.d.ts +1 -0
- package/hstack/register.js +4 -0
- package/icon/icon.d.ts +16 -0
- package/icon/icon.js +34 -0
- package/icon/index.d.ts +1 -0
- package/icon/index.js +1 -0
- package/icon/register.d.ts +1 -0
- package/icon/register.js +4 -0
- package/input/index.d.ts +1 -0
- package/input/index.js +1 -0
- package/input/input.d.ts +47 -0
- package/input/input.js +205 -0
- package/input/register.d.ts +1 -0
- package/input/register.js +4 -0
- package/link/index.d.ts +1 -0
- package/link/index.js +1 -0
- package/link/link.d.ts +27 -0
- package/link/link.js +57 -0
- package/link/register.d.ts +1 -0
- package/link/register.js +4 -0
- package/menu/index.d.ts +2 -0
- package/menu/index.js +2 -0
- package/menu/menu-item.d.ts +17 -0
- package/menu/menu-item.js +62 -0
- package/menu/menu.d.ts +15 -0
- package/menu/menu.js +228 -0
- package/menu/register.d.ts +1 -0
- package/menu/register.js +8 -0
- package/menubar/index.d.ts +2 -0
- package/menubar/index.js +1 -0
- package/menubar/menubar-context.d.ts +9 -0
- package/menubar/menubar-context.js +2 -0
- package/menubar/menubar.d.ts +19 -0
- package/menubar/menubar.js +130 -0
- package/menubar/register.d.ts +1 -0
- package/menubar/register.js +4 -0
- package/number-field/index.d.ts +1 -0
- package/number-field/index.js +1 -0
- package/number-field/number-field.d.ts +34 -0
- package/number-field/number-field.js +326 -0
- package/number-field/register.d.ts +1 -0
- package/number-field/register.js +4 -0
- package/package.json +217 -0
- package/page-inset/index.d.ts +1 -0
- package/page-inset/index.js +1 -0
- package/page-inset/page-inset.d.ts +28 -0
- package/page-inset/page-inset.js +103 -0
- package/page-inset/register.d.ts +1 -0
- package/page-inset/register.js +4 -0
- package/popover/index.d.ts +6 -0
- package/popover/index.js +4 -0
- package/popover/popover-close.d.ts +13 -0
- package/popover/popover-close.js +33 -0
- package/popover/popover-context.d.ts +17 -0
- package/popover/popover-context.js +3 -0
- package/popover/popover-popup.d.ts +20 -0
- package/popover/popover-popup.js +176 -0
- package/popover/popover-trigger.d.ts +13 -0
- package/popover/popover-trigger.js +57 -0
- package/popover/popover.d.ts +30 -0
- package/popover/popover.js +140 -0
- package/popover/register.d.ts +1 -0
- package/popover/register.js +16 -0
- package/portal/index.d.ts +2 -0
- package/portal/index.js +1 -0
- package/portal/portal.d.ts +29 -0
- package/portal/portal.js +115 -0
- package/portal/register.d.ts +1 -0
- package/portal/register.js +4 -0
- package/preview-card/index.d.ts +5 -0
- package/preview-card/index.js +3 -0
- package/preview-card/preview-card-context.d.ts +16 -0
- package/preview-card/preview-card-context.js +3 -0
- package/preview-card/preview-card-popup.d.ts +16 -0
- package/preview-card/preview-card-popup.js +167 -0
- package/preview-card/preview-card-trigger.d.ts +13 -0
- package/preview-card/preview-card-trigger.js +75 -0
- package/preview-card/preview-card.d.ts +34 -0
- package/preview-card/preview-card.js +164 -0
- package/preview-card/register.d.ts +1 -0
- package/preview-card/register.js +12 -0
- package/progress/index.d.ts +1 -0
- package/progress/index.js +1 -0
- package/progress/progress.d.ts +19 -0
- package/progress/progress.js +94 -0
- package/progress/register.d.ts +1 -0
- package/progress/register.js +4 -0
- package/radio/index.d.ts +3 -0
- package/radio/index.js +2 -0
- package/radio/radio-group-context.d.ts +11 -0
- package/radio/radio-group-context.js +2 -0
- package/radio/radio-group.d.ts +37 -0
- package/radio/radio-group.js +135 -0
- package/radio/radio.d.ts +27 -0
- package/radio/radio.js +204 -0
- package/radio/register.d.ts +1 -0
- package/radio/register.js +8 -0
- package/scroll-area/index.d.ts +1 -0
- package/scroll-area/index.js +1 -0
- package/scroll-area/register.d.ts +1 -0
- package/scroll-area/register.js +4 -0
- package/scroll-area/scroll-area.d.ts +38 -0
- package/scroll-area/scroll-area.js +453 -0
- package/select/index.d.ts +2 -0
- package/select/index.js +1 -0
- package/select/register.d.ts +1 -0
- package/select/register.js +4 -0
- package/select/select.d.ts +36 -0
- package/select/select.js +404 -0
- package/separator/index.d.ts +1 -0
- package/separator/index.js +1 -0
- package/separator/register.d.ts +1 -0
- package/separator/register.js +4 -0
- package/separator/separator.d.ts +12 -0
- package/separator/separator.js +50 -0
- package/sidebar/index.d.ts +16 -0
- package/sidebar/index.js +13 -0
- package/sidebar/register.d.ts +1 -0
- package/sidebar/register.js +52 -0
- package/sidebar/sidebar-content.d.ts +14 -0
- package/sidebar/sidebar-content.js +30 -0
- package/sidebar/sidebar-context.d.ts +15 -0
- package/sidebar/sidebar-context.js +3 -0
- package/sidebar/sidebar-footer.d.ts +12 -0
- package/sidebar/sidebar-footer.js +21 -0
- package/sidebar/sidebar-group-label.d.ts +17 -0
- package/sidebar/sidebar-group-label.js +49 -0
- package/sidebar/sidebar-group.d.ts +15 -0
- package/sidebar/sidebar-group.js +29 -0
- package/sidebar/sidebar-header.d.ts +12 -0
- package/sidebar/sidebar-header.js +21 -0
- package/sidebar/sidebar-inset.d.ts +15 -0
- package/sidebar/sidebar-inset.js +29 -0
- package/sidebar/sidebar-menu-button.d.ts +31 -0
- package/sidebar/sidebar-menu-button.js +201 -0
- package/sidebar/sidebar-menu-item.d.ts +12 -0
- package/sidebar/sidebar-menu-item.js +20 -0
- package/sidebar/sidebar-menu.d.ts +14 -0
- package/sidebar/sidebar-menu.js +30 -0
- package/sidebar/sidebar-provider.d.ts +34 -0
- package/sidebar/sidebar-provider.js +157 -0
- package/sidebar/sidebar-separator.d.ts +12 -0
- package/sidebar/sidebar-separator.js +24 -0
- package/sidebar/sidebar-trigger.d.ts +16 -0
- package/sidebar/sidebar-trigger.js +50 -0
- package/sidebar/sidebar.d.ts +21 -0
- package/sidebar/sidebar.js +228 -0
- package/slider/index.d.ts +1 -0
- package/slider/index.js +1 -0
- package/slider/register.d.ts +1 -0
- package/slider/register.js +4 -0
- package/slider/slider.d.ts +37 -0
- package/slider/slider.js +268 -0
- package/spinner/index.d.ts +1 -0
- package/spinner/index.js +1 -0
- package/spinner/register.d.ts +1 -0
- package/spinner/register.js +4 -0
- package/spinner/spinner.d.ts +18 -0
- package/spinner/spinner.js +138 -0
- package/switch/index.d.ts +1 -0
- package/switch/index.js +1 -0
- package/switch/register.d.ts +1 -0
- package/switch/register.js +4 -0
- package/switch/switch.d.ts +29 -0
- package/switch/switch.js +201 -0
- package/tabs/index.d.ts +6 -0
- package/tabs/index.js +5 -0
- package/tabs/register.d.ts +1 -0
- package/tabs/register.js +10 -0
- package/tabs/tab.d.ts +16 -0
- package/tabs/tab.js +98 -0
- package/tabs/tabs-context.d.ts +8 -0
- package/tabs/tabs-context.js +2 -0
- package/tabs/tabs-indicator.d.ts +11 -0
- package/tabs/tabs-indicator.js +27 -0
- package/tabs/tabs-list.d.ts +17 -0
- package/tabs/tabs-list.js +85 -0
- package/tabs/tabs-panel.d.ts +18 -0
- package/tabs/tabs-panel.js +85 -0
- package/tabs/tabs.d.ts +24 -0
- package/tabs/tabs.js +111 -0
- package/textarea/index.d.ts +2 -0
- package/textarea/index.js +1 -0
- package/textarea/register.d.ts +1 -0
- package/textarea/register.js +4 -0
- package/textarea/textarea.d.ts +37 -0
- package/textarea/textarea.js +170 -0
- package/toggle/index.d.ts +3 -0
- package/toggle/index.js +2 -0
- package/toggle/register.d.ts +1 -0
- package/toggle/register.js +8 -0
- package/toggle/toggle-group-context.d.ts +9 -0
- package/toggle/toggle-group-context.js +2 -0
- package/toggle/toggle-group.d.ts +27 -0
- package/toggle/toggle-group.js +163 -0
- package/toggle/toggle.d.ts +25 -0
- package/toggle/toggle.js +124 -0
- package/toolbar/index.d.ts +1 -0
- package/toolbar/index.js +1 -0
- package/toolbar/register.d.ts +1 -0
- package/toolbar/register.js +4 -0
- package/toolbar/toolbar.d.ts +15 -0
- package/toolbar/toolbar.js +89 -0
- package/tooltip/index.d.ts +5 -0
- package/tooltip/index.js +3 -0
- package/tooltip/register.d.ts +1 -0
- package/tooltip/register.js +12 -0
- package/tooltip/tooltip-context.d.ts +17 -0
- package/tooltip/tooltip-context.js +3 -0
- package/tooltip/tooltip-popup.d.ts +16 -0
- package/tooltip/tooltip-popup.js +162 -0
- package/tooltip/tooltip-trigger.d.ts +15 -0
- package/tooltip/tooltip-trigger.js +110 -0
- package/tooltip/tooltip.d.ts +36 -0
- package/tooltip/tooltip.js +176 -0
- package/trunc/index.d.ts +1 -0
- package/trunc/index.js +1 -0
- package/trunc/register.d.ts +1 -0
- package/trunc/register.js +4 -0
- package/trunc/trunc.d.ts +19 -0
- package/trunc/trunc.js +68 -0
- package/vstack/index.d.ts +1 -0
- package/vstack/index.js +1 -0
- package/vstack/register.d.ts +1 -0
- package/vstack/register.js +4 -0
- package/vstack/vstack.d.ts +17 -0
- package/vstack/vstack.js +83 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/accordion */
|
|
2
|
+
export type AccordionContext = {
|
|
3
|
+
readonly openValues: readonly string[];
|
|
4
|
+
readonly disabled: boolean;
|
|
5
|
+
readonly orientation: "vertical" | "horizontal";
|
|
6
|
+
readonly loopFocus: boolean;
|
|
7
|
+
readonly keepMounted: boolean;
|
|
8
|
+
readonly toggle: (value: string) => void;
|
|
9
|
+
readonly registerItem: (value: string, el: HTMLElement) => void;
|
|
10
|
+
readonly unregisterItem: (value: string) => void;
|
|
11
|
+
readonly focusItem: (value: string, direction: "next" | "prev" | "first" | "last") => void;
|
|
12
|
+
};
|
|
13
|
+
export declare const accordionContext: {
|
|
14
|
+
__context__: AccordionContext;
|
|
15
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/accordion */
|
|
2
|
+
import { LitElement, type TemplateResult } from "lit";
|
|
3
|
+
import { type AccordionContext } from "./accordion-context.js";
|
|
4
|
+
export declare const openChangeEvent: (detail: {
|
|
5
|
+
value: string;
|
|
6
|
+
open: boolean;
|
|
7
|
+
}) => CustomEvent<{
|
|
8
|
+
value: string;
|
|
9
|
+
open: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
export declare class DuiAccordionItem extends LitElement {
|
|
12
|
+
#private;
|
|
13
|
+
static tagName: "dui-accordion-item";
|
|
14
|
+
static styles: import("lit").CSSResult[];
|
|
15
|
+
accessor value: string;
|
|
16
|
+
accessor disabled: boolean;
|
|
17
|
+
accessor _ctx: AccordionContext;
|
|
18
|
+
connectedCallback(): void;
|
|
19
|
+
disconnectedCallback(): void;
|
|
20
|
+
willUpdate(): void;
|
|
21
|
+
render(): TemplateResult;
|
|
22
|
+
}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/accordion */
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
import { css, html, LitElement, nothing } from "lit";
|
|
9
|
+
import { property } from "lit/decorators.js";
|
|
10
|
+
import { consume } from "@lit/context";
|
|
11
|
+
import { base } from "@deepfuture/dui-core/base";
|
|
12
|
+
import { customEvent } from "@deepfuture/dui-core/event";
|
|
13
|
+
import { accordionContext, } from "./accordion-context.js";
|
|
14
|
+
export const openChangeEvent = customEvent("open-change", { bubbles: true, composed: true });
|
|
15
|
+
const styles = css `
|
|
16
|
+
:host {
|
|
17
|
+
display: block;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
[part="trigger"] {
|
|
21
|
+
display: flex;
|
|
22
|
+
width: 100%;
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: space-between;
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
user-select: none;
|
|
27
|
+
border: none;
|
|
28
|
+
background: none;
|
|
29
|
+
text-align: left;
|
|
30
|
+
outline: none;
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
transition-property: background, box-shadow, filter, transform;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
[part="trigger"][data-disabled] {
|
|
36
|
+
cursor: default;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
[part="indicator"] {
|
|
40
|
+
flex-shrink: 0;
|
|
41
|
+
transition-property: transform;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
[part="panel"] {
|
|
45
|
+
overflow: hidden;
|
|
46
|
+
transition-property: height;
|
|
47
|
+
}
|
|
48
|
+
`;
|
|
49
|
+
// Inline chevron-down SVG to avoid icon component dependency
|
|
50
|
+
const chevronSvg = html `<svg
|
|
51
|
+
part="indicator"
|
|
52
|
+
width="16"
|
|
53
|
+
height="16"
|
|
54
|
+
viewBox="0 0 24 24"
|
|
55
|
+
fill="none"
|
|
56
|
+
stroke="currentColor"
|
|
57
|
+
stroke-width="2"
|
|
58
|
+
stroke-linecap="round"
|
|
59
|
+
stroke-linejoin="round"
|
|
60
|
+
>
|
|
61
|
+
<path d="m6 9 6 6 6-6" />
|
|
62
|
+
</svg>`;
|
|
63
|
+
export class DuiAccordionItem extends LitElement {
|
|
64
|
+
static { this.tagName = "dui-accordion-item"; }
|
|
65
|
+
static { this.styles = [base, styles]; }
|
|
66
|
+
#value_accessor_storage = "";
|
|
67
|
+
get value() { return this.#value_accessor_storage; }
|
|
68
|
+
set value(value) { this.#value_accessor_storage = value; }
|
|
69
|
+
#disabled_accessor_storage = false;
|
|
70
|
+
get disabled() { return this.#disabled_accessor_storage; }
|
|
71
|
+
set disabled(value) { this.#disabled_accessor_storage = value; }
|
|
72
|
+
#_ctx_accessor_storage;
|
|
73
|
+
get _ctx() { return this.#_ctx_accessor_storage; }
|
|
74
|
+
set _ctx(value) { this.#_ctx_accessor_storage = value; }
|
|
75
|
+
#starting_accessor_storage = false;
|
|
76
|
+
get #starting() { return this.#starting_accessor_storage; }
|
|
77
|
+
set #starting(value) { this.#starting_accessor_storage = value; }
|
|
78
|
+
#ending_accessor_storage = false;
|
|
79
|
+
get #ending() { return this.#ending_accessor_storage; }
|
|
80
|
+
set #ending(value) { this.#ending_accessor_storage = value; }
|
|
81
|
+
#panelHeight_accessor_storage = "0";
|
|
82
|
+
get #panelHeight() { return this.#panelHeight_accessor_storage; }
|
|
83
|
+
set #panelHeight(value) { this.#panelHeight_accessor_storage = value; }
|
|
84
|
+
#visible_accessor_storage = false;
|
|
85
|
+
get #visible() { return this.#visible_accessor_storage; }
|
|
86
|
+
set #visible(value) { this.#visible_accessor_storage = value; }
|
|
87
|
+
#prevOpen = undefined;
|
|
88
|
+
#animGen = 0;
|
|
89
|
+
get #open() {
|
|
90
|
+
return this._ctx?.openValues.includes(this.value) ?? false;
|
|
91
|
+
}
|
|
92
|
+
get #isDisabled() {
|
|
93
|
+
return this.disabled || this._ctx?.disabled;
|
|
94
|
+
}
|
|
95
|
+
get #triggerId() {
|
|
96
|
+
return `dui-trigger-${this.value}`;
|
|
97
|
+
}
|
|
98
|
+
get #panelId() {
|
|
99
|
+
return `dui-panel-${this.value}`;
|
|
100
|
+
}
|
|
101
|
+
connectedCallback() {
|
|
102
|
+
super.connectedCallback();
|
|
103
|
+
this._ctx?.registerItem(this.value, this);
|
|
104
|
+
}
|
|
105
|
+
disconnectedCallback() {
|
|
106
|
+
super.disconnectedCallback();
|
|
107
|
+
this._ctx?.unregisterItem(this.value);
|
|
108
|
+
}
|
|
109
|
+
willUpdate() {
|
|
110
|
+
const isOpen = this.#open;
|
|
111
|
+
if (this.#prevOpen === undefined) {
|
|
112
|
+
this.#visible = isOpen;
|
|
113
|
+
this.#panelHeight = isOpen ? "auto" : "0";
|
|
114
|
+
}
|
|
115
|
+
else if (this.#prevOpen !== isOpen) {
|
|
116
|
+
if (isOpen) {
|
|
117
|
+
this.#startOpenAnimation();
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
this.#startCloseAnimation();
|
|
121
|
+
}
|
|
122
|
+
this.dispatchEvent(openChangeEvent({ value: this.value, open: isOpen }));
|
|
123
|
+
}
|
|
124
|
+
this.#prevOpen = isOpen;
|
|
125
|
+
}
|
|
126
|
+
#startOpenAnimation() {
|
|
127
|
+
const gen = ++this.#animGen;
|
|
128
|
+
this.#ending = false;
|
|
129
|
+
this.#visible = true;
|
|
130
|
+
this.#starting = true;
|
|
131
|
+
this.#panelHeight = "0";
|
|
132
|
+
requestAnimationFrame(() => {
|
|
133
|
+
if (this.#animGen !== gen)
|
|
134
|
+
return;
|
|
135
|
+
const panel = this.shadowRoot?.querySelector("[part='panel']");
|
|
136
|
+
if (panel) {
|
|
137
|
+
this.#panelHeight = `${panel.scrollHeight}px`;
|
|
138
|
+
}
|
|
139
|
+
this.#starting = false;
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
#startCloseAnimation() {
|
|
143
|
+
const gen = ++this.#animGen;
|
|
144
|
+
this.#starting = false;
|
|
145
|
+
const panel = this.shadowRoot?.querySelector("[part='panel']");
|
|
146
|
+
if (panel) {
|
|
147
|
+
this.#panelHeight = `${panel.scrollHeight}px`;
|
|
148
|
+
}
|
|
149
|
+
requestAnimationFrame(() => {
|
|
150
|
+
if (this.#animGen !== gen)
|
|
151
|
+
return;
|
|
152
|
+
this.#ending = true;
|
|
153
|
+
this.#panelHeight = "0";
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
#onTransitionEnd = (event) => {
|
|
157
|
+
if (event.propertyName !== "height")
|
|
158
|
+
return;
|
|
159
|
+
if (this.#ending) {
|
|
160
|
+
this.#ending = false;
|
|
161
|
+
if (!this._ctx?.keepMounted) {
|
|
162
|
+
this.#visible = false;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
else if (this.#open) {
|
|
166
|
+
this.#panelHeight = "auto";
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
#onClick = () => {
|
|
170
|
+
if (this.#isDisabled)
|
|
171
|
+
return;
|
|
172
|
+
this._ctx.toggle(this.value);
|
|
173
|
+
};
|
|
174
|
+
#onKeyDown = (event) => {
|
|
175
|
+
if (this.#isDisabled)
|
|
176
|
+
return;
|
|
177
|
+
const isVertical = this._ctx.orientation === "vertical";
|
|
178
|
+
const nextKey = isVertical ? "ArrowDown" : "ArrowRight";
|
|
179
|
+
const prevKey = isVertical ? "ArrowUp" : "ArrowLeft";
|
|
180
|
+
switch (event.key) {
|
|
181
|
+
case nextKey:
|
|
182
|
+
event.preventDefault();
|
|
183
|
+
this._ctx.focusItem(this.value, "next");
|
|
184
|
+
break;
|
|
185
|
+
case prevKey:
|
|
186
|
+
event.preventDefault();
|
|
187
|
+
this._ctx.focusItem(this.value, "prev");
|
|
188
|
+
break;
|
|
189
|
+
case "Home":
|
|
190
|
+
event.preventDefault();
|
|
191
|
+
this._ctx.focusItem(this.value, "first");
|
|
192
|
+
break;
|
|
193
|
+
case "End":
|
|
194
|
+
event.preventDefault();
|
|
195
|
+
this._ctx.focusItem(this.value, "last");
|
|
196
|
+
break;
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
render() {
|
|
200
|
+
const shouldRender = this.#visible || this._ctx?.keepMounted;
|
|
201
|
+
return html `
|
|
202
|
+
<div
|
|
203
|
+
part="item"
|
|
204
|
+
?data-open=${this.#open}
|
|
205
|
+
?data-disabled=${this.#isDisabled}
|
|
206
|
+
>
|
|
207
|
+
<h3 part="header">
|
|
208
|
+
<button
|
|
209
|
+
part="trigger"
|
|
210
|
+
id=${this.#triggerId}
|
|
211
|
+
aria-expanded=${this.#open}
|
|
212
|
+
aria-controls=${this.#panelId}
|
|
213
|
+
?data-open=${this.#open}
|
|
214
|
+
?data-disabled=${this.#isDisabled}
|
|
215
|
+
@click=${this.#onClick}
|
|
216
|
+
@keydown=${this.#onKeyDown}
|
|
217
|
+
>
|
|
218
|
+
<slot name="trigger"></slot>
|
|
219
|
+
${chevronSvg}
|
|
220
|
+
</button>
|
|
221
|
+
</h3>
|
|
222
|
+
${shouldRender
|
|
223
|
+
? html `
|
|
224
|
+
<div
|
|
225
|
+
part="panel"
|
|
226
|
+
id=${this.#panelId}
|
|
227
|
+
role="region"
|
|
228
|
+
aria-labelledby=${this.#triggerId}
|
|
229
|
+
style="height: ${this.#panelHeight}"
|
|
230
|
+
?data-open=${this.#open && !this.#starting}
|
|
231
|
+
?data-starting-style=${this.#starting}
|
|
232
|
+
?data-ending-style=${this.#ending}
|
|
233
|
+
?hidden=${!this.#visible && !this.#ending}
|
|
234
|
+
@transitionend=${this.#onTransitionEnd}
|
|
235
|
+
>
|
|
236
|
+
<div part="content">
|
|
237
|
+
<slot></slot>
|
|
238
|
+
</div>
|
|
239
|
+
</div>
|
|
240
|
+
`
|
|
241
|
+
: nothing}
|
|
242
|
+
</div>
|
|
243
|
+
`;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
__decorate([
|
|
247
|
+
property({ type: String })
|
|
248
|
+
], DuiAccordionItem.prototype, "value", null);
|
|
249
|
+
__decorate([
|
|
250
|
+
property({ type: Boolean })
|
|
251
|
+
], DuiAccordionItem.prototype, "disabled", null);
|
|
252
|
+
__decorate([
|
|
253
|
+
consume({ context: accordionContext, subscribe: true })
|
|
254
|
+
], DuiAccordionItem.prototype, "_ctx", null);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/accordion */
|
|
2
|
+
import { LitElement, type TemplateResult } from "lit";
|
|
3
|
+
import { type AccordionContext } from "./accordion-context.js";
|
|
4
|
+
export declare const valueChangeEvent: (detail: string[]) => CustomEvent<string[]>;
|
|
5
|
+
export declare class DuiAccordion extends LitElement {
|
|
6
|
+
#private;
|
|
7
|
+
static tagName: "dui-accordion";
|
|
8
|
+
static styles: import("lit").CSSResult[];
|
|
9
|
+
accessor value: string[] | undefined;
|
|
10
|
+
accessor defaultValue: string[];
|
|
11
|
+
accessor disabled: boolean;
|
|
12
|
+
accessor multiple: boolean;
|
|
13
|
+
accessor loopFocus: boolean;
|
|
14
|
+
accessor orientation: "vertical" | "horizontal";
|
|
15
|
+
accessor keepMounted: boolean;
|
|
16
|
+
accessor _ctx: AccordionContext;
|
|
17
|
+
connectedCallback(): void;
|
|
18
|
+
willUpdate(): void;
|
|
19
|
+
render(): TemplateResult;
|
|
20
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/accordion */
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
import { css, html, LitElement } from "lit";
|
|
9
|
+
import { property, state } from "lit/decorators.js";
|
|
10
|
+
import { provide } from "@lit/context";
|
|
11
|
+
import { base } from "@deepfuture/dui-core/base";
|
|
12
|
+
import { customEvent } from "@deepfuture/dui-core/event";
|
|
13
|
+
import { accordionContext, } from "./accordion-context.js";
|
|
14
|
+
export const valueChangeEvent = customEvent("value-change", {
|
|
15
|
+
bubbles: true,
|
|
16
|
+
composed: true,
|
|
17
|
+
});
|
|
18
|
+
const styles = css `
|
|
19
|
+
:host {
|
|
20
|
+
display: block;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
[part="root"] {
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
export class DuiAccordion extends LitElement {
|
|
29
|
+
static { this.tagName = "dui-accordion"; }
|
|
30
|
+
static { this.styles = [base, styles]; }
|
|
31
|
+
#value_accessor_storage = undefined;
|
|
32
|
+
get value() { return this.#value_accessor_storage; }
|
|
33
|
+
set value(value) { this.#value_accessor_storage = value; }
|
|
34
|
+
#defaultValue_accessor_storage = [];
|
|
35
|
+
get defaultValue() { return this.#defaultValue_accessor_storage; }
|
|
36
|
+
set defaultValue(value) { this.#defaultValue_accessor_storage = value; }
|
|
37
|
+
#disabled_accessor_storage = false;
|
|
38
|
+
get disabled() { return this.#disabled_accessor_storage; }
|
|
39
|
+
set disabled(value) { this.#disabled_accessor_storage = value; }
|
|
40
|
+
#multiple_accessor_storage = false;
|
|
41
|
+
get multiple() { return this.#multiple_accessor_storage; }
|
|
42
|
+
set multiple(value) { this.#multiple_accessor_storage = value; }
|
|
43
|
+
#loopFocus_accessor_storage = true;
|
|
44
|
+
get loopFocus() { return this.#loopFocus_accessor_storage; }
|
|
45
|
+
set loopFocus(value) { this.#loopFocus_accessor_storage = value; }
|
|
46
|
+
#orientation_accessor_storage = "vertical";
|
|
47
|
+
get orientation() { return this.#orientation_accessor_storage; }
|
|
48
|
+
set orientation(value) { this.#orientation_accessor_storage = value; }
|
|
49
|
+
#keepMounted_accessor_storage = false;
|
|
50
|
+
get keepMounted() { return this.#keepMounted_accessor_storage; }
|
|
51
|
+
set keepMounted(value) { this.#keepMounted_accessor_storage = value; }
|
|
52
|
+
#internalOpenValues_accessor_storage = [];
|
|
53
|
+
get #internalOpenValues() { return this.#internalOpenValues_accessor_storage; }
|
|
54
|
+
set #internalOpenValues(value) { this.#internalOpenValues_accessor_storage = value; }
|
|
55
|
+
#itemRegistry = new Map();
|
|
56
|
+
#itemOrder = [];
|
|
57
|
+
#getOpenValues = () => this.value ?? this.#internalOpenValues;
|
|
58
|
+
#toggle = (value) => {
|
|
59
|
+
const current = [...this.#getOpenValues()];
|
|
60
|
+
const index = current.indexOf(value);
|
|
61
|
+
let next;
|
|
62
|
+
if (index >= 0) {
|
|
63
|
+
next = current.filter((v) => v !== value);
|
|
64
|
+
}
|
|
65
|
+
else if (this.multiple) {
|
|
66
|
+
next = [...current, value];
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
next = [value];
|
|
70
|
+
}
|
|
71
|
+
if (this.value === undefined) {
|
|
72
|
+
this.#internalOpenValues = next;
|
|
73
|
+
}
|
|
74
|
+
this.dispatchEvent(valueChangeEvent(next));
|
|
75
|
+
};
|
|
76
|
+
#registerItem = (value, el) => {
|
|
77
|
+
this.#itemRegistry.set(value, el);
|
|
78
|
+
if (!this.#itemOrder.includes(value)) {
|
|
79
|
+
this.#itemOrder.push(value);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
#unregisterItem = (value) => {
|
|
83
|
+
this.#itemRegistry.delete(value);
|
|
84
|
+
this.#itemOrder = this.#itemOrder.filter((v) => v !== value);
|
|
85
|
+
};
|
|
86
|
+
#focusItem = (value, direction) => {
|
|
87
|
+
const currentIndex = this.#itemOrder.indexOf(value);
|
|
88
|
+
if (currentIndex === -1)
|
|
89
|
+
return;
|
|
90
|
+
const len = this.#itemOrder.length;
|
|
91
|
+
let targetIndex;
|
|
92
|
+
switch (direction) {
|
|
93
|
+
case "next":
|
|
94
|
+
if (currentIndex < len - 1) {
|
|
95
|
+
targetIndex = currentIndex + 1;
|
|
96
|
+
}
|
|
97
|
+
else if (this.loopFocus) {
|
|
98
|
+
targetIndex = 0;
|
|
99
|
+
}
|
|
100
|
+
break;
|
|
101
|
+
case "prev":
|
|
102
|
+
if (currentIndex > 0) {
|
|
103
|
+
targetIndex = currentIndex - 1;
|
|
104
|
+
}
|
|
105
|
+
else if (this.loopFocus) {
|
|
106
|
+
targetIndex = len - 1;
|
|
107
|
+
}
|
|
108
|
+
break;
|
|
109
|
+
case "first":
|
|
110
|
+
targetIndex = 0;
|
|
111
|
+
break;
|
|
112
|
+
case "last":
|
|
113
|
+
targetIndex = len - 1;
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
if (targetIndex !== undefined) {
|
|
117
|
+
const targetValue = this.#itemOrder[targetIndex];
|
|
118
|
+
const targetEl = this.#itemRegistry.get(targetValue);
|
|
119
|
+
const trigger = targetEl?.shadowRoot?.querySelector("[part='trigger']");
|
|
120
|
+
trigger?.focus();
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
#_ctx_accessor_storage = this.#buildContext();
|
|
124
|
+
get _ctx() { return this.#_ctx_accessor_storage; }
|
|
125
|
+
set _ctx(value) { this.#_ctx_accessor_storage = value; }
|
|
126
|
+
#buildContext() {
|
|
127
|
+
return {
|
|
128
|
+
openValues: this.#getOpenValues(),
|
|
129
|
+
disabled: this.disabled,
|
|
130
|
+
orientation: this.orientation,
|
|
131
|
+
loopFocus: this.loopFocus,
|
|
132
|
+
keepMounted: this.keepMounted,
|
|
133
|
+
toggle: this.#toggle,
|
|
134
|
+
registerItem: this.#registerItem,
|
|
135
|
+
unregisterItem: this.#unregisterItem,
|
|
136
|
+
focusItem: this.#focusItem,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
connectedCallback() {
|
|
140
|
+
super.connectedCallback();
|
|
141
|
+
if (this.value === undefined && this.defaultValue.length > 0) {
|
|
142
|
+
this.#internalOpenValues = [...this.defaultValue];
|
|
143
|
+
}
|
|
144
|
+
this._ctx = this.#buildContext();
|
|
145
|
+
}
|
|
146
|
+
willUpdate() {
|
|
147
|
+
this._ctx = this.#buildContext();
|
|
148
|
+
}
|
|
149
|
+
render() {
|
|
150
|
+
return html `
|
|
151
|
+
<div
|
|
152
|
+
part="root"
|
|
153
|
+
data-orientation=${this.orientation}
|
|
154
|
+
?data-disabled=${this.disabled}
|
|
155
|
+
>
|
|
156
|
+
<slot></slot>
|
|
157
|
+
</div>
|
|
158
|
+
`;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
__decorate([
|
|
162
|
+
property({ type: Array })
|
|
163
|
+
], DuiAccordion.prototype, "value", null);
|
|
164
|
+
__decorate([
|
|
165
|
+
property({ type: Array, attribute: "default-value" })
|
|
166
|
+
], DuiAccordion.prototype, "defaultValue", null);
|
|
167
|
+
__decorate([
|
|
168
|
+
property({ type: Boolean })
|
|
169
|
+
], DuiAccordion.prototype, "disabled", null);
|
|
170
|
+
__decorate([
|
|
171
|
+
property({ type: Boolean })
|
|
172
|
+
], DuiAccordion.prototype, "multiple", null);
|
|
173
|
+
__decorate([
|
|
174
|
+
property({ type: Boolean, attribute: "loop-focus" })
|
|
175
|
+
], DuiAccordion.prototype, "loopFocus", null);
|
|
176
|
+
__decorate([
|
|
177
|
+
property({ type: String })
|
|
178
|
+
], DuiAccordion.prototype, "orientation", null);
|
|
179
|
+
__decorate([
|
|
180
|
+
property({ type: Boolean, attribute: "keep-mounted" })
|
|
181
|
+
], DuiAccordion.prototype, "keepMounted", null);
|
|
182
|
+
__decorate([
|
|
183
|
+
provide({ context: accordionContext }),
|
|
184
|
+
state()
|
|
185
|
+
], DuiAccordion.prototype, "_ctx", null);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DuiAccordion } from "./accordion.js";
|
|
2
|
+
import { DuiAccordionItem } from "./accordion-item.js";
|
|
3
|
+
if (!customElements.get(DuiAccordion.tagName)) {
|
|
4
|
+
customElements.define(DuiAccordion.tagName, DuiAccordion);
|
|
5
|
+
}
|
|
6
|
+
if (!customElements.get(DuiAccordionItem.tagName)) {
|
|
7
|
+
customElements.define(DuiAccordionItem.tagName, DuiAccordionItem);
|
|
8
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/alert-dialog */
|
|
2
|
+
import { LitElement, type TemplateResult } from "lit";
|
|
3
|
+
/**
|
|
4
|
+
* `<dui-alert-dialog-close>` — A close button wrapper for the alert dialog.
|
|
5
|
+
*
|
|
6
|
+
* Wraps slotted content and closes the alert dialog on click.
|
|
7
|
+
*
|
|
8
|
+
* @slot - Content that closes the alert dialog (usually a button).
|
|
9
|
+
*/
|
|
10
|
+
export declare class DuiAlertDialogClose extends LitElement {
|
|
11
|
+
#private;
|
|
12
|
+
static tagName: "dui-alert-dialog-close";
|
|
13
|
+
static styles: import("lit").CSSResult[];
|
|
14
|
+
render(): TemplateResult;
|
|
15
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/alert-dialog */
|
|
2
|
+
import { css, html, LitElement } from "lit";
|
|
3
|
+
import { ContextConsumer } from "@lit/context";
|
|
4
|
+
import { base } from "@deepfuture/dui-core/base";
|
|
5
|
+
import { alertDialogContext } from "./alert-dialog-context.js";
|
|
6
|
+
const hostStyles = css `
|
|
7
|
+
:host {
|
|
8
|
+
display: contents;
|
|
9
|
+
}
|
|
10
|
+
`;
|
|
11
|
+
/**
|
|
12
|
+
* `<dui-alert-dialog-close>` — A close button wrapper for the alert dialog.
|
|
13
|
+
*
|
|
14
|
+
* Wraps slotted content and closes the alert dialog on click.
|
|
15
|
+
*
|
|
16
|
+
* @slot - Content that closes the alert dialog (usually a button).
|
|
17
|
+
*/
|
|
18
|
+
export class DuiAlertDialogClose extends LitElement {
|
|
19
|
+
static { this.tagName = "dui-alert-dialog-close"; }
|
|
20
|
+
static { this.styles = [base, hostStyles]; }
|
|
21
|
+
#ctx = new ContextConsumer(this, {
|
|
22
|
+
context: alertDialogContext,
|
|
23
|
+
subscribe: true,
|
|
24
|
+
});
|
|
25
|
+
#handleClick = () => {
|
|
26
|
+
this.#ctx.value?.closeDialog();
|
|
27
|
+
};
|
|
28
|
+
render() {
|
|
29
|
+
return html `
|
|
30
|
+
<span @click="${this.#handleClick}">
|
|
31
|
+
<slot></slot>
|
|
32
|
+
</span>
|
|
33
|
+
`;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/alert-dialog */
|
|
2
|
+
export type AlertDialogContext = {
|
|
3
|
+
readonly open: boolean;
|
|
4
|
+
readonly dialogId: string;
|
|
5
|
+
readonly triggerId: string;
|
|
6
|
+
readonly titleId: string;
|
|
7
|
+
readonly descriptionId: string;
|
|
8
|
+
readonly openDialog: () => void;
|
|
9
|
+
readonly closeDialog: () => void;
|
|
10
|
+
};
|
|
11
|
+
export declare const alertDialogContext: {
|
|
12
|
+
__context__: AlertDialogContext;
|
|
13
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/alert-dialog */
|
|
2
|
+
import { LitElement, type TemplateResult } from "lit";
|
|
3
|
+
/**
|
|
4
|
+
* `<dui-alert-dialog-popup>` — The popup overlay for the alert 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
|
+
* Does NOT close on backdrop click — requires explicit user action.
|
|
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 alert dialog (rendered as `<h2>`).
|
|
14
|
+
* @slot description - Description text for the alert dialog (rendered as `<p>`).
|
|
15
|
+
* @slot - Default slot for dialog content (actions, 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 DuiAlertDialogPopup extends LitElement {
|
|
22
|
+
#private;
|
|
23
|
+
static tagName: "dui-alert-dialog-popup";
|
|
24
|
+
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
|
+
updated(): void;
|
|
32
|
+
willUpdate(): void;
|
|
33
|
+
render(): TemplateResult;
|
|
34
|
+
}
|