analytica-frontend-lib 1.0.22 → 1.0.24
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/chunk-CETSS3RA.mjs +52 -0
- package/dist/chunk-GSEO6POW.mjs +93 -0
- package/dist/chunk-IB4IJ3GF.mjs +60 -0
- package/dist/chunk-IH5TEC64.mjs +35 -0
- package/dist/chunk-JNPCNN67.mjs +86 -0
- package/dist/chunk-KT6HNGRV.mjs +241 -0
- package/dist/chunk-LYOJCBOM.mjs +195 -0
- package/dist/chunk-MI5FIRHM.mjs +75 -0
- package/dist/chunk-NWGRQN6R.mjs +108 -0
- package/dist/chunk-QODEDLAX.mjs +142 -0
- package/dist/chunk-QOFMTSHE.mjs +44 -0
- package/dist/chunk-RPYPJ5O5.mjs +55 -0
- package/dist/chunk-SESX5OEP.mjs +57 -0
- package/dist/chunk-TT3VCQGR.mjs +53 -0
- package/dist/chunk-WIOCQOM7.mjs +20 -0
- package/dist/client-components.d.mts +9 -0
- package/dist/client-components.d.ts +9 -0
- package/dist/client-components.js +755 -0
- package/dist/client-components.mjs +39 -0
- package/dist/components/Alert/Alert.d.mts +13 -0
- package/dist/components/Alert/Alert.d.ts +13 -0
- package/dist/components/Alert/Alert.js +158 -0
- package/dist/components/Alert/Alert.mjs +7 -0
- package/dist/components/Badge/Badge.d.mts +47 -0
- package/dist/components/Badge/Badge.d.ts +47 -0
- package/dist/components/Badge/Badge.js +117 -0
- package/dist/components/Badge/Badge.mjs +6 -0
- package/dist/components/Button/Button.d.mts +46 -0
- package/dist/components/Button/Button.d.ts +46 -0
- package/dist/components/Button/Button.js +84 -0
- package/dist/components/Button/Button.mjs +6 -0
- package/dist/components/CheckBox/CheckBox.d.mts +74 -0
- package/dist/components/CheckBox/CheckBox.d.ts +74 -0
- package/dist/components/CheckBox/CheckBox.js +264 -0
- package/dist/components/CheckBox/CheckBox.mjs +8 -0
- package/dist/components/DropdownMenu/DropdownMenu.d.mts +29 -0
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +29 -0
- package/dist/components/DropdownMenu/DropdownMenu.js +262 -0
- package/dist/components/DropdownMenu/DropdownMenu.mjs +17 -0
- package/dist/components/IconButton/IconButton.d.mts +77 -0
- package/dist/components/IconButton/IconButton.d.ts +77 -0
- package/dist/components/IconButton/IconButton.js +79 -0
- package/dist/components/IconButton/IconButton.mjs +6 -0
- package/dist/components/IconRoundedButton/IconRoundedButton.d.mts +35 -0
- package/dist/components/IconRoundedButton/IconRoundedButton.d.ts +35 -0
- package/dist/components/IconRoundedButton/IconRoundedButton.js +68 -0
- package/dist/components/IconRoundedButton/IconRoundedButton.mjs +6 -0
- package/dist/components/NavButton/NavButton.d.mts +58 -0
- package/dist/components/NavButton/NavButton.d.ts +58 -0
- package/dist/components/NavButton/NavButton.js +76 -0
- package/dist/components/NavButton/NavButton.mjs +6 -0
- package/dist/components/SelectionButton/SelectionButton.d.mts +58 -0
- package/dist/components/SelectionButton/SelectionButton.d.ts +58 -0
- package/dist/components/SelectionButton/SelectionButton.js +81 -0
- package/dist/components/SelectionButton/SelectionButton.mjs +6 -0
- package/dist/components/Table/Table.d.mts +17 -0
- package/dist/components/Table/Table.d.ts +17 -0
- package/dist/components/Table/Table.js +139 -0
- package/dist/components/Table/Table.mjs +20 -0
- package/dist/components/Text/Text.d.mts +59 -0
- package/dist/components/Text/Text.d.ts +59 -0
- package/dist/components/Text/Text.js +77 -0
- package/dist/components/Text/Text.mjs +6 -0
- package/dist/components/TextArea/TextArea.d.mts +69 -0
- package/dist/components/TextArea/TextArea.d.ts +69 -0
- package/dist/components/TextArea/TextArea.js +211 -0
- package/dist/components/TextArea/TextArea.mjs +8 -0
- package/dist/components/Toast/Toast.d.mts +17 -0
- package/dist/components/Toast/Toast.d.ts +17 -0
- package/dist/components/Toast/Toast.js +100 -0
- package/dist/components/Toast/Toast.mjs +7 -0
- package/dist/components/Toast/utils/ToastStore.d.mts +19 -0
- package/dist/components/Toast/utils/ToastStore.d.ts +19 -0
- package/dist/components/Toast/utils/ToastStore.js +44 -0
- package/dist/components/Toast/utils/ToastStore.mjs +6 -0
- package/dist/components/Toast/utils/Toaster.d.mts +11 -0
- package/dist/components/Toast/utils/Toaster.d.ts +11 -0
- package/dist/components/Toast/utils/Toaster.js +145 -0
- package/dist/components/Toast/utils/Toaster.mjs +11 -0
- package/dist/index.d.mts +168 -355
- package/dist/index.d.ts +168 -355
- package/dist/index.js +341 -936
- package/dist/index.mjs +340 -941
- package/dist/server-components.d.mts +11 -0
- package/dist/server-components.d.ts +11 -0
- package/dist/server-components.js +629 -0
- package/dist/server-components.mjs +52 -0
- package/package.json +76 -3
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Text
|
|
3
|
+
} from "./chunk-TT3VCQGR.mjs";
|
|
4
|
+
|
|
5
|
+
// src/components/CheckBox/CheckBox.tsx
|
|
6
|
+
import {
|
|
7
|
+
forwardRef,
|
|
8
|
+
useState,
|
|
9
|
+
useId
|
|
10
|
+
} from "react";
|
|
11
|
+
import { Check, Minus } from "phosphor-react";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
var SIZE_CLASSES = {
|
|
14
|
+
small: {
|
|
15
|
+
checkbox: "w-4 h-4",
|
|
16
|
+
// 16px x 16px
|
|
17
|
+
textSize: "sm",
|
|
18
|
+
spacing: "gap-1.5",
|
|
19
|
+
// 6px
|
|
20
|
+
borderWidth: "border-2",
|
|
21
|
+
iconSize: 14,
|
|
22
|
+
// pixels for Phosphor icons
|
|
23
|
+
labelHeight: "h-[21px]"
|
|
24
|
+
},
|
|
25
|
+
medium: {
|
|
26
|
+
checkbox: "w-5 h-5",
|
|
27
|
+
// 20px x 20px
|
|
28
|
+
textSize: "md",
|
|
29
|
+
spacing: "gap-2",
|
|
30
|
+
// 8px
|
|
31
|
+
borderWidth: "border-2",
|
|
32
|
+
iconSize: 16,
|
|
33
|
+
// pixels for Phosphor icons
|
|
34
|
+
labelHeight: "h-6"
|
|
35
|
+
},
|
|
36
|
+
large: {
|
|
37
|
+
checkbox: "w-6 h-6",
|
|
38
|
+
// 24px x 24px
|
|
39
|
+
textSize: "lg",
|
|
40
|
+
spacing: "gap-2",
|
|
41
|
+
// 8px
|
|
42
|
+
borderWidth: "border-[3px]",
|
|
43
|
+
// 3px border
|
|
44
|
+
iconSize: 20,
|
|
45
|
+
// pixels for Phosphor icons
|
|
46
|
+
labelHeight: "h-[27px]"
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var BASE_CHECKBOX_CLASSES = "rounded border cursor-pointer transition-all duration-200 flex items-center justify-center focus:outline-none";
|
|
50
|
+
var STATE_CLASSES = {
|
|
51
|
+
default: {
|
|
52
|
+
unchecked: "border-border-400 bg-background hover:border-border-500",
|
|
53
|
+
checked: "border-primary-950 bg-primary-950 text-text hover:border-primary-800 hover:bg-primary-800"
|
|
54
|
+
},
|
|
55
|
+
hovered: {
|
|
56
|
+
unchecked: "border-border-500 bg-background",
|
|
57
|
+
checked: "border-primary-800 bg-primary-800 text-text"
|
|
58
|
+
},
|
|
59
|
+
focused: {
|
|
60
|
+
unchecked: "border-indicator-info bg-background ring-2 ring-indicator-info/20",
|
|
61
|
+
checked: "border-indicator-info bg-primary-950 text-text ring-2 ring-indicator-info/20"
|
|
62
|
+
},
|
|
63
|
+
invalid: {
|
|
64
|
+
unchecked: "border-error-700 bg-background hover:border-error-600",
|
|
65
|
+
checked: "border-error-700 bg-primary-950 text-text"
|
|
66
|
+
},
|
|
67
|
+
disabled: {
|
|
68
|
+
unchecked: "border-border-400 bg-background cursor-not-allowed opacity-40",
|
|
69
|
+
checked: "border-primary-600 bg-primary-600 text-text cursor-not-allowed opacity-40"
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
var CheckBox = forwardRef(
|
|
73
|
+
({
|
|
74
|
+
label,
|
|
75
|
+
size = "medium",
|
|
76
|
+
state = "default",
|
|
77
|
+
indeterminate = false,
|
|
78
|
+
errorMessage,
|
|
79
|
+
helperText,
|
|
80
|
+
className = "",
|
|
81
|
+
labelClassName = "",
|
|
82
|
+
checked: checkedProp,
|
|
83
|
+
disabled,
|
|
84
|
+
id,
|
|
85
|
+
onChange,
|
|
86
|
+
...props
|
|
87
|
+
}, ref) => {
|
|
88
|
+
const generatedId = useId();
|
|
89
|
+
const inputId = id ?? `checkbox-${generatedId}`;
|
|
90
|
+
const [internalChecked, setInternalChecked] = useState(false);
|
|
91
|
+
const isControlled = checkedProp !== void 0;
|
|
92
|
+
const checked = isControlled ? checkedProp : internalChecked;
|
|
93
|
+
const handleChange = (event) => {
|
|
94
|
+
if (!isControlled) {
|
|
95
|
+
setInternalChecked(event.target.checked);
|
|
96
|
+
}
|
|
97
|
+
onChange?.(event);
|
|
98
|
+
};
|
|
99
|
+
const currentState = disabled ? "disabled" : state;
|
|
100
|
+
const sizeClasses = SIZE_CLASSES[size];
|
|
101
|
+
const checkVariant = checked || indeterminate ? "checked" : "unchecked";
|
|
102
|
+
const stylingClasses = STATE_CLASSES[currentState][checkVariant];
|
|
103
|
+
const borderWidthClass = state === "focused" || state === "hovered" && size === "large" ? "border-[3px]" : sizeClasses.borderWidth;
|
|
104
|
+
const checkboxClasses = `${BASE_CHECKBOX_CLASSES} ${sizeClasses.checkbox} ${borderWidthClass} ${stylingClasses} ${className}`;
|
|
105
|
+
const renderIcon = () => {
|
|
106
|
+
if (indeterminate) {
|
|
107
|
+
return /* @__PURE__ */ jsx(
|
|
108
|
+
Minus,
|
|
109
|
+
{
|
|
110
|
+
size: sizeClasses.iconSize,
|
|
111
|
+
weight: "bold",
|
|
112
|
+
color: "currentColor"
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
if (checked) {
|
|
117
|
+
return /* @__PURE__ */ jsx(
|
|
118
|
+
Check,
|
|
119
|
+
{
|
|
120
|
+
size: sizeClasses.iconSize,
|
|
121
|
+
weight: "bold",
|
|
122
|
+
color: "currentColor"
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
return null;
|
|
127
|
+
};
|
|
128
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
|
|
129
|
+
/* @__PURE__ */ jsxs(
|
|
130
|
+
"div",
|
|
131
|
+
{
|
|
132
|
+
className: `flex flex-row items-center ${sizeClasses.spacing} ${disabled ? "opacity-40" : ""}`,
|
|
133
|
+
children: [
|
|
134
|
+
/* @__PURE__ */ jsx(
|
|
135
|
+
"input",
|
|
136
|
+
{
|
|
137
|
+
ref,
|
|
138
|
+
type: "checkbox",
|
|
139
|
+
id: inputId,
|
|
140
|
+
checked,
|
|
141
|
+
disabled,
|
|
142
|
+
onChange: handleChange,
|
|
143
|
+
className: "sr-only",
|
|
144
|
+
...props
|
|
145
|
+
}
|
|
146
|
+
),
|
|
147
|
+
/* @__PURE__ */ jsx("label", { htmlFor: inputId, className: checkboxClasses, children: renderIcon() }),
|
|
148
|
+
label && /* @__PURE__ */ jsx(
|
|
149
|
+
"div",
|
|
150
|
+
{
|
|
151
|
+
className: `flex flex-row items-center ${sizeClasses.labelHeight}`,
|
|
152
|
+
children: /* @__PURE__ */ jsx(
|
|
153
|
+
Text,
|
|
154
|
+
{
|
|
155
|
+
as: "label",
|
|
156
|
+
htmlFor: inputId,
|
|
157
|
+
size: sizeClasses.textSize,
|
|
158
|
+
weight: "normal",
|
|
159
|
+
className: `cursor-pointer select-none leading-[150%] flex items-center font-roboto ${labelClassName}`,
|
|
160
|
+
children: label
|
|
161
|
+
}
|
|
162
|
+
)
|
|
163
|
+
}
|
|
164
|
+
)
|
|
165
|
+
]
|
|
166
|
+
}
|
|
167
|
+
),
|
|
168
|
+
errorMessage && /* @__PURE__ */ jsx(
|
|
169
|
+
Text,
|
|
170
|
+
{
|
|
171
|
+
size: "sm",
|
|
172
|
+
weight: "normal",
|
|
173
|
+
className: "mt-1.5",
|
|
174
|
+
color: "text-error-600",
|
|
175
|
+
children: errorMessage
|
|
176
|
+
}
|
|
177
|
+
),
|
|
178
|
+
helperText && !errorMessage && /* @__PURE__ */ jsx(
|
|
179
|
+
Text,
|
|
180
|
+
{
|
|
181
|
+
size: "sm",
|
|
182
|
+
weight: "normal",
|
|
183
|
+
className: "mt-1.5",
|
|
184
|
+
color: "text-text-500",
|
|
185
|
+
children: helperText
|
|
186
|
+
}
|
|
187
|
+
)
|
|
188
|
+
] });
|
|
189
|
+
}
|
|
190
|
+
);
|
|
191
|
+
CheckBox.displayName = "CheckBox";
|
|
192
|
+
|
|
193
|
+
export {
|
|
194
|
+
CheckBox
|
|
195
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// src/components/Toast/Toast.tsx
|
|
2
|
+
import { CheckCircle, WarningCircle, Info, X } from "phosphor-react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
var VARIANT_ACTION_CLASSES = {
|
|
5
|
+
solid: {
|
|
6
|
+
warning: "bg-warning text-warning-800 border-none focus-visible:outline-none",
|
|
7
|
+
success: "bg-success text-success-800 border-none focus-visible:outline-none",
|
|
8
|
+
info: "bg-info text-info-800 border-none focus-visible:outline-none"
|
|
9
|
+
},
|
|
10
|
+
outlined: {
|
|
11
|
+
warning: "bg-warning text-warning-800 border border-warning-200 focus-visible:outline-none",
|
|
12
|
+
success: "bg-success text-success-800 border border-success-200 focus-visible:outline-none",
|
|
13
|
+
info: "bg-info text-info-800 border border-info-200 focus-visible:outline-none"
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
var iconMap = {
|
|
17
|
+
success: CheckCircle,
|
|
18
|
+
info: Info,
|
|
19
|
+
warning: WarningCircle
|
|
20
|
+
};
|
|
21
|
+
var Toast = ({
|
|
22
|
+
variant = "outlined",
|
|
23
|
+
action = "success",
|
|
24
|
+
className = "",
|
|
25
|
+
onClose,
|
|
26
|
+
title,
|
|
27
|
+
description,
|
|
28
|
+
position = "default",
|
|
29
|
+
...props
|
|
30
|
+
}) => {
|
|
31
|
+
const variantClasses = VARIANT_ACTION_CLASSES[variant][action];
|
|
32
|
+
const positionClasses = {
|
|
33
|
+
"top-left": "fixed top-4 left-4",
|
|
34
|
+
"top-center": "fixed top-4 left-1/2 transform -translate-x-1/2",
|
|
35
|
+
"top-right": "fixed top-4 right-4",
|
|
36
|
+
"bottom-left": "fixed bottom-4 left-4",
|
|
37
|
+
"bottom-center": "fixed bottom-4 left-1/2 transform -translate-x-1/2",
|
|
38
|
+
"bottom-right": "fixed bottom-4 right-4",
|
|
39
|
+
default: ""
|
|
40
|
+
};
|
|
41
|
+
const IconAction = iconMap[action] || iconMap["success"];
|
|
42
|
+
const baseClasses = "max-w-[390px] w-full flex flex-row items-start justify-between shadow-lg rounded-lg border p-4 gap-6 group";
|
|
43
|
+
return /* @__PURE__ */ jsxs(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
role: "alert",
|
|
47
|
+
"aria-live": "assertive",
|
|
48
|
+
"aria-atomic": "true",
|
|
49
|
+
className: `${baseClasses} ${positionClasses[position]} ${variantClasses} ${className}`,
|
|
50
|
+
...props,
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-row items-start gap-3", children: [
|
|
53
|
+
/* @__PURE__ */ jsx("span", { className: "mt-1", "data-testid": `toast-icon-${action}`, children: /* @__PURE__ */ jsx(IconAction, {}) }),
|
|
54
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-start justify-start", children: [
|
|
55
|
+
/* @__PURE__ */ jsx("p", { className: "font-semibold text-md", children: title }),
|
|
56
|
+
description && /* @__PURE__ */ jsx("p", { className: "text-md text-text-900", children: description })
|
|
57
|
+
] })
|
|
58
|
+
] }),
|
|
59
|
+
/* @__PURE__ */ jsx(
|
|
60
|
+
"button",
|
|
61
|
+
{
|
|
62
|
+
onClick: onClose,
|
|
63
|
+
"aria-label": "Dismiss notification",
|
|
64
|
+
className: "text-background-500 cursor-pointer opacity-0 group-hover:opacity-100 transition-opacity",
|
|
65
|
+
children: /* @__PURE__ */ jsx(X, {})
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export {
|
|
74
|
+
Toast
|
|
75
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
// src/components/Table/Table.tsx
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
var Table = forwardRef(
|
|
5
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: "border border-border-200 rounded-xl relative w-full overflow-hidden", children: /* @__PURE__ */ jsxs(
|
|
6
|
+
"table",
|
|
7
|
+
{
|
|
8
|
+
ref,
|
|
9
|
+
className: `w-full caption-bottom text-sm ${className ?? ""}`,
|
|
10
|
+
...props,
|
|
11
|
+
children: [
|
|
12
|
+
/* @__PURE__ */ jsx("caption", { className: "sr-only", children: "My Table" }),
|
|
13
|
+
children
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
) })
|
|
17
|
+
);
|
|
18
|
+
Table.displayName = "Table";
|
|
19
|
+
var TableHeader = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
20
|
+
"thead",
|
|
21
|
+
{
|
|
22
|
+
ref,
|
|
23
|
+
className: `[&_tr:first-child]:border-0 ${className}`,
|
|
24
|
+
...props
|
|
25
|
+
}
|
|
26
|
+
));
|
|
27
|
+
TableHeader.displayName = "TableHeader";
|
|
28
|
+
var TableBody = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
29
|
+
"tbody",
|
|
30
|
+
{
|
|
31
|
+
ref,
|
|
32
|
+
className: `[&_tr:last-child]:border-0 border-t border-border-200 ${className}`,
|
|
33
|
+
...props
|
|
34
|
+
}
|
|
35
|
+
));
|
|
36
|
+
TableBody.displayName = "TableBody";
|
|
37
|
+
var TableFooter = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
38
|
+
"tfoot",
|
|
39
|
+
{
|
|
40
|
+
ref,
|
|
41
|
+
className: `border-t bg-background-50 border-border-200 font-medium [&>tr]:last:border-b-0 px-6 py-3.5 ${className}`,
|
|
42
|
+
...props
|
|
43
|
+
}
|
|
44
|
+
));
|
|
45
|
+
TableFooter.displayName = "TableFooter";
|
|
46
|
+
var VARIANT_STATES_ROW = {
|
|
47
|
+
default: "border-b border-border-200",
|
|
48
|
+
selected: "border-b-2 border-indicator-primary",
|
|
49
|
+
invalid: "border-b-2 border-indicator-error",
|
|
50
|
+
disabled: "border-b border-border-100 bg-background-50 opacity-50 cursor-not-allowed"
|
|
51
|
+
};
|
|
52
|
+
var TableRow = forwardRef(
|
|
53
|
+
({ state = "default", className, ...props }, ref) => {
|
|
54
|
+
return /* @__PURE__ */ jsx(
|
|
55
|
+
"tr",
|
|
56
|
+
{
|
|
57
|
+
ref,
|
|
58
|
+
className: `
|
|
59
|
+
transition-colors
|
|
60
|
+
${state !== "disabled" ? "hover:bg-muted/50" : ""}
|
|
61
|
+
${VARIANT_STATES_ROW[state]}
|
|
62
|
+
${className}
|
|
63
|
+
`,
|
|
64
|
+
"aria-disabled": state === "disabled",
|
|
65
|
+
...props
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
TableRow.displayName = "TableRow";
|
|
71
|
+
var TableHead = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
72
|
+
"th",
|
|
73
|
+
{
|
|
74
|
+
ref,
|
|
75
|
+
className: `h-10 px-6 py-3.5 bg-bg-secondary bg-muted/50 text-left align-middle font-bold text-text-800 [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] ${className}`,
|
|
76
|
+
...props
|
|
77
|
+
}
|
|
78
|
+
));
|
|
79
|
+
TableHead.displayName = "TableHead";
|
|
80
|
+
var TableCell = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
81
|
+
"td",
|
|
82
|
+
{
|
|
83
|
+
ref,
|
|
84
|
+
className: `p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-md text-text-800 px-6 py-3.5 ${className}`,
|
|
85
|
+
...props
|
|
86
|
+
}
|
|
87
|
+
));
|
|
88
|
+
TableCell.displayName = "TableCell";
|
|
89
|
+
var TableCaption = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
90
|
+
"caption",
|
|
91
|
+
{
|
|
92
|
+
ref,
|
|
93
|
+
className: `border-t border-border-200 text-sm text-text-800 px-6 py-3.5 ${className}`,
|
|
94
|
+
...props
|
|
95
|
+
}
|
|
96
|
+
));
|
|
97
|
+
TableCaption.displayName = "TableCaption";
|
|
98
|
+
|
|
99
|
+
export {
|
|
100
|
+
Table,
|
|
101
|
+
TableHeader,
|
|
102
|
+
TableBody,
|
|
103
|
+
TableFooter,
|
|
104
|
+
TableRow,
|
|
105
|
+
TableHead,
|
|
106
|
+
TableCell,
|
|
107
|
+
TableCaption
|
|
108
|
+
};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Text
|
|
3
|
+
} from "./chunk-TT3VCQGR.mjs";
|
|
4
|
+
|
|
5
|
+
// src/components/TextArea/TextArea.tsx
|
|
6
|
+
import {
|
|
7
|
+
forwardRef,
|
|
8
|
+
useState,
|
|
9
|
+
useId
|
|
10
|
+
} from "react";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
var SIZE_CLASSES = {
|
|
13
|
+
small: {
|
|
14
|
+
container: "w-72",
|
|
15
|
+
// 288px width
|
|
16
|
+
textarea: "h-24 text-sm",
|
|
17
|
+
// 96px height, 14px font
|
|
18
|
+
textSize: "sm"
|
|
19
|
+
},
|
|
20
|
+
medium: {
|
|
21
|
+
container: "w-72",
|
|
22
|
+
// 288px width
|
|
23
|
+
textarea: "h-24 text-base",
|
|
24
|
+
// 96px height, 16px font
|
|
25
|
+
textSize: "md"
|
|
26
|
+
},
|
|
27
|
+
large: {
|
|
28
|
+
container: "w-72",
|
|
29
|
+
// 288px width
|
|
30
|
+
textarea: "h-24 text-lg",
|
|
31
|
+
// 96px height, 18px font
|
|
32
|
+
textSize: "lg"
|
|
33
|
+
},
|
|
34
|
+
extraLarge: {
|
|
35
|
+
container: "w-72",
|
|
36
|
+
// 288px width
|
|
37
|
+
textarea: "h-24 text-xl",
|
|
38
|
+
// 96px height, 20px font
|
|
39
|
+
textSize: "xl"
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var BASE_TEXTAREA_CLASSES = "w-full box-border p-3 bg-background border border-solid rounded-[4px] resize-none focus:outline-none font-roboto font-normal leading-[150%] placeholder:text-text-600 transition-all duration-200";
|
|
43
|
+
var STATE_CLASSES = {
|
|
44
|
+
default: {
|
|
45
|
+
base: "border-border-300 bg-background text-text-600",
|
|
46
|
+
hover: "hover:border-border-400",
|
|
47
|
+
focus: "focus:border-border-500"
|
|
48
|
+
},
|
|
49
|
+
hovered: {
|
|
50
|
+
base: "border-border-400 bg-background text-text-600",
|
|
51
|
+
hover: "",
|
|
52
|
+
focus: "focus:border-border-500"
|
|
53
|
+
},
|
|
54
|
+
focused: {
|
|
55
|
+
base: "border-2 border-primary-950 bg-background text-text-900",
|
|
56
|
+
hover: "",
|
|
57
|
+
focus: ""
|
|
58
|
+
},
|
|
59
|
+
invalid: {
|
|
60
|
+
base: "border-2 border-red-700 bg-white text-gray-800",
|
|
61
|
+
hover: "hover:border-red-700",
|
|
62
|
+
focus: "focus:border-red-700"
|
|
63
|
+
},
|
|
64
|
+
disabled: {
|
|
65
|
+
base: "border-border-300 bg-background text-text-600 cursor-not-allowed opacity-40",
|
|
66
|
+
hover: "",
|
|
67
|
+
focus: ""
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
var TextArea = forwardRef(
|
|
71
|
+
({
|
|
72
|
+
label,
|
|
73
|
+
size = "medium",
|
|
74
|
+
state = "default",
|
|
75
|
+
errorMessage,
|
|
76
|
+
helperMessage,
|
|
77
|
+
className = "",
|
|
78
|
+
labelClassName = "",
|
|
79
|
+
disabled,
|
|
80
|
+
id,
|
|
81
|
+
onChange,
|
|
82
|
+
placeholder,
|
|
83
|
+
...props
|
|
84
|
+
}, ref) => {
|
|
85
|
+
const generatedId = useId();
|
|
86
|
+
const inputId = id ?? `textarea-${generatedId}`;
|
|
87
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
88
|
+
const handleChange = (event) => {
|
|
89
|
+
onChange?.(event);
|
|
90
|
+
};
|
|
91
|
+
const handleFocus = (event) => {
|
|
92
|
+
setIsFocused(true);
|
|
93
|
+
props.onFocus?.(event);
|
|
94
|
+
};
|
|
95
|
+
const handleBlur = (event) => {
|
|
96
|
+
setIsFocused(false);
|
|
97
|
+
props.onBlur?.(event);
|
|
98
|
+
};
|
|
99
|
+
let currentState = disabled ? "disabled" : state;
|
|
100
|
+
if (isFocused && currentState !== "invalid" && currentState !== "disabled") {
|
|
101
|
+
currentState = "focused";
|
|
102
|
+
}
|
|
103
|
+
const sizeClasses = SIZE_CLASSES[size];
|
|
104
|
+
const stateClasses = STATE_CLASSES[currentState];
|
|
105
|
+
const textareaClasses = `${BASE_TEXTAREA_CLASSES} ${sizeClasses.textarea} ${stateClasses.base} ${stateClasses.hover} ${stateClasses.focus} ${className}`;
|
|
106
|
+
return /* @__PURE__ */ jsxs("div", { className: `flex flex-col ${sizeClasses.container}`, children: [
|
|
107
|
+
label && /* @__PURE__ */ jsx(
|
|
108
|
+
Text,
|
|
109
|
+
{
|
|
110
|
+
as: "label",
|
|
111
|
+
htmlFor: inputId,
|
|
112
|
+
size: sizeClasses.textSize,
|
|
113
|
+
weight: "medium",
|
|
114
|
+
color: "text-text-950",
|
|
115
|
+
className: `mb-1.5 ${labelClassName}`,
|
|
116
|
+
children: label
|
|
117
|
+
}
|
|
118
|
+
),
|
|
119
|
+
/* @__PURE__ */ jsx(
|
|
120
|
+
"textarea",
|
|
121
|
+
{
|
|
122
|
+
ref,
|
|
123
|
+
id: inputId,
|
|
124
|
+
disabled,
|
|
125
|
+
onChange: handleChange,
|
|
126
|
+
onFocus: handleFocus,
|
|
127
|
+
onBlur: handleBlur,
|
|
128
|
+
className: textareaClasses,
|
|
129
|
+
placeholder,
|
|
130
|
+
...props
|
|
131
|
+
}
|
|
132
|
+
),
|
|
133
|
+
errorMessage && /* @__PURE__ */ jsx(Text, { size: "sm", weight: "normal", className: "mt-1.5 text-error-600", children: errorMessage }),
|
|
134
|
+
helperMessage && !errorMessage && /* @__PURE__ */ jsx(Text, { size: "sm", weight: "normal", className: "mt-1.5 text-text-500", children: helperMessage })
|
|
135
|
+
] });
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
TextArea.displayName = "TextArea";
|
|
139
|
+
|
|
140
|
+
export {
|
|
141
|
+
TextArea
|
|
142
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// src/components/IconRoundedButton/IconRoundedButton.tsx
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
var IconRoundedButton = ({
|
|
4
|
+
icon,
|
|
5
|
+
className = "",
|
|
6
|
+
disabled,
|
|
7
|
+
...props
|
|
8
|
+
}) => {
|
|
9
|
+
const baseClasses = [
|
|
10
|
+
"inline-flex",
|
|
11
|
+
"items-center",
|
|
12
|
+
"justify-center",
|
|
13
|
+
"w-8",
|
|
14
|
+
"h-8",
|
|
15
|
+
"rounded-full",
|
|
16
|
+
"cursor-pointer",
|
|
17
|
+
"border",
|
|
18
|
+
"border-background-200",
|
|
19
|
+
"bg-background",
|
|
20
|
+
"text-text-950",
|
|
21
|
+
"hover:shadow-hard-shadow-1",
|
|
22
|
+
"focus-visible:outline-none",
|
|
23
|
+
"focus-visible:shadow-hard-shadow-1",
|
|
24
|
+
"focus-visible:ring-2",
|
|
25
|
+
"focus-visible:ring-indicator-info",
|
|
26
|
+
"focus-visible:ring-offset-0",
|
|
27
|
+
"disabled:opacity-50",
|
|
28
|
+
"disabled:cursor-not-allowed"
|
|
29
|
+
].join(" ");
|
|
30
|
+
return /* @__PURE__ */ jsx(
|
|
31
|
+
"button",
|
|
32
|
+
{
|
|
33
|
+
type: "button",
|
|
34
|
+
className: `${baseClasses} ${className}`,
|
|
35
|
+
disabled,
|
|
36
|
+
...props,
|
|
37
|
+
children: /* @__PURE__ */ jsx("span", { className: "flex items-center justify-center w-5 h-5", children: icon })
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export {
|
|
43
|
+
IconRoundedButton
|
|
44
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// src/components/IconButton/IconButton.tsx
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
var IconButton = forwardRef(
|
|
5
|
+
({ icon, size = "md", active = false, className = "", disabled, ...props }, ref) => {
|
|
6
|
+
const baseClasses = [
|
|
7
|
+
"inline-flex",
|
|
8
|
+
"items-center",
|
|
9
|
+
"justify-center",
|
|
10
|
+
"rounded-lg",
|
|
11
|
+
"font-medium",
|
|
12
|
+
"bg-transparent",
|
|
13
|
+
"text-text-950",
|
|
14
|
+
"cursor-pointer",
|
|
15
|
+
"hover:bg-primary-600",
|
|
16
|
+
"hover:text-text",
|
|
17
|
+
"focus-visible:outline-none",
|
|
18
|
+
"focus-visible:ring-2",
|
|
19
|
+
"focus-visible:ring-offset-0",
|
|
20
|
+
"focus-visible:ring-indicator-info",
|
|
21
|
+
"disabled:opacity-50",
|
|
22
|
+
"disabled:cursor-not-allowed",
|
|
23
|
+
"disabled:pointer-events-none"
|
|
24
|
+
];
|
|
25
|
+
const sizeClasses = {
|
|
26
|
+
sm: ["w-6", "h-6", "text-sm"],
|
|
27
|
+
md: ["w-10", "h-10", "text-base"]
|
|
28
|
+
};
|
|
29
|
+
const activeClasses = active ? ["!bg-primary-50", "!text-primary-950", "hover:!bg-primary-100"] : [];
|
|
30
|
+
const allClasses = [
|
|
31
|
+
...baseClasses,
|
|
32
|
+
...sizeClasses[size],
|
|
33
|
+
...activeClasses
|
|
34
|
+
].join(" ");
|
|
35
|
+
const ariaLabel = props["aria-label"] ?? "Bot\xE3o de a\xE7\xE3o";
|
|
36
|
+
return /* @__PURE__ */ jsx(
|
|
37
|
+
"button",
|
|
38
|
+
{
|
|
39
|
+
ref,
|
|
40
|
+
type: "button",
|
|
41
|
+
className: `${allClasses} ${className}`,
|
|
42
|
+
disabled,
|
|
43
|
+
"aria-pressed": active,
|
|
44
|
+
"aria-label": ariaLabel,
|
|
45
|
+
...props,
|
|
46
|
+
children: /* @__PURE__ */ jsx("span", { className: "flex items-center justify-center", children: icon })
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
IconButton.displayName = "IconButton";
|
|
52
|
+
|
|
53
|
+
export {
|
|
54
|
+
IconButton
|
|
55
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// src/components/SelectionButton/SelectionButton.tsx
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
var SelectionButton = forwardRef(
|
|
5
|
+
({ icon, label, selected = false, className = "", disabled, ...props }, ref) => {
|
|
6
|
+
const baseClasses = [
|
|
7
|
+
"inline-flex",
|
|
8
|
+
"items-center",
|
|
9
|
+
"justify-start",
|
|
10
|
+
"gap-2",
|
|
11
|
+
"p-4",
|
|
12
|
+
"rounded-xl",
|
|
13
|
+
"cursor-pointer",
|
|
14
|
+
"border",
|
|
15
|
+
"border-border-50",
|
|
16
|
+
"bg-background",
|
|
17
|
+
"text-sm",
|
|
18
|
+
"text-text-700",
|
|
19
|
+
"font-bold",
|
|
20
|
+
"shadow-soft-shadow-1",
|
|
21
|
+
"hover:bg-background-100",
|
|
22
|
+
"focus-visible:outline-none",
|
|
23
|
+
"focus-visible:ring-2",
|
|
24
|
+
"focus-visible:ring-indicator-info",
|
|
25
|
+
"focus-visible:ring-offset-0",
|
|
26
|
+
"focus-visible:shadow-none",
|
|
27
|
+
"active:ring-2",
|
|
28
|
+
"active:ring-primary-950",
|
|
29
|
+
"active:ring-offset-0",
|
|
30
|
+
"active:shadow-none",
|
|
31
|
+
"disabled:opacity-50",
|
|
32
|
+
"disabled:cursor-not-allowed"
|
|
33
|
+
];
|
|
34
|
+
const stateClasses = selected ? ["ring-primary-950", "ring-2", "ring-offset-0", "shadow-none"] : [];
|
|
35
|
+
const allClasses = [...baseClasses, ...stateClasses].join(" ");
|
|
36
|
+
return /* @__PURE__ */ jsxs(
|
|
37
|
+
"button",
|
|
38
|
+
{
|
|
39
|
+
ref,
|
|
40
|
+
type: "button",
|
|
41
|
+
className: `${allClasses} ${className}`,
|
|
42
|
+
disabled,
|
|
43
|
+
"aria-pressed": selected,
|
|
44
|
+
...props,
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ jsx("span", { className: "flex items-center justify-center w-6 h-6", children: icon }),
|
|
47
|
+
/* @__PURE__ */ jsx("span", { children: label })
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
SelectionButton.displayName = "SelectionButton";
|
|
54
|
+
|
|
55
|
+
export {
|
|
56
|
+
SelectionButton
|
|
57
|
+
};
|