analytica-frontend-lib 1.0.27 → 1.0.29
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 → index.d.mts} +1 -1
- package/dist/Alert/{Alert.d.ts → index.d.ts} +1 -1
- package/dist/Alert/{Alert.js → index.js} +6 -7
- package/dist/Alert/index.js.map +1 -0
- package/dist/Alert/{Alert.mjs → index.mjs} +67 -16
- package/dist/Alert/index.mjs.map +1 -0
- package/dist/Badge/{Badge.d.mts → index.d.mts} +1 -1
- package/dist/Badge/{Badge.d.ts → index.d.ts} +1 -1
- package/dist/Badge/{Badge.js → index.js} +3 -5
- package/dist/Badge/index.js.map +1 -0
- package/dist/Badge/{Badge.mjs → index.mjs} +3 -1
- package/dist/Badge/index.mjs.map +1 -0
- package/dist/Button/{Button.d.ts → index.d.mts} +1 -1
- package/dist/Button/{Button.d.mts → index.d.ts} +1 -1
- package/dist/Button/{Button.js → index.js} +3 -5
- package/dist/Button/index.js.map +1 -0
- package/dist/Button/{Button.mjs → index.mjs} +3 -1
- package/dist/Button/index.mjs.map +1 -0
- package/dist/CheckBox/{CheckBox.d.mts → index.d.mts} +1 -1
- package/dist/CheckBox/{CheckBox.d.ts → index.d.ts} +1 -1
- package/dist/CheckBox/{CheckBox.js → index.js} +7 -8
- package/dist/CheckBox/index.js.map +1 -0
- package/dist/CheckBox/{CheckBox.mjs → index.mjs} +68 -16
- package/dist/CheckBox/index.mjs.map +1 -0
- package/dist/DropdownMenu/{DropdownMenu.d.mts → index.d.mts} +1 -1
- package/dist/DropdownMenu/{DropdownMenu.d.ts → index.d.ts} +1 -1
- package/dist/DropdownMenu/{DropdownMenu.js → index.js} +4 -3
- package/dist/DropdownMenu/index.js.map +1 -0
- package/dist/DropdownMenu/{DropdownMenu.mjs → index.mjs} +4 -2
- package/dist/DropdownMenu/index.mjs.map +1 -0
- package/dist/IconButton/{IconButton.d.mts → index.d.mts} +1 -1
- package/dist/IconButton/{IconButton.d.ts → index.d.ts} +1 -1
- package/dist/IconButton/{IconButton.js → index.js} +3 -5
- package/dist/IconButton/index.js.map +1 -0
- package/dist/IconButton/{IconButton.mjs → index.mjs} +3 -1
- package/dist/IconButton/index.mjs.map +1 -0
- package/dist/IconRoundedButton/{IconRoundedButton.d.mts → index.d.mts} +1 -1
- package/dist/IconRoundedButton/{IconRoundedButton.d.ts → index.d.ts} +1 -1
- package/dist/IconRoundedButton/{IconRoundedButton.js → index.js} +3 -5
- package/dist/IconRoundedButton/index.js.map +1 -0
- package/dist/IconRoundedButton/{IconRoundedButton.mjs → index.mjs} +3 -1
- package/dist/IconRoundedButton/index.mjs.map +1 -0
- package/dist/NavButton/{NavButton.d.mts → index.d.mts} +1 -1
- package/dist/NavButton/{NavButton.d.ts → index.d.ts} +1 -1
- package/dist/NavButton/{NavButton.js → index.js} +3 -5
- package/dist/NavButton/index.js.map +1 -0
- package/dist/NavButton/{NavButton.mjs → index.mjs} +3 -1
- package/dist/NavButton/index.mjs.map +1 -0
- package/dist/SelectionButton/{SelectionButton.d.mts → index.d.mts} +1 -1
- package/dist/SelectionButton/{SelectionButton.d.ts → index.d.ts} +1 -1
- package/dist/SelectionButton/{SelectionButton.js → index.js} +3 -5
- package/dist/SelectionButton/index.js.map +1 -0
- package/dist/SelectionButton/{SelectionButton.mjs → index.mjs} +3 -1
- package/dist/SelectionButton/index.mjs.map +1 -0
- package/dist/Table/{Table.d.mts → index.d.mts} +1 -1
- package/dist/Table/{Table.d.ts → index.d.ts} +1 -1
- package/dist/Table/{Table.js → index.js} +4 -3
- package/dist/Table/index.js.map +1 -0
- package/dist/Table/{Table.mjs → index.mjs} +4 -2
- package/dist/Table/index.mjs.map +1 -0
- package/dist/Text/{Text.d.mts → index.d.mts} +1 -1
- package/dist/Text/{Text.d.ts → index.d.ts} +1 -1
- package/dist/Text/{Text.js → index.js} +3 -5
- package/dist/Text/index.js.map +1 -0
- package/dist/{chunk-TT3VCQGR.mjs → Text/index.mjs} +3 -2
- package/dist/Text/index.mjs.map +1 -0
- package/dist/TextArea/{TextArea.d.mts → index.d.mts} +1 -1
- package/dist/TextArea/{TextArea.d.ts → index.d.ts} +1 -1
- package/dist/TextArea/{TextArea.js → index.js} +7 -8
- package/dist/TextArea/index.js.map +1 -0
- package/dist/TextArea/{TextArea.mjs → index.mjs} +62 -10
- package/dist/TextArea/index.mjs.map +1 -0
- package/dist/Toast/{utils/ToastStore.d.mts → ToastStore/index.d.mts} +1 -1
- package/dist/Toast/{utils/ToastStore.d.ts → ToastStore/index.d.ts} +1 -1
- package/dist/Toast/{utils/ToastStore.js → ToastStore/index.js} +3 -5
- package/dist/Toast/ToastStore/index.js.map +1 -0
- package/dist/{chunk-WIOCQOM7.mjs → Toast/ToastStore/index.mjs} +3 -2
- package/dist/Toast/ToastStore/index.mjs.map +1 -0
- package/dist/Toast/{utils/Toaster.d.mts → Toaster/index.d.mts} +2 -2
- package/dist/Toast/{utils/Toaster.d.ts → Toaster/index.d.ts} +2 -2
- package/dist/Toast/{utils/Toaster.js → Toaster/index.js} +10 -7
- package/dist/Toast/Toaster/index.js.map +1 -0
- package/dist/Toast/Toaster/index.mjs +122 -0
- package/dist/Toast/Toaster/index.mjs.map +1 -0
- package/dist/Toast/{Toast.d.mts → index.d.mts} +1 -1
- package/dist/Toast/{Toast.d.ts → index.d.ts} +1 -1
- package/dist/Toast/{Toast.js → index.js} +3 -5
- package/dist/Toast/index.js.map +1 -0
- package/dist/{chunk-XJA5HF7B.mjs → Toast/index.mjs} +5 -2
- package/dist/Toast/index.mjs.map +1 -0
- package/dist/index.css +1 -3
- package/dist/index.css.map +1 -0
- package/dist/index.d.mts +18 -507
- package/dist/index.d.ts +18 -507
- package/dist/index.js +157 -141
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +154 -138
- package/dist/index.mjs.map +1 -0
- package/dist/styles.css +1 -3
- package/dist/styles.css.map +1 -0
- package/dist/styles.d.mts +2 -0
- package/dist/styles.d.ts +2 -0
- package/package.json +26 -86
- package/dist/Text/Text.mjs +0 -6
- package/dist/Toast/Toast.mjs +0 -7
- package/dist/Toast/utils/ToastStore.mjs +0 -6
- package/dist/Toast/utils/Toaster.mjs +0 -35
package/dist/index.mjs
CHANGED
|
@@ -47,6 +47,7 @@ var Text = ({
|
|
|
47
47
|
}
|
|
48
48
|
);
|
|
49
49
|
};
|
|
50
|
+
var Text_default = Text;
|
|
50
51
|
|
|
51
52
|
// src/components/Button/Button.tsx
|
|
52
53
|
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
@@ -104,6 +105,7 @@ var Button = ({
|
|
|
104
105
|
}
|
|
105
106
|
);
|
|
106
107
|
};
|
|
108
|
+
var Button_default = Button;
|
|
107
109
|
|
|
108
110
|
// src/components/Badge/Badge.tsx
|
|
109
111
|
import { Bell } from "phosphor-react";
|
|
@@ -194,6 +196,7 @@ var Badge = ({
|
|
|
194
196
|
}
|
|
195
197
|
);
|
|
196
198
|
};
|
|
199
|
+
var Badge_default = Badge;
|
|
197
200
|
|
|
198
201
|
// src/components/Alert/Alert.tsx
|
|
199
202
|
import { CheckCircle, Info, WarningCircle, XCircle } from "phosphor-react";
|
|
@@ -250,7 +253,7 @@ var Alert = ({
|
|
|
250
253
|
/* @__PURE__ */ jsx4("span", { className: `mt-0.5 ${variantColor}`, children: variantIcon }),
|
|
251
254
|
/* @__PURE__ */ jsxs3("div", { children: [
|
|
252
255
|
hasHeading && /* @__PURE__ */ jsx4(
|
|
253
|
-
|
|
256
|
+
Text_default,
|
|
254
257
|
{
|
|
255
258
|
size: "md",
|
|
256
259
|
weight: "medium",
|
|
@@ -260,7 +263,7 @@ var Alert = ({
|
|
|
260
263
|
}
|
|
261
264
|
),
|
|
262
265
|
/* @__PURE__ */ jsx4(
|
|
263
|
-
|
|
266
|
+
Text_default,
|
|
264
267
|
{
|
|
265
268
|
size: hasHeading ? "sm" : "md",
|
|
266
269
|
weight: "normal",
|
|
@@ -273,6 +276,7 @@ var Alert = ({
|
|
|
273
276
|
}
|
|
274
277
|
);
|
|
275
278
|
};
|
|
279
|
+
var Alert_default = Alert;
|
|
276
280
|
|
|
277
281
|
// src/components/IconButton/IconButton.tsx
|
|
278
282
|
import { forwardRef } from "react";
|
|
@@ -325,6 +329,7 @@ var IconButton = forwardRef(
|
|
|
325
329
|
}
|
|
326
330
|
);
|
|
327
331
|
IconButton.displayName = "IconButton";
|
|
332
|
+
var IconButton_default = IconButton;
|
|
328
333
|
|
|
329
334
|
// src/components/IconRoundedButton/IconRoundedButton.tsx
|
|
330
335
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
@@ -366,6 +371,7 @@ var IconRoundedButton = ({
|
|
|
366
371
|
}
|
|
367
372
|
);
|
|
368
373
|
};
|
|
374
|
+
var IconRoundedButton_default = IconRoundedButton;
|
|
369
375
|
|
|
370
376
|
// src/components/NavButton/NavButton.tsx
|
|
371
377
|
import { forwardRef as forwardRef2 } from "react";
|
|
@@ -415,6 +421,7 @@ var NavButton = forwardRef2(
|
|
|
415
421
|
}
|
|
416
422
|
);
|
|
417
423
|
NavButton.displayName = "NavButton";
|
|
424
|
+
var NavButton_default = NavButton;
|
|
418
425
|
|
|
419
426
|
// src/components/SelectionButton/SelectionButton.tsx
|
|
420
427
|
import { forwardRef as forwardRef3 } from "react";
|
|
@@ -469,6 +476,7 @@ var SelectionButton = forwardRef3(
|
|
|
469
476
|
}
|
|
470
477
|
);
|
|
471
478
|
SelectionButton.displayName = "SelectionButton";
|
|
479
|
+
var SelectionButton_default = SelectionButton;
|
|
472
480
|
|
|
473
481
|
// src/components/Table/Table.tsx
|
|
474
482
|
import { forwardRef as forwardRef4 } from "react";
|
|
@@ -567,6 +575,7 @@ var TableCaption = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
567
575
|
}
|
|
568
576
|
));
|
|
569
577
|
TableCaption.displayName = "TableCaption";
|
|
578
|
+
var Table_default = Table;
|
|
570
579
|
|
|
571
580
|
// src/components/CheckBox/CheckBox.tsx
|
|
572
581
|
import {
|
|
@@ -716,7 +725,7 @@ var CheckBox = forwardRef5(
|
|
|
716
725
|
{
|
|
717
726
|
className: `flex flex-row items-center ${sizeClasses.labelHeight}`,
|
|
718
727
|
children: /* @__PURE__ */ jsx10(
|
|
719
|
-
|
|
728
|
+
Text_default,
|
|
720
729
|
{
|
|
721
730
|
as: "label",
|
|
722
731
|
htmlFor: inputId,
|
|
@@ -732,7 +741,7 @@ var CheckBox = forwardRef5(
|
|
|
732
741
|
}
|
|
733
742
|
),
|
|
734
743
|
errorMessage && /* @__PURE__ */ jsx10(
|
|
735
|
-
|
|
744
|
+
Text_default,
|
|
736
745
|
{
|
|
737
746
|
size: "sm",
|
|
738
747
|
weight: "normal",
|
|
@@ -742,7 +751,7 @@ var CheckBox = forwardRef5(
|
|
|
742
751
|
}
|
|
743
752
|
),
|
|
744
753
|
helperText && !errorMessage && /* @__PURE__ */ jsx10(
|
|
745
|
-
|
|
754
|
+
Text_default,
|
|
746
755
|
{
|
|
747
756
|
size: "sm",
|
|
748
757
|
weight: "normal",
|
|
@@ -755,6 +764,7 @@ var CheckBox = forwardRef5(
|
|
|
755
764
|
}
|
|
756
765
|
);
|
|
757
766
|
CheckBox.displayName = "CheckBox";
|
|
767
|
+
var CheckBox_default = CheckBox;
|
|
758
768
|
|
|
759
769
|
// src/components/TextArea/TextArea.tsx
|
|
760
770
|
import {
|
|
@@ -859,7 +869,7 @@ var TextArea = forwardRef6(
|
|
|
859
869
|
const textareaClasses = `${BASE_TEXTAREA_CLASSES} ${sizeClasses.textarea} ${stateClasses.base} ${stateClasses.hover} ${stateClasses.focus} ${className}`;
|
|
860
870
|
return /* @__PURE__ */ jsxs8("div", { className: `flex flex-col ${sizeClasses.container}`, children: [
|
|
861
871
|
label && /* @__PURE__ */ jsx11(
|
|
862
|
-
|
|
872
|
+
Text_default,
|
|
863
873
|
{
|
|
864
874
|
as: "label",
|
|
865
875
|
htmlFor: inputId,
|
|
@@ -884,12 +894,124 @@ var TextArea = forwardRef6(
|
|
|
884
894
|
...props
|
|
885
895
|
}
|
|
886
896
|
),
|
|
887
|
-
errorMessage && /* @__PURE__ */ jsx11(
|
|
888
|
-
helperMessage && !errorMessage && /* @__PURE__ */ jsx11(
|
|
897
|
+
errorMessage && /* @__PURE__ */ jsx11(Text_default, { size: "sm", weight: "normal", className: "mt-1.5 text-error-600", children: errorMessage }),
|
|
898
|
+
helperMessage && !errorMessage && /* @__PURE__ */ jsx11(Text_default, { size: "sm", weight: "normal", className: "mt-1.5 text-text-500", children: helperMessage })
|
|
889
899
|
] });
|
|
890
900
|
}
|
|
891
901
|
);
|
|
892
902
|
TextArea.displayName = "TextArea";
|
|
903
|
+
var TextArea_default = TextArea;
|
|
904
|
+
|
|
905
|
+
// src/components/Toast/Toast.tsx
|
|
906
|
+
import { CheckCircle as CheckCircle2, WarningCircle as WarningCircle2, Info as Info2, X } from "phosphor-react";
|
|
907
|
+
import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
908
|
+
var VARIANT_ACTION_CLASSES4 = {
|
|
909
|
+
solid: {
|
|
910
|
+
warning: "bg-warning text-warning-600 border-none focus-visible:outline-none",
|
|
911
|
+
success: "bg-success text-success-800 border-none focus-visible:outline-none",
|
|
912
|
+
info: "bg-info text-info-600 border-none focus-visible:outline-none"
|
|
913
|
+
},
|
|
914
|
+
outlined: {
|
|
915
|
+
warning: "bg-warning text-warning-600 border border-warning-300 focus-visible:outline-none",
|
|
916
|
+
success: "bg-success text-success-800 border border-success-200 focus-visible:outline-none",
|
|
917
|
+
info: "bg-info text-info-600 border border-info-600 focus-visible:outline-none"
|
|
918
|
+
}
|
|
919
|
+
};
|
|
920
|
+
var iconMap = {
|
|
921
|
+
success: CheckCircle2,
|
|
922
|
+
info: Info2,
|
|
923
|
+
warning: WarningCircle2
|
|
924
|
+
};
|
|
925
|
+
var Toast = ({
|
|
926
|
+
variant = "outlined",
|
|
927
|
+
action = "success",
|
|
928
|
+
className = "",
|
|
929
|
+
onClose,
|
|
930
|
+
title,
|
|
931
|
+
description,
|
|
932
|
+
position = "default",
|
|
933
|
+
...props
|
|
934
|
+
}) => {
|
|
935
|
+
const variantClasses = VARIANT_ACTION_CLASSES4[variant][action];
|
|
936
|
+
const positionClasses = {
|
|
937
|
+
"top-left": "fixed top-4 left-4",
|
|
938
|
+
"top-center": "fixed top-4 left-1/2 transform -translate-x-1/2",
|
|
939
|
+
"top-right": "fixed top-4 right-4",
|
|
940
|
+
"bottom-left": "fixed bottom-4 left-4",
|
|
941
|
+
"bottom-center": "fixed bottom-4 left-1/2 transform -translate-x-1/2",
|
|
942
|
+
"bottom-right": "fixed bottom-4 right-4",
|
|
943
|
+
default: ""
|
|
944
|
+
};
|
|
945
|
+
const IconAction = iconMap[action] || iconMap["success"];
|
|
946
|
+
const baseClasses = "max-w-[390px] w-full flex flex-row items-start justify-between shadow-lg rounded-lg border p-4 gap-6 group";
|
|
947
|
+
return /* @__PURE__ */ jsxs9(
|
|
948
|
+
"div",
|
|
949
|
+
{
|
|
950
|
+
role: "alert",
|
|
951
|
+
"aria-live": "assertive",
|
|
952
|
+
"aria-atomic": "true",
|
|
953
|
+
className: `${baseClasses} ${positionClasses[position]} ${variantClasses} ${className}`,
|
|
954
|
+
...props,
|
|
955
|
+
children: [
|
|
956
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex flex-row items-start gap-3", children: [
|
|
957
|
+
/* @__PURE__ */ jsx12("span", { className: "mt-1", "data-testid": `toast-icon-${action}`, children: /* @__PURE__ */ jsx12(IconAction, {}) }),
|
|
958
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex flex-col items-start justify-start", children: [
|
|
959
|
+
/* @__PURE__ */ jsx12("p", { className: "font-semibold text-md", children: title }),
|
|
960
|
+
description && /* @__PURE__ */ jsx12("p", { className: "text-md text-text-900", children: description })
|
|
961
|
+
] })
|
|
962
|
+
] }),
|
|
963
|
+
/* @__PURE__ */ jsx12(
|
|
964
|
+
"button",
|
|
965
|
+
{
|
|
966
|
+
onClick: onClose,
|
|
967
|
+
"aria-label": "Dismiss notification",
|
|
968
|
+
className: "text-background-500 cursor-pointer opacity-0 group-hover:opacity-100 transition-opacity",
|
|
969
|
+
children: /* @__PURE__ */ jsx12(X, {})
|
|
970
|
+
}
|
|
971
|
+
)
|
|
972
|
+
]
|
|
973
|
+
}
|
|
974
|
+
);
|
|
975
|
+
};
|
|
976
|
+
var Toast_default = Toast;
|
|
977
|
+
|
|
978
|
+
// src/components/Toast/utils/ToastStore.ts
|
|
979
|
+
import { create } from "zustand";
|
|
980
|
+
var useToastStore = create((set) => ({
|
|
981
|
+
toasts: [],
|
|
982
|
+
addToast: (toast) => {
|
|
983
|
+
const id = crypto.randomUUID();
|
|
984
|
+
set((state) => ({
|
|
985
|
+
toasts: [...state.toasts, { id, ...toast }]
|
|
986
|
+
}));
|
|
987
|
+
},
|
|
988
|
+
removeToast: (id) => {
|
|
989
|
+
set((state) => ({
|
|
990
|
+
toasts: state.toasts.filter((t) => t.id !== id)
|
|
991
|
+
}));
|
|
992
|
+
}
|
|
993
|
+
}));
|
|
994
|
+
var ToastStore_default = useToastStore;
|
|
995
|
+
|
|
996
|
+
// src/components/Toast/utils/Toaster.tsx
|
|
997
|
+
import { Fragment, jsx as jsx13 } from "react/jsx-runtime";
|
|
998
|
+
var Toaster = () => {
|
|
999
|
+
const toasts = ToastStore_default((state) => state.toasts);
|
|
1000
|
+
const removeToast = ToastStore_default((state) => state.removeToast);
|
|
1001
|
+
return /* @__PURE__ */ jsx13(Fragment, { children: toasts.map((toast) => /* @__PURE__ */ jsx13(
|
|
1002
|
+
Toast_default,
|
|
1003
|
+
{
|
|
1004
|
+
title: toast.title,
|
|
1005
|
+
description: toast.description,
|
|
1006
|
+
variant: toast.variant,
|
|
1007
|
+
action: toast.action,
|
|
1008
|
+
position: toast.position,
|
|
1009
|
+
onClose: () => removeToast(toast.id)
|
|
1010
|
+
},
|
|
1011
|
+
toast.id
|
|
1012
|
+
)) });
|
|
1013
|
+
};
|
|
1014
|
+
var Toaster_default = Toaster;
|
|
893
1015
|
|
|
894
1016
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
895
1017
|
import {
|
|
@@ -902,7 +1024,7 @@ import {
|
|
|
902
1024
|
useRef,
|
|
903
1025
|
useMemo
|
|
904
1026
|
} from "react";
|
|
905
|
-
import { jsx as
|
|
1027
|
+
import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
906
1028
|
var DropdownMenuContext = createContext(
|
|
907
1029
|
void 0
|
|
908
1030
|
);
|
|
@@ -965,14 +1087,14 @@ var DropdownMenu = ({ children, open, onOpenChange }) => {
|
|
|
965
1087
|
() => ({ open: currentOpen, setOpen }),
|
|
966
1088
|
[currentOpen, setOpen]
|
|
967
1089
|
);
|
|
968
|
-
return /* @__PURE__ */
|
|
1090
|
+
return /* @__PURE__ */ jsx14(DropdownMenuContext.Provider, { value, children: /* @__PURE__ */ jsx14("div", { className: "relative", ref: menuRef, children }) });
|
|
969
1091
|
};
|
|
970
1092
|
var DropdownMenuTrigger = forwardRef7(({ className, children, onClick, ...props }, ref) => {
|
|
971
1093
|
const context = useContext(DropdownMenuContext);
|
|
972
1094
|
if (!context)
|
|
973
1095
|
throw new Error("DropdownMenuTrigger must be used within a DropdownMenu");
|
|
974
1096
|
const { open, setOpen } = context;
|
|
975
|
-
return /* @__PURE__ */
|
|
1097
|
+
return /* @__PURE__ */ jsx14(
|
|
976
1098
|
"button",
|
|
977
1099
|
{
|
|
978
1100
|
ref,
|
|
@@ -1004,7 +1126,7 @@ var ALIGN_CLASSES = {
|
|
|
1004
1126
|
center: "left-1/2 -translate-x-1/2",
|
|
1005
1127
|
end: "right-0"
|
|
1006
1128
|
};
|
|
1007
|
-
var MenuLabel = forwardRef7(({ className, inset, ...props }, ref) => /* @__PURE__ */
|
|
1129
|
+
var MenuLabel = forwardRef7(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
1008
1130
|
"fieldset",
|
|
1009
1131
|
{
|
|
1010
1132
|
ref,
|
|
@@ -1039,7 +1161,7 @@ var MenuContent = forwardRef7(
|
|
|
1039
1161
|
const horizontal = ALIGN_CLASSES[align];
|
|
1040
1162
|
return `absolute ${vertical} ${horizontal}`;
|
|
1041
1163
|
};
|
|
1042
|
-
return /* @__PURE__ */
|
|
1164
|
+
return /* @__PURE__ */ jsx14(
|
|
1043
1165
|
"div",
|
|
1044
1166
|
{
|
|
1045
1167
|
ref,
|
|
@@ -1084,7 +1206,7 @@ var MenuItem = forwardRef7(
|
|
|
1084
1206
|
}
|
|
1085
1207
|
onClick?.(e);
|
|
1086
1208
|
};
|
|
1087
|
-
return /* @__PURE__ */
|
|
1209
|
+
return /* @__PURE__ */ jsxs10(
|
|
1088
1210
|
"div",
|
|
1089
1211
|
{
|
|
1090
1212
|
ref,
|
|
@@ -1114,7 +1236,7 @@ var MenuItem = forwardRef7(
|
|
|
1114
1236
|
}
|
|
1115
1237
|
);
|
|
1116
1238
|
MenuItem.displayName = "MenuItem";
|
|
1117
|
-
var MenuSeparator = forwardRef7(({ className, ...props }, ref) => /* @__PURE__ */
|
|
1239
|
+
var MenuSeparator = forwardRef7(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
1118
1240
|
"div",
|
|
1119
1241
|
{
|
|
1120
1242
|
ref,
|
|
@@ -1123,133 +1245,27 @@ var MenuSeparator = forwardRef7(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
1123
1245
|
}
|
|
1124
1246
|
));
|
|
1125
1247
|
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";
|
|
1130
|
-
var VARIANT_ACTION_CLASSES4 = {
|
|
1131
|
-
solid: {
|
|
1132
|
-
warning: "bg-warning text-warning-600 border-none focus-visible:outline-none",
|
|
1133
|
-
success: "bg-success text-success-800 border-none focus-visible:outline-none",
|
|
1134
|
-
info: "bg-info text-info-600 border-none focus-visible:outline-none"
|
|
1135
|
-
},
|
|
1136
|
-
outlined: {
|
|
1137
|
-
warning: "bg-warning text-warning-600 border border-warning-300 focus-visible:outline-none",
|
|
1138
|
-
success: "bg-success text-success-800 border border-success-200 focus-visible:outline-none",
|
|
1139
|
-
info: "bg-info text-info-600 border border-info-600 focus-visible:outline-none"
|
|
1140
|
-
}
|
|
1141
|
-
};
|
|
1142
|
-
var iconMap = {
|
|
1143
|
-
success: CheckCircle2,
|
|
1144
|
-
info: Info2,
|
|
1145
|
-
warning: WarningCircle2
|
|
1146
|
-
};
|
|
1147
|
-
var Toast = ({
|
|
1148
|
-
variant = "outlined",
|
|
1149
|
-
action = "success",
|
|
1150
|
-
className = "",
|
|
1151
|
-
onClose,
|
|
1152
|
-
title,
|
|
1153
|
-
description,
|
|
1154
|
-
position = "default",
|
|
1155
|
-
...props
|
|
1156
|
-
}) => {
|
|
1157
|
-
const variantClasses = VARIANT_ACTION_CLASSES4[variant][action];
|
|
1158
|
-
const positionClasses = {
|
|
1159
|
-
"top-left": "fixed top-4 left-4",
|
|
1160
|
-
"top-center": "fixed top-4 left-1/2 transform -translate-x-1/2",
|
|
1161
|
-
"top-right": "fixed top-4 right-4",
|
|
1162
|
-
"bottom-left": "fixed bottom-4 left-4",
|
|
1163
|
-
"bottom-center": "fixed bottom-4 left-1/2 transform -translate-x-1/2",
|
|
1164
|
-
"bottom-right": "fixed bottom-4 right-4",
|
|
1165
|
-
default: ""
|
|
1166
|
-
};
|
|
1167
|
-
const IconAction = iconMap[action] || iconMap["success"];
|
|
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";
|
|
1169
|
-
return /* @__PURE__ */ jsxs10(
|
|
1170
|
-
"div",
|
|
1171
|
-
{
|
|
1172
|
-
role: "alert",
|
|
1173
|
-
"aria-live": "assertive",
|
|
1174
|
-
"aria-atomic": "true",
|
|
1175
|
-
className: `${baseClasses} ${positionClasses[position]} ${variantClasses} ${className}`,
|
|
1176
|
-
...props,
|
|
1177
|
-
children: [
|
|
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 })
|
|
1183
|
-
] })
|
|
1184
|
-
] }),
|
|
1185
|
-
/* @__PURE__ */ jsx13(
|
|
1186
|
-
"button",
|
|
1187
|
-
{
|
|
1188
|
-
onClick: onClose,
|
|
1189
|
-
"aria-label": "Dismiss notification",
|
|
1190
|
-
className: "text-background-500 cursor-pointer opacity-0 group-hover:opacity-100 transition-opacity",
|
|
1191
|
-
children: /* @__PURE__ */ jsx13(X, {})
|
|
1192
|
-
}
|
|
1193
|
-
)
|
|
1194
|
-
]
|
|
1195
|
-
}
|
|
1196
|
-
);
|
|
1197
|
-
};
|
|
1198
|
-
|
|
1199
|
-
// src/components/Toast/utils/ToastStore.ts
|
|
1200
|
-
import { create } from "zustand";
|
|
1201
|
-
var useToastStore = create((set) => ({
|
|
1202
|
-
toasts: [],
|
|
1203
|
-
addToast: (toast) => {
|
|
1204
|
-
const id = crypto.randomUUID();
|
|
1205
|
-
set((state) => ({
|
|
1206
|
-
toasts: [...state.toasts, { id, ...toast }]
|
|
1207
|
-
}));
|
|
1208
|
-
},
|
|
1209
|
-
removeToast: (id) => {
|
|
1210
|
-
set((state) => ({
|
|
1211
|
-
toasts: state.toasts.filter((t) => t.id !== id)
|
|
1212
|
-
}));
|
|
1213
|
-
}
|
|
1214
|
-
}));
|
|
1215
|
-
|
|
1216
|
-
// src/components/Toast/utils/Toaster.tsx
|
|
1217
|
-
import { Fragment, jsx as jsx14 } from "react/jsx-runtime";
|
|
1218
|
-
var Toaster = () => {
|
|
1219
|
-
const toasts = useToastStore((state) => state.toasts);
|
|
1220
|
-
const removeToast = useToastStore((state) => state.removeToast);
|
|
1221
|
-
return /* @__PURE__ */ jsx14(Fragment, { children: toasts.map((toast) => /* @__PURE__ */ jsx14(
|
|
1222
|
-
Toast,
|
|
1223
|
-
{
|
|
1224
|
-
title: toast.title,
|
|
1225
|
-
description: toast.description,
|
|
1226
|
-
variant: toast.variant,
|
|
1227
|
-
action: toast.action,
|
|
1228
|
-
position: toast.position,
|
|
1229
|
-
onClose: () => removeToast(toast.id)
|
|
1230
|
-
},
|
|
1231
|
-
toast.id
|
|
1232
|
-
)) });
|
|
1233
|
-
};
|
|
1248
|
+
var DropdownMenu_default = DropdownMenu;
|
|
1234
1249
|
export {
|
|
1235
|
-
Alert,
|
|
1236
|
-
Badge,
|
|
1237
|
-
Button,
|
|
1238
|
-
CheckBox,
|
|
1239
|
-
DropdownMenu,
|
|
1250
|
+
Alert_default as Alert,
|
|
1251
|
+
Badge_default as Badge,
|
|
1252
|
+
Button_default as Button,
|
|
1253
|
+
CheckBox_default as CheckBox,
|
|
1254
|
+
DropdownMenu_default as DropdownMenu,
|
|
1240
1255
|
MenuContent as DropdownMenuContent,
|
|
1241
1256
|
MenuItem as DropdownMenuItem,
|
|
1242
1257
|
MenuLabel as DropdownMenuLabel,
|
|
1243
1258
|
MenuSeparator as DropdownMenuSeparator,
|
|
1244
1259
|
DropdownMenuTrigger,
|
|
1245
|
-
IconButton,
|
|
1246
|
-
IconRoundedButton,
|
|
1247
|
-
NavButton,
|
|
1248
|
-
SelectionButton,
|
|
1249
|
-
Table,
|
|
1250
|
-
Text,
|
|
1251
|
-
TextArea,
|
|
1252
|
-
Toast,
|
|
1253
|
-
Toaster,
|
|
1254
|
-
useToastStore
|
|
1260
|
+
IconButton_default as IconButton,
|
|
1261
|
+
IconRoundedButton_default as IconRoundedButton,
|
|
1262
|
+
NavButton_default as NavButton,
|
|
1263
|
+
SelectionButton_default as SelectionButton,
|
|
1264
|
+
Table_default as Table,
|
|
1265
|
+
Text_default as Text,
|
|
1266
|
+
TextArea_default as TextArea,
|
|
1267
|
+
Toast_default as Toast,
|
|
1268
|
+
Toaster_default as Toaster,
|
|
1269
|
+
ToastStore_default as useToastStore
|
|
1255
1270
|
};
|
|
1271
|
+
//# sourceMappingURL=index.mjs.map
|