@alfadocs/ui-kit 1.136.0 → 1.138.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{appointment-card-BT1cMZIX.js → appointment-card-CaxFXtSn.js} +196 -184
- package/dist/_chunks/appointment-details-panel.history-DrIMDQYf.js +314 -0
- package/dist/_chunks/appointment-details-panel.identity-C20Y9xNC.js +223 -0
- package/dist/_chunks/{appointment-timeline-Dy4YQJ17.js → appointment-timeline-BEwgbYyG.js} +113 -110
- package/dist/_chunks/{appointment-tray-B3gSHL1j.js → appointment-tray-DPpeR9JT.js} +8 -8
- package/dist/_chunks/calendar-appointment-editor-dialog-SxSkOTnO.js +5519 -0
- package/dist/_chunks/calendar-editor-discard-host-DjUhoFr2.js +1336 -0
- package/dist/_chunks/calendar-editor-guard-9fShhNIA.js +31 -0
- package/dist/_chunks/calendar-waiting-list-panel-331vzAdl.js +981 -0
- package/dist/_chunks/calendar-workspace.model-B8yPwuBv.js +1557 -0
- package/dist/_chunks/calendar.sheets-aodjllWd.js +4585 -0
- package/dist/_chunks/color-picker-CC8ZfntU.js +582 -0
- package/dist/_chunks/{document-preview-DWlejd8A.js → document-preview-CirR3C_m.js} +2 -2
- package/dist/_chunks/{fiscal-code-input-BBvU7sAo.js → fiscal-code-input-DZlpaMGg.js} +2 -2
- package/dist/_chunks/{iban-input-DuTwKok5.js → iban-input-CdSLRzQN.js} +2 -2
- package/dist/_chunks/list-todo-KWvUhmT_.js +33 -0
- package/dist/_chunks/{notes-panel-BvjAo4RQ.js → notes-panel-DsEKNtsw.js} +2 -2
- package/dist/_chunks/palettes-CKVXYTzo.js +172 -0
- package/dist/_chunks/{patient-account-settings-Bmfeclpd.js → patient-account-settings-Cs9y-pVA.js} +3 -3
- package/dist/_chunks/{patient-check-in-resume-CYZ-SvsF.js → patient-check-in-resume-4qi_klQV.js} +5 -5
- package/dist/_chunks/{patient-details-9eh9cNy7.js → patient-details-Dv7EiTCo.js} +2 -2
- package/dist/_chunks/{patient-field-row-B782eT0C.js → patient-field-row-DuHWGlLz.js} +2 -2
- package/dist/_chunks/patient-picker-BZJuOgMw.js +173 -0
- package/dist/_chunks/{patient-summary-card-K9zaMl1O.js → patient-summary-card-D-cDzOim.js} +2 -2
- package/dist/_chunks/{portal-details-DCIiGkHA.js → portal-details-BGc_FLQk.js} +3 -3
- package/dist/_chunks/{portal-documents-DVKj6Sco.js → portal-documents-BSI1U5lI.js} +3 -3
- package/dist/_chunks/{portal-parts-Br8wuala.js → portal-parts-C99CreYO.js} +2 -2
- package/dist/_chunks/{privacy-mask-C19dJFMk.js → privacy-mask-C2ZLKrMh.js} +5 -5
- package/dist/_chunks/{rich-text-editor-DjHL1b3E.js → rich-text-editor-C48omVjq.js} +2 -2
- package/dist/_chunks/task-editor-wKbFbGqW.js +1093 -0
- package/dist/_chunks/use-appointment-details-read-jGkJalX8.js +1966 -0
- package/dist/agent-catalog.json +2 -2
- package/dist/appointment-editor-panel/index.js +100 -0
- package/dist/booking-tools-data/index.js +82 -0
- package/dist/browser-support.js +1 -1
- package/dist/calendar-action-buttons/index.js +178 -0
- package/dist/components/appointment-card/appointment-card.d.ts +5 -2
- package/dist/components/appointment-card/index.js +2 -2
- package/dist/components/appointment-details-panel/index.js +6 -5
- package/dist/components/appointment-timeline/appointment-timeline.d.ts +6 -0
- package/dist/components/appointment-timeline/index.js +1 -1
- package/dist/components/color-picker/index.js +5 -4
- package/dist/components/document-preview/index.js +1 -1
- package/dist/components/fiscal-code-input/index.js +1 -1
- package/dist/components/iban-input/index.js +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/task-editor/index.js +1 -1
- package/dist/core.css +1 -1
- package/dist/find-free-slots-panel/index.js +58 -0
- package/dist/host-legacy.css +16 -0
- package/dist/i18n/locales/ar.d.ts +0 -1
- package/dist/i18n/locales/ar.js +0 -1
- package/dist/i18n/locales/de.d.ts +0 -1
- package/dist/i18n/locales/de.js +0 -1
- package/dist/i18n/locales/el.d.ts +0 -1
- package/dist/i18n/locales/el.js +0 -1
- package/dist/i18n/locales/en.d.ts +0 -1
- package/dist/i18n/locales/en.js +0 -1
- package/dist/i18n/locales/es.d.ts +0 -1
- package/dist/i18n/locales/es.js +0 -1
- package/dist/i18n/locales/fr.d.ts +0 -1
- package/dist/i18n/locales/fr.js +0 -1
- package/dist/i18n/locales/hi.d.ts +0 -1
- package/dist/i18n/locales/hi.js +0 -1
- package/dist/i18n/locales/it.d.ts +0 -1
- package/dist/i18n/locales/it.js +0 -1
- package/dist/i18n/locales/ja.d.ts +0 -1
- package/dist/i18n/locales/ja.js +0 -1
- package/dist/i18n/locales/nl.d.ts +0 -1
- package/dist/i18n/locales/nl.js +0 -1
- package/dist/i18n/locales/pl.d.ts +0 -1
- package/dist/i18n/locales/pl.js +0 -1
- package/dist/i18n/locales/pt.d.ts +0 -1
- package/dist/i18n/locales/pt.js +0 -1
- package/dist/i18n/locales/ro.d.ts +0 -1
- package/dist/i18n/locales/ro.js +0 -1
- package/dist/i18n/locales/ru.d.ts +0 -1
- package/dist/i18n/locales/ru.js +0 -1
- package/dist/i18n/locales/sq.d.ts +0 -1
- package/dist/i18n/locales/sq.js +0 -1
- package/dist/i18n/locales/sv.d.ts +0 -1
- package/dist/i18n/locales/sv.js +0 -1
- package/dist/i18n/locales/tr.d.ts +0 -1
- package/dist/i18n/locales/tr.js +0 -1
- package/dist/i18n/locales/zh.d.ts +0 -1
- package/dist/i18n/locales/zh.js +0 -1
- package/dist/index.js +1328 -1322
- package/dist/locales/ar.json +0 -1
- package/dist/locales/de.json +0 -1
- package/dist/locales/el.json +0 -1
- package/dist/locales/en.json +0 -1
- package/dist/locales/es.json +0 -1
- package/dist/locales/fr.json +0 -1
- package/dist/locales/hi.json +0 -1
- package/dist/locales/it.json +0 -1
- package/dist/locales/ja.json +0 -1
- package/dist/locales/nl.json +0 -1
- package/dist/locales/pl.json +0 -1
- package/dist/locales/pt.json +0 -1
- package/dist/locales/ro.json +0 -1
- package/dist/locales/ru.json +0 -1
- package/dist/locales/sq.json +0 -1
- package/dist/locales/sv.json +0 -1
- package/dist/locales/tr.json +0 -1
- package/dist/locales/zh.json +0 -1
- package/dist/online-bookings-panel/index.js +69 -0
- package/dist/patterns/calendar/booking-tools/appointment-editor-panel.d.ts +46 -0
- package/dist/patterns/calendar/booking-tools/booking-tools-data.d.ts +48 -0
- package/dist/patterns/calendar/booking-tools/calendar-action-buttons.d.ts +55 -0
- package/dist/patterns/calendar/booking-tools/find-free-slots-panel.d.ts +35 -0
- package/dist/patterns/calendar/booking-tools/online-bookings-panel.d.ts +61 -0
- package/dist/patterns/calendar/booking-tools/waiting-list-panel.d.ts +58 -0
- package/dist/patterns/calendar/calendar-editor-discard-host.d.ts +20 -0
- package/dist/patterns/calendar/calendar-print-sheet.d.ts +16 -0
- package/dist/patterns/calendar/calendar-workspace.model.d.ts +7 -0
- package/dist/patterns/calendar/calendar.model.d.ts +9 -0
- package/dist/patterns/calendar/calendar.sheets.d.ts +59 -17
- package/dist/patterns/calendar/index.js +24 -20
- package/dist/patterns/patient-account-settings/index.js +1 -1
- package/dist/patterns/patient-check-in/index.js +1 -1
- package/dist/patterns/patient-portal/index.js +2 -2
- package/dist/tokens.css +1 -1
- package/dist/waiting-list-panel/index.js +158 -0
- package/package.json +27 -2
- package/dist/_chunks/calendar-appointment-editor-dialog-CB4cQOtc.js +0 -13773
- package/dist/_chunks/color-picker-AcaWuKah.js +0 -745
- package/dist/_chunks/task-editor-BfXSn6U1.js +0 -1257
- package/dist/_chunks/use-appointment-details-read-7J0j1FP7.js +0 -2476
|
@@ -1,745 +0,0 @@
|
|
|
1
|
-
import { jsx as l, jsxs as m, Fragment as Ne } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as Pe, useId as $e, useState as T, useMemo as E, useCallback as Ae, useRef as G, useEffect as ee } from "react";
|
|
3
|
-
import * as F from "@radix-ui/react-popover";
|
|
4
|
-
import { u as Me, f as Se } from "./non-modal-tab-exit-j3CPOuE3.js";
|
|
5
|
-
import { c as se } from "./index-D2ZczOXr.js";
|
|
6
|
-
import { useTranslation as Te } from "react-i18next";
|
|
7
|
-
import { a as Ee } from "./format-number-DdzqwMs1.js";
|
|
8
|
-
import { u as Le, a as ze } from "./form-field-context-DtiROUJV.js";
|
|
9
|
-
import { S as re } from "./slider-pZ95bEm7.js";
|
|
10
|
-
import { u as Re } from "./registry-DvAUVLHh.js";
|
|
11
|
-
import { C as ne } from "./check-DrFSN__t.js";
|
|
12
|
-
import { X as Ie } from "./x-B5YnXwCz.js";
|
|
13
|
-
const Fe = {
|
|
14
|
-
id: "color-picker",
|
|
15
|
-
capabilities: ["set_value"],
|
|
16
|
-
state: {
|
|
17
|
-
value: {
|
|
18
|
-
type: "string",
|
|
19
|
-
descriptionKey: "ui.agent.colorPicker.state.value",
|
|
20
|
-
description: 'Currently picked colour as a hex string (e.g. "#3b82f6").',
|
|
21
|
-
read: (e) => e.getValue()
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
actions: {
|
|
25
|
-
set_value: {
|
|
26
|
-
safety: "write",
|
|
27
|
-
argsType: "{ hex: string }",
|
|
28
|
-
argsSchema: {
|
|
29
|
-
type: "object",
|
|
30
|
-
properties: {
|
|
31
|
-
hex: {
|
|
32
|
-
type: "string",
|
|
33
|
-
description: 'Hex colour string, e.g. "#3b82f6".'
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
required: ["hex"]
|
|
37
|
-
},
|
|
38
|
-
idempotent: !0,
|
|
39
|
-
descriptionKey: "ui.agent.colorPicker.actions.setValue",
|
|
40
|
-
description: "Set the picked colour from a hex string.",
|
|
41
|
-
examples: [{ args: { hex: "#3b82f6" }, note: "Set to brand blue." }],
|
|
42
|
-
invoke: (e, t) => {
|
|
43
|
-
e.setValue(t.hex);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
domHooks: {
|
|
48
|
-
root: {
|
|
49
|
-
attr: "data-component",
|
|
50
|
-
value: "color-picker",
|
|
51
|
-
description: "Marks the ColorPicker wrapper (inline) or trigger (popover variant)."
|
|
52
|
-
},
|
|
53
|
-
instanceId: {
|
|
54
|
-
attr: "data-component-id",
|
|
55
|
-
sourceProp: "id",
|
|
56
|
-
description: "Sourced from the id prop."
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
function He(e) {
|
|
61
|
-
let t = e.startsWith("#") ? e.slice(1) : e;
|
|
62
|
-
(t.length === 3 || t.length === 4) && (t = t.split("").map((c) => c + c).join(""));
|
|
63
|
-
const r = parseInt(t.slice(0, 2), 16) / 255, s = parseInt(t.slice(2, 4), 16) / 255, n = parseInt(t.slice(4, 6), 16) / 255, d = t.length === 8 ? parseInt(t.slice(6, 8), 16) / 255 : 1;
|
|
64
|
-
return oe(r, s, n, d);
|
|
65
|
-
}
|
|
66
|
-
function oe(e, t, r, s) {
|
|
67
|
-
const n = Math.max(e, t, r), d = Math.min(e, t, r), c = (n + d) / 2;
|
|
68
|
-
let h = 0, w = 0;
|
|
69
|
-
if (n !== d) {
|
|
70
|
-
const x = n - d;
|
|
71
|
-
w = c > 0.5 ? x / (2 - n - d) : x / (n + d), n === e ? h = ((t - r) / x + (t < r ? 6 : 0)) / 6 : n === t ? h = ((r - e) / x + 2) / 6 : h = ((e - t) / x + 4) / 6;
|
|
72
|
-
}
|
|
73
|
-
return {
|
|
74
|
-
// Preserve byte identity through RGB -> HSL -> RGB. Palette colours
|
|
75
|
-
// can be server identifiers, so even one changed channel is a different
|
|
76
|
-
// selection. Round human-facing labels only, never this stored value.
|
|
77
|
-
h: h * 360,
|
|
78
|
-
s: w * 100,
|
|
79
|
-
l: c * 100,
|
|
80
|
-
a: s
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
function C(e) {
|
|
84
|
-
const { r: t, g: r, b: s } = W(e), n = (c) => Math.round(c * 255).toString(16).padStart(2, "0"), d = `#${n(t)}${n(r)}${n(s)}`;
|
|
85
|
-
return e.a < 1 ? `${d}${n(e.a)}` : d;
|
|
86
|
-
}
|
|
87
|
-
function _e(e) {
|
|
88
|
-
const { r: t, g: r, b: s } = W(e), n = Math.round(t * 255), d = Math.round(r * 255), c = Math.round(s * 255);
|
|
89
|
-
return e.a < 1 ? `rgba(${n}, ${d}, ${c}, ${e.a})` : `rgba(${n}, ${d}, ${c}, 1)`;
|
|
90
|
-
}
|
|
91
|
-
function W(e) {
|
|
92
|
-
const t = e.h / 360, r = e.s / 100, s = e.l / 100;
|
|
93
|
-
if (r === 0)
|
|
94
|
-
return { r: s, g: s, b: s };
|
|
95
|
-
const n = s < 0.5 ? s * (1 + r) : s + r - s * r, d = 2 * s - n;
|
|
96
|
-
return {
|
|
97
|
-
r: D(d, n, t + 1 / 3),
|
|
98
|
-
g: D(d, n, t),
|
|
99
|
-
b: D(d, n, t - 1 / 3)
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
function D(e, t, r) {
|
|
103
|
-
let s = r;
|
|
104
|
-
return s < 0 && (s += 1), s > 1 && (s -= 1), s < 1 / 6 ? e + (t - e) * 6 * s : s < 1 / 2 ? t : s < 2 / 3 ? e + (t - e) * (2 / 3 - s) * 6 : e;
|
|
105
|
-
}
|
|
106
|
-
function j(e, t) {
|
|
107
|
-
switch (t) {
|
|
108
|
-
case "hex":
|
|
109
|
-
return C(e);
|
|
110
|
-
case "hsl":
|
|
111
|
-
return e.a < 1 ? `hsla(${Math.round(e.h)}, ${Math.round(e.s)}%, ${Math.round(e.l)}%, ${e.a})` : `hsl(${Math.round(e.h)}, ${Math.round(e.s)}%, ${Math.round(e.l)}%)`;
|
|
112
|
-
case "rgba":
|
|
113
|
-
return _e(e);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
function y(e) {
|
|
117
|
-
const t = e.trim();
|
|
118
|
-
if (!t) return null;
|
|
119
|
-
if (t.startsWith("#")) {
|
|
120
|
-
const n = t.slice(1);
|
|
121
|
-
return !/^[0-9a-fA-F]{3,8}$/.test(n) || ![3, 4, 6, 8].includes(n.length) ? null : He(t);
|
|
122
|
-
}
|
|
123
|
-
const r = t.match(
|
|
124
|
-
/^hsla?\(\s*([\d.]+)\s*[,/]\s*([\d.]+)%?\s*[,/]\s*([\d.]+)%?\s*(?:[,/]\s*([\d.]+))?\s*\)$/
|
|
125
|
-
);
|
|
126
|
-
if (r)
|
|
127
|
-
return {
|
|
128
|
-
h: Math.round(parseFloat(r[1])) % 360,
|
|
129
|
-
s: Math.round(parseFloat(r[2])),
|
|
130
|
-
l: Math.round(parseFloat(r[3])),
|
|
131
|
-
a: r[4] !== void 0 ? parseFloat(r[4]) : 1
|
|
132
|
-
};
|
|
133
|
-
const s = t.match(
|
|
134
|
-
/^rgba?\(\s*([\d.]+)\s*[,/]\s*([\d.]+)\s*[,/]\s*([\d.]+)\s*(?:[,/]\s*([\d.]+))?\s*\)$/
|
|
135
|
-
);
|
|
136
|
-
if (s) {
|
|
137
|
-
const n = parseFloat(s[1]) / 255, d = parseFloat(s[2]) / 255, c = parseFloat(s[3]) / 255, h = s[4] !== void 0 ? parseFloat(s[4]) : 1;
|
|
138
|
-
return oe(n, d, c, h);
|
|
139
|
-
}
|
|
140
|
-
return null;
|
|
141
|
-
}
|
|
142
|
-
function ae(e) {
|
|
143
|
-
const { r: t, g: r, b: s } = W(e), n = (d) => d <= 0.03928 ? d / 12.92 : Math.pow((d + 0.055) / 1.055, 2.4);
|
|
144
|
-
return 0.2126 * n(t) + 0.7152 * n(r) + 0.0722 * n(s);
|
|
145
|
-
}
|
|
146
|
-
function Oe(e, t) {
|
|
147
|
-
const r = ae(e), s = ae(t), n = Math.max(r, s), d = Math.min(r, s);
|
|
148
|
-
return Math.round((n + 0.05) / (d + 0.05) * 100) / 100;
|
|
149
|
-
}
|
|
150
|
-
function Be(e) {
|
|
151
|
-
return e >= 4.5;
|
|
152
|
-
}
|
|
153
|
-
function Ve(e) {
|
|
154
|
-
return e >= 7;
|
|
155
|
-
}
|
|
156
|
-
const Ge = [
|
|
157
|
-
{ name: "Pink 500", hex: "#e91e63", textColor: "#ffffff" },
|
|
158
|
-
{ name: "Black", hex: "#000000", textColor: "#ffffff" },
|
|
159
|
-
{ name: "Blue 500", hex: "#2196f3", textColor: "#ffffff" },
|
|
160
|
-
{ name: "Blue 900", hex: "#0d47a1", textColor: "#ffffff" },
|
|
161
|
-
{ name: "Blue Grey 500", hex: "#607d8b", textColor: "#ffffff" },
|
|
162
|
-
{ name: "Blue Grey 800", hex: "#37474f", textColor: "#ffffff" },
|
|
163
|
-
{ name: "Brown 500", hex: "#795548", textColor: "#ffffff" },
|
|
164
|
-
{ name: "Deep Orange 500", hex: "#ff5722", textColor: "#ffffff" },
|
|
165
|
-
{ name: "Deep Purple 500", hex: "#673ab7", textColor: "#ffffff" },
|
|
166
|
-
{ name: "Green 500", hex: "#4caf50", textColor: "#ffffff" },
|
|
167
|
-
{ name: "Green 900", hex: "#1b5e20", textColor: "#ffffff" },
|
|
168
|
-
{ name: "Indigo 500", hex: "#3f51b5", textColor: "#ffffff" },
|
|
169
|
-
{ name: "Indigo 900", hex: "#1a237e", textColor: "#ffffff" },
|
|
170
|
-
{ name: "Pink 900", hex: "#880e4f", textColor: "#ffffff" },
|
|
171
|
-
{ name: "Purple 500", hex: "#9c27b0", textColor: "#ffffff" },
|
|
172
|
-
{ name: "Purple 900", hex: "#4a148c", textColor: "#ffffff" },
|
|
173
|
-
{ name: "Red 500", hex: "#f44336", textColor: "#ffffff" },
|
|
174
|
-
{ name: "Red 900", hex: "#b71c1c", textColor: "#ffffff" },
|
|
175
|
-
{ name: "Teal 500", hex: "#009688", textColor: "#ffffff" },
|
|
176
|
-
{ name: "Teal 900", hex: "#004d40", textColor: "#ffffff" },
|
|
177
|
-
{ name: "Amber 500", hex: "#ffc107", textColor: "#000000" },
|
|
178
|
-
{ name: "Cyan 500", hex: "#00bcd4", textColor: "#000000" },
|
|
179
|
-
{ name: "Grey 500", hex: "#9e9e9e", textColor: "#000000" },
|
|
180
|
-
{ name: "Light Blue 500", hex: "#03a9f4", textColor: "#000000" },
|
|
181
|
-
{ name: "Light Green 500", hex: "#8bc34a", textColor: "#000000" },
|
|
182
|
-
{ name: "Lime 500", hex: "#cddc39", textColor: "#000000" },
|
|
183
|
-
{ name: "Orange 500", hex: "#ff9800", textColor: "#000000" },
|
|
184
|
-
{ name: "Orange 900", hex: "#e65100", textColor: "#000000" },
|
|
185
|
-
{ name: "White", hex: "#ffffff", textColor: "#000000" },
|
|
186
|
-
{ name: "Yellow 500", hex: "#ffeb3b", textColor: "#000000" }
|
|
187
|
-
], ca = [
|
|
188
|
-
{ name: "Blue 300", hex: "#70738c" },
|
|
189
|
-
{ name: "Blue 500", hex: "#292e53" },
|
|
190
|
-
{ name: "Blue 700", hex: "#1d213b" },
|
|
191
|
-
{ name: "Violet 300", hex: "#9995ee" },
|
|
192
|
-
{ name: "Violet 500", hex: "#6761e5" },
|
|
193
|
-
{ name: "Violet 700", hex: "#4945a3" },
|
|
194
|
-
{ name: "Purple 300", hex: "#ccaafa" },
|
|
195
|
-
{ name: "Purple 500", hex: "#b380f8" },
|
|
196
|
-
{ name: "Purple 700", hex: "#7f5bb0" },
|
|
197
|
-
{ name: "Magenta 300", hex: "#ea7ffc" },
|
|
198
|
-
{ name: "Magenta 500", hex: "#e040fb" },
|
|
199
|
-
{ name: "Magenta 700", hex: "#9f2db2" },
|
|
200
|
-
{ name: "Fuchsia 300", hex: "#fa76fc" },
|
|
201
|
-
{ name: "Fuchsia 500", hex: "#f732fb" },
|
|
202
|
-
{ name: "Fuchsia 700", hex: "#af24b2" },
|
|
203
|
-
{ name: "Grey 300", hex: "#f9f6f3" },
|
|
204
|
-
{ name: "Grey 500", hex: "#f6f1ed" },
|
|
205
|
-
{ name: "Grey 700", hex: "#afaba8" }
|
|
206
|
-
], fa = [
|
|
207
|
-
{ name: "Tomato", hex: "#d50000" },
|
|
208
|
-
{ name: "Flamingo", hex: "#e67c73" },
|
|
209
|
-
{ name: "Tangerine", hex: "#f4511e" },
|
|
210
|
-
{ name: "Banana", hex: "#f6bf26" },
|
|
211
|
-
{ name: "Sage", hex: "#33b679" },
|
|
212
|
-
{ name: "Basil", hex: "#0b8043" },
|
|
213
|
-
{ name: "Peacock", hex: "#039be5" },
|
|
214
|
-
{ name: "Blueberry", hex: "#3f51b5" },
|
|
215
|
-
{ name: "Lavender", hex: "#7986cb" },
|
|
216
|
-
{ name: "Grape", hex: "#8e24aa" },
|
|
217
|
-
{ name: "Graphite", hex: "#616161" }
|
|
218
|
-
], u = 6, De = se(
|
|
219
|
-
[
|
|
220
|
-
"ds:inline-flex ds:items-center ds:w-full",
|
|
221
|
-
"ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--control-border)] ds:bg-[var(--background)] ds:text-[var(--foreground)]",
|
|
222
|
-
"ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
|
|
223
|
-
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
|
|
224
|
-
"ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
225
|
-
"ds:disabled:cursor-not-allowed ds:disabled:opacity-50"
|
|
226
|
-
].join(" "),
|
|
227
|
-
{
|
|
228
|
-
variants: {
|
|
229
|
-
size: {
|
|
230
|
-
sm: "ds:h-8 ds:text-[length:var(--font-size-sm)] ds:ps-3 ds:pe-3",
|
|
231
|
-
md: "ds:h-[var(--min-target-size)] ds:text-[length:var(--font-size-base)] ds:ps-3 ds:pe-3",
|
|
232
|
-
lg: "ds:h-12 ds:text-[length:var(--font-size-lg)] ds:ps-4 ds:pe-4"
|
|
233
|
-
}
|
|
234
|
-
},
|
|
235
|
-
defaultVariants: { size: "md" }
|
|
236
|
-
}
|
|
237
|
-
), je = se(
|
|
238
|
-
[
|
|
239
|
-
"ds:relative ds:rounded-[var(--radius-sm)] ds:border-2 ds:cursor-pointer",
|
|
240
|
-
"ds:transition-[transform,box-shadow] ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
|
|
241
|
-
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
|
|
242
|
-
"ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
243
|
-
"ds:hover:scale-110",
|
|
244
|
-
// The swatch background is the user-picked colour — set as a CSS custom
|
|
245
|
-
// property via inline `style` per 23-constraints §Runtime-computed
|
|
246
|
-
// dimensions (CSS custom property setter; the bg rule lives on the class).
|
|
247
|
-
"ds:bg-[var(--swatch-bg)]"
|
|
248
|
-
].join(" "),
|
|
249
|
-
{
|
|
250
|
-
variants: {
|
|
251
|
-
selected: {
|
|
252
|
-
true: "ds:border-[var(--primary)] ds:shadow-[var(--shadow-md)]",
|
|
253
|
-
false: "ds:border-transparent"
|
|
254
|
-
},
|
|
255
|
-
// Swatch footprint. md/lg honour --min-target-size (44/48px) for touch.
|
|
256
|
-
// sm is a denser 28px swatch for toolbar/inline use — comfortably above
|
|
257
|
-
// the WCAG 2.5.8 (AA) 24px minimum, with the grid gap providing spacing.
|
|
258
|
-
// sm intentionally does NOT take the accessible-theme --min-target-size
|
|
259
|
-
// bump (48px) — a dense colour grid is opt-in and the full roving-tabindex
|
|
260
|
-
// keyboard path is the mitigation for the sub-AAA pointer target.
|
|
261
|
-
size: {
|
|
262
|
-
// sm = 28px: clears WCAG 2.5.8 (AA, 24px) but intentionally opts out of
|
|
263
|
-
// the accessible-theme 48px min-target bump — a conscious, signed-off
|
|
264
|
-
// trade-off (dense opt-in grid; keyboard roving-tabindex is the mitigation).
|
|
265
|
-
sm: "ds:min-w-7 ds:min-h-7",
|
|
266
|
-
md: "ds:min-w-[var(--min-target-size)] ds:min-h-[var(--min-target-size)]",
|
|
267
|
-
lg: "ds:min-w-[var(--min-target-size)] ds:min-h-[var(--min-target-size)]"
|
|
268
|
-
}
|
|
269
|
-
},
|
|
270
|
-
defaultVariants: { selected: !1, size: "md" }
|
|
271
|
-
}
|
|
272
|
-
), Ke = [
|
|
273
|
-
"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
|
|
274
|
-
"ds:rounded-[var(--radius-md)] ds:bg-[var(--background)] ds:text-[var(--foreground)]",
|
|
275
|
-
"ds:p-[var(--spacing-md)]"
|
|
276
|
-
].join(" "), We = [
|
|
277
|
-
"ds:bg-[image:repeating-conic-gradient(var(--color-grey-700)_0%_25%,transparent_0%_50%)]",
|
|
278
|
-
"ds:bg-[size:8px_8px]"
|
|
279
|
-
].join(" "), Ue = [
|
|
280
|
-
"ds:rounded-[var(--radius-md)] ds:bg-[var(--background)] ds:text-[var(--foreground)]",
|
|
281
|
-
"ds:p-[var(--spacing-sm)]"
|
|
282
|
-
].join(" "), Xe = [
|
|
283
|
-
"ds:rounded-[var(--radius-md)] ds:bg-[var(--background)] ds:text-[var(--foreground)]",
|
|
284
|
-
"ds:p-[var(--spacing-xs)]"
|
|
285
|
-
].join(" "), Ye = [
|
|
286
|
-
"ds:z-[var(--z-popover)] ds:rounded-[var(--radius-md)]",
|
|
287
|
-
"ds:border ds:border-[color:var(--border)] ds:bg-[var(--background)] ds:shadow-[var(--shadow-lg)]",
|
|
288
|
-
"ds:w-72",
|
|
289
|
-
"ds:data-[state=open]:animate-in ds:data-[state=open]:fade-in-0 ds:data-[state=open]:zoom-in-95",
|
|
290
|
-
"ds:data-[state=closed]:animate-out ds:data-[state=closed]:fade-out-0 ds:data-[state=closed]:zoom-out-95",
|
|
291
|
-
"ds:data-[side=bottom]:slide-in-from-top-2 ds:data-[side=top]:slide-in-from-bottom-2",
|
|
292
|
-
"ds:data-[side=left]:slide-in-from-right-2 ds:data-[side=right]:slide-in-from-left-2"
|
|
293
|
-
].join(" "), qe = [
|
|
294
|
-
"ds:w-full ds:rounded-[var(--radius-sm)] ds:border ds:bg-[var(--background)] ds:text-[var(--foreground)]",
|
|
295
|
-
"ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:py-[var(--spacing-xs)] ds:text-[length:var(--font-size-sm)]",
|
|
296
|
-
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
|
|
297
|
-
"ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
298
|
-
"ds:disabled:cursor-not-allowed ds:disabled:opacity-50",
|
|
299
|
-
"ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none"
|
|
300
|
-
].join(" "), ie = "ds:[&>span:first-child]:bg-transparent ds:[&>span:first-child>span]:bg-transparent", Je = Pe(
|
|
301
|
-
(e, t) => {
|
|
302
|
-
const {
|
|
303
|
-
value: r,
|
|
304
|
-
defaultValue: s,
|
|
305
|
-
onChange: n,
|
|
306
|
-
format: d = "hex",
|
|
307
|
-
allowOpacity: c = !1,
|
|
308
|
-
palette: h,
|
|
309
|
-
against: w,
|
|
310
|
-
size: x = "md",
|
|
311
|
-
disabled: de = !1,
|
|
312
|
-
variant: le = "inline",
|
|
313
|
-
compact: S = !0,
|
|
314
|
-
className: U
|
|
315
|
-
} = e, { t: g, i18n: ce } = Te("ui"), $ = Le(), fe = $e(), N = ze($) || fe, b = $.disabled || de, L = r !== void 0, [X, ue] = T(() => {
|
|
316
|
-
const a = r ?? s;
|
|
317
|
-
if (a) {
|
|
318
|
-
const i = y(a);
|
|
319
|
-
if (i) return i;
|
|
320
|
-
}
|
|
321
|
-
return { h: 0, s: 100, l: 50, a: 1 };
|
|
322
|
-
}), o = E(() => {
|
|
323
|
-
if (L && r) {
|
|
324
|
-
const a = y(r);
|
|
325
|
-
if (a) return a;
|
|
326
|
-
}
|
|
327
|
-
return X;
|
|
328
|
-
}, [L, r, X]), v = Ae(
|
|
329
|
-
(a) => {
|
|
330
|
-
const i = c ? a : { ...a, a: 1 };
|
|
331
|
-
L || ue(i), n == null || n(j(i, d));
|
|
332
|
-
},
|
|
333
|
-
[c, d, L, n]
|
|
334
|
-
), [Y, H] = T(() => C(o)), [me, z] = T(!1), P = G(void 0), _ = G(o);
|
|
335
|
-
_.current = o, ee(() => {
|
|
336
|
-
H(C(o)), z(!1), P.current !== void 0 && (clearTimeout(P.current), P.current = void 0);
|
|
337
|
-
}, [o]), ee(() => () => {
|
|
338
|
-
P.current !== void 0 && clearTimeout(P.current);
|
|
339
|
-
}, []);
|
|
340
|
-
const he = () => {
|
|
341
|
-
const a = y(Y);
|
|
342
|
-
a ? (z(!1), v(a)) : (z(!0), P.current = setTimeout(() => {
|
|
343
|
-
P.current = void 0, z(!1), H(C(_.current));
|
|
344
|
-
}, 800));
|
|
345
|
-
}, A = E(() => h ? h.map(
|
|
346
|
-
(a) => typeof a == "string" ? { name: a.toUpperCase(), hex: a } : a
|
|
347
|
-
) : Ge, [h]), ge = C(o), O = E(
|
|
348
|
-
() => A.map((a) => {
|
|
349
|
-
const i = y(a.hex);
|
|
350
|
-
return i ? C(i).toLowerCase() : null;
|
|
351
|
-
}),
|
|
352
|
-
[A]
|
|
353
|
-
).findIndex(
|
|
354
|
-
(a) => a !== null && a === ge.toLowerCase()
|
|
355
|
-
), R = G(null), [p, q] = T(
|
|
356
|
-
O >= 0 ? O : 0
|
|
357
|
-
), pe = (a) => {
|
|
358
|
-
var f;
|
|
359
|
-
const i = (f = R.current) == null ? void 0 : f.querySelectorAll('[role="gridcell"]');
|
|
360
|
-
i != null && i[a] && (i[a].focus(), q(a));
|
|
361
|
-
}, xe = (a) => {
|
|
362
|
-
if (b) return;
|
|
363
|
-
const i = A.length;
|
|
364
|
-
let f = p;
|
|
365
|
-
const k = (typeof window < "u" && R.current ? window.getComputedStyle(R.current).direction === "rtl" : !1) ? -1 : 1;
|
|
366
|
-
switch (a.key) {
|
|
367
|
-
case "ArrowRight":
|
|
368
|
-
f = (p + k + i) % i;
|
|
369
|
-
break;
|
|
370
|
-
case "ArrowLeft":
|
|
371
|
-
f = (p - k + i) % i;
|
|
372
|
-
break;
|
|
373
|
-
case "ArrowDown":
|
|
374
|
-
f = Math.min(p + u, i - 1);
|
|
375
|
-
break;
|
|
376
|
-
case "ArrowUp":
|
|
377
|
-
f = Math.max(p - u, 0);
|
|
378
|
-
break;
|
|
379
|
-
case "Home":
|
|
380
|
-
f = Math.floor(p / u) * u;
|
|
381
|
-
break;
|
|
382
|
-
case "End":
|
|
383
|
-
f = Math.min(
|
|
384
|
-
Math.floor(p / u) * u + u - 1,
|
|
385
|
-
i - 1
|
|
386
|
-
);
|
|
387
|
-
break;
|
|
388
|
-
case "PageUp":
|
|
389
|
-
f = p % u;
|
|
390
|
-
break;
|
|
391
|
-
case "PageDown": {
|
|
392
|
-
const M = Math.floor((i - 1) / u) * u;
|
|
393
|
-
f = Math.min(M + p % u, i - 1);
|
|
394
|
-
break;
|
|
395
|
-
}
|
|
396
|
-
case "Enter":
|
|
397
|
-
case " ": {
|
|
398
|
-
a.preventDefault();
|
|
399
|
-
const M = y(A[p].hex);
|
|
400
|
-
M && v(M);
|
|
401
|
-
return;
|
|
402
|
-
}
|
|
403
|
-
default:
|
|
404
|
-
return;
|
|
405
|
-
}
|
|
406
|
-
a.preventDefault(), pe(f);
|
|
407
|
-
}, [be, J] = T(!1), ve = E(
|
|
408
|
-
() => ({
|
|
409
|
-
getValue: () => C(_.current),
|
|
410
|
-
setValue: (a) => {
|
|
411
|
-
const i = y(a);
|
|
412
|
-
i && v(i);
|
|
413
|
-
}
|
|
414
|
-
}),
|
|
415
|
-
[v]
|
|
416
|
-
);
|
|
417
|
-
Re(Fe, ve, N);
|
|
418
|
-
const I = E(() => {
|
|
419
|
-
if (!w) return null;
|
|
420
|
-
const a = y(w);
|
|
421
|
-
if (!a) return null;
|
|
422
|
-
const i = Oe(o, a);
|
|
423
|
-
return { ratio: i, aa: Be(i), aaa: Ve(i) };
|
|
424
|
-
}, [w, o]), Ce = (
|
|
425
|
-
// eslint-disable-next-line jsx-a11y/interactive-supports-focus -- inner gridcells are individually focusable via roving tabindex
|
|
426
|
-
/* @__PURE__ */ l(
|
|
427
|
-
"div",
|
|
428
|
-
{
|
|
429
|
-
ref: R,
|
|
430
|
-
role: "grid",
|
|
431
|
-
"aria-label": g("inputs.colorPicker.paletteLabel", "Colour palette"),
|
|
432
|
-
onKeyDown: xe,
|
|
433
|
-
className: "ds:grid ds:grid-cols-6 ds:gap-[var(--spacing-xs)]",
|
|
434
|
-
children: A.map((a, i) => {
|
|
435
|
-
const f = Math.floor(i / u) * u;
|
|
436
|
-
return i === f ? /* @__PURE__ */ l("div", { role: "row", className: "ds:contents", children: A.slice(f, f + u).map((k, M) => {
|
|
437
|
-
const B = f + M, V = B === O;
|
|
438
|
-
return (
|
|
439
|
-
// eslint-disable-next-line jsx-a11y/click-events-have-key-events -- parent grid handles keyboard navigation via onKeyDown
|
|
440
|
-
/* @__PURE__ */ l(
|
|
441
|
-
"div",
|
|
442
|
-
{
|
|
443
|
-
role: "gridcell",
|
|
444
|
-
"aria-selected": V,
|
|
445
|
-
"aria-label": g("inputs.colorPicker.swatchLabel", {
|
|
446
|
-
name: k.name,
|
|
447
|
-
hex: k.hex
|
|
448
|
-
}),
|
|
449
|
-
tabIndex: B === p ? 0 : -1,
|
|
450
|
-
onClick: () => {
|
|
451
|
-
if (b) return;
|
|
452
|
-
const Z = y(k.hex);
|
|
453
|
-
Z && v(Z), q(B);
|
|
454
|
-
},
|
|
455
|
-
className: je({ selected: V, size: x }),
|
|
456
|
-
style: { "--swatch-bg": k.hex },
|
|
457
|
-
children: V ? /* @__PURE__ */ l(
|
|
458
|
-
ne,
|
|
459
|
-
{
|
|
460
|
-
"aria-hidden": "true",
|
|
461
|
-
className: "ds:absolute ds:inset-0 ds:m-auto ds:size-4 ds:text-[var(--background)] ds:mix-blend-difference"
|
|
462
|
-
}
|
|
463
|
-
) : null
|
|
464
|
-
},
|
|
465
|
-
k.hex
|
|
466
|
-
)
|
|
467
|
-
);
|
|
468
|
-
}) }, i) : null;
|
|
469
|
-
})
|
|
470
|
-
}
|
|
471
|
-
)
|
|
472
|
-
), we = S ? null : /* @__PURE__ */ m(Ne, { children: [
|
|
473
|
-
/* @__PURE__ */ m("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
474
|
-
/* @__PURE__ */ l(
|
|
475
|
-
"label",
|
|
476
|
-
{
|
|
477
|
-
htmlFor: `${N}-hex`,
|
|
478
|
-
className: "ds:text-[length:var(--font-size-xs)] ds:text-[var(--muted-foreground)]",
|
|
479
|
-
children: g("inputs.colorPicker.hex", "Hex")
|
|
480
|
-
}
|
|
481
|
-
),
|
|
482
|
-
/* @__PURE__ */ l("bdi", { dir: "ltr", children: /* @__PURE__ */ l(
|
|
483
|
-
"input",
|
|
484
|
-
{
|
|
485
|
-
id: `${N}-hex`,
|
|
486
|
-
type: "text",
|
|
487
|
-
value: Y,
|
|
488
|
-
disabled: b,
|
|
489
|
-
onChange: (a) => H(a.target.value),
|
|
490
|
-
onBlur: he,
|
|
491
|
-
className: `${qe} ${me ? "ds:border-[var(--destructive)]" : "ds:border-[color:var(--control-border)]"}`
|
|
492
|
-
}
|
|
493
|
-
) })
|
|
494
|
-
] }),
|
|
495
|
-
/* @__PURE__ */ m("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
496
|
-
/* @__PURE__ */ l(
|
|
497
|
-
K,
|
|
498
|
-
{
|
|
499
|
-
label: g("inputs.colorPicker.hue", "Hue"),
|
|
500
|
-
gradient: "linear-gradient(to right, hsl(0,100%,50%), hsl(60,100%,50%), hsl(120,100%,50%), hsl(180,100%,50%), hsl(240,100%,50%), hsl(300,100%,50%), hsl(360,100%,50%))",
|
|
501
|
-
min: 0,
|
|
502
|
-
max: 360,
|
|
503
|
-
value: o.h,
|
|
504
|
-
onChange: (a) => v({ ...o, h: a }),
|
|
505
|
-
formatValue: (a) => `H ${Math.round(a)}°`,
|
|
506
|
-
disabled: b
|
|
507
|
-
}
|
|
508
|
-
),
|
|
509
|
-
/* @__PURE__ */ l(
|
|
510
|
-
K,
|
|
511
|
-
{
|
|
512
|
-
label: g("inputs.colorPicker.saturation", "Saturation"),
|
|
513
|
-
gradient: `linear-gradient(to right, hsl(${o.h},0%,${o.l}%), hsl(${o.h},100%,${o.l}%))`,
|
|
514
|
-
min: 0,
|
|
515
|
-
max: 100,
|
|
516
|
-
value: o.s,
|
|
517
|
-
onChange: (a) => v({ ...o, s: a }),
|
|
518
|
-
formatValue: (a) => `S ${Math.round(a)}%`,
|
|
519
|
-
disabled: b
|
|
520
|
-
}
|
|
521
|
-
),
|
|
522
|
-
/* @__PURE__ */ l(
|
|
523
|
-
K,
|
|
524
|
-
{
|
|
525
|
-
label: g("inputs.colorPicker.lightness", "Lightness"),
|
|
526
|
-
gradient: `linear-gradient(to right, hsl(${o.h},${o.s}%,0%), hsl(${o.h},${o.s}%,50%), hsl(${o.h},${o.s}%,100%))`,
|
|
527
|
-
min: 0,
|
|
528
|
-
max: 100,
|
|
529
|
-
value: o.l,
|
|
530
|
-
onChange: (a) => v({ ...o, l: a }),
|
|
531
|
-
formatValue: (a) => `L ${Math.round(a)}%`,
|
|
532
|
-
disabled: b
|
|
533
|
-
}
|
|
534
|
-
),
|
|
535
|
-
c ? /* @__PURE__ */ m("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
536
|
-
/* @__PURE__ */ l("label", { className: "ds:text-[length:var(--font-size-xs)] ds:text-[var(--muted-foreground)]", children: g("inputs.colorPicker.opacity", "Opacity") }),
|
|
537
|
-
/* @__PURE__ */ m("div", { className: "ds:relative", children: [
|
|
538
|
-
/* @__PURE__ */ l(
|
|
539
|
-
"div",
|
|
540
|
-
{
|
|
541
|
-
className: `ds:absolute ds:inset-0 ds:rounded-[var(--radius-full)] ds:pointer-events-none ${We}`,
|
|
542
|
-
"aria-hidden": "true"
|
|
543
|
-
}
|
|
544
|
-
),
|
|
545
|
-
/* @__PURE__ */ l(
|
|
546
|
-
"div",
|
|
547
|
-
{
|
|
548
|
-
className: "ds:absolute ds:inset-0 ds:rounded-[var(--radius-full)] ds:pointer-events-none ds:bg-[image:var(--opacity-gradient)]",
|
|
549
|
-
style: {
|
|
550
|
-
"--opacity-gradient": `linear-gradient(to right, hsla(${o.h},${o.s}%,${o.l}%,0), hsl(${o.h},${o.s}%,${o.l}%))`
|
|
551
|
-
},
|
|
552
|
-
"aria-hidden": "true"
|
|
553
|
-
}
|
|
554
|
-
),
|
|
555
|
-
/* @__PURE__ */ l(
|
|
556
|
-
re,
|
|
557
|
-
{
|
|
558
|
-
min: 0,
|
|
559
|
-
max: 100,
|
|
560
|
-
step: 1,
|
|
561
|
-
value: [Math.round(o.a * 100)],
|
|
562
|
-
onValueChange: ([a]) => v({ ...o, a: a / 100 }),
|
|
563
|
-
"aria-label": g("inputs.colorPicker.opacity", "Opacity"),
|
|
564
|
-
formatValue: (a) => `${a}%`,
|
|
565
|
-
disabled: b,
|
|
566
|
-
className: ie
|
|
567
|
-
}
|
|
568
|
-
)
|
|
569
|
-
] })
|
|
570
|
-
] }) : null
|
|
571
|
-
] }),
|
|
572
|
-
I ? /* @__PURE__ */ m(
|
|
573
|
-
"div",
|
|
574
|
-
{
|
|
575
|
-
className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)] ds:text-[length:var(--font-size-sm)]",
|
|
576
|
-
role: "status",
|
|
577
|
-
"aria-live": "polite",
|
|
578
|
-
children: [
|
|
579
|
-
/* @__PURE__ */ l("span", { className: "ds:tabular-nums", children: g("inputs.colorPicker.contrastRatio", {
|
|
580
|
-
ratio: Ee(I.ratio, ce.language, {
|
|
581
|
-
minimumFractionDigits: 1,
|
|
582
|
-
maximumFractionDigits: 1
|
|
583
|
-
})
|
|
584
|
-
}) }),
|
|
585
|
-
/* @__PURE__ */ l(te, { level: "AA", passes: I.aa, t: g }),
|
|
586
|
-
/* @__PURE__ */ l(te, { level: "AAA", passes: I.aaa, t: g })
|
|
587
|
-
]
|
|
588
|
-
}
|
|
589
|
-
) : null,
|
|
590
|
-
/* @__PURE__ */ m("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
591
|
-
/* @__PURE__ */ l(
|
|
592
|
-
"div",
|
|
593
|
-
{
|
|
594
|
-
className: "ds:size-8 ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ds:bg-[var(--swatch-bg)]",
|
|
595
|
-
style: { "--swatch-bg": C(o) },
|
|
596
|
-
"aria-hidden": "true"
|
|
597
|
-
}
|
|
598
|
-
),
|
|
599
|
-
/* @__PURE__ */ l("span", { className: "ds:text-[length:var(--font-size-sm)] ds:text-[var(--muted-foreground)] ds:tabular-nums", children: j(o, d) })
|
|
600
|
-
] })
|
|
601
|
-
] }), Q = /* @__PURE__ */ m(
|
|
602
|
-
"div",
|
|
603
|
-
{
|
|
604
|
-
className: S ? x === "sm" ? Xe : Ue : Ke,
|
|
605
|
-
children: [
|
|
606
|
-
Ce,
|
|
607
|
-
we
|
|
608
|
-
]
|
|
609
|
-
}
|
|
610
|
-
), ke = Me(!0, {
|
|
611
|
-
getAnchor: Se,
|
|
612
|
-
onReturnToTrigger: () => J(!1)
|
|
613
|
-
});
|
|
614
|
-
return le === "inline" ? /* @__PURE__ */ l(
|
|
615
|
-
"div",
|
|
616
|
-
{
|
|
617
|
-
ref: t,
|
|
618
|
-
id: N,
|
|
619
|
-
className: U,
|
|
620
|
-
"aria-describedby": $.describedBy || void 0,
|
|
621
|
-
"aria-invalid": $.invalid || void 0,
|
|
622
|
-
"aria-disabled": b || void 0,
|
|
623
|
-
"data-component": "color-picker",
|
|
624
|
-
"data-component-id": N,
|
|
625
|
-
"data-testid": "color-picker",
|
|
626
|
-
children: Q
|
|
627
|
-
}
|
|
628
|
-
) : /* @__PURE__ */ m(F.Root, { open: be, onOpenChange: J, children: [
|
|
629
|
-
/* @__PURE__ */ l(F.Trigger, { asChild: !0, disabled: b, children: /* @__PURE__ */ m(
|
|
630
|
-
"button",
|
|
631
|
-
{
|
|
632
|
-
ref: t,
|
|
633
|
-
type: "button",
|
|
634
|
-
id: N,
|
|
635
|
-
"aria-describedby": $.describedBy || void 0,
|
|
636
|
-
"aria-invalid": $.invalid || void 0,
|
|
637
|
-
"aria-label": S ? g("inputs.colorPicker.triggerLabel", "Choose colour") : void 0,
|
|
638
|
-
className: De({ size: x, className: U }),
|
|
639
|
-
"data-component": "color-picker",
|
|
640
|
-
"data-component-id": N,
|
|
641
|
-
"data-testid": "color-picker-trigger",
|
|
642
|
-
children: [
|
|
643
|
-
/* @__PURE__ */ l(
|
|
644
|
-
"span",
|
|
645
|
-
{
|
|
646
|
-
className: `ds:inline-block ds:size-5 ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ds:shrink-0 ds:bg-[var(--swatch-bg)]${S ? "" : " ds:me-[var(--spacing-sm)]"}`,
|
|
647
|
-
"aria-hidden": "true",
|
|
648
|
-
style: { "--swatch-bg": C(o) }
|
|
649
|
-
}
|
|
650
|
-
),
|
|
651
|
-
S ? null : /* @__PURE__ */ l("span", { className: "ds:text-start ds:truncate ds:tabular-nums", children: j(o, d) })
|
|
652
|
-
]
|
|
653
|
-
}
|
|
654
|
-
) }),
|
|
655
|
-
/* @__PURE__ */ l(F.Portal, { children: /* @__PURE__ */ l(
|
|
656
|
-
F.Content,
|
|
657
|
-
{
|
|
658
|
-
sideOffset: 4,
|
|
659
|
-
align: "start",
|
|
660
|
-
className: Ye,
|
|
661
|
-
onKeyDown: ke,
|
|
662
|
-
children: Q
|
|
663
|
-
}
|
|
664
|
-
) })
|
|
665
|
-
] });
|
|
666
|
-
}
|
|
667
|
-
);
|
|
668
|
-
Je.displayName = "ColorPicker";
|
|
669
|
-
function te({
|
|
670
|
-
level: e,
|
|
671
|
-
passes: t,
|
|
672
|
-
t: r
|
|
673
|
-
}) {
|
|
674
|
-
return /* @__PURE__ */ m("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
675
|
-
/* @__PURE__ */ l(
|
|
676
|
-
"abbr",
|
|
677
|
-
{
|
|
678
|
-
title: `Web Content Accessibility Guidelines Level ${e}`,
|
|
679
|
-
className: "ds:no-underline ds:font-medium",
|
|
680
|
-
children: e
|
|
681
|
-
}
|
|
682
|
-
),
|
|
683
|
-
t ? /* @__PURE__ */ l(
|
|
684
|
-
ne,
|
|
685
|
-
{
|
|
686
|
-
"aria-hidden": "true",
|
|
687
|
-
className: "ds:size-4 ds:text-[var(--success)]"
|
|
688
|
-
}
|
|
689
|
-
) : /* @__PURE__ */ l(
|
|
690
|
-
Ie,
|
|
691
|
-
{
|
|
692
|
-
"aria-hidden": "true",
|
|
693
|
-
className: "ds:size-4 ds:text-[var(--destructive)]"
|
|
694
|
-
}
|
|
695
|
-
),
|
|
696
|
-
/* @__PURE__ */ l("span", { className: "ds:sr-only", children: t ? r("inputs.colorPicker.contrastPass", "Pass") : r("inputs.colorPicker.contrastFail", "Fail") })
|
|
697
|
-
] });
|
|
698
|
-
}
|
|
699
|
-
function K({
|
|
700
|
-
label: e,
|
|
701
|
-
gradient: t,
|
|
702
|
-
min: r,
|
|
703
|
-
max: s,
|
|
704
|
-
value: n,
|
|
705
|
-
onChange: d,
|
|
706
|
-
formatValue: c,
|
|
707
|
-
disabled: h
|
|
708
|
-
}) {
|
|
709
|
-
return /* @__PURE__ */ m("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
710
|
-
/* @__PURE__ */ l("label", { className: "ds:text-[length:var(--font-size-xs)] ds:text-[var(--muted-foreground)]", children: e }),
|
|
711
|
-
/* @__PURE__ */ m("div", { className: "ds:relative", children: [
|
|
712
|
-
/* @__PURE__ */ l(
|
|
713
|
-
"div",
|
|
714
|
-
{
|
|
715
|
-
className: "ds:absolute ds:inset-0 ds:rounded-[var(--radius-full)] ds:pointer-events-none ds:bg-[image:var(--slider-gradient)]",
|
|
716
|
-
style: { "--slider-gradient": t },
|
|
717
|
-
"aria-hidden": "true"
|
|
718
|
-
}
|
|
719
|
-
),
|
|
720
|
-
/* @__PURE__ */ l(
|
|
721
|
-
re,
|
|
722
|
-
{
|
|
723
|
-
min: r,
|
|
724
|
-
max: s,
|
|
725
|
-
step: 1,
|
|
726
|
-
value: [n],
|
|
727
|
-
onValueChange: ([w]) => d(w),
|
|
728
|
-
"aria-label": e,
|
|
729
|
-
formatValue: c,
|
|
730
|
-
disabled: h,
|
|
731
|
-
className: ie
|
|
732
|
-
}
|
|
733
|
-
)
|
|
734
|
-
] })
|
|
735
|
-
] });
|
|
736
|
-
}
|
|
737
|
-
export {
|
|
738
|
-
Ge as A,
|
|
739
|
-
ca as B,
|
|
740
|
-
Je as C,
|
|
741
|
-
fa as G,
|
|
742
|
-
Oe as c,
|
|
743
|
-
He as h
|
|
744
|
-
};
|
|
745
|
-
//# sourceMappingURL=color-picker-AcaWuKah.js.map
|