intlayer-editor 7.0.8 → 7.0.9-canary.2
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/client/dist/assets/{CodeBlockShiki-BD9incJt.js → CodeBlockShiki-DcO6QqUs.js} +3 -3
- package/client/dist/assets/{bundle-web-BpNxvicp.js → bundle-web-DnDpJc5N.js} +1 -1
- package/client/dist/assets/{index-yUZ4ks9F.css → index-BVgTO6SK.css} +602 -288
- package/client/dist/assets/{index-BLpSOJjm.js → index-B_fQHAk5.js} +1941 -601
- package/client/dist/index.html +2 -2
- package/package.json +36 -33
|
@@ -13552,6 +13552,11 @@ var defaultValues_exports = /* @__PURE__ */ __export$1({
|
|
|
13552
13552
|
Log: () => log_exports,
|
|
13553
13553
|
Routing: () => routing_exports
|
|
13554
13554
|
});
|
|
13555
|
+
const camelCaseToSentence = (value) => {
|
|
13556
|
+
if (!value) return "";
|
|
13557
|
+
const withSpaces = value.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2");
|
|
13558
|
+
return withSpaces.charAt(0).toUpperCase() + withSpaces.slice(1).toLowerCase();
|
|
13559
|
+
};
|
|
13555
13560
|
const createCookieEntry = (options) => {
|
|
13556
13561
|
const { name, path, expires, domain, secure, sameSite, httpOnly } = options ?? {};
|
|
13557
13562
|
return {
|
|
@@ -14907,42 +14912,7 @@ const setLocaleInStorage = (locale, isCookieEnabled) => setLocaleInStorage$1(loc
|
|
|
14907
14912
|
...localeStorageOptions,
|
|
14908
14913
|
isCookieEnabled
|
|
14909
14914
|
});
|
|
14910
|
-
const
|
|
14911
|
-
for (let i2 = 0; i2 < 256; ++i2) {
|
|
14912
|
-
byteToHex.push((i2 + 256).toString(16).slice(1));
|
|
14913
|
-
}
|
|
14914
|
-
function unsafeStringify(arr, offset2 = 0) {
|
|
14915
|
-
return (byteToHex[arr[offset2 + 0]] + byteToHex[arr[offset2 + 1]] + byteToHex[arr[offset2 + 2]] + byteToHex[arr[offset2 + 3]] + "-" + byteToHex[arr[offset2 + 4]] + byteToHex[arr[offset2 + 5]] + "-" + byteToHex[arr[offset2 + 6]] + byteToHex[arr[offset2 + 7]] + "-" + byteToHex[arr[offset2 + 8]] + byteToHex[arr[offset2 + 9]] + "-" + byteToHex[arr[offset2 + 10]] + byteToHex[arr[offset2 + 11]] + byteToHex[arr[offset2 + 12]] + byteToHex[arr[offset2 + 13]] + byteToHex[arr[offset2 + 14]] + byteToHex[arr[offset2 + 15]]).toLowerCase();
|
|
14916
|
-
}
|
|
14917
|
-
let getRandomValues;
|
|
14918
|
-
const rnds8 = new Uint8Array(16);
|
|
14919
|
-
function rng() {
|
|
14920
|
-
if (!getRandomValues) {
|
|
14921
|
-
if (typeof crypto === "undefined" || !crypto.getRandomValues) {
|
|
14922
|
-
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
14923
|
-
}
|
|
14924
|
-
getRandomValues = crypto.getRandomValues.bind(crypto);
|
|
14925
|
-
}
|
|
14926
|
-
return getRandomValues(rnds8);
|
|
14927
|
-
}
|
|
14928
|
-
const randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
14929
|
-
const native = { randomUUID };
|
|
14930
|
-
function _v4(options, buf, offset2) {
|
|
14931
|
-
options = options || {};
|
|
14932
|
-
const rnds = options.random ?? options.rng?.() ?? rng();
|
|
14933
|
-
if (rnds.length < 16) {
|
|
14934
|
-
throw new Error("Random bytes length must be >= 16");
|
|
14935
|
-
}
|
|
14936
|
-
rnds[6] = rnds[6] & 15 | 64;
|
|
14937
|
-
rnds[8] = rnds[8] & 63 | 128;
|
|
14938
|
-
return unsafeStringify(rnds);
|
|
14939
|
-
}
|
|
14940
|
-
function v4(options, buf, offset2) {
|
|
14941
|
-
if (native.randomUUID && true && !options) {
|
|
14942
|
-
return native.randomUUID();
|
|
14943
|
-
}
|
|
14944
|
-
return _v4(options);
|
|
14945
|
-
}
|
|
14915
|
+
const randomUUID = () => Math.random().toString(36).slice(2);
|
|
14946
14916
|
const { editor } = configuration ?? {};
|
|
14947
14917
|
const CommunicatorContext = reactExports.createContext({
|
|
14948
14918
|
postMessage: () => null,
|
|
@@ -14954,7 +14924,7 @@ const CommunicatorContext = reactExports.createContext({
|
|
|
14954
14924
|
senderId: ""
|
|
14955
14925
|
});
|
|
14956
14926
|
const CommunicatorProvider = ({ children, allowedOrigins, postMessage }) => {
|
|
14957
|
-
const senderIdRef = reactExports.useRef(
|
|
14927
|
+
const senderIdRef = reactExports.useRef(randomUUID());
|
|
14958
14928
|
const value = reactExports.useMemo(() => ({
|
|
14959
14929
|
postMessage,
|
|
14960
14930
|
allowedOrigins,
|
|
@@ -20830,7 +20800,144 @@ const getDefaultConfig = () => {
|
|
|
20830
20800
|
};
|
|
20831
20801
|
};
|
|
20832
20802
|
const twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
|
|
20833
|
-
const cn$
|
|
20803
|
+
const cn$2 = (...inputs) => twMerge(clsx(inputs));
|
|
20804
|
+
const falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
20805
|
+
const cx$1 = clsx;
|
|
20806
|
+
const cva = (base, config2) => (props) => {
|
|
20807
|
+
var _config_compoundVariants;
|
|
20808
|
+
if ((config2 === null || config2 === void 0 ? void 0 : config2.variants) == null) return cx$1(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
20809
|
+
const { variants, defaultVariants } = config2;
|
|
20810
|
+
const getVariantClassNames = Object.keys(variants).map((variant) => {
|
|
20811
|
+
const variantProp = props === null || props === void 0 ? void 0 : props[variant];
|
|
20812
|
+
const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
|
|
20813
|
+
if (variantProp === null) return null;
|
|
20814
|
+
const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
|
|
20815
|
+
return variants[variant][variantKey];
|
|
20816
|
+
});
|
|
20817
|
+
const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param) => {
|
|
20818
|
+
let [key2, value] = param;
|
|
20819
|
+
if (value === void 0) {
|
|
20820
|
+
return acc;
|
|
20821
|
+
}
|
|
20822
|
+
acc[key2] = value;
|
|
20823
|
+
return acc;
|
|
20824
|
+
}, {});
|
|
20825
|
+
const getCompoundVariantClassNames = config2 === null || config2 === void 0 ? void 0 : (_config_compoundVariants = config2.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param) => {
|
|
20826
|
+
let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
|
|
20827
|
+
return Object.entries(compoundVariantOptions).every((param2) => {
|
|
20828
|
+
let [key2, value] = param2;
|
|
20829
|
+
return Array.isArray(value) ? value.includes({
|
|
20830
|
+
...defaultVariants,
|
|
20831
|
+
...propsWithoutUndefined
|
|
20832
|
+
}[key2]) : {
|
|
20833
|
+
...defaultVariants,
|
|
20834
|
+
...propsWithoutUndefined
|
|
20835
|
+
}[key2] === value;
|
|
20836
|
+
}) ? [
|
|
20837
|
+
...acc,
|
|
20838
|
+
cvClass,
|
|
20839
|
+
cvClassName
|
|
20840
|
+
] : acc;
|
|
20841
|
+
}, []);
|
|
20842
|
+
return cx$1(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
20843
|
+
};
|
|
20844
|
+
const containerVariants$1 = cva("flex flex-col text-text backdrop-blur", {
|
|
20845
|
+
variants: {
|
|
20846
|
+
roundedSize: {
|
|
20847
|
+
none: "rounded-none",
|
|
20848
|
+
sm: "rounded-sm [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-md",
|
|
20849
|
+
md: "rounded-md [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-lg",
|
|
20850
|
+
lg: "rounded-lg [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-xl",
|
|
20851
|
+
xl: "rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl",
|
|
20852
|
+
"2xl": "rounded-2xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-3xl",
|
|
20853
|
+
"3xl": "rounded-3xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-4xl",
|
|
20854
|
+
full: "rounded-full [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-full"
|
|
20855
|
+
},
|
|
20856
|
+
transparency: {
|
|
20857
|
+
none: "bg-card",
|
|
20858
|
+
sm: "bg-card/95",
|
|
20859
|
+
md: "bg-card/70",
|
|
20860
|
+
lg: "bg-card/40",
|
|
20861
|
+
xl: "bg-card/20",
|
|
20862
|
+
full: ""
|
|
20863
|
+
},
|
|
20864
|
+
padding: {
|
|
20865
|
+
none: "p-0",
|
|
20866
|
+
sm: "px-2 py-4",
|
|
20867
|
+
md: "px-4 py-6",
|
|
20868
|
+
lg: "px-6 py-8",
|
|
20869
|
+
xl: "px-8 py-10",
|
|
20870
|
+
"2xl": "px-10 py-12"
|
|
20871
|
+
},
|
|
20872
|
+
separator: {
|
|
20873
|
+
without: "",
|
|
20874
|
+
x: "divide-x divide-dashed divide-text/20",
|
|
20875
|
+
y: "divide-y divide-dashed divide-text/20",
|
|
20876
|
+
both: "divide-x divide-y divide-dashed divide-text/20"
|
|
20877
|
+
},
|
|
20878
|
+
border: {
|
|
20879
|
+
none: "",
|
|
20880
|
+
with: "border-[1.5px]"
|
|
20881
|
+
},
|
|
20882
|
+
borderColor: {
|
|
20883
|
+
primary: "border-primary",
|
|
20884
|
+
secondary: "border-secondary",
|
|
20885
|
+
neutral: "border-neutral",
|
|
20886
|
+
text: "border-text",
|
|
20887
|
+
error: "border-error",
|
|
20888
|
+
warning: "border-warning",
|
|
20889
|
+
success: "border-success"
|
|
20890
|
+
},
|
|
20891
|
+
background: {
|
|
20892
|
+
none: "bg-inherit",
|
|
20893
|
+
hoverable: "bg-opacity-5! backdrop-blur-0 hover:bg-opacity-10! hover:backdrop-blur focus:bg-opacity-10! focus:backdrop-blur aria-selected:bg-opacity-15! aria-selected:backdrop-blur",
|
|
20894
|
+
with: ""
|
|
20895
|
+
},
|
|
20896
|
+
gap: {
|
|
20897
|
+
none: "gap-0",
|
|
20898
|
+
sm: "gap-1",
|
|
20899
|
+
md: "gap-3",
|
|
20900
|
+
lg: "gap-5",
|
|
20901
|
+
xl: "gap-8",
|
|
20902
|
+
"2xl": "gap-10"
|
|
20903
|
+
}
|
|
20904
|
+
},
|
|
20905
|
+
defaultVariants: {
|
|
20906
|
+
roundedSize: "md",
|
|
20907
|
+
border: "none",
|
|
20908
|
+
borderColor: "text",
|
|
20909
|
+
transparency: "md",
|
|
20910
|
+
padding: "none",
|
|
20911
|
+
separator: "without",
|
|
20912
|
+
gap: "none"
|
|
20913
|
+
}
|
|
20914
|
+
});
|
|
20915
|
+
let ContainerRoundedSize = /* @__PURE__ */ (function(ContainerRoundedSize$1) {
|
|
20916
|
+
ContainerRoundedSize$1["NONE"] = "none";
|
|
20917
|
+
ContainerRoundedSize$1["SM"] = "sm";
|
|
20918
|
+
ContainerRoundedSize$1["MD"] = "md";
|
|
20919
|
+
ContainerRoundedSize$1["LG"] = "lg";
|
|
20920
|
+
ContainerRoundedSize$1["XL"] = "xl";
|
|
20921
|
+
ContainerRoundedSize$1["TWO_XL"] = "2xl";
|
|
20922
|
+
ContainerRoundedSize$1["THREE_XL"] = "3xl";
|
|
20923
|
+
ContainerRoundedSize$1["FULL"] = "full";
|
|
20924
|
+
return ContainerRoundedSize$1;
|
|
20925
|
+
})({});
|
|
20926
|
+
const Container = ({ children, roundedSize, padding, transparency, separator, className, border, borderColor, background, gap, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
20927
|
+
className: cn$2(containerVariants$1({
|
|
20928
|
+
roundedSize,
|
|
20929
|
+
transparency,
|
|
20930
|
+
padding,
|
|
20931
|
+
separator,
|
|
20932
|
+
border: typeof border === "boolean" ? border ? "with" : "none" : void 0,
|
|
20933
|
+
background,
|
|
20934
|
+
borderColor,
|
|
20935
|
+
gap,
|
|
20936
|
+
className
|
|
20937
|
+
})),
|
|
20938
|
+
...props,
|
|
20939
|
+
children
|
|
20940
|
+
});
|
|
20834
20941
|
const Spinner = ({ className, strokeWidth = 4 }) => /* @__PURE__ */ jsxRuntimeExports.jsx("svg", {
|
|
20835
20942
|
xmlns: "http://www.w3.org/2000/svg",
|
|
20836
20943
|
width: "44",
|
|
@@ -20839,7 +20946,7 @@ const Spinner = ({ className, strokeWidth = 4 }) => /* @__PURE__ */ jsxRuntimeEx
|
|
|
20839
20946
|
stroke: "currentColor",
|
|
20840
20947
|
role: "img",
|
|
20841
20948
|
"aria-label": "Spinner",
|
|
20842
|
-
className: cn$
|
|
20949
|
+
className: cn$2("size-full", className),
|
|
20843
20950
|
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("g", {
|
|
20844
20951
|
fill: "none",
|
|
20845
20952
|
fillRule: "evenodd",
|
|
@@ -20896,59 +21003,19 @@ const Spinner = ({ className, strokeWidth = 4 }) => /* @__PURE__ */ jsxRuntimeEx
|
|
|
20896
21003
|
const Loader = ({ children, isLoading = true, keepChildren = false, className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: isLoading && keepChildren ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
20897
21004
|
className: "relative size-full",
|
|
20898
21005
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
20899
|
-
className: cn$
|
|
21006
|
+
className: cn$2("absolute top-0 left-0 flex size-full max-h-screen max-w-[100vw] flex-1 items-center justify-center", className),
|
|
20900
21007
|
role: "status",
|
|
20901
21008
|
"aria-label": "Animated icon, meaning that the website is processing",
|
|
20902
21009
|
...props,
|
|
20903
21010
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Spinner, { className: "size-10 max-h-full max-w-full" })
|
|
20904
21011
|
}), children]
|
|
20905
21012
|
}) : isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
20906
|
-
className: cn$
|
|
21013
|
+
className: cn$2("flex size-full max-h-screen max-w-[100vw] flex-1 items-center justify-center", className),
|
|
20907
21014
|
role: "status",
|
|
20908
21015
|
"aria-label": "Animated icon, meaning that the website is processing",
|
|
20909
21016
|
...props,
|
|
20910
21017
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Spinner, { className: "size-10 max-h-full max-w-full" })
|
|
20911
21018
|
}) : children ?? /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {}) });
|
|
20912
|
-
const falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
20913
|
-
const cx$1 = clsx;
|
|
20914
|
-
const cva = (base, config2) => (props) => {
|
|
20915
|
-
var _config_compoundVariants;
|
|
20916
|
-
if ((config2 === null || config2 === void 0 ? void 0 : config2.variants) == null) return cx$1(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
20917
|
-
const { variants, defaultVariants } = config2;
|
|
20918
|
-
const getVariantClassNames = Object.keys(variants).map((variant) => {
|
|
20919
|
-
const variantProp = props === null || props === void 0 ? void 0 : props[variant];
|
|
20920
|
-
const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
|
|
20921
|
-
if (variantProp === null) return null;
|
|
20922
|
-
const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
|
|
20923
|
-
return variants[variant][variantKey];
|
|
20924
|
-
});
|
|
20925
|
-
const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param) => {
|
|
20926
|
-
let [key2, value] = param;
|
|
20927
|
-
if (value === void 0) {
|
|
20928
|
-
return acc;
|
|
20929
|
-
}
|
|
20930
|
-
acc[key2] = value;
|
|
20931
|
-
return acc;
|
|
20932
|
-
}, {});
|
|
20933
|
-
const getCompoundVariantClassNames = config2 === null || config2 === void 0 ? void 0 : (_config_compoundVariants = config2.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param) => {
|
|
20934
|
-
let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
|
|
20935
|
-
return Object.entries(compoundVariantOptions).every((param2) => {
|
|
20936
|
-
let [key2, value] = param2;
|
|
20937
|
-
return Array.isArray(value) ? value.includes({
|
|
20938
|
-
...defaultVariants,
|
|
20939
|
-
...propsWithoutUndefined
|
|
20940
|
-
}[key2]) : {
|
|
20941
|
-
...defaultVariants,
|
|
20942
|
-
...propsWithoutUndefined
|
|
20943
|
-
}[key2] === value;
|
|
20944
|
-
}) ? [
|
|
20945
|
-
...acc,
|
|
20946
|
-
cvClass,
|
|
20947
|
-
cvClassName
|
|
20948
|
-
] : acc;
|
|
20949
|
-
}, []);
|
|
20950
|
-
return cx$1(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
20951
|
-
};
|
|
20952
21019
|
let ButtonSize = /* @__PURE__ */ (function(ButtonSize$1) {
|
|
20953
21020
|
ButtonSize$1["SM"] = "sm";
|
|
20954
21021
|
ButtonSize$1["MD"] = "md";
|
|
@@ -20960,28 +21027,17 @@ let ButtonSize = /* @__PURE__ */ (function(ButtonSize$1) {
|
|
|
20960
21027
|
ButtonSize$1["ICON_XL"] = "icon-xl";
|
|
20961
21028
|
return ButtonSize$1;
|
|
20962
21029
|
})({});
|
|
20963
|
-
|
|
20964
|
-
|
|
20965
|
-
|
|
20966
|
-
|
|
20967
|
-
|
|
20968
|
-
|
|
20969
|
-
|
|
20970
|
-
|
|
20971
|
-
|
|
20972
|
-
|
|
20973
|
-
|
|
20974
|
-
[`${ButtonSize.XL}`]: "-translate-y-1/2 absolute top-1/2 size-6",
|
|
20975
|
-
[`${ButtonSize.ICON_SM}`]: "size-3",
|
|
20976
|
-
[`${ButtonSize.ICON_MD}`]: "size-4",
|
|
20977
|
-
[`${ButtonSize.ICON_LG}`]: "size-5",
|
|
20978
|
-
[`${ButtonSize.ICON_XL}`]: "size-6"
|
|
20979
|
-
},
|
|
20980
|
-
position: {
|
|
20981
|
-
[`${ButtonIconPosition.LEFT}`]: "left-3",
|
|
20982
|
-
[`${ButtonIconPosition.RIGHT}`]: "right-3"
|
|
20983
|
-
}
|
|
20984
|
-
},
|
|
21030
|
+
const buttonIconVariants = cva("flex-none shrink-0", {
|
|
21031
|
+
variants: { size: {
|
|
21032
|
+
[`${ButtonSize.SM}`]: "size-3",
|
|
21033
|
+
[`${ButtonSize.MD}`]: "size-4",
|
|
21034
|
+
[`${ButtonSize.LG}`]: "size-5",
|
|
21035
|
+
[`${ButtonSize.XL}`]: "size-6",
|
|
21036
|
+
[`${ButtonSize.ICON_SM}`]: "size-3",
|
|
21037
|
+
[`${ButtonSize.ICON_MD}`]: "size-4",
|
|
21038
|
+
[`${ButtonSize.ICON_LG}`]: "size-4",
|
|
21039
|
+
[`${ButtonSize.ICON_XL}`]: "size-5"
|
|
21040
|
+
} },
|
|
20985
21041
|
defaultVariants: { size: ButtonSize.MD }
|
|
20986
21042
|
});
|
|
20987
21043
|
let ButtonVariant = /* @__PURE__ */ (function(ButtonVariant$1) {
|
|
@@ -21017,7 +21073,7 @@ let ButtonTextAlign = /* @__PURE__ */ (function(ButtonTextAlign$1) {
|
|
|
21017
21073
|
ButtonTextAlign$1["RIGHT"] = "right";
|
|
21018
21074
|
return ButtonTextAlign$1;
|
|
21019
21075
|
})({});
|
|
21020
|
-
const buttonVariants = cva("relative cursor-pointer
|
|
21076
|
+
const buttonVariants = cva("relative inline-flex cursor-pointer items-center justify-center font-medium ring-0 transition-all duration-300 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50", {
|
|
21021
21077
|
variants: {
|
|
21022
21078
|
size: {
|
|
21023
21079
|
[`${ButtonSize.SM}`]: "min-h-7 px-3 text-xs max-md:py-1",
|
|
@@ -21030,68 +21086,88 @@ const buttonVariants = cva("relative cursor-pointer truncate whitespace-nowrap f
|
|
|
21030
21086
|
[`${ButtonSize.ICON_XL}`]: "p-3"
|
|
21031
21087
|
},
|
|
21032
21088
|
color: {
|
|
21033
|
-
[`${ButtonColor.PRIMARY}`]: "
|
|
21034
|
-
[`${ButtonColor.SECONDARY}`]: "
|
|
21035
|
-
[`${ButtonColor.DESTRUCTIVE}`]: "
|
|
21036
|
-
[`${ButtonColor.NEUTRAL}`]: "
|
|
21037
|
-
[`${ButtonColor.CARD}`]: "
|
|
21038
|
-
[`${ButtonColor.LIGHT}`]: "
|
|
21039
|
-
[`${ButtonColor.DARK}`]: "
|
|
21040
|
-
[`${ButtonColor.TEXT}`]: "
|
|
21041
|
-
[`${ButtonColor.CURRENT}`]: "
|
|
21042
|
-
[`${ButtonColor.TEXT_INVERSE}`]: "
|
|
21043
|
-
[`${ButtonColor.ERROR}`]: "
|
|
21044
|
-
[`${ButtonColor.SUCCESS}`]: "
|
|
21045
|
-
[`${ButtonColor.CUSTOM}`]: "
|
|
21089
|
+
[`${ButtonColor.PRIMARY}`]: "hover-primary-500/20 text-primary ring-primary-500/20 *:text-text-light",
|
|
21090
|
+
[`${ButtonColor.SECONDARY}`]: "hover-secondary-500/20 text-secondary ring-secondary-500/20 *:text-text-light",
|
|
21091
|
+
[`${ButtonColor.DESTRUCTIVE}`]: "hover-destructive-500/20 text-destructive ring-destructive-500/20 *:text-text-light",
|
|
21092
|
+
[`${ButtonColor.NEUTRAL}`]: "hover-neutral-500/20 text-neutral ring-neutral-500/20 *:text-text-light",
|
|
21093
|
+
[`${ButtonColor.CARD}`]: "hover-card-500/20 text-card ring-card-500/20 *:text-text-light",
|
|
21094
|
+
[`${ButtonColor.LIGHT}`]: "hover-white-500/20 text-white ring-white/20 *:text-text-light",
|
|
21095
|
+
[`${ButtonColor.DARK}`]: "hover-neutral-500/20 text-neutral-800 ring-neutral-800/50 *:text-text-light",
|
|
21096
|
+
[`${ButtonColor.TEXT}`]: "hover-neutral-500/20 text-text ring-neutral-500/20 *:text-text-opposite",
|
|
21097
|
+
[`${ButtonColor.CURRENT}`]: "hover-current-500/20 text-current ring-current/20 *:text-text-light",
|
|
21098
|
+
[`${ButtonColor.TEXT_INVERSE}`]: "hover-neutral-500/20 text-text-opposite ring-neutral-500/20 *:text-text",
|
|
21099
|
+
[`${ButtonColor.ERROR}`]: "hover-error-500/20 text-error ring-error/20 *:text-text-light",
|
|
21100
|
+
[`${ButtonColor.SUCCESS}`]: "hover-success-500/20 text-success ring-success/20 *:text-text-light",
|
|
21101
|
+
[`${ButtonColor.CUSTOM}`]: ""
|
|
21102
|
+
},
|
|
21103
|
+
roundedSize: {
|
|
21104
|
+
[`${ContainerRoundedSize.NONE}`]: "rounded-none",
|
|
21105
|
+
[`${ContainerRoundedSize.SM}`]: "rounded-lg [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-xl",
|
|
21106
|
+
[`${ContainerRoundedSize.MD}`]: "rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl",
|
|
21107
|
+
[`${ContainerRoundedSize.LG}`]: "rounded-2xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-3xl",
|
|
21108
|
+
[`${ContainerRoundedSize.XL}`]: "rounded-3xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-4xl"
|
|
21046
21109
|
},
|
|
21047
21110
|
variant: {
|
|
21048
|
-
[`${ButtonVariant.DEFAULT}`]:
|
|
21111
|
+
[`${ButtonVariant.DEFAULT}`]: [
|
|
21112
|
+
"bg-current",
|
|
21113
|
+
"hover:bg-current/90",
|
|
21114
|
+
"hover:ring-6",
|
|
21115
|
+
"aria-selected:ring-6"
|
|
21116
|
+
],
|
|
21117
|
+
[`${ButtonVariant.OUTLINE}`]: [
|
|
21118
|
+
"rounded-2xl border-[1.5px] border-current bg-current/0 *:text-current!",
|
|
21119
|
+
"hover:bg-current/10",
|
|
21120
|
+
"hover:ring-6",
|
|
21121
|
+
"aria-selected:ring-6"
|
|
21122
|
+
],
|
|
21049
21123
|
[`${ButtonVariant.NONE}`]: "border-none bg-current/0 text-inherit hover:bg-current/0",
|
|
21050
|
-
[`${ButtonVariant.
|
|
21051
|
-
[`${ButtonVariant.
|
|
21052
|
-
[`${ButtonVariant.
|
|
21053
|
-
[`${ButtonVariant.
|
|
21054
|
-
[`${ButtonVariant.FADE}`]: "*:!text-current rounded-lg border-none bg-current/10 transition hover:bg-current/20 aria-[current]:bg-current/5",
|
|
21124
|
+
[`${ButtonVariant.LINK}`]: "h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 *:text-current! hover:bg-transparent hover:underline",
|
|
21125
|
+
[`${ButtonVariant.INVISIBLE_LINK}`]: "h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 *:text-current! hover:bg-transparent",
|
|
21126
|
+
[`${ButtonVariant.HOVERABLE}`]: "rounded-lg border-none bg-current/0 transition *:text-current! hover:bg-current/10 aria-[current]:bg-current/5",
|
|
21127
|
+
[`${ButtonVariant.FADE}`]: "rounded-lg border-none bg-current/10 transition *:text-current! hover:bg-current/20 aria-[current]:bg-current/5",
|
|
21055
21128
|
[`${ButtonVariant.INPUT}`]: [
|
|
21056
|
-
"
|
|
21057
|
-
"
|
|
21058
|
-
"
|
|
21059
|
-
"
|
|
21129
|
+
"text-text",
|
|
21130
|
+
"w-full select-text resize-none rounded-2xl text-base shadow-none outline-none supports-[corner-shape:squircle]:rounded-4xl",
|
|
21131
|
+
"transition-shadow duration-100 md:text-sm",
|
|
21132
|
+
"ring-0",
|
|
21133
|
+
"disabled:opacity-50",
|
|
21134
|
+
"text-text",
|
|
21135
|
+
"bg-neutral-50 dark:bg-neutral-950",
|
|
21136
|
+
"hover:bg-neutral-100/90 dark:hover:bg-neutral-900/90",
|
|
21137
|
+
"ring-neutral-100 dark:ring-neutral-700",
|
|
21138
|
+
"hover:ring-3",
|
|
21139
|
+
"aria-selected:ring-4",
|
|
21140
|
+
"focus-visible:ring-2",
|
|
21141
|
+
"disabled:ring-0",
|
|
21142
|
+
"focus-visible:outline-none",
|
|
21143
|
+
"[box-shadow:none] focus:[box-shadow:none]",
|
|
21144
|
+
"aria-invalid:border-error"
|
|
21060
21145
|
]
|
|
21061
21146
|
},
|
|
21062
21147
|
textAlign: {
|
|
21063
|
-
[`${ButtonTextAlign.LEFT}`]: "text-left",
|
|
21064
|
-
[`${ButtonTextAlign.CENTER}`]: "text-center",
|
|
21065
|
-
[`${ButtonTextAlign.RIGHT}`]: "text-right"
|
|
21148
|
+
[`${ButtonTextAlign.LEFT}`]: "justify-start text-left",
|
|
21149
|
+
[`${ButtonTextAlign.CENTER}`]: "justify-center text-center",
|
|
21150
|
+
[`${ButtonTextAlign.RIGHT}`]: "justify-end text-right"
|
|
21066
21151
|
},
|
|
21067
21152
|
isFullWidth: {
|
|
21068
21153
|
true: "w-full",
|
|
21069
21154
|
false: ""
|
|
21070
|
-
},
|
|
21071
|
-
hasIconLeft: {
|
|
21072
|
-
true: "px-12",
|
|
21073
|
-
false: ""
|
|
21074
|
-
},
|
|
21075
|
-
hasIconRight: {
|
|
21076
|
-
true: "pr-8",
|
|
21077
|
-
false: ""
|
|
21078
21155
|
}
|
|
21079
21156
|
},
|
|
21080
21157
|
defaultVariants: {
|
|
21081
|
-
variant: ButtonVariant.DEFAULT
|
|
21082
|
-
size: ButtonSize.MD
|
|
21083
|
-
color: ButtonColor.CUSTOM
|
|
21084
|
-
|
|
21085
|
-
|
|
21086
|
-
|
|
21087
|
-
hasIconLeft: false
|
|
21158
|
+
variant: `${ButtonVariant.DEFAULT}`,
|
|
21159
|
+
size: `${ButtonSize.MD}`,
|
|
21160
|
+
color: `${ButtonColor.CUSTOM}`,
|
|
21161
|
+
roundedSize: `${ContainerRoundedSize.MD}`,
|
|
21162
|
+
textAlign: `${ButtonTextAlign.CENTER}`,
|
|
21163
|
+
isFullWidth: false
|
|
21088
21164
|
}
|
|
21089
21165
|
});
|
|
21090
|
-
const Button = ({ variant, size: size2, color: color2, children, Icon: Icon2, IconRight, iconClassName, isLoading = false, isActive = false, isSelected = false, isFullWidth = false, textAlign, disabled, label, className, type = "button", "aria-describedby": ariaDescribedBy, "aria-expanded": ariaExpanded, "aria-haspopup": ariaHasPopup, "aria-pressed": ariaPressed, ...props }) => {
|
|
21091
|
-
const isLink = variant === ButtonVariant.LINK || variant === ButtonVariant.INVISIBLE_LINK
|
|
21166
|
+
const Button = ({ variant, size: size2, color: color2, children, Icon: Icon2, IconRight, iconClassName, isLoading = false, isActive = false, isSelected = false, isFullWidth = false, roundedSize, textAlign, disabled, label, className, type = "button", "aria-describedby": ariaDescribedBy, "aria-expanded": ariaExpanded, "aria-haspopup": ariaHasPopup, "aria-pressed": ariaPressed, ...props }) => {
|
|
21167
|
+
const isLink = variant === `${ButtonVariant.LINK}` || variant === `${ButtonVariant.INVISIBLE_LINK}`;
|
|
21092
21168
|
const isIconOnly = !children && (Icon2 || IconRight);
|
|
21093
21169
|
const accessibilityProps = {
|
|
21094
|
-
"aria-label": isIconOnly ? label : void 0,
|
|
21170
|
+
"aria-label": isIconOnly ? label ?? void 0 : void 0,
|
|
21095
21171
|
"aria-labelledby": !isIconOnly ? void 0 : void 0,
|
|
21096
21172
|
"aria-describedby": ariaDescribedBy,
|
|
21097
21173
|
"aria-expanded": ariaExpanded,
|
|
@@ -21102,6 +21178,7 @@ const Button = ({ variant, size: size2, color: color2, children, Icon: Icon2, Ic
|
|
|
21102
21178
|
"aria-disabled": disabled || isLoading,
|
|
21103
21179
|
"aria-selected": isSelected
|
|
21104
21180
|
};
|
|
21181
|
+
const isSquareButton = size2 === ButtonSize.ICON_SM || size2 === ButtonSize.ICON_MD || size2 === ButtonSize.ICON_LG || size2 === ButtonSize.ICON_XL;
|
|
21105
21182
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("button", {
|
|
21106
21183
|
disabled: isLoading || disabled,
|
|
21107
21184
|
role: isLink ? "link" : "button",
|
|
@@ -21111,9 +21188,8 @@ const Button = ({ variant, size: size2, color: color2, children, Icon: Icon2, Ic
|
|
|
21111
21188
|
size: size2,
|
|
21112
21189
|
color: color2,
|
|
21113
21190
|
isFullWidth,
|
|
21191
|
+
roundedSize,
|
|
21114
21192
|
textAlign: textAlign ?? (IconRight ? ButtonTextAlign.LEFT : ButtonTextAlign.CENTER),
|
|
21115
|
-
hasIconLeft: Boolean(typeof children !== "undefined" && (typeof Icon2 !== "undefined" || isLoading)),
|
|
21116
|
-
hasIconRight: Boolean(typeof children !== "undefined" && typeof IconRight !== "undefined"),
|
|
21117
21193
|
className
|
|
21118
21194
|
}),
|
|
21119
21195
|
...accessibilityProps,
|
|
@@ -21122,22 +21198,26 @@ const Button = ({ variant, size: size2, color: color2, children, Icon: Icon2, Ic
|
|
|
21122
21198
|
Icon2 && !isLoading && /* @__PURE__ */ jsxRuntimeExports.jsx(Icon2, {
|
|
21123
21199
|
className: buttonIconVariants({
|
|
21124
21200
|
size: size2,
|
|
21125
|
-
className: iconClassName
|
|
21126
|
-
position: ButtonIconPosition.LEFT
|
|
21201
|
+
className: cn$2(!isSquareButton && "mr-3", iconClassName)
|
|
21127
21202
|
}),
|
|
21128
21203
|
"aria-hidden": "true"
|
|
21129
21204
|
}),
|
|
21130
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
21131
|
-
className:
|
|
21132
|
-
|
|
21133
|
-
className:
|
|
21134
|
-
|
|
21135
|
-
|
|
21136
|
-
|
|
21137
|
-
|
|
21138
|
-
|
|
21205
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
21206
|
+
className: cn$2("flex w-0 items-center justify-center transition-[width] duration-300", isLoading && size2 === ButtonSize.SM && "w-3", isLoading && size2 === ButtonSize.MD && "w-4", isLoading && size2 === ButtonSize.LG && "w-5", isLoading && size2 === ButtonSize.XL && "w-6"),
|
|
21207
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Loader, {
|
|
21208
|
+
className: buttonIconVariants({
|
|
21209
|
+
size: size2,
|
|
21210
|
+
className: cn$2(!isSquareButton && "mr-3", iconClassName)
|
|
21211
|
+
}),
|
|
21212
|
+
isLoading,
|
|
21213
|
+
"aria-hidden": "true",
|
|
21214
|
+
"data-testid": "loader"
|
|
21215
|
+
})
|
|
21216
|
+
}),
|
|
21217
|
+
children && /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
21218
|
+
className: "flex-1 truncate whitespace-nowrap",
|
|
21219
|
+
children
|
|
21139
21220
|
}),
|
|
21140
|
-
children && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children }),
|
|
21141
21221
|
!children && isIconOnly && /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
21142
21222
|
className: "sr-only",
|
|
21143
21223
|
children: label
|
|
@@ -21145,8 +21225,7 @@ const Button = ({ variant, size: size2, color: color2, children, Icon: Icon2, Ic
|
|
|
21145
21225
|
IconRight && /* @__PURE__ */ jsxRuntimeExports.jsx(IconRight, {
|
|
21146
21226
|
className: buttonIconVariants({
|
|
21147
21227
|
size: size2,
|
|
21148
|
-
className: iconClassName
|
|
21149
|
-
position: ButtonIconPosition.RIGHT
|
|
21228
|
+
className: cn$2(!isSquareButton && "ml-3", iconClassName)
|
|
21150
21229
|
}),
|
|
21151
21230
|
"aria-hidden": "true"
|
|
21152
21231
|
})
|
|
@@ -21157,11 +21236,11 @@ const MaxHeightSmoother = ({ children, isHidden: isHidden2, className = "", isOv
|
|
|
21157
21236
|
"aria-hidden": isFocusable ? isHidden2 : void 0,
|
|
21158
21237
|
tabIndex: isFocusable ? 0 : void 0,
|
|
21159
21238
|
role: isFocusable ? "button" : "none",
|
|
21160
|
-
className: cn$
|
|
21239
|
+
className: cn$2("group/height-smoother relative grid w-full grid-rows-[0fr] overflow-hidden transition-all duration-700 ease-in-out", typeof isHidden2 !== "undefined" && !isHidden2 && "grid-rows-[1fr] overflow-x-auto", isOverable && "hover:grid-rows-[1fr] hover:overflow-x-auto", isFocusable && "focus-within:grid-rows-[1fr] focus-within:overflow-x-auto focus:grid-rows-[1fr] focus:overflow-x-auto", className),
|
|
21161
21240
|
...props,
|
|
21162
21241
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
21163
21242
|
style: { minHeight: `${minHeight}px` },
|
|
21164
|
-
className: cn$
|
|
21243
|
+
className: cn$2(isOverable && "group-hover/height-smoother:visible", isFocusable && "group-focus/height-smoother:visible", className),
|
|
21165
21244
|
children
|
|
21166
21245
|
})
|
|
21167
21246
|
});
|
|
@@ -21240,56 +21319,56 @@ const createLucideIcon = (iconName, iconNode) => {
|
|
|
21240
21319
|
Component.displayName = toPascalCase(iconName);
|
|
21241
21320
|
return Component;
|
|
21242
21321
|
};
|
|
21243
|
-
const __iconNode$
|
|
21322
|
+
const __iconNode$q = [
|
|
21244
21323
|
["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
|
|
21245
21324
|
["path", { d: "M19 12H5", key: "x3x0zl" }]
|
|
21246
21325
|
];
|
|
21247
|
-
const ArrowLeft = createLucideIcon("arrow-left", __iconNode$
|
|
21248
|
-
const __iconNode$
|
|
21326
|
+
const ArrowLeft = createLucideIcon("arrow-left", __iconNode$q);
|
|
21327
|
+
const __iconNode$p = [
|
|
21249
21328
|
["path", { d: "m18 9-6-6-6 6", key: "kcunyi" }],
|
|
21250
21329
|
["path", { d: "M12 3v14", key: "7cf3v8" }],
|
|
21251
21330
|
["path", { d: "M5 21h14", key: "11awu3" }]
|
|
21252
21331
|
];
|
|
21253
|
-
const ArrowUpFromLine = createLucideIcon("arrow-up-from-line", __iconNode$
|
|
21254
|
-
const __iconNode$
|
|
21255
|
-
const Check = createLucideIcon("check", __iconNode$
|
|
21256
|
-
const __iconNode$
|
|
21257
|
-
const ChevronDown = createLucideIcon("chevron-down", __iconNode$
|
|
21258
|
-
const __iconNode$
|
|
21259
|
-
const ChevronLeft = createLucideIcon("chevron-left", __iconNode$
|
|
21260
|
-
const __iconNode$
|
|
21261
|
-
const ChevronRight = createLucideIcon("chevron-right", __iconNode$
|
|
21262
|
-
const __iconNode$
|
|
21263
|
-
const ChevronUp = createLucideIcon("chevron-up", __iconNode$
|
|
21264
|
-
const __iconNode$
|
|
21332
|
+
const ArrowUpFromLine = createLucideIcon("arrow-up-from-line", __iconNode$p);
|
|
21333
|
+
const __iconNode$o = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
21334
|
+
const Check = createLucideIcon("check", __iconNode$o);
|
|
21335
|
+
const __iconNode$n = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
21336
|
+
const ChevronDown = createLucideIcon("chevron-down", __iconNode$n);
|
|
21337
|
+
const __iconNode$m = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
|
|
21338
|
+
const ChevronLeft = createLucideIcon("chevron-left", __iconNode$m);
|
|
21339
|
+
const __iconNode$l = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
|
|
21340
|
+
const ChevronRight = createLucideIcon("chevron-right", __iconNode$l);
|
|
21341
|
+
const __iconNode$k = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
|
|
21342
|
+
const ChevronUp = createLucideIcon("chevron-up", __iconNode$k);
|
|
21343
|
+
const __iconNode$j = [
|
|
21265
21344
|
["path", { d: "m7 15 5 5 5-5", key: "1hf1tw" }],
|
|
21266
21345
|
["path", { d: "m7 9 5-5 5 5", key: "sgt6xg" }]
|
|
21267
21346
|
];
|
|
21268
|
-
const ChevronsUpDown = createLucideIcon("chevrons-up-down", __iconNode$
|
|
21269
|
-
const __iconNode$
|
|
21347
|
+
const ChevronsUpDown = createLucideIcon("chevrons-up-down", __iconNode$j);
|
|
21348
|
+
const __iconNode$i = [
|
|
21270
21349
|
["path", { d: "m12 15 2 2 4-4", key: "2c609p" }],
|
|
21271
21350
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
21272
21351
|
["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
|
|
21273
21352
|
];
|
|
21274
|
-
const CopyCheck = createLucideIcon("copy-check", __iconNode$
|
|
21275
|
-
const __iconNode$
|
|
21353
|
+
const CopyCheck = createLucideIcon("copy-check", __iconNode$i);
|
|
21354
|
+
const __iconNode$h = [
|
|
21276
21355
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
21277
21356
|
["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
|
|
21278
21357
|
];
|
|
21279
|
-
const Copy = createLucideIcon("copy", __iconNode$
|
|
21280
|
-
const __iconNode$
|
|
21358
|
+
const Copy = createLucideIcon("copy", __iconNode$h);
|
|
21359
|
+
const __iconNode$g = [
|
|
21281
21360
|
["path", { d: "M12 15V3", key: "m9g1x1" }],
|
|
21282
21361
|
["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
|
|
21283
21362
|
["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
|
|
21284
21363
|
];
|
|
21285
|
-
const Download = createLucideIcon("download", __iconNode$
|
|
21286
|
-
const __iconNode$
|
|
21364
|
+
const Download = createLucideIcon("download", __iconNode$g);
|
|
21365
|
+
const __iconNode$f = [
|
|
21287
21366
|
["path", { d: "M15 3h6v6", key: "1q9fwt" }],
|
|
21288
21367
|
["path", { d: "M10 14 21 3", key: "gplh6r" }],
|
|
21289
21368
|
["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
|
|
21290
21369
|
];
|
|
21291
|
-
const ExternalLink = createLucideIcon("external-link", __iconNode$
|
|
21292
|
-
const __iconNode$
|
|
21370
|
+
const ExternalLink = createLucideIcon("external-link", __iconNode$f);
|
|
21371
|
+
const __iconNode$e = [
|
|
21293
21372
|
[
|
|
21294
21373
|
"path",
|
|
21295
21374
|
{
|
|
@@ -21307,8 +21386,8 @@ const __iconNode$d = [
|
|
|
21307
21386
|
],
|
|
21308
21387
|
["path", { d: "m2 2 20 20", key: "1ooewy" }]
|
|
21309
21388
|
];
|
|
21310
|
-
const EyeOff = createLucideIcon("eye-off", __iconNode$
|
|
21311
|
-
const __iconNode$
|
|
21389
|
+
const EyeOff = createLucideIcon("eye-off", __iconNode$e);
|
|
21390
|
+
const __iconNode$d = [
|
|
21312
21391
|
[
|
|
21313
21392
|
"path",
|
|
21314
21393
|
{
|
|
@@ -21318,13 +21397,15 @@ const __iconNode$c = [
|
|
|
21318
21397
|
],
|
|
21319
21398
|
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
21320
21399
|
];
|
|
21321
|
-
const Eye = createLucideIcon("eye", __iconNode$
|
|
21322
|
-
const __iconNode$
|
|
21400
|
+
const Eye = createLucideIcon("eye", __iconNode$d);
|
|
21401
|
+
const __iconNode$c = [
|
|
21323
21402
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
21324
21403
|
["path", { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20", key: "13o1zl" }],
|
|
21325
21404
|
["path", { d: "M2 12h20", key: "9i4pu4" }]
|
|
21326
21405
|
];
|
|
21327
|
-
const Globe = createLucideIcon("globe", __iconNode$
|
|
21406
|
+
const Globe = createLucideIcon("globe", __iconNode$c);
|
|
21407
|
+
const __iconNode$b = [["path", { d: "M5 12h14", key: "1ays0h" }]];
|
|
21408
|
+
const Minus = createLucideIcon("minus", __iconNode$b);
|
|
21328
21409
|
const __iconNode$a = [
|
|
21329
21410
|
["path", { d: "M11 19H5v-6", key: "8awifj" }],
|
|
21330
21411
|
["path", { d: "M13 5h6v6", key: "7voy1q" }],
|
|
@@ -21437,9 +21518,9 @@ const Accordion = ({ children, header, isOpen, defaultIsOpen = false, onToggle,
|
|
|
21437
21518
|
onKeyDown: handleKeyDown,
|
|
21438
21519
|
disabled,
|
|
21439
21520
|
isFullWidth: true,
|
|
21440
|
-
className: cn$
|
|
21521
|
+
className: cn$2("flex items-center justify-between gap-2", headerClassName),
|
|
21441
21522
|
IconRight: ChevronDown,
|
|
21442
|
-
iconClassName: cn$
|
|
21523
|
+
iconClassName: cn$2("transform transition-transform duration-500 ease-in-out", isExpandedState ? "rotate-0" : "-rotate-180"),
|
|
21443
21524
|
"aria-expanded": isExpandedState,
|
|
21444
21525
|
"aria-controls": generatedContentId,
|
|
21445
21526
|
"aria-label": ariaLabel,
|
|
@@ -21528,7 +21609,7 @@ const Badge = ({ className, variant = BadgeVariant.DEFAULT, color: color2 = Badg
|
|
|
21528
21609
|
onDismiss?.();
|
|
21529
21610
|
};
|
|
21530
21611
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Component, {
|
|
21531
|
-
className: cn$
|
|
21612
|
+
className: cn$2(badgeVariants({
|
|
21532
21613
|
variant,
|
|
21533
21614
|
color: color2,
|
|
21534
21615
|
size: size2
|
|
@@ -21637,7 +21718,7 @@ const Link = (props) => {
|
|
|
21637
21718
|
rel,
|
|
21638
21719
|
target,
|
|
21639
21720
|
"aria-current": isActive ? "page" : void 0,
|
|
21640
|
-
className: cn$
|
|
21721
|
+
className: cn$2(linkVariants({
|
|
21641
21722
|
variant,
|
|
21642
21723
|
color: color2,
|
|
21643
21724
|
underlined,
|
|
@@ -21712,7 +21793,7 @@ const ButtonLink = ({ children: text, onClick, color: color2, position, classNam
|
|
|
21712
21793
|
};
|
|
21713
21794
|
const Span = ({ children, position, className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
|
|
21714
21795
|
itemProp: "item",
|
|
21715
|
-
className: cn$
|
|
21796
|
+
className: cn$2("inline-flex items-center", "font-medium text-neutral-700", "transition-colors duration-200", className),
|
|
21716
21797
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
21717
21798
|
itemProp: "name",
|
|
21718
21799
|
...props,
|
|
@@ -21731,7 +21812,7 @@ const Breadcrumb = ({ links, className, color: color2 = LinkColor.TEXT, locale,
|
|
|
21731
21812
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("nav", {
|
|
21732
21813
|
"aria-label": ariaLabel,
|
|
21733
21814
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("ol", {
|
|
21734
|
-
className: cn$
|
|
21815
|
+
className: cn$2(breadcrumbVariants({
|
|
21735
21816
|
size: size2,
|
|
21736
21817
|
spacing
|
|
21737
21818
|
}), className),
|
|
@@ -21763,7 +21844,7 @@ const Breadcrumb = ({ links, className, color: color2 = LinkColor.TEXT, locale,
|
|
|
21763
21844
|
let section = /* @__PURE__ */ jsxRuntimeExports.jsx(Span, {
|
|
21764
21845
|
position: index2 + 1,
|
|
21765
21846
|
"aria-current": ariaCurrent,
|
|
21766
|
-
className: cn$
|
|
21847
|
+
className: cn$2("transition-colors duration-200", isActive && "text-neutral-900"),
|
|
21767
21848
|
children: text
|
|
21768
21849
|
}, text);
|
|
21769
21850
|
if (isLink) section = /* @__PURE__ */ jsxRuntimeExports.jsx(LinkLink, {
|
|
@@ -21772,7 +21853,7 @@ const Breadcrumb = ({ links, className, color: color2 = LinkColor.TEXT, locale,
|
|
|
21772
21853
|
position: index2 + 1,
|
|
21773
21854
|
locale,
|
|
21774
21855
|
"aria-current": ariaCurrent,
|
|
21775
|
-
className: cn$
|
|
21856
|
+
className: cn$2(isActive && "cursor-default text-neutral-900"),
|
|
21776
21857
|
children: text
|
|
21777
21858
|
}, text);
|
|
21778
21859
|
else if (isButton) section = /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonLink, {
|
|
@@ -21780,7 +21861,7 @@ const Breadcrumb = ({ links, className, color: color2 = LinkColor.TEXT, locale,
|
|
|
21780
21861
|
color: color2,
|
|
21781
21862
|
position: index2 + 1,
|
|
21782
21863
|
"aria-current": ariaCurrent,
|
|
21783
|
-
className: cn$
|
|
21864
|
+
className: cn$2(isActive && "cursor-default text-neutral-900"),
|
|
21784
21865
|
children: text
|
|
21785
21866
|
}, text);
|
|
21786
21867
|
const listElement = /* @__PURE__ */ reactExports.createElement("li", {
|
|
@@ -24066,19 +24147,19 @@ function B({ asChild: r2, children: o2 }, n2) {
|
|
|
24066
24147
|
}
|
|
24067
24148
|
var Te = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
|
|
24068
24149
|
const CommandRoot = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(_e, {
|
|
24069
|
-
className: cn$
|
|
24150
|
+
className: cn$2("flex size-full flex-col overflow-hidden rounded-md", className),
|
|
24070
24151
|
...props
|
|
24071
24152
|
});
|
|
24072
24153
|
const CommandInput = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
24073
24154
|
className: "flex w-full items-center",
|
|
24074
24155
|
"cmdk-input-wrapper": "",
|
|
24075
24156
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Search, { className: "mr-2 size-4 shrink-0 opacity-50" }), /* @__PURE__ */ jsxRuntimeExports.jsx(_e.Input, {
|
|
24076
|
-
className: cn$
|
|
24157
|
+
className: cn$2("flex w-full rounded-md bg-transparent text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50", className),
|
|
24077
24158
|
...props
|
|
24078
24159
|
})]
|
|
24079
24160
|
});
|
|
24080
24161
|
const CommandList = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(_e.List, {
|
|
24081
|
-
className: cn$
|
|
24162
|
+
className: cn$2("max-h-[300px] overflow-y-auto overflow-x-hidden", className),
|
|
24082
24163
|
...props
|
|
24083
24164
|
});
|
|
24084
24165
|
const CommandEmpty = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(_e.Empty, {
|
|
@@ -24086,7 +24167,7 @@ const CommandEmpty = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(_e.Empty,
|
|
|
24086
24167
|
...props
|
|
24087
24168
|
});
|
|
24088
24169
|
const CommandItem = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(_e.Item, {
|
|
24089
|
-
className: cn$
|
|
24170
|
+
className: cn$2("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50", className),
|
|
24090
24171
|
...props
|
|
24091
24172
|
});
|
|
24092
24173
|
const Command = {
|
|
@@ -24096,91 +24177,6 @@ const Command = {
|
|
|
24096
24177
|
Empty: CommandEmpty,
|
|
24097
24178
|
Item: CommandItem
|
|
24098
24179
|
};
|
|
24099
|
-
const containerVariants$1 = cva("flex flex-col text-text backdrop-blur", {
|
|
24100
|
-
variants: {
|
|
24101
|
-
roundedSize: {
|
|
24102
|
-
none: "rounded-none",
|
|
24103
|
-
sm: "rounded-sm",
|
|
24104
|
-
md: "rounded-md",
|
|
24105
|
-
lg: "rounded-lg",
|
|
24106
|
-
xl: "rounded-xl",
|
|
24107
|
-
"2xl": "rounded-2xl",
|
|
24108
|
-
"3xl": "rounded-3xl",
|
|
24109
|
-
full: "rounded-full"
|
|
24110
|
-
},
|
|
24111
|
-
transparency: {
|
|
24112
|
-
none: "bg-card",
|
|
24113
|
-
sm: "bg-card/95",
|
|
24114
|
-
md: "bg-card/70",
|
|
24115
|
-
lg: "bg-card/40",
|
|
24116
|
-
xl: "bg-card/20",
|
|
24117
|
-
full: ""
|
|
24118
|
-
},
|
|
24119
|
-
padding: {
|
|
24120
|
-
none: "p-0",
|
|
24121
|
-
sm: "p-1",
|
|
24122
|
-
md: "p-2",
|
|
24123
|
-
lg: "p-3",
|
|
24124
|
-
xl: "p-4"
|
|
24125
|
-
},
|
|
24126
|
-
separator: {
|
|
24127
|
-
without: "",
|
|
24128
|
-
x: "divide-x divide-dashed divide-text/20",
|
|
24129
|
-
y: "divide-y divide-dashed divide-text/20",
|
|
24130
|
-
both: "divide-x divide-y divide-dashed divide-text/20"
|
|
24131
|
-
},
|
|
24132
|
-
border: {
|
|
24133
|
-
none: "",
|
|
24134
|
-
with: "border-[1.5px]"
|
|
24135
|
-
},
|
|
24136
|
-
borderColor: {
|
|
24137
|
-
primary: "border-primary",
|
|
24138
|
-
secondary: "border-secondary",
|
|
24139
|
-
neutral: "border-neutral",
|
|
24140
|
-
text: "border-text",
|
|
24141
|
-
error: "border-error",
|
|
24142
|
-
warning: "border-warning",
|
|
24143
|
-
success: "border-success"
|
|
24144
|
-
},
|
|
24145
|
-
background: {
|
|
24146
|
-
none: "bg-inherit",
|
|
24147
|
-
hoverable: "!bg-opacity-5 hover:!bg-opacity-10 focus:!bg-opacity-10 aria-selected:!bg-opacity-15 backdrop-blur-0 hover:backdrop-blur focus:backdrop-blur aria-selected:backdrop-blur",
|
|
24148
|
-
with: ""
|
|
24149
|
-
},
|
|
24150
|
-
gap: {
|
|
24151
|
-
none: "gap-0",
|
|
24152
|
-
sm: "gap-1",
|
|
24153
|
-
md: "gap-3",
|
|
24154
|
-
lg: "gap-5",
|
|
24155
|
-
xl: "gap-8",
|
|
24156
|
-
"2xl": "gap-10"
|
|
24157
|
-
}
|
|
24158
|
-
},
|
|
24159
|
-
defaultVariants: {
|
|
24160
|
-
roundedSize: "md",
|
|
24161
|
-
border: "none",
|
|
24162
|
-
borderColor: "text",
|
|
24163
|
-
transparency: "md",
|
|
24164
|
-
padding: "none",
|
|
24165
|
-
separator: "without",
|
|
24166
|
-
gap: "none"
|
|
24167
|
-
}
|
|
24168
|
-
});
|
|
24169
|
-
const Container = ({ children, roundedSize, padding, transparency, separator, className, border, borderColor, background, gap, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
24170
|
-
className: cn$1(containerVariants$1({
|
|
24171
|
-
roundedSize,
|
|
24172
|
-
transparency,
|
|
24173
|
-
padding,
|
|
24174
|
-
separator,
|
|
24175
|
-
border: typeof border === "boolean" ? border ? "with" : "none" : void 0,
|
|
24176
|
-
background,
|
|
24177
|
-
borderColor,
|
|
24178
|
-
gap,
|
|
24179
|
-
className
|
|
24180
|
-
})),
|
|
24181
|
-
...props,
|
|
24182
|
-
children
|
|
24183
|
-
});
|
|
24184
24180
|
const CopyButton = ({ content: content2, ...props }) => {
|
|
24185
24181
|
const [copied, setCopied] = reactExports.useState(false);
|
|
24186
24182
|
const [error, setError] = reactExports.useState(false);
|
|
@@ -24225,27 +24221,27 @@ const CopyButton = ({ content: content2, ...props }) => {
|
|
|
24225
24221
|
const styledHeading = `relative scroll-mb-8 scroll-mt-[30vh] scroll-p-8`;
|
|
24226
24222
|
const styledAfter = `after:content-['#'] after:scale-75 after:px-6 after:text-neutral after:absolute after:top-0 after:h-full after:-left-12 after:absolute after:to-neutral after:md:opacity-0 after:transition-opacity hover:after:opacity-80 after:duration-200 after:delay-100`;
|
|
24227
24223
|
const StyledH1 = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("h1", {
|
|
24228
|
-
className: cn$
|
|
24224
|
+
className: cn$2("font-bold text-2xl", className),
|
|
24229
24225
|
...props
|
|
24230
24226
|
});
|
|
24231
24227
|
const StyledH2 = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("h2", {
|
|
24232
|
-
className: cn$
|
|
24228
|
+
className: cn$2("mb-2 font-bold text-2xl", styledHeading, className),
|
|
24233
24229
|
...props
|
|
24234
24230
|
});
|
|
24235
24231
|
const StyledH3 = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("h3", {
|
|
24236
|
-
className: cn$
|
|
24232
|
+
className: cn$2("mb-2 font-bold text-xl", styledHeading, className),
|
|
24237
24233
|
...props
|
|
24238
24234
|
});
|
|
24239
24235
|
const StyledH4 = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("h4", {
|
|
24240
|
-
className: cn$
|
|
24236
|
+
className: cn$2("font-bold text-lg", styledHeading, className),
|
|
24241
24237
|
...props
|
|
24242
24238
|
});
|
|
24243
24239
|
const StyledH5 = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("h5", {
|
|
24244
|
-
className: cn$
|
|
24240
|
+
className: cn$2("font-bold text-base", styledHeading, className),
|
|
24245
24241
|
...props
|
|
24246
24242
|
});
|
|
24247
24243
|
const StyledH6 = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("h6", {
|
|
24248
|
-
className: cn$
|
|
24244
|
+
className: cn$2("ml-3 font-bold text-base", styledHeading, className),
|
|
24249
24245
|
...props
|
|
24250
24246
|
});
|
|
24251
24247
|
const getId = (children) => String(children).normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/\s+/g, "-").toLowerCase();
|
|
@@ -24282,7 +24278,7 @@ const HeadingWrapper = ({ H: H7, children, className, isClickable, ...props }) =
|
|
|
24282
24278
|
id: id2,
|
|
24283
24279
|
onClick: isClickable ? onClick : void 0,
|
|
24284
24280
|
"aria-label": isClickable ? `Click to scroll to section ${id2} and copy the link to the clipboard` : void 0,
|
|
24285
|
-
className: cn$
|
|
24281
|
+
className: cn$2(isClickable && styledAfter, className),
|
|
24286
24282
|
...props,
|
|
24287
24283
|
children
|
|
24288
24284
|
});
|
|
@@ -24421,7 +24417,7 @@ function requireWithSelector_production() {
|
|
|
24421
24417
|
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
24422
24418
|
}
|
|
24423
24419
|
var objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore = shim2.useSyncExternalStore, useRef2 = React2.useRef, useEffect = React2.useEffect, useMemo = React2.useMemo, useDebugValue2 = React2.useDebugValue;
|
|
24424
|
-
withSelector_production.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot,
|
|
24420
|
+
withSelector_production.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector2, isEqual) {
|
|
24425
24421
|
var instRef = useRef2(null);
|
|
24426
24422
|
if (null === instRef.current) {
|
|
24427
24423
|
var inst = { hasValue: false, value: null };
|
|
@@ -24433,7 +24429,7 @@ function requireWithSelector_production() {
|
|
|
24433
24429
|
if (!hasMemo) {
|
|
24434
24430
|
hasMemo = true;
|
|
24435
24431
|
memoizedSnapshot = nextSnapshot;
|
|
24436
|
-
nextSnapshot =
|
|
24432
|
+
nextSnapshot = selector2(nextSnapshot);
|
|
24437
24433
|
if (void 0 !== isEqual && inst.hasValue) {
|
|
24438
24434
|
var currentSelection = inst.value;
|
|
24439
24435
|
if (isEqual(currentSelection, nextSnapshot))
|
|
@@ -24443,7 +24439,7 @@ function requireWithSelector_production() {
|
|
|
24443
24439
|
}
|
|
24444
24440
|
currentSelection = memoizedSelection;
|
|
24445
24441
|
if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;
|
|
24446
|
-
var nextSelection =
|
|
24442
|
+
var nextSelection = selector2(nextSnapshot);
|
|
24447
24443
|
if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))
|
|
24448
24444
|
return memoizedSnapshot = nextSnapshot, currentSelection;
|
|
24449
24445
|
memoizedSnapshot = nextSnapshot;
|
|
@@ -24459,7 +24455,7 @@ function requireWithSelector_production() {
|
|
|
24459
24455
|
}
|
|
24460
24456
|
];
|
|
24461
24457
|
},
|
|
24462
|
-
[getSnapshot, getServerSnapshot,
|
|
24458
|
+
[getSnapshot, getServerSnapshot, selector2, isEqual]
|
|
24463
24459
|
);
|
|
24464
24460
|
var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
|
|
24465
24461
|
useEffect(
|
|
@@ -24490,7 +24486,7 @@ const { useDebugValue } = We;
|
|
|
24490
24486
|
const { useSyncExternalStoreWithSelector } = useSyncExternalStoreExports;
|
|
24491
24487
|
let didWarnAboutEqualityFn = false;
|
|
24492
24488
|
const identity = (arg) => arg;
|
|
24493
|
-
function useStore(api,
|
|
24489
|
+
function useStore(api, selector2 = identity, equalityFn) {
|
|
24494
24490
|
if ((__vite_import_meta_env__ ? "production" : void 0) !== "production" && equalityFn && !didWarnAboutEqualityFn) {
|
|
24495
24491
|
console.warn(
|
|
24496
24492
|
"[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"
|
|
@@ -24501,7 +24497,7 @@ function useStore(api, selector = identity, equalityFn) {
|
|
|
24501
24497
|
api.subscribe,
|
|
24502
24498
|
api.getState,
|
|
24503
24499
|
api.getServerState || api.getInitialState,
|
|
24504
|
-
|
|
24500
|
+
selector2,
|
|
24505
24501
|
equalityFn
|
|
24506
24502
|
);
|
|
24507
24503
|
useDebugValue(slice);
|
|
@@ -24514,7 +24510,7 @@ const createImpl = (createState2) => {
|
|
|
24514
24510
|
);
|
|
24515
24511
|
}
|
|
24516
24512
|
const api = typeof createState2 === "function" ? createStore(createState2) : createState2;
|
|
24517
|
-
const useBoundStore = (
|
|
24513
|
+
const useBoundStore = (selector2, equalityFn) => useStore(api, selector2, equalityFn);
|
|
24518
24514
|
Object.assign(useBoundStore, api);
|
|
24519
24515
|
return useBoundStore;
|
|
24520
24516
|
};
|
|
@@ -24590,10 +24586,10 @@ function shallow(objA, objB) {
|
|
|
24590
24586
|
return true;
|
|
24591
24587
|
}
|
|
24592
24588
|
const { useRef } = We;
|
|
24593
|
-
function useShallow(
|
|
24589
|
+
function useShallow(selector2) {
|
|
24594
24590
|
const prev = useRef();
|
|
24595
24591
|
return (state) => {
|
|
24596
|
-
const next =
|
|
24592
|
+
const next = selector2(state);
|
|
24597
24593
|
return shallow(prev.current, next) ? prev.current : prev.current = next;
|
|
24598
24594
|
};
|
|
24599
24595
|
}
|
|
@@ -31787,7 +31783,7 @@ let ModalSize = /* @__PURE__ */ (function(ModalSize$1) {
|
|
|
31787
31783
|
ModalSize$1["UNSET"] = "unset";
|
|
31788
31784
|
return ModalSize$1;
|
|
31789
31785
|
})({});
|
|
31790
|
-
const modalVariants = cva("cursor-default justify-center overflow-auto
|
|
31786
|
+
const modalVariants = cva("cursor-default justify-center overflow-auto p-3 shadow-sm", {
|
|
31791
31787
|
variants: { size: {
|
|
31792
31788
|
sm: "h-auto max-h-[30vh] w-[95vw] max-w-xl",
|
|
31793
31789
|
md: "h-auto max-h-[50vh] w-[95vw] max-w-xl",
|
|
@@ -31804,6 +31800,15 @@ const Modal = ({ children, isOpen, container, disableScroll = true, onClose, has
|
|
|
31804
31800
|
key: "modal",
|
|
31805
31801
|
disableScroll: isOpen && disableScroll
|
|
31806
31802
|
});
|
|
31803
|
+
reactExports.useEffect(() => {
|
|
31804
|
+
const handleEscape = (event) => {
|
|
31805
|
+
if (event.key === "Escape" && isOpen && onClose) onClose();
|
|
31806
|
+
};
|
|
31807
|
+
document.addEventListener("keydown", handleEscape);
|
|
31808
|
+
return () => {
|
|
31809
|
+
document.removeEventListener("keydown", handleEscape);
|
|
31810
|
+
};
|
|
31811
|
+
}, [isOpen, onClose]);
|
|
31807
31812
|
if (!containerElement) return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
|
|
31808
31813
|
const hasTitle = typeof title === "string";
|
|
31809
31814
|
return reactDomExports.createPortal(/* @__PURE__ */ jsxRuntimeExports.jsx(motion.div, {
|
|
@@ -31832,58 +31837,63 @@ const Modal = ({ children, isOpen, container, disableScroll = true, onClose, has
|
|
|
31832
31837
|
onClose?.();
|
|
31833
31838
|
},
|
|
31834
31839
|
"aria-hidden": !isOpen,
|
|
31835
|
-
children: /* @__PURE__ */ jsxRuntimeExports.
|
|
31836
|
-
|
|
31837
|
-
|
|
31838
|
-
|
|
31839
|
-
|
|
31840
|
-
|
|
31841
|
-
|
|
31842
|
-
className
|
|
31843
|
-
|
|
31844
|
-
|
|
31845
|
-
|
|
31846
|
-
|
|
31847
|
-
|
|
31848
|
-
|
|
31849
|
-
|
|
31850
|
-
children: [/* @__PURE__ */ jsxRuntimeExports.
|
|
31851
|
-
className:
|
|
31852
|
-
children:
|
|
31853
|
-
|
|
31854
|
-
|
|
31855
|
-
|
|
31856
|
-
|
|
31857
|
-
|
|
31858
|
-
|
|
31859
|
-
|
|
31860
|
-
|
|
31861
|
-
|
|
31862
|
-
|
|
31863
|
-
|
|
31864
|
-
Icon: X$1,
|
|
31865
|
-
size: ButtonSize.ICON_MD
|
|
31866
|
-
})]
|
|
31867
|
-
}), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
31868
|
-
className: "flex flex-1 flex-col items-center overflow-auto",
|
|
31869
|
-
children
|
|
31840
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(MotionModal, {
|
|
31841
|
+
onClick: (e) => e.stopPropagation(),
|
|
31842
|
+
initial: { scale: isOpen ? 0.5 : 1 },
|
|
31843
|
+
animate: { scale: isOpen ? 1 : 0.5 },
|
|
31844
|
+
transition: { duration: 0.3 },
|
|
31845
|
+
className: modalVariants({
|
|
31846
|
+
size: size2,
|
|
31847
|
+
className
|
|
31848
|
+
}),
|
|
31849
|
+
role: "dialog",
|
|
31850
|
+
"aria-modal": true,
|
|
31851
|
+
roundedSize: "2xl",
|
|
31852
|
+
...props,
|
|
31853
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
31854
|
+
className: cn$2("cursor-default", hasCloseButton && hasTitle ? `flex items-start` : hasCloseButton ? `flex justify-end` : hasTitle ? `items-center` : `hidden`),
|
|
31855
|
+
children: [hasTitle && /* @__PURE__ */ jsxRuntimeExports.jsx(H3, {
|
|
31856
|
+
className: "mt-2 mb-4 ml-4 flex items-center justify-center font-bold text-lg",
|
|
31857
|
+
children: title
|
|
31858
|
+
}), hasCloseButton && /* @__PURE__ */ jsxRuntimeExports.jsx(Button, {
|
|
31859
|
+
variant: ButtonVariant.HOVERABLE,
|
|
31860
|
+
color: ButtonColor.TEXT,
|
|
31861
|
+
label: "Close modal",
|
|
31862
|
+
className: "ml-auto",
|
|
31863
|
+
onClick: (e) => {
|
|
31864
|
+
e.stopPropagation();
|
|
31865
|
+
onClose?.();
|
|
31866
|
+
},
|
|
31867
|
+
Icon: X$1,
|
|
31868
|
+
size: ButtonSize.ICON_MD
|
|
31870
31869
|
})]
|
|
31871
|
-
})
|
|
31870
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
31871
|
+
className: "flex flex-1 flex-col items-center",
|
|
31872
|
+
children
|
|
31873
|
+
})]
|
|
31872
31874
|
})
|
|
31873
31875
|
}), containerElement);
|
|
31874
31876
|
};
|
|
31875
|
-
const checkboxVariants = cva(
|
|
31877
|
+
const checkboxVariants = cva([
|
|
31878
|
+
"appearance-none",
|
|
31879
|
+
"pointer relative border-2",
|
|
31880
|
+
"focus:outline-0",
|
|
31881
|
+
"checked:border-current checked:bg-current checked:hover:bg-current/80",
|
|
31882
|
+
"ring-current/20 ring-offset-current",
|
|
31883
|
+
"hover:bg-current/20",
|
|
31884
|
+
"disabled:opacity-50",
|
|
31885
|
+
"ring-0 transition-all duration-300 ease-in-out hover:ring-4 focus-visible:ring-6",
|
|
31886
|
+
"checked:before:absolute checked:before:inset-0 checked:before:content-['✓']",
|
|
31887
|
+
"checked:before:flex checked:before:items-center checked:before:justify-center",
|
|
31888
|
+
"checked:before:text-text-opposite/80",
|
|
31889
|
+
"rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl"
|
|
31890
|
+
].join(" "), {
|
|
31876
31891
|
variants: {
|
|
31877
|
-
variant: { default:
|
|
31878
|
-
"pointer rounded border-2 bg-input-background text-input-text shadow-none outline-0 transition-all",
|
|
31879
|
-
"border-input-border hover:border-input-border-hover focus:border-input-border-focus focus:outline-0 focus:[box-shadow:none]",
|
|
31880
|
-
"checked:border-checkbox-checked-border checked:bg-checkbox-checked",
|
|
31881
|
-
"disabled:opacity-50"
|
|
31882
|
-
] },
|
|
31892
|
+
variant: { default: "" },
|
|
31883
31893
|
size: {
|
|
31884
|
-
sm: "size-4",
|
|
31885
|
-
md: "size-5",
|
|
31886
|
-
lg: "size-6"
|
|
31894
|
+
sm: "size-4 rounded-md",
|
|
31895
|
+
md: "size-5 rounded-lg",
|
|
31896
|
+
lg: "size-6 rounded-xl"
|
|
31887
31897
|
},
|
|
31888
31898
|
color: {
|
|
31889
31899
|
primary: "accent-primary",
|
|
@@ -31911,20 +31921,19 @@ const checkboxVariants = cva("", {
|
|
|
31911
31921
|
});
|
|
31912
31922
|
const Input$1 = ({ validationStyleEnabled = false, label, size: size2, color: color2, name, variant, className, labelClassName, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("input", {
|
|
31913
31923
|
type: "checkbox",
|
|
31914
|
-
className: checkboxVariants({
|
|
31924
|
+
className: cn$2(checkboxVariants({
|
|
31915
31925
|
variant,
|
|
31916
31926
|
size: size2,
|
|
31917
31927
|
color: color2,
|
|
31918
|
-
validationStyleEnabled: validationStyleEnabled ? "enabled" : "disabled"
|
|
31919
|
-
|
|
31920
|
-
}),
|
|
31928
|
+
validationStyleEnabled: validationStyleEnabled ? "enabled" : "disabled"
|
|
31929
|
+
}), className),
|
|
31921
31930
|
...props
|
|
31922
31931
|
});
|
|
31923
31932
|
const Checkbox = (props) => {
|
|
31924
31933
|
const { label, name, id: id2 } = props;
|
|
31925
31934
|
return label ? /* @__PURE__ */ jsxRuntimeExports.jsxs("label", {
|
|
31926
31935
|
htmlFor: id2 ?? name,
|
|
31927
|
-
className: cn$
|
|
31936
|
+
className: cn$2("flex w-full cursor-pointer items-center gap-x-4 font-medium text-sm", props.labelClassName),
|
|
31928
31937
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Input$1, {
|
|
31929
31938
|
id: id2 ?? name,
|
|
31930
31939
|
...props
|
|
@@ -31934,20 +31943,32 @@ const Checkbox = (props) => {
|
|
|
31934
31943
|
...props
|
|
31935
31944
|
});
|
|
31936
31945
|
};
|
|
31937
|
-
const
|
|
31946
|
+
const cn$1 = (...classes) => classes.filter(Boolean).join(" ");
|
|
31947
|
+
const inputVariants = cva([
|
|
31948
|
+
"w-full select-text resize-none text-base shadow-none outline-none",
|
|
31949
|
+
"transition-shadow duration-100 md:text-sm",
|
|
31950
|
+
"ring-0",
|
|
31951
|
+
"disabled:opacity-50",
|
|
31952
|
+
"rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl"
|
|
31953
|
+
].join(" "), {
|
|
31938
31954
|
variants: {
|
|
31939
31955
|
variant: {
|
|
31940
31956
|
default: [
|
|
31941
|
-
"
|
|
31942
|
-
"
|
|
31943
|
-
"
|
|
31944
|
-
"
|
|
31945
|
-
|
|
31946
|
-
|
|
31957
|
+
"text-text",
|
|
31958
|
+
"bg-neutral-50 dark:bg-neutral-950",
|
|
31959
|
+
"ring-neutral-100 dark:ring-neutral-700",
|
|
31960
|
+
"ring-offset-neutral-100 dark:ring-offset-neutral-700",
|
|
31961
|
+
"focus-visible:outline-none",
|
|
31962
|
+
"disabled:ring-0",
|
|
31963
|
+
"focus-visible:ring-3",
|
|
31964
|
+
"[box-shadow:none] focus:[box-shadow:none]",
|
|
31965
|
+
"aria-invalid:border-error"
|
|
31966
|
+
].join(" "),
|
|
31967
|
+
invisible: ["border-none bg-inherit text-inherit outline-none ring-0"].join(" ")
|
|
31947
31968
|
},
|
|
31948
31969
|
size: {
|
|
31949
|
-
md: "px-2 py-3 md:py-
|
|
31950
|
-
lg: "p-4
|
|
31970
|
+
md: "px-2 py-3 md:py-2",
|
|
31971
|
+
lg: "p-4"
|
|
31951
31972
|
},
|
|
31952
31973
|
validationStyleEnabled: {
|
|
31953
31974
|
disabled: "",
|
|
@@ -31966,12 +31987,11 @@ let InputVariant = /* @__PURE__ */ (function(InputVariant$1) {
|
|
|
31966
31987
|
return InputVariant$1;
|
|
31967
31988
|
})({});
|
|
31968
31989
|
const Input = ({ validationStyleEnabled = false, variant, size: size2, className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("input", {
|
|
31969
|
-
className: inputVariants({
|
|
31990
|
+
className: cn$1(inputVariants({
|
|
31970
31991
|
variant,
|
|
31971
31992
|
size: size2,
|
|
31972
|
-
validationStyleEnabled: validationStyleEnabled ? "enabled" : "disabled"
|
|
31973
|
-
|
|
31974
|
-
}),
|
|
31993
|
+
validationStyleEnabled: validationStyleEnabled ? "enabled" : "disabled"
|
|
31994
|
+
}), className),
|
|
31975
31995
|
...props
|
|
31976
31996
|
});
|
|
31977
31997
|
const InputPassword = (props) => {
|
|
@@ -31994,18 +32014,477 @@ const InputPassword = (props) => {
|
|
|
31994
32014
|
onClick: handlePasswordReveal,
|
|
31995
32015
|
"aria-label": isPasswordRevealed ? "Hide password" : "Show password",
|
|
31996
32016
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(EyeIconComponent, {
|
|
31997
|
-
className: "mr-2 inline-block text-neutral",
|
|
32017
|
+
className: "mr-2 inline-block cursor-pointer text-neutral",
|
|
31998
32018
|
size: 20
|
|
31999
32019
|
})
|
|
32000
32020
|
})]
|
|
32001
32021
|
});
|
|
32002
32022
|
};
|
|
32023
|
+
const syncTimeouts = (cb) => {
|
|
32024
|
+
return [
|
|
32025
|
+
setTimeout(cb, 0),
|
|
32026
|
+
setTimeout(cb, 10),
|
|
32027
|
+
setTimeout(cb, 50)
|
|
32028
|
+
];
|
|
32029
|
+
};
|
|
32030
|
+
const safeInsertRule = (sheet, rule) => {
|
|
32031
|
+
try {
|
|
32032
|
+
sheet.insertRule(rule);
|
|
32033
|
+
} catch {
|
|
32034
|
+
console.error("input-otp could not insert CSS rule:", rule);
|
|
32035
|
+
}
|
|
32036
|
+
};
|
|
32037
|
+
const NOSCRIPT_CSS_FALLBACK = `
|
|
32038
|
+
[data-input-otp] {
|
|
32039
|
+
--nojs-bg: white !important;
|
|
32040
|
+
--nojs-fg: black !important;
|
|
32041
|
+
|
|
32042
|
+
background-color: var(--nojs-bg) !important;
|
|
32043
|
+
color: var(--nojs-fg) !important;
|
|
32044
|
+
caret-color: var(--nojs-fg) !important;
|
|
32045
|
+
letter-spacing: .25em !important;
|
|
32046
|
+
text-align: center !important;
|
|
32047
|
+
border: 1px solid var(--nojs-fg) !important;
|
|
32048
|
+
border-radius: 4px !important;
|
|
32049
|
+
width: 100% !important;
|
|
32050
|
+
}
|
|
32051
|
+
@media (prefers-color-scheme: dark) {
|
|
32052
|
+
[data-input-otp] {
|
|
32053
|
+
--nojs-bg: black !important;
|
|
32054
|
+
--nojs-fg: white !important;
|
|
32055
|
+
}
|
|
32056
|
+
}`;
|
|
32057
|
+
const PWM_BADGE_MARGIN_RIGHT = 18;
|
|
32058
|
+
const PWM_BADGE_SPACE_WIDTH_PX = 40;
|
|
32059
|
+
const PWM_BADGE_SPACE_WIDTH = `${PWM_BADGE_SPACE_WIDTH_PX}px`;
|
|
32060
|
+
const PASSWORD_MANAGERS_SELECTORS = [
|
|
32061
|
+
"[data-lastpass-icon-root]",
|
|
32062
|
+
"com-1password-button",
|
|
32063
|
+
"[data-dashlanecreated]",
|
|
32064
|
+
'[style$="2147483647 !important;"]'
|
|
32065
|
+
].join(",");
|
|
32066
|
+
const usePasswordManagerBadge = ({ containerRef, inputRef, pushPasswordManagerStrategy, isFocused }) => {
|
|
32067
|
+
const [hasPWMBadge, setHasPWMBadge] = reactExports.useState(false);
|
|
32068
|
+
const [hasPWMBadgeSpace, setHasPWMBadgeSpace] = reactExports.useState(false);
|
|
32069
|
+
const [done, setDone] = reactExports.useState(false);
|
|
32070
|
+
const willPushPWMBadge = pushPasswordManagerStrategy === "none" ? false : (pushPasswordManagerStrategy === "increase-width" || pushPasswordManagerStrategy === "experimental-no-flickering") && hasPWMBadge && hasPWMBadgeSpace;
|
|
32071
|
+
const trackPWMBadge = () => {
|
|
32072
|
+
const container = containerRef.current;
|
|
32073
|
+
const input = inputRef.current;
|
|
32074
|
+
if (!container || !input || done || pushPasswordManagerStrategy === "none") return;
|
|
32075
|
+
const elementToCompare = container;
|
|
32076
|
+
const rightCornerX = elementToCompare.getBoundingClientRect().left + elementToCompare.offsetWidth;
|
|
32077
|
+
const centereredY = elementToCompare.getBoundingClientRect().top + elementToCompare.offsetHeight / 2;
|
|
32078
|
+
const x = rightCornerX - PWM_BADGE_MARGIN_RIGHT;
|
|
32079
|
+
const y = centereredY;
|
|
32080
|
+
if (document.querySelectorAll(PASSWORD_MANAGERS_SELECTORS).length === 0) {
|
|
32081
|
+
if (document.elementFromPoint(x, y) === container) return;
|
|
32082
|
+
}
|
|
32083
|
+
setHasPWMBadge(true);
|
|
32084
|
+
setDone(true);
|
|
32085
|
+
};
|
|
32086
|
+
reactExports.useEffect(() => {
|
|
32087
|
+
const container = containerRef.current;
|
|
32088
|
+
if (!container || pushPasswordManagerStrategy === "none") return;
|
|
32089
|
+
const checkHasSpace = () => {
|
|
32090
|
+
setHasPWMBadgeSpace(window.innerWidth - container.getBoundingClientRect().right >= PWM_BADGE_SPACE_WIDTH_PX);
|
|
32091
|
+
};
|
|
32092
|
+
checkHasSpace();
|
|
32093
|
+
const interval = setInterval(checkHasSpace, 1e3);
|
|
32094
|
+
return () => {
|
|
32095
|
+
clearInterval(interval);
|
|
32096
|
+
};
|
|
32097
|
+
}, [containerRef, pushPasswordManagerStrategy]);
|
|
32098
|
+
reactExports.useEffect(() => {
|
|
32099
|
+
const _isFocused = isFocused || document.activeElement === inputRef.current;
|
|
32100
|
+
if (pushPasswordManagerStrategy === "none" || !_isFocused) return;
|
|
32101
|
+
const t1 = setTimeout(trackPWMBadge, 0);
|
|
32102
|
+
const t2 = setTimeout(trackPWMBadge, 2e3);
|
|
32103
|
+
const t3 = setTimeout(trackPWMBadge, 5e3);
|
|
32104
|
+
const t4 = setTimeout(() => {
|
|
32105
|
+
setDone(true);
|
|
32106
|
+
}, 6e3);
|
|
32107
|
+
return () => {
|
|
32108
|
+
clearTimeout(t1);
|
|
32109
|
+
clearTimeout(t2);
|
|
32110
|
+
clearTimeout(t3);
|
|
32111
|
+
clearTimeout(t4);
|
|
32112
|
+
};
|
|
32113
|
+
}, [
|
|
32114
|
+
inputRef,
|
|
32115
|
+
isFocused,
|
|
32116
|
+
pushPasswordManagerStrategy
|
|
32117
|
+
]);
|
|
32118
|
+
return {
|
|
32119
|
+
hasPWMBadge,
|
|
32120
|
+
willPushPWMBadge,
|
|
32121
|
+
PWM_BADGE_SPACE_WIDTH
|
|
32122
|
+
};
|
|
32123
|
+
};
|
|
32124
|
+
const usePrevious$1 = (value) => {
|
|
32125
|
+
const ref = reactExports.useRef(void 0);
|
|
32126
|
+
reactExports.useEffect(() => {
|
|
32127
|
+
ref.current = value;
|
|
32128
|
+
});
|
|
32129
|
+
return ref.current;
|
|
32130
|
+
};
|
|
32131
|
+
const OTPInputContext = reactExports.createContext({});
|
|
32132
|
+
const OTPInput = ({ value: uncheckedValue, onChange: uncheckedOnChange, maxLength, pattern, placeholder, inputMode = "numeric", onComplete, onActiveSlotChange, pushPasswordManagerStrategy = "increase-width", pasteTransformer, containerClassName, noScriptCSSFallback = NOSCRIPT_CSS_FALLBACK, render, children, ...props }) => {
|
|
32133
|
+
const [internalValue, setInternalValue] = reactExports.useState(typeof props.defaultValue === "string" ? props.defaultValue : "");
|
|
32134
|
+
const value = uncheckedValue ?? internalValue;
|
|
32135
|
+
const previousValue = usePrevious$1(value);
|
|
32136
|
+
const onChange = (newValue) => {
|
|
32137
|
+
uncheckedOnChange?.(newValue);
|
|
32138
|
+
setInternalValue(newValue);
|
|
32139
|
+
};
|
|
32140
|
+
const regexp = pattern !== void 0 ? typeof pattern === "string" ? new RegExp(pattern) : pattern : null;
|
|
32141
|
+
const inputRef = reactExports.useRef(null);
|
|
32142
|
+
const containerRef = reactExports.useRef(null);
|
|
32143
|
+
const initialLoadRef = reactExports.useRef({
|
|
32144
|
+
value,
|
|
32145
|
+
onChange,
|
|
32146
|
+
isIOS: typeof window !== "undefined" && window?.CSS?.supports?.("-webkit-touch-callout", "none")
|
|
32147
|
+
});
|
|
32148
|
+
const inputMetadataRef = reactExports.useRef({ prev: [
|
|
32149
|
+
inputRef.current?.selectionStart ?? null,
|
|
32150
|
+
inputRef.current?.selectionEnd ?? null,
|
|
32151
|
+
inputRef.current?.selectionDirection ?? "none"
|
|
32152
|
+
] });
|
|
32153
|
+
reactExports.useEffect(() => {
|
|
32154
|
+
const input = inputRef.current;
|
|
32155
|
+
const container = containerRef.current;
|
|
32156
|
+
if (!input || !container) return;
|
|
32157
|
+
if (initialLoadRef.current.value !== input.value) initialLoadRef.current.onChange(input.value);
|
|
32158
|
+
inputMetadataRef.current.prev = [
|
|
32159
|
+
input.selectionStart,
|
|
32160
|
+
input.selectionEnd,
|
|
32161
|
+
input.selectionDirection ?? "none"
|
|
32162
|
+
];
|
|
32163
|
+
const onDocumentSelectionChange = () => {
|
|
32164
|
+
if (document.activeElement !== input) {
|
|
32165
|
+
setMirrorSelectionStart(null);
|
|
32166
|
+
setMirrorSelectionEnd(null);
|
|
32167
|
+
setActualCaretPosition(null);
|
|
32168
|
+
return;
|
|
32169
|
+
}
|
|
32170
|
+
const selectionStart = input.selectionStart;
|
|
32171
|
+
const selectionEnd = input.selectionEnd;
|
|
32172
|
+
const selectionDirection = input.selectionDirection;
|
|
32173
|
+
const maxLength$1 = input.maxLength;
|
|
32174
|
+
const value$1 = input.value;
|
|
32175
|
+
const previousSelection = inputMetadataRef.current.prev;
|
|
32176
|
+
let calculatedStart = -1;
|
|
32177
|
+
let calculatedEnd = -1;
|
|
32178
|
+
let calculatedDirection = selectionDirection ?? "none";
|
|
32179
|
+
if (value$1.length !== 0 && selectionStart !== null && selectionEnd !== null) {
|
|
32180
|
+
const isSingleCaret = selectionStart === selectionEnd;
|
|
32181
|
+
const isInsertMode = selectionStart === value$1.length && value$1.length < maxLength$1;
|
|
32182
|
+
if (isSingleCaret && !isInsertMode) {
|
|
32183
|
+
const caretPosition = selectionStart;
|
|
32184
|
+
if (caretPosition === 0) {
|
|
32185
|
+
calculatedStart = 0;
|
|
32186
|
+
calculatedEnd = 1;
|
|
32187
|
+
calculatedDirection = "forward";
|
|
32188
|
+
} else if (caretPosition === maxLength$1) {
|
|
32189
|
+
calculatedStart = caretPosition - 1;
|
|
32190
|
+
calculatedEnd = caretPosition;
|
|
32191
|
+
calculatedDirection = "backward";
|
|
32192
|
+
} else if (maxLength$1 > 1 && value$1.length > 1) {
|
|
32193
|
+
let offset2 = 0;
|
|
32194
|
+
if (previousSelection[0] !== null && previousSelection[1] !== null) {
|
|
32195
|
+
calculatedDirection = caretPosition < previousSelection[1] ? "backward" : "forward";
|
|
32196
|
+
const wasPreviouslyInserting = previousSelection[0] === previousSelection[1] && previousSelection[0] < maxLength$1;
|
|
32197
|
+
if (calculatedDirection === "backward" && !wasPreviouslyInserting) offset2 = -1;
|
|
32198
|
+
}
|
|
32199
|
+
calculatedStart = offset2 + caretPosition;
|
|
32200
|
+
calculatedEnd = offset2 + caretPosition + 1;
|
|
32201
|
+
}
|
|
32202
|
+
}
|
|
32203
|
+
if (calculatedStart !== -1 && calculatedEnd !== -1 && calculatedStart !== calculatedEnd) inputRef.current?.setSelectionRange(calculatedStart, calculatedEnd, calculatedDirection);
|
|
32204
|
+
}
|
|
32205
|
+
const finalSelectionStart = calculatedStart !== -1 ? calculatedStart : selectionStart;
|
|
32206
|
+
const finalSelectionEnd = calculatedEnd !== -1 ? calculatedEnd : selectionEnd;
|
|
32207
|
+
const finalDirection = calculatedDirection;
|
|
32208
|
+
if (selectionStart !== null && selectionEnd !== null) if (selectionStart === selectionEnd) setActualCaretPosition(selectionStart);
|
|
32209
|
+
else setActualCaretPosition(finalSelectionStart);
|
|
32210
|
+
else setActualCaretPosition(null);
|
|
32211
|
+
setMirrorSelectionStart(finalSelectionStart);
|
|
32212
|
+
setMirrorSelectionEnd(finalSelectionEnd);
|
|
32213
|
+
inputMetadataRef.current.prev = [
|
|
32214
|
+
finalSelectionStart,
|
|
32215
|
+
finalSelectionEnd,
|
|
32216
|
+
finalDirection
|
|
32217
|
+
];
|
|
32218
|
+
};
|
|
32219
|
+
document.addEventListener("selectionchange", onDocumentSelectionChange, { capture: true });
|
|
32220
|
+
onDocumentSelectionChange();
|
|
32221
|
+
if (document.activeElement === input) setIsFocused(true);
|
|
32222
|
+
if (!document.getElementById("input-otp-style")) {
|
|
32223
|
+
const styleEl = document.createElement("style");
|
|
32224
|
+
styleEl.id = "input-otp-style";
|
|
32225
|
+
document.head.appendChild(styleEl);
|
|
32226
|
+
if (styleEl.sheet) {
|
|
32227
|
+
const autofillStyles = "background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";
|
|
32228
|
+
safeInsertRule(styleEl.sheet, "[data-input-otp]::selection { background: transparent !important; color: transparent !important; }");
|
|
32229
|
+
safeInsertRule(styleEl.sheet, `[data-input-otp]:autofill { ${autofillStyles} }`);
|
|
32230
|
+
safeInsertRule(styleEl.sheet, `[data-input-otp]:-webkit-autofill { ${autofillStyles} }`);
|
|
32231
|
+
safeInsertRule(styleEl.sheet, `@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }`);
|
|
32232
|
+
safeInsertRule(styleEl.sheet, `[data-input-otp] + * { pointer-events: all !important; }`);
|
|
32233
|
+
}
|
|
32234
|
+
}
|
|
32235
|
+
const updateRootHeight = () => {
|
|
32236
|
+
if (container) container.style.setProperty("--root-height", `${input.clientHeight}px`);
|
|
32237
|
+
};
|
|
32238
|
+
updateRootHeight();
|
|
32239
|
+
const resizeObserver = new ResizeObserver(updateRootHeight);
|
|
32240
|
+
resizeObserver.observe(input);
|
|
32241
|
+
return () => {
|
|
32242
|
+
document.removeEventListener("selectionchange", onDocumentSelectionChange, { capture: true });
|
|
32243
|
+
resizeObserver.disconnect();
|
|
32244
|
+
};
|
|
32245
|
+
}, []);
|
|
32246
|
+
const [isHoveringInput, setIsHoveringInput] = reactExports.useState(false);
|
|
32247
|
+
const [isFocused, setIsFocused] = reactExports.useState(false);
|
|
32248
|
+
const [mirrorSelectionStart, setMirrorSelectionStart] = reactExports.useState(null);
|
|
32249
|
+
const [mirrorSelectionEnd, setMirrorSelectionEnd] = reactExports.useState(null);
|
|
32250
|
+
const [actualCaretPosition, setActualCaretPosition] = reactExports.useState(null);
|
|
32251
|
+
reactExports.useEffect(() => {
|
|
32252
|
+
syncTimeouts(() => {
|
|
32253
|
+
inputRef.current?.dispatchEvent(new Event("input"));
|
|
32254
|
+
const s2 = inputRef.current?.selectionStart ?? null;
|
|
32255
|
+
const e = inputRef.current?.selectionEnd ?? null;
|
|
32256
|
+
const dir = inputRef.current?.selectionDirection ?? "none";
|
|
32257
|
+
if (s2 !== null && e !== null) {
|
|
32258
|
+
setMirrorSelectionStart(s2);
|
|
32259
|
+
setMirrorSelectionEnd(e);
|
|
32260
|
+
setActualCaretPosition(s2);
|
|
32261
|
+
inputMetadataRef.current.prev = [
|
|
32262
|
+
s2,
|
|
32263
|
+
e,
|
|
32264
|
+
dir
|
|
32265
|
+
];
|
|
32266
|
+
}
|
|
32267
|
+
});
|
|
32268
|
+
}, [value, isFocused]);
|
|
32269
|
+
reactExports.useEffect(() => {
|
|
32270
|
+
if (previousValue === void 0) return;
|
|
32271
|
+
if (value !== previousValue && previousValue.length < maxLength && value.length === maxLength) onComplete?.(value);
|
|
32272
|
+
}, [
|
|
32273
|
+
maxLength,
|
|
32274
|
+
onComplete,
|
|
32275
|
+
previousValue,
|
|
32276
|
+
value
|
|
32277
|
+
]);
|
|
32278
|
+
const previousActiveSlot = reactExports.useRef(null);
|
|
32279
|
+
reactExports.useEffect(() => {
|
|
32280
|
+
const activeSlotIndex = isFocused && actualCaretPosition !== null ? actualCaretPosition : null;
|
|
32281
|
+
if (activeSlotIndex !== previousActiveSlot.current) {
|
|
32282
|
+
previousActiveSlot.current = activeSlotIndex;
|
|
32283
|
+
onActiveSlotChange?.(activeSlotIndex);
|
|
32284
|
+
}
|
|
32285
|
+
}, [
|
|
32286
|
+
isFocused,
|
|
32287
|
+
actualCaretPosition,
|
|
32288
|
+
onActiveSlotChange
|
|
32289
|
+
]);
|
|
32290
|
+
const pwmb = usePasswordManagerBadge({
|
|
32291
|
+
containerRef,
|
|
32292
|
+
inputRef,
|
|
32293
|
+
pushPasswordManagerStrategy,
|
|
32294
|
+
isFocused
|
|
32295
|
+
});
|
|
32296
|
+
const _changeListener = (e) => {
|
|
32297
|
+
const newValue = e.currentTarget.value.slice(0, maxLength);
|
|
32298
|
+
if (newValue.length > 0 && regexp && !regexp.test(newValue)) {
|
|
32299
|
+
e.preventDefault();
|
|
32300
|
+
return;
|
|
32301
|
+
}
|
|
32302
|
+
if (typeof previousValue === "string" && newValue.length < previousValue.length) document.dispatchEvent(new Event("selectionchange"));
|
|
32303
|
+
onChange(newValue);
|
|
32304
|
+
};
|
|
32305
|
+
const _focusListener = () => {
|
|
32306
|
+
if (inputRef.current) {
|
|
32307
|
+
const start = Math.min(inputRef.current.value.length, maxLength - 1);
|
|
32308
|
+
const end = inputRef.current.value.length;
|
|
32309
|
+
inputRef.current?.setSelectionRange(start, end);
|
|
32310
|
+
setMirrorSelectionStart(start);
|
|
32311
|
+
setMirrorSelectionEnd(end);
|
|
32312
|
+
}
|
|
32313
|
+
setIsFocused(true);
|
|
32314
|
+
};
|
|
32315
|
+
const _pasteListener = (e) => {
|
|
32316
|
+
const input = inputRef.current;
|
|
32317
|
+
if (!pasteTransformer && (!initialLoadRef.current.isIOS || !e.clipboardData || !input)) return;
|
|
32318
|
+
const _content = e.clipboardData.getData("text/plain");
|
|
32319
|
+
const content2 = pasteTransformer ? pasteTransformer(_content) : _content;
|
|
32320
|
+
e.preventDefault();
|
|
32321
|
+
const start = inputRef.current?.selectionStart;
|
|
32322
|
+
const end = inputRef.current?.selectionEnd;
|
|
32323
|
+
const newValue = (start !== end ? value.slice(0, start ?? 0) + content2 + value.slice(end ?? 0) : value.slice(0, start ?? 0) + content2 + value.slice(start ?? 0)).slice(0, maxLength);
|
|
32324
|
+
if (newValue.length > 0 && regexp && !regexp.test(newValue)) return;
|
|
32325
|
+
if (input) {
|
|
32326
|
+
input.value = newValue;
|
|
32327
|
+
onChange(newValue);
|
|
32328
|
+
const _start = Math.min(newValue.length, maxLength - 1);
|
|
32329
|
+
const _end = newValue.length;
|
|
32330
|
+
input.setSelectionRange(_start, _end);
|
|
32331
|
+
setMirrorSelectionStart(_start);
|
|
32332
|
+
setMirrorSelectionEnd(_end);
|
|
32333
|
+
}
|
|
32334
|
+
};
|
|
32335
|
+
const dynamicInputStyle = {
|
|
32336
|
+
width: pwmb.willPushPWMBadge ? `calc(100% + ${pwmb.PWM_BADGE_SPACE_WIDTH})` : "100%",
|
|
32337
|
+
clipPath: pwmb.willPushPWMBadge ? `inset(0 ${pwmb.PWM_BADGE_SPACE_WIDTH} 0 0)` : void 0,
|
|
32338
|
+
fontSize: "var(--root-height)"
|
|
32339
|
+
};
|
|
32340
|
+
const renderedInput = /* @__PURE__ */ jsxRuntimeExports.jsx("input", {
|
|
32341
|
+
autoComplete: props.autoComplete || "one-time-code",
|
|
32342
|
+
...props,
|
|
32343
|
+
"data-input-otp": true,
|
|
32344
|
+
"data-input-otp-placeholder-shown": value.length === 0 || void 0,
|
|
32345
|
+
"data-input-otp-mss": mirrorSelectionStart,
|
|
32346
|
+
"data-input-otp-mse": mirrorSelectionEnd,
|
|
32347
|
+
inputMode,
|
|
32348
|
+
pattern: regexp?.source,
|
|
32349
|
+
"aria-placeholder": placeholder,
|
|
32350
|
+
className: "-z-10 pointer-events-auto absolute inset-0 flex h-full border-0 border-transparent bg-transparent text-center font-mono text-transparent tabular-nums leading-none tracking-[-.5em] caret-transparent opacity-100 shadow-none outline-none",
|
|
32351
|
+
style: dynamicInputStyle,
|
|
32352
|
+
maxLength,
|
|
32353
|
+
value,
|
|
32354
|
+
ref: inputRef,
|
|
32355
|
+
onPaste: (e) => {
|
|
32356
|
+
_pasteListener(e);
|
|
32357
|
+
props.onPaste?.(e);
|
|
32358
|
+
},
|
|
32359
|
+
onChange: _changeListener,
|
|
32360
|
+
onMouseOver: (e) => {
|
|
32361
|
+
setIsHoveringInput(true);
|
|
32362
|
+
props.onMouseOver?.(e);
|
|
32363
|
+
},
|
|
32364
|
+
onMouseLeave: (e) => {
|
|
32365
|
+
setIsHoveringInput(false);
|
|
32366
|
+
props.onMouseLeave?.(e);
|
|
32367
|
+
},
|
|
32368
|
+
onKeyDown: (e) => {
|
|
32369
|
+
if (e.key === "ArrowLeft" || e.key === "ArrowRight") requestAnimationFrame(() => {
|
|
32370
|
+
const input = inputRef.current;
|
|
32371
|
+
if (input && document.activeElement === input) {
|
|
32372
|
+
const s2 = input.selectionStart;
|
|
32373
|
+
const end = input.selectionEnd;
|
|
32374
|
+
if (s2 !== null && end !== null) setActualCaretPosition(s2);
|
|
32375
|
+
}
|
|
32376
|
+
});
|
|
32377
|
+
props.onKeyDown?.(e);
|
|
32378
|
+
},
|
|
32379
|
+
onFocus: (e) => {
|
|
32380
|
+
_focusListener();
|
|
32381
|
+
props.onFocus?.(e);
|
|
32382
|
+
},
|
|
32383
|
+
onBlur: (e) => {
|
|
32384
|
+
setIsFocused(false);
|
|
32385
|
+
props.onBlur?.(e);
|
|
32386
|
+
}
|
|
32387
|
+
});
|
|
32388
|
+
const setSelection = (index2) => {
|
|
32389
|
+
const input = inputRef.current;
|
|
32390
|
+
if (!input || props.disabled) return;
|
|
32391
|
+
const clampedIndex = Math.max(0, Math.min(index2, maxLength - 1));
|
|
32392
|
+
if (document.activeElement !== input) input.focus();
|
|
32393
|
+
const hasChar = value[clampedIndex] !== void 0;
|
|
32394
|
+
const start = clampedIndex;
|
|
32395
|
+
const end = hasChar ? clampedIndex + 1 : clampedIndex;
|
|
32396
|
+
input.setSelectionRange(start, end);
|
|
32397
|
+
setMirrorSelectionStart(start);
|
|
32398
|
+
setMirrorSelectionEnd(end);
|
|
32399
|
+
setIsFocused(true);
|
|
32400
|
+
};
|
|
32401
|
+
const contextValue = {
|
|
32402
|
+
slots: Array.from({ length: maxLength }).map((_2, slotIdx) => {
|
|
32403
|
+
const isActive = isFocused && mirrorSelectionStart !== null && mirrorSelectionEnd !== null && (mirrorSelectionStart === mirrorSelectionEnd && slotIdx === mirrorSelectionStart || slotIdx >= mirrorSelectionStart && slotIdx < mirrorSelectionEnd);
|
|
32404
|
+
const char = value[slotIdx] !== void 0 ? value[slotIdx] : null;
|
|
32405
|
+
return {
|
|
32406
|
+
char,
|
|
32407
|
+
placeholderChar: value[0] !== void 0 ? null : placeholder?.[slotIdx] ?? null,
|
|
32408
|
+
isActive,
|
|
32409
|
+
hasFakeCaret: isActive && char === null
|
|
32410
|
+
};
|
|
32411
|
+
}),
|
|
32412
|
+
isFocused,
|
|
32413
|
+
isHovering: !props.disabled && isHoveringInput,
|
|
32414
|
+
setSelection
|
|
32415
|
+
};
|
|
32416
|
+
const renderedChildren = render !== void 0 ? render(contextValue) : /* @__PURE__ */ jsxRuntimeExports.jsx(OTPInputContext.Provider, {
|
|
32417
|
+
value: contextValue,
|
|
32418
|
+
children
|
|
32419
|
+
});
|
|
32420
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [noScriptCSSFallback !== null && /* @__PURE__ */ jsxRuntimeExports.jsx("noscript", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("style", { children: noScriptCSSFallback }) }), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
32421
|
+
ref: containerRef,
|
|
32422
|
+
className: cn$2("relative", props.disabled ? "cursor-default" : "cursor-text", containerClassName),
|
|
32423
|
+
children: [renderedChildren, /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
32424
|
+
className: "absolute inset-0",
|
|
32425
|
+
children: renderedInput
|
|
32426
|
+
})]
|
|
32427
|
+
})] });
|
|
32428
|
+
};
|
|
32429
|
+
const InputOTP = ({ className, render, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(OTPInput, {
|
|
32430
|
+
containerClassName: "relative flex items-center gap-2 has-disabled:opacity-50",
|
|
32431
|
+
className: cn$2("disabled:cursor-not-allowed", className),
|
|
32432
|
+
render,
|
|
32433
|
+
...props
|
|
32434
|
+
});
|
|
32435
|
+
const InputOTPGroup = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
32436
|
+
className: cn$2("z-10 flex items-center gap-3", className),
|
|
32437
|
+
...props
|
|
32438
|
+
});
|
|
32439
|
+
const InputOTPSlot = ({ index: index2, className, onClick, onKeyDown, ...props }) => {
|
|
32440
|
+
const inputOTPContext = reactExports.useContext(OTPInputContext);
|
|
32441
|
+
const { char, isActive } = inputOTPContext?.slots[index2] ?? {};
|
|
32442
|
+
const { setSelection } = inputOTPContext ?? {};
|
|
32443
|
+
const handleClick = (e) => {
|
|
32444
|
+
setSelection?.(index2);
|
|
32445
|
+
onClick?.(e);
|
|
32446
|
+
};
|
|
32447
|
+
const handleKeyDown = (e) => {
|
|
32448
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
32449
|
+
e.preventDefault();
|
|
32450
|
+
setSelection?.(index2);
|
|
32451
|
+
}
|
|
32452
|
+
onKeyDown?.(e);
|
|
32453
|
+
};
|
|
32454
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Button, {
|
|
32455
|
+
"aria-active": isActive,
|
|
32456
|
+
variant: "input",
|
|
32457
|
+
color: "custom",
|
|
32458
|
+
tabIndex: -1,
|
|
32459
|
+
className: cn$2("relative z-10 px-2!", isActive && "ring-4!", className),
|
|
32460
|
+
onClick: handleClick,
|
|
32461
|
+
onKeyDown: handleKeyDown,
|
|
32462
|
+
label: null,
|
|
32463
|
+
...props,
|
|
32464
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
32465
|
+
className: "relative z-10 flex h-6 w-4 items-center justify-center",
|
|
32466
|
+
children: char
|
|
32467
|
+
})
|
|
32468
|
+
});
|
|
32469
|
+
};
|
|
32470
|
+
const InputOTPSeparator = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
32471
|
+
"aria-hidden": true,
|
|
32472
|
+
className: "z-0 table h-0.5 w-3 rounded-full bg-border text-neutral",
|
|
32473
|
+
...props,
|
|
32474
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Minus, {})
|
|
32475
|
+
});
|
|
32476
|
+
const InputIndicator = ({ ref, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
32477
|
+
"data-indicator": true,
|
|
32478
|
+
className: "absolute top-0 z-0 h-8 h-full w-auto rounded-xl bg-neutral-100 ring-4 ring-neutral-100 transition-[left,width] duration-300 ease-in-out [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl motion-reduce:transition-none dark:bg-neutral-700 dark:ring-neutral-700",
|
|
32479
|
+
ref,
|
|
32480
|
+
...props
|
|
32481
|
+
});
|
|
32003
32482
|
const SearchInput = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
32004
32483
|
className: "relative flex items-center gap-1",
|
|
32005
32484
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Search, { className: "absolute left-2 size-4" }), /* @__PURE__ */ jsxRuntimeExports.jsx(Input, {
|
|
32006
32485
|
...props,
|
|
32007
32486
|
type: "search",
|
|
32008
|
-
className: cn$
|
|
32487
|
+
className: cn$2("pl-8", className)
|
|
32009
32488
|
})]
|
|
32010
32489
|
});
|
|
32011
32490
|
const EditableFieldLayout = ({ value = "", onCancel, onSave, onClick, children, isDisabled, ...props }) => {
|
|
@@ -32046,7 +32525,7 @@ const EditableFieldLayout = ({ value = "", onCancel, onSave, onClick, children,
|
|
|
32046
32525
|
ref: editableFieldRef,
|
|
32047
32526
|
...props,
|
|
32048
32527
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
32049
|
-
className: cn$
|
|
32528
|
+
className: cn$2("flex flex-1 gap-2", isEditing ? "display" : "hidden"),
|
|
32050
32529
|
children: [
|
|
32051
32530
|
children,
|
|
32052
32531
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, {
|
|
@@ -32079,7 +32558,7 @@ const EditableFieldLayout = ({ value = "", onCancel, onSave, onClick, children,
|
|
|
32079
32558
|
})
|
|
32080
32559
|
]
|
|
32081
32560
|
}, String(isEditing)), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
32082
|
-
className: cn$
|
|
32561
|
+
className: cn$2("flex flex-1 gap-2", isEditing ? "hidden" : "display"),
|
|
32083
32562
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
32084
32563
|
className: "ml-2 flex w-full whitespace-pre-wrap p-1 text-sm leading-6",
|
|
32085
32564
|
children: result
|
|
@@ -33949,12 +34428,12 @@ const useFormField = () => {
|
|
|
33949
34428
|
};
|
|
33950
34429
|
};
|
|
33951
34430
|
const InformationTag = ({ className, children, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("i", {
|
|
33952
|
-
className: cn$
|
|
34431
|
+
className: cn$2("text-neutral-400 text-xs", className),
|
|
33953
34432
|
...props,
|
|
33954
34433
|
children: ["ⓘ ", children]
|
|
33955
34434
|
});
|
|
33956
34435
|
const Label$1 = ({ htmlFor, required: required2 = false, disabled = false, className, children, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("label", {
|
|
33957
|
-
className: cn$
|
|
34436
|
+
className: cn$2("select-none font-medium text-sm leading-none", "peer-disabled:cursor-not-allowed peer-disabled:opacity-70", disabled && "cursor-not-allowed text-muted-foreground opacity-70", className),
|
|
33958
34437
|
htmlFor,
|
|
33959
34438
|
...props,
|
|
33960
34439
|
children: [children, required2 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
@@ -33965,7 +34444,7 @@ const Label$1 = ({ htmlFor, required: required2 = false, disabled = false, class
|
|
|
33965
34444
|
})]
|
|
33966
34445
|
});
|
|
33967
34446
|
const TextArea = ({ className, variant, validationStyleEnabled = false, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("textarea", {
|
|
33968
|
-
className: cn$
|
|
34447
|
+
className: cn$2("resize-none", inputVariants({
|
|
33969
34448
|
variant,
|
|
33970
34449
|
validationStyleEnabled: validationStyleEnabled ? "enabled" : "disabled",
|
|
33971
34450
|
className
|
|
@@ -34005,7 +34484,7 @@ const AutoSizedTextArea = ({ className, autoSize = true, onChange, maxRows = 999
|
|
|
34005
34484
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(TextArea, {
|
|
34006
34485
|
ref: setRef2,
|
|
34007
34486
|
onChange: handleChange,
|
|
34008
|
-
className: cn$
|
|
34487
|
+
className: cn$2("overflow-y-auto", autoSize ? "resize-none" : "", className),
|
|
34009
34488
|
...props
|
|
34010
34489
|
});
|
|
34011
34490
|
};
|
|
@@ -38551,89 +39030,743 @@ function createAuthClient(options) {
|
|
|
38551
39030
|
);
|
|
38552
39031
|
return proxy;
|
|
38553
39032
|
}
|
|
39033
|
+
function bufferToBase64URLString(buffer) {
|
|
39034
|
+
const bytes = new Uint8Array(buffer);
|
|
39035
|
+
let str = "";
|
|
39036
|
+
for (const charCode of bytes) {
|
|
39037
|
+
str += String.fromCharCode(charCode);
|
|
39038
|
+
}
|
|
39039
|
+
const base64String = btoa(str);
|
|
39040
|
+
return base64String.replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
39041
|
+
}
|
|
39042
|
+
function base64URLStringToBuffer(base64URLString) {
|
|
39043
|
+
const base642 = base64URLString.replace(/-/g, "+").replace(/_/g, "/");
|
|
39044
|
+
const padLength = (4 - base642.length % 4) % 4;
|
|
39045
|
+
const padded = base642.padEnd(base642.length + padLength, "=");
|
|
39046
|
+
const binary = atob(padded);
|
|
39047
|
+
const buffer = new ArrayBuffer(binary.length);
|
|
39048
|
+
const bytes = new Uint8Array(buffer);
|
|
39049
|
+
for (let i2 = 0; i2 < binary.length; i2++) {
|
|
39050
|
+
bytes[i2] = binary.charCodeAt(i2);
|
|
39051
|
+
}
|
|
39052
|
+
return buffer;
|
|
39053
|
+
}
|
|
39054
|
+
function browserSupportsWebAuthn() {
|
|
39055
|
+
return _browserSupportsWebAuthnInternals.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential === "function");
|
|
39056
|
+
}
|
|
39057
|
+
const _browserSupportsWebAuthnInternals = {
|
|
39058
|
+
stubThis: (value) => value
|
|
39059
|
+
};
|
|
39060
|
+
function toPublicKeyCredentialDescriptor(descriptor) {
|
|
39061
|
+
const { id: id2 } = descriptor;
|
|
39062
|
+
return {
|
|
39063
|
+
...descriptor,
|
|
39064
|
+
id: base64URLStringToBuffer(id2),
|
|
39065
|
+
/**
|
|
39066
|
+
* `descriptor.transports` is an array of our `AuthenticatorTransportFuture` that includes newer
|
|
39067
|
+
* transports that TypeScript's DOM lib is ignorant of. Convince TS that our list of transports
|
|
39068
|
+
* are fine to pass to WebAuthn since browsers will recognize the new value.
|
|
39069
|
+
*/
|
|
39070
|
+
transports: descriptor.transports
|
|
39071
|
+
};
|
|
39072
|
+
}
|
|
39073
|
+
function isValidDomain(hostname2) {
|
|
39074
|
+
return (
|
|
39075
|
+
// Consider localhost valid as well since it's okay wrt Secure Contexts
|
|
39076
|
+
hostname2 === "localhost" || /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(hostname2)
|
|
39077
|
+
);
|
|
39078
|
+
}
|
|
39079
|
+
class WebAuthnError extends Error {
|
|
39080
|
+
constructor({ message, code, cause, name }) {
|
|
39081
|
+
super(message, { cause });
|
|
39082
|
+
Object.defineProperty(this, "code", {
|
|
39083
|
+
enumerable: true,
|
|
39084
|
+
configurable: true,
|
|
39085
|
+
writable: true,
|
|
39086
|
+
value: void 0
|
|
39087
|
+
});
|
|
39088
|
+
this.name = name ?? cause.name;
|
|
39089
|
+
this.code = code;
|
|
39090
|
+
}
|
|
39091
|
+
}
|
|
39092
|
+
function identifyRegistrationError({ error, options }) {
|
|
39093
|
+
const { publicKey } = options;
|
|
39094
|
+
if (!publicKey) {
|
|
39095
|
+
throw Error("options was missing required publicKey property");
|
|
39096
|
+
}
|
|
39097
|
+
if (error.name === "AbortError") {
|
|
39098
|
+
if (options.signal instanceof AbortSignal) {
|
|
39099
|
+
return new WebAuthnError({
|
|
39100
|
+
message: "Registration ceremony was sent an abort signal",
|
|
39101
|
+
code: "ERROR_CEREMONY_ABORTED",
|
|
39102
|
+
cause: error
|
|
39103
|
+
});
|
|
39104
|
+
}
|
|
39105
|
+
} else if (error.name === "ConstraintError") {
|
|
39106
|
+
if (publicKey.authenticatorSelection?.requireResidentKey === true) {
|
|
39107
|
+
return new WebAuthnError({
|
|
39108
|
+
message: "Discoverable credentials were required but no available authenticator supported it",
|
|
39109
|
+
code: "ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",
|
|
39110
|
+
cause: error
|
|
39111
|
+
});
|
|
39112
|
+
} else if (
|
|
39113
|
+
// @ts-ignore: `mediation` doesn't yet exist on CredentialCreationOptions but it's possible as of Sept 2024
|
|
39114
|
+
options.mediation === "conditional" && publicKey.authenticatorSelection?.userVerification === "required"
|
|
39115
|
+
) {
|
|
39116
|
+
return new WebAuthnError({
|
|
39117
|
+
message: "User verification was required during automatic registration but it could not be performed",
|
|
39118
|
+
code: "ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",
|
|
39119
|
+
cause: error
|
|
39120
|
+
});
|
|
39121
|
+
} else if (publicKey.authenticatorSelection?.userVerification === "required") {
|
|
39122
|
+
return new WebAuthnError({
|
|
39123
|
+
message: "User verification was required but no available authenticator supported it",
|
|
39124
|
+
code: "ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",
|
|
39125
|
+
cause: error
|
|
39126
|
+
});
|
|
39127
|
+
}
|
|
39128
|
+
} else if (error.name === "InvalidStateError") {
|
|
39129
|
+
return new WebAuthnError({
|
|
39130
|
+
message: "The authenticator was previously registered",
|
|
39131
|
+
code: "ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",
|
|
39132
|
+
cause: error
|
|
39133
|
+
});
|
|
39134
|
+
} else if (error.name === "NotAllowedError") {
|
|
39135
|
+
return new WebAuthnError({
|
|
39136
|
+
message: error.message,
|
|
39137
|
+
code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
|
|
39138
|
+
cause: error
|
|
39139
|
+
});
|
|
39140
|
+
} else if (error.name === "NotSupportedError") {
|
|
39141
|
+
const validPubKeyCredParams = publicKey.pubKeyCredParams.filter((param) => param.type === "public-key");
|
|
39142
|
+
if (validPubKeyCredParams.length === 0) {
|
|
39143
|
+
return new WebAuthnError({
|
|
39144
|
+
message: 'No entry in pubKeyCredParams was of type "public-key"',
|
|
39145
|
+
code: "ERROR_MALFORMED_PUBKEYCREDPARAMS",
|
|
39146
|
+
cause: error
|
|
39147
|
+
});
|
|
39148
|
+
}
|
|
39149
|
+
return new WebAuthnError({
|
|
39150
|
+
message: "No available authenticator supported any of the specified pubKeyCredParams algorithms",
|
|
39151
|
+
code: "ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",
|
|
39152
|
+
cause: error
|
|
39153
|
+
});
|
|
39154
|
+
} else if (error.name === "SecurityError") {
|
|
39155
|
+
const effectiveDomain = globalThis.location.hostname;
|
|
39156
|
+
if (!isValidDomain(effectiveDomain)) {
|
|
39157
|
+
return new WebAuthnError({
|
|
39158
|
+
message: `${globalThis.location.hostname} is an invalid domain`,
|
|
39159
|
+
code: "ERROR_INVALID_DOMAIN",
|
|
39160
|
+
cause: error
|
|
39161
|
+
});
|
|
39162
|
+
} else if (publicKey.rp.id !== effectiveDomain) {
|
|
39163
|
+
return new WebAuthnError({
|
|
39164
|
+
message: `The RP ID "${publicKey.rp.id}" is invalid for this domain`,
|
|
39165
|
+
code: "ERROR_INVALID_RP_ID",
|
|
39166
|
+
cause: error
|
|
39167
|
+
});
|
|
39168
|
+
}
|
|
39169
|
+
} else if (error.name === "TypeError") {
|
|
39170
|
+
if (publicKey.user.id.byteLength < 1 || publicKey.user.id.byteLength > 64) {
|
|
39171
|
+
return new WebAuthnError({
|
|
39172
|
+
message: "User ID was not between 1 and 64 characters",
|
|
39173
|
+
code: "ERROR_INVALID_USER_ID_LENGTH",
|
|
39174
|
+
cause: error
|
|
39175
|
+
});
|
|
39176
|
+
}
|
|
39177
|
+
} else if (error.name === "UnknownError") {
|
|
39178
|
+
return new WebAuthnError({
|
|
39179
|
+
message: "The authenticator was unable to process the specified options, or could not create a new credential",
|
|
39180
|
+
code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
|
|
39181
|
+
cause: error
|
|
39182
|
+
});
|
|
39183
|
+
}
|
|
39184
|
+
return error;
|
|
39185
|
+
}
|
|
39186
|
+
class BaseWebAuthnAbortService {
|
|
39187
|
+
constructor() {
|
|
39188
|
+
Object.defineProperty(this, "controller", {
|
|
39189
|
+
enumerable: true,
|
|
39190
|
+
configurable: true,
|
|
39191
|
+
writable: true,
|
|
39192
|
+
value: void 0
|
|
39193
|
+
});
|
|
39194
|
+
}
|
|
39195
|
+
createNewAbortSignal() {
|
|
39196
|
+
if (this.controller) {
|
|
39197
|
+
const abortError = new Error("Cancelling existing WebAuthn API call for new one");
|
|
39198
|
+
abortError.name = "AbortError";
|
|
39199
|
+
this.controller.abort(abortError);
|
|
39200
|
+
}
|
|
39201
|
+
const newController = new AbortController();
|
|
39202
|
+
this.controller = newController;
|
|
39203
|
+
return newController.signal;
|
|
39204
|
+
}
|
|
39205
|
+
cancelCeremony() {
|
|
39206
|
+
if (this.controller) {
|
|
39207
|
+
const abortError = new Error("Manually cancelling existing WebAuthn API call");
|
|
39208
|
+
abortError.name = "AbortError";
|
|
39209
|
+
this.controller.abort(abortError);
|
|
39210
|
+
this.controller = void 0;
|
|
39211
|
+
}
|
|
39212
|
+
}
|
|
39213
|
+
}
|
|
39214
|
+
const WebAuthnAbortService = new BaseWebAuthnAbortService();
|
|
39215
|
+
const attachments = ["cross-platform", "platform"];
|
|
39216
|
+
function toAuthenticatorAttachment(attachment) {
|
|
39217
|
+
if (!attachment) {
|
|
39218
|
+
return;
|
|
39219
|
+
}
|
|
39220
|
+
if (attachments.indexOf(attachment) < 0) {
|
|
39221
|
+
return;
|
|
39222
|
+
}
|
|
39223
|
+
return attachment;
|
|
39224
|
+
}
|
|
39225
|
+
async function startRegistration(options) {
|
|
39226
|
+
if (!options.optionsJSON && options.challenge) {
|
|
39227
|
+
console.warn("startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.");
|
|
39228
|
+
options = { optionsJSON: options };
|
|
39229
|
+
}
|
|
39230
|
+
const { optionsJSON, useAutoRegister = false } = options;
|
|
39231
|
+
if (!browserSupportsWebAuthn()) {
|
|
39232
|
+
throw new Error("WebAuthn is not supported in this browser");
|
|
39233
|
+
}
|
|
39234
|
+
const publicKey = {
|
|
39235
|
+
...optionsJSON,
|
|
39236
|
+
challenge: base64URLStringToBuffer(optionsJSON.challenge),
|
|
39237
|
+
user: {
|
|
39238
|
+
...optionsJSON.user,
|
|
39239
|
+
id: base64URLStringToBuffer(optionsJSON.user.id)
|
|
39240
|
+
},
|
|
39241
|
+
excludeCredentials: optionsJSON.excludeCredentials?.map(toPublicKeyCredentialDescriptor)
|
|
39242
|
+
};
|
|
39243
|
+
const createOptions = {};
|
|
39244
|
+
if (useAutoRegister) {
|
|
39245
|
+
createOptions.mediation = "conditional";
|
|
39246
|
+
}
|
|
39247
|
+
createOptions.publicKey = publicKey;
|
|
39248
|
+
createOptions.signal = WebAuthnAbortService.createNewAbortSignal();
|
|
39249
|
+
let credential;
|
|
39250
|
+
try {
|
|
39251
|
+
credential = await navigator.credentials.create(createOptions);
|
|
39252
|
+
} catch (err) {
|
|
39253
|
+
throw identifyRegistrationError({ error: err, options: createOptions });
|
|
39254
|
+
}
|
|
39255
|
+
if (!credential) {
|
|
39256
|
+
throw new Error("Registration was not completed");
|
|
39257
|
+
}
|
|
39258
|
+
const { id: id2, rawId, response, type } = credential;
|
|
39259
|
+
let transports = void 0;
|
|
39260
|
+
if (typeof response.getTransports === "function") {
|
|
39261
|
+
transports = response.getTransports();
|
|
39262
|
+
}
|
|
39263
|
+
let responsePublicKeyAlgorithm = void 0;
|
|
39264
|
+
if (typeof response.getPublicKeyAlgorithm === "function") {
|
|
39265
|
+
try {
|
|
39266
|
+
responsePublicKeyAlgorithm = response.getPublicKeyAlgorithm();
|
|
39267
|
+
} catch (error) {
|
|
39268
|
+
warnOnBrokenImplementation("getPublicKeyAlgorithm()", error);
|
|
39269
|
+
}
|
|
39270
|
+
}
|
|
39271
|
+
let responsePublicKey = void 0;
|
|
39272
|
+
if (typeof response.getPublicKey === "function") {
|
|
39273
|
+
try {
|
|
39274
|
+
const _publicKey = response.getPublicKey();
|
|
39275
|
+
if (_publicKey !== null) {
|
|
39276
|
+
responsePublicKey = bufferToBase64URLString(_publicKey);
|
|
39277
|
+
}
|
|
39278
|
+
} catch (error) {
|
|
39279
|
+
warnOnBrokenImplementation("getPublicKey()", error);
|
|
39280
|
+
}
|
|
39281
|
+
}
|
|
39282
|
+
let responseAuthenticatorData;
|
|
39283
|
+
if (typeof response.getAuthenticatorData === "function") {
|
|
39284
|
+
try {
|
|
39285
|
+
responseAuthenticatorData = bufferToBase64URLString(response.getAuthenticatorData());
|
|
39286
|
+
} catch (error) {
|
|
39287
|
+
warnOnBrokenImplementation("getAuthenticatorData()", error);
|
|
39288
|
+
}
|
|
39289
|
+
}
|
|
39290
|
+
return {
|
|
39291
|
+
id: id2,
|
|
39292
|
+
rawId: bufferToBase64URLString(rawId),
|
|
39293
|
+
response: {
|
|
39294
|
+
attestationObject: bufferToBase64URLString(response.attestationObject),
|
|
39295
|
+
clientDataJSON: bufferToBase64URLString(response.clientDataJSON),
|
|
39296
|
+
transports,
|
|
39297
|
+
publicKeyAlgorithm: responsePublicKeyAlgorithm,
|
|
39298
|
+
publicKey: responsePublicKey,
|
|
39299
|
+
authenticatorData: responseAuthenticatorData
|
|
39300
|
+
},
|
|
39301
|
+
type,
|
|
39302
|
+
clientExtensionResults: credential.getClientExtensionResults(),
|
|
39303
|
+
authenticatorAttachment: toAuthenticatorAttachment(credential.authenticatorAttachment)
|
|
39304
|
+
};
|
|
39305
|
+
}
|
|
39306
|
+
function warnOnBrokenImplementation(methodName, cause) {
|
|
39307
|
+
console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${methodName}. You should report this error to them.
|
|
39308
|
+
`, cause);
|
|
39309
|
+
}
|
|
39310
|
+
function browserSupportsWebAuthnAutofill() {
|
|
39311
|
+
if (!browserSupportsWebAuthn()) {
|
|
39312
|
+
return _browserSupportsWebAuthnAutofillInternals.stubThis(new Promise((resolve) => resolve(false)));
|
|
39313
|
+
}
|
|
39314
|
+
const globalPublicKeyCredential = globalThis.PublicKeyCredential;
|
|
39315
|
+
if (globalPublicKeyCredential?.isConditionalMediationAvailable === void 0) {
|
|
39316
|
+
return _browserSupportsWebAuthnAutofillInternals.stubThis(new Promise((resolve) => resolve(false)));
|
|
39317
|
+
}
|
|
39318
|
+
return _browserSupportsWebAuthnAutofillInternals.stubThis(globalPublicKeyCredential.isConditionalMediationAvailable());
|
|
39319
|
+
}
|
|
39320
|
+
const _browserSupportsWebAuthnAutofillInternals = {
|
|
39321
|
+
stubThis: (value) => value
|
|
39322
|
+
};
|
|
39323
|
+
function identifyAuthenticationError({ error, options }) {
|
|
39324
|
+
const { publicKey } = options;
|
|
39325
|
+
if (!publicKey) {
|
|
39326
|
+
throw Error("options was missing required publicKey property");
|
|
39327
|
+
}
|
|
39328
|
+
if (error.name === "AbortError") {
|
|
39329
|
+
if (options.signal instanceof AbortSignal) {
|
|
39330
|
+
return new WebAuthnError({
|
|
39331
|
+
message: "Authentication ceremony was sent an abort signal",
|
|
39332
|
+
code: "ERROR_CEREMONY_ABORTED",
|
|
39333
|
+
cause: error
|
|
39334
|
+
});
|
|
39335
|
+
}
|
|
39336
|
+
} else if (error.name === "NotAllowedError") {
|
|
39337
|
+
return new WebAuthnError({
|
|
39338
|
+
message: error.message,
|
|
39339
|
+
code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
|
|
39340
|
+
cause: error
|
|
39341
|
+
});
|
|
39342
|
+
} else if (error.name === "SecurityError") {
|
|
39343
|
+
const effectiveDomain = globalThis.location.hostname;
|
|
39344
|
+
if (!isValidDomain(effectiveDomain)) {
|
|
39345
|
+
return new WebAuthnError({
|
|
39346
|
+
message: `${globalThis.location.hostname} is an invalid domain`,
|
|
39347
|
+
code: "ERROR_INVALID_DOMAIN",
|
|
39348
|
+
cause: error
|
|
39349
|
+
});
|
|
39350
|
+
} else if (publicKey.rpId !== effectiveDomain) {
|
|
39351
|
+
return new WebAuthnError({
|
|
39352
|
+
message: `The RP ID "${publicKey.rpId}" is invalid for this domain`,
|
|
39353
|
+
code: "ERROR_INVALID_RP_ID",
|
|
39354
|
+
cause: error
|
|
39355
|
+
});
|
|
39356
|
+
}
|
|
39357
|
+
} else if (error.name === "UnknownError") {
|
|
39358
|
+
return new WebAuthnError({
|
|
39359
|
+
message: "The authenticator was unable to process the specified options, or could not create a new assertion signature",
|
|
39360
|
+
code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
|
|
39361
|
+
cause: error
|
|
39362
|
+
});
|
|
39363
|
+
}
|
|
39364
|
+
return error;
|
|
39365
|
+
}
|
|
39366
|
+
async function startAuthentication(options) {
|
|
39367
|
+
if (!options.optionsJSON && options.challenge) {
|
|
39368
|
+
console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.");
|
|
39369
|
+
options = { optionsJSON: options };
|
|
39370
|
+
}
|
|
39371
|
+
const { optionsJSON, useBrowserAutofill = false, verifyBrowserAutofillInput = true } = options;
|
|
39372
|
+
if (!browserSupportsWebAuthn()) {
|
|
39373
|
+
throw new Error("WebAuthn is not supported in this browser");
|
|
39374
|
+
}
|
|
39375
|
+
let allowCredentials;
|
|
39376
|
+
if (optionsJSON.allowCredentials?.length !== 0) {
|
|
39377
|
+
allowCredentials = optionsJSON.allowCredentials?.map(toPublicKeyCredentialDescriptor);
|
|
39378
|
+
}
|
|
39379
|
+
const publicKey = {
|
|
39380
|
+
...optionsJSON,
|
|
39381
|
+
challenge: base64URLStringToBuffer(optionsJSON.challenge),
|
|
39382
|
+
allowCredentials
|
|
39383
|
+
};
|
|
39384
|
+
const getOptions = {};
|
|
39385
|
+
if (useBrowserAutofill) {
|
|
39386
|
+
if (!await browserSupportsWebAuthnAutofill()) {
|
|
39387
|
+
throw Error("Browser does not support WebAuthn autofill");
|
|
39388
|
+
}
|
|
39389
|
+
const eligibleInputs = document.querySelectorAll("input[autocomplete$='webauthn']");
|
|
39390
|
+
if (eligibleInputs.length < 1 && verifyBrowserAutofillInput) {
|
|
39391
|
+
throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
|
|
39392
|
+
}
|
|
39393
|
+
getOptions.mediation = "conditional";
|
|
39394
|
+
publicKey.allowCredentials = [];
|
|
39395
|
+
}
|
|
39396
|
+
getOptions.publicKey = publicKey;
|
|
39397
|
+
getOptions.signal = WebAuthnAbortService.createNewAbortSignal();
|
|
39398
|
+
let credential;
|
|
39399
|
+
try {
|
|
39400
|
+
credential = await navigator.credentials.get(getOptions);
|
|
39401
|
+
} catch (err) {
|
|
39402
|
+
throw identifyAuthenticationError({ error: err, options: getOptions });
|
|
39403
|
+
}
|
|
39404
|
+
if (!credential) {
|
|
39405
|
+
throw new Error("Authentication was not completed");
|
|
39406
|
+
}
|
|
39407
|
+
const { id: id2, rawId, response, type } = credential;
|
|
39408
|
+
let userHandle = void 0;
|
|
39409
|
+
if (response.userHandle) {
|
|
39410
|
+
userHandle = bufferToBase64URLString(response.userHandle);
|
|
39411
|
+
}
|
|
39412
|
+
return {
|
|
39413
|
+
id: id2,
|
|
39414
|
+
rawId: bufferToBase64URLString(rawId),
|
|
39415
|
+
response: {
|
|
39416
|
+
authenticatorData: bufferToBase64URLString(response.authenticatorData),
|
|
39417
|
+
clientDataJSON: bufferToBase64URLString(response.clientDataJSON),
|
|
39418
|
+
signature: bufferToBase64URLString(response.signature),
|
|
39419
|
+
userHandle
|
|
39420
|
+
},
|
|
39421
|
+
type,
|
|
39422
|
+
clientExtensionResults: credential.getClientExtensionResults(),
|
|
39423
|
+
authenticatorAttachment: toAuthenticatorAttachment(credential.authenticatorAttachment)
|
|
39424
|
+
};
|
|
39425
|
+
}
|
|
39426
|
+
const twoFactorClient = (options) => {
|
|
39427
|
+
return {
|
|
39428
|
+
id: "two-factor",
|
|
39429
|
+
$InferServerPlugin: {},
|
|
39430
|
+
atomListeners: [
|
|
39431
|
+
{
|
|
39432
|
+
matcher: (path) => path.startsWith("/two-factor/"),
|
|
39433
|
+
signal: "$sessionSignal"
|
|
39434
|
+
}
|
|
39435
|
+
],
|
|
39436
|
+
pathMethods: {
|
|
39437
|
+
"/two-factor/disable": "POST",
|
|
39438
|
+
"/two-factor/enable": "POST",
|
|
39439
|
+
"/two-factor/send-otp": "POST",
|
|
39440
|
+
"/two-factor/generate-backup-codes": "POST"
|
|
39441
|
+
},
|
|
39442
|
+
fetchPlugins: [
|
|
39443
|
+
{
|
|
39444
|
+
id: "two-factor",
|
|
39445
|
+
name: "two-factor",
|
|
39446
|
+
hooks: {
|
|
39447
|
+
async onSuccess(context) {
|
|
39448
|
+
if (context.data?.twoFactorRedirect) {
|
|
39449
|
+
if (options?.onTwoFactorRedirect) {
|
|
39450
|
+
await options.onTwoFactorRedirect();
|
|
39451
|
+
}
|
|
39452
|
+
}
|
|
39453
|
+
}
|
|
39454
|
+
}
|
|
39455
|
+
}
|
|
39456
|
+
]
|
|
39457
|
+
};
|
|
39458
|
+
};
|
|
39459
|
+
const getPasskeyActions = ($fetch, {
|
|
39460
|
+
$listPasskeys,
|
|
39461
|
+
$store
|
|
39462
|
+
}) => {
|
|
39463
|
+
const signInPasskey = async (opts, options) => {
|
|
39464
|
+
const response = await $fetch(
|
|
39465
|
+
"/passkey/generate-authenticate-options",
|
|
39466
|
+
{
|
|
39467
|
+
method: "POST",
|
|
39468
|
+
throw: false
|
|
39469
|
+
}
|
|
39470
|
+
);
|
|
39471
|
+
if (!response.data) {
|
|
39472
|
+
return response;
|
|
39473
|
+
}
|
|
39474
|
+
try {
|
|
39475
|
+
const res = await startAuthentication({
|
|
39476
|
+
optionsJSON: response.data,
|
|
39477
|
+
useBrowserAutofill: opts?.autoFill
|
|
39478
|
+
});
|
|
39479
|
+
const verified = await $fetch("/passkey/verify-authentication", {
|
|
39480
|
+
body: {
|
|
39481
|
+
response: res
|
|
39482
|
+
},
|
|
39483
|
+
...opts?.fetchOptions,
|
|
39484
|
+
...options,
|
|
39485
|
+
method: "POST",
|
|
39486
|
+
throw: false
|
|
39487
|
+
});
|
|
39488
|
+
$listPasskeys.set(Math.random());
|
|
39489
|
+
$store.notify("$sessionSignal");
|
|
39490
|
+
return verified;
|
|
39491
|
+
} catch (e) {
|
|
39492
|
+
return {
|
|
39493
|
+
data: null,
|
|
39494
|
+
error: {
|
|
39495
|
+
code: "AUTH_CANCELLED",
|
|
39496
|
+
message: "auth cancelled",
|
|
39497
|
+
status: 400,
|
|
39498
|
+
statusText: "BAD_REQUEST"
|
|
39499
|
+
}
|
|
39500
|
+
};
|
|
39501
|
+
}
|
|
39502
|
+
};
|
|
39503
|
+
const registerPasskey = async (opts, fetchOpts) => {
|
|
39504
|
+
const options = await $fetch(
|
|
39505
|
+
"/passkey/generate-register-options",
|
|
39506
|
+
{
|
|
39507
|
+
method: "GET",
|
|
39508
|
+
query: {
|
|
39509
|
+
...opts?.authenticatorAttachment && {
|
|
39510
|
+
authenticatorAttachment: opts.authenticatorAttachment
|
|
39511
|
+
},
|
|
39512
|
+
...opts?.name && {
|
|
39513
|
+
name: opts.name
|
|
39514
|
+
}
|
|
39515
|
+
},
|
|
39516
|
+
throw: false
|
|
39517
|
+
}
|
|
39518
|
+
);
|
|
39519
|
+
if (!options.data) {
|
|
39520
|
+
return options;
|
|
39521
|
+
}
|
|
39522
|
+
try {
|
|
39523
|
+
const res = await startRegistration({
|
|
39524
|
+
optionsJSON: options.data,
|
|
39525
|
+
useAutoRegister: opts?.useAutoRegister
|
|
39526
|
+
});
|
|
39527
|
+
const verified = await $fetch("/passkey/verify-registration", {
|
|
39528
|
+
...opts?.fetchOptions,
|
|
39529
|
+
...fetchOpts,
|
|
39530
|
+
body: {
|
|
39531
|
+
response: res,
|
|
39532
|
+
name: opts?.name
|
|
39533
|
+
},
|
|
39534
|
+
method: "POST",
|
|
39535
|
+
throw: false
|
|
39536
|
+
});
|
|
39537
|
+
if (!verified.data) {
|
|
39538
|
+
return verified;
|
|
39539
|
+
}
|
|
39540
|
+
$listPasskeys.set(Math.random());
|
|
39541
|
+
} catch (e) {
|
|
39542
|
+
if (e instanceof WebAuthnError) {
|
|
39543
|
+
if (e.code === "ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED") {
|
|
39544
|
+
return {
|
|
39545
|
+
data: null,
|
|
39546
|
+
error: {
|
|
39547
|
+
code: e.code,
|
|
39548
|
+
message: "previously registered",
|
|
39549
|
+
status: 400,
|
|
39550
|
+
statusText: "BAD_REQUEST"
|
|
39551
|
+
}
|
|
39552
|
+
};
|
|
39553
|
+
}
|
|
39554
|
+
if (e.code === "ERROR_CEREMONY_ABORTED") {
|
|
39555
|
+
return {
|
|
39556
|
+
data: null,
|
|
39557
|
+
error: {
|
|
39558
|
+
code: e.code,
|
|
39559
|
+
message: "registration cancelled",
|
|
39560
|
+
status: 400,
|
|
39561
|
+
statusText: "BAD_REQUEST"
|
|
39562
|
+
}
|
|
39563
|
+
};
|
|
39564
|
+
}
|
|
39565
|
+
return {
|
|
39566
|
+
data: null,
|
|
39567
|
+
error: {
|
|
39568
|
+
code: e.code,
|
|
39569
|
+
message: e.message,
|
|
39570
|
+
status: 400,
|
|
39571
|
+
statusText: "BAD_REQUEST"
|
|
39572
|
+
}
|
|
39573
|
+
};
|
|
39574
|
+
}
|
|
39575
|
+
return {
|
|
39576
|
+
data: null,
|
|
39577
|
+
error: {
|
|
39578
|
+
code: "UNKNOWN_ERROR",
|
|
39579
|
+
message: e instanceof Error ? e.message : "unknown error",
|
|
39580
|
+
status: 500,
|
|
39581
|
+
statusText: "INTERNAL_SERVER_ERROR"
|
|
39582
|
+
}
|
|
39583
|
+
};
|
|
39584
|
+
}
|
|
39585
|
+
};
|
|
39586
|
+
return {
|
|
39587
|
+
signIn: {
|
|
39588
|
+
/**
|
|
39589
|
+
* Sign in with a registered passkey
|
|
39590
|
+
*/
|
|
39591
|
+
passkey: signInPasskey
|
|
39592
|
+
},
|
|
39593
|
+
passkey: {
|
|
39594
|
+
/**
|
|
39595
|
+
* Add a passkey to the user account
|
|
39596
|
+
*/
|
|
39597
|
+
addPasskey: registerPasskey
|
|
39598
|
+
},
|
|
39599
|
+
/**
|
|
39600
|
+
* Inferred Internal Types
|
|
39601
|
+
*/
|
|
39602
|
+
$Infer: {}
|
|
39603
|
+
};
|
|
39604
|
+
};
|
|
39605
|
+
const passkeyClient = () => {
|
|
39606
|
+
const $listPasskeys = atom();
|
|
39607
|
+
return {
|
|
39608
|
+
id: "passkey",
|
|
39609
|
+
$InferServerPlugin: {},
|
|
39610
|
+
getActions: ($fetch, $store) => getPasskeyActions($fetch, {
|
|
39611
|
+
$listPasskeys,
|
|
39612
|
+
$store
|
|
39613
|
+
}),
|
|
39614
|
+
getAtoms($fetch) {
|
|
39615
|
+
const listPasskeys = useAuthQuery(
|
|
39616
|
+
$listPasskeys,
|
|
39617
|
+
"/passkey/list-user-passkeys",
|
|
39618
|
+
$fetch,
|
|
39619
|
+
{
|
|
39620
|
+
method: "GET"
|
|
39621
|
+
}
|
|
39622
|
+
);
|
|
39623
|
+
return {
|
|
39624
|
+
listPasskeys,
|
|
39625
|
+
$listPasskeys
|
|
39626
|
+
};
|
|
39627
|
+
},
|
|
39628
|
+
pathMethods: {
|
|
39629
|
+
"/passkey/register": "POST",
|
|
39630
|
+
"/passkey/authenticate": "POST"
|
|
39631
|
+
},
|
|
39632
|
+
atomListeners: [
|
|
39633
|
+
{
|
|
39634
|
+
matcher(path) {
|
|
39635
|
+
return path === "/passkey/verify-registration" || path === "/passkey/delete-passkey" || path === "/passkey/update-passkey" || path === "/sign-out";
|
|
39636
|
+
},
|
|
39637
|
+
signal: "$listPasskeys"
|
|
39638
|
+
},
|
|
39639
|
+
{
|
|
39640
|
+
matcher: (path) => path === "/passkey/verify-authentication",
|
|
39641
|
+
signal: "$sessionSignal"
|
|
39642
|
+
}
|
|
39643
|
+
]
|
|
39644
|
+
};
|
|
39645
|
+
};
|
|
39646
|
+
const magicLinkClient = () => {
|
|
39647
|
+
return {
|
|
39648
|
+
id: "magic-link",
|
|
39649
|
+
$InferServerPlugin: {}
|
|
39650
|
+
};
|
|
39651
|
+
};
|
|
39652
|
+
const getAuthClient = (backendURL) => createAuthClient({
|
|
39653
|
+
baseURL: backendURL,
|
|
39654
|
+
withCredentials: true,
|
|
39655
|
+
plugins: [
|
|
39656
|
+
twoFactorClient({ onTwoFactorRedirect: () => {
|
|
39657
|
+
const redirectUrl = new URLSearchParams(window.location.search).get("redirect_url");
|
|
39658
|
+
const twoFaUrl = redirectUrl ? `/auth/2fa?redirect_url=${encodeURIComponent(redirectUrl)}` : "/auth/2fa";
|
|
39659
|
+
window.location.href = twoFaUrl;
|
|
39660
|
+
} }),
|
|
39661
|
+
passkeyClient(),
|
|
39662
|
+
magicLinkClient()
|
|
39663
|
+
]
|
|
39664
|
+
});
|
|
38554
39665
|
const getAuthAPI = (intlayerConfig) => {
|
|
38555
39666
|
const backendURL = intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;
|
|
38556
39667
|
if (!backendURL) throw new Error("Backend URL is not defined in the Intlayer configuration.");
|
|
38557
|
-
const
|
|
38558
|
-
return createAuthClient({
|
|
38559
|
-
baseURL: backendURL,
|
|
38560
|
-
withCredentials: true
|
|
38561
|
-
});
|
|
38562
|
-
};
|
|
39668
|
+
const client2 = getAuthClient(backendURL);
|
|
38563
39669
|
const signInEmail = async (...args) => {
|
|
38564
|
-
return
|
|
39670
|
+
return client2.signIn.email(...args);
|
|
38565
39671
|
};
|
|
38566
39672
|
const signInSocial = async (...args) => {
|
|
38567
|
-
return
|
|
39673
|
+
return client2.signIn.social(...args);
|
|
38568
39674
|
};
|
|
38569
39675
|
const signUpEmail = async (...args) => {
|
|
38570
|
-
return
|
|
39676
|
+
return client2.signUp.email(...args);
|
|
38571
39677
|
};
|
|
38572
39678
|
const signOut = async (...args) => {
|
|
38573
|
-
return
|
|
39679
|
+
return client2.signOut(...args);
|
|
38574
39680
|
};
|
|
38575
39681
|
const changePasswordSession = async (...args) => {
|
|
38576
|
-
return
|
|
39682
|
+
return client2.changePassword(...args);
|
|
38577
39683
|
};
|
|
38578
39684
|
const requestPasswordResetSession = async (...args) => {
|
|
38579
|
-
return
|
|
39685
|
+
return client2.requestPasswordReset(...args);
|
|
38580
39686
|
};
|
|
38581
39687
|
const resetPassword = async (...args) => {
|
|
38582
|
-
return
|
|
39688
|
+
return client2.resetPassword(...args);
|
|
38583
39689
|
};
|
|
38584
39690
|
const verifyEmailSession = async (...args) => {
|
|
38585
|
-
return
|
|
39691
|
+
return client2.verifyEmail(...args);
|
|
38586
39692
|
};
|
|
38587
39693
|
const getSession = async (...args) => {
|
|
38588
|
-
return
|
|
39694
|
+
return client2.getSession(...args);
|
|
38589
39695
|
};
|
|
38590
39696
|
const forgetPassword = async (...args) => {
|
|
38591
|
-
return
|
|
39697
|
+
return client2.forgetPassword(...args);
|
|
38592
39698
|
};
|
|
38593
39699
|
const sendVerificationEmail = async (...args) => {
|
|
38594
|
-
return
|
|
39700
|
+
return client2.sendVerificationEmail(...args);
|
|
38595
39701
|
};
|
|
38596
39702
|
const changeEmail = async (...args) => {
|
|
38597
|
-
return
|
|
39703
|
+
return client2.changeEmail(...args);
|
|
38598
39704
|
};
|
|
38599
39705
|
const deleteUser = async (...args) => {
|
|
38600
|
-
return
|
|
39706
|
+
return client2.deleteUser(...args);
|
|
38601
39707
|
};
|
|
38602
39708
|
const revokeSession = async (...args) => {
|
|
38603
|
-
return
|
|
39709
|
+
return client2.revokeSession(...args);
|
|
38604
39710
|
};
|
|
38605
39711
|
const revokeSessions = async (...args) => {
|
|
38606
|
-
return
|
|
39712
|
+
return client2.revokeSessions(...args);
|
|
38607
39713
|
};
|
|
38608
39714
|
const revokeOtherSessions = async (...args) => {
|
|
38609
|
-
return
|
|
39715
|
+
return client2.revokeOtherSessions(...args);
|
|
38610
39716
|
};
|
|
38611
39717
|
const linkSocial = async (...args) => {
|
|
38612
|
-
return
|
|
39718
|
+
return client2.linkSocial(...args);
|
|
38613
39719
|
};
|
|
38614
39720
|
const listAccounts = async (...args) => {
|
|
38615
|
-
return
|
|
39721
|
+
return client2.listAccounts(...args);
|
|
38616
39722
|
};
|
|
38617
39723
|
const unlinkAccount = async (...args) => {
|
|
38618
|
-
return
|
|
39724
|
+
return client2.unlinkAccount(...args);
|
|
38619
39725
|
};
|
|
38620
39726
|
const refreshToken = async (...args) => {
|
|
38621
|
-
return
|
|
39727
|
+
return client2.refreshToken(...args);
|
|
38622
39728
|
};
|
|
38623
39729
|
const getAccessToken = async (...args) => {
|
|
38624
|
-
return
|
|
39730
|
+
return client2.getAccessToken(...args);
|
|
38625
39731
|
};
|
|
38626
39732
|
const accountInfo = async (...args) => {
|
|
38627
|
-
return
|
|
39733
|
+
return client2.accountInfo(...args);
|
|
38628
39734
|
};
|
|
38629
39735
|
const updateUser = async (...args) => {
|
|
38630
|
-
return
|
|
39736
|
+
return client2.updateUser(...args);
|
|
38631
39737
|
};
|
|
38632
39738
|
const listSessions = async (...args) => {
|
|
38633
|
-
return
|
|
39739
|
+
return client2.listSessions(...args);
|
|
39740
|
+
};
|
|
39741
|
+
const enableTwoFactor = async (...args) => {
|
|
39742
|
+
return client2.twoFactor.enable(...args);
|
|
39743
|
+
};
|
|
39744
|
+
const disableTwoFactor = async (...args) => {
|
|
39745
|
+
return client2.twoFactor.disable(...args);
|
|
39746
|
+
};
|
|
39747
|
+
const verifyTotp = async (...args) => {
|
|
39748
|
+
return client2.twoFactor.verifyTotp(...args);
|
|
39749
|
+
};
|
|
39750
|
+
const verifyBackupCode = async (...args) => {
|
|
39751
|
+
return client2.twoFactor.verifyBackupCode(...args);
|
|
39752
|
+
};
|
|
39753
|
+
const addPasskey = async (...args) => {
|
|
39754
|
+
return client2.passkey.addPasskey(...args);
|
|
39755
|
+
};
|
|
39756
|
+
const signInPasskey = async (...args) => {
|
|
39757
|
+
return client2.signIn.passkey(...args);
|
|
39758
|
+
};
|
|
39759
|
+
const deletePasskey = async (...args) => {
|
|
39760
|
+
return client2.passkey.deletePasskey(...args);
|
|
39761
|
+
};
|
|
39762
|
+
const listPasskeys = async () => {
|
|
39763
|
+
return client2.$fetch("/passkey/list-user-passkeys", { method: "GET" });
|
|
39764
|
+
};
|
|
39765
|
+
const signInMagicLink = async (...args) => {
|
|
39766
|
+
return client2.signIn.magicLink(...args);
|
|
38634
39767
|
};
|
|
38635
39768
|
return {
|
|
38636
|
-
getAuthClient,
|
|
39769
|
+
getAuthClient: () => client2,
|
|
38637
39770
|
signInEmail,
|
|
38638
39771
|
signUpEmail,
|
|
38639
39772
|
signOut,
|
|
@@ -38657,10 +39790,19 @@ const getAuthAPI = (intlayerConfig) => {
|
|
|
38657
39790
|
getAccessToken,
|
|
38658
39791
|
accountInfo,
|
|
38659
39792
|
updateUser,
|
|
38660
|
-
listSessions
|
|
38661
|
-
|
|
38662
|
-
|
|
38663
|
-
|
|
39793
|
+
listSessions,
|
|
39794
|
+
enableTwoFactor,
|
|
39795
|
+
disableTwoFactor,
|
|
39796
|
+
verifyTotp,
|
|
39797
|
+
verifyBackupCode,
|
|
39798
|
+
addPasskey,
|
|
39799
|
+
signInPasskey,
|
|
39800
|
+
deletePasskey,
|
|
39801
|
+
listPasskeys,
|
|
39802
|
+
signInMagicLink
|
|
39803
|
+
};
|
|
39804
|
+
};
|
|
39805
|
+
function useSession(sessionProp, intlayerConfiguration) {
|
|
38664
39806
|
const configuration$1 = useConfiguration();
|
|
38665
39807
|
const config2 = intlayerConfiguration ?? configuration$1 ?? configuration;
|
|
38666
39808
|
const queryClient = useQueryClient();
|
|
@@ -38677,7 +39819,9 @@ const useSession = (sessionProp, intlayerConfiguration) => {
|
|
|
38677
39819
|
enabled: !sessionProp
|
|
38678
39820
|
});
|
|
38679
39821
|
const session = data ?? (isFetched ? null : void 0);
|
|
38680
|
-
const setSession = (nextSession) =>
|
|
39822
|
+
const setSession = (nextSession) => {
|
|
39823
|
+
queryClient.setQueryData(["session"], nextSession);
|
|
39824
|
+
};
|
|
38681
39825
|
const fetchSession = async () => {
|
|
38682
39826
|
return (await refetch()).data;
|
|
38683
39827
|
};
|
|
@@ -38687,7 +39831,7 @@ const useSession = (sessionProp, intlayerConfiguration) => {
|
|
|
38687
39831
|
revalidateSession: fetchSession,
|
|
38688
39832
|
setSession
|
|
38689
39833
|
};
|
|
38690
|
-
}
|
|
39834
|
+
}
|
|
38691
39835
|
const useAuth = ({ session: sessionProp, intlayerConfiguration } = {}) => {
|
|
38692
39836
|
const { session, fetchSession, revalidateSession, setSession } = useSession(sessionProp, intlayerConfiguration);
|
|
38693
39837
|
const { oAuth2AccessToken } = useOAuth2(intlayerConfiguration);
|
|
@@ -39117,7 +40261,7 @@ const MultiSelectRoot = ({ values: valuesProp, defaultValues, onValueChange, loo
|
|
|
39117
40261
|
]),
|
|
39118
40262
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(CommandRoot, {
|
|
39119
40263
|
onKeyDown: handleKeyDown,
|
|
39120
|
-
className: cn$
|
|
40264
|
+
className: cn$2("flex w-full flex-col gap-2 overflow-visible bg-transparent", className),
|
|
39121
40265
|
dir,
|
|
39122
40266
|
...props,
|
|
39123
40267
|
children
|
|
@@ -39131,12 +40275,12 @@ const MultiSelectTrigger = ({ className, getBadgeValue = (value$1) => value$1, v
|
|
|
39131
40275
|
e.stopPropagation();
|
|
39132
40276
|
}, []);
|
|
39133
40277
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
39134
|
-
className: cn$
|
|
40278
|
+
className: cn$2("flex w-full flex-col gap-3", "cursor-pointer select-text text-base shadow-none outline-none md:text-sm", "rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl", "px-2 py-3 md:py-2", "bg-neutral-50 dark:bg-neutral-950", "text-text", "ring-0", "focus-within:outline-none", "focus-within:ring-3", "focus-within:ring-neutral-200", "dark:focus-within:ring-neutral-500", "focus-within:ring-offset-white", "dark:focus-within:ring-offset-neutral-500", "[box-shadow:none]", "disabled:cursor-not-allowed disabled:opacity-50", "aria-invalid:border-error", validationStyleEnabled && "valid:border-success invalid:border-error", className),
|
|
39135
40279
|
...props,
|
|
39136
40280
|
children: [value.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
39137
40281
|
className: "flex w-full flex-wrap gap-1",
|
|
39138
40282
|
children: value.map((item, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Badge, {
|
|
39139
|
-
className: cn$
|
|
40283
|
+
className: cn$2("flex items-center gap-1 rounded-xl px-1", activeIndex === index2 && "ring-2 ring-muted-foreground"),
|
|
39140
40284
|
color: BadgeColor.TEXT,
|
|
39141
40285
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
39142
40286
|
className: "text-xs",
|
|
@@ -39171,7 +40315,7 @@ const MultiSelectInput = ({ className, ...props }) => {
|
|
|
39171
40315
|
onBlur: () => setOpen(false),
|
|
39172
40316
|
onFocus: () => setOpen(true),
|
|
39173
40317
|
onClick: () => setActiveIndex(-1),
|
|
39174
|
-
className: cn$
|
|
40318
|
+
className: cn$2("ml-2 flex-1 cursor-pointer outline-hidden", className, activeIndex !== -1 && "caret-transparent")
|
|
39175
40319
|
});
|
|
39176
40320
|
};
|
|
39177
40321
|
const MultiSelectContent = ({ children }) => {
|
|
@@ -39182,7 +40326,7 @@ const MultiSelectContent = ({ children }) => {
|
|
|
39182
40326
|
});
|
|
39183
40327
|
};
|
|
39184
40328
|
const MultiSelectList = ({ className, children }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Command.List, {
|
|
39185
|
-
className: cn$
|
|
40329
|
+
className: cn$2("absolute top-0 z-10 flex w-full flex-col gap-2", "rounded-xl p-2 shadow-md", "bg-white dark:bg-neutral-950", "text-text", "border border-neutral-200 dark:border-neutral-800", "transition-colors", className),
|
|
39186
40330
|
children: [children, /* @__PURE__ */ jsxRuntimeExports.jsx(Command.Empty, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
39187
40331
|
className: "text-muted-foreground",
|
|
39188
40332
|
children: "No results found"
|
|
@@ -39201,7 +40345,7 @@ const MultiSelectItem = ({ className, value, children, ...props }) => {
|
|
|
39201
40345
|
onValueChange(value);
|
|
39202
40346
|
setInputValue("");
|
|
39203
40347
|
},
|
|
39204
|
-
className: cn$
|
|
40348
|
+
className: cn$2("flex cursor-pointer justify-between", "rounded-lg px-2 py-1", "transition-colors", "hover:bg-neutral/10", isIncluded && "opacity-50", props.disabled && "cursor-not-allowed opacity-50", className),
|
|
39205
40349
|
onMouseDown: mousePreventDefault,
|
|
39206
40350
|
children: [children, isIncluded && /* @__PURE__ */ jsxRuntimeExports.jsx(Check, { className: "size-4" })]
|
|
39207
40351
|
});
|
|
@@ -40177,9 +41321,9 @@ function isTableElement(element) {
|
|
|
40177
41321
|
}
|
|
40178
41322
|
const topLayerSelectors = [":popover-open", ":modal"];
|
|
40179
41323
|
function isTopLayer(element) {
|
|
40180
|
-
return topLayerSelectors.some((
|
|
41324
|
+
return topLayerSelectors.some((selector2) => {
|
|
40181
41325
|
try {
|
|
40182
|
-
return element.matches(
|
|
41326
|
+
return element.matches(selector2);
|
|
40183
41327
|
} catch (_e2) {
|
|
40184
41328
|
return false;
|
|
40185
41329
|
}
|
|
@@ -42655,7 +43799,7 @@ const SelectRoot = Root2$1;
|
|
|
42655
43799
|
const SelectGroup = Group;
|
|
42656
43800
|
const SelectValue = Value;
|
|
42657
43801
|
const SelectTrigger = ({ validationStyleEnabled = false, className, children, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Trigger$1, {
|
|
42658
|
-
className: cn$
|
|
43802
|
+
className: cn$2("flex w-full cursor-pointer items-center justify-between whitespace-nowrap", "select-text text-base shadow-none outline-none md:text-sm", "rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl", "px-2 py-3 md:py-2", "bg-neutral-50 dark:bg-neutral-950", "text-text", "ring-0", "focus-visible:outline-none", "focus-visible:ring-3", "focus-visible:ring-neutral-200", "dark:focus-visible:ring-neutral-500", "focus-visible:ring-offset-white", "dark:focus-visible:ring-offset-neutral-500", "[box-shadow:none] focus:[box-shadow:none]", "disabled:cursor-not-allowed disabled:opacity-50", "aria-invalid:border-error", "[&>span]:line-clamp-1", validationStyleEnabled && "valid:border-success invalid:border-error", className),
|
|
42659
43803
|
...props,
|
|
42660
43804
|
children: [children, /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, {
|
|
42661
43805
|
asChild: true,
|
|
@@ -42663,34 +43807,34 @@ const SelectTrigger = ({ validationStyleEnabled = false, className, children, ..
|
|
|
42663
43807
|
})]
|
|
42664
43808
|
});
|
|
42665
43809
|
const SelectScrollUpButton = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollUpButton, {
|
|
42666
|
-
className: cn$
|
|
43810
|
+
className: cn$2("flex cursor-default items-center justify-center py-1", className),
|
|
42667
43811
|
...props,
|
|
42668
43812
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronUp, {})
|
|
42669
43813
|
});
|
|
42670
43814
|
const SelectScrollDownButton = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollDownButton, {
|
|
42671
|
-
className: cn$
|
|
43815
|
+
className: cn$2("flex cursor-default items-center justify-center py-1", className),
|
|
42672
43816
|
...props,
|
|
42673
43817
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, {})
|
|
42674
43818
|
});
|
|
42675
43819
|
const SelectContent = ({ className, children, position = SelectContentPosition.POPPER, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Portal, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Content2, {
|
|
42676
|
-
className: cn$
|
|
43820
|
+
className: cn$2("relative z-50 max-h-96 min-w-32 overflow-hidden", "rounded-xl shadow-md", "bg-white dark:bg-neutral-950", "text-text", "border border-neutral-200 dark:border-neutral-800", "data-[state=closed]:animate-out data-[state=open]:animate-in", "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95", "data-[side=bottom]:slide-in-from-top-2", "data-[side=left]:slide-in-from-right-2", "data-[side=right]:slide-in-from-left-2", "data-[side=top]:slide-in-from-bottom-2", position === "popper" && "data-[side=left]:-translate-x-1 data-[side=top]:-translate-y-1 data-[side=right]:translate-x-1 data-[side=bottom]:translate-y-1", className),
|
|
42677
43821
|
position,
|
|
42678
43822
|
...props,
|
|
42679
43823
|
children: [
|
|
42680
43824
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectScrollUpButton, {}),
|
|
42681
43825
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Viewport$1, {
|
|
42682
|
-
className: cn$
|
|
43826
|
+
className: cn$2("p-1", position === "popper" && "h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"),
|
|
42683
43827
|
children
|
|
42684
43828
|
}),
|
|
42685
43829
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectScrollDownButton, {})
|
|
42686
43830
|
]
|
|
42687
43831
|
}) });
|
|
42688
43832
|
const SelectLabel = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Label, {
|
|
42689
|
-
className: cn$
|
|
43833
|
+
className: cn$2("px-1 py-0.5 font-semibold text-sm", className),
|
|
42690
43834
|
...props
|
|
42691
43835
|
});
|
|
42692
43836
|
const SelectItem = ({ className, children, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Item, {
|
|
42693
|
-
className: cn$
|
|
43837
|
+
className: cn$2("relative flex w-full cursor-pointer select-none items-center rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden focus:bg-neutral/10 data-disabled:pointer-events-none data-disabled:opacity-50", className),
|
|
42694
43838
|
...props,
|
|
42695
43839
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
42696
43840
|
className: "absolute right-2 flex size-3.5 items-center justify-center",
|
|
@@ -42698,7 +43842,7 @@ const SelectItem = ({ className, children, ...props }) => /* @__PURE__ */ jsxRun
|
|
|
42698
43842
|
}), /* @__PURE__ */ jsxRuntimeExports.jsx(ItemText, { children })]
|
|
42699
43843
|
});
|
|
42700
43844
|
const SelectSeparator = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Separator, {
|
|
42701
|
-
className: cn$
|
|
43845
|
+
className: cn$2("-mx-1 my-1 h-px", "bg-neutral-200 dark:bg-neutral-800", className),
|
|
42702
43846
|
...props
|
|
42703
43847
|
});
|
|
42704
43848
|
const Select = SelectRoot;
|
|
@@ -42712,14 +43856,17 @@ Select.Label = SelectLabel;
|
|
|
42712
43856
|
Select.Item = SelectItem;
|
|
42713
43857
|
Select.Separator = SelectSeparator;
|
|
42714
43858
|
const selectorDefault = (option) => option?.getAttribute("aria-selected") === "true";
|
|
42715
|
-
const useItemSelector = (optionsRefs, selector = selectorDefault, isHoverable = false
|
|
43859
|
+
const useItemSelector = (optionsRefs, { selector: selector2 = selectorDefault, isHoverable = false } = {
|
|
43860
|
+
selector: selectorDefault,
|
|
43861
|
+
isHoverable: false
|
|
43862
|
+
}) => {
|
|
42716
43863
|
const [choiceIndicatorPosition, setChoiceIndicatorPosition] = reactExports.useState(null);
|
|
42717
43864
|
const [hoveredItem, setHoveredItem] = reactExports.useState(null);
|
|
42718
43865
|
const itemsLength = optionsRefs.current.length;
|
|
42719
43866
|
const calculatePosition = () => {
|
|
42720
43867
|
let targetElement = null;
|
|
42721
43868
|
if (hoveredItem) targetElement = hoveredItem;
|
|
42722
|
-
else targetElement = optionsRefs.current.find(
|
|
43869
|
+
else targetElement = optionsRefs.current.find(selector2) ?? null;
|
|
42723
43870
|
if (!targetElement) {
|
|
42724
43871
|
setChoiceIndicatorPosition((prev) => ({
|
|
42725
43872
|
left: 0,
|
|
@@ -42766,7 +43913,7 @@ const useItemSelector = (optionsRefs, selector = selectorDefault, isHoverable =
|
|
|
42766
43913
|
resizeObserver.observe(element);
|
|
42767
43914
|
resizeObservers.push(resizeObserver);
|
|
42768
43915
|
};
|
|
42769
|
-
const selectedItem = optionsRefs.current.find(
|
|
43916
|
+
const selectedItem = optionsRefs.current.find(selector2) ?? null;
|
|
42770
43917
|
if (selectedItem) observeSize(selectedItem);
|
|
42771
43918
|
if (hoveredItem) observeSize(hoveredItem);
|
|
42772
43919
|
const handleMouseEnter = (event) => {
|
|
@@ -42795,7 +43942,7 @@ const useItemSelector = (optionsRefs, selector = selectorDefault, isHoverable =
|
|
|
42795
43942
|
};
|
|
42796
43943
|
}, [
|
|
42797
43944
|
optionsRefs,
|
|
42798
|
-
|
|
43945
|
+
selector2,
|
|
42799
43946
|
hoveredItem,
|
|
42800
43947
|
itemsLength
|
|
42801
43948
|
]);
|
|
@@ -42821,17 +43968,17 @@ let SwitchSelectorColor = /* @__PURE__ */ (function(SwitchSelectorColor$1) {
|
|
|
42821
43968
|
SwitchSelectorColor$1["TEXT"] = "text";
|
|
42822
43969
|
return SwitchSelectorColor$1;
|
|
42823
43970
|
})({});
|
|
42824
|
-
const switchSelectorVariant = cva("flex w-fit flex-row gap-2 rounded-full border-[1.5px] p-[1.5px]", {
|
|
43971
|
+
const switchSelectorVariant = cva("flex w-fit cursor-pointer flex-row gap-2 rounded-full border-[1.5px] p-[1.5px]", {
|
|
42825
43972
|
variants: { color: {
|
|
42826
|
-
[SwitchSelectorColor.PRIMARY]: "border-primary text-primary",
|
|
42827
|
-
[SwitchSelectorColor.SECONDARY]: "border-secondary text-secondary",
|
|
42828
|
-
[SwitchSelectorColor.DESTRUCTIVE]: "border-destructive bg-destructive text-destructive",
|
|
42829
|
-
[SwitchSelectorColor.NEUTRAL]: "border-neutral text-neutral",
|
|
42830
|
-
[SwitchSelectorColor.LIGHT]: "border-white text-white",
|
|
42831
|
-
[SwitchSelectorColor.DARK]: "border-neutral-800 text-neutral-800",
|
|
42832
|
-
[SwitchSelectorColor.TEXT]: "border-text text-text"
|
|
43973
|
+
[`${SwitchSelectorColor.PRIMARY}`]: "border-primary text-primary",
|
|
43974
|
+
[`${SwitchSelectorColor.SECONDARY}`]: "border-secondary text-secondary",
|
|
43975
|
+
[`${SwitchSelectorColor.DESTRUCTIVE}`]: "border-destructive bg-destructive text-destructive",
|
|
43976
|
+
[`${SwitchSelectorColor.NEUTRAL}`]: "border-neutral text-neutral",
|
|
43977
|
+
[`${SwitchSelectorColor.LIGHT}`]: "border-white text-white",
|
|
43978
|
+
[`${SwitchSelectorColor.DARK}`]: "border-neutral-800 text-neutral-800",
|
|
43979
|
+
[`${SwitchSelectorColor.TEXT}`]: "border-text text-text"
|
|
42833
43980
|
} },
|
|
42834
|
-
defaultVariants: { color: SwitchSelectorColor.PRIMARY }
|
|
43981
|
+
defaultVariants: { color: `${SwitchSelectorColor.PRIMARY}` }
|
|
42835
43982
|
});
|
|
42836
43983
|
let SwitchSelectorSize = /* @__PURE__ */ (function(SwitchSelectorSize$1) {
|
|
42837
43984
|
SwitchSelectorSize$1["SM"] = "sm";
|
|
@@ -42839,28 +43986,31 @@ let SwitchSelectorSize = /* @__PURE__ */ (function(SwitchSelectorSize$1) {
|
|
|
42839
43986
|
SwitchSelectorSize$1["LG"] = "lg";
|
|
42840
43987
|
return SwitchSelectorSize$1;
|
|
42841
43988
|
})({});
|
|
42842
|
-
const choiceVariant = cva("z-1 w-full flex-1 cursor-pointer font-medium text-sm transition-all duration-300 ease-in-out aria-selected:cursor-default
|
|
43989
|
+
const choiceVariant = cva("z-1 w-full flex-1 cursor-pointer font-medium text-sm transition-all duration-300 ease-in-out aria-selected:cursor-default data-[indicator=true]:text-text-opposite motion-reduce:transition-none", {
|
|
42843
43990
|
variants: { size: {
|
|
42844
|
-
[SwitchSelectorSize.SM]: "px-2 py-1 text-xs",
|
|
42845
|
-
[SwitchSelectorSize.MD]: "p-2 text-sm",
|
|
42846
|
-
[SwitchSelectorSize.LG]: "p-4 text-base"
|
|
43991
|
+
[`${SwitchSelectorSize.SM}`]: "px-2 py-1 text-xs",
|
|
43992
|
+
[`${SwitchSelectorSize.MD}`]: "p-2 text-sm",
|
|
43993
|
+
[`${SwitchSelectorSize.LG}`]: "p-4 text-base"
|
|
42847
43994
|
} },
|
|
42848
|
-
defaultVariants: { size: SwitchSelectorSize.MD }
|
|
43995
|
+
defaultVariants: { size: `${SwitchSelectorSize.MD}` }
|
|
42849
43996
|
});
|
|
42850
43997
|
const indicatorVariant$1 = cva("absolute top-0 z-[-1] h-full w-auto rounded-full transition-[left,width] duration-300 ease-in-out motion-reduce:transition-none", { variants: { color: {
|
|
42851
|
-
[SwitchSelectorColor.PRIMARY]: "bg-primary
|
|
42852
|
-
[SwitchSelectorColor.SECONDARY]: "bg-secondary
|
|
42853
|
-
[SwitchSelectorColor.DESTRUCTIVE]: "bg-destructive
|
|
42854
|
-
[SwitchSelectorColor.NEUTRAL]: "bg-neutral
|
|
42855
|
-
[SwitchSelectorColor.LIGHT]: "bg-white
|
|
42856
|
-
[SwitchSelectorColor.DARK]: "bg-neutral-800
|
|
42857
|
-
[SwitchSelectorColor.TEXT]: "bg-text
|
|
43998
|
+
[`${SwitchSelectorColor.PRIMARY}`]: "bg-primary data-[indicator=true]:text-text",
|
|
43999
|
+
[`${SwitchSelectorColor.SECONDARY}`]: "bg-secondary data-[indicator=true]:text-text",
|
|
44000
|
+
[`${SwitchSelectorColor.DESTRUCTIVE}`]: "bg-destructive data-[indicator=true]:text-text",
|
|
44001
|
+
[`${SwitchSelectorColor.NEUTRAL}`]: "bg-neutral data-[indicator=true]:text-white",
|
|
44002
|
+
[`${SwitchSelectorColor.LIGHT}`]: "bg-white data-[indicator=true]:text-black",
|
|
44003
|
+
[`${SwitchSelectorColor.DARK}`]: "bg-neutral-800 data-[indicator=true]:text-white",
|
|
44004
|
+
[`${SwitchSelectorColor.TEXT}`]: "bg-text data-[indicator=true]:text-text-opposite"
|
|
42858
44005
|
} } });
|
|
42859
|
-
const SwitchSelector = ({ choices = defaultChoices, value, defaultValue, onChange, color: color2 = SwitchSelectorColor.PRIMARY, size: size2 = SwitchSelectorSize.MD, className }) => {
|
|
44006
|
+
const SwitchSelector = ({ choices = defaultChoices, value, defaultValue, onChange, color: color2 = SwitchSelectorColor.PRIMARY, size: size2 = SwitchSelectorSize.MD, className, hoverable = true }) => {
|
|
42860
44007
|
const [valueState, setValue] = reactExports.useState(value ?? defaultValue ?? choices[0].value);
|
|
44008
|
+
const [hoveredIndex, setHoveredIndex] = reactExports.useState(null);
|
|
42861
44009
|
const optionsRefs = reactExports.useRef([]);
|
|
42862
44010
|
const indicatorRef = reactExports.useRef(null);
|
|
42863
|
-
const { choiceIndicatorPosition } = useItemSelector(optionsRefs);
|
|
44011
|
+
const { choiceIndicatorPosition } = useItemSelector(optionsRefs, { isHoverable: hoverable });
|
|
44012
|
+
const selectedIndex = choices.findIndex((choice) => choice.value === valueState);
|
|
44013
|
+
const indicatorIndex = hoverable && hoveredIndex !== null ? hoveredIndex : selectedIndex;
|
|
42864
44014
|
const handleChange = (newValue) => {
|
|
42865
44015
|
setValue(newValue);
|
|
42866
44016
|
onChange?.(newValue);
|
|
@@ -42880,21 +44030,26 @@ const SwitchSelector = ({ choices = defaultChoices, value, defaultValue, onChang
|
|
|
42880
44030
|
children: [choices.map((choice, index2) => {
|
|
42881
44031
|
const { content: content2, value: value$1, ...buttonProps } = choice;
|
|
42882
44032
|
const isKeyOfKey = typeof value$1 === "string" || typeof value$1 === "number";
|
|
42883
|
-
const isSelected =
|
|
44033
|
+
const isSelected = index2 === selectedIndex;
|
|
44034
|
+
const isIndicatorOwner = index2 === indicatorIndex;
|
|
42884
44035
|
return /* @__PURE__ */ reactExports.createElement("button", {
|
|
42885
44036
|
...buttonProps,
|
|
42886
|
-
className: cn$
|
|
44037
|
+
className: cn$2(choiceVariant({ size: size2 })),
|
|
42887
44038
|
key: isKeyOfKey ? value$1 : index2,
|
|
42888
44039
|
role: "tab",
|
|
42889
44040
|
onClick: () => handleChange(value$1),
|
|
42890
|
-
"aria-selected": isSelected,
|
|
44041
|
+
"aria-selected": isSelected ? "true" : void 0,
|
|
44042
|
+
"data-indicator": isIndicatorOwner ? "true" : void 0,
|
|
42891
44043
|
disabled: isSelected,
|
|
44044
|
+
tabIndex: isSelected ? 0 : -1,
|
|
42892
44045
|
ref: (el) => {
|
|
42893
44046
|
optionsRefs.current[index2] = el;
|
|
42894
|
-
}
|
|
44047
|
+
},
|
|
44048
|
+
onMouseEnter: () => setHoveredIndex(index2),
|
|
44049
|
+
onMouseLeave: () => setHoveredIndex(null)
|
|
42895
44050
|
}, content2);
|
|
42896
44051
|
}), choiceIndicatorPosition && /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
42897
|
-
className: cn$
|
|
44052
|
+
className: cn$2(indicatorVariant$1({ color: color2 })),
|
|
42898
44053
|
style: choiceIndicatorPosition,
|
|
42899
44054
|
ref: indicatorRef
|
|
42900
44055
|
})]
|
|
@@ -45406,7 +46561,7 @@ const Form$1 = ({ schema, onSubmit: onSubmitProp, onSubmitSuccess: onSubmitSucce
|
|
|
45406
46561
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(FormProvider, {
|
|
45407
46562
|
...props,
|
|
45408
46563
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("form", {
|
|
45409
|
-
className: cn$
|
|
46564
|
+
className: cn$2("flex size-full flex-col gap-y-6", className),
|
|
45410
46565
|
onSubmit: props.handleSubmit(onSubmit),
|
|
45411
46566
|
autoComplete: autoComplete ? "on" : "off",
|
|
45412
46567
|
noValidate: true,
|
|
@@ -45431,7 +46586,7 @@ const useForm = (schema, props) => {
|
|
|
45431
46586
|
const FormLabel = ({ className, ...props }) => {
|
|
45432
46587
|
const { error, formItemId } = useFormField();
|
|
45433
46588
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, {
|
|
45434
|
-
className: cn$
|
|
46589
|
+
className: cn$2("mb-2", error && "text-error", className),
|
|
45435
46590
|
htmlFor: formItemId,
|
|
45436
46591
|
...props
|
|
45437
46592
|
});
|
|
@@ -45450,8 +46605,7 @@ const FormLabelLayout = ({ children, isRequired, info, htmlFor, className }) =>
|
|
|
45450
46605
|
}), info && /* @__PURE__ */ jsxRuntimeExports.jsx(InformationTag, { content: info })]
|
|
45451
46606
|
});
|
|
45452
46607
|
const FormItemLayout = ({ label, description, isRequired, info, children, showErrorMessage = true, htmlFor }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Form.Item, {
|
|
45453
|
-
|
|
45454
|
-
className: "flex w-full flex-col gap-2 p-2",
|
|
46608
|
+
className: "flex w-full flex-col gap-2 px-1 py-2",
|
|
45455
46609
|
children: [
|
|
45456
46610
|
(description || label) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
45457
46611
|
className: "flex flex-col gap-1 p-1 leading-none",
|
|
@@ -45540,6 +46694,111 @@ const InputPasswordElement = ({ autoComplete, ...props }) => /* @__PURE__ */ jsx
|
|
|
45540
46694
|
maxLength: 255,
|
|
45541
46695
|
...props
|
|
45542
46696
|
});
|
|
46697
|
+
const selector = (option) => option?.getAttribute("aria-active") === "true";
|
|
46698
|
+
const OTPFieldContent = ({ field, name, label, description, isRequired, info, showErrorMessage, children, slots = 6, maxLength = 6, ...props }) => {
|
|
46699
|
+
const { error } = useFormField();
|
|
46700
|
+
const optionsRefs = reactExports.useRef([]);
|
|
46701
|
+
const indicatorRef = reactExports.useRef(null);
|
|
46702
|
+
const { choiceIndicatorPosition, calculatePosition } = useItemSelector(optionsRefs, {
|
|
46703
|
+
selector,
|
|
46704
|
+
isHoverable: true
|
|
46705
|
+
});
|
|
46706
|
+
reactExports.useEffect(() => {
|
|
46707
|
+
calculatePosition();
|
|
46708
|
+
}, []);
|
|
46709
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(FormItemLayout, {
|
|
46710
|
+
htmlFor: name,
|
|
46711
|
+
label,
|
|
46712
|
+
description,
|
|
46713
|
+
isRequired,
|
|
46714
|
+
info,
|
|
46715
|
+
showErrorMessage,
|
|
46716
|
+
"aria-invalid": !!error,
|
|
46717
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(InputOTP, {
|
|
46718
|
+
onChange: field.onChange,
|
|
46719
|
+
defaultValue: field.value,
|
|
46720
|
+
maxLength,
|
|
46721
|
+
pattern: "^[0-9]+$",
|
|
46722
|
+
onActiveSlotChange: calculatePosition,
|
|
46723
|
+
...props,
|
|
46724
|
+
children: children ?? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
46725
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(InputOTPGroup, { children: [
|
|
46726
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(InputOTPSlot, {
|
|
46727
|
+
index: 0,
|
|
46728
|
+
ref: (el) => {
|
|
46729
|
+
optionsRefs.current[0] = el;
|
|
46730
|
+
}
|
|
46731
|
+
}),
|
|
46732
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(InputOTPSlot, {
|
|
46733
|
+
index: 1,
|
|
46734
|
+
ref: (el) => {
|
|
46735
|
+
optionsRefs.current[1] = el;
|
|
46736
|
+
}
|
|
46737
|
+
}),
|
|
46738
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(InputOTPSlot, {
|
|
46739
|
+
index: 2,
|
|
46740
|
+
ref: (el) => {
|
|
46741
|
+
optionsRefs.current[2] = el;
|
|
46742
|
+
}
|
|
46743
|
+
})
|
|
46744
|
+
] }),
|
|
46745
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(InputOTPSeparator, {}),
|
|
46746
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(InputOTPGroup, { children: [
|
|
46747
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(InputOTPSlot, {
|
|
46748
|
+
index: 3,
|
|
46749
|
+
ref: (el) => {
|
|
46750
|
+
optionsRefs.current[3] = el;
|
|
46751
|
+
}
|
|
46752
|
+
}),
|
|
46753
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(InputOTPSlot, {
|
|
46754
|
+
index: 4,
|
|
46755
|
+
ref: (el) => {
|
|
46756
|
+
optionsRefs.current[4] = el;
|
|
46757
|
+
}
|
|
46758
|
+
}),
|
|
46759
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(InputOTPSlot, {
|
|
46760
|
+
index: 5,
|
|
46761
|
+
ref: (el) => {
|
|
46762
|
+
optionsRefs.current[5] = el;
|
|
46763
|
+
}
|
|
46764
|
+
})
|
|
46765
|
+
] }),
|
|
46766
|
+
choiceIndicatorPosition && /* @__PURE__ */ jsxRuntimeExports.jsx(InputIndicator, {
|
|
46767
|
+
style: choiceIndicatorPosition,
|
|
46768
|
+
ref: indicatorRef
|
|
46769
|
+
})
|
|
46770
|
+
] })
|
|
46771
|
+
})
|
|
46772
|
+
});
|
|
46773
|
+
};
|
|
46774
|
+
const OTPElement = ({ name, description, label, isRequired, info, showErrorMessage, children, slots = 6, maxLength = 6, ...props }) => {
|
|
46775
|
+
const { control } = useFormContext();
|
|
46776
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Form.Field, {
|
|
46777
|
+
control,
|
|
46778
|
+
name,
|
|
46779
|
+
render: ({ field }) => /* @__PURE__ */ jsxRuntimeExports.jsx(OTPFieldContent, {
|
|
46780
|
+
field,
|
|
46781
|
+
name,
|
|
46782
|
+
label,
|
|
46783
|
+
description,
|
|
46784
|
+
isRequired,
|
|
46785
|
+
info,
|
|
46786
|
+
showErrorMessage,
|
|
46787
|
+
slots,
|
|
46788
|
+
maxLength,
|
|
46789
|
+
...props,
|
|
46790
|
+
children
|
|
46791
|
+
})
|
|
46792
|
+
});
|
|
46793
|
+
};
|
|
46794
|
+
const SearchInputElement = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(FormElement, {
|
|
46795
|
+
id: props.name,
|
|
46796
|
+
"data-testid": props.name,
|
|
46797
|
+
Element: SearchInput,
|
|
46798
|
+
"aria-labelledby": props.label ? `${props.name}-label` : void 0,
|
|
46799
|
+
"aria-label": props.label ? void 0 : props.name,
|
|
46800
|
+
...props
|
|
46801
|
+
});
|
|
45543
46802
|
const TextAreaElement = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(FormElement, {
|
|
45544
46803
|
Element: TextArea,
|
|
45545
46804
|
id: props.name,
|
|
@@ -45567,29 +46826,58 @@ const CheckboxElement = ({ autoComplete, ...props }) => /* @__PURE__ */ jsxRunti
|
|
|
45567
46826
|
maxLength: 255,
|
|
45568
46827
|
...props
|
|
45569
46828
|
});
|
|
46829
|
+
const MultiSelectFieldContent = ({ field, name, label, description, isRequired, info, showErrorMessage, children, ...props }) => {
|
|
46830
|
+
const { error } = useFormField();
|
|
46831
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(FormItemLayout, {
|
|
46832
|
+
htmlFor: name,
|
|
46833
|
+
label,
|
|
46834
|
+
description,
|
|
46835
|
+
isRequired,
|
|
46836
|
+
info,
|
|
46837
|
+
showErrorMessage,
|
|
46838
|
+
"aria-invalid": !!error,
|
|
46839
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(MultiSelect, {
|
|
46840
|
+
onValueChange: field.onChange,
|
|
46841
|
+
values: field.value,
|
|
46842
|
+
...props,
|
|
46843
|
+
children
|
|
46844
|
+
})
|
|
46845
|
+
});
|
|
46846
|
+
};
|
|
45570
46847
|
const MultiSelectElement = ({ name, description, label, isRequired, info, showErrorMessage, children, ...props }) => {
|
|
45571
46848
|
const { control } = useFormContext();
|
|
45572
46849
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Form.Field, {
|
|
45573
46850
|
control,
|
|
45574
46851
|
name,
|
|
45575
|
-
render: ({ field }) => {
|
|
45576
|
-
|
|
45577
|
-
|
|
45578
|
-
|
|
45579
|
-
|
|
45580
|
-
|
|
45581
|
-
|
|
45582
|
-
|
|
45583
|
-
|
|
45584
|
-
|
|
45585
|
-
|
|
45586
|
-
|
|
45587
|
-
|
|
45588
|
-
|
|
45589
|
-
|
|
45590
|
-
|
|
45591
|
-
|
|
45592
|
-
|
|
46852
|
+
render: ({ field }) => /* @__PURE__ */ jsxRuntimeExports.jsx(MultiSelectFieldContent, {
|
|
46853
|
+
field,
|
|
46854
|
+
name,
|
|
46855
|
+
label,
|
|
46856
|
+
description,
|
|
46857
|
+
isRequired,
|
|
46858
|
+
info,
|
|
46859
|
+
showErrorMessage,
|
|
46860
|
+
...props,
|
|
46861
|
+
children
|
|
46862
|
+
})
|
|
46863
|
+
});
|
|
46864
|
+
};
|
|
46865
|
+
const SelectFieldContent = ({ field, name, label, description, isRequired, info, showErrorMessage, children, ...props }) => {
|
|
46866
|
+
const { error } = useFormField();
|
|
46867
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(FormItemLayout, {
|
|
46868
|
+
htmlFor: name,
|
|
46869
|
+
label,
|
|
46870
|
+
description,
|
|
46871
|
+
isRequired,
|
|
46872
|
+
info,
|
|
46873
|
+
showErrorMessage,
|
|
46874
|
+
"aria-invalid": !!error,
|
|
46875
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Select, {
|
|
46876
|
+
onValueChange: field.onChange,
|
|
46877
|
+
defaultValue: field.value,
|
|
46878
|
+
...props,
|
|
46879
|
+
children
|
|
46880
|
+
})
|
|
45593
46881
|
});
|
|
45594
46882
|
};
|
|
45595
46883
|
const SelectElement = ({ name, description, label, isRequired, info, showErrorMessage, children, ...props }) => {
|
|
@@ -45597,24 +46885,34 @@ const SelectElement = ({ name, description, label, isRequired, info, showErrorMe
|
|
|
45597
46885
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Form.Field, {
|
|
45598
46886
|
control,
|
|
45599
46887
|
name,
|
|
45600
|
-
render: ({ field }) => {
|
|
45601
|
-
|
|
45602
|
-
|
|
45603
|
-
|
|
45604
|
-
|
|
45605
|
-
|
|
45606
|
-
|
|
45607
|
-
|
|
45608
|
-
|
|
45609
|
-
|
|
45610
|
-
|
|
45611
|
-
|
|
45612
|
-
|
|
45613
|
-
|
|
45614
|
-
|
|
45615
|
-
|
|
45616
|
-
|
|
45617
|
-
|
|
46888
|
+
render: ({ field }) => /* @__PURE__ */ jsxRuntimeExports.jsx(SelectFieldContent, {
|
|
46889
|
+
field,
|
|
46890
|
+
name,
|
|
46891
|
+
label,
|
|
46892
|
+
description,
|
|
46893
|
+
isRequired,
|
|
46894
|
+
info,
|
|
46895
|
+
showErrorMessage,
|
|
46896
|
+
...props,
|
|
46897
|
+
children
|
|
46898
|
+
})
|
|
46899
|
+
});
|
|
46900
|
+
};
|
|
46901
|
+
const SwitchSelectorFieldContent = ({ field, name, label, description, isRequired, info, showErrorMessage, children, ...props }) => {
|
|
46902
|
+
const { error } = useFormField();
|
|
46903
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(FormItemLayout, {
|
|
46904
|
+
htmlFor: name,
|
|
46905
|
+
label,
|
|
46906
|
+
description,
|
|
46907
|
+
isRequired,
|
|
46908
|
+
info,
|
|
46909
|
+
showErrorMessage,
|
|
46910
|
+
"aria-invalid": !!error,
|
|
46911
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(SwitchSelector, {
|
|
46912
|
+
...field,
|
|
46913
|
+
...props,
|
|
46914
|
+
children
|
|
46915
|
+
})
|
|
45618
46916
|
});
|
|
45619
46917
|
};
|
|
45620
46918
|
const SwitchSelectorElement = ({ name, description, label, isRequired, info, showErrorMessage, children, ...props }) => {
|
|
@@ -45622,23 +46920,17 @@ const SwitchSelectorElement = ({ name, description, label, isRequired, info, sho
|
|
|
45622
46920
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Form.Field, {
|
|
45623
46921
|
control,
|
|
45624
46922
|
name,
|
|
45625
|
-
render: ({ field }) => {
|
|
45626
|
-
|
|
45627
|
-
|
|
45628
|
-
|
|
45629
|
-
|
|
45630
|
-
|
|
45631
|
-
|
|
45632
|
-
|
|
45633
|
-
|
|
45634
|
-
|
|
45635
|
-
|
|
45636
|
-
...field,
|
|
45637
|
-
...props,
|
|
45638
|
-
children
|
|
45639
|
-
})
|
|
45640
|
-
});
|
|
45641
|
-
}
|
|
46923
|
+
render: ({ field }) => /* @__PURE__ */ jsxRuntimeExports.jsx(SwitchSelectorFieldContent, {
|
|
46924
|
+
field,
|
|
46925
|
+
name,
|
|
46926
|
+
label,
|
|
46927
|
+
description,
|
|
46928
|
+
isRequired,
|
|
46929
|
+
info,
|
|
46930
|
+
showErrorMessage,
|
|
46931
|
+
...props,
|
|
46932
|
+
children
|
|
46933
|
+
})
|
|
45642
46934
|
});
|
|
45643
46935
|
};
|
|
45644
46936
|
const FormControl = (props) => {
|
|
@@ -45689,6 +46981,8 @@ Form.MultiSelect = MultiSelectElement;
|
|
|
45689
46981
|
Form.EditableFieldInput = EditableFieldInputElement;
|
|
45690
46982
|
Form.EditableFieldTextArea = EditableFieldTextAreaElement;
|
|
45691
46983
|
Form.SwitchSelector = SwitchSelectorElement;
|
|
46984
|
+
Form.OTP = OTPElement;
|
|
46985
|
+
Form.SearchInput = SearchInputElement;
|
|
45692
46986
|
const SaveForm = ({ dictionary, mode, className, onDelete, onSave, ...props }) => {
|
|
45693
46987
|
const [isFormatAlertModalOpen, setIsFormatAlertModalOpen] = reactExports.useState(false);
|
|
45694
46988
|
const { setLocaleDictionary } = useDictionariesRecordActions();
|
|
@@ -45728,7 +47022,7 @@ const SaveForm = ({ dictionary, mode, className, onDelete, onSave, ...props }) =
|
|
|
45728
47022
|
};
|
|
45729
47023
|
const handleDeleteDictionary = () => {
|
|
45730
47024
|
if (!dictionary.id) return;
|
|
45731
|
-
deleteDictionary({ dictionaryId: dictionary.id
|
|
47025
|
+
deleteDictionary({ dictionaryId: dictionary.id }, { onSuccess: (res) => {
|
|
45732
47026
|
if (res) onDelete?.();
|
|
45733
47027
|
} });
|
|
45734
47028
|
};
|
|
@@ -45764,7 +47058,7 @@ const SaveForm = ({ dictionary, mode, className, onDelete, onSave, ...props }) =
|
|
|
45764
47058
|
})]
|
|
45765
47059
|
})
|
|
45766
47060
|
}), /* @__PURE__ */ jsxRuntimeExports.jsxs("form", {
|
|
45767
|
-
className: cn$
|
|
47061
|
+
className: cn$2("flex justify-end gap-2 max-md:flex-col", className),
|
|
45768
47062
|
...props,
|
|
45769
47063
|
children: [
|
|
45770
47064
|
mode.includes("remote") && isDistantDictionary && onDelete && isAuthenticated && /* @__PURE__ */ jsxRuntimeExports.jsx(Form.Button, {
|
|
@@ -45822,7 +47116,7 @@ const SaveForm = ({ dictionary, mode, className, onDelete, onSave, ...props }) =
|
|
|
45822
47116
|
})] });
|
|
45823
47117
|
};
|
|
45824
47118
|
const ItemLayout = ({ level, title, description, children, rightParam, isSelected, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
45825
|
-
className: cn$
|
|
47119
|
+
className: cn$2("rounded-md p-2 transition", "hover:bg-card/30 [&:has(.section:hover)]:bg-transparent", level === 2 && "hover:bg-card/30", level >= 3 && "", isSelected === true && "bg-card/40"),
|
|
45826
47120
|
...props,
|
|
45827
47121
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Accordion, {
|
|
45828
47122
|
isOpen: isSelected,
|
|
@@ -45832,7 +47126,7 @@ const ItemLayout = ({ level, title, description, children, rightParam, isSelecte
|
|
|
45832
47126
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
45833
47127
|
className: "flex w-full items-center justify-between",
|
|
45834
47128
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
45835
|
-
className: cn$
|
|
47129
|
+
className: cn$2(level === 0 && "text-lg", level === 1 && "text-md", level === 2 && "text-md", level >= 3 && "text-base"),
|
|
45836
47130
|
children: title
|
|
45837
47131
|
}), rightParam && /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
45838
47132
|
className: "flex w-auto items-center justify-between p-3",
|
|
@@ -45843,7 +47137,10 @@ const ItemLayout = ({ level, title, description, children, rightParam, isSelecte
|
|
|
45843
47137
|
children: description
|
|
45844
47138
|
})]
|
|
45845
47139
|
}),
|
|
45846
|
-
children
|
|
47140
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
47141
|
+
className: "size-full px-2",
|
|
47142
|
+
children
|
|
47143
|
+
})
|
|
45847
47144
|
})
|
|
45848
47145
|
});
|
|
45849
47146
|
const ArrayWrapper = (props) => {
|
|
@@ -45926,7 +47223,7 @@ const StringWrapper = ({ keyPath, section, editedContent, editedContentValue: ed
|
|
|
45926
47223
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
45927
47224
|
role: "button",
|
|
45928
47225
|
tabIndex: 0,
|
|
45929
|
-
className: cn$
|
|
47226
|
+
className: cn$2("w-full rounded-md p-2 text-left transition", "hover:bg-card/30 [&:has(.section:hover)]:bg-transparent", level === 2 && "hover:bg-card/30", level >= 3 && ""),
|
|
45930
47227
|
onClick: (e) => {
|
|
45931
47228
|
e.stopPropagation();
|
|
45932
47229
|
onFocusKeyPath(keyPath);
|
|
@@ -46005,7 +47302,7 @@ const NestedObjectWrapper = reactExports.memo((props) => {
|
|
|
46005
47302
|
const isSelected = isSameKeyPath(newKeyPath, focusedKeyPath);
|
|
46006
47303
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(ItemLayout, {
|
|
46007
47304
|
level: keyPath.length,
|
|
46008
|
-
title: key2,
|
|
47305
|
+
title: camelCaseToSentence(key2),
|
|
46009
47306
|
description: "",
|
|
46010
47307
|
isSelected,
|
|
46011
47308
|
onClick: (e) => {
|
|
@@ -46686,14 +47983,14 @@ function superRefine(fn) {
|
|
|
46686
47983
|
return _superRefine(fn);
|
|
46687
47984
|
}
|
|
46688
47985
|
const DropDown = ({ children, className, identifier, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
46689
|
-
className: cn$
|
|
47986
|
+
className: cn$2(`group/dropdown relative flex`, className),
|
|
46690
47987
|
"aria-label": `DropDown ${identifier}`,
|
|
46691
47988
|
id: `dropdown-container-${identifier}`,
|
|
46692
47989
|
...props,
|
|
46693
47990
|
children
|
|
46694
47991
|
});
|
|
46695
47992
|
const Trigger = ({ children, identifier, className, label, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Button, {
|
|
46696
|
-
className: cn$
|
|
47993
|
+
className: cn$2("w-full cursor-pointer", className),
|
|
46697
47994
|
label: label ?? `Open panel ${identifier}`,
|
|
46698
47995
|
"aria-haspopup": "true",
|
|
46699
47996
|
"aria-controls": `dropdown-panel-${identifier}`,
|
|
@@ -46711,14 +48008,14 @@ let DropDownAlign = /* @__PURE__ */ (function(DropDownAlign$1) {
|
|
|
46711
48008
|
return DropDownAlign$1;
|
|
46712
48009
|
})({});
|
|
46713
48010
|
const Panel = ({ children, isHidden: isHidden2 = void 0, isOverable = false, isFocusable = false, align = DropDownAlign.START, identifier, className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
46714
|
-
className: cn$
|
|
48011
|
+
className: cn$2("absolute top-[calc(100%+0.5rem)] z-[1000] min-w-full", align === DropDownAlign.START && "left-0", align === DropDownAlign.END && "right-0", className),
|
|
46715
48012
|
"aria-hidden": isHidden2,
|
|
46716
48013
|
role: "region",
|
|
46717
48014
|
"aria-labelledby": `dropdown-trigger-${identifier}`,
|
|
46718
48015
|
id: `dropdown-panel-${identifier}`,
|
|
46719
48016
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(MaxHeightSmoother, {
|
|
46720
48017
|
isHidden: isHidden2,
|
|
46721
|
-
className: cn$
|
|
48018
|
+
className: cn$2("overflow-x-visible", isHidden2 === false && "invisible", isHidden2 === true && "visible", isOverable && "group-hover/dropdown:visible group-hover/dropdown:grid-rows-[1fr]", isFocusable && "group-focus-within/dropdown:visible group-focus-within/dropdown:grid-rows-[1fr]"),
|
|
46722
48019
|
...props,
|
|
46723
48020
|
children
|
|
46724
48021
|
})
|
|
@@ -48270,7 +49567,7 @@ const ExpandCollapse = ({ isRollable = true, minHeight = DEFAULT_MIN_HEIGHT, chi
|
|
|
48270
49567
|
}, []);
|
|
48271
49568
|
if (!isRollable) return children;
|
|
48272
49569
|
if (!isTooBig) return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
48273
|
-
className: cn$
|
|
49570
|
+
className: cn$2("grid w-full", className),
|
|
48274
49571
|
ref: codeContainerRef,
|
|
48275
49572
|
children
|
|
48276
49573
|
});
|
|
@@ -48279,11 +49576,11 @@ const ExpandCollapse = ({ isRollable = true, minHeight = DEFAULT_MIN_HEIGHT, chi
|
|
|
48279
49576
|
minHeight,
|
|
48280
49577
|
className: "w-full overflow-x-auto overflow-y-hidden",
|
|
48281
49578
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
48282
|
-
className: cn$
|
|
49579
|
+
className: cn$2("grid w-full", className),
|
|
48283
49580
|
ref: codeContainerRef,
|
|
48284
49581
|
children
|
|
48285
49582
|
}), /* @__PURE__ */ jsxRuntimeExports.jsx("button", {
|
|
48286
|
-
className: cn$
|
|
49583
|
+
className: cn$2("absolute right-0 bottom-0 flex w-full cursor-pointer items-center justify-center rounded-t-2xl bg-gradient-to-t from-card/80 to-transparent px-3 py-0.5 text-md text-neutral-700 shadow-[0_0_10px_-15px_rgba(0,0,0,0.3)] backdrop-blur transition-all duration-300 hover:py-1 dark:text-neutral-400", isCollapsed ? "w-full" : "w-32"),
|
|
48287
49584
|
type: "button",
|
|
48288
49585
|
onClick: () => setIsCollapsed((prev) => !prev),
|
|
48289
49586
|
children: expandCollapseContent(isCollapsed)
|
|
@@ -48354,9 +49651,9 @@ const CodeDefault = ({ children }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div
|
|
|
48354
49651
|
}, `line-${index2}-${line.slice(0, 10)}`)) })
|
|
48355
49652
|
})
|
|
48356
49653
|
});
|
|
48357
|
-
const CodeBlockShiki = reactExports.lazy(() => __vitePreload(() => import("./CodeBlockShiki-
|
|
49654
|
+
const CodeBlockShiki = reactExports.lazy(() => __vitePreload(() => import("./CodeBlockShiki-DcO6QqUs.js"), true ? [] : void 0).then((mod) => ({ default: mod.CodeBlockShiki })));
|
|
48358
49655
|
const CodeBlock = ({ className, onChange, isEditable, children, lang, isDarkMode, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
48359
|
-
className: cn$
|
|
49656
|
+
className: cn$2("flex w-full min-w-0 max-w-full overflow-x-auto", className),
|
|
48360
49657
|
...props,
|
|
48361
49658
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, {
|
|
48362
49659
|
fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(CodeDefault, { children }),
|
|
@@ -48378,7 +49675,7 @@ let PopoverYAlign = /* @__PURE__ */ (function(PopoverYAlign$1) {
|
|
|
48378
49675
|
return PopoverYAlign$1;
|
|
48379
49676
|
})({});
|
|
48380
49677
|
const PopoverStatic = ({ children, className, identifier, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
48381
|
-
className: cn$
|
|
49678
|
+
className: cn$2("group/popover relative flex cursor-pointer", className),
|
|
48382
49679
|
id: `unrollable-panel-button-${identifier}`,
|
|
48383
49680
|
"aria-haspopup": true,
|
|
48384
49681
|
...props,
|
|
@@ -48391,7 +49688,7 @@ const Detail = reactExports.forwardRef(({ children, isHidden: isHidden2 = void 0
|
|
|
48391
49688
|
"aria-hidden": isHidden2,
|
|
48392
49689
|
"aria-labelledby": `unrollable-panel-button-${identifier}`,
|
|
48393
49690
|
id: `unrollable-panel-${identifier}`,
|
|
48394
|
-
className: cn$
|
|
49691
|
+
className: cn$2("absolute z-[1000] min-w-full rounded-md ring-1 ring-neutral", xAlign === "start" && "left-0", xAlign === "end" && "right-0", yAlign === "bellow" && "top-[calc(100%+1rem)]", yAlign === "above" && "bottom-[calc(100%+1rem)]", displayArrow && 'before:absolute before:z-[999] before:h-0 before:w-0 before:content-[""]', displayArrow && xAlign === "start" && "before:left-2", displayArrow && xAlign === "end" && "before:right-2", displayArrow && yAlign === "bellow" && "before:-top-[10px] before:border-r-[10px] before:border-r-transparent before:border-b-[10px] before:border-b-neutral before:border-l-[10px] before:border-l-transparent", displayArrow && yAlign === "above" && "before:-bottom-[10px] before:border-t-[10px] before:border-t-neutral before:border-r-[10px] before:border-r-transparent before:border-l-[10px] before:border-l-transparent", "overflow-x-visible opacity-0 transition-all duration-400 ease-in-out", isHidden2 !== false ? "invisible" : "visible opacity-100 delay-800", isOverable && "group-hover/popover:visible group-hover/popover:opacity-100 group-hover/popover:delay-800", isFocusable && "group-focus-within/popover:visible group-focus-within/popover:opacity-100 group-focus-within/popover:delay-800", className),
|
|
48395
49692
|
...props,
|
|
48396
49693
|
children
|
|
48397
49694
|
}));
|
|
@@ -48537,7 +49834,10 @@ const CodeFormatSelector = () => {
|
|
|
48537
49834
|
setCodeFormat(value);
|
|
48538
49835
|
setContentDeclarationFormat(value);
|
|
48539
49836
|
},
|
|
48540
|
-
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Trigger, {
|
|
49837
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Trigger, {
|
|
49838
|
+
className: "py-1",
|
|
49839
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Value, { placeholder: "Code Format" })
|
|
49840
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsxs(Select.Content, { children: [
|
|
48541
49841
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, {
|
|
48542
49842
|
value: "typescript",
|
|
48543
49843
|
children: "TypeScript"
|
|
@@ -48558,7 +49858,10 @@ const ContentDeclarationFormatSelector = () => {
|
|
|
48558
49858
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Select, {
|
|
48559
49859
|
value: contentDeclarationFormat,
|
|
48560
49860
|
onValueChange: setContentDeclarationFormat,
|
|
48561
|
-
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Trigger, {
|
|
49861
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Trigger, {
|
|
49862
|
+
className: "py-1",
|
|
49863
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Value, { placeholder: "Dictionary Format" })
|
|
49864
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsxs(Select.Content, { children: [
|
|
48562
49865
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, {
|
|
48563
49866
|
value: "typescript",
|
|
48564
49867
|
children: "TypeScript"
|
|
@@ -48598,7 +49901,10 @@ const PackageManagerSelector = () => {
|
|
|
48598
49901
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Select, {
|
|
48599
49902
|
value: packageManager,
|
|
48600
49903
|
onValueChange: setPackageManager,
|
|
48601
|
-
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Trigger, {
|
|
49904
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Trigger, {
|
|
49905
|
+
className: "py-1",
|
|
49906
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Value, { placeholder: "Package Manager" })
|
|
49907
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsxs(Select.Content, { children: [
|
|
48602
49908
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, {
|
|
48603
49909
|
value: "npm",
|
|
48604
49910
|
children: "npm"
|
|
@@ -48627,7 +49933,7 @@ const Code = ({ children, language, isDarkMode, showHeader = true, showLineNumbe
|
|
|
48627
49933
|
codeFormat,
|
|
48628
49934
|
contentDeclarationFormat,
|
|
48629
49935
|
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Container, {
|
|
48630
|
-
className: cn$
|
|
49936
|
+
className: cn$2("relative min-w-0 max-w-full text-sm leading-6", showLineNumbers && "with-line-number ml-0", className),
|
|
48631
49937
|
transparency: "lg",
|
|
48632
49938
|
...props,
|
|
48633
49939
|
children: [showHeader && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
@@ -48646,7 +49952,7 @@ const Code = ({ children, language, isDarkMode, showHeader = true, showLineNumbe
|
|
|
48646
49952
|
}), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
48647
49953
|
className: "sticky top-46 z-20",
|
|
48648
49954
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
48649
|
-
className: cn$
|
|
49955
|
+
className: cn$2("absolute right-2 bottom-0 flex h-7 items-center", hadSelectInHeader && "h-11"),
|
|
48650
49956
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(CopyCode, { code })
|
|
48651
49957
|
})
|
|
48652
49958
|
})] }), /* @__PURE__ */ jsxRuntimeExports.jsx(ExpandCollapse, {
|
|
@@ -48696,12 +50002,12 @@ const indicatorVariant = cva("absolute top-0 z-[-1] h-full w-auto rounded-lg tra
|
|
|
48696
50002
|
const TabSelector = ({ tabs, selectedChoice, onTabClick, color: color2 = TabSelectorColor.PRIMARY, hoverable = false, className }) => {
|
|
48697
50003
|
const optionsRefs = reactExports.useRef([]);
|
|
48698
50004
|
const indicatorRef = reactExports.useRef(null);
|
|
48699
|
-
const { choiceIndicatorPosition, calculatePosition } = useItemSelector(optionsRefs,
|
|
50005
|
+
const { choiceIndicatorPosition, calculatePosition } = useItemSelector(optionsRefs, { isHoverable: hoverable });
|
|
48700
50006
|
reactExports.useEffect(() => {
|
|
48701
50007
|
calculatePosition();
|
|
48702
50008
|
}, [selectedChoice, tabs]);
|
|
48703
50009
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
48704
|
-
className: cn$
|
|
50010
|
+
className: cn$2(tabSelectorVariant({ color: color2 }), className),
|
|
48705
50011
|
"aria-orientation": "horizontal",
|
|
48706
50012
|
"aria-multiselectable": "false",
|
|
48707
50013
|
role: "tablist",
|
|
@@ -48723,7 +50029,7 @@ const TabSelector = ({ tabs, selectedChoice, onTabClick, color: color2 = TabSele
|
|
|
48723
50029
|
}
|
|
48724
50030
|
});
|
|
48725
50031
|
}), choiceIndicatorPosition && /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
48726
|
-
className: cn$
|
|
50032
|
+
className: cn$2(indicatorVariant({ color: color2 })),
|
|
48727
50033
|
style: choiceIndicatorPosition,
|
|
48728
50034
|
ref: indicatorRef
|
|
48729
50035
|
}, `${selectedChoice}${JSON.stringify(tabs.map((tab) => tab.key))}`)]
|
|
@@ -48912,7 +50218,7 @@ const TabComponent = ({ defaultTab, group, variant, children, className, ...prop
|
|
|
48912
50218
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(TabContext.Provider, {
|
|
48913
50219
|
value: contextValue,
|
|
48914
50220
|
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
48915
|
-
className: cn$
|
|
50221
|
+
className: cn$2(tabContainerVariant({ variant }), className),
|
|
48916
50222
|
...props,
|
|
48917
50223
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
48918
50224
|
className: "sticky top-36 z-10 flex gap-3 bg-background/70 p-3 backdrop-blur",
|
|
@@ -48922,7 +50228,7 @@ const TabComponent = ({ defaultTab, group, variant, children, className, ...prop
|
|
|
48922
50228
|
const { label, value, disabled } = child.props;
|
|
48923
50229
|
const isActive = currentTabValue === value;
|
|
48924
50230
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("button", {
|
|
48925
|
-
className: cn$
|
|
50231
|
+
className: cn$2("cursor-pointer rounded-md px-4 py-1 font-medium text-sm transition-colors focus:outline-none", !isActive && "text-neutral/70"),
|
|
48926
50232
|
"data-active": isActive,
|
|
48927
50233
|
disabled,
|
|
48928
50234
|
onClick: () => !disabled && handleSetActiveTab(value),
|
|
@@ -48942,7 +50248,7 @@ const TabComponent = ({ defaultTab, group, variant, children, className, ...prop
|
|
|
48942
50248
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
48943
50249
|
role: "tablist",
|
|
48944
50250
|
"aria-orientation": "horizontal",
|
|
48945
|
-
className: cn$
|
|
50251
|
+
className: cn$2("grid w-full min-w-0", isDragging2 ? "transition-none" : "transition-transform duration-300 ease-in-out"),
|
|
48946
50252
|
style: {
|
|
48947
50253
|
gridTemplateColumns: `repeat(${tabItems.length}, 100%)`,
|
|
48948
50254
|
transform: `translateX(-${activeTabIndex * 100 - (isDragging2 ? dragDeltaPct : 0)}%)`
|
|
@@ -48957,7 +50263,7 @@ const TabComponent = ({ defaultTab, group, variant, children, className, ...prop
|
|
|
48957
50263
|
"aria-hidden": !isActive,
|
|
48958
50264
|
tabIndex: isActive ? 0 : -1,
|
|
48959
50265
|
"data-active": isActive,
|
|
48960
|
-
className: cn$
|
|
50266
|
+
className: cn$2("w-full min-w-0 p-6 opacity-100 transition-opacity duration-300 ease-in-out", !isActive && "pointer-events-none opacity-0"),
|
|
48961
50267
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
48962
50268
|
className: "flex w-full min-w-0 flex-col items-stretch gap-6",
|
|
48963
50269
|
children: children$1
|
|
@@ -48994,7 +50300,7 @@ const Table = ({ className, isRollable = false, displayModal, ...props }) => {
|
|
|
48994
50300
|
isRollable,
|
|
48995
50301
|
className: "max-w-full overflow-x-auto",
|
|
48996
50302
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("table", {
|
|
48997
|
-
className: cn$
|
|
50303
|
+
className: cn$2("min-w-full max-w-full table-auto overflow-x-auto bg-background text-left", className),
|
|
48998
50304
|
...props
|
|
48999
50305
|
})
|
|
49000
50306
|
}),
|
|
@@ -49006,7 +50312,7 @@ const Table = ({ className, isRollable = false, displayModal, ...props }) => {
|
|
|
49006
50312
|
children: isModalOpen ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
49007
50313
|
className: "grid",
|
|
49008
50314
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("table", {
|
|
49009
|
-
className: cn$
|
|
50315
|
+
className: cn$2("min-w-full max-w-full table-auto text-left", className),
|
|
49010
50316
|
...props
|
|
49011
50317
|
})
|
|
49012
50318
|
}) : /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {})
|
|
@@ -50404,22 +51710,27 @@ const MarkdownRenderer = ({ children, isDarkMode, locale, options }) => {
|
|
|
50404
51710
|
}),
|
|
50405
51711
|
h2: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(H2, {
|
|
50406
51712
|
isClickable: true,
|
|
51713
|
+
className: "mt-16",
|
|
50407
51714
|
...props
|
|
50408
51715
|
}),
|
|
50409
51716
|
h3: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(H3, {
|
|
50410
51717
|
isClickable: true,
|
|
51718
|
+
className: "mt-5",
|
|
50411
51719
|
...props
|
|
50412
51720
|
}),
|
|
50413
51721
|
h4: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(H4, {
|
|
50414
51722
|
isClickable: true,
|
|
51723
|
+
className: "mt-3",
|
|
50415
51724
|
...props
|
|
50416
51725
|
}),
|
|
50417
51726
|
h5: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(H5, {
|
|
50418
51727
|
isClickable: true,
|
|
51728
|
+
className: "mt-3",
|
|
50419
51729
|
...props
|
|
50420
51730
|
}),
|
|
50421
51731
|
h6: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(H6, {
|
|
50422
51732
|
isClickable: true,
|
|
51733
|
+
className: "mt-3",
|
|
50423
51734
|
...props
|
|
50424
51735
|
}),
|
|
50425
51736
|
code: (props) => !props.className ? /* @__PURE__ */ jsxRuntimeExports.jsx("strong", {
|
|
@@ -50433,21 +51744,21 @@ const MarkdownRenderer = ({ children, isDarkMode, locale, options }) => {
|
|
|
50433
51744
|
showHeader: Boolean(props.fileName)
|
|
50434
51745
|
}),
|
|
50435
51746
|
blockquote: ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("blockquote", {
|
|
50436
|
-
className: cn$
|
|
51747
|
+
className: cn$2("mt-5 gap-3 border-card border-l-4 pl-5 text-neutral", className),
|
|
50437
51748
|
...props
|
|
50438
51749
|
}),
|
|
50439
51750
|
ul: ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("ul", {
|
|
50440
|
-
className: cn$
|
|
51751
|
+
className: cn$2("mt-5 flex list-disc flex-col gap-3 pl-5", className),
|
|
50441
51752
|
...props
|
|
50442
51753
|
}),
|
|
50443
51754
|
ol: ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("ol", {
|
|
50444
|
-
className: cn$
|
|
51755
|
+
className: cn$2("mt-5 flex list-decimal flex-col gap-3 pl-5", className),
|
|
50445
51756
|
...props
|
|
50446
51757
|
}),
|
|
50447
51758
|
img: ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("img", {
|
|
50448
51759
|
...props,
|
|
50449
51760
|
loading: "lazy",
|
|
50450
|
-
className: cn$
|
|
51761
|
+
className: cn$2("max-h-[80vh] max-w-full rounded-md", className),
|
|
50451
51762
|
src: `${props.src}?raw=true`
|
|
50452
51763
|
}),
|
|
50453
51764
|
a: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(Link, {
|
|
@@ -50463,30 +51774,30 @@ const MarkdownRenderer = ({ children, isDarkMode, locale, options }) => {
|
|
|
50463
51774
|
...props
|
|
50464
51775
|
}),
|
|
50465
51776
|
th: ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("th", {
|
|
50466
|
-
className: cn$
|
|
51777
|
+
className: cn$2("border-neutral border-b bg-neutral/10 p-4", className),
|
|
50467
51778
|
...props
|
|
50468
51779
|
}),
|
|
50469
51780
|
tr: ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("tr", {
|
|
50470
|
-
className: cn$
|
|
51781
|
+
className: cn$2("hover:/10 hover:bg-neutral/10", className),
|
|
50471
51782
|
...props
|
|
50472
51783
|
}),
|
|
50473
51784
|
td: ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
50474
|
-
className: cn$
|
|
51785
|
+
className: cn$2("border-neutral-500/50 border-b p-4", className),
|
|
50475
51786
|
...props
|
|
50476
51787
|
}),
|
|
50477
51788
|
hr: ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("hr", {
|
|
50478
|
-
className: cn$
|
|
51789
|
+
className: cn$2("mx-6 mt-16 text-neutral", className),
|
|
50479
51790
|
...props
|
|
50480
51791
|
}),
|
|
50481
51792
|
Tabs: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(Tab, { ...props }),
|
|
50482
51793
|
Tab: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(Tab, { ...props }),
|
|
50483
51794
|
TabItem: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(Tab.Item, { ...props }),
|
|
50484
51795
|
Columns: ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
50485
|
-
className: cn$
|
|
51796
|
+
className: cn$2("flex gap-4 max-md:flex-col", className),
|
|
50486
51797
|
...props
|
|
50487
51798
|
}),
|
|
50488
51799
|
Column: ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
50489
|
-
className: cn$
|
|
51800
|
+
className: cn$2("flex-1", className),
|
|
50490
51801
|
...props
|
|
50491
51802
|
}),
|
|
50492
51803
|
...overrides
|
|
@@ -50822,16 +52133,25 @@ const TranslationTextEditor = ({ section, keyPath, dictionary, renderSection })
|
|
|
50822
52133
|
className: "flex w-full flex-col gap-2",
|
|
50823
52134
|
children: localesList.map((translationKey) => /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [/* @__PURE__ */ jsxRuntimeExports.jsx("tr", {
|
|
50824
52135
|
className: "mt-2 w-full p-2 text-xs",
|
|
50825
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
50826
|
-
|
|
50827
|
-
|
|
50828
|
-
|
|
50829
|
-
|
|
50830
|
-
|
|
50831
|
-
|
|
50832
|
-
|
|
50833
|
-
|
|
50834
|
-
|
|
52136
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
52137
|
+
className: "w-full",
|
|
52138
|
+
children: getLocaleName(translationKey, locale)
|
|
52139
|
+
})
|
|
52140
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx("tr", {
|
|
52141
|
+
className: "flex",
|
|
52142
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
52143
|
+
className: "w-full",
|
|
52144
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(TextEditorContainer, {
|
|
52145
|
+
section: content2[translationKey] ?? getEmptyNode(content2[defaultLocale]),
|
|
52146
|
+
keyPath: [...keyPath, {
|
|
52147
|
+
type: NodeType.Translation,
|
|
52148
|
+
key: translationKey
|
|
52149
|
+
}],
|
|
52150
|
+
dictionary,
|
|
52151
|
+
renderSection
|
|
52152
|
+
})
|
|
52153
|
+
})
|
|
52154
|
+
})] }, translationKey))
|
|
50835
52155
|
})
|
|
50836
52156
|
});
|
|
50837
52157
|
};
|
|
@@ -50919,7 +52239,10 @@ const ConditionTextEditor = ({ section, keyPath, dictionary, renderSection }) =>
|
|
|
50919
52239
|
"fallback"
|
|
50920
52240
|
].map((condKey) => /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [/* @__PURE__ */ jsxRuntimeExports.jsx("tr", {
|
|
50921
52241
|
className: "mt-2 block w-full p-2 text-xs",
|
|
50922
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
52242
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
52243
|
+
className: "w-full",
|
|
52244
|
+
children: String(condKey)
|
|
52245
|
+
})
|
|
50923
52246
|
}, condKey), /* @__PURE__ */ jsxRuntimeExports.jsx("tr", {
|
|
50924
52247
|
className: "block w-full",
|
|
50925
52248
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(TextEditorContainer, {
|
|
@@ -50947,7 +52270,10 @@ const GenderTextEditor = ({ section, keyPath, dictionary, renderSection }) => {
|
|
|
50947
52270
|
"fallback"
|
|
50948
52271
|
].map((condKey) => /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [/* @__PURE__ */ jsxRuntimeExports.jsx("tr", {
|
|
50949
52272
|
className: "mt-2 block w-full p-2 text-xs",
|
|
50950
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
52273
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
52274
|
+
className: "w-full",
|
|
52275
|
+
children: String(condKey)
|
|
52276
|
+
})
|
|
50951
52277
|
}, condKey), /* @__PURE__ */ jsxRuntimeExports.jsx("tr", {
|
|
50952
52278
|
className: "block w-full",
|
|
50953
52279
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(TextEditorContainer, {
|
|
@@ -50973,7 +52299,7 @@ const ArrayTextEditor = ({ section, keyPath, dictionary, renderSection }) => {
|
|
|
50973
52299
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("tbody", {
|
|
50974
52300
|
className: "flex w-full flex-col gap-2",
|
|
50975
52301
|
children: section.map((subSection, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("tr", {
|
|
50976
|
-
className: "mt-2 flex w-full justify-between gap-2 p-2",
|
|
52302
|
+
className: "mt-2 flex w-full items-center justify-between gap-2 p-2",
|
|
50977
52303
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
50978
52304
|
className: "text-xs",
|
|
50979
52305
|
children: String(index2)
|
|
@@ -51038,7 +52364,10 @@ const ObjectTextEditor = ({ section, keyPath, dictionary, renderSection }) => /*
|
|
|
51038
52364
|
const subSection = typedSection[key2] ?? getEmptyNode(typedSection[firstKey]);
|
|
51039
52365
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [/* @__PURE__ */ jsxRuntimeExports.jsx("tr", {
|
|
51040
52366
|
className: "mt-2 p-2 text-xs",
|
|
51041
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
52367
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
52368
|
+
className: "w-full",
|
|
52369
|
+
children: String(key2)
|
|
52370
|
+
})
|
|
51042
52371
|
}, JSON.stringify(subSection)), /* @__PURE__ */ jsxRuntimeExports.jsx("tr", {
|
|
51043
52372
|
className: "block w-full",
|
|
51044
52373
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(TextEditor, {
|
|
@@ -51120,7 +52449,7 @@ const NestedTextEditor = ({ keyPath, dictionary, renderSection, section, ...prop
|
|
|
51120
52449
|
const content2 = section[NodeType.Nested];
|
|
51121
52450
|
const childrenKeyPath = [...keyPath, { type: NodeType.Nested }];
|
|
51122
52451
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
51123
|
-
className: "w-full p-2",
|
|
52452
|
+
className: "flex w-full flex-col gap-4 p-2",
|
|
51124
52453
|
children: [
|
|
51125
52454
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { children: "Dictionary key" }),
|
|
51126
52455
|
/* @__PURE__ */ jsxRuntimeExports.jsx(ContentEditorInput, {
|
|
@@ -51276,7 +52605,7 @@ const getIsEditableSection = (section) => {
|
|
|
51276
52605
|
const KeyPathBreadcrumb = ({ keyPath, dictionaryKey, onClickKeyPath, locale }) => {
|
|
51277
52606
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Breadcrumb, {
|
|
51278
52607
|
links: [{
|
|
51279
|
-
text: dictionaryKey,
|
|
52608
|
+
text: camelCaseToSentence(dictionaryKey),
|
|
51280
52609
|
onClick: () => onClickKeyPath([])
|
|
51281
52610
|
}, ...keyPath.map((el, index2) => ({
|
|
51282
52611
|
onClick: () => onClickKeyPath(keyPath.slice(0, index2 + 1)),
|
|
@@ -51286,9 +52615,6 @@ const KeyPathBreadcrumb = ({ keyPath, dictionaryKey, onClickKeyPath, locale }) =
|
|
|
51286
52615
|
elementType: "location"
|
|
51287
52616
|
});
|
|
51288
52617
|
};
|
|
51289
|
-
const camelCaseToSentence = (content2) => {
|
|
51290
|
-
return String(content2).replace(/([A-Z])/g, " $1").toLowerCase().trim();
|
|
51291
|
-
};
|
|
51292
52618
|
const NavigationViewNode = ({ section: sectionProp, keyPath, dictionary }) => {
|
|
51293
52619
|
const { locales } = configuration.internationalization;
|
|
51294
52620
|
const section = getContentNodeByKeyPath(sectionProp, keyPath, useEditorLocale());
|
|
@@ -51829,8 +53155,8 @@ function validateChanges(initial, changes) {
|
|
|
51829
53155
|
})) errorHandler$1("changeField");
|
|
51830
53156
|
return changes;
|
|
51831
53157
|
}
|
|
51832
|
-
function validateSelector(
|
|
51833
|
-
if (!isFunction(
|
|
53158
|
+
function validateSelector(selector2) {
|
|
53159
|
+
if (!isFunction(selector2)) errorHandler$1("selectorType");
|
|
51834
53160
|
}
|
|
51835
53161
|
function validateHandler(handler) {
|
|
51836
53162
|
if (!(isFunction(handler) || isObject$1(handler))) errorHandler$1("handlerType");
|
|
@@ -51876,11 +53202,11 @@ function create(initial) {
|
|
|
51876
53202
|
var validate = curry$1(validators$1.changes)(initial);
|
|
51877
53203
|
var getChanges = curry$1(extractChanges)(state);
|
|
51878
53204
|
function getState2() {
|
|
51879
|
-
var
|
|
53205
|
+
var selector2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(state2) {
|
|
51880
53206
|
return state2;
|
|
51881
53207
|
};
|
|
51882
|
-
validators$1.selector(
|
|
51883
|
-
return
|
|
53208
|
+
validators$1.selector(selector2);
|
|
53209
|
+
return selector2(state.current);
|
|
51884
53210
|
}
|
|
51885
53211
|
function setState2(causedChanges) {
|
|
51886
53212
|
compose$1(didUpdate, update, validate, getChanges)(causedChanges);
|
|
@@ -52298,11 +53624,11 @@ const MonacoCode = ({ children, language, isDarkMode, showLineNumbers, showCopyB
|
|
|
52298
53624
|
};
|
|
52299
53625
|
const isShowLineNumbers = showLineNumbers ?? children.split("\n").length > 1;
|
|
52300
53626
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
52301
|
-
className: cn$
|
|
53627
|
+
className: cn$2("relative h-full w-full text-sm", showLineNumbers && "ml-0"),
|
|
52302
53628
|
children: [showCopyButton && /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
52303
53629
|
className: "sticky top-5 z-10",
|
|
52304
53630
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
52305
|
-
className: cn$
|
|
53631
|
+
className: cn$2("absolute right-2 bottom-0 flex h-7 items-center"),
|
|
52306
53632
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(CopyButton, { content: children })
|
|
52307
53633
|
})
|
|
52308
53634
|
}), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
@@ -52714,13 +54040,13 @@ const DictionaryFieldEditor = ({ dictionary, onClickDictionaryList, isDarkMode,
|
|
|
52714
54040
|
});
|
|
52715
54041
|
};
|
|
52716
54042
|
const MaxWidthSmoother = ({ children, isHidden: isHidden2, minWidth = 0, align = "left", className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
52717
|
-
className: cn$
|
|
54043
|
+
className: cn$2("relative grid h-full grid-cols-[0fr] overflow-x-hidden overflow-y-hidden transition-all duration-500 ease-in-out", isHidden2 ? "" : "grid-cols-[1fr]", className),
|
|
52718
54044
|
"aria-hidden": isHidden2,
|
|
52719
54045
|
...props,
|
|
52720
54046
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
52721
54047
|
style: { minWidth: `${minWidth}px` },
|
|
52722
54048
|
tabIndex: isHidden2 !== false ? void 0 : -1,
|
|
52723
|
-
className: cn$
|
|
54049
|
+
className: cn$2(align === "right" && "ml-auto"),
|
|
52724
54050
|
children
|
|
52725
54051
|
})
|
|
52726
54052
|
});
|
|
@@ -52748,6 +54074,18 @@ const checkIsMobileUserAgent = () => {
|
|
|
52748
54074
|
if (typeof userAgent === "undefined") return;
|
|
52749
54075
|
return /android|bb\d+|meego|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(?:hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(?:ob|in)i|palm(?: os)?|phone|p(?:ixi|re)\/|plucker|pocket|psp|series(?:4|6)0|symbian|treo|up\.(?:browser|link)|vodafone|wap|windows ce|windows phone|xda|xiino|zte-/i.test(userAgent);
|
|
52750
54076
|
};
|
|
54077
|
+
const checkIsIOS = () => {
|
|
54078
|
+
if (typeof window === "undefined") return;
|
|
54079
|
+
const userAgent = window.navigator?.userAgent;
|
|
54080
|
+
if (typeof userAgent === "undefined") return;
|
|
54081
|
+
return /iP(?:hone|ad|od)/.test(userAgent);
|
|
54082
|
+
};
|
|
54083
|
+
const checkIsMac = () => {
|
|
54084
|
+
if (typeof window === "undefined") return;
|
|
54085
|
+
const userAgent = window.navigator?.userAgent;
|
|
54086
|
+
if (typeof userAgent === "undefined") return;
|
|
54087
|
+
return /Macintosh|MacIntel|Mac OS X/.test(userAgent);
|
|
54088
|
+
};
|
|
52751
54089
|
const checkIsMobileScreen = (breakpoint) => {
|
|
52752
54090
|
if (typeof window === "undefined") return;
|
|
52753
54091
|
return (window?.innerWidth ?? 0) <= breakpoint;
|
|
@@ -52759,7 +54097,9 @@ const calculateIsMobile = (breakpoint = "md") => {
|
|
|
52759
54097
|
return {
|
|
52760
54098
|
isMobileScreen,
|
|
52761
54099
|
isMobileUserAgent,
|
|
52762
|
-
isMobile: isMobileScreen ?? isMobileUserAgent
|
|
54100
|
+
isMobile: isMobileScreen ?? isMobileUserAgent,
|
|
54101
|
+
isIOS: checkIsIOS(),
|
|
54102
|
+
isMac: checkIsMac()
|
|
52763
54103
|
};
|
|
52764
54104
|
};
|
|
52765
54105
|
const useDevice = (breakpoint = "md") => {
|
|
@@ -53658,7 +54998,7 @@ const ToastPrimitives = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
53658
54998
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
53659
54999
|
const ToastProvider = ToastPrimitives;
|
|
53660
55000
|
const ToastViewport = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Viewport, {
|
|
53661
|
-
className: cn$
|
|
55001
|
+
className: cn$2("fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:top-auto sm:right-0 sm:bottom-0 sm:flex-col md:max-w-[420px]", className),
|
|
53662
55002
|
...props
|
|
53663
55003
|
});
|
|
53664
55004
|
const toastVariants = cva("group data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md p-4 pr-6 shadow-[0_0_10px_-15px_rgba(0,0,0,0.3)] backdrop-blur transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[state=closed]:animate-out data-[state=open]:animate-in data-[swipe=end]:animate-out data-[swipe=move]:transition-none", {
|
|
@@ -53671,22 +55011,22 @@ const toastVariants = cva("group data-[state=closed]:fade-out-80 data-[state=clo
|
|
|
53671
55011
|
});
|
|
53672
55012
|
const Toast = ({ className, variant, ...props }) => {
|
|
53673
55013
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Root2, {
|
|
53674
|
-
className: cn$
|
|
55014
|
+
className: cn$2(toastVariants({ variant }), className),
|
|
53675
55015
|
...props
|
|
53676
55016
|
});
|
|
53677
55017
|
};
|
|
53678
55018
|
const ToastClose = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Close, {
|
|
53679
|
-
className: cn$
|
|
55019
|
+
className: cn$2("absolute top-1 right-1 rounded-md p-1 text-text/50 opacity-0 transition-opacity hover:text-text/80 focus:opacity-100 focus:outline-hidden focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600 group-[.destructive]:hover:text-red-50", className),
|
|
53680
55020
|
"toast-close": "",
|
|
53681
55021
|
...props,
|
|
53682
55022
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(X$1, { className: "size-5" })
|
|
53683
55023
|
});
|
|
53684
55024
|
const ToastTitle = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Title, {
|
|
53685
|
-
className: cn$
|
|
55025
|
+
className: cn$2("font-semibold text-sm [&+div]:text-xs", className),
|
|
53686
55026
|
...props
|
|
53687
55027
|
});
|
|
53688
55028
|
const ToastDescription = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Description, {
|
|
53689
|
-
className: cn$
|
|
55029
|
+
className: cn$2("text-sm opacity-90", className),
|
|
53690
55030
|
...props
|
|
53691
55031
|
});
|
|
53692
55032
|
const TOAST_LIMIT = 1;
|