analytica-frontend-lib 1.0.16 → 1.0.18
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.css +211 -0
- package/dist/index.d.mts +108 -2
- package/dist/index.d.ts +108 -2
- package/dist/index.js +337 -47
- package/dist/index.mjs +328 -39
- package/package.json +5 -2
package/dist/index.mjs
CHANGED
|
@@ -206,25 +206,309 @@ var Text = ({
|
|
|
206
206
|
);
|
|
207
207
|
};
|
|
208
208
|
|
|
209
|
-
// src/components/
|
|
210
|
-
import {
|
|
209
|
+
// src/components/Toast/Toast.tsx
|
|
210
|
+
import { CheckCircle, WarningCircle, Info, X } from "phosphor-react";
|
|
211
211
|
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
212
|
-
var
|
|
213
|
-
|
|
212
|
+
var VARIANT_ACTION_CLASSES2 = {
|
|
213
|
+
solid: {
|
|
214
|
+
warning: "bg-warning text-warning-800 border-none focus-visible:outline-none",
|
|
215
|
+
success: "bg-success text-success-800 border-none focus-visible:outline-none",
|
|
216
|
+
info: "bg-info text-info-800 border-none focus-visible:outline-none"
|
|
217
|
+
},
|
|
218
|
+
outlined: {
|
|
219
|
+
warning: "bg-warning text-warning-800 border border-warning-200 focus-visible:outline-none",
|
|
220
|
+
success: "bg-success text-success-800 border border-success-200 focus-visible:outline-none",
|
|
221
|
+
info: "bg-info text-info-800 border border-info-200 focus-visible:outline-none"
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
var iconMap = {
|
|
225
|
+
success: CheckCircle,
|
|
226
|
+
info: Info,
|
|
227
|
+
warning: WarningCircle
|
|
228
|
+
};
|
|
229
|
+
var Toast = ({
|
|
230
|
+
variant = "outlined",
|
|
231
|
+
action = "success",
|
|
232
|
+
className = "",
|
|
233
|
+
onClose,
|
|
234
|
+
title,
|
|
235
|
+
description,
|
|
236
|
+
position = "default",
|
|
237
|
+
...props
|
|
238
|
+
}) => {
|
|
239
|
+
const variantClasses = VARIANT_ACTION_CLASSES2[variant][action];
|
|
240
|
+
const positionClasses = {
|
|
241
|
+
"top-left": "fixed top-4 left-4",
|
|
242
|
+
"top-center": "fixed top-4 left-1/2 transform -translate-x-1/2",
|
|
243
|
+
"top-right": "fixed top-4 right-4",
|
|
244
|
+
"bottom-left": "fixed bottom-4 left-4",
|
|
245
|
+
"bottom-center": "fixed bottom-4 left-1/2 transform -translate-x-1/2",
|
|
246
|
+
"bottom-right": "fixed bottom-4 right-4",
|
|
247
|
+
default: ""
|
|
248
|
+
};
|
|
249
|
+
const IconAction = iconMap[action] || iconMap["success"];
|
|
250
|
+
const baseClasses = "max-w-[390px] w-full flex flex-row items-start justify-between shadow-lg rounded-lg border p-4 gap-6 group";
|
|
251
|
+
return /* @__PURE__ */ jsxs3(
|
|
252
|
+
"div",
|
|
253
|
+
{
|
|
254
|
+
role: "alert",
|
|
255
|
+
"aria-live": "assertive",
|
|
256
|
+
"aria-atomic": "true",
|
|
257
|
+
className: `${baseClasses} ${positionClasses[position]} ${variantClasses} ${className}`,
|
|
258
|
+
...props,
|
|
259
|
+
children: [
|
|
260
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex flex-row items-start gap-3", children: [
|
|
261
|
+
/* @__PURE__ */ jsx5("span", { className: "mt-1", "data-testid": `toast-icon-${action}`, children: /* @__PURE__ */ jsx5(IconAction, {}) }),
|
|
262
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex flex-col items-start justify-start", children: [
|
|
263
|
+
/* @__PURE__ */ jsx5("p", { className: "font-semibold text-md", children: title }),
|
|
264
|
+
description && /* @__PURE__ */ jsx5("p", { className: "text-md text-text-900", children: description })
|
|
265
|
+
] })
|
|
266
|
+
] }),
|
|
267
|
+
/* @__PURE__ */ jsx5(
|
|
268
|
+
"button",
|
|
269
|
+
{
|
|
270
|
+
onClick: onClose,
|
|
271
|
+
"aria-label": "Dismiss notification",
|
|
272
|
+
className: "text-background-500 cursor-pointer opacity-0 group-hover:opacity-100 transition-opacity",
|
|
273
|
+
children: /* @__PURE__ */ jsx5(X, {})
|
|
274
|
+
}
|
|
275
|
+
)
|
|
276
|
+
]
|
|
277
|
+
}
|
|
278
|
+
);
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
// src/components/Toast/utils/ToastStore.ts
|
|
282
|
+
import { create } from "zustand";
|
|
283
|
+
var useToastStore = create((set) => ({
|
|
284
|
+
toasts: [],
|
|
285
|
+
addToast: (toast) => {
|
|
286
|
+
const id = crypto.randomUUID();
|
|
287
|
+
set((state) => ({
|
|
288
|
+
toasts: [...state.toasts, { id, ...toast }]
|
|
289
|
+
}));
|
|
290
|
+
},
|
|
291
|
+
removeToast: (id) => {
|
|
292
|
+
set((state) => ({
|
|
293
|
+
toasts: state.toasts.filter((t) => t.id !== id)
|
|
294
|
+
}));
|
|
295
|
+
}
|
|
296
|
+
}));
|
|
297
|
+
|
|
298
|
+
// src/components/Toast/utils/Toaster.tsx
|
|
299
|
+
import { Fragment, jsx as jsx6 } from "react/jsx-runtime";
|
|
300
|
+
var Toaster = () => {
|
|
301
|
+
const toasts = useToastStore((state) => state.toasts);
|
|
302
|
+
const removeToast = useToastStore((state) => state.removeToast);
|
|
303
|
+
return /* @__PURE__ */ jsx6(Fragment, { children: toasts.map((toast) => /* @__PURE__ */ jsx6(
|
|
304
|
+
Toast,
|
|
305
|
+
{
|
|
306
|
+
title: toast.title,
|
|
307
|
+
description: toast.description,
|
|
308
|
+
variant: toast.variant,
|
|
309
|
+
action: toast.action,
|
|
310
|
+
position: toast.position,
|
|
311
|
+
onClose: () => removeToast(toast.id)
|
|
312
|
+
},
|
|
313
|
+
toast.id
|
|
314
|
+
)) });
|
|
315
|
+
};
|
|
316
|
+
var useToast = () => {
|
|
317
|
+
const addToast = useToastStore((state) => state.addToast);
|
|
318
|
+
const removeToast = useToastStore((state) => state.removeToast);
|
|
319
|
+
return { addToast, removeToast };
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
// src/components/CheckBox/CheckBox.tsx
|
|
323
|
+
import {
|
|
324
|
+
forwardRef as forwardRef2,
|
|
325
|
+
useState,
|
|
326
|
+
useId
|
|
327
|
+
} from "react";
|
|
328
|
+
import { Check, Minus } from "phosphor-react";
|
|
329
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
330
|
+
var SIZE_CLASSES2 = {
|
|
331
|
+
small: {
|
|
332
|
+
checkbox: "w-4 h-4",
|
|
333
|
+
// 16px x 16px
|
|
334
|
+
textSize: "sm",
|
|
335
|
+
spacing: "gap-1.5",
|
|
336
|
+
// 6px
|
|
337
|
+
borderWidth: "border-2",
|
|
338
|
+
iconSize: 14,
|
|
339
|
+
// pixels for Phosphor icons
|
|
340
|
+
labelHeight: "h-[21px]"
|
|
341
|
+
},
|
|
342
|
+
medium: {
|
|
343
|
+
checkbox: "w-5 h-5",
|
|
344
|
+
// 20px x 20px
|
|
345
|
+
textSize: "md",
|
|
346
|
+
spacing: "gap-2",
|
|
347
|
+
// 8px
|
|
348
|
+
borderWidth: "border-2",
|
|
349
|
+
iconSize: 16,
|
|
350
|
+
// pixels for Phosphor icons
|
|
351
|
+
labelHeight: "h-6"
|
|
352
|
+
},
|
|
353
|
+
large: {
|
|
354
|
+
checkbox: "w-6 h-6",
|
|
355
|
+
// 24px x 24px
|
|
356
|
+
textSize: "lg",
|
|
357
|
+
spacing: "gap-2",
|
|
358
|
+
// 8px
|
|
359
|
+
borderWidth: "border-[3px]",
|
|
360
|
+
// 3px border
|
|
361
|
+
iconSize: 20,
|
|
362
|
+
// pixels for Phosphor icons
|
|
363
|
+
labelHeight: "h-[27px]"
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
var BASE_CHECKBOX_CLASSES = "rounded border cursor-pointer transition-all duration-200 flex items-center justify-center focus:outline-none";
|
|
367
|
+
var STATE_CLASSES = {
|
|
368
|
+
default: {
|
|
369
|
+
unchecked: "border-border-400 bg-background hover:border-border-500",
|
|
370
|
+
checked: "border-primary-950 bg-primary-950 text-text hover:border-primary-800 hover:bg-primary-800"
|
|
371
|
+
},
|
|
372
|
+
hovered: {
|
|
373
|
+
unchecked: "border-border-500 bg-background",
|
|
374
|
+
checked: "border-primary-800 bg-primary-800 text-text"
|
|
375
|
+
},
|
|
376
|
+
focused: {
|
|
377
|
+
unchecked: "border-indicator-info bg-background ring-2 ring-indicator-info/20",
|
|
378
|
+
checked: "border-indicator-info bg-primary-950 text-text ring-2 ring-indicator-info/20"
|
|
379
|
+
},
|
|
380
|
+
invalid: {
|
|
381
|
+
unchecked: "border-error-700 bg-background hover:border-error-600",
|
|
382
|
+
checked: "border-error-700 bg-primary-950 text-text"
|
|
383
|
+
},
|
|
384
|
+
disabled: {
|
|
385
|
+
unchecked: "border-border-400 bg-background cursor-not-allowed opacity-40",
|
|
386
|
+
checked: "border-primary-600 bg-primary-600 text-text cursor-not-allowed opacity-40"
|
|
387
|
+
}
|
|
388
|
+
};
|
|
389
|
+
var CheckBox = forwardRef2(
|
|
390
|
+
({
|
|
391
|
+
label,
|
|
392
|
+
size = "medium",
|
|
393
|
+
state = "default",
|
|
394
|
+
indeterminate = false,
|
|
395
|
+
errorMessage,
|
|
396
|
+
helperText,
|
|
397
|
+
className = "",
|
|
398
|
+
labelClassName = "",
|
|
399
|
+
checked: checkedProp,
|
|
400
|
+
disabled,
|
|
401
|
+
id,
|
|
402
|
+
onChange,
|
|
403
|
+
...props
|
|
404
|
+
}, ref) => {
|
|
405
|
+
const generatedId = useId();
|
|
406
|
+
const inputId = id ?? `checkbox-${generatedId}`;
|
|
407
|
+
const [internalChecked, setInternalChecked] = useState(false);
|
|
408
|
+
const isControlled = checkedProp !== void 0;
|
|
409
|
+
const checked = isControlled ? checkedProp : internalChecked;
|
|
410
|
+
const handleChange = (event) => {
|
|
411
|
+
if (!isControlled) {
|
|
412
|
+
setInternalChecked(event.target.checked);
|
|
413
|
+
}
|
|
414
|
+
onChange?.(event);
|
|
415
|
+
};
|
|
416
|
+
const currentState = disabled ? "disabled" : state;
|
|
417
|
+
const sizeClasses = SIZE_CLASSES2[size];
|
|
418
|
+
const checkVariant = checked || indeterminate ? "checked" : "unchecked";
|
|
419
|
+
const stylingClasses = STATE_CLASSES[currentState][checkVariant];
|
|
420
|
+
const borderWidthClass = state === "focused" || state === "hovered" && size === "large" ? "border-[3px]" : sizeClasses.borderWidth;
|
|
421
|
+
const checkboxClasses = `${BASE_CHECKBOX_CLASSES} ${sizeClasses.checkbox} ${borderWidthClass} ${stylingClasses} ${className}`;
|
|
422
|
+
const renderIcon = () => {
|
|
423
|
+
if (indeterminate) {
|
|
424
|
+
return /* @__PURE__ */ jsx7(
|
|
425
|
+
Minus,
|
|
426
|
+
{
|
|
427
|
+
size: sizeClasses.iconSize,
|
|
428
|
+
weight: "bold",
|
|
429
|
+
color: "currentColor"
|
|
430
|
+
}
|
|
431
|
+
);
|
|
432
|
+
}
|
|
433
|
+
if (checked) {
|
|
434
|
+
return /* @__PURE__ */ jsx7(
|
|
435
|
+
Check,
|
|
436
|
+
{
|
|
437
|
+
size: sizeClasses.iconSize,
|
|
438
|
+
weight: "bold",
|
|
439
|
+
color: "currentColor"
|
|
440
|
+
}
|
|
441
|
+
);
|
|
442
|
+
}
|
|
443
|
+
return null;
|
|
444
|
+
};
|
|
445
|
+
return /* @__PURE__ */ jsxs4("div", { className: "flex flex-col", children: [
|
|
446
|
+
/* @__PURE__ */ jsxs4(
|
|
447
|
+
"div",
|
|
448
|
+
{
|
|
449
|
+
className: `flex flex-row items-center ${sizeClasses.spacing} ${disabled ? "opacity-40" : ""}`,
|
|
450
|
+
children: [
|
|
451
|
+
/* @__PURE__ */ jsx7(
|
|
452
|
+
"input",
|
|
453
|
+
{
|
|
454
|
+
ref,
|
|
455
|
+
type: "checkbox",
|
|
456
|
+
id: inputId,
|
|
457
|
+
checked,
|
|
458
|
+
disabled,
|
|
459
|
+
onChange: handleChange,
|
|
460
|
+
className: "sr-only",
|
|
461
|
+
...props
|
|
462
|
+
}
|
|
463
|
+
),
|
|
464
|
+
/* @__PURE__ */ jsx7("label", { htmlFor: inputId, className: checkboxClasses, children: renderIcon() }),
|
|
465
|
+
label && /* @__PURE__ */ jsx7(
|
|
466
|
+
"div",
|
|
467
|
+
{
|
|
468
|
+
className: `flex flex-row items-center ${sizeClasses.labelHeight}`,
|
|
469
|
+
children: /* @__PURE__ */ jsx7(
|
|
470
|
+
Text,
|
|
471
|
+
{
|
|
472
|
+
as: "label",
|
|
473
|
+
htmlFor: inputId,
|
|
474
|
+
size: sizeClasses.textSize,
|
|
475
|
+
weight: "normal",
|
|
476
|
+
color: "black",
|
|
477
|
+
className: `cursor-pointer select-none leading-[150%] flex items-center font-roboto ${labelClassName}`,
|
|
478
|
+
children: label
|
|
479
|
+
}
|
|
480
|
+
)
|
|
481
|
+
}
|
|
482
|
+
)
|
|
483
|
+
]
|
|
484
|
+
}
|
|
485
|
+
),
|
|
486
|
+
errorMessage && /* @__PURE__ */ jsx7(Text, { size: "sm", weight: "normal", className: "mt-1.5 text-error-600", children: errorMessage }),
|
|
487
|
+
helperText && !errorMessage && /* @__PURE__ */ jsx7(Text, { size: "sm", weight: "normal", className: "mt-1.5 text-text-500", children: helperText })
|
|
488
|
+
] });
|
|
489
|
+
}
|
|
490
|
+
);
|
|
491
|
+
CheckBox.displayName = "CheckBox";
|
|
492
|
+
|
|
493
|
+
// src/components/Table/Table.tsx
|
|
494
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
495
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
496
|
+
var Table = forwardRef3(
|
|
497
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx8("div", { className: "border border-border-200 rounded-xl relative w-full overflow-hidden", children: /* @__PURE__ */ jsxs5(
|
|
214
498
|
"table",
|
|
215
499
|
{
|
|
216
500
|
ref,
|
|
217
501
|
className: `w-full caption-bottom text-sm ${className ?? ""}`,
|
|
218
502
|
...props,
|
|
219
503
|
children: [
|
|
220
|
-
/* @__PURE__ */
|
|
504
|
+
/* @__PURE__ */ jsx8("caption", { className: "sr-only", children: "My Table" }),
|
|
221
505
|
children
|
|
222
506
|
]
|
|
223
507
|
}
|
|
224
508
|
) })
|
|
225
509
|
);
|
|
226
510
|
Table.displayName = "Table";
|
|
227
|
-
var TableHeader =
|
|
511
|
+
var TableHeader = forwardRef3(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
228
512
|
"thead",
|
|
229
513
|
{
|
|
230
514
|
ref,
|
|
@@ -233,7 +517,7 @@ var TableHeader = forwardRef2(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
233
517
|
}
|
|
234
518
|
));
|
|
235
519
|
TableHeader.displayName = "TableHeader";
|
|
236
|
-
var TableBody =
|
|
520
|
+
var TableBody = forwardRef3(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
237
521
|
"tbody",
|
|
238
522
|
{
|
|
239
523
|
ref,
|
|
@@ -242,7 +526,7 @@ var TableBody = forwardRef2(({ className, ...props }, ref) => /* @__PURE__ */ js
|
|
|
242
526
|
}
|
|
243
527
|
));
|
|
244
528
|
TableBody.displayName = "TableBody";
|
|
245
|
-
var TableFooter =
|
|
529
|
+
var TableFooter = forwardRef3(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
246
530
|
"tfoot",
|
|
247
531
|
{
|
|
248
532
|
ref,
|
|
@@ -257,9 +541,9 @@ var VARIANT_STATES_ROW = {
|
|
|
257
541
|
invalid: "border-b-2 border-indicator-error",
|
|
258
542
|
disabled: "border-b border-border-100 bg-background-50 opacity-50 cursor-not-allowed"
|
|
259
543
|
};
|
|
260
|
-
var TableRow =
|
|
544
|
+
var TableRow = forwardRef3(
|
|
261
545
|
({ state = "default", className, ...props }, ref) => {
|
|
262
|
-
return /* @__PURE__ */
|
|
546
|
+
return /* @__PURE__ */ jsx8(
|
|
263
547
|
"tr",
|
|
264
548
|
{
|
|
265
549
|
ref,
|
|
@@ -276,7 +560,7 @@ var TableRow = forwardRef2(
|
|
|
276
560
|
}
|
|
277
561
|
);
|
|
278
562
|
TableRow.displayName = "TableRow";
|
|
279
|
-
var TableHead =
|
|
563
|
+
var TableHead = forwardRef3(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
280
564
|
"th",
|
|
281
565
|
{
|
|
282
566
|
ref,
|
|
@@ -285,7 +569,7 @@ var TableHead = forwardRef2(({ className, ...props }, ref) => /* @__PURE__ */ js
|
|
|
285
569
|
}
|
|
286
570
|
));
|
|
287
571
|
TableHead.displayName = "TableHead";
|
|
288
|
-
var TableCell =
|
|
572
|
+
var TableCell = forwardRef3(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
289
573
|
"td",
|
|
290
574
|
{
|
|
291
575
|
ref,
|
|
@@ -294,7 +578,7 @@ var TableCell = forwardRef2(({ className, ...props }, ref) => /* @__PURE__ */ js
|
|
|
294
578
|
}
|
|
295
579
|
));
|
|
296
580
|
TableCell.displayName = "TableCell";
|
|
297
|
-
var TableCaption =
|
|
581
|
+
var TableCaption = forwardRef3(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
298
582
|
"caption",
|
|
299
583
|
{
|
|
300
584
|
ref,
|
|
@@ -307,20 +591,20 @@ TableCaption.displayName = "TableCaption";
|
|
|
307
591
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
308
592
|
import {
|
|
309
593
|
createContext,
|
|
310
|
-
useState,
|
|
594
|
+
useState as useState2,
|
|
311
595
|
useCallback,
|
|
312
596
|
useContext,
|
|
313
|
-
forwardRef as
|
|
597
|
+
forwardRef as forwardRef4,
|
|
314
598
|
useEffect,
|
|
315
599
|
useRef,
|
|
316
600
|
useMemo
|
|
317
601
|
} from "react";
|
|
318
|
-
import { jsx as
|
|
602
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
319
603
|
var DropdownMenuContext = createContext(
|
|
320
604
|
void 0
|
|
321
605
|
);
|
|
322
606
|
var DropdownMenu = ({ children, open, onOpenChange }) => {
|
|
323
|
-
const [internalOpen, setInternalOpen] =
|
|
607
|
+
const [internalOpen, setInternalOpen] = useState2(false);
|
|
324
608
|
const isControlled = open !== void 0;
|
|
325
609
|
const currentOpen = isControlled ? open : internalOpen;
|
|
326
610
|
const setOpen = useCallback(
|
|
@@ -355,14 +639,14 @@ var DropdownMenu = ({ children, open, onOpenChange }) => {
|
|
|
355
639
|
() => ({ open: currentOpen, setOpen }),
|
|
356
640
|
[currentOpen, setOpen]
|
|
357
641
|
);
|
|
358
|
-
return /* @__PURE__ */
|
|
642
|
+
return /* @__PURE__ */ jsx9(DropdownMenuContext.Provider, { value, children: /* @__PURE__ */ jsx9("div", { className: "relative", ref: menuRef, children }) });
|
|
359
643
|
};
|
|
360
|
-
var DropdownMenuTrigger =
|
|
644
|
+
var DropdownMenuTrigger = forwardRef4(({ className, children, onClick, ...props }, ref) => {
|
|
361
645
|
const context = useContext(DropdownMenuContext);
|
|
362
646
|
if (!context)
|
|
363
647
|
throw new Error("DropdownMenuTrigger must be used within a DropdownMenu");
|
|
364
648
|
const { open, setOpen } = context;
|
|
365
|
-
return /* @__PURE__ */
|
|
649
|
+
return /* @__PURE__ */ jsx9(
|
|
366
650
|
"button",
|
|
367
651
|
{
|
|
368
652
|
ref,
|
|
@@ -394,7 +678,7 @@ var ALIGN_CLASSES = {
|
|
|
394
678
|
center: "left-1/2 -translate-x-1/2",
|
|
395
679
|
end: "right-0"
|
|
396
680
|
};
|
|
397
|
-
var MenuLabel =
|
|
681
|
+
var MenuLabel = forwardRef4(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
398
682
|
"fieldset",
|
|
399
683
|
{
|
|
400
684
|
ref,
|
|
@@ -404,7 +688,7 @@ var MenuLabel = forwardRef3(({ className, inset, ...props }, ref) => /* @__PURE_
|
|
|
404
688
|
}
|
|
405
689
|
));
|
|
406
690
|
MenuLabel.displayName = "MenuLabel";
|
|
407
|
-
var MenuContent =
|
|
691
|
+
var MenuContent = forwardRef4(
|
|
408
692
|
({
|
|
409
693
|
className,
|
|
410
694
|
align = "start",
|
|
@@ -414,7 +698,7 @@ var MenuContent = forwardRef3(
|
|
|
414
698
|
...props
|
|
415
699
|
}, ref) => {
|
|
416
700
|
const { open } = useContext(DropdownMenuContext);
|
|
417
|
-
const [isVisible, setIsVisible] =
|
|
701
|
+
const [isVisible, setIsVisible] = useState2(open);
|
|
418
702
|
useEffect(() => {
|
|
419
703
|
if (open) {
|
|
420
704
|
setIsVisible(true);
|
|
@@ -429,7 +713,7 @@ var MenuContent = forwardRef3(
|
|
|
429
713
|
const horizontal = ALIGN_CLASSES[align];
|
|
430
714
|
return `absolute ${vertical} ${horizontal}`;
|
|
431
715
|
};
|
|
432
|
-
return /* @__PURE__ */
|
|
716
|
+
return /* @__PURE__ */ jsx9(
|
|
433
717
|
"div",
|
|
434
718
|
{
|
|
435
719
|
ref,
|
|
@@ -453,7 +737,7 @@ var MenuContent = forwardRef3(
|
|
|
453
737
|
}
|
|
454
738
|
);
|
|
455
739
|
MenuContent.displayName = "MenuContent";
|
|
456
|
-
var MenuItem =
|
|
740
|
+
var MenuItem = forwardRef4(
|
|
457
741
|
({
|
|
458
742
|
className,
|
|
459
743
|
inset,
|
|
@@ -474,7 +758,7 @@ var MenuItem = forwardRef3(
|
|
|
474
758
|
}
|
|
475
759
|
onClick?.(e);
|
|
476
760
|
};
|
|
477
|
-
return /* @__PURE__ */
|
|
761
|
+
return /* @__PURE__ */ jsxs6(
|
|
478
762
|
"div",
|
|
479
763
|
{
|
|
480
764
|
ref,
|
|
@@ -503,7 +787,7 @@ var MenuItem = forwardRef3(
|
|
|
503
787
|
}
|
|
504
788
|
);
|
|
505
789
|
MenuItem.displayName = "MenuItem";
|
|
506
|
-
var MenuSeparator =
|
|
790
|
+
var MenuSeparator = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
507
791
|
"div",
|
|
508
792
|
{
|
|
509
793
|
ref,
|
|
@@ -514,9 +798,9 @@ var MenuSeparator = forwardRef3(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
514
798
|
MenuSeparator.displayName = "MenuSeparator";
|
|
515
799
|
|
|
516
800
|
// src/components/NavButton/NavButton.tsx
|
|
517
|
-
import { forwardRef as
|
|
518
|
-
import { jsx as
|
|
519
|
-
var NavButton =
|
|
801
|
+
import { forwardRef as forwardRef5 } from "react";
|
|
802
|
+
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
803
|
+
var NavButton = forwardRef5(
|
|
520
804
|
({ icon, label, selected = false, className = "", disabled, ...props }, ref) => {
|
|
521
805
|
const baseClasses = [
|
|
522
806
|
"flex",
|
|
@@ -543,7 +827,7 @@ var NavButton = forwardRef4(
|
|
|
543
827
|
];
|
|
544
828
|
const stateClasses = selected ? ["bg-primary-50", "text-primary-950"] : [];
|
|
545
829
|
const allClasses = [...baseClasses, ...stateClasses].join(" ");
|
|
546
|
-
return /* @__PURE__ */
|
|
830
|
+
return /* @__PURE__ */ jsxs7(
|
|
547
831
|
"button",
|
|
548
832
|
{
|
|
549
833
|
ref,
|
|
@@ -553,8 +837,8 @@ var NavButton = forwardRef4(
|
|
|
553
837
|
"aria-pressed": selected,
|
|
554
838
|
...props,
|
|
555
839
|
children: [
|
|
556
|
-
/* @__PURE__ */
|
|
557
|
-
/* @__PURE__ */
|
|
840
|
+
/* @__PURE__ */ jsx10("span", { className: "flex items-center justify-center w-5 h-5", children: icon }),
|
|
841
|
+
/* @__PURE__ */ jsx10("span", { className: "whitespace-nowrap", children: label })
|
|
558
842
|
]
|
|
559
843
|
}
|
|
560
844
|
);
|
|
@@ -563,9 +847,9 @@ var NavButton = forwardRef4(
|
|
|
563
847
|
NavButton.displayName = "NavButton";
|
|
564
848
|
|
|
565
849
|
// src/components/IconButton/IconButton.tsx
|
|
566
|
-
import { forwardRef as
|
|
567
|
-
import { jsx as
|
|
568
|
-
var IconButton =
|
|
850
|
+
import { forwardRef as forwardRef6 } from "react";
|
|
851
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
852
|
+
var IconButton = forwardRef6(
|
|
569
853
|
({ icon, size = "md", active = false, className = "", disabled, ...props }, ref) => {
|
|
570
854
|
const baseClasses = [
|
|
571
855
|
"inline-flex",
|
|
@@ -597,7 +881,7 @@ var IconButton = forwardRef5(
|
|
|
597
881
|
...activeClasses
|
|
598
882
|
].join(" ");
|
|
599
883
|
const ariaLabel = props["aria-label"] ?? "Bot\xE3o de a\xE7\xE3o";
|
|
600
|
-
return /* @__PURE__ */
|
|
884
|
+
return /* @__PURE__ */ jsx11(
|
|
601
885
|
"button",
|
|
602
886
|
{
|
|
603
887
|
ref,
|
|
@@ -607,7 +891,7 @@ var IconButton = forwardRef5(
|
|
|
607
891
|
"aria-pressed": active,
|
|
608
892
|
"aria-label": ariaLabel,
|
|
609
893
|
...props,
|
|
610
|
-
children: /* @__PURE__ */
|
|
894
|
+
children: /* @__PURE__ */ jsx11("span", { className: "flex items-center justify-center", children: icon })
|
|
611
895
|
}
|
|
612
896
|
);
|
|
613
897
|
}
|
|
@@ -615,6 +899,7 @@ var IconButton = forwardRef5(
|
|
|
615
899
|
IconButton.displayName = "IconButton";
|
|
616
900
|
export {
|
|
617
901
|
Button,
|
|
902
|
+
CheckBox,
|
|
618
903
|
DropdownMenu,
|
|
619
904
|
DropdownMenuTrigger,
|
|
620
905
|
IconButton,
|
|
@@ -633,5 +918,9 @@ export {
|
|
|
633
918
|
TableHead,
|
|
634
919
|
TableHeader,
|
|
635
920
|
TableRow,
|
|
636
|
-
Text
|
|
921
|
+
Text,
|
|
922
|
+
Toast,
|
|
923
|
+
Toaster,
|
|
924
|
+
useToast,
|
|
925
|
+
useToastStore
|
|
637
926
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "analytica-frontend-lib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.18",
|
|
4
4
|
"description": "Repositório público dos componentes utilizados nas plataformas da Analytica Ensino",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -64,7 +64,10 @@
|
|
|
64
64
|
"react-dom": ">=19.0.0"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"phosphor-react": "^1.4.1"
|
|
67
|
+
"phosphor-react": "^1.4.1",
|
|
68
|
+
"react": "^19.1.0",
|
|
69
|
+
"react-dom": "^19.1.0",
|
|
70
|
+
"zustand": "^5.0.5"
|
|
68
71
|
},
|
|
69
72
|
"devDependencies": {
|
|
70
73
|
"@eslint/eslintrc": "^3.3.1",
|