analytica-frontend-lib 1.0.23 → 1.0.25
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/index.d.mts +260 -319
- package/dist/index.d.ts +260 -319
- package/dist/index.js +659 -599
- package/dist/index.mjs +647 -580
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -20,190 +20,31 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
|
+
Alert: () => Alert,
|
|
23
24
|
Badge: () => Badge,
|
|
24
25
|
Button: () => Button,
|
|
25
26
|
CheckBox: () => CheckBox,
|
|
26
27
|
DropdownMenu: () => DropdownMenu,
|
|
28
|
+
DropdownMenuContent: () => MenuContent,
|
|
29
|
+
DropdownMenuItem: () => MenuItem,
|
|
30
|
+
DropdownMenuLabel: () => MenuLabel,
|
|
31
|
+
DropdownMenuSeparator: () => MenuSeparator,
|
|
27
32
|
DropdownMenuTrigger: () => DropdownMenuTrigger,
|
|
28
33
|
IconButton: () => IconButton,
|
|
29
34
|
IconRoundedButton: () => IconRoundedButton,
|
|
30
|
-
MenuContent: () => MenuContent,
|
|
31
|
-
MenuItem: () => MenuItem,
|
|
32
|
-
MenuLabel: () => MenuLabel,
|
|
33
|
-
MenuSeparator: () => MenuSeparator,
|
|
34
35
|
NavButton: () => NavButton,
|
|
35
36
|
SelectionButton: () => SelectionButton,
|
|
36
37
|
Table: () => Table,
|
|
37
|
-
TableBody: () => TableBody,
|
|
38
|
-
TableCaption: () => TableCaption,
|
|
39
|
-
TableCell: () => TableCell,
|
|
40
|
-
TableFooter: () => TableFooter,
|
|
41
|
-
TableHead: () => TableHead,
|
|
42
|
-
TableHeader: () => TableHeader,
|
|
43
|
-
TableRow: () => TableRow,
|
|
44
38
|
Text: () => Text,
|
|
45
39
|
TextArea: () => TextArea,
|
|
46
40
|
Toast: () => Toast,
|
|
47
41
|
Toaster: () => Toaster,
|
|
48
|
-
useToast: () => useToast,
|
|
49
42
|
useToastStore: () => useToastStore
|
|
50
43
|
});
|
|
51
44
|
module.exports = __toCommonJS(index_exports);
|
|
52
45
|
|
|
53
|
-
// src/components/Button/Button.tsx
|
|
54
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
55
|
-
var VARIANT_ACTION_CLASSES = {
|
|
56
|
-
solid: {
|
|
57
|
-
primary: "bg-primary-950 text-text border border-primary-950 hover:bg-primary-800 hover:border-primary-800 focus-visible:outline-none focus-visible:bg-primary-950 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-primary-700 active:border-primary-700 disabled:bg-primary-500 disabled:border-primary-500 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
58
|
-
positive: "bg-success-500 text-text border border-success-500 hover:bg-success-600 hover:border-success-600 focus-visible:outline-none focus-visible:bg-success-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-success-700 active:border-success-700 disabled:bg-success-500 disabled:border-success-500 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
59
|
-
negative: "bg-error-500 text-text border border-error-500 hover:bg-error-600 hover:border-error-600 focus-visible:outline-none focus-visible:bg-error-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-error-700 active:border-error-700 disabled:bg-error-500 disabled:border-error-500 disabled:opacity-40 disabled:cursor-not-allowed"
|
|
60
|
-
},
|
|
61
|
-
outline: {
|
|
62
|
-
primary: "bg-transparent text-primary-950 border border-primary-950 hover:bg-background-50 hover:text-primary-400 hover:border-primary-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 active:border-primary-700 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
63
|
-
positive: "bg-transparent text-success-500 border border-success-300 hover:bg-background-50 hover:text-success-400 hover:border-success-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 active:border-success-700 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
64
|
-
negative: "bg-transparent text-error-500 border border-error-300 hover:bg-background-50 hover:text-error-400 hover:border-error-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 active:border-error-700 disabled:opacity-40 disabled:cursor-not-allowed"
|
|
65
|
-
},
|
|
66
|
-
link: {
|
|
67
|
-
primary: "bg-transparent text-primary-950 hover:text-primary-400 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
68
|
-
positive: "bg-transparent text-success-500 hover:text-success-400 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
69
|
-
negative: "bg-transparent text-error-500 hover:text-error-400 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 disabled:opacity-40 disabled:cursor-not-allowed"
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
var SIZE_CLASSES = {
|
|
73
|
-
"extra-small": "text-xs px-3.5 py-2",
|
|
74
|
-
small: "text-sm px-4 py-2.5",
|
|
75
|
-
medium: "text-md px-5 py-2.5",
|
|
76
|
-
large: "text-lg px-6 py-3",
|
|
77
|
-
"extra-large": "text-lg px-7 py-3.5"
|
|
78
|
-
};
|
|
79
|
-
var Button = ({
|
|
80
|
-
children,
|
|
81
|
-
iconLeft,
|
|
82
|
-
iconRight,
|
|
83
|
-
size = "medium",
|
|
84
|
-
variant = "solid",
|
|
85
|
-
action = "primary",
|
|
86
|
-
className = "",
|
|
87
|
-
disabled,
|
|
88
|
-
type = "button",
|
|
89
|
-
...props
|
|
90
|
-
}) => {
|
|
91
|
-
const sizeClasses = SIZE_CLASSES[size];
|
|
92
|
-
const variantClasses = VARIANT_ACTION_CLASSES[variant][action];
|
|
93
|
-
const baseClasses = "inline-flex items-center justify-center rounded-full cursor-pointer font-medium";
|
|
94
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
95
|
-
"button",
|
|
96
|
-
{
|
|
97
|
-
className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
|
|
98
|
-
disabled,
|
|
99
|
-
type,
|
|
100
|
-
...props,
|
|
101
|
-
children: [
|
|
102
|
-
iconLeft && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "mr-2 flex items-center", children: iconLeft }),
|
|
103
|
-
children,
|
|
104
|
-
iconRight && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "ml-2 flex items-center", children: iconRight })
|
|
105
|
-
]
|
|
106
|
-
}
|
|
107
|
-
);
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
// src/components/IconRoundedButton/IconRoundedButton.tsx
|
|
111
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
112
|
-
var IconRoundedButton = ({
|
|
113
|
-
icon,
|
|
114
|
-
className = "",
|
|
115
|
-
disabled,
|
|
116
|
-
...props
|
|
117
|
-
}) => {
|
|
118
|
-
const baseClasses = [
|
|
119
|
-
"inline-flex",
|
|
120
|
-
"items-center",
|
|
121
|
-
"justify-center",
|
|
122
|
-
"w-8",
|
|
123
|
-
"h-8",
|
|
124
|
-
"rounded-full",
|
|
125
|
-
"cursor-pointer",
|
|
126
|
-
"border",
|
|
127
|
-
"border-background-200",
|
|
128
|
-
"bg-background",
|
|
129
|
-
"text-text-950",
|
|
130
|
-
"hover:shadow-hard-shadow-1",
|
|
131
|
-
"focus-visible:outline-none",
|
|
132
|
-
"focus-visible:shadow-hard-shadow-1",
|
|
133
|
-
"focus-visible:ring-2",
|
|
134
|
-
"focus-visible:ring-indicator-info",
|
|
135
|
-
"focus-visible:ring-offset-0",
|
|
136
|
-
"disabled:opacity-50",
|
|
137
|
-
"disabled:cursor-not-allowed"
|
|
138
|
-
].join(" ");
|
|
139
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
140
|
-
"button",
|
|
141
|
-
{
|
|
142
|
-
type: "button",
|
|
143
|
-
className: `${baseClasses} ${className}`,
|
|
144
|
-
disabled,
|
|
145
|
-
...props,
|
|
146
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "flex items-center justify-center w-5 h-5", children: icon })
|
|
147
|
-
}
|
|
148
|
-
);
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
// src/components/SelectionButton/SelectionButton.tsx
|
|
152
|
-
var import_react = require("react");
|
|
153
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
154
|
-
var SelectionButton = (0, import_react.forwardRef)(
|
|
155
|
-
({ icon, label, selected = false, className = "", disabled, ...props }, ref) => {
|
|
156
|
-
const baseClasses = [
|
|
157
|
-
"inline-flex",
|
|
158
|
-
"items-center",
|
|
159
|
-
"justify-start",
|
|
160
|
-
"gap-2",
|
|
161
|
-
"p-4",
|
|
162
|
-
"rounded-xl",
|
|
163
|
-
"cursor-pointer",
|
|
164
|
-
"border",
|
|
165
|
-
"border-border-50",
|
|
166
|
-
"bg-background",
|
|
167
|
-
"text-sm",
|
|
168
|
-
"text-text-700",
|
|
169
|
-
"font-bold",
|
|
170
|
-
"shadow-soft-shadow-1",
|
|
171
|
-
"hover:bg-background-100",
|
|
172
|
-
"focus-visible:outline-none",
|
|
173
|
-
"focus-visible:ring-2",
|
|
174
|
-
"focus-visible:ring-indicator-info",
|
|
175
|
-
"focus-visible:ring-offset-0",
|
|
176
|
-
"focus-visible:shadow-none",
|
|
177
|
-
"active:ring-2",
|
|
178
|
-
"active:ring-primary-950",
|
|
179
|
-
"active:ring-offset-0",
|
|
180
|
-
"active:shadow-none",
|
|
181
|
-
"disabled:opacity-50",
|
|
182
|
-
"disabled:cursor-not-allowed"
|
|
183
|
-
];
|
|
184
|
-
const stateClasses = selected ? ["ring-primary-950", "ring-2", "ring-offset-0", "shadow-none"] : [];
|
|
185
|
-
const allClasses = [...baseClasses, ...stateClasses].join(" ");
|
|
186
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
187
|
-
"button",
|
|
188
|
-
{
|
|
189
|
-
ref,
|
|
190
|
-
type: "button",
|
|
191
|
-
className: `${allClasses} ${className}`,
|
|
192
|
-
disabled,
|
|
193
|
-
"aria-pressed": selected,
|
|
194
|
-
...props,
|
|
195
|
-
children: [
|
|
196
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "flex items-center justify-center w-6 h-6", children: icon }),
|
|
197
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: label })
|
|
198
|
-
]
|
|
199
|
-
}
|
|
200
|
-
);
|
|
201
|
-
}
|
|
202
|
-
);
|
|
203
|
-
SelectionButton.displayName = "SelectionButton";
|
|
204
|
-
|
|
205
46
|
// src/components/Text/Text.tsx
|
|
206
|
-
var
|
|
47
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
207
48
|
var Text = ({
|
|
208
49
|
children,
|
|
209
50
|
size = "md",
|
|
@@ -242,7 +83,7 @@ var Text = ({
|
|
|
242
83
|
weightClasses = weightClassMap[weight] ?? weightClassMap.normal;
|
|
243
84
|
const baseClasses = "font-primary";
|
|
244
85
|
const Component = as ?? "p";
|
|
245
|
-
return /* @__PURE__ */ (0,
|
|
86
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
246
87
|
Component,
|
|
247
88
|
{
|
|
248
89
|
className: `${baseClasses} ${sizeClasses} ${weightClasses} ${color} ${className}`,
|
|
@@ -252,140 +93,66 @@ var Text = ({
|
|
|
252
93
|
);
|
|
253
94
|
};
|
|
254
95
|
|
|
255
|
-
// src/components/
|
|
256
|
-
var
|
|
257
|
-
var
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
textarea: "h-24 text-sm",
|
|
263
|
-
// 96px height, 14px font
|
|
264
|
-
textSize: "sm"
|
|
265
|
-
},
|
|
266
|
-
medium: {
|
|
267
|
-
container: "w-72",
|
|
268
|
-
// 288px width
|
|
269
|
-
textarea: "h-24 text-base",
|
|
270
|
-
// 96px height, 16px font
|
|
271
|
-
textSize: "md"
|
|
96
|
+
// src/components/Button/Button.tsx
|
|
97
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
98
|
+
var VARIANT_ACTION_CLASSES = {
|
|
99
|
+
solid: {
|
|
100
|
+
primary: "bg-primary-950 text-text border border-primary-950 hover:bg-primary-800 hover:border-primary-800 focus-visible:outline-none focus-visible:bg-primary-950 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-primary-700 active:border-primary-700 disabled:bg-primary-500 disabled:border-primary-500 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
101
|
+
positive: "bg-success-500 text-text border border-success-500 hover:bg-success-600 hover:border-success-600 focus-visible:outline-none focus-visible:bg-success-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-success-700 active:border-success-700 disabled:bg-success-500 disabled:border-success-500 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
102
|
+
negative: "bg-error-500 text-text border border-error-500 hover:bg-error-600 hover:border-error-600 focus-visible:outline-none focus-visible:bg-error-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-error-700 active:border-error-700 disabled:bg-error-500 disabled:border-error-500 disabled:opacity-40 disabled:cursor-not-allowed"
|
|
272
103
|
},
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
// 96px height, 18px font
|
|
278
|
-
textSize: "lg"
|
|
104
|
+
outline: {
|
|
105
|
+
primary: "bg-transparent text-primary-950 border border-primary-950 hover:bg-background-50 hover:text-primary-400 hover:border-primary-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 active:border-primary-700 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
106
|
+
positive: "bg-transparent text-success-500 border border-success-300 hover:bg-background-50 hover:text-success-400 hover:border-success-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 active:border-success-700 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
107
|
+
negative: "bg-transparent text-error-500 border border-error-300 hover:bg-background-50 hover:text-error-400 hover:border-error-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 active:border-error-700 disabled:opacity-40 disabled:cursor-not-allowed"
|
|
279
108
|
},
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
// 96px height, 20px font
|
|
285
|
-
textSize: "xl"
|
|
109
|
+
link: {
|
|
110
|
+
primary: "bg-transparent text-primary-950 hover:text-primary-400 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
111
|
+
positive: "bg-transparent text-success-500 hover:text-success-400 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
112
|
+
negative: "bg-transparent text-error-500 hover:text-error-400 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 disabled:opacity-40 disabled:cursor-not-allowed"
|
|
286
113
|
}
|
|
287
114
|
};
|
|
288
|
-
var
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
},
|
|
295
|
-
hovered: {
|
|
296
|
-
base: "border-border-400 bg-background text-text-600",
|
|
297
|
-
hover: "",
|
|
298
|
-
focus: "focus:border-border-500"
|
|
299
|
-
},
|
|
300
|
-
focused: {
|
|
301
|
-
base: "border-2 border-primary-950 bg-background text-text-900",
|
|
302
|
-
hover: "",
|
|
303
|
-
focus: ""
|
|
304
|
-
},
|
|
305
|
-
invalid: {
|
|
306
|
-
base: "border-2 border-red-700 bg-white text-gray-800",
|
|
307
|
-
hover: "hover:border-red-700",
|
|
308
|
-
focus: "focus:border-red-700"
|
|
309
|
-
},
|
|
310
|
-
disabled: {
|
|
311
|
-
base: "border-border-300 bg-background text-text-600 cursor-not-allowed opacity-40",
|
|
312
|
-
hover: "",
|
|
313
|
-
focus: ""
|
|
314
|
-
}
|
|
115
|
+
var SIZE_CLASSES = {
|
|
116
|
+
"extra-small": "text-xs px-3.5 py-2",
|
|
117
|
+
small: "text-sm px-4 py-2.5",
|
|
118
|
+
medium: "text-md px-5 py-2.5",
|
|
119
|
+
large: "text-lg px-6 py-3",
|
|
120
|
+
"extra-large": "text-lg px-7 py-3.5"
|
|
315
121
|
};
|
|
316
|
-
var
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
props.onBlur?.(event);
|
|
344
|
-
};
|
|
345
|
-
let currentState = disabled ? "disabled" : state;
|
|
346
|
-
if (isFocused && currentState !== "invalid" && currentState !== "disabled") {
|
|
347
|
-
currentState = "focused";
|
|
122
|
+
var Button = ({
|
|
123
|
+
children,
|
|
124
|
+
iconLeft,
|
|
125
|
+
iconRight,
|
|
126
|
+
size = "medium",
|
|
127
|
+
variant = "solid",
|
|
128
|
+
action = "primary",
|
|
129
|
+
className = "",
|
|
130
|
+
disabled,
|
|
131
|
+
type = "button",
|
|
132
|
+
...props
|
|
133
|
+
}) => {
|
|
134
|
+
const sizeClasses = SIZE_CLASSES[size];
|
|
135
|
+
const variantClasses = VARIANT_ACTION_CLASSES[variant][action];
|
|
136
|
+
const baseClasses = "inline-flex items-center justify-center rounded-full cursor-pointer font-medium";
|
|
137
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
138
|
+
"button",
|
|
139
|
+
{
|
|
140
|
+
className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
|
|
141
|
+
disabled,
|
|
142
|
+
type,
|
|
143
|
+
...props,
|
|
144
|
+
children: [
|
|
145
|
+
iconLeft && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "mr-2 flex items-center", children: iconLeft }),
|
|
146
|
+
children,
|
|
147
|
+
iconRight && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "ml-2 flex items-center", children: iconRight })
|
|
148
|
+
]
|
|
348
149
|
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
const textareaClasses = `${BASE_TEXTAREA_CLASSES} ${sizeClasses.textarea} ${stateClasses.base} ${stateClasses.hover} ${stateClasses.focus} ${className}`;
|
|
352
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: `flex flex-col ${sizeClasses.container}`, children: [
|
|
353
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
354
|
-
Text,
|
|
355
|
-
{
|
|
356
|
-
as: "label",
|
|
357
|
-
htmlFor: inputId,
|
|
358
|
-
size: sizeClasses.textSize,
|
|
359
|
-
weight: "medium",
|
|
360
|
-
color: "text-text-950",
|
|
361
|
-
className: `mb-1.5 ${labelClassName}`,
|
|
362
|
-
children: label
|
|
363
|
-
}
|
|
364
|
-
),
|
|
365
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
366
|
-
"textarea",
|
|
367
|
-
{
|
|
368
|
-
ref,
|
|
369
|
-
id: inputId,
|
|
370
|
-
disabled,
|
|
371
|
-
onChange: handleChange,
|
|
372
|
-
onFocus: handleFocus,
|
|
373
|
-
onBlur: handleBlur,
|
|
374
|
-
className: textareaClasses,
|
|
375
|
-
placeholder,
|
|
376
|
-
...props
|
|
377
|
-
}
|
|
378
|
-
),
|
|
379
|
-
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { size: "sm", weight: "normal", className: "mt-1.5 text-error-600", children: errorMessage }),
|
|
380
|
-
helperMessage && !errorMessage && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { size: "sm", weight: "normal", className: "mt-1.5 text-text-500", children: helperMessage })
|
|
381
|
-
] });
|
|
382
|
-
}
|
|
383
|
-
);
|
|
384
|
-
TextArea.displayName = "TextArea";
|
|
150
|
+
);
|
|
151
|
+
};
|
|
385
152
|
|
|
386
153
|
// src/components/Badge/Badge.tsx
|
|
387
154
|
var import_phosphor_react = require("phosphor-react");
|
|
388
|
-
var
|
|
155
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
389
156
|
var VARIANT_ACTION_CLASSES2 = {
|
|
390
157
|
solid: {
|
|
391
158
|
error: "bg-error text-error-700 focus-visible:outline-none",
|
|
@@ -413,7 +180,7 @@ var VARIANT_ACTION_CLASSES2 = {
|
|
|
413
180
|
},
|
|
414
181
|
notification: "text-primary"
|
|
415
182
|
};
|
|
416
|
-
var
|
|
183
|
+
var SIZE_CLASSES2 = {
|
|
417
184
|
small: "text-2xs px-2 py-1",
|
|
418
185
|
medium: "text-xs px-2 py-1",
|
|
419
186
|
large: "text-sm px-2 py-1"
|
|
@@ -434,50 +201,423 @@ var Badge = ({
|
|
|
434
201
|
notificationActive = false,
|
|
435
202
|
...props
|
|
436
203
|
}) => {
|
|
437
|
-
const sizeClasses =
|
|
204
|
+
const sizeClasses = SIZE_CLASSES2[size];
|
|
438
205
|
const sizeClassesIcon = SIZE_CLASSES_ICON[size];
|
|
439
206
|
const variantActionMap = VARIANT_ACTION_CLASSES2[variant] || {};
|
|
440
207
|
const variantClasses = typeof variantActionMap === "string" ? variantActionMap : variantActionMap[action] ?? variantActionMap.muted ?? "";
|
|
441
208
|
const baseClasses = "inline-flex items-center justify-center rounded-xs font-medium gap-1 relative";
|
|
442
209
|
const baseClassesIcon = "flex items-center";
|
|
443
210
|
if (variant === "notification") {
|
|
444
|
-
return /* @__PURE__ */ (0,
|
|
211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
445
212
|
"div",
|
|
446
213
|
{
|
|
447
|
-
className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
|
|
214
|
+
className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
|
|
215
|
+
...props,
|
|
216
|
+
children: [
|
|
217
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_phosphor_react.Bell, { size: 24, className: "text-primary-950" }),
|
|
218
|
+
notificationActive && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
219
|
+
"span",
|
|
220
|
+
{
|
|
221
|
+
"data-testid": "notification-dot",
|
|
222
|
+
className: "absolute top-[5px] right-[10px] block h-2 w-2 rounded-full bg-indicator-error ring-2 ring-white"
|
|
223
|
+
}
|
|
224
|
+
)
|
|
225
|
+
]
|
|
226
|
+
}
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
230
|
+
"div",
|
|
231
|
+
{
|
|
232
|
+
className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
|
|
233
|
+
...props,
|
|
234
|
+
children: [
|
|
235
|
+
iconLeft && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: `${baseClassesIcon} ${sizeClassesIcon}`, children: iconLeft }),
|
|
236
|
+
children,
|
|
237
|
+
iconRight && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: `${baseClassesIcon} ${sizeClassesIcon}`, children: iconRight })
|
|
238
|
+
]
|
|
239
|
+
}
|
|
240
|
+
);
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
// src/components/Alert/Alert.tsx
|
|
244
|
+
var import_phosphor_react2 = require("phosphor-react");
|
|
245
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
246
|
+
var VARIANT_ACTION_CLASSES3 = {
|
|
247
|
+
solid: {
|
|
248
|
+
default: "bg-background-50 border-transparent",
|
|
249
|
+
info: "bg-info border-transparent",
|
|
250
|
+
success: "bg-success border-transparent",
|
|
251
|
+
warning: "bg-warning border-transparent",
|
|
252
|
+
error: "bg-error border-transparent"
|
|
253
|
+
},
|
|
254
|
+
outline: {
|
|
255
|
+
default: "bg-background border border-border-100",
|
|
256
|
+
info: "bg-background border border-border-100",
|
|
257
|
+
success: "bg-background border border-border-100",
|
|
258
|
+
warning: "bg-background border border-border-100",
|
|
259
|
+
error: "bg-background border border-border-100"
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
var COLOR_CLASSES = {
|
|
263
|
+
default: "text-text-950",
|
|
264
|
+
info: "text-info-800",
|
|
265
|
+
success: "text-success-800",
|
|
266
|
+
warning: "text-warning-800",
|
|
267
|
+
error: "text-error-800"
|
|
268
|
+
};
|
|
269
|
+
var ICONS = {
|
|
270
|
+
default: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_phosphor_react2.CheckCircle, { size: 18 }),
|
|
271
|
+
info: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_phosphor_react2.Info, { size: 18 }),
|
|
272
|
+
success: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_phosphor_react2.CheckCircle, { size: 18 }),
|
|
273
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_phosphor_react2.WarningCircle, { size: 18 }),
|
|
274
|
+
error: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_phosphor_react2.XCircle, { size: 18 })
|
|
275
|
+
};
|
|
276
|
+
var Alert = ({
|
|
277
|
+
variant = "solid",
|
|
278
|
+
title,
|
|
279
|
+
description,
|
|
280
|
+
action = "default",
|
|
281
|
+
className,
|
|
282
|
+
...props
|
|
283
|
+
}) => {
|
|
284
|
+
const baseClasses = "alert-wrapper flex items-start gap-2 w-[384px] py-3 px-4 font-inherit rounded-md";
|
|
285
|
+
const variantClasses = VARIANT_ACTION_CLASSES3[variant][action];
|
|
286
|
+
const variantColor = COLOR_CLASSES[action];
|
|
287
|
+
const variantIcon = ICONS[action];
|
|
288
|
+
const hasHeading = Boolean(title);
|
|
289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
290
|
+
"div",
|
|
291
|
+
{
|
|
292
|
+
className: `${baseClasses} ${variantClasses} ${className ?? ""}`,
|
|
293
|
+
...props,
|
|
294
|
+
children: [
|
|
295
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: `mt-0.5 ${variantColor}`, children: variantIcon }),
|
|
296
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
|
|
297
|
+
hasHeading && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
298
|
+
Text,
|
|
299
|
+
{
|
|
300
|
+
size: "md",
|
|
301
|
+
weight: "medium",
|
|
302
|
+
color: variantColor,
|
|
303
|
+
className: "mb-0.5",
|
|
304
|
+
children: title
|
|
305
|
+
}
|
|
306
|
+
),
|
|
307
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
308
|
+
Text,
|
|
309
|
+
{
|
|
310
|
+
size: hasHeading ? "sm" : "md",
|
|
311
|
+
weight: "normal",
|
|
312
|
+
color: !hasHeading ? variantColor : "text-text-700",
|
|
313
|
+
children: description
|
|
314
|
+
}
|
|
315
|
+
)
|
|
316
|
+
] })
|
|
317
|
+
]
|
|
318
|
+
}
|
|
319
|
+
);
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
// src/components/IconButton/IconButton.tsx
|
|
323
|
+
var import_react = require("react");
|
|
324
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
325
|
+
var IconButton = (0, import_react.forwardRef)(
|
|
326
|
+
({ icon, size = "md", active = false, className = "", disabled, ...props }, ref) => {
|
|
327
|
+
const baseClasses = [
|
|
328
|
+
"inline-flex",
|
|
329
|
+
"items-center",
|
|
330
|
+
"justify-center",
|
|
331
|
+
"rounded-lg",
|
|
332
|
+
"font-medium",
|
|
333
|
+
"bg-transparent",
|
|
334
|
+
"text-text-950",
|
|
335
|
+
"cursor-pointer",
|
|
336
|
+
"hover:bg-primary-600",
|
|
337
|
+
"hover:text-text",
|
|
338
|
+
"focus-visible:outline-none",
|
|
339
|
+
"focus-visible:ring-2",
|
|
340
|
+
"focus-visible:ring-offset-0",
|
|
341
|
+
"focus-visible:ring-indicator-info",
|
|
342
|
+
"disabled:opacity-50",
|
|
343
|
+
"disabled:cursor-not-allowed",
|
|
344
|
+
"disabled:pointer-events-none"
|
|
345
|
+
];
|
|
346
|
+
const sizeClasses = {
|
|
347
|
+
sm: ["w-6", "h-6", "text-sm"],
|
|
348
|
+
md: ["w-10", "h-10", "text-base"]
|
|
349
|
+
};
|
|
350
|
+
const activeClasses = active ? ["!bg-primary-50", "!text-primary-950", "hover:!bg-primary-100"] : [];
|
|
351
|
+
const allClasses = [
|
|
352
|
+
...baseClasses,
|
|
353
|
+
...sizeClasses[size],
|
|
354
|
+
...activeClasses
|
|
355
|
+
].join(" ");
|
|
356
|
+
const ariaLabel = props["aria-label"] ?? "Bot\xE3o de a\xE7\xE3o";
|
|
357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
358
|
+
"button",
|
|
359
|
+
{
|
|
360
|
+
ref,
|
|
361
|
+
type: "button",
|
|
362
|
+
className: `${allClasses} ${className}`,
|
|
363
|
+
disabled,
|
|
364
|
+
"aria-pressed": active,
|
|
365
|
+
"aria-label": ariaLabel,
|
|
366
|
+
...props,
|
|
367
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "flex items-center justify-center", children: icon })
|
|
368
|
+
}
|
|
369
|
+
);
|
|
370
|
+
}
|
|
371
|
+
);
|
|
372
|
+
IconButton.displayName = "IconButton";
|
|
373
|
+
|
|
374
|
+
// src/components/IconRoundedButton/IconRoundedButton.tsx
|
|
375
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
376
|
+
var IconRoundedButton = ({
|
|
377
|
+
icon,
|
|
378
|
+
className = "",
|
|
379
|
+
disabled,
|
|
380
|
+
...props
|
|
381
|
+
}) => {
|
|
382
|
+
const baseClasses = [
|
|
383
|
+
"inline-flex",
|
|
384
|
+
"items-center",
|
|
385
|
+
"justify-center",
|
|
386
|
+
"w-8",
|
|
387
|
+
"h-8",
|
|
388
|
+
"rounded-full",
|
|
389
|
+
"cursor-pointer",
|
|
390
|
+
"border",
|
|
391
|
+
"border-background-200",
|
|
392
|
+
"bg-background",
|
|
393
|
+
"text-text-950",
|
|
394
|
+
"hover:shadow-hard-shadow-1",
|
|
395
|
+
"focus-visible:outline-none",
|
|
396
|
+
"focus-visible:shadow-hard-shadow-1",
|
|
397
|
+
"focus-visible:ring-2",
|
|
398
|
+
"focus-visible:ring-indicator-info",
|
|
399
|
+
"focus-visible:ring-offset-0",
|
|
400
|
+
"disabled:opacity-50",
|
|
401
|
+
"disabled:cursor-not-allowed"
|
|
402
|
+
].join(" ");
|
|
403
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
404
|
+
"button",
|
|
405
|
+
{
|
|
406
|
+
type: "button",
|
|
407
|
+
className: `${baseClasses} ${className}`,
|
|
408
|
+
disabled,
|
|
409
|
+
...props,
|
|
410
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "flex items-center justify-center w-5 h-5", children: icon })
|
|
411
|
+
}
|
|
412
|
+
);
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
// src/components/NavButton/NavButton.tsx
|
|
416
|
+
var import_react2 = require("react");
|
|
417
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
418
|
+
var NavButton = (0, import_react2.forwardRef)(
|
|
419
|
+
({ icon, label, selected = false, className = "", disabled, ...props }, ref) => {
|
|
420
|
+
const baseClasses = [
|
|
421
|
+
"flex",
|
|
422
|
+
"flex-col",
|
|
423
|
+
"items-center",
|
|
424
|
+
"justify-center",
|
|
425
|
+
"gap-0.5",
|
|
426
|
+
"px-12",
|
|
427
|
+
"py-1",
|
|
428
|
+
"rounded-sm",
|
|
429
|
+
"cursor-pointer",
|
|
430
|
+
"text-text-950",
|
|
431
|
+
"text-xs",
|
|
432
|
+
"font-medium",
|
|
433
|
+
"hover:text-text",
|
|
434
|
+
"hover:bg-primary-600",
|
|
435
|
+
"focus-visible:outline-none",
|
|
436
|
+
"focus-visible:ring-2",
|
|
437
|
+
"focus-visible:ring-offset-0",
|
|
438
|
+
"focus-visible:ring-indicator-info",
|
|
439
|
+
"disabled:opacity-50",
|
|
440
|
+
"disabled:cursor-not-allowed",
|
|
441
|
+
"disabled:pointer-events-none"
|
|
442
|
+
];
|
|
443
|
+
const stateClasses = selected ? ["bg-primary-50", "text-primary-950"] : [];
|
|
444
|
+
const allClasses = [...baseClasses, ...stateClasses].join(" ");
|
|
445
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
446
|
+
"button",
|
|
447
|
+
{
|
|
448
|
+
ref,
|
|
449
|
+
type: "button",
|
|
450
|
+
className: `${allClasses} ${className}`,
|
|
451
|
+
disabled,
|
|
452
|
+
"aria-pressed": selected,
|
|
448
453
|
...props,
|
|
449
454
|
children: [
|
|
450
|
-
/* @__PURE__ */ (0,
|
|
451
|
-
|
|
452
|
-
"span",
|
|
453
|
-
{
|
|
454
|
-
"data-testid": "notification-dot",
|
|
455
|
-
className: "absolute top-[5px] right-[10px] block h-2 w-2 rounded-full bg-indicator-error ring-2 ring-white"
|
|
456
|
-
}
|
|
457
|
-
)
|
|
455
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "flex items-center justify-center w-5 h-5", children: icon }),
|
|
456
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "whitespace-nowrap", children: label })
|
|
458
457
|
]
|
|
459
458
|
}
|
|
460
459
|
);
|
|
461
460
|
}
|
|
462
|
-
|
|
463
|
-
|
|
461
|
+
);
|
|
462
|
+
NavButton.displayName = "NavButton";
|
|
463
|
+
|
|
464
|
+
// src/components/SelectionButton/SelectionButton.tsx
|
|
465
|
+
var import_react3 = require("react");
|
|
466
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
467
|
+
var SelectionButton = (0, import_react3.forwardRef)(
|
|
468
|
+
({ icon, label, selected = false, className = "", disabled, ...props }, ref) => {
|
|
469
|
+
const baseClasses = [
|
|
470
|
+
"inline-flex",
|
|
471
|
+
"items-center",
|
|
472
|
+
"justify-start",
|
|
473
|
+
"gap-2",
|
|
474
|
+
"p-4",
|
|
475
|
+
"rounded-xl",
|
|
476
|
+
"cursor-pointer",
|
|
477
|
+
"border",
|
|
478
|
+
"border-border-50",
|
|
479
|
+
"bg-background",
|
|
480
|
+
"text-sm",
|
|
481
|
+
"text-text-700",
|
|
482
|
+
"font-bold",
|
|
483
|
+
"shadow-soft-shadow-1",
|
|
484
|
+
"hover:bg-background-100",
|
|
485
|
+
"focus-visible:outline-none",
|
|
486
|
+
"focus-visible:ring-2",
|
|
487
|
+
"focus-visible:ring-indicator-info",
|
|
488
|
+
"focus-visible:ring-offset-0",
|
|
489
|
+
"focus-visible:shadow-none",
|
|
490
|
+
"active:ring-2",
|
|
491
|
+
"active:ring-primary-950",
|
|
492
|
+
"active:ring-offset-0",
|
|
493
|
+
"active:shadow-none",
|
|
494
|
+
"disabled:opacity-50",
|
|
495
|
+
"disabled:cursor-not-allowed"
|
|
496
|
+
];
|
|
497
|
+
const stateClasses = selected ? ["ring-primary-950", "ring-2", "ring-offset-0", "shadow-none"] : [];
|
|
498
|
+
const allClasses = [...baseClasses, ...stateClasses].join(" ");
|
|
499
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
500
|
+
"button",
|
|
501
|
+
{
|
|
502
|
+
ref,
|
|
503
|
+
type: "button",
|
|
504
|
+
className: `${allClasses} ${className}`,
|
|
505
|
+
disabled,
|
|
506
|
+
"aria-pressed": selected,
|
|
507
|
+
...props,
|
|
508
|
+
children: [
|
|
509
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "flex items-center justify-center w-6 h-6", children: icon }),
|
|
510
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: label })
|
|
511
|
+
]
|
|
512
|
+
}
|
|
513
|
+
);
|
|
514
|
+
}
|
|
515
|
+
);
|
|
516
|
+
SelectionButton.displayName = "SelectionButton";
|
|
517
|
+
|
|
518
|
+
// src/components/Table/Table.tsx
|
|
519
|
+
var import_react4 = require("react");
|
|
520
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
521
|
+
var Table = (0, import_react4.forwardRef)(
|
|
522
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "border border-border-200 rounded-xl relative w-full overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
523
|
+
"table",
|
|
464
524
|
{
|
|
465
|
-
|
|
525
|
+
ref,
|
|
526
|
+
className: `w-full caption-bottom text-sm ${className ?? ""}`,
|
|
466
527
|
...props,
|
|
467
528
|
children: [
|
|
468
|
-
|
|
469
|
-
children
|
|
470
|
-
iconRight && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: `${baseClassesIcon} ${sizeClassesIcon}`, children: iconRight })
|
|
529
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("caption", { className: "sr-only", children: "My Table" }),
|
|
530
|
+
children
|
|
471
531
|
]
|
|
472
532
|
}
|
|
473
|
-
)
|
|
533
|
+
) })
|
|
534
|
+
);
|
|
535
|
+
Table.displayName = "Table";
|
|
536
|
+
var TableHeader = (0, import_react4.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
537
|
+
"thead",
|
|
538
|
+
{
|
|
539
|
+
ref,
|
|
540
|
+
className: `[&_tr:first-child]:border-0 ${className}`,
|
|
541
|
+
...props
|
|
542
|
+
}
|
|
543
|
+
));
|
|
544
|
+
TableHeader.displayName = "TableHeader";
|
|
545
|
+
var TableBody = (0, import_react4.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
546
|
+
"tbody",
|
|
547
|
+
{
|
|
548
|
+
ref,
|
|
549
|
+
className: `[&_tr:last-child]:border-0 border-t border-border-200 ${className}`,
|
|
550
|
+
...props
|
|
551
|
+
}
|
|
552
|
+
));
|
|
553
|
+
TableBody.displayName = "TableBody";
|
|
554
|
+
var TableFooter = (0, import_react4.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
555
|
+
"tfoot",
|
|
556
|
+
{
|
|
557
|
+
ref,
|
|
558
|
+
className: `border-t bg-background-50 border-border-200 font-medium [&>tr]:last:border-b-0 px-6 py-3.5 ${className}`,
|
|
559
|
+
...props
|
|
560
|
+
}
|
|
561
|
+
));
|
|
562
|
+
TableFooter.displayName = "TableFooter";
|
|
563
|
+
var VARIANT_STATES_ROW = {
|
|
564
|
+
default: "border-b border-border-200",
|
|
565
|
+
selected: "border-b-2 border-indicator-primary",
|
|
566
|
+
invalid: "border-b-2 border-indicator-error",
|
|
567
|
+
disabled: "border-b border-border-100 bg-background-50 opacity-50 cursor-not-allowed"
|
|
474
568
|
};
|
|
569
|
+
var TableRow = (0, import_react4.forwardRef)(
|
|
570
|
+
({ state = "default", className, ...props }, ref) => {
|
|
571
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
572
|
+
"tr",
|
|
573
|
+
{
|
|
574
|
+
ref,
|
|
575
|
+
className: `
|
|
576
|
+
transition-colors
|
|
577
|
+
${state !== "disabled" ? "hover:bg-muted/50" : ""}
|
|
578
|
+
${VARIANT_STATES_ROW[state]}
|
|
579
|
+
${className}
|
|
580
|
+
`,
|
|
581
|
+
"aria-disabled": state === "disabled",
|
|
582
|
+
...props
|
|
583
|
+
}
|
|
584
|
+
);
|
|
585
|
+
}
|
|
586
|
+
);
|
|
587
|
+
TableRow.displayName = "TableRow";
|
|
588
|
+
var TableHead = (0, import_react4.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
589
|
+
"th",
|
|
590
|
+
{
|
|
591
|
+
ref,
|
|
592
|
+
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}`,
|
|
593
|
+
...props
|
|
594
|
+
}
|
|
595
|
+
));
|
|
596
|
+
TableHead.displayName = "TableHead";
|
|
597
|
+
var TableCell = (0, import_react4.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
598
|
+
"td",
|
|
599
|
+
{
|
|
600
|
+
ref,
|
|
601
|
+
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}`,
|
|
602
|
+
...props
|
|
603
|
+
}
|
|
604
|
+
));
|
|
605
|
+
TableCell.displayName = "TableCell";
|
|
606
|
+
var TableCaption = (0, import_react4.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
607
|
+
"caption",
|
|
608
|
+
{
|
|
609
|
+
ref,
|
|
610
|
+
className: `border-t border-border-200 text-sm text-text-800 px-6 py-3.5 ${className}`,
|
|
611
|
+
...props
|
|
612
|
+
}
|
|
613
|
+
));
|
|
614
|
+
TableCaption.displayName = "TableCaption";
|
|
475
615
|
|
|
476
616
|
// src/components/CheckBox/CheckBox.tsx
|
|
477
|
-
var
|
|
478
|
-
var
|
|
479
|
-
var
|
|
480
|
-
var
|
|
617
|
+
var import_react5 = require("react");
|
|
618
|
+
var import_phosphor_react3 = require("phosphor-react");
|
|
619
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
620
|
+
var SIZE_CLASSES3 = {
|
|
481
621
|
small: {
|
|
482
622
|
checkbox: "w-4 h-4",
|
|
483
623
|
// 16px x 16px
|
|
@@ -514,7 +654,7 @@ var SIZE_CLASSES4 = {
|
|
|
514
654
|
}
|
|
515
655
|
};
|
|
516
656
|
var BASE_CHECKBOX_CLASSES = "rounded border cursor-pointer transition-all duration-200 flex items-center justify-center focus:outline-none";
|
|
517
|
-
var
|
|
657
|
+
var STATE_CLASSES = {
|
|
518
658
|
default: {
|
|
519
659
|
unchecked: "border-border-400 bg-background hover:border-border-500",
|
|
520
660
|
checked: "border-primary-950 bg-primary-950 text-text hover:border-primary-800 hover:bg-primary-800"
|
|
@@ -536,7 +676,7 @@ var STATE_CLASSES2 = {
|
|
|
536
676
|
checked: "border-primary-600 bg-primary-600 text-text cursor-not-allowed opacity-40"
|
|
537
677
|
}
|
|
538
678
|
};
|
|
539
|
-
var CheckBox = (0,
|
|
679
|
+
var CheckBox = (0, import_react5.forwardRef)(
|
|
540
680
|
({
|
|
541
681
|
label,
|
|
542
682
|
size = "medium",
|
|
@@ -552,9 +692,9 @@ var CheckBox = (0, import_react3.forwardRef)(
|
|
|
552
692
|
onChange,
|
|
553
693
|
...props
|
|
554
694
|
}, ref) => {
|
|
555
|
-
const generatedId = (0,
|
|
695
|
+
const generatedId = (0, import_react5.useId)();
|
|
556
696
|
const inputId = id ?? `checkbox-${generatedId}`;
|
|
557
|
-
const [internalChecked, setInternalChecked] = (0,
|
|
697
|
+
const [internalChecked, setInternalChecked] = (0, import_react5.useState)(false);
|
|
558
698
|
const isControlled = checkedProp !== void 0;
|
|
559
699
|
const checked = isControlled ? checkedProp : internalChecked;
|
|
560
700
|
const handleChange = (event) => {
|
|
@@ -564,15 +704,15 @@ var CheckBox = (0, import_react3.forwardRef)(
|
|
|
564
704
|
onChange?.(event);
|
|
565
705
|
};
|
|
566
706
|
const currentState = disabled ? "disabled" : state;
|
|
567
|
-
const sizeClasses =
|
|
707
|
+
const sizeClasses = SIZE_CLASSES3[size];
|
|
568
708
|
const checkVariant = checked || indeterminate ? "checked" : "unchecked";
|
|
569
|
-
const stylingClasses =
|
|
709
|
+
const stylingClasses = STATE_CLASSES[currentState][checkVariant];
|
|
570
710
|
const borderWidthClass = state === "focused" || state === "hovered" && size === "large" ? "border-[3px]" : sizeClasses.borderWidth;
|
|
571
711
|
const checkboxClasses = `${BASE_CHECKBOX_CLASSES} ${sizeClasses.checkbox} ${borderWidthClass} ${stylingClasses} ${className}`;
|
|
572
712
|
const renderIcon = () => {
|
|
573
713
|
if (indeterminate) {
|
|
574
|
-
return /* @__PURE__ */ (0,
|
|
575
|
-
|
|
714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
715
|
+
import_phosphor_react3.Minus,
|
|
576
716
|
{
|
|
577
717
|
size: sizeClasses.iconSize,
|
|
578
718
|
weight: "bold",
|
|
@@ -581,8 +721,8 @@ var CheckBox = (0, import_react3.forwardRef)(
|
|
|
581
721
|
);
|
|
582
722
|
}
|
|
583
723
|
if (checked) {
|
|
584
|
-
return /* @__PURE__ */ (0,
|
|
585
|
-
|
|
724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
725
|
+
import_phosphor_react3.Check,
|
|
586
726
|
{
|
|
587
727
|
size: sizeClasses.iconSize,
|
|
588
728
|
weight: "bold",
|
|
@@ -592,13 +732,13 @@ var CheckBox = (0, import_react3.forwardRef)(
|
|
|
592
732
|
}
|
|
593
733
|
return null;
|
|
594
734
|
};
|
|
595
|
-
return /* @__PURE__ */ (0,
|
|
596
|
-
/* @__PURE__ */ (0,
|
|
735
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col", children: [
|
|
736
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
597
737
|
"div",
|
|
598
738
|
{
|
|
599
739
|
className: `flex flex-row items-center ${sizeClasses.spacing} ${disabled ? "opacity-40" : ""}`,
|
|
600
740
|
children: [
|
|
601
|
-
/* @__PURE__ */ (0,
|
|
741
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
602
742
|
"input",
|
|
603
743
|
{
|
|
604
744
|
ref,
|
|
@@ -611,12 +751,12 @@ var CheckBox = (0, import_react3.forwardRef)(
|
|
|
611
751
|
...props
|
|
612
752
|
}
|
|
613
753
|
),
|
|
614
|
-
/* @__PURE__ */ (0,
|
|
615
|
-
label && /* @__PURE__ */ (0,
|
|
754
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { htmlFor: inputId, className: checkboxClasses, children: renderIcon() }),
|
|
755
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
616
756
|
"div",
|
|
617
757
|
{
|
|
618
758
|
className: `flex flex-row items-center ${sizeClasses.labelHeight}`,
|
|
619
|
-
children: /* @__PURE__ */ (0,
|
|
759
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
620
760
|
Text,
|
|
621
761
|
{
|
|
622
762
|
as: "label",
|
|
@@ -632,147 +772,180 @@ var CheckBox = (0, import_react3.forwardRef)(
|
|
|
632
772
|
]
|
|
633
773
|
}
|
|
634
774
|
),
|
|
635
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
775
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
776
|
+
Text,
|
|
777
|
+
{
|
|
778
|
+
size: "sm",
|
|
779
|
+
weight: "normal",
|
|
780
|
+
className: "mt-1.5",
|
|
781
|
+
color: "text-error-600",
|
|
782
|
+
children: errorMessage
|
|
783
|
+
}
|
|
784
|
+
),
|
|
785
|
+
helperText && !errorMessage && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
786
|
+
Text,
|
|
787
|
+
{
|
|
788
|
+
size: "sm",
|
|
789
|
+
weight: "normal",
|
|
790
|
+
className: "mt-1.5",
|
|
791
|
+
color: "text-text-500",
|
|
792
|
+
children: helperText
|
|
793
|
+
}
|
|
794
|
+
)
|
|
795
|
+
] });
|
|
796
|
+
}
|
|
797
|
+
);
|
|
798
|
+
CheckBox.displayName = "CheckBox";
|
|
799
|
+
|
|
800
|
+
// src/components/TextArea/TextArea.tsx
|
|
801
|
+
var import_react6 = require("react");
|
|
802
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
803
|
+
var SIZE_CLASSES4 = {
|
|
804
|
+
small: {
|
|
805
|
+
container: "w-72",
|
|
806
|
+
// 288px width
|
|
807
|
+
textarea: "h-24 text-sm",
|
|
808
|
+
// 96px height, 14px font
|
|
809
|
+
textSize: "sm"
|
|
810
|
+
},
|
|
811
|
+
medium: {
|
|
812
|
+
container: "w-72",
|
|
813
|
+
// 288px width
|
|
814
|
+
textarea: "h-24 text-base",
|
|
815
|
+
// 96px height, 16px font
|
|
816
|
+
textSize: "md"
|
|
817
|
+
},
|
|
818
|
+
large: {
|
|
819
|
+
container: "w-72",
|
|
820
|
+
// 288px width
|
|
821
|
+
textarea: "h-24 text-lg",
|
|
822
|
+
// 96px height, 18px font
|
|
823
|
+
textSize: "lg"
|
|
824
|
+
},
|
|
825
|
+
extraLarge: {
|
|
826
|
+
container: "w-72",
|
|
827
|
+
// 288px width
|
|
828
|
+
textarea: "h-24 text-xl",
|
|
829
|
+
// 96px height, 20px font
|
|
830
|
+
textSize: "xl"
|
|
831
|
+
}
|
|
832
|
+
};
|
|
833
|
+
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";
|
|
834
|
+
var STATE_CLASSES2 = {
|
|
835
|
+
default: {
|
|
836
|
+
base: "border-border-300 bg-background text-text-600",
|
|
837
|
+
hover: "hover:border-border-400",
|
|
838
|
+
focus: "focus:border-border-500"
|
|
839
|
+
},
|
|
840
|
+
hovered: {
|
|
841
|
+
base: "border-border-400 bg-background text-text-600",
|
|
842
|
+
hover: "",
|
|
843
|
+
focus: "focus:border-border-500"
|
|
844
|
+
},
|
|
845
|
+
focused: {
|
|
846
|
+
base: "border-2 border-primary-950 bg-background text-text-900",
|
|
847
|
+
hover: "",
|
|
848
|
+
focus: ""
|
|
849
|
+
},
|
|
850
|
+
invalid: {
|
|
851
|
+
base: "border-2 border-red-700 bg-white text-gray-800",
|
|
852
|
+
hover: "hover:border-red-700",
|
|
853
|
+
focus: "focus:border-red-700"
|
|
854
|
+
},
|
|
855
|
+
disabled: {
|
|
856
|
+
base: "border-border-300 bg-background text-text-600 cursor-not-allowed opacity-40",
|
|
857
|
+
hover: "",
|
|
858
|
+
focus: ""
|
|
859
|
+
}
|
|
860
|
+
};
|
|
861
|
+
var TextArea = (0, import_react6.forwardRef)(
|
|
862
|
+
({
|
|
863
|
+
label,
|
|
864
|
+
size = "medium",
|
|
865
|
+
state = "default",
|
|
866
|
+
errorMessage,
|
|
867
|
+
helperMessage,
|
|
868
|
+
className = "",
|
|
869
|
+
labelClassName = "",
|
|
870
|
+
disabled,
|
|
871
|
+
id,
|
|
872
|
+
onChange,
|
|
873
|
+
placeholder,
|
|
874
|
+
...props
|
|
875
|
+
}, ref) => {
|
|
876
|
+
const generatedId = (0, import_react6.useId)();
|
|
877
|
+
const inputId = id ?? `textarea-${generatedId}`;
|
|
878
|
+
const [isFocused, setIsFocused] = (0, import_react6.useState)(false);
|
|
879
|
+
const handleChange = (event) => {
|
|
880
|
+
onChange?.(event);
|
|
881
|
+
};
|
|
882
|
+
const handleFocus = (event) => {
|
|
883
|
+
setIsFocused(true);
|
|
884
|
+
props.onFocus?.(event);
|
|
885
|
+
};
|
|
886
|
+
const handleBlur = (event) => {
|
|
887
|
+
setIsFocused(false);
|
|
888
|
+
props.onBlur?.(event);
|
|
889
|
+
};
|
|
890
|
+
let currentState = disabled ? "disabled" : state;
|
|
891
|
+
if (isFocused && currentState !== "invalid" && currentState !== "disabled") {
|
|
892
|
+
currentState = "focused";
|
|
893
|
+
}
|
|
894
|
+
const sizeClasses = SIZE_CLASSES4[size];
|
|
895
|
+
const stateClasses = STATE_CLASSES2[currentState];
|
|
896
|
+
const textareaClasses = `${BASE_TEXTAREA_CLASSES} ${sizeClasses.textarea} ${stateClasses.base} ${stateClasses.hover} ${stateClasses.focus} ${className}`;
|
|
897
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: `flex flex-col ${sizeClasses.container}`, children: [
|
|
898
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
636
899
|
Text,
|
|
637
900
|
{
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
901
|
+
as: "label",
|
|
902
|
+
htmlFor: inputId,
|
|
903
|
+
size: sizeClasses.textSize,
|
|
904
|
+
weight: "medium",
|
|
905
|
+
color: "text-text-950",
|
|
906
|
+
className: `mb-1.5 ${labelClassName}`,
|
|
907
|
+
children: label
|
|
643
908
|
}
|
|
644
909
|
),
|
|
645
|
-
|
|
646
|
-
|
|
910
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
911
|
+
"textarea",
|
|
647
912
|
{
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
913
|
+
ref,
|
|
914
|
+
id: inputId,
|
|
915
|
+
disabled,
|
|
916
|
+
onChange: handleChange,
|
|
917
|
+
onFocus: handleFocus,
|
|
918
|
+
onBlur: handleBlur,
|
|
919
|
+
className: textareaClasses,
|
|
920
|
+
placeholder,
|
|
921
|
+
...props
|
|
653
922
|
}
|
|
654
|
-
)
|
|
923
|
+
),
|
|
924
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { size: "sm", weight: "normal", className: "mt-1.5 text-error-600", children: errorMessage }),
|
|
925
|
+
helperMessage && !errorMessage && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { size: "sm", weight: "normal", className: "mt-1.5 text-text-500", children: helperMessage })
|
|
655
926
|
] });
|
|
656
927
|
}
|
|
657
928
|
);
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
// src/components/Table/Table.tsx
|
|
661
|
-
var import_react4 = require("react");
|
|
662
|
-
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
663
|
-
var Table = (0, import_react4.forwardRef)(
|
|
664
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "border border-border-200 rounded-xl relative w-full overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
665
|
-
"table",
|
|
666
|
-
{
|
|
667
|
-
ref,
|
|
668
|
-
className: `w-full caption-bottom text-sm ${className ?? ""}`,
|
|
669
|
-
...props,
|
|
670
|
-
children: [
|
|
671
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("caption", { className: "sr-only", children: "My Table" }),
|
|
672
|
-
children
|
|
673
|
-
]
|
|
674
|
-
}
|
|
675
|
-
) })
|
|
676
|
-
);
|
|
677
|
-
Table.displayName = "Table";
|
|
678
|
-
var TableHeader = (0, import_react4.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
679
|
-
"thead",
|
|
680
|
-
{
|
|
681
|
-
ref,
|
|
682
|
-
className: `[&_tr:first-child]:border-0 ${className}`,
|
|
683
|
-
...props
|
|
684
|
-
}
|
|
685
|
-
));
|
|
686
|
-
TableHeader.displayName = "TableHeader";
|
|
687
|
-
var TableBody = (0, import_react4.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
688
|
-
"tbody",
|
|
689
|
-
{
|
|
690
|
-
ref,
|
|
691
|
-
className: `[&_tr:last-child]:border-0 border-t border-border-200 ${className}`,
|
|
692
|
-
...props
|
|
693
|
-
}
|
|
694
|
-
));
|
|
695
|
-
TableBody.displayName = "TableBody";
|
|
696
|
-
var TableFooter = (0, import_react4.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
697
|
-
"tfoot",
|
|
698
|
-
{
|
|
699
|
-
ref,
|
|
700
|
-
className: `border-t bg-background-50 border-border-200 font-medium [&>tr]:last:border-b-0 px-6 py-3.5 ${className}`,
|
|
701
|
-
...props
|
|
702
|
-
}
|
|
703
|
-
));
|
|
704
|
-
TableFooter.displayName = "TableFooter";
|
|
705
|
-
var VARIANT_STATES_ROW = {
|
|
706
|
-
default: "border-b border-border-200",
|
|
707
|
-
selected: "border-b-2 border-indicator-primary",
|
|
708
|
-
invalid: "border-b-2 border-indicator-error",
|
|
709
|
-
disabled: "border-b border-border-100 bg-background-50 opacity-50 cursor-not-allowed"
|
|
710
|
-
};
|
|
711
|
-
var TableRow = (0, import_react4.forwardRef)(
|
|
712
|
-
({ state = "default", className, ...props }, ref) => {
|
|
713
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
714
|
-
"tr",
|
|
715
|
-
{
|
|
716
|
-
ref,
|
|
717
|
-
className: `
|
|
718
|
-
transition-colors
|
|
719
|
-
${state !== "disabled" ? "hover:bg-muted/50" : ""}
|
|
720
|
-
${VARIANT_STATES_ROW[state]}
|
|
721
|
-
${className}
|
|
722
|
-
`,
|
|
723
|
-
"aria-disabled": state === "disabled",
|
|
724
|
-
...props
|
|
725
|
-
}
|
|
726
|
-
);
|
|
727
|
-
}
|
|
728
|
-
);
|
|
729
|
-
TableRow.displayName = "TableRow";
|
|
730
|
-
var TableHead = (0, import_react4.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
731
|
-
"th",
|
|
732
|
-
{
|
|
733
|
-
ref,
|
|
734
|
-
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}`,
|
|
735
|
-
...props
|
|
736
|
-
}
|
|
737
|
-
));
|
|
738
|
-
TableHead.displayName = "TableHead";
|
|
739
|
-
var TableCell = (0, import_react4.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
740
|
-
"td",
|
|
741
|
-
{
|
|
742
|
-
ref,
|
|
743
|
-
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}`,
|
|
744
|
-
...props
|
|
745
|
-
}
|
|
746
|
-
));
|
|
747
|
-
TableCell.displayName = "TableCell";
|
|
748
|
-
var TableCaption = (0, import_react4.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
749
|
-
"caption",
|
|
750
|
-
{
|
|
751
|
-
ref,
|
|
752
|
-
className: `border-t border-border-200 text-sm text-text-800 px-6 py-3.5 ${className}`,
|
|
753
|
-
...props
|
|
754
|
-
}
|
|
755
|
-
));
|
|
756
|
-
TableCaption.displayName = "TableCaption";
|
|
929
|
+
TextArea.displayName = "TextArea";
|
|
757
930
|
|
|
758
931
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
759
|
-
var
|
|
760
|
-
var
|
|
761
|
-
var DropdownMenuContext = (0,
|
|
932
|
+
var import_react7 = require("react");
|
|
933
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
934
|
+
var DropdownMenuContext = (0, import_react7.createContext)(
|
|
762
935
|
void 0
|
|
763
936
|
);
|
|
764
937
|
var DropdownMenu = ({ children, open, onOpenChange }) => {
|
|
765
|
-
const [internalOpen, setInternalOpen] = (0,
|
|
938
|
+
const [internalOpen, setInternalOpen] = (0, import_react7.useState)(false);
|
|
766
939
|
const isControlled = open !== void 0;
|
|
767
940
|
const currentOpen = isControlled ? open : internalOpen;
|
|
768
|
-
const setOpen = (0,
|
|
941
|
+
const setOpen = (0, import_react7.useCallback)(
|
|
769
942
|
(newOpen) => {
|
|
770
943
|
if (onOpenChange) onOpenChange(newOpen);
|
|
771
944
|
if (!isControlled) setInternalOpen(newOpen);
|
|
772
945
|
},
|
|
773
946
|
[isControlled, onOpenChange]
|
|
774
947
|
);
|
|
775
|
-
const menuRef = (0,
|
|
948
|
+
const menuRef = (0, import_react7.useRef)(null);
|
|
776
949
|
const handleArrowDownOrArrowUp = (event) => {
|
|
777
950
|
const menuContent = menuRef.current?.querySelector('[role="menu"]');
|
|
778
951
|
if (menuContent) {
|
|
@@ -806,7 +979,7 @@ var DropdownMenu = ({ children, open, onOpenChange }) => {
|
|
|
806
979
|
setOpen(false);
|
|
807
980
|
}
|
|
808
981
|
};
|
|
809
|
-
(0,
|
|
982
|
+
(0, import_react7.useEffect)(() => {
|
|
810
983
|
if (currentOpen) {
|
|
811
984
|
document.addEventListener("mousedown", handleClickOutside);
|
|
812
985
|
document.addEventListener("keydown", handleDownkey);
|
|
@@ -816,18 +989,18 @@ var DropdownMenu = ({ children, open, onOpenChange }) => {
|
|
|
816
989
|
document.removeEventListener("keydown", handleDownkey);
|
|
817
990
|
};
|
|
818
991
|
}, [currentOpen]);
|
|
819
|
-
const value = (0,
|
|
992
|
+
const value = (0, import_react7.useMemo)(
|
|
820
993
|
() => ({ open: currentOpen, setOpen }),
|
|
821
994
|
[currentOpen, setOpen]
|
|
822
995
|
);
|
|
823
|
-
return /* @__PURE__ */ (0,
|
|
996
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DropdownMenuContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "relative", ref: menuRef, children }) });
|
|
824
997
|
};
|
|
825
|
-
var DropdownMenuTrigger = (0,
|
|
826
|
-
const context = (0,
|
|
998
|
+
var DropdownMenuTrigger = (0, import_react7.forwardRef)(({ className, children, onClick, ...props }, ref) => {
|
|
999
|
+
const context = (0, import_react7.useContext)(DropdownMenuContext);
|
|
827
1000
|
if (!context)
|
|
828
1001
|
throw new Error("DropdownMenuTrigger must be used within a DropdownMenu");
|
|
829
1002
|
const { open, setOpen } = context;
|
|
830
|
-
return /* @__PURE__ */ (0,
|
|
1003
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
831
1004
|
"button",
|
|
832
1005
|
{
|
|
833
1006
|
ref,
|
|
@@ -859,7 +1032,7 @@ var ALIGN_CLASSES = {
|
|
|
859
1032
|
center: "left-1/2 -translate-x-1/2",
|
|
860
1033
|
end: "right-0"
|
|
861
1034
|
};
|
|
862
|
-
var MenuLabel = (0,
|
|
1035
|
+
var MenuLabel = (0, import_react7.forwardRef)(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
863
1036
|
"fieldset",
|
|
864
1037
|
{
|
|
865
1038
|
ref,
|
|
@@ -869,7 +1042,7 @@ var MenuLabel = (0, import_react5.forwardRef)(({ className, inset, ...props }, r
|
|
|
869
1042
|
}
|
|
870
1043
|
));
|
|
871
1044
|
MenuLabel.displayName = "MenuLabel";
|
|
872
|
-
var MenuContent = (0,
|
|
1045
|
+
var MenuContent = (0, import_react7.forwardRef)(
|
|
873
1046
|
({
|
|
874
1047
|
className,
|
|
875
1048
|
align = "start",
|
|
@@ -878,9 +1051,9 @@ var MenuContent = (0, import_react5.forwardRef)(
|
|
|
878
1051
|
children,
|
|
879
1052
|
...props
|
|
880
1053
|
}, ref) => {
|
|
881
|
-
const { open } = (0,
|
|
882
|
-
const [isVisible, setIsVisible] = (0,
|
|
883
|
-
(0,
|
|
1054
|
+
const { open } = (0, import_react7.useContext)(DropdownMenuContext);
|
|
1055
|
+
const [isVisible, setIsVisible] = (0, import_react7.useState)(open);
|
|
1056
|
+
(0, import_react7.useEffect)(() => {
|
|
884
1057
|
if (open) {
|
|
885
1058
|
setIsVisible(true);
|
|
886
1059
|
} else {
|
|
@@ -894,7 +1067,7 @@ var MenuContent = (0, import_react5.forwardRef)(
|
|
|
894
1067
|
const horizontal = ALIGN_CLASSES[align];
|
|
895
1068
|
return `absolute ${vertical} ${horizontal}`;
|
|
896
1069
|
};
|
|
897
|
-
return /* @__PURE__ */ (0,
|
|
1070
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
898
1071
|
"div",
|
|
899
1072
|
{
|
|
900
1073
|
ref,
|
|
@@ -918,7 +1091,7 @@ var MenuContent = (0, import_react5.forwardRef)(
|
|
|
918
1091
|
}
|
|
919
1092
|
);
|
|
920
1093
|
MenuContent.displayName = "MenuContent";
|
|
921
|
-
var MenuItem = (0,
|
|
1094
|
+
var MenuItem = (0, import_react7.forwardRef)(
|
|
922
1095
|
({
|
|
923
1096
|
className,
|
|
924
1097
|
inset,
|
|
@@ -939,7 +1112,7 @@ var MenuItem = (0, import_react5.forwardRef)(
|
|
|
939
1112
|
}
|
|
940
1113
|
onClick?.(e);
|
|
941
1114
|
};
|
|
942
|
-
return /* @__PURE__ */ (0,
|
|
1115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
943
1116
|
"div",
|
|
944
1117
|
{
|
|
945
1118
|
ref,
|
|
@@ -969,7 +1142,7 @@ var MenuItem = (0, import_react5.forwardRef)(
|
|
|
969
1142
|
}
|
|
970
1143
|
);
|
|
971
1144
|
MenuItem.displayName = "MenuItem";
|
|
972
|
-
var MenuSeparator = (0,
|
|
1145
|
+
var MenuSeparator = (0, import_react7.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
973
1146
|
"div",
|
|
974
1147
|
{
|
|
975
1148
|
ref,
|
|
@@ -979,111 +1152,10 @@ var MenuSeparator = (0, import_react5.forwardRef)(({ className, ...props }, ref)
|
|
|
979
1152
|
));
|
|
980
1153
|
MenuSeparator.displayName = "MenuSeparator";
|
|
981
1154
|
|
|
982
|
-
// src/components/NavButton/NavButton.tsx
|
|
983
|
-
var import_react6 = require("react");
|
|
984
|
-
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
985
|
-
var NavButton = (0, import_react6.forwardRef)(
|
|
986
|
-
({ icon, label, selected = false, className = "", disabled, ...props }, ref) => {
|
|
987
|
-
const baseClasses = [
|
|
988
|
-
"flex",
|
|
989
|
-
"flex-col",
|
|
990
|
-
"items-center",
|
|
991
|
-
"justify-center",
|
|
992
|
-
"gap-0.5",
|
|
993
|
-
"px-12",
|
|
994
|
-
"py-1",
|
|
995
|
-
"rounded-sm",
|
|
996
|
-
"cursor-pointer",
|
|
997
|
-
"text-text-950",
|
|
998
|
-
"text-xs",
|
|
999
|
-
"font-medium",
|
|
1000
|
-
"hover:text-text",
|
|
1001
|
-
"hover:bg-primary-600",
|
|
1002
|
-
"focus-visible:outline-none",
|
|
1003
|
-
"focus-visible:ring-2",
|
|
1004
|
-
"focus-visible:ring-offset-0",
|
|
1005
|
-
"focus-visible:ring-indicator-info",
|
|
1006
|
-
"disabled:opacity-50",
|
|
1007
|
-
"disabled:cursor-not-allowed",
|
|
1008
|
-
"disabled:pointer-events-none"
|
|
1009
|
-
];
|
|
1010
|
-
const stateClasses = selected ? ["bg-primary-50", "text-primary-950"] : [];
|
|
1011
|
-
const allClasses = [...baseClasses, ...stateClasses].join(" ");
|
|
1012
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1013
|
-
"button",
|
|
1014
|
-
{
|
|
1015
|
-
ref,
|
|
1016
|
-
type: "button",
|
|
1017
|
-
className: `${allClasses} ${className}`,
|
|
1018
|
-
disabled,
|
|
1019
|
-
"aria-pressed": selected,
|
|
1020
|
-
...props,
|
|
1021
|
-
children: [
|
|
1022
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "flex items-center justify-center w-5 h-5", children: icon }),
|
|
1023
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "whitespace-nowrap", children: label })
|
|
1024
|
-
]
|
|
1025
|
-
}
|
|
1026
|
-
);
|
|
1027
|
-
}
|
|
1028
|
-
);
|
|
1029
|
-
NavButton.displayName = "NavButton";
|
|
1030
|
-
|
|
1031
|
-
// src/components/IconButton/IconButton.tsx
|
|
1032
|
-
var import_react7 = require("react");
|
|
1033
|
-
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1034
|
-
var IconButton = (0, import_react7.forwardRef)(
|
|
1035
|
-
({ icon, size = "md", active = false, className = "", disabled, ...props }, ref) => {
|
|
1036
|
-
const baseClasses = [
|
|
1037
|
-
"inline-flex",
|
|
1038
|
-
"items-center",
|
|
1039
|
-
"justify-center",
|
|
1040
|
-
"rounded-lg",
|
|
1041
|
-
"font-medium",
|
|
1042
|
-
"bg-transparent",
|
|
1043
|
-
"text-text-950",
|
|
1044
|
-
"cursor-pointer",
|
|
1045
|
-
"hover:bg-primary-600",
|
|
1046
|
-
"hover:text-text",
|
|
1047
|
-
"focus-visible:outline-none",
|
|
1048
|
-
"focus-visible:ring-2",
|
|
1049
|
-
"focus-visible:ring-offset-0",
|
|
1050
|
-
"focus-visible:ring-indicator-info",
|
|
1051
|
-
"disabled:opacity-50",
|
|
1052
|
-
"disabled:cursor-not-allowed",
|
|
1053
|
-
"disabled:pointer-events-none"
|
|
1054
|
-
];
|
|
1055
|
-
const sizeClasses = {
|
|
1056
|
-
sm: ["w-6", "h-6", "text-sm"],
|
|
1057
|
-
md: ["w-10", "h-10", "text-base"]
|
|
1058
|
-
};
|
|
1059
|
-
const activeClasses = active ? ["!bg-primary-50", "!text-primary-950", "hover:!bg-primary-100"] : [];
|
|
1060
|
-
const allClasses = [
|
|
1061
|
-
...baseClasses,
|
|
1062
|
-
...sizeClasses[size],
|
|
1063
|
-
...activeClasses
|
|
1064
|
-
].join(" ");
|
|
1065
|
-
const ariaLabel = props["aria-label"] ?? "Bot\xE3o de a\xE7\xE3o";
|
|
1066
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1067
|
-
"button",
|
|
1068
|
-
{
|
|
1069
|
-
ref,
|
|
1070
|
-
type: "button",
|
|
1071
|
-
className: `${allClasses} ${className}`,
|
|
1072
|
-
disabled,
|
|
1073
|
-
"aria-pressed": active,
|
|
1074
|
-
"aria-label": ariaLabel,
|
|
1075
|
-
...props,
|
|
1076
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "flex items-center justify-center", children: icon })
|
|
1077
|
-
}
|
|
1078
|
-
);
|
|
1079
|
-
}
|
|
1080
|
-
);
|
|
1081
|
-
IconButton.displayName = "IconButton";
|
|
1082
|
-
|
|
1083
1155
|
// src/components/Toast/Toast.tsx
|
|
1084
|
-
var
|
|
1085
|
-
var
|
|
1086
|
-
var
|
|
1156
|
+
var import_phosphor_react4 = require("phosphor-react");
|
|
1157
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1158
|
+
var VARIANT_ACTION_CLASSES4 = {
|
|
1087
1159
|
solid: {
|
|
1088
1160
|
warning: "bg-warning text-warning-800 border-none focus-visible:outline-none",
|
|
1089
1161
|
success: "bg-success text-success-800 border-none focus-visible:outline-none",
|
|
@@ -1096,9 +1168,9 @@ var VARIANT_ACTION_CLASSES3 = {
|
|
|
1096
1168
|
}
|
|
1097
1169
|
};
|
|
1098
1170
|
var iconMap = {
|
|
1099
|
-
success:
|
|
1100
|
-
info:
|
|
1101
|
-
warning:
|
|
1171
|
+
success: import_phosphor_react4.CheckCircle,
|
|
1172
|
+
info: import_phosphor_react4.Info,
|
|
1173
|
+
warning: import_phosphor_react4.WarningCircle
|
|
1102
1174
|
};
|
|
1103
1175
|
var Toast = ({
|
|
1104
1176
|
variant = "outlined",
|
|
@@ -1110,7 +1182,7 @@ var Toast = ({
|
|
|
1110
1182
|
position = "default",
|
|
1111
1183
|
...props
|
|
1112
1184
|
}) => {
|
|
1113
|
-
const variantClasses =
|
|
1185
|
+
const variantClasses = VARIANT_ACTION_CLASSES4[variant][action];
|
|
1114
1186
|
const positionClasses = {
|
|
1115
1187
|
"top-left": "fixed top-4 left-4",
|
|
1116
1188
|
"top-center": "fixed top-4 left-1/2 transform -translate-x-1/2",
|
|
@@ -1122,7 +1194,7 @@ var Toast = ({
|
|
|
1122
1194
|
};
|
|
1123
1195
|
const IconAction = iconMap[action] || iconMap["success"];
|
|
1124
1196
|
const baseClasses = "max-w-[390px] w-full flex flex-row items-start justify-between shadow-lg rounded-lg border p-4 gap-6 group";
|
|
1125
|
-
return /* @__PURE__ */ (0,
|
|
1197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1126
1198
|
"div",
|
|
1127
1199
|
{
|
|
1128
1200
|
role: "alert",
|
|
@@ -1131,20 +1203,20 @@ var Toast = ({
|
|
|
1131
1203
|
className: `${baseClasses} ${positionClasses[position]} ${variantClasses} ${className}`,
|
|
1132
1204
|
...props,
|
|
1133
1205
|
children: [
|
|
1134
|
-
/* @__PURE__ */ (0,
|
|
1135
|
-
/* @__PURE__ */ (0,
|
|
1136
|
-
/* @__PURE__ */ (0,
|
|
1137
|
-
/* @__PURE__ */ (0,
|
|
1138
|
-
description && /* @__PURE__ */ (0,
|
|
1206
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-row items-start gap-3", children: [
|
|
1207
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "mt-1", "data-testid": `toast-icon-${action}`, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconAction, {}) }),
|
|
1208
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-col items-start justify-start", children: [
|
|
1209
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "font-semibold text-md", children: title }),
|
|
1210
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "text-md text-text-900", children: description })
|
|
1139
1211
|
] })
|
|
1140
1212
|
] }),
|
|
1141
|
-
/* @__PURE__ */ (0,
|
|
1213
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1142
1214
|
"button",
|
|
1143
1215
|
{
|
|
1144
1216
|
onClick: onClose,
|
|
1145
1217
|
"aria-label": "Dismiss notification",
|
|
1146
1218
|
className: "text-background-500 cursor-pointer opacity-0 group-hover:opacity-100 transition-opacity",
|
|
1147
|
-
children: /* @__PURE__ */ (0,
|
|
1219
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_phosphor_react4.X, {})
|
|
1148
1220
|
}
|
|
1149
1221
|
)
|
|
1150
1222
|
]
|
|
@@ -1170,11 +1242,11 @@ var useToastStore = (0, import_zustand.create)((set) => ({
|
|
|
1170
1242
|
}));
|
|
1171
1243
|
|
|
1172
1244
|
// src/components/Toast/utils/Toaster.tsx
|
|
1173
|
-
var
|
|
1245
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1174
1246
|
var Toaster = () => {
|
|
1175
1247
|
const toasts = useToastStore((state) => state.toasts);
|
|
1176
1248
|
const removeToast = useToastStore((state) => state.removeToast);
|
|
1177
|
-
return /* @__PURE__ */ (0,
|
|
1249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_jsx_runtime14.Fragment, { children: toasts.map((toast) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1178
1250
|
Toast,
|
|
1179
1251
|
{
|
|
1180
1252
|
title: toast.title,
|
|
@@ -1187,38 +1259,26 @@ var Toaster = () => {
|
|
|
1187
1259
|
toast.id
|
|
1188
1260
|
)) });
|
|
1189
1261
|
};
|
|
1190
|
-
var useToast = () => {
|
|
1191
|
-
const addToast = useToastStore((state) => state.addToast);
|
|
1192
|
-
const removeToast = useToastStore((state) => state.removeToast);
|
|
1193
|
-
return { addToast, removeToast };
|
|
1194
|
-
};
|
|
1195
1262
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1196
1263
|
0 && (module.exports = {
|
|
1264
|
+
Alert,
|
|
1197
1265
|
Badge,
|
|
1198
1266
|
Button,
|
|
1199
1267
|
CheckBox,
|
|
1200
1268
|
DropdownMenu,
|
|
1269
|
+
DropdownMenuContent,
|
|
1270
|
+
DropdownMenuItem,
|
|
1271
|
+
DropdownMenuLabel,
|
|
1272
|
+
DropdownMenuSeparator,
|
|
1201
1273
|
DropdownMenuTrigger,
|
|
1202
1274
|
IconButton,
|
|
1203
1275
|
IconRoundedButton,
|
|
1204
|
-
MenuContent,
|
|
1205
|
-
MenuItem,
|
|
1206
|
-
MenuLabel,
|
|
1207
|
-
MenuSeparator,
|
|
1208
1276
|
NavButton,
|
|
1209
1277
|
SelectionButton,
|
|
1210
1278
|
Table,
|
|
1211
|
-
TableBody,
|
|
1212
|
-
TableCaption,
|
|
1213
|
-
TableCell,
|
|
1214
|
-
TableFooter,
|
|
1215
|
-
TableHead,
|
|
1216
|
-
TableHeader,
|
|
1217
|
-
TableRow,
|
|
1218
1279
|
Text,
|
|
1219
1280
|
TextArea,
|
|
1220
1281
|
Toast,
|
|
1221
1282
|
Toaster,
|
|
1222
|
-
useToast,
|
|
1223
1283
|
useToastStore
|
|
1224
1284
|
});
|