analytica-frontend-lib 1.0.21 → 1.0.23
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/Alert/Alert.d.mts +13 -0
- package/dist/Alert/Alert.d.ts +13 -0
- package/dist/Alert/Alert.js +158 -0
- package/dist/Alert/Alert.mjs +85 -0
- package/dist/Badge/Badge.d.mts +47 -0
- package/dist/Badge/Badge.d.ts +47 -0
- package/dist/Badge/Badge.js +117 -0
- package/dist/Badge/Badge.mjs +92 -0
- package/dist/Button/Button.d.mts +46 -0
- package/dist/Button/Button.d.ts +46 -0
- package/dist/Button/Button.js +84 -0
- package/dist/Button/Button.mjs +59 -0
- package/dist/CheckBox/CheckBox.d.mts +74 -0
- package/dist/CheckBox/CheckBox.d.ts +74 -0
- package/dist/CheckBox/CheckBox.js +264 -0
- package/dist/CheckBox/CheckBox.mjs +195 -0
- package/dist/DropdownMenu/DropdownMenu.d.mts +29 -0
- package/dist/DropdownMenu/DropdownMenu.d.ts +29 -0
- package/dist/DropdownMenu/DropdownMenu.js +262 -0
- package/dist/DropdownMenu/DropdownMenu.mjs +242 -0
- package/dist/IconButton/IconButton.d.mts +77 -0
- package/dist/IconButton/IconButton.d.ts +77 -0
- package/dist/IconButton/IconButton.js +79 -0
- package/dist/IconButton/IconButton.mjs +54 -0
- package/dist/IconRoundedButton/IconRoundedButton.d.mts +35 -0
- package/dist/IconRoundedButton/IconRoundedButton.d.ts +35 -0
- package/dist/IconRoundedButton/IconRoundedButton.js +68 -0
- package/dist/IconRoundedButton/IconRoundedButton.mjs +43 -0
- package/dist/NavButton/NavButton.d.mts +58 -0
- package/dist/NavButton/NavButton.d.ts +58 -0
- package/dist/NavButton/NavButton.js +76 -0
- package/dist/NavButton/NavButton.mjs +51 -0
- package/dist/SelectionButton/SelectionButton.d.mts +58 -0
- package/dist/SelectionButton/SelectionButton.d.ts +58 -0
- package/dist/SelectionButton/SelectionButton.js +81 -0
- package/dist/SelectionButton/SelectionButton.mjs +56 -0
- package/dist/Table/Table.d.mts +17 -0
- package/dist/Table/Table.d.ts +17 -0
- package/dist/Table/Table.js +139 -0
- package/dist/Table/Table.mjs +107 -0
- package/dist/Text/Text.d.mts +59 -0
- package/dist/Text/Text.d.ts +59 -0
- package/dist/Text/Text.js +77 -0
- package/dist/Text/Text.mjs +6 -0
- package/dist/TextArea/TextArea.d.mts +69 -0
- package/dist/TextArea/TextArea.d.ts +69 -0
- package/dist/TextArea/TextArea.js +211 -0
- package/dist/TextArea/TextArea.mjs +142 -0
- package/dist/Toast/Toast.d.mts +17 -0
- package/dist/Toast/Toast.d.ts +17 -0
- package/dist/Toast/Toast.js +100 -0
- package/dist/Toast/Toast.mjs +7 -0
- package/dist/Toast/utils/ToastStore.d.mts +19 -0
- package/dist/Toast/utils/ToastStore.d.ts +19 -0
- package/dist/Toast/utils/ToastStore.js +44 -0
- package/dist/Toast/utils/ToastStore.mjs +6 -0
- package/dist/Toast/utils/Toaster.d.mts +11 -0
- package/dist/Toast/utils/Toaster.d.ts +11 -0
- package/dist/Toast/utils/Toaster.js +145 -0
- package/dist/Toast/utils/Toaster.mjs +35 -0
- package/dist/chunk-MI5FIRHM.mjs +75 -0
- package/dist/chunk-TT3VCQGR.mjs +53 -0
- package/dist/chunk-WIOCQOM7.mjs +20 -0
- package/dist/index.css +103 -0
- package/dist/index.d.mts +68 -2
- package/dist/index.d.ts +68 -2
- package/dist/index.js +217 -84
- package/dist/index.mjs +215 -79
- package/package.json +71 -3
package/dist/index.mjs
CHANGED
|
@@ -200,9 +200,144 @@ var Text = ({
|
|
|
200
200
|
);
|
|
201
201
|
};
|
|
202
202
|
|
|
203
|
+
// src/components/TextArea/TextArea.tsx
|
|
204
|
+
import {
|
|
205
|
+
forwardRef as forwardRef2,
|
|
206
|
+
useState,
|
|
207
|
+
useId
|
|
208
|
+
} from "react";
|
|
209
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
210
|
+
var SIZE_CLASSES2 = {
|
|
211
|
+
small: {
|
|
212
|
+
container: "w-72",
|
|
213
|
+
// 288px width
|
|
214
|
+
textarea: "h-24 text-sm",
|
|
215
|
+
// 96px height, 14px font
|
|
216
|
+
textSize: "sm"
|
|
217
|
+
},
|
|
218
|
+
medium: {
|
|
219
|
+
container: "w-72",
|
|
220
|
+
// 288px width
|
|
221
|
+
textarea: "h-24 text-base",
|
|
222
|
+
// 96px height, 16px font
|
|
223
|
+
textSize: "md"
|
|
224
|
+
},
|
|
225
|
+
large: {
|
|
226
|
+
container: "w-72",
|
|
227
|
+
// 288px width
|
|
228
|
+
textarea: "h-24 text-lg",
|
|
229
|
+
// 96px height, 18px font
|
|
230
|
+
textSize: "lg"
|
|
231
|
+
},
|
|
232
|
+
extraLarge: {
|
|
233
|
+
container: "w-72",
|
|
234
|
+
// 288px width
|
|
235
|
+
textarea: "h-24 text-xl",
|
|
236
|
+
// 96px height, 20px font
|
|
237
|
+
textSize: "xl"
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
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";
|
|
241
|
+
var STATE_CLASSES = {
|
|
242
|
+
default: {
|
|
243
|
+
base: "border-border-300 bg-background text-text-600",
|
|
244
|
+
hover: "hover:border-border-400",
|
|
245
|
+
focus: "focus:border-border-500"
|
|
246
|
+
},
|
|
247
|
+
hovered: {
|
|
248
|
+
base: "border-border-400 bg-background text-text-600",
|
|
249
|
+
hover: "",
|
|
250
|
+
focus: "focus:border-border-500"
|
|
251
|
+
},
|
|
252
|
+
focused: {
|
|
253
|
+
base: "border-2 border-primary-950 bg-background text-text-900",
|
|
254
|
+
hover: "",
|
|
255
|
+
focus: ""
|
|
256
|
+
},
|
|
257
|
+
invalid: {
|
|
258
|
+
base: "border-2 border-red-700 bg-white text-gray-800",
|
|
259
|
+
hover: "hover:border-red-700",
|
|
260
|
+
focus: "focus:border-red-700"
|
|
261
|
+
},
|
|
262
|
+
disabled: {
|
|
263
|
+
base: "border-border-300 bg-background text-text-600 cursor-not-allowed opacity-40",
|
|
264
|
+
hover: "",
|
|
265
|
+
focus: ""
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
var TextArea = forwardRef2(
|
|
269
|
+
({
|
|
270
|
+
label,
|
|
271
|
+
size = "medium",
|
|
272
|
+
state = "default",
|
|
273
|
+
errorMessage,
|
|
274
|
+
helperMessage,
|
|
275
|
+
className = "",
|
|
276
|
+
labelClassName = "",
|
|
277
|
+
disabled,
|
|
278
|
+
id,
|
|
279
|
+
onChange,
|
|
280
|
+
placeholder,
|
|
281
|
+
...props
|
|
282
|
+
}, ref) => {
|
|
283
|
+
const generatedId = useId();
|
|
284
|
+
const inputId = id ?? `textarea-${generatedId}`;
|
|
285
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
286
|
+
const handleChange = (event) => {
|
|
287
|
+
onChange?.(event);
|
|
288
|
+
};
|
|
289
|
+
const handleFocus = (event) => {
|
|
290
|
+
setIsFocused(true);
|
|
291
|
+
props.onFocus?.(event);
|
|
292
|
+
};
|
|
293
|
+
const handleBlur = (event) => {
|
|
294
|
+
setIsFocused(false);
|
|
295
|
+
props.onBlur?.(event);
|
|
296
|
+
};
|
|
297
|
+
let currentState = disabled ? "disabled" : state;
|
|
298
|
+
if (isFocused && currentState !== "invalid" && currentState !== "disabled") {
|
|
299
|
+
currentState = "focused";
|
|
300
|
+
}
|
|
301
|
+
const sizeClasses = SIZE_CLASSES2[size];
|
|
302
|
+
const stateClasses = STATE_CLASSES[currentState];
|
|
303
|
+
const textareaClasses = `${BASE_TEXTAREA_CLASSES} ${sizeClasses.textarea} ${stateClasses.base} ${stateClasses.hover} ${stateClasses.focus} ${className}`;
|
|
304
|
+
return /* @__PURE__ */ jsxs3("div", { className: `flex flex-col ${sizeClasses.container}`, children: [
|
|
305
|
+
label && /* @__PURE__ */ jsx5(
|
|
306
|
+
Text,
|
|
307
|
+
{
|
|
308
|
+
as: "label",
|
|
309
|
+
htmlFor: inputId,
|
|
310
|
+
size: sizeClasses.textSize,
|
|
311
|
+
weight: "medium",
|
|
312
|
+
color: "text-text-950",
|
|
313
|
+
className: `mb-1.5 ${labelClassName}`,
|
|
314
|
+
children: label
|
|
315
|
+
}
|
|
316
|
+
),
|
|
317
|
+
/* @__PURE__ */ jsx5(
|
|
318
|
+
"textarea",
|
|
319
|
+
{
|
|
320
|
+
ref,
|
|
321
|
+
id: inputId,
|
|
322
|
+
disabled,
|
|
323
|
+
onChange: handleChange,
|
|
324
|
+
onFocus: handleFocus,
|
|
325
|
+
onBlur: handleBlur,
|
|
326
|
+
className: textareaClasses,
|
|
327
|
+
placeholder,
|
|
328
|
+
...props
|
|
329
|
+
}
|
|
330
|
+
),
|
|
331
|
+
errorMessage && /* @__PURE__ */ jsx5(Text, { size: "sm", weight: "normal", className: "mt-1.5 text-error-600", children: errorMessage }),
|
|
332
|
+
helperMessage && !errorMessage && /* @__PURE__ */ jsx5(Text, { size: "sm", weight: "normal", className: "mt-1.5 text-text-500", children: helperMessage })
|
|
333
|
+
] });
|
|
334
|
+
}
|
|
335
|
+
);
|
|
336
|
+
TextArea.displayName = "TextArea";
|
|
337
|
+
|
|
203
338
|
// src/components/Badge/Badge.tsx
|
|
204
339
|
import { Bell } from "phosphor-react";
|
|
205
|
-
import { jsx as
|
|
340
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
206
341
|
var VARIANT_ACTION_CLASSES2 = {
|
|
207
342
|
solid: {
|
|
208
343
|
error: "bg-error text-error-700 focus-visible:outline-none",
|
|
@@ -230,7 +365,7 @@ var VARIANT_ACTION_CLASSES2 = {
|
|
|
230
365
|
},
|
|
231
366
|
notification: "text-primary"
|
|
232
367
|
};
|
|
233
|
-
var
|
|
368
|
+
var SIZE_CLASSES3 = {
|
|
234
369
|
small: "text-2xs px-2 py-1",
|
|
235
370
|
medium: "text-xs px-2 py-1",
|
|
236
371
|
large: "text-sm px-2 py-1"
|
|
@@ -251,21 +386,21 @@ var Badge = ({
|
|
|
251
386
|
notificationActive = false,
|
|
252
387
|
...props
|
|
253
388
|
}) => {
|
|
254
|
-
const sizeClasses =
|
|
389
|
+
const sizeClasses = SIZE_CLASSES3[size];
|
|
255
390
|
const sizeClassesIcon = SIZE_CLASSES_ICON[size];
|
|
256
391
|
const variantActionMap = VARIANT_ACTION_CLASSES2[variant] || {};
|
|
257
392
|
const variantClasses = typeof variantActionMap === "string" ? variantActionMap : variantActionMap[action] ?? variantActionMap.muted ?? "";
|
|
258
393
|
const baseClasses = "inline-flex items-center justify-center rounded-xs font-medium gap-1 relative";
|
|
259
394
|
const baseClassesIcon = "flex items-center";
|
|
260
395
|
if (variant === "notification") {
|
|
261
|
-
return /* @__PURE__ */
|
|
396
|
+
return /* @__PURE__ */ jsxs4(
|
|
262
397
|
"div",
|
|
263
398
|
{
|
|
264
399
|
className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
|
|
265
400
|
...props,
|
|
266
401
|
children: [
|
|
267
|
-
/* @__PURE__ */
|
|
268
|
-
notificationActive && /* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ jsx6(Bell, { size: 24, className: "text-primary-950" }),
|
|
403
|
+
notificationActive && /* @__PURE__ */ jsx6(
|
|
269
404
|
"span",
|
|
270
405
|
{
|
|
271
406
|
"data-testid": "notification-dot",
|
|
@@ -276,15 +411,15 @@ var Badge = ({
|
|
|
276
411
|
}
|
|
277
412
|
);
|
|
278
413
|
}
|
|
279
|
-
return /* @__PURE__ */
|
|
414
|
+
return /* @__PURE__ */ jsxs4(
|
|
280
415
|
"div",
|
|
281
416
|
{
|
|
282
417
|
className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
|
|
283
418
|
...props,
|
|
284
419
|
children: [
|
|
285
|
-
iconLeft && /* @__PURE__ */
|
|
420
|
+
iconLeft && /* @__PURE__ */ jsx6("span", { className: `${baseClassesIcon} ${sizeClassesIcon}`, children: iconLeft }),
|
|
286
421
|
children,
|
|
287
|
-
iconRight && /* @__PURE__ */
|
|
422
|
+
iconRight && /* @__PURE__ */ jsx6("span", { className: `${baseClassesIcon} ${sizeClassesIcon}`, children: iconRight })
|
|
288
423
|
]
|
|
289
424
|
}
|
|
290
425
|
);
|
|
@@ -292,13 +427,13 @@ var Badge = ({
|
|
|
292
427
|
|
|
293
428
|
// src/components/CheckBox/CheckBox.tsx
|
|
294
429
|
import {
|
|
295
|
-
forwardRef as
|
|
296
|
-
useState,
|
|
297
|
-
useId
|
|
430
|
+
forwardRef as forwardRef3,
|
|
431
|
+
useState as useState2,
|
|
432
|
+
useId as useId2
|
|
298
433
|
} from "react";
|
|
299
434
|
import { Check, Minus } from "phosphor-react";
|
|
300
|
-
import { jsx as
|
|
301
|
-
var
|
|
435
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
436
|
+
var SIZE_CLASSES4 = {
|
|
302
437
|
small: {
|
|
303
438
|
checkbox: "w-4 h-4",
|
|
304
439
|
// 16px x 16px
|
|
@@ -335,7 +470,7 @@ var SIZE_CLASSES3 = {
|
|
|
335
470
|
}
|
|
336
471
|
};
|
|
337
472
|
var BASE_CHECKBOX_CLASSES = "rounded border cursor-pointer transition-all duration-200 flex items-center justify-center focus:outline-none";
|
|
338
|
-
var
|
|
473
|
+
var STATE_CLASSES2 = {
|
|
339
474
|
default: {
|
|
340
475
|
unchecked: "border-border-400 bg-background hover:border-border-500",
|
|
341
476
|
checked: "border-primary-950 bg-primary-950 text-text hover:border-primary-800 hover:bg-primary-800"
|
|
@@ -357,7 +492,7 @@ var STATE_CLASSES = {
|
|
|
357
492
|
checked: "border-primary-600 bg-primary-600 text-text cursor-not-allowed opacity-40"
|
|
358
493
|
}
|
|
359
494
|
};
|
|
360
|
-
var CheckBox =
|
|
495
|
+
var CheckBox = forwardRef3(
|
|
361
496
|
({
|
|
362
497
|
label,
|
|
363
498
|
size = "medium",
|
|
@@ -373,9 +508,9 @@ var CheckBox = forwardRef2(
|
|
|
373
508
|
onChange,
|
|
374
509
|
...props
|
|
375
510
|
}, ref) => {
|
|
376
|
-
const generatedId =
|
|
511
|
+
const generatedId = useId2();
|
|
377
512
|
const inputId = id ?? `checkbox-${generatedId}`;
|
|
378
|
-
const [internalChecked, setInternalChecked] =
|
|
513
|
+
const [internalChecked, setInternalChecked] = useState2(false);
|
|
379
514
|
const isControlled = checkedProp !== void 0;
|
|
380
515
|
const checked = isControlled ? checkedProp : internalChecked;
|
|
381
516
|
const handleChange = (event) => {
|
|
@@ -385,14 +520,14 @@ var CheckBox = forwardRef2(
|
|
|
385
520
|
onChange?.(event);
|
|
386
521
|
};
|
|
387
522
|
const currentState = disabled ? "disabled" : state;
|
|
388
|
-
const sizeClasses =
|
|
523
|
+
const sizeClasses = SIZE_CLASSES4[size];
|
|
389
524
|
const checkVariant = checked || indeterminate ? "checked" : "unchecked";
|
|
390
|
-
const stylingClasses =
|
|
525
|
+
const stylingClasses = STATE_CLASSES2[currentState][checkVariant];
|
|
391
526
|
const borderWidthClass = state === "focused" || state === "hovered" && size === "large" ? "border-[3px]" : sizeClasses.borderWidth;
|
|
392
527
|
const checkboxClasses = `${BASE_CHECKBOX_CLASSES} ${sizeClasses.checkbox} ${borderWidthClass} ${stylingClasses} ${className}`;
|
|
393
528
|
const renderIcon = () => {
|
|
394
529
|
if (indeterminate) {
|
|
395
|
-
return /* @__PURE__ */
|
|
530
|
+
return /* @__PURE__ */ jsx7(
|
|
396
531
|
Minus,
|
|
397
532
|
{
|
|
398
533
|
size: sizeClasses.iconSize,
|
|
@@ -402,7 +537,7 @@ var CheckBox = forwardRef2(
|
|
|
402
537
|
);
|
|
403
538
|
}
|
|
404
539
|
if (checked) {
|
|
405
|
-
return /* @__PURE__ */
|
|
540
|
+
return /* @__PURE__ */ jsx7(
|
|
406
541
|
Check,
|
|
407
542
|
{
|
|
408
543
|
size: sizeClasses.iconSize,
|
|
@@ -413,13 +548,13 @@ var CheckBox = forwardRef2(
|
|
|
413
548
|
}
|
|
414
549
|
return null;
|
|
415
550
|
};
|
|
416
|
-
return /* @__PURE__ */
|
|
417
|
-
/* @__PURE__ */
|
|
551
|
+
return /* @__PURE__ */ jsxs5("div", { className: "flex flex-col", children: [
|
|
552
|
+
/* @__PURE__ */ jsxs5(
|
|
418
553
|
"div",
|
|
419
554
|
{
|
|
420
555
|
className: `flex flex-row items-center ${sizeClasses.spacing} ${disabled ? "opacity-40" : ""}`,
|
|
421
556
|
children: [
|
|
422
|
-
/* @__PURE__ */
|
|
557
|
+
/* @__PURE__ */ jsx7(
|
|
423
558
|
"input",
|
|
424
559
|
{
|
|
425
560
|
ref,
|
|
@@ -432,12 +567,12 @@ var CheckBox = forwardRef2(
|
|
|
432
567
|
...props
|
|
433
568
|
}
|
|
434
569
|
),
|
|
435
|
-
/* @__PURE__ */
|
|
436
|
-
label && /* @__PURE__ */
|
|
570
|
+
/* @__PURE__ */ jsx7("label", { htmlFor: inputId, className: checkboxClasses, children: renderIcon() }),
|
|
571
|
+
label && /* @__PURE__ */ jsx7(
|
|
437
572
|
"div",
|
|
438
573
|
{
|
|
439
574
|
className: `flex flex-row items-center ${sizeClasses.labelHeight}`,
|
|
440
|
-
children: /* @__PURE__ */
|
|
575
|
+
children: /* @__PURE__ */ jsx7(
|
|
441
576
|
Text,
|
|
442
577
|
{
|
|
443
578
|
as: "label",
|
|
@@ -453,7 +588,7 @@ var CheckBox = forwardRef2(
|
|
|
453
588
|
]
|
|
454
589
|
}
|
|
455
590
|
),
|
|
456
|
-
errorMessage && /* @__PURE__ */
|
|
591
|
+
errorMessage && /* @__PURE__ */ jsx7(
|
|
457
592
|
Text,
|
|
458
593
|
{
|
|
459
594
|
size: "sm",
|
|
@@ -463,7 +598,7 @@ var CheckBox = forwardRef2(
|
|
|
463
598
|
children: errorMessage
|
|
464
599
|
}
|
|
465
600
|
),
|
|
466
|
-
helperText && !errorMessage && /* @__PURE__ */
|
|
601
|
+
helperText && !errorMessage && /* @__PURE__ */ jsx7(
|
|
467
602
|
Text,
|
|
468
603
|
{
|
|
469
604
|
size: "sm",
|
|
@@ -479,24 +614,24 @@ var CheckBox = forwardRef2(
|
|
|
479
614
|
CheckBox.displayName = "CheckBox";
|
|
480
615
|
|
|
481
616
|
// src/components/Table/Table.tsx
|
|
482
|
-
import { forwardRef as
|
|
483
|
-
import { jsx as
|
|
484
|
-
var Table =
|
|
485
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
617
|
+
import { forwardRef as forwardRef4 } from "react";
|
|
618
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
619
|
+
var Table = forwardRef4(
|
|
620
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx8("div", { className: "border border-border-200 rounded-xl relative w-full overflow-hidden", children: /* @__PURE__ */ jsxs6(
|
|
486
621
|
"table",
|
|
487
622
|
{
|
|
488
623
|
ref,
|
|
489
624
|
className: `w-full caption-bottom text-sm ${className ?? ""}`,
|
|
490
625
|
...props,
|
|
491
626
|
children: [
|
|
492
|
-
/* @__PURE__ */
|
|
627
|
+
/* @__PURE__ */ jsx8("caption", { className: "sr-only", children: "My Table" }),
|
|
493
628
|
children
|
|
494
629
|
]
|
|
495
630
|
}
|
|
496
631
|
) })
|
|
497
632
|
);
|
|
498
633
|
Table.displayName = "Table";
|
|
499
|
-
var TableHeader =
|
|
634
|
+
var TableHeader = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
500
635
|
"thead",
|
|
501
636
|
{
|
|
502
637
|
ref,
|
|
@@ -505,7 +640,7 @@ var TableHeader = forwardRef3(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
505
640
|
}
|
|
506
641
|
));
|
|
507
642
|
TableHeader.displayName = "TableHeader";
|
|
508
|
-
var TableBody =
|
|
643
|
+
var TableBody = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
509
644
|
"tbody",
|
|
510
645
|
{
|
|
511
646
|
ref,
|
|
@@ -514,7 +649,7 @@ var TableBody = forwardRef3(({ className, ...props }, ref) => /* @__PURE__ */ js
|
|
|
514
649
|
}
|
|
515
650
|
));
|
|
516
651
|
TableBody.displayName = "TableBody";
|
|
517
|
-
var TableFooter =
|
|
652
|
+
var TableFooter = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
518
653
|
"tfoot",
|
|
519
654
|
{
|
|
520
655
|
ref,
|
|
@@ -529,9 +664,9 @@ var VARIANT_STATES_ROW = {
|
|
|
529
664
|
invalid: "border-b-2 border-indicator-error",
|
|
530
665
|
disabled: "border-b border-border-100 bg-background-50 opacity-50 cursor-not-allowed"
|
|
531
666
|
};
|
|
532
|
-
var TableRow =
|
|
667
|
+
var TableRow = forwardRef4(
|
|
533
668
|
({ state = "default", className, ...props }, ref) => {
|
|
534
|
-
return /* @__PURE__ */
|
|
669
|
+
return /* @__PURE__ */ jsx8(
|
|
535
670
|
"tr",
|
|
536
671
|
{
|
|
537
672
|
ref,
|
|
@@ -548,7 +683,7 @@ var TableRow = forwardRef3(
|
|
|
548
683
|
}
|
|
549
684
|
);
|
|
550
685
|
TableRow.displayName = "TableRow";
|
|
551
|
-
var TableHead =
|
|
686
|
+
var TableHead = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
552
687
|
"th",
|
|
553
688
|
{
|
|
554
689
|
ref,
|
|
@@ -557,7 +692,7 @@ var TableHead = forwardRef3(({ className, ...props }, ref) => /* @__PURE__ */ js
|
|
|
557
692
|
}
|
|
558
693
|
));
|
|
559
694
|
TableHead.displayName = "TableHead";
|
|
560
|
-
var TableCell =
|
|
695
|
+
var TableCell = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
561
696
|
"td",
|
|
562
697
|
{
|
|
563
698
|
ref,
|
|
@@ -566,7 +701,7 @@ var TableCell = forwardRef3(({ className, ...props }, ref) => /* @__PURE__ */ js
|
|
|
566
701
|
}
|
|
567
702
|
));
|
|
568
703
|
TableCell.displayName = "TableCell";
|
|
569
|
-
var TableCaption =
|
|
704
|
+
var TableCaption = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
570
705
|
"caption",
|
|
571
706
|
{
|
|
572
707
|
ref,
|
|
@@ -579,20 +714,20 @@ TableCaption.displayName = "TableCaption";
|
|
|
579
714
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
580
715
|
import {
|
|
581
716
|
createContext,
|
|
582
|
-
useState as
|
|
717
|
+
useState as useState3,
|
|
583
718
|
useCallback,
|
|
584
719
|
useContext,
|
|
585
|
-
forwardRef as
|
|
720
|
+
forwardRef as forwardRef5,
|
|
586
721
|
useEffect,
|
|
587
722
|
useRef,
|
|
588
723
|
useMemo
|
|
589
724
|
} from "react";
|
|
590
|
-
import { jsx as
|
|
725
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
591
726
|
var DropdownMenuContext = createContext(
|
|
592
727
|
void 0
|
|
593
728
|
);
|
|
594
729
|
var DropdownMenu = ({ children, open, onOpenChange }) => {
|
|
595
|
-
const [internalOpen, setInternalOpen] =
|
|
730
|
+
const [internalOpen, setInternalOpen] = useState3(false);
|
|
596
731
|
const isControlled = open !== void 0;
|
|
597
732
|
const currentOpen = isControlled ? open : internalOpen;
|
|
598
733
|
const setOpen = useCallback(
|
|
@@ -650,14 +785,14 @@ var DropdownMenu = ({ children, open, onOpenChange }) => {
|
|
|
650
785
|
() => ({ open: currentOpen, setOpen }),
|
|
651
786
|
[currentOpen, setOpen]
|
|
652
787
|
);
|
|
653
|
-
return /* @__PURE__ */
|
|
788
|
+
return /* @__PURE__ */ jsx9(DropdownMenuContext.Provider, { value, children: /* @__PURE__ */ jsx9("div", { className: "relative", ref: menuRef, children }) });
|
|
654
789
|
};
|
|
655
|
-
var DropdownMenuTrigger =
|
|
790
|
+
var DropdownMenuTrigger = forwardRef5(({ className, children, onClick, ...props }, ref) => {
|
|
656
791
|
const context = useContext(DropdownMenuContext);
|
|
657
792
|
if (!context)
|
|
658
793
|
throw new Error("DropdownMenuTrigger must be used within a DropdownMenu");
|
|
659
794
|
const { open, setOpen } = context;
|
|
660
|
-
return /* @__PURE__ */
|
|
795
|
+
return /* @__PURE__ */ jsx9(
|
|
661
796
|
"button",
|
|
662
797
|
{
|
|
663
798
|
ref,
|
|
@@ -689,7 +824,7 @@ var ALIGN_CLASSES = {
|
|
|
689
824
|
center: "left-1/2 -translate-x-1/2",
|
|
690
825
|
end: "right-0"
|
|
691
826
|
};
|
|
692
|
-
var MenuLabel =
|
|
827
|
+
var MenuLabel = forwardRef5(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
693
828
|
"fieldset",
|
|
694
829
|
{
|
|
695
830
|
ref,
|
|
@@ -699,7 +834,7 @@ var MenuLabel = forwardRef4(({ className, inset, ...props }, ref) => /* @__PURE_
|
|
|
699
834
|
}
|
|
700
835
|
));
|
|
701
836
|
MenuLabel.displayName = "MenuLabel";
|
|
702
|
-
var MenuContent =
|
|
837
|
+
var MenuContent = forwardRef5(
|
|
703
838
|
({
|
|
704
839
|
className,
|
|
705
840
|
align = "start",
|
|
@@ -709,7 +844,7 @@ var MenuContent = forwardRef4(
|
|
|
709
844
|
...props
|
|
710
845
|
}, ref) => {
|
|
711
846
|
const { open } = useContext(DropdownMenuContext);
|
|
712
|
-
const [isVisible, setIsVisible] =
|
|
847
|
+
const [isVisible, setIsVisible] = useState3(open);
|
|
713
848
|
useEffect(() => {
|
|
714
849
|
if (open) {
|
|
715
850
|
setIsVisible(true);
|
|
@@ -724,7 +859,7 @@ var MenuContent = forwardRef4(
|
|
|
724
859
|
const horizontal = ALIGN_CLASSES[align];
|
|
725
860
|
return `absolute ${vertical} ${horizontal}`;
|
|
726
861
|
};
|
|
727
|
-
return /* @__PURE__ */
|
|
862
|
+
return /* @__PURE__ */ jsx9(
|
|
728
863
|
"div",
|
|
729
864
|
{
|
|
730
865
|
ref,
|
|
@@ -748,7 +883,7 @@ var MenuContent = forwardRef4(
|
|
|
748
883
|
}
|
|
749
884
|
);
|
|
750
885
|
MenuContent.displayName = "MenuContent";
|
|
751
|
-
var MenuItem =
|
|
886
|
+
var MenuItem = forwardRef5(
|
|
752
887
|
({
|
|
753
888
|
className,
|
|
754
889
|
inset,
|
|
@@ -769,7 +904,7 @@ var MenuItem = forwardRef4(
|
|
|
769
904
|
}
|
|
770
905
|
onClick?.(e);
|
|
771
906
|
};
|
|
772
|
-
return /* @__PURE__ */
|
|
907
|
+
return /* @__PURE__ */ jsxs7(
|
|
773
908
|
"div",
|
|
774
909
|
{
|
|
775
910
|
ref,
|
|
@@ -799,7 +934,7 @@ var MenuItem = forwardRef4(
|
|
|
799
934
|
}
|
|
800
935
|
);
|
|
801
936
|
MenuItem.displayName = "MenuItem";
|
|
802
|
-
var MenuSeparator =
|
|
937
|
+
var MenuSeparator = forwardRef5(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
803
938
|
"div",
|
|
804
939
|
{
|
|
805
940
|
ref,
|
|
@@ -810,9 +945,9 @@ var MenuSeparator = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
810
945
|
MenuSeparator.displayName = "MenuSeparator";
|
|
811
946
|
|
|
812
947
|
// src/components/NavButton/NavButton.tsx
|
|
813
|
-
import { forwardRef as
|
|
814
|
-
import { jsx as
|
|
815
|
-
var NavButton =
|
|
948
|
+
import { forwardRef as forwardRef6 } from "react";
|
|
949
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
950
|
+
var NavButton = forwardRef6(
|
|
816
951
|
({ icon, label, selected = false, className = "", disabled, ...props }, ref) => {
|
|
817
952
|
const baseClasses = [
|
|
818
953
|
"flex",
|
|
@@ -839,7 +974,7 @@ var NavButton = forwardRef5(
|
|
|
839
974
|
];
|
|
840
975
|
const stateClasses = selected ? ["bg-primary-50", "text-primary-950"] : [];
|
|
841
976
|
const allClasses = [...baseClasses, ...stateClasses].join(" ");
|
|
842
|
-
return /* @__PURE__ */
|
|
977
|
+
return /* @__PURE__ */ jsxs8(
|
|
843
978
|
"button",
|
|
844
979
|
{
|
|
845
980
|
ref,
|
|
@@ -849,8 +984,8 @@ var NavButton = forwardRef5(
|
|
|
849
984
|
"aria-pressed": selected,
|
|
850
985
|
...props,
|
|
851
986
|
children: [
|
|
852
|
-
/* @__PURE__ */
|
|
853
|
-
/* @__PURE__ */
|
|
987
|
+
/* @__PURE__ */ jsx10("span", { className: "flex items-center justify-center w-5 h-5", children: icon }),
|
|
988
|
+
/* @__PURE__ */ jsx10("span", { className: "whitespace-nowrap", children: label })
|
|
854
989
|
]
|
|
855
990
|
}
|
|
856
991
|
);
|
|
@@ -859,9 +994,9 @@ var NavButton = forwardRef5(
|
|
|
859
994
|
NavButton.displayName = "NavButton";
|
|
860
995
|
|
|
861
996
|
// src/components/IconButton/IconButton.tsx
|
|
862
|
-
import { forwardRef as
|
|
863
|
-
import { jsx as
|
|
864
|
-
var IconButton =
|
|
997
|
+
import { forwardRef as forwardRef7 } from "react";
|
|
998
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
999
|
+
var IconButton = forwardRef7(
|
|
865
1000
|
({ icon, size = "md", active = false, className = "", disabled, ...props }, ref) => {
|
|
866
1001
|
const baseClasses = [
|
|
867
1002
|
"inline-flex",
|
|
@@ -893,7 +1028,7 @@ var IconButton = forwardRef6(
|
|
|
893
1028
|
...activeClasses
|
|
894
1029
|
].join(" ");
|
|
895
1030
|
const ariaLabel = props["aria-label"] ?? "Bot\xE3o de a\xE7\xE3o";
|
|
896
|
-
return /* @__PURE__ */
|
|
1031
|
+
return /* @__PURE__ */ jsx11(
|
|
897
1032
|
"button",
|
|
898
1033
|
{
|
|
899
1034
|
ref,
|
|
@@ -903,7 +1038,7 @@ var IconButton = forwardRef6(
|
|
|
903
1038
|
"aria-pressed": active,
|
|
904
1039
|
"aria-label": ariaLabel,
|
|
905
1040
|
...props,
|
|
906
|
-
children: /* @__PURE__ */
|
|
1041
|
+
children: /* @__PURE__ */ jsx11("span", { className: "flex items-center justify-center", children: icon })
|
|
907
1042
|
}
|
|
908
1043
|
);
|
|
909
1044
|
}
|
|
@@ -912,7 +1047,7 @@ IconButton.displayName = "IconButton";
|
|
|
912
1047
|
|
|
913
1048
|
// src/components/Toast/Toast.tsx
|
|
914
1049
|
import { CheckCircle, WarningCircle, Info, X } from "phosphor-react";
|
|
915
|
-
import { jsx as
|
|
1050
|
+
import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
916
1051
|
var VARIANT_ACTION_CLASSES3 = {
|
|
917
1052
|
solid: {
|
|
918
1053
|
warning: "bg-warning text-warning-800 border-none focus-visible:outline-none",
|
|
@@ -952,7 +1087,7 @@ var Toast = ({
|
|
|
952
1087
|
};
|
|
953
1088
|
const IconAction = iconMap[action] || iconMap["success"];
|
|
954
1089
|
const baseClasses = "max-w-[390px] w-full flex flex-row items-start justify-between shadow-lg rounded-lg border p-4 gap-6 group";
|
|
955
|
-
return /* @__PURE__ */
|
|
1090
|
+
return /* @__PURE__ */ jsxs9(
|
|
956
1091
|
"div",
|
|
957
1092
|
{
|
|
958
1093
|
role: "alert",
|
|
@@ -961,20 +1096,20 @@ var Toast = ({
|
|
|
961
1096
|
className: `${baseClasses} ${positionClasses[position]} ${variantClasses} ${className}`,
|
|
962
1097
|
...props,
|
|
963
1098
|
children: [
|
|
964
|
-
/* @__PURE__ */
|
|
965
|
-
/* @__PURE__ */
|
|
966
|
-
/* @__PURE__ */
|
|
967
|
-
/* @__PURE__ */
|
|
968
|
-
description && /* @__PURE__ */
|
|
1099
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex flex-row items-start gap-3", children: [
|
|
1100
|
+
/* @__PURE__ */ jsx12("span", { className: "mt-1", "data-testid": `toast-icon-${action}`, children: /* @__PURE__ */ jsx12(IconAction, {}) }),
|
|
1101
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex flex-col items-start justify-start", children: [
|
|
1102
|
+
/* @__PURE__ */ jsx12("p", { className: "font-semibold text-md", children: title }),
|
|
1103
|
+
description && /* @__PURE__ */ jsx12("p", { className: "text-md text-text-900", children: description })
|
|
969
1104
|
] })
|
|
970
1105
|
] }),
|
|
971
|
-
/* @__PURE__ */
|
|
1106
|
+
/* @__PURE__ */ jsx12(
|
|
972
1107
|
"button",
|
|
973
1108
|
{
|
|
974
1109
|
onClick: onClose,
|
|
975
1110
|
"aria-label": "Dismiss notification",
|
|
976
1111
|
className: "text-background-500 cursor-pointer opacity-0 group-hover:opacity-100 transition-opacity",
|
|
977
|
-
children: /* @__PURE__ */
|
|
1112
|
+
children: /* @__PURE__ */ jsx12(X, {})
|
|
978
1113
|
}
|
|
979
1114
|
)
|
|
980
1115
|
]
|
|
@@ -1000,11 +1135,11 @@ var useToastStore = create((set) => ({
|
|
|
1000
1135
|
}));
|
|
1001
1136
|
|
|
1002
1137
|
// src/components/Toast/utils/Toaster.tsx
|
|
1003
|
-
import { Fragment, jsx as
|
|
1138
|
+
import { Fragment, jsx as jsx13 } from "react/jsx-runtime";
|
|
1004
1139
|
var Toaster = () => {
|
|
1005
1140
|
const toasts = useToastStore((state) => state.toasts);
|
|
1006
1141
|
const removeToast = useToastStore((state) => state.removeToast);
|
|
1007
|
-
return /* @__PURE__ */
|
|
1142
|
+
return /* @__PURE__ */ jsx13(Fragment, { children: toasts.map((toast) => /* @__PURE__ */ jsx13(
|
|
1008
1143
|
Toast,
|
|
1009
1144
|
{
|
|
1010
1145
|
title: toast.title,
|
|
@@ -1045,6 +1180,7 @@ export {
|
|
|
1045
1180
|
TableHeader,
|
|
1046
1181
|
TableRow,
|
|
1047
1182
|
Text,
|
|
1183
|
+
TextArea,
|
|
1048
1184
|
Toast,
|
|
1049
1185
|
Toaster,
|
|
1050
1186
|
useToast,
|