@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
package/hstack/hstack.js
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/hstack */
|
|
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 } from "lit/decorators.js";
|
|
10
|
+
import { base } from "@deepfuture/dui-core/base";
|
|
11
|
+
/** Structural styles only — layout CSS. */
|
|
12
|
+
const styles = css `
|
|
13
|
+
:host {
|
|
14
|
+
--hstack-gap: var(--space-4);
|
|
15
|
+
--hstack-align: center;
|
|
16
|
+
--hstack-justify: stretch;
|
|
17
|
+
display: block;
|
|
18
|
+
width: 100%;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:host([gap="0"]) {
|
|
22
|
+
--hstack-gap: var(--space-0);
|
|
23
|
+
}
|
|
24
|
+
:host([gap="1"]) {
|
|
25
|
+
--hstack-gap: var(--space-1);
|
|
26
|
+
}
|
|
27
|
+
:host([gap="2"]) {
|
|
28
|
+
--hstack-gap: var(--space-2);
|
|
29
|
+
}
|
|
30
|
+
:host([gap="3"]) {
|
|
31
|
+
--hstack-gap: var(--space-3);
|
|
32
|
+
}
|
|
33
|
+
:host([gap="4"]) {
|
|
34
|
+
--hstack-gap: var(--space-4);
|
|
35
|
+
}
|
|
36
|
+
:host([gap="5"]) {
|
|
37
|
+
--hstack-gap: var(--space-5);
|
|
38
|
+
}
|
|
39
|
+
:host([gap="6"]) {
|
|
40
|
+
--hstack-gap: var(--space-6);
|
|
41
|
+
}
|
|
42
|
+
:host([gap="8"]) {
|
|
43
|
+
--hstack-gap: var(--space-8);
|
|
44
|
+
}
|
|
45
|
+
:host([gap="10"]) {
|
|
46
|
+
--hstack-gap: var(--space-10);
|
|
47
|
+
}
|
|
48
|
+
:host([gap="12"]) {
|
|
49
|
+
--hstack-gap: var(--space-12);
|
|
50
|
+
}
|
|
51
|
+
:host([gap="16"]) {
|
|
52
|
+
--hstack-gap: var(--space-16);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
:host([align="start"]) {
|
|
56
|
+
--hstack-align: flex-start;
|
|
57
|
+
}
|
|
58
|
+
:host([align="center"]) {
|
|
59
|
+
--hstack-align: center;
|
|
60
|
+
}
|
|
61
|
+
:host([align="end"]) {
|
|
62
|
+
--hstack-align: flex-end;
|
|
63
|
+
}
|
|
64
|
+
:host([align="stretch"]) {
|
|
65
|
+
--hstack-align: stretch;
|
|
66
|
+
}
|
|
67
|
+
:host([align="baseline"]) {
|
|
68
|
+
--hstack-align: baseline;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
:host([justify="start"]) {
|
|
72
|
+
--hstack-justify: flex-start;
|
|
73
|
+
}
|
|
74
|
+
:host([justify="center"]) {
|
|
75
|
+
--hstack-justify: center;
|
|
76
|
+
}
|
|
77
|
+
:host([justify="end"]) {
|
|
78
|
+
--hstack-justify: flex-end;
|
|
79
|
+
}
|
|
80
|
+
:host([justify="between"]) {
|
|
81
|
+
--hstack-justify: space-between;
|
|
82
|
+
}
|
|
83
|
+
:host([justify="around"]) {
|
|
84
|
+
--hstack-justify: space-around;
|
|
85
|
+
}
|
|
86
|
+
:host([justify="evenly"]) {
|
|
87
|
+
--hstack-justify: space-evenly;
|
|
88
|
+
}
|
|
89
|
+
:host([justify="stretch"]) {
|
|
90
|
+
--hstack-justify: stretch;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
[part="root"] {
|
|
94
|
+
display: flex;
|
|
95
|
+
flex-direction: row;
|
|
96
|
+
gap: var(--hstack-gap);
|
|
97
|
+
align-items: var(--hstack-align);
|
|
98
|
+
justify-content: var(--hstack-justify);
|
|
99
|
+
}
|
|
100
|
+
`;
|
|
101
|
+
/**
|
|
102
|
+
* `<dui-hstack>` — A horizontal stack layout component.
|
|
103
|
+
*
|
|
104
|
+
* @slot - Stack content.
|
|
105
|
+
* @csspart root - The stack container.
|
|
106
|
+
* @cssprop --hstack-gap - Override gap between items.
|
|
107
|
+
* @cssprop --hstack-align - Override align-items.
|
|
108
|
+
* @cssprop --hstack-justify - Override justify-content.
|
|
109
|
+
*/
|
|
110
|
+
export class DuiHstack extends LitElement {
|
|
111
|
+
static { this.tagName = "dui-hstack"; }
|
|
112
|
+
static { this.styles = [base, styles]; }
|
|
113
|
+
#gap_accessor_storage = "4";
|
|
114
|
+
/** Gap between stack items. Maps to space tokens. */
|
|
115
|
+
get gap() { return this.#gap_accessor_storage; }
|
|
116
|
+
set gap(value) { this.#gap_accessor_storage = value; }
|
|
117
|
+
#align_accessor_storage = "center";
|
|
118
|
+
/** Alignment of items on the cross axis. */
|
|
119
|
+
get align() { return this.#align_accessor_storage; }
|
|
120
|
+
set align(value) { this.#align_accessor_storage = value; }
|
|
121
|
+
#justify_accessor_storage = "stretch";
|
|
122
|
+
/** Justification of items on the main axis. */
|
|
123
|
+
get justify() { return this.#justify_accessor_storage; }
|
|
124
|
+
set justify(value) { this.#justify_accessor_storage = value; }
|
|
125
|
+
render() {
|
|
126
|
+
return html `
|
|
127
|
+
<div part="root">
|
|
128
|
+
<slot></slot>
|
|
129
|
+
</div>
|
|
130
|
+
`;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
__decorate([
|
|
134
|
+
property({ reflect: true })
|
|
135
|
+
], DuiHstack.prototype, "gap", null);
|
|
136
|
+
__decorate([
|
|
137
|
+
property({ reflect: true })
|
|
138
|
+
], DuiHstack.prototype, "align", null);
|
|
139
|
+
__decorate([
|
|
140
|
+
property({ reflect: true })
|
|
141
|
+
], DuiHstack.prototype, "justify", null);
|
package/hstack/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DuiHstack } from "./hstack.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/icon/icon.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* `<dui-icon>` — Slot-based SVG icon container.
|
|
4
|
+
*
|
|
5
|
+
* Consumers provide their own SVG via the default slot. The icon inherits
|
|
6
|
+
* `currentColor` and sizes itself via `--icon-size`.
|
|
7
|
+
*
|
|
8
|
+
* @slot - SVG element to display.
|
|
9
|
+
* @cssprop [--icon-size=1em] - Icon dimensions.
|
|
10
|
+
* @cssprop [--icon-color=currentColor] - Icon color.
|
|
11
|
+
*/
|
|
12
|
+
export declare class DuiIcon extends LitElement {
|
|
13
|
+
static tagName: "dui-icon";
|
|
14
|
+
static styles: import("lit").CSSResult[];
|
|
15
|
+
render(): import("lit").TemplateResult<1>;
|
|
16
|
+
}
|
package/icon/icon.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { css, html, LitElement } from "lit";
|
|
2
|
+
import { base } from "@deepfuture/dui-core/base";
|
|
3
|
+
const styles = css `
|
|
4
|
+
:host {
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
width: var(--icon-size, 1em);
|
|
9
|
+
height: var(--icon-size, 1em);
|
|
10
|
+
color: var(--icon-color, currentColor);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
::slotted(svg) {
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 100%;
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
/**
|
|
19
|
+
* `<dui-icon>` — Slot-based SVG icon container.
|
|
20
|
+
*
|
|
21
|
+
* Consumers provide their own SVG via the default slot. The icon inherits
|
|
22
|
+
* `currentColor` and sizes itself via `--icon-size`.
|
|
23
|
+
*
|
|
24
|
+
* @slot - SVG element to display.
|
|
25
|
+
* @cssprop [--icon-size=1em] - Icon dimensions.
|
|
26
|
+
* @cssprop [--icon-color=currentColor] - Icon color.
|
|
27
|
+
*/
|
|
28
|
+
export class DuiIcon extends LitElement {
|
|
29
|
+
static { this.tagName = "dui-icon"; }
|
|
30
|
+
static { this.styles = [base, styles]; }
|
|
31
|
+
render() {
|
|
32
|
+
return html `<slot></slot>`;
|
|
33
|
+
}
|
|
34
|
+
}
|
package/icon/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DuiIcon } from "./icon.js";
|
package/icon/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DuiIcon } from "./icon.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/icon/register.js
ADDED
package/input/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DuiInput, inputChangeEvent } from "./input.js";
|
package/input/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DuiInput, inputChangeEvent } from "./input.js";
|
package/input/input.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/input */
|
|
2
|
+
import { LitElement, type TemplateResult } from "lit";
|
|
3
|
+
export declare const inputChangeEvent: (detail: {
|
|
4
|
+
value: string;
|
|
5
|
+
}) => CustomEvent<{
|
|
6
|
+
value: string;
|
|
7
|
+
}>;
|
|
8
|
+
/**
|
|
9
|
+
* `<dui-input>` — A native input element that integrates with dui-field.
|
|
10
|
+
*
|
|
11
|
+
* Automatically works with Field for accessible labeling and validation.
|
|
12
|
+
*
|
|
13
|
+
* @csspart input - The native input element.
|
|
14
|
+
* @fires input-change - Fired when value changes. Detail: { value: string }
|
|
15
|
+
*/
|
|
16
|
+
export declare class DuiInput extends LitElement {
|
|
17
|
+
#private;
|
|
18
|
+
static tagName: "dui-input";
|
|
19
|
+
static shadowRootOptions: ShadowRootInit;
|
|
20
|
+
static styles: import("lit").CSSResult[];
|
|
21
|
+
/** Input type (text, email, password, etc.) */
|
|
22
|
+
accessor type: string;
|
|
23
|
+
/** Current input value. */
|
|
24
|
+
accessor value: string;
|
|
25
|
+
/** Placeholder text. */
|
|
26
|
+
accessor placeholder: string;
|
|
27
|
+
/** Whether the input is disabled. */
|
|
28
|
+
accessor disabled: boolean;
|
|
29
|
+
/** Whether the input is required. */
|
|
30
|
+
accessor required: boolean;
|
|
31
|
+
/** Whether the input is read-only. */
|
|
32
|
+
accessor readonly: boolean;
|
|
33
|
+
/** Minimum length for text inputs. */
|
|
34
|
+
accessor minLength: number | undefined;
|
|
35
|
+
/** Maximum length for text inputs. */
|
|
36
|
+
accessor maxLength: number | undefined;
|
|
37
|
+
/** Pattern for validation. */
|
|
38
|
+
accessor pattern: string | undefined;
|
|
39
|
+
/** Name attribute for form submission. */
|
|
40
|
+
accessor name: string;
|
|
41
|
+
/** Autocomplete hint for the browser. */
|
|
42
|
+
accessor autocomplete: string | undefined;
|
|
43
|
+
/** Whether the input should receive focus on mount. */
|
|
44
|
+
accessor autofocus: boolean;
|
|
45
|
+
firstUpdated(): void;
|
|
46
|
+
render(): TemplateResult;
|
|
47
|
+
}
|
package/input/input.js
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/input */
|
|
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 } from "lit/decorators.js";
|
|
10
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
11
|
+
import { live } from "lit/directives/live.js";
|
|
12
|
+
import { base } from "@deepfuture/dui-core/base";
|
|
13
|
+
import { customEvent } from "@deepfuture/dui-core/event";
|
|
14
|
+
export const inputChangeEvent = customEvent("input-change", {
|
|
15
|
+
bubbles: true,
|
|
16
|
+
composed: true,
|
|
17
|
+
});
|
|
18
|
+
/** Structural styles only — layout CSS. */
|
|
19
|
+
const styles = css `
|
|
20
|
+
:host {
|
|
21
|
+
display: block;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
[part="input"] {
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
width: 100%;
|
|
27
|
+
outline: none;
|
|
28
|
+
transition-property: border-color, box-shadow, background, filter, transform;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
[part="input"]:disabled {
|
|
32
|
+
cursor: not-allowed;
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
/**
|
|
36
|
+
* `<dui-input>` — A native input element that integrates with dui-field.
|
|
37
|
+
*
|
|
38
|
+
* Automatically works with Field for accessible labeling and validation.
|
|
39
|
+
*
|
|
40
|
+
* @csspart input - The native input element.
|
|
41
|
+
* @fires input-change - Fired when value changes. Detail: { value: string }
|
|
42
|
+
*/
|
|
43
|
+
export class DuiInput extends LitElement {
|
|
44
|
+
static { this.tagName = "dui-input"; }
|
|
45
|
+
static { this.shadowRootOptions = {
|
|
46
|
+
...LitElement.shadowRootOptions,
|
|
47
|
+
delegatesFocus: true,
|
|
48
|
+
}; }
|
|
49
|
+
static { this.styles = [base, styles]; }
|
|
50
|
+
#type_accessor_storage = "text";
|
|
51
|
+
/** Input type (text, email, password, etc.) */
|
|
52
|
+
get type() { return this.#type_accessor_storage; }
|
|
53
|
+
set type(value) { this.#type_accessor_storage = value; }
|
|
54
|
+
#value_accessor_storage = "";
|
|
55
|
+
/** Current input value. */
|
|
56
|
+
get value() { return this.#value_accessor_storage; }
|
|
57
|
+
set value(value) { this.#value_accessor_storage = value; }
|
|
58
|
+
#placeholder_accessor_storage = "";
|
|
59
|
+
/** Placeholder text. */
|
|
60
|
+
get placeholder() { return this.#placeholder_accessor_storage; }
|
|
61
|
+
set placeholder(value) { this.#placeholder_accessor_storage = value; }
|
|
62
|
+
#disabled_accessor_storage = false;
|
|
63
|
+
/** Whether the input is disabled. */
|
|
64
|
+
get disabled() { return this.#disabled_accessor_storage; }
|
|
65
|
+
set disabled(value) { this.#disabled_accessor_storage = value; }
|
|
66
|
+
#required_accessor_storage = false;
|
|
67
|
+
/** Whether the input is required. */
|
|
68
|
+
get required() { return this.#required_accessor_storage; }
|
|
69
|
+
set required(value) { this.#required_accessor_storage = value; }
|
|
70
|
+
#readonly_accessor_storage = false;
|
|
71
|
+
/** Whether the input is read-only. */
|
|
72
|
+
get readonly() { return this.#readonly_accessor_storage; }
|
|
73
|
+
set readonly(value) { this.#readonly_accessor_storage = value; }
|
|
74
|
+
#minLength_accessor_storage = undefined;
|
|
75
|
+
/** Minimum length for text inputs. */
|
|
76
|
+
get minLength() { return this.#minLength_accessor_storage; }
|
|
77
|
+
set minLength(value) { this.#minLength_accessor_storage = value; }
|
|
78
|
+
#maxLength_accessor_storage = undefined;
|
|
79
|
+
/** Maximum length for text inputs. */
|
|
80
|
+
get maxLength() { return this.#maxLength_accessor_storage; }
|
|
81
|
+
set maxLength(value) { this.#maxLength_accessor_storage = value; }
|
|
82
|
+
#pattern_accessor_storage = undefined;
|
|
83
|
+
/** Pattern for validation. */
|
|
84
|
+
get pattern() { return this.#pattern_accessor_storage; }
|
|
85
|
+
set pattern(value) { this.#pattern_accessor_storage = value; }
|
|
86
|
+
#name_accessor_storage = "";
|
|
87
|
+
/** Name attribute for form submission. */
|
|
88
|
+
get name() { return this.#name_accessor_storage; }
|
|
89
|
+
set name(value) { this.#name_accessor_storage = value; }
|
|
90
|
+
#autocomplete_accessor_storage = undefined;
|
|
91
|
+
/** Autocomplete hint for the browser. */
|
|
92
|
+
get autocomplete() { return this.#autocomplete_accessor_storage; }
|
|
93
|
+
set autocomplete(value) { this.#autocomplete_accessor_storage = value; }
|
|
94
|
+
#autofocus_accessor_storage = false;
|
|
95
|
+
/** Whether the input should receive focus on mount. */
|
|
96
|
+
get autofocus() { return this.#autofocus_accessor_storage; }
|
|
97
|
+
set autofocus(value) { this.#autofocus_accessor_storage = value; }
|
|
98
|
+
#ctx_accessor_storage;
|
|
99
|
+
get #ctx() { return this.#ctx_accessor_storage; }
|
|
100
|
+
set #ctx(value) { this.#ctx_accessor_storage = value; }
|
|
101
|
+
get #controlId() {
|
|
102
|
+
return this.#ctx?.controlId ?? "";
|
|
103
|
+
}
|
|
104
|
+
get #descriptionId() {
|
|
105
|
+
return this.#ctx?.descriptionId;
|
|
106
|
+
}
|
|
107
|
+
get #errorId() {
|
|
108
|
+
return this.#ctx?.errorId;
|
|
109
|
+
}
|
|
110
|
+
get #isDisabled() {
|
|
111
|
+
return this.disabled || (this.#ctx?.disabled ?? false);
|
|
112
|
+
}
|
|
113
|
+
get #isInvalid() {
|
|
114
|
+
return this.#ctx?.invalid ?? false;
|
|
115
|
+
}
|
|
116
|
+
firstUpdated() {
|
|
117
|
+
if (this.autofocus) {
|
|
118
|
+
this.focus();
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
#onInput = (event) => {
|
|
122
|
+
const target = event.target;
|
|
123
|
+
this.value = target.value;
|
|
124
|
+
this.#ctx?.markDirty();
|
|
125
|
+
this.#ctx?.setFilled(this.value.length > 0);
|
|
126
|
+
this.dispatchEvent(inputChangeEvent({ value: this.value }));
|
|
127
|
+
};
|
|
128
|
+
#onFocus = () => {
|
|
129
|
+
this.#ctx?.setFocused(true);
|
|
130
|
+
};
|
|
131
|
+
#onBlur = () => {
|
|
132
|
+
this.#ctx?.setFocused(false);
|
|
133
|
+
this.#ctx?.markTouched();
|
|
134
|
+
};
|
|
135
|
+
render() {
|
|
136
|
+
const describedBy = [this.#descriptionId, this.#isInvalid ? this.#errorId : undefined]
|
|
137
|
+
.filter(Boolean)
|
|
138
|
+
.join(" ") || undefined;
|
|
139
|
+
return html `
|
|
140
|
+
<input
|
|
141
|
+
part="input"
|
|
142
|
+
id="${this.#controlId}"
|
|
143
|
+
type="${this.type}"
|
|
144
|
+
.value="${live(this.value)}"
|
|
145
|
+
placeholder="${this.placeholder}"
|
|
146
|
+
?disabled="${this.#isDisabled}"
|
|
147
|
+
?required="${this.required}"
|
|
148
|
+
?readonly="${this.readonly}"
|
|
149
|
+
minlength="${ifDefined(this.minLength)}"
|
|
150
|
+
maxlength="${ifDefined(this.maxLength)}"
|
|
151
|
+
pattern="${ifDefined(this.pattern)}"
|
|
152
|
+
name="${this.name}"
|
|
153
|
+
autocomplete="${ifDefined(this.autocomplete)}"
|
|
154
|
+
aria-describedby="${ifDefined(describedBy)}"
|
|
155
|
+
aria-invalid="${this.#isInvalid}"
|
|
156
|
+
?data-disabled="${this.#isDisabled}"
|
|
157
|
+
?data-invalid="${this.#isInvalid}"
|
|
158
|
+
?data-valid="${!this.#isInvalid}"
|
|
159
|
+
?data-dirty="${this.#ctx?.dirty}"
|
|
160
|
+
?data-touched="${this.#ctx?.touched}"
|
|
161
|
+
?data-filled="${this.#ctx?.filled}"
|
|
162
|
+
?data-focused="${this.#ctx?.focused}"
|
|
163
|
+
@input="${this.#onInput}"
|
|
164
|
+
@focus="${this.#onFocus}"
|
|
165
|
+
@blur="${this.#onBlur}"
|
|
166
|
+
/>
|
|
167
|
+
`;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
__decorate([
|
|
171
|
+
property({ type: String })
|
|
172
|
+
], DuiInput.prototype, "type", null);
|
|
173
|
+
__decorate([
|
|
174
|
+
property({ type: String })
|
|
175
|
+
], DuiInput.prototype, "value", null);
|
|
176
|
+
__decorate([
|
|
177
|
+
property({ type: String })
|
|
178
|
+
], DuiInput.prototype, "placeholder", null);
|
|
179
|
+
__decorate([
|
|
180
|
+
property({ type: Boolean, reflect: true })
|
|
181
|
+
], DuiInput.prototype, "disabled", null);
|
|
182
|
+
__decorate([
|
|
183
|
+
property({ type: Boolean })
|
|
184
|
+
], DuiInput.prototype, "required", null);
|
|
185
|
+
__decorate([
|
|
186
|
+
property({ type: Boolean })
|
|
187
|
+
], DuiInput.prototype, "readonly", null);
|
|
188
|
+
__decorate([
|
|
189
|
+
property({ type: Number, attribute: "minlength" })
|
|
190
|
+
], DuiInput.prototype, "minLength", null);
|
|
191
|
+
__decorate([
|
|
192
|
+
property({ type: Number, attribute: "maxlength" })
|
|
193
|
+
], DuiInput.prototype, "maxLength", null);
|
|
194
|
+
__decorate([
|
|
195
|
+
property({ type: String })
|
|
196
|
+
], DuiInput.prototype, "pattern", null);
|
|
197
|
+
__decorate([
|
|
198
|
+
property({ type: String })
|
|
199
|
+
], DuiInput.prototype, "name", null);
|
|
200
|
+
__decorate([
|
|
201
|
+
property({ type: String })
|
|
202
|
+
], DuiInput.prototype, "autocomplete", null);
|
|
203
|
+
__decorate([
|
|
204
|
+
property({ type: Boolean })
|
|
205
|
+
], DuiInput.prototype, "autofocus", null);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/link/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DuiLink, spaNavigateEvent } from "./link.js";
|
package/link/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DuiLink, spaNavigateEvent } from "./link.js";
|
package/link/link.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/link */
|
|
2
|
+
import { LitElement, type TemplateResult } from "lit";
|
|
3
|
+
export declare const spaNavigateEvent: (detail: {
|
|
4
|
+
href: string;
|
|
5
|
+
}) => CustomEvent<{
|
|
6
|
+
href: string;
|
|
7
|
+
}>;
|
|
8
|
+
/**
|
|
9
|
+
* `<dui-link>` — A layout-transparent SPA link.
|
|
10
|
+
*
|
|
11
|
+
* Renders a real `<a href>` inside shadow DOM for native link behaviors
|
|
12
|
+
* (right-click menu, URL preview on hover, accessibility). On plain
|
|
13
|
+
* left-click, dispatches a bubbling `spa-navigate` event instead of
|
|
14
|
+
* performing a full page navigation. Modifier-clicks (cmd/ctrl/shift/middle)
|
|
15
|
+
* fall through to the browser for new-tab behavior.
|
|
16
|
+
*
|
|
17
|
+
* @slot - Link content.
|
|
18
|
+
* @fires spa-navigate - Fired on plain left-click. Detail: { href }.
|
|
19
|
+
*/
|
|
20
|
+
export declare class DuiLink extends LitElement {
|
|
21
|
+
#private;
|
|
22
|
+
static tagName: "dui-link";
|
|
23
|
+
static styles: import("lit").CSSResult[];
|
|
24
|
+
/** The URL to navigate to. */
|
|
25
|
+
accessor href: string;
|
|
26
|
+
render(): TemplateResult;
|
|
27
|
+
}
|
package/link/link.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/link */
|
|
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 } from "lit/decorators.js";
|
|
10
|
+
import { base } from "@deepfuture/dui-core/base";
|
|
11
|
+
import { customEvent } from "@deepfuture/dui-core/event";
|
|
12
|
+
export const spaNavigateEvent = customEvent("spa-navigate", { bubbles: true, composed: true });
|
|
13
|
+
/** Structural styles only — layout CSS. */
|
|
14
|
+
const styles = css `
|
|
15
|
+
:host {
|
|
16
|
+
display: contents;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
a {
|
|
20
|
+
display: contents;
|
|
21
|
+
color: inherit;
|
|
22
|
+
text-decoration: none;
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
/**
|
|
26
|
+
* `<dui-link>` — A layout-transparent SPA link.
|
|
27
|
+
*
|
|
28
|
+
* Renders a real `<a href>` inside shadow DOM for native link behaviors
|
|
29
|
+
* (right-click menu, URL preview on hover, accessibility). On plain
|
|
30
|
+
* left-click, dispatches a bubbling `spa-navigate` event instead of
|
|
31
|
+
* performing a full page navigation. Modifier-clicks (cmd/ctrl/shift/middle)
|
|
32
|
+
* fall through to the browser for new-tab behavior.
|
|
33
|
+
*
|
|
34
|
+
* @slot - Link content.
|
|
35
|
+
* @fires spa-navigate - Fired on plain left-click. Detail: { href }.
|
|
36
|
+
*/
|
|
37
|
+
export class DuiLink extends LitElement {
|
|
38
|
+
static { this.tagName = "dui-link"; }
|
|
39
|
+
static { this.styles = [base, styles]; }
|
|
40
|
+
#href_accessor_storage = "";
|
|
41
|
+
/** The URL to navigate to. */
|
|
42
|
+
get href() { return this.#href_accessor_storage; }
|
|
43
|
+
set href(value) { this.#href_accessor_storage = value; }
|
|
44
|
+
#onClick = (event) => {
|
|
45
|
+
if (event.metaKey || event.ctrlKey || event.shiftKey || event.button !== 0) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
event.preventDefault();
|
|
49
|
+
this.dispatchEvent(spaNavigateEvent({ href: this.href }));
|
|
50
|
+
};
|
|
51
|
+
render() {
|
|
52
|
+
return html `<a href="${this.href}" @click="${this.#onClick}"><slot></slot></a>`;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
__decorate([
|
|
56
|
+
property()
|
|
57
|
+
], DuiLink.prototype, "href", null);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/link/register.js
ADDED
package/menu/index.d.ts
ADDED
package/menu/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Ported from original DUI: deep-future-app/app/client/components/dui/menu */
|
|
2
|
+
import { LitElement, type TemplateResult } from "lit";
|
|
3
|
+
/**
|
|
4
|
+
* `<dui-menu-item>` — An item within a `dui-menu`.
|
|
5
|
+
*
|
|
6
|
+
* @slot default - Item content (text, icons, etc.).
|
|
7
|
+
*/
|
|
8
|
+
export declare class DuiMenuItem extends LitElement {
|
|
9
|
+
static tagName: "dui-menu-item";
|
|
10
|
+
static styles: import("lit").CSSResult[];
|
|
11
|
+
/** Visual variant. */
|
|
12
|
+
accessor variant: "default" | "danger";
|
|
13
|
+
/** Whether the item is disabled. */
|
|
14
|
+
accessor disabled: boolean;
|
|
15
|
+
connectedCallback(): void;
|
|
16
|
+
render(): TemplateResult;
|
|
17
|
+
}
|