@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
|
@@ -1,238 +1,81 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
5
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
6
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
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
|
-
import { css, html, LitElement, nothing } from "lit";
|
|
37
|
-
import { property } from "lit/decorators.js";
|
|
38
|
-
import { ContextConsumer } from "@lit/context";
|
|
39
|
-
import { base } from "@deepfuture/dui-core/base";
|
|
40
|
-
import { sidebarContext } from "./sidebar-context.js";
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
import { DuiSidebarMenuButtonPrimitive } from "@deepfuture/dui-primitives/sidebar";
|
|
3
|
+
import "../_install.js";
|
|
41
4
|
const styles = css `
|
|
42
5
|
:host {
|
|
43
|
-
|
|
6
|
+
--smb-height: var(--component-height-md);
|
|
7
|
+
--smb-padding-x: var(--sidebar-button-inset);
|
|
8
|
+
--smb-gap: var(--space-2);
|
|
9
|
+
--smb-icon-size: var(--space-4);
|
|
10
|
+
--smb-font-size: var(--text-sm);
|
|
11
|
+
--smb-radius: var(--radius-md);
|
|
44
12
|
}
|
|
45
13
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
overflow: hidden;
|
|
14
|
+
:host([size="sm"]) {
|
|
15
|
+
--smb-height: var(--component-height-sm);
|
|
16
|
+
--smb-font-size: var(--text-xs);
|
|
50
17
|
}
|
|
51
18
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
min-width: 0;
|
|
57
|
-
align-items: center;
|
|
58
|
-
height: 100%;
|
|
59
|
-
border: none;
|
|
60
|
-
border-radius: 0;
|
|
61
|
-
background: transparent;
|
|
62
|
-
text-align: left;
|
|
63
|
-
text-decoration: none;
|
|
64
|
-
white-space: nowrap;
|
|
65
|
-
overflow: hidden;
|
|
66
|
-
cursor: pointer;
|
|
67
|
-
user-select: none;
|
|
68
|
-
font: inherit;
|
|
69
|
-
color: inherit;
|
|
70
|
-
padding: 0;
|
|
19
|
+
:host([size="lg"]) {
|
|
20
|
+
--smb-height: var(--component-height-lg);
|
|
21
|
+
--smb-font-size: var(--text-sm);
|
|
22
|
+
--smb-gap: var(--space-2_5);
|
|
71
23
|
}
|
|
72
24
|
|
|
73
|
-
.
|
|
74
|
-
|
|
25
|
+
.Row {
|
|
26
|
+
height: var(--smb-height);
|
|
27
|
+
border-radius: var(--smb-radius);
|
|
28
|
+
margin: 0 var(--space-2);
|
|
29
|
+
transition-property: background;
|
|
30
|
+
transition-duration: var(--duration-faster);
|
|
31
|
+
transition-timing-function: var(--ease-out-3);
|
|
75
32
|
}
|
|
76
33
|
|
|
77
|
-
.
|
|
78
|
-
|
|
79
|
-
overflow: hidden;
|
|
80
|
-
text-overflow: ellipsis;
|
|
34
|
+
.Row:hover {
|
|
35
|
+
background: oklch(from var(--foreground) l c h / 0.05);
|
|
81
36
|
}
|
|
82
37
|
|
|
83
|
-
.
|
|
84
|
-
|
|
38
|
+
.Row[data-active] {
|
|
39
|
+
background: oklch(from var(--foreground) l c h / 0.10);
|
|
85
40
|
}
|
|
86
41
|
|
|
87
42
|
.Row[data-icon-collapsed] {
|
|
88
|
-
|
|
43
|
+
width: var(--sidebar-width-icon);
|
|
44
|
+
margin: 0 auto;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.Button {
|
|
48
|
+
gap: var(--smb-gap);
|
|
49
|
+
padding: 0 var(--smb-padding-x);
|
|
50
|
+
color: var(--sidebar-button-fg);
|
|
51
|
+
font-family: var(--font-sans);
|
|
52
|
+
font-size: var(--smb-font-size);
|
|
53
|
+
font-weight: var(--font-weight-regular);
|
|
54
|
+
letter-spacing: var(--letter-spacing-tight);
|
|
55
|
+
line-height: var(--line-height-snug);
|
|
56
|
+
text-box: trim-both cap alphabetic;
|
|
57
|
+
--icon-size: var(--smb-icon-size);
|
|
58
|
+
--icon-color: var(--sidebar-muted-fg);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.Button:focus-visible {
|
|
62
|
+
box-shadow:
|
|
63
|
+
0 0 0 var(--focus-ring-offset) var(--background),
|
|
64
|
+
0 0 0 calc(var(--focus-ring-offset) + var(--focus-ring-width)) var(--sidebar-ring);
|
|
65
|
+
border-radius: var(--smb-radius);
|
|
89
66
|
}
|
|
90
67
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
display: none;
|
|
68
|
+
:host([disabled]) .Row {
|
|
69
|
+
opacity: 0.4;
|
|
94
70
|
}
|
|
95
71
|
|
|
96
|
-
:host([
|
|
97
|
-
|
|
72
|
+
:host([active]) .Button {
|
|
73
|
+
color: var(--sidebar-fg);
|
|
74
|
+
font-weight: var(--font-weight-medium);
|
|
75
|
+
--icon-color: var(--sidebar-fg);
|
|
98
76
|
}
|
|
99
77
|
`;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
* Supports icon-collapsed mode where only the icon is visible, with an
|
|
105
|
-
* optional tooltip.
|
|
106
|
-
*
|
|
107
|
-
* @slot icon - Icon slot, shown before the label.
|
|
108
|
-
* @slot - Default slot for label text.
|
|
109
|
-
* @slot suffix - Suffix slot, shown after the label.
|
|
110
|
-
* @fires spa-navigate - Fired on normal link clicks. Detail: { href: string }
|
|
111
|
-
*/
|
|
112
|
-
let DuiSidebarMenuButton = (() => {
|
|
113
|
-
let _classSuper = LitElement;
|
|
114
|
-
let _active_decorators;
|
|
115
|
-
let _active_initializers = [];
|
|
116
|
-
let _active_extraInitializers = [];
|
|
117
|
-
let _disabled_decorators;
|
|
118
|
-
let _disabled_initializers = [];
|
|
119
|
-
let _disabled_extraInitializers = [];
|
|
120
|
-
let _tooltip_decorators;
|
|
121
|
-
let _tooltip_initializers = [];
|
|
122
|
-
let _tooltip_extraInitializers = [];
|
|
123
|
-
let _href_decorators;
|
|
124
|
-
let _href_initializers = [];
|
|
125
|
-
let _href_extraInitializers = [];
|
|
126
|
-
return class DuiSidebarMenuButton extends _classSuper {
|
|
127
|
-
static {
|
|
128
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
129
|
-
_active_decorators = [property({ type: Boolean, reflect: true })];
|
|
130
|
-
_disabled_decorators = [property({ type: Boolean, reflect: true })];
|
|
131
|
-
_tooltip_decorators = [property()];
|
|
132
|
-
_href_decorators = [property()];
|
|
133
|
-
__esDecorate(this, null, _active_decorators, { kind: "accessor", name: "active", static: false, private: false, access: { has: obj => "active" in obj, get: obj => obj.active, set: (obj, value) => { obj.active = value; } }, metadata: _metadata }, _active_initializers, _active_extraInitializers);
|
|
134
|
-
__esDecorate(this, null, _disabled_decorators, { kind: "accessor", name: "disabled", static: false, private: false, access: { has: obj => "disabled" in obj, get: obj => obj.disabled, set: (obj, value) => { obj.disabled = value; } }, metadata: _metadata }, _disabled_initializers, _disabled_extraInitializers);
|
|
135
|
-
__esDecorate(this, null, _tooltip_decorators, { kind: "accessor", name: "tooltip", static: false, private: false, access: { has: obj => "tooltip" in obj, get: obj => obj.tooltip, set: (obj, value) => { obj.tooltip = value; } }, metadata: _metadata }, _tooltip_initializers, _tooltip_extraInitializers);
|
|
136
|
-
__esDecorate(this, null, _href_decorators, { kind: "accessor", name: "href", static: false, private: false, access: { has: obj => "href" in obj, get: obj => obj.href, set: (obj, value) => { obj.href = value; } }, metadata: _metadata }, _href_initializers, _href_extraInitializers);
|
|
137
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
138
|
-
}
|
|
139
|
-
static tagName = "dui-sidebar-menu-button";
|
|
140
|
-
static styles = [base, styles];
|
|
141
|
-
#active_accessor_storage = __runInitializers(this, _active_initializers, false);
|
|
142
|
-
/** Whether the button is in active/selected state. */
|
|
143
|
-
get active() { return this.#active_accessor_storage; }
|
|
144
|
-
set active(value) { this.#active_accessor_storage = value; }
|
|
145
|
-
#disabled_accessor_storage = (__runInitializers(this, _active_extraInitializers), __runInitializers(this, _disabled_initializers, false));
|
|
146
|
-
/** Whether the button is disabled. */
|
|
147
|
-
get disabled() { return this.#disabled_accessor_storage; }
|
|
148
|
-
set disabled(value) { this.#disabled_accessor_storage = value; }
|
|
149
|
-
#tooltip_accessor_storage = (__runInitializers(this, _disabled_extraInitializers), __runInitializers(this, _tooltip_initializers, ""));
|
|
150
|
-
/** Tooltip text shown when sidebar is icon-collapsed. */
|
|
151
|
-
get tooltip() { return this.#tooltip_accessor_storage; }
|
|
152
|
-
set tooltip(value) { this.#tooltip_accessor_storage = value; }
|
|
153
|
-
#href_accessor_storage = (__runInitializers(this, _tooltip_extraInitializers), __runInitializers(this, _href_initializers, undefined));
|
|
154
|
-
/** When set, renders as an anchor tag instead of a button. */
|
|
155
|
-
get href() { return this.#href_accessor_storage; }
|
|
156
|
-
set href(value) { this.#href_accessor_storage = value; }
|
|
157
|
-
#ctx = (__runInitializers(this, _href_extraInitializers), new ContextConsumer(this, {
|
|
158
|
-
context: sidebarContext,
|
|
159
|
-
subscribe: true,
|
|
160
|
-
}));
|
|
161
|
-
get #isIconCollapsed() {
|
|
162
|
-
const ctx = this.#ctx.value;
|
|
163
|
-
return ctx?.collapsible === "icon" && ctx?.state === "collapsed";
|
|
164
|
-
}
|
|
165
|
-
#onLinkClick = (event) => {
|
|
166
|
-
if (this.disabled) {
|
|
167
|
-
event.preventDefault();
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
if (this.href &&
|
|
171
|
-
!(event.metaKey || event.ctrlKey || event.shiftKey || event.altKey)) {
|
|
172
|
-
event.preventDefault();
|
|
173
|
-
this.dispatchEvent(new CustomEvent("spa-navigate", {
|
|
174
|
-
detail: { href: this.href },
|
|
175
|
-
bubbles: true,
|
|
176
|
-
composed: true,
|
|
177
|
-
}));
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
#renderButton() {
|
|
181
|
-
return html `
|
|
182
|
-
<button
|
|
183
|
-
class="Button"
|
|
184
|
-
?disabled=${this.disabled}
|
|
185
|
-
?data-active=${this.active}
|
|
186
|
-
>
|
|
187
|
-
<slot name="icon"></slot>
|
|
188
|
-
<span class="Label"><slot></slot></span>
|
|
189
|
-
<span class="Suffix"><slot name="suffix"></slot></span>
|
|
190
|
-
</button>
|
|
191
|
-
`;
|
|
192
|
-
}
|
|
193
|
-
#renderLink() {
|
|
194
|
-
return html `
|
|
195
|
-
<a
|
|
196
|
-
class="Button"
|
|
197
|
-
href=${this.href ?? nothing}
|
|
198
|
-
aria-disabled=${this.disabled || nothing}
|
|
199
|
-
?data-active=${this.active}
|
|
200
|
-
@click=${this.#onLinkClick}
|
|
201
|
-
>
|
|
202
|
-
<slot name="icon"></slot>
|
|
203
|
-
<span class="Label"><slot></slot></span>
|
|
204
|
-
<span class="Suffix"><slot name="suffix"></slot></span>
|
|
205
|
-
</a>
|
|
206
|
-
`;
|
|
207
|
-
}
|
|
208
|
-
#renderContent() {
|
|
209
|
-
const iconCollapsed = this.#isIconCollapsed;
|
|
210
|
-
return html `
|
|
211
|
-
<div
|
|
212
|
-
class="Row"
|
|
213
|
-
?data-icon-collapsed=${iconCollapsed}
|
|
214
|
-
?data-active=${this.active}
|
|
215
|
-
>
|
|
216
|
-
${this.href !== undefined ? this.#renderLink() : this.#renderButton()}
|
|
217
|
-
</div>
|
|
218
|
-
`;
|
|
219
|
-
}
|
|
220
|
-
render() {
|
|
221
|
-
const iconCollapsed = this.#isIconCollapsed;
|
|
222
|
-
if (iconCollapsed && this.tooltip) {
|
|
223
|
-
return html `
|
|
224
|
-
<dui-tooltip>
|
|
225
|
-
<dui-tooltip-trigger>
|
|
226
|
-
${this.#renderContent()}
|
|
227
|
-
</dui-tooltip-trigger>
|
|
228
|
-
<dui-tooltip-popup side="right">
|
|
229
|
-
${this.tooltip}
|
|
230
|
-
</dui-tooltip-popup>
|
|
231
|
-
</dui-tooltip>
|
|
232
|
-
`;
|
|
233
|
-
}
|
|
234
|
-
return this.#renderContent();
|
|
235
|
-
}
|
|
236
|
-
};
|
|
237
|
-
})();
|
|
238
|
-
export { DuiSidebarMenuButton };
|
|
78
|
+
export class DuiSidebarMenuButton extends DuiSidebarMenuButtonPrimitive {
|
|
79
|
+
static styles = [...DuiSidebarMenuButtonPrimitive.styles, styles];
|
|
80
|
+
}
|
|
81
|
+
customElements.define(DuiSidebarMenuButton.tagName, DuiSidebarMenuButton);
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
* `<dui-sidebar-menu-item>` — Individual navigation item in a sidebar menu.
|
|
5
|
-
*
|
|
6
|
-
* @slot - Default slot for a `<dui-sidebar-menu-button>` or other content.
|
|
7
|
-
*/
|
|
8
|
-
export declare class DuiSidebarMenuItem extends LitElement {
|
|
9
|
-
static tagName: "dui-sidebar-menu-item";
|
|
1
|
+
import { DuiSidebarMenuItemPrimitive } from "@deepfuture/dui-primitives/sidebar";
|
|
2
|
+
import "../_install.js";
|
|
3
|
+
export declare class DuiSidebarMenuItem extends DuiSidebarMenuItemPrimitive {
|
|
10
4
|
static styles: import("lit").CSSResult[];
|
|
11
|
-
render(): TemplateResult;
|
|
12
5
|
}
|
|
@@ -1,20 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
const styles = css
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
`;
|
|
9
|
-
/**
|
|
10
|
-
* `<dui-sidebar-menu-item>` — Individual navigation item in a sidebar menu.
|
|
11
|
-
*
|
|
12
|
-
* @slot - Default slot for a `<dui-sidebar-menu-button>` or other content.
|
|
13
|
-
*/
|
|
14
|
-
export class DuiSidebarMenuItem extends LitElement {
|
|
15
|
-
static tagName = "dui-sidebar-menu-item";
|
|
16
|
-
static styles = [base, styles];
|
|
17
|
-
render() {
|
|
18
|
-
return html `<slot></slot>`;
|
|
19
|
-
}
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
import { DuiSidebarMenuItemPrimitive } from "@deepfuture/dui-primitives/sidebar";
|
|
3
|
+
import "../_install.js";
|
|
4
|
+
const styles = css ``;
|
|
5
|
+
export class DuiSidebarMenuItem extends DuiSidebarMenuItemPrimitive {
|
|
6
|
+
static styles = [...DuiSidebarMenuItemPrimitive.styles, styles];
|
|
20
7
|
}
|
|
8
|
+
customElements.define(DuiSidebarMenuItem.tagName, DuiSidebarMenuItem);
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
* `<dui-sidebar-menu>` — Navigation list within a sidebar group.
|
|
5
|
-
*
|
|
6
|
-
* Renders a semantic `<ul>` for menu items.
|
|
7
|
-
*
|
|
8
|
-
* @slot - Default slot for `<dui-sidebar-menu-item>` elements.
|
|
9
|
-
*/
|
|
10
|
-
export declare class DuiSidebarMenu extends LitElement {
|
|
11
|
-
static tagName: "dui-sidebar-menu";
|
|
1
|
+
import { DuiSidebarMenuPrimitive } from "@deepfuture/dui-primitives/sidebar";
|
|
2
|
+
import "../_install.js";
|
|
3
|
+
export declare class DuiSidebarMenu extends DuiSidebarMenuPrimitive {
|
|
12
4
|
static styles: import("lit").CSSResult[];
|
|
13
|
-
render(): TemplateResult;
|
|
14
5
|
}
|
package/sidebar/sidebar-menu.js
CHANGED
|
@@ -1,30 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
import { DuiSidebarMenuPrimitive } from "@deepfuture/dui-primitives/sidebar";
|
|
3
|
+
import "../_install.js";
|
|
4
4
|
const styles = css `
|
|
5
5
|
.Menu {
|
|
6
|
-
|
|
7
|
-
flex-direction: column;
|
|
8
|
-
list-style: none;
|
|
9
|
-
margin: 0;
|
|
10
|
-
padding: 0;
|
|
6
|
+
gap: var(--space-px);
|
|
11
7
|
}
|
|
12
8
|
`;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
*
|
|
16
|
-
* Renders a semantic `<ul>` for menu items.
|
|
17
|
-
*
|
|
18
|
-
* @slot - Default slot for `<dui-sidebar-menu-item>` elements.
|
|
19
|
-
*/
|
|
20
|
-
export class DuiSidebarMenu extends LitElement {
|
|
21
|
-
static tagName = "dui-sidebar-menu";
|
|
22
|
-
static styles = [base, styles];
|
|
23
|
-
render() {
|
|
24
|
-
return html `
|
|
25
|
-
<ul class="Menu" role="list">
|
|
26
|
-
<slot></slot>
|
|
27
|
-
</ul>
|
|
28
|
-
`;
|
|
29
|
-
}
|
|
9
|
+
export class DuiSidebarMenu extends DuiSidebarMenuPrimitive {
|
|
10
|
+
static styles = [...DuiSidebarMenuPrimitive.styles, styles];
|
|
30
11
|
}
|
|
12
|
+
customElements.define(DuiSidebarMenu.tagName, DuiSidebarMenu);
|
|
@@ -1,36 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
export type SidebarOpenChangeDetail = {
|
|
5
|
-
open: boolean;
|
|
6
|
-
};
|
|
7
|
-
export declare const openChangeEvent: (detail: SidebarOpenChangeDetail) => CustomEvent<SidebarOpenChangeDetail>;
|
|
8
|
-
/**
|
|
9
|
-
* `<dui-sidebar-provider>` — Root state manager for the sidebar compound component.
|
|
10
|
-
*
|
|
11
|
-
* Manages open/close state, mobile detection, and provides context to all
|
|
12
|
-
* sidebar sub-components. Wraps the entire layout (sidebar + main content).
|
|
13
|
-
*
|
|
14
|
-
* @slot - Default slot for sidebar and content areas.
|
|
15
|
-
* @fires open-change - Fired when the sidebar opens or closes. Detail: { open: boolean }
|
|
16
|
-
*/
|
|
17
|
-
export declare class DuiSidebarProvider extends LitElement {
|
|
18
|
-
#private;
|
|
19
|
-
static tagName: "dui-sidebar-provider";
|
|
1
|
+
import { DuiSidebarProviderPrimitive } from "@deepfuture/dui-primitives/sidebar";
|
|
2
|
+
import "../_install.js";
|
|
3
|
+
export declare class DuiSidebarProvider extends DuiSidebarProviderPrimitive {
|
|
20
4
|
static styles: import("lit").CSSResult[];
|
|
21
|
-
/** Controls the sidebar open state (controlled mode). */
|
|
22
|
-
accessor open: boolean | undefined;
|
|
23
|
-
/** Initial open state for uncontrolled mode. Defaults to true. */
|
|
24
|
-
accessor defaultOpen: boolean;
|
|
25
|
-
/** Which side the sidebar appears on. */
|
|
26
|
-
accessor side: "left" | "right";
|
|
27
|
-
/** Visual variant of the sidebar. */
|
|
28
|
-
accessor variant: string;
|
|
29
|
-
/** How the sidebar collapses. */
|
|
30
|
-
accessor collapsible: "offcanvas" | "icon" | "none";
|
|
31
|
-
accessor _ctx: SidebarContext;
|
|
32
|
-
connectedCallback(): void;
|
|
33
|
-
disconnectedCallback(): void;
|
|
34
|
-
willUpdate(): void;
|
|
35
|
-
render(): TemplateResult;
|
|
36
5
|
}
|