@ensi-platform/admin-ui 0.9.0 → 0.11.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/{Component-C6mp0LOp.js → Component-6rieHJdg.js} +4 -4
- package/dist/{Component-C6mp0LOp.js.map → Component-6rieHJdg.js.map} +1 -1
- package/dist/{Component-BRHoDRtF.js → Component-BH5skHn_.js} +3 -3
- package/dist/{Component-BRHoDRtF.js.map → Component-BH5skHn_.js.map} +1 -1
- package/dist/{Component-D310jlAj.js → Component-BZqLGwzc.js} +3 -3
- package/dist/{Component-D310jlAj.js.map → Component-BZqLGwzc.js.map} +1 -1
- package/dist/{Component-CBWeJZfB.js → Component-C24OpTxW.js} +2 -2
- package/dist/{Component-CBWeJZfB.js.map → Component-C24OpTxW.js.map} +1 -1
- package/dist/{Component-DU3MeOen.js → Component-C4vHIDMZ.js} +4 -4
- package/dist/{Component-DU3MeOen.js.map → Component-C4vHIDMZ.js.map} +1 -1
- package/dist/{Component-B73be-FU.js → Component-CkazNd13.js} +3 -3
- package/dist/{Component-B73be-FU.js.map → Component-CkazNd13.js.map} +1 -1
- package/dist/{Component-uHkw3SDR.js → Component-CzwTENBM.js} +2 -2
- package/dist/{Component-uHkw3SDR.js.map → Component-CzwTENBM.js.map} +1 -1
- package/dist/{Component-BnSNDZFt.js → Component-DH7wdC3G.js} +4 -4
- package/dist/{Component-BnSNDZFt.js.map → Component-DH7wdC3G.js.map} +1 -1
- package/dist/{Component-CIxKpL6s.js → Component-DOlDNQnu.js} +4 -4
- package/dist/{Component-CIxKpL6s.js.map → Component-DOlDNQnu.js.map} +1 -1
- package/dist/{Component-BPN5FgKq.js → Component-DSAL6avh.js} +2 -2
- package/dist/{Component-BPN5FgKq.js.map → Component-DSAL6avh.js.map} +1 -1
- package/dist/{Component-ZIAMtMpP.js → Component-DpACJ8IJ.js} +3 -3
- package/dist/{Component-ZIAMtMpP.js.map → Component-DpACJ8IJ.js.map} +1 -1
- package/dist/{Component-qJGssCB4.js → Component-IFlvrceZ.js} +6 -6
- package/dist/{Component-qJGssCB4.js.map → Component-IFlvrceZ.js.map} +1 -1
- package/dist/{Component-B1piMJHv.js → Component-MSGhHMYk.js} +2 -2
- package/dist/{Component-B1piMJHv.js.map → Component-MSGhHMYk.js.map} +1 -1
- package/dist/Component-uzbYiLD9.js +58 -0
- package/dist/Component-uzbYiLD9.js.map +1 -0
- package/dist/Upload-Bi4Xl-j5.js +120 -0
- package/dist/Upload-Bi4Xl-j5.js.map +1 -0
- package/dist/action-popup/index.js +3 -3
- package/dist/active-filters/index.js +2 -2
- package/dist/arrangement-settings/index.js +4 -4
- 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/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/assets/index16.css +1 -1
- package/dist/assets/index17.css +1 -1
- package/dist/assets/index18.css +1 -1
- package/dist/assets/index19.css +1 -1
- package/dist/assets/index20.css +1 -1
- package/dist/assets/index21.css +1 -1
- package/dist/assets/index22.css +1 -1
- package/dist/assets/index23.css +1 -1
- package/dist/assets/index24.css +1 -1
- package/dist/assets/index25.css +1 -1
- package/dist/assets/index26.css +1 -1
- package/dist/assets/index27.css +1 -1
- package/dist/assets/index28.css +1 -1
- package/dist/assets/index29.css +1 -1
- package/dist/assets/index30.css +1 -1
- package/dist/assets/index31.css +1 -1
- package/dist/assets/index32.css +1 -0
- package/dist/assets/index33.css +1 -0
- package/dist/assets/index4.css +1 -1
- package/dist/assets/index8.css +1 -1
- package/dist/assets/index9.css +1 -1
- package/dist/assets/theme2.css +1 -0
- package/dist/autocomplete/index.js +3 -3
- package/dist/autocomplete-async/index.js +3 -3
- package/dist/bottom-sheet/index.js +2 -2
- package/dist/button/index.js +1 -1
- package/dist/cascade-menu/index.js +4 -4
- package/dist/checkbox/index.js +3 -3
- package/dist/checkbox-group/index.js +2 -2
- package/dist/color-picker/Component.d.ts +5 -0
- package/dist/color-picker/Component.d.ts.map +1 -0
- package/dist/color-picker/FormColorPicker.d.ts +6 -0
- package/dist/color-picker/FormColorPicker.d.ts.map +1 -0
- package/dist/color-picker/index.d.ts +4 -0
- package/dist/color-picker/index.d.ts.map +1 -0
- package/dist/color-picker/index.js +347 -0
- package/dist/color-picker/index.js.map +1 -0
- package/dist/color-picker/theme.d.ts +6 -0
- package/dist/color-picker/theme.d.ts.map +1 -0
- package/dist/color-picker/types.d.ts +58 -0
- package/dist/color-picker/types.d.ts.map +1 -0
- package/dist/color-picker/utils.d.ts +23 -0
- package/dist/color-picker/utils.d.ts.map +1 -0
- package/dist/combobox/index.js +4 -4
- package/dist/context-menu/index.js +1 -1
- package/dist/copy-button/index.js +2 -2
- package/dist/data-table/index.js +3 -3
- package/dist/date-picker/index.js +5 -5
- package/dist/date-range-picker/index.js +5 -5
- package/dist/drawer/index.js +1 -1
- package/dist/dropzone/Component.d.ts +14 -0
- package/dist/dropzone/Component.d.ts.map +1 -0
- package/dist/dropzone/FormDropzone.d.ts +6 -0
- package/dist/dropzone/FormDropzone.d.ts.map +1 -0
- package/dist/dropzone/__tests__/helpers.d.ts +37 -0
- package/dist/dropzone/__tests__/helpers.d.ts.map +1 -0
- package/dist/dropzone/components/Action/index.d.ts +14 -0
- package/dist/dropzone/components/Action/index.d.ts.map +1 -0
- package/dist/dropzone/components/ActionSlot/index.d.ts +10 -0
- package/dist/dropzone/components/ActionSlot/index.d.ts.map +1 -0
- package/dist/dropzone/components/FileCopy/index.d.ts +7 -0
- package/dist/dropzone/components/FileCopy/index.d.ts.map +1 -0
- package/dist/dropzone/components/FileListDrag/index.d.ts +11 -0
- package/dist/dropzone/components/FileListDrag/index.d.ts.map +1 -0
- package/dist/dropzone/components/FileRows/index.d.ts +9 -0
- package/dist/dropzone/components/FileRows/index.d.ts.map +1 -0
- package/dist/dropzone/components/FileSkeletons/index.d.ts +8 -0
- package/dist/dropzone/components/FileSkeletons/index.d.ts.map +1 -0
- package/dist/dropzone/components/GridItem/index.d.ts +7 -0
- package/dist/dropzone/components/GridItem/index.d.ts.map +1 -0
- package/dist/dropzone/components/GridList/index.d.ts +7 -0
- package/dist/dropzone/components/GridList/index.d.ts.map +1 -0
- package/dist/dropzone/components/Grip/index.d.ts +7 -0
- package/dist/dropzone/components/Grip/index.d.ts.map +1 -0
- package/dist/dropzone/components/Item/index.d.ts +7 -0
- package/dist/dropzone/components/Item/index.d.ts.map +1 -0
- package/dist/dropzone/components/ItemRoot/index.d.ts +8 -0
- package/dist/dropzone/components/ItemRoot/index.d.ts.map +1 -0
- package/dist/dropzone/components/List/index.d.ts +7 -0
- package/dist/dropzone/components/List/index.d.ts.map +1 -0
- package/dist/dropzone/components/Preview/index.d.ts +6 -0
- package/dist/dropzone/components/Preview/index.d.ts.map +1 -0
- package/dist/dropzone/components/Progress/index.d.ts +7 -0
- package/dist/dropzone/components/Progress/index.d.ts.map +1 -0
- package/dist/dropzone/components/Quota/index.d.ts +9 -0
- package/dist/dropzone/components/Quota/index.d.ts.map +1 -0
- package/dist/dropzone/components/SelectionMark/index.d.ts +5 -0
- package/dist/dropzone/components/SelectionMark/index.d.ts.map +1 -0
- package/dist/dropzone/components/TypeMark/index.d.ts +5 -0
- package/dist/dropzone/components/TypeMark/index.d.ts.map +1 -0
- package/dist/dropzone/components/Zone/index.d.ts +34 -0
- package/dist/dropzone/components/Zone/index.d.ts.map +1 -0
- package/dist/dropzone/components/ZoneSkeleton/index.d.ts +3 -0
- package/dist/dropzone/components/ZoneSkeleton/index.d.ts.map +1 -0
- package/dist/dropzone/hooks/useDropzoneFiles.d.ts +30 -0
- package/dist/dropzone/hooks/useDropzoneFiles.d.ts.map +1 -0
- package/dist/dropzone/hooks/useDropzoneFocus.d.ts +18 -0
- package/dist/dropzone/hooks/useDropzoneFocus.d.ts.map +1 -0
- package/dist/dropzone/hooks/useDropzoneSelection.d.ts +15 -0
- package/dist/dropzone/hooks/useDropzoneSelection.d.ts.map +1 -0
- package/dist/dropzone/hooks/useDropzoneUploads.d.ts +27 -0
- package/dist/dropzone/hooks/useDropzoneUploads.d.ts.map +1 -0
- package/dist/dropzone/hooks/useFileList/index.d.ts +23 -0
- package/dist/dropzone/hooks/useFileList/index.d.ts.map +1 -0
- package/dist/dropzone/index.d.ts +4 -0
- package/dist/dropzone/index.d.ts.map +1 -0
- package/dist/dropzone/index.js +1516 -0
- package/dist/dropzone/index.js.map +1 -0
- package/dist/dropzone/theme.d.ts +6 -0
- package/dist/dropzone/theme.d.ts.map +1 -0
- package/dist/dropzone/types.d.ts +240 -0
- package/dist/dropzone/types.d.ts.map +1 -0
- package/dist/dropzone/utils.d.ts +123 -0
- package/dist/dropzone/utils.d.ts.map +1 -0
- package/dist/field/index.js +1 -1
- package/dist/filters/index.js +1 -1
- package/dist/form/hooks/useFieldHook.d.ts +4 -2
- package/dist/form/hooks/useFieldHook.d.ts.map +1 -1
- package/dist/form/index.js +2 -2
- package/dist/grid-layout/index.js +1 -1
- package/dist/hooks-CekMiYbX.js +91 -0
- package/dist/hooks-CekMiYbX.js.map +1 -0
- package/dist/icons/File.d.ts +7 -0
- package/dist/icons/File.d.ts.map +1 -0
- package/dist/icons/ListChecks.d.ts +8 -0
- package/dist/icons/ListChecks.d.ts.map +1 -0
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.d.ts.map +1 -1
- package/dist/icons/index.js +83 -145
- package/dist/icons/index.js.map +1 -1
- package/dist/{index-BXlN61PG.js → index-BccXGF9t.js} +2 -2
- package/dist/{index-BXlN61PG.js.map → index-BccXGF9t.js.map} +1 -1
- package/dist/{index-CDCqZ3um.js → index-C_oo7Xm5.js} +3 -3
- package/dist/{index-CDCqZ3um.js.map → index-C_oo7Xm5.js.map} +1 -1
- package/dist/{index-CdAE-ZaU.js → index-DxsuVBkE.js} +4 -4
- package/dist/{index-CdAE-ZaU.js.map → index-DxsuVBkE.js.map} +1 -1
- package/dist/input/index.js +3 -3
- package/dist/loader/index.js +2 -2
- package/dist/menu-list/index.js +1 -1
- package/dist/{metrics-B5YsELiI.js → metrics-Cv_jrA15.js} +2 -2
- package/dist/{metrics-B5YsELiI.js.map → metrics-Cv_jrA15.js.map} +1 -1
- package/dist/modal/index.js +1 -1
- package/dist/multi-autocomplete/index.js +3 -3
- package/dist/multi-autocomplete-async/index.js +3 -3
- package/dist/multi-select/index.js +5 -5
- package/dist/number-input/index.js +3 -3
- package/dist/number-range/index.js +3 -3
- package/dist/provider/context.d.ts.map +1 -1
- package/dist/provider/index.js +2 -2
- package/dist/provider/types.d.ts +76 -0
- package/dist/provider/types.d.ts.map +1 -1
- package/dist/select/index.js +3 -3
- package/dist/slider/Component.d.ts.map +1 -1
- package/dist/slider/index.js +111 -108
- package/dist/slider/index.js.map +1 -1
- package/dist/suggest-checklist/Component.d.ts.map +1 -1
- package/dist/suggest-checklist/index.js +78 -67
- package/dist/suggest-checklist/index.js.map +1 -1
- package/dist/switch/index.js +2 -2
- package/dist/table/index.js +1 -1
- package/dist/tabs/index.js +1 -1
- package/dist/tag/index.js +1 -1
- package/dist/test/axe.d.ts +16 -0
- package/dist/test/axe.d.ts.map +1 -0
- package/dist/textarea/index.js +4 -4
- package/dist/theme-C-N1qQjF.js +35 -0
- package/dist/theme-C-N1qQjF.js.map +1 -0
- package/dist/time-field/index.js +3 -3
- package/dist/toast/index.js +2 -2
- package/dist/tooltip/index.js +1 -1
- package/dist/typography/index.js +1 -1
- package/dist/useFieldHook-o47pjrRg.js +56 -0
- package/dist/useFieldHook-o47pjrRg.js.map +1 -0
- package/dist/{utils-Dj_u-w0s.js → utils-DrTtzDsS.js} +3 -3
- package/dist/{utils-Dj_u-w0s.js.map → utils-DrTtzDsS.js.map} +1 -1
- package/dist/vertical-tabs/index.js +1 -1
- package/package.json +10 -1
- package/src/color-picker/docs/Description.md +45 -0
- package/src/color-picker/docs/Example.md +5 -0
- package/src/color-picker/docs/cssVariables.ts +40 -0
- package/src/color-picker/types.ts +67 -0
- package/src/dropzone/docs/Description.md +73 -0
- package/src/dropzone/docs/Example.md +17 -0
- package/src/dropzone/docs/cssVariables.ts +32 -0
- package/src/dropzone/types.ts +268 -0
- package/src/provider/types.ts +76 -0
- package/dist/Component-u6K-ylDb.js +0 -85
- package/dist/Component-u6K-ylDb.js.map +0 -1
- package/dist/assets/Component16.css +0 -1
- package/dist/hooks-BlX5Y4Zt.js +0 -53
- package/dist/hooks-BlX5Y4Zt.js.map +0 -1
- package/dist/useFieldHook-Bt9nST7g.js +0 -52
- package/dist/useFieldHook-Bt9nST7g.js.map +0 -1
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
import { jsx as s, jsxs as S } from "react/jsx-runtime";
|
|
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";
|
|
343
|
+
export {
|
|
344
|
+
de as ColorPicker,
|
|
345
|
+
_t as FormColorPicker
|
|
346
|
+
};
|
|
347
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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,WAAO;AAAA,EACX;AACJ,GAGaC,IAAa,CAACC,MAAiC;AACxD,QAAMC,IAAUD,EAAM,KAAA;AAEtB,SAAKC,IAEDN,GAAS,KAAKM,CAAO,IAAUJ,GAAQ,IAAII,CAAO,EAAE,IAEjDJ,GAAQI,CAAO,IAJD;AAKzB,GAOaC,KAAiB,CAACC,GAAaC,MAAqC;AAC7E,QAAMH,IAAUE,EAAI,KAAA;AAEpB,MAAI,CAACF,EAAS,QAAOG,MAAS,WAAW,KAAK;AAE9C,QA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AA,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;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const colorPickerGroupVariants: (props?: ({
|
|
2
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
3
|
+
variant?: "primary" | null | undefined;
|
|
4
|
+
block?: boolean | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/color-picker/theme.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,wBAAwB;;;;8EAoBnC,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Ref } from 'react';
|
|
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
|
+
/** Own / chrome props (not from RAC). */
|
|
17
|
+
export interface IColorPickerOwnProps extends IDataTestIdProps {
|
|
18
|
+
/** Clear button for the current value. */
|
|
19
|
+
clear?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Preset swatches inside the popover.
|
|
22
|
+
* Values that are not colors are dropped. No row when empty.
|
|
23
|
+
*/
|
|
24
|
+
presets?: string[];
|
|
25
|
+
/** Class name on the root. */
|
|
26
|
+
className?: string;
|
|
27
|
+
/** Ref to the field group (React 19 prop). */
|
|
28
|
+
ref?: Ref<HTMLDivElement>;
|
|
29
|
+
/** Ref to the hex input (React 19 prop). */
|
|
30
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
31
|
+
id?: string;
|
|
32
|
+
'aria-label'?: string;
|
|
33
|
+
'aria-labelledby'?: string;
|
|
34
|
+
'aria-describedby'?: string;
|
|
35
|
+
'aria-invalid'?: boolean | 'true' | 'false';
|
|
36
|
+
}
|
|
37
|
+
/** Control state (our names, not RAC). */
|
|
38
|
+
export interface IColorPickerControlProps {
|
|
39
|
+
/** `#rrggbb` or `''`. */
|
|
40
|
+
value?: string;
|
|
41
|
+
/** `#rrggbb` or `''`. */
|
|
42
|
+
defaultValue?: string;
|
|
43
|
+
/** `''` or canonical `#rrggbb`. */
|
|
44
|
+
onChange?: (value: string) => void;
|
|
45
|
+
onBlur?: () => void;
|
|
46
|
+
}
|
|
47
|
+
export interface IColorPickerBaseProps extends IColorPickerThemeProps, IFieldStateProps, IColorPickerOwnProps, IColorPickerControlProps {
|
|
48
|
+
}
|
|
49
|
+
export interface IColorPickerProps extends IColorPickerBaseProps {
|
|
50
|
+
}
|
|
51
|
+
/** Content slice for FormColorPicker. */
|
|
52
|
+
export interface IColorPickerContentProps {
|
|
53
|
+
clear?: boolean;
|
|
54
|
+
presets?: string[];
|
|
55
|
+
}
|
|
56
|
+
export interface IFormColorPickerProps extends IFormFieldLayoutProps, Pick<IColorPickerThemeProps, 'variant'>, IColorPickerContentProps {
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +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,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAE1D,wBAAwB;AACxB,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAElD,sBAAsB;AACtB,MAAM,MAAM,mBAAmB,GAAG,SAAS,CAAC;AAE5C,oBAAoB;AACpB,MAAM,WAAW,sBAAsB;IACnC,sEAAsE;IACtE,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,sBAAsB;IACtB,OAAO,CAAC,EAAE,mBAAmB,CAAC;CACjC;AAED,yCAAyC;AACzC,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC1D,0CAA0C;IAC1C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,8BAA8B;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8CAA8C;IAC9C,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;IACjC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;CAC/C;AAED,0CAA0C;AAC1C,MAAM,WAAW,wBAAwB;IACrC,yBAAyB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yBAAyB;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,qBACb,SAAQ,sBAAsB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,wBAAwB;CAAG;AAEvG,MAAM,WAAW,iBAAkB,SAAQ,qBAAqB;CAAG;AAEnE,yCAAyC;AACzC,MAAM,WAAW,wBAAwB;IACrC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,qBACb,SAAQ,qBAAqB,EAAE,IAAI,CAAC,sBAAsB,EAAE,SAAS,CAAC,EAAE,wBAAwB;CAAG"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Color } from 'react-aria-components';
|
|
2
|
+
/** Draft shown in the panel when the field is empty. Never emitted. */
|
|
3
|
+
export declare const IDLE_DRAFT = "#808080";
|
|
4
|
+
/** HSB color for the RAC picker, so hue survives gray values. */
|
|
5
|
+
export declare const toDraftColor: (hex: string) => Color;
|
|
6
|
+
export type TCommitMode = 'live' | 'settle';
|
|
7
|
+
/** Canonical `#rrggbb`, or `null` when the string is not a color. */
|
|
8
|
+
export declare const toHexColor: (value: string) => string | null;
|
|
9
|
+
/**
|
|
10
|
+
* Hex to publish.
|
|
11
|
+
* `''` clears on settle. `null` means "keep typing" or "not a color".
|
|
12
|
+
* Three-digit hex expands only on settle, so `#abcdef` can be typed.
|
|
13
|
+
*/
|
|
14
|
+
export declare const commitHexInput: (raw: string, mode: TCommitMode) => string | null;
|
|
15
|
+
/** How a stored string should look in the field before the user edits it. */
|
|
16
|
+
export declare const describeColorValue: (value: string | null | undefined) => {
|
|
17
|
+
text: string;
|
|
18
|
+
hex: string | null;
|
|
19
|
+
unrecognized: boolean;
|
|
20
|
+
};
|
|
21
|
+
/** Preset list as unique `#rrggbb`. Drops values that are not colors. */
|
|
22
|
+
export declare const validPresetHexes: (presets: readonly string[] | undefined) => string[];
|
|
23
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +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;AAKpF,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,QAAQ,CAAC;AAU5C,qEAAqE;AACrE,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,KAAG,MAAM,GAAG,IAQnD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,KAAK,MAAM,EAAE,MAAM,WAAW,KAAG,MAAM,GAAG,IA0BxE,CAAC;AAEF,6EAA6E;AAC7E,eAAO,MAAM,kBAAkB,GAC3B,OAAO,MAAM,GAAG,IAAI,GAAG,SAAS,KACjC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,YAAY,EAAE,OAAO,CAAA;CAU3D,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,gBAAgB,GAAI,SAAS,SAAS,MAAM,EAAE,GAAG,SAAS,KAAG,MAAM,EAc/E,CAAC"}
|
package/dist/combobox/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { C as e, a as t, b as a, c as r, i as b, r as i, t as m } from "../utils-
|
|
2
|
-
import { C as x, r as c, u as p } from "../metrics-
|
|
3
|
-
import { C as g, u as n, a as f } from "../index-
|
|
4
|
-
import { C as v } from "../index-
|
|
1
|
+
import { C as e, a as t, b as a, c as r, i as b, r as i, t as m } from "../utils-DrTtzDsS.js";
|
|
2
|
+
import { C as x, r as c, u as p } from "../metrics-Cv_jrA15.js";
|
|
3
|
+
import { C as g, u as n, a as f } from "../index-DxsuVBkE.js";
|
|
4
|
+
import { C as v } from "../index-C_oo7Xm5.js";
|
|
5
5
|
export {
|
|
6
6
|
e as ComboboxItemContent,
|
|
7
7
|
t as ComboboxList,
|
|
@@ -5,8 +5,8 @@ import { s as L } from "../index-h8z54aFR.js";
|
|
|
5
5
|
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
|
-
import { u as q } from "../hooks-
|
|
9
|
-
import { T as y } from "../Component-
|
|
8
|
+
import { u as q } from "../hooks-CekMiYbX.js";
|
|
9
|
+
import { T as y } from "../Component-CzwTENBM.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,11 +1,11 @@
|
|
|
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-IFlvrceZ.js";
|
|
5
5
|
import A from "classnames";
|
|
6
6
|
import { M as P } from "../SortDescending-DziKhSYN.js";
|
|
7
|
-
import { u as R } from "../hooks-
|
|
8
|
-
import '../assets/
|
|
7
|
+
import { u as R } from "../hooks-CekMiYbX.js";
|
|
8
|
+
import '../assets/index24.css';const S = "aub_styles-module_trigger_f9d5f", k = "aub_styles-module_icon_fcb5d", w = "aub_styles-module_visuallyHidden_14779", b = {
|
|
9
9
|
trigger: S,
|
|
10
10
|
icon: k,
|
|
11
11
|
visuallyHidden: w
|
|
@@ -4,15 +4,15 @@ import { CalendarDate as z } from "@internationalized/date";
|
|
|
4
4
|
import E from "classnames";
|
|
5
5
|
import { DatePickerStateContext as Z, useSlottedContext as ee, CalendarContext as ae, DatePicker as oe, Group as te, DateInput as le, DateSegment as ne, Button as Y, Popover as re, Dialog as se } from "react-aria-components";
|
|
6
6
|
import { s as j } from "../index-h8z54aFR.js";
|
|
7
|
-
import { u as ce, t as M, a as ie, M as ue, b as de, D as me, c as pe } from "../index-
|
|
7
|
+
import { u as ce, t as M, a as ie, M as ue, b as de, D as me, c as pe } from "../index-BccXGF9t.js";
|
|
8
8
|
import { C as be } from "../Calendar-CMg4K4oF.js";
|
|
9
9
|
import { C as _e } from "../Clear-DcxADxz6.js";
|
|
10
|
-
import { u as ye } from "../hooks-
|
|
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-
|
|
14
|
-
import { u as De, g as ge } from "../useFieldHook-
|
|
15
|
-
import '../assets/
|
|
13
|
+
import { F as N, u as he } from "../Component-DSAL6avh.js";
|
|
14
|
+
import { u as De, g as ge } from "../useFieldHook-o47pjrRg.js";
|
|
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) => {
|
|
17
17
|
if (t?.onChange) {
|
|
18
18
|
t.onChange(n);
|
|
@@ -4,15 +4,15 @@ import z from "classnames";
|
|
|
4
4
|
import { DateRangePickerStateContext as be, useSlottedContext as ge, RangeCalendarContext as _e, DateRangePicker as ye, Group as he, DateInput as ne, DateSegment as re, Button as te, Popover as De, Dialog as Ce } from "react-aria-components";
|
|
5
5
|
import { s as se } from "../index-h8z54aFR.js";
|
|
6
6
|
import { CalendarDate as le } from "@internationalized/date";
|
|
7
|
-
import { u as Re, t as M, a as ke, M as Ee, b as Ne, c as ve, D as Fe } from "../index-
|
|
7
|
+
import { u as Re, t as M, a as ke, M as Ee, b as Ne, c as ve, D as Fe } from "../index-BccXGF9t.js";
|
|
8
8
|
import { C as Pe } from "../Calendar-CMg4K4oF.js";
|
|
9
9
|
import { C as Ve } from "../Clear-DcxADxz6.js";
|
|
10
|
-
import { u as Se } from "../hooks-
|
|
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-
|
|
14
|
-
import { u as Ae, g as Le } from "../useFieldHook-
|
|
15
|
-
import '../assets/
|
|
13
|
+
import { F as w, u as Me } from "../Component-DSAL6avh.js";
|
|
14
|
+
import { u as Ae, g as Le } from "../useFieldHook-o47pjrRg.js";
|
|
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) => {
|
|
17
17
|
if (!u) {
|
|
18
18
|
C(t);
|
package/dist/drawer/index.js
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IDropzoneProps } from './types';
|
|
2
|
+
export declare const Dropzone: (({ ref, value, defaultValue, onChange, onRemove, renderAction, accept, maxSize, maxTotalSize, maxFiles, maxFileNameLength, paste, loading, layout, list, item, upload, validate, onPendingChange, title, description, hint, onRejectionChange, size, variant, invalid, disabled, block, className, dataTestId, id, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "aria-invalid": ariaInvalid, ...props }: IDropzoneProps) => import("react").JSX.Element) & {
|
|
3
|
+
displayName?: string;
|
|
4
|
+
} & {
|
|
5
|
+
Action: {
|
|
6
|
+
({ children, className, hidden, icon: Icon, ...props }: Omit<import('react').ButtonHTMLAttributes<HTMLButtonElement>, "type"> & {
|
|
7
|
+
children: import('react').ReactNode;
|
|
8
|
+
hidden?: boolean;
|
|
9
|
+
icon?: import('../ds/common').TSVGRIcon;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=Component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Component.d.ts","sourceRoot":"","sources":["../../../src/dropzone/Component.tsx"],"names":[],"mappings":"AAuBA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAyTlE,eAAO,MAAM,QAAQ,uaAnQd,cAAc;;;;;;kBA/DgB,CAAC;gBAEV,CAAC;;;;CAkU3B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IFormDropzoneProps } from './types';
|
|
2
|
+
export declare const FormDropzone: {
|
|
3
|
+
({ name, label, hint, size, block, disabled, className, dataTestId, variant, ref, ...content }: IFormDropzoneProps): import("react").JSX.Element;
|
|
4
|
+
displayName: string;
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=FormDropzone.d.ts.map
|