@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/input/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { DuiInput
|
|
3
|
-
export
|
|
1
|
+
import "./input.js";
|
|
2
|
+
export { DuiInput } from "./input.js";
|
|
3
|
+
export { inputChangeEvent } from "@deepfuture/dui-primitives/input";
|
package/input/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { DuiInput
|
|
3
|
-
export
|
|
1
|
+
import "./input.js";
|
|
2
|
+
export { DuiInput } from "./input.js";
|
|
3
|
+
export { inputChangeEvent } from "@deepfuture/dui-primitives/input";
|
package/input/input.d.ts
CHANGED
|
@@ -1,51 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
export declare
|
|
4
|
-
value: string;
|
|
5
|
-
}) => CustomEvent<{
|
|
6
|
-
value: string;
|
|
7
|
-
}>;
|
|
8
|
-
/**
|
|
9
|
-
* `<dui-input>` — A native input element that integrates with dui-field.
|
|
10
|
-
*
|
|
11
|
-
* Automatically works with Field for accessible labeling and validation.
|
|
12
|
-
*
|
|
13
|
-
* @csspart input - The native input element.
|
|
14
|
-
* @fires input-change - Fired when value changes. Detail: { value: string }
|
|
15
|
-
*/
|
|
16
|
-
export declare class DuiInput extends LitElement {
|
|
17
|
-
#private;
|
|
18
|
-
static tagName: "dui-input";
|
|
19
|
-
static formAssociated: boolean;
|
|
20
|
-
static shadowRootOptions: ShadowRootInit;
|
|
1
|
+
import { DuiInputPrimitive } from "@deepfuture/dui-primitives/input";
|
|
2
|
+
import "../_install.js";
|
|
3
|
+
export declare class DuiInput extends DuiInputPrimitive {
|
|
21
4
|
static styles: import("lit").CSSResult[];
|
|
22
|
-
constructor();
|
|
23
|
-
/** Input type (text, email, password, etc.) */
|
|
24
|
-
accessor type: string;
|
|
25
|
-
/** Current input value. */
|
|
26
|
-
accessor value: string;
|
|
27
|
-
/** Placeholder text. */
|
|
28
|
-
accessor placeholder: string;
|
|
29
|
-
/** Whether the input is disabled. */
|
|
30
|
-
accessor disabled: boolean;
|
|
31
|
-
/** Whether the input is required. */
|
|
32
|
-
accessor required: boolean;
|
|
33
|
-
/** Whether the input is read-only. */
|
|
34
|
-
accessor readonly: boolean;
|
|
35
|
-
/** Minimum length for text inputs. */
|
|
36
|
-
accessor minLength: number | undefined;
|
|
37
|
-
/** Maximum length for text inputs. */
|
|
38
|
-
accessor maxLength: number | undefined;
|
|
39
|
-
/** Pattern for validation. */
|
|
40
|
-
accessor pattern: string | undefined;
|
|
41
|
-
/** Name attribute for form submission. */
|
|
42
|
-
accessor name: string;
|
|
43
|
-
/** Autocomplete hint for the browser. */
|
|
44
|
-
accessor autocomplete: string | undefined;
|
|
45
|
-
/** Whether the input should receive focus on mount. */
|
|
46
|
-
accessor autofocus: boolean;
|
|
47
|
-
firstUpdated(): void;
|
|
48
|
-
updated(): void;
|
|
49
|
-
willUpdate(): void;
|
|
50
|
-
render(): TemplateResult;
|
|
51
5
|
}
|
package/input/input.js
CHANGED
|
@@ -1,246 +1,65 @@
|
|
|
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 } from "lit";
|
|
37
|
-
import { property } from "lit/decorators.js";
|
|
38
|
-
import { ifDefined } from "lit/directives/if-defined.js";
|
|
39
|
-
import { live } from "lit/directives/live.js";
|
|
40
|
-
import { base } from "@deepfuture/dui-core/base";
|
|
41
|
-
import { customEvent } from "@deepfuture/dui-core/event";
|
|
42
|
-
export const inputChangeEvent = customEvent("input-change", {
|
|
43
|
-
bubbles: true,
|
|
44
|
-
composed: true,
|
|
45
|
-
});
|
|
46
|
-
/** Structural styles only — layout CSS. */
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
import { DuiInputPrimitive } from "@deepfuture/dui-primitives/input";
|
|
3
|
+
import "../_install.js";
|
|
47
4
|
const styles = css `
|
|
48
|
-
|
|
49
|
-
|
|
5
|
+
[part="input"] {
|
|
6
|
+
padding: var(--space-2);
|
|
7
|
+
font-family: var(--font-sans);
|
|
8
|
+
font-size: var(--text-sm); line-height: var(--text-sm--line-height);
|
|
9
|
+
height: var(--component-height-md);
|
|
10
|
+
color: var(--text-1);
|
|
11
|
+
border: var(--border-width-thin) solid var(--border);
|
|
12
|
+
background: transparent;
|
|
13
|
+
border-radius: var(--radius-md);
|
|
14
|
+
transition-property: border-color, box-shadow, background, filter, transform;
|
|
15
|
+
transition-duration: var(--duration-fast);
|
|
50
16
|
}
|
|
51
17
|
|
|
52
|
-
[part="input"] {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
18
|
+
[part="input"]::placeholder {
|
|
19
|
+
color: var(--text-3);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
[part="input"]:focus-visible {
|
|
23
|
+
box-shadow:
|
|
24
|
+
0 0 0 var(--focus-ring-offset) var(--background),
|
|
25
|
+
0 0 0 calc(var(--focus-ring-offset) + var(--focus-ring-width)) var(--focus-ring-color);
|
|
56
26
|
}
|
|
57
27
|
|
|
58
28
|
[part="input"]:disabled {
|
|
59
|
-
|
|
29
|
+
opacity: 0.4;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:host([aria-invalid="true"]) [part="input"] {
|
|
33
|
+
border-color: var(--destructive);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
:host([size="sm"]) [part="input"] {
|
|
37
|
+
height: var(--component-height-sm);
|
|
38
|
+
padding: var(--space-1_5);
|
|
39
|
+
font-size: var(--text-xs);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
:host([aria-invalid="true"]) [part="input"]:focus-visible {
|
|
43
|
+
box-shadow:
|
|
44
|
+
0 0 0 var(--focus-ring-offset) var(--background),
|
|
45
|
+
0 0 0 calc(var(--focus-ring-offset) + var(--focus-ring-width)) var(--focus-ring-color);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* Password bullets are tiny at small font sizes — bump them up */
|
|
49
|
+
[part="input"][type="password"]:not(:placeholder-shown) {
|
|
50
|
+
font-size: var(--text-2xl);
|
|
51
|
+
font-weight: var(--font-weight-bold);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* Autofill overrides */
|
|
55
|
+
[part="input"]:-webkit-autofill,
|
|
56
|
+
[part="input"]:-webkit-autofill:hover,
|
|
57
|
+
[part="input"]:-webkit-autofill:focus {
|
|
58
|
+
-webkit-text-fill-color: var(--text-1);
|
|
59
|
+
transition: background-color 5000s ease-in-out 0s;
|
|
60
60
|
}
|
|
61
61
|
`;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
*
|
|
67
|
-
* @csspart input - The native input element.
|
|
68
|
-
* @fires input-change - Fired when value changes. Detail: { value: string }
|
|
69
|
-
*/
|
|
70
|
-
let DuiInput = (() => {
|
|
71
|
-
let _classSuper = LitElement;
|
|
72
|
-
let _type_decorators;
|
|
73
|
-
let _type_initializers = [];
|
|
74
|
-
let _type_extraInitializers = [];
|
|
75
|
-
let _value_decorators;
|
|
76
|
-
let _value_initializers = [];
|
|
77
|
-
let _value_extraInitializers = [];
|
|
78
|
-
let _placeholder_decorators;
|
|
79
|
-
let _placeholder_initializers = [];
|
|
80
|
-
let _placeholder_extraInitializers = [];
|
|
81
|
-
let _disabled_decorators;
|
|
82
|
-
let _disabled_initializers = [];
|
|
83
|
-
let _disabled_extraInitializers = [];
|
|
84
|
-
let _required_decorators;
|
|
85
|
-
let _required_initializers = [];
|
|
86
|
-
let _required_extraInitializers = [];
|
|
87
|
-
let _readonly_decorators;
|
|
88
|
-
let _readonly_initializers = [];
|
|
89
|
-
let _readonly_extraInitializers = [];
|
|
90
|
-
let _minLength_decorators;
|
|
91
|
-
let _minLength_initializers = [];
|
|
92
|
-
let _minLength_extraInitializers = [];
|
|
93
|
-
let _maxLength_decorators;
|
|
94
|
-
let _maxLength_initializers = [];
|
|
95
|
-
let _maxLength_extraInitializers = [];
|
|
96
|
-
let _pattern_decorators;
|
|
97
|
-
let _pattern_initializers = [];
|
|
98
|
-
let _pattern_extraInitializers = [];
|
|
99
|
-
let _name_decorators;
|
|
100
|
-
let _name_initializers = [];
|
|
101
|
-
let _name_extraInitializers = [];
|
|
102
|
-
let _autocomplete_decorators;
|
|
103
|
-
let _autocomplete_initializers = [];
|
|
104
|
-
let _autocomplete_extraInitializers = [];
|
|
105
|
-
let _autofocus_decorators;
|
|
106
|
-
let _autofocus_initializers = [];
|
|
107
|
-
let _autofocus_extraInitializers = [];
|
|
108
|
-
return class DuiInput extends _classSuper {
|
|
109
|
-
static {
|
|
110
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
111
|
-
_type_decorators = [property({ type: String })];
|
|
112
|
-
_value_decorators = [property({ type: String })];
|
|
113
|
-
_placeholder_decorators = [property({ type: String })];
|
|
114
|
-
_disabled_decorators = [property({ type: Boolean, reflect: true })];
|
|
115
|
-
_required_decorators = [property({ type: Boolean })];
|
|
116
|
-
_readonly_decorators = [property({ type: Boolean })];
|
|
117
|
-
_minLength_decorators = [property({ type: Number, attribute: "minlength" })];
|
|
118
|
-
_maxLength_decorators = [property({ type: Number, attribute: "maxlength" })];
|
|
119
|
-
_pattern_decorators = [property({ type: String })];
|
|
120
|
-
_name_decorators = [property({ type: String })];
|
|
121
|
-
_autocomplete_decorators = [property({ type: String })];
|
|
122
|
-
_autofocus_decorators = [property({ type: Boolean })];
|
|
123
|
-
__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);
|
|
124
|
-
__esDecorate(this, null, _value_decorators, { kind: "accessor", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
|
|
125
|
-
__esDecorate(this, null, _placeholder_decorators, { kind: "accessor", name: "placeholder", static: false, private: false, access: { has: obj => "placeholder" in obj, get: obj => obj.placeholder, set: (obj, value) => { obj.placeholder = value; } }, metadata: _metadata }, _placeholder_initializers, _placeholder_extraInitializers);
|
|
126
|
-
__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);
|
|
127
|
-
__esDecorate(this, null, _required_decorators, { kind: "accessor", name: "required", static: false, private: false, access: { has: obj => "required" in obj, get: obj => obj.required, set: (obj, value) => { obj.required = value; } }, metadata: _metadata }, _required_initializers, _required_extraInitializers);
|
|
128
|
-
__esDecorate(this, null, _readonly_decorators, { kind: "accessor", name: "readonly", static: false, private: false, access: { has: obj => "readonly" in obj, get: obj => obj.readonly, set: (obj, value) => { obj.readonly = value; } }, metadata: _metadata }, _readonly_initializers, _readonly_extraInitializers);
|
|
129
|
-
__esDecorate(this, null, _minLength_decorators, { kind: "accessor", name: "minLength", static: false, private: false, access: { has: obj => "minLength" in obj, get: obj => obj.minLength, set: (obj, value) => { obj.minLength = value; } }, metadata: _metadata }, _minLength_initializers, _minLength_extraInitializers);
|
|
130
|
-
__esDecorate(this, null, _maxLength_decorators, { kind: "accessor", name: "maxLength", static: false, private: false, access: { has: obj => "maxLength" in obj, get: obj => obj.maxLength, set: (obj, value) => { obj.maxLength = value; } }, metadata: _metadata }, _maxLength_initializers, _maxLength_extraInitializers);
|
|
131
|
-
__esDecorate(this, null, _pattern_decorators, { kind: "accessor", name: "pattern", static: false, private: false, access: { has: obj => "pattern" in obj, get: obj => obj.pattern, set: (obj, value) => { obj.pattern = value; } }, metadata: _metadata }, _pattern_initializers, _pattern_extraInitializers);
|
|
132
|
-
__esDecorate(this, null, _name_decorators, { kind: "accessor", name: "name", static: false, private: false, access: { has: obj => "name" in obj, get: obj => obj.name, set: (obj, value) => { obj.name = value; } }, metadata: _metadata }, _name_initializers, _name_extraInitializers);
|
|
133
|
-
__esDecorate(this, null, _autocomplete_decorators, { kind: "accessor", name: "autocomplete", static: false, private: false, access: { has: obj => "autocomplete" in obj, get: obj => obj.autocomplete, set: (obj, value) => { obj.autocomplete = value; } }, metadata: _metadata }, _autocomplete_initializers, _autocomplete_extraInitializers);
|
|
134
|
-
__esDecorate(this, null, _autofocus_decorators, { kind: "accessor", name: "autofocus", static: false, private: false, access: { has: obj => "autofocus" in obj, get: obj => obj.autofocus, set: (obj, value) => { obj.autofocus = value; } }, metadata: _metadata }, _autofocus_initializers, _autofocus_extraInitializers);
|
|
135
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
136
|
-
}
|
|
137
|
-
static tagName = "dui-input";
|
|
138
|
-
static formAssociated = true;
|
|
139
|
-
static shadowRootOptions = {
|
|
140
|
-
...LitElement.shadowRootOptions,
|
|
141
|
-
delegatesFocus: true,
|
|
142
|
-
};
|
|
143
|
-
static styles = [base, styles];
|
|
144
|
-
#internals;
|
|
145
|
-
constructor() {
|
|
146
|
-
super();
|
|
147
|
-
this.#internals = this.attachInternals();
|
|
148
|
-
}
|
|
149
|
-
#type_accessor_storage = __runInitializers(this, _type_initializers, "text");
|
|
150
|
-
/** Input type (text, email, password, etc.) */
|
|
151
|
-
get type() { return this.#type_accessor_storage; }
|
|
152
|
-
set type(value) { this.#type_accessor_storage = value; }
|
|
153
|
-
#value_accessor_storage = (__runInitializers(this, _type_extraInitializers), __runInitializers(this, _value_initializers, ""));
|
|
154
|
-
/** Current input value. */
|
|
155
|
-
get value() { return this.#value_accessor_storage; }
|
|
156
|
-
set value(value) { this.#value_accessor_storage = value; }
|
|
157
|
-
#placeholder_accessor_storage = (__runInitializers(this, _value_extraInitializers), __runInitializers(this, _placeholder_initializers, ""));
|
|
158
|
-
/** Placeholder text. */
|
|
159
|
-
get placeholder() { return this.#placeholder_accessor_storage; }
|
|
160
|
-
set placeholder(value) { this.#placeholder_accessor_storage = value; }
|
|
161
|
-
#disabled_accessor_storage = (__runInitializers(this, _placeholder_extraInitializers), __runInitializers(this, _disabled_initializers, false));
|
|
162
|
-
/** Whether the input is disabled. */
|
|
163
|
-
get disabled() { return this.#disabled_accessor_storage; }
|
|
164
|
-
set disabled(value) { this.#disabled_accessor_storage = value; }
|
|
165
|
-
#required_accessor_storage = (__runInitializers(this, _disabled_extraInitializers), __runInitializers(this, _required_initializers, false));
|
|
166
|
-
/** Whether the input is required. */
|
|
167
|
-
get required() { return this.#required_accessor_storage; }
|
|
168
|
-
set required(value) { this.#required_accessor_storage = value; }
|
|
169
|
-
#readonly_accessor_storage = (__runInitializers(this, _required_extraInitializers), __runInitializers(this, _readonly_initializers, false));
|
|
170
|
-
/** Whether the input is read-only. */
|
|
171
|
-
get readonly() { return this.#readonly_accessor_storage; }
|
|
172
|
-
set readonly(value) { this.#readonly_accessor_storage = value; }
|
|
173
|
-
#minLength_accessor_storage = (__runInitializers(this, _readonly_extraInitializers), __runInitializers(this, _minLength_initializers, undefined));
|
|
174
|
-
/** Minimum length for text inputs. */
|
|
175
|
-
get minLength() { return this.#minLength_accessor_storage; }
|
|
176
|
-
set minLength(value) { this.#minLength_accessor_storage = value; }
|
|
177
|
-
#maxLength_accessor_storage = (__runInitializers(this, _minLength_extraInitializers), __runInitializers(this, _maxLength_initializers, undefined));
|
|
178
|
-
/** Maximum length for text inputs. */
|
|
179
|
-
get maxLength() { return this.#maxLength_accessor_storage; }
|
|
180
|
-
set maxLength(value) { this.#maxLength_accessor_storage = value; }
|
|
181
|
-
#pattern_accessor_storage = (__runInitializers(this, _maxLength_extraInitializers), __runInitializers(this, _pattern_initializers, undefined));
|
|
182
|
-
/** Pattern for validation. */
|
|
183
|
-
get pattern() { return this.#pattern_accessor_storage; }
|
|
184
|
-
set pattern(value) { this.#pattern_accessor_storage = value; }
|
|
185
|
-
#name_accessor_storage = (__runInitializers(this, _pattern_extraInitializers), __runInitializers(this, _name_initializers, ""));
|
|
186
|
-
/** Name attribute for form submission. */
|
|
187
|
-
get name() { return this.#name_accessor_storage; }
|
|
188
|
-
set name(value) { this.#name_accessor_storage = value; }
|
|
189
|
-
#autocomplete_accessor_storage = (__runInitializers(this, _name_extraInitializers), __runInitializers(this, _autocomplete_initializers, undefined));
|
|
190
|
-
/** Autocomplete hint for the browser. */
|
|
191
|
-
get autocomplete() { return this.#autocomplete_accessor_storage; }
|
|
192
|
-
set autocomplete(value) { this.#autocomplete_accessor_storage = value; }
|
|
193
|
-
#autofocus_accessor_storage = (__runInitializers(this, _autocomplete_extraInitializers), __runInitializers(this, _autofocus_initializers, false));
|
|
194
|
-
/** Whether the input should receive focus on mount. */
|
|
195
|
-
get autofocus() { return this.#autofocus_accessor_storage; }
|
|
196
|
-
set autofocus(value) { this.#autofocus_accessor_storage = value; }
|
|
197
|
-
firstUpdated() {
|
|
198
|
-
this.#syncValidity();
|
|
199
|
-
if (this.autofocus) {
|
|
200
|
-
this.focus();
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
updated() {
|
|
204
|
-
this.#syncValidity();
|
|
205
|
-
}
|
|
206
|
-
#onInput = (__runInitializers(this, _autofocus_extraInitializers), (event) => {
|
|
207
|
-
const target = event.target;
|
|
208
|
-
this.value = target.value;
|
|
209
|
-
this.#syncFormValue();
|
|
210
|
-
this.#syncValidity();
|
|
211
|
-
this.dispatchEvent(inputChangeEvent({ value: this.value }));
|
|
212
|
-
});
|
|
213
|
-
willUpdate() {
|
|
214
|
-
this.#syncFormValue();
|
|
215
|
-
}
|
|
216
|
-
#syncFormValue() {
|
|
217
|
-
this.#internals.setFormValue(this.value);
|
|
218
|
-
}
|
|
219
|
-
#syncValidity() {
|
|
220
|
-
const input = this.shadowRoot?.querySelector("input");
|
|
221
|
-
if (input) {
|
|
222
|
-
this.#internals.setValidity(input.validity, input.validationMessage, input);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
render() {
|
|
226
|
-
return html `
|
|
227
|
-
<input
|
|
228
|
-
part="input"
|
|
229
|
-
type="${this.type}"
|
|
230
|
-
.value="${live(this.value)}"
|
|
231
|
-
placeholder="${this.placeholder}"
|
|
232
|
-
?disabled="${this.disabled}"
|
|
233
|
-
?required="${this.required}"
|
|
234
|
-
?readonly="${this.readonly}"
|
|
235
|
-
minlength="${ifDefined(this.minLength)}"
|
|
236
|
-
maxlength="${ifDefined(this.maxLength)}"
|
|
237
|
-
pattern="${ifDefined(this.pattern)}"
|
|
238
|
-
name="${this.name}"
|
|
239
|
-
autocomplete="${ifDefined(this.autocomplete)}"
|
|
240
|
-
@input="${this.#onInput}"
|
|
241
|
-
/>
|
|
242
|
-
`;
|
|
243
|
-
}
|
|
244
|
-
};
|
|
245
|
-
})();
|
|
246
|
-
export { DuiInput };
|
|
62
|
+
export class DuiInput extends DuiInputPrimitive {
|
|
63
|
+
static styles = [...DuiInputPrimitive.styles, styles];
|
|
64
|
+
}
|
|
65
|
+
customElements.define(DuiInput.tagName, DuiInput);
|
package/menu/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export { DuiMenuItem };
|
|
5
|
-
export declare const menuFamily: (typeof DuiMenuItem | typeof DuiMenu)[];
|
|
1
|
+
import "./menu.js";
|
|
2
|
+
import "./menu-item.js";
|
|
3
|
+
export { DuiMenu } from "./menu.js";
|
|
4
|
+
export { DuiMenuItem } from "./menu-item.js";
|
package/menu/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export { DuiMenuItem };
|
|
5
|
-
export const menuFamily = [DuiMenu, DuiMenuItem];
|
|
1
|
+
import "./menu.js";
|
|
2
|
+
import "./menu-item.js";
|
|
3
|
+
export { DuiMenu } from "./menu.js";
|
|
4
|
+
export { DuiMenuItem } from "./menu-item.js";
|
package/menu/menu-item.d.ts
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
* `<dui-menu-item>` — An item within a `dui-menu`.
|
|
5
|
-
*
|
|
6
|
-
* @slot default - Item content (text, icons, etc.).
|
|
7
|
-
*/
|
|
8
|
-
export declare class DuiMenuItem extends LitElement {
|
|
9
|
-
static tagName: "dui-menu-item";
|
|
1
|
+
import { DuiMenuItemPrimitive } from "@deepfuture/dui-primitives/menu";
|
|
2
|
+
import "../_install.js";
|
|
3
|
+
export declare class DuiMenuItem extends DuiMenuItemPrimitive {
|
|
10
4
|
static styles: import("lit").CSSResult[];
|
|
11
|
-
/** Whether the item is disabled. */
|
|
12
|
-
accessor disabled: boolean;
|
|
13
|
-
connectedCallback(): void;
|
|
14
|
-
render(): TemplateResult;
|
|
15
5
|
}
|
package/menu/menu-item.js
CHANGED
|
@@ -1,96 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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 } from "lit";
|
|
37
|
-
import { property } from "lit/decorators.js";
|
|
38
|
-
import { base } from "@deepfuture/dui-core/base";
|
|
39
|
-
const hostStyles = css `
|
|
40
|
-
:host {
|
|
41
|
-
display: block;
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
import { DuiMenuItemPrimitive } from "@deepfuture/dui-primitives/menu";
|
|
3
|
+
import "../_install.js";
|
|
4
|
+
const styles = css `
|
|
5
|
+
.Item {
|
|
6
|
+
--icon-size: var(--space-4);
|
|
7
|
+
--icon-color: var(--text-2);
|
|
8
|
+
gap: var(--space-2);
|
|
9
|
+
padding: 0 var(--space-2);
|
|
10
|
+
height: var(--component-height-sm);
|
|
11
|
+
border-radius: var(--radius-sm);
|
|
12
|
+
font-size: var(--text-sm);
|
|
13
|
+
line-height: var(--text-sm--line-height);
|
|
14
|
+
text-box: trim-both cap alphabetic;
|
|
15
|
+
font-family: var(--font-sans);
|
|
16
|
+
color: var(--text-1);
|
|
42
17
|
}
|
|
43
18
|
|
|
44
|
-
:
|
|
45
|
-
|
|
19
|
+
.Item:hover,
|
|
20
|
+
:host([data-highlighted]) .Item {
|
|
21
|
+
--icon-color: var(--text-1);
|
|
22
|
+
background: oklch(from var(--foreground) l c h / 0.05);
|
|
23
|
+
color: var(--text-1);
|
|
46
24
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
25
|
+
|
|
26
|
+
:host([variant="danger"]) .Item {
|
|
27
|
+
--icon-color: var(--destructive);
|
|
28
|
+
color: var(--destructive);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
:host([variant="danger"]) .Item:hover,
|
|
32
|
+
:host([variant="danger"][data-highlighted]) .Item {
|
|
33
|
+
--icon-color: oklch(from var(--destructive) 0.98 0.01 h);
|
|
34
|
+
background: var(--destructive);
|
|
35
|
+
color: oklch(from var(--destructive) 0.98 0.01 h);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
:host([disabled]) .Item {
|
|
39
|
+
opacity: 0.4;
|
|
40
|
+
cursor: not-allowed;
|
|
53
41
|
}
|
|
54
42
|
`;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
*/
|
|
60
|
-
let DuiMenuItem = (() => {
|
|
61
|
-
let _classSuper = LitElement;
|
|
62
|
-
let _disabled_decorators;
|
|
63
|
-
let _disabled_initializers = [];
|
|
64
|
-
let _disabled_extraInitializers = [];
|
|
65
|
-
return class DuiMenuItem extends _classSuper {
|
|
66
|
-
static {
|
|
67
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
68
|
-
_disabled_decorators = [property({ type: Boolean, reflect: true })];
|
|
69
|
-
__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);
|
|
70
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
71
|
-
}
|
|
72
|
-
static tagName = "dui-menu-item";
|
|
73
|
-
static styles = [base, hostStyles, componentStyles];
|
|
74
|
-
#disabled_accessor_storage = __runInitializers(this, _disabled_initializers, false);
|
|
75
|
-
/** Whether the item is disabled. */
|
|
76
|
-
get disabled() { return this.#disabled_accessor_storage; }
|
|
77
|
-
set disabled(value) { this.#disabled_accessor_storage = value; }
|
|
78
|
-
connectedCallback() {
|
|
79
|
-
super.connectedCallback();
|
|
80
|
-
this.setAttribute("role", "menuitem");
|
|
81
|
-
this.setAttribute("tabindex", "-1");
|
|
82
|
-
}
|
|
83
|
-
render() {
|
|
84
|
-
return html `
|
|
85
|
-
<div class="Item" part="root" aria-disabled="${this.disabled}">
|
|
86
|
-
<slot></slot>
|
|
87
|
-
</div>
|
|
88
|
-
`;
|
|
89
|
-
}
|
|
90
|
-
constructor() {
|
|
91
|
-
super(...arguments);
|
|
92
|
-
__runInitializers(this, _disabled_extraInitializers);
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
})();
|
|
96
|
-
export { DuiMenuItem };
|
|
43
|
+
export class DuiMenuItem extends DuiMenuItemPrimitive {
|
|
44
|
+
static styles = [...DuiMenuItemPrimitive.styles, styles];
|
|
45
|
+
}
|
|
46
|
+
customElements.define(DuiMenuItem.tagName, DuiMenuItem);
|
package/menu/menu.d.ts
CHANGED
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
* `<dui-menu>` — A popup menu triggered by a slotted element.
|
|
5
|
-
*
|
|
6
|
-
* @slot trigger - The element that opens the menu on click.
|
|
7
|
-
* @slot default - `dui-menu-item` children rendered inside the popup.
|
|
8
|
-
*/
|
|
9
|
-
export declare class DuiMenu extends LitElement {
|
|
10
|
-
#private;
|
|
11
|
-
static tagName: "dui-menu";
|
|
1
|
+
import { DuiMenuPrimitive } from "@deepfuture/dui-primitives/menu";
|
|
2
|
+
import "../_install.js";
|
|
3
|
+
export declare class DuiMenu extends DuiMenuPrimitive {
|
|
12
4
|
static styles: import("lit").CSSResult[];
|
|
13
|
-
/** Sets `min-width` on the popup panel (e.g. `"200px"`). Defaults to `"var(--space-28)".` */
|
|
14
|
-
accessor popupMinWidth: string;
|
|
15
|
-
protected updated(): void;
|
|
16
|
-
render(): TemplateResult;
|
|
17
5
|
}
|