@lax-wp/design-system 0.13.47 → 0.13.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/floating-bar/FloatingBar.cjs.js +1 -1
- package/dist/components/floating-bar/FloatingBar.cjs.js.map +1 -1
- package/dist/components/floating-bar/FloatingBar.es.js +5 -5
- package/dist/components/floating-bar/FloatingBar.es.js.map +1 -1
- package/dist/components/forms/checkbox/Checkbox.cjs.js +1 -1
- package/dist/components/forms/checkbox/Checkbox.cjs.js.map +1 -1
- package/dist/components/forms/checkbox/Checkbox.es.js +56 -52
- package/dist/components/forms/checkbox/Checkbox.es.js.map +1 -1
- package/dist/components/navigation/tabs/TabOptions.cjs.js +1 -1
- package/dist/components/navigation/tabs/TabOptions.cjs.js.map +1 -1
- package/dist/components/navigation/tabs/TabOptions.es.js +56 -56
- package/dist/components/navigation/tabs/TabOptions.es.js.map +1 -1
- package/dist/components/user-avatar/UserAvatar.cjs.js +1 -1
- package/dist/components/user-avatar/UserAvatar.cjs.js.map +1 -1
- package/dist/components/user-avatar/UserAvatar.es.js +38 -38
- package/dist/components/user-avatar/UserAvatar.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { jsx as e, jsxs as i, Fragment as
|
|
2
|
-
import { Checkbox as
|
|
1
|
+
import { jsx as e, jsxs as i, Fragment as h } from "react/jsx-runtime";
|
|
2
|
+
import { Checkbox as F } from "antd";
|
|
3
3
|
import t from "../../../_virtual/index.es.js";
|
|
4
|
-
import { AnimatePresence as
|
|
5
|
-
import { forwardRef as
|
|
6
|
-
import { Typography as
|
|
7
|
-
const
|
|
4
|
+
import { AnimatePresence as S, motion as A } from "framer-motion";
|
|
5
|
+
import { forwardRef as L } from "react";
|
|
6
|
+
import { Typography as p } from "../../data-display/typography/Typography.es.js";
|
|
7
|
+
const M = L(
|
|
8
8
|
({
|
|
9
9
|
id: a,
|
|
10
10
|
label: l,
|
|
11
11
|
checked: s,
|
|
12
|
-
isChecked:
|
|
13
|
-
onChange:
|
|
14
|
-
disabled:
|
|
12
|
+
isChecked: g,
|
|
13
|
+
onChange: b,
|
|
14
|
+
disabled: c = !1,
|
|
15
15
|
required: u = !1,
|
|
16
16
|
message: n,
|
|
17
17
|
messageType: r = "default",
|
|
18
|
-
wrapperClassName:
|
|
19
|
-
checkboxClassName:
|
|
20
|
-
labelClassName:
|
|
18
|
+
wrapperClassName: k,
|
|
19
|
+
checkboxClassName: y,
|
|
20
|
+
labelClassName: v,
|
|
21
21
|
size: d = "medium",
|
|
22
|
-
variant:
|
|
23
|
-
labelPosition:
|
|
24
|
-
checkboxProps:
|
|
25
|
-
},
|
|
26
|
-
const
|
|
22
|
+
variant: w = "default",
|
|
23
|
+
labelPosition: o = "right",
|
|
24
|
+
checkboxProps: C
|
|
25
|
+
}, z) => {
|
|
26
|
+
const N = s !== void 0 ? s : g || !1, _ = () => {
|
|
27
27
|
switch (d) {
|
|
28
28
|
case "small":
|
|
29
|
-
return "
|
|
29
|
+
return "[--checkbox-size:clamp(10px,0.625vw,12px)]";
|
|
30
30
|
case "large":
|
|
31
|
-
return "
|
|
31
|
+
return "[--checkbox-size:clamp(18px,calc(8px_+_0.625vw),20px)]";
|
|
32
32
|
default:
|
|
33
|
-
return "
|
|
33
|
+
return "[--checkbox-size:clamp(14px,calc(4px_+_0.625vw),16px)]";
|
|
34
34
|
}
|
|
35
|
-
},
|
|
35
|
+
}, j = () => {
|
|
36
36
|
if (r === "error")
|
|
37
37
|
return "text-red-600 border-red-300 focus:ring-red-500 dark:focus:ring-red-600";
|
|
38
38
|
if (r === "success")
|
|
39
39
|
return "text-green-600 border-green-300 focus:ring-green-500 dark:focus:ring-green-600";
|
|
40
40
|
if (r === "info")
|
|
41
41
|
return "text-blue-600 border-blue-300 focus:ring-blue-500 dark:focus:ring-blue-600";
|
|
42
|
-
switch (
|
|
42
|
+
switch (w) {
|
|
43
43
|
case "outline":
|
|
44
44
|
return "text-primary-600 bg-transparent border-neutral-300 focus:ring-primary-500 dark:focus:ring-primary-600";
|
|
45
45
|
case "solid":
|
|
@@ -47,7 +47,7 @@ const R = M(
|
|
|
47
47
|
default:
|
|
48
48
|
return "text-primary-600 bg-gray-100 border-gray-300 focus:ring-primary-500 dark:focus:ring-primary-600 dark:bg-neutral-600 dark:border-gray-600";
|
|
49
49
|
}
|
|
50
|
-
},
|
|
50
|
+
}, $ = () => r === "error" ? "text-red-500 dark:text-red-400" : r === "success" ? "text-green-500 dark:text-green-400" : r === "info" ? "text-blue-500 dark:text-blue-400" : "text-neutral-500 dark:text-neutral-400", E = () => {
|
|
51
51
|
switch (d) {
|
|
52
52
|
case "small":
|
|
53
53
|
return "extra-small";
|
|
@@ -57,67 +57,71 @@ const R = M(
|
|
|
57
57
|
return "small";
|
|
58
58
|
}
|
|
59
59
|
}, m = /* @__PURE__ */ e(
|
|
60
|
-
|
|
60
|
+
F,
|
|
61
61
|
{
|
|
62
|
-
...
|
|
63
|
-
ref:
|
|
62
|
+
...C,
|
|
63
|
+
ref: z,
|
|
64
64
|
id: a,
|
|
65
|
-
checked:
|
|
66
|
-
onChange: (
|
|
67
|
-
|
|
65
|
+
checked: N,
|
|
66
|
+
onChange: (f) => {
|
|
67
|
+
b(f.target.checked, f);
|
|
68
68
|
},
|
|
69
|
-
disabled:
|
|
69
|
+
disabled: c,
|
|
70
70
|
className: t(
|
|
71
71
|
// Base styles
|
|
72
72
|
"rounded focus:ring-2 focus:ring-primary-500 dark:focus:ring-primary-400 focus:ring-offset-gray-800 transition-colors duration-200",
|
|
73
|
-
// Size classes
|
|
74
|
-
|
|
73
|
+
// Size classes — the clamp() value set by getSizeClasses drives the
|
|
74
|
+
// antd wrapper and the visible .ant-checkbox-inner box (!important
|
|
75
|
+
// needed to beat antd's own token-based width/height)
|
|
76
|
+
_(),
|
|
77
|
+
"w-[var(--checkbox-size)] h-[var(--checkbox-size)]",
|
|
78
|
+
"[&_.ant-checkbox-inner]:!w-[var(--checkbox-size)] [&_.ant-checkbox-inner]:!h-[var(--checkbox-size)]",
|
|
75
79
|
// Variant classes
|
|
76
|
-
|
|
80
|
+
j(),
|
|
77
81
|
// Disabled styles
|
|
78
|
-
|
|
82
|
+
c && "opacity-50 cursor-not-allowed",
|
|
79
83
|
// Custom classes
|
|
80
|
-
|
|
84
|
+
y
|
|
81
85
|
),
|
|
82
86
|
"aria-required": u,
|
|
83
87
|
"aria-invalid": n && r === "error" ? "true" : "false",
|
|
84
88
|
"aria-describedby": n ? `${a}-message` : void 0
|
|
85
89
|
}
|
|
86
|
-
),
|
|
90
|
+
), x = l ? /* @__PURE__ */ e(
|
|
87
91
|
"label",
|
|
88
92
|
{
|
|
89
93
|
htmlFor: a,
|
|
90
94
|
className: t(
|
|
91
95
|
"font-medium cursor-pointer transition-colors duration-200",
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
96
|
+
c ? "text-neutral-400 dark:text-neutral-600 cursor-not-allowed" : "text-neutral-900 dark:text-neutral-100",
|
|
97
|
+
o === "right" ? "ml-2" : "mr-2",
|
|
98
|
+
v
|
|
95
99
|
),
|
|
96
|
-
children: /* @__PURE__ */ i(
|
|
100
|
+
children: /* @__PURE__ */ i(p, { variant: "medium", size: E(), appearance: "body", children: [
|
|
97
101
|
l,
|
|
98
102
|
u && /* @__PURE__ */ e("span", { className: "text-red-500 ml-1", children: "*" })
|
|
99
103
|
] })
|
|
100
104
|
}
|
|
101
105
|
) : null;
|
|
102
|
-
return /* @__PURE__ */ i("div", { className: t("flex flex-col",
|
|
106
|
+
return /* @__PURE__ */ i("div", { className: t("flex flex-col", k), children: [
|
|
103
107
|
/* @__PURE__ */ e(
|
|
104
108
|
"div",
|
|
105
109
|
{
|
|
106
110
|
className: t(
|
|
107
111
|
"flex items-center",
|
|
108
|
-
|
|
112
|
+
o === "left" && "flex-row-reverse justify-end"
|
|
109
113
|
),
|
|
110
|
-
children:
|
|
114
|
+
children: o === "left" ? /* @__PURE__ */ i(h, { children: [
|
|
111
115
|
m,
|
|
112
|
-
|
|
113
|
-
] }) : /* @__PURE__ */ i(
|
|
116
|
+
x
|
|
117
|
+
] }) : /* @__PURE__ */ i(h, { children: [
|
|
114
118
|
m,
|
|
115
|
-
|
|
119
|
+
x
|
|
116
120
|
] })
|
|
117
121
|
}
|
|
118
122
|
),
|
|
119
|
-
/* @__PURE__ */ e(
|
|
120
|
-
|
|
123
|
+
/* @__PURE__ */ e(S, { children: n && /* @__PURE__ */ e(
|
|
124
|
+
A.div,
|
|
121
125
|
{
|
|
122
126
|
initial: { opacity: 0, y: -10 },
|
|
123
127
|
animate: { opacity: 1, y: 0 },
|
|
@@ -126,9 +130,9 @@ const R = M(
|
|
|
126
130
|
id: `${a}-message`,
|
|
127
131
|
role: r === "error" ? "alert" : void 0,
|
|
128
132
|
children: /* @__PURE__ */ e(
|
|
129
|
-
|
|
133
|
+
p,
|
|
130
134
|
{
|
|
131
|
-
className: t("mt-1",
|
|
135
|
+
className: t("mt-1", $()),
|
|
132
136
|
appearance: "custom",
|
|
133
137
|
size: "extra-small",
|
|
134
138
|
variant: "medium",
|
|
@@ -140,8 +144,8 @@ const R = M(
|
|
|
140
144
|
] });
|
|
141
145
|
}
|
|
142
146
|
);
|
|
143
|
-
|
|
147
|
+
M.displayName = "Checkbox";
|
|
144
148
|
export {
|
|
145
|
-
|
|
149
|
+
M as Checkbox
|
|
146
150
|
};
|
|
147
151
|
//# sourceMappingURL=Checkbox.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.es.js","sources":["../../../../src/components/forms/checkbox/Checkbox.tsx"],"sourcesContent":["import { Checkbox as AntdCheckbox } from \"antd\";\nimport type { CheckboxChangeEvent, CheckboxProps, CheckboxRef } from \"antd\";\nimport cn from \"classnames\";\nimport { AnimatePresence, motion } from \"framer-motion\";\nimport { forwardRef } from \"react\";\nimport { Typography } from \"../../data-display/typography/Typography\";\n\n/**\n * Props for the Checkbox component\n */\nexport interface CheckboxComponentProps {\n /** Unique identifier for the checkbox */\n id: string;\n /** Label text to display next to the checkbox */\n label?: string;\n /** Whether the checkbox is checked */\n checked?: boolean;\n /** Whether the checkbox is checked (alias for checked) */\n isChecked?: boolean;\n /** Callback function called when checkbox state changes */\n onChange: (checked: boolean, event: CheckboxChangeEvent) => void;\n /** Whether the checkbox is disabled */\n disabled?: boolean;\n /** Whether the field is required */\n required?: boolean;\n /** Message to display below the checkbox */\n message?: string;\n /** Type of message to display */\n messageType?: \"success\" | \"error\" | \"info\" | \"default\";\n /** Additional CSS classes for the wrapper container */\n wrapperClassName?: string;\n /** Additional CSS classes for the checkbox input */\n checkboxClassName?: string;\n /** Additional CSS classes for the label */\n labelClassName?: string;\n /** Size variant for the checkbox */\n size?: \"small\" | \"medium\" | \"large\";\n /** Visual variant for the checkbox */\n variant?: \"default\" | \"outline\" | \"solid\";\n /** Whether to show the label on the left side */\n labelPosition?: \"left\" | \"right\";\n /** Additional props to pass to the Ant Design Checkbox */\n checkboxProps?: Omit<\n CheckboxProps,\n \"checked\" | \"onChange\" | \"id\" | \"disabled\"\n >;\n}\n\n/**\n * A highly customizable checkbox component with label, validation, and styling support.\n * Features dark mode support, accessibility enhancements, and comprehensive prop support.\n *\n * @example\n * ```tsx\n * <Checkbox\n * id=\"terms\"\n * label=\"I agree to the terms and conditions\"\n * checked={agreedToTerms}\n * onChange={(checked) => setAgreedToTerms(checked)}\n * required\n * />\n * ```\n */\nexport const Checkbox = forwardRef<CheckboxRef, CheckboxComponentProps>(\n (\n {\n id,\n label,\n checked,\n isChecked,\n onChange,\n disabled = false,\n required = false,\n message,\n messageType = \"default\",\n wrapperClassName,\n checkboxClassName,\n labelClassName,\n size = \"medium\",\n variant = \"default\",\n labelPosition = \"right\",\n checkboxProps,\n },\n ref\n ) => {\n // Use checked prop, fallback to isChecked for backward compatibility\n const isCheckboxChecked =\n checked !== undefined ? checked : isChecked || false;\n\n // Size-based styling\n const getSizeClasses = (): string => {\n switch (size) {\n case \"small\":\n return \"w-3 h-3\";\n case \"large\":\n return \"w-5 h-5\";\n default:\n return \"w-4 h-4\";\n }\n };\n\n // Variant-based styling\n const getVariantClasses = (): string => {\n if (messageType === \"error\") {\n return \"text-red-600 border-red-300 focus:ring-red-500 dark:focus:ring-red-600\";\n }\n if (messageType === \"success\") {\n return \"text-green-600 border-green-300 focus:ring-green-500 dark:focus:ring-green-600\";\n }\n if (messageType === \"info\") {\n return \"text-blue-600 border-blue-300 focus:ring-blue-500 dark:focus:ring-blue-600\";\n }\n\n switch (variant) {\n case \"outline\":\n return \"text-primary-600 bg-transparent border-neutral-300 focus:ring-primary-500 dark:focus:ring-primary-600\";\n case \"solid\":\n return \"text-primary-600 bg-primary-50 border-primary-300 focus:ring-primary-500 dark:focus:ring-primary-600 dark:bg-primary-900/20\";\n default:\n return \"text-primary-600 bg-gray-100 border-gray-300 focus:ring-primary-500 dark:focus:ring-primary-600 dark:bg-neutral-600 dark:border-gray-600\";\n }\n };\n\n // Message typography class\n const getMessageTypographyClass = (): string => {\n if (messageType === \"error\") return \"text-red-500 dark:text-red-400\";\n if (messageType === \"success\")\n return \"text-green-500 dark:text-green-400\";\n if (messageType === \"info\") return \"text-blue-500 dark:text-blue-400\";\n return \"text-neutral-500 dark:text-neutral-400\";\n };\n\n // Label typography size based on checkbox size\n const getLabelSize = (): \"extra-small\" | \"small\" | \"medium\" => {\n switch (size) {\n case \"small\":\n return \"extra-small\";\n case \"large\":\n return \"medium\";\n default:\n return \"small\";\n }\n };\n\n const handleChange = (e: CheckboxChangeEvent) => {\n onChange(e.target.checked, e);\n };\n\n const checkboxElement = (\n <AntdCheckbox\n {...checkboxProps}\n ref={ref}\n id={id}\n checked={isCheckboxChecked}\n onChange={handleChange}\n disabled={disabled}\n className={cn(\n // Base styles\n \"rounded focus:ring-2 focus:ring-primary-500 dark:focus:ring-primary-400 focus:ring-offset-gray-800 transition-colors duration-200\",\n\n // Size classes\n getSizeClasses(),\n\n // Variant classes\n getVariantClasses(),\n\n // Disabled styles\n disabled && \"opacity-50 cursor-not-allowed\",\n\n // Custom classes\n checkboxClassName\n )}\n aria-required={required}\n aria-invalid={message && messageType === \"error\" ? \"true\" : \"false\"}\n aria-describedby={message ? `${id}-message` : undefined}\n />\n );\n\n const labelElement = label ? (\n <label\n htmlFor={id}\n className={cn(\n \"font-medium cursor-pointer transition-colors duration-200\",\n disabled\n ? \"text-neutral-400 dark:text-neutral-600 cursor-not-allowed\"\n : \"text-neutral-900 dark:text-neutral-100\",\n labelPosition === \"right\" ? \"ml-2\" : \"mr-2\",\n labelClassName\n )}\n >\n <Typography variant=\"medium\" size={getLabelSize()} appearance=\"body\">\n {label}\n {required && <span className=\"text-red-500 ml-1\">*</span>}\n </Typography>\n </label>\n ) : null;\n\n return (\n <div className={cn(\"flex flex-col\", wrapperClassName)}>\n <div\n className={cn(\n \"flex items-center\",\n labelPosition === \"left\" && \"flex-row-reverse justify-end\"\n )}\n >\n {labelPosition === \"left\" ? (\n <>\n {checkboxElement}\n {labelElement}\n </>\n ) : (\n <>\n {checkboxElement}\n {labelElement}\n </>\n )}\n </div>\n\n {/* Message */}\n <AnimatePresence>\n {message && (\n <motion.div\n initial={{ opacity: 0, y: -10 }}\n animate={{ opacity: 1, y: 0 }}\n exit={{ opacity: 0, y: -10 }}\n transition={{ duration: 0.2 }}\n id={`${id}-message`}\n role={messageType === \"error\" ? \"alert\" : undefined}\n >\n <Typography\n className={cn(\"mt-1\", getMessageTypographyClass())}\n appearance=\"custom\"\n size=\"extra-small\"\n variant=\"medium\"\n >\n {message}\n </Typography>\n </motion.div>\n )}\n </AnimatePresence>\n </div>\n );\n }\n);\n\nCheckbox.displayName = \"Checkbox\";\n\n// Export type alias for backward compatibility\nexport type TCheckboxComponentProps = CheckboxComponentProps;\n"],"names":["Checkbox","forwardRef","id","label","checked","isChecked","onChange","disabled","required","message","messageType","wrapperClassName","checkboxClassName","labelClassName","size","variant","labelPosition","checkboxProps","ref","isCheckboxChecked","getSizeClasses","getVariantClasses","getMessageTypographyClass","getLabelSize","checkboxElement","jsx","AntdCheckbox","e","cn","labelElement","jsxs","Typography","Fragment","AnimatePresence","motion"],"mappings":";;;;;;AA+DO,MAAMA,IAAWC;AAAA,EACtB,CACE;AAAA,IACE,IAAAC;AAAA,IACA,OAAAC;AAAA,IACA,SAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,SAAAC;AAAA,IACA,aAAAC,IAAc;AAAA,IACd,kBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,SAAAC,IAAU;AAAA,IACV,eAAAC,IAAgB;AAAA,IAChB,eAAAC;AAAA,EAAA,GAEFC,MACG;AAEH,UAAMC,IACJf,MAAY,SAAYA,IAAUC,KAAa,IAG3Ce,IAAiB,MAAc;AACnC,cAAQN,GAAA;AAAA,QACN,KAAK;AACH,iBAAO;AAAA,QACT,KAAK;AACH,iBAAO;AAAA,QACT;AACE,iBAAO;AAAA,MAAA;AAAA,IAEb,GAGMO,IAAoB,MAAc;AACtC,UAAIX,MAAgB;AAClB,eAAO;AAET,UAAIA,MAAgB;AAClB,eAAO;AAET,UAAIA,MAAgB;AAClB,eAAO;AAGT,cAAQK,GAAA;AAAA,QACN,KAAK;AACH,iBAAO;AAAA,QACT,KAAK;AACH,iBAAO;AAAA,QACT;AACE,iBAAO;AAAA,MAAA;AAAA,IAEb,GAGMO,IAA4B,MAC5BZ,MAAgB,UAAgB,mCAChCA,MAAgB,YACX,uCACLA,MAAgB,SAAe,qCAC5B,0CAIHa,IAAe,MAA0C;AAC7D,cAAQT,GAAA;AAAA,QACN,KAAK;AACH,iBAAO;AAAA,QACT,KAAK;AACH,iBAAO;AAAA,QACT;AACE,iBAAO;AAAA,MAAA;AAAA,IAEb,GAMMU,IACJ,gBAAAC;AAAA,MAACC;AAAAA,MAAA;AAAA,QACE,GAAGT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AAA,UAAA,EAAA,CACH;AAAA,QAAA;AAAA,MAAA;AAAA,MAKJ,gBAAAJ,EAACQ,KACE,UAAAxB,KACC,gBAAAgB;AAAA,QAACS,EAAO;AAAA,QAAP;AAAA,UACC,SAAS,EAAE,SAAS,GAAG,GAAG,IAAA;AAAA,UAC1B,SAAS,EAAE,SAAS,GAAG,GAAG,EAAA;AAAA,UAC1B,MAAM,EAAE,SAAS,GAAG,GAAG,IAAA;AAAA,UACvB,YAAY,EAAE,UAAU,IAAA;AAAA,UACxB,IAAI,GAAGhC,CAAE;AAAA,UACT,MAAMQ,MAAgB,UAAU,UAAU;AAAA,UAE1C,UAAA,gBAAAe;AAAA,YAACM;AAAA,YAAA;AAAA,cACC,WAAWH,EAAG,QAAQN,GAA2B;AAAA,cACjD,YAAW;AAAA,cACX,MAAK;AAAA,cACL,SAAQ;AAAA,cAEP,UAAAb;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA,EACF,CAEJ;AAAA,IAAA,GACF;AAAA,EAEJ;AACF;AAEAT,EAAS,cAAc;"}
|
|
1
|
+
{"version":3,"file":"Checkbox.es.js","sources":["../../../../src/components/forms/checkbox/Checkbox.tsx"],"sourcesContent":["import { Checkbox as AntdCheckbox } from \"antd\";\nimport type { CheckboxChangeEvent, CheckboxProps, CheckboxRef } from \"antd\";\nimport cn from \"classnames\";\nimport { AnimatePresence, motion } from \"framer-motion\";\nimport { forwardRef } from \"react\";\nimport { Typography } from \"../../data-display/typography/Typography\";\n\n/**\n * Props for the Checkbox component\n */\nexport interface CheckboxComponentProps {\n /** Unique identifier for the checkbox */\n id: string;\n /** Label text to display next to the checkbox */\n label?: string;\n /** Whether the checkbox is checked */\n checked?: boolean;\n /** Whether the checkbox is checked (alias for checked) */\n isChecked?: boolean;\n /** Callback function called when checkbox state changes */\n onChange: (checked: boolean, event: CheckboxChangeEvent) => void;\n /** Whether the checkbox is disabled */\n disabled?: boolean;\n /** Whether the field is required */\n required?: boolean;\n /** Message to display below the checkbox */\n message?: string;\n /** Type of message to display */\n messageType?: \"success\" | \"error\" | \"info\" | \"default\";\n /** Additional CSS classes for the wrapper container */\n wrapperClassName?: string;\n /** Additional CSS classes for the checkbox input */\n checkboxClassName?: string;\n /** Additional CSS classes for the label */\n labelClassName?: string;\n /** Size variant for the checkbox */\n size?: \"small\" | \"medium\" | \"large\";\n /** Visual variant for the checkbox */\n variant?: \"default\" | \"outline\" | \"solid\";\n /** Whether to show the label on the left side */\n labelPosition?: \"left\" | \"right\";\n /** Additional props to pass to the Ant Design Checkbox */\n checkboxProps?: Omit<\n CheckboxProps,\n \"checked\" | \"onChange\" | \"id\" | \"disabled\"\n >;\n}\n\n/**\n * A highly customizable checkbox component with label, validation, and styling support.\n * Features dark mode support, accessibility enhancements, and comprehensive prop support.\n *\n * @example\n * ```tsx\n * <Checkbox\n * id=\"terms\"\n * label=\"I agree to the terms and conditions\"\n * checked={agreedToTerms}\n * onChange={(checked) => setAgreedToTerms(checked)}\n * required\n * />\n * ```\n */\nexport const Checkbox = forwardRef<CheckboxRef, CheckboxComponentProps>(\n (\n {\n id,\n label,\n checked,\n isChecked,\n onChange,\n disabled = false,\n required = false,\n message,\n messageType = \"default\",\n wrapperClassName,\n checkboxClassName,\n labelClassName,\n size = \"medium\",\n variant = \"default\",\n labelPosition = \"right\",\n checkboxProps,\n },\n ref\n ) => {\n // Use checked prop, fallback to isChecked for backward compatibility\n const isCheckboxChecked =\n checked !== undefined ? checked : isChecked || false;\n\n // Fluid size scaling: each size clamps from 2px smaller on <=1600px\n // screens up to its full size at 1920px — the same clamp() curve used for\n // the fluid fontSize / icon spacing tokens in tailwind.config.js.\n const getSizeClasses = (): string => {\n switch (size) {\n case \"small\":\n return \"[--checkbox-size:clamp(10px,0.625vw,12px)]\";\n case \"large\":\n return \"[--checkbox-size:clamp(18px,calc(8px_+_0.625vw),20px)]\";\n default:\n return \"[--checkbox-size:clamp(14px,calc(4px_+_0.625vw),16px)]\";\n }\n };\n\n // Variant-based styling\n const getVariantClasses = (): string => {\n if (messageType === \"error\") {\n return \"text-red-600 border-red-300 focus:ring-red-500 dark:focus:ring-red-600\";\n }\n if (messageType === \"success\") {\n return \"text-green-600 border-green-300 focus:ring-green-500 dark:focus:ring-green-600\";\n }\n if (messageType === \"info\") {\n return \"text-blue-600 border-blue-300 focus:ring-blue-500 dark:focus:ring-blue-600\";\n }\n\n switch (variant) {\n case \"outline\":\n return \"text-primary-600 bg-transparent border-neutral-300 focus:ring-primary-500 dark:focus:ring-primary-600\";\n case \"solid\":\n return \"text-primary-600 bg-primary-50 border-primary-300 focus:ring-primary-500 dark:focus:ring-primary-600 dark:bg-primary-900/20\";\n default:\n return \"text-primary-600 bg-gray-100 border-gray-300 focus:ring-primary-500 dark:focus:ring-primary-600 dark:bg-neutral-600 dark:border-gray-600\";\n }\n };\n\n // Message typography class\n const getMessageTypographyClass = (): string => {\n if (messageType === \"error\") return \"text-red-500 dark:text-red-400\";\n if (messageType === \"success\")\n return \"text-green-500 dark:text-green-400\";\n if (messageType === \"info\") return \"text-blue-500 dark:text-blue-400\";\n return \"text-neutral-500 dark:text-neutral-400\";\n };\n\n // Label typography size based on checkbox size\n const getLabelSize = (): \"extra-small\" | \"small\" | \"medium\" => {\n switch (size) {\n case \"small\":\n return \"extra-small\";\n case \"large\":\n return \"medium\";\n default:\n return \"small\";\n }\n };\n\n const handleChange = (e: CheckboxChangeEvent) => {\n onChange(e.target.checked, e);\n };\n\n const checkboxElement = (\n <AntdCheckbox\n {...checkboxProps}\n ref={ref}\n id={id}\n checked={isCheckboxChecked}\n onChange={handleChange}\n disabled={disabled}\n className={cn(\n // Base styles\n \"rounded focus:ring-2 focus:ring-primary-500 dark:focus:ring-primary-400 focus:ring-offset-gray-800 transition-colors duration-200\",\n\n // Size classes — the clamp() value set by getSizeClasses drives the\n // antd wrapper and the visible .ant-checkbox-inner box (!important\n // needed to beat antd's own token-based width/height)\n getSizeClasses(),\n \"w-[var(--checkbox-size)] h-[var(--checkbox-size)]\",\n \"[&_.ant-checkbox-inner]:!w-[var(--checkbox-size)] [&_.ant-checkbox-inner]:!h-[var(--checkbox-size)]\",\n\n // Variant classes\n getVariantClasses(),\n\n // Disabled styles\n disabled && \"opacity-50 cursor-not-allowed\",\n\n // Custom classes\n checkboxClassName\n )}\n aria-required={required}\n aria-invalid={message && messageType === \"error\" ? \"true\" : \"false\"}\n aria-describedby={message ? `${id}-message` : undefined}\n />\n );\n\n const labelElement = label ? (\n <label\n htmlFor={id}\n className={cn(\n \"font-medium cursor-pointer transition-colors duration-200\",\n disabled\n ? \"text-neutral-400 dark:text-neutral-600 cursor-not-allowed\"\n : \"text-neutral-900 dark:text-neutral-100\",\n labelPosition === \"right\" ? \"ml-2\" : \"mr-2\",\n labelClassName\n )}\n >\n <Typography variant=\"medium\" size={getLabelSize()} appearance=\"body\">\n {label}\n {required && <span className=\"text-red-500 ml-1\">*</span>}\n </Typography>\n </label>\n ) : null;\n\n return (\n <div className={cn(\"flex flex-col\", wrapperClassName)}>\n <div\n className={cn(\n \"flex items-center\",\n labelPosition === \"left\" && \"flex-row-reverse justify-end\"\n )}\n >\n {labelPosition === \"left\" ? (\n <>\n {checkboxElement}\n {labelElement}\n </>\n ) : (\n <>\n {checkboxElement}\n {labelElement}\n </>\n )}\n </div>\n\n {/* Message */}\n <AnimatePresence>\n {message && (\n <motion.div\n initial={{ opacity: 0, y: -10 }}\n animate={{ opacity: 1, y: 0 }}\n exit={{ opacity: 0, y: -10 }}\n transition={{ duration: 0.2 }}\n id={`${id}-message`}\n role={messageType === \"error\" ? \"alert\" : undefined}\n >\n <Typography\n className={cn(\"mt-1\", getMessageTypographyClass())}\n appearance=\"custom\"\n size=\"extra-small\"\n variant=\"medium\"\n >\n {message}\n </Typography>\n </motion.div>\n )}\n </AnimatePresence>\n </div>\n );\n }\n);\n\nCheckbox.displayName = \"Checkbox\";\n\n// Export type alias for backward compatibility\nexport type TCheckboxComponentProps = CheckboxComponentProps;\n"],"names":["Checkbox","forwardRef","id","label","checked","isChecked","onChange","disabled","required","message","messageType","wrapperClassName","checkboxClassName","labelClassName","size","variant","labelPosition","checkboxProps","ref","isCheckboxChecked","getSizeClasses","getVariantClasses","getMessageTypographyClass","getLabelSize","checkboxElement","jsx","AntdCheckbox","e","cn","labelElement","jsxs","Typography","Fragment","AnimatePresence","motion"],"mappings":";;;;;;AA+DO,MAAMA,IAAWC;AAAA,EACtB,CACE;AAAA,IACE,IAAAC;AAAA,IACA,OAAAC;AAAA,IACA,SAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,SAAAC;AAAA,IACA,aAAAC,IAAc;AAAA,IACd,kBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,SAAAC,IAAU;AAAA,IACV,eAAAC,IAAgB;AAAA,IAChB,eAAAC;AAAA,EAAA,GAEFC,MACG;AAEH,UAAMC,IACJf,MAAY,SAAYA,IAAUC,KAAa,IAK3Ce,IAAiB,MAAc;AACnC,cAAQN,GAAA;AAAA,QACN,KAAK;AACH,iBAAO;AAAA,QACT,KAAK;AACH,iBAAO;AAAA,QACT;AACE,iBAAO;AAAA,MAAA;AAAA,IAEb,GAGMO,IAAoB,MAAc;AACtC,UAAIX,MAAgB;AAClB,eAAO;AAET,UAAIA,MAAgB;AAClB,eAAO;AAET,UAAIA,MAAgB;AAClB,eAAO;AAGT,cAAQK,GAAA;AAAA,QACN,KAAK;AACH,iBAAO;AAAA,QACT,KAAK;AACH,iBAAO;AAAA,QACT;AACE,iBAAO;AAAA,MAAA;AAAA,IAEb,GAGMO,IAA4B,MAC5BZ,MAAgB,UAAgB,mCAChCA,MAAgB,YACX,uCACLA,MAAgB,SAAe,qCAC5B,0CAIHa,IAAe,MAA0C;AAC7D,cAAQT,GAAA;AAAA,QACN,KAAK;AACH,iBAAO;AAAA,QACT,KAAK;AACH,iBAA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,gBAAAc,EAAAE,GAAA,EACG,UAAA;AAAA,YAAAR;AAAA,YACAK;AAAA,UAAA,EAAA,CACH,IAEA,gBAAAC,EAAAE,GAAA,EACG,UAAA;AAAA,YAAAR;AAAA,YACAK;AAAA,UAAA,EAAA,CACH;AAAA,QAAA;AAAA,MAAA;AAAA,MAKJ,gBAAAJ,EAACQ,KACE,UAAAxB,KACC,gBAAAgB;AAAA,QAACS,EAAO;AAAA,QAAP;AAAA,UACC,SAAS,EAAE,SAAS,GAAG,GAAG,IAAA;AAAA,UAC1B,SAAS,EAAE,SAAS,GAAG,GAAG,EAAA;AAAA,UAC1B,MAAM,EAAE,SAAS,GAAG,GAAG,IAAA;AAAA,UACvB,YAAY,EAAE,UAAU,IAAA;AAAA,UACxB,IAAI,GAAGhC,CAAE;AAAA,UACT,MAAMQ,MAAgB,UAAU,UAAU;AAAA,UAE1C,UAAA,gBAAAe;AAAA,YAACM;AAAA,YAAA;AAAA,cACC,WAAWH,EAAG,QAAQN,GAA2B;AAAA,cACjD,YAAW;AAAA,cACX,MAAK;AAAA,cACL,SAAQ;AAAA,cAEP,UAAAb;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA,EACF,CAEJ;AAAA,IAAA,GACF;AAAA,EAEJ;AACF;AAEAT,EAAS,cAAc;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("@mui/icons-material"),C=require("antd"),S=require("../../../_virtual/index.cjs.js"),d=require("react"),x=require("../../button/Button.cjs.js"),a=require("../../data-display/typography/Typography.cjs.js"),L=require("../../forms/base-input-field/BaseInputField.cjs.js"),M=require("../../forms/select-field/SelectField.cjs.js"),j=require("../../forms/toggle/Toggle.cjs.js"),q=require("../../button/IconButton.cjs.js"),y=require("./types.cjs.js"),l=require("../../icon/icons.generated.cjs.js"),A=({fontSize:t=24,className:i})=>e.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i,children:e.jsx("path",{d:"M3.5 7H9.5M3.5 12H7.5M3.5 17H5.5M14 16L17 19M17 19L20 16M17 19V5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),B=({fontSize:t=24,className:i})=>e.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i,children:e.jsx("path",{d:"M3.5 17H9.5M3.5 12H7.5M3.5 7H5.5M14 8L17 5M17 5L20 8M17 5V19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),F=[{label:"Default",value:"default",icon:e.jsx(l.FormatListBulletedIcon,{className:"w-icon h-icon"})},{label:"A-Z",value:"asc",icon:e.jsx(A,{className:"w-icon h-icon"})},{label:"Z-A",value:"desc",icon:e.jsx(B,{className:"w-icon h-icon"})}],V=({savedConfig:t,onApplyFilter:i,setUnsavedChanges:f,handleTabSort:w,onSearchChange:m,hasSuffixRecord:v=!1})=>{const[N,u]=d.useState(!1),[r,p]=d.useState(y.INITIAL_TAB_OPTION_CONFIG),[n,g]=d.useState(""),c=(s,h)=>{p(I=>({...I,[s]:h}))},k=()=>{p({filterType:{label:"Contains",value:"contains"},sortOrder:"default",showCounts:!0,lockOrder:!1}),g(""),m("","contains")},O=()=>{i({filterType:r.filterType,sortOrder:r.sortOrder,showCounts:r.showCounts,lockOrder:r.lockOrder}),w(r.sortOrder),f(!0),u(!1),n&&m(n,r.filterType.value)};d.useEffect(()=>{t&&JSON.stringify(t)!==JSON.stringify(r)&&p(t)},[t]);const T=e.jsxs("div",{children:[e.jsxs("div",{className:"p-5 space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(a.Typography,{size:"extra-small",variant:"regular",className:"!text-neutral-600 dark:!text-neutral-400 uppercase",appearance:"title",children:[e.jsx(o.Search,{sx:{height:"14px",width:"14px"}})," Filter Tabs"]}),e.jsxs("div",{className:"grid grid-cols-[150px_3fr] gap-2",children:[e.jsx(M.SelectField,{showSearch:!1,allowClear:!1,value:r.filterType,onChange:s=>c("filterType",s),options:[{label:"Contains",value:"contains"},{label:"Does not contain",value:"does-not-contain"}]}),e.jsx(L.BaseInputField,{id:"base-input-field-tab-options-filter",placeholder:"Insert value",value:n,onChange:s=>g(s),isClearable:!0})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(a.Typography,{size:"extra-small",variant:"regular",className:"!text-neutral-600 dark:!text-neutral-400 uppercase",appearance:"title",children:[e.jsx(o.SwapVertOutlined,{sx:{height:"14px",width:"14px"}})," Sort"]}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:F.map(s=>{const h=r.sortOrder===s.value;return e.jsxs(x,{appearance:"outline",status:h?"secondary":"secondary-neutral",id:`sort-option-${s.value}`,onClick:()=>c("sortOrder",s.value),className:"w-full",children:[s.icon,s.label]},s.value)})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(a.Typography,{size:"extra-small",variant:"regular",className:"!text-neutral-600 dark:!text-neutral-400 uppercase",appearance:"title",children:[e.jsx(o.VisibilityOutlined,{sx:{height:"14px",width:"14px"}})," Display Options"]}),v&&e.jsxs("div",{className:"rounded-lg border-0 bg-neutral-100 dark:bg-neutral-800 flex items-center justify-between w-full py-2 px-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex items-center h-8 w-8 justify-center bg-white dark:bg-neutral-700 rounded-lg",children:e.jsx(l.TagIcon,{className:"text-neutral-800 dark:text-white h-icon w-icon"})}),e.jsxs("div",{className:"flex flex-col gap-0",children:[e.jsx(a.Typography,{size:"small",variant:"medium",appearance:"title",children:"Show Counts"}),e.jsx(a.Typography,{size:"extra-small",variant:"regular",appearance:"subtitle",children:"Display item counts on tabs"})]})]}),e.jsx("div",{className:"flex items-center justify-end",children:e.jsx(j.Toggle,{isChecked:r.showCounts,onChange:s=>c("showCounts",s),hideStatus:!0,icon:{checkedIcon:e.jsx(l.VisibilityIcon,{className:"cursor-pointer !block text-primary-600 dark:text-primary-400 w-sm h-sm"}),uncheckedIcon:e.jsx(l.VisibilityOffIcon,{className:"cursor-pointer !block text-neutral-700 dark:text-neutral-300 w-sm h-sm"})},withIcon:!0})})]}),e.jsxs("div",{className:"rounded-lg border-0 bg-neutral-100 dark:bg-neutral-800 flex items-center justify-between w-full py-2 px-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex items-center justify-center h-8 w-8 bg-white dark:bg-primary-800 rounded-lg",children:e.jsx(l.LockIcon,{className:"text-neutral-800 dark:text-white w-icon h-icon"})}),e.jsxs("div",{className:"flex flex-col gap-0",children:[e.jsx(a.Typography,{size:"small",variant:"medium",appearance:"title",children:"Lock Order"}),e.jsx(a.Typography,{size:"extra-small",variant:"regular",appearance:"subtitle",children:"Prevent tab reordering"})]})]}),e.jsx("div",{className:"flex items-center justify-end",children:e.jsx(j.Toggle,{isChecked:r.lockOrder,onChange:s=>c("lockOrder",s),hideStatus:!0,withIcon:!0,icon:{checkedIcon:e.jsx(l.LockIcon,{className:"cursor-pointer !block text-primary-600 dark:text-primary-400 w-sm h-sm"}),uncheckedIcon:e.jsx(l.LockOpenIcon,{className:"cursor-pointer !block text-neutral-700 w-sm h-sm"})}})})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 border-t border-neutral-200 dark:border-neutral-800 p-5",children:[e.jsx(x,{id:"btn-tab-options-reset",appearance:"outline",status:"cancel",className:"w-full",onClick:k,children:"Reset"}),e.jsx(x,{id:"btn-tab-options-apply",appearance:"filled",status:"primary",className:"w-full",onClick:O,disabled:JSON.stringify(t)===JSON.stringify(r)&&n==="",children:"Apply"})]})]});return e.jsx(C.Popover,{classNames:{body:"rounded-md w-[348px] !p-0"},placement:"bottomLeft",content:T,trigger:["click"],arrow:!1,open:N,onOpenChange:u,children:e.jsx("div",{className:"border-l border-neutral-200 dark:border-neutral-800 pl-2",children:e.jsxs(q,{tooltip:"Manage Tabs",variant:"ghost",className:"!text-neutral-400 hover:!text-primary-600 dark:hover:!bg-primary-900 relative",onClick:()=>u(!0),children:[e.jsx(o.Tune,{sx:{height:"20px",width:"20px"}}),JSON.stringify(r)!==JSON.stringify(y.INITIAL_TAB_OPTION_CONFIG)&&e.jsx(b,{className:"text-primary-600"})]})})})},b=({className:t})=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"5",height:"5",viewBox:"0 0 4 4",fill:"none",className:S("absolute top-0.5 right-0.5",t),children:e.jsx("circle",{cx:"2",cy:"2",r:"2",fill:"currentColor"})});exports.Indicator=b;exports.TabOptions=V;
|
|
2
2
|
//# sourceMappingURL=TabOptions.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabOptions.cjs.js","sources":["../../../../src/components/navigation/tabs/TabOptions.tsx"],"sourcesContent":["import {\n Search,\n SwapVertOutlined,\n TagOutlined,\n Tune,\n VisibilityOutlined,\n} from '@mui/icons-material';\nimport { Popover } from 'antd';\nimport classNames from 'classnames';\nimport { useEffect, useState } from 'react';\nimport Button from '../../button/Button';\nimport { Typography } from '../../data-display/typography/Typography';\nimport { BaseInputField } from '../../forms/base-input-field/BaseInputField';\nimport { SelectField } from '../../forms/select-field/SelectField';\nimport { Toggle } from '../../forms/toggle/Toggle';\nimport IconButton from '../../button/IconButton';\nimport type { TabOptionConfig } from './types';\nimport { INITIAL_TAB_OPTION_CONFIG } from './types';\nimport { FormatListBulletedIcon, LockIcon, LockOpenIcon, VisibilityIcon, VisibilityOffIcon } from '../../icon';\n\ntype TabOptionsProps = {\n savedConfig: TabOptionConfig;\n onApplyFilter: (config: TabOptionConfig) => void;\n setUnsavedChanges: (unsavedChanges: boolean) => void;\n handleTabSort: (order: 'asc' | 'desc') => void;\n onSearchChange: (searchValue: string, filterType: 'contains' | 'does-not-contain') => void;\n hasSuffixRecord: boolean;\n};\n\nconst SortAlphabetDownIcon = ({ fontSize = 24, className }: { fontSize?: number; className?: string }) => (\n <svg width={fontSize} height={fontSize} viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" className={className}>\n <path d=\"M3.5 7H9.5M3.5 12H7.5M3.5 17H5.5M14 16L17 19M17 19L20 16M17 19V5\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n);\n\nconst SortAlphabetUpIcon = ({ fontSize = 24, className }: { fontSize?: number; className?: string }) => (\n <svg width={fontSize} height={fontSize} viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" className={className}>\n <path d=\"M3.5 17H9.5M3.5 12H7.5M3.5 7H5.5M14 8L17 5M17 5L20 8M17 5V19\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n);\n\nconst SORT_OPTIONS = [\n {\n label: 'Default',\n value: 'default',\n icon: <FormatListBulletedIcon className='w-icon h-icon' />,\n },\n {\n label: 'A-Z',\n value: 'asc',\n icon: <SortAlphabetDownIcon className='w-icon h-icon' />,\n },\n {\n label: 'Z-A',\n value: 'desc',\n icon: <SortAlphabetUpIcon className='w-icon h-icon' />,\n },\n];\n\nexport const TabOptions = ({\n savedConfig,\n onApplyFilter,\n setUnsavedChanges,\n handleTabSort,\n onSearchChange,\n hasSuffixRecord = false,\n}: TabOptionsProps) => {\n const [isTabOptionsVisible, setIsTabOptionsVisible] = useState(false);\n const [tabOptionConfig, setTabOptionConfig] = useState<TabOptionConfig>(INITIAL_TAB_OPTION_CONFIG);\n const [filterValue, setFilterValue] = useState('');\n\n const handleConfigChange = <K extends keyof typeof tabOptionConfig>(key: K, value: (typeof tabOptionConfig)[K]) => {\n setTabOptionConfig((prev) => ({\n ...prev,\n [key]: value,\n }));\n };\n\n const handleReset = () => {\n setTabOptionConfig({\n filterType: { label: 'Contains', value: 'contains' },\n sortOrder: 'default',\n showCounts: true,\n lockOrder: false,\n });\n setFilterValue('');\n onSearchChange('', 'contains');\n };\n\n const applyFilter = () => {\n onApplyFilter({\n filterType: tabOptionConfig.filterType,\n sortOrder: tabOptionConfig.sortOrder,\n showCounts: tabOptionConfig.showCounts,\n lockOrder: tabOptionConfig.lockOrder,\n });\n handleTabSort(tabOptionConfig.sortOrder as 'asc' | 'desc');\n setUnsavedChanges(true);\n setIsTabOptionsVisible(false);\n if (filterValue) {\n onSearchChange(filterValue, tabOptionConfig.filterType.value);\n }\n };\n\n useEffect(() => {\n if (savedConfig && JSON.stringify(savedConfig) !== JSON.stringify(tabOptionConfig)) {\n setTabOptionConfig(savedConfig);\n }\n }, [savedConfig]);\n\n const content = (\n <div>\n <div className=\"p-5 space-y-5\">\n <div className=\"space-y-2\">\n <Typography size=\"extra-small\" variant=\"regular\" className=\"!text-neutral-600 dark:!text-neutral-400 uppercase\" appearance=\"title\">\n <Search sx={{ height: '14px', width: '14px' }} /> Filter Tabs\n </Typography>\n <div className=\"grid grid-cols-[150px_3fr] gap-2\">\n <SelectField\n showSearch={false}\n allowClear={false}\n value={tabOptionConfig.filterType}\n onChange={(value) => handleConfigChange('filterType', value)}\n options={[\n { label: 'Contains', value: 'contains' },\n { label: 'Does not contain', value: 'does-not-contain' },\n ]}\n />\n <BaseInputField\n id=\"base-input-field-tab-options-filter\"\n placeholder=\"Insert value\"\n value={filterValue}\n onChange={(value: string) => setFilterValue(value)}\n isClearable\n />\n </div>\n </div>\n <div className=\"space-y-2\">\n <Typography size=\"extra-small\" variant=\"regular\" className=\"!text-neutral-600 dark:!text-neutral-400 uppercase\" appearance=\"title\">\n <SwapVertOutlined sx={{ height: '14px', width: '14px' }} /> Sort\n </Typography>\n <div className=\"grid grid-cols-3 gap-2\">\n {SORT_OPTIONS.map((option) => {\n const isActive = tabOptionConfig.sortOrder === option.value;\n return (\n <Button\n appearance=\"outline\"\n status={isActive ? 'secondary' : 'secondary-neutral'}\n id={`sort-option-${option.value}`}\n onClick={() => handleConfigChange('sortOrder', option.value as 'default' | 'asc' | 'desc')}\n className=\"w-full\"\n key={option.value}\n >\n {option.icon}\n {option.label}\n </Button>\n );\n })}\n </div>\n </div>\n <div className=\"space-y-2\">\n <Typography size=\"extra-small\" variant=\"regular\" className=\"!text-neutral-600 dark:!text-neutral-400 uppercase\" appearance=\"title\">\n <VisibilityOutlined sx={{ height: '14px', width: '14px' }} /> Display Options\n </Typography>\n {hasSuffixRecord && (\n <div className=\"rounded-lg border-0 bg-neutral-100 dark:bg-neutral-800 flex items-center justify-between w-full py-2 px-3\">\n <div className=\"flex items-center gap-2\">\n <div className=\"flex items-center justify-center h-8 w-8 bg-white dark:bg-neutral-700 rounded-lg\">\n <TagOutlined sx={{ height: '16px', width: '16px' }} className=\"text-neutral-800 dark:text-white\" />\n </div>\n <div className=\"flex flex-col gap-0\">\n <Typography size=\"small\" variant=\"medium\" appearance=\"title\">\n Show Counts\n </Typography>\n <Typography size=\"extra-small\" variant=\"regular\" appearance=\"subtitle\">\n Display item counts on tabs\n </Typography>\n </div>\n </div>\n <div className=\"flex items-center justify-end\">\n <Toggle\n isChecked={tabOptionConfig.showCounts}\n onChange={(v) => handleConfigChange('showCounts', v)}\n hideStatus\n icon={{\n checkedIcon: <VisibilityIcon className=\"cursor-pointer !block text-primary-600 dark:text-primary-400 w-sm h-sm\" />,\n uncheckedIcon: <VisibilityOffIcon className=\"cursor-pointer !block text-neutral-700 dark:text-neutral-300 w-sm h-sm\" />,\n }}\n withIcon\n />\n </div>\n </div>\n )}\n <div className=\"rounded-lg border-0 bg-neutral-100 dark:bg-neutral-800 flex items-center justify-between w-full py-2 px-3\">\n <div className=\"flex items-center gap-2\">\n <div className=\"flex items-center justify-center h-8 w-8 bg-white dark:bg-neutral-700 rounded-lg\">\n <LockIcon className=\"text-neutral-800 dark:text-white w-icon h-icon\" />\n </div>\n <div className=\"flex flex-col gap-0\">\n <Typography size=\"small\" variant=\"medium\" appearance=\"title\">\n Lock Order\n </Typography>\n <Typography size=\"extra-small\" variant=\"regular\" appearance=\"subtitle\">\n Prevent tab reordering\n </Typography>\n </div>\n </div>\n <div className=\"flex items-center justify-end\">\n <Toggle\n isChecked={tabOptionConfig.lockOrder}\n onChange={(v) => handleConfigChange('lockOrder', v)}\n hideStatus\n withIcon\n icon={{\n checkedIcon: <LockIcon className=\"cursor-pointer !block text-primary-600 dark:text-primary-400 w-sm h-sm\" />,\n uncheckedIcon: <LockOpenIcon className=\"cursor-pointer !block text-neutral-700 w-sm h-sm\" />,\n }}\n />\n </div>\n </div>\n </div>\n </div>\n <div className=\"grid grid-cols-2 gap-2 border-t border-neutral-200 dark:border-neutral-800 p-5\">\n <Button id=\"btn-tab-options-reset\" appearance=\"outline\" status=\"cancel\" className=\"w-full\" onClick={handleReset}>\n Reset\n </Button>\n <Button\n id=\"btn-tab-options-apply\"\n appearance=\"filled\"\n status=\"primary\"\n className=\"w-full\"\n onClick={applyFilter}\n disabled={JSON.stringify(savedConfig) === JSON.stringify(tabOptionConfig) && filterValue === ''}\n >\n Apply\n </Button>\n </div>\n </div>\n );\n\n return (\n <Popover\n classNames={{\n body: 'rounded-md w-[348px] !p-0',\n }}\n placement=\"bottomLeft\"\n content={content}\n trigger={['click']}\n arrow={false}\n open={isTabOptionsVisible}\n onOpenChange={setIsTabOptionsVisible}\n >\n <div className=\"border-l border-neutral-200 dark:border-neutral-800 pl-2\">\n <IconButton\n tooltip=\"Manage Tabs\"\n variant=\"ghost\"\n className=\"!text-neutral-400 hover:!text-primary-600 dark:hover:!bg-primary-900 relative\"\n onClick={() => setIsTabOptionsVisible(true)}\n >\n <Tune sx={{ height: '20px', width: '20px' }} />\n {JSON.stringify(tabOptionConfig) !== JSON.stringify(INITIAL_TAB_OPTION_CONFIG) && <Indicator className=\"text-primary-600\" />}\n </IconButton>\n </div>\n </Popover>\n );\n};\n\nexport const Indicator = ({ className }: { className?: string }) => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"5\"\n height=\"5\"\n viewBox=\"0 0 4 4\"\n fill=\"none\"\n className={classNames('absolute top-0.5 right-0.5', className)}\n >\n <circle cx=\"2\" cy=\"2\" r=\"2\" fill=\"currentColor\" />\n </svg>\n );\n};\n"],"names":["SortAlphabetDownIcon","fontSize","className","jsx","SortAlphabetUpIcon","SORT_OPTIONS","FormatListBulletedIcon","TabOptions","savedConfig","onApplyFilter","setUnsavedChanges","handleTabSort","onSearchChange","hasSuffixRecord","isTabOptionsVisible","setIsTabOptionsVisible","useState","tabOptionConfig","setTabOptionConfig","INITIAL_TAB_OPTION_CONFIG","filterValue","setFilterValue","handleConfigChange","key","value","prev","handleReset","applyFilter","useEffect","content","jsxs","Typography","Search","SelectField","BaseInputField","SwapVertOutlined","option","isActive","Button","VisibilityOutlined","TagOutlined","Toggle","v","VisibilityIcon","VisibilityOffIcon","LockIcon","LockOpenIcon","Popover","IconButton","Tune","Indicator","classNames"],"mappings":"0mBA6BMA,EAAuB,CAAC,CAAE,SAAAC,EAAW,GAAI,UAAAC,CAAA,IAC7CC,EAAAA,IAAC,MAAA,CAAI,MAAOF,EAAU,OAAQA,EAAU,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAA6B,UAAAC,EACzG,SAAAC,EAAAA,IAAC,OAAA,CAAK,EAAE,mEAAmE,OAAO,eAAe,YAAY,MAAM,cAAc,QAAQ,eAAe,QAAQ,EAClK,EAGIC,EAAqB,CAAC,CAAE,SAAAH,EAAW,GAAI,UAAAC,CAAA,IAC3CC,EAAAA,IAAC,MAAA,CAAI,MAAOF,EAAU,OAAQA,EAAU,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAA6B,UAAAC,EACzG,SAAAC,EAAAA,IAAC,OAAA,CAAK,EAAE,+DAA+D,OAAO,eAAe,YAAY,MAAM,cAAc,QAAQ,eAAe,QAAQ,EAC9J,EAGIE,EAAe,CACnB,CACE,MAAO,U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AAA,CACF,CAAA,EACF,EAGF,OACEjB,EAAAA,IAAC4C,EAAAA,QAAA,CACC,WAAY,CACV,KAAM,2BAAA,EAER,UAAU,aACV,QAAAlB,EACA,QAAS,CAAC,OAAO,EACjB,MAAO,GACP,KAAMf,EACN,aAAcC,EAEd,SAAAZ,EAAAA,IAAC,MAAA,CAAI,UAAU,2DACb,SAAA2B,EAAAA,KAACkB,EAAA,CACC,QAAQ,cACR,QAAQ,QACR,UAAU,gFACV,QAAS,IAAMjC,EAAuB,EAAI,EAE1C,SAAA,CAAAZ,MAAC8C,EAAAA,MAAK,GAAI,CAAE,OAAQ,OAAQ,MAAO,QAAU,EAC5C,KAAK,UAAUhC,CAAe,IAAM,KAAK,UAAUE,2BAAyB,GAAKhB,MAAC+C,EAAA,CAAU,UAAU,kBAAA,CAAmB,CAAA,CAAA,CAAA,CAC5H,CACF,CAAA,CAAA,CAGN,EAEaA,EAAY,CAAC,CAAE,UAAAhD,KAExBC,EAAAA,IAAC,MAAA,CACC,MAAM,6BACN,MAAM,IACN,OAAO,IACP,QAAQ,UACR,KAAK,OACL,UAAWgD,EAAW,6BAA8BjD,CAAS,EAE7D,SAAAC,EAAAA,IAAC,UAAO,GAAG,IAAI,GAAG,IAAI,EAAE,IAAI,KAAK,cAAA,CAAe,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"TabOptions.cjs.js","sources":["../../../../src/components/navigation/tabs/TabOptions.tsx"],"sourcesContent":["import {\n Search,\n SwapVertOutlined,\n Tune,\n VisibilityOutlined,\n} from '@mui/icons-material';\nimport { Popover } from 'antd';\nimport classNames from 'classnames';\nimport { useEffect, useState } from 'react';\nimport Button from '../../button/Button';\nimport { Typography } from '../../data-display/typography/Typography';\nimport { BaseInputField } from '../../forms/base-input-field/BaseInputField';\nimport { SelectField } from '../../forms/select-field/SelectField';\nimport { Toggle } from '../../forms/toggle/Toggle';\nimport IconButton from '../../button/IconButton';\nimport type { TabOptionConfig } from './types';\nimport { INITIAL_TAB_OPTION_CONFIG } from './types';\nimport { FormatListBulletedIcon, LockIcon, LockOpenIcon, TagIcon, VisibilityIcon, VisibilityOffIcon } from '../../icon';\n\ntype TabOptionsProps = {\n savedConfig: TabOptionConfig;\n onApplyFilter: (config: TabOptionConfig) => void;\n setUnsavedChanges: (unsavedChanges: boolean) => void;\n handleTabSort: (order: 'asc' | 'desc') => void;\n onSearchChange: (searchValue: string, filterType: 'contains' | 'does-not-contain') => void;\n hasSuffixRecord: boolean;\n};\n\nconst SortAlphabetDownIcon = ({ fontSize = 24, className }: { fontSize?: number; className?: string }) => (\n <svg width={fontSize} height={fontSize} viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" className={className}>\n <path d=\"M3.5 7H9.5M3.5 12H7.5M3.5 17H5.5M14 16L17 19M17 19L20 16M17 19V5\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n);\n\nconst SortAlphabetUpIcon = ({ fontSize = 24, className }: { fontSize?: number; className?: string }) => (\n <svg width={fontSize} height={fontSize} viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" className={className}>\n <path d=\"M3.5 17H9.5M3.5 12H7.5M3.5 7H5.5M14 8L17 5M17 5L20 8M17 5V19\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n);\n\nconst SORT_OPTIONS = [\n {\n label: 'Default',\n value: 'default',\n icon: <FormatListBulletedIcon className='w-icon h-icon' />,\n },\n {\n label: 'A-Z',\n value: 'asc',\n icon: <SortAlphabetDownIcon className='w-icon h-icon' />,\n },\n {\n label: 'Z-A',\n value: 'desc',\n icon: <SortAlphabetUpIcon className='w-icon h-icon' />,\n },\n];\n\nexport const TabOptions = ({\n savedConfig,\n onApplyFilter,\n setUnsavedChanges,\n handleTabSort,\n onSearchChange,\n hasSuffixRecord = false,\n}: TabOptionsProps) => {\n const [isTabOptionsVisible, setIsTabOptionsVisible] = useState(false);\n const [tabOptionConfig, setTabOptionConfig] = useState<TabOptionConfig>(INITIAL_TAB_OPTION_CONFIG);\n const [filterValue, setFilterValue] = useState('');\n\n const handleConfigChange = <K extends keyof typeof tabOptionConfig>(key: K, value: (typeof tabOptionConfig)[K]) => {\n setTabOptionConfig((prev) => ({\n ...prev,\n [key]: value,\n }));\n };\n\n const handleReset = () => {\n setTabOptionConfig({\n filterType: { label: 'Contains', value: 'contains' },\n sortOrder: 'default',\n showCounts: true,\n lockOrder: false,\n });\n setFilterValue('');\n onSearchChange('', 'contains');\n };\n\n const applyFilter = () => {\n onApplyFilter({\n filterType: tabOptionConfig.filterType,\n sortOrder: tabOptionConfig.sortOrder,\n showCounts: tabOptionConfig.showCounts,\n lockOrder: tabOptionConfig.lockOrder,\n });\n handleTabSort(tabOptionConfig.sortOrder as 'asc' | 'desc');\n setUnsavedChanges(true);\n setIsTabOptionsVisible(false);\n if (filterValue) {\n onSearchChange(filterValue, tabOptionConfig.filterType.value);\n }\n };\n\n useEffect(() => {\n if (savedConfig && JSON.stringify(savedConfig) !== JSON.stringify(tabOptionConfig)) {\n setTabOptionConfig(savedConfig);\n }\n }, [savedConfig]);\n\n const content = (\n <div>\n <div className=\"p-5 space-y-5\">\n <div className=\"space-y-2\">\n <Typography size=\"extra-small\" variant=\"regular\" className=\"!text-neutral-600 dark:!text-neutral-400 uppercase\" appearance=\"title\">\n <Search sx={{ height: '14px', width: '14px' }} /> Filter Tabs\n </Typography>\n <div className=\"grid grid-cols-[150px_3fr] gap-2\">\n <SelectField\n showSearch={false}\n allowClear={false}\n value={tabOptionConfig.filterType}\n onChange={(value) => handleConfigChange('filterType', value)}\n options={[\n { label: 'Contains', value: 'contains' },\n { label: 'Does not contain', value: 'does-not-contain' },\n ]}\n />\n <BaseInputField\n id=\"base-input-field-tab-options-filter\"\n placeholder=\"Insert value\"\n value={filterValue}\n onChange={(value: string) => setFilterValue(value)}\n isClearable\n />\n </div>\n </div>\n <div className=\"space-y-2\">\n <Typography size=\"extra-small\" variant=\"regular\" className=\"!text-neutral-600 dark:!text-neutral-400 uppercase\" appearance=\"title\">\n <SwapVertOutlined sx={{ height: '14px', width: '14px' }} /> Sort\n </Typography>\n <div className=\"grid grid-cols-3 gap-2\">\n {SORT_OPTIONS.map((option) => {\n const isActive = tabOptionConfig.sortOrder === option.value;\n return (\n <Button\n appearance=\"outline\"\n status={isActive ? 'secondary' : 'secondary-neutral'}\n id={`sort-option-${option.value}`}\n onClick={() => handleConfigChange('sortOrder', option.value as 'default' | 'asc' | 'desc')}\n className=\"w-full\"\n key={option.value}\n >\n {option.icon}\n {option.label}\n </Button>\n );\n })}\n </div>\n </div>\n <div className=\"space-y-2\">\n <Typography size=\"extra-small\" variant=\"regular\" className=\"!text-neutral-600 dark:!text-neutral-400 uppercase\" appearance=\"title\">\n <VisibilityOutlined sx={{ height: '14px', width: '14px' }} /> Display Options\n </Typography>\n {hasSuffixRecord && (\n <div className=\"rounded-lg border-0 bg-neutral-100 dark:bg-neutral-800 flex items-center justify-between w-full py-2 px-3\">\n <div className=\"flex items-center gap-2\">\n <div className=\"flex items-center h-8 w-8 justify-center bg-white dark:bg-neutral-700 rounded-lg\">\n <TagIcon className=\"text-neutral-800 dark:text-white h-icon w-icon\" />\n </div>\n <div className=\"flex flex-col gap-0\">\n <Typography size=\"small\" variant=\"medium\" appearance=\"title\">\n Show Counts\n </Typography>\n <Typography size=\"extra-small\" variant=\"regular\" appearance=\"subtitle\">\n Display item counts on tabs\n </Typography>\n </div>\n </div>\n <div className=\"flex items-center justify-end\">\n <Toggle\n isChecked={tabOptionConfig.showCounts}\n onChange={(v) => handleConfigChange('showCounts', v)}\n hideStatus\n icon={{\n checkedIcon: <VisibilityIcon className=\"cursor-pointer !block text-primary-600 dark:text-primary-400 w-sm h-sm\" />,\n uncheckedIcon: <VisibilityOffIcon className=\"cursor-pointer !block text-neutral-700 dark:text-neutral-300 w-sm h-sm\" />,\n }}\n withIcon\n />\n </div>\n </div>\n )}\n <div className=\"rounded-lg border-0 bg-neutral-100 dark:bg-neutral-800 flex items-center justify-between w-full py-2 px-3\">\n <div className=\"flex items-center gap-2\">\n <div className=\"flex items-center justify-center h-8 w-8 bg-white dark:bg-primary-800 rounded-lg\">\n <LockIcon className=\"text-neutral-800 dark:text-white w-icon h-icon\" />\n </div>\n <div className=\"flex flex-col gap-0\">\n <Typography size=\"small\" variant=\"medium\" appearance=\"title\">\n Lock Order\n </Typography>\n <Typography size=\"extra-small\" variant=\"regular\" appearance=\"subtitle\">\n Prevent tab reordering\n </Typography>\n </div>\n </div>\n <div className=\"flex items-center justify-end\">\n <Toggle\n isChecked={tabOptionConfig.lockOrder}\n onChange={(v) => handleConfigChange('lockOrder', v)}\n hideStatus\n withIcon\n icon={{\n checkedIcon: <LockIcon className=\"cursor-pointer !block text-primary-600 dark:text-primary-400 w-sm h-sm\" />,\n uncheckedIcon: <LockOpenIcon className=\"cursor-pointer !block text-neutral-700 w-sm h-sm\" />,\n }}\n />\n </div>\n </div>\n </div>\n </div>\n <div className=\"grid grid-cols-2 gap-2 border-t border-neutral-200 dark:border-neutral-800 p-5\">\n <Button id=\"btn-tab-options-reset\" appearance=\"outline\" status=\"cancel\" className=\"w-full\" onClick={handleReset}>\n Reset\n </Button>\n <Button\n id=\"btn-tab-options-apply\"\n appearance=\"filled\"\n status=\"primary\"\n className=\"w-full\"\n onClick={applyFilter}\n disabled={JSON.stringify(savedConfig) === JSON.stringify(tabOptionConfig) && filterValue === ''}\n >\n Apply\n </Button>\n </div>\n </div>\n );\n\n return (\n <Popover\n classNames={{\n body: 'rounded-md w-[348px] !p-0',\n }}\n placement=\"bottomLeft\"\n content={content}\n trigger={['click']}\n arrow={false}\n open={isTabOptionsVisible}\n onOpenChange={setIsTabOptionsVisible}\n >\n <div className=\"border-l border-neutral-200 dark:border-neutral-800 pl-2\">\n <IconButton\n tooltip=\"Manage Tabs\"\n variant=\"ghost\"\n className=\"!text-neutral-400 hover:!text-primary-600 dark:hover:!bg-primary-900 relative\"\n onClick={() => setIsTabOptionsVisible(true)}\n >\n <Tune sx={{ height: '20px', width: '20px' }} />\n {JSON.stringify(tabOptionConfig) !== JSON.stringify(INITIAL_TAB_OPTION_CONFIG) && <Indicator className=\"text-primary-600\" />}\n </IconButton>\n </div>\n </Popover>\n );\n};\n\nexport const Indicator = ({ className }: { className?: string }) => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"5\"\n height=\"5\"\n viewBox=\"0 0 4 4\"\n fill=\"none\"\n className={classNames('absolute top-0.5 right-0.5', className)}\n >\n <circle cx=\"2\" cy=\"2\" r=\"2\" fill=\"currentColor\" />\n </svg>\n );\n};\n"],"names":["SortAlphabetDownIcon","fontSize","className","jsx","SortAlphabetUpIcon","SORT_OPTIONS","FormatListBulletedIcon","TabOptions","savedConfig","onApplyFilter","setUnsavedChanges","handleTabSort","onSearchChange","hasSuffixRecord","isTabOptionsVisible","setIsTabOptionsVisible","useState","tabOptionConfig","setTabOptionConfig","INITIAL_TAB_OPTION_CONFIG","filterValue","setFilterValue","handleConfigChange","key","value","prev","handleReset","applyFilter","useEffect","content","jsxs","Typography","Search","SelectField","BaseInputField","SwapVertOutlined","option","isActive","Button","VisibilityOutlined","TagIcon","Toggle","v","VisibilityIcon","VisibilityOffIcon","LockIcon","LockOpenIcon","Popover","IconButton","Tune","Indicator","classNames"],"mappings":"0mBA4BMA,EAAuB,CAAC,CAAE,SAAAC,EAAW,GAAI,UAAAC,CAAA,IAC7CC,EAAAA,IAAC,MAAA,CAAI,MAAOF,EAAU,OAAQA,EAAU,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAA6B,UAAAC,EACzG,SAAAC,EAAAA,IAAC,OAAA,CAAK,EAAE,mEAAmE,OAAO,eAAe,YAAY,MAAM,cAAc,QAAQ,eAAe,QAAQ,EAClK,EAGIC,EAAqB,CAAC,CAAE,SAAAH,EAAW,GAAI,UAAAC,CAAA,IAC3CC,EA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