analytica-frontend-lib 1.0.22 → 1.0.24
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/chunk-CETSS3RA.mjs +52 -0
- package/dist/chunk-GSEO6POW.mjs +93 -0
- package/dist/chunk-IB4IJ3GF.mjs +60 -0
- package/dist/chunk-IH5TEC64.mjs +35 -0
- package/dist/chunk-JNPCNN67.mjs +86 -0
- package/dist/chunk-KT6HNGRV.mjs +241 -0
- package/dist/chunk-LYOJCBOM.mjs +195 -0
- package/dist/chunk-MI5FIRHM.mjs +75 -0
- package/dist/chunk-NWGRQN6R.mjs +108 -0
- package/dist/chunk-QODEDLAX.mjs +142 -0
- package/dist/chunk-QOFMTSHE.mjs +44 -0
- package/dist/chunk-RPYPJ5O5.mjs +55 -0
- package/dist/chunk-SESX5OEP.mjs +57 -0
- package/dist/chunk-TT3VCQGR.mjs +53 -0
- package/dist/chunk-WIOCQOM7.mjs +20 -0
- package/dist/client-components.d.mts +9 -0
- package/dist/client-components.d.ts +9 -0
- package/dist/client-components.js +755 -0
- package/dist/client-components.mjs +39 -0
- package/dist/components/Alert/Alert.d.mts +13 -0
- package/dist/components/Alert/Alert.d.ts +13 -0
- package/dist/components/Alert/Alert.js +158 -0
- package/dist/components/Alert/Alert.mjs +7 -0
- package/dist/components/Badge/Badge.d.mts +47 -0
- package/dist/components/Badge/Badge.d.ts +47 -0
- package/dist/components/Badge/Badge.js +117 -0
- package/dist/components/Badge/Badge.mjs +6 -0
- package/dist/components/Button/Button.d.mts +46 -0
- package/dist/components/Button/Button.d.ts +46 -0
- package/dist/components/Button/Button.js +84 -0
- package/dist/components/Button/Button.mjs +6 -0
- package/dist/components/CheckBox/CheckBox.d.mts +74 -0
- package/dist/components/CheckBox/CheckBox.d.ts +74 -0
- package/dist/components/CheckBox/CheckBox.js +264 -0
- package/dist/components/CheckBox/CheckBox.mjs +8 -0
- package/dist/components/DropdownMenu/DropdownMenu.d.mts +29 -0
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +29 -0
- package/dist/components/DropdownMenu/DropdownMenu.js +262 -0
- package/dist/components/DropdownMenu/DropdownMenu.mjs +17 -0
- package/dist/components/IconButton/IconButton.d.mts +77 -0
- package/dist/components/IconButton/IconButton.d.ts +77 -0
- package/dist/components/IconButton/IconButton.js +79 -0
- package/dist/components/IconButton/IconButton.mjs +6 -0
- package/dist/components/IconRoundedButton/IconRoundedButton.d.mts +35 -0
- package/dist/components/IconRoundedButton/IconRoundedButton.d.ts +35 -0
- package/dist/components/IconRoundedButton/IconRoundedButton.js +68 -0
- package/dist/components/IconRoundedButton/IconRoundedButton.mjs +6 -0
- package/dist/components/NavButton/NavButton.d.mts +58 -0
- package/dist/components/NavButton/NavButton.d.ts +58 -0
- package/dist/components/NavButton/NavButton.js +76 -0
- package/dist/components/NavButton/NavButton.mjs +6 -0
- package/dist/components/SelectionButton/SelectionButton.d.mts +58 -0
- package/dist/components/SelectionButton/SelectionButton.d.ts +58 -0
- package/dist/components/SelectionButton/SelectionButton.js +81 -0
- package/dist/components/SelectionButton/SelectionButton.mjs +6 -0
- package/dist/components/Table/Table.d.mts +17 -0
- package/dist/components/Table/Table.d.ts +17 -0
- package/dist/components/Table/Table.js +139 -0
- package/dist/components/Table/Table.mjs +20 -0
- package/dist/components/Text/Text.d.mts +59 -0
- package/dist/components/Text/Text.d.ts +59 -0
- package/dist/components/Text/Text.js +77 -0
- package/dist/components/Text/Text.mjs +6 -0
- package/dist/components/TextArea/TextArea.d.mts +69 -0
- package/dist/components/TextArea/TextArea.d.ts +69 -0
- package/dist/components/TextArea/TextArea.js +211 -0
- package/dist/components/TextArea/TextArea.mjs +8 -0
- package/dist/components/Toast/Toast.d.mts +17 -0
- package/dist/components/Toast/Toast.d.ts +17 -0
- package/dist/components/Toast/Toast.js +100 -0
- package/dist/components/Toast/Toast.mjs +7 -0
- package/dist/components/Toast/utils/ToastStore.d.mts +19 -0
- package/dist/components/Toast/utils/ToastStore.d.ts +19 -0
- package/dist/components/Toast/utils/ToastStore.js +44 -0
- package/dist/components/Toast/utils/ToastStore.mjs +6 -0
- package/dist/components/Toast/utils/Toaster.d.mts +11 -0
- package/dist/components/Toast/utils/Toaster.d.ts +11 -0
- package/dist/components/Toast/utils/Toaster.js +145 -0
- package/dist/components/Toast/utils/Toaster.mjs +11 -0
- package/dist/index.d.mts +168 -355
- package/dist/index.d.ts +168 -355
- package/dist/index.js +341 -936
- package/dist/index.mjs +340 -941
- package/dist/server-components.d.mts +11 -0
- package/dist/server-components.d.ts +11 -0
- package/dist/server-components.js +629 -0
- package/dist/server-components.mjs +52 -0
- package/package.json +76 -3
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as zustand from 'zustand';
|
|
2
|
+
|
|
3
|
+
type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | 'default';
|
|
4
|
+
type ToastData = {
|
|
5
|
+
id: string;
|
|
6
|
+
title: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
variant?: 'solid' | 'outlined';
|
|
9
|
+
action?: 'warning' | 'success' | 'info';
|
|
10
|
+
position?: ToastPosition;
|
|
11
|
+
};
|
|
12
|
+
type ToastStore = {
|
|
13
|
+
toasts: ToastData[];
|
|
14
|
+
addToast: (toast: Omit<ToastData, 'id'>) => void;
|
|
15
|
+
removeToast: (id: string) => void;
|
|
16
|
+
};
|
|
17
|
+
declare const useToastStore: zustand.UseBoundStore<zustand.StoreApi<ToastStore>>;
|
|
18
|
+
|
|
19
|
+
export { type ToastData, useToastStore };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/components/Toast/utils/ToastStore.ts
|
|
21
|
+
var ToastStore_exports = {};
|
|
22
|
+
__export(ToastStore_exports, {
|
|
23
|
+
useToastStore: () => useToastStore
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(ToastStore_exports);
|
|
26
|
+
var import_zustand = require("zustand");
|
|
27
|
+
var useToastStore = (0, import_zustand.create)((set) => ({
|
|
28
|
+
toasts: [],
|
|
29
|
+
addToast: (toast) => {
|
|
30
|
+
const id = crypto.randomUUID();
|
|
31
|
+
set((state) => ({
|
|
32
|
+
toasts: [...state.toasts, { id, ...toast }]
|
|
33
|
+
}));
|
|
34
|
+
},
|
|
35
|
+
removeToast: (id) => {
|
|
36
|
+
set((state) => ({
|
|
37
|
+
toasts: state.toasts.filter((t) => t.id !== id)
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
}));
|
|
41
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
+
0 && (module.exports = {
|
|
43
|
+
useToastStore
|
|
44
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ToastData } from './ToastStore.mjs';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import 'zustand';
|
|
4
|
+
|
|
5
|
+
declare const Toaster: () => react_jsx_runtime.JSX.Element;
|
|
6
|
+
declare const useToast: () => {
|
|
7
|
+
addToast: (toast: Omit<ToastData, "id">) => void;
|
|
8
|
+
removeToast: (id: string) => void;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { Toaster, useToast };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ToastData } from './ToastStore.js';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import 'zustand';
|
|
4
|
+
|
|
5
|
+
declare const Toaster: () => react_jsx_runtime.JSX.Element;
|
|
6
|
+
declare const useToast: () => {
|
|
7
|
+
addToast: (toast: Omit<ToastData, "id">) => void;
|
|
8
|
+
removeToast: (id: string) => void;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { Toaster, useToast };
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/components/Toast/utils/Toaster.tsx
|
|
22
|
+
var Toaster_exports = {};
|
|
23
|
+
__export(Toaster_exports, {
|
|
24
|
+
Toaster: () => Toaster,
|
|
25
|
+
useToast: () => useToast
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(Toaster_exports);
|
|
28
|
+
|
|
29
|
+
// src/components/Toast/utils/ToastStore.ts
|
|
30
|
+
var import_zustand = require("zustand");
|
|
31
|
+
var useToastStore = (0, import_zustand.create)((set) => ({
|
|
32
|
+
toasts: [],
|
|
33
|
+
addToast: (toast) => {
|
|
34
|
+
const id = crypto.randomUUID();
|
|
35
|
+
set((state) => ({
|
|
36
|
+
toasts: [...state.toasts, { id, ...toast }]
|
|
37
|
+
}));
|
|
38
|
+
},
|
|
39
|
+
removeToast: (id) => {
|
|
40
|
+
set((state) => ({
|
|
41
|
+
toasts: state.toasts.filter((t) => t.id !== id)
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
}));
|
|
45
|
+
|
|
46
|
+
// src/components/Toast/Toast.tsx
|
|
47
|
+
var import_phosphor_react = require("phosphor-react");
|
|
48
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
49
|
+
var VARIANT_ACTION_CLASSES = {
|
|
50
|
+
solid: {
|
|
51
|
+
warning: "bg-warning text-warning-800 border-none focus-visible:outline-none",
|
|
52
|
+
success: "bg-success text-success-800 border-none focus-visible:outline-none",
|
|
53
|
+
info: "bg-info text-info-800 border-none focus-visible:outline-none"
|
|
54
|
+
},
|
|
55
|
+
outlined: {
|
|
56
|
+
warning: "bg-warning text-warning-800 border border-warning-200 focus-visible:outline-none",
|
|
57
|
+
success: "bg-success text-success-800 border border-success-200 focus-visible:outline-none",
|
|
58
|
+
info: "bg-info text-info-800 border border-info-200 focus-visible:outline-none"
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
var iconMap = {
|
|
62
|
+
success: import_phosphor_react.CheckCircle,
|
|
63
|
+
info: import_phosphor_react.Info,
|
|
64
|
+
warning: import_phosphor_react.WarningCircle
|
|
65
|
+
};
|
|
66
|
+
var Toast = ({
|
|
67
|
+
variant = "outlined",
|
|
68
|
+
action = "success",
|
|
69
|
+
className = "",
|
|
70
|
+
onClose,
|
|
71
|
+
title,
|
|
72
|
+
description,
|
|
73
|
+
position = "default",
|
|
74
|
+
...props
|
|
75
|
+
}) => {
|
|
76
|
+
const variantClasses = VARIANT_ACTION_CLASSES[variant][action];
|
|
77
|
+
const positionClasses = {
|
|
78
|
+
"top-left": "fixed top-4 left-4",
|
|
79
|
+
"top-center": "fixed top-4 left-1/2 transform -translate-x-1/2",
|
|
80
|
+
"top-right": "fixed top-4 right-4",
|
|
81
|
+
"bottom-left": "fixed bottom-4 left-4",
|
|
82
|
+
"bottom-center": "fixed bottom-4 left-1/2 transform -translate-x-1/2",
|
|
83
|
+
"bottom-right": "fixed bottom-4 right-4",
|
|
84
|
+
default: ""
|
|
85
|
+
};
|
|
86
|
+
const IconAction = iconMap[action] || iconMap["success"];
|
|
87
|
+
const baseClasses = "max-w-[390px] w-full flex flex-row items-start justify-between shadow-lg rounded-lg border p-4 gap-6 group";
|
|
88
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
89
|
+
"div",
|
|
90
|
+
{
|
|
91
|
+
role: "alert",
|
|
92
|
+
"aria-live": "assertive",
|
|
93
|
+
"aria-atomic": "true",
|
|
94
|
+
className: `${baseClasses} ${positionClasses[position]} ${variantClasses} ${className}`,
|
|
95
|
+
...props,
|
|
96
|
+
children: [
|
|
97
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-row items-start gap-3", children: [
|
|
98
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "mt-1", "data-testid": `toast-icon-${action}`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconAction, {}) }),
|
|
99
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col items-start justify-start", children: [
|
|
100
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "font-semibold text-md", children: title }),
|
|
101
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-md text-text-900", children: description })
|
|
102
|
+
] })
|
|
103
|
+
] }),
|
|
104
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
105
|
+
"button",
|
|
106
|
+
{
|
|
107
|
+
onClick: onClose,
|
|
108
|
+
"aria-label": "Dismiss notification",
|
|
109
|
+
className: "text-background-500 cursor-pointer opacity-0 group-hover:opacity-100 transition-opacity",
|
|
110
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_phosphor_react.X, {})
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
// src/components/Toast/utils/Toaster.tsx
|
|
119
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
120
|
+
var Toaster = () => {
|
|
121
|
+
const toasts = useToastStore((state) => state.toasts);
|
|
122
|
+
const removeToast = useToastStore((state) => state.removeToast);
|
|
123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children: toasts.map((toast) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
124
|
+
Toast,
|
|
125
|
+
{
|
|
126
|
+
title: toast.title,
|
|
127
|
+
description: toast.description,
|
|
128
|
+
variant: toast.variant,
|
|
129
|
+
action: toast.action,
|
|
130
|
+
position: toast.position,
|
|
131
|
+
onClose: () => removeToast(toast.id)
|
|
132
|
+
},
|
|
133
|
+
toast.id
|
|
134
|
+
)) });
|
|
135
|
+
};
|
|
136
|
+
var useToast = () => {
|
|
137
|
+
const addToast = useToastStore((state) => state.addToast);
|
|
138
|
+
const removeToast = useToastStore((state) => state.removeToast);
|
|
139
|
+
return { addToast, removeToast };
|
|
140
|
+
};
|
|
141
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
142
|
+
0 && (module.exports = {
|
|
143
|
+
Toaster,
|
|
144
|
+
useToast
|
|
145
|
+
});
|