@cerberus-design/react 0.15.0-next-32cd15e → 0.15.0-next-199cf16
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/build/legacy/_tsup-dts-rollup.d.cts +35 -3
- package/build/legacy/components/DatePicker.client.cjs +37 -30
- package/build/legacy/components/DatePicker.client.cjs.map +1 -1
- package/build/legacy/components/button/button.cjs +154 -0
- package/build/legacy/components/button/button.cjs.map +1 -0
- package/build/legacy/components/button/index.cjs +163 -0
- package/build/legacy/components/button/index.cjs.map +1 -0
- package/build/legacy/components/button/parts.cjs +159 -0
- package/build/legacy/components/button/parts.cjs.map +1 -0
- package/build/legacy/components/deprecated/NavMenuTrigger.cjs.map +1 -1
- package/build/legacy/context/confirm-modal.cjs +53 -44
- package/build/legacy/context/confirm-modal.cjs.map +1 -1
- package/build/legacy/context/cta-modal.cjs +53 -44
- package/build/legacy/context/cta-modal.cjs.map +1 -1
- package/build/legacy/context/notification-center.cjs +22 -15
- package/build/legacy/context/notification-center.cjs.map +1 -1
- package/build/legacy/context/prompt-modal.cjs +75 -66
- package/build/legacy/context/prompt-modal.cjs.map +1 -1
- package/build/legacy/index.cjs +416 -393
- package/build/legacy/index.cjs.map +1 -1
- package/build/modern/_tsup-dts-rollup.d.ts +35 -3
- package/build/modern/{chunk-BRVZVAPT.js → chunk-245SMQ45.js} +1 -1
- package/build/modern/chunk-245SMQ45.js.map +1 -0
- package/build/modern/{chunk-ISCJ542I.js → chunk-2HOUQ2DX.js} +2 -2
- package/build/modern/chunk-2JX27W6Y.js +15 -0
- package/build/modern/chunk-2JX27W6Y.js.map +1 -0
- package/build/modern/{chunk-F5OVI74O.js → chunk-3RGRHMJQ.js} +6 -6
- package/build/modern/chunk-3RGRHMJQ.js.map +1 -0
- package/build/modern/{chunk-FV4UITYD.js → chunk-5QONP7GT.js} +4 -4
- package/build/modern/{chunk-O6LFWUHI.js → chunk-7P7OWBGV.js} +2 -2
- package/build/modern/{chunk-UNDJYNQC.js → chunk-7S47NSGR.js} +6 -6
- package/build/modern/chunk-7S47NSGR.js.map +1 -0
- package/build/modern/{chunk-25HMVHLT.js → chunk-7SU6FCTJ.js} +5 -5
- package/build/modern/chunk-CYC2YUKU.js +1 -0
- package/build/modern/{chunk-NJSETNRL.js → chunk-DXBZ3HMY.js} +2 -2
- package/build/modern/{chunk-A6BRQ2QK.js → chunk-KU2AWAK3.js} +2 -2
- package/build/modern/chunk-KU2AWAK3.js.map +1 -0
- package/build/modern/chunk-MER66QUY.js +52 -0
- package/build/modern/chunk-MER66QUY.js.map +1 -0
- package/build/modern/{chunk-EDARV2EI.js → chunk-MISIUX63.js} +4 -4
- package/build/modern/{chunk-N24COMHJ.js → chunk-NGOLRISW.js} +4 -4
- package/build/modern/{chunk-ZUXK7V4G.js → chunk-Q4IV5NUT.js} +9 -9
- package/build/modern/chunk-Q4IV5NUT.js.map +1 -0
- package/build/modern/{chunk-GCQMH4QA.js → chunk-SXLPDPOZ.js} +4 -4
- package/build/modern/{chunk-MZ3UCDUL.js → chunk-VYCU7I4J.js} +4 -4
- package/build/modern/{chunk-FOKO6LKG.js → chunk-Z7FGXAND.js} +7 -7
- package/build/modern/chunk-Z7FGXAND.js.map +1 -0
- package/build/modern/components/AccordionItemGroup.js +1 -1
- package/build/modern/components/Admonition.client.js +3 -3
- package/build/modern/components/Admonition.js +4 -4
- package/build/modern/components/Avatar.js +2 -2
- package/build/modern/components/Checkbox.js +2 -2
- package/build/modern/components/DatePicker.client.js +4 -2
- package/build/modern/components/FileStatus.js +3 -3
- package/build/modern/components/FileUploader.js +3 -3
- package/build/modern/components/Input.js +2 -2
- package/build/modern/components/Select.js +2 -2
- package/build/modern/components/Tag.js +2 -2
- package/build/modern/components/button/button.js +12 -0
- package/build/modern/components/button/button.js.map +1 -0
- package/build/modern/components/button/index.js +16 -0
- package/build/modern/components/button/index.js.map +1 -0
- package/build/modern/components/button/parts.js +10 -0
- package/build/modern/components/button/parts.js.map +1 -0
- package/build/modern/components/deprecated/NavMenuTrigger.js +1 -1
- package/build/modern/context/confirm-modal.js +5 -4
- package/build/modern/context/cta-modal.js +5 -4
- package/build/modern/context/notification-center.js +5 -4
- package/build/modern/context/prompt-modal.js +6 -5
- package/build/modern/index.js +52 -45
- package/build/modern/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/DatePicker.client.tsx +1 -1
- package/src/components/button/button.tsx +77 -0
- package/src/components/button/index.ts +2 -0
- package/src/components/button/parts.ts +26 -0
- package/src/components/deprecated/NavMenuTrigger.tsx +1 -1
- package/src/context/confirm-modal.tsx +1 -1
- package/src/context/cta-modal.tsx +1 -1
- package/src/context/notification-center.tsx +1 -1
- package/src/context/prompt-modal.tsx +1 -1
- package/src/index.ts +1 -1
- package/build/legacy/components/Button.cjs +0 -51
- package/build/legacy/components/Button.cjs.map +0 -1
- package/build/modern/chunk-A6BRQ2QK.js.map +0 -1
- package/build/modern/chunk-BRVZVAPT.js.map +0 -1
- package/build/modern/chunk-F5OVI74O.js.map +0 -1
- package/build/modern/chunk-FOKO6LKG.js.map +0 -1
- package/build/modern/chunk-STNRGV3Y.js +0 -29
- package/build/modern/chunk-STNRGV3Y.js.map +0 -1
- package/build/modern/chunk-UNDJYNQC.js.map +0 -1
- package/build/modern/chunk-ZUXK7V4G.js.map +0 -1
- package/build/modern/components/Button.js +0 -7
- package/src/components/Button.tsx +0 -36
- /package/build/modern/{chunk-ISCJ542I.js.map → chunk-2HOUQ2DX.js.map} +0 -0
- /package/build/modern/{chunk-FV4UITYD.js.map → chunk-5QONP7GT.js.map} +0 -0
- /package/build/modern/{chunk-O6LFWUHI.js.map → chunk-7P7OWBGV.js.map} +0 -0
- /package/build/modern/{chunk-25HMVHLT.js.map → chunk-7SU6FCTJ.js.map} +0 -0
- /package/build/modern/{components/Button.js.map → chunk-CYC2YUKU.js.map} +0 -0
- /package/build/modern/{chunk-NJSETNRL.js.map → chunk-DXBZ3HMY.js.map} +0 -0
- /package/build/modern/{chunk-EDARV2EI.js.map → chunk-MISIUX63.js.map} +0 -0
- /package/build/modern/{chunk-N24COMHJ.js.map → chunk-NGOLRISW.js.map} +0 -0
- /package/build/modern/{chunk-GCQMH4QA.js.map → chunk-SXLPDPOZ.js.map} +0 -0
- /package/build/modern/{chunk-MZ3UCDUL.js.map → chunk-VYCU7I4J.js.map} +0 -0
package/build/legacy/index.cjs
CHANGED
|
@@ -32,6 +32,8 @@ __export(src_exports, {
|
|
|
32
32
|
AdmonitionHeading: () => AdmonitionHeading,
|
|
33
33
|
Avatar: () => Avatar,
|
|
34
34
|
Button: () => Button,
|
|
35
|
+
ButtonIcon: () => ButtonIcon,
|
|
36
|
+
ButtonParts: () => ButtonParts,
|
|
35
37
|
CTAModal: () => CTAModal,
|
|
36
38
|
CerberusProvider: () => CerberusProvider,
|
|
37
39
|
Checkbox: () => Checkbox,
|
|
@@ -799,16 +801,101 @@ function AdmonitionDescription(props) {
|
|
|
799
801
|
);
|
|
800
802
|
}
|
|
801
803
|
|
|
802
|
-
// src/components/
|
|
804
|
+
// src/components/button/button.tsx
|
|
805
|
+
var import_react9 = require("react");
|
|
803
806
|
var import_css14 = require("@cerberus/styled-system/css");
|
|
804
807
|
var import_recipes9 = require("@cerberus/styled-system/recipes");
|
|
808
|
+
|
|
809
|
+
// src/components/Spinner.tsx
|
|
805
810
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
806
|
-
function
|
|
807
|
-
const { palette, usage, shape, size, ...nativeProps } = props;
|
|
811
|
+
function Spinner(props) {
|
|
808
812
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
813
|
+
"svg",
|
|
814
|
+
{
|
|
815
|
+
"aria-busy": "true",
|
|
816
|
+
role: "status",
|
|
817
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
818
|
+
height: props.size,
|
|
819
|
+
width: props.size,
|
|
820
|
+
viewBox: "0 0 24 24",
|
|
821
|
+
...props,
|
|
822
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
823
|
+
"g",
|
|
824
|
+
{
|
|
825
|
+
fill: "none",
|
|
826
|
+
stroke: "currentColor",
|
|
827
|
+
strokeLinecap: "round",
|
|
828
|
+
strokeLinejoin: "round",
|
|
829
|
+
strokeWidth: 2,
|
|
830
|
+
children: [
|
|
831
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
832
|
+
"path",
|
|
833
|
+
{
|
|
834
|
+
strokeDasharray: 16,
|
|
835
|
+
strokeDashoffset: 16,
|
|
836
|
+
d: "M12 3c4.97 0 9 4.03 9 9",
|
|
837
|
+
children: [
|
|
838
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
839
|
+
"animate",
|
|
840
|
+
{
|
|
841
|
+
fill: "freeze",
|
|
842
|
+
attributeName: "stroke-dashoffset",
|
|
843
|
+
dur: "0.15s",
|
|
844
|
+
values: "16;0"
|
|
845
|
+
}
|
|
846
|
+
),
|
|
847
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
848
|
+
"animateTransform",
|
|
849
|
+
{
|
|
850
|
+
attributeName: "transform",
|
|
851
|
+
dur: "0.75s",
|
|
852
|
+
repeatCount: "indefinite",
|
|
853
|
+
type: "rotate",
|
|
854
|
+
values: "0 12 12;360 12 12"
|
|
855
|
+
}
|
|
856
|
+
)
|
|
857
|
+
]
|
|
858
|
+
}
|
|
859
|
+
),
|
|
860
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
861
|
+
"path",
|
|
862
|
+
{
|
|
863
|
+
strokeDasharray: 64,
|
|
864
|
+
strokeDashoffset: 64,
|
|
865
|
+
strokeOpacity: 0.3,
|
|
866
|
+
d: "M12 3c4.97 0 9 4.03 9 9c0 4.97 -4.03 9 -9 9c-4.97 0 -9 -4.03 -9 -9c0 -4.97 4.03 -9 9 -9Z",
|
|
867
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
868
|
+
"animate",
|
|
869
|
+
{
|
|
870
|
+
fill: "freeze",
|
|
871
|
+
attributeName: "stroke-dashoffset",
|
|
872
|
+
dur: "0.6s",
|
|
873
|
+
values: "64;0"
|
|
874
|
+
}
|
|
875
|
+
)
|
|
876
|
+
}
|
|
877
|
+
)
|
|
878
|
+
]
|
|
879
|
+
}
|
|
880
|
+
)
|
|
881
|
+
}
|
|
882
|
+
);
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
// src/components/button/button.tsx
|
|
886
|
+
var import_jsx = require("@cerberus/styled-system/jsx");
|
|
887
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
888
|
+
var ButtonContext = (0, import_react9.createContext)({
|
|
889
|
+
pending: false
|
|
890
|
+
});
|
|
891
|
+
function Button(props) {
|
|
892
|
+
const { palette, usage, shape, size, pending = false, ...nativeProps } = props;
|
|
893
|
+
const value = (0, import_react9.useMemo)(() => ({ pending }), [pending]);
|
|
894
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ButtonContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
809
895
|
"button",
|
|
810
896
|
{
|
|
811
897
|
...nativeProps,
|
|
898
|
+
disabled: pending || nativeProps.disabled,
|
|
812
899
|
className: (0, import_css14.cx)(
|
|
813
900
|
nativeProps.className,
|
|
814
901
|
(0, import_recipes9.button)({
|
|
@@ -819,8 +906,18 @@ function Button(props) {
|
|
|
819
906
|
})
|
|
820
907
|
)
|
|
821
908
|
}
|
|
822
|
-
);
|
|
909
|
+
) });
|
|
823
910
|
}
|
|
911
|
+
function ButtonIcon(props) {
|
|
912
|
+
const { pending } = (0, import_react9.useContext)(ButtonContext);
|
|
913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Show, { when: pending, fallback: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_jsx_runtime17.Fragment, { children: props.children }), children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_jsx.Box, { w: "4", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Spinner, {}) }) });
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
// src/components/button/parts.ts
|
|
917
|
+
var ButtonParts = {
|
|
918
|
+
Root: Button,
|
|
919
|
+
Icon: ButtonIcon
|
|
920
|
+
};
|
|
824
921
|
|
|
825
922
|
// src/components/Checkbox.tsx
|
|
826
923
|
var import_recipes10 = require("@cerberus/styled-system/recipes");
|
|
@@ -828,11 +925,11 @@ var import_patterns5 = require("@cerberus/styled-system/patterns");
|
|
|
828
925
|
var import_css15 = require("@cerberus/styled-system/css");
|
|
829
926
|
|
|
830
927
|
// src/context/field.tsx
|
|
831
|
-
var
|
|
832
|
-
var
|
|
833
|
-
var FieldContext = (0,
|
|
928
|
+
var import_react10 = require("react");
|
|
929
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
930
|
+
var FieldContext = (0, import_react10.createContext)(null);
|
|
834
931
|
function Field(props) {
|
|
835
|
-
const value = (0,
|
|
932
|
+
const value = (0, import_react10.useMemo)(
|
|
836
933
|
() => ({
|
|
837
934
|
disabled: props.disabled,
|
|
838
935
|
readOnly: props.readOnly,
|
|
@@ -841,10 +938,10 @@ function Field(props) {
|
|
|
841
938
|
}),
|
|
842
939
|
[props.disabled, props.readOnly, props.required, props.invalid]
|
|
843
940
|
);
|
|
844
|
-
return /* @__PURE__ */ (0,
|
|
941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(FieldContext.Provider, { value, children: props.children });
|
|
845
942
|
}
|
|
846
943
|
function useFieldContext() {
|
|
847
|
-
const context = (0,
|
|
944
|
+
const context = (0, import_react10.useContext)(FieldContext);
|
|
848
945
|
if (!context) {
|
|
849
946
|
throw new Error("useFieldContext must be used within a Field Provider.");
|
|
850
947
|
}
|
|
@@ -852,7 +949,7 @@ function useFieldContext() {
|
|
|
852
949
|
}
|
|
853
950
|
|
|
854
951
|
// src/components/Checkbox.tsx
|
|
855
|
-
var
|
|
952
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
856
953
|
function Checkbox(props) {
|
|
857
954
|
const { describedBy, size, checked, mixed, ...nativeProps } = props;
|
|
858
955
|
const { invalid, ...fieldStates } = useFieldContext();
|
|
@@ -865,7 +962,7 @@ function Checkbox(props) {
|
|
|
865
962
|
if (!IndeterminateIcon2) {
|
|
866
963
|
throw new Error("The CerberusProvider is missing the indeterminate icon.");
|
|
867
964
|
}
|
|
868
|
-
return /* @__PURE__ */ (0,
|
|
965
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
869
966
|
"div",
|
|
870
967
|
{
|
|
871
968
|
className: (0, import_css15.cx)(
|
|
@@ -876,7 +973,7 @@ function Checkbox(props) {
|
|
|
876
973
|
})
|
|
877
974
|
),
|
|
878
975
|
children: [
|
|
879
|
-
/* @__PURE__ */ (0,
|
|
976
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
880
977
|
"input",
|
|
881
978
|
{
|
|
882
979
|
...nativeProps,
|
|
@@ -888,8 +985,8 @@ function Checkbox(props) {
|
|
|
888
985
|
type: "checkbox"
|
|
889
986
|
}
|
|
890
987
|
),
|
|
891
|
-
/* @__PURE__ */ (0,
|
|
892
|
-
/* @__PURE__ */ (0,
|
|
988
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Show, { when: checked && !mixed, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: styles.icon, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CheckIcon, {}) }) }),
|
|
989
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Show, { when: mixed, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: styles.icon, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(IndeterminateIcon2, {}) }) })
|
|
893
990
|
]
|
|
894
991
|
}
|
|
895
992
|
);
|
|
@@ -898,14 +995,14 @@ function Checkbox(props) {
|
|
|
898
995
|
// src/components/CircularProgress.tsx
|
|
899
996
|
var import_patterns6 = require("@cerberus/styled-system/patterns");
|
|
900
997
|
var import_css16 = require("@cerberus/styled-system/css");
|
|
901
|
-
var
|
|
998
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
902
999
|
function CircularProgress(props) {
|
|
903
1000
|
const strokeW = 14;
|
|
904
1001
|
const radius = `calc(50% * (1 - ${strokeW}/100))`;
|
|
905
1002
|
const status = props.syntax ?? "Done";
|
|
906
1003
|
const now = props.now >= 100 ? 100 : props.now;
|
|
907
1004
|
const bgStyle = props.bgStyle ?? "filled";
|
|
908
|
-
return /* @__PURE__ */ (0,
|
|
1005
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
909
1006
|
"div",
|
|
910
1007
|
{
|
|
911
1008
|
id: props.id,
|
|
@@ -920,7 +1017,7 @@ function CircularProgress(props) {
|
|
|
920
1017
|
position: "relative"
|
|
921
1018
|
}),
|
|
922
1019
|
role: "progressbar",
|
|
923
|
-
children: /* @__PURE__ */ (0,
|
|
1020
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
924
1021
|
"svg",
|
|
925
1022
|
{
|
|
926
1023
|
"data-complete": now === 100,
|
|
@@ -935,17 +1032,17 @@ function CircularProgress(props) {
|
|
|
935
1032
|
viewBox: "0 0 100 100",
|
|
936
1033
|
xmlns: "http://www.w3.org/2000/svg",
|
|
937
1034
|
children: [
|
|
938
|
-
/* @__PURE__ */ (0,
|
|
939
|
-
/* @__PURE__ */ (0,
|
|
940
|
-
/* @__PURE__ */ (0,
|
|
941
|
-
/* @__PURE__ */ (0,
|
|
1035
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("title", { children: props.title }),
|
|
1036
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("desc", { children: `${now}% ${status}` }),
|
|
1037
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("linearGradient", { id: "gradient", children: [
|
|
1038
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
942
1039
|
"stop",
|
|
943
1040
|
{
|
|
944
1041
|
offset: "0%",
|
|
945
1042
|
stopColor: "var(--cerberus-colors-data-viz-progress-start)"
|
|
946
1043
|
}
|
|
947
1044
|
),
|
|
948
|
-
/* @__PURE__ */ (0,
|
|
1045
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
949
1046
|
"stop",
|
|
950
1047
|
{
|
|
951
1048
|
offset: "100%",
|
|
@@ -953,7 +1050,7 @@ function CircularProgress(props) {
|
|
|
953
1050
|
}
|
|
954
1051
|
)
|
|
955
1052
|
] }) }),
|
|
956
|
-
/* @__PURE__ */ (0,
|
|
1053
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Show, { when: bgStyle === "filled", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
957
1054
|
"circle",
|
|
958
1055
|
{
|
|
959
1056
|
className: (0, import_css16.css)({
|
|
@@ -965,7 +1062,7 @@ function CircularProgress(props) {
|
|
|
965
1062
|
pathLength: "100"
|
|
966
1063
|
}
|
|
967
1064
|
) }),
|
|
968
|
-
/* @__PURE__ */ (0,
|
|
1065
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
969
1066
|
"circle",
|
|
970
1067
|
{
|
|
971
1068
|
className: (0, import_css16.css)({
|
|
@@ -977,7 +1074,7 @@ function CircularProgress(props) {
|
|
|
977
1074
|
pathLength: "100"
|
|
978
1075
|
}
|
|
979
1076
|
),
|
|
980
|
-
/* @__PURE__ */ (0,
|
|
1077
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
981
1078
|
"circle",
|
|
982
1079
|
{
|
|
983
1080
|
"data-complete": now === 100,
|
|
@@ -998,8 +1095,8 @@ function CircularProgress(props) {
|
|
|
998
1095
|
transform: "rotate(-90 50 50)"
|
|
999
1096
|
}
|
|
1000
1097
|
),
|
|
1001
|
-
/* @__PURE__ */ (0,
|
|
1002
|
-
/* @__PURE__ */ (0,
|
|
1098
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("g", { children: [
|
|
1099
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1003
1100
|
"text",
|
|
1004
1101
|
{
|
|
1005
1102
|
className: (0, import_css16.css)({
|
|
@@ -1017,7 +1114,7 @@ function CircularProgress(props) {
|
|
|
1017
1114
|
]
|
|
1018
1115
|
}
|
|
1019
1116
|
),
|
|
1020
|
-
/* @__PURE__ */ (0,
|
|
1117
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1021
1118
|
"text",
|
|
1022
1119
|
{
|
|
1023
1120
|
className: (0, import_css16.css)({
|
|
@@ -1041,26 +1138,26 @@ function CircularProgress(props) {
|
|
|
1041
1138
|
}
|
|
1042
1139
|
|
|
1043
1140
|
// src/components/DatePicker.client.tsx
|
|
1044
|
-
var
|
|
1141
|
+
var import_react13 = require("@ark-ui/react");
|
|
1045
1142
|
|
|
1046
1143
|
// src/components/Portal.tsx
|
|
1047
|
-
var
|
|
1048
|
-
var Portal =
|
|
1144
|
+
var import_react11 = require("@ark-ui/react");
|
|
1145
|
+
var Portal = import_react11.Portal;
|
|
1049
1146
|
|
|
1050
1147
|
// src/components/DatePicker.client.tsx
|
|
1051
1148
|
var import_recipes13 = require("@cerberus/styled-system/recipes");
|
|
1052
1149
|
var import_css19 = require("@cerberus/styled-system/css");
|
|
1053
1150
|
|
|
1054
1151
|
// src/components/DatePicker.server.tsx
|
|
1055
|
-
var
|
|
1152
|
+
var import_react12 = require("@ark-ui/react");
|
|
1056
1153
|
var import_css17 = require("@cerberus/styled-system/css");
|
|
1057
1154
|
var import_recipes11 = require("@cerberus/styled-system/recipes");
|
|
1058
|
-
var
|
|
1155
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1059
1156
|
var datePickerStyles = (0, import_recipes11.datePicker)();
|
|
1060
1157
|
function DatePickerLabel(props) {
|
|
1061
1158
|
const { className, ...arkProps } = props;
|
|
1062
|
-
return /* @__PURE__ */ (0,
|
|
1063
|
-
|
|
1159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1160
|
+
import_react12.DatePicker.Label,
|
|
1064
1161
|
{
|
|
1065
1162
|
...arkProps,
|
|
1066
1163
|
className: (0, import_css17.cx)(
|
|
@@ -1073,8 +1170,8 @@ function DatePickerLabel(props) {
|
|
|
1073
1170
|
);
|
|
1074
1171
|
}
|
|
1075
1172
|
function DatePickerViewControl(props) {
|
|
1076
|
-
return /* @__PURE__ */ (0,
|
|
1077
|
-
|
|
1173
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1174
|
+
import_react12.DatePicker.Control,
|
|
1078
1175
|
{
|
|
1079
1176
|
...props,
|
|
1080
1177
|
className: (0, import_css17.cx)(props.className, datePickerStyles.viewControl)
|
|
@@ -1082,8 +1179,8 @@ function DatePickerViewControl(props) {
|
|
|
1082
1179
|
);
|
|
1083
1180
|
}
|
|
1084
1181
|
function DatePickerTable(props) {
|
|
1085
|
-
return /* @__PURE__ */ (0,
|
|
1086
|
-
|
|
1182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1183
|
+
import_react12.DatePicker.Table,
|
|
1087
1184
|
{
|
|
1088
1185
|
...props,
|
|
1089
1186
|
className: (0, import_css17.cx)(props.className, datePickerStyles.table)
|
|
@@ -1091,8 +1188,8 @@ function DatePickerTable(props) {
|
|
|
1091
1188
|
);
|
|
1092
1189
|
}
|
|
1093
1190
|
function DatePickerTableHeader(props) {
|
|
1094
|
-
return /* @__PURE__ */ (0,
|
|
1095
|
-
|
|
1191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1192
|
+
import_react12.DatePicker.TableHeader,
|
|
1096
1193
|
{
|
|
1097
1194
|
...props,
|
|
1098
1195
|
className: (0, import_css17.cx)(props.className, datePickerStyles.tableHeader)
|
|
@@ -1100,8 +1197,8 @@ function DatePickerTableHeader(props) {
|
|
|
1100
1197
|
);
|
|
1101
1198
|
}
|
|
1102
1199
|
function DatePickerTableCell(props) {
|
|
1103
|
-
return /* @__PURE__ */ (0,
|
|
1104
|
-
|
|
1200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1201
|
+
import_react12.DatePicker.TableCell,
|
|
1105
1202
|
{
|
|
1106
1203
|
...props,
|
|
1107
1204
|
className: (0, import_css17.cx)(props.className, datePickerStyles.tableCell)
|
|
@@ -1109,24 +1206,24 @@ function DatePickerTableCell(props) {
|
|
|
1109
1206
|
);
|
|
1110
1207
|
}
|
|
1111
1208
|
function DatePickerTableCellTrigger(props) {
|
|
1112
|
-
return /* @__PURE__ */ (0,
|
|
1113
|
-
|
|
1209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1210
|
+
import_react12.DatePicker.TableCellTrigger,
|
|
1114
1211
|
{
|
|
1115
1212
|
...props,
|
|
1116
1213
|
className: (0, import_css17.cx)(props.className, datePickerStyles.tableCellTrigger)
|
|
1117
1214
|
}
|
|
1118
1215
|
);
|
|
1119
1216
|
}
|
|
1120
|
-
var DatePickerView =
|
|
1121
|
-
var DatePickerContext =
|
|
1217
|
+
var DatePickerView = import_react12.DatePicker.View;
|
|
1218
|
+
var DatePickerContext = import_react12.DatePicker.Context;
|
|
1122
1219
|
|
|
1123
1220
|
// src/components/IconButton.tsx
|
|
1124
1221
|
var import_css18 = require("@cerberus/styled-system/css");
|
|
1125
1222
|
var import_recipes12 = require("@cerberus/styled-system/recipes");
|
|
1126
|
-
var
|
|
1223
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1127
1224
|
function IconButton(props) {
|
|
1128
1225
|
const { ariaLabel, palette, usage, size, ...nativeProps } = props;
|
|
1129
|
-
return /* @__PURE__ */ (0,
|
|
1226
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1130
1227
|
"button",
|
|
1131
1228
|
{
|
|
1132
1229
|
...nativeProps,
|
|
@@ -1144,13 +1241,13 @@ function IconButton(props) {
|
|
|
1144
1241
|
}
|
|
1145
1242
|
|
|
1146
1243
|
// src/components/DatePicker.client.tsx
|
|
1147
|
-
var
|
|
1148
|
-
var
|
|
1244
|
+
var import_react14 = require("react");
|
|
1245
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1149
1246
|
var datePickerStyles2 = (0, import_recipes13.datePicker)();
|
|
1150
1247
|
function DatePicker(props) {
|
|
1151
1248
|
const states = useFieldContext();
|
|
1152
|
-
return /* @__PURE__ */ (0,
|
|
1153
|
-
|
|
1249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1250
|
+
import_react13.DatePicker.Root,
|
|
1154
1251
|
{
|
|
1155
1252
|
...props,
|
|
1156
1253
|
...states,
|
|
@@ -1163,9 +1260,9 @@ function DatePicker(props) {
|
|
|
1163
1260
|
function DatePickerViewControlGroup(props) {
|
|
1164
1261
|
const { icons } = useCerberusContext();
|
|
1165
1262
|
const { calendarPrev: PrevIcon, calendarNext: NextIcon } = icons;
|
|
1166
|
-
return /* @__PURE__ */ (0,
|
|
1167
|
-
/* @__PURE__ */ (0,
|
|
1168
|
-
/* @__PURE__ */ (0,
|
|
1263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(DatePickerViewControl, { ...props, children: [
|
|
1264
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react13.DatePicker.PrevTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(IconButton, { ariaLabel: "Previous", size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(PrevIcon, {}) }) }),
|
|
1265
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react13.DatePicker.ViewTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1169
1266
|
Button,
|
|
1170
1267
|
{
|
|
1171
1268
|
className: (0, import_css19.css)({
|
|
@@ -1175,17 +1272,17 @@ function DatePickerViewControlGroup(props) {
|
|
|
1175
1272
|
shape: "rounded",
|
|
1176
1273
|
size: "sm",
|
|
1177
1274
|
usage: "ghost",
|
|
1178
|
-
children: /* @__PURE__ */ (0,
|
|
1275
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react13.DatePicker.RangeText, {})
|
|
1179
1276
|
}
|
|
1180
1277
|
) }),
|
|
1181
|
-
/* @__PURE__ */ (0,
|
|
1278
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react13.DatePicker.NextTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(IconButton, { ariaLabel: "Next", size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(NextIcon, {}) }) })
|
|
1182
1279
|
] });
|
|
1183
1280
|
}
|
|
1184
1281
|
function DatePickerTrigger(props) {
|
|
1185
1282
|
const { icons } = useCerberusContext();
|
|
1186
1283
|
const { calendar: CalendarIcon } = icons;
|
|
1187
|
-
return /* @__PURE__ */ (0,
|
|
1188
|
-
|
|
1284
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1285
|
+
import_react13.DatePicker.Trigger,
|
|
1189
1286
|
{
|
|
1190
1287
|
...props,
|
|
1191
1288
|
className: (0, import_css19.cx)(
|
|
@@ -1196,16 +1293,16 @@ function DatePickerTrigger(props) {
|
|
|
1196
1293
|
}),
|
|
1197
1294
|
datePickerStyles2.trigger
|
|
1198
1295
|
),
|
|
1199
|
-
children: /* @__PURE__ */ (0,
|
|
1296
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CalendarIcon, {})
|
|
1200
1297
|
}
|
|
1201
1298
|
);
|
|
1202
1299
|
}
|
|
1203
1300
|
function DatePickerInput(props) {
|
|
1204
1301
|
const { invalid, ...fieldStates } = useFieldContext();
|
|
1205
|
-
return /* @__PURE__ */ (0,
|
|
1206
|
-
/* @__PURE__ */ (0,
|
|
1207
|
-
/* @__PURE__ */ (0,
|
|
1208
|
-
|
|
1302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react13.DatePicker.Control, { className: datePickerStyles2.control, children: [
|
|
1303
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DatePickerTrigger, {}),
|
|
1304
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1305
|
+
import_react13.DatePicker.Input,
|
|
1209
1306
|
{
|
|
1210
1307
|
...props,
|
|
1211
1308
|
...fieldStates,
|
|
@@ -1220,12 +1317,12 @@ function DatePickerInput(props) {
|
|
|
1220
1317
|
function RangePickerInput(props) {
|
|
1221
1318
|
const { invalid, ...fieldStates } = useFieldContext();
|
|
1222
1319
|
const { defaultValue, ...nativeProps } = props;
|
|
1223
|
-
const startDate = (0,
|
|
1224
|
-
const endDate = (0,
|
|
1225
|
-
return /* @__PURE__ */ (0,
|
|
1226
|
-
/* @__PURE__ */ (0,
|
|
1227
|
-
/* @__PURE__ */ (0,
|
|
1228
|
-
|
|
1320
|
+
const startDate = (0, import_react14.useMemo)(() => defaultValue == null ? void 0 : defaultValue[0], [defaultValue]);
|
|
1321
|
+
const endDate = (0, import_react14.useMemo)(() => defaultValue == null ? void 0 : defaultValue[1], [defaultValue]);
|
|
1322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react13.DatePicker.Control, { "data-range": true, className: datePickerStyles2.control, children: [
|
|
1323
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DatePickerTrigger, {}),
|
|
1324
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1325
|
+
import_react13.DatePicker.Input,
|
|
1229
1326
|
{
|
|
1230
1327
|
...nativeProps,
|
|
1231
1328
|
...fieldStates,
|
|
@@ -1238,8 +1335,8 @@ function RangePickerInput(props) {
|
|
|
1238
1335
|
index: 0
|
|
1239
1336
|
}
|
|
1240
1337
|
),
|
|
1241
|
-
/* @__PURE__ */ (0,
|
|
1242
|
-
|
|
1338
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1339
|
+
import_react13.DatePicker.Input,
|
|
1243
1340
|
{
|
|
1244
1341
|
...nativeProps,
|
|
1245
1342
|
...fieldStates,
|
|
@@ -1257,8 +1354,8 @@ function RangePickerInput(props) {
|
|
|
1257
1354
|
}
|
|
1258
1355
|
function DatePickerContent(props) {
|
|
1259
1356
|
const { children, withModal, ...contentProps } = props;
|
|
1260
|
-
return /* @__PURE__ */ (0,
|
|
1261
|
-
|
|
1357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Portal, { disabled: withModal ?? false, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react13.DatePicker.Positioner, { className: datePickerStyles2.positioner, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1358
|
+
import_react13.DatePicker.Content,
|
|
1262
1359
|
{
|
|
1263
1360
|
...contentProps,
|
|
1264
1361
|
className: (0, import_css19.cx)(contentProps.className, datePickerStyles2.content),
|
|
@@ -1283,11 +1380,11 @@ function DatePickerDayView(props) {
|
|
|
1283
1380
|
if (isPastDay(date)) return "past";
|
|
1284
1381
|
return "future";
|
|
1285
1382
|
}
|
|
1286
|
-
return /* @__PURE__ */ (0,
|
|
1287
|
-
/* @__PURE__ */ (0,
|
|
1288
|
-
/* @__PURE__ */ (0,
|
|
1289
|
-
/* @__PURE__ */ (0,
|
|
1290
|
-
/* @__PURE__ */ (0,
|
|
1383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DatePickerView, { ...props, view: "day", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DatePickerContext, { children: (datePicker3) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
1384
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DatePickerViewControlGroup, {}),
|
|
1385
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(DatePickerTable, { children: [
|
|
1386
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react13.DatePicker.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react13.DatePicker.TableRow, { children: datePicker3.weekDays.map((weekDay, id) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DatePickerTableHeader, { children: weekDay.narrow }, id)) }) }),
|
|
1387
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react13.DatePicker.TableBody, { children: datePicker3.weeks.map((week, id) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react13.DatePicker.TableRow, { children: week.map((day, id2) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DatePickerTableCell, { value: day, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1291
1388
|
DatePickerTableCellTrigger,
|
|
1292
1389
|
{
|
|
1293
1390
|
"data-date": getDayValue(day),
|
|
@@ -1298,84 +1395,84 @@ function DatePickerDayView(props) {
|
|
|
1298
1395
|
] }) }) });
|
|
1299
1396
|
}
|
|
1300
1397
|
function DatePickerMonthView(props) {
|
|
1301
|
-
return /* @__PURE__ */ (0,
|
|
1302
|
-
/* @__PURE__ */ (0,
|
|
1303
|
-
/* @__PURE__ */ (0,
|
|
1398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react13.DatePicker.View, { ...props, view: "month", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react13.DatePicker.Context, { children: (datePicker3) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
1399
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DatePickerViewControlGroup, {}),
|
|
1400
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DatePickerTable, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react13.DatePicker.TableBody, { children: datePicker3.getMonthsGrid({ columns: 4, format: "short" }).map((months, id) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react13.DatePicker.TableRow, { children: months.map((month, id2) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DatePickerTableCell, { value: month.value, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DatePickerTableCellTrigger, { children: month.label }) }, id2)) }, id)) }) })
|
|
1304
1401
|
] }) }) });
|
|
1305
1402
|
}
|
|
1306
1403
|
function DatePickerYearView(props) {
|
|
1307
|
-
return /* @__PURE__ */ (0,
|
|
1308
|
-
/* @__PURE__ */ (0,
|
|
1309
|
-
/* @__PURE__ */ (0,
|
|
1404
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react13.DatePicker.View, { ...props, view: "year", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react13.DatePicker.Context, { children: (datePicker3) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
1405
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DatePickerViewControlGroup, {}),
|
|
1406
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DatePickerTable, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react13.DatePicker.TableBody, { children: datePicker3.getYearsGrid({ columns: 4 }).map((years, id) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react13.DatePicker.TableRow, { children: years.map((year, id2) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DatePickerTableCell, { value: year.value, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DatePickerTableCellTrigger, { children: year.label }) }, id2)) }, id)) }) })
|
|
1310
1407
|
] }) }) });
|
|
1311
1408
|
}
|
|
1312
1409
|
function DatePickerCalendar(props) {
|
|
1313
|
-
return /* @__PURE__ */ (0,
|
|
1314
|
-
/* @__PURE__ */ (0,
|
|
1315
|
-
/* @__PURE__ */ (0,
|
|
1316
|
-
/* @__PURE__ */ (0,
|
|
1410
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(DatePickerContent, { withModal: props.withModal, children: [
|
|
1411
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DatePickerDayView, {}),
|
|
1412
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DatePickerMonthView, {}),
|
|
1413
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DatePickerYearView, {})
|
|
1317
1414
|
] });
|
|
1318
1415
|
}
|
|
1319
1416
|
|
|
1320
1417
|
// src/components/Dialog.tsx
|
|
1321
|
-
var
|
|
1418
|
+
var import_react15 = require("@ark-ui/react");
|
|
1322
1419
|
var import_recipes14 = require("@cerberus/styled-system/recipes");
|
|
1323
1420
|
var import_css20 = require("@cerberus/styled-system/css");
|
|
1324
|
-
var
|
|
1421
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1325
1422
|
function DialogProvider(props) {
|
|
1326
|
-
return /* @__PURE__ */ (0,
|
|
1423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react15.Dialog.Root, { ...props });
|
|
1327
1424
|
}
|
|
1328
1425
|
function Dialog(props) {
|
|
1329
1426
|
const { size, ...contentProps } = props;
|
|
1330
1427
|
const styles = (0, import_recipes14.dialog)({ size });
|
|
1331
|
-
return /* @__PURE__ */ (0,
|
|
1332
|
-
/* @__PURE__ */ (0,
|
|
1333
|
-
/* @__PURE__ */ (0,
|
|
1428
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Portal, { children: [
|
|
1429
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogBackdrop, { className: styles.backdrop }),
|
|
1430
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogPositioner, { className: styles.positioner, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogContent, { className: styles.content, ...contentProps }) })
|
|
1334
1431
|
] });
|
|
1335
1432
|
}
|
|
1336
1433
|
function DialogHeading(props) {
|
|
1337
1434
|
const styles = (0, import_recipes14.dialog)();
|
|
1338
|
-
return /* @__PURE__ */ (0,
|
|
1435
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react15.Dialog.Title, { ...props, className: (0, import_css20.cx)(props.className, styles.title) });
|
|
1339
1436
|
}
|
|
1340
1437
|
function DialogDescription(props) {
|
|
1341
1438
|
const styles = (0, import_recipes14.dialog)();
|
|
1342
|
-
return /* @__PURE__ */ (0,
|
|
1343
|
-
|
|
1439
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1440
|
+
import_react15.Dialog.Description,
|
|
1344
1441
|
{
|
|
1345
1442
|
...props,
|
|
1346
1443
|
className: (0, import_css20.cx)(props.className, styles.description)
|
|
1347
1444
|
}
|
|
1348
1445
|
);
|
|
1349
1446
|
}
|
|
1350
|
-
var DialogTrigger =
|
|
1351
|
-
var DialogCloseTrigger =
|
|
1352
|
-
var DialogBackdrop =
|
|
1353
|
-
var DialogPositioner =
|
|
1354
|
-
var DialogContent =
|
|
1447
|
+
var DialogTrigger = import_react15.Dialog.Trigger;
|
|
1448
|
+
var DialogCloseTrigger = import_react15.Dialog.CloseTrigger;
|
|
1449
|
+
var DialogBackdrop = import_react15.Dialog.Backdrop;
|
|
1450
|
+
var DialogPositioner = import_react15.Dialog.Positioner;
|
|
1451
|
+
var DialogContent = import_react15.Dialog.Content;
|
|
1355
1452
|
|
|
1356
1453
|
// src/components/Dialog.client.tsx
|
|
1357
|
-
var
|
|
1454
|
+
var import_react16 = require("@ark-ui/react");
|
|
1358
1455
|
var import_recipes15 = require("@cerberus/styled-system/recipes");
|
|
1359
1456
|
var import_css21 = require("@cerberus/styled-system/css");
|
|
1360
|
-
var
|
|
1457
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1361
1458
|
function DialogCloseIconTrigger(props) {
|
|
1362
1459
|
const { icons } = useCerberusContext();
|
|
1363
1460
|
const { close: CloseIcon } = icons;
|
|
1364
1461
|
const styles = (0, import_recipes15.dialog)();
|
|
1365
|
-
return /* @__PURE__ */ (0,
|
|
1366
|
-
|
|
1462
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1463
|
+
import_react16.Dialog.CloseTrigger,
|
|
1367
1464
|
{
|
|
1368
1465
|
...props,
|
|
1369
1466
|
className: (0, import_css21.cx)(props.className, styles.closeTrigger),
|
|
1370
1467
|
asChild: true,
|
|
1371
|
-
children: /* @__PURE__ */ (0,
|
|
1468
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1372
1469
|
IconButton,
|
|
1373
1470
|
{
|
|
1374
1471
|
ariaLabel: "Close dialog",
|
|
1375
1472
|
palette: "action",
|
|
1376
1473
|
size: "lg",
|
|
1377
1474
|
usage: "ghost",
|
|
1378
|
-
children: /* @__PURE__ */ (0,
|
|
1475
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CloseIcon, {})
|
|
1379
1476
|
}
|
|
1380
1477
|
)
|
|
1381
1478
|
}
|
|
@@ -1384,18 +1481,18 @@ function DialogCloseIconTrigger(props) {
|
|
|
1384
1481
|
|
|
1385
1482
|
// src/components/Droppable.tsx
|
|
1386
1483
|
var import_core = require("@dnd-kit/core");
|
|
1387
|
-
var
|
|
1388
|
-
var
|
|
1484
|
+
var import_react17 = require("react");
|
|
1485
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1389
1486
|
function Droppable(props) {
|
|
1390
1487
|
const { dropped, id, disabled, data, resizeObserverConfig, ...nativeProps } = props;
|
|
1391
|
-
const uuid = (0,
|
|
1488
|
+
const uuid = (0, import_react17.useId)();
|
|
1392
1489
|
const { isOver, setNodeRef } = (0, import_core.useDroppable)({
|
|
1393
1490
|
data,
|
|
1394
1491
|
disabled,
|
|
1395
1492
|
id: id || uuid,
|
|
1396
1493
|
resizeObserverConfig
|
|
1397
1494
|
});
|
|
1398
|
-
return /* @__PURE__ */ (0,
|
|
1495
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1399
1496
|
"div",
|
|
1400
1497
|
{
|
|
1401
1498
|
...nativeProps,
|
|
@@ -1410,10 +1507,10 @@ function Droppable(props) {
|
|
|
1410
1507
|
// src/components/FieldMessage.tsx
|
|
1411
1508
|
var import_css22 = require("@cerberus/styled-system/css");
|
|
1412
1509
|
var import_recipes16 = require("@cerberus/styled-system/recipes");
|
|
1413
|
-
var
|
|
1510
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1414
1511
|
function FieldMessage(props) {
|
|
1415
1512
|
const { invalid } = useFieldContext();
|
|
1416
|
-
return /* @__PURE__ */ (0,
|
|
1513
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1417
1514
|
"small",
|
|
1418
1515
|
{
|
|
1419
1516
|
...props,
|
|
@@ -1424,14 +1521,14 @@ function FieldMessage(props) {
|
|
|
1424
1521
|
}
|
|
1425
1522
|
|
|
1426
1523
|
// src/context/feature-flags.tsx
|
|
1427
|
-
var
|
|
1428
|
-
var
|
|
1429
|
-
var FeatureFlagContext = (0,
|
|
1524
|
+
var import_react18 = require("react");
|
|
1525
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1526
|
+
var FeatureFlagContext = (0, import_react18.createContext)(null);
|
|
1430
1527
|
function FeatureFlags(props) {
|
|
1431
|
-
return /* @__PURE__ */ (0,
|
|
1528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(FeatureFlagContext.Provider, { value: props.flags, children: props.children });
|
|
1432
1529
|
}
|
|
1433
1530
|
function useFeatureFlags(key) {
|
|
1434
|
-
const context = (0,
|
|
1531
|
+
const context = (0, import_react18.useContext)(FeatureFlagContext);
|
|
1435
1532
|
if (context === null) {
|
|
1436
1533
|
throw new Error(
|
|
1437
1534
|
"useFeatureFlag must be used within a FeatureFlags Provider"
|
|
@@ -1441,18 +1538,18 @@ function useFeatureFlags(key) {
|
|
|
1441
1538
|
}
|
|
1442
1539
|
|
|
1443
1540
|
// src/components/FeatureFlag.tsx
|
|
1444
|
-
var
|
|
1541
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1445
1542
|
function FeatureFlag(props) {
|
|
1446
1543
|
const showContent = useFeatureFlags(props.flag);
|
|
1447
|
-
return /* @__PURE__ */ (0,
|
|
1544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Show, { when: showContent, children: props.children });
|
|
1448
1545
|
}
|
|
1449
1546
|
|
|
1450
1547
|
// src/components/Fieldset.tsx
|
|
1451
1548
|
var import_css23 = require("@cerberus/styled-system/css");
|
|
1452
|
-
var
|
|
1549
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1453
1550
|
function Fieldset(props) {
|
|
1454
1551
|
const { invalid, ...formState } = useFieldContext();
|
|
1455
|
-
return /* @__PURE__ */ (0,
|
|
1552
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1456
1553
|
"fieldset",
|
|
1457
1554
|
{
|
|
1458
1555
|
...props,
|
|
@@ -1473,10 +1570,10 @@ function Fieldset(props) {
|
|
|
1473
1570
|
// src/components/FieldsetLabel.tsx
|
|
1474
1571
|
var import_css24 = require("@cerberus/styled-system/css");
|
|
1475
1572
|
var import_recipes17 = require("@cerberus/styled-system/recipes");
|
|
1476
|
-
var
|
|
1573
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1477
1574
|
function FieldsetLabel(props) {
|
|
1478
1575
|
const { size, usage, ...nativeProps } = props;
|
|
1479
|
-
return /* @__PURE__ */ (0,
|
|
1576
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1480
1577
|
"label",
|
|
1481
1578
|
{
|
|
1482
1579
|
...nativeProps,
|
|
@@ -1492,7 +1589,7 @@ function FieldsetLabel(props) {
|
|
|
1492
1589
|
}
|
|
1493
1590
|
|
|
1494
1591
|
// src/components/FileStatus.tsx
|
|
1495
|
-
var
|
|
1592
|
+
var import_react19 = require("react");
|
|
1496
1593
|
var import_recipes19 = require("@cerberus/styled-system/recipes");
|
|
1497
1594
|
var import_css26 = require("@cerberus/styled-system/css");
|
|
1498
1595
|
var import_patterns7 = require("@cerberus/styled-system/patterns");
|
|
@@ -1500,7 +1597,7 @@ var import_patterns7 = require("@cerberus/styled-system/patterns");
|
|
|
1500
1597
|
// src/components/ProgressBar.tsx
|
|
1501
1598
|
var import_css25 = require("@cerberus/styled-system/css");
|
|
1502
1599
|
var import_recipes18 = require("@cerberus/styled-system/recipes");
|
|
1503
|
-
var
|
|
1600
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1504
1601
|
function ProgressBar(props) {
|
|
1505
1602
|
const { indeterminate, size, usage, now, label: label5, ...nativeProps } = props;
|
|
1506
1603
|
const styles = (0, import_recipes18.progressBar)({ size, usage });
|
|
@@ -1508,7 +1605,7 @@ function ProgressBar(props) {
|
|
|
1508
1605
|
const width = {
|
|
1509
1606
|
width: indeterminate ? "50%" : `${nowClamped}%`
|
|
1510
1607
|
};
|
|
1511
|
-
return /* @__PURE__ */ (0,
|
|
1608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1512
1609
|
"div",
|
|
1513
1610
|
{
|
|
1514
1611
|
...nativeProps,
|
|
@@ -1518,7 +1615,7 @@ function ProgressBar(props) {
|
|
|
1518
1615
|
"aria-valuenow": indeterminate ? 0 : nowClamped,
|
|
1519
1616
|
className: (0, import_css25.cx)(nativeProps.className, styles.root),
|
|
1520
1617
|
role: "progressbar",
|
|
1521
|
-
children: /* @__PURE__ */ (0,
|
|
1618
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1522
1619
|
"div",
|
|
1523
1620
|
{
|
|
1524
1621
|
...indeterminate && { "data-indeterminate": true },
|
|
@@ -1532,7 +1629,7 @@ function ProgressBar(props) {
|
|
|
1532
1629
|
}
|
|
1533
1630
|
|
|
1534
1631
|
// src/components/FileStatus.tsx
|
|
1535
|
-
var
|
|
1632
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1536
1633
|
var processStatus = /* @__PURE__ */ ((processStatus2) => {
|
|
1537
1634
|
processStatus2["TODO"] = "todo";
|
|
1538
1635
|
processStatus2["PROCESSING"] = "processing";
|
|
@@ -1542,10 +1639,10 @@ var processStatus = /* @__PURE__ */ ((processStatus2) => {
|
|
|
1542
1639
|
})(processStatus || {});
|
|
1543
1640
|
function FileStatus(props) {
|
|
1544
1641
|
const { file, now, status, onClick, ...nativeProps } = props;
|
|
1545
|
-
const actionLabel = (0,
|
|
1546
|
-
const palette = (0,
|
|
1547
|
-
const modalIconPalette = (0,
|
|
1548
|
-
const styles = (0,
|
|
1642
|
+
const actionLabel = (0, import_react19.useMemo)(() => getStatusActionLabel(status), [status]);
|
|
1643
|
+
const palette = (0, import_react19.useMemo)(() => getPalette(status), [status]);
|
|
1644
|
+
const modalIconPalette = (0, import_react19.useMemo)(() => getModalIconPalette(status), [status]);
|
|
1645
|
+
const styles = (0, import_react19.useMemo)(() => {
|
|
1549
1646
|
switch (status) {
|
|
1550
1647
|
case "todo" /* TODO */:
|
|
1551
1648
|
return (0, import_recipes19.fileStatus)({ status: "todo" });
|
|
@@ -1559,7 +1656,7 @@ function FileStatus(props) {
|
|
|
1559
1656
|
return (0, import_recipes19.fileStatus)();
|
|
1560
1657
|
}
|
|
1561
1658
|
}, [status]);
|
|
1562
|
-
const handleClick = (0,
|
|
1659
|
+
const handleClick = (0, import_react19.useCallback)(
|
|
1563
1660
|
(e) => {
|
|
1564
1661
|
const actionStatus = getStatusActionLabel(
|
|
1565
1662
|
status
|
|
@@ -1568,22 +1665,22 @@ function FileStatus(props) {
|
|
|
1568
1665
|
},
|
|
1569
1666
|
[onClick]
|
|
1570
1667
|
);
|
|
1571
|
-
return /* @__PURE__ */ (0,
|
|
1668
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
1572
1669
|
"div",
|
|
1573
1670
|
{
|
|
1574
1671
|
...nativeProps,
|
|
1575
1672
|
className: (0, import_css26.cx)(nativeProps.className, styles.root, (0, import_patterns7.hstack)()),
|
|
1576
1673
|
children: [
|
|
1577
|
-
/* @__PURE__ */ (0,
|
|
1674
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1578
1675
|
Avatar,
|
|
1579
1676
|
{
|
|
1580
1677
|
ariaLabel: "",
|
|
1581
1678
|
gradient: modalIconPalette,
|
|
1582
|
-
icon: /* @__PURE__ */ (0,
|
|
1679
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(MatchFileStatusIcon, { size: 24, status }),
|
|
1583
1680
|
src: ""
|
|
1584
1681
|
}
|
|
1585
1682
|
),
|
|
1586
|
-
/* @__PURE__ */ (0,
|
|
1683
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
1587
1684
|
"div",
|
|
1588
1685
|
{
|
|
1589
1686
|
className: (0, import_patterns7.vstack)({
|
|
@@ -1592,7 +1689,7 @@ function FileStatus(props) {
|
|
|
1592
1689
|
w: "full"
|
|
1593
1690
|
}),
|
|
1594
1691
|
children: [
|
|
1595
|
-
/* @__PURE__ */ (0,
|
|
1692
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1596
1693
|
"small",
|
|
1597
1694
|
{
|
|
1598
1695
|
className: (0, import_css26.css)({
|
|
@@ -1602,7 +1699,7 @@ function FileStatus(props) {
|
|
|
1602
1699
|
children: file
|
|
1603
1700
|
}
|
|
1604
1701
|
),
|
|
1605
|
-
/* @__PURE__ */ (0,
|
|
1702
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1606
1703
|
ProgressBar,
|
|
1607
1704
|
{
|
|
1608
1705
|
id: props.id,
|
|
@@ -1611,27 +1708,27 @@ function FileStatus(props) {
|
|
|
1611
1708
|
size: "sm"
|
|
1612
1709
|
}
|
|
1613
1710
|
),
|
|
1614
|
-
/* @__PURE__ */ (0,
|
|
1711
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Field, { invalid: modalIconPalette === "hades-dark", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1615
1712
|
FieldMessage,
|
|
1616
1713
|
{
|
|
1617
1714
|
className: (0, import_css26.css)({
|
|
1618
1715
|
color: "page.text.100"
|
|
1619
1716
|
}),
|
|
1620
1717
|
id: `help:${file}`,
|
|
1621
|
-
children: /* @__PURE__ */ (0,
|
|
1718
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(MatchFileStatusText, { status, now })
|
|
1622
1719
|
}
|
|
1623
1720
|
) })
|
|
1624
1721
|
]
|
|
1625
1722
|
}
|
|
1626
1723
|
),
|
|
1627
|
-
/* @__PURE__ */ (0,
|
|
1724
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1628
1725
|
IconButton,
|
|
1629
1726
|
{
|
|
1630
1727
|
ariaLabel: actionLabel,
|
|
1631
1728
|
onClick: handleClick,
|
|
1632
1729
|
palette,
|
|
1633
1730
|
size: "sm",
|
|
1634
|
-
children: /* @__PURE__ */ (0,
|
|
1731
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(MatchStatusAction, { status })
|
|
1635
1732
|
}
|
|
1636
1733
|
)
|
|
1637
1734
|
]
|
|
@@ -1648,13 +1745,13 @@ function MatchFileStatusIcon(props) {
|
|
|
1648
1745
|
} = icons;
|
|
1649
1746
|
switch (props.status) {
|
|
1650
1747
|
case "todo" /* TODO */:
|
|
1651
|
-
return /* @__PURE__ */ (0,
|
|
1748
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TodoIcon, { size: props.size });
|
|
1652
1749
|
case "processing" /* PROCESSING */:
|
|
1653
|
-
return /* @__PURE__ */ (0,
|
|
1750
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(FileUploaderIcon, { size: props.size });
|
|
1654
1751
|
case "done" /* DONE */:
|
|
1655
|
-
return /* @__PURE__ */ (0,
|
|
1752
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(DoneIcon, { size: props.size });
|
|
1656
1753
|
case "error" /* ERROR */:
|
|
1657
|
-
return /* @__PURE__ */ (0,
|
|
1754
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(InvalidIcon, { size: props.size });
|
|
1658
1755
|
default:
|
|
1659
1756
|
throw new Error("Unknown status");
|
|
1660
1757
|
}
|
|
@@ -1679,11 +1776,11 @@ function MatchStatusAction(props) {
|
|
|
1679
1776
|
switch (props.status) {
|
|
1680
1777
|
case "todo" /* TODO */:
|
|
1681
1778
|
case "processing" /* PROCESSING */:
|
|
1682
|
-
return /* @__PURE__ */ (0,
|
|
1779
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CloseIcon, {});
|
|
1683
1780
|
case "error" /* ERROR */:
|
|
1684
|
-
return /* @__PURE__ */ (0,
|
|
1781
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(RedoIcon, {});
|
|
1685
1782
|
case "done" /* DONE */:
|
|
1686
|
-
return /* @__PURE__ */ (0,
|
|
1783
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TrashIcon, {});
|
|
1687
1784
|
default:
|
|
1688
1785
|
throw new Error("Invalid status");
|
|
1689
1786
|
}
|
|
@@ -1732,13 +1829,13 @@ function getModalIconPalette(status) {
|
|
|
1732
1829
|
var import_css27 = require("@cerberus/styled-system/css");
|
|
1733
1830
|
var import_patterns8 = require("@cerberus/styled-system/patterns");
|
|
1734
1831
|
var import_recipes20 = require("@cerberus/styled-system/recipes");
|
|
1735
|
-
var
|
|
1832
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1736
1833
|
function FileUploader(props) {
|
|
1737
1834
|
var _a;
|
|
1738
1835
|
const { icons } = useCerberusContext();
|
|
1739
1836
|
const styles = (0, import_recipes20.fileUploader)();
|
|
1740
1837
|
const { waitingFileUploader: Icon } = icons;
|
|
1741
|
-
return /* @__PURE__ */ (0,
|
|
1838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
1742
1839
|
"div",
|
|
1743
1840
|
{
|
|
1744
1841
|
...props.disabled ? { "aria-disabled": true } : {},
|
|
@@ -1749,17 +1846,17 @@ function FileUploader(props) {
|
|
|
1749
1846
|
styles.container
|
|
1750
1847
|
),
|
|
1751
1848
|
children: [
|
|
1752
|
-
/* @__PURE__ */ (0,
|
|
1849
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: styles.icon, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1753
1850
|
Avatar,
|
|
1754
1851
|
{
|
|
1755
1852
|
gradient: "charon-light",
|
|
1756
1853
|
ariaLabel: "",
|
|
1757
|
-
icon: /* @__PURE__ */ (0,
|
|
1854
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Icon, {}),
|
|
1758
1855
|
size: "md",
|
|
1759
1856
|
src: ""
|
|
1760
1857
|
}
|
|
1761
1858
|
) }),
|
|
1762
|
-
/* @__PURE__ */ (0,
|
|
1859
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
1763
1860
|
"label",
|
|
1764
1861
|
{
|
|
1765
1862
|
className: (0, import_css27.cx)(
|
|
@@ -1770,12 +1867,12 @@ function FileUploader(props) {
|
|
|
1770
1867
|
),
|
|
1771
1868
|
htmlFor: props.name,
|
|
1772
1869
|
children: [
|
|
1773
|
-
/* @__PURE__ */ (0,
|
|
1870
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Show, { when: Boolean(props.heading), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: styles.heading, children: props.heading }) }),
|
|
1774
1871
|
"Import ",
|
|
1775
1872
|
(_a = props.accept) == null ? void 0 : _a.replace(",", ", "),
|
|
1776
1873
|
" files",
|
|
1777
|
-
/* @__PURE__ */ (0,
|
|
1778
|
-
/* @__PURE__ */ (0,
|
|
1874
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: styles.description, children: "Click to select files" }),
|
|
1875
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1779
1876
|
"input",
|
|
1780
1877
|
{
|
|
1781
1878
|
...props,
|
|
@@ -1794,7 +1891,7 @@ function FileUploader(props) {
|
|
|
1794
1891
|
// src/components/Input.tsx
|
|
1795
1892
|
var import_recipes21 = require("@cerberus/styled-system/recipes");
|
|
1796
1893
|
var import_css28 = require("@cerberus/styled-system/css");
|
|
1797
|
-
var
|
|
1894
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1798
1895
|
function Input(props) {
|
|
1799
1896
|
const { describedBy, size, startIcon, endIcon, ...nativeProps } = props;
|
|
1800
1897
|
const inputStyles = (0, import_recipes21.input)({ size });
|
|
@@ -1802,9 +1899,9 @@ function Input(props) {
|
|
|
1802
1899
|
const hasEndIcon = Boolean(endIcon);
|
|
1803
1900
|
const { icons } = useCerberusContext();
|
|
1804
1901
|
const { invalid: InvalidIcon } = icons;
|
|
1805
|
-
return /* @__PURE__ */ (0,
|
|
1806
|
-
/* @__PURE__ */ (0,
|
|
1807
|
-
/* @__PURE__ */ (0,
|
|
1902
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: inputStyles.root, children: [
|
|
1903
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Show, { when: Boolean(startIcon), children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: inputStyles.startIcon, children: startIcon }) }),
|
|
1904
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1808
1905
|
"input",
|
|
1809
1906
|
{
|
|
1810
1907
|
...nativeProps,
|
|
@@ -1815,8 +1912,8 @@ function Input(props) {
|
|
|
1815
1912
|
className: (0, import_css28.cx)("peer", nativeProps.className, inputStyles.input)
|
|
1816
1913
|
}
|
|
1817
1914
|
),
|
|
1818
|
-
/* @__PURE__ */ (0,
|
|
1819
|
-
/* @__PURE__ */ (0,
|
|
1915
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Show, { when: invalid, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(InvalidIcon, { className: inputStyles.icon }) }),
|
|
1916
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Show, { when: hasEndIcon && !invalid, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: inputStyles.icon, children: endIcon }) })
|
|
1820
1917
|
] });
|
|
1821
1918
|
}
|
|
1822
1919
|
|
|
@@ -1824,12 +1921,12 @@ function Input(props) {
|
|
|
1824
1921
|
var import_recipes22 = require("@cerberus/styled-system/recipes");
|
|
1825
1922
|
var import_css29 = require("@cerberus/styled-system/css");
|
|
1826
1923
|
var import_patterns9 = require("@cerberus/styled-system/patterns");
|
|
1827
|
-
var
|
|
1924
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
1828
1925
|
function Label(props) {
|
|
1829
1926
|
const { hidden, size, ...nativeProps } = props;
|
|
1830
1927
|
const { required, disabled } = useFieldContext();
|
|
1831
1928
|
const usage = hidden ? "hidden" : "visible";
|
|
1832
|
-
return /* @__PURE__ */ (0,
|
|
1929
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
1833
1930
|
"label",
|
|
1834
1931
|
{
|
|
1835
1932
|
...nativeProps,
|
|
@@ -1844,7 +1941,7 @@ function Label(props) {
|
|
|
1844
1941
|
),
|
|
1845
1942
|
children: [
|
|
1846
1943
|
props.children,
|
|
1847
|
-
/* @__PURE__ */ (0,
|
|
1944
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Show, { when: required, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
1848
1945
|
"span",
|
|
1849
1946
|
{
|
|
1850
1947
|
className: (0, import_css29.css)({
|
|
@@ -1863,11 +1960,11 @@ function Label(props) {
|
|
|
1863
1960
|
var import_css30 = require("@cerberus/styled-system/css");
|
|
1864
1961
|
var import_recipes23 = require("@cerberus/styled-system/recipes");
|
|
1865
1962
|
var import_patterns10 = require("@cerberus/styled-system/patterns");
|
|
1866
|
-
var
|
|
1963
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
1867
1964
|
function Legend(props) {
|
|
1868
1965
|
const { size, ...nativeProps } = props;
|
|
1869
1966
|
const { invalid, ...formState } = useFieldContext();
|
|
1870
|
-
return /* @__PURE__ */ (0,
|
|
1967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
1871
1968
|
"legend",
|
|
1872
1969
|
{
|
|
1873
1970
|
...nativeProps,
|
|
@@ -1885,7 +1982,7 @@ function Legend(props) {
|
|
|
1885
1982
|
),
|
|
1886
1983
|
children: [
|
|
1887
1984
|
nativeProps.children,
|
|
1888
|
-
/* @__PURE__ */ (0,
|
|
1985
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Show, { when: formState.required, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1889
1986
|
"span",
|
|
1890
1987
|
{
|
|
1891
1988
|
className: (0, import_css30.css)({
|
|
@@ -1901,18 +1998,18 @@ function Legend(props) {
|
|
|
1901
1998
|
}
|
|
1902
1999
|
|
|
1903
2000
|
// src/components/Menu.tsx
|
|
1904
|
-
var
|
|
2001
|
+
var import_react20 = require("@ark-ui/react");
|
|
1905
2002
|
var import_recipes24 = require("@cerberus/styled-system/recipes");
|
|
1906
2003
|
var import_css31 = require("@cerberus/styled-system/css");
|
|
1907
|
-
var
|
|
2004
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
1908
2005
|
var menuStyles = (0, import_recipes24.menu)();
|
|
1909
|
-
var Menu =
|
|
2006
|
+
var Menu = import_react20.Menu.Root;
|
|
1910
2007
|
function MenuTrigger(props) {
|
|
1911
|
-
return /* @__PURE__ */ (0,
|
|
2008
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react20.Menu.Trigger, { ...props, asChild: true });
|
|
1912
2009
|
}
|
|
1913
2010
|
function MenuContent(props) {
|
|
1914
|
-
return /* @__PURE__ */ (0,
|
|
1915
|
-
|
|
2011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react20.Menu.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2012
|
+
import_react20.Menu.Content,
|
|
1916
2013
|
{
|
|
1917
2014
|
...props,
|
|
1918
2015
|
className: (0, import_css31.cx)(props.className, menuStyles.content)
|
|
@@ -1920,12 +2017,12 @@ function MenuContent(props) {
|
|
|
1920
2017
|
) });
|
|
1921
2018
|
}
|
|
1922
2019
|
function MenuItem(props) {
|
|
1923
|
-
return /* @__PURE__ */ (0,
|
|
2020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react20.Menu.Item, { ...props, className: (0, import_css31.cx)(props.className, menuStyles.item) });
|
|
1924
2021
|
}
|
|
1925
|
-
var MenuItemGroup =
|
|
2022
|
+
var MenuItemGroup = import_react20.Menu.ItemGroup;
|
|
1926
2023
|
function MenuGroupLabel(props) {
|
|
1927
|
-
return /* @__PURE__ */ (0,
|
|
1928
|
-
|
|
2024
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2025
|
+
import_react20.Menu.ItemGroupLabel,
|
|
1929
2026
|
{
|
|
1930
2027
|
...props,
|
|
1931
2028
|
className: (0, import_css31.cx)(props.className, menuStyles.itemGroupLabel)
|
|
@@ -1933,8 +2030,8 @@ function MenuGroupLabel(props) {
|
|
|
1933
2030
|
);
|
|
1934
2031
|
}
|
|
1935
2032
|
function MenuSeparator(props) {
|
|
1936
|
-
return /* @__PURE__ */ (0,
|
|
1937
|
-
|
|
2033
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2034
|
+
import_react20.Menu.Separator,
|
|
1938
2035
|
{
|
|
1939
2036
|
...props,
|
|
1940
2037
|
className: (0, import_css31.cx)(props.className, menuStyles.separator)
|
|
@@ -1946,7 +2043,7 @@ function MenuSeparator(props) {
|
|
|
1946
2043
|
var import_css32 = require("@cerberus/styled-system/css");
|
|
1947
2044
|
var import_patterns11 = require("@cerberus/styled-system/patterns");
|
|
1948
2045
|
var import_recipes25 = require("@cerberus/styled-system/recipes");
|
|
1949
|
-
var
|
|
2046
|
+
var import_react21 = require("react");
|
|
1950
2047
|
|
|
1951
2048
|
// src/aria-helpers/trap-focus.aria.ts
|
|
1952
2049
|
function trapFocus(modalRef) {
|
|
@@ -1975,22 +2072,22 @@ function trapFocus(modalRef) {
|
|
|
1975
2072
|
}
|
|
1976
2073
|
|
|
1977
2074
|
// src/components/Notification.tsx
|
|
1978
|
-
var
|
|
2075
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
1979
2076
|
function MatchNotificationIcon(props) {
|
|
1980
2077
|
const { icons } = useCerberusContext();
|
|
1981
2078
|
const palette = props.palette || "info";
|
|
1982
2079
|
const key = `${palette}Notification`;
|
|
1983
2080
|
const Icon = icons[key];
|
|
1984
|
-
return /* @__PURE__ */ (0,
|
|
2081
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Icon, {});
|
|
1985
2082
|
}
|
|
1986
2083
|
function Notification(props) {
|
|
1987
2084
|
const { children, palette, onClose, ...nativeProps } = props;
|
|
1988
|
-
const ref = (0,
|
|
2085
|
+
const ref = (0, import_react21.useRef)(null);
|
|
1989
2086
|
const onKeyDown = trapFocus(ref);
|
|
1990
2087
|
const styles = (0, import_recipes25.notification)({ palette });
|
|
1991
2088
|
const { icons } = useCerberusContext();
|
|
1992
2089
|
const { close: CloseIcon } = icons;
|
|
1993
|
-
return /* @__PURE__ */ (0,
|
|
2090
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
1994
2091
|
"dialog",
|
|
1995
2092
|
{
|
|
1996
2093
|
...nativeProps,
|
|
@@ -2006,8 +2103,8 @@ function Notification(props) {
|
|
|
2006
2103
|
onKeyDown,
|
|
2007
2104
|
ref,
|
|
2008
2105
|
children: [
|
|
2009
|
-
/* @__PURE__ */ (0,
|
|
2010
|
-
/* @__PURE__ */ (0,
|
|
2106
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: styles.icon, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MatchNotificationIcon, { palette }) }),
|
|
2107
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2011
2108
|
"div",
|
|
2012
2109
|
{
|
|
2013
2110
|
className: (0, import_patterns11.vstack)({
|
|
@@ -2018,14 +2115,14 @@ function Notification(props) {
|
|
|
2018
2115
|
children
|
|
2019
2116
|
}
|
|
2020
2117
|
),
|
|
2021
|
-
/* @__PURE__ */ (0,
|
|
2118
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2022
2119
|
"button",
|
|
2023
2120
|
{
|
|
2024
2121
|
"aria-label": "Close",
|
|
2025
2122
|
className: styles.close,
|
|
2026
2123
|
onClick: onClose,
|
|
2027
2124
|
value: props.id,
|
|
2028
|
-
children: /* @__PURE__ */ (0,
|
|
2125
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CloseIcon, {})
|
|
2029
2126
|
}
|
|
2030
2127
|
)
|
|
2031
2128
|
]
|
|
@@ -2036,21 +2133,21 @@ function Notification(props) {
|
|
|
2036
2133
|
// src/components/NotificationHeading.tsx
|
|
2037
2134
|
var import_css33 = require("@cerberus/styled-system/css");
|
|
2038
2135
|
var import_recipes26 = require("@cerberus/styled-system/recipes");
|
|
2039
|
-
var
|
|
2136
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2040
2137
|
function NotificationHeading(props) {
|
|
2041
2138
|
const { palette, ...nativeProps } = props;
|
|
2042
2139
|
const styles = (0, import_recipes26.notification)({ palette });
|
|
2043
|
-
return /* @__PURE__ */ (0,
|
|
2140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: (0, import_css33.cx)(nativeProps.className, styles.heading), ...nativeProps });
|
|
2044
2141
|
}
|
|
2045
2142
|
|
|
2046
2143
|
// src/components/NotificationDescription.tsx
|
|
2047
2144
|
var import_css34 = require("@cerberus/styled-system/css");
|
|
2048
2145
|
var import_recipes27 = require("@cerberus/styled-system/recipes");
|
|
2049
|
-
var
|
|
2146
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2050
2147
|
function NotificationDescription(props) {
|
|
2051
2148
|
const { palette, ...nativeProps } = props;
|
|
2052
2149
|
const styles = (0, import_recipes27.notification)({ palette });
|
|
2053
|
-
return /* @__PURE__ */ (0,
|
|
2150
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2054
2151
|
"p",
|
|
2055
2152
|
{
|
|
2056
2153
|
className: (0, import_css34.cx)(nativeProps.className, styles.description),
|
|
@@ -2063,12 +2160,12 @@ function NotificationDescription(props) {
|
|
|
2063
2160
|
var import_css35 = require("@cerberus/styled-system/css");
|
|
2064
2161
|
var import_patterns12 = require("@cerberus/styled-system/patterns");
|
|
2065
2162
|
var import_recipes28 = require("@cerberus/styled-system/recipes");
|
|
2066
|
-
var
|
|
2163
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2067
2164
|
function Radio(props) {
|
|
2068
2165
|
const { children, size, ...nativeProps } = props;
|
|
2069
2166
|
const { invalid, ...state } = useFieldContext();
|
|
2070
2167
|
const styles = (0, import_recipes28.radio)({ size });
|
|
2071
|
-
return /* @__PURE__ */ (0,
|
|
2168
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
2072
2169
|
"div",
|
|
2073
2170
|
{
|
|
2074
2171
|
className: (0, import_css35.cx)(
|
|
@@ -2080,7 +2177,7 @@ function Radio(props) {
|
|
|
2080
2177
|
),
|
|
2081
2178
|
tabIndex: 0,
|
|
2082
2179
|
children: [
|
|
2083
|
-
/* @__PURE__ */ (0,
|
|
2180
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2084
2181
|
"input",
|
|
2085
2182
|
{
|
|
2086
2183
|
...nativeProps,
|
|
@@ -2097,82 +2194,6 @@ function Radio(props) {
|
|
|
2097
2194
|
);
|
|
2098
2195
|
}
|
|
2099
2196
|
|
|
2100
|
-
// src/components/Spinner.tsx
|
|
2101
|
-
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2102
|
-
function Spinner(props) {
|
|
2103
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2104
|
-
"svg",
|
|
2105
|
-
{
|
|
2106
|
-
"aria-busy": "true",
|
|
2107
|
-
role: "status",
|
|
2108
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2109
|
-
height: props.size,
|
|
2110
|
-
width: props.size,
|
|
2111
|
-
viewBox: "0 0 24 24",
|
|
2112
|
-
...props,
|
|
2113
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
2114
|
-
"g",
|
|
2115
|
-
{
|
|
2116
|
-
fill: "none",
|
|
2117
|
-
stroke: "currentColor",
|
|
2118
|
-
strokeLinecap: "round",
|
|
2119
|
-
strokeLinejoin: "round",
|
|
2120
|
-
strokeWidth: 2,
|
|
2121
|
-
children: [
|
|
2122
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
2123
|
-
"path",
|
|
2124
|
-
{
|
|
2125
|
-
strokeDasharray: 16,
|
|
2126
|
-
strokeDashoffset: 16,
|
|
2127
|
-
d: "M12 3c4.97 0 9 4.03 9 9",
|
|
2128
|
-
children: [
|
|
2129
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2130
|
-
"animate",
|
|
2131
|
-
{
|
|
2132
|
-
fill: "freeze",
|
|
2133
|
-
attributeName: "stroke-dashoffset",
|
|
2134
|
-
dur: "0.15s",
|
|
2135
|
-
values: "16;0"
|
|
2136
|
-
}
|
|
2137
|
-
),
|
|
2138
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2139
|
-
"animateTransform",
|
|
2140
|
-
{
|
|
2141
|
-
attributeName: "transform",
|
|
2142
|
-
dur: "0.75s",
|
|
2143
|
-
repeatCount: "indefinite",
|
|
2144
|
-
type: "rotate",
|
|
2145
|
-
values: "0 12 12;360 12 12"
|
|
2146
|
-
}
|
|
2147
|
-
)
|
|
2148
|
-
]
|
|
2149
|
-
}
|
|
2150
|
-
),
|
|
2151
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2152
|
-
"path",
|
|
2153
|
-
{
|
|
2154
|
-
strokeDasharray: 64,
|
|
2155
|
-
strokeDashoffset: 64,
|
|
2156
|
-
strokeOpacity: 0.3,
|
|
2157
|
-
d: "M12 3c4.97 0 9 4.03 9 9c0 4.97 -4.03 9 -9 9c-4.97 0 -9 -4.03 -9 -9c0 -4.97 4.03 -9 9 -9Z",
|
|
2158
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2159
|
-
"animate",
|
|
2160
|
-
{
|
|
2161
|
-
fill: "freeze",
|
|
2162
|
-
attributeName: "stroke-dashoffset",
|
|
2163
|
-
dur: "0.6s",
|
|
2164
|
-
values: "64;0"
|
|
2165
|
-
}
|
|
2166
|
-
)
|
|
2167
|
-
}
|
|
2168
|
-
)
|
|
2169
|
-
]
|
|
2170
|
-
}
|
|
2171
|
-
)
|
|
2172
|
-
}
|
|
2173
|
-
);
|
|
2174
|
-
}
|
|
2175
|
-
|
|
2176
2197
|
// src/components/Tabs.client.tsx
|
|
2177
2198
|
var import_tabs2 = require("@ark-ui/react/tabs");
|
|
2178
2199
|
var import_css36 = require("@cerberus/styled-system/css");
|
|
@@ -2180,7 +2201,7 @@ var import_css36 = require("@cerberus/styled-system/css");
|
|
|
2180
2201
|
// src/context/tabs.tsx
|
|
2181
2202
|
var import_tabs = require("@ark-ui/react/tabs");
|
|
2182
2203
|
var import_recipes29 = require("@cerberus/styled-system/recipes");
|
|
2183
|
-
var
|
|
2204
|
+
var import_react22 = require("react");
|
|
2184
2205
|
|
|
2185
2206
|
// src/utils/localStorage.ts
|
|
2186
2207
|
function getLocalStorage(key, defaultValue) {
|
|
@@ -2197,18 +2218,18 @@ function setLocalStorage(key, value) {
|
|
|
2197
2218
|
|
|
2198
2219
|
// src/context/tabs.tsx
|
|
2199
2220
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2200
|
-
var TabsContext = (0,
|
|
2221
|
+
var TabsContext = (0, import_react22.createContext)(null);
|
|
2201
2222
|
function Tabs(props) {
|
|
2202
2223
|
const { cache, defaultValue, palette, uuid, ...arkProps } = props;
|
|
2203
|
-
const [activeTab, setActiveTab] = (0,
|
|
2224
|
+
const [activeTab, setActiveTab] = (0, import_react22.useState)(
|
|
2204
2225
|
() => cache ? "" : defaultValue
|
|
2205
2226
|
);
|
|
2206
2227
|
const styles = (0, import_recipes29.tabs)({ palette });
|
|
2207
|
-
const cacheKey = (0,
|
|
2228
|
+
const cacheKey = (0, import_react22.useMemo)(
|
|
2208
2229
|
() => uuid ? `cerberus-tabs-${uuid}` : "cerberus-tabs",
|
|
2209
2230
|
[uuid]
|
|
2210
2231
|
);
|
|
2211
|
-
const handleValueChange = (0,
|
|
2232
|
+
const handleValueChange = (0, import_react22.useCallback)(
|
|
2212
2233
|
(details) => {
|
|
2213
2234
|
if (cache) {
|
|
2214
2235
|
setLocalStorage(cacheKey, details.value);
|
|
@@ -2217,13 +2238,13 @@ function Tabs(props) {
|
|
|
2217
2238
|
},
|
|
2218
2239
|
[cache]
|
|
2219
2240
|
);
|
|
2220
|
-
(0,
|
|
2241
|
+
(0, import_react22.useEffect)(() => {
|
|
2221
2242
|
if (cache && !activeTab) {
|
|
2222
2243
|
const cachedTab = getLocalStorage(cacheKey, defaultValue ?? "");
|
|
2223
2244
|
setActiveTab(cachedTab);
|
|
2224
2245
|
}
|
|
2225
2246
|
}, [cache, defaultValue, activeTab]);
|
|
2226
|
-
const value = (0,
|
|
2247
|
+
const value = (0, import_react22.useMemo)(
|
|
2227
2248
|
() => ({
|
|
2228
2249
|
active: activeTab,
|
|
2229
2250
|
styles
|
|
@@ -2244,7 +2265,7 @@ function Tabs(props) {
|
|
|
2244
2265
|
) });
|
|
2245
2266
|
}
|
|
2246
2267
|
function useTabsContext() {
|
|
2247
|
-
const context = (0,
|
|
2268
|
+
const context = (0, import_react22.useContext)(TabsContext);
|
|
2248
2269
|
if (!context) {
|
|
2249
2270
|
throw new Error("useTabsContext must be used within a Tabs Provider.");
|
|
2250
2271
|
}
|
|
@@ -2465,33 +2486,33 @@ var closableCss = (0, import_css42.css)({
|
|
|
2465
2486
|
});
|
|
2466
2487
|
|
|
2467
2488
|
// src/components/Text.tsx
|
|
2468
|
-
var
|
|
2489
|
+
var import_jsx2 = require("@cerberus/styled-system/jsx");
|
|
2469
2490
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
2470
2491
|
function Text(props) {
|
|
2471
2492
|
const { as = "p", ...pandaJSXProps } = props;
|
|
2472
2493
|
switch (as) {
|
|
2473
2494
|
case "h1":
|
|
2474
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2495
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx2.H1, { ...pandaJSXProps });
|
|
2475
2496
|
case "h2":
|
|
2476
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx2.H2, { ...pandaJSXProps });
|
|
2477
2498
|
case "h3":
|
|
2478
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2499
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx2.H3, { ...pandaJSXProps });
|
|
2479
2500
|
case "h4":
|
|
2480
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx2.H4, { ...pandaJSXProps });
|
|
2481
2502
|
case "h5":
|
|
2482
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2503
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx2.H5, { ...pandaJSXProps });
|
|
2483
2504
|
case "h6":
|
|
2484
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2505
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx2.H6, { ...pandaJSXProps });
|
|
2485
2506
|
case "strong":
|
|
2486
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx2.Strong, { ...pandaJSXProps });
|
|
2487
2508
|
case "em":
|
|
2488
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2509
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx2.Em, { ...pandaJSXProps });
|
|
2489
2510
|
case "small":
|
|
2490
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2511
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx2.Small, { ...pandaJSXProps });
|
|
2491
2512
|
case "span":
|
|
2492
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2513
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx2.Span, { ...pandaJSXProps });
|
|
2493
2514
|
default:
|
|
2494
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2515
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx2.P, { ...pandaJSXProps });
|
|
2495
2516
|
}
|
|
2496
2517
|
}
|
|
2497
2518
|
|
|
@@ -2600,7 +2621,7 @@ function Tooltip(props) {
|
|
|
2600
2621
|
var import_select2 = require("@ark-ui/react/select");
|
|
2601
2622
|
var import_recipes39 = require("@cerberus/styled-system/recipes");
|
|
2602
2623
|
var import_css46 = require("@cerberus/styled-system/css");
|
|
2603
|
-
var
|
|
2624
|
+
var import_jsx3 = require("@cerberus/styled-system/jsx");
|
|
2604
2625
|
|
|
2605
2626
|
// src/components/Select.server.tsx
|
|
2606
2627
|
var import_select = require("@ark-ui/react/select");
|
|
@@ -2640,7 +2661,7 @@ function Select(props) {
|
|
|
2640
2661
|
] }),
|
|
2641
2662
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectControl, { className: styles.control, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(SelectTrigger, { className: styles.trigger, children: [
|
|
2642
2663
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectValueText, { placeholder }),
|
|
2643
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
2664
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx3.HStack, { children: [
|
|
2644
2665
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Show, { when: props.invalid, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(InvalidIcon, { "data-part": "invalid-icon" }) }),
|
|
2645
2666
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectIndicator, { className: styles.indicator, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectArrow, {}) })
|
|
2646
2667
|
] })
|
|
@@ -2679,23 +2700,23 @@ function createSelectCollection(collection) {
|
|
|
2679
2700
|
}
|
|
2680
2701
|
|
|
2681
2702
|
// src/context/confirm-modal.tsx
|
|
2682
|
-
var
|
|
2703
|
+
var import_react23 = require("react");
|
|
2683
2704
|
var import_css47 = require("@cerberus/styled-system/css");
|
|
2684
|
-
var
|
|
2705
|
+
var import_jsx4 = require("@cerberus/styled-system/jsx");
|
|
2685
2706
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
2686
|
-
var ConfirmModalContext = (0,
|
|
2707
|
+
var ConfirmModalContext = (0, import_react23.createContext)(null);
|
|
2687
2708
|
function ConfirmModal(props) {
|
|
2688
|
-
const [open, setOpen] = (0,
|
|
2689
|
-
const [content, setContent] = (0,
|
|
2690
|
-
const resolveRef = (0,
|
|
2709
|
+
const [open, setOpen] = (0, import_react23.useState)(false);
|
|
2710
|
+
const [content, setContent] = (0, import_react23.useState)(null);
|
|
2711
|
+
const resolveRef = (0, import_react23.useRef)(null);
|
|
2691
2712
|
const kind = (content == null ? void 0 : content.kind) ?? "non-destructive";
|
|
2692
2713
|
const { icons } = useCerberusContext();
|
|
2693
2714
|
const { confirmModal: ConfirmIcon } = icons;
|
|
2694
|
-
const palette = (0,
|
|
2715
|
+
const palette = (0, import_react23.useMemo)(
|
|
2695
2716
|
() => kind === "destructive" ? "danger" : "action",
|
|
2696
2717
|
[kind]
|
|
2697
2718
|
);
|
|
2698
|
-
const handleChoice = (0,
|
|
2719
|
+
const handleChoice = (0, import_react23.useCallback)(
|
|
2699
2720
|
(e) => {
|
|
2700
2721
|
var _a, _b;
|
|
2701
2722
|
const target = e.currentTarget;
|
|
@@ -2707,7 +2728,7 @@ function ConfirmModal(props) {
|
|
|
2707
2728
|
},
|
|
2708
2729
|
[setOpen]
|
|
2709
2730
|
);
|
|
2710
|
-
const handleShow = (0,
|
|
2731
|
+
const handleShow = (0, import_react23.useCallback)(
|
|
2711
2732
|
(options) => {
|
|
2712
2733
|
return new Promise((resolve) => {
|
|
2713
2734
|
setContent({ ...options });
|
|
@@ -2717,7 +2738,7 @@ function ConfirmModal(props) {
|
|
|
2717
2738
|
},
|
|
2718
2739
|
[setOpen, setContent]
|
|
2719
2740
|
);
|
|
2720
|
-
const value = (0,
|
|
2741
|
+
const value = (0, import_react23.useMemo)(
|
|
2721
2742
|
() => ({
|
|
2722
2743
|
show: handleShow
|
|
2723
2744
|
}),
|
|
@@ -2725,10 +2746,10 @@ function ConfirmModal(props) {
|
|
|
2725
2746
|
);
|
|
2726
2747
|
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(ConfirmModalContext.Provider, { value, children: [
|
|
2727
2748
|
props.children,
|
|
2728
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(DialogProvider, { open, onOpenChange: (e) => setOpen(e.open), children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Dialog, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
2729
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
2749
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(DialogProvider, { open, onOpenChange: (e) => setOpen(e.open), children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Dialog, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx4.VStack, { gap: "xl", w: "full", children: [
|
|
2750
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx4.VStack, { alignItems: "flex-start", gap: "md", w: "full", children: [
|
|
2730
2751
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
2731
|
-
|
|
2752
|
+
import_jsx4.HStack,
|
|
2732
2753
|
{
|
|
2733
2754
|
alignSelf: "center",
|
|
2734
2755
|
justify: "center",
|
|
@@ -2763,7 +2784,7 @@ function ConfirmModal(props) {
|
|
|
2763
2784
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(DialogHeading, { children: content == null ? void 0 : content.heading }),
|
|
2764
2785
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(DialogDescription, { children: content == null ? void 0 : content.description })
|
|
2765
2786
|
] }),
|
|
2766
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
2787
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx4.HStack, { gap: "4", w: "full", children: [
|
|
2767
2788
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
2768
2789
|
Button,
|
|
2769
2790
|
{
|
|
@@ -2796,7 +2817,7 @@ function ConfirmModal(props) {
|
|
|
2796
2817
|
] });
|
|
2797
2818
|
}
|
|
2798
2819
|
function useConfirmModal() {
|
|
2799
|
-
const context = (0,
|
|
2820
|
+
const context = (0, import_react23.useContext)(ConfirmModalContext);
|
|
2800
2821
|
if (context === null) {
|
|
2801
2822
|
throw new Error(
|
|
2802
2823
|
"useConfirmModal must be used within a ConfirmModal Provider"
|
|
@@ -2806,20 +2827,20 @@ function useConfirmModal() {
|
|
|
2806
2827
|
}
|
|
2807
2828
|
|
|
2808
2829
|
// src/context/cta-modal.tsx
|
|
2809
|
-
var
|
|
2810
|
-
var import_jsx4 = require("@cerberus/styled-system/jsx");
|
|
2811
|
-
var import_css48 = require("@cerberus/styled-system/css");
|
|
2830
|
+
var import_react24 = require("react");
|
|
2812
2831
|
var import_jsx5 = require("@cerberus/styled-system/jsx");
|
|
2832
|
+
var import_css48 = require("@cerberus/styled-system/css");
|
|
2833
|
+
var import_jsx6 = require("@cerberus/styled-system/jsx");
|
|
2813
2834
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
2814
|
-
var CTAModalContext = (0,
|
|
2835
|
+
var CTAModalContext = (0, import_react24.createContext)(null);
|
|
2815
2836
|
function CTAModal(props) {
|
|
2816
2837
|
var _a, _b;
|
|
2817
|
-
const [open, setOpen] = (0,
|
|
2818
|
-
const [content, setContent] = (0,
|
|
2838
|
+
const [open, setOpen] = (0, import_react24.useState)(false);
|
|
2839
|
+
const [content, setContent] = (0, import_react24.useState)(null);
|
|
2819
2840
|
const confirmIcon = content == null ? void 0 : content.icon;
|
|
2820
2841
|
const { icons } = useCerberusContext();
|
|
2821
2842
|
const { confirmModal: FallbackIcon } = icons;
|
|
2822
|
-
const handleShow = (0,
|
|
2843
|
+
const handleShow = (0, import_react24.useCallback)(
|
|
2823
2844
|
(options) => {
|
|
2824
2845
|
const maxActions = 2;
|
|
2825
2846
|
if (options.actions.length > maxActions) {
|
|
@@ -2832,7 +2853,7 @@ function CTAModal(props) {
|
|
|
2832
2853
|
},
|
|
2833
2854
|
[setOpen]
|
|
2834
2855
|
);
|
|
2835
|
-
const handleActionClick = (0,
|
|
2856
|
+
const handleActionClick = (0, import_react24.useCallback)(
|
|
2836
2857
|
(event) => {
|
|
2837
2858
|
const index = event.currentTarget.getAttribute("data-index");
|
|
2838
2859
|
const action = content == null ? void 0 : content.actions[Number(index)];
|
|
@@ -2842,7 +2863,7 @@ function CTAModal(props) {
|
|
|
2842
2863
|
},
|
|
2843
2864
|
[content, setOpen]
|
|
2844
2865
|
);
|
|
2845
|
-
const value = (0,
|
|
2866
|
+
const value = (0, import_react24.useMemo)(
|
|
2846
2867
|
() => ({
|
|
2847
2868
|
show: handleShow
|
|
2848
2869
|
}),
|
|
@@ -2852,8 +2873,8 @@ function CTAModal(props) {
|
|
|
2852
2873
|
props.children,
|
|
2853
2874
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(DialogProvider, { open, onOpenChange: (e) => setOpen(e.open), children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Dialog, { size: "sm", children: [
|
|
2854
2875
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(DialogCloseIconTrigger, {}),
|
|
2855
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
2856
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
2876
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx6.VStack, { gap: "xl", w: "full", children: [
|
|
2877
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_jsx6.VStack, { alignItems: "flex-start", gap: "md", w: "full", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx6.VStack, { gap: "lg", w: "full", children: [
|
|
2857
2878
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
2858
2879
|
Avatar,
|
|
2859
2880
|
{
|
|
@@ -2873,7 +2894,7 @@ function CTAModal(props) {
|
|
|
2873
2894
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(DialogHeading, { children: content == null ? void 0 : content.heading }),
|
|
2874
2895
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(DialogDescription, { children: content == null ? void 0 : content.description })
|
|
2875
2896
|
] }) }),
|
|
2876
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
2897
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_jsx5.HStack, { gap: "md", w: "full", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Show, { when: Boolean((_a = content == null ? void 0 : content.actions) == null ? void 0 : _a.length), children: (_b = content == null ? void 0 : content.actions) == null ? void 0 : _b.map((action, index) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
2877
2898
|
Button,
|
|
2878
2899
|
{
|
|
2879
2900
|
"data-index": index,
|
|
@@ -2892,7 +2913,7 @@ function CTAModal(props) {
|
|
|
2892
2913
|
] });
|
|
2893
2914
|
}
|
|
2894
2915
|
function useCTAModal() {
|
|
2895
|
-
const context = (0,
|
|
2916
|
+
const context = (0, import_react24.useContext)(CTAModalContext);
|
|
2896
2917
|
if (context === null) {
|
|
2897
2918
|
throw new Error("useCTAModal must be used within a CTAModal Provider");
|
|
2898
2919
|
}
|
|
@@ -2900,7 +2921,7 @@ function useCTAModal() {
|
|
|
2900
2921
|
}
|
|
2901
2922
|
|
|
2902
2923
|
// src/context/notification-center.tsx
|
|
2903
|
-
var
|
|
2924
|
+
var import_react25 = require("react");
|
|
2904
2925
|
var import_patterns14 = require("@cerberus/styled-system/patterns");
|
|
2905
2926
|
var import_recipes40 = require("@cerberus/styled-system/recipes");
|
|
2906
2927
|
var import_css49 = require("@cerberus/styled-system/css");
|
|
@@ -2937,15 +2958,15 @@ function clearNotificationState(dispatch) {
|
|
|
2937
2958
|
|
|
2938
2959
|
// src/context/notification-center.tsx
|
|
2939
2960
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
2940
|
-
var NotificationsContext = (0,
|
|
2961
|
+
var NotificationsContext = (0, import_react25.createContext)(null);
|
|
2941
2962
|
function NotificationCenter(props) {
|
|
2942
|
-
const [state, dispatch] = (0,
|
|
2963
|
+
const [state, dispatch] = (0, import_react25.useReducer)(notificationCenterReducer, []);
|
|
2943
2964
|
const styles = (0, import_recipes40.notification)();
|
|
2944
|
-
const timeout = (0,
|
|
2965
|
+
const timeout = (0, import_react25.useMemo)(
|
|
2945
2966
|
() => props.duration || 6e3,
|
|
2946
2967
|
[props.duration]
|
|
2947
2968
|
);
|
|
2948
|
-
const closeNotification = (0,
|
|
2969
|
+
const closeNotification = (0, import_react25.useCallback)(
|
|
2949
2970
|
(id) => {
|
|
2950
2971
|
updateNotificationState(dispatch, {
|
|
2951
2972
|
id,
|
|
@@ -2957,7 +2978,7 @@ function NotificationCenter(props) {
|
|
|
2957
2978
|
},
|
|
2958
2979
|
[dispatch]
|
|
2959
2980
|
);
|
|
2960
|
-
const handleNotify = (0,
|
|
2981
|
+
const handleNotify = (0, import_react25.useCallback)(
|
|
2961
2982
|
(options) => {
|
|
2962
2983
|
const id = `${options.palette}:${state.length + 1}`;
|
|
2963
2984
|
addNotification(dispatch, {
|
|
@@ -2971,20 +2992,20 @@ function NotificationCenter(props) {
|
|
|
2971
2992
|
},
|
|
2972
2993
|
[dispatch, state, timeout, closeNotification]
|
|
2973
2994
|
);
|
|
2974
|
-
const handleClose = (0,
|
|
2995
|
+
const handleClose = (0, import_react25.useCallback)(
|
|
2975
2996
|
(e) => {
|
|
2976
2997
|
const target = e.currentTarget;
|
|
2977
2998
|
closeNotification(target.value);
|
|
2978
2999
|
},
|
|
2979
3000
|
[closeNotification]
|
|
2980
3001
|
);
|
|
2981
|
-
const handleCloseAll = (0,
|
|
3002
|
+
const handleCloseAll = (0, import_react25.useCallback)(() => {
|
|
2982
3003
|
state.forEach((item) => {
|
|
2983
3004
|
if (item.onClose) item.onClose();
|
|
2984
3005
|
});
|
|
2985
3006
|
clearNotificationState(dispatch);
|
|
2986
3007
|
}, [state, dispatch]);
|
|
2987
|
-
const value = (0,
|
|
3008
|
+
const value = (0, import_react25.useMemo)(
|
|
2988
3009
|
() => ({
|
|
2989
3010
|
notify: handleNotify
|
|
2990
3011
|
}),
|
|
@@ -3031,7 +3052,7 @@ function NotificationCenter(props) {
|
|
|
3031
3052
|
}
|
|
3032
3053
|
function MatchNotification(props) {
|
|
3033
3054
|
const { palette, id, onClose, heading, description, open } = props;
|
|
3034
|
-
const sharedProps = (0,
|
|
3055
|
+
const sharedProps = (0, import_react25.useMemo)(
|
|
3035
3056
|
() => ({
|
|
3036
3057
|
id,
|
|
3037
3058
|
open: true,
|
|
@@ -3065,7 +3086,7 @@ function MatchNotification(props) {
|
|
|
3065
3086
|
}
|
|
3066
3087
|
}
|
|
3067
3088
|
function useNotificationCenter() {
|
|
3068
|
-
const context = (0,
|
|
3089
|
+
const context = (0, import_react25.useContext)(NotificationsContext);
|
|
3069
3090
|
if (!context) {
|
|
3070
3091
|
throw new Error(
|
|
3071
3092
|
"useNotificationCenter must be used within a NotificationsProvider"
|
|
@@ -3075,35 +3096,35 @@ function useNotificationCenter() {
|
|
|
3075
3096
|
}
|
|
3076
3097
|
|
|
3077
3098
|
// src/context/prompt-modal.tsx
|
|
3078
|
-
var
|
|
3099
|
+
var import_react26 = require("react");
|
|
3079
3100
|
var import_css50 = require("@cerberus/styled-system/css");
|
|
3080
3101
|
var import_patterns15 = require("@cerberus/styled-system/patterns");
|
|
3081
|
-
var
|
|
3082
|
-
var
|
|
3102
|
+
var import_jsx7 = require("@cerberus/styled-system/jsx");
|
|
3103
|
+
var import_react27 = require("@ark-ui/react");
|
|
3083
3104
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
3084
|
-
var PromptModalContext = (0,
|
|
3105
|
+
var PromptModalContext = (0, import_react26.createContext)(null);
|
|
3085
3106
|
function PromptModal(props) {
|
|
3086
|
-
const resolveRef = (0,
|
|
3087
|
-
const [open, setOpen] = (0,
|
|
3088
|
-
const [content, setContent] = (0,
|
|
3089
|
-
const [inputValue, setInputValue] = (0,
|
|
3107
|
+
const resolveRef = (0, import_react26.useRef)(null);
|
|
3108
|
+
const [open, setOpen] = (0, import_react26.useState)(false);
|
|
3109
|
+
const [content, setContent] = (0, import_react26.useState)(null);
|
|
3110
|
+
const [inputValue, setInputValue] = (0, import_react26.useState)("");
|
|
3090
3111
|
const { icons } = useCerberusContext();
|
|
3091
3112
|
const { promptModal: PromptIcon } = icons;
|
|
3092
|
-
const isValid = (0,
|
|
3113
|
+
const isValid = (0, import_react26.useMemo)(
|
|
3093
3114
|
() => inputValue === (content == null ? void 0 : content.key),
|
|
3094
3115
|
[inputValue, content]
|
|
3095
3116
|
);
|
|
3096
|
-
const palette = (0,
|
|
3117
|
+
const palette = (0, import_react26.useMemo)(
|
|
3097
3118
|
() => (content == null ? void 0 : content.kind) === "destructive" ? "danger" : "action",
|
|
3098
3119
|
[content]
|
|
3099
3120
|
);
|
|
3100
|
-
const handleChange = (0,
|
|
3121
|
+
const handleChange = (0, import_react26.useCallback)(
|
|
3101
3122
|
(e) => {
|
|
3102
3123
|
setInputValue(e.currentTarget.value);
|
|
3103
3124
|
},
|
|
3104
3125
|
[content]
|
|
3105
3126
|
);
|
|
3106
|
-
const handleChoice = (0,
|
|
3127
|
+
const handleChoice = (0, import_react26.useCallback)(
|
|
3107
3128
|
(e) => {
|
|
3108
3129
|
var _a;
|
|
3109
3130
|
const target = e.currentTarget;
|
|
@@ -3114,7 +3135,7 @@ function PromptModal(props) {
|
|
|
3114
3135
|
},
|
|
3115
3136
|
[inputValue, setOpen]
|
|
3116
3137
|
);
|
|
3117
|
-
const handleShow = (0,
|
|
3138
|
+
const handleShow = (0, import_react26.useCallback)(
|
|
3118
3139
|
(options) => {
|
|
3119
3140
|
return new Promise((resolve) => {
|
|
3120
3141
|
setContent({ ...options, kind: options.kind || "non-destructive" });
|
|
@@ -3124,7 +3145,7 @@ function PromptModal(props) {
|
|
|
3124
3145
|
},
|
|
3125
3146
|
[setOpen]
|
|
3126
3147
|
);
|
|
3127
|
-
const value = (0,
|
|
3148
|
+
const value = (0, import_react26.useMemo)(
|
|
3128
3149
|
() => ({
|
|
3129
3150
|
show: handleShow
|
|
3130
3151
|
}),
|
|
@@ -3132,10 +3153,10 @@ function PromptModal(props) {
|
|
|
3132
3153
|
);
|
|
3133
3154
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(PromptModalContext.Provider, { value, children: [
|
|
3134
3155
|
props.children,
|
|
3135
|
-
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DialogProvider, { open, onOpenChange: (e) => setOpen(e.open), children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Dialog, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
3136
|
-
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
3156
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DialogProvider, { open, onOpenChange: (e) => setOpen(e.open), children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Dialog, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx7.VStack, { gap: "xl", w: "full", children: [
|
|
3157
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx7.VStack, { alignItems: "flex-start", gap: "md", w: "full", children: [
|
|
3137
3158
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
3138
|
-
|
|
3159
|
+
import_jsx7.HStack,
|
|
3139
3160
|
{
|
|
3140
3161
|
alignSelf: "center",
|
|
3141
3162
|
justify: "center",
|
|
@@ -3171,7 +3192,7 @@ function PromptModal(props) {
|
|
|
3171
3192
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DialogDescription, { children: content == null ? void 0 : content.description })
|
|
3172
3193
|
] }),
|
|
3173
3194
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
3174
|
-
|
|
3195
|
+
import_jsx7.VStack,
|
|
3175
3196
|
{
|
|
3176
3197
|
alignItems: "flex-start",
|
|
3177
3198
|
marginBlockStart: "md",
|
|
@@ -3206,7 +3227,7 @@ function PromptModal(props) {
|
|
|
3206
3227
|
] })
|
|
3207
3228
|
}
|
|
3208
3229
|
),
|
|
3209
|
-
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
3230
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx7.HStack, { gap: "md", justify: "stretch", w: "full", children: [
|
|
3210
3231
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
3211
3232
|
Button,
|
|
3212
3233
|
{
|
|
@@ -3222,7 +3243,7 @@ function PromptModal(props) {
|
|
|
3222
3243
|
children: content == null ? void 0 : content.actionText
|
|
3223
3244
|
}
|
|
3224
3245
|
),
|
|
3225
|
-
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
3246
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_react27.DialogCloseTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
3226
3247
|
Button,
|
|
3227
3248
|
{
|
|
3228
3249
|
className: (0, import_css50.css)({
|
|
@@ -3240,7 +3261,7 @@ function PromptModal(props) {
|
|
|
3240
3261
|
] });
|
|
3241
3262
|
}
|
|
3242
3263
|
function usePromptModal() {
|
|
3243
|
-
const context = (0,
|
|
3264
|
+
const context = (0, import_react26.useContext)(PromptModalContext);
|
|
3244
3265
|
if (context === null) {
|
|
3245
3266
|
throw new Error("usePromptModal must be used within a PromptModal Provider");
|
|
3246
3267
|
}
|
|
@@ -3248,50 +3269,50 @@ function usePromptModal() {
|
|
|
3248
3269
|
}
|
|
3249
3270
|
|
|
3250
3271
|
// src/context/theme.tsx
|
|
3251
|
-
var
|
|
3272
|
+
var import_react29 = require("react");
|
|
3252
3273
|
|
|
3253
3274
|
// src/hooks/useTheme.ts
|
|
3254
|
-
var
|
|
3275
|
+
var import_react28 = require("react");
|
|
3255
3276
|
var THEME_KEY = "cerberus-theme";
|
|
3256
3277
|
var MODE_KEY = "cerberus-mode";
|
|
3257
3278
|
function useTheme(defaultTheme = "cerberus", defaultColorMode = "light", options = {}) {
|
|
3258
3279
|
const { updateMode, updateTheme, cache } = options;
|
|
3259
|
-
const [theme, setTheme] = (0,
|
|
3260
|
-
const [colorMode, setColorMode] = (0,
|
|
3261
|
-
const handleThemeChange = (0,
|
|
3280
|
+
const [theme, setTheme] = (0, import_react28.useState)(defaultTheme);
|
|
3281
|
+
const [colorMode, setColorMode] = (0, import_react28.useState)(defaultColorMode);
|
|
3282
|
+
const handleThemeChange = (0, import_react28.useCallback)(
|
|
3262
3283
|
(newTheme) => {
|
|
3263
3284
|
setTheme(newTheme);
|
|
3264
3285
|
updateTheme == null ? void 0 : updateTheme(newTheme);
|
|
3265
3286
|
},
|
|
3266
3287
|
[updateTheme]
|
|
3267
3288
|
);
|
|
3268
|
-
const handleColorModeChange = (0,
|
|
3289
|
+
const handleColorModeChange = (0, import_react28.useCallback)(
|
|
3269
3290
|
(newMode) => {
|
|
3270
3291
|
setColorMode(newMode);
|
|
3271
3292
|
updateMode == null ? void 0 : updateMode(newMode);
|
|
3272
3293
|
},
|
|
3273
3294
|
[updateMode]
|
|
3274
3295
|
);
|
|
3275
|
-
(0,
|
|
3296
|
+
(0, import_react28.useLayoutEffect)(() => {
|
|
3276
3297
|
const theme2 = localStorage.getItem(THEME_KEY);
|
|
3277
3298
|
if (theme2) {
|
|
3278
3299
|
setTheme(theme2);
|
|
3279
3300
|
}
|
|
3280
3301
|
}, []);
|
|
3281
|
-
(0,
|
|
3302
|
+
(0, import_react28.useLayoutEffect)(() => {
|
|
3282
3303
|
const mode = localStorage.getItem(MODE_KEY);
|
|
3283
3304
|
if (mode) {
|
|
3284
3305
|
setColorMode(mode);
|
|
3285
3306
|
}
|
|
3286
3307
|
}, []);
|
|
3287
|
-
(0,
|
|
3308
|
+
(0, import_react28.useEffect)(() => {
|
|
3288
3309
|
const root = document.documentElement;
|
|
3289
3310
|
root.dataset.pandaTheme = theme;
|
|
3290
3311
|
if (cache) {
|
|
3291
3312
|
localStorage.setItem(THEME_KEY, theme);
|
|
3292
3313
|
}
|
|
3293
3314
|
}, [theme, cache]);
|
|
3294
|
-
(0,
|
|
3315
|
+
(0, import_react28.useEffect)(() => {
|
|
3295
3316
|
const root = document.documentElement;
|
|
3296
3317
|
if (colorMode === "system") {
|
|
3297
3318
|
root.dataset.colorMode = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
@@ -3302,7 +3323,7 @@ function useTheme(defaultTheme = "cerberus", defaultColorMode = "light", options
|
|
|
3302
3323
|
localStorage.setItem(MODE_KEY, colorMode);
|
|
3303
3324
|
}
|
|
3304
3325
|
}, [colorMode, cache]);
|
|
3305
|
-
return (0,
|
|
3326
|
+
return (0, import_react28.useMemo)(
|
|
3306
3327
|
() => ({
|
|
3307
3328
|
theme,
|
|
3308
3329
|
mode: colorMode,
|
|
@@ -3315,7 +3336,7 @@ function useTheme(defaultTheme = "cerberus", defaultColorMode = "light", options
|
|
|
3315
3336
|
|
|
3316
3337
|
// src/context/theme.tsx
|
|
3317
3338
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
3318
|
-
var ThemeContext = (0,
|
|
3339
|
+
var ThemeContext = (0, import_react29.createContext)(
|
|
3319
3340
|
null
|
|
3320
3341
|
);
|
|
3321
3342
|
function ThemeProvider(props) {
|
|
@@ -3327,7 +3348,7 @@ function ThemeProvider(props) {
|
|
|
3327
3348
|
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ThemeContext.Provider, { value: state, children: props.children });
|
|
3328
3349
|
}
|
|
3329
3350
|
function useThemeContext() {
|
|
3330
|
-
const context = (0,
|
|
3351
|
+
const context = (0, import_react29.useContext)(ThemeContext);
|
|
3331
3352
|
if (!context) {
|
|
3332
3353
|
throw new Error("useThemeContext must be used within a ThemeProvider");
|
|
3333
3354
|
}
|
|
@@ -3335,13 +3356,13 @@ function useThemeContext() {
|
|
|
3335
3356
|
}
|
|
3336
3357
|
|
|
3337
3358
|
// src/hooks/useDate.ts
|
|
3338
|
-
var
|
|
3359
|
+
var import_react30 = require("react");
|
|
3339
3360
|
function useDate(options) {
|
|
3340
3361
|
const initialValue = (options == null ? void 0 : options.initialValue) ?? "";
|
|
3341
3362
|
const format = (options == null ? void 0 : options.format) ?? DateFormats.USMilitary;
|
|
3342
3363
|
const onChange = options == null ? void 0 : options.onChange;
|
|
3343
|
-
const [value, setValue] = (0,
|
|
3344
|
-
const handleChange = (0,
|
|
3364
|
+
const [value, setValue] = (0, import_react30.useState)(initialValue);
|
|
3365
|
+
const handleChange = (0, import_react30.useCallback)(
|
|
3345
3366
|
(e) => {
|
|
3346
3367
|
const newValue = formatMilitaryDate(e.currentTarget.value);
|
|
3347
3368
|
if (onChange) onChange(e);
|
|
@@ -3349,7 +3370,7 @@ function useDate(options) {
|
|
|
3349
3370
|
},
|
|
3350
3371
|
[onChange]
|
|
3351
3372
|
);
|
|
3352
|
-
return (0,
|
|
3373
|
+
return (0, import_react30.useMemo)(
|
|
3353
3374
|
() => ({
|
|
3354
3375
|
format,
|
|
3355
3376
|
value,
|
|
@@ -3428,21 +3449,21 @@ var MONTHS = [
|
|
|
3428
3449
|
];
|
|
3429
3450
|
|
|
3430
3451
|
// src/hooks/useModal.ts
|
|
3431
|
-
var
|
|
3452
|
+
var import_react31 = require("react");
|
|
3432
3453
|
function useModal() {
|
|
3433
|
-
const modalRef = (0,
|
|
3434
|
-
const [isOpen, setIsOpen] = (0,
|
|
3435
|
-
const show = (0,
|
|
3454
|
+
const modalRef = (0, import_react31.useRef)(null);
|
|
3455
|
+
const [isOpen, setIsOpen] = (0, import_react31.useState)(false);
|
|
3456
|
+
const show = (0, import_react31.useCallback)(() => {
|
|
3436
3457
|
var _a;
|
|
3437
3458
|
(_a = modalRef.current) == null ? void 0 : _a.showModal();
|
|
3438
3459
|
setIsOpen(true);
|
|
3439
3460
|
}, []);
|
|
3440
|
-
const close = (0,
|
|
3461
|
+
const close = (0, import_react31.useCallback)(() => {
|
|
3441
3462
|
var _a;
|
|
3442
3463
|
(_a = modalRef.current) == null ? void 0 : _a.close();
|
|
3443
3464
|
setIsOpen(false);
|
|
3444
3465
|
}, []);
|
|
3445
|
-
return (0,
|
|
3466
|
+
return (0, import_react31.useMemo)(() => {
|
|
3446
3467
|
return {
|
|
3447
3468
|
modalRef,
|
|
3448
3469
|
show,
|
|
@@ -3453,11 +3474,11 @@ function useModal() {
|
|
|
3453
3474
|
}
|
|
3454
3475
|
|
|
3455
3476
|
// src/hooks/useToggle.ts
|
|
3456
|
-
var
|
|
3477
|
+
var import_react32 = require("react");
|
|
3457
3478
|
function useToggle(options) {
|
|
3458
|
-
const [checked, setChecked] = (0,
|
|
3479
|
+
const [checked, setChecked] = (0, import_react32.useState)((options == null ? void 0 : options.checked) ?? "");
|
|
3459
3480
|
const onChange = options == null ? void 0 : options.onChange;
|
|
3460
|
-
const handleChange = (0,
|
|
3481
|
+
const handleChange = (0, import_react32.useCallback)(
|
|
3461
3482
|
(e) => {
|
|
3462
3483
|
const target = e.currentTarget;
|
|
3463
3484
|
setChecked((prev) => {
|
|
@@ -3467,25 +3488,25 @@ function useToggle(options) {
|
|
|
3467
3488
|
},
|
|
3468
3489
|
[onChange]
|
|
3469
3490
|
);
|
|
3470
|
-
return (0,
|
|
3491
|
+
return (0, import_react32.useMemo)(() => ({ checked, handleChange }), [checked, handleChange]);
|
|
3471
3492
|
}
|
|
3472
3493
|
|
|
3473
3494
|
// src/hooks/useRootColors.ts
|
|
3474
|
-
var
|
|
3495
|
+
var import_react33 = require("react");
|
|
3475
3496
|
function useRootColors(colors = []) {
|
|
3476
|
-
const [state, dispatch] = (0,
|
|
3477
|
-
const handleRefetch = (0,
|
|
3497
|
+
const [state, dispatch] = (0, import_react33.useReducer)(rootColorsReducer, {});
|
|
3498
|
+
const handleRefetch = (0, import_react33.useCallback)(() => {
|
|
3478
3499
|
return new Promise((resolve) => {
|
|
3479
3500
|
dispatch(formatColors(colors));
|
|
3480
3501
|
resolve();
|
|
3481
3502
|
});
|
|
3482
3503
|
}, []);
|
|
3483
|
-
(0,
|
|
3504
|
+
(0, import_react33.useEffect)(() => {
|
|
3484
3505
|
if (Object.keys(state).length === colors.length) return;
|
|
3485
3506
|
dispatch(formatColors(colors));
|
|
3486
3507
|
console.log("updating colors in root hook");
|
|
3487
3508
|
}, [colors]);
|
|
3488
|
-
return (0,
|
|
3509
|
+
return (0, import_react33.useMemo)(
|
|
3489
3510
|
() => ({ colors: state, refetch: handleRefetch }),
|
|
3490
3511
|
[state, handleRefetch]
|
|
3491
3512
|
);
|
|
@@ -3677,6 +3698,8 @@ __reExport(src_exports, require("@dnd-kit/core"), module.exports);
|
|
|
3677
3698
|
AdmonitionHeading,
|
|
3678
3699
|
Avatar,
|
|
3679
3700
|
Button,
|
|
3701
|
+
ButtonIcon,
|
|
3702
|
+
ButtonParts,
|
|
3680
3703
|
CTAModal,
|
|
3681
3704
|
CerberusProvider,
|
|
3682
3705
|
Checkbox,
|