@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/color-picker.esm.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { E as q } from "./ElementBase-YlTLMsGk.mjs";
|
|
2
|
-
import { r as O, e as F, l as U, i as A, s as N, c as V } from "./date-time-utils-
|
|
2
|
+
import { r as O, e as F, l as U, i as A, s as N, c as V } from "./date-time-utils-Cps2aSu2.mjs";
|
|
3
3
|
function g(s, t, e) {
|
|
4
4
|
return Math.max(t, Math.min(e, s));
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function m(s, t = 3) {
|
|
7
7
|
const e = 10 ** t;
|
|
8
8
|
return Math.round(s * e) / e;
|
|
9
9
|
}
|
|
10
10
|
function S(s) {
|
|
11
11
|
return g(Math.round(s), 0, 255);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function D(s) {
|
|
14
14
|
const t = s.trim();
|
|
15
15
|
if (!t) return null;
|
|
16
16
|
if (t.endsWith("%")) {
|
|
@@ -20,7 +20,7 @@ function H(s) {
|
|
|
20
20
|
const e = Number(t);
|
|
21
21
|
return Number.isFinite(e) ? g(e, 0, 1) : null;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function C(s) {
|
|
24
24
|
const t = s.trim();
|
|
25
25
|
if (!t) return null;
|
|
26
26
|
if (t.endsWith("%")) {
|
|
@@ -98,9 +98,9 @@ function G(s) {
|
|
|
98
98
|
if (!t) return null;
|
|
99
99
|
const e = T(t[1]);
|
|
100
100
|
if (!e || e.channels.length < 3) return null;
|
|
101
|
-
const r =
|
|
101
|
+
const r = C(e.channels[0]), i = C(e.channels[1]), a = C(e.channels[2]);
|
|
102
102
|
if (r == null || i == null || a == null) return null;
|
|
103
|
-
const n = e.alpha != null ?
|
|
103
|
+
const n = e.alpha != null ? D(e.alpha) : 1;
|
|
104
104
|
return n == null ? null : b({ r, g: i, b: a, a: n });
|
|
105
105
|
}
|
|
106
106
|
function X(s) {
|
|
@@ -110,7 +110,7 @@ function X(s) {
|
|
|
110
110
|
if (!e || e.channels.length < 3) return null;
|
|
111
111
|
const r = W(e.channels[0]), i = B(e.channels[1]), a = B(e.channels[2]);
|
|
112
112
|
if (r == null || i == null || a == null) return null;
|
|
113
|
-
const n = e.alpha != null ?
|
|
113
|
+
const n = e.alpha != null ? D(e.alpha) : 1;
|
|
114
114
|
return n == null ? null : $({ h: r, s: i, l: a, a: n });
|
|
115
115
|
}
|
|
116
116
|
function b(s) {
|
|
@@ -118,7 +118,7 @@ function b(s) {
|
|
|
118
118
|
r: S(s.r),
|
|
119
119
|
g: S(s.g),
|
|
120
120
|
b: S(s.b),
|
|
121
|
-
a:
|
|
121
|
+
a: m(g(s.a, 0, 1), 4)
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
124
|
function f(s) {
|
|
@@ -131,21 +131,21 @@ function Y(s, t = !1) {
|
|
|
131
131
|
}
|
|
132
132
|
function j(s, t = !0) {
|
|
133
133
|
const e = b(s);
|
|
134
|
-
return !t || e.a >= 1 ? `rgb(${e.r} ${e.g} ${e.b})` : `rgb(${e.r} ${e.g} ${e.b} / ${
|
|
134
|
+
return !t || e.a >= 1 ? `rgb(${e.r} ${e.g} ${e.b})` : `rgb(${e.r} ${e.g} ${e.b} / ${m(e.a, 3)})`;
|
|
135
135
|
}
|
|
136
136
|
function J(s, t = !0) {
|
|
137
|
-
const e = Math.round(y(s.h)), r = Math.round(g(s.s, 0, 100)), i = Math.round(g(s.l, 0, 100)), a =
|
|
137
|
+
const e = Math.round(y(s.h)), r = Math.round(g(s.s, 0, 100)), i = Math.round(g(s.l, 0, 100)), a = m(g(s.a, 0, 1), 3);
|
|
138
138
|
return !t || a >= 1 ? `hsl(${e} ${r}% ${i}%)` : `hsl(${e} ${r}% ${i}% / ${a})`;
|
|
139
139
|
}
|
|
140
140
|
function z(s) {
|
|
141
141
|
const t = b(s), e = t.r / 255, r = t.g / 255, i = t.b / 255, a = Math.max(e, r, i), n = Math.min(e, r, i), o = a - n;
|
|
142
142
|
let l = 0;
|
|
143
143
|
o !== 0 && (a === e ? l = (r - i) / o % 6 : a === r ? l = (i - e) / o + 2 : l = (e - r) / o + 4, l *= 60, l < 0 && (l += 360));
|
|
144
|
-
const c = a === 0 ? 0 : o / a * 100,
|
|
144
|
+
const c = a === 0 ? 0 : o / a * 100, p = a * 100;
|
|
145
145
|
return {
|
|
146
|
-
h:
|
|
147
|
-
s:
|
|
148
|
-
v:
|
|
146
|
+
h: m(l, 3),
|
|
147
|
+
s: m(c, 3),
|
|
148
|
+
v: m(p, 3),
|
|
149
149
|
a: t.a
|
|
150
150
|
};
|
|
151
151
|
}
|
|
@@ -159,13 +159,13 @@ function Q(s) {
|
|
|
159
159
|
a: s.a
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function M(s) {
|
|
163
163
|
const t = b(s), e = t.r / 255, r = t.g / 255, i = t.b / 255, a = Math.max(e, r, i), n = Math.min(e, r, i), o = a - n, l = (a + n) / 2;
|
|
164
|
-
let c = 0,
|
|
165
|
-
return o !== 0 && (
|
|
166
|
-
h:
|
|
167
|
-
s:
|
|
168
|
-
l:
|
|
164
|
+
let c = 0, p = 0;
|
|
165
|
+
return o !== 0 && (p = o / (1 - Math.abs(2 * l - 1)), a === e ? c = (r - i) / o % 6 : a === r ? c = (i - e) / o + 2 : c = (e - r) / o + 4, c *= 60, c < 0 && (c += 360)), {
|
|
166
|
+
h: m(c, 3),
|
|
167
|
+
s: m(p * 100, 3),
|
|
168
|
+
l: m(l * 100, 3),
|
|
169
169
|
a: t.a
|
|
170
170
|
};
|
|
171
171
|
}
|
|
@@ -179,28 +179,28 @@ function $(s) {
|
|
|
179
179
|
a: s.a
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function _(s, t) {
|
|
183
183
|
return Y(s, t).toUpperCase();
|
|
184
184
|
}
|
|
185
185
|
function w(s, t) {
|
|
186
186
|
return j(s, t);
|
|
187
187
|
}
|
|
188
188
|
function Z(s, t) {
|
|
189
|
-
return J(
|
|
189
|
+
return J(M(s), t);
|
|
190
190
|
}
|
|
191
|
-
const
|
|
191
|
+
const I = "#2563eb", L = "editora:ui-color-picker:recent", tt = `
|
|
192
192
|
<svg viewBox="0 0 20 20" aria-hidden="true" focusable="false">
|
|
193
193
|
<path d="m5.6 7.6 4.4 4.6 4.4-4.6" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
|
194
194
|
</svg>
|
|
195
|
-
`,
|
|
195
|
+
`, H = `
|
|
196
196
|
:host {
|
|
197
197
|
--ui-cp-bg: color-mix(in srgb, var(--ui-color-surface, #ffffff) 96%, transparent);
|
|
198
198
|
--ui-cp-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 74%, transparent);
|
|
199
199
|
--ui-cp-text: var(--ui-color-text, #0f172a);
|
|
200
|
-
--ui-cp-muted: var(--ui-color-muted, #
|
|
200
|
+
--ui-cp-muted: var(--ui-color-muted, #526175);
|
|
201
201
|
--ui-cp-accent: var(--ui-color-primary, #2563eb);
|
|
202
|
-
--ui-cp-success: var(--ui-color-success, #
|
|
203
|
-
--ui-cp-warning: var(--ui-color-warning, #
|
|
202
|
+
--ui-cp-success: var(--ui-color-success, #15803d);
|
|
203
|
+
--ui-cp-warning: var(--ui-color-warning, #b45309);
|
|
204
204
|
--ui-cp-danger: var(--ui-color-danger, #dc2626);
|
|
205
205
|
--ui-cp-radius: 14px;
|
|
206
206
|
--ui-cp-shadow: none;
|
|
@@ -509,11 +509,15 @@ const C = "#2563eb", L = "editora:ui-color-picker:recent", tt = `
|
|
|
509
509
|
}
|
|
510
510
|
|
|
511
511
|
.sv:focus-visible,
|
|
512
|
-
.slider:focus-visible {
|
|
512
|
+
.slider:focus-visible::after {
|
|
513
513
|
outline: 2px solid color-mix(in srgb, var(--ui-cp-accent) 64%, transparent);
|
|
514
514
|
outline-offset: 1px;
|
|
515
515
|
}
|
|
516
516
|
|
|
517
|
+
.slider:focus-visible {
|
|
518
|
+
outline: none;
|
|
519
|
+
}
|
|
520
|
+
|
|
517
521
|
.thumb {
|
|
518
522
|
position: absolute;
|
|
519
523
|
inline-size: 12px;
|
|
@@ -528,19 +532,35 @@ const C = "#2563eb", L = "editora:ui-color-picker:recent", tt = `
|
|
|
528
532
|
transform: translate3d(0, 0, 0);
|
|
529
533
|
}
|
|
530
534
|
|
|
535
|
+
/* The track is 12px, but the element is 24px tall (WCAG 2.5.8): the padding is the extra hit area,
|
|
536
|
+
the track is painted in the content box and the ring is drawn by ::after over just the track. */
|
|
531
537
|
.slider {
|
|
532
538
|
position: relative;
|
|
539
|
+
box-sizing: content-box;
|
|
533
540
|
block-size: 12px;
|
|
541
|
+
padding-block: 6px;
|
|
534
542
|
border-radius: 999px;
|
|
535
|
-
|
|
543
|
+
background-clip: content-box;
|
|
544
|
+
background-origin: content-box;
|
|
536
545
|
cursor: pointer;
|
|
537
546
|
touch-action: none;
|
|
538
547
|
overflow: visible;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
.slider::after {
|
|
551
|
+
content: "";
|
|
552
|
+
position: absolute;
|
|
553
|
+
inset-inline: 0;
|
|
554
|
+
inset-block: 6px;
|
|
555
|
+
box-sizing: border-box;
|
|
556
|
+
border-radius: 999px;
|
|
557
|
+
border: 1px solid color-mix(in srgb, var(--ui-cp-border) 82%, transparent);
|
|
539
558
|
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ui-cp-border) 40%, transparent);
|
|
559
|
+
pointer-events: none;
|
|
540
560
|
}
|
|
541
561
|
|
|
542
562
|
.slider.hue {
|
|
543
|
-
background: linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
|
|
563
|
+
background-image: linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
|
|
544
564
|
}
|
|
545
565
|
|
|
546
566
|
.slider.alpha {
|
|
@@ -888,7 +908,7 @@ function k(s) {
|
|
|
888
908
|
}
|
|
889
909
|
class rt extends q {
|
|
890
910
|
constructor() {
|
|
891
|
-
super(), this._syncing = !1, this._initialized = !1, this._rgba = b(f(
|
|
911
|
+
super(), this._syncing = !1, this._initialized = !1, this._rgba = b(f(I) || { r: 37, g: 99, b: 235, a: 1 }), this._hsva = z(this._rgba), this._format = "hex", this._open = !1, this._error = "", this._presets = [], this._recentColors = [], this._panelCache = /* @__PURE__ */ new WeakMap(), this._overlay = null, this._overlayRoot = null, this._releaseScrollLock = null, this._restoreFocusEl = null, this._isSheetOpen = !1, this._dragTarget = null, this._dragPointerId = -1, this._dragRect = null, this._dragX = 0, this._dragY = 0, this._dragRaf = 0, this._dragChanged = !1, this._dragSource = "drag", this._renderingSwatches = !1, this._scheduleOverlayPosition = O(() => this._positionOverlay()), this._onRootClickBound = (t) => this._onPanelClick(t, "root"), this._onRootInputBound = (t) => this._onPanelInput(t, "root"), this._onRootChangeBound = (t) => this._onPanelChange(t, "root"), this._onRootKeyDownBound = (t) => this._onPanelKeyDown(t, "root"), this._onRootPointerDownBound = (t) => this._onPanelPointerDown(t, "root"), this._onRootPointerMoveBound = (t) => this._onPanelPointerMove(t), this._onRootPointerUpBound = (t) => this._onPanelPointerUp(t), this._onRootPointerCancelBound = (t) => this._onPanelPointerCancel(t), this._onDocumentPointerDownBound = (t) => this._onDocumentPointerDown(t), this._onDocumentKeyDownBound = (t) => this._onDocumentKeyDown(t), this._onWindowResizeBound = () => this._scheduleOverlayPosition.run(), this._onWindowScrollBound = (t) => {
|
|
892
912
|
F(t, [this._overlay]) || this._scheduleOverlayPosition.run();
|
|
893
913
|
}, this._applyValueAttribute(!1), this._applyFormatAttribute(), this._open = this.hasAttribute("open"), this._parsePresetsAttribute();
|
|
894
914
|
}
|
|
@@ -984,7 +1004,7 @@ class rt extends q {
|
|
|
984
1004
|
getColor() {
|
|
985
1005
|
const t = b(this._rgba);
|
|
986
1006
|
return {
|
|
987
|
-
hex:
|
|
1007
|
+
hex: _(t, this._alphaEnabled()),
|
|
988
1008
|
rgba: t,
|
|
989
1009
|
hsva: { ...this._hsva }
|
|
990
1010
|
};
|
|
@@ -1014,7 +1034,7 @@ class rt extends q {
|
|
|
1014
1034
|
}
|
|
1015
1035
|
_buildTemplate() {
|
|
1016
1036
|
return `
|
|
1017
|
-
<style>${
|
|
1037
|
+
<style>${H}</style>
|
|
1018
1038
|
<section class="root">
|
|
1019
1039
|
<div class="trigger-wrap" data-role="trigger-wrap">
|
|
1020
1040
|
<button
|
|
@@ -1077,7 +1097,7 @@ class rt extends q {
|
|
|
1077
1097
|
<div class="group" data-format-group="hex">
|
|
1078
1098
|
<div class="field">
|
|
1079
1099
|
<span>Value</span>
|
|
1080
|
-
<input class="input" data-input="hex" part="input" spellcheck="false" autocomplete="off" />
|
|
1100
|
+
<input class="input" data-input="hex" part="input" spellcheck="false" autocomplete="off" aria-label="Hex color value" />
|
|
1081
1101
|
</div>
|
|
1082
1102
|
</div>
|
|
1083
1103
|
|
|
@@ -1123,7 +1143,7 @@ class rt extends q {
|
|
|
1123
1143
|
this._syncOverlayHostAttributes();
|
|
1124
1144
|
const t = this._isMobileSheet(), e = t ? "sheet" : "popover";
|
|
1125
1145
|
this._overlay.dataset.mode !== e && (this._overlay.dataset.mode = e, this._overlayRoot.innerHTML = `
|
|
1126
|
-
<style>${
|
|
1146
|
+
<style>${H}${et}</style>
|
|
1127
1147
|
<section class="overlay">
|
|
1128
1148
|
${t ? '<div class="sheet-backdrop" data-action="close-popover"></div>' : ""}
|
|
1129
1149
|
<div class="${t ? "sheet-shell" : "popover-shell"}">
|
|
@@ -1198,7 +1218,7 @@ class rt extends q {
|
|
|
1198
1218
|
_applyValueAttribute(t) {
|
|
1199
1219
|
const e = this.getAttribute("value");
|
|
1200
1220
|
if (!e) {
|
|
1201
|
-
this._applyRgba(f(
|
|
1221
|
+
this._applyRgba(f(I) || this._rgba, !1);
|
|
1202
1222
|
return;
|
|
1203
1223
|
}
|
|
1204
1224
|
const r = f(e);
|
|
@@ -1225,7 +1245,7 @@ class rt extends q {
|
|
|
1225
1245
|
if (typeof i != "string") continue;
|
|
1226
1246
|
const a = f(i);
|
|
1227
1247
|
if (!a) continue;
|
|
1228
|
-
const n =
|
|
1248
|
+
const n = _(this._normalizeByAlpha(a), this._alphaEnabled());
|
|
1229
1249
|
r.includes(n) || r.push(n);
|
|
1230
1250
|
}
|
|
1231
1251
|
this._presets = r;
|
|
@@ -1244,7 +1264,7 @@ class rt extends q {
|
|
|
1244
1264
|
if (!t) return;
|
|
1245
1265
|
const e = JSON.parse(t);
|
|
1246
1266
|
if (!Array.isArray(e)) return;
|
|
1247
|
-
this._recentColors = e.filter((r) => typeof r == "string").map((r) => f(r)).filter((r) => !!r).map((r) =>
|
|
1267
|
+
this._recentColors = e.filter((r) => typeof r == "string").map((r) => f(r)).filter((r) => !!r).map((r) => _(this._normalizeByAlpha(r), this._alphaEnabled())).slice(0, this._maxRecent());
|
|
1248
1268
|
} catch {
|
|
1249
1269
|
this._recentColors = [];
|
|
1250
1270
|
}
|
|
@@ -1269,17 +1289,17 @@ class rt extends q {
|
|
|
1269
1289
|
};
|
|
1270
1290
|
}
|
|
1271
1291
|
_serializeValue(t = this._format) {
|
|
1272
|
-
return t === "rgb" ? w(this._rgba, this._alphaEnabled()) : t === "hsl" ? Z(this._rgba, this._alphaEnabled()) :
|
|
1292
|
+
return t === "rgb" ? w(this._rgba, this._alphaEnabled()) : t === "hsl" ? Z(this._rgba, this._alphaEnabled()) : _(this._rgba, this._alphaEnabled());
|
|
1273
1293
|
}
|
|
1274
1294
|
_currentHex() {
|
|
1275
|
-
return
|
|
1295
|
+
return _(this._rgba, this._alphaEnabled());
|
|
1276
1296
|
}
|
|
1277
1297
|
_eventDetail(t) {
|
|
1278
1298
|
return {
|
|
1279
1299
|
value: this._serializeValue(),
|
|
1280
1300
|
hex: this._currentHex(),
|
|
1281
1301
|
rgba: { ...this._rgba },
|
|
1282
|
-
hsla:
|
|
1302
|
+
hsla: M(this._rgba),
|
|
1283
1303
|
source: t
|
|
1284
1304
|
};
|
|
1285
1305
|
}
|
|
@@ -1459,18 +1479,18 @@ class rt extends q {
|
|
|
1459
1479
|
return this._isPopoverMode() && this._open && this._overlayRoot ? this._overlayRoot.querySelector('[data-cp-panel="overlay"]') : this.root.querySelector('[data-cp-panel="inline"]');
|
|
1460
1480
|
}
|
|
1461
1481
|
_updateUI(t, e = !1) {
|
|
1462
|
-
const r = this.root.querySelector('[data-role="trigger-wrap"]'), i = this.root.querySelector(".trigger"), a = this.root.querySelector('[data-role="trigger-value"]'), n = this.root.querySelector('[data-role="trigger-preview"]'), o = this.root.querySelector('[data-role="inline-panel"]'), l = this._isPopoverMode(), c = this._state(),
|
|
1463
|
-
r && (r.hidden = !l), i && (i.disabled = h || v, i.dataset.state = c, i.dataset.tone =
|
|
1482
|
+
const r = this.root.querySelector('[data-role="trigger-wrap"]'), i = this.root.querySelector(".trigger"), a = this.root.querySelector('[data-role="trigger-value"]'), n = this.root.querySelector('[data-role="trigger-preview"]'), o = this.root.querySelector('[data-role="inline-panel"]'), l = this._isPopoverMode(), c = this._state(), p = this._tone(), v = c === "loading", h = this._isDisabled(), x = this._isReadonly(), R = this._serializeValue() || this._placeholder();
|
|
1483
|
+
r && (r.hidden = !l), i && (i.disabled = h || v, i.dataset.state = c, i.dataset.tone = p, i.setAttribute("aria-expanded", l && this._open ? "true" : "false"), this._applyAria(i, R)), a && (a.textContent = R), n && (n.style.background = w(this._rgba, !0)), o && (o.hidden = l), this._forEachPanel((d) => this._updatePanel(d, { skipSwatches: t, disabled: h, readonly: x, loading: v, state: c, tone: p, modePopover: l, liveOnly: e }));
|
|
1464
1484
|
}
|
|
1465
1485
|
_updatePanel(t, e) {
|
|
1466
|
-
const r = this._rgba, i =
|
|
1486
|
+
const r = this._rgba, i = M(r), a = this._hsva, n = `hsl(${Math.round(a.h)} 100% 50%)`, o = t.panel.getAttribute("data-cp-panel") === "overlay", l = !!this._error || e.state === "error", c = e.disabled || e.readonly || e.loading;
|
|
1467
1487
|
if (this._applyAria(t.panel), t.panel.dataset.state = l ? "error" : e.state, t.panel.dataset.tone = e.tone, t.panel.setAttribute("aria-busy", e.loading ? "true" : "false"), o && e.modePopover ? (t.panel.setAttribute("role", "dialog"), t.panel.setAttribute("aria-modal", "true"), t.panel.tabIndex = -1) : (t.panel.removeAttribute("role"), t.panel.removeAttribute("aria-modal"), t.panel.removeAttribute("tabindex")), t.label && (t.label.textContent = this._labelText()), t.valueText && (t.valueText.textContent = this._serializeValue()), t.preview && (t.preview.style.background = w(r, !0)), t.status) {
|
|
1468
|
-
let
|
|
1469
|
-
l ?
|
|
1488
|
+
let d = "";
|
|
1489
|
+
l ? d = "Error" : e.state === "loading" ? d = "Syncing" : e.state === "success" && (d = "Saved"), t.status.hidden = !d, t.status.textContent = d, t.status.dataset.tone = e.tone;
|
|
1470
1490
|
}
|
|
1471
1491
|
if (t.sv && (t.sv.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, ${n})`, t.sv.setAttribute("aria-valuetext", `Saturation ${Math.round(a.s)}%, Value ${Math.round(a.v)}%`), t.sv.setAttribute("aria-disabled", c ? "true" : "false"), t.sv.tabIndex = c ? -1 : 0), t.svThumb) {
|
|
1472
|
-
const
|
|
1473
|
-
t.svThumb.style.left = `${
|
|
1492
|
+
const d = u(a.s, 1, 99), P = u(100 - a.v, 1, 99);
|
|
1493
|
+
t.svThumb.style.left = `${d}%`, t.svThumb.style.top = `${P}%`;
|
|
1474
1494
|
}
|
|
1475
1495
|
t.hue && (t.hue.setAttribute("aria-valuemin", "0"), t.hue.setAttribute("aria-valuemax", "360"), t.hue.setAttribute("aria-valuenow", String(Math.round(a.h))), t.hue.setAttribute("aria-disabled", c ? "true" : "false"), t.hue.tabIndex = c ? -1 : 0), t.hueThumb && (t.hueThumb.style.left = `${u(a.h / 360 * 100, 1, 99)}%`), t.alphaRow && (t.alphaRow.hidden = !this._alphaEnabled()), t.alpha && (t.alpha.setAttribute("aria-valuemin", "0"), t.alpha.setAttribute("aria-valuemax", "100"), t.alpha.setAttribute("aria-valuenow", String(Math.round(a.a * 100))), t.alpha.setAttribute("aria-disabled", c || !this._alphaEnabled() ? "true" : "false"), t.alpha.tabIndex = c ? -1 : 0, t.alpha.style.backgroundImage = `
|
|
1476
1496
|
linear-gradient(45deg, var(--ui-cp-checker-a) 25%, transparent 25%),
|
|
@@ -1479,20 +1499,20 @@ class rt extends q {
|
|
|
1479
1499
|
linear-gradient(-45deg, transparent 75%, var(--ui-cp-checker-a) 75%),
|
|
1480
1500
|
linear-gradient(to right, rgba(${r.r}, ${r.g}, ${r.b}, 0), rgba(${r.r}, ${r.g}, ${r.b}, 1))
|
|
1481
1501
|
`), t.alphaThumb && (t.alphaThumb.style.left = `${u(a.a * 100, 1, 99)}%`);
|
|
1482
|
-
const
|
|
1483
|
-
if (t.inputHex && h !== "hex" && (t.inputHex.value =
|
|
1502
|
+
const p = t.panel.getRootNode(), v = p instanceof ShadowRoot ? p.activeElement : t.panel.ownerDocument.activeElement, h = v && t.panel.contains(v) ? v.getAttribute("data-input") : null;
|
|
1503
|
+
if (t.inputHex && h !== "hex" && (t.inputHex.value = _(r, this._alphaEnabled())), t.inputR && h !== "r" && (t.inputR.value = String(r.r)), t.inputG && h !== "g" && (t.inputG.value = String(r.g)), t.inputB && h !== "b" && (t.inputB.value = String(r.b)), t.inputA1 && h !== "a1" && (t.inputA1.value = this._alphaEnabled() ? String(Number(r.a.toFixed(3))) : "1"), t.inputH && h !== "h" && (t.inputH.value = String(Math.round(i.h))), t.inputS && h !== "s" && (t.inputS.value = String(Math.round(i.s))), t.inputL && h !== "l" && (t.inputL.value = String(Math.round(i.l))), t.inputA2 && h !== "a2" && (t.inputA2.value = this._alphaEnabled() ? String(Number(r.a.toFixed(3))) : "1"), e.liveOnly) return;
|
|
1484
1504
|
if (t.tabHex && (t.tabHex.dataset.active = String(this._format === "hex")), t.tabRgb && (t.tabRgb.dataset.active = String(this._format === "rgb")), t.tabHsl && (t.tabHsl.dataset.active = String(this._format === "hsl")), t.groupHex && (t.groupHex.hidden = this._format !== "hex"), t.groupRgb && (t.groupRgb.hidden = this._format !== "rgb"), t.groupHsl && (t.groupHsl.hidden = this._format !== "hsl"), t.inputA1 && (t.inputA1.disabled = !this._alphaEnabled() || c), t.inputA2 && (t.inputA2.disabled = !this._alphaEnabled() || c), t.error) {
|
|
1485
|
-
const
|
|
1486
|
-
t.error.hidden = !
|
|
1505
|
+
const d = this._error || (e.state === "error" ? "Unable to validate current color value." : "");
|
|
1506
|
+
t.error.hidden = !d, t.error.textContent = d;
|
|
1487
1507
|
}
|
|
1488
1508
|
const x = c;
|
|
1489
1509
|
if (t.copyHex && (t.copyHex.disabled = e.disabled || e.loading), t.copyRgb && (t.copyRgb.disabled = e.disabled || e.loading), t.eyedropper) {
|
|
1490
|
-
const
|
|
1491
|
-
t.eyedropper.hidden = !
|
|
1510
|
+
const d = typeof window < "u" && typeof window.EyeDropper == "function";
|
|
1511
|
+
t.eyedropper.hidden = !d, t.eyedropper.disabled = x || !d;
|
|
1492
1512
|
}
|
|
1493
|
-
if (t.clear && (t.clear.disabled = x), t.apply && (t.apply.hidden = !e.modePopover, t.apply.disabled = x), t.panel.querySelectorAll(".input").forEach((
|
|
1494
|
-
const
|
|
1495
|
-
|
|
1513
|
+
if (t.clear && (t.clear.disabled = x), t.apply && (t.apply.hidden = !e.modePopover, t.apply.disabled = x), t.panel.querySelectorAll(".input").forEach((d) => {
|
|
1514
|
+
const P = d;
|
|
1515
|
+
P.disabled = x;
|
|
1496
1516
|
}), !e.skipSwatches && !this._renderingSwatches) {
|
|
1497
1517
|
this._renderingSwatches = !0;
|
|
1498
1518
|
try {
|
|
@@ -1507,12 +1527,12 @@ class rt extends q {
|
|
|
1507
1527
|
t.presets && (t.presets.innerHTML = this._presets.map((r) => {
|
|
1508
1528
|
const i = f(r);
|
|
1509
1529
|
if (!i) return "";
|
|
1510
|
-
const a =
|
|
1530
|
+
const a = _(this._normalizeByAlpha(i), this._alphaEnabled()), n = a.toLowerCase() === e ? ' data-selected="true"' : "";
|
|
1511
1531
|
return `<button type="button" class="swatch" part="swatch" data-action="preset" data-color="${k(a)}"${n} title="${k(a)}" style="background:${k(w(i, !0))}"></button>`;
|
|
1512
1532
|
}).join("")), t.recentTitle && (t.recentTitle.hidden = !this._recentEnabled() || this._recentColors.length === 0), t.recent && (t.recent.hidden = !this._recentEnabled() || this._recentColors.length === 0, t.recent.innerHTML = this._recentColors.map((r) => {
|
|
1513
1533
|
const i = f(r);
|
|
1514
1534
|
if (!i) return "";
|
|
1515
|
-
const a =
|
|
1535
|
+
const a = _(this._normalizeByAlpha(i), this._alphaEnabled()), n = a.toLowerCase() === e ? ' data-selected="true"' : "";
|
|
1516
1536
|
return `<button type="button" class="swatch" part="swatch recent" data-action="recent" data-color="${k(a)}"${n} title="${k(a)}" style="background:${k(w(i, !0))}"></button>`;
|
|
1517
1537
|
}).join(""));
|
|
1518
1538
|
}
|
|
@@ -1552,7 +1572,7 @@ class rt extends q {
|
|
|
1552
1572
|
}
|
|
1553
1573
|
if (a === "clear") {
|
|
1554
1574
|
if (this._isReadonly()) return;
|
|
1555
|
-
const n = f(
|
|
1575
|
+
const n = f(I);
|
|
1556
1576
|
n && (this._applyRgba(n, !1), this._error = "", this._syncValueAttribute(), this._emitInput("text"), this._emitChange("text"), this._pushRecent(this._currentHex()), this._updateUI(!1));
|
|
1557
1577
|
return;
|
|
1558
1578
|
}
|
|
@@ -1629,12 +1649,12 @@ class rt extends q {
|
|
|
1629
1649
|
if (!t) return null;
|
|
1630
1650
|
const e = this._panelRefs(t);
|
|
1631
1651
|
if (this._format === "hex") {
|
|
1632
|
-
const l = e.inputHex?.value || "", c = l.trim().startsWith("#") ? l.trim() : `#${l.trim()}`,
|
|
1633
|
-
return
|
|
1652
|
+
const l = e.inputHex?.value || "", c = l.trim().startsWith("#") ? l.trim() : `#${l.trim()}`, p = f(c);
|
|
1653
|
+
return p ? this._normalizeByAlpha(p) : null;
|
|
1634
1654
|
}
|
|
1635
1655
|
if (this._format === "rgb") {
|
|
1636
|
-
const l = Number(e.inputR?.value ?? ""), c = Number(e.inputG?.value ?? ""),
|
|
1637
|
-
return [l, c,
|
|
1656
|
+
const l = Number(e.inputR?.value ?? ""), c = Number(e.inputG?.value ?? ""), p = Number(e.inputB?.value ?? ""), v = this._alphaEnabled() ? Number(e.inputA1?.value ?? "") : 1;
|
|
1657
|
+
return [l, c, p, v].every((h) => Number.isFinite(h)) ? this._normalizeByAlpha({ r: l, g: c, b: p, a: v }) : null;
|
|
1638
1658
|
}
|
|
1639
1659
|
const r = Number(e.inputH?.value ?? ""), i = Number(e.inputS?.value ?? ""), a = Number(e.inputL?.value ?? ""), n = this._alphaEnabled() ? Number(e.inputA2?.value ?? "") : 1;
|
|
1640
1660
|
if (![r, i, a, n].every((l) => Number.isFinite(l))) return null;
|
|
@@ -1744,9 +1764,11 @@ class rt extends q {
|
|
|
1744
1764
|
else
|
|
1745
1765
|
this.dispatchEvent(new CustomEvent("toast", { detail: { message: r }, bubbles: !0, composed: !0 }));
|
|
1746
1766
|
}
|
|
1747
|
-
_applyAria(t) {
|
|
1748
|
-
const
|
|
1749
|
-
|
|
1767
|
+
_applyAria(t, e = "") {
|
|
1768
|
+
const r = this.getAttribute("aria-labelledby"), i = this.getAttribute("aria-describedby"), a = this.getAttribute("aria-label"), n = this.getRootNode(), o = r ? r.split(/\s+/).map((p) => n.getElementById?.(p)?.textContent?.trim() || "").filter(Boolean).join(" ") : "";
|
|
1769
|
+
t.removeAttribute("aria-labelledby"), i ? t.setAttribute("aria-describedby", i) : t.removeAttribute("aria-describedby");
|
|
1770
|
+
const l = o || a || "Color picker", c = e && !l.includes(e) ? `${l}, ${e}` : l;
|
|
1771
|
+
t.setAttribute("aria-label", c);
|
|
1750
1772
|
}
|
|
1751
1773
|
}
|
|
1752
1774
|
customElements.get("ui-color-picker") || customElements.define("ui-color-picker", rt);
|