@editora/ui-core 0.1.12 → 0.1.14
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 +95 -5
- package/dist/alert-dialog.cjs.js +18 -18
- package/dist/alert-dialog.esm.js +130 -117
- package/dist/app-header.cjs.js +22 -2
- package/dist/app-header.esm.js +22 -2
- package/dist/badge.cjs.js +5 -5
- package/dist/badge.esm.js +9 -8
- package/dist/color-picker.cjs.js +4 -4
- package/dist/color-picker.esm.js +40 -31
- package/dist/combobox.cjs.js +21 -21
- package/dist/combobox.esm.js +79 -40
- package/dist/command-palette.cjs.js +1 -1
- package/dist/command-palette.esm.js +2 -2
- package/dist/components/date-time-utils.d.ts +2 -1
- package/dist/components/date-time-utils.d.ts.map +1 -1
- package/dist/components/ui-alert-dialog.d.ts +2 -0
- package/dist/components/ui-alert-dialog.d.ts.map +1 -1
- package/dist/components/ui-app-header.d.ts.map +1 -1
- package/dist/components/ui-badge.d.ts.map +1 -1
- package/dist/components/ui-color-picker.d.ts.map +1 -1
- package/dist/components/ui-combobox.d.ts +4 -1
- package/dist/components/ui-combobox.d.ts.map +1 -1
- package/dist/components/ui-context-menu.d.ts +6 -0
- package/dist/components/ui-context-menu.d.ts.map +1 -1
- package/dist/components/ui-date-picker.d.ts +3 -0
- package/dist/components/ui-date-picker.d.ts.map +1 -1
- package/dist/components/ui-date-range-picker.d.ts +3 -0
- package/dist/components/ui-date-range-picker.d.ts.map +1 -1
- package/dist/components/ui-date-range-time-picker.d.ts +3 -0
- package/dist/components/ui-date-range-time-picker.d.ts.map +1 -1
- package/dist/components/ui-date-time-picker.d.ts +3 -0
- package/dist/components/ui-date-time-picker.d.ts.map +1 -1
- package/dist/components/ui-dialog.d.ts +3 -0
- package/dist/components/ui-dialog.d.ts.map +1 -1
- package/dist/components/ui-drawer.d.ts +14 -0
- package/dist/components/ui-drawer.d.ts.map +1 -1
- package/dist/components/ui-floating-toolbar.d.ts +3 -0
- package/dist/components/ui-floating-toolbar.d.ts.map +1 -1
- package/dist/components/ui-gantt.d.ts +30 -1
- package/dist/components/ui-gantt.d.ts.map +1 -1
- package/dist/components/ui-hover-card.d.ts +3 -0
- package/dist/components/ui-hover-card.d.ts.map +1 -1
- package/dist/components/ui-menu.d.ts +1 -0
- package/dist/components/ui-menu.d.ts.map +1 -1
- package/dist/components/ui-menubar.d.ts +1 -0
- package/dist/components/ui-menubar.d.ts.map +1 -1
- package/dist/components/ui-positioner.d.ts.map +1 -1
- package/dist/components/ui-quick-actions.d.ts.map +1 -1
- package/dist/components/ui-radio.d.ts +47 -0
- package/dist/components/ui-radio.d.ts.map +1 -0
- package/dist/components/ui-select.d.ts +8 -0
- package/dist/components/ui-select.d.ts.map +1 -1
- package/dist/components/ui-selection-popup.d.ts.map +1 -1
- package/dist/components/ui-stepper.d.ts.map +1 -1
- package/dist/components/ui-time-picker.d.ts +3 -0
- package/dist/components/ui-time-picker.d.ts.map +1 -1
- package/dist/context-menu.cjs.js +12 -12
- package/dist/context-menu.esm.js +160 -133
- package/dist/date-field.cjs.js +1 -1
- package/dist/date-field.esm.js +3 -2
- package/dist/date-picker.cjs.js +13 -13
- package/dist/date-picker.esm.js +101 -67
- package/dist/date-range-picker.cjs.js +14 -14
- package/dist/date-range-picker.esm.js +99 -65
- package/dist/date-range-time-picker.cjs.js +13 -13
- package/dist/date-range-time-picker.esm.js +77 -45
- package/dist/date-time-picker.cjs.js +13 -13
- package/dist/date-time-picker.esm.js +133 -101
- package/dist/date-time-utils-66480de4.js +1 -0
- package/dist/date-time-utils-a2c7af25.mjs +307 -0
- package/dist/dialog.cjs.js +29 -20
- package/dist/dialog.esm.js +90 -70
- package/dist/drawer.cjs.js +16 -16
- package/dist/drawer.esm.js +216 -98
- package/dist/floating-toolbar.cjs.js +6 -16
- package/dist/floating-toolbar.esm.js +57 -40
- package/dist/gantt.cjs.js +656 -74
- package/dist/gantt.esm.js +1050 -100
- package/dist/hover-card.cjs.js +4 -4
- package/dist/hover-card.esm.js +62 -39
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +300 -286
- package/dist/menu.cjs.js +2 -2
- package/dist/menu.esm.js +118 -110
- package/dist/menubar.cjs.js +5 -5
- package/dist/menubar.esm.js +83 -78
- package/dist/{overlayManager-ece06517.js → overlayManager-0eda4e08.js} +1 -1
- package/dist/{overlayManager-86454af7.mjs → overlayManager-5bbd4dc3.mjs} +1 -1
- package/dist/popover.cjs.js +1 -1
- package/dist/popover.esm.js +2 -2
- package/dist/portal-c69756c0.js +1 -0
- package/dist/portal-fe73e5cc.mjs +123 -0
- package/dist/portal.d.ts +29 -3
- package/dist/portal.d.ts.map +1 -1
- package/dist/positioner-33529bb8.js +1 -0
- package/dist/positioner-e9770c66.mjs +582 -0
- package/dist/positioner.cjs.js +2 -2
- package/dist/positioner.esm.js +36 -26
- package/dist/primitives/positioner.d.ts +199 -1
- package/dist/primitives/positioner.d.ts.map +1 -1
- package/dist/quick-actions.cjs.js +10 -4
- package/dist/quick-actions.esm.js +27 -21
- package/dist/radio.cjs.js +259 -0
- package/dist/radio.esm.js +455 -0
- package/dist/{runtime-4ac0107b.mjs → runtime-161f68a2.mjs} +24 -23
- package/dist/runtime-3f13807b.js +1 -0
- package/dist/runtime.cjs.js +1 -1
- package/dist/runtime.d.ts +2 -0
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.esm.js +39 -24
- package/dist/scroll-lock-31da444f.mjs +56 -0
- package/dist/scroll-lock-d7b0df21.js +1 -0
- package/dist/scroll-lock.d.ts.map +1 -1
- package/dist/select.cjs.js +14 -15
- package/dist/select.esm.js +117 -97
- package/dist/selection-popup.cjs.js +4 -7
- package/dist/selection-popup.esm.js +8 -11
- package/dist/split-button.cjs.js +1 -1
- package/dist/split-button.esm.js +2 -2
- package/dist/standalone/radio.d.ts +2 -0
- package/dist/standalone/radio.d.ts.map +1 -0
- package/dist/stepper.cjs.js +19 -50
- package/dist/stepper.esm.js +17 -48
- package/dist/time-field.cjs.js +1 -1
- package/dist/time-field.esm.js +3 -2
- package/dist/time-picker.cjs.js +15 -15
- package/dist/time-picker.esm.js +100 -68
- package/dist/tooltip.cjs.js +1 -1
- package/dist/tooltip.esm.js +2 -1
- package/package.json +1 -1
- package/dist/date-time-utils-5cf58cd0.js +0 -1
- package/dist/date-time-utils-bdceb7af.mjs +0 -273
- package/dist/portal-1cf392ca.mjs +0 -114
- package/dist/portal-d8d7fbca.js +0 -1
- package/dist/positioner-accc6e5f.js +0 -1
- package/dist/positioner-fbd61bf1.mjs +0 -132
- package/dist/runtime-5f282bc8.js +0 -1
- package/dist/scroll-lock-48793569.js +0 -1
- package/dist/scroll-lock-9de6d328.mjs +0 -53
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
import { E as l } from "./ElementBase-909688f3.mjs";
|
|
2
|
+
const u = `
|
|
3
|
+
:host {
|
|
4
|
+
--ui-radio-size: 18px;
|
|
5
|
+
--ui-radio-hit-area: 24px;
|
|
6
|
+
--ui-radio-dot-size: 8px;
|
|
7
|
+
--ui-radio-border: 1.5px solid color-mix(in srgb, var(--ui-radio-accent, var(--ui-primary, var(--ui-color-primary, #2563eb))) 44%, var(--ui-color-border, #cbd5e1) 56%);
|
|
8
|
+
--ui-radio-background: var(--ui-bg, var(--ui-color-surface, #ffffff));
|
|
9
|
+
--ui-radio-accent: var(--ui-primary, var(--ui-color-primary, #2563eb));
|
|
10
|
+
--ui-radio-dot-color: var(--ui-radio-accent);
|
|
11
|
+
--ui-radio-focus: 0 0 0 4px color-mix(in srgb, var(--ui-radio-accent) 24%, transparent);
|
|
12
|
+
--ui-radio-invalid: var(--ui-color-danger, #dc2626);
|
|
13
|
+
--ui-radio-invalid-focus: 0 0 0 4px color-mix(in srgb, var(--ui-radio-invalid) 24%, transparent);
|
|
14
|
+
--ui-radio-disabled-bg: color-mix(in srgb, var(--ui-color-surface-alt, #f1f5f9) 88%, #ffffff 12%);
|
|
15
|
+
--ui-radio-disabled-border: 1.5px solid color-mix(in srgb, var(--ui-color-border, #cbd5e1) 78%, transparent);
|
|
16
|
+
--ui-radio-label-color: var(--ui-color-text, var(--ui-text, #0f172a));
|
|
17
|
+
--ui-radio-muted: var(--ui-color-muted, #64748b);
|
|
18
|
+
--ui-radio-duration: 170ms;
|
|
19
|
+
--ui-radio-easing: cubic-bezier(0.2, 0.8, 0.2, 1);
|
|
20
|
+
|
|
21
|
+
display: inline-flex;
|
|
22
|
+
vertical-align: middle;
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
user-select: none;
|
|
25
|
+
color-scheme: light dark;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:host([density="compact"]) {
|
|
29
|
+
--ui-radio-size: 16px;
|
|
30
|
+
--ui-radio-hit-area: 20px;
|
|
31
|
+
--ui-radio-dot-size: 7px;
|
|
32
|
+
--ui-radio-duration: 140ms;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:host([density="compact"]) .label {
|
|
36
|
+
font-size: 13px;
|
|
37
|
+
line-height: 1.35;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
:host([density="comfortable"]) {
|
|
41
|
+
--ui-radio-size: 20px;
|
|
42
|
+
--ui-radio-hit-area: 28px;
|
|
43
|
+
--ui-radio-dot-size: 9px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
:host([density="comfortable"]) .label {
|
|
47
|
+
font-size: 15px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:host([tone="neutral"]) { --ui-radio-accent: #64748b; }
|
|
51
|
+
:host([tone="success"]) { --ui-radio-accent: #16a34a; }
|
|
52
|
+
:host([tone="warning"]) { --ui-radio-accent: #d97706; }
|
|
53
|
+
:host([tone="danger"]) { --ui-radio-accent: #dc2626; }
|
|
54
|
+
:host([tone="info"]) { --ui-radio-accent: #0ea5e9; }
|
|
55
|
+
|
|
56
|
+
:host([disabled]),
|
|
57
|
+
:host([loading]) {
|
|
58
|
+
cursor: not-allowed;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.row {
|
|
62
|
+
display: inline-flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
gap: 10px;
|
|
65
|
+
min-height: var(--ui-radio-hit-area);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.control-wrap {
|
|
69
|
+
width: var(--ui-radio-hit-area);
|
|
70
|
+
min-width: var(--ui-radio-hit-area);
|
|
71
|
+
height: var(--ui-radio-hit-area);
|
|
72
|
+
display: inline-flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
justify-content: center;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.control {
|
|
78
|
+
width: var(--ui-radio-size);
|
|
79
|
+
min-width: var(--ui-radio-size);
|
|
80
|
+
height: var(--ui-radio-size);
|
|
81
|
+
border-radius: 999px;
|
|
82
|
+
border: var(--ui-radio-border);
|
|
83
|
+
background: var(--ui-radio-background);
|
|
84
|
+
box-sizing: border-box;
|
|
85
|
+
display: inline-flex;
|
|
86
|
+
align-items: center;
|
|
87
|
+
justify-content: center;
|
|
88
|
+
position: relative;
|
|
89
|
+
overflow: hidden;
|
|
90
|
+
transition:
|
|
91
|
+
border-color var(--ui-radio-duration) var(--ui-radio-easing),
|
|
92
|
+
background-color var(--ui-radio-duration) var(--ui-radio-easing),
|
|
93
|
+
box-shadow var(--ui-radio-duration) var(--ui-radio-easing),
|
|
94
|
+
transform var(--ui-radio-duration) var(--ui-radio-easing);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.control::before {
|
|
98
|
+
content: '';
|
|
99
|
+
position: absolute;
|
|
100
|
+
inset: 0;
|
|
101
|
+
border-radius: inherit;
|
|
102
|
+
background: linear-gradient(180deg, color-mix(in srgb, #ffffff 26%, transparent), transparent 56%);
|
|
103
|
+
opacity: 0.18;
|
|
104
|
+
pointer-events: none;
|
|
105
|
+
transition: opacity var(--ui-radio-duration) var(--ui-radio-easing);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.dot {
|
|
109
|
+
width: var(--ui-radio-dot-size);
|
|
110
|
+
height: var(--ui-radio-dot-size);
|
|
111
|
+
border-radius: 999px;
|
|
112
|
+
background: var(--ui-radio-dot-color);
|
|
113
|
+
opacity: 0;
|
|
114
|
+
transform: scale(0.2);
|
|
115
|
+
transition:
|
|
116
|
+
opacity var(--ui-radio-duration) var(--ui-radio-easing),
|
|
117
|
+
transform var(--ui-radio-duration) var(--ui-radio-easing);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.spinner {
|
|
121
|
+
position: absolute;
|
|
122
|
+
width: calc(var(--ui-radio-size) - 5px);
|
|
123
|
+
height: calc(var(--ui-radio-size) - 5px);
|
|
124
|
+
border-radius: 999px;
|
|
125
|
+
border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
|
|
126
|
+
border-top-color: currentColor;
|
|
127
|
+
opacity: 0;
|
|
128
|
+
animation: ui-radio-spin 700ms linear infinite;
|
|
129
|
+
pointer-events: none;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
:host([checked]) .control {
|
|
133
|
+
border-color: var(--ui-radio-accent);
|
|
134
|
+
background: color-mix(in srgb, var(--ui-radio-accent) 8%, var(--ui-radio-background));
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
:host([checked]) .control::before {
|
|
138
|
+
opacity: 0.28;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
:host([checked]) .dot {
|
|
142
|
+
opacity: 1;
|
|
143
|
+
transform: scale(1);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
:host(:focus-visible) .control {
|
|
147
|
+
box-shadow: var(--ui-radio-focus);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
:host(:not([disabled]):not([loading]):hover) .control {
|
|
151
|
+
transform: translateY(-0.5px);
|
|
152
|
+
border-color: color-mix(in srgb, var(--ui-radio-accent) 80%, #0f172a 20%);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
:host(:not([disabled]):not([loading]):active) .control {
|
|
156
|
+
transform: scale(0.96);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
:host([invalid]) .control {
|
|
160
|
+
border-color: var(--ui-radio-invalid);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
:host([invalid]:focus-visible) .control {
|
|
164
|
+
box-shadow: var(--ui-radio-invalid-focus);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
:host([disabled]) .control,
|
|
168
|
+
:host([loading]) .control {
|
|
169
|
+
background: var(--ui-radio-disabled-bg);
|
|
170
|
+
border: var(--ui-radio-disabled-border);
|
|
171
|
+
box-shadow: none;
|
|
172
|
+
transform: none;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
:host([loading]) .spinner {
|
|
176
|
+
opacity: 1;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.label {
|
|
180
|
+
color: var(--ui-radio-label-color);
|
|
181
|
+
font-size: 14px;
|
|
182
|
+
line-height: 1.4;
|
|
183
|
+
letter-spacing: -0.005em;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.label:empty {
|
|
187
|
+
display: none;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
:host([disabled]) .label,
|
|
191
|
+
:host([loading]) .label {
|
|
192
|
+
color: color-mix(in srgb, var(--ui-radio-label-color) 55%, var(--ui-radio-muted) 45%);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
:host([headless]) .control {
|
|
196
|
+
display: none;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
:host([headless]) .control-wrap {
|
|
200
|
+
width: 0;
|
|
201
|
+
min-width: 0;
|
|
202
|
+
height: 0;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
:host([headless]) .row {
|
|
206
|
+
gap: 0;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
:host([headless]) .label {
|
|
210
|
+
color: inherit;
|
|
211
|
+
font: inherit;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
@keyframes ui-radio-spin {
|
|
215
|
+
to {
|
|
216
|
+
transform: rotate(360deg);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
@media (prefers-reduced-motion: reduce) {
|
|
221
|
+
.control,
|
|
222
|
+
.dot,
|
|
223
|
+
.spinner {
|
|
224
|
+
transition: none !important;
|
|
225
|
+
animation: none !important;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
@media (prefers-contrast: more) {
|
|
230
|
+
:host {
|
|
231
|
+
--ui-radio-border: 2px solid currentColor;
|
|
232
|
+
--ui-radio-disabled-border: 2px solid currentColor;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
@media (forced-colors: active) {
|
|
237
|
+
:host {
|
|
238
|
+
--ui-radio-background: Canvas;
|
|
239
|
+
--ui-radio-border: 1px solid CanvasText;
|
|
240
|
+
--ui-radio-accent: Highlight;
|
|
241
|
+
--ui-radio-invalid: Highlight;
|
|
242
|
+
--ui-radio-disabled-bg: Canvas;
|
|
243
|
+
--ui-radio-disabled-border: 1px solid GrayText;
|
|
244
|
+
--ui-radio-focus: 0 0 0 2px Highlight;
|
|
245
|
+
--ui-radio-invalid-focus: 0 0 0 2px Highlight;
|
|
246
|
+
--ui-radio-label-color: CanvasText;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
`;
|
|
250
|
+
function o(r) {
|
|
251
|
+
return r !== null && r.toLowerCase() !== "false" && r !== "0";
|
|
252
|
+
}
|
|
253
|
+
function c(r) {
|
|
254
|
+
return r instanceof HTMLElement ? !!r.closest('a, button, input, select, textarea, [contenteditable="true"], [data-ui-radio-no-toggle]') : !1;
|
|
255
|
+
}
|
|
256
|
+
class s extends l {
|
|
257
|
+
constructor() {
|
|
258
|
+
super(), this._uid = `ui-radio-${Math.random().toString(36).slice(2, 9)}`, this._onClick = this._onClick.bind(this), this._onKeyDown = this._onKeyDown.bind(this);
|
|
259
|
+
}
|
|
260
|
+
static get observedAttributes() {
|
|
261
|
+
return [
|
|
262
|
+
"checked",
|
|
263
|
+
"disabled",
|
|
264
|
+
"loading",
|
|
265
|
+
"invalid",
|
|
266
|
+
"required",
|
|
267
|
+
"headless",
|
|
268
|
+
"name",
|
|
269
|
+
"value",
|
|
270
|
+
"tabindex"
|
|
271
|
+
];
|
|
272
|
+
}
|
|
273
|
+
connectedCallback() {
|
|
274
|
+
super.connectedCallback(), this.addEventListener("click", this._onClick), this.addEventListener("keydown", this._onKeyDown), this.checked && this._uncheckSiblings(), this._syncA11yState();
|
|
275
|
+
}
|
|
276
|
+
disconnectedCallback() {
|
|
277
|
+
this.removeEventListener("click", this._onClick), this.removeEventListener("keydown", this._onKeyDown), super.disconnectedCallback();
|
|
278
|
+
}
|
|
279
|
+
attributeChangedCallback(e, i, t) {
|
|
280
|
+
i !== t && ((e === "checked" || e === "name") && this.checked && this._uncheckSiblings(), this._syncA11yState());
|
|
281
|
+
}
|
|
282
|
+
get checked() {
|
|
283
|
+
return o(this.getAttribute("checked"));
|
|
284
|
+
}
|
|
285
|
+
set checked(e) {
|
|
286
|
+
const i = !!e;
|
|
287
|
+
i !== this.checked && (i ? this.setAttribute("checked", "") : this.removeAttribute("checked"));
|
|
288
|
+
}
|
|
289
|
+
get disabled() {
|
|
290
|
+
return o(this.getAttribute("disabled"));
|
|
291
|
+
}
|
|
292
|
+
set disabled(e) {
|
|
293
|
+
const i = !!e;
|
|
294
|
+
i !== this.disabled && (i ? this.setAttribute("disabled", "") : this.removeAttribute("disabled"));
|
|
295
|
+
}
|
|
296
|
+
get loading() {
|
|
297
|
+
return o(this.getAttribute("loading"));
|
|
298
|
+
}
|
|
299
|
+
set loading(e) {
|
|
300
|
+
const i = !!e;
|
|
301
|
+
i !== this.loading && (i ? this.setAttribute("loading", "") : this.removeAttribute("loading"));
|
|
302
|
+
}
|
|
303
|
+
get invalid() {
|
|
304
|
+
return o(this.getAttribute("invalid"));
|
|
305
|
+
}
|
|
306
|
+
set invalid(e) {
|
|
307
|
+
const i = !!e;
|
|
308
|
+
i !== this.invalid && (i ? this.setAttribute("invalid", "") : this.removeAttribute("invalid"));
|
|
309
|
+
}
|
|
310
|
+
get required() {
|
|
311
|
+
return o(this.getAttribute("required"));
|
|
312
|
+
}
|
|
313
|
+
set required(e) {
|
|
314
|
+
const i = !!e;
|
|
315
|
+
i !== this.required && (i ? this.setAttribute("required", "") : this.removeAttribute("required"));
|
|
316
|
+
}
|
|
317
|
+
get headless() {
|
|
318
|
+
return this.hasAttribute("headless");
|
|
319
|
+
}
|
|
320
|
+
set headless(e) {
|
|
321
|
+
e !== this.headless && (e ? this.setAttribute("headless", "") : this.removeAttribute("headless"));
|
|
322
|
+
}
|
|
323
|
+
get name() {
|
|
324
|
+
return this.getAttribute("name") || "";
|
|
325
|
+
}
|
|
326
|
+
set name(e) {
|
|
327
|
+
const i = String(e || "").trim();
|
|
328
|
+
if (!i) {
|
|
329
|
+
this.removeAttribute("name");
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
this.setAttribute("name", i);
|
|
333
|
+
}
|
|
334
|
+
get value() {
|
|
335
|
+
return this.getAttribute("value") || "";
|
|
336
|
+
}
|
|
337
|
+
set value(e) {
|
|
338
|
+
const i = String(e || "");
|
|
339
|
+
if (!i) {
|
|
340
|
+
this.removeAttribute("value");
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
this.setAttribute("value", i);
|
|
344
|
+
}
|
|
345
|
+
get density() {
|
|
346
|
+
return this.getAttribute("density") || "default";
|
|
347
|
+
}
|
|
348
|
+
set density(e) {
|
|
349
|
+
const i = (e || "").trim().toLowerCase();
|
|
350
|
+
if (!i || i === "default") {
|
|
351
|
+
this.removeAttribute("density");
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
this.setAttribute("density", i);
|
|
355
|
+
}
|
|
356
|
+
get tone() {
|
|
357
|
+
const e = this.getAttribute("tone");
|
|
358
|
+
return e === "neutral" || e === "success" || e === "warning" || e === "danger" || e === "info" ? e : "brand";
|
|
359
|
+
}
|
|
360
|
+
set tone(e) {
|
|
361
|
+
const i = (e || "").trim().toLowerCase();
|
|
362
|
+
if (!i || i === "brand") {
|
|
363
|
+
this.removeAttribute("tone");
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
this.setAttribute("tone", i);
|
|
367
|
+
}
|
|
368
|
+
_syncA11yState() {
|
|
369
|
+
const e = this.disabled || this.loading, i = e ? "-1" : this.getAttribute("tabindex") || "0", t = `${this._uid}-label`;
|
|
370
|
+
this.setAttribute("role", "radio"), this.setAttribute("aria-checked", this.checked ? "true" : "false"), this.setAttribute("aria-disabled", e ? "true" : "false"), this.setAttribute("aria-busy", this.loading ? "true" : "false"), this.setAttribute("aria-required", this.required ? "true" : "false"), this.invalid ? this.setAttribute("aria-invalid", "true") : this.removeAttribute("aria-invalid"), this.setAttribute("aria-labelledby", t), this.setAttribute("tabindex", i);
|
|
371
|
+
}
|
|
372
|
+
_resolveQueryScope() {
|
|
373
|
+
const e = this.closest("form, ui-form");
|
|
374
|
+
if (e)
|
|
375
|
+
return e;
|
|
376
|
+
const i = this.getRootNode();
|
|
377
|
+
return i instanceof Document || i instanceof ShadowRoot || i instanceof Element ? i : null;
|
|
378
|
+
}
|
|
379
|
+
_getGroupMembers() {
|
|
380
|
+
const e = this.name.trim();
|
|
381
|
+
if (!e)
|
|
382
|
+
return [this];
|
|
383
|
+
const i = this._resolveQueryScope();
|
|
384
|
+
return !i || !("querySelectorAll" in i) ? [this] : Array.from(i.querySelectorAll("ui-radio")).filter(
|
|
385
|
+
(t) => t instanceof s && t.name === e
|
|
386
|
+
);
|
|
387
|
+
}
|
|
388
|
+
_uncheckSiblings() {
|
|
389
|
+
this._getGroupMembers().forEach((i) => {
|
|
390
|
+
i !== this && i.checked && (i.checked = !1);
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
_focusSelf() {
|
|
394
|
+
try {
|
|
395
|
+
this.focus({ preventScroll: !0 });
|
|
396
|
+
} catch {
|
|
397
|
+
this.focus();
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
_checkFromUser(e) {
|
|
401
|
+
if (this.disabled || this.loading || this.checked)
|
|
402
|
+
return;
|
|
403
|
+
this.checked = !0;
|
|
404
|
+
const i = {
|
|
405
|
+
checked: !0,
|
|
406
|
+
value: this.value || void 0,
|
|
407
|
+
name: this.name || void 0,
|
|
408
|
+
reason: e
|
|
409
|
+
};
|
|
410
|
+
this.dispatchEvent(new CustomEvent("input", { detail: i, bubbles: !0, composed: !0 })), this.dispatchEvent(new CustomEvent("change", { detail: i, bubbles: !0, composed: !0 }));
|
|
411
|
+
}
|
|
412
|
+
_moveGroupSelection(e) {
|
|
413
|
+
const i = this._getGroupMembers().filter((n) => !n.disabled && !n.loading);
|
|
414
|
+
if (i.length <= 1)
|
|
415
|
+
return;
|
|
416
|
+
const d = (Math.max(i.indexOf(this), 0) + e + i.length) % i.length, a = i[d];
|
|
417
|
+
!a || a === this || (a._checkFromUser("keyboard"), a._focusSelf());
|
|
418
|
+
}
|
|
419
|
+
_onClick(e) {
|
|
420
|
+
this.disabled || this.loading || e.composedPath().some((t) => c(t)) || this._checkFromUser("click");
|
|
421
|
+
}
|
|
422
|
+
_onKeyDown(e) {
|
|
423
|
+
if (!(this.disabled || this.loading)) {
|
|
424
|
+
if (e.key === " " || e.key === "Enter") {
|
|
425
|
+
e.preventDefault(), this._checkFromUser("keyboard");
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
428
|
+
if (this.name) {
|
|
429
|
+
if (e.key === "ArrowRight" || e.key === "ArrowDown") {
|
|
430
|
+
e.preventDefault(), this._moveGroupSelection(1);
|
|
431
|
+
return;
|
|
432
|
+
}
|
|
433
|
+
(e.key === "ArrowLeft" || e.key === "ArrowUp") && (e.preventDefault(), this._moveGroupSelection(-1));
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
render() {
|
|
438
|
+
this._syncA11yState(), this.setContent(`
|
|
439
|
+
<style>${u}</style>
|
|
440
|
+
<span class="row" part="root">
|
|
441
|
+
<span class="control-wrap" part="hit-area" aria-hidden="true">
|
|
442
|
+
<span class="control" part="control">
|
|
443
|
+
<span class="dot" part="dot"></span>
|
|
444
|
+
<span class="spinner" part="spinner"></span>
|
|
445
|
+
</span>
|
|
446
|
+
</span>
|
|
447
|
+
<span class="label" id="${this._uid}-label" part="label"><slot></slot></span>
|
|
448
|
+
</span>
|
|
449
|
+
`);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
typeof customElements < "u" && !customElements.get("ui-radio") && customElements.define("ui-radio", s);
|
|
453
|
+
export {
|
|
454
|
+
s as UIRadio
|
|
455
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import "./portal-
|
|
1
|
+
import "./portal-fe73e5cc.mjs";
|
|
2
|
+
import "./positioner-e9770c66.mjs";
|
|
2
3
|
function ja() {
|
|
3
4
|
return typeof window < "u" && typeof document < "u";
|
|
4
5
|
}
|
|
@@ -323,16 +324,16 @@ function oe(e = {}) {
|
|
|
323
324
|
function Sa() {
|
|
324
325
|
return x || (x = oe()), x;
|
|
325
326
|
}
|
|
326
|
-
function
|
|
327
|
+
function ge(e = {}) {
|
|
327
328
|
return Sa().alert(e);
|
|
328
329
|
}
|
|
329
|
-
function
|
|
330
|
+
function me(e = {}) {
|
|
330
331
|
return Sa().confirm(e);
|
|
331
332
|
}
|
|
332
|
-
function
|
|
333
|
+
function he(e = {}) {
|
|
333
334
|
return Sa().prompt(e);
|
|
334
335
|
}
|
|
335
|
-
function
|
|
336
|
+
function xe(e = "programmatic") {
|
|
336
337
|
x && (x.destroy(e), x = null);
|
|
337
338
|
}
|
|
338
339
|
function Ua() {
|
|
@@ -540,13 +541,13 @@ function pe(e = {}) {
|
|
|
540
541
|
function Na() {
|
|
541
542
|
return b || (b = pe()), b;
|
|
542
543
|
}
|
|
543
|
-
function
|
|
544
|
+
function be(e = {}) {
|
|
544
545
|
return Na().open(e);
|
|
545
546
|
}
|
|
546
|
-
function
|
|
547
|
+
function ye(e = {}) {
|
|
547
548
|
return Na().confirm(e);
|
|
548
549
|
}
|
|
549
|
-
function
|
|
550
|
+
function we(e = "programmatic") {
|
|
550
551
|
b && (b.destroy(e), b = null);
|
|
551
552
|
}
|
|
552
553
|
const Ga = {
|
|
@@ -1772,7 +1773,7 @@ const _a = {
|
|
|
1772
1773
|
6: "0 0 0 1px var(--gray-a6),0 12px 60px var(--black-a4),0 16px 64px var(--black-a6),0 16px 36px -20px var(--black-a11)"
|
|
1773
1774
|
},
|
|
1774
1775
|
components: le
|
|
1775
|
-
},
|
|
1776
|
+
}, ve = _a, Xa = /* @__PURE__ */ new Set();
|
|
1776
1777
|
function p(e, a) {
|
|
1777
1778
|
if (!(!e && !a))
|
|
1778
1779
|
return { ...e || {}, ...a || {} };
|
|
@@ -1879,7 +1880,7 @@ function Ya(e, a) {
|
|
|
1879
1880
|
}
|
|
1880
1881
|
};
|
|
1881
1882
|
}
|
|
1882
|
-
function
|
|
1883
|
+
function ke(e, a, n = "light") {
|
|
1883
1884
|
const i = g[a][n], r = e;
|
|
1884
1885
|
return Ya(
|
|
1885
1886
|
{
|
|
@@ -1912,14 +1913,14 @@ function s(e, a, n) {
|
|
|
1912
1913
|
typeof r == "string" && r && e.style.setProperty(`${a}${i}`, r);
|
|
1913
1914
|
});
|
|
1914
1915
|
}
|
|
1915
|
-
function
|
|
1916
|
+
function _e(e) {
|
|
1916
1917
|
e && Xa.add(e);
|
|
1917
1918
|
}
|
|
1918
1919
|
function Wa(e, a) {
|
|
1919
1920
|
var n, i, r, o, c, l, d, f, u, m, h, y, w, v, k, _, S, C, z, E, A, D, T, I, L, M, P, R, H, F, O, B, $, V, j, Z, U, Q, W, N, G, K, J, X, Y, q, aa, ea, ia, na, oa, ta, ra, sa, pa, ca, la, da, fa, ua, ga, ma, ha, xa, ba, ya, wa, va, Ca, za, Ea, Aa, Da, Ta, Ia, La, Ma, Pa, Ra, Ha, Fa, Oa, Ba, $a, Va;
|
|
1920
1921
|
t(e, "--ui-color-primary", a.colors.primary), t(e, "--ui-color-primary-hover", a.colors.primaryHover || a.colors.primary), t(e, "--ui-color-foreground-on-primary", a.colors.foregroundOnPrimary || "#ffffff"), t(e, "--ui-color-background", a.colors.background || "#ffffff"), t(e, "--ui-color-surface", a.colors.surface || a.colors.background || "#ffffff"), t(e, "--ui-color-surface-alt", a.colors.surfaceAlt || a.colors.surface || "#f9f9f9"), t(e, "--ui-color-text", a.colors.text || "#202020"), t(e, "--ui-color-muted", a.colors.muted || "#646464"), t(e, "--ui-color-border", a.colors.border || "#0000001f"), t(e, "--ui-color-focus-ring", a.colors.focusRing || a.colors.primary), t(e, "--ui-color-success", a.colors.success || "#30a46c"), t(e, "--ui-color-danger", a.colors.danger || "#e5484d"), t(e, "--ui-color-warning", a.colors.warning || a.colors.primary), t(e, "--ui-primary", a.colors.primary), t(e, "--ui-primary-hover", a.colors.primaryHover || a.colors.primary), t(e, "--ui-foreground", a.colors.foregroundOnPrimary || "#ffffff"), t(e, "--ui-background", a.colors.background || "#ffffff"), t(e, "--ui-surface", a.colors.surface || a.colors.background || "#ffffff"), t(e, "--ui-surface-alt", a.colors.surfaceAlt || a.colors.surface || "#f9f9f9"), t(e, "--ui-text", a.colors.text || "#202020"), t(e, "--ui-muted", a.colors.muted || "#646464"), t(e, "--ui-border", a.colors.border || "#0000001f"), t(e, "--ui-focus-ring", a.colors.focusRing || a.colors.primary), t(e, "--ui-success", a.colors.success || "#30a46c"), t(e, "--ui-error", a.colors.danger || "#e5484d"), t(e, "--ui-warning", a.colors.warning || a.colors.primary), t(e, "--ui-radius", a.radius || "4px"), t(e, "--ui-space-xs", ((n = a.spacing) == null ? void 0 : n.xs) || "4px"), t(e, "--ui-space-sm", ((i = a.spacing) == null ? void 0 : i.sm) || "8px"), t(e, "--ui-space-md", ((r = a.spacing) == null ? void 0 : r.md) || "12px"), t(e, "--ui-space-lg", ((o = a.spacing) == null ? void 0 : o.lg) || "24px"), t(e, "--ui-space-xl", ((c = a.spacing) == null ? void 0 : c.xl) || "32px"), t(e, "--ui-space-xxl", ((l = a.spacing) == null ? void 0 : l.xxl) || "48px"), t(e, "--ui-default-gap", ((d = a.spacing) == null ? void 0 : d.sm) || ((f = a.spaceScale) == null ? void 0 : f["2"]) || "8px"), t(e, "--ui-shadow-sm", ((u = a.shadows) == null ? void 0 : u.sm) || ((m = a.shadows) == null ? void 0 : m["2"]) || "none"), t(e, "--ui-shadow-md", ((h = a.shadows) == null ? void 0 : h.md) || ((y = a.shadows) == null ? void 0 : y["3"]) || "none"), t(e, "--ui-shadow-lg", ((w = a.shadows) == null ? void 0 : w.lg) || ((v = a.shadows) == null ? void 0 : v["4"]) || "none"), t(e, "--ui-font-family", ((k = a.typography) == null ? void 0 : k.family) || "system-ui, sans-serif"), t(e, "--ui-font-family-heading", ((_ = a.typography) == null ? void 0 : _.headingFamily) || ((S = a.typography) == null ? void 0 : S.family) || "system-ui, sans-serif"), t(e, "--ui-font-family-code", ((C = a.typography) == null ? void 0 : C.codeFamily) || "monospace"), t(e, "--ui-font-size-sm", ((E = (z = a.typography) == null ? void 0 : z.size) == null ? void 0 : E.sm) || "12px"), t(e, "--ui-font-size-md", ((D = (A = a.typography) == null ? void 0 : A.size) == null ? void 0 : D.md) || "14px"), t(e, "--ui-font-size-lg", ((I = (T = a.typography) == null ? void 0 : T.size) == null ? void 0 : I.lg) || "16px"), t(e, "--ui-default-font-size", ((M = (L = a.typography) == null ? void 0 : L.size) == null ? void 0 : M.md) || ((R = (P = a.typography) == null ? void 0 : P.fontScale) == null ? void 0 : R["2"]) || "14px"), t(e, "--ui-default-line-height", ((F = (H = a.typography) == null ? void 0 : H.lineHeight) == null ? void 0 : F["2"]) || "20px"), t(e, "--ui-default-letter-spacing", ((B = (O = a.typography) == null ? void 0 : O.letterSpacing) == null ? void 0 : B["2"]) || "0em"), t(e, "--ui-motion-short", (($ = a.motion) == null ? void 0 : $.durationShort) || "120ms"), t(e, "--ui-motion-base", ((V = a.motion) == null ? void 0 : V.durationBase) || "180ms"), t(e, "--ui-motion-long", ((j = a.motion) == null ? void 0 : j.durationLong) || "260ms"), t(e, "--ui-motion-easing", ((Z = a.motion) == null ? void 0 : Z.easing) || "cubic-bezier(0.2, 0.8, 0.2, 1)"), t(e, "--ui-z-modal", String(((U = a.zIndex) == null ? void 0 : U.modal) ?? 1e3)), t(e, "--ui-z-overlay", String(((Q = a.zIndex) == null ? void 0 : Q.overlay) ?? 900)), t(e, "--ui-z-toast", String(((W = a.zIndex) == null ? void 0 : W.toast) ?? 1100)), t(e, "--ui-breakpoint-sm", ((N = a.breakpoints) == null ? void 0 : N.sm) || "640px"), t(e, "--ui-breakpoint-md", ((G = a.breakpoints) == null ? void 0 : G.md) || "768px"), t(e, "--ui-breakpoint-lg", ((K = a.breakpoints) == null ? void 0 : K.lg) || "1024px"), t(e, "--color-background", ((J = a.surfaces) == null ? void 0 : J.background) || a.colors.background || "#ffffff"), t(e, "--color-surface", ((X = a.surfaces) == null ? void 0 : X.surface) || a.colors.surface || "#fcfcfc"), t(e, "--color-panel", ((Y = a.surfaces) == null ? void 0 : Y.panel) || ((q = a.surfaces) == null ? void 0 : q.panelTranslucent) || "#ffffffcc"), t(e, "--color-panel-solid", ((aa = a.surfaces) == null ? void 0 : aa.panelSolid) || a.colors.surface || "#ffffff"), t(e, "--color-panel-translucent", ((ea = a.surfaces) == null ? void 0 : ea.panelTranslucent) || "#ffffffcc"), t(e, "--color-overlay", ((ia = a.surfaces) == null ? void 0 : ia.overlay) || "rgba(2, 6, 23, 0.52)"), t(e, "--color-transparent", ((na = a.surfaces) == null ? void 0 : na.transparent) || "transparent"), t(e, "--backdrop-filter-panel", ((oa = a.effects) == null ? void 0 : oa.backdropFilterPanel) || "blur(64px)"), (ta = a.palette) != null && ta.accentContrast && t(e, "--accent-contrast", a.palette.accentContrast), (ra = a.palette) != null && ra.accentSurface && t(e, "--accent-surface", a.palette.accentSurface), (sa = a.palette) != null && sa.accentIndicator && t(e, "--accent-indicator", a.palette.accentIndicator), (pa = a.palette) != null && pa.accentTrack && t(e, "--accent-track", a.palette.accentTrack), s(e, "--gray-", (ca = a.palette) == null ? void 0 : ca.gray), s(e, "--gray-a", (la = a.palette) == null ? void 0 : la.grayAlpha), s(e, "--black-a", (da = a.palette) == null ? void 0 : da.blackAlpha), s(e, "--white-a", (fa = a.palette) == null ? void 0 : fa.whiteAlpha), s(e, "--accent-", (ua = a.palette) == null ? void 0 : ua.accent), s(e, "--accent-a", (ga = a.palette) == null ? void 0 : ga.accentAlpha), s(e, "--space-", a.spaceScale), s(e, "--radius-", a.radiusScale), s(e, "--font-size-", (ma = a.typography) == null ? void 0 : ma.fontScale), s(e, "--line-height-", (ha = a.typography) == null ? void 0 : ha.lineHeight), s(e, "--letter-spacing-", (xa = a.typography) == null ? void 0 : xa.letterSpacing), s(e, "--shadow-", a.shadows), s(e, "--base-button-", (ba = a.components) == null ? void 0 : ba.button), s(e, "--base-badge-", (ya = a.components) == null ? void 0 : ya.badge), s(e, "--base-dropdown-", (wa = a.components) == null ? void 0 : wa.dropdown), s(e, "--base-select-", (va = a.components) == null ? void 0 : va.select), s(e, "--base-sidebar-", (Ca = a.components) == null ? void 0 : Ca.sidebar), s(e, "--base-block-controls-", (za = a.components) == null ? void 0 : za.blockControls), s(e, "--base-box-", (Ea = a.components) == null ? void 0 : Ea.box), s(e, "--base-breadcrumb-", (Aa = a.components) == null ? void 0 : Aa.breadcrumb), s(e, "--base-card-", (Da = a.components) == null ? void 0 : Da.card), s(e, "--base-multi-select-", (Ta = a.components) == null ? void 0 : Ta.multiSelect), s(e, "--base-navigation-menu-", (Ia = a.components) == null ? void 0 : Ia.navigationMenu), s(e, "--base-menubar-", (La = a.components) == null ? void 0 : La.menubar), s(e, "--base-context-menu-", (Ma = a.components) == null ? void 0 : Ma.contextMenu), s(e, "--base-alert-", (Pa = a.components) == null ? void 0 : Pa.alert), s(e, "--base-alert-dialog-", (Ra = a.components) == null ? void 0 : Ra.alertDialog), s(e, "--base-app-header-", (Ha = a.components) == null ? void 0 : Ha.appHeader), s(e, "--base-aspect-ratio-", (Fa = a.components) == null ? void 0 : Fa.aspectRatio), s(e, "--base-avatar-", (Oa = a.components) == null ? void 0 : Oa.avatar), s(e, "--base-menu-", (Ba = a.components) == null ? void 0 : Ba.menu), s(e, "--base-panel-", ($a = a.components) == null ? void 0 : $a.panel), s(e, "--base-input-", (Va = a.components) == null ? void 0 : Va.input);
|
|
1921
1922
|
}
|
|
1922
|
-
function
|
|
1923
|
+
function Se(e, a = typeof document < "u" ? document : null) {
|
|
1923
1924
|
if (!a)
|
|
1924
1925
|
return;
|
|
1925
1926
|
const n = Ya(e), i = a === document || a instanceof ShadowRoot;
|
|
@@ -1934,21 +1935,21 @@ function _e(e, a = typeof document < "u" ? document : null) {
|
|
|
1934
1935
|
export {
|
|
1935
1936
|
ne as A,
|
|
1936
1937
|
se as D,
|
|
1937
|
-
|
|
1938
|
-
|
|
1938
|
+
ge as a,
|
|
1939
|
+
me as b,
|
|
1939
1940
|
oe as c,
|
|
1940
|
-
|
|
1941
|
+
xe as d,
|
|
1941
1942
|
pe as e,
|
|
1942
|
-
|
|
1943
|
-
|
|
1943
|
+
ye as f,
|
|
1944
|
+
we as g,
|
|
1944
1945
|
g as h,
|
|
1945
1946
|
_a as i,
|
|
1946
1947
|
de as j,
|
|
1947
|
-
|
|
1948
|
+
ve as k,
|
|
1948
1949
|
Ya as l,
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1950
|
+
Se as m,
|
|
1951
|
+
he as p,
|
|
1952
|
+
_e as r,
|
|
1953
|
+
be as s,
|
|
1954
|
+
ke as w
|
|
1954
1955
|
};
|