@ensi-platform/admin-ui 0.10.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-BMol_xnR.js → Component-BPAXqDXt.js} +3 -3
- package/dist/{Component-BMol_xnR.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-D9cY4WmP.js → Component-BuFsNZAH.js} +3 -3
- package/dist/{Component-D9cY4WmP.js.map → Component-BuFsNZAH.js.map} +1 -1
- package/dist/{Component-CD81ynoG.js → Component-CBnhxD86.js} +6 -6
- package/dist/{Component-CD81ynoG.js.map → Component-CBnhxD86.js.map} +1 -1
- package/dist/{Component-DxkpQKZ9.js → Component-CDURmZCP.js} +3 -3
- package/dist/{Component-DxkpQKZ9.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-BO5LvfoO.js → Component-DWp04UBh.js} +4 -4
- package/dist/{Component-BO5LvfoO.js.map → Component-DWp04UBh.js.map} +1 -1
- package/dist/{Component-c2va6Tzq.js → Component-D_c3xBcb.js} +3 -3
- package/dist/{Component-c2va6Tzq.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-DcSDEfYC.js → Component-dmSX0Khf.js} +4 -4
- package/dist/{Component-DcSDEfYC.js.map → Component-dmSX0Khf.js.map} +1 -1
- package/dist/{Component-Cxk1CLsH.js → Component-eoUrqznD.js} +4 -4
- package/dist/{Component-Cxk1CLsH.js.map → Component-eoUrqznD.js.map} +1 -1
- package/dist/{Component-BjITARbg.js → Component-jzDbWkuj.js} +4 -4
- package/dist/{Component-BjITARbg.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/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 +4 -4
- package/dist/arrangement-settings/index.js +3 -3
- 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/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/index8.css +1 -1
- package/dist/assets/index9.css +1 -1
- 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/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 +4 -4
- package/dist/checkbox/index.js +2 -2
- package/dist/checkbox-group/index.js +2 -2
- 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-field/theme.d.ts +6 -0
- 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 +5 -0
- package/dist/color-picker/Component.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 +6 -0
- package/dist/color-picker/index.js.map +1 -0
- package/dist/color-picker/types.d.ts +37 -0
- package/dist/color-picker/types.d.ts.map +1 -0
- package/dist/color-picker/utils.d.ts +16 -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/link/index.js +1 -1
- package/dist/loader/index.js +2 -2
- 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/{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/popover/index.js +1 -1
- 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/index.js +3 -3
- package/dist/suggest-checklist/index.js +3 -3
- 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/textarea/index.js +4 -4
- 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 +20 -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 +26 -0
- package/src/color-picker/docs/Example.md +5 -0
- package/src/color-picker/docs/cssVariables.ts +12 -0
- package/src/color-picker/types.ts +39 -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/mask/docs/Description.md +48 -0
- package/src/mask/docs/Example.md +12 -0
- package/src/mask/types.ts +21 -0
- package/src/provider/types.ts +76 -0
- package/dist/Component-C24OpTxW.js +0 -92
- package/dist/Component-C24OpTxW.js.map +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,284 @@
|
|
|
1
|
+
import { jsx as l, jsxs as z } from "react/jsx-runtime";
|
|
2
|
+
import { useState as h, useRef as w, useCallback as fe, useEffect as M } from "react";
|
|
3
|
+
import k from "classnames";
|
|
4
|
+
import { DialogTrigger as pe, Button as U, ColorSwatch as be, Popover as ge, Dialog as he } from "react-aria-components";
|
|
5
|
+
import { s as _e } from "../index-h8z54aFR.js";
|
|
6
|
+
import { t as Y, C as ye } from "../Component-DhE4a93B.js";
|
|
7
|
+
import { C as Ce } from "../Clear-DcxADxz6.js";
|
|
8
|
+
import { u as ve } from "../hooks-CekMiYbX.js";
|
|
9
|
+
import { cva as xe } from "class-variance-authority";
|
|
10
|
+
import { typographyStyles as E } from "../typography/index.js";
|
|
11
|
+
import { F, u as we } from "../Component-BPN5FgKq.js";
|
|
12
|
+
import { u as Fe, g as ke } from "../useFieldHook-o47pjrRg.js";
|
|
13
|
+
import '../assets/index15.css';const Ne = "aub_styles-module_root_2023e", Pe = "aub_styles-module_block_88782", Re = "aub_styles-module_group_4501d", He = "aub_styles-module_swatch_7c309", Se = "aub_styles-module_clear_36c5c", $e = "aub_styles-module_sm_27b98", Be = "aub_styles-module_md_2abd6", De = "aub_styles-module_lg_f2dbc", Ee = "aub_styles-module_primary_fed91", ze = "aub_styles-module_swatchColor_8141a", Te = "aub_styles-module_hex_169fb", Le = "aub_styles-module_icon_5c0c1", Ve = "aub_styles-module_popover_24de0", Ge = "aub_styles-module_dialog_788ed", o = {
|
|
14
|
+
root: Ne,
|
|
15
|
+
block: Pe,
|
|
16
|
+
group: Re,
|
|
17
|
+
swatch: He,
|
|
18
|
+
clear: Se,
|
|
19
|
+
sm: $e,
|
|
20
|
+
md: Be,
|
|
21
|
+
lg: De,
|
|
22
|
+
primary: Ee,
|
|
23
|
+
swatchColor: ze,
|
|
24
|
+
hex: Te,
|
|
25
|
+
icon: Le,
|
|
26
|
+
popover: Ve,
|
|
27
|
+
dialog: Ge
|
|
28
|
+
}, Ie = xe(o.group, {
|
|
29
|
+
variants: {
|
|
30
|
+
size: {
|
|
31
|
+
sm: k(o.sm, E.bodyS),
|
|
32
|
+
md: k(o.md, E.bodyS),
|
|
33
|
+
lg: k(o.lg, E.bodyM)
|
|
34
|
+
},
|
|
35
|
+
variant: {
|
|
36
|
+
primary: o.primary
|
|
37
|
+
},
|
|
38
|
+
block: {
|
|
39
|
+
true: o.block,
|
|
40
|
+
false: null
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
defaultVariants: {
|
|
44
|
+
size: "md",
|
|
45
|
+
variant: "primary",
|
|
46
|
+
block: !0
|
|
47
|
+
}
|
|
48
|
+
}), Oe = /^[0-9a-fA-F]+$/, je = /^(rgb|rgba|hsl|hsla|hsb|hsba)\([^)]+\)$/i, W = (t, r) => {
|
|
49
|
+
const s = t.trim();
|
|
50
|
+
if (!s) return r === "settle" ? "" : null;
|
|
51
|
+
const i = s.startsWith("#") ? s.slice(1) : s;
|
|
52
|
+
if (Oe.test(i)) {
|
|
53
|
+
if (i.length === 6) return `#${i.toLowerCase()}`;
|
|
54
|
+
if (r === "settle" && i.length === 3) {
|
|
55
|
+
const [u, a, d] = i.toLowerCase();
|
|
56
|
+
return `#${u}${u}${a}${a}${d}${d}`;
|
|
57
|
+
}
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
const c = Y(s);
|
|
61
|
+
return !c || r === "live" && !je.test(s) ? null : c;
|
|
62
|
+
}, X = (t) => {
|
|
63
|
+
if (t == null || t.trim() === "")
|
|
64
|
+
return { text: "", hex: null, unrecognized: !1 };
|
|
65
|
+
const r = Y(t);
|
|
66
|
+
return r ? { text: r, hex: r, unrecognized: !1 } : { text: "", hex: null, unrecognized: !0 };
|
|
67
|
+
}, q = _e(
|
|
68
|
+
({
|
|
69
|
+
ref: t,
|
|
70
|
+
inputRef: r,
|
|
71
|
+
size: s = "md",
|
|
72
|
+
variant: i = "primary",
|
|
73
|
+
block: c = !0,
|
|
74
|
+
invalid: u = !1,
|
|
75
|
+
disabled: a = !1,
|
|
76
|
+
clear: d = !1,
|
|
77
|
+
presets: N,
|
|
78
|
+
value: f,
|
|
79
|
+
defaultValue: P,
|
|
80
|
+
onChange: R,
|
|
81
|
+
onBlur: _,
|
|
82
|
+
className: H,
|
|
83
|
+
dataTestId: y,
|
|
84
|
+
id: S,
|
|
85
|
+
"aria-label": C,
|
|
86
|
+
"aria-labelledby": T,
|
|
87
|
+
"aria-describedby": Q,
|
|
88
|
+
"aria-invalid": L
|
|
89
|
+
}) => {
|
|
90
|
+
const { clear: Z, openPalette: ee, colorCode: te, colorPalette: oe } = ve(), V = f !== void 0, [re, le] = h(P ?? ""), p = V ? f : re, m = X(p), [G, b] = h(m.text), [se, g] = h(null), [ae, ne] = h(void 0), [I, ie] = h(0), O = w(null), ce = fe(
|
|
91
|
+
(e) => {
|
|
92
|
+
if (O.current = e, typeof t == "function") {
|
|
93
|
+
t(e);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
t && (t.current = e);
|
|
97
|
+
},
|
|
98
|
+
[t]
|
|
99
|
+
), $ = w(!1), v = w(!1), B = w(p), j = u || L === !0 || L === "true" || m.unrecognized, D = se ?? m.hex, ue = d && !a && (G !== "" || !!m.hex);
|
|
100
|
+
M(() => {
|
|
101
|
+
B.current = p;
|
|
102
|
+
}, [p, I]), M(() => {
|
|
103
|
+
if ($.current) return;
|
|
104
|
+
const e = X(p);
|
|
105
|
+
b(e.text), g(null);
|
|
106
|
+
}, [p, I]);
|
|
107
|
+
const x = (e, n) => {
|
|
108
|
+
v.current = !1, g(e || null), b(n !== void 0 && n.toLowerCase() === e ? n : e), B.current !== e && (B.current = e, V || le(e), e !== p && R?.(e));
|
|
109
|
+
}, A = (e) => {
|
|
110
|
+
if (!v.current && e === m.text) return;
|
|
111
|
+
const n = W(e, "settle");
|
|
112
|
+
if (v.current = !1, n == null) {
|
|
113
|
+
b(m.text), g(m.hex);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
x(n);
|
|
117
|
+
}, de = (e) => {
|
|
118
|
+
const n = e.target.value;
|
|
119
|
+
v.current = !0, b(n), g(null);
|
|
120
|
+
const K = W(n, "live");
|
|
121
|
+
K && x(K, n);
|
|
122
|
+
}, me = (e) => {
|
|
123
|
+
e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), A(e.currentTarget.value));
|
|
124
|
+
};
|
|
125
|
+
return /* @__PURE__ */ l("div", { className: k(o.root, c && o.block, H), children: /* @__PURE__ */ z(
|
|
126
|
+
"div",
|
|
127
|
+
{
|
|
128
|
+
ref: ce,
|
|
129
|
+
className: Ie({ size: s, variant: i, block: c }),
|
|
130
|
+
"data-invalid": j || void 0,
|
|
131
|
+
"data-disabled": a || void 0,
|
|
132
|
+
"data-test-id": y,
|
|
133
|
+
children: [
|
|
134
|
+
/* @__PURE__ */ z(
|
|
135
|
+
pe,
|
|
136
|
+
{
|
|
137
|
+
onOpenChange: (e) => {
|
|
138
|
+
e || _?.();
|
|
139
|
+
},
|
|
140
|
+
children: [
|
|
141
|
+
/* @__PURE__ */ l(
|
|
142
|
+
U,
|
|
143
|
+
{
|
|
144
|
+
className: o.swatch,
|
|
145
|
+
"aria-label": ee,
|
|
146
|
+
isDisabled: a,
|
|
147
|
+
"data-empty": D ? void 0 : !0,
|
|
148
|
+
"data-test-id": "color-field-trigger",
|
|
149
|
+
children: D ? /* @__PURE__ */ l(be, { className: o.swatchColor, color: D }) : null
|
|
150
|
+
}
|
|
151
|
+
),
|
|
152
|
+
/* @__PURE__ */ l(ge, { className: o.popover, placement: "bottom start", triggerRef: O, children: /* @__PURE__ */ l(
|
|
153
|
+
he,
|
|
154
|
+
{
|
|
155
|
+
className: o.dialog,
|
|
156
|
+
"aria-label": oe,
|
|
157
|
+
"data-test-id": "color-field-dialog",
|
|
158
|
+
children: /* @__PURE__ */ l(
|
|
159
|
+
ye,
|
|
160
|
+
{
|
|
161
|
+
value: m.hex ?? "",
|
|
162
|
+
hue: ae,
|
|
163
|
+
presets: N,
|
|
164
|
+
disabled: a,
|
|
165
|
+
onHueChange: ne,
|
|
166
|
+
onPreview: (e) => {
|
|
167
|
+
g(e), b(e);
|
|
168
|
+
},
|
|
169
|
+
onChange: x
|
|
170
|
+
}
|
|
171
|
+
)
|
|
172
|
+
}
|
|
173
|
+
) })
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
),
|
|
177
|
+
/* @__PURE__ */ l(
|
|
178
|
+
"input",
|
|
179
|
+
{
|
|
180
|
+
ref: r,
|
|
181
|
+
id: S,
|
|
182
|
+
className: o.hex,
|
|
183
|
+
"aria-label": T ? void 0 : C ?? te,
|
|
184
|
+
"aria-labelledby": T,
|
|
185
|
+
"aria-describedby": Q,
|
|
186
|
+
"aria-invalid": j || void 0,
|
|
187
|
+
placeholder: "#RRGGBB",
|
|
188
|
+
spellCheck: !1,
|
|
189
|
+
autoComplete: "off",
|
|
190
|
+
disabled: a,
|
|
191
|
+
value: G,
|
|
192
|
+
"data-test-id": "color-field-input",
|
|
193
|
+
onFocus: () => {
|
|
194
|
+
$.current = !0;
|
|
195
|
+
},
|
|
196
|
+
onChange: de,
|
|
197
|
+
onBlur: (e) => {
|
|
198
|
+
$.current = !1, A(e.target.value), ie((n) => n + 1), _?.();
|
|
199
|
+
},
|
|
200
|
+
onKeyDown: me
|
|
201
|
+
}
|
|
202
|
+
),
|
|
203
|
+
ue ? /* @__PURE__ */ l(
|
|
204
|
+
U,
|
|
205
|
+
{
|
|
206
|
+
className: o.clear,
|
|
207
|
+
"aria-label": Z,
|
|
208
|
+
"data-test-id": "color-field-clear",
|
|
209
|
+
excludeFromTabOrder: !0,
|
|
210
|
+
onPress: () => x(""),
|
|
211
|
+
children: /* @__PURE__ */ l(Ce, { className: o.icon })
|
|
212
|
+
}
|
|
213
|
+
) : null
|
|
214
|
+
]
|
|
215
|
+
}
|
|
216
|
+
) });
|
|
217
|
+
}
|
|
218
|
+
);
|
|
219
|
+
q.displayName = "ColorField";
|
|
220
|
+
const J = ({ value: t, onChange: r, onBlur: s, ...i }) => {
|
|
221
|
+
const { controlProps: c, size: u, invalid: a, disabled: d } = we();
|
|
222
|
+
return /* @__PURE__ */ l(
|
|
223
|
+
q,
|
|
224
|
+
{
|
|
225
|
+
...c,
|
|
226
|
+
...i,
|
|
227
|
+
size: u,
|
|
228
|
+
invalid: a,
|
|
229
|
+
disabled: d,
|
|
230
|
+
value: t,
|
|
231
|
+
onChange: r,
|
|
232
|
+
onBlur: s
|
|
233
|
+
}
|
|
234
|
+
);
|
|
235
|
+
};
|
|
236
|
+
J.displayName = "FormColorFieldControl";
|
|
237
|
+
const Ae = ({
|
|
238
|
+
name: t,
|
|
239
|
+
label: r,
|
|
240
|
+
hint: s,
|
|
241
|
+
size: i = "md",
|
|
242
|
+
block: c = !0,
|
|
243
|
+
disabled: u,
|
|
244
|
+
className: a,
|
|
245
|
+
dataTestId: d,
|
|
246
|
+
...N
|
|
247
|
+
}) => {
|
|
248
|
+
const { field: f, fieldState: P, inputProps: R, onChange: _, onBlurHandler: H } = Fe({ name: t }), y = ke(P.error)?.message, S = u ?? R.disabled;
|
|
249
|
+
return /* @__PURE__ */ z(
|
|
250
|
+
F,
|
|
251
|
+
{
|
|
252
|
+
invalid: !!y,
|
|
253
|
+
disabled: S,
|
|
254
|
+
size: i,
|
|
255
|
+
block: c,
|
|
256
|
+
className: a,
|
|
257
|
+
dataTestId: d,
|
|
258
|
+
children: [
|
|
259
|
+
r ? /* @__PURE__ */ l(F.Label, { children: r }) : null,
|
|
260
|
+
/* @__PURE__ */ l(
|
|
261
|
+
J,
|
|
262
|
+
{
|
|
263
|
+
...N,
|
|
264
|
+
block: c,
|
|
265
|
+
inputRef: f.ref,
|
|
266
|
+
value: typeof f.value == "string" ? f.value : "",
|
|
267
|
+
onChange: (C) => {
|
|
268
|
+
f.onChange(C), _(t, C);
|
|
269
|
+
},
|
|
270
|
+
onBlur: () => H()
|
|
271
|
+
}
|
|
272
|
+
),
|
|
273
|
+
s ? /* @__PURE__ */ l(F.Hint, { children: s }) : null,
|
|
274
|
+
/* @__PURE__ */ l(F.Error, { children: y })
|
|
275
|
+
]
|
|
276
|
+
}
|
|
277
|
+
);
|
|
278
|
+
};
|
|
279
|
+
Ae.displayName = "FormColorField";
|
|
280
|
+
export {
|
|
281
|
+
q as ColorField,
|
|
282
|
+
Ae as FormColorField
|
|
283
|
+
};
|
|
284
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/color-field/theme.ts","../../src/color-field/utils.ts","../../src/color-field/Component.tsx","../../src/color-field/FormColorField.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 colorFieldGroupVariants = 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 { toHexColor } from '@/color-picker';\n\nexport type TCommitMode = 'live' | 'settle';\n\nconst HEX_BODY = /^[0-9a-fA-F]+$/;\nconst COMPLETE_CSS = /^(rgb|rgba|hsl|hsla|hsb|hsba)\\([^)]+\\)$/i;\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","import { type ChangeEvent, type KeyboardEvent, useCallback, useEffect, useRef, useState } from 'react';\n\nimport cn from 'classnames';\nimport { Button as RacButton, ColorSwatch, Dialog, DialogTrigger, Popover } from 'react-aria-components';\n\nimport { supportRef } from '@ds/common/support-ref';\n\nimport { ColorPicker } from '@/color-picker';\nimport { Clear } from '@/icons';\nimport { useAuiLabels } from '@/provider';\n\nimport { colorFieldGroupVariants } from './theme';\nimport { type IColorFieldProps } from './types';\nimport { commitHexInput, describeColorValue } from './utils';\n\nimport styles from './styles.module.css';\n\nexport const ColorField = 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 }: IColorFieldProps) => {\n const { clear: clearLabel, openPalette, colorCode, colorPalette } = 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 [previewHex, setPreviewHex] = useState<string | null>(null);\n const [hue, setHue] = useState<number | undefined>(undefined);\n /** Forces a resync after blur when the parent rejected the change and `current` did not move. */\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 lastEmittedRef = useRef(current);\n const markedInvalid = invalid || ariaInvalid === true || ariaInvalid === 'true' || display.unrecognized;\n const swatchColor = previewHex ?? display.hex;\n const showClear = clear && !disabled && (text !== '' || Boolean(display.hex));\n\n useEffect(() => {\n lastEmittedRef.current = current;\n }, [current, settledTick]);\n\n useEffect(() => {\n if (focusedRef.current) return;\n\n const next = describeColorValue(current);\n\n setText(next.text);\n setPreviewHex(null);\n }, [current, settledTick]);\n\n const emit = (hex: string, typed?: string) => {\n dirtyRef.current = false;\n setPreviewHex(hex || null);\n setText(typed !== undefined && typed.toLowerCase() === hex ? typed : hex);\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 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 setPreviewHex(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 setPreviewHex(null);\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 <div className={cn(styles.root, block && styles.block, className)}>\n <div\n ref={setGroupRef}\n className={colorFieldGroupVariants({ 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-field-trigger\"\n >\n {swatchColor ? <ColorSwatch className={styles.swatchColor} color={swatchColor} /> : 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-field-dialog\"\n >\n <ColorPicker\n value={display.hex ?? ''}\n hue={hue}\n presets={presets}\n disabled={disabled}\n onHueChange={setHue}\n onPreview={hex => {\n setPreviewHex(hex);\n setText(hex);\n }}\n onChange={emit}\n />\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-field-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-field-clear\"\n excludeFromTabOrder\n onPress={() => emit('')}\n >\n <Clear className={styles.icon} />\n </RacButton>\n ) : null}\n </div>\n </div>\n );\n }\n);\n\nColorField.displayName = 'ColorField';\n","import { Field, useField } from '@/field';\nimport { useFieldHook } from '@/form/hooks/useFieldHook';\nimport { getError } from '@/form/utils';\n\nimport { ColorField } from './Component';\nimport { type IColorFieldProps, type IFormColorFieldProps } from './types';\n\ntype TFormColorFieldControlProps = Omit<IColorFieldProps, 'size' | 'invalid' | 'disabled' | 'value' | 'onChange'> & {\n value: string;\n onChange: (value: string) => void;\n};\n\nconst FormColorFieldControl = ({ value, onChange, onBlur, ...props }: TFormColorFieldControlProps) => {\n const { controlProps, size, invalid, disabled } = useField();\n\n return (\n <ColorField\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\nFormColorFieldControl.displayName = 'FormColorFieldControl';\n\nexport const FormColorField = ({\n name,\n label,\n hint,\n size = 'md',\n block = true,\n disabled,\n className,\n dataTestId,\n ...inputProps\n}: IFormColorFieldProps) => {\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 <FormColorFieldControl\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\nFormColorField.displayName = 'FormColorField';\n"],"names":["colorFieldGroupVariants","cva","styles","cn","typographyStyles","HEX_BODY","COMPLETE_CSS","commitHexInput","raw","mode","trimmed","body","red","green","blue","parsed","toHexColor","describeColorValue","value","hex","ColorField","supportRef","ref","inputRef","size","variant","block","invalid","disabled","clear","presets","defaultValue","onChange","onBlur","className","dataTestId","id","ariaLabel","ariaLabelledby","ariaDescribedby","ariaInvalid","clearLabel","openPalette","colorCode","colorPalette","useAuiLabels","isControlled","uncontrolledValue","setUncontrolledValue","useState","current","display","text","setText","previewHex","setPreviewHex","hue","setHue","settledTick","setSettledTick","groupRef","useRef","setGroupRef","useCallback","node","focusedRef","dirtyRef","lastEmittedRef","markedInvalid","swatchColor","showClear","useEffect","next","emit","typed","settle","committed","onInputChange","event","onInputKeyDown","jsx","jsxs","DialogTrigger","open","RacButton","ColorSwatch","Popover","Dialog","ColorPicker","tick","Clear","FormColorFieldControl","props","controlProps","useField","FormColorField","name","label","hint","inputProps","field","fieldState","rhfInputProps","onBlurHandler","useFieldHook","error","getError","isDisabled","Field"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;GAOaA,KAA0BC,GAAIC,EAAO,OAAO;AAAA,EACrD,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,GCvBKG,KAAW,kBACXC,KAAe,4CAORC,IAAiB,CAACC,GAAaC,MAAqC;AAC7E,QAAMC,IAAUF,EAAI,KAAA;AAEpB,MAAI,CAACE,EAAS,QAAOD,M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|
+
export declare const colorFieldGroupVariants: (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-field/theme.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,uBAAuB;;;;8EAoBlC,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
|
+
/** ColorField size. */
|
|
6
|
+
export type TColorFieldSize = 'sm' | 'md' | 'lg';
|
|
7
|
+
/** Visual variant. */
|
|
8
|
+
export type TColorFieldVariant = 'primary';
|
|
9
|
+
/** Theme inputs. */
|
|
10
|
+
export interface IColorFieldThemeProps {
|
|
11
|
+
/** Control size. Inside Field, inherits `Field.size` when omitted. */
|
|
12
|
+
size?: TColorFieldSize;
|
|
13
|
+
/** Visual variant. */
|
|
14
|
+
variant?: TColorFieldVariant;
|
|
15
|
+
}
|
|
16
|
+
/** Own / chrome props (not from RAC). */
|
|
17
|
+
export interface IColorFieldOwnProps 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 IColorFieldControlProps {
|
|
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 IColorFieldBaseProps extends IColorFieldThemeProps, IFieldStateProps, IColorFieldOwnProps, IColorFieldControlProps {
|
|
48
|
+
}
|
|
49
|
+
export interface IColorFieldProps extends IColorFieldBaseProps {
|
|
50
|
+
}
|
|
51
|
+
/** Content slice for FormColorField. */
|
|
52
|
+
export interface IColorFieldContentProps {
|
|
53
|
+
clear?: boolean;
|
|
54
|
+
presets?: string[];
|
|
55
|
+
}
|
|
56
|
+
export interface IFormColorFieldProps extends IFormFieldLayoutProps, Pick<IColorFieldThemeProps, 'variant'>, IColorFieldContentProps {
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/color-field/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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AuB;CAAG;AAEpG,MAAM,WAAW,gBAAiB,SAAQ,oBAAoB;CAAG;AAEjE,wCAAwC;AACxC,MAAM,WAAW,uBAAuB;IACpC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,oBACb,SAAQ,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,EAAE,SAAS,CAAC,EAAE,uBAAuB;CAAG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type TCommitMode = 'live' | 'settle';
|
|
2
|
+
/**
|
|
3
|
+
* Hex to publish.
|
|
4
|
+
* `''` clears on settle. `null` means "keep typing" or "not a color".
|
|
5
|
+
* Three-digit hex expands only on settle, so `#abcdef` can be typed.
|
|
6
|
+
*/
|
|
7
|
+
export declare const commitHexInput: (raw: string, mode: TCommitMode) => string | null;
|
|
8
|
+
/** How a stored string should look in the field before the user edits it. */
|
|
9
|
+
export declare const describeColorValue: (value: string | null | undefined) => {
|
|
10
|
+
text: string;
|
|
11
|
+
hex: string | null;
|
|
12
|
+
unrecognized: boolean;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/color-field/utils.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,QAAQ,CAAC;AAK5C;;;;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"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IColorPickerProps } from './types';
|
|
2
|
+
export declare const ColorPicker: (({ ref, value, defaultValue, onChange, onPreview, onHueChange, hue, presets, disabled, className, dataTestId, "aria-label": ariaLabel, }: IColorPickerProps) => import("react").JSX.Element) & {
|
|
3
|
+
displayName?: string;
|
|
4
|
+
};
|
|
5
|
+
//# sourceMappingURL=Component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Component.d.ts","sourceRoot":"","sources":["../../../src/color-picker/Component.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAUjD,eAAO,MAAM,WAAW,6IAcjB,iBAAiB;;CAgIvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/color-picker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { IDataTestIdProps } from '../ds/common/index.js';
|
|
3
|
+
/** Own / chrome props (not from RAC). */
|
|
4
|
+
export interface IColorPickerOwnProps extends IDataTestIdProps {
|
|
5
|
+
/**
|
|
6
|
+
* Preset swatches.
|
|
7
|
+
* Values that are not colors are dropped. No row when empty.
|
|
8
|
+
*/
|
|
9
|
+
presets?: string[];
|
|
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. */
|
|
16
|
+
className?: string;
|
|
17
|
+
/** Ref to the palette root (React 19 prop). */
|
|
18
|
+
ref?: Ref<HTMLDivElement>;
|
|
19
|
+
'aria-label'?: string;
|
|
20
|
+
}
|
|
21
|
+
/** Control state (our names, not RAC). */
|
|
22
|
+
export interface IColorPickerControlProps {
|
|
23
|
+
/** `#rrggbb` or `''`. Empty shows a gray draft and is not emitted. */
|
|
24
|
+
value?: string;
|
|
25
|
+
/** `#rrggbb` or `''`. */
|
|
26
|
+
defaultValue?: string;
|
|
27
|
+
/** Canonical `#rrggbb`. Empty is never emitted. */
|
|
28
|
+
onChange?: (value: string) => void;
|
|
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;
|
|
34
|
+
}
|
|
35
|
+
export interface IColorPickerProps extends IColorPickerOwnProps, IColorPickerControlProps {
|
|
36
|
+
}
|
|
37
|
+
//# 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,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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Color } from 'react-aria-components';
|
|
2
|
+
/** Draft shown in the panel when the value 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 declare const hexOf: (color: Color) => string;
|
|
7
|
+
/**
|
|
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.
|
|
10
|
+
*/
|
|
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;
|
|
14
|
+
/** Preset list as unique `#rrggbb`. Drops values that are not colors. */
|
|
15
|
+
export declare const validPresetHexes: (presets: readonly string[] | undefined) => string[];
|
|
16
|
+
//# 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;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"}
|
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-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,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-CBnhxD86.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-BPN5FgKq.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-BPN5FgKq.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
|