@deepfuture/dui-components 0.0.21 → 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 -194
- 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 -535
- package/select/index.d.ts +3 -4
- package/select/index.js +2 -3
- package/select/select.d.ts +3 -39
- package/select/select.js +115 -425
- 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 -85
- 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 -33
- package/split-button/split-button.js +307 -394
- package/stepper/index.d.ts +3 -3
- package/stepper/index.js +3 -3
- package/stepper/stepper.d.ts +3 -41
- package/stepper/stepper.js +57 -381
- package/switch/index.d.ts +3 -3
- package/switch/index.js +3 -3
- package/switch/switch.d.ts +3 -30
- package/switch/switch.js +63 -228
- package/tabs/index.d.ts +12 -12
- package/tabs/index.js +11 -11
- package/tabs/tab.d.ts +3 -14
- package/tabs/tab.js +33 -131
- package/tabs/tabs-indicator.d.ts +3 -9
- package/tabs/tabs-indicator.js +17 -22
- package/tabs/tabs-list.d.ts +3 -15
- package/tabs/tabs-list.js +14 -113
- package/tabs/tabs-panel.d.ts +3 -16
- package/tabs/tabs-panel.js +32 -114
- package/tabs/tabs.d.ts +3 -22
- package/tabs/tabs.js +8 -170
- package/textarea/index.d.ts +4 -4
- package/textarea/index.js +3 -3
- package/textarea/textarea.d.ts +3 -36
- package/textarea/textarea.js +63 -220
- package/toggle/index.d.ts +6 -6
- package/toggle/index.js +5 -5
- package/toggle/toggle-group.d.ts +3 -27
- package/toggle/toggle-group.js +9 -224
- package/toggle/toggle.d.ts +3 -26
- package/toggle/toggle.js +94 -178
- package/tokens/properties.css +361 -0
- package/tokens/prose.css +250 -0
- package/tokens/prose.d.ts +2 -0
- package/tokens/prose.js +4 -0
- package/tokens/tokens-raw.d.ts +2 -0
- package/tokens/tokens-raw.js +2 -0
- package/tokens/tokens.css +409 -0
- package/tokens/tokens.d.ts +2 -0
- package/tokens/tokens.js +5 -0
- package/toolbar/index.d.ts +2 -3
- package/toolbar/index.js +2 -3
- package/toolbar/toolbar.d.ts +3 -11
- package/toolbar/toolbar.js +25 -116
- package/tooltip/index.d.ts +9 -9
- package/tooltip/index.js +7 -7
- package/tooltip/tooltip-popup.d.ts +3 -14
- package/tooltip/tooltip-popup.js +32 -185
- package/tooltip/tooltip-trigger.d.ts +3 -14
- package/tooltip/tooltip-trigger.js +5 -148
- package/tooltip/tooltip.d.ts +3 -35
- package/tooltip/tooltip.js +8 -253
- package/trunc/index.d.ts +2 -3
- package/trunc/index.js +2 -3
- package/trunc/trunc.d.ts +3 -17
- package/trunc/trunc.js +10 -108
- package/_deprecated/center/center.d.ts +0 -14
- package/_deprecated/center/center.js +0 -37
- package/_deprecated/center/index.d.ts +0 -3
- package/_deprecated/center/index.js +0 -3
- package/_deprecated/center/register.js +0 -4
- package/_deprecated/hstack/hstack.d.ts +0 -25
- package/_deprecated/hstack/hstack.js +0 -187
- package/_deprecated/hstack/index.d.ts +0 -4
- package/_deprecated/hstack/index.js +0 -3
- package/_deprecated/hstack/register.d.ts +0 -1
- package/_deprecated/hstack/register.js +0 -4
- package/_deprecated/page-inset/index.d.ts +0 -3
- package/_deprecated/page-inset/index.js +0 -3
- package/_deprecated/page-inset/page-inset.d.ts +0 -28
- package/_deprecated/page-inset/page-inset.js +0 -151
- package/_deprecated/page-inset/register.d.ts +0 -1
- package/_deprecated/page-inset/register.js +0 -4
- package/_deprecated/vstack/index.d.ts +0 -3
- package/_deprecated/vstack/index.js +0 -3
- package/_deprecated/vstack/register.d.ts +0 -1
- package/_deprecated/vstack/register.js +0 -4
- package/_deprecated/vstack/vstack.d.ts +0 -17
- package/_deprecated/vstack/vstack.js +0 -125
- package/accordion/accordion-context.d.ts +0 -15
- package/accordion/accordion-context.js +0 -3
- package/alert-dialog/alert-dialog-context.d.ts +0 -13
- package/alert-dialog/alert-dialog-context.js +0 -3
- package/checkbox/checkbox-group-context.d.ts +0 -11
- package/checkbox/checkbox-group-context.js +0 -3
- package/command/command-context.d.ts +0 -30
- package/command/command-context.js +0 -3
- package/command/command-score.d.ts +0 -6
- package/command/command-score.js +0 -31
- package/dialog/dialog-context.d.ts +0 -13
- package/dialog/dialog-context.js +0 -3
- package/global.d.ts +0 -179
- package/menubar/menubar-context.d.ts +0 -9
- package/menubar/menubar-context.js +0 -2
- package/popover/popover-context.d.ts +0 -17
- package/popover/popover-context.js +0 -3
- package/preview-card/preview-card-context.d.ts +0 -16
- package/preview-card/preview-card-context.js +0 -3
- package/radio/radio-group-context.d.ts +0 -11
- package/radio/radio-group-context.js +0 -2
- package/sidebar/sidebar-context.d.ts +0 -15
- package/sidebar/sidebar-context.js +0 -3
- package/split-button/register.d.ts +0 -1
- package/split-button/register.js +0 -4
- package/tabs/tabs-context.d.ts +0 -8
- package/tabs/tabs-context.js +0 -2
- package/toggle/toggle-group-context.d.ts +0 -9
- package/toggle/toggle-group-context.js +0 -2
- package/tooltip/tooltip-context.d.ts +0 -17
- package/tooltip/tooltip-context.js +0 -3
- /package/{_deprecated/center/register.d.ts → _install.d.ts} +0 -0
package/avatar/avatar.js
CHANGED
|
@@ -1,248 +1,28 @@
|
|
|
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
|
-
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
37
|
-
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
38
|
-
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
39
|
-
};
|
|
40
|
-
import { css, html, LitElement, nothing, } from "lit";
|
|
41
|
-
import { property, state } from "lit/decorators.js";
|
|
42
|
-
import { base } from "@deepfuture/dui-core/base";
|
|
43
|
-
import { customEvent } from "@deepfuture/dui-core/event";
|
|
44
|
-
export const loadingStatusChangeEvent = customEvent("loading-status-change", { bubbles: true, composed: true });
|
|
45
|
-
/** Structural styles only — layout CSS. */
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
import { DuiAvatarPrimitive } from "@deepfuture/dui-primitives/avatar";
|
|
3
|
+
import "../_install.js";
|
|
46
4
|
const styles = css `
|
|
47
5
|
:host {
|
|
48
|
-
--avatar-
|
|
49
|
-
|
|
6
|
+
--avatar-bg: oklch(from var(--foreground) l c h / 0.08);
|
|
7
|
+
--avatar-fg: var(--text-2);
|
|
50
8
|
}
|
|
51
9
|
|
|
52
10
|
[part="root"] {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
overflow: hidden;
|
|
59
|
-
height: var(--avatar-size);
|
|
60
|
-
width: var(--avatar-size);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
[part="image"] {
|
|
64
|
-
object-fit: cover;
|
|
65
|
-
height: 100%;
|
|
66
|
-
width: 100%;
|
|
11
|
+
--icon-size: calc(var(--avatar-size) * 0.5);
|
|
12
|
+
--icon-color: var(--avatar-fg);
|
|
13
|
+
border-radius: var(--radius-full);
|
|
14
|
+
background: var(--avatar-bg);
|
|
15
|
+
color: var(--avatar-fg);
|
|
67
16
|
}
|
|
68
17
|
|
|
69
18
|
[part="fallback"] {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
height:
|
|
74
|
-
width: 100%;
|
|
19
|
+
font-family: var(--font-sans);
|
|
20
|
+
font-size: calc(var(--avatar-size) * 0.4);
|
|
21
|
+
font-weight: var(--font-weight-medium);
|
|
22
|
+
line-height: var(--line-height-none);
|
|
75
23
|
}
|
|
76
24
|
`;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
* Falls back to slotted content (e.g. initials) after an optional delay.
|
|
82
|
-
*
|
|
83
|
-
* @slot - Fallback content shown when the image is unavailable.
|
|
84
|
-
* @csspart root - The avatar container.
|
|
85
|
-
* @csspart image - The avatar image element.
|
|
86
|
-
* @csspart fallback - The fallback content container.
|
|
87
|
-
* @cssprop --avatar-size - Avatar dimensions (width and height). Default: var(--space-12).
|
|
88
|
-
* @fires loading-status-change - Fired when the image loading status changes. Detail: { status }
|
|
89
|
-
*/
|
|
90
|
-
let DuiAvatar = (() => {
|
|
91
|
-
let _classSuper = LitElement;
|
|
92
|
-
let _src_decorators;
|
|
93
|
-
let _src_initializers = [];
|
|
94
|
-
let _src_extraInitializers = [];
|
|
95
|
-
let _alt_decorators;
|
|
96
|
-
let _alt_initializers = [];
|
|
97
|
-
let _alt_extraInitializers = [];
|
|
98
|
-
let _fallbackDelay_decorators;
|
|
99
|
-
let _fallbackDelay_initializers = [];
|
|
100
|
-
let _fallbackDelay_extraInitializers = [];
|
|
101
|
-
let _size_decorators;
|
|
102
|
-
let _size_initializers = [];
|
|
103
|
-
let _size_extraInitializers = [];
|
|
104
|
-
let _private_imageStatus_decorators;
|
|
105
|
-
let _private_imageStatus_initializers = [];
|
|
106
|
-
let _private_imageStatus_extraInitializers = [];
|
|
107
|
-
let _private_imageStatus_descriptor;
|
|
108
|
-
let _private_delayPassed_decorators;
|
|
109
|
-
let _private_delayPassed_initializers = [];
|
|
110
|
-
let _private_delayPassed_extraInitializers = [];
|
|
111
|
-
let _private_delayPassed_descriptor;
|
|
112
|
-
return class DuiAvatar extends _classSuper {
|
|
113
|
-
static {
|
|
114
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
115
|
-
_src_decorators = [property()];
|
|
116
|
-
_alt_decorators = [property()];
|
|
117
|
-
_fallbackDelay_decorators = [property({ type: Number, attribute: "fallback-delay" })];
|
|
118
|
-
_size_decorators = [property({ reflect: true })];
|
|
119
|
-
_private_imageStatus_decorators = [state()];
|
|
120
|
-
_private_delayPassed_decorators = [state()];
|
|
121
|
-
__esDecorate(this, null, _src_decorators, { kind: "accessor", name: "src", static: false, private: false, access: { has: obj => "src" in obj, get: obj => obj.src, set: (obj, value) => { obj.src = value; } }, metadata: _metadata }, _src_initializers, _src_extraInitializers);
|
|
122
|
-
__esDecorate(this, null, _alt_decorators, { kind: "accessor", name: "alt", static: false, private: false, access: { has: obj => "alt" in obj, get: obj => obj.alt, set: (obj, value) => { obj.alt = value; } }, metadata: _metadata }, _alt_initializers, _alt_extraInitializers);
|
|
123
|
-
__esDecorate(this, null, _fallbackDelay_decorators, { kind: "accessor", name: "fallbackDelay", static: false, private: false, access: { has: obj => "fallbackDelay" in obj, get: obj => obj.fallbackDelay, set: (obj, value) => { obj.fallbackDelay = value; } }, metadata: _metadata }, _fallbackDelay_initializers, _fallbackDelay_extraInitializers);
|
|
124
|
-
__esDecorate(this, null, _size_decorators, { kind: "accessor", name: "size", static: false, private: false, access: { has: obj => "size" in obj, get: obj => obj.size, set: (obj, value) => { obj.size = value; } }, metadata: _metadata }, _size_initializers, _size_extraInitializers);
|
|
125
|
-
__esDecorate(this, _private_imageStatus_descriptor = { get: __setFunctionName(function () { return this.#imageStatus_accessor_storage; }, "#imageStatus", "get"), set: __setFunctionName(function (value) { this.#imageStatus_accessor_storage = value; }, "#imageStatus", "set") }, _private_imageStatus_decorators, { kind: "accessor", name: "#imageStatus", static: false, private: true, access: { has: obj => #imageStatus in obj, get: obj => obj.#imageStatus, set: (obj, value) => { obj.#imageStatus = value; } }, metadata: _metadata }, _private_imageStatus_initializers, _private_imageStatus_extraInitializers);
|
|
126
|
-
__esDecorate(this, _private_delayPassed_descriptor = { get: __setFunctionName(function () { return this.#delayPassed_accessor_storage; }, "#delayPassed", "get"), set: __setFunctionName(function (value) { this.#delayPassed_accessor_storage = value; }, "#delayPassed", "set") }, _private_delayPassed_decorators, { kind: "accessor", name: "#delayPassed", static: false, private: true, access: { has: obj => #delayPassed in obj, get: obj => obj.#delayPassed, set: (obj, value) => { obj.#delayPassed = value; } }, metadata: _metadata }, _private_delayPassed_initializers, _private_delayPassed_extraInitializers);
|
|
127
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
128
|
-
}
|
|
129
|
-
static tagName = "dui-avatar";
|
|
130
|
-
static styles = [base, styles];
|
|
131
|
-
#src_accessor_storage = __runInitializers(this, _src_initializers, undefined);
|
|
132
|
-
/** Image URL for the avatar. */
|
|
133
|
-
get src() { return this.#src_accessor_storage; }
|
|
134
|
-
set src(value) { this.#src_accessor_storage = value; }
|
|
135
|
-
#alt_accessor_storage = (__runInitializers(this, _src_extraInitializers), __runInitializers(this, _alt_initializers, ""));
|
|
136
|
-
/** Alt text for the avatar image. */
|
|
137
|
-
get alt() { return this.#alt_accessor_storage; }
|
|
138
|
-
set alt(value) { this.#alt_accessor_storage = value; }
|
|
139
|
-
#fallbackDelay_accessor_storage = (__runInitializers(this, _alt_extraInitializers), __runInitializers(this, _fallbackDelay_initializers, undefined));
|
|
140
|
-
/** Milliseconds to wait before showing fallback content. */
|
|
141
|
-
get fallbackDelay() { return this.#fallbackDelay_accessor_storage; }
|
|
142
|
-
set fallbackDelay(value) { this.#fallbackDelay_accessor_storage = value; }
|
|
143
|
-
#size_accessor_storage = (__runInitializers(this, _fallbackDelay_extraInitializers), __runInitializers(this, _size_initializers, undefined));
|
|
144
|
-
/**
|
|
145
|
-
* Avatar size as a CSS length value (e.g. `"var(--space-8)"`, `"2rem"`).
|
|
146
|
-
* When set, overrides `--avatar-size` on the host.
|
|
147
|
-
*/
|
|
148
|
-
get size() { return this.#size_accessor_storage; }
|
|
149
|
-
set size(value) { this.#size_accessor_storage = value; }
|
|
150
|
-
#imageStatus_accessor_storage = (__runInitializers(this, _size_extraInitializers), __runInitializers(this, _private_imageStatus_initializers, "idle"));
|
|
151
|
-
get #imageStatus() { return _private_imageStatus_descriptor.get.call(this); }
|
|
152
|
-
set #imageStatus(value) { return _private_imageStatus_descriptor.set.call(this, value); }
|
|
153
|
-
#delayPassed_accessor_storage = (__runInitializers(this, _private_imageStatus_extraInitializers), __runInitializers(this, _private_delayPassed_initializers, false));
|
|
154
|
-
get #delayPassed() { return _private_delayPassed_descriptor.get.call(this); }
|
|
155
|
-
set #delayPassed(value) { return _private_delayPassed_descriptor.set.call(this, value); }
|
|
156
|
-
#probeImage = __runInitializers(this, _private_delayPassed_extraInitializers);
|
|
157
|
-
#delayTimer;
|
|
158
|
-
#setImageStatus(status) {
|
|
159
|
-
this.#imageStatus = status;
|
|
160
|
-
this.dispatchEvent(loadingStatusChangeEvent({ status }));
|
|
161
|
-
}
|
|
162
|
-
#startProbe() {
|
|
163
|
-
this.#cleanupProbe();
|
|
164
|
-
if (!this.src) {
|
|
165
|
-
this.#setImageStatus("error");
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
this.#setImageStatus("loading");
|
|
169
|
-
const img = new Image();
|
|
170
|
-
img.onload = () => this.#setImageStatus("loaded");
|
|
171
|
-
img.onerror = () => this.#setImageStatus("error");
|
|
172
|
-
img.src = this.src;
|
|
173
|
-
this.#probeImage = img;
|
|
174
|
-
}
|
|
175
|
-
#cleanupProbe() {
|
|
176
|
-
if (this.#probeImage) {
|
|
177
|
-
this.#probeImage.onload = null;
|
|
178
|
-
this.#probeImage.onerror = null;
|
|
179
|
-
this.#probeImage = undefined;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
#startDelay() {
|
|
183
|
-
this.#clearDelay();
|
|
184
|
-
if (this.fallbackDelay === undefined || this.fallbackDelay <= 0) {
|
|
185
|
-
this.#delayPassed = true;
|
|
186
|
-
return;
|
|
187
|
-
}
|
|
188
|
-
this.#delayPassed = false;
|
|
189
|
-
this.#delayTimer = setTimeout(() => {
|
|
190
|
-
this.#delayPassed = true;
|
|
191
|
-
}, this.fallbackDelay);
|
|
192
|
-
}
|
|
193
|
-
#clearDelay() {
|
|
194
|
-
if (this.#delayTimer !== undefined) {
|
|
195
|
-
clearTimeout(this.#delayTimer);
|
|
196
|
-
this.#delayTimer = undefined;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
connectedCallback() {
|
|
200
|
-
super.connectedCallback();
|
|
201
|
-
this.#startDelay();
|
|
202
|
-
this.#startProbe();
|
|
203
|
-
}
|
|
204
|
-
disconnectedCallback() {
|
|
205
|
-
super.disconnectedCallback();
|
|
206
|
-
this.#cleanupProbe();
|
|
207
|
-
this.#clearDelay();
|
|
208
|
-
}
|
|
209
|
-
willUpdate(changed) {
|
|
210
|
-
if (changed.has("size")) {
|
|
211
|
-
if (this.size) {
|
|
212
|
-
this.style.setProperty("--avatar-size", this.size);
|
|
213
|
-
}
|
|
214
|
-
else {
|
|
215
|
-
this.style.removeProperty("--avatar-size");
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
if (changed.has("src")) {
|
|
219
|
-
this.#startProbe();
|
|
220
|
-
}
|
|
221
|
-
if (changed.has("fallbackDelay")) {
|
|
222
|
-
this.#startDelay();
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
render() {
|
|
226
|
-
const showImage = this.src && this.#imageStatus === "loaded";
|
|
227
|
-
const showFallback = !showImage && this.#delayPassed;
|
|
228
|
-
return html `
|
|
229
|
-
<span part="root">
|
|
230
|
-
${showImage
|
|
231
|
-
? html `
|
|
232
|
-
<img
|
|
233
|
-
part="image"
|
|
234
|
-
src="${this.src}"
|
|
235
|
-
alt="${this.alt}"
|
|
236
|
-
/>
|
|
237
|
-
`
|
|
238
|
-
: showFallback
|
|
239
|
-
? html `
|
|
240
|
-
<span part="fallback"><slot></slot></span>
|
|
241
|
-
`
|
|
242
|
-
: nothing}
|
|
243
|
-
</span>
|
|
244
|
-
`;
|
|
245
|
-
}
|
|
246
|
-
};
|
|
247
|
-
})();
|
|
248
|
-
export { DuiAvatar };
|
|
25
|
+
export class DuiAvatar extends DuiAvatarPrimitive {
|
|
26
|
+
static styles = [...DuiAvatarPrimitive.styles, styles];
|
|
27
|
+
}
|
|
28
|
+
customElements.define(DuiAvatar.tagName, DuiAvatar);
|
package/avatar/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { DuiAvatar
|
|
3
|
-
export type { ImageStatus } from "
|
|
4
|
-
export
|
|
1
|
+
import "./avatar.js";
|
|
2
|
+
export { DuiAvatar } from "./avatar.js";
|
|
3
|
+
export type { ImageStatus } from "@deepfuture/dui-primitives/avatar";
|
|
4
|
+
export { loadingStatusChangeEvent } from "@deepfuture/dui-primitives/avatar";
|
package/avatar/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { DuiAvatar
|
|
3
|
-
export
|
|
1
|
+
import "./avatar.js";
|
|
2
|
+
export { DuiAvatar } from "./avatar.js";
|
|
3
|
+
export { loadingStatusChangeEvent } from "@deepfuture/dui-primitives/avatar";
|
package/badge/badge.d.ts
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
* @slot - Badge content — text and/or icons.
|
|
6
|
-
* @csspart root - The badge span element.
|
|
7
|
-
*/
|
|
8
|
-
export declare class DuiBadge extends LitElement {
|
|
9
|
-
static tagName: "dui-badge";
|
|
1
|
+
import { DuiBadgePrimitive } from "@deepfuture/dui-primitives/badge";
|
|
2
|
+
import "../_install.js";
|
|
3
|
+
export declare class DuiBadge extends DuiBadgePrimitive {
|
|
10
4
|
static styles: import("lit").CSSResult[];
|
|
11
|
-
render(): TemplateResult;
|
|
12
5
|
}
|
package/badge/badge.js
CHANGED
|
@@ -1,30 +1,96 @@
|
|
|
1
|
-
import { css
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
import { DuiBadgePrimitive } from "@deepfuture/dui-primitives/badge";
|
|
3
|
+
import "../_install.js";
|
|
4
4
|
const styles = css `
|
|
5
|
+
/* =================================================================
|
|
6
|
+
* Two-axis variant system:
|
|
7
|
+
* variant → semantic intent (neutral, accent, danger)
|
|
8
|
+
* appearance → visual treatment (filled, outline, ghost)
|
|
9
|
+
* ================================================================= */
|
|
10
|
+
|
|
11
|
+
/* ---------------------------------------------------------------
|
|
12
|
+
* Layer 1 — Intent (sets --_intent-* private tokens)
|
|
13
|
+
* --------------------------------------------------------------- */
|
|
14
|
+
|
|
15
|
+
:host,
|
|
16
|
+
:host([variant=""]),
|
|
17
|
+
:host([variant="neutral"]) {
|
|
18
|
+
--_intent-base: var(--foreground);
|
|
19
|
+
--_intent-base-fg: var(--background);
|
|
20
|
+
--_intent-subtle: oklch(from var(--foreground) l c h / 0.08);
|
|
21
|
+
--_intent-subtle-fg: var(--text-2);
|
|
22
|
+
--_intent-border: var(--border-strong);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:host([variant="primary"]) {
|
|
26
|
+
--_intent-base: var(--accent);
|
|
27
|
+
--_intent-base-fg: oklch(from var(--accent) 0.98 0.01 h);
|
|
28
|
+
--_intent-subtle: var(--accent-subtle);
|
|
29
|
+
--_intent-subtle-fg: var(--accent-text);
|
|
30
|
+
--_intent-border: oklch(from var(--accent) l c h / 0.5);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:host([variant="danger"]) {
|
|
34
|
+
--_intent-base: var(--destructive);
|
|
35
|
+
--_intent-base-fg: oklch(from var(--destructive) 0.98 0.01 h);
|
|
36
|
+
--_intent-subtle: var(--destructive-subtle);
|
|
37
|
+
--_intent-subtle-fg: oklch(from var(--destructive-text) l c h / 0.8);
|
|
38
|
+
--_intent-border: oklch(from var(--destructive) l c h / 0.5);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* ---------------------------------------------------------------
|
|
42
|
+
* Layer 2 — Appearance (maps --_intent-* to --badge-*)
|
|
43
|
+
* --------------------------------------------------------------- */
|
|
44
|
+
|
|
45
|
+
:host,
|
|
46
|
+
:host([appearance=""]),
|
|
47
|
+
:host([appearance="filled"]) {
|
|
48
|
+
--badge-bg: var(--_intent-base);
|
|
49
|
+
--badge-fg: var(--_intent-base-fg);
|
|
50
|
+
--badge-border: transparent;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:host([appearance="outline"]) {
|
|
54
|
+
--badge-bg: transparent;
|
|
55
|
+
--badge-fg: var(--_intent-subtle-fg);
|
|
56
|
+
--badge-border: var(--_intent-border);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:host([appearance="soft"]) {
|
|
60
|
+
--badge-bg: var(--_intent-subtle);
|
|
61
|
+
--badge-fg: var(--_intent-subtle-fg);
|
|
62
|
+
--badge-border: transparent;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* ---------------------------------------------------------------
|
|
66
|
+
* Sizing & base appearance
|
|
67
|
+
* --------------------------------------------------------------- */
|
|
68
|
+
|
|
5
69
|
:host {
|
|
6
|
-
|
|
70
|
+
--badge-icon-size: var(--space-3);
|
|
71
|
+
--icon-size: var(--badge-icon-size);
|
|
72
|
+
--icon-color: var(--badge-fg);
|
|
73
|
+
vertical-align: middle;
|
|
74
|
+
line-height: 0;
|
|
7
75
|
}
|
|
8
76
|
|
|
9
77
|
[part="root"] {
|
|
10
|
-
display: inline-
|
|
11
|
-
|
|
78
|
+
/* display: inline-block; */
|
|
79
|
+
gap: var(--space-1);
|
|
80
|
+
height: var(--space-5);
|
|
81
|
+
padding: 0 var(--space-2);
|
|
82
|
+
border-radius: var(--radius-full);
|
|
83
|
+
background: var(--badge-bg);
|
|
84
|
+
color: var(--badge-fg);
|
|
85
|
+
font-family: var(--font-sans);
|
|
86
|
+
font-size: var(--text-xs); letter-spacing: var(--letter-spacing-normal); line-height: var(--line-height-snug);
|
|
87
|
+
font-weight: var(--font-weight-medium);
|
|
88
|
+
text-box: trim-both cap alphabetic;
|
|
89
|
+
white-space: nowrap;
|
|
90
|
+
border: var(--border-width-thin) solid var(--badge-border);
|
|
12
91
|
}
|
|
13
92
|
`;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*
|
|
17
|
-
* @slot - Badge content — text and/or icons.
|
|
18
|
-
* @csspart root - The badge span element.
|
|
19
|
-
*/
|
|
20
|
-
export class DuiBadge extends LitElement {
|
|
21
|
-
static tagName = "dui-badge";
|
|
22
|
-
static styles = [base, styles];
|
|
23
|
-
render() {
|
|
24
|
-
return html `
|
|
25
|
-
<span part="root">
|
|
26
|
-
<slot></slot>
|
|
27
|
-
</span>
|
|
28
|
-
`;
|
|
29
|
-
}
|
|
93
|
+
export class DuiBadge extends DuiBadgePrimitive {
|
|
94
|
+
static styles = [...DuiBadgePrimitive.styles, styles];
|
|
30
95
|
}
|
|
96
|
+
customElements.define(DuiBadge.tagName, DuiBadge);
|
package/badge/index.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { DuiBadge };
|
|
3
|
-
export declare const badgeFamily: (typeof DuiBadge)[];
|
|
1
|
+
import "./badge.js";
|
|
2
|
+
export { DuiBadge } from "./badge.js";
|
package/badge/index.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { DuiBadge };
|
|
3
|
-
export const badgeFamily = [DuiBadge];
|
|
1
|
+
import "./badge.js";
|
|
2
|
+
export { DuiBadge } from "./badge.js";
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
* `<dui-breadcrumb-ellipsis>` — Collapsed breadcrumb indicator.
|
|
5
|
-
* Defaults to "\u2026" but can be overridden via slot (e.g., an icon).
|
|
6
|
-
*
|
|
7
|
-
* @slot - Custom ellipsis content. Defaults to "\u2026".
|
|
8
|
-
* @csspart root - The `<span>` element (presentational, aria-hidden).
|
|
9
|
-
*/
|
|
10
|
-
export declare class DuiBreadcrumbEllipsis extends LitElement {
|
|
11
|
-
static tagName: "dui-breadcrumb-ellipsis";
|
|
1
|
+
import { DuiBreadcrumbEllipsisPrimitive } from "@deepfuture/dui-primitives/breadcrumb";
|
|
2
|
+
import "../_install.js";
|
|
3
|
+
export declare class DuiBreadcrumbEllipsis extends DuiBreadcrumbEllipsisPrimitive {
|
|
12
4
|
static styles: import("lit").CSSResult[];
|
|
13
|
-
render(): TemplateResult;
|
|
14
5
|
}
|
|
@@ -1,39 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
/** Structural styles only — layout CSS. */
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
import { DuiBreadcrumbEllipsisPrimitive } from "@deepfuture/dui-primitives/breadcrumb";
|
|
3
|
+
import "../_install.js";
|
|
5
4
|
const styles = css `
|
|
6
|
-
:host {
|
|
7
|
-
display: flex;
|
|
8
|
-
align-items: center;
|
|
9
|
-
justify-content: center;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
5
|
[part="root"] {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
justify-content: center;
|
|
6
|
+
color: var(--text-2);
|
|
7
|
+
width: var(--space-4);
|
|
16
8
|
}
|
|
17
9
|
`;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
* Defaults to "\u2026" but can be overridden via slot (e.g., an icon).
|
|
21
|
-
*
|
|
22
|
-
* @slot - Custom ellipsis content. Defaults to "\u2026".
|
|
23
|
-
* @csspart root - The `<span>` element (presentational, aria-hidden).
|
|
24
|
-
*/
|
|
25
|
-
export class DuiBreadcrumbEllipsis extends LitElement {
|
|
26
|
-
static tagName = "dui-breadcrumb-ellipsis";
|
|
27
|
-
static styles = [base, styles];
|
|
28
|
-
render() {
|
|
29
|
-
return html `
|
|
30
|
-
<span
|
|
31
|
-
role="presentation"
|
|
32
|
-
aria-hidden="true"
|
|
33
|
-
part="root"
|
|
34
|
-
>
|
|
35
|
-
<slot>…</slot>
|
|
36
|
-
</span>
|
|
37
|
-
`;
|
|
38
|
-
}
|
|
10
|
+
export class DuiBreadcrumbEllipsis extends DuiBreadcrumbEllipsisPrimitive {
|
|
11
|
+
static styles = [...DuiBreadcrumbEllipsisPrimitive.styles, styles];
|
|
39
12
|
}
|
|
13
|
+
customElements.define(DuiBreadcrumbEllipsis.tagName, DuiBreadcrumbEllipsis);
|
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
* `<dui-breadcrumb-item>` — List item wrapper for a single breadcrumb entry.
|
|
5
|
-
*
|
|
6
|
-
* @slot - A breadcrumb link, page, or ellipsis.
|
|
7
|
-
* @csspart root - The `<li>` element.
|
|
8
|
-
*/
|
|
9
|
-
export declare class DuiBreadcrumbItem extends LitElement {
|
|
10
|
-
static tagName: "dui-breadcrumb-item";
|
|
1
|
+
import { DuiBreadcrumbItemPrimitive } from "@deepfuture/dui-primitives/breadcrumb";
|
|
2
|
+
import "../_install.js";
|
|
3
|
+
export declare class DuiBreadcrumbItem extends DuiBreadcrumbItemPrimitive {
|
|
11
4
|
static styles: import("lit").CSSResult[];
|
|
12
|
-
render(): TemplateResult;
|
|
13
5
|
}
|
|
@@ -1,31 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
/** Structural styles only — layout CSS. */
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
import { DuiBreadcrumbItemPrimitive } from "@deepfuture/dui-primitives/breadcrumb";
|
|
3
|
+
import "../_install.js";
|
|
5
4
|
const styles = css `
|
|
6
|
-
:host {
|
|
7
|
-
display: inline-flex;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
5
|
[part="root"] {
|
|
11
|
-
|
|
12
|
-
align-items: center;
|
|
6
|
+
gap: var(--space-1_5);
|
|
13
7
|
}
|
|
14
8
|
`;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*
|
|
18
|
-
* @slot - A breadcrumb link, page, or ellipsis.
|
|
19
|
-
* @csspart root - The `<li>` element.
|
|
20
|
-
*/
|
|
21
|
-
export class DuiBreadcrumbItem extends LitElement {
|
|
22
|
-
static tagName = "dui-breadcrumb-item";
|
|
23
|
-
static styles = [base, styles];
|
|
24
|
-
render() {
|
|
25
|
-
return html `
|
|
26
|
-
<li part="root">
|
|
27
|
-
<slot></slot>
|
|
28
|
-
</li>
|
|
29
|
-
`;
|
|
30
|
-
}
|
|
9
|
+
export class DuiBreadcrumbItem extends DuiBreadcrumbItemPrimitive {
|
|
10
|
+
static styles = [...DuiBreadcrumbItemPrimitive.styles, styles];
|
|
31
11
|
}
|
|
12
|
+
customElements.define(DuiBreadcrumbItem.tagName, DuiBreadcrumbItem);
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
* `<dui-breadcrumb-link>` — Styled wrapper for a clickable breadcrumb link.
|
|
5
|
-
* Consumer slots in their own `<a>` element.
|
|
6
|
-
*
|
|
7
|
-
* @slot - An `<a>` element for navigation.
|
|
8
|
-
* @csspart root - The wrapper `<span>` element.
|
|
9
|
-
*/
|
|
10
|
-
export declare class DuiBreadcrumbLink extends LitElement {
|
|
11
|
-
static tagName: "dui-breadcrumb-link";
|
|
1
|
+
import { DuiBreadcrumbLinkPrimitive } from "@deepfuture/dui-primitives/breadcrumb";
|
|
2
|
+
import "../_install.js";
|
|
3
|
+
export declare class DuiBreadcrumbLink extends DuiBreadcrumbLinkPrimitive {
|
|
12
4
|
static styles: import("lit").CSSResult[];
|
|
13
|
-
render(): TemplateResult;
|
|
14
5
|
}
|
|
@@ -1,32 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
/** Structural styles only — layout CSS. */
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
import { DuiBreadcrumbLinkPrimitive } from "@deepfuture/dui-primitives/breadcrumb";
|
|
3
|
+
import "../_install.js";
|
|
5
4
|
const styles = css `
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
[part="root"] {
|
|
6
|
+
color: var(--text-2);
|
|
8
7
|
}
|
|
9
8
|
|
|
10
|
-
[part="root"] {
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
[part="root"] ::slotted(a) {
|
|
10
|
+
color: inherit;
|
|
11
|
+
text-decoration: none;
|
|
12
|
+
transition: color var(--duration-fast);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
[part="root"] ::slotted(a:hover) {
|
|
16
|
+
color: var(--text-1);
|
|
13
17
|
}
|
|
14
18
|
`;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
* Consumer slots in their own `<a>` element.
|
|
18
|
-
*
|
|
19
|
-
* @slot - An `<a>` element for navigation.
|
|
20
|
-
* @csspart root - The wrapper `<span>` element.
|
|
21
|
-
*/
|
|
22
|
-
export class DuiBreadcrumbLink extends LitElement {
|
|
23
|
-
static tagName = "dui-breadcrumb-link";
|
|
24
|
-
static styles = [base, styles];
|
|
25
|
-
render() {
|
|
26
|
-
return html `
|
|
27
|
-
<span part="root">
|
|
28
|
-
<slot></slot>
|
|
29
|
-
</span>
|
|
30
|
-
`;
|
|
31
|
-
}
|
|
19
|
+
export class DuiBreadcrumbLink extends DuiBreadcrumbLinkPrimitive {
|
|
20
|
+
static styles = [...DuiBreadcrumbLinkPrimitive.styles, styles];
|
|
32
21
|
}
|
|
22
|
+
customElements.define(DuiBreadcrumbLink.tagName, DuiBreadcrumbLink);
|
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
* `<dui-breadcrumb-page>` — Current page indicator (not clickable).
|
|
5
|
-
*
|
|
6
|
-
* @slot - The current page label text.
|
|
7
|
-
* @csspart root - The `<span>` element with `aria-current="page"`.
|
|
8
|
-
*/
|
|
9
|
-
export declare class DuiBreadcrumbPage extends LitElement {
|
|
10
|
-
static tagName: "dui-breadcrumb-page";
|
|
1
|
+
import { DuiBreadcrumbPagePrimitive } from "@deepfuture/dui-primitives/breadcrumb";
|
|
2
|
+
import "../_install.js";
|
|
3
|
+
export declare class DuiBreadcrumbPage extends DuiBreadcrumbPagePrimitive {
|
|
11
4
|
static styles: import("lit").CSSResult[];
|
|
12
|
-
render(): TemplateResult;
|
|
13
5
|
}
|