@editora/ui-core 0.1.20 → 0.1.22
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/dist/accordion.cjs.js +3 -3
- package/dist/accordion.esm.js +3 -3
- package/dist/alert-dialog.cjs.js +32 -32
- package/dist/alert-dialog.esm.js +95 -75
- package/dist/alert.cjs.js +6 -6
- package/dist/alert.esm.js +6 -6
- package/dist/animated-list.cjs.js +4 -4
- package/dist/animated-list.esm.js +4 -4
- package/dist/animated-text.cjs.js +4 -4
- package/dist/animated-text.esm.js +4 -4
- package/dist/app-header.cjs.js +3 -3
- package/dist/app-header.esm.js +3 -3
- package/dist/aspect-ratio.cjs.js +3 -3
- package/dist/aspect-ratio.esm.js +3 -3
- package/dist/avatar.cjs.js +14 -14
- package/dist/avatar.esm.js +31 -29
- package/dist/badge.cjs.js +4 -4
- package/dist/badge.esm.js +4 -4
- package/dist/block-controls.cjs.js +4 -4
- package/dist/block-controls.esm.js +4 -4
- package/dist/box.cjs.js +2 -2
- package/dist/box.esm.js +2 -2
- package/dist/breadcrumb.cjs.js +5 -5
- package/dist/breadcrumb.esm.js +5 -5
- package/dist/button.cjs.js +1 -1
- package/dist/button.esm.js +1 -1
- package/dist/{calendar-DLY4acgn.mjs → calendar-DbxYRdlv.mjs} +227 -183
- package/dist/{calendar-Dkof-FTK.js → calendar-Qa-cFOp3.js} +74 -35
- package/dist/calendar.cjs.js +1 -1
- package/dist/calendar.esm.js +1 -1
- package/dist/card.cjs.js +8 -8
- package/dist/card.esm.js +63 -20
- package/dist/chart.cjs.js +4 -4
- package/dist/chart.esm.js +6 -6
- package/dist/checkbox.cjs.js +2 -2
- package/dist/checkbox.esm.js +2 -2
- package/dist/collapsible.cjs.js +7 -7
- package/dist/collapsible.esm.js +7 -7
- package/dist/collection.cjs.js +1 -1
- package/dist/collection.esm.js +27 -23
- package/dist/color-picker.cjs.js +34 -14
- package/dist/color-picker.esm.js +89 -67
- package/dist/combobox.cjs.js +29 -27
- package/dist/combobox.esm.js +51 -45
- package/dist/command.cjs.js +2 -2
- package/dist/command.esm.js +2 -2
- package/dist/components/ui-alert-dialog.d.ts +1 -0
- package/dist/components/ui-alert-dialog.d.ts.map +1 -1
- package/dist/components/ui-avatar.d.ts +1 -0
- package/dist/components/ui-avatar.d.ts.map +1 -1
- package/dist/components/ui-button.d.ts +1 -0
- package/dist/components/ui-button.d.ts.map +1 -1
- package/dist/components/ui-calendar.d.ts.map +1 -1
- package/dist/components/ui-card.d.ts +3 -0
- package/dist/components/ui-card.d.ts.map +1 -1
- package/dist/components/ui-checkbox.d.ts.map +1 -1
- package/dist/components/ui-collection.d.ts.map +1 -1
- package/dist/components/ui-color-picker.d.ts.map +1 -1
- package/dist/components/ui-combobox.d.ts.map +1 -1
- package/dist/components/ui-data-table.d.ts.map +1 -1
- package/dist/components/ui-date-field.d.ts.map +1 -1
- package/dist/components/ui-date-picker.d.ts.map +1 -1
- package/dist/components/ui-date-range-picker.d.ts.map +1 -1
- package/dist/components/ui-date-range-time-picker.d.ts.map +1 -1
- package/dist/components/ui-date-time-picker.d.ts.map +1 -1
- package/dist/components/ui-dock.d.ts +1 -0
- package/dist/components/ui-dock.d.ts.map +1 -1
- package/dist/components/ui-drawer.d.ts.map +1 -1
- package/dist/components/ui-dropdown.d.ts.map +1 -1
- package/dist/components/ui-field.d.ts.map +1 -1
- package/dist/components/ui-file-upload.d.ts.map +1 -1
- package/dist/components/ui-gantt.d.ts.map +1 -1
- package/dist/components/ui-input.d.ts.map +1 -1
- package/dist/components/ui-menu.d.ts.map +1 -1
- package/dist/components/ui-multi-select.d.ts.map +1 -1
- package/dist/components/ui-number-field.d.ts.map +1 -1
- package/dist/components/ui-password-field.d.ts.map +1 -1
- package/dist/components/ui-pin-input.d.ts +1 -0
- package/dist/components/ui-pin-input.d.ts.map +1 -1
- package/dist/components/ui-placement-grid.d.ts.map +1 -1
- package/dist/components/ui-portal.d.ts.map +1 -1
- package/dist/components/ui-positioner.d.ts.map +1 -1
- package/dist/components/ui-progress.d.ts.map +1 -1
- package/dist/components/ui-radio.d.ts.map +1 -1
- package/dist/components/ui-rating.d.ts +1 -0
- package/dist/components/ui-rating.d.ts.map +1 -1
- package/dist/components/ui-select.d.ts.map +1 -1
- package/dist/components/ui-sortable.d.ts +8 -0
- package/dist/components/ui-sortable.d.ts.map +1 -1
- package/dist/components/ui-switch.d.ts.map +1 -1
- package/dist/components/ui-table.d.ts.map +1 -1
- package/dist/components/ui-tabs.d.ts +1 -0
- package/dist/components/ui-tabs.d.ts.map +1 -1
- package/dist/components/ui-tags-input.d.ts +1 -0
- package/dist/components/ui-tags-input.d.ts.map +1 -1
- package/dist/components/ui-textarea.d.ts.map +1 -1
- package/dist/components/ui-time-field.d.ts.map +1 -1
- package/dist/components/ui-toggle-group.d.ts.map +1 -1
- package/dist/components/ui-toggle.d.ts.map +1 -1
- package/dist/components/ui-tree.d.ts.map +1 -1
- package/dist/components/ui-wizard.d.ts.map +1 -1
- package/dist/context-menu.cjs.js +3 -3
- package/dist/context-menu.esm.js +4 -4
- package/dist/control-name-BmoI1m3a.js +1 -0
- package/dist/control-name-Bpj7F34X.mjs +48 -0
- package/dist/data-table.cjs.js +5 -2
- package/dist/data-table.esm.js +145 -142
- package/dist/date-field.cjs.js +5 -5
- package/dist/date-field.esm.js +34 -31
- package/dist/date-picker.cjs.js +16 -16
- package/dist/date-picker.esm.js +48 -44
- package/dist/date-range-picker.cjs.js +5 -5
- package/dist/date-range-picker.esm.js +120 -118
- package/dist/date-range-time-picker.cjs.js +22 -22
- package/dist/date-range-time-picker.esm.js +88 -84
- package/dist/date-time-picker.cjs.js +26 -26
- package/dist/date-time-picker.esm.js +105 -101
- package/dist/{date-time-utils-Dmost5Ee.js → date-time-utils-BzfTpeU-.js} +1 -1
- package/dist/{date-time-utils-y1N2gvG2.mjs → date-time-utils-Cps2aSu2.mjs} +1 -1
- package/dist/description.cjs.js +3 -3
- package/dist/description.esm.js +3 -3
- package/dist/dialog.cjs.js +2 -2
- package/dist/dialog.esm.js +2 -2
- package/dist/dock.cjs.js +12 -12
- package/dist/dock.esm.js +72 -74
- package/dist/drawer.cjs.js +19 -19
- package/dist/drawer.esm.js +58 -58
- package/dist/dropdown.cjs.js +13 -13
- package/dist/dropdown.esm.js +49 -48
- package/dist/empty-state.cjs.js +3 -3
- package/dist/empty-state.esm.js +3 -3
- package/dist/field-error.cjs.js +1 -1
- package/dist/field-error.esm.js +1 -1
- package/dist/field.cjs.js +12 -12
- package/dist/field.esm.js +84 -75
- package/dist/fieldset.cjs.js +4 -4
- package/dist/fieldset.esm.js +4 -4
- package/dist/file-upload.cjs.js +3 -3
- package/dist/file-upload.esm.js +5 -3
- package/dist/floating-toolbar.cjs.js +8 -8
- package/dist/floating-toolbar.esm.js +9 -9
- package/dist/form.cjs.js +11 -11
- package/dist/form.esm.js +11 -11
- package/dist/gantt.cjs.js +43 -32
- package/dist/gantt.esm.js +99 -88
- package/dist/icon-cloud.cjs.js +3 -3
- package/dist/icon-cloud.esm.js +3 -3
- package/dist/icon.cjs.js +1 -1
- package/dist/icon.esm.js +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +121 -118
- package/dist/inline-edit.cjs.js +1 -1
- package/dist/inline-edit.esm.js +1 -1
- package/dist/input.cjs.js +14 -14
- package/dist/input.esm.js +39 -32
- package/dist/label.cjs.js +3 -3
- package/dist/label.esm.js +3 -3
- package/dist/{listbox-B6QgECax.js → listbox-CTpRpuF7.js} +1 -1
- package/dist/{listbox-DJamVeFj.mjs → listbox-hMVOhKHC.mjs} +1 -1
- package/dist/listbox.cjs.js +1 -1
- package/dist/listbox.esm.js +1 -1
- package/dist/marquee.cjs.js +3 -3
- package/dist/marquee.esm.js +3 -3
- package/dist/{menu-item-styles-CbNUEwP2.js → menu-item-styles-B4onAr4C.js} +3 -3
- package/dist/{menu-item-styles-CZiPwPwl.mjs → menu-item-styles-IGSFLAHu.mjs} +3 -3
- package/dist/menu.cjs.js +7 -7
- package/dist/menu.esm.js +29 -28
- package/dist/menubar.cjs.js +1 -1
- package/dist/menubar.esm.js +2 -2
- package/dist/meter.cjs.js +1 -1
- package/dist/meter.esm.js +1 -1
- package/dist/multi-select.cjs.js +18 -18
- package/dist/multi-select.esm.js +82 -66
- package/dist/navigation-menu.cjs.js +1 -1
- package/dist/navigation-menu.esm.js +1 -1
- package/dist/number-field.cjs.js +11 -13
- package/dist/number-field.esm.js +29 -27
- package/dist/number-ticker.cjs.js +4 -4
- package/dist/number-ticker.esm.js +4 -4
- package/dist/odometer.cjs.js +2 -2
- package/dist/odometer.esm.js +2 -2
- package/dist/orbiter.cjs.js +3 -3
- package/dist/orbiter.esm.js +3 -3
- package/dist/pagination.cjs.js +1 -1
- package/dist/pagination.esm.js +1 -1
- package/dist/password-field.cjs.js +23 -23
- package/dist/password-field.esm.js +48 -47
- package/dist/pin-input.cjs.js +8 -6
- package/dist/pin-input.esm.js +21 -15
- package/dist/placement-grid.cjs.js +4 -4
- package/dist/placement-grid.esm.js +58 -58
- package/dist/plugin-panel.cjs.js +1 -1
- package/dist/plugin-panel.esm.js +1 -1
- package/dist/popover.cjs.js +5 -5
- package/dist/popover.esm.js +4 -4
- package/dist/portal.cjs.js +3 -3
- package/dist/portal.esm.js +11 -10
- package/dist/positioner.cjs.js +2 -2
- package/dist/positioner.esm.js +15 -14
- package/dist/primitives/auto-scroll.d.ts +9 -0
- package/dist/primitives/auto-scroll.d.ts.map +1 -0
- package/dist/primitives/control-name.d.ts +30 -0
- package/dist/primitives/control-name.d.ts.map +1 -0
- package/dist/primitives/selector.d.ts +4 -0
- package/dist/primitives/selector.d.ts.map +1 -0
- package/dist/primitives/trigger.d.ts +2 -0
- package/dist/primitives/trigger.d.ts.map +1 -0
- package/dist/progress.cjs.js +4 -4
- package/dist/progress.esm.js +20 -18
- package/dist/quick-actions.cjs.js +3 -3
- package/dist/quick-actions.esm.js +3 -3
- package/dist/radio-group.cjs.js +1 -1
- package/dist/radio-group.esm.js +1 -1
- package/dist/radio.cjs.js +2 -2
- package/dist/radio.esm.js +2 -2
- package/dist/rating.cjs.js +17 -16
- package/dist/rating.esm.js +91 -92
- package/dist/{runtime-D1gFh1fS.mjs → runtime-CFnK53iC.mjs} +133 -94
- package/dist/runtime-DwE-tizc.js +1 -0
- package/dist/runtime.cjs.js +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.esm.js +29 -26
- package/dist/select.cjs.js +20 -19
- package/dist/select.esm.js +36 -32
- package/dist/selection-popup.cjs.js +2 -2
- package/dist/selection-popup.esm.js +2 -2
- package/dist/selector-BvAh35ve.js +1 -0
- package/dist/selector-WI8pD7YO.mjs +18 -0
- package/dist/separator.cjs.js +7 -7
- package/dist/separator.esm.js +7 -7
- package/dist/sidebar.cjs.js +7 -7
- package/dist/sidebar.esm.js +7 -7
- package/dist/skeleton.cjs.js +7 -7
- package/dist/skeleton.esm.js +7 -7
- package/dist/slider.cjs.js +3 -3
- package/dist/slider.esm.js +3 -3
- package/dist/slot.cjs.js +3 -3
- package/dist/slot.esm.js +3 -3
- package/dist/sortable.cjs.js +61 -48
- package/dist/sortable.esm.js +636 -554
- package/dist/spinning-text.cjs.js +3 -3
- package/dist/spinning-text.esm.js +3 -3
- package/dist/split-button.cjs.js +1 -1
- package/dist/split-button.esm.js +1 -1
- package/dist/stepper.cjs.js +1 -1
- package/dist/stepper.esm.js +1 -1
- package/dist/switch.cjs.js +10 -12
- package/dist/switch.esm.js +10 -12
- package/dist/table.cjs.js +9 -6
- package/dist/table.esm.js +46 -43
- package/dist/tabs.cjs.js +22 -23
- package/dist/tabs.esm.js +116 -112
- package/dist/tags-input.cjs.js +9 -9
- package/dist/tags-input.esm.js +32 -25
- package/dist/textarea.cjs.js +13 -13
- package/dist/textarea.esm.js +46 -31
- package/dist/theme.d.ts +18 -0
- package/dist/theme.d.ts.map +1 -1
- package/dist/time-field.cjs.js +5 -5
- package/dist/time-field.esm.js +21 -18
- package/dist/time-picker.cjs.js +4 -4
- package/dist/time-picker.esm.js +5 -5
- package/dist/timeline.cjs.js +2 -2
- package/dist/timeline.esm.js +4 -4
- package/dist/toast.cjs.js +6 -6
- package/dist/toast.esm.js +13 -13
- package/dist/toggle-group.cjs.js +5 -6
- package/dist/toggle-group.esm.js +63 -60
- package/dist/toggle.cjs.js +18 -18
- package/dist/toggle.esm.js +32 -31
- package/dist/tooltip.cjs.js +4 -4
- package/dist/tooltip.esm.js +4 -4
- package/dist/transfer-list.cjs.js +32 -32
- package/dist/transfer-list.esm.js +57 -57
- package/dist/tree-7qbVnpGp.js +39 -0
- package/dist/{tree-B3kE8ESs.mjs → tree-Deoft-kO.mjs} +34 -33
- package/dist/tree.cjs.js +1 -1
- package/dist/tree.esm.js +1 -1
- package/dist/trigger-BjnxLCeQ.mjs +9 -0
- package/dist/trigger-DkPsKxsP.js +1 -0
- package/dist/{ui-button-rXQOS9QJ.js → ui-button-BInsgSbr.js} +27 -26
- package/dist/{ui-button-Q0GNNWKC.mjs → ui-button-rfiuUnUD.mjs} +65 -48
- package/dist/{ui-icon-YI6lyuqU.mjs → ui-icon-BSi_GtqO.mjs} +2 -2
- package/dist/{ui-icon-BzVNC_lr.js → ui-icon-Bvt9oIIR.js} +5 -5
- package/dist/wizard.cjs.js +12 -13
- package/dist/wizard.esm.js +17 -15
- package/package.json +1 -1
- package/dist/runtime-CTaOSmBj.js +0 -1
- package/dist/tree-Dx_kv_ih.js +0 -39
package/dist/dropdown.esm.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { E as _ } from "./ElementBase-YlTLMsGk.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { r as x } from "./trigger-BjnxLCeQ.mjs";
|
|
3
|
+
import { c as y } from "./menu-item-styles-IGSFLAHu.mjs";
|
|
3
4
|
const l = [
|
|
4
5
|
'[role="menuitem"]',
|
|
5
6
|
'[role="menuitemcheckbox"]',
|
|
6
7
|
'[role="menuitemradio"]',
|
|
7
8
|
".item",
|
|
8
9
|
"[data-menu-item]"
|
|
9
|
-
].join(", "),
|
|
10
|
+
].join(", "), k = `
|
|
10
11
|
:host {
|
|
11
12
|
--ui-dropdown-bg: var(
|
|
12
13
|
--ui-dropdown-menu-bg,
|
|
@@ -251,7 +252,7 @@ const l = [
|
|
|
251
252
|
}
|
|
252
253
|
|
|
253
254
|
.menu[data-tone='neutral'] {
|
|
254
|
-
--ui-dropdown-ring: color-mix(in srgb, var(--ui-color-muted, #
|
|
255
|
+
--ui-dropdown-ring: color-mix(in srgb, var(--ui-color-muted, #526175) 60%, var(--ui-dropdown-color));
|
|
255
256
|
}
|
|
256
257
|
|
|
257
258
|
.menu[data-tone='danger'] {
|
|
@@ -262,20 +263,20 @@ const l = [
|
|
|
262
263
|
}
|
|
263
264
|
|
|
264
265
|
.menu[data-tone='success'] {
|
|
265
|
-
--ui-dropdown-ring: var(--ui-color-success, #
|
|
266
|
-
--ui-dropdown-item-hover-bg: color-mix(in srgb, var(--ui-color-success, #
|
|
267
|
-
--ui-dropdown-item-active-bg: color-mix(in srgb, var(--ui-color-success, #
|
|
268
|
-
--ui-dropdown-item-checked-bg: color-mix(in srgb, var(--ui-color-success, #
|
|
266
|
+
--ui-dropdown-ring: var(--ui-color-success, #15803d);
|
|
267
|
+
--ui-dropdown-item-hover-bg: color-mix(in srgb, var(--ui-color-success, #15803d) 12%, transparent);
|
|
268
|
+
--ui-dropdown-item-active-bg: color-mix(in srgb, var(--ui-color-success, #15803d) 18%, transparent);
|
|
269
|
+
--ui-dropdown-item-checked-bg: color-mix(in srgb, var(--ui-color-success, #15803d) 16%, transparent);
|
|
269
270
|
}
|
|
270
271
|
|
|
271
272
|
.menu[data-tone='warning'] {
|
|
272
|
-
--ui-dropdown-ring: var(--ui-color-warning, #
|
|
273
|
-
--ui-dropdown-item-hover-bg: color-mix(in srgb, var(--ui-color-warning, #
|
|
274
|
-
--ui-dropdown-item-active-bg: color-mix(in srgb, var(--ui-color-warning, #
|
|
275
|
-
--ui-dropdown-item-checked-bg: color-mix(in srgb, var(--ui-color-warning, #
|
|
273
|
+
--ui-dropdown-ring: var(--ui-color-warning, #b45309);
|
|
274
|
+
--ui-dropdown-item-hover-bg: color-mix(in srgb, var(--ui-color-warning, #b45309) 15%, transparent);
|
|
275
|
+
--ui-dropdown-item-active-bg: color-mix(in srgb, var(--ui-color-warning, #b45309) 20%, transparent);
|
|
276
|
+
--ui-dropdown-item-checked-bg: color-mix(in srgb, var(--ui-color-warning, #b45309) 17%, transparent);
|
|
276
277
|
}
|
|
277
278
|
|
|
278
|
-
${
|
|
279
|
+
${y({
|
|
279
280
|
scopes: [".menu"],
|
|
280
281
|
prefix: "--ui-dropdown",
|
|
281
282
|
shortcutSelectors: [".shortcut", ".meta"],
|
|
@@ -508,18 +509,18 @@ const l = [
|
|
|
508
509
|
}
|
|
509
510
|
}
|
|
510
511
|
`;
|
|
511
|
-
function
|
|
512
|
+
function A(i) {
|
|
512
513
|
return i === "top" || i === "left" || i === "right" ? i : "bottom";
|
|
513
514
|
}
|
|
514
|
-
function
|
|
515
|
+
function S(i) {
|
|
515
516
|
const e = (i || "").trim().toLowerCase();
|
|
516
517
|
return e === "sm" || e === "1" || e === "compact" ? "sm" : e === "lg" || e === "3" || e === "comfortable" ? "lg" : "md";
|
|
517
518
|
}
|
|
518
|
-
function
|
|
519
|
+
function C(i) {
|
|
519
520
|
const e = (i || "").trim().toLowerCase();
|
|
520
521
|
return !e || e === "default" ? null : e === "none" ? "0px" : e === "sm" ? "8px" : e === "md" ? "12px" : e === "lg" || e === "large" ? "16px" : e === "full" || e === "pill" ? "999px" : e === "square" ? "6px" : e === "soft" || e === "rounded" ? "14px" : /^\d+(\.\d+)?$/.test(e) ? `${e}px` : /^\d+(\.\d+)?(px|rem|em|%)$/.test(e) ? e : i;
|
|
521
522
|
}
|
|
522
|
-
function
|
|
523
|
+
function p(i, e) {
|
|
523
524
|
return i.getAttribute(e) || "";
|
|
524
525
|
}
|
|
525
526
|
function f(i, e) {
|
|
@@ -527,13 +528,13 @@ function f(i, e) {
|
|
|
527
528
|
const t = i.trim().toLowerCase();
|
|
528
529
|
return t !== "false" && t !== "0" && t !== "off";
|
|
529
530
|
}
|
|
530
|
-
function
|
|
531
|
+
function h() {
|
|
531
532
|
return typeof window < "u" && typeof document < "u";
|
|
532
533
|
}
|
|
533
534
|
function b(i) {
|
|
534
535
|
return i.hasAttribute("disabled") || i.getAttribute("aria-disabled") === "true" || i.disabled === !0;
|
|
535
536
|
}
|
|
536
|
-
function
|
|
537
|
+
function E(i) {
|
|
537
538
|
return (i.getAttribute("aria-label") || i.textContent || "").trim();
|
|
538
539
|
}
|
|
539
540
|
function g(i) {
|
|
@@ -544,7 +545,7 @@ function g(i) {
|
|
|
544
545
|
i.focus();
|
|
545
546
|
}
|
|
546
547
|
}
|
|
547
|
-
function
|
|
548
|
+
function I(i, e) {
|
|
548
549
|
const t = i.offsetTop, r = t + i.offsetHeight, o = e.scrollTop, a = o + e.clientHeight;
|
|
549
550
|
if (t < o) {
|
|
550
551
|
e.scrollTop = t;
|
|
@@ -552,7 +553,7 @@ function E(i, e) {
|
|
|
552
553
|
}
|
|
553
554
|
r > a && (e.scrollTop = Math.max(0, r - e.clientHeight));
|
|
554
555
|
}
|
|
555
|
-
function
|
|
556
|
+
function T(i) {
|
|
556
557
|
return w(i);
|
|
557
558
|
}
|
|
558
559
|
function w(i) {
|
|
@@ -567,23 +568,23 @@ function w(i) {
|
|
|
567
568
|
t.appendChild(w(r));
|
|
568
569
|
}), t;
|
|
569
570
|
}
|
|
570
|
-
function
|
|
571
|
+
function M(i, e, t) {
|
|
571
572
|
for (let r = e + t; r >= 0 && r < i.length; r += t)
|
|
572
573
|
if (!b(i[r])) return r;
|
|
573
574
|
return -1;
|
|
574
575
|
}
|
|
575
|
-
function
|
|
576
|
+
function O(i, e, t) {
|
|
576
577
|
if (!e) return null;
|
|
577
578
|
const r = i.filter((a) => !b(a));
|
|
578
579
|
if (!r.length) return null;
|
|
579
580
|
const o = t ? r.indexOf(t) : -1;
|
|
580
581
|
for (let a = 1; a <= r.length; a += 1) {
|
|
581
582
|
const n = r[(o + a + r.length) % r.length];
|
|
582
|
-
if (
|
|
583
|
+
if (E(n).toLowerCase().startsWith(e)) return n;
|
|
583
584
|
}
|
|
584
585
|
return null;
|
|
585
586
|
}
|
|
586
|
-
const
|
|
587
|
+
const P = /* @__PURE__ */ new Set(["variant", "density", "shape", "elevation", "tone", "size", "radius"]), F = /* @__PURE__ */ new Set(["aria-label", "aria-labelledby", "aria-describedby"]), D = [
|
|
587
588
|
"--ui-dropdown-bg",
|
|
588
589
|
"--ui-dropdown-color",
|
|
589
590
|
"--ui-dropdown-muted",
|
|
@@ -605,7 +606,7 @@ const O = /* @__PURE__ */ new Set(["variant", "density", "shape", "elevation", "
|
|
|
605
606
|
"--ui-dropdown-duration",
|
|
606
607
|
"--ui-dropdown-easing"
|
|
607
608
|
];
|
|
608
|
-
class
|
|
609
|
+
class L extends _ {
|
|
609
610
|
constructor() {
|
|
610
611
|
super(), this._isOpen = !1, this._panelEl = null, this._portalEl = null, this._restoreFocusEl = null, this._typeaheadBuffer = "", this._typeaheadTimer = null, this._placement = "bottom", this._openListenersBound = !1, this._openFrame = 0, this._checkboxState = /* @__PURE__ */ new Map(), this._radioState = /* @__PURE__ */ new Map(), this._menuId = `ui-dropdown-menu-${Math.random().toString(36).slice(2, 10)}`, this._triggerId = `ui-dropdown-trigger-${Math.random().toString(36).slice(2, 10)}`, this._onHostClick = this._onHostClick.bind(this), this._onHostKeyDown = this._onHostKeyDown.bind(this), this._onDocumentPointerDown = this._onDocumentPointerDown.bind(this), this._onSlotChange = this._onSlotChange.bind(this);
|
|
611
612
|
}
|
|
@@ -646,11 +647,11 @@ class D extends _ {
|
|
|
646
647
|
this.hasAttribute("disabled") && this._isOpen && this.close("disabled"), this._syncTriggerA11y();
|
|
647
648
|
return;
|
|
648
649
|
}
|
|
649
|
-
if (this._isOpen && (e === "placement" ||
|
|
650
|
+
if (this._isOpen && (e === "placement" || P.has(e))) {
|
|
650
651
|
this._syncMenuPresentation(), this._schedulePanelSync();
|
|
651
652
|
return;
|
|
652
653
|
}
|
|
653
|
-
this._isOpen &&
|
|
654
|
+
this._isOpen && F.has(e) && this._syncMenuA11y();
|
|
654
655
|
}
|
|
655
656
|
}
|
|
656
657
|
}
|
|
@@ -705,7 +706,7 @@ class D extends _ {
|
|
|
705
706
|
}
|
|
706
707
|
_isFocusable(e) {
|
|
707
708
|
if (!e || !e.isConnected || e.disabled || e.getAttribute("aria-hidden") === "true") return !1;
|
|
708
|
-
if (!
|
|
709
|
+
if (!h()) return !0;
|
|
709
710
|
const t = window.getComputedStyle(e);
|
|
710
711
|
return t.display !== "none" && t.visibility !== "hidden";
|
|
711
712
|
}
|
|
@@ -781,20 +782,20 @@ class D extends _ {
|
|
|
781
782
|
}
|
|
782
783
|
_syncTriggerA11y() {
|
|
783
784
|
const e = this._getTrigger();
|
|
784
|
-
if (e)
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
e.getAttribute("aria-disabled") === "true" && e.removeAttribute("aria-disabled"), e.getAttribute("tabindex") === "-1" && e.removeAttribute("tabindex");
|
|
785
|
+
if (!e) return;
|
|
786
|
+
const t = x(e);
|
|
787
|
+
if (t.id || (t.id = this._triggerId), t.setAttribute("aria-haspopup", "menu"), t.setAttribute("aria-expanded", this._isOpen ? "true" : "false"), this._isOpen ? t.setAttribute("aria-controls", this._menuId) : t.removeAttribute("aria-controls"), this.hasAttribute("disabled")) {
|
|
788
|
+
t.setAttribute("aria-disabled", "true"), t.setAttribute("tabindex", "-1");
|
|
789
|
+
return;
|
|
790
790
|
}
|
|
791
|
+
t.getAttribute("aria-disabled") === "true" && t.removeAttribute("aria-disabled"), t.getAttribute("tabindex") === "-1" && t.removeAttribute("tabindex");
|
|
791
792
|
}
|
|
792
793
|
_renderMenuContent() {
|
|
793
794
|
const e = this._getMenu();
|
|
794
795
|
if (!e) return;
|
|
795
796
|
e.replaceChildren();
|
|
796
797
|
const t = this._getContentSource();
|
|
797
|
-
if (t && e.appendChild(
|
|
798
|
+
if (t && e.appendChild(T(t)), !e.querySelector(l)) {
|
|
798
799
|
const r = document.createElement("div");
|
|
799
800
|
r.className = "empty-state", r.textContent = "No items", e.appendChild(r);
|
|
800
801
|
}
|
|
@@ -828,12 +829,12 @@ class D extends _ {
|
|
|
828
829
|
_syncMenuPresentation() {
|
|
829
830
|
const e = this._getMenu();
|
|
830
831
|
if (!e) return;
|
|
831
|
-
const t =
|
|
832
|
-
t &&
|
|
832
|
+
const t = h() ? window.getComputedStyle(this) : null;
|
|
833
|
+
t && D.forEach((c) => {
|
|
833
834
|
const m = t.getPropertyValue(c).trim();
|
|
834
835
|
m ? e.style.setProperty(c, m) : e.style.removeProperty(c);
|
|
835
836
|
});
|
|
836
|
-
const r =
|
|
837
|
+
const r = p(this, "variant"), o = S(this.getAttribute("size") || this.getAttribute("density")), a = p(this, "density"), n = p(this, "shape"), u = p(this, "elevation"), s = p(this, "tone"), d = C(this.getAttribute("radius") || n || null);
|
|
837
838
|
if (r && r !== "default" ? e.setAttribute("data-variant", r) : e.removeAttribute("data-variant"), o !== "md" ? e.setAttribute("data-size", o) : e.removeAttribute("data-size"), a && a !== "default" ? e.setAttribute("data-density", a) : e.removeAttribute("data-density"), n && n !== "default" ? e.setAttribute("data-shape", n) : e.removeAttribute("data-shape"), u && u !== "default" ? e.setAttribute("data-elevation", u) : e.removeAttribute("data-elevation"), s && s !== "default" && s !== "brand" ? e.setAttribute("data-tone", s) : e.removeAttribute("data-tone"), d) {
|
|
838
839
|
e.style.setProperty("--ui-dropdown-radius", d), e.style.setProperty("--ui-dropdown-item-radius", d === "999px" ? "999px" : `max(0px, calc(${d} - 2px))`);
|
|
839
840
|
return;
|
|
@@ -861,19 +862,19 @@ class D extends _ {
|
|
|
861
862
|
}
|
|
862
863
|
_availableWidth(e) {
|
|
863
864
|
const t = this._getTrigger();
|
|
864
|
-
if (!t || !
|
|
865
|
+
if (!t || !h()) return 380;
|
|
865
866
|
const r = t.getBoundingClientRect(), o = window.innerWidth || document.documentElement.clientWidth || 0;
|
|
866
867
|
return e === "left" ? r.left - 12 : e === "right" ? o - r.right - 12 : o - r.left - 12;
|
|
867
868
|
}
|
|
868
869
|
_availableHeight(e) {
|
|
869
870
|
const t = this._getTrigger();
|
|
870
|
-
if (!t || !
|
|
871
|
+
if (!t || !h()) return 440;
|
|
871
872
|
const r = t.getBoundingClientRect(), o = window.innerHeight || document.documentElement.clientHeight || 0;
|
|
872
873
|
return e === "top" ? r.top - 12 : o - r.bottom - 12;
|
|
873
874
|
}
|
|
874
875
|
_resolvePlacement() {
|
|
875
|
-
const e =
|
|
876
|
-
if (!t || !r || !
|
|
876
|
+
const e = A(this.getAttribute("placement")), t = this._getTrigger(), r = this._getMenu();
|
|
877
|
+
if (!t || !r || !h()) return e;
|
|
877
878
|
const o = t.getBoundingClientRect(), a = window.innerWidth || document.documentElement.clientWidth || 0, n = window.innerHeight || document.documentElement.clientHeight || 0, u = Math.max(0, n - o.bottom - 12), s = Math.max(0, o.top - 12), d = Math.max(0, a - o.right - 12), c = Math.max(0, o.left - 12), m = Math.min(Math.max(r.scrollHeight, r.offsetHeight) + 4, 320), v = Math.min(Math.max(r.scrollWidth, r.offsetWidth) + 4, 360);
|
|
878
879
|
return e === "top" ? s >= m || s > u ? "top" : "bottom" : e === "left" ? c >= v || c > d ? "left" : "right" : e === "right" ? d >= v || d >= c ? "right" : "left" : u >= m || u >= s ? "bottom" : "top";
|
|
879
880
|
}
|
|
@@ -883,7 +884,7 @@ class D extends _ {
|
|
|
883
884
|
_setActiveItem(e, t = {}) {
|
|
884
885
|
if (this._clearActiveItem(), !!e && (e.setAttribute("data-active", "true"), t.focus && g(e), t.scroll)) {
|
|
885
886
|
const r = this._getMenu();
|
|
886
|
-
r &&
|
|
887
|
+
r && I(e, r);
|
|
887
888
|
}
|
|
888
889
|
}
|
|
889
890
|
_focusFirstItem() {
|
|
@@ -897,7 +898,7 @@ class D extends _ {
|
|
|
897
898
|
_moveFocus(e) {
|
|
898
899
|
const t = this._queryItems(!0);
|
|
899
900
|
if (!t.length) return;
|
|
900
|
-
const r = this._currentFocusedItem() || this._queryItems(!0).find((n) => n.getAttribute("data-active") === "true") || null, o = r ? t.indexOf(r) : e > 0 ? -1 : t.length, a =
|
|
901
|
+
const r = this._currentFocusedItem() || this._queryItems(!0).find((n) => n.getAttribute("data-active") === "true") || null, o = r ? t.indexOf(r) : e > 0 ? -1 : t.length, a = M(t, o, e);
|
|
901
902
|
if (a >= 0) {
|
|
902
903
|
this._setActiveItem(t[a], { focus: !0, scroll: !0 });
|
|
903
904
|
return;
|
|
@@ -914,7 +915,7 @@ class D extends _ {
|
|
|
914
915
|
if (!this.typeahead || !this._isTypeaheadKey(e)) return !1;
|
|
915
916
|
const t = e.key.toLowerCase();
|
|
916
917
|
this._typeaheadBuffer = `${this._typeaheadBuffer}${t}`.slice(0, 24), this._typeaheadTimer != null && window.clearTimeout(this._typeaheadTimer), this._typeaheadTimer = window.setTimeout(() => this._resetTypeahead(), 460);
|
|
917
|
-
const r =
|
|
918
|
+
const r = O(this._queryItems(!0), this._typeaheadBuffer, this._currentFocusedItem());
|
|
918
919
|
return r ? (this._setActiveItem(r, { focus: !0, scroll: !0 }), e.preventDefault(), !0) : !1;
|
|
919
920
|
}
|
|
920
921
|
_querySourceItems() {
|
|
@@ -1023,7 +1024,7 @@ class D extends _ {
|
|
|
1023
1024
|
}
|
|
1024
1025
|
render() {
|
|
1025
1026
|
this.setContent(`
|
|
1026
|
-
<style>${
|
|
1027
|
+
<style>${k}</style>
|
|
1027
1028
|
<div class="root" part="root">
|
|
1028
1029
|
<div class="trigger" part="trigger">
|
|
1029
1030
|
<slot name="trigger"></slot>
|
|
@@ -1048,7 +1049,7 @@ class D extends _ {
|
|
|
1048
1049
|
return !1;
|
|
1049
1050
|
}
|
|
1050
1051
|
}
|
|
1051
|
-
typeof customElements < "u" && !customElements.get("ui-dropdown") && customElements.define("ui-dropdown",
|
|
1052
|
+
typeof customElements < "u" && !customElements.get("ui-dropdown") && customElements.define("ui-dropdown", L);
|
|
1052
1053
|
export {
|
|
1053
|
-
|
|
1054
|
+
L as UIDropdown
|
|
1054
1055
|
};
|
package/dist/empty-state.cjs.js
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
--ui-empty-radius: 16px;
|
|
7
7
|
--ui-empty-padding: 28px;
|
|
8
8
|
--ui-empty-title: var(--ui-color-text, #0f172a);
|
|
9
|
-
--ui-empty-description: var(--ui-color-muted, #
|
|
10
|
-
--ui-empty-icon-bg: color-mix(in srgb, var(--ui-color-muted, #
|
|
9
|
+
--ui-empty-description: var(--ui-color-muted, #526175);
|
|
10
|
+
--ui-empty-icon-bg: color-mix(in srgb, var(--ui-color-muted, #526175) 18%, transparent);
|
|
11
11
|
--ui-empty-icon-color: color-mix(in srgb, var(--ui-color-text, #334155) 82%, transparent);
|
|
12
12
|
--ui-empty-shadow: none;
|
|
13
13
|
--ui-empty-action-bg: color-mix(in srgb, var(--ui-color-primary, #2563eb) 14%, transparent);
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
|
|
101
101
|
:host([tone="success"]) {
|
|
102
102
|
--ui-empty-icon-color: var(--ui-color-success, #166534);
|
|
103
|
-
--ui-empty-icon-bg: color-mix(in srgb, var(--ui-color-success, #
|
|
103
|
+
--ui-empty-icon-bg: color-mix(in srgb, var(--ui-color-success, #15803d) 20%, transparent);
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
:host([tone="warning"]) {
|
package/dist/empty-state.esm.js
CHANGED
|
@@ -7,8 +7,8 @@ const a = `
|
|
|
7
7
|
--ui-empty-radius: 16px;
|
|
8
8
|
--ui-empty-padding: 28px;
|
|
9
9
|
--ui-empty-title: var(--ui-color-text, #0f172a);
|
|
10
|
-
--ui-empty-description: var(--ui-color-muted, #
|
|
11
|
-
--ui-empty-icon-bg: color-mix(in srgb, var(--ui-color-muted, #
|
|
10
|
+
--ui-empty-description: var(--ui-color-muted, #526175);
|
|
11
|
+
--ui-empty-icon-bg: color-mix(in srgb, var(--ui-color-muted, #526175) 18%, transparent);
|
|
12
12
|
--ui-empty-icon-color: color-mix(in srgb, var(--ui-color-text, #334155) 82%, transparent);
|
|
13
13
|
--ui-empty-shadow: none;
|
|
14
14
|
--ui-empty-action-bg: color-mix(in srgb, var(--ui-color-primary, #2563eb) 14%, transparent);
|
|
@@ -101,7 +101,7 @@ const a = `
|
|
|
101
101
|
|
|
102
102
|
:host([tone="success"]) {
|
|
103
103
|
--ui-empty-icon-color: var(--ui-color-success, #166534);
|
|
104
|
-
--ui-empty-icon-bg: color-mix(in srgb, var(--ui-color-success, #
|
|
104
|
+
--ui-empty-icon-bg: color-mix(in srgb, var(--ui-color-success, #15803d) 20%, transparent);
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
:host([tone="warning"]) {
|
package/dist/field-error.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("./ElementBase-EV6mVBUV.js"),u=`
|
|
2
2
|
:host {
|
|
3
|
-
--ui-field-error-color: var(--ui-color-danger, var(--ui-error, #
|
|
3
|
+
--ui-field-error-color: var(--ui-color-danger, var(--ui-error, #c81e1e));
|
|
4
4
|
--ui-field-error-size: 12px;
|
|
5
5
|
--ui-field-error-weight: 600;
|
|
6
6
|
--ui-field-error-line-height: 1.45;
|
package/dist/field-error.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { E as d } from "./ElementBase-YlTLMsGk.mjs";
|
|
2
2
|
const l = `
|
|
3
3
|
:host {
|
|
4
|
-
--ui-field-error-color: var(--ui-color-danger, var(--ui-error, #
|
|
4
|
+
--ui-field-error-color: var(--ui-color-danger, var(--ui-error, #c81e1e));
|
|
5
5
|
--ui-field-error-size: 12px;
|
|
6
6
|
--ui-field-error-weight: 600;
|
|
7
7
|
--ui-field-error-line-height: 1.45;
|
package/dist/field.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const M=require("./ElementBase-EV6mVBUV.js"),N=`
|
|
2
2
|
:host {
|
|
3
3
|
--ui-field-gap: 8px;
|
|
4
4
|
--ui-field-label-width: 192px;
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
--ui-field-bg: var(--ui-color-surface, var(--ui-surface, #ffffff));
|
|
7
7
|
--ui-field-color: var(--ui-color-text, var(--ui-text, #0f172a));
|
|
8
8
|
--ui-field-label-color: var(--ui-color-text, var(--ui-text, #0f172a));
|
|
9
|
-
--ui-field-description-color: var(--ui-color-muted, var(--ui-muted, #
|
|
10
|
-
--ui-field-error-color: var(--ui-color-danger, var(--ui-error, #
|
|
9
|
+
--ui-field-description-color: var(--ui-color-muted, var(--ui-muted, #526175));
|
|
10
|
+
--ui-field-error-color: var(--ui-color-danger, var(--ui-error, #c81e1e));
|
|
11
11
|
--ui-field-border-color: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 72%, transparent);
|
|
12
12
|
--ui-field-border: 1px solid var(--ui-field-border-color);
|
|
13
13
|
--ui-field-shadow:
|
|
@@ -216,7 +216,7 @@
|
|
|
216
216
|
|
|
217
217
|
:host([tone="danger"]) {
|
|
218
218
|
--ui-field-accent: #dc2626;
|
|
219
|
-
--ui-field-error-color: #
|
|
219
|
+
--ui-field-error-color: #c81e1e;
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
:host([density="compact"]) {
|
|
@@ -370,19 +370,19 @@
|
|
|
370
370
|
box-shadow: none;
|
|
371
371
|
}
|
|
372
372
|
}
|
|
373
|
-
`;function
|
|
374
|
-
<style>${
|
|
373
|
+
`;function C(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function A(r){if(!r)return!1;const t=r.assignedNodes({flatten:!0});return t.length?t.some(i=>i.nodeType===Node.TEXT_NODE?!!i.textContent?.trim():i.nodeType===Node.ELEMENT_NODE):!1}function x(r){if(r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true"||r.getAttribute("tabindex")==="-1")return!1;const t=window.getComputedStyle(r);return!(t.display==="none"||t.visibility==="hidden")}function D(r){return!!r.closest('button, a, input, select, textarea, summary, [contenteditable=""], [contenteditable="true"], [role="button"]')}function k(r){return Array.from(new Set(r.filter(Boolean)))}const _="data-ui-field-label",S="data-ui-field-description",I='ui-input, ui-textarea, ui-select, ui-combobox, input, textarea, select, button, [tabindex]:not([tabindex="-1"])';class L extends M.ElementBase{constructor(){super(),this._uid=Math.random().toString(36).slice(2,9),this._controlCache=null,this._stateSyncQueued=!1,this._onRootClick=this._onRootClick.bind(this),this._onSlotChange=this._onSlotChange.bind(this)}static get observedAttributes(){return["label","description","error","for","required","invalid","orientation","headless","variant","tone","density","shape","shell","label-width"]}connectedCallback(){super.connectedCallback(),this.root.addEventListener("click",this._onRootClick),this.root.addEventListener("slotchange",this._onSlotChange),this._scheduleDerivedStateSync()}disconnectedCallback(){this.root.removeEventListener("click",this._onRootClick),this.root.removeEventListener("slotchange",this._onSlotChange),super.disconnectedCallback()}attributeChangedCallback(t,i,l){if(i!==l){if(t==="for"&&this._invalidateControlCache(),t==="label-width"){const o=this.getAttribute("label-width");o?this.style.setProperty("--ui-field-label-width",o):this.style.removeProperty("--ui-field-label-width")}if(t==="label"||t==="description"||t==="error"||t==="required"||t==="for"){this.isConnected&&this.requestRender();return}t==="invalid"&&this._scheduleDerivedStateSync()}}_onSlotChange(){this._invalidateControlCache(),this._scheduleDerivedStateSync()}_onRootClick(t){const i=t.target;i&&i.closest(".label")&&(D(i)||this._focusControl())}_invalidateControlCache(){this._controlCache=null}_scheduleDerivedStateSync(){this._stateSyncQueued||(this._stateSyncQueued=!0,queueMicrotask(()=>{this._stateSyncQueued=!1,this.isConnected&&this._syncDerivedState()}))}_focusControl(){const t=this._resolveControlElement();if(t)try{t.focus({preventScroll:!0})}catch{t.focus()}}_resolveControlElement(){if(this._controlCache&&this._controlCache.isConnected&&x(this._controlCache))return this._controlCache;const t=this.getAttribute("for");if(t){const e=document.getElementById(t);if(e instanceof HTMLElement&&x(e))return this._controlCache=e,e}const l=this.root.querySelector("slot:not([name])")?.assignedElements({flatten:!0})||[];for(const e of l){if(!(e instanceof HTMLElement))continue;if(x(e))return this._controlCache=e,e;const a=e.querySelector(I);if(a&&x(a))return this._controlCache=a,a}const o=this.querySelector(I);return o&&x(o)?(this._controlCache=o,o):null}_syncDerivedState(){const t=this.root.querySelector('slot[name="label"]'),i=this.root.querySelector('slot[name="actions"]'),l=this.root.querySelector('slot[name="description"]'),o=this.root.querySelector('slot[name="error"]'),e=(this.getAttribute("label")||"").trim(),a=(this.getAttribute("description")||"").trim(),y=(this.getAttribute("error")||"").trim(),n=!!e||A(t),d=A(i),h=!!a||A(l),b=!!y||A(o),w=n||d||h,E=n||d,c=this.root.querySelector(".meta"),p=this.root.querySelector(".label-row"),g=this.root.querySelector(".label"),m=this.root.querySelector(".actions"),u=this.root.querySelector(".description"),v=this.root.querySelector(".error");c&&(w?c.removeAttribute("hidden"):c.setAttribute("hidden","")),p&&(E?p.removeAttribute("hidden"):p.setAttribute("hidden","")),g&&(n?g.removeAttribute("hidden"):g.setAttribute("hidden","")),m&&(d?m.removeAttribute("hidden"):m.setAttribute("hidden","")),u&&(h?u.removeAttribute("hidden"):u.setAttribute("hidden","")),v&&(b?v.removeAttribute("hidden"):v.setAttribute("hidden",""));const q=t?t.assignedNodes({flatten:!0}).map(f=>f.textContent||"").join(" "):"",s=f=>f.replace(/\s+/g," ").trim(),T=f=>f?f.assignedNodes({flatten:!0}).map($=>$.textContent||"").join(" "):"",B=h?s(a||T(l)):"",R=b?s(y||T(o)):"";this._syncControlA11y(n,s(e||q),[B,R].filter(Boolean).join(" "),b)}_syncControlA11y(t,i,l,o){const e=this._resolveControlElement();if(!e)return;const a=`${this._uid}-label`,y=`${this._uid}-description`,n=`${this._uid}-error`,d=(e.getAttribute("aria-labelledby")||"").split(/\s+/).filter(s=>s&&s!==a),h=e.getRootNode(),b=d.some(s=>!!h.getElementById?.(s)),w=k(d);w.length?e.setAttribute("aria-labelledby",w.join(" ")):e.removeAttribute("aria-labelledby");const E=e.hasAttribute("aria-label")&&!e.hasAttribute(_),c=e.labels,p=(e.getAttribute("label")||"").trim().length>0,g=(e.textContent||"").trim().length>0,m=b||E||p||g||!!(c&&c.length>0);t&&i&&!m?(e.setAttribute("aria-label",i),e.setAttribute(_,"")):e.hasAttribute(_)&&(e.removeAttribute("aria-label"),e.removeAttribute(_));const u=k((e.getAttribute("aria-describedby")||"").split(/\s+/).filter(s=>s&&s!==y&&s!==n));u.length?e.setAttribute("aria-describedby",u.join(" ")):e.removeAttribute("aria-describedby");const v=e.hasAttribute("aria-description")&&!e.hasAttribute(S);l&&!v?(e.setAttribute("aria-description",l),e.setAttribute(S,"")):e.hasAttribute(S)&&(e.removeAttribute("aria-description"),e.removeAttribute(S)),this.hasAttribute("invalid")||o?e.setAttribute("aria-invalid","true"):e.removeAttribute("aria-invalid"),this.hasAttribute("required")?e.setAttribute("aria-required","true"):e.removeAttribute("aria-required")}render(){const t=this.getAttribute("label")||"",i=this.getAttribute("description")||"",l=this.getAttribute("error")||"",o=this.hasAttribute("required"),e=this.getAttribute("for")||"";this.setContent(`
|
|
374
|
+
<style>${N}</style>
|
|
375
375
|
<div class="frame" part="field">
|
|
376
376
|
<div class="meta" part="meta">
|
|
377
377
|
<div class="label-row" part="top">
|
|
378
|
-
<label class="label" id="${this._uid}-label" ${
|
|
379
|
-
<slot name="label">${
|
|
380
|
-
${
|
|
378
|
+
<label class="label" id="${this._uid}-label" ${e?`for="${C(e)}"`:""}>
|
|
379
|
+
<slot name="label">${C(t)}</slot>
|
|
380
|
+
${o?'<span class="required" aria-hidden="true">*</span>':""}
|
|
381
381
|
</label>
|
|
382
382
|
<div class="actions" part="actions"><slot name="actions"></slot></div>
|
|
383
383
|
</div>
|
|
384
384
|
<p class="description" id="${this._uid}-description" part="description">
|
|
385
|
-
<slot name="description">${
|
|
385
|
+
<slot name="description">${C(i)}</slot>
|
|
386
386
|
</p>
|
|
387
387
|
</div>
|
|
388
388
|
|
|
@@ -391,8 +391,8 @@
|
|
|
391
391
|
<div class="control" part="control"><slot></slot></div>
|
|
392
392
|
</div>
|
|
393
393
|
<p class="error" id="${this._uid}-error" part="error" aria-live="polite">
|
|
394
|
-
<slot name="error">${
|
|
394
|
+
<slot name="error">${C(l)}</slot>
|
|
395
395
|
</p>
|
|
396
396
|
</div>
|
|
397
397
|
</div>
|
|
398
|
-
`),this._invalidateControlCache(),this._scheduleDerivedStateSync()}shouldRenderOnAttributeChange(
|
|
398
|
+
`),this._invalidateControlCache(),this._scheduleDerivedStateSync()}shouldRenderOnAttributeChange(t,i,l){return t==="label"||t==="description"||t==="error"||t==="required"||t==="for"}}typeof customElements<"u"&&!customElements.get("ui-field")&&customElements.define("ui-field",L);exports.UIField=L;
|