analytica-frontend-lib 1.0.26 → 1.0.27
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/Toast/Toast.js +2 -2
- package/dist/Toast/Toast.mjs +1 -1
- package/dist/Toast/utils/Toaster.js +2 -2
- package/dist/Toast/utils/Toaster.mjs +1 -1
- package/dist/{chunk-XYTNJU4A.mjs → chunk-XJA5HF7B.mjs} +2 -2
- package/dist/index.css +3 -0
- package/dist/index.js +221 -127
- package/dist/index.mjs +178 -92
- package/dist/styles.css +2059 -0
- package/package.json +9 -10
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { Minus, Check, Bell, WarningCircle, Info, CheckCircle, X, XCircle } from 'phosphor-react';
|
|
3
|
-
import { forwardRef, useId, useState, createContext, useContext, useEffect, useCallback, useRef, useMemo } from 'react';
|
|
4
|
-
import { create } from 'zustand';
|
|
5
|
-
|
|
6
1
|
// src/components/Text/Text.tsx
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
3
|
var Text = ({
|
|
8
4
|
children,
|
|
9
5
|
size = "md",
|
|
@@ -51,6 +47,9 @@ var Text = ({
|
|
|
51
47
|
}
|
|
52
48
|
);
|
|
53
49
|
};
|
|
50
|
+
|
|
51
|
+
// src/components/Button/Button.tsx
|
|
52
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
54
53
|
var VARIANT_ACTION_CLASSES = {
|
|
55
54
|
solid: {
|
|
56
55
|
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",
|
|
@@ -98,13 +97,17 @@ var Button = ({
|
|
|
98
97
|
type,
|
|
99
98
|
...props,
|
|
100
99
|
children: [
|
|
101
|
-
iconLeft && /* @__PURE__ */
|
|
100
|
+
iconLeft && /* @__PURE__ */ jsx2("span", { className: "mr-2 flex items-center", children: iconLeft }),
|
|
102
101
|
children,
|
|
103
|
-
iconRight && /* @__PURE__ */
|
|
102
|
+
iconRight && /* @__PURE__ */ jsx2("span", { className: "ml-2 flex items-center", children: iconRight })
|
|
104
103
|
]
|
|
105
104
|
}
|
|
106
105
|
);
|
|
107
106
|
};
|
|
107
|
+
|
|
108
|
+
// src/components/Badge/Badge.tsx
|
|
109
|
+
import { Bell } from "phosphor-react";
|
|
110
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
108
111
|
var VARIANT_ACTION_CLASSES2 = {
|
|
109
112
|
solid: {
|
|
110
113
|
error: "bg-error text-error-700 focus-visible:outline-none",
|
|
@@ -160,14 +163,14 @@ var Badge = ({
|
|
|
160
163
|
const baseClasses = "inline-flex items-center justify-center rounded-xs font-normal gap-1 relative";
|
|
161
164
|
const baseClassesIcon = "flex items-center";
|
|
162
165
|
if (variant === "notification") {
|
|
163
|
-
return /* @__PURE__ */
|
|
166
|
+
return /* @__PURE__ */ jsxs2(
|
|
164
167
|
"div",
|
|
165
168
|
{
|
|
166
169
|
className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
|
|
167
170
|
...props,
|
|
168
171
|
children: [
|
|
169
|
-
/* @__PURE__ */
|
|
170
|
-
notificationActive && /* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */ jsx3(Bell, { size: 24, className: "text-primary-950" }),
|
|
173
|
+
notificationActive && /* @__PURE__ */ jsx3(
|
|
171
174
|
"span",
|
|
172
175
|
{
|
|
173
176
|
"data-testid": "notification-dot",
|
|
@@ -178,19 +181,23 @@ var Badge = ({
|
|
|
178
181
|
}
|
|
179
182
|
);
|
|
180
183
|
}
|
|
181
|
-
return /* @__PURE__ */
|
|
184
|
+
return /* @__PURE__ */ jsxs2(
|
|
182
185
|
"div",
|
|
183
186
|
{
|
|
184
187
|
className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
|
|
185
188
|
...props,
|
|
186
189
|
children: [
|
|
187
|
-
iconLeft && /* @__PURE__ */
|
|
190
|
+
iconLeft && /* @__PURE__ */ jsx3("span", { className: `${baseClassesIcon} ${sizeClassesIcon}`, children: iconLeft }),
|
|
188
191
|
children,
|
|
189
|
-
iconRight && /* @__PURE__ */
|
|
192
|
+
iconRight && /* @__PURE__ */ jsx3("span", { className: `${baseClassesIcon} ${sizeClassesIcon}`, children: iconRight })
|
|
190
193
|
]
|
|
191
194
|
}
|
|
192
195
|
);
|
|
193
196
|
};
|
|
197
|
+
|
|
198
|
+
// src/components/Alert/Alert.tsx
|
|
199
|
+
import { CheckCircle, Info, WarningCircle, XCircle } from "phosphor-react";
|
|
200
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
194
201
|
var VARIANT_ACTION_CLASSES3 = {
|
|
195
202
|
solid: {
|
|
196
203
|
default: "bg-background-50 border-transparent",
|
|
@@ -215,11 +222,11 @@ var COLOR_CLASSES = {
|
|
|
215
222
|
error: "text-error-800"
|
|
216
223
|
};
|
|
217
224
|
var ICONS = {
|
|
218
|
-
default: /* @__PURE__ */
|
|
219
|
-
info: /* @__PURE__ */
|
|
220
|
-
success: /* @__PURE__ */
|
|
221
|
-
warning: /* @__PURE__ */
|
|
222
|
-
error: /* @__PURE__ */
|
|
225
|
+
default: /* @__PURE__ */ jsx4(CheckCircle, { size: 18 }),
|
|
226
|
+
info: /* @__PURE__ */ jsx4(Info, { size: 18 }),
|
|
227
|
+
success: /* @__PURE__ */ jsx4(CheckCircle, { size: 18 }),
|
|
228
|
+
warning: /* @__PURE__ */ jsx4(WarningCircle, { size: 18 }),
|
|
229
|
+
error: /* @__PURE__ */ jsx4(XCircle, { size: 18 })
|
|
223
230
|
};
|
|
224
231
|
var Alert = ({
|
|
225
232
|
variant = "solid",
|
|
@@ -234,15 +241,15 @@ var Alert = ({
|
|
|
234
241
|
const variantColor = COLOR_CLASSES[action];
|
|
235
242
|
const variantIcon = ICONS[action];
|
|
236
243
|
const hasHeading = Boolean(title);
|
|
237
|
-
return /* @__PURE__ */
|
|
244
|
+
return /* @__PURE__ */ jsxs3(
|
|
238
245
|
"div",
|
|
239
246
|
{
|
|
240
247
|
className: `${baseClasses} ${variantClasses} ${className ?? ""}`,
|
|
241
248
|
...props,
|
|
242
249
|
children: [
|
|
243
|
-
/* @__PURE__ */
|
|
244
|
-
/* @__PURE__ */
|
|
245
|
-
hasHeading && /* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ jsx4("span", { className: `mt-0.5 ${variantColor}`, children: variantIcon }),
|
|
251
|
+
/* @__PURE__ */ jsxs3("div", { children: [
|
|
252
|
+
hasHeading && /* @__PURE__ */ jsx4(
|
|
246
253
|
Text,
|
|
247
254
|
{
|
|
248
255
|
size: "md",
|
|
@@ -252,7 +259,7 @@ var Alert = ({
|
|
|
252
259
|
children: title
|
|
253
260
|
}
|
|
254
261
|
),
|
|
255
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ jsx4(
|
|
256
263
|
Text,
|
|
257
264
|
{
|
|
258
265
|
size: hasHeading ? "sm" : "md",
|
|
@@ -266,6 +273,10 @@ var Alert = ({
|
|
|
266
273
|
}
|
|
267
274
|
);
|
|
268
275
|
};
|
|
276
|
+
|
|
277
|
+
// src/components/IconButton/IconButton.tsx
|
|
278
|
+
import { forwardRef } from "react";
|
|
279
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
269
280
|
var IconButton = forwardRef(
|
|
270
281
|
({ icon, size = "md", active = false, className = "", disabled, ...props }, ref) => {
|
|
271
282
|
const baseClasses = [
|
|
@@ -298,7 +309,7 @@ var IconButton = forwardRef(
|
|
|
298
309
|
...activeClasses
|
|
299
310
|
].join(" ");
|
|
300
311
|
const ariaLabel = props["aria-label"] ?? "Bot\xE3o de a\xE7\xE3o";
|
|
301
|
-
return /* @__PURE__ */
|
|
312
|
+
return /* @__PURE__ */ jsx5(
|
|
302
313
|
"button",
|
|
303
314
|
{
|
|
304
315
|
ref,
|
|
@@ -308,12 +319,15 @@ var IconButton = forwardRef(
|
|
|
308
319
|
"aria-pressed": active,
|
|
309
320
|
"aria-label": ariaLabel,
|
|
310
321
|
...props,
|
|
311
|
-
children: /* @__PURE__ */
|
|
322
|
+
children: /* @__PURE__ */ jsx5("span", { className: "flex items-center justify-center", children: icon })
|
|
312
323
|
}
|
|
313
324
|
);
|
|
314
325
|
}
|
|
315
326
|
);
|
|
316
327
|
IconButton.displayName = "IconButton";
|
|
328
|
+
|
|
329
|
+
// src/components/IconRoundedButton/IconRoundedButton.tsx
|
|
330
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
317
331
|
var IconRoundedButton = ({
|
|
318
332
|
icon,
|
|
319
333
|
className = "",
|
|
@@ -341,18 +355,22 @@ var IconRoundedButton = ({
|
|
|
341
355
|
"disabled:opacity-50",
|
|
342
356
|
"disabled:cursor-not-allowed"
|
|
343
357
|
].join(" ");
|
|
344
|
-
return /* @__PURE__ */
|
|
358
|
+
return /* @__PURE__ */ jsx6(
|
|
345
359
|
"button",
|
|
346
360
|
{
|
|
347
361
|
type: "button",
|
|
348
362
|
className: `${baseClasses} ${className}`,
|
|
349
363
|
disabled,
|
|
350
364
|
...props,
|
|
351
|
-
children: /* @__PURE__ */
|
|
365
|
+
children: /* @__PURE__ */ jsx6("span", { className: "flex items-center justify-center w-5 h-5", children: icon })
|
|
352
366
|
}
|
|
353
367
|
);
|
|
354
368
|
};
|
|
355
|
-
|
|
369
|
+
|
|
370
|
+
// src/components/NavButton/NavButton.tsx
|
|
371
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
372
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
373
|
+
var NavButton = forwardRef2(
|
|
356
374
|
({ icon, label, selected = false, className = "", disabled, ...props }, ref) => {
|
|
357
375
|
const baseClasses = [
|
|
358
376
|
"flex",
|
|
@@ -379,7 +397,7 @@ var NavButton = forwardRef(
|
|
|
379
397
|
];
|
|
380
398
|
const stateClasses = selected ? ["bg-primary-50", "text-primary-950"] : [];
|
|
381
399
|
const allClasses = [...baseClasses, ...stateClasses].join(" ");
|
|
382
|
-
return /* @__PURE__ */
|
|
400
|
+
return /* @__PURE__ */ jsxs4(
|
|
383
401
|
"button",
|
|
384
402
|
{
|
|
385
403
|
ref,
|
|
@@ -389,15 +407,19 @@ var NavButton = forwardRef(
|
|
|
389
407
|
"aria-pressed": selected,
|
|
390
408
|
...props,
|
|
391
409
|
children: [
|
|
392
|
-
/* @__PURE__ */
|
|
393
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ jsx7("span", { className: "flex items-center justify-center w-5 h-5", children: icon }),
|
|
411
|
+
/* @__PURE__ */ jsx7("span", { className: "whitespace-nowrap", children: label })
|
|
394
412
|
]
|
|
395
413
|
}
|
|
396
414
|
);
|
|
397
415
|
}
|
|
398
416
|
);
|
|
399
417
|
NavButton.displayName = "NavButton";
|
|
400
|
-
|
|
418
|
+
|
|
419
|
+
// src/components/SelectionButton/SelectionButton.tsx
|
|
420
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
421
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
422
|
+
var SelectionButton = forwardRef3(
|
|
401
423
|
({ icon, label, selected = false, className = "", disabled, ...props }, ref) => {
|
|
402
424
|
const baseClasses = [
|
|
403
425
|
"inline-flex",
|
|
@@ -429,7 +451,7 @@ var SelectionButton = forwardRef(
|
|
|
429
451
|
];
|
|
430
452
|
const stateClasses = selected ? ["ring-primary-950", "ring-2", "ring-offset-0", "shadow-none"] : [];
|
|
431
453
|
const allClasses = [...baseClasses, ...stateClasses].join(" ");
|
|
432
|
-
return /* @__PURE__ */
|
|
454
|
+
return /* @__PURE__ */ jsxs5(
|
|
433
455
|
"button",
|
|
434
456
|
{
|
|
435
457
|
ref,
|
|
@@ -439,30 +461,34 @@ var SelectionButton = forwardRef(
|
|
|
439
461
|
"aria-pressed": selected,
|
|
440
462
|
...props,
|
|
441
463
|
children: [
|
|
442
|
-
/* @__PURE__ */
|
|
443
|
-
/* @__PURE__ */
|
|
464
|
+
/* @__PURE__ */ jsx8("span", { className: "flex items-center justify-center w-6 h-6", children: icon }),
|
|
465
|
+
/* @__PURE__ */ jsx8("span", { children: label })
|
|
444
466
|
]
|
|
445
467
|
}
|
|
446
468
|
);
|
|
447
469
|
}
|
|
448
470
|
);
|
|
449
471
|
SelectionButton.displayName = "SelectionButton";
|
|
450
|
-
|
|
451
|
-
|
|
472
|
+
|
|
473
|
+
// src/components/Table/Table.tsx
|
|
474
|
+
import { forwardRef as forwardRef4 } from "react";
|
|
475
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
476
|
+
var Table = forwardRef4(
|
|
477
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx9("div", { className: "border border-border-200 rounded-xl relative w-full overflow-hidden", children: /* @__PURE__ */ jsxs6(
|
|
452
478
|
"table",
|
|
453
479
|
{
|
|
454
480
|
ref,
|
|
455
481
|
className: `w-full caption-bottom text-sm ${className ?? ""}`,
|
|
456
482
|
...props,
|
|
457
483
|
children: [
|
|
458
|
-
/* @__PURE__ */
|
|
484
|
+
/* @__PURE__ */ jsx9("caption", { className: "sr-only", children: "My Table" }),
|
|
459
485
|
children
|
|
460
486
|
]
|
|
461
487
|
}
|
|
462
488
|
) })
|
|
463
489
|
);
|
|
464
490
|
Table.displayName = "Table";
|
|
465
|
-
var TableHeader =
|
|
491
|
+
var TableHeader = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
466
492
|
"thead",
|
|
467
493
|
{
|
|
468
494
|
ref,
|
|
@@ -471,7 +497,7 @@ var TableHeader = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ j
|
|
|
471
497
|
}
|
|
472
498
|
));
|
|
473
499
|
TableHeader.displayName = "TableHeader";
|
|
474
|
-
var TableBody =
|
|
500
|
+
var TableBody = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
475
501
|
"tbody",
|
|
476
502
|
{
|
|
477
503
|
ref,
|
|
@@ -480,7 +506,7 @@ var TableBody = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx
|
|
|
480
506
|
}
|
|
481
507
|
));
|
|
482
508
|
TableBody.displayName = "TableBody";
|
|
483
|
-
var TableFooter =
|
|
509
|
+
var TableFooter = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
484
510
|
"tfoot",
|
|
485
511
|
{
|
|
486
512
|
ref,
|
|
@@ -495,9 +521,9 @@ var VARIANT_STATES_ROW = {
|
|
|
495
521
|
invalid: "border-b-2 border-indicator-error",
|
|
496
522
|
disabled: "border-b border-border-100 bg-background-50 opacity-50 cursor-not-allowed"
|
|
497
523
|
};
|
|
498
|
-
var TableRow =
|
|
524
|
+
var TableRow = forwardRef4(
|
|
499
525
|
({ state = "default", className, ...props }, ref) => {
|
|
500
|
-
return /* @__PURE__ */
|
|
526
|
+
return /* @__PURE__ */ jsx9(
|
|
501
527
|
"tr",
|
|
502
528
|
{
|
|
503
529
|
ref,
|
|
@@ -514,7 +540,7 @@ var TableRow = forwardRef(
|
|
|
514
540
|
}
|
|
515
541
|
);
|
|
516
542
|
TableRow.displayName = "TableRow";
|
|
517
|
-
var TableHead =
|
|
543
|
+
var TableHead = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
518
544
|
"th",
|
|
519
545
|
{
|
|
520
546
|
ref,
|
|
@@ -523,7 +549,7 @@ var TableHead = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx
|
|
|
523
549
|
}
|
|
524
550
|
));
|
|
525
551
|
TableHead.displayName = "TableHead";
|
|
526
|
-
var TableCell =
|
|
552
|
+
var TableCell = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
527
553
|
"td",
|
|
528
554
|
{
|
|
529
555
|
ref,
|
|
@@ -532,7 +558,7 @@ var TableCell = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx
|
|
|
532
558
|
}
|
|
533
559
|
));
|
|
534
560
|
TableCell.displayName = "TableCell";
|
|
535
|
-
var TableCaption =
|
|
561
|
+
var TableCaption = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
536
562
|
"caption",
|
|
537
563
|
{
|
|
538
564
|
ref,
|
|
@@ -541,6 +567,15 @@ var TableCaption = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
541
567
|
}
|
|
542
568
|
));
|
|
543
569
|
TableCaption.displayName = "TableCaption";
|
|
570
|
+
|
|
571
|
+
// src/components/CheckBox/CheckBox.tsx
|
|
572
|
+
import {
|
|
573
|
+
forwardRef as forwardRef5,
|
|
574
|
+
useState,
|
|
575
|
+
useId
|
|
576
|
+
} from "react";
|
|
577
|
+
import { Check, Minus } from "phosphor-react";
|
|
578
|
+
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
544
579
|
var SIZE_CLASSES3 = {
|
|
545
580
|
small: {
|
|
546
581
|
checkbox: "w-4 h-4",
|
|
@@ -600,7 +635,7 @@ var STATE_CLASSES = {
|
|
|
600
635
|
checked: "border-primary-600 bg-primary-600 text-text cursor-not-allowed opacity-40"
|
|
601
636
|
}
|
|
602
637
|
};
|
|
603
|
-
var CheckBox =
|
|
638
|
+
var CheckBox = forwardRef5(
|
|
604
639
|
({
|
|
605
640
|
label,
|
|
606
641
|
size = "medium",
|
|
@@ -635,7 +670,7 @@ var CheckBox = forwardRef(
|
|
|
635
670
|
const checkboxClasses = `${BASE_CHECKBOX_CLASSES} ${sizeClasses.checkbox} ${borderWidthClass} ${stylingClasses} ${className}`;
|
|
636
671
|
const renderIcon = () => {
|
|
637
672
|
if (indeterminate) {
|
|
638
|
-
return /* @__PURE__ */
|
|
673
|
+
return /* @__PURE__ */ jsx10(
|
|
639
674
|
Minus,
|
|
640
675
|
{
|
|
641
676
|
size: sizeClasses.iconSize,
|
|
@@ -645,7 +680,7 @@ var CheckBox = forwardRef(
|
|
|
645
680
|
);
|
|
646
681
|
}
|
|
647
682
|
if (checked) {
|
|
648
|
-
return /* @__PURE__ */
|
|
683
|
+
return /* @__PURE__ */ jsx10(
|
|
649
684
|
Check,
|
|
650
685
|
{
|
|
651
686
|
size: sizeClasses.iconSize,
|
|
@@ -656,13 +691,13 @@ var CheckBox = forwardRef(
|
|
|
656
691
|
}
|
|
657
692
|
return null;
|
|
658
693
|
};
|
|
659
|
-
return /* @__PURE__ */
|
|
660
|
-
/* @__PURE__ */
|
|
694
|
+
return /* @__PURE__ */ jsxs7("div", { className: "flex flex-col", children: [
|
|
695
|
+
/* @__PURE__ */ jsxs7(
|
|
661
696
|
"div",
|
|
662
697
|
{
|
|
663
698
|
className: `flex flex-row items-center ${sizeClasses.spacing} ${disabled ? "opacity-40" : ""}`,
|
|
664
699
|
children: [
|
|
665
|
-
/* @__PURE__ */
|
|
700
|
+
/* @__PURE__ */ jsx10(
|
|
666
701
|
"input",
|
|
667
702
|
{
|
|
668
703
|
ref,
|
|
@@ -675,12 +710,12 @@ var CheckBox = forwardRef(
|
|
|
675
710
|
...props
|
|
676
711
|
}
|
|
677
712
|
),
|
|
678
|
-
/* @__PURE__ */
|
|
679
|
-
label && /* @__PURE__ */
|
|
713
|
+
/* @__PURE__ */ jsx10("label", { htmlFor: inputId, className: checkboxClasses, children: renderIcon() }),
|
|
714
|
+
label && /* @__PURE__ */ jsx10(
|
|
680
715
|
"div",
|
|
681
716
|
{
|
|
682
717
|
className: `flex flex-row items-center ${sizeClasses.labelHeight}`,
|
|
683
|
-
children: /* @__PURE__ */
|
|
718
|
+
children: /* @__PURE__ */ jsx10(
|
|
684
719
|
Text,
|
|
685
720
|
{
|
|
686
721
|
as: "label",
|
|
@@ -696,7 +731,7 @@ var CheckBox = forwardRef(
|
|
|
696
731
|
]
|
|
697
732
|
}
|
|
698
733
|
),
|
|
699
|
-
errorMessage && /* @__PURE__ */
|
|
734
|
+
errorMessage && /* @__PURE__ */ jsx10(
|
|
700
735
|
Text,
|
|
701
736
|
{
|
|
702
737
|
size: "sm",
|
|
@@ -706,7 +741,7 @@ var CheckBox = forwardRef(
|
|
|
706
741
|
children: errorMessage
|
|
707
742
|
}
|
|
708
743
|
),
|
|
709
|
-
helperText && !errorMessage && /* @__PURE__ */
|
|
744
|
+
helperText && !errorMessage && /* @__PURE__ */ jsx10(
|
|
710
745
|
Text,
|
|
711
746
|
{
|
|
712
747
|
size: "sm",
|
|
@@ -720,6 +755,14 @@ var CheckBox = forwardRef(
|
|
|
720
755
|
}
|
|
721
756
|
);
|
|
722
757
|
CheckBox.displayName = "CheckBox";
|
|
758
|
+
|
|
759
|
+
// src/components/TextArea/TextArea.tsx
|
|
760
|
+
import {
|
|
761
|
+
forwardRef as forwardRef6,
|
|
762
|
+
useState as useState2,
|
|
763
|
+
useId as useId2
|
|
764
|
+
} from "react";
|
|
765
|
+
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
723
766
|
var SIZE_CLASSES4 = {
|
|
724
767
|
small: {
|
|
725
768
|
container: "w-72",
|
|
@@ -778,7 +821,7 @@ var STATE_CLASSES2 = {
|
|
|
778
821
|
focus: ""
|
|
779
822
|
}
|
|
780
823
|
};
|
|
781
|
-
var TextArea =
|
|
824
|
+
var TextArea = forwardRef6(
|
|
782
825
|
({
|
|
783
826
|
label,
|
|
784
827
|
size = "medium",
|
|
@@ -793,9 +836,9 @@ var TextArea = forwardRef(
|
|
|
793
836
|
placeholder,
|
|
794
837
|
...props
|
|
795
838
|
}, ref) => {
|
|
796
|
-
const generatedId =
|
|
839
|
+
const generatedId = useId2();
|
|
797
840
|
const inputId = id ?? `textarea-${generatedId}`;
|
|
798
|
-
const [isFocused, setIsFocused] =
|
|
841
|
+
const [isFocused, setIsFocused] = useState2(false);
|
|
799
842
|
const handleChange = (event) => {
|
|
800
843
|
onChange?.(event);
|
|
801
844
|
};
|
|
@@ -814,8 +857,8 @@ var TextArea = forwardRef(
|
|
|
814
857
|
const sizeClasses = SIZE_CLASSES4[size];
|
|
815
858
|
const stateClasses = STATE_CLASSES2[currentState];
|
|
816
859
|
const textareaClasses = `${BASE_TEXTAREA_CLASSES} ${sizeClasses.textarea} ${stateClasses.base} ${stateClasses.hover} ${stateClasses.focus} ${className}`;
|
|
817
|
-
return /* @__PURE__ */
|
|
818
|
-
label && /* @__PURE__ */
|
|
860
|
+
return /* @__PURE__ */ jsxs8("div", { className: `flex flex-col ${sizeClasses.container}`, children: [
|
|
861
|
+
label && /* @__PURE__ */ jsx11(
|
|
819
862
|
Text,
|
|
820
863
|
{
|
|
821
864
|
as: "label",
|
|
@@ -827,7 +870,7 @@ var TextArea = forwardRef(
|
|
|
827
870
|
children: label
|
|
828
871
|
}
|
|
829
872
|
),
|
|
830
|
-
/* @__PURE__ */
|
|
873
|
+
/* @__PURE__ */ jsx11(
|
|
831
874
|
"textarea",
|
|
832
875
|
{
|
|
833
876
|
ref,
|
|
@@ -841,17 +884,30 @@ var TextArea = forwardRef(
|
|
|
841
884
|
...props
|
|
842
885
|
}
|
|
843
886
|
),
|
|
844
|
-
errorMessage && /* @__PURE__ */
|
|
845
|
-
helperMessage && !errorMessage && /* @__PURE__ */
|
|
887
|
+
errorMessage && /* @__PURE__ */ jsx11(Text, { size: "sm", weight: "normal", className: "mt-1.5 text-error-600", children: errorMessage }),
|
|
888
|
+
helperMessage && !errorMessage && /* @__PURE__ */ jsx11(Text, { size: "sm", weight: "normal", className: "mt-1.5 text-text-500", children: helperMessage })
|
|
846
889
|
] });
|
|
847
890
|
}
|
|
848
891
|
);
|
|
849
892
|
TextArea.displayName = "TextArea";
|
|
893
|
+
|
|
894
|
+
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
895
|
+
import {
|
|
896
|
+
createContext,
|
|
897
|
+
useState as useState3,
|
|
898
|
+
useCallback,
|
|
899
|
+
useContext,
|
|
900
|
+
forwardRef as forwardRef7,
|
|
901
|
+
useEffect,
|
|
902
|
+
useRef,
|
|
903
|
+
useMemo
|
|
904
|
+
} from "react";
|
|
905
|
+
import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
850
906
|
var DropdownMenuContext = createContext(
|
|
851
907
|
void 0
|
|
852
908
|
);
|
|
853
909
|
var DropdownMenu = ({ children, open, onOpenChange }) => {
|
|
854
|
-
const [internalOpen, setInternalOpen] =
|
|
910
|
+
const [internalOpen, setInternalOpen] = useState3(false);
|
|
855
911
|
const isControlled = open !== void 0;
|
|
856
912
|
const currentOpen = isControlled ? open : internalOpen;
|
|
857
913
|
const setOpen = useCallback(
|
|
@@ -909,14 +965,14 @@ var DropdownMenu = ({ children, open, onOpenChange }) => {
|
|
|
909
965
|
() => ({ open: currentOpen, setOpen }),
|
|
910
966
|
[currentOpen, setOpen]
|
|
911
967
|
);
|
|
912
|
-
return /* @__PURE__ */
|
|
968
|
+
return /* @__PURE__ */ jsx12(DropdownMenuContext.Provider, { value, children: /* @__PURE__ */ jsx12("div", { className: "relative", ref: menuRef, children }) });
|
|
913
969
|
};
|
|
914
|
-
var DropdownMenuTrigger =
|
|
970
|
+
var DropdownMenuTrigger = forwardRef7(({ className, children, onClick, ...props }, ref) => {
|
|
915
971
|
const context = useContext(DropdownMenuContext);
|
|
916
972
|
if (!context)
|
|
917
973
|
throw new Error("DropdownMenuTrigger must be used within a DropdownMenu");
|
|
918
974
|
const { open, setOpen } = context;
|
|
919
|
-
return /* @__PURE__ */
|
|
975
|
+
return /* @__PURE__ */ jsx12(
|
|
920
976
|
"button",
|
|
921
977
|
{
|
|
922
978
|
ref,
|
|
@@ -948,7 +1004,7 @@ var ALIGN_CLASSES = {
|
|
|
948
1004
|
center: "left-1/2 -translate-x-1/2",
|
|
949
1005
|
end: "right-0"
|
|
950
1006
|
};
|
|
951
|
-
var MenuLabel =
|
|
1007
|
+
var MenuLabel = forwardRef7(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx12(
|
|
952
1008
|
"fieldset",
|
|
953
1009
|
{
|
|
954
1010
|
ref,
|
|
@@ -958,7 +1014,7 @@ var MenuLabel = forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__
|
|
|
958
1014
|
}
|
|
959
1015
|
));
|
|
960
1016
|
MenuLabel.displayName = "MenuLabel";
|
|
961
|
-
var MenuContent =
|
|
1017
|
+
var MenuContent = forwardRef7(
|
|
962
1018
|
({
|
|
963
1019
|
className,
|
|
964
1020
|
align = "start",
|
|
@@ -968,7 +1024,7 @@ var MenuContent = forwardRef(
|
|
|
968
1024
|
...props
|
|
969
1025
|
}, ref) => {
|
|
970
1026
|
const { open } = useContext(DropdownMenuContext);
|
|
971
|
-
const [isVisible, setIsVisible] =
|
|
1027
|
+
const [isVisible, setIsVisible] = useState3(open);
|
|
972
1028
|
useEffect(() => {
|
|
973
1029
|
if (open) {
|
|
974
1030
|
setIsVisible(true);
|
|
@@ -983,7 +1039,7 @@ var MenuContent = forwardRef(
|
|
|
983
1039
|
const horizontal = ALIGN_CLASSES[align];
|
|
984
1040
|
return `absolute ${vertical} ${horizontal}`;
|
|
985
1041
|
};
|
|
986
|
-
return /* @__PURE__ */
|
|
1042
|
+
return /* @__PURE__ */ jsx12(
|
|
987
1043
|
"div",
|
|
988
1044
|
{
|
|
989
1045
|
ref,
|
|
@@ -1007,7 +1063,7 @@ var MenuContent = forwardRef(
|
|
|
1007
1063
|
}
|
|
1008
1064
|
);
|
|
1009
1065
|
MenuContent.displayName = "MenuContent";
|
|
1010
|
-
var MenuItem =
|
|
1066
|
+
var MenuItem = forwardRef7(
|
|
1011
1067
|
({
|
|
1012
1068
|
className,
|
|
1013
1069
|
inset,
|
|
@@ -1028,7 +1084,7 @@ var MenuItem = forwardRef(
|
|
|
1028
1084
|
}
|
|
1029
1085
|
onClick?.(e);
|
|
1030
1086
|
};
|
|
1031
|
-
return /* @__PURE__ */
|
|
1087
|
+
return /* @__PURE__ */ jsxs9(
|
|
1032
1088
|
"div",
|
|
1033
1089
|
{
|
|
1034
1090
|
ref,
|
|
@@ -1058,7 +1114,7 @@ var MenuItem = forwardRef(
|
|
|
1058
1114
|
}
|
|
1059
1115
|
);
|
|
1060
1116
|
MenuItem.displayName = "MenuItem";
|
|
1061
|
-
var MenuSeparator =
|
|
1117
|
+
var MenuSeparator = forwardRef7(({ className, ...props }, ref) => /* @__PURE__ */ jsx12(
|
|
1062
1118
|
"div",
|
|
1063
1119
|
{
|
|
1064
1120
|
ref,
|
|
@@ -1067,11 +1123,15 @@ var MenuSeparator = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
1067
1123
|
}
|
|
1068
1124
|
));
|
|
1069
1125
|
MenuSeparator.displayName = "MenuSeparator";
|
|
1126
|
+
|
|
1127
|
+
// src/components/Toast/Toast.tsx
|
|
1128
|
+
import { CheckCircle as CheckCircle2, WarningCircle as WarningCircle2, Info as Info2, X } from "phosphor-react";
|
|
1129
|
+
import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1070
1130
|
var VARIANT_ACTION_CLASSES4 = {
|
|
1071
1131
|
solid: {
|
|
1072
|
-
warning: "bg-warning text-warning-
|
|
1132
|
+
warning: "bg-warning text-warning-600 border-none focus-visible:outline-none",
|
|
1073
1133
|
success: "bg-success text-success-800 border-none focus-visible:outline-none",
|
|
1074
|
-
info: "bg-info text-info-
|
|
1134
|
+
info: "bg-info text-info-600 border-none focus-visible:outline-none"
|
|
1075
1135
|
},
|
|
1076
1136
|
outlined: {
|
|
1077
1137
|
warning: "bg-warning text-warning-600 border border-warning-300 focus-visible:outline-none",
|
|
@@ -1080,9 +1140,9 @@ var VARIANT_ACTION_CLASSES4 = {
|
|
|
1080
1140
|
}
|
|
1081
1141
|
};
|
|
1082
1142
|
var iconMap = {
|
|
1083
|
-
success:
|
|
1084
|
-
info:
|
|
1085
|
-
warning:
|
|
1143
|
+
success: CheckCircle2,
|
|
1144
|
+
info: Info2,
|
|
1145
|
+
warning: WarningCircle2
|
|
1086
1146
|
};
|
|
1087
1147
|
var Toast = ({
|
|
1088
1148
|
variant = "outlined",
|
|
@@ -1106,7 +1166,7 @@ var Toast = ({
|
|
|
1106
1166
|
};
|
|
1107
1167
|
const IconAction = iconMap[action] || iconMap["success"];
|
|
1108
1168
|
const baseClasses = "max-w-[390px] w-full flex flex-row items-start justify-between shadow-lg rounded-lg border p-4 gap-6 group";
|
|
1109
|
-
return /* @__PURE__ */
|
|
1169
|
+
return /* @__PURE__ */ jsxs10(
|
|
1110
1170
|
"div",
|
|
1111
1171
|
{
|
|
1112
1172
|
role: "alert",
|
|
@@ -1115,26 +1175,29 @@ var Toast = ({
|
|
|
1115
1175
|
className: `${baseClasses} ${positionClasses[position]} ${variantClasses} ${className}`,
|
|
1116
1176
|
...props,
|
|
1117
1177
|
children: [
|
|
1118
|
-
/* @__PURE__ */
|
|
1119
|
-
/* @__PURE__ */
|
|
1120
|
-
/* @__PURE__ */
|
|
1121
|
-
/* @__PURE__ */
|
|
1122
|
-
description && /* @__PURE__ */
|
|
1178
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex flex-row items-start gap-3", children: [
|
|
1179
|
+
/* @__PURE__ */ jsx13("span", { className: "mt-1", "data-testid": `toast-icon-${action}`, children: /* @__PURE__ */ jsx13(IconAction, {}) }),
|
|
1180
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex flex-col items-start justify-start", children: [
|
|
1181
|
+
/* @__PURE__ */ jsx13("p", { className: "font-semibold text-md", children: title }),
|
|
1182
|
+
description && /* @__PURE__ */ jsx13("p", { className: "text-md text-text-900", children: description })
|
|
1123
1183
|
] })
|
|
1124
1184
|
] }),
|
|
1125
|
-
/* @__PURE__ */
|
|
1185
|
+
/* @__PURE__ */ jsx13(
|
|
1126
1186
|
"button",
|
|
1127
1187
|
{
|
|
1128
1188
|
onClick: onClose,
|
|
1129
1189
|
"aria-label": "Dismiss notification",
|
|
1130
1190
|
className: "text-background-500 cursor-pointer opacity-0 group-hover:opacity-100 transition-opacity",
|
|
1131
|
-
children: /* @__PURE__ */
|
|
1191
|
+
children: /* @__PURE__ */ jsx13(X, {})
|
|
1132
1192
|
}
|
|
1133
1193
|
)
|
|
1134
1194
|
]
|
|
1135
1195
|
}
|
|
1136
1196
|
);
|
|
1137
1197
|
};
|
|
1198
|
+
|
|
1199
|
+
// src/components/Toast/utils/ToastStore.ts
|
|
1200
|
+
import { create } from "zustand";
|
|
1138
1201
|
var useToastStore = create((set) => ({
|
|
1139
1202
|
toasts: [],
|
|
1140
1203
|
addToast: (toast) => {
|
|
@@ -1149,10 +1212,13 @@ var useToastStore = create((set) => ({
|
|
|
1149
1212
|
}));
|
|
1150
1213
|
}
|
|
1151
1214
|
}));
|
|
1215
|
+
|
|
1216
|
+
// src/components/Toast/utils/Toaster.tsx
|
|
1217
|
+
import { Fragment, jsx as jsx14 } from "react/jsx-runtime";
|
|
1152
1218
|
var Toaster = () => {
|
|
1153
1219
|
const toasts = useToastStore((state) => state.toasts);
|
|
1154
1220
|
const removeToast = useToastStore((state) => state.removeToast);
|
|
1155
|
-
return /* @__PURE__ */
|
|
1221
|
+
return /* @__PURE__ */ jsx14(Fragment, { children: toasts.map((toast) => /* @__PURE__ */ jsx14(
|
|
1156
1222
|
Toast,
|
|
1157
1223
|
{
|
|
1158
1224
|
title: toast.title,
|
|
@@ -1165,5 +1231,25 @@ var Toaster = () => {
|
|
|
1165
1231
|
toast.id
|
|
1166
1232
|
)) });
|
|
1167
1233
|
};
|
|
1168
|
-
|
|
1169
|
-
|
|
1234
|
+
export {
|
|
1235
|
+
Alert,
|
|
1236
|
+
Badge,
|
|
1237
|
+
Button,
|
|
1238
|
+
CheckBox,
|
|
1239
|
+
DropdownMenu,
|
|
1240
|
+
MenuContent as DropdownMenuContent,
|
|
1241
|
+
MenuItem as DropdownMenuItem,
|
|
1242
|
+
MenuLabel as DropdownMenuLabel,
|
|
1243
|
+
MenuSeparator as DropdownMenuSeparator,
|
|
1244
|
+
DropdownMenuTrigger,
|
|
1245
|
+
IconButton,
|
|
1246
|
+
IconRoundedButton,
|
|
1247
|
+
NavButton,
|
|
1248
|
+
SelectionButton,
|
|
1249
|
+
Table,
|
|
1250
|
+
Text,
|
|
1251
|
+
TextArea,
|
|
1252
|
+
Toast,
|
|
1253
|
+
Toaster,
|
|
1254
|
+
useToastStore
|
|
1255
|
+
};
|