@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
|
@@ -1,36 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
/** Structural styles only — layout CSS. */
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
import { DuiBreadcrumbPagePrimitive } 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
|
-
|
|
6
|
+
color: var(--text-1);
|
|
7
|
+
font-weight: var(--font-weight-regular);
|
|
13
8
|
}
|
|
14
9
|
`;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*
|
|
18
|
-
* @slot - The current page label text.
|
|
19
|
-
* @csspart root - The `<span>` element with `aria-current="page"`.
|
|
20
|
-
*/
|
|
21
|
-
export class DuiBreadcrumbPage extends LitElement {
|
|
22
|
-
static tagName = "dui-breadcrumb-page";
|
|
23
|
-
static styles = [base, styles];
|
|
24
|
-
render() {
|
|
25
|
-
return html `
|
|
26
|
-
<span
|
|
27
|
-
role="link"
|
|
28
|
-
aria-disabled="true"
|
|
29
|
-
aria-current="page"
|
|
30
|
-
part="root"
|
|
31
|
-
>
|
|
32
|
-
<slot></slot>
|
|
33
|
-
</span>
|
|
34
|
-
`;
|
|
35
|
-
}
|
|
10
|
+
export class DuiBreadcrumbPage extends DuiBreadcrumbPagePrimitive {
|
|
11
|
+
static styles = [...DuiBreadcrumbPagePrimitive.styles, styles];
|
|
36
12
|
}
|
|
13
|
+
customElements.define(DuiBreadcrumbPage.tagName, DuiBreadcrumbPage);
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
* `<dui-breadcrumb-separator>` — Visual separator between breadcrumb items.
|
|
5
|
-
* Defaults to "/" but can be overridden via slot (e.g., a chevron icon).
|
|
6
|
-
*
|
|
7
|
-
* @slot - Custom separator content. Defaults to "/".
|
|
8
|
-
* @csspart root - The `<li>` element (presentational, aria-hidden).
|
|
9
|
-
*/
|
|
10
|
-
export declare class DuiBreadcrumbSeparator extends LitElement {
|
|
11
|
-
static tagName: "dui-breadcrumb-separator";
|
|
1
|
+
import { DuiBreadcrumbSeparatorPrimitive } from "@deepfuture/dui-primitives/breadcrumb";
|
|
2
|
+
import "../_install.js";
|
|
3
|
+
export declare class DuiBreadcrumbSeparator extends DuiBreadcrumbSeparatorPrimitive {
|
|
12
4
|
static styles: import("lit").CSSResult[];
|
|
13
|
-
render(): TemplateResult;
|
|
14
5
|
}
|
|
@@ -1,36 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
/** Structural styles only — layout CSS. */
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
import { DuiBreadcrumbSeparatorPrimitive } from "@deepfuture/dui-primitives/breadcrumb";
|
|
3
|
+
import "../_install.js";
|
|
5
4
|
const styles = css `
|
|
6
|
-
:host {
|
|
7
|
-
display: flex;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
5
|
[part="root"] {
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
--icon-size: var(--space-3_5);
|
|
7
|
+
color: color-mix(in oklch, var(--text-2) 50%, transparent);
|
|
13
8
|
}
|
|
14
9
|
`;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
* Defaults to "/" but can be overridden via slot (e.g., a chevron icon).
|
|
18
|
-
*
|
|
19
|
-
* @slot - Custom separator content. Defaults to "/".
|
|
20
|
-
* @csspart root - The `<li>` element (presentational, aria-hidden).
|
|
21
|
-
*/
|
|
22
|
-
export class DuiBreadcrumbSeparator extends LitElement {
|
|
23
|
-
static tagName = "dui-breadcrumb-separator";
|
|
24
|
-
static styles = [base, styles];
|
|
25
|
-
render() {
|
|
26
|
-
return html `
|
|
27
|
-
<li
|
|
28
|
-
role="presentation"
|
|
29
|
-
aria-hidden="true"
|
|
30
|
-
part="root"
|
|
31
|
-
>
|
|
32
|
-
<slot>/</slot>
|
|
33
|
-
</li>
|
|
34
|
-
`;
|
|
35
|
-
}
|
|
10
|
+
export class DuiBreadcrumbSeparator extends DuiBreadcrumbSeparatorPrimitive {
|
|
11
|
+
static styles = [...DuiBreadcrumbSeparatorPrimitive.styles, styles];
|
|
36
12
|
}
|
|
13
|
+
customElements.define(DuiBreadcrumbSeparator.tagName, DuiBreadcrumbSeparator);
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
* `<dui-breadcrumb>` — Root navigation wrapper for breadcrumb trails.
|
|
5
|
-
* Renders a `<nav>` with an internal `<ol>` for semantic structure.
|
|
6
|
-
*
|
|
7
|
-
* @slot - Breadcrumb items and separators.
|
|
8
|
-
* @csspart root - The `<ol>` element.
|
|
9
|
-
*/
|
|
10
|
-
export declare class DuiBreadcrumb extends LitElement {
|
|
11
|
-
static tagName: "dui-breadcrumb";
|
|
1
|
+
import { DuiBreadcrumbPrimitive } from "@deepfuture/dui-primitives/breadcrumb";
|
|
2
|
+
import "../_install.js";
|
|
3
|
+
export declare class DuiBreadcrumb extends DuiBreadcrumbPrimitive {
|
|
12
4
|
static styles: import("lit").CSSResult[];
|
|
13
|
-
render(): TemplateResult;
|
|
14
5
|
}
|
package/breadcrumb/breadcrumb.js
CHANGED
|
@@ -1,38 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
/** Structural styles only — layout CSS. */
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
import { DuiBreadcrumbPrimitive } from "@deepfuture/dui-primitives/breadcrumb";
|
|
3
|
+
import "../_install.js";
|
|
5
4
|
const styles = css `
|
|
6
|
-
:host {
|
|
7
|
-
display: block;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
5
|
[part="root"] {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
margin: 0;
|
|
16
|
-
padding: 0;
|
|
6
|
+
gap: var(--space-2);
|
|
7
|
+
font-size: var(--text-sm); line-height: var(--text-sm--line-height);
|
|
8
|
+
font-family: var(--font-sans);
|
|
9
|
+
color: var(--text-2);
|
|
17
10
|
}
|
|
18
11
|
`;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
* Renders a `<nav>` with an internal `<ol>` for semantic structure.
|
|
22
|
-
*
|
|
23
|
-
* @slot - Breadcrumb items and separators.
|
|
24
|
-
* @csspart root - The `<ol>` element.
|
|
25
|
-
*/
|
|
26
|
-
export class DuiBreadcrumb extends LitElement {
|
|
27
|
-
static tagName = "dui-breadcrumb";
|
|
28
|
-
static styles = [base, styles];
|
|
29
|
-
render() {
|
|
30
|
-
return html `
|
|
31
|
-
<nav aria-label="breadcrumb">
|
|
32
|
-
<ol part="root">
|
|
33
|
-
<slot></slot>
|
|
34
|
-
</ol>
|
|
35
|
-
</nav>
|
|
36
|
-
`;
|
|
37
|
-
}
|
|
12
|
+
export class DuiBreadcrumb extends DuiBreadcrumbPrimitive {
|
|
13
|
+
static styles = [...DuiBreadcrumbPrimitive.styles, styles];
|
|
38
14
|
}
|
|
15
|
+
customElements.define(DuiBreadcrumb.tagName, DuiBreadcrumb);
|
package/breadcrumb/index.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
|
|
12
|
-
export {
|
|
13
|
-
export declare const breadcrumbFamily: (typeof DuiBreadcrumb | typeof DuiBreadcrumbItem | typeof DuiBreadcrumbLink | typeof DuiBreadcrumbPage | typeof DuiBreadcrumbSeparator | typeof DuiBreadcrumbEllipsis)[];
|
|
1
|
+
import "./breadcrumb.js";
|
|
2
|
+
import "./breadcrumb-ellipsis.js";
|
|
3
|
+
import "./breadcrumb-item.js";
|
|
4
|
+
import "./breadcrumb-link.js";
|
|
5
|
+
import "./breadcrumb-page.js";
|
|
6
|
+
import "./breadcrumb-separator.js";
|
|
7
|
+
export { DuiBreadcrumb } from "./breadcrumb.js";
|
|
8
|
+
export { DuiBreadcrumbEllipsis } from "./breadcrumb-ellipsis.js";
|
|
9
|
+
export { DuiBreadcrumbItem } from "./breadcrumb-item.js";
|
|
10
|
+
export { DuiBreadcrumbLink } from "./breadcrumb-link.js";
|
|
11
|
+
export { DuiBreadcrumbPage } from "./breadcrumb-page.js";
|
|
12
|
+
export { DuiBreadcrumbSeparator } from "./breadcrumb-separator.js";
|
package/breadcrumb/index.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
|
|
12
|
-
export {
|
|
13
|
-
export const breadcrumbFamily = [DuiBreadcrumb, DuiBreadcrumbItem, DuiBreadcrumbLink, DuiBreadcrumbPage, DuiBreadcrumbSeparator, DuiBreadcrumbEllipsis];
|
|
1
|
+
import "./breadcrumb.js";
|
|
2
|
+
import "./breadcrumb-ellipsis.js";
|
|
3
|
+
import "./breadcrumb-item.js";
|
|
4
|
+
import "./breadcrumb-link.js";
|
|
5
|
+
import "./breadcrumb-page.js";
|
|
6
|
+
import "./breadcrumb-separator.js";
|
|
7
|
+
export { DuiBreadcrumb } from "./breadcrumb.js";
|
|
8
|
+
export { DuiBreadcrumbEllipsis } from "./breadcrumb-ellipsis.js";
|
|
9
|
+
export { DuiBreadcrumbItem } from "./breadcrumb-item.js";
|
|
10
|
+
export { DuiBreadcrumbLink } from "./breadcrumb-link.js";
|
|
11
|
+
export { DuiBreadcrumbPage } from "./breadcrumb-page.js";
|
|
12
|
+
export { DuiBreadcrumbSeparator } from "./breadcrumb-separator.js";
|
package/button/button.d.ts
CHANGED
|
@@ -1,34 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare
|
|
4
|
-
href: string;
|
|
5
|
-
}) => CustomEvent<{
|
|
6
|
-
href: string;
|
|
7
|
-
}>;
|
|
8
|
-
/**
|
|
9
|
-
* `<dui-button>` — A button component.
|
|
10
|
-
*
|
|
11
|
-
* Renders as a native `<button>` by default. When `href` is set, renders as a
|
|
12
|
-
* native `<a>` tag instead. Normal clicks fire a `dui-navigate` event that
|
|
13
|
-
* consumers handle for SPA routing.
|
|
14
|
-
*
|
|
15
|
-
* @slot - Button label / content.
|
|
16
|
-
* @csspart root - The button or anchor element.
|
|
17
|
-
* @fires dui-navigate - Fired on normal link clicks. Detail: { href: string }
|
|
18
|
-
*/
|
|
19
|
-
export declare class DuiButton extends LitElement {
|
|
20
|
-
#private;
|
|
21
|
-
static tagName: "dui-button";
|
|
22
|
-
static shadowRootOptions: {
|
|
23
|
-
delegatesFocus: boolean;
|
|
24
|
-
mode: ShadowRootMode;
|
|
25
|
-
serializable?: boolean;
|
|
26
|
-
slotAssignment?: SlotAssignmentMode;
|
|
27
|
-
};
|
|
1
|
+
import { DuiButtonPrimitive } from "@deepfuture/dui-primitives/button";
|
|
2
|
+
import "../_install.js";
|
|
3
|
+
export declare class DuiButton extends DuiButtonPrimitive {
|
|
28
4
|
static styles: import("lit").CSSResult[];
|
|
29
|
-
accessor disabled: boolean;
|
|
30
|
-
accessor focusableWhenDisabled: boolean;
|
|
31
|
-
accessor type: "button" | "submit" | "reset";
|
|
32
|
-
accessor href: string | undefined;
|
|
33
|
-
render(): TemplateResult;
|
|
34
5
|
}
|
package/button/button.js
CHANGED
|
@@ -1,174 +1,230 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
-
var _, done = false;
|
|
7
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
-
var context = {};
|
|
9
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
-
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
-
if (kind === "accessor") {
|
|
14
|
-
if (result === void 0) continue;
|
|
15
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
-
}
|
|
20
|
-
else if (_ = accept(result)) {
|
|
21
|
-
if (kind === "field") initializers.unshift(_);
|
|
22
|
-
else descriptor[key] = _;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
-
done = true;
|
|
27
|
-
};
|
|
28
|
-
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
-
var useValue = arguments.length > 2;
|
|
30
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
-
}
|
|
33
|
-
return useValue ? value : void 0;
|
|
34
|
-
};
|
|
35
|
-
import { css, html, LitElement, nothing } from "lit";
|
|
36
|
-
import { property } from "lit/decorators.js";
|
|
37
|
-
import { base } from "@deepfuture/dui-core/base";
|
|
38
|
-
import { customEvent } from "@deepfuture/dui-core/event";
|
|
39
|
-
/** Fired when a button with `href` is clicked via normal (non-modifier) click. */
|
|
40
|
-
export const navigateEvent = customEvent("dui-navigate", { bubbles: true, composed: true });
|
|
41
|
-
/** Structural styles only — layout and behavioral CSS. */
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
import { DuiButtonPrimitive } from "@deepfuture/dui-primitives/button";
|
|
3
|
+
import "../_install.js";
|
|
42
4
|
const styles = css `
|
|
5
|
+
/* =================================================================
|
|
6
|
+
* Two-axis variant system:
|
|
7
|
+
* variant → semantic intent (neutral, primary, danger)
|
|
8
|
+
* appearance → visual treatment (filled, outline, ghost, link)
|
|
9
|
+
*
|
|
10
|
+
* Uses the --_interact alpha overlay pattern for hover/active states.
|
|
11
|
+
* ================================================================= */
|
|
12
|
+
|
|
13
|
+
/* ---------------------------------------------------------------
|
|
14
|
+
* Layer 1 — Intent (sets --_intent-* private tokens)
|
|
15
|
+
* --------------------------------------------------------------- */
|
|
16
|
+
|
|
17
|
+
:host,
|
|
18
|
+
:host([variant=""]),
|
|
19
|
+
:host([variant="neutral"]) {
|
|
20
|
+
--_intent-base: var(--foreground);
|
|
21
|
+
--_intent-base-fg: var(--background);
|
|
22
|
+
--_intent-subtle: oklch(from var(--foreground) l c h / 0.08);
|
|
23
|
+
--_intent-subtle-fg: var(--text-1);
|
|
24
|
+
--_intent-border: var(--border);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
:host([variant="primary"]) {
|
|
28
|
+
--_intent-base: var(--accent);
|
|
29
|
+
--_intent-base-fg: oklch(from var(--accent) 0.98 0.01 h);
|
|
30
|
+
--_intent-subtle: var(--accent-subtle);
|
|
31
|
+
--_intent-subtle-fg: var(--accent-text);
|
|
32
|
+
--_intent-border: oklch(from var(--accent) l c h / 0.5);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:host([variant="danger"]) {
|
|
36
|
+
--_intent-base: var(--destructive);
|
|
37
|
+
--_intent-base-fg: oklch(from var(--destructive) 0.98 0.01 h);
|
|
38
|
+
--_intent-subtle: var(--destructive-subtle);
|
|
39
|
+
--_intent-subtle-fg: var(--destructive-text);
|
|
40
|
+
--_intent-border: oklch(from var(--destructive) l c h / 0.5);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* ---------------------------------------------------------------
|
|
44
|
+
* Layer 2 — Appearance (maps --_intent-* to --button-*)
|
|
45
|
+
* --------------------------------------------------------------- */
|
|
46
|
+
|
|
47
|
+
:host,
|
|
48
|
+
:host([appearance=""]),
|
|
49
|
+
:host([appearance="filled"]) {
|
|
50
|
+
--button-bg: var(--_intent-base);
|
|
51
|
+
--button-fg: var(--_intent-base-fg);
|
|
52
|
+
--button-border: transparent;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
:host([appearance="outline"]) {
|
|
56
|
+
--button-bg: oklch(from var(--_intent-base) l c h / 0);
|
|
57
|
+
--button-fg: var(--_intent-subtle-fg);
|
|
58
|
+
--button-border: var(--_intent-border);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:host([appearance="ghost"]) {
|
|
62
|
+
--button-bg: oklch(from var(--_intent-base) l c h / 0);
|
|
63
|
+
--button-fg: var(--_intent-subtle-fg);
|
|
64
|
+
--button-border: transparent;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:host([appearance="soft"]) {
|
|
68
|
+
--button-bg: var(--_intent-subtle);
|
|
69
|
+
--button-fg: var(--_intent-subtle-fg);
|
|
70
|
+
--button-border: transparent;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
:host([appearance="link"]) {
|
|
74
|
+
--button-bg: transparent;
|
|
75
|
+
--button-fg: var(--_intent-subtle-fg);
|
|
76
|
+
--button-border: transparent;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* ---------------------------------------------------------------
|
|
80
|
+
* Sizes (swap dimensions)
|
|
81
|
+
* --------------------------------------------------------------- */
|
|
82
|
+
|
|
43
83
|
:host {
|
|
44
|
-
|
|
84
|
+
--button-height: var(--component-height-md);
|
|
85
|
+
--button-width: auto;
|
|
86
|
+
--button-padding-y: var(--space-2);
|
|
87
|
+
--button-padding-x: var(--space-2_5);
|
|
88
|
+
--button-gap: var(--space-1_5);
|
|
89
|
+
--button-radius: var(--radius-md);
|
|
90
|
+
--button-font-size: var(--text-sm);
|
|
91
|
+
--button-icon-size: var(--space-4_5);
|
|
92
|
+
width: var(--button-width);
|
|
45
93
|
}
|
|
46
94
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
color: inherit;
|
|
55
|
-
text-decoration: none;
|
|
95
|
+
:host([size="xs"]) {
|
|
96
|
+
--button-height: var(--component-height-xs);
|
|
97
|
+
--button-padding-y: var(--space-1);
|
|
98
|
+
--button-padding-x: var(--space-1_5);
|
|
99
|
+
--button-gap: var(--space-1);
|
|
100
|
+
--button-font-size: var(--text-xs);
|
|
101
|
+
--button-icon-size: var(--space-3_5);
|
|
56
102
|
}
|
|
57
103
|
|
|
104
|
+
:host([size="sm"]) {
|
|
105
|
+
--button-height: var(--component-height-sm);
|
|
106
|
+
--button-padding-y: var(--space-1_5);
|
|
107
|
+
--button-padding-x: var(--space-2);
|
|
108
|
+
--button-gap: var(--space-1);
|
|
109
|
+
--button-font-size: var(--text-xs);
|
|
110
|
+
--button-icon-size: var(--space-4);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
:host([size="lg"]) {
|
|
114
|
+
--button-height: var(--component-height-lg);
|
|
115
|
+
--button-padding-y: var(--space-2_5);
|
|
116
|
+
--button-padding-x: var(--space-3);
|
|
117
|
+
--button-gap: var(--space-1_5);
|
|
118
|
+
--button-font-size: var(--text-sm);
|
|
119
|
+
--button-icon-size: var(--space-4_5);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/* ---------------------------------------------------------------
|
|
123
|
+
* Base appearance
|
|
124
|
+
* --------------------------------------------------------------- */
|
|
125
|
+
|
|
58
126
|
[part="root"] {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
-
|
|
127
|
+
--icon-size: var(--button-icon-size);
|
|
128
|
+
--icon-color: var(--button-fg);
|
|
129
|
+
gap: var(--button-gap);
|
|
130
|
+
padding: var(--button-padding-y) var(--button-padding-x);
|
|
131
|
+
width: var(--button-width);
|
|
132
|
+
height: var(--button-height);
|
|
133
|
+
border: var(--border-width-thin) solid var(--button-border);
|
|
134
|
+
border-radius: var(--button-radius);
|
|
135
|
+
background: var(--button-bg);
|
|
136
|
+
color: var(--button-fg);
|
|
137
|
+
font-family: var(--font-sans);
|
|
138
|
+
font-weight: var(--font-weight-medium);
|
|
139
|
+
font-size: var(--button-font-size);
|
|
140
|
+
letter-spacing: var(--letter-spacing-tight);
|
|
141
|
+
line-height: var(--line-height-snug);
|
|
142
|
+
text-box: trim-both cap alphabetic;
|
|
143
|
+
white-space: nowrap;
|
|
144
|
+
transition-property: background, box-shadow, filter, transform, border-color, text-decoration-color;
|
|
145
|
+
transition-duration: var(--duration-fast);
|
|
146
|
+
transition-timing-function: var(--ease-out-3);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/* ---------------------------------------------------------------
|
|
150
|
+
* Interactive states — filled variant uses filter for hover/active
|
|
151
|
+
* --------------------------------------------------------------- */
|
|
152
|
+
|
|
153
|
+
/* Filled: darken on hover, more on active */
|
|
154
|
+
:host(:not([appearance="outline"]):not([appearance="ghost"]):not([appearance="soft"]):not([appearance="link"]))
|
|
155
|
+
[part="root"]:hover:not(:disabled):not([aria-disabled="true"]) {
|
|
156
|
+
filter: brightness(0.88);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
:host(:not([appearance="outline"]):not([appearance="ghost"]):not([appearance="soft"]):not([appearance="link"]))
|
|
160
|
+
[part="root"]:active:not(:disabled):not([aria-disabled="true"]) {
|
|
161
|
+
filter: brightness(0.80);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/* Ghost / outline: alpha overlay on foreground */
|
|
165
|
+
:host([appearance="ghost"]) [part="root"]:hover:not(:disabled):not([aria-disabled="true"]),
|
|
166
|
+
:host([appearance="outline"]) [part="root"]:hover:not(:disabled):not([aria-disabled="true"]) {
|
|
167
|
+
background: oklch(from var(--_intent-base) l c h / 0.05);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
:host([appearance="ghost"]) [part="root"]:active:not(:disabled):not([aria-disabled="true"]),
|
|
171
|
+
:host([appearance="outline"]) [part="root"]:active:not(:disabled):not([aria-disabled="true"]) {
|
|
172
|
+
background: oklch(from var(--_intent-base) l c h / 0.10);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/* Soft: layer intent color on top of tinted background */
|
|
176
|
+
:host([appearance="soft"])
|
|
177
|
+
[part="root"]:hover:not(:disabled):not([aria-disabled="true"]) {
|
|
178
|
+
background: oklch(from var(--_intent-base) l c h / 0.12);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
:host([appearance="soft"])
|
|
182
|
+
[part="root"]:active:not(:disabled):not([aria-disabled="true"]) {
|
|
183
|
+
background: oklch(from var(--_intent-base) l c h / 0.18);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
[part="root"]:focus-visible {
|
|
187
|
+
outline: none;
|
|
188
|
+
box-shadow:
|
|
189
|
+
0 0 0 var(--focus-ring-offset) var(--background),
|
|
190
|
+
0 0 0 calc(var(--focus-ring-offset) + var(--focus-ring-width)) var(--focus-ring-color);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
[part="root"]:disabled,
|
|
194
|
+
[part="root"][aria-disabled="true"] {
|
|
195
|
+
opacity: 0.2;
|
|
196
|
+
cursor: not-allowed;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/* Link appearance: persistent transparent underline, fades in on hover */
|
|
200
|
+
:host([appearance="link"]) [part="root"] {
|
|
201
|
+
text-decoration: underline;
|
|
202
|
+
text-underline-offset: 4px;
|
|
203
|
+
text-decoration-color: transparent;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
:host([appearance="link"])
|
|
207
|
+
[part="root"]:hover:not(:disabled):not([aria-disabled="true"]) {
|
|
208
|
+
text-decoration-color: currentColor;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/* Open state — mirrors :active so the trigger looks pressed while its overlay is open */
|
|
212
|
+
|
|
213
|
+
:host([data-open]:not([appearance="outline"]):not([appearance="ghost"]):not([appearance="soft"]):not([appearance="link"]))
|
|
214
|
+
[part="root"]:not(:disabled):not([aria-disabled="true"]) {
|
|
215
|
+
filter: brightness(0.80);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
:host([data-open][appearance="ghost"]) [part="root"]:not(:disabled):not([aria-disabled="true"]),
|
|
219
|
+
:host([data-open][appearance="outline"]) [part="root"]:not(:disabled):not([aria-disabled="true"]) {
|
|
220
|
+
background: oklch(from var(--_intent-base) l c h / 0.10);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
:host([data-open][appearance="soft"]) [part="root"]:not(:disabled):not([aria-disabled="true"]) {
|
|
224
|
+
background: oklch(from var(--_intent-base) l c h / 0.18);
|
|
66
225
|
}
|
|
67
226
|
`;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
* native `<a>` tag instead. Normal clicks fire a `dui-navigate` event that
|
|
73
|
-
* consumers handle for SPA routing.
|
|
74
|
-
*
|
|
75
|
-
* @slot - Button label / content.
|
|
76
|
-
* @csspart root - The button or anchor element.
|
|
77
|
-
* @fires dui-navigate - Fired on normal link clicks. Detail: { href: string }
|
|
78
|
-
*/
|
|
79
|
-
let DuiButton = (() => {
|
|
80
|
-
let _classSuper = LitElement;
|
|
81
|
-
let _disabled_decorators;
|
|
82
|
-
let _disabled_initializers = [];
|
|
83
|
-
let _disabled_extraInitializers = [];
|
|
84
|
-
let _focusableWhenDisabled_decorators;
|
|
85
|
-
let _focusableWhenDisabled_initializers = [];
|
|
86
|
-
let _focusableWhenDisabled_extraInitializers = [];
|
|
87
|
-
let _type_decorators;
|
|
88
|
-
let _type_initializers = [];
|
|
89
|
-
let _type_extraInitializers = [];
|
|
90
|
-
let _href_decorators;
|
|
91
|
-
let _href_initializers = [];
|
|
92
|
-
let _href_extraInitializers = [];
|
|
93
|
-
return class DuiButton extends _classSuper {
|
|
94
|
-
static {
|
|
95
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
96
|
-
_disabled_decorators = [property({ type: Boolean, reflect: true })];
|
|
97
|
-
_focusableWhenDisabled_decorators = [property({ type: Boolean, attribute: "focusable-when-disabled" })];
|
|
98
|
-
_type_decorators = [property()];
|
|
99
|
-
_href_decorators = [property()];
|
|
100
|
-
__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);
|
|
101
|
-
__esDecorate(this, null, _focusableWhenDisabled_decorators, { kind: "accessor", name: "focusableWhenDisabled", static: false, private: false, access: { has: obj => "focusableWhenDisabled" in obj, get: obj => obj.focusableWhenDisabled, set: (obj, value) => { obj.focusableWhenDisabled = value; } }, metadata: _metadata }, _focusableWhenDisabled_initializers, _focusableWhenDisabled_extraInitializers);
|
|
102
|
-
__esDecorate(this, null, _type_decorators, { kind: "accessor", name: "type", static: false, private: false, access: { has: obj => "type" in obj, get: obj => obj.type, set: (obj, value) => { obj.type = value; } }, metadata: _metadata }, _type_initializers, _type_extraInitializers);
|
|
103
|
-
__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);
|
|
104
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
105
|
-
}
|
|
106
|
-
static tagName = "dui-button";
|
|
107
|
-
static shadowRootOptions = {
|
|
108
|
-
...LitElement.shadowRootOptions,
|
|
109
|
-
delegatesFocus: true,
|
|
110
|
-
};
|
|
111
|
-
static styles = [base, styles];
|
|
112
|
-
#disabled_accessor_storage = __runInitializers(this, _disabled_initializers, false);
|
|
113
|
-
get disabled() { return this.#disabled_accessor_storage; }
|
|
114
|
-
set disabled(value) { this.#disabled_accessor_storage = value; }
|
|
115
|
-
#focusableWhenDisabled_accessor_storage = (__runInitializers(this, _disabled_extraInitializers), __runInitializers(this, _focusableWhenDisabled_initializers, false));
|
|
116
|
-
get focusableWhenDisabled() { return this.#focusableWhenDisabled_accessor_storage; }
|
|
117
|
-
set focusableWhenDisabled(value) { this.#focusableWhenDisabled_accessor_storage = value; }
|
|
118
|
-
#type_accessor_storage = (__runInitializers(this, _focusableWhenDisabled_extraInitializers), __runInitializers(this, _type_initializers, "button"));
|
|
119
|
-
get type() { return this.#type_accessor_storage; }
|
|
120
|
-
set type(value) { this.#type_accessor_storage = value; }
|
|
121
|
-
#href_accessor_storage = (__runInitializers(this, _type_extraInitializers), __runInitializers(this, _href_initializers, undefined));
|
|
122
|
-
get href() { return this.#href_accessor_storage; }
|
|
123
|
-
set href(value) { this.#href_accessor_storage = value; }
|
|
124
|
-
#handleClick = (__runInitializers(this, _href_extraInitializers), (e) => {
|
|
125
|
-
if (this.disabled) {
|
|
126
|
-
e.preventDefault();
|
|
127
|
-
e.stopPropagation();
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
#onLinkClick = (event) => {
|
|
131
|
-
if (this.disabled) {
|
|
132
|
-
event.preventDefault();
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) {
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
if (this.href) {
|
|
139
|
-
event.preventDefault();
|
|
140
|
-
this.dispatchEvent(navigateEvent({ href: this.href }));
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
#renderButton() {
|
|
144
|
-
const ariaDisabled = this.disabled && this.focusableWhenDisabled;
|
|
145
|
-
return html `
|
|
146
|
-
<button
|
|
147
|
-
part="root"
|
|
148
|
-
type="${this.type}"
|
|
149
|
-
?disabled="${this.disabled && !this.focusableWhenDisabled}"
|
|
150
|
-
aria-disabled="${ariaDisabled || nothing}"
|
|
151
|
-
@click="${this.#handleClick}"
|
|
152
|
-
>
|
|
153
|
-
<slot></slot>
|
|
154
|
-
</button>
|
|
155
|
-
`;
|
|
156
|
-
}
|
|
157
|
-
#renderLink() {
|
|
158
|
-
return html `
|
|
159
|
-
<a
|
|
160
|
-
part="root"
|
|
161
|
-
href="${this.href ?? nothing}"
|
|
162
|
-
aria-disabled="${this.disabled || nothing}"
|
|
163
|
-
@click="${this.#onLinkClick}"
|
|
164
|
-
>
|
|
165
|
-
<slot></slot>
|
|
166
|
-
</a>
|
|
167
|
-
`;
|
|
168
|
-
}
|
|
169
|
-
render() {
|
|
170
|
-
return this.href !== undefined ? this.#renderLink() : this.#renderButton();
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
})();
|
|
174
|
-
export { DuiButton };
|
|
227
|
+
export class DuiButton extends DuiButtonPrimitive {
|
|
228
|
+
static styles = [...DuiButtonPrimitive.styles, styles];
|
|
229
|
+
}
|
|
230
|
+
customElements.define(DuiButton.tagName, DuiButton);
|