@ensi-platform/admin-ui 0.11.0 → 0.12.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/ai/skills/admin-ui/SKILL.md +1 -0
- package/dist/{Component-MSGhHMYk.js → Component-B1piMJHv.js} +2 -2
- package/dist/{Component-MSGhHMYk.js.map → Component-B1piMJHv.js.map} +1 -1
- package/dist/{Component-DpACJ8IJ.js → Component-BPAXqDXt.js} +2 -2
- package/dist/{Component-DpACJ8IJ.js.map → Component-BPAXqDXt.js.map} +1 -1
- package/dist/{Component-DSAL6avh.js → Component-BPN5FgKq.js} +2 -2
- package/dist/{Component-DSAL6avh.js.map → Component-BPN5FgKq.js.map} +1 -1
- package/dist/{Component-BZqLGwzc.js → Component-BuFsNZAH.js} +2 -2
- package/dist/{Component-BZqLGwzc.js.map → Component-BuFsNZAH.js.map} +1 -1
- package/dist/{Component-IFlvrceZ.js → Component-CBnhxD86.js} +5 -5
- package/dist/{Component-IFlvrceZ.js.map → Component-CBnhxD86.js.map} +1 -1
- package/dist/{Component-BH5skHn_.js → Component-CDURmZCP.js} +2 -2
- package/dist/{Component-BH5skHn_.js.map → Component-CDURmZCP.js.map} +1 -1
- package/dist/{Component-Dq7pvkWP.js → Component-CQyBQxAb.js} +2 -2
- package/dist/{Component-Dq7pvkWP.js.map → Component-CQyBQxAb.js.map} +1 -1
- package/dist/{Component-DGze6SVb.js → Component-D92F9hx-.js} +2 -2
- package/dist/{Component-DGze6SVb.js.map → Component-D92F9hx-.js.map} +1 -1
- package/dist/{Component-DH7wdC3G.js → Component-DWp04UBh.js} +2 -2
- package/dist/{Component-DH7wdC3G.js.map → Component-DWp04UBh.js.map} +1 -1
- package/dist/{Component-CkazNd13.js → Component-D_c3xBcb.js} +2 -2
- package/dist/{Component-CkazNd13.js.map → Component-D_c3xBcb.js.map} +1 -1
- package/dist/Component-DhE4a93B.js +138 -0
- package/dist/Component-DhE4a93B.js.map +1 -0
- package/dist/Component-DlBYWjUa.js +107 -0
- package/dist/Component-DlBYWjUa.js.map +1 -0
- package/dist/{Component-C4vHIDMZ.js → Component-dmSX0Khf.js} +2 -2
- package/dist/{Component-C4vHIDMZ.js.map → Component-dmSX0Khf.js.map} +1 -1
- package/dist/{Component-DOlDNQnu.js → Component-eoUrqznD.js} +2 -2
- package/dist/{Component-DOlDNQnu.js.map → Component-eoUrqznD.js.map} +1 -1
- package/dist/{Component-6rieHJdg.js → Component-jzDbWkuj.js} +3 -3
- package/dist/{Component-6rieHJdg.js.map → Component-jzDbWkuj.js.map} +1 -1
- package/dist/{Component-CzwTENBM.js → Component-uHkw3SDR.js} +2 -2
- package/dist/{Component-CzwTENBM.js.map → Component-uHkw3SDR.js.map} +1 -1
- package/dist/action-popup/index.js +2 -2
- package/dist/active-filters/index.js +2 -2
- package/dist/arrangement-settings/index.js +2 -2
- package/dist/assets/Component.css +1 -1
- package/dist/assets/Component10.css +1 -1
- package/dist/assets/Component11.css +1 -1
- package/dist/assets/Component12.css +1 -1
- package/dist/assets/Component13.css +1 -1
- package/dist/assets/Component14.css +1 -1
- package/dist/assets/Component15.css +1 -1
- package/dist/assets/Component16.css +1 -0
- package/dist/assets/Component2.css +1 -1
- package/dist/assets/Component3.css +1 -1
- package/dist/assets/Component4.css +1 -1
- package/dist/assets/Component5.css +1 -1
- package/dist/assets/Component6.css +1 -1
- package/dist/assets/Component7.css +1 -1
- package/dist/assets/Component8.css +1 -1
- package/dist/assets/Component9.css +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/assets/index15.css +1 -1
- package/dist/autocomplete/index.js +2 -2
- package/dist/autocomplete-async/index.js +2 -2
- package/dist/button/Component.d.ts +1 -1
- package/dist/button/Component.d.ts.map +1 -1
- package/dist/button/index.js +1 -1
- package/dist/button/types.d.ts +2 -0
- package/dist/button/types.d.ts.map +1 -1
- package/dist/cascade-menu/index.js +2 -2
- package/dist/checkbox/index.js +1 -1
- package/dist/checkbox-group/index.js +1 -1
- package/dist/color-field/Component.d.ts +5 -0
- package/dist/color-field/Component.d.ts.map +1 -0
- package/dist/color-field/FormColorField.d.ts +6 -0
- package/dist/color-field/FormColorField.d.ts.map +1 -0
- package/dist/color-field/index.d.ts +4 -0
- package/dist/color-field/index.d.ts.map +1 -0
- package/dist/color-field/index.js +284 -0
- package/dist/color-field/index.js.map +1 -0
- package/dist/{color-picker → color-field}/theme.d.ts +1 -1
- package/dist/color-field/theme.d.ts.map +1 -0
- package/dist/color-field/types.d.ts +58 -0
- package/dist/color-field/types.d.ts.map +1 -0
- package/dist/color-field/utils.d.ts +14 -0
- package/dist/color-field/utils.d.ts.map +1 -0
- package/dist/color-picker/Component.d.ts +1 -1
- package/dist/color-picker/Component.d.ts.map +1 -1
- package/dist/color-picker/index.d.ts +2 -2
- package/dist/color-picker/index.d.ts.map +1 -1
- package/dist/color-picker/index.js +3 -344
- package/dist/color-picker/index.js.map +1 -1
- package/dist/color-picker/types.d.ts +16 -37
- package/dist/color-picker/types.d.ts.map +1 -1
- package/dist/color-picker/utils.d.ts +7 -14
- package/dist/color-picker/utils.d.ts.map +1 -1
- package/dist/context-menu/index.js +1 -1
- package/dist/copy-button/index.js +1 -1
- package/dist/data-table/index.js +1 -1
- package/dist/date-picker/index.js +1 -1
- package/dist/date-range-picker/index.js +1 -1
- package/dist/drawer/index.js +1 -1
- package/dist/dropzone/index.js +2 -2
- package/dist/field/index.js +1 -1
- package/dist/input/index.js +2 -2
- package/dist/link/index.js +1 -1
- package/dist/mask/Component.d.ts +5 -0
- package/dist/mask/Component.d.ts.map +1 -0
- package/dist/mask/FormMask.d.ts +6 -0
- package/dist/mask/FormMask.d.ts.map +1 -0
- package/dist/mask/index.d.ts +4 -0
- package/dist/mask/index.d.ts.map +1 -0
- package/dist/mask/index.js +104 -0
- package/dist/mask/index.js.map +1 -0
- package/dist/mask/types.d.ts +20 -0
- package/dist/mask/types.d.ts.map +1 -0
- package/dist/menu-list/index.js +1 -1
- package/dist/modal/index.js +1 -1
- package/dist/multi-autocomplete/index.js +2 -2
- package/dist/multi-autocomplete-async/index.js +2 -2
- package/dist/multi-select/index.js +1 -1
- package/dist/number-input/index.js +2 -2
- package/dist/number-range/index.js +2 -2
- package/dist/popover/index.js +1 -1
- package/dist/select/index.js +2 -2
- package/dist/slider/index.js +1 -1
- package/dist/suggest-checklist/index.js +1 -1
- package/dist/switch/index.js +1 -1
- package/dist/table/index.js +1 -1
- package/dist/textarea/index.js +1 -1
- package/dist/time-field/index.js +1 -1
- package/dist/tooltip/index.js +1 -1
- package/package.json +11 -1
- package/src/button/docs/Description.md +9 -8
- package/src/button/docs/cssVariables.ts +1 -0
- package/src/button/types.ts +2 -0
- package/src/color-field/docs/Description.md +46 -0
- package/src/color-field/docs/Example.md +5 -0
- package/src/color-field/docs/cssVariables.ts +34 -0
- package/src/color-field/types.ts +67 -0
- package/src/color-picker/docs/Description.md +17 -36
- package/src/color-picker/docs/Example.md +1 -1
- package/src/color-picker/docs/cssVariables.ts +4 -32
- package/src/color-picker/types.ts +16 -44
- package/src/mask/docs/Description.md +48 -0
- package/src/mask/docs/Example.md +12 -0
- package/src/mask/types.ts +21 -0
- package/dist/Component-C24OpTxW.js +0 -92
- package/dist/Component-C24OpTxW.js.map +0 -1
- package/dist/color-picker/FormColorPicker.d.ts +0 -6
- package/dist/color-picker/FormColorPicker.d.ts.map +0 -1
- package/dist/color-picker/theme.d.ts.map +0 -1
|
@@ -1,347 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useState as g, useRef as C, useCallback as Fe, useEffect as re } from "react";
|
|
3
|
-
import D from "classnames";
|
|
4
|
-
import { parseColor as ie, ColorPicker as Re, DialogTrigger as $e, Button as oe, ColorSwatch as se, Popover as Ee, Dialog as Be, ColorArea as He, ColorThumb as ae, ColorSlider as Le, SliderTrack as ze, ColorSwatchPicker as Ge, ColorSwatchPickerItem as Ie } from "react-aria-components";
|
|
5
|
-
import { s as Oe } from "../index-h8z54aFR.js";
|
|
6
|
-
import { C as Ve } from "../Clear-DcxADxz6.js";
|
|
7
|
-
import { u as Ae } from "../hooks-CekMiYbX.js";
|
|
8
|
-
import { cva as Ke } from "class-variance-authority";
|
|
9
|
-
import { typographyStyles as G } from "../typography/index.js";
|
|
10
|
-
import { F as w, u as Me } from "../Component-DSAL6avh.js";
|
|
11
|
-
import { u as je, g as Ue } from "../useFieldHook-o47pjrRg.js";
|
|
12
|
-
import '../assets/index15.css';const We = "aub_styles-module_root_1a08f", Xe = "aub_styles-module_block_2b9b6", Ye = "aub_styles-module_group_842c9", qe = "aub_styles-module_swatch_536a7", Je = "aub_styles-module_clear_e0f46", Qe = "aub_styles-module_sm_81187", Ze = "aub_styles-module_md_650f8", et = "aub_styles-module_lg_10191", tt = "aub_styles-module_primary_2c33e", rt = "aub_styles-module_swatchColor_23c10", ot = "aub_styles-module_hex_bb285", st = "aub_styles-module_icon_22bf7", at = "aub_styles-module_popover_ca0ef", lt = "aub_styles-module_dialog_956ba", nt = "aub_styles-module_gestures_bdd10", ct = "aub_styles-module_area_bc0ba", it = "aub_styles-module_hue_431a1", ut = "aub_styles-module_hueTrack_aed1b", dt = "aub_styles-module_thumb_3861b", mt = "aub_styles-module_presets_b941b", ft = "aub_styles-module_preset_94276", r = {
|
|
13
|
-
root: We,
|
|
14
|
-
block: Xe,
|
|
15
|
-
group: Ye,
|
|
16
|
-
swatch: qe,
|
|
17
|
-
clear: Je,
|
|
18
|
-
sm: Qe,
|
|
19
|
-
md: Ze,
|
|
20
|
-
lg: et,
|
|
21
|
-
primary: tt,
|
|
22
|
-
swatchColor: rt,
|
|
23
|
-
hex: ot,
|
|
24
|
-
icon: st,
|
|
25
|
-
popover: at,
|
|
26
|
-
dialog: lt,
|
|
27
|
-
gestures: nt,
|
|
28
|
-
area: ct,
|
|
29
|
-
hue: it,
|
|
30
|
-
hueTrack: ut,
|
|
31
|
-
thumb: dt,
|
|
32
|
-
presets: mt,
|
|
33
|
-
preset: ft
|
|
34
|
-
}, pt = Ke(r.group, {
|
|
35
|
-
variants: {
|
|
36
|
-
size: {
|
|
37
|
-
sm: D(r.sm, G.bodyS),
|
|
38
|
-
md: D(r.md, G.bodyS),
|
|
39
|
-
lg: D(r.lg, G.bodyM)
|
|
40
|
-
},
|
|
41
|
-
variant: {
|
|
42
|
-
primary: r.primary
|
|
43
|
-
},
|
|
44
|
-
block: {
|
|
45
|
-
true: r.block,
|
|
46
|
-
false: null
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
defaultVariants: {
|
|
50
|
-
size: "md",
|
|
51
|
-
variant: "primary",
|
|
52
|
-
block: !0
|
|
53
|
-
}
|
|
54
|
-
}), N = "#808080", I = (t) => ie(t).toFormat("hsb"), ue = /^[0-9a-fA-F]+$/, ht = /^(rgb|rgba|hsl|hsla|hsb|hsba)\([^)]+\)$/i, le = (t) => {
|
|
55
|
-
try {
|
|
56
|
-
return ie(t).toString("hex").toLowerCase();
|
|
57
|
-
} catch {
|
|
58
|
-
return null;
|
|
59
|
-
}
|
|
60
|
-
}, V = (t) => {
|
|
61
|
-
const o = t.trim();
|
|
62
|
-
return o ? ue.test(o) ? le(`#${o}`) : le(o) : null;
|
|
63
|
-
}, ne = (t, o) => {
|
|
64
|
-
const n = t.trim();
|
|
65
|
-
if (!n) return o === "settle" ? "" : null;
|
|
66
|
-
const l = n.startsWith("#") ? n.slice(1) : n;
|
|
67
|
-
if (ue.test(l)) {
|
|
68
|
-
if (l.length === 6) return `#${l.toLowerCase()}`;
|
|
69
|
-
if (o === "settle" && l.length === 3) {
|
|
70
|
-
const [d, c, m] = l.toLowerCase();
|
|
71
|
-
return `#${d}${d}${c}${c}${m}${m}`;
|
|
72
|
-
}
|
|
73
|
-
return null;
|
|
74
|
-
}
|
|
75
|
-
const i = V(n);
|
|
76
|
-
return !i || o === "live" && !ht.test(n) ? null : i;
|
|
77
|
-
}, ce = (t) => {
|
|
78
|
-
if (t == null || t.trim() === "")
|
|
79
|
-
return { text: "", hex: null, unrecognized: !1 };
|
|
80
|
-
const o = V(t);
|
|
81
|
-
return o ? { text: o, hex: o, unrecognized: !1 } : { text: "", hex: null, unrecognized: !0 };
|
|
82
|
-
}, bt = (t) => {
|
|
83
|
-
if (!t?.length) return [];
|
|
84
|
-
const o = /* @__PURE__ */ new Set();
|
|
85
|
-
return t.flatMap((n) => {
|
|
86
|
-
const l = V(n);
|
|
87
|
-
return !l || o.has(l) ? [] : (o.add(l), [l]);
|
|
88
|
-
});
|
|
89
|
-
}, O = (t) => t.toString("hex").toLowerCase(), de = Oe(
|
|
90
|
-
({
|
|
91
|
-
ref: t,
|
|
92
|
-
inputRef: o,
|
|
93
|
-
size: n = "md",
|
|
94
|
-
variant: l = "primary",
|
|
95
|
-
block: i = !0,
|
|
96
|
-
invalid: d = !1,
|
|
97
|
-
disabled: c = !1,
|
|
98
|
-
clear: m = !1,
|
|
99
|
-
presets: T,
|
|
100
|
-
value: f,
|
|
101
|
-
defaultValue: F,
|
|
102
|
-
onChange: R,
|
|
103
|
-
onBlur: y,
|
|
104
|
-
className: $,
|
|
105
|
-
dataTestId: k,
|
|
106
|
-
id: E,
|
|
107
|
-
"aria-label": v,
|
|
108
|
-
"aria-labelledby": A,
|
|
109
|
-
"aria-describedby": fe,
|
|
110
|
-
"aria-invalid": K
|
|
111
|
-
}) => {
|
|
112
|
-
const { clear: pe, openPalette: he, colorCode: be, colorHue: _e, colorPalette: ge, colorPresets: Ce } = Ae(), M = f !== void 0, [ye, ke] = g(F ?? ""), p = M ? f : ye, u = ce(p), [j, h] = g(u.text), [U, B] = g(() => I(u.hex ?? N)), [ve, x] = g(!1), [W, xe] = g(0), X = C(null), Pe = Fe(
|
|
113
|
-
(e) => {
|
|
114
|
-
if (X.current = e, typeof t == "function") {
|
|
115
|
-
t(e);
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
t && (t.current = e);
|
|
119
|
-
},
|
|
120
|
-
[t]
|
|
121
|
-
), H = C(!1), P = C(!1), b = C(!1), L = C(p), Y = bt(T), q = d || K === !0 || K === "true" || u.unrecognized, z = ve ? U : u.hex, we = m && !c && (j !== "" || !!u.hex);
|
|
122
|
-
re(() => {
|
|
123
|
-
L.current = p;
|
|
124
|
-
}, [p, W]);
|
|
125
|
-
const J = (e) => B((a) => O(a) === e ? a : I(e));
|
|
126
|
-
re(() => {
|
|
127
|
-
if (H.current || b.current) return;
|
|
128
|
-
const e = ce(p);
|
|
129
|
-
h(e.text), J(e.hex ?? N), x(!1);
|
|
130
|
-
}, [p, W]);
|
|
131
|
-
const _ = (e, a) => {
|
|
132
|
-
P.current = !1, x(!!e), h(a !== void 0 && a.toLowerCase() === e ? a : e), J(e || N), L.current !== e && (L.current = e, M || ke(e), e !== p && R?.(e));
|
|
133
|
-
}, Ne = (e) => {
|
|
134
|
-
const a = O(e);
|
|
135
|
-
B(e), x(!0), h(a), b.current || _(a);
|
|
136
|
-
}, Q = (e) => {
|
|
137
|
-
b.current = !1, _(O(e));
|
|
138
|
-
}, Se = () => {
|
|
139
|
-
b.current = !1;
|
|
140
|
-
}, Z = () => {
|
|
141
|
-
b.current = !0;
|
|
142
|
-
}, ee = (e) => {
|
|
143
|
-
if (!P.current && e === u.text) return;
|
|
144
|
-
const a = ne(e, "settle");
|
|
145
|
-
if (P.current = !1, a == null) {
|
|
146
|
-
h(u.text), B(I(u.hex ?? N)), x(!!u.hex);
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
_(a);
|
|
150
|
-
}, De = (e) => {
|
|
151
|
-
const a = e.target.value;
|
|
152
|
-
P.current = !0, h(a);
|
|
153
|
-
const te = ne(a, "live");
|
|
154
|
-
te && _(te, a);
|
|
155
|
-
}, Te = (e) => {
|
|
156
|
-
e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), ee(e.currentTarget.value));
|
|
157
|
-
};
|
|
158
|
-
return /* @__PURE__ */ s(Re, { value: U, onChange: Ne, children: /* @__PURE__ */ s("div", { className: D(r.root, i && r.block, $), children: /* @__PURE__ */ S(
|
|
159
|
-
"div",
|
|
160
|
-
{
|
|
161
|
-
ref: Pe,
|
|
162
|
-
className: pt({ size: n, variant: l, block: i }),
|
|
163
|
-
"data-invalid": q || void 0,
|
|
164
|
-
"data-disabled": c || void 0,
|
|
165
|
-
"data-test-id": k,
|
|
166
|
-
children: [
|
|
167
|
-
/* @__PURE__ */ S(
|
|
168
|
-
$e,
|
|
169
|
-
{
|
|
170
|
-
onOpenChange: (e) => {
|
|
171
|
-
e || y?.();
|
|
172
|
-
},
|
|
173
|
-
children: [
|
|
174
|
-
/* @__PURE__ */ s(
|
|
175
|
-
oe,
|
|
176
|
-
{
|
|
177
|
-
className: r.swatch,
|
|
178
|
-
"aria-label": he,
|
|
179
|
-
isDisabled: c,
|
|
180
|
-
"data-empty": z ? void 0 : !0,
|
|
181
|
-
"data-test-id": "color-picker-trigger",
|
|
182
|
-
children: z ? /* @__PURE__ */ s(se, { className: r.swatchColor, color: z }) : null
|
|
183
|
-
}
|
|
184
|
-
),
|
|
185
|
-
/* @__PURE__ */ s(Ee, { className: r.popover, placement: "bottom start", triggerRef: X, children: /* @__PURE__ */ s(
|
|
186
|
-
Be,
|
|
187
|
-
{
|
|
188
|
-
className: r.dialog,
|
|
189
|
-
"aria-label": ge,
|
|
190
|
-
"data-test-id": "color-picker-dialog",
|
|
191
|
-
children: /* @__PURE__ */ S("div", { className: r.gestures, onKeyDownCapture: Se, children: [
|
|
192
|
-
/* @__PURE__ */ s(
|
|
193
|
-
He,
|
|
194
|
-
{
|
|
195
|
-
className: r.area,
|
|
196
|
-
colorSpace: "hsb",
|
|
197
|
-
xChannel: "saturation",
|
|
198
|
-
yChannel: "brightness",
|
|
199
|
-
"data-test-id": "color-picker-area",
|
|
200
|
-
onChangeEnd: Q,
|
|
201
|
-
onPointerDown: Z,
|
|
202
|
-
children: /* @__PURE__ */ s(ae, { className: r.thumb })
|
|
203
|
-
}
|
|
204
|
-
),
|
|
205
|
-
/* @__PURE__ */ s(
|
|
206
|
-
Le,
|
|
207
|
-
{
|
|
208
|
-
className: r.hue,
|
|
209
|
-
"aria-label": _e,
|
|
210
|
-
channel: "hue",
|
|
211
|
-
colorSpace: "hsb",
|
|
212
|
-
onChangeEnd: Q,
|
|
213
|
-
children: /* @__PURE__ */ s(
|
|
214
|
-
ze,
|
|
215
|
-
{
|
|
216
|
-
className: r.hueTrack,
|
|
217
|
-
onPointerDown: Z,
|
|
218
|
-
"data-test-id": "color-picker-hue",
|
|
219
|
-
children: /* @__PURE__ */ s(ae, { className: r.thumb })
|
|
220
|
-
}
|
|
221
|
-
)
|
|
222
|
-
}
|
|
223
|
-
),
|
|
224
|
-
Y.length > 0 ? /* @__PURE__ */ s(Ge, { "aria-label": Ce, className: r.presets, children: Y.map((e) => /* @__PURE__ */ s(
|
|
225
|
-
Ie,
|
|
226
|
-
{
|
|
227
|
-
className: r.preset,
|
|
228
|
-
color: e,
|
|
229
|
-
"data-test-id": `color-picker-preset-${e}`,
|
|
230
|
-
children: /* @__PURE__ */ s(se, {})
|
|
231
|
-
},
|
|
232
|
-
e
|
|
233
|
-
)) }) : null
|
|
234
|
-
] })
|
|
235
|
-
}
|
|
236
|
-
) })
|
|
237
|
-
]
|
|
238
|
-
}
|
|
239
|
-
),
|
|
240
|
-
/* @__PURE__ */ s(
|
|
241
|
-
"input",
|
|
242
|
-
{
|
|
243
|
-
ref: o,
|
|
244
|
-
id: E,
|
|
245
|
-
className: r.hex,
|
|
246
|
-
"aria-label": A ? void 0 : v ?? be,
|
|
247
|
-
"aria-labelledby": A,
|
|
248
|
-
"aria-describedby": fe,
|
|
249
|
-
"aria-invalid": q || void 0,
|
|
250
|
-
placeholder: "#RRGGBB",
|
|
251
|
-
spellCheck: !1,
|
|
252
|
-
autoComplete: "off",
|
|
253
|
-
disabled: c,
|
|
254
|
-
value: j,
|
|
255
|
-
"data-test-id": "color-picker-input",
|
|
256
|
-
onFocus: () => {
|
|
257
|
-
H.current = !0;
|
|
258
|
-
},
|
|
259
|
-
onChange: De,
|
|
260
|
-
onBlur: (e) => {
|
|
261
|
-
H.current = !1, ee(e.target.value), xe((a) => a + 1), y?.();
|
|
262
|
-
},
|
|
263
|
-
onKeyDown: Te
|
|
264
|
-
}
|
|
265
|
-
),
|
|
266
|
-
we ? /* @__PURE__ */ s(
|
|
267
|
-
oe,
|
|
268
|
-
{
|
|
269
|
-
className: r.clear,
|
|
270
|
-
"aria-label": pe,
|
|
271
|
-
"data-test-id": "color-picker-clear",
|
|
272
|
-
excludeFromTabOrder: !0,
|
|
273
|
-
onPress: () => _(""),
|
|
274
|
-
children: /* @__PURE__ */ s(Ve, { className: r.icon })
|
|
275
|
-
}
|
|
276
|
-
) : null
|
|
277
|
-
]
|
|
278
|
-
}
|
|
279
|
-
) }) });
|
|
280
|
-
}
|
|
281
|
-
);
|
|
282
|
-
de.displayName = "ColorPicker";
|
|
283
|
-
const me = ({ value: t, onChange: o, onBlur: n, ...l }) => {
|
|
284
|
-
const { controlProps: i, size: d, invalid: c, disabled: m } = Me();
|
|
285
|
-
return /* @__PURE__ */ s(
|
|
286
|
-
de,
|
|
287
|
-
{
|
|
288
|
-
...i,
|
|
289
|
-
...l,
|
|
290
|
-
size: d,
|
|
291
|
-
invalid: c,
|
|
292
|
-
disabled: m,
|
|
293
|
-
value: t,
|
|
294
|
-
onChange: o,
|
|
295
|
-
onBlur: n
|
|
296
|
-
}
|
|
297
|
-
);
|
|
298
|
-
};
|
|
299
|
-
me.displayName = "FormColorPickerControl";
|
|
300
|
-
const _t = ({
|
|
301
|
-
name: t,
|
|
302
|
-
label: o,
|
|
303
|
-
hint: n,
|
|
304
|
-
size: l = "md",
|
|
305
|
-
block: i = !0,
|
|
306
|
-
disabled: d,
|
|
307
|
-
className: c,
|
|
308
|
-
dataTestId: m,
|
|
309
|
-
...T
|
|
310
|
-
}) => {
|
|
311
|
-
const { field: f, fieldState: F, inputProps: R, onChange: y, onBlurHandler: $ } = je({ name: t }), k = Ue(F.error)?.message, E = d ?? R.disabled;
|
|
312
|
-
return /* @__PURE__ */ S(
|
|
313
|
-
w,
|
|
314
|
-
{
|
|
315
|
-
invalid: !!k,
|
|
316
|
-
disabled: E,
|
|
317
|
-
size: l,
|
|
318
|
-
block: i,
|
|
319
|
-
className: c,
|
|
320
|
-
dataTestId: m,
|
|
321
|
-
children: [
|
|
322
|
-
o ? /* @__PURE__ */ s(w.Label, { children: o }) : null,
|
|
323
|
-
/* @__PURE__ */ s(
|
|
324
|
-
me,
|
|
325
|
-
{
|
|
326
|
-
...T,
|
|
327
|
-
block: i,
|
|
328
|
-
inputRef: f.ref,
|
|
329
|
-
value: typeof f.value == "string" ? f.value : "",
|
|
330
|
-
onChange: (v) => {
|
|
331
|
-
f.onChange(v), y(t, v);
|
|
332
|
-
},
|
|
333
|
-
onBlur: () => $()
|
|
334
|
-
}
|
|
335
|
-
),
|
|
336
|
-
n ? /* @__PURE__ */ s(w.Hint, { children: n }) : null,
|
|
337
|
-
/* @__PURE__ */ s(w.Error, { children: k })
|
|
338
|
-
]
|
|
339
|
-
}
|
|
340
|
-
);
|
|
341
|
-
};
|
|
342
|
-
_t.displayName = "FormColorPicker";
|
|
1
|
+
import { C as e, t } from "../Component-DhE4a93B.js";
|
|
343
2
|
export {
|
|
344
|
-
|
|
345
|
-
|
|
3
|
+
e as ColorPicker,
|
|
4
|
+
t as toHexColor
|
|
346
5
|
};
|
|
347
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/color-picker/theme.ts","../../src/color-picker/utils.ts","../../src/color-picker/Component.tsx","../../src/color-picker/FormColorPicker.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority';\nimport cn from 'classnames';\n\nimport { typographyStyles } from '@ds/typography';\n\nimport styles from './styles.module.css';\n\nexport const colorPickerGroupVariants = cva(styles.group, {\n variants: {\n size: {\n sm: cn(styles.sm, typographyStyles.bodyS),\n md: cn(styles.md, typographyStyles.bodyS),\n lg: cn(styles.lg, typographyStyles.bodyM),\n },\n variant: {\n primary: styles.primary,\n },\n block: {\n true: styles.block,\n false: null,\n },\n },\n defaultVariants: {\n size: 'md',\n variant: 'primary',\n block: true,\n },\n});\n","import { type Color, parseColor } from 'react-aria-components';\n\n/** Draft shown in the panel when the field is empty. Never emitted. */\nexport const IDLE_DRAFT = '#808080';\n\n/** HSB color for the RAC picker, so hue survives gray values. */\nexport const toDraftColor = (hex: string): Color => parseColor(hex).toFormat('hsb');\n\nconst HEX_BODY = /^[0-9a-fA-F]+$/;\nconst COMPLETE_CSS = /^(rgb|rgba|hsl|hsla|hsb|hsba)\\([^)]+\\)$/i;\n\nexport type TCommitMode = 'live' | 'settle';\n\nconst readHex = (candidate: string): string | null => {\n try {\n return parseColor(candidate).toString('hex').toLowerCase();\n } catch {\n return null;\n }\n};\n\n/** Canonical `#rrggbb`, or `null` when the string is not a color. */\nexport const toHexColor = (value: string): string | null => {\n const trimmed = value.trim();\n\n if (!trimmed) return null;\n\n if (HEX_BODY.test(trimmed)) return readHex(`#${trimmed}`);\n\n return readHex(trimmed);\n};\n\n/**\n * Hex to publish.\n * `''` clears on settle. `null` means \"keep typing\" or \"not a color\".\n * Three-digit hex expands only on settle, so `#abcdef` can be typed.\n */\nexport const commitHexInput = (raw: string, mode: TCommitMode): string | null => {\n const trimmed = raw.trim();\n\n if (!trimmed) return mode === 'settle' ? '' : null;\n\n const body = trimmed.startsWith('#') ? trimmed.slice(1) : trimmed;\n\n if (HEX_BODY.test(body)) {\n if (body.length === 6) return `#${body.toLowerCase()}`;\n\n if (mode === 'settle' && body.length === 3) {\n const [red, green, blue] = body.toLowerCase();\n\n return `#${red}${red}${green}${green}${blue}${blue}`;\n }\n\n return null;\n }\n\n const parsed = toHexColor(trimmed);\n\n if (!parsed) return null;\n\n if (mode === 'live' && !COMPLETE_CSS.test(trimmed)) return null;\n\n return parsed;\n};\n\n/** How a stored string should look in the field before the user edits it. */\nexport const describeColorValue = (\n value: string | null | undefined\n): { text: string; hex: string | null; unrecognized: boolean } => {\n if (value == null || value.trim() === '') {\n return { text: '', hex: null, unrecognized: false };\n }\n\n const hex = toHexColor(value);\n\n if (!hex) return { text: '', hex: null, unrecognized: true };\n\n return { text: hex, hex, unrecognized: false };\n};\n\n/** Preset list as unique `#rrggbb`. Drops values that are not colors. */\nexport const validPresetHexes = (presets: readonly string[] | undefined): string[] => {\n if (!presets?.length) return [];\n\n const seen = new Set<string>();\n\n return presets.flatMap(preset => {\n const hex = toHexColor(preset);\n\n if (!hex || seen.has(hex)) return [];\n\n seen.add(hex);\n\n return [hex];\n });\n};\n","import { type ChangeEvent, type KeyboardEvent, useCallback, useEffect, useRef, useState } from 'react';\n\nimport cn from 'classnames';\nimport {\n Button as RacButton,\n ColorArea,\n ColorPicker as RacColorPicker,\n ColorSlider,\n ColorSwatch,\n ColorSwatchPicker,\n ColorSwatchPickerItem,\n ColorThumb,\n Dialog,\n DialogTrigger,\n Popover,\n SliderTrack,\n type Color,\n} from 'react-aria-components';\n\nimport { supportRef } from '@ds/common/support-ref';\n\nimport { Clear } from '@/icons';\nimport { useAuiLabels } from '@/provider';\n\nimport { colorPickerGroupVariants } from './theme';\nimport { type IColorPickerProps } from './types';\nimport { commitHexInput, describeColorValue, IDLE_DRAFT, toDraftColor, validPresetHexes } from './utils';\n\nimport styles from './styles.module.css';\n\nconst hexOf = (color: Color) => color.toString('hex').toLowerCase();\n\nexport const ColorPicker = supportRef(\n ({\n ref,\n inputRef,\n size = 'md',\n variant = 'primary',\n block = true,\n invalid = false,\n disabled = false,\n clear = false,\n presets,\n value,\n defaultValue,\n onChange,\n onBlur,\n className,\n dataTestId,\n id,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n 'aria-invalid': ariaInvalid,\n }: IColorPickerProps) => {\n const { clear: clearLabel, openPalette, colorCode, colorHue, colorPalette, colorPresets } = useAuiLabels();\n const isControlled = value !== undefined;\n const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue ?? '');\n const current = isControlled ? value : uncontrolledValue;\n const display = describeColorValue(current);\n const [text, setText] = useState(display.text);\n const [draft, setDraft] = useState<Color>(() => toDraftColor(display.hex ?? IDLE_DRAFT));\n const [previewing, setPreviewing] = useState(false);\n const [settledTick, setSettledTick] = useState(0);\n const groupRef = useRef<HTMLDivElement>(null);\n const setGroupRef = useCallback(\n (node: HTMLDivElement | null) => {\n groupRef.current = node;\n\n if (typeof ref === 'function') {\n ref(node);\n\n return;\n }\n\n if (ref) ref.current = node;\n },\n [ref]\n );\n const focusedRef = useRef(false);\n const dirtyRef = useRef(false);\n const draggingRef = useRef(false);\n const lastEmittedRef = useRef(current);\n const presetHexes = validPresetHexes(presets);\n const markedInvalid = invalid || ariaInvalid === true || ariaInvalid === 'true' || display.unrecognized;\n const swatchColor = previewing ? draft : display.hex;\n const showClear = clear && !disabled && (text !== '' || Boolean(display.hex));\n\n useEffect(() => {\n lastEmittedRef.current = current;\n }, [current, settledTick]);\n\n // Keeps the HSB draft when it already matches `hex`, so hue survives gray colors.\n const syncDraft = (hex: string) => setDraft(prev => (hexOf(prev) === hex ? prev : toDraftColor(hex)));\n\n useEffect(() => {\n if (focusedRef.current || draggingRef.current) return;\n\n const next = describeColorValue(current);\n\n setText(next.text);\n syncDraft(next.hex ?? IDLE_DRAFT);\n setPreviewing(false);\n }, [current, settledTick]);\n\n const emit = (hex: string, typed?: string) => {\n dirtyRef.current = false;\n setPreviewing(Boolean(hex));\n setText(typed !== undefined && typed.toLowerCase() === hex ? typed : hex);\n syncDraft(hex || IDLE_DRAFT);\n\n if (lastEmittedRef.current === hex) return;\n\n lastEmittedRef.current = hex;\n\n if (!isControlled) setUncontrolledValue(hex);\n\n if (hex === current) return;\n\n onChange?.(hex);\n };\n\n const onPickerChange = (color: Color) => {\n const hex = hexOf(color);\n\n setDraft(color);\n setPreviewing(true);\n setText(hex);\n\n if (!draggingRef.current) emit(hex);\n };\n\n const finishGesture = (color: Color) => {\n draggingRef.current = false;\n emit(hexOf(color));\n };\n\n const releasePointerGesture = () => {\n draggingRef.current = false;\n };\n\n const startGesture = () => {\n draggingRef.current = true;\n };\n\n const settle = (raw: string) => {\n if (!dirtyRef.current && raw === display.text) return;\n\n const committed = commitHexInput(raw, 'settle');\n\n dirtyRef.current = false;\n\n if (committed == null) {\n setText(display.text);\n setDraft(toDraftColor(display.hex ?? IDLE_DRAFT));\n setPreviewing(Boolean(display.hex));\n\n return;\n }\n\n emit(committed);\n };\n\n const onInputChange = (event: ChangeEvent<HTMLInputElement>) => {\n const next = event.target.value;\n\n dirtyRef.current = true;\n setText(next);\n\n const committed = commitHexInput(next, 'live');\n\n if (committed) emit(committed, next);\n };\n\n const onInputKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key !== 'Enter') return;\n\n event.preventDefault();\n event.stopPropagation();\n settle(event.currentTarget.value);\n };\n\n return (\n <RacColorPicker value={draft} onChange={onPickerChange}>\n <div className={cn(styles.root, block && styles.block, className)}>\n <div\n ref={setGroupRef}\n className={colorPickerGroupVariants({ size, variant, block })}\n data-invalid={markedInvalid || undefined}\n data-disabled={disabled || undefined}\n data-test-id={dataTestId}\n >\n <DialogTrigger\n onOpenChange={open => {\n if (!open) onBlur?.();\n }}\n >\n <RacButton\n className={styles.swatch}\n aria-label={openPalette}\n isDisabled={disabled}\n data-empty={swatchColor ? undefined : true}\n data-test-id=\"color-picker-trigger\"\n >\n {swatchColor ? (\n <ColorSwatch className={styles.swatchColor} color={swatchColor} />\n ) : null}\n </RacButton>\n <Popover className={styles.popover} placement=\"bottom start\" triggerRef={groupRef}>\n <Dialog\n className={styles.dialog}\n aria-label={colorPalette}\n data-test-id=\"color-picker-dialog\"\n >\n <div className={styles.gestures} onKeyDownCapture={releasePointerGesture}>\n <ColorArea\n className={styles.area}\n colorSpace=\"hsb\"\n xChannel=\"saturation\"\n yChannel=\"brightness\"\n data-test-id=\"color-picker-area\"\n onChangeEnd={finishGesture}\n onPointerDown={startGesture}\n >\n <ColorThumb className={styles.thumb} />\n </ColorArea>\n <ColorSlider\n className={styles.hue}\n aria-label={colorHue}\n channel=\"hue\"\n colorSpace=\"hsb\"\n onChangeEnd={finishGesture}\n >\n <SliderTrack\n className={styles.hueTrack}\n onPointerDown={startGesture}\n data-test-id=\"color-picker-hue\"\n >\n <ColorThumb className={styles.thumb} />\n </SliderTrack>\n </ColorSlider>\n {presetHexes.length > 0 ? (\n <ColorSwatchPicker aria-label={colorPresets} className={styles.presets}>\n {presetHexes.map(hex => (\n <ColorSwatchPickerItem\n key={hex}\n className={styles.preset}\n color={hex}\n data-test-id={`color-picker-preset-${hex}`}\n >\n <ColorSwatch />\n </ColorSwatchPickerItem>\n ))}\n </ColorSwatchPicker>\n ) : null}\n </div>\n </Dialog>\n </Popover>\n </DialogTrigger>\n <input\n ref={inputRef}\n id={id}\n className={styles.hex}\n aria-label={ariaLabelledby ? undefined : (ariaLabel ?? colorCode)}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n aria-invalid={markedInvalid || undefined}\n placeholder=\"#RRGGBB\"\n spellCheck={false}\n autoComplete=\"off\"\n disabled={disabled}\n value={text}\n data-test-id=\"color-picker-input\"\n onFocus={() => {\n focusedRef.current = true;\n }}\n onChange={onInputChange}\n onBlur={event => {\n focusedRef.current = false;\n settle(event.target.value);\n setSettledTick(tick => tick + 1);\n onBlur?.();\n }}\n onKeyDown={onInputKeyDown}\n />\n {showClear ? (\n <RacButton\n className={styles.clear}\n aria-label={clearLabel}\n data-test-id=\"color-picker-clear\"\n excludeFromTabOrder\n onPress={() => emit('')}\n >\n <Clear className={styles.icon} />\n </RacButton>\n ) : null}\n </div>\n </div>\n </RacColorPicker>\n );\n }\n);\n\nColorPicker.displayName = 'ColorPicker';\n","import { Field, useField } from '@/field';\nimport { useFieldHook } from '@/form/hooks/useFieldHook';\nimport { getError } from '@/form/utils';\n\nimport { ColorPicker } from './Component';\nimport { type IColorPickerProps, type IFormColorPickerProps } from './types';\n\ntype TFormColorPickerControlProps = Omit<IColorPickerProps, 'size' | 'invalid' | 'disabled' | 'value' | 'onChange'> & {\n value: string;\n onChange: (value: string) => void;\n};\n\nconst FormColorPickerControl = ({ value, onChange, onBlur, ...props }: TFormColorPickerControlProps) => {\n const { controlProps, size, invalid, disabled } = useField();\n\n return (\n <ColorPicker\n {...controlProps}\n {...props}\n size={size}\n invalid={invalid}\n disabled={disabled}\n value={value}\n onChange={onChange}\n onBlur={onBlur}\n />\n );\n};\n\nFormColorPickerControl.displayName = 'FormColorPickerControl';\n\nexport const FormColorPicker = ({\n name,\n label,\n hint,\n size = 'md',\n block = true,\n disabled,\n className,\n dataTestId,\n ...inputProps\n}: IFormColorPickerProps) => {\n const { field, fieldState, inputProps: rhfInputProps, onChange, onBlurHandler } = useFieldHook({ name });\n const error = getError(fieldState.error)?.message;\n const isDisabled = disabled ?? rhfInputProps.disabled;\n\n return (\n <Field\n invalid={Boolean(error)}\n disabled={isDisabled}\n size={size}\n block={block}\n className={className}\n dataTestId={dataTestId}\n >\n {label ? <Field.Label>{label}</Field.Label> : null}\n <FormColorPickerControl\n {...inputProps}\n block={block}\n inputRef={field.ref}\n value={typeof field.value === 'string' ? field.value : ''}\n onChange={next => {\n field.onChange(next);\n onChange(name, next as never);\n }}\n onBlur={() => onBlurHandler()}\n />\n {hint ? <Field.Hint>{hint}</Field.Hint> : null}\n <Field.Error>{error}</Field.Error>\n </Field>\n );\n};\n\nFormColorPicker.displayName = 'FormColorPicker';\n"],"names":["colorPickerGroupVariants","cva","styles","cn","typographyStyles","IDLE_DRAFT","toDraftColor","hex","parseColor","HEX_BODY","COMPLETE_CSS","readHex","candidate","toHexColor","value","trimmed","commitHexInput","raw","mode","body","red","green","blue","parsed","describeColorValue","validPresetHexes","presets","seen","preset","hexOf","color","ColorPicker","supportRef","ref","inputRef","size","variant","block","invalid","disabled","clear","defaultValue","onChange","onBlur","className","dataTestId","id","ariaLabel","ariaLabelledby","ariaDescribedby","ariaInvalid","clearLabel","openPalette","colorCode","colorHue","colorPalette","colorPresets","useAuiLabels","isControlled","uncontrolledValue","setUncontrolledValue","useState","current","display","text","setText","draft","setDraft","previewing","setPreviewing","settledTick","setSettledTick","groupRef","useRef","setGroupRef","useCallback","node","focusedRef","dirtyRef","draggingRef","lastEmittedRef","presetHexes","markedInvalid","swatchColor","showClear","useEffect","syncDraft","prev","next","emit","typed","onPickerChange","finishGesture","releasePointerGesture","startGesture","settle","committed","onInputChange","event","onInputKeyDown","RacColorPicker","jsx","jsxs","DialogTrigger","open","RacButton","ColorSwatch","Popover","Dialog","ColorArea","ColorThumb","ColorSlider","SliderTrack","ColorSwatchPicker","ColorSwatchPickerItem","tick","Clear","FormColorPickerControl","props","controlProps","useField","FormColorPicker","name","label","hint","inputProps","field","fieldState","rhfInputProps","onBlurHandler","useFieldHook","error","getError","isDisabled","Field"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAOaA,KAA2BC,GAAIC,EAAO,OAAO;AAAA,EACtD,UAAU;AAAA,IACN,MAAM;AAAA,MACF,IAAIC,EAAGD,EAAO,IAAIE,EAAiB,KAAK;AAAA,MACxC,IAAID,EAAGD,EAAO,IAAIE,EAAiB,KAAK;AAAA,MACxC,IAAID,EAAGD,EAAO,IAAIE,EAAiB,KAAK;AAAA,IAAA;AAAA,IAE5C,SAAS;AAAA,MACL,SAASF,EAAO;AAAA,IAAA;AAAA,IAEpB,OAAO;AAAA,MACH,MAAMA,EAAO;AAAA,MACb,OAAO;AAAA,IAAA;AAAA,EACX;AAAA,EAEJ,iBAAiB;AAAA,IACb,MAAM;AAAA,IACN,SAAS;AAAA,IACT,OAAO;AAAA,EAAA;AAEf,CAAC,GCxBYG,IAAa,WAGbC,IAAe,CAACC,MAAuBC,GAAWD,CAAG,EAAE,SAAS,KAAK,GAE5EE,KAAW,kBACXC,KAAe,4CAIfC,KAAU,CAACC,MAAqC;AAClD,MAAI;AACA,WAAOJ,GAAWI,CAAS,EAAE,SAAS,KAAK,EAAE,YAAA;AAAA,EACjD,QAAQ;AACJ,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AO;AAAA,EACP,OAAAE,IAAQ;AAAA,EACR,UAAAE;AAAA,EACA,WAAAK;AAAA,EACA,YAAAC;AAAA,EACA,GAAGgF;AACP,MAA6B;AACzB,QAAM,EAAE,OAAAC,GAAO,YAAAC,GAAY,YAAYC,GAAe,UAAAtF,GAAU,eAAAuF,MAAkBC,GAAa,EAAE,MAAAR,GAAM,GACjGS,IAAQC,GAASL,EAAW,KAAK,GAAG,SACpCM,IAAa9F,KAAYyF,EAAc;AAE7C,SACI,gBAAA1B;AAAA,IAACgC;AAAA,IAAA;AAAA,MACG,SAAS,EAAQH;AAAA,MACjB,UAAUE;AAAA,MACV,MAAAlG;AAAA,MACA,OAAAE;AAAA,MACA,WAAAO;AAAA,MACA,YAAAC;AAAA,MAEC,UAAA;AAAA,QAAA8E,IAAQ,gBAAAtB,EAACiC,EAAM,OAAN,EAAa,aAAM,IAAiB;AAAA,QAC9C,gBAAAjC;AAAA,UAACgB;AAAA,UAAA;AAAA,YACI,GAAGQ;AAAA,YACJ,OAAAxF;AAAA,YACA,UAAUyF,EAAM;AAAA,YAChB,OAAO,OAAOA,EAAM,SAAU,WAAWA,EAAM,QAAQ;AAAA,YACvD,UAAU,CAAAtC,MAAQ;AACd,cAAAsC,EAAM,SAAStC,CAAI,GACnB9C,EAASgF,GAAMlC,CAAa;AAAA,YAChC;AAAA,YACA,QAAQ,MAAMyC,EAAA;AAAA,UAAc;AAAA,QAAA;AAAA,QAE/BL,IAAO,gBAAAvB,EAACiC,EAAM,MAAN,EAAY,aAAK,IAAgB;AAAA,QAC1C,gBAAAjC,EAACiC,EAAM,OAAN,EAAa,UAAAH,EAAA,CAAM;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGhC;AAEAV,GAAgB,cAAc;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,58 +1,37 @@
|
|
|
1
1
|
import { Ref } from 'react';
|
|
2
2
|
import { IDataTestIdProps } from '../ds/common/index.js';
|
|
3
|
-
import { IFieldStateProps } from '../field/types';
|
|
4
|
-
import { IFormFieldLayoutProps } from '../form/types';
|
|
5
|
-
/** ColorPicker size. */
|
|
6
|
-
export type TColorPickerSize = 'sm' | 'md' | 'lg';
|
|
7
|
-
/** Visual variant. */
|
|
8
|
-
export type TColorPickerVariant = 'primary';
|
|
9
|
-
/** Theme inputs. */
|
|
10
|
-
export interface IColorPickerThemeProps {
|
|
11
|
-
/** Control size. Inside Field, inherits `Field.size` when omitted. */
|
|
12
|
-
size?: TColorPickerSize;
|
|
13
|
-
/** Visual variant. */
|
|
14
|
-
variant?: TColorPickerVariant;
|
|
15
|
-
}
|
|
16
3
|
/** Own / chrome props (not from RAC). */
|
|
17
4
|
export interface IColorPickerOwnProps extends IDataTestIdProps {
|
|
18
|
-
/** Clear button for the current value. */
|
|
19
|
-
clear?: boolean;
|
|
20
5
|
/**
|
|
21
|
-
* Preset swatches
|
|
6
|
+
* Preset swatches.
|
|
22
7
|
* Values that are not colors are dropped. No row when empty.
|
|
23
8
|
*/
|
|
24
9
|
presets?: string[];
|
|
25
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Hue in degrees for a gray color.
|
|
12
|
+
* The field keeps it so the slider survives a closed popover.
|
|
13
|
+
*/
|
|
14
|
+
hue?: number;
|
|
15
|
+
/** Class name on the palette root. */
|
|
26
16
|
className?: string;
|
|
27
|
-
/** Ref to the
|
|
17
|
+
/** Ref to the palette root (React 19 prop). */
|
|
28
18
|
ref?: Ref<HTMLDivElement>;
|
|
29
|
-
/** Ref to the hex input (React 19 prop). */
|
|
30
|
-
inputRef?: Ref<HTMLInputElement>;
|
|
31
|
-
id?: string;
|
|
32
19
|
'aria-label'?: string;
|
|
33
|
-
'aria-labelledby'?: string;
|
|
34
|
-
'aria-describedby'?: string;
|
|
35
|
-
'aria-invalid'?: boolean | 'true' | 'false';
|
|
36
20
|
}
|
|
37
21
|
/** Control state (our names, not RAC). */
|
|
38
22
|
export interface IColorPickerControlProps {
|
|
39
|
-
/** `#rrggbb` or `''`. */
|
|
23
|
+
/** `#rrggbb` or `''`. Empty shows a gray draft and is not emitted. */
|
|
40
24
|
value?: string;
|
|
41
25
|
/** `#rrggbb` or `''`. */
|
|
42
26
|
defaultValue?: string;
|
|
43
|
-
/**
|
|
27
|
+
/** Canonical `#rrggbb`. Empty is never emitted. */
|
|
44
28
|
onChange?: (value: string) => void;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
/** Content slice for FormColorPicker. */
|
|
52
|
-
export interface IColorPickerContentProps {
|
|
53
|
-
clear?: boolean;
|
|
54
|
-
presets?: string[];
|
|
29
|
+
/** Live `#rrggbb` while the pointer is down. Not a commit. */
|
|
30
|
+
onPreview?: (value: string) => void;
|
|
31
|
+
/** Hue channel after a palette change. */
|
|
32
|
+
onHueChange?: (hue: number) => void;
|
|
33
|
+
disabled?: boolean;
|
|
55
34
|
}
|
|
56
|
-
export interface
|
|
35
|
+
export interface IColorPickerProps extends IColorPickerOwnProps, IColorPickerControlProps {
|
|
57
36
|
}
|
|
58
37
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/color-picker/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/color-picker/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,yCAAyC;AACzC,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC1D;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,0CAA0C;AAC1C,MAAM,WAAW,wBAAwB;IACrC,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yBAAyB;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,8DAA8D;IAC9D,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,0CAA0C;IAC1C,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,iBAAkB,SAAQ,oBAAoB,EAAE,wBAAwB;CAAG"}
|
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
import { Color } from 'react-aria-components';
|
|
2
|
-
/** Draft shown in the panel when the
|
|
2
|
+
/** Draft shown in the panel when the value is empty. Never emitted. */
|
|
3
3
|
export declare const IDLE_DRAFT = "#808080";
|
|
4
4
|
/** HSB color for the RAC picker, so hue survives gray values. */
|
|
5
5
|
export declare const toDraftColor: (hex: string) => Color;
|
|
6
|
-
export
|
|
7
|
-
/** Canonical `#rrggbb`, or `null` when the string is not a color. */
|
|
8
|
-
export declare const toHexColor: (value: string) => string | null;
|
|
6
|
+
export declare const hexOf: (color: Color) => string;
|
|
9
7
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* Three-digit hex expands only on settle, so `#abcdef` can be typed.
|
|
8
|
+
* Gray hex has no hue. Keep a hue the field stored across a remount.
|
|
9
|
+
* Chromatic colors already encode hue, so the stored value is ignored.
|
|
13
10
|
*/
|
|
14
|
-
export declare const
|
|
15
|
-
/**
|
|
16
|
-
export declare const
|
|
17
|
-
text: string;
|
|
18
|
-
hex: string | null;
|
|
19
|
-
unrecognized: boolean;
|
|
20
|
-
};
|
|
11
|
+
export declare const withStoredHue: (color: Color, hue: number | undefined) => Color;
|
|
12
|
+
/** Canonical `#rrggbb`, or `null` when the string is not a color. */
|
|
13
|
+
export declare const toHexColor: (value: string) => string | null;
|
|
21
14
|
/** Preset list as unique `#rrggbb`. Drops values that are not colors. */
|
|
22
15
|
export declare const validPresetHexes: (presets: readonly string[] | undefined) => string[];
|
|
23
16
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/color-picker/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAc,MAAM,uBAAuB,CAAC;AAE/D,uEAAuE;AACvE,eAAO,MAAM,UAAU,YAAY,CAAC;AAEpC,iEAAiE;AACjE,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,KAAG,KAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/color-picker/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAc,MAAM,uBAAuB,CAAC;AAE/D,uEAAuE;AACvE,eAAO,MAAM,UAAU,YAAY,CAAC;AAEpC,iEAAiE;AACjE,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,KAAG,KAAwC,CAAC;AAEpF,eAAO,MAAM,KAAK,GAAI,OAAO,KAAK,WAAwC,CAAC;AAE3E;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,KAAK,EAAE,KAAK,MAAM,GAAG,SAAS,KAAG,KAMrE,CAAC;AAYF,qEAAqE;AACrE,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,KAAG,MAAM,GAAG,IAQnD,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,gBAAgB,GAAI,SAAS,SAAS,MAAM,EAAE,GAAG,SAAS,KAAG,MAAM,EAc/E,CAAC"}
|
|
@@ -6,7 +6,7 @@ import { typographyStyles as $ } from "../typography/index.js";
|
|
|
6
6
|
import { C as D } from "../Check-deng4Zns.js";
|
|
7
7
|
import { C as V } from "../Copy-DBU7bgFo.js";
|
|
8
8
|
import { u as q } from "../hooks-CekMiYbX.js";
|
|
9
|
-
import { T as y } from "../Component-
|
|
9
|
+
import { T as y } from "../Component-uHkw3SDR.js";
|
|
10
10
|
import '../assets/index2.css';const z = "aub_styles-module_root_c67e4", G = "aub_styles-module_icon_e7237", g = {
|
|
11
11
|
root: z,
|
|
12
12
|
icon: G
|
package/dist/data-table/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as C, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useContext as x, createContext as N, Children as y, isValidElement as h, useMemo as _ } from "react";
|
|
3
3
|
import { s as F } from "../index-h8z54aFR.js";
|
|
4
|
-
import { T as t } from "../Component-
|
|
4
|
+
import { T as t } from "../Component-CBnhxD86.js";
|
|
5
5
|
import A from "classnames";
|
|
6
6
|
import { M as P } from "../SortDescending-DziKhSYN.js";
|
|
7
7
|
import { u as R } from "../hooks-CekMiYbX.js";
|
|
@@ -10,7 +10,7 @@ import { C as _e } from "../Clear-DcxADxz6.js";
|
|
|
10
10
|
import { u as ye } from "../hooks-CekMiYbX.js";
|
|
11
11
|
import { cva as fe } from "class-variance-authority";
|
|
12
12
|
import { typographyStyles as O } from "../typography/index.js";
|
|
13
|
-
import { F as N, u as he } from "../Component-
|
|
13
|
+
import { F as N, u as he } from "../Component-BPN5FgKq.js";
|
|
14
14
|
import { u as De, g as ge } from "../useFieldHook-o47pjrRg.js";
|
|
15
15
|
import '../assets/index16.css';const K = ({ scrollToDate: o, className: r, autoFocusDay: s = !1 }) => {
|
|
16
16
|
const { months: m, viewportRef: c, setMonthEl: d, scrollToMonth: p } = ce(o), i = Q(Z), t = ee(ae), b = M(i?.value ?? t?.value ?? null), y = M(t?.minValue ?? null), f = M(t?.maxValue ?? null), v = !!t?.isDisabled, h = t?.isDateUnavailable ? (n) => !!t.isDateUnavailable?.(n) : void 0, _ = (n) => {
|
|
@@ -10,7 +10,7 @@ import { C as Ve } from "../Clear-DcxADxz6.js";
|
|
|
10
10
|
import { u as Se } from "../hooks-CekMiYbX.js";
|
|
11
11
|
import { cva as Be } from "class-variance-authority";
|
|
12
12
|
import { typographyStyles as J } from "../typography/index.js";
|
|
13
|
-
import { F as w, u as Me } from "../Component-
|
|
13
|
+
import { F as w, u as Me } from "../Component-BPN5FgKq.js";
|
|
14
14
|
import { u as Ae, g as Le } from "../useFieldHook-o47pjrRg.js";
|
|
15
15
|
import '../assets/index21.css';const ce = ({ scrollToDate: e, className: r, autoFocusDay: c = !1 }) => {
|
|
16
16
|
const { months: d, viewportRef: s, setMonthEl: p, scrollToMonth: b } = Re(e), l = fe(be), i = ge(_e), [u, C] = L(null), [P, R] = L(null), k = l?.value ?? i?.value ?? null, _ = M(k?.start ?? null), E = M(k?.end ?? null), y = M(i?.minValue ?? null), U = M(i?.maxValue ?? null), K = !!i?.isDisabled, I = i?.isDateUnavailable ? (t) => !!i.isDateUnavailable?.(t) : void 0, T = (t) => {
|
package/dist/drawer/index.js
CHANGED
package/dist/dropzone/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { useState as re, useEffect as le, useRef as L, useMemo as st, useLayoutE
|
|
|
3
3
|
import ie from "classnames";
|
|
4
4
|
import { s as at } from "../index-h8z54aFR.js";
|
|
5
5
|
import { typographyStyles as he } from "../typography/index.js";
|
|
6
|
-
import { B as Ke } from "../Component-
|
|
6
|
+
import { B as Ke } from "../Component-DlBYWjUa.js";
|
|
7
7
|
import { T as lt, I as wt, F as St, U as Nt, L as Dt } from "../Upload-Bi4Xl-j5.js";
|
|
8
8
|
import { u as Oe } from "../hooks-CekMiYbX.js";
|
|
9
9
|
import { useDropzone as Rt } from "react-dropzone";
|
|
@@ -13,7 +13,7 @@ import { C as Ct } from "../Check-deng4Zns.js";
|
|
|
13
13
|
import "react-aria";
|
|
14
14
|
import { cva as At } from "class-variance-authority";
|
|
15
15
|
import { useFormContext as Mt } from "react-hook-form";
|
|
16
|
-
import { F as xe, u as Bt } from "../Component-
|
|
16
|
+
import { F as xe, u as Bt } from "../Component-BPN5FgKq.js";
|
|
17
17
|
import { u as xt, g as jt } from "../useFieldHook-o47pjrRg.js";
|
|
18
18
|
import '../assets/index32.css';const Tt = "aub_styles-module_action_0905b", Ut = "aub_styles-module_text_c6aa5", Ot = "aub_styles-module_actionIcon_35d84", qt = "aub_styles-module_actionLabel_1de4c", je = {
|
|
19
19
|
action: Tt,
|
package/dist/field/index.js
CHANGED
package/dist/input/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { I as x } from "../Component-
|
|
1
|
+
import { I as x } from "../Component-BuFsNZAH.js";
|
|
2
2
|
import { jsxs as B, jsx as r } from "react/jsx-runtime";
|
|
3
3
|
import "react";
|
|
4
4
|
import { s as C } from "../index-h8z54aFR.js";
|
|
5
|
-
import { F as s, u as O } from "../Component-
|
|
5
|
+
import { F as s, u as O } from "../Component-BPN5FgKq.js";
|
|
6
6
|
import { u as P, g as j } from "../useFieldHook-o47pjrRg.js";
|
|
7
7
|
const D = C((i) => {
|
|
8
8
|
const { controlProps: o, size: e, invalid: l, disabled: n } = O();
|
package/dist/link/index.js
CHANGED