analytica-frontend-lib 1.0.85 → 1.0.87
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/Accordation/index.js +0 -1
- package/dist/Accordation/index.mjs +0 -1
- package/dist/Alert/index.js +0 -1
- package/dist/Alert/index.mjs +0 -1
- package/dist/AlertDialog/index.js +0 -1
- package/dist/AlertDialog/index.mjs +0 -1
- package/dist/Alternative/index.js +0 -1
- package/dist/Alternative/index.mjs +0 -1
- package/dist/Auth/AuthProvider/index.js +0 -1
- package/dist/Auth/AuthProvider/index.mjs +0 -1
- package/dist/Auth/ProtectedRoute/index.js +0 -1
- package/dist/Auth/ProtectedRoute/index.mjs +0 -1
- package/dist/Auth/PublicRoute/index.js +0 -1
- package/dist/Auth/PublicRoute/index.mjs +0 -1
- package/dist/Auth/getRootDomain/index.js +0 -1
- package/dist/Auth/getRootDomain/index.mjs +0 -1
- package/dist/Auth/index.js +0 -1
- package/dist/Auth/index.mjs +0 -1
- package/dist/Auth/useApiConfig/index.js +0 -1
- package/dist/Auth/useApiConfig/index.mjs +0 -1
- package/dist/Auth/useAuth/index.js +0 -1
- package/dist/Auth/useAuth/index.mjs +0 -1
- package/dist/Auth/useAuthGuard/index.js +0 -1
- package/dist/Auth/useAuthGuard/index.mjs +0 -1
- package/dist/Auth/useRouteAuth/index.js +0 -1
- package/dist/Auth/useRouteAuth/index.mjs +0 -1
- package/dist/Auth/useUrlAuthentication/index.js +0 -1
- package/dist/Auth/useUrlAuthentication/index.mjs +0 -1
- package/dist/Auth/withAuth/index.js +0 -1
- package/dist/Auth/withAuth/index.mjs +0 -1
- package/dist/Auth/zustandAuthAdapter/index.js +0 -1
- package/dist/Auth/zustandAuthAdapter/index.mjs +0 -1
- package/dist/Badge/index.js +0 -1
- package/dist/Badge/index.mjs +0 -1
- package/dist/Button/index.js +0 -1
- package/dist/Button/index.mjs +0 -1
- package/dist/Calendar/index.js +0 -1
- package/dist/Calendar/index.mjs +0 -1
- package/dist/Card/index.js +0 -1
- package/dist/Card/index.mjs +0 -1
- package/dist/CheckBox/index.js +0 -1
- package/dist/CheckBox/index.mjs +0 -1
- package/dist/Chips/index.js +0 -1
- package/dist/Chips/index.mjs +0 -1
- package/dist/Divider/index.js +0 -1
- package/dist/Divider/index.mjs +0 -1
- package/dist/DropdownMenu/index.js +0 -1
- package/dist/DropdownMenu/index.mjs +0 -1
- package/dist/IconButton/index.js +0 -1
- package/dist/IconButton/index.mjs +0 -1
- package/dist/IconRoundedButton/index.js +0 -1
- package/dist/IconRoundedButton/index.mjs +0 -1
- package/dist/Input/index.js +0 -1
- package/dist/Input/index.mjs +0 -1
- package/dist/Menu/index.js +0 -1
- package/dist/Menu/index.mjs +0 -1
- package/dist/Modal/index.js +0 -1
- package/dist/Modal/index.mjs +0 -1
- package/dist/MultipleChoice/index.js +660 -0
- package/dist/MultipleChoice/index.mjs +647 -0
- package/dist/NavButton/index.js +0 -1
- package/dist/NavButton/index.mjs +0 -1
- package/dist/NotFound/index.js +0 -1
- package/dist/NotFound/index.mjs +0 -1
- package/dist/ProgressBar/index.js +0 -1
- package/dist/ProgressBar/index.mjs +0 -1
- package/dist/ProgressCircle/index.js +0 -1
- package/dist/ProgressCircle/index.mjs +0 -1
- package/dist/Quiz/index.js +957 -298
- package/dist/Quiz/index.mjs +974 -297
- package/dist/Quiz/useQuizStore/index.js +79 -35
- package/dist/Quiz/useQuizStore/index.mjs +79 -35
- package/dist/Radio/index.js +0 -1
- package/dist/Radio/index.mjs +0 -1
- package/dist/Select/index.js +2 -3
- package/dist/Select/index.mjs +2 -3
- package/dist/SelectionButton/index.js +0 -1
- package/dist/SelectionButton/index.mjs +0 -1
- package/dist/Skeleton/index.js +0 -1
- package/dist/Skeleton/index.mjs +0 -1
- package/dist/Stepper/index.js +0 -1
- package/dist/Stepper/index.mjs +0 -1
- package/dist/Table/index.js +0 -1
- package/dist/Table/index.mjs +0 -1
- package/dist/Text/index.js +0 -1
- package/dist/Text/index.mjs +0 -1
- package/dist/TextArea/index.js +0 -1
- package/dist/TextArea/index.mjs +0 -1
- package/dist/Toast/ToastStore/index.js +0 -1
- package/dist/Toast/ToastStore/index.mjs +0 -1
- package/dist/Toast/Toaster/index.js +0 -1
- package/dist/Toast/Toaster/index.mjs +0 -1
- package/dist/Toast/index.js +0 -1
- package/dist/Toast/index.mjs +0 -1
- package/dist/index.css +46 -1
- package/dist/index.js +1399 -937
- package/dist/index.mjs +1340 -868
- package/dist/styles.css +46 -1
- package/package.json +4 -2
- package/dist/Accordation/index.d.mts +0 -12
- package/dist/Accordation/index.d.ts +0 -12
- package/dist/Accordation/index.js.map +0 -1
- package/dist/Accordation/index.mjs.map +0 -1
- package/dist/Alert/index.d.mts +0 -13
- package/dist/Alert/index.d.ts +0 -13
- package/dist/Alert/index.js.map +0 -1
- package/dist/Alert/index.mjs.map +0 -1
- package/dist/AlertDialog/index.d.mts +0 -36
- package/dist/AlertDialog/index.d.ts +0 -36
- package/dist/AlertDialog/index.js.map +0 -1
- package/dist/AlertDialog/index.mjs.map +0 -1
- package/dist/Alternative/index.d.mts +0 -81
- package/dist/Alternative/index.d.ts +0 -81
- package/dist/Alternative/index.js.map +0 -1
- package/dist/Alternative/index.mjs.map +0 -1
- package/dist/Auth/AuthProvider/index.d.mts +0 -3
- package/dist/Auth/AuthProvider/index.d.ts +0 -3
- package/dist/Auth/AuthProvider/index.js.map +0 -1
- package/dist/Auth/AuthProvider/index.mjs.map +0 -1
- package/dist/Auth/ProtectedRoute/index.d.mts +0 -3
- package/dist/Auth/ProtectedRoute/index.d.ts +0 -3
- package/dist/Auth/ProtectedRoute/index.js.map +0 -1
- package/dist/Auth/ProtectedRoute/index.mjs.map +0 -1
- package/dist/Auth/PublicRoute/index.d.mts +0 -3
- package/dist/Auth/PublicRoute/index.d.ts +0 -3
- package/dist/Auth/PublicRoute/index.js.map +0 -1
- package/dist/Auth/PublicRoute/index.mjs.map +0 -1
- package/dist/Auth/getRootDomain/index.d.mts +0 -3
- package/dist/Auth/getRootDomain/index.d.ts +0 -3
- package/dist/Auth/getRootDomain/index.js.map +0 -1
- package/dist/Auth/getRootDomain/index.mjs.map +0 -1
- package/dist/Auth/index.d.mts +0 -312
- package/dist/Auth/index.d.ts +0 -312
- package/dist/Auth/index.js.map +0 -1
- package/dist/Auth/index.mjs.map +0 -1
- package/dist/Auth/useApiConfig/index.d.mts +0 -43
- package/dist/Auth/useApiConfig/index.d.ts +0 -43
- package/dist/Auth/useApiConfig/index.js.map +0 -1
- package/dist/Auth/useApiConfig/index.mjs.map +0 -1
- package/dist/Auth/useAuth/index.d.mts +0 -3
- package/dist/Auth/useAuth/index.d.ts +0 -3
- package/dist/Auth/useAuth/index.js.map +0 -1
- package/dist/Auth/useAuth/index.mjs.map +0 -1
- package/dist/Auth/useAuthGuard/index.d.mts +0 -3
- package/dist/Auth/useAuthGuard/index.d.ts +0 -3
- package/dist/Auth/useAuthGuard/index.js.map +0 -1
- package/dist/Auth/useAuthGuard/index.mjs.map +0 -1
- package/dist/Auth/useRouteAuth/index.d.mts +0 -3
- package/dist/Auth/useRouteAuth/index.d.ts +0 -3
- package/dist/Auth/useRouteAuth/index.js.map +0 -1
- package/dist/Auth/useRouteAuth/index.mjs.map +0 -1
- package/dist/Auth/useUrlAuthentication/index.d.mts +0 -58
- package/dist/Auth/useUrlAuthentication/index.d.ts +0 -58
- package/dist/Auth/useUrlAuthentication/index.js.map +0 -1
- package/dist/Auth/useUrlAuthentication/index.mjs.map +0 -1
- package/dist/Auth/withAuth/index.d.mts +0 -3
- package/dist/Auth/withAuth/index.d.ts +0 -3
- package/dist/Auth/withAuth/index.js.map +0 -1
- package/dist/Auth/withAuth/index.mjs.map +0 -1
- package/dist/Auth/zustandAuthAdapter/index.d.mts +0 -75
- package/dist/Auth/zustandAuthAdapter/index.d.ts +0 -75
- package/dist/Auth/zustandAuthAdapter/index.js.map +0 -1
- package/dist/Auth/zustandAuthAdapter/index.mjs.map +0 -1
- package/dist/Badge/index.d.mts +0 -46
- package/dist/Badge/index.d.ts +0 -46
- package/dist/Badge/index.js.map +0 -1
- package/dist/Badge/index.mjs.map +0 -1
- package/dist/Button/index.d.mts +0 -45
- package/dist/Button/index.d.ts +0 -45
- package/dist/Button/index.js.map +0 -1
- package/dist/Button/index.mjs.map +0 -1
- package/dist/Calendar/index.d.mts +0 -60
- package/dist/Calendar/index.d.ts +0 -60
- package/dist/Calendar/index.js.map +0 -1
- package/dist/Calendar/index.mjs.map +0 -1
- package/dist/Card/index.d.mts +0 -150
- package/dist/Card/index.d.ts +0 -150
- package/dist/Card/index.js.map +0 -1
- package/dist/Card/index.mjs.map +0 -1
- package/dist/CheckBox/index.d.mts +0 -74
- package/dist/CheckBox/index.d.ts +0 -74
- package/dist/CheckBox/index.js.map +0 -1
- package/dist/CheckBox/index.mjs.map +0 -1
- package/dist/Chips/index.d.mts +0 -41
- package/dist/Chips/index.d.ts +0 -41
- package/dist/Chips/index.js.map +0 -1
- package/dist/Chips/index.mjs.map +0 -1
- package/dist/Divider/index.d.mts +0 -32
- package/dist/Divider/index.d.ts +0 -32
- package/dist/Divider/index.js.map +0 -1
- package/dist/Divider/index.mjs.map +0 -1
- package/dist/DropdownMenu/index.d.mts +0 -68
- package/dist/DropdownMenu/index.d.ts +0 -68
- package/dist/DropdownMenu/index.js.map +0 -1
- package/dist/DropdownMenu/index.mjs.map +0 -1
- package/dist/IconButton/index.d.mts +0 -76
- package/dist/IconButton/index.d.ts +0 -76
- package/dist/IconButton/index.js.map +0 -1
- package/dist/IconButton/index.mjs.map +0 -1
- package/dist/IconRoundedButton/index.d.mts +0 -34
- package/dist/IconRoundedButton/index.d.ts +0 -34
- package/dist/IconRoundedButton/index.js.map +0 -1
- package/dist/IconRoundedButton/index.mjs.map +0 -1
- package/dist/Input/index.d.mts +0 -27
- package/dist/Input/index.d.ts +0 -27
- package/dist/Input/index.js.map +0 -1
- package/dist/Input/index.mjs.map +0 -1
- package/dist/Menu/index.d.mts +0 -48
- package/dist/Menu/index.d.ts +0 -48
- package/dist/Menu/index.js.map +0 -1
- package/dist/Menu/index.mjs.map +0 -1
- package/dist/Modal/index.d.mts +0 -66
- package/dist/Modal/index.d.ts +0 -66
- package/dist/Modal/index.js.map +0 -1
- package/dist/Modal/index.mjs.map +0 -1
- package/dist/NavButton/index.d.mts +0 -57
- package/dist/NavButton/index.d.ts +0 -57
- package/dist/NavButton/index.js.map +0 -1
- package/dist/NavButton/index.mjs.map +0 -1
- package/dist/NotFound/index.d.mts +0 -58
- package/dist/NotFound/index.d.ts +0 -58
- package/dist/NotFound/index.js.map +0 -1
- package/dist/NotFound/index.mjs.map +0 -1
- package/dist/ProgressBar/index.d.mts +0 -95
- package/dist/ProgressBar/index.d.ts +0 -95
- package/dist/ProgressBar/index.js.map +0 -1
- package/dist/ProgressBar/index.mjs.map +0 -1
- package/dist/ProgressCircle/index.d.mts +0 -60
- package/dist/ProgressCircle/index.d.ts +0 -60
- package/dist/ProgressCircle/index.js.map +0 -1
- package/dist/ProgressCircle/index.mjs.map +0 -1
- package/dist/Quiz/index.d.mts +0 -52
- package/dist/Quiz/index.d.ts +0 -52
- package/dist/Quiz/index.js.map +0 -1
- package/dist/Quiz/index.mjs.map +0 -1
- package/dist/Quiz/useQuizStore/index.d.mts +0 -140
- package/dist/Quiz/useQuizStore/index.d.ts +0 -140
- package/dist/Quiz/useQuizStore/index.js.map +0 -1
- package/dist/Quiz/useQuizStore/index.mjs.map +0 -1
- package/dist/Radio/index.d.mts +0 -203
- package/dist/Radio/index.d.ts +0 -203
- package/dist/Radio/index.js.map +0 -1
- package/dist/Radio/index.mjs.map +0 -1
- package/dist/Select/index.d.mts +0 -58
- package/dist/Select/index.d.ts +0 -58
- package/dist/Select/index.js.map +0 -1
- package/dist/Select/index.mjs.map +0 -1
- package/dist/SelectionButton/index.d.mts +0 -57
- package/dist/SelectionButton/index.d.ts +0 -57
- package/dist/SelectionButton/index.js.map +0 -1
- package/dist/SelectionButton/index.mjs.map +0 -1
- package/dist/Skeleton/index.d.mts +0 -40
- package/dist/Skeleton/index.d.ts +0 -40
- package/dist/Skeleton/index.js.map +0 -1
- package/dist/Skeleton/index.mjs.map +0 -1
- package/dist/Stepper/index.d.mts +0 -169
- package/dist/Stepper/index.d.ts +0 -169
- package/dist/Stepper/index.js.map +0 -1
- package/dist/Stepper/index.mjs.map +0 -1
- package/dist/Table/index.d.mts +0 -17
- package/dist/Table/index.d.ts +0 -17
- package/dist/Table/index.js.map +0 -1
- package/dist/Table/index.mjs.map +0 -1
- package/dist/Text/index.d.mts +0 -58
- package/dist/Text/index.d.ts +0 -58
- package/dist/Text/index.js.map +0 -1
- package/dist/Text/index.mjs.map +0 -1
- package/dist/TextArea/index.d.mts +0 -70
- package/dist/TextArea/index.d.ts +0 -70
- package/dist/TextArea/index.js.map +0 -1
- package/dist/TextArea/index.mjs.map +0 -1
- package/dist/Toast/ToastStore/index.d.mts +0 -19
- package/dist/Toast/ToastStore/index.d.ts +0 -19
- package/dist/Toast/ToastStore/index.js.map +0 -1
- package/dist/Toast/ToastStore/index.mjs.map +0 -1
- package/dist/Toast/Toaster/index.d.mts +0 -16
- package/dist/Toast/Toaster/index.d.ts +0 -16
- package/dist/Toast/Toaster/index.js.map +0 -1
- package/dist/Toast/Toaster/index.mjs.map +0 -1
- package/dist/Toast/index.d.mts +0 -17
- package/dist/Toast/index.d.ts +0 -17
- package/dist/Toast/index.js.map +0 -1
- package/dist/Toast/index.mjs.map +0 -1
- package/dist/index.css.map +0 -1
- package/dist/index.d.mts +0 -41
- package/dist/index.d.ts +0 -41
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/styles.css.map +0 -1
- package/dist/styles.d.mts +0 -2
- package/dist/styles.d.ts +0 -2
|
@@ -0,0 +1,660 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/components/MultipleChoice/MultipleChoice.tsx
|
|
21
|
+
var MultipleChoice_exports = {};
|
|
22
|
+
__export(MultipleChoice_exports, {
|
|
23
|
+
MultipleChoiceList: () => MultipleChoiceList
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(MultipleChoice_exports);
|
|
26
|
+
var import_react3 = require("react");
|
|
27
|
+
|
|
28
|
+
// src/components/CheckBox/CheckboxList.tsx
|
|
29
|
+
var import_react2 = require("react");
|
|
30
|
+
var import_zustand = require("zustand");
|
|
31
|
+
|
|
32
|
+
// src/components/CheckBox/CheckBox.tsx
|
|
33
|
+
var import_react = require("react");
|
|
34
|
+
|
|
35
|
+
// src/utils/utils.ts
|
|
36
|
+
var import_clsx = require("clsx");
|
|
37
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
38
|
+
function cn(...inputs) {
|
|
39
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// src/components/Text/Text.tsx
|
|
43
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
44
|
+
var Text = ({
|
|
45
|
+
children,
|
|
46
|
+
size = "md",
|
|
47
|
+
weight = "normal",
|
|
48
|
+
color = "text-text-950",
|
|
49
|
+
as,
|
|
50
|
+
className = "",
|
|
51
|
+
...props
|
|
52
|
+
}) => {
|
|
53
|
+
let sizeClasses = "";
|
|
54
|
+
let weightClasses = "";
|
|
55
|
+
const sizeClassMap = {
|
|
56
|
+
"2xs": "text-2xs",
|
|
57
|
+
xs: "text-xs",
|
|
58
|
+
sm: "text-sm",
|
|
59
|
+
md: "text-md",
|
|
60
|
+
lg: "text-lg",
|
|
61
|
+
xl: "text-xl",
|
|
62
|
+
"2xl": "text-2xl",
|
|
63
|
+
"3xl": "text-3xl",
|
|
64
|
+
"4xl": "text-4xl",
|
|
65
|
+
"5xl": "text-5xl",
|
|
66
|
+
"6xl": "text-6xl"
|
|
67
|
+
};
|
|
68
|
+
sizeClasses = sizeClassMap[size] ?? sizeClassMap.md;
|
|
69
|
+
const weightClassMap = {
|
|
70
|
+
hairline: "font-hairline",
|
|
71
|
+
light: "font-light",
|
|
72
|
+
normal: "font-normal",
|
|
73
|
+
medium: "font-medium",
|
|
74
|
+
semibold: "font-semibold",
|
|
75
|
+
bold: "font-bold",
|
|
76
|
+
extrabold: "font-extrabold",
|
|
77
|
+
black: "font-black"
|
|
78
|
+
};
|
|
79
|
+
weightClasses = weightClassMap[weight] ?? weightClassMap.normal;
|
|
80
|
+
const baseClasses = "font-primary";
|
|
81
|
+
const Component = as ?? "p";
|
|
82
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
83
|
+
Component,
|
|
84
|
+
{
|
|
85
|
+
className: cn(baseClasses, sizeClasses, weightClasses, color, className),
|
|
86
|
+
...props,
|
|
87
|
+
children
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
};
|
|
91
|
+
var Text_default = Text;
|
|
92
|
+
|
|
93
|
+
// src/components/CheckBox/CheckBox.tsx
|
|
94
|
+
var import_phosphor_react = require("phosphor-react");
|
|
95
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
96
|
+
var SIZE_CLASSES = {
|
|
97
|
+
small: {
|
|
98
|
+
checkbox: "w-4 h-4",
|
|
99
|
+
// 16px x 16px
|
|
100
|
+
textSize: "sm",
|
|
101
|
+
spacing: "gap-1.5",
|
|
102
|
+
// 6px
|
|
103
|
+
borderWidth: "border-2",
|
|
104
|
+
iconSize: 14,
|
|
105
|
+
// pixels for Phosphor icons
|
|
106
|
+
labelHeight: "h-[21px]"
|
|
107
|
+
},
|
|
108
|
+
medium: {
|
|
109
|
+
checkbox: "w-5 h-5",
|
|
110
|
+
// 20px x 20px
|
|
111
|
+
textSize: "md",
|
|
112
|
+
spacing: "gap-2",
|
|
113
|
+
// 8px
|
|
114
|
+
borderWidth: "border-2",
|
|
115
|
+
iconSize: 16,
|
|
116
|
+
// pixels for Phosphor icons
|
|
117
|
+
labelHeight: "h-6"
|
|
118
|
+
},
|
|
119
|
+
large: {
|
|
120
|
+
checkbox: "w-6 h-6",
|
|
121
|
+
// 24px x 24px
|
|
122
|
+
textSize: "lg",
|
|
123
|
+
spacing: "gap-2",
|
|
124
|
+
// 8px
|
|
125
|
+
borderWidth: "border-[3px]",
|
|
126
|
+
// 3px border
|
|
127
|
+
iconSize: 20,
|
|
128
|
+
// pixels for Phosphor icons
|
|
129
|
+
labelHeight: "h-[27px]"
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
var BASE_CHECKBOX_CLASSES = "rounded border cursor-pointer transition-all duration-200 flex items-center justify-center focus:outline-none";
|
|
133
|
+
var STATE_CLASSES = {
|
|
134
|
+
default: {
|
|
135
|
+
unchecked: "border-border-400 bg-background hover:border-border-500",
|
|
136
|
+
checked: "border-primary-950 bg-primary-950 text-text hover:border-primary-800 hover:bg-primary-800"
|
|
137
|
+
},
|
|
138
|
+
hovered: {
|
|
139
|
+
unchecked: "border-border-500 bg-background",
|
|
140
|
+
checked: "border-primary-800 bg-primary-800 text-text"
|
|
141
|
+
},
|
|
142
|
+
focused: {
|
|
143
|
+
unchecked: "border-indicator-info bg-background ring-2 ring-indicator-info/20",
|
|
144
|
+
checked: "border-indicator-info bg-primary-950 text-text ring-2 ring-indicator-info/20"
|
|
145
|
+
},
|
|
146
|
+
invalid: {
|
|
147
|
+
unchecked: "border-error-700 bg-background hover:border-error-600",
|
|
148
|
+
checked: "border-error-700 bg-primary-950 text-text"
|
|
149
|
+
},
|
|
150
|
+
disabled: {
|
|
151
|
+
unchecked: "border-border-400 bg-background cursor-not-allowed opacity-40",
|
|
152
|
+
checked: "border-primary-600 bg-primary-600 text-text cursor-not-allowed opacity-40"
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
var CheckBox = (0, import_react.forwardRef)(
|
|
156
|
+
({
|
|
157
|
+
label,
|
|
158
|
+
size = "medium",
|
|
159
|
+
state = "default",
|
|
160
|
+
indeterminate = false,
|
|
161
|
+
errorMessage,
|
|
162
|
+
helperText,
|
|
163
|
+
className = "",
|
|
164
|
+
labelClassName = "",
|
|
165
|
+
checked: checkedProp,
|
|
166
|
+
disabled,
|
|
167
|
+
id,
|
|
168
|
+
onChange,
|
|
169
|
+
...props
|
|
170
|
+
}, ref) => {
|
|
171
|
+
const generatedId = (0, import_react.useId)();
|
|
172
|
+
const inputId = id ?? `checkbox-${generatedId}`;
|
|
173
|
+
const [internalChecked, setInternalChecked] = (0, import_react.useState)(false);
|
|
174
|
+
const isControlled = checkedProp !== void 0;
|
|
175
|
+
const checked = isControlled ? checkedProp : internalChecked;
|
|
176
|
+
const handleChange = (event) => {
|
|
177
|
+
if (!isControlled) {
|
|
178
|
+
setInternalChecked(event.target.checked);
|
|
179
|
+
}
|
|
180
|
+
onChange?.(event);
|
|
181
|
+
};
|
|
182
|
+
const currentState = disabled ? "disabled" : state;
|
|
183
|
+
const sizeClasses = SIZE_CLASSES[size];
|
|
184
|
+
const checkVariant = checked || indeterminate ? "checked" : "unchecked";
|
|
185
|
+
const stylingClasses = STATE_CLASSES[currentState][checkVariant];
|
|
186
|
+
const borderWidthClass = state === "focused" || state === "hovered" && size === "large" ? "border-[3px]" : sizeClasses.borderWidth;
|
|
187
|
+
const checkboxClasses = cn(
|
|
188
|
+
BASE_CHECKBOX_CLASSES,
|
|
189
|
+
sizeClasses.checkbox,
|
|
190
|
+
borderWidthClass,
|
|
191
|
+
stylingClasses,
|
|
192
|
+
className
|
|
193
|
+
);
|
|
194
|
+
const renderIcon = () => {
|
|
195
|
+
if (indeterminate) {
|
|
196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
197
|
+
import_phosphor_react.Minus,
|
|
198
|
+
{
|
|
199
|
+
size: sizeClasses.iconSize,
|
|
200
|
+
weight: "bold",
|
|
201
|
+
color: "currentColor"
|
|
202
|
+
}
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
if (checked) {
|
|
206
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
207
|
+
import_phosphor_react.Check,
|
|
208
|
+
{
|
|
209
|
+
size: sizeClasses.iconSize,
|
|
210
|
+
weight: "bold",
|
|
211
|
+
color: "currentColor"
|
|
212
|
+
}
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
return null;
|
|
216
|
+
};
|
|
217
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex flex-col", children: [
|
|
218
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
219
|
+
"div",
|
|
220
|
+
{
|
|
221
|
+
className: cn(
|
|
222
|
+
"flex flex-row items-center",
|
|
223
|
+
sizeClasses.spacing,
|
|
224
|
+
disabled ? "opacity-40" : ""
|
|
225
|
+
),
|
|
226
|
+
children: [
|
|
227
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
228
|
+
"input",
|
|
229
|
+
{
|
|
230
|
+
ref,
|
|
231
|
+
type: "checkbox",
|
|
232
|
+
id: inputId,
|
|
233
|
+
checked,
|
|
234
|
+
disabled,
|
|
235
|
+
onChange: handleChange,
|
|
236
|
+
className: "sr-only",
|
|
237
|
+
...props
|
|
238
|
+
}
|
|
239
|
+
),
|
|
240
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { htmlFor: inputId, className: checkboxClasses, children: renderIcon() }),
|
|
241
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
242
|
+
"div",
|
|
243
|
+
{
|
|
244
|
+
className: cn(
|
|
245
|
+
"flex flex-row items-center",
|
|
246
|
+
sizeClasses.labelHeight
|
|
247
|
+
),
|
|
248
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
249
|
+
Text_default,
|
|
250
|
+
{
|
|
251
|
+
as: "label",
|
|
252
|
+
htmlFor: inputId,
|
|
253
|
+
size: sizeClasses.textSize,
|
|
254
|
+
weight: "normal",
|
|
255
|
+
className: cn(
|
|
256
|
+
"cursor-pointer select-none leading-[150%] flex items-center font-roboto",
|
|
257
|
+
labelClassName
|
|
258
|
+
),
|
|
259
|
+
children: label
|
|
260
|
+
}
|
|
261
|
+
)
|
|
262
|
+
}
|
|
263
|
+
)
|
|
264
|
+
]
|
|
265
|
+
}
|
|
266
|
+
),
|
|
267
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
268
|
+
Text_default,
|
|
269
|
+
{
|
|
270
|
+
size: "sm",
|
|
271
|
+
weight: "normal",
|
|
272
|
+
className: "mt-1.5",
|
|
273
|
+
color: "text-error-600",
|
|
274
|
+
children: errorMessage
|
|
275
|
+
}
|
|
276
|
+
),
|
|
277
|
+
helperText && !errorMessage && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
278
|
+
Text_default,
|
|
279
|
+
{
|
|
280
|
+
size: "sm",
|
|
281
|
+
weight: "normal",
|
|
282
|
+
className: "mt-1.5",
|
|
283
|
+
color: "text-text-500",
|
|
284
|
+
children: helperText
|
|
285
|
+
}
|
|
286
|
+
)
|
|
287
|
+
] });
|
|
288
|
+
}
|
|
289
|
+
);
|
|
290
|
+
CheckBox.displayName = "CheckBox";
|
|
291
|
+
var CheckBox_default = CheckBox;
|
|
292
|
+
|
|
293
|
+
// src/components/CheckBox/CheckboxList.tsx
|
|
294
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
295
|
+
var createCheckboxListStore = (name, defaultValues, disabled, onValuesChange) => (0, import_zustand.create)((set, get) => ({
|
|
296
|
+
values: defaultValues,
|
|
297
|
+
setValues: (values) => {
|
|
298
|
+
if (!get().disabled) {
|
|
299
|
+
set({ values });
|
|
300
|
+
get().onValuesChange?.(values);
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
toggleValue: (value) => {
|
|
304
|
+
if (!get().disabled) {
|
|
305
|
+
const currentValues = get().values;
|
|
306
|
+
const newValues = currentValues.includes(value) ? currentValues.filter((v) => v !== value) : [...currentValues, value];
|
|
307
|
+
set({ values: newValues });
|
|
308
|
+
get().onValuesChange?.(newValues);
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
onValuesChange,
|
|
312
|
+
disabled,
|
|
313
|
+
name
|
|
314
|
+
}));
|
|
315
|
+
var useCheckboxListStore = (externalStore) => {
|
|
316
|
+
if (!externalStore) {
|
|
317
|
+
throw new Error("CheckboxListItem must be used within a CheckboxList");
|
|
318
|
+
}
|
|
319
|
+
return externalStore;
|
|
320
|
+
};
|
|
321
|
+
var injectStore = (children, store) => import_react2.Children.map(children, (child) => {
|
|
322
|
+
if (!(0, import_react2.isValidElement)(child)) return child;
|
|
323
|
+
const typedChild = child;
|
|
324
|
+
const shouldInject = typedChild.type === CheckboxListItem;
|
|
325
|
+
return (0, import_react2.cloneElement)(typedChild, {
|
|
326
|
+
...shouldInject ? { store } : {},
|
|
327
|
+
...typedChild.props.children ? { children: injectStore(typedChild.props.children, store) } : {}
|
|
328
|
+
});
|
|
329
|
+
});
|
|
330
|
+
var CheckboxList = (0, import_react2.forwardRef)(
|
|
331
|
+
({
|
|
332
|
+
values: propValues,
|
|
333
|
+
defaultValues = [],
|
|
334
|
+
onValuesChange,
|
|
335
|
+
name: propName,
|
|
336
|
+
disabled = false,
|
|
337
|
+
className = "",
|
|
338
|
+
children,
|
|
339
|
+
...props
|
|
340
|
+
}, ref) => {
|
|
341
|
+
const generatedId = (0, import_react2.useId)();
|
|
342
|
+
const name = propName || `checkbox-list-${generatedId}`;
|
|
343
|
+
const storeRef = (0, import_react2.useRef)(null);
|
|
344
|
+
storeRef.current ??= createCheckboxListStore(
|
|
345
|
+
name,
|
|
346
|
+
defaultValues,
|
|
347
|
+
disabled,
|
|
348
|
+
onValuesChange
|
|
349
|
+
);
|
|
350
|
+
const store = storeRef.current;
|
|
351
|
+
const { setValues } = (0, import_zustand.useStore)(store, (s) => s);
|
|
352
|
+
(0, import_react2.useEffect)(() => {
|
|
353
|
+
const currentValues = store.getState().values;
|
|
354
|
+
if (currentValues.length > 0 && onValuesChange) {
|
|
355
|
+
onValuesChange(currentValues);
|
|
356
|
+
}
|
|
357
|
+
}, []);
|
|
358
|
+
(0, import_react2.useEffect)(() => {
|
|
359
|
+
if (propValues !== void 0) {
|
|
360
|
+
setValues(propValues);
|
|
361
|
+
}
|
|
362
|
+
}, [propValues, setValues]);
|
|
363
|
+
(0, import_react2.useEffect)(() => {
|
|
364
|
+
store.setState({ disabled });
|
|
365
|
+
}, [disabled, store]);
|
|
366
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
367
|
+
"div",
|
|
368
|
+
{
|
|
369
|
+
ref,
|
|
370
|
+
className: cn("flex flex-col gap-2 w-full", className),
|
|
371
|
+
"aria-label": name,
|
|
372
|
+
...props,
|
|
373
|
+
children: injectStore(children, store)
|
|
374
|
+
}
|
|
375
|
+
);
|
|
376
|
+
}
|
|
377
|
+
);
|
|
378
|
+
CheckboxList.displayName = "CheckboxList";
|
|
379
|
+
var CheckboxListItem = (0, import_react2.forwardRef)(
|
|
380
|
+
({
|
|
381
|
+
value,
|
|
382
|
+
store: externalStore,
|
|
383
|
+
disabled: itemDisabled,
|
|
384
|
+
size = "medium",
|
|
385
|
+
state = "default",
|
|
386
|
+
className = "",
|
|
387
|
+
id,
|
|
388
|
+
...props
|
|
389
|
+
}, ref) => {
|
|
390
|
+
const store = useCheckboxListStore(externalStore);
|
|
391
|
+
const {
|
|
392
|
+
values: groupValues,
|
|
393
|
+
toggleValue,
|
|
394
|
+
disabled: groupDisabled,
|
|
395
|
+
name
|
|
396
|
+
} = (0, import_zustand.useStore)(store);
|
|
397
|
+
const generatedId = (0, import_react2.useId)();
|
|
398
|
+
const inputId = id ?? `checkbox-item-${generatedId}`;
|
|
399
|
+
const isChecked = groupValues.includes(value);
|
|
400
|
+
const isDisabled = groupDisabled || itemDisabled;
|
|
401
|
+
const currentState = isDisabled ? "disabled" : state;
|
|
402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
403
|
+
CheckBox_default,
|
|
404
|
+
{
|
|
405
|
+
ref,
|
|
406
|
+
id: inputId,
|
|
407
|
+
name,
|
|
408
|
+
value,
|
|
409
|
+
checked: isChecked,
|
|
410
|
+
disabled: isDisabled,
|
|
411
|
+
size,
|
|
412
|
+
state: currentState,
|
|
413
|
+
className,
|
|
414
|
+
onChange: () => {
|
|
415
|
+
if (!isDisabled) {
|
|
416
|
+
toggleValue(value);
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
...props
|
|
420
|
+
}
|
|
421
|
+
);
|
|
422
|
+
}
|
|
423
|
+
);
|
|
424
|
+
CheckboxListItem.displayName = "CheckboxListItem";
|
|
425
|
+
var CheckboxList_default = CheckboxList;
|
|
426
|
+
|
|
427
|
+
// src/components/MultipleChoice/MultipleChoice.tsx
|
|
428
|
+
var import_phosphor_react3 = require("phosphor-react");
|
|
429
|
+
|
|
430
|
+
// src/components/Badge/Badge.tsx
|
|
431
|
+
var import_phosphor_react2 = require("phosphor-react");
|
|
432
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
433
|
+
var VARIANT_ACTION_CLASSES = {
|
|
434
|
+
solid: {
|
|
435
|
+
error: "bg-error-background text-error-700 focus-visible:outline-none",
|
|
436
|
+
warning: "bg-warning text-warning-800 focus-visible:outline-none",
|
|
437
|
+
success: "bg-success text-success-800 focus-visible:outline-none",
|
|
438
|
+
info: "bg-info text-info-800 focus-visible:outline-none",
|
|
439
|
+
muted: "bg-background-muted text-background-800 focus-visible:outline-none"
|
|
440
|
+
},
|
|
441
|
+
outlined: {
|
|
442
|
+
error: "bg-error text-error-700 border border-error-300 focus-visible:outline-none",
|
|
443
|
+
warning: "bg-warning text-warning-800 border border-warning-300 focus-visible:outline-none",
|
|
444
|
+
success: "bg-success text-success-800 border border-success-300 focus-visible:outline-none",
|
|
445
|
+
info: "bg-info text-info-800 border border-info-300 focus-visible:outline-none",
|
|
446
|
+
muted: "bg-background-muted text-background-800 border border-border-300 focus-visible:outline-none"
|
|
447
|
+
},
|
|
448
|
+
exams: {
|
|
449
|
+
exam1: "bg-exam-1 text-info-700 focus-visible:outline-none",
|
|
450
|
+
exam2: "bg-exam-2 text-typography-1 focus-visible:outline-none",
|
|
451
|
+
exam3: "bg-exam-3 text-typography-2 focus-visible:outline-none",
|
|
452
|
+
exam4: "bg-exam-4 text-success-700 focus-visible:outline-none"
|
|
453
|
+
},
|
|
454
|
+
examsOutlined: {
|
|
455
|
+
exam1: "bg-exam-1 text-info-700 border border-info-700 focus-visible:outline-none",
|
|
456
|
+
exam2: "bg-exam-2 text-typography-1 border border-typography-1 focus-visible:outline-none",
|
|
457
|
+
exam3: "bg-exam-3 text-typography-2 border border-typography-2 focus-visible:outline-none",
|
|
458
|
+
exam4: "bg-exam-4 text-success-700 border border-success-700 focus-visible:outline-none"
|
|
459
|
+
},
|
|
460
|
+
resultStatus: {
|
|
461
|
+
negative: "bg-error text-error-800 focus-visible:outline-none",
|
|
462
|
+
positive: "bg-success text-success-800 focus-visible:outline-none"
|
|
463
|
+
},
|
|
464
|
+
notification: "text-primary"
|
|
465
|
+
};
|
|
466
|
+
var SIZE_CLASSES2 = {
|
|
467
|
+
small: "text-2xs px-2 py-1",
|
|
468
|
+
medium: "text-xs px-2 py-1",
|
|
469
|
+
large: "text-sm px-2 py-1"
|
|
470
|
+
};
|
|
471
|
+
var SIZE_CLASSES_ICON = {
|
|
472
|
+
small: "size-3",
|
|
473
|
+
medium: "size-3.5",
|
|
474
|
+
large: "size-4"
|
|
475
|
+
};
|
|
476
|
+
var Badge = ({
|
|
477
|
+
children,
|
|
478
|
+
iconLeft,
|
|
479
|
+
iconRight,
|
|
480
|
+
size = "medium",
|
|
481
|
+
variant = "solid",
|
|
482
|
+
action = "error",
|
|
483
|
+
className = "",
|
|
484
|
+
notificationActive = false,
|
|
485
|
+
...props
|
|
486
|
+
}) => {
|
|
487
|
+
const sizeClasses = SIZE_CLASSES2[size];
|
|
488
|
+
const sizeClassesIcon = SIZE_CLASSES_ICON[size];
|
|
489
|
+
const variantActionMap = VARIANT_ACTION_CLASSES[variant] || {};
|
|
490
|
+
const variantClasses = typeof variantActionMap === "string" ? variantActionMap : variantActionMap[action] ?? variantActionMap.muted ?? "";
|
|
491
|
+
const baseClasses = "inline-flex items-center justify-center rounded-xs font-normal gap-1 relative";
|
|
492
|
+
const baseClassesIcon = "flex items-center";
|
|
493
|
+
if (variant === "notification") {
|
|
494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
495
|
+
"div",
|
|
496
|
+
{
|
|
497
|
+
className: cn(baseClasses, variantClasses, sizeClasses, className),
|
|
498
|
+
...props,
|
|
499
|
+
children: [
|
|
500
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_phosphor_react2.Bell, { size: 24, className: "text-current", "aria-hidden": "true" }),
|
|
501
|
+
notificationActive && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
502
|
+
"span",
|
|
503
|
+
{
|
|
504
|
+
"data-testid": "notification-dot",
|
|
505
|
+
className: "absolute top-[5px] right-[10px] block h-2 w-2 rounded-full bg-indicator-error ring-2 ring-white"
|
|
506
|
+
}
|
|
507
|
+
)
|
|
508
|
+
]
|
|
509
|
+
}
|
|
510
|
+
);
|
|
511
|
+
}
|
|
512
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
513
|
+
"div",
|
|
514
|
+
{
|
|
515
|
+
className: cn(baseClasses, variantClasses, sizeClasses, className),
|
|
516
|
+
...props,
|
|
517
|
+
children: [
|
|
518
|
+
iconLeft && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: cn(baseClassesIcon, sizeClassesIcon), children: iconLeft }),
|
|
519
|
+
children,
|
|
520
|
+
iconRight && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: cn(baseClassesIcon, sizeClassesIcon), children: iconRight })
|
|
521
|
+
]
|
|
522
|
+
}
|
|
523
|
+
);
|
|
524
|
+
};
|
|
525
|
+
var Badge_default = Badge;
|
|
526
|
+
|
|
527
|
+
// src/components/MultipleChoice/MultipleChoice.tsx
|
|
528
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
529
|
+
var MultipleChoiceList = ({
|
|
530
|
+
disabled = false,
|
|
531
|
+
className = "",
|
|
532
|
+
choices,
|
|
533
|
+
name,
|
|
534
|
+
selectedValues,
|
|
535
|
+
onHandleSelectedValues,
|
|
536
|
+
mode = "interactive"
|
|
537
|
+
}) => {
|
|
538
|
+
const [actualValue, setActualValue] = (0, import_react3.useState)(selectedValues);
|
|
539
|
+
(0, import_react3.useEffect)(() => {
|
|
540
|
+
setActualValue(selectedValues);
|
|
541
|
+
}, [selectedValues]);
|
|
542
|
+
const getStatusBadge = (status) => {
|
|
543
|
+
switch (status) {
|
|
544
|
+
case "correct":
|
|
545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_phosphor_react3.CheckCircle, {}), children: "Resposta correta" });
|
|
546
|
+
case "incorrect":
|
|
547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_phosphor_react3.XCircle, {}), children: "Resposta incorreta" });
|
|
548
|
+
default:
|
|
549
|
+
return null;
|
|
550
|
+
}
|
|
551
|
+
};
|
|
552
|
+
const getStatusStyles = (status) => {
|
|
553
|
+
switch (status) {
|
|
554
|
+
case "correct":
|
|
555
|
+
return "bg-success-background border-success-300";
|
|
556
|
+
case "incorrect":
|
|
557
|
+
return "bg-error-background border-error-300";
|
|
558
|
+
default:
|
|
559
|
+
return `bg-background border-border-100`;
|
|
560
|
+
}
|
|
561
|
+
};
|
|
562
|
+
const renderVisualCheckbox = (isSelected, isDisabled) => {
|
|
563
|
+
const checkboxClasses = cn(
|
|
564
|
+
"w-5 h-5 rounded border-2 cursor-default transition-all duration-200 flex items-center justify-center",
|
|
565
|
+
isSelected ? "border-primary-950 bg-primary-950 text-text" : "border-border-400 bg-background",
|
|
566
|
+
isDisabled && "opacity-40 cursor-not-allowed"
|
|
567
|
+
);
|
|
568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: checkboxClasses, children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_phosphor_react3.Check, { size: 16, weight: "bold" }) });
|
|
569
|
+
};
|
|
570
|
+
if (mode === "readonly") {
|
|
571
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: cn("flex flex-col gap-2", className), children: choices.map((choice, i) => {
|
|
572
|
+
const isSelected = actualValue?.includes(choice.value) || false;
|
|
573
|
+
const statusStyles = getStatusStyles(choice.status);
|
|
574
|
+
const statusBadge = getStatusBadge(choice.status);
|
|
575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
576
|
+
"div",
|
|
577
|
+
{
|
|
578
|
+
className: cn(
|
|
579
|
+
"flex flex-row justify-between gap-2 items-start p-2 rounded-lg transition-all",
|
|
580
|
+
statusStyles,
|
|
581
|
+
choice.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
582
|
+
),
|
|
583
|
+
children: [
|
|
584
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex items-center gap-2 flex-1", children: [
|
|
585
|
+
renderVisualCheckbox(isSelected, choice.disabled || disabled),
|
|
586
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
587
|
+
"span",
|
|
588
|
+
{
|
|
589
|
+
className: cn(
|
|
590
|
+
"flex-1",
|
|
591
|
+
isSelected || choice.status && choice.status != "neutral" ? "text-text-950" : "text-text-600",
|
|
592
|
+
choice.disabled || disabled ? "cursor-not-allowed" : "cursor-default"
|
|
593
|
+
),
|
|
594
|
+
children: choice.label
|
|
595
|
+
}
|
|
596
|
+
)
|
|
597
|
+
] }),
|
|
598
|
+
statusBadge && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
|
|
599
|
+
]
|
|
600
|
+
},
|
|
601
|
+
`readonly-${choice.value}-${i}`
|
|
602
|
+
);
|
|
603
|
+
}) });
|
|
604
|
+
}
|
|
605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
606
|
+
"div",
|
|
607
|
+
{
|
|
608
|
+
className: cn(
|
|
609
|
+
"flex flex-row justify-between gap-2 items-start p-2 rounded-lg transition-all",
|
|
610
|
+
disabled ? "opacity-50 cursor-not-allowed" : "",
|
|
611
|
+
className
|
|
612
|
+
),
|
|
613
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
614
|
+
CheckboxList_default,
|
|
615
|
+
{
|
|
616
|
+
name,
|
|
617
|
+
values: actualValue,
|
|
618
|
+
onValuesChange: (v) => {
|
|
619
|
+
setActualValue(v);
|
|
620
|
+
onHandleSelectedValues?.(v);
|
|
621
|
+
},
|
|
622
|
+
disabled,
|
|
623
|
+
children: choices.map((choice, i) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
624
|
+
"div",
|
|
625
|
+
{
|
|
626
|
+
className: "flex flex-row gap-2 items-center",
|
|
627
|
+
children: [
|
|
628
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
629
|
+
CheckboxListItem,
|
|
630
|
+
{
|
|
631
|
+
value: choice.value,
|
|
632
|
+
id: `interactive-${choice.value}-${i}`,
|
|
633
|
+
disabled: choice.disabled || disabled
|
|
634
|
+
}
|
|
635
|
+
),
|
|
636
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
637
|
+
"label",
|
|
638
|
+
{
|
|
639
|
+
htmlFor: `interactive-${choice.value}-${i}`,
|
|
640
|
+
className: cn(
|
|
641
|
+
"flex-1",
|
|
642
|
+
actualValue?.includes(choice.value) ? "text-text-950" : "text-text-600",
|
|
643
|
+
choice.disabled || disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
644
|
+
),
|
|
645
|
+
children: choice.label
|
|
646
|
+
}
|
|
647
|
+
)
|
|
648
|
+
]
|
|
649
|
+
},
|
|
650
|
+
`interactive-${choice.value}-${i}`
|
|
651
|
+
))
|
|
652
|
+
}
|
|
653
|
+
)
|
|
654
|
+
}
|
|
655
|
+
);
|
|
656
|
+
};
|
|
657
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
658
|
+
0 && (module.exports = {
|
|
659
|
+
MultipleChoiceList
|
|
660
|
+
});
|