@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/radio/radio-group.js
CHANGED
|
@@ -1,204 +1,12 @@
|
|
|
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 } from "lit";
|
|
41
|
-
import { property, state } from "lit/decorators.js";
|
|
42
|
-
import { provide } from "@lit/context";
|
|
43
|
-
import { base } from "@deepfuture/dui-core/base";
|
|
44
|
-
import { radioGroupContext, } from "./radio-group-context.js";
|
|
45
|
-
import { customEvent } from "@deepfuture/dui-core/event";
|
|
46
|
-
export const valueChangeEvent = customEvent("value-change", {
|
|
47
|
-
bubbles: true,
|
|
48
|
-
composed: true,
|
|
49
|
-
});
|
|
50
|
-
/** Structural styles only — layout CSS. */
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
import { DuiRadioGroupPrimitive } from "@deepfuture/dui-primitives/radio";
|
|
3
|
+
import "../_install.js";
|
|
51
4
|
const styles = css `
|
|
52
|
-
:host {
|
|
53
|
-
display: block;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
5
|
[part="root"] {
|
|
57
|
-
|
|
58
|
-
flex-direction: column;
|
|
59
|
-
align-items: start;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
[part="root"][data-disabled] {
|
|
63
|
-
opacity: 0.5;
|
|
6
|
+
gap: var(--space-1_5);
|
|
64
7
|
}
|
|
65
8
|
`;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
* controlled and uncontrolled usage.
|
|
71
|
-
*
|
|
72
|
-
* @slot - Default slot for `<dui-radio>` children.
|
|
73
|
-
* @csspart root - The group container element.
|
|
74
|
-
* @fires value-change - Fired when the selected value changes. Detail: { value: string }
|
|
75
|
-
*/
|
|
76
|
-
let DuiRadioGroup = (() => {
|
|
77
|
-
let _classSuper = LitElement;
|
|
78
|
-
let _name_decorators;
|
|
79
|
-
let _name_initializers = [];
|
|
80
|
-
let _name_extraInitializers = [];
|
|
81
|
-
let _value_decorators;
|
|
82
|
-
let _value_initializers = [];
|
|
83
|
-
let _value_extraInitializers = [];
|
|
84
|
-
let _defaultValue_decorators;
|
|
85
|
-
let _defaultValue_initializers = [];
|
|
86
|
-
let _defaultValue_extraInitializers = [];
|
|
87
|
-
let _disabled_decorators;
|
|
88
|
-
let _disabled_initializers = [];
|
|
89
|
-
let _disabled_extraInitializers = [];
|
|
90
|
-
let _readOnly_decorators;
|
|
91
|
-
let _readOnly_initializers = [];
|
|
92
|
-
let _readOnly_extraInitializers = [];
|
|
93
|
-
let _required_decorators;
|
|
94
|
-
let _required_initializers = [];
|
|
95
|
-
let _required_extraInitializers = [];
|
|
96
|
-
let _private_internalValue_decorators;
|
|
97
|
-
let _private_internalValue_initializers = [];
|
|
98
|
-
let _private_internalValue_extraInitializers = [];
|
|
99
|
-
let _private_internalValue_descriptor;
|
|
100
|
-
let __ctx_decorators;
|
|
101
|
-
let __ctx_initializers = [];
|
|
102
|
-
let __ctx_extraInitializers = [];
|
|
103
|
-
return class DuiRadioGroup extends _classSuper {
|
|
104
|
-
static {
|
|
105
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
106
|
-
_name_decorators = [property()];
|
|
107
|
-
_value_decorators = [property()];
|
|
108
|
-
_defaultValue_decorators = [property({ attribute: "default-value" })];
|
|
109
|
-
_disabled_decorators = [property({ type: Boolean, reflect: true })];
|
|
110
|
-
_readOnly_decorators = [property({ type: Boolean, reflect: true, attribute: "read-only" })];
|
|
111
|
-
_required_decorators = [property({ type: Boolean, reflect: true })];
|
|
112
|
-
_private_internalValue_decorators = [state()];
|
|
113
|
-
__ctx_decorators = [provide({ context: radioGroupContext }), state()];
|
|
114
|
-
__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);
|
|
115
|
-
__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);
|
|
116
|
-
__esDecorate(this, null, _defaultValue_decorators, { kind: "accessor", name: "defaultValue", static: false, private: false, access: { has: obj => "defaultValue" in obj, get: obj => obj.defaultValue, set: (obj, value) => { obj.defaultValue = value; } }, metadata: _metadata }, _defaultValue_initializers, _defaultValue_extraInitializers);
|
|
117
|
-
__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);
|
|
118
|
-
__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);
|
|
119
|
-
__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);
|
|
120
|
-
__esDecorate(this, _private_internalValue_descriptor = { get: __setFunctionName(function () { return this.#internalValue_accessor_storage; }, "#internalValue", "get"), set: __setFunctionName(function (value) { this.#internalValue_accessor_storage = value; }, "#internalValue", "set") }, _private_internalValue_decorators, { kind: "accessor", name: "#internalValue", static: false, private: true, access: { has: obj => #internalValue in obj, get: obj => obj.#internalValue, set: (obj, value) => { obj.#internalValue = value; } }, metadata: _metadata }, _private_internalValue_initializers, _private_internalValue_extraInitializers);
|
|
121
|
-
__esDecorate(this, null, __ctx_decorators, { kind: "accessor", name: "_ctx", static: false, private: false, access: { has: obj => "_ctx" in obj, get: obj => obj._ctx, set: (obj, value) => { obj._ctx = value; } }, metadata: _metadata }, __ctx_initializers, __ctx_extraInitializers);
|
|
122
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
123
|
-
}
|
|
124
|
-
static tagName = "dui-radio-group";
|
|
125
|
-
static styles = [base, styles];
|
|
126
|
-
#name_accessor_storage = __runInitializers(this, _name_initializers, undefined);
|
|
127
|
-
/** The name attribute for form submission. */
|
|
128
|
-
get name() { return this.#name_accessor_storage; }
|
|
129
|
-
set name(value) { this.#name_accessor_storage = value; }
|
|
130
|
-
#value_accessor_storage = (__runInitializers(this, _name_extraInitializers), __runInitializers(this, _value_initializers, undefined));
|
|
131
|
-
/** Selected value (controlled). */
|
|
132
|
-
get value() { return this.#value_accessor_storage; }
|
|
133
|
-
set value(value) { this.#value_accessor_storage = value; }
|
|
134
|
-
#defaultValue_accessor_storage = (__runInitializers(this, _value_extraInitializers), __runInitializers(this, _defaultValue_initializers, undefined));
|
|
135
|
-
/** Initial selected value for uncontrolled usage. */
|
|
136
|
-
get defaultValue() { return this.#defaultValue_accessor_storage; }
|
|
137
|
-
set defaultValue(value) { this.#defaultValue_accessor_storage = value; }
|
|
138
|
-
#disabled_accessor_storage = (__runInitializers(this, _defaultValue_extraInitializers), __runInitializers(this, _disabled_initializers, false));
|
|
139
|
-
/** Whether all radios in the group are disabled. */
|
|
140
|
-
get disabled() { return this.#disabled_accessor_storage; }
|
|
141
|
-
set disabled(value) { this.#disabled_accessor_storage = value; }
|
|
142
|
-
#readOnly_accessor_storage = (__runInitializers(this, _disabled_extraInitializers), __runInitializers(this, _readOnly_initializers, false));
|
|
143
|
-
/** Whether all radios in the group are read-only. */
|
|
144
|
-
get readOnly() { return this.#readOnly_accessor_storage; }
|
|
145
|
-
set readOnly(value) { this.#readOnly_accessor_storage = value; }
|
|
146
|
-
#required_accessor_storage = (__runInitializers(this, _readOnly_extraInitializers), __runInitializers(this, _required_initializers, false));
|
|
147
|
-
/** Whether a selection is required. */
|
|
148
|
-
get required() { return this.#required_accessor_storage; }
|
|
149
|
-
set required(value) { this.#required_accessor_storage = value; }
|
|
150
|
-
#internalValue_accessor_storage = (__runInitializers(this, _required_extraInitializers), __runInitializers(this, _private_internalValue_initializers, undefined));
|
|
151
|
-
get #internalValue() { return _private_internalValue_descriptor.get.call(this); }
|
|
152
|
-
set #internalValue(value) { return _private_internalValue_descriptor.set.call(this, value); }
|
|
153
|
-
#getSelectedValue = (__runInitializers(this, _private_internalValue_extraInitializers), () => this.value ?? this.#internalValue);
|
|
154
|
-
#select = (val) => {
|
|
155
|
-
if (this.disabled || this.readOnly)
|
|
156
|
-
return;
|
|
157
|
-
if (this.value === undefined) {
|
|
158
|
-
this.#internalValue = val;
|
|
159
|
-
}
|
|
160
|
-
this.dispatchEvent(valueChangeEvent({ value: val }));
|
|
161
|
-
};
|
|
162
|
-
#_ctx_accessor_storage = __runInitializers(this, __ctx_initializers, this.#buildContext());
|
|
163
|
-
get _ctx() { return this.#_ctx_accessor_storage; }
|
|
164
|
-
set _ctx(value) { this.#_ctx_accessor_storage = value; }
|
|
165
|
-
#buildContext() {
|
|
166
|
-
return {
|
|
167
|
-
name: this.name,
|
|
168
|
-
value: this.#getSelectedValue(),
|
|
169
|
-
disabled: this.disabled,
|
|
170
|
-
readOnly: this.readOnly,
|
|
171
|
-
required: this.required,
|
|
172
|
-
select: this.#select,
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
connectedCallback() {
|
|
176
|
-
super.connectedCallback();
|
|
177
|
-
if (this.value === undefined && this.defaultValue !== undefined) {
|
|
178
|
-
this.#internalValue = this.defaultValue;
|
|
179
|
-
}
|
|
180
|
-
this._ctx = this.#buildContext();
|
|
181
|
-
}
|
|
182
|
-
willUpdate() {
|
|
183
|
-
this._ctx = this.#buildContext();
|
|
184
|
-
}
|
|
185
|
-
render() {
|
|
186
|
-
return html `
|
|
187
|
-
<div
|
|
188
|
-
part="root"
|
|
189
|
-
role="radiogroup"
|
|
190
|
-
?data-disabled="${this.disabled}"
|
|
191
|
-
?data-readonly="${this.readOnly}"
|
|
192
|
-
?data-required="${this.required}"
|
|
193
|
-
>
|
|
194
|
-
<slot></slot>
|
|
195
|
-
</div>
|
|
196
|
-
`;
|
|
197
|
-
}
|
|
198
|
-
constructor() {
|
|
199
|
-
super(...arguments);
|
|
200
|
-
__runInitializers(this, __ctx_extraInitializers);
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
})();
|
|
204
|
-
export { DuiRadioGroup };
|
|
9
|
+
export class DuiRadioGroup extends DuiRadioGroupPrimitive {
|
|
10
|
+
static styles = [...DuiRadioGroupPrimitive.styles, styles];
|
|
11
|
+
}
|
|
12
|
+
customElements.define(DuiRadioGroup.tagName, DuiRadioGroup);
|
package/radio/radio.d.ts
CHANGED
|
@@ -1,30 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
* `<dui-radio>` — A radio button input.
|
|
5
|
-
*
|
|
6
|
-
* Must be used within a `<dui-radio-group>`. Only one radio can be
|
|
7
|
-
* selected at a time within a group.
|
|
8
|
-
*
|
|
9
|
-
* @slot - Label content.
|
|
10
|
-
* @csspart root - The radio container.
|
|
11
|
-
* @csspart indicator - The selected state indicator.
|
|
12
|
-
* @cssprop --radio-size - Size of the radio button.
|
|
13
|
-
*/
|
|
14
|
-
export declare class DuiRadio extends LitElement {
|
|
15
|
-
#private;
|
|
16
|
-
static tagName: "dui-radio";
|
|
17
|
-
static formAssociated: boolean;
|
|
1
|
+
import { DuiRadioPrimitive } from "@deepfuture/dui-primitives/radio";
|
|
2
|
+
import "../_install.js";
|
|
3
|
+
export declare class DuiRadio extends DuiRadioPrimitive {
|
|
18
4
|
static styles: import("lit").CSSResult[];
|
|
19
|
-
constructor();
|
|
20
|
-
/** The value attribute for this radio option. */
|
|
21
|
-
accessor value: string;
|
|
22
|
-
/** Whether the radio is disabled. */
|
|
23
|
-
accessor disabled: boolean;
|
|
24
|
-
/** Whether the radio is read-only. */
|
|
25
|
-
accessor readOnly: boolean;
|
|
26
|
-
connectedCallback(): void;
|
|
27
|
-
willUpdate(): void;
|
|
28
|
-
disconnectedCallback(): void;
|
|
29
|
-
render(): TemplateResult;
|
|
30
5
|
}
|
package/radio/radio.js
CHANGED
|
@@ -1,230 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
5
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
6
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
7
|
-
var _, done = false;
|
|
8
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
9
|
-
var context = {};
|
|
10
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
11
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
12
|
-
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
13
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
14
|
-
if (kind === "accessor") {
|
|
15
|
-
if (result === void 0) continue;
|
|
16
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
17
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
|
18
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
|
19
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
20
|
-
}
|
|
21
|
-
else if (_ = accept(result)) {
|
|
22
|
-
if (kind === "field") initializers.unshift(_);
|
|
23
|
-
else descriptor[key] = _;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
27
|
-
done = true;
|
|
28
|
-
};
|
|
29
|
-
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
30
|
-
var useValue = arguments.length > 2;
|
|
31
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
32
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
33
|
-
}
|
|
34
|
-
return useValue ? value : void 0;
|
|
35
|
-
};
|
|
36
|
-
import { css, html, LitElement, nothing } from "lit";
|
|
37
|
-
import { property } from "lit/decorators.js";
|
|
38
|
-
import { ContextConsumer } from "@lit/context";
|
|
39
|
-
import { base } from "@deepfuture/dui-core/base";
|
|
40
|
-
import { radioGroupContext } from "./radio-group-context.js";
|
|
41
|
-
/** Structural styles only — layout CSS. */
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
import { DuiRadioPrimitive } from "@deepfuture/dui-primitives/radio";
|
|
3
|
+
import "../_install.js";
|
|
42
4
|
const styles = css `
|
|
43
5
|
:host {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
6
|
+
--radio-size: var(--space-4_5);
|
|
7
|
+
gap: var(--space-2);
|
|
8
|
+
font-size: var(--text-sm);
|
|
47
9
|
}
|
|
48
10
|
|
|
49
|
-
|
|
50
|
-
|
|
11
|
+
[part="root"] {
|
|
12
|
+
width: var(--radio-size);
|
|
13
|
+
height: var(--radio-size);
|
|
14
|
+
border-radius: 50%;
|
|
15
|
+
transition-property: background, border-color, box-shadow, filter, transform;
|
|
16
|
+
transition-duration: var(--duration-fast);
|
|
51
17
|
}
|
|
52
18
|
|
|
53
|
-
[part="root"] {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
flex-shrink: 0;
|
|
57
|
-
align-items: center;
|
|
58
|
-
justify-content: center;
|
|
59
|
-
outline: 0;
|
|
60
|
-
padding: 0;
|
|
61
|
-
margin: 0;
|
|
62
|
-
border: none;
|
|
63
|
-
user-select: none;
|
|
19
|
+
[part="root"][data-unchecked] {
|
|
20
|
+
border: var(--border-width-thin) solid var(--border);
|
|
21
|
+
background: transparent;
|
|
64
22
|
}
|
|
65
23
|
|
|
66
|
-
[part="root"][data-
|
|
67
|
-
|
|
24
|
+
[part="root"][data-checked] {
|
|
25
|
+
border: var(--border-width-thin) solid var(--accent);
|
|
26
|
+
background: var(--accent);
|
|
68
27
|
}
|
|
69
28
|
|
|
70
|
-
[part="root"][data-
|
|
71
|
-
|
|
29
|
+
[part="root"][data-disabled] {
|
|
30
|
+
opacity: 0.4;
|
|
72
31
|
}
|
|
73
32
|
|
|
74
|
-
[part="
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
height: 100%;
|
|
33
|
+
[part="root"]:focus-visible {
|
|
34
|
+
outline: none;
|
|
35
|
+
box-shadow:
|
|
36
|
+
0 0 0 var(--focus-ring-offset) var(--background),
|
|
37
|
+
0 0 0 calc(var(--focus-ring-offset) + var(--focus-ring-width)) var(--focus-ring-color);
|
|
80
38
|
}
|
|
81
39
|
|
|
82
|
-
[
|
|
83
|
-
|
|
40
|
+
:host([aria-invalid="true"]) [part="root"] {
|
|
41
|
+
border-color: color-mix(in oklch, var(--destructive) 70%, transparent);
|
|
42
|
+
background: color-mix(in oklch, var(--destructive) 15%, transparent);
|
|
84
43
|
}
|
|
85
44
|
|
|
45
|
+
[part="dot"] {
|
|
46
|
+
width: var(--space-2);
|
|
47
|
+
height: var(--space-2);
|
|
48
|
+
border-radius: 50%;
|
|
49
|
+
background: oklch(from var(--accent) 0.98 0.01 h);
|
|
50
|
+
}
|
|
86
51
|
`;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
* selected at a time within a group.
|
|
92
|
-
*
|
|
93
|
-
* @slot - Label content.
|
|
94
|
-
* @csspart root - The radio container.
|
|
95
|
-
* @csspart indicator - The selected state indicator.
|
|
96
|
-
* @cssprop --radio-size - Size of the radio button.
|
|
97
|
-
*/
|
|
98
|
-
let DuiRadio = (() => {
|
|
99
|
-
let _classSuper = LitElement;
|
|
100
|
-
let _value_decorators;
|
|
101
|
-
let _value_initializers = [];
|
|
102
|
-
let _value_extraInitializers = [];
|
|
103
|
-
let _disabled_decorators;
|
|
104
|
-
let _disabled_initializers = [];
|
|
105
|
-
let _disabled_extraInitializers = [];
|
|
106
|
-
let _readOnly_decorators;
|
|
107
|
-
let _readOnly_initializers = [];
|
|
108
|
-
let _readOnly_extraInitializers = [];
|
|
109
|
-
return class DuiRadio extends _classSuper {
|
|
110
|
-
static {
|
|
111
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
112
|
-
_value_decorators = [property()];
|
|
113
|
-
_disabled_decorators = [property({ type: Boolean, reflect: true })];
|
|
114
|
-
_readOnly_decorators = [property({ type: Boolean, reflect: true, attribute: "read-only" })];
|
|
115
|
-
__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);
|
|
116
|
-
__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);
|
|
117
|
-
__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);
|
|
118
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
119
|
-
}
|
|
120
|
-
static tagName = "dui-radio";
|
|
121
|
-
static formAssociated = true;
|
|
122
|
-
static styles = [base, styles];
|
|
123
|
-
#internals;
|
|
124
|
-
constructor() {
|
|
125
|
-
super();
|
|
126
|
-
this.#internals = this.attachInternals();
|
|
127
|
-
}
|
|
128
|
-
#value_accessor_storage = __runInitializers(this, _value_initializers, "");
|
|
129
|
-
/** The value attribute for this radio option. */
|
|
130
|
-
get value() { return this.#value_accessor_storage; }
|
|
131
|
-
set value(value) { this.#value_accessor_storage = value; }
|
|
132
|
-
#disabled_accessor_storage = (__runInitializers(this, _value_extraInitializers), __runInitializers(this, _disabled_initializers, false));
|
|
133
|
-
/** Whether the radio is disabled. */
|
|
134
|
-
get disabled() { return this.#disabled_accessor_storage; }
|
|
135
|
-
set disabled(value) { this.#disabled_accessor_storage = value; }
|
|
136
|
-
#readOnly_accessor_storage = (__runInitializers(this, _disabled_extraInitializers), __runInitializers(this, _readOnly_initializers, false));
|
|
137
|
-
/** Whether the radio is read-only. */
|
|
138
|
-
get readOnly() { return this.#readOnly_accessor_storage; }
|
|
139
|
-
set readOnly(value) { this.#readOnly_accessor_storage = value; }
|
|
140
|
-
#groupCtx = (__runInitializers(this, _readOnly_extraInitializers), new ContextConsumer(this, {
|
|
141
|
-
context: radioGroupContext,
|
|
142
|
-
subscribe: true,
|
|
143
|
-
}));
|
|
144
|
-
get #isChecked() {
|
|
145
|
-
return this.#groupCtx.value?.value === this.value;
|
|
146
|
-
}
|
|
147
|
-
get #isDisabled() {
|
|
148
|
-
return (this.disabled ||
|
|
149
|
-
(this.#groupCtx.value?.disabled ?? false));
|
|
150
|
-
}
|
|
151
|
-
get #isReadOnly() {
|
|
152
|
-
return this.readOnly || (this.#groupCtx.value?.readOnly ?? false);
|
|
153
|
-
}
|
|
154
|
-
get #isRequired() {
|
|
155
|
-
return this.#groupCtx.value?.required ?? false;
|
|
156
|
-
}
|
|
157
|
-
connectedCallback() {
|
|
158
|
-
super.connectedCallback();
|
|
159
|
-
this.addEventListener("click", this.#handleHostClick);
|
|
160
|
-
}
|
|
161
|
-
willUpdate() {
|
|
162
|
-
this.#syncFormValue();
|
|
163
|
-
}
|
|
164
|
-
#syncFormValue() {
|
|
165
|
-
if (this.#isChecked) {
|
|
166
|
-
this.#internals.setFormValue(this.value);
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
this.#internals.setFormValue(null);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
disconnectedCallback() {
|
|
173
|
-
super.disconnectedCallback();
|
|
174
|
-
this.removeEventListener("click", this.#handleHostClick);
|
|
175
|
-
}
|
|
176
|
-
#handleHostClick = (e) => {
|
|
177
|
-
if (e.target.closest("[part='root']"))
|
|
178
|
-
return;
|
|
179
|
-
this.#handleClick(e);
|
|
180
|
-
};
|
|
181
|
-
#handleClick = (_e) => {
|
|
182
|
-
if (this.#isDisabled || this.#isReadOnly)
|
|
183
|
-
return;
|
|
184
|
-
const ctx = this.#groupCtx.value;
|
|
185
|
-
if (ctx) {
|
|
186
|
-
ctx.select(this.value);
|
|
187
|
-
}
|
|
188
|
-
};
|
|
189
|
-
#handleKeyDown = (e) => {
|
|
190
|
-
if (e.key === " ") {
|
|
191
|
-
e.preventDefault();
|
|
192
|
-
this.#handleClick(e);
|
|
193
|
-
}
|
|
194
|
-
};
|
|
195
|
-
render() {
|
|
196
|
-
const isChecked = this.#isChecked;
|
|
197
|
-
const isDisabled = this.#isDisabled;
|
|
198
|
-
const isReadOnly = this.#isReadOnly;
|
|
199
|
-
const isRequired = this.#isRequired;
|
|
200
|
-
return html `
|
|
201
|
-
<span
|
|
202
|
-
part="root"
|
|
203
|
-
role="radio"
|
|
204
|
-
aria-checked="${String(isChecked)}"
|
|
205
|
-
aria-disabled="${isDisabled ? "true" : nothing}"
|
|
206
|
-
aria-readonly="${isReadOnly ? "true" : nothing}"
|
|
207
|
-
aria-required="${isRequired ? "true" : nothing}"
|
|
208
|
-
tabindex="${isDisabled ? nothing : "0"}"
|
|
209
|
-
?data-checked="${isChecked}"
|
|
210
|
-
?data-unchecked="${!isChecked}"
|
|
211
|
-
?data-disabled="${isDisabled}"
|
|
212
|
-
?data-readonly="${isReadOnly}"
|
|
213
|
-
?data-required="${isRequired}"
|
|
214
|
-
@click="${this.#handleClick}"
|
|
215
|
-
@keydown="${this.#handleKeyDown}"
|
|
216
|
-
>
|
|
217
|
-
<span
|
|
218
|
-
part="indicator"
|
|
219
|
-
?data-checked="${isChecked}"
|
|
220
|
-
?data-unchecked="${!isChecked}"
|
|
221
|
-
>
|
|
222
|
-
${isChecked ? html `<span part="dot"></span>` : nothing}
|
|
223
|
-
</span>
|
|
224
|
-
</span>
|
|
225
|
-
<slot></slot>
|
|
226
|
-
`;
|
|
227
|
-
}
|
|
228
|
-
};
|
|
229
|
-
})();
|
|
230
|
-
export { DuiRadio };
|
|
52
|
+
export class DuiRadio extends DuiRadioPrimitive {
|
|
53
|
+
static styles = [...DuiRadioPrimitive.styles, styles];
|
|
54
|
+
}
|
|
55
|
+
customElements.define(DuiRadio.tagName, DuiRadio);
|
package/scroll-area/index.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { DuiScrollArea };
|
|
3
|
-
export declare const scrollAreaFamily: (typeof DuiScrollArea)[];
|
|
1
|
+
import "./scroll-area.js";
|
|
2
|
+
export { DuiScrollArea } from "./scroll-area.js";
|
package/scroll-area/index.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { DuiScrollArea };
|
|
3
|
-
export const scrollAreaFamily = [DuiScrollArea];
|
|
1
|
+
import "./scroll-area.js";
|
|
2
|
+
export { DuiScrollArea } from "./scroll-area.js";
|
|
@@ -1,38 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* `<dui-scroll-area>` — A scroll container with custom styled scrollbar.
|
|
6
|
-
*
|
|
7
|
-
* Hides the native scrollbar and renders a custom track + thumb with
|
|
8
|
-
* auto-hide behavior. Supports vertical, horizontal, or both orientations.
|
|
9
|
-
*
|
|
10
|
-
* @slot - Default slot for scrollable content.
|
|
11
|
-
*
|
|
12
|
-
* @cssprop [--scroll-area-max-height] - Max-height constraint.
|
|
13
|
-
* @cssprop [--scroll-area-thumb-color] - Scrollbar thumb color.
|
|
14
|
-
* @cssprop [--scroll-fade-size] - Distance over which the top fade goes from transparent to opaque (default: 1.5rem).
|
|
15
|
-
*/
|
|
16
|
-
export declare class DuiScrollArea extends LitElement {
|
|
17
|
-
#private;
|
|
18
|
-
static tagName: "dui-scroll-area";
|
|
1
|
+
import { DuiScrollAreaPrimitive } from "@deepfuture/dui-primitives/scroll-area";
|
|
2
|
+
import "../_install.js";
|
|
3
|
+
export declare class DuiScrollArea extends DuiScrollAreaPrimitive {
|
|
19
4
|
static styles: import("lit").CSSResult[];
|
|
20
|
-
/** Scroll direction(s). */
|
|
21
|
-
accessor orientation: ScrollAreaOrientation;
|
|
22
|
-
/** Show a fade overlay at the top when scrolled. */
|
|
23
|
-
accessor fade: boolean;
|
|
24
|
-
/** Optional max-height constraint (CSS value). */
|
|
25
|
-
accessor maxHeight: string | undefined;
|
|
26
|
-
protected willUpdate(changed: PropertyValues): void;
|
|
27
|
-
connectedCallback(): void;
|
|
28
|
-
disconnectedCallback(): void;
|
|
29
|
-
protected firstUpdated(): void;
|
|
30
|
-
/** Scroll the viewport to the bottom. */
|
|
31
|
-
scrollToBottom(): Promise<void>;
|
|
32
|
-
/** Whether the viewport is scrolled to the top. */
|
|
33
|
-
get isAtTop(): boolean;
|
|
34
|
-
/** Whether the viewport is scrolled to the bottom. */
|
|
35
|
-
get isAtBottom(): boolean;
|
|
36
|
-
render(): TemplateResult;
|
|
37
5
|
}
|
|
38
|
-
export {};
|