analytica-frontend-lib 1.0.26 → 1.0.28
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} +12 -9
- 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} +5 -7
- package/dist/Toast/index.js.map +1 -0
- package/dist/{chunk-XYTNJU4A.mjs → Toast/index.mjs} +7 -4
- package/dist/Toast/index.mjs.map +1 -0
- package/dist/index.css +1 -0
- 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 +326 -216
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +283 -181
- package/dist/index.mjs.map +1 -0
- package/dist/styles.css +2057 -0
- package/dist/styles.css.map +1 -0
- package/dist/styles.d.mts +2 -0
- package/dist/styles.d.ts +2 -0
- package/package.json +28 -89
- 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.js
CHANGED
|
@@ -1,11 +1,50 @@
|
|
|
1
|
-
|
|
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);
|
|
2
19
|
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
Alert: () => Alert_default,
|
|
24
|
+
Badge: () => Badge_default,
|
|
25
|
+
Button: () => Button_default,
|
|
26
|
+
CheckBox: () => CheckBox_default,
|
|
27
|
+
DropdownMenu: () => DropdownMenu_default,
|
|
28
|
+
DropdownMenuContent: () => MenuContent,
|
|
29
|
+
DropdownMenuItem: () => MenuItem,
|
|
30
|
+
DropdownMenuLabel: () => MenuLabel,
|
|
31
|
+
DropdownMenuSeparator: () => MenuSeparator,
|
|
32
|
+
DropdownMenuTrigger: () => DropdownMenuTrigger,
|
|
33
|
+
IconButton: () => IconButton_default,
|
|
34
|
+
IconRoundedButton: () => IconRoundedButton_default,
|
|
35
|
+
NavButton: () => NavButton_default,
|
|
36
|
+
SelectionButton: () => SelectionButton_default,
|
|
37
|
+
Table: () => Table_default,
|
|
38
|
+
Text: () => Text_default,
|
|
39
|
+
TextArea: () => TextArea_default,
|
|
40
|
+
Toast: () => Toast_default,
|
|
41
|
+
Toaster: () => Toaster_default,
|
|
42
|
+
useToastStore: () => ToastStore_default
|
|
43
|
+
});
|
|
44
|
+
module.exports = __toCommonJS(src_exports);
|
|
7
45
|
|
|
8
46
|
// src/components/Text/Text.tsx
|
|
47
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
9
48
|
var Text = ({
|
|
10
49
|
children,
|
|
11
50
|
size = "md",
|
|
@@ -44,7 +83,7 @@ var Text = ({
|
|
|
44
83
|
weightClasses = weightClassMap[weight] ?? weightClassMap.normal;
|
|
45
84
|
const baseClasses = "font-primary";
|
|
46
85
|
const Component = as ?? "p";
|
|
47
|
-
return /* @__PURE__ */
|
|
86
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
48
87
|
Component,
|
|
49
88
|
{
|
|
50
89
|
className: `${baseClasses} ${sizeClasses} ${weightClasses} ${color} ${className}`,
|
|
@@ -53,6 +92,10 @@ var Text = ({
|
|
|
53
92
|
}
|
|
54
93
|
);
|
|
55
94
|
};
|
|
95
|
+
var Text_default = Text;
|
|
96
|
+
|
|
97
|
+
// src/components/Button/Button.tsx
|
|
98
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
56
99
|
var VARIANT_ACTION_CLASSES = {
|
|
57
100
|
solid: {
|
|
58
101
|
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",
|
|
@@ -92,7 +135,7 @@ var Button = ({
|
|
|
92
135
|
const sizeClasses = SIZE_CLASSES[size];
|
|
93
136
|
const variantClasses = VARIANT_ACTION_CLASSES[variant][action];
|
|
94
137
|
const baseClasses = "inline-flex items-center justify-center rounded-full cursor-pointer font-medium";
|
|
95
|
-
return /* @__PURE__ */
|
|
138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
96
139
|
"button",
|
|
97
140
|
{
|
|
98
141
|
className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
|
|
@@ -100,13 +143,18 @@ var Button = ({
|
|
|
100
143
|
type,
|
|
101
144
|
...props,
|
|
102
145
|
children: [
|
|
103
|
-
iconLeft && /* @__PURE__ */
|
|
146
|
+
iconLeft && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "mr-2 flex items-center", children: iconLeft }),
|
|
104
147
|
children,
|
|
105
|
-
iconRight && /* @__PURE__ */
|
|
148
|
+
iconRight && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "ml-2 flex items-center", children: iconRight })
|
|
106
149
|
]
|
|
107
150
|
}
|
|
108
151
|
);
|
|
109
152
|
};
|
|
153
|
+
var Button_default = Button;
|
|
154
|
+
|
|
155
|
+
// src/components/Badge/Badge.tsx
|
|
156
|
+
var import_phosphor_react = require("phosphor-react");
|
|
157
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
110
158
|
var VARIANT_ACTION_CLASSES2 = {
|
|
111
159
|
solid: {
|
|
112
160
|
error: "bg-error text-error-700 focus-visible:outline-none",
|
|
@@ -162,14 +210,14 @@ var Badge = ({
|
|
|
162
210
|
const baseClasses = "inline-flex items-center justify-center rounded-xs font-normal gap-1 relative";
|
|
163
211
|
const baseClassesIcon = "flex items-center";
|
|
164
212
|
if (variant === "notification") {
|
|
165
|
-
return /* @__PURE__ */
|
|
213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
166
214
|
"div",
|
|
167
215
|
{
|
|
168
216
|
className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
|
|
169
217
|
...props,
|
|
170
218
|
children: [
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
-
notificationActive && /* @__PURE__ */
|
|
219
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_phosphor_react.Bell, { size: 24, className: "text-primary-950" }),
|
|
220
|
+
notificationActive && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
173
221
|
"span",
|
|
174
222
|
{
|
|
175
223
|
"data-testid": "notification-dot",
|
|
@@ -180,19 +228,24 @@ var Badge = ({
|
|
|
180
228
|
}
|
|
181
229
|
);
|
|
182
230
|
}
|
|
183
|
-
return /* @__PURE__ */
|
|
231
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
184
232
|
"div",
|
|
185
233
|
{
|
|
186
234
|
className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
|
|
187
235
|
...props,
|
|
188
236
|
children: [
|
|
189
|
-
iconLeft && /* @__PURE__ */
|
|
237
|
+
iconLeft && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: `${baseClassesIcon} ${sizeClassesIcon}`, children: iconLeft }),
|
|
190
238
|
children,
|
|
191
|
-
iconRight && /* @__PURE__ */
|
|
239
|
+
iconRight && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: `${baseClassesIcon} ${sizeClassesIcon}`, children: iconRight })
|
|
192
240
|
]
|
|
193
241
|
}
|
|
194
242
|
);
|
|
195
243
|
};
|
|
244
|
+
var Badge_default = Badge;
|
|
245
|
+
|
|
246
|
+
// src/components/Alert/Alert.tsx
|
|
247
|
+
var import_phosphor_react2 = require("phosphor-react");
|
|
248
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
196
249
|
var VARIANT_ACTION_CLASSES3 = {
|
|
197
250
|
solid: {
|
|
198
251
|
default: "bg-background-50 border-transparent",
|
|
@@ -217,11 +270,11 @@ var COLOR_CLASSES = {
|
|
|
217
270
|
error: "text-error-800"
|
|
218
271
|
};
|
|
219
272
|
var ICONS = {
|
|
220
|
-
default: /* @__PURE__ */
|
|
221
|
-
info: /* @__PURE__ */
|
|
222
|
-
success: /* @__PURE__ */
|
|
223
|
-
warning: /* @__PURE__ */
|
|
224
|
-
error: /* @__PURE__ */
|
|
273
|
+
default: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_phosphor_react2.CheckCircle, { size: 18 }),
|
|
274
|
+
info: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_phosphor_react2.Info, { size: 18 }),
|
|
275
|
+
success: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_phosphor_react2.CheckCircle, { size: 18 }),
|
|
276
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_phosphor_react2.WarningCircle, { size: 18 }),
|
|
277
|
+
error: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_phosphor_react2.XCircle, { size: 18 })
|
|
225
278
|
};
|
|
226
279
|
var Alert = ({
|
|
227
280
|
variant = "solid",
|
|
@@ -236,16 +289,16 @@ var Alert = ({
|
|
|
236
289
|
const variantColor = COLOR_CLASSES[action];
|
|
237
290
|
const variantIcon = ICONS[action];
|
|
238
291
|
const hasHeading = Boolean(title);
|
|
239
|
-
return /* @__PURE__ */
|
|
292
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
240
293
|
"div",
|
|
241
294
|
{
|
|
242
295
|
className: `${baseClasses} ${variantClasses} ${className ?? ""}`,
|
|
243
296
|
...props,
|
|
244
297
|
children: [
|
|
245
|
-
/* @__PURE__ */
|
|
246
|
-
/* @__PURE__ */
|
|
247
|
-
hasHeading && /* @__PURE__ */
|
|
248
|
-
|
|
298
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: `mt-0.5 ${variantColor}`, children: variantIcon }),
|
|
299
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
|
|
300
|
+
hasHeading && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
301
|
+
Text_default,
|
|
249
302
|
{
|
|
250
303
|
size: "md",
|
|
251
304
|
weight: "medium",
|
|
@@ -254,8 +307,8 @@ var Alert = ({
|
|
|
254
307
|
children: title
|
|
255
308
|
}
|
|
256
309
|
),
|
|
257
|
-
/* @__PURE__ */
|
|
258
|
-
|
|
310
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
311
|
+
Text_default,
|
|
259
312
|
{
|
|
260
313
|
size: hasHeading ? "sm" : "md",
|
|
261
314
|
weight: "normal",
|
|
@@ -268,7 +321,12 @@ var Alert = ({
|
|
|
268
321
|
}
|
|
269
322
|
);
|
|
270
323
|
};
|
|
271
|
-
var
|
|
324
|
+
var Alert_default = Alert;
|
|
325
|
+
|
|
326
|
+
// src/components/IconButton/IconButton.tsx
|
|
327
|
+
var import_react = require("react");
|
|
328
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
329
|
+
var IconButton = (0, import_react.forwardRef)(
|
|
272
330
|
({ icon, size = "md", active = false, className = "", disabled, ...props }, ref) => {
|
|
273
331
|
const baseClasses = [
|
|
274
332
|
"inline-flex",
|
|
@@ -300,7 +358,7 @@ var IconButton = react.forwardRef(
|
|
|
300
358
|
...activeClasses
|
|
301
359
|
].join(" ");
|
|
302
360
|
const ariaLabel = props["aria-label"] ?? "Bot\xE3o de a\xE7\xE3o";
|
|
303
|
-
return /* @__PURE__ */
|
|
361
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
304
362
|
"button",
|
|
305
363
|
{
|
|
306
364
|
ref,
|
|
@@ -310,12 +368,16 @@ var IconButton = react.forwardRef(
|
|
|
310
368
|
"aria-pressed": active,
|
|
311
369
|
"aria-label": ariaLabel,
|
|
312
370
|
...props,
|
|
313
|
-
children: /* @__PURE__ */
|
|
371
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "flex items-center justify-center", children: icon })
|
|
314
372
|
}
|
|
315
373
|
);
|
|
316
374
|
}
|
|
317
375
|
);
|
|
318
376
|
IconButton.displayName = "IconButton";
|
|
377
|
+
var IconButton_default = IconButton;
|
|
378
|
+
|
|
379
|
+
// src/components/IconRoundedButton/IconRoundedButton.tsx
|
|
380
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
319
381
|
var IconRoundedButton = ({
|
|
320
382
|
icon,
|
|
321
383
|
className = "",
|
|
@@ -343,18 +405,23 @@ var IconRoundedButton = ({
|
|
|
343
405
|
"disabled:opacity-50",
|
|
344
406
|
"disabled:cursor-not-allowed"
|
|
345
407
|
].join(" ");
|
|
346
|
-
return /* @__PURE__ */
|
|
408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
347
409
|
"button",
|
|
348
410
|
{
|
|
349
411
|
type: "button",
|
|
350
412
|
className: `${baseClasses} ${className}`,
|
|
351
413
|
disabled,
|
|
352
414
|
...props,
|
|
353
|
-
children: /* @__PURE__ */
|
|
415
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "flex items-center justify-center w-5 h-5", children: icon })
|
|
354
416
|
}
|
|
355
417
|
);
|
|
356
418
|
};
|
|
357
|
-
var
|
|
419
|
+
var IconRoundedButton_default = IconRoundedButton;
|
|
420
|
+
|
|
421
|
+
// src/components/NavButton/NavButton.tsx
|
|
422
|
+
var import_react2 = require("react");
|
|
423
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
424
|
+
var NavButton = (0, import_react2.forwardRef)(
|
|
358
425
|
({ icon, label, selected = false, className = "", disabled, ...props }, ref) => {
|
|
359
426
|
const baseClasses = [
|
|
360
427
|
"flex",
|
|
@@ -381,7 +448,7 @@ var NavButton = react.forwardRef(
|
|
|
381
448
|
];
|
|
382
449
|
const stateClasses = selected ? ["bg-primary-50", "text-primary-950"] : [];
|
|
383
450
|
const allClasses = [...baseClasses, ...stateClasses].join(" ");
|
|
384
|
-
return /* @__PURE__ */
|
|
451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
385
452
|
"button",
|
|
386
453
|
{
|
|
387
454
|
ref,
|
|
@@ -391,15 +458,20 @@ var NavButton = react.forwardRef(
|
|
|
391
458
|
"aria-pressed": selected,
|
|
392
459
|
...props,
|
|
393
460
|
children: [
|
|
394
|
-
/* @__PURE__ */
|
|
395
|
-
/* @__PURE__ */
|
|
461
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "flex items-center justify-center w-5 h-5", children: icon }),
|
|
462
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "whitespace-nowrap", children: label })
|
|
396
463
|
]
|
|
397
464
|
}
|
|
398
465
|
);
|
|
399
466
|
}
|
|
400
467
|
);
|
|
401
468
|
NavButton.displayName = "NavButton";
|
|
402
|
-
var
|
|
469
|
+
var NavButton_default = NavButton;
|
|
470
|
+
|
|
471
|
+
// src/components/SelectionButton/SelectionButton.tsx
|
|
472
|
+
var import_react3 = require("react");
|
|
473
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
474
|
+
var SelectionButton = (0, import_react3.forwardRef)(
|
|
403
475
|
({ icon, label, selected = false, className = "", disabled, ...props }, ref) => {
|
|
404
476
|
const baseClasses = [
|
|
405
477
|
"inline-flex",
|
|
@@ -431,7 +503,7 @@ var SelectionButton = react.forwardRef(
|
|
|
431
503
|
];
|
|
432
504
|
const stateClasses = selected ? ["ring-primary-950", "ring-2", "ring-offset-0", "shadow-none"] : [];
|
|
433
505
|
const allClasses = [...baseClasses, ...stateClasses].join(" ");
|
|
434
|
-
return /* @__PURE__ */
|
|
506
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
435
507
|
"button",
|
|
436
508
|
{
|
|
437
509
|
ref,
|
|
@@ -441,30 +513,35 @@ var SelectionButton = react.forwardRef(
|
|
|
441
513
|
"aria-pressed": selected,
|
|
442
514
|
...props,
|
|
443
515
|
children: [
|
|
444
|
-
/* @__PURE__ */
|
|
445
|
-
/* @__PURE__ */
|
|
516
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "flex items-center justify-center w-6 h-6", children: icon }),
|
|
517
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: label })
|
|
446
518
|
]
|
|
447
519
|
}
|
|
448
520
|
);
|
|
449
521
|
}
|
|
450
522
|
);
|
|
451
523
|
SelectionButton.displayName = "SelectionButton";
|
|
452
|
-
var
|
|
453
|
-
|
|
524
|
+
var SelectionButton_default = SelectionButton;
|
|
525
|
+
|
|
526
|
+
// src/components/Table/Table.tsx
|
|
527
|
+
var import_react4 = require("react");
|
|
528
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
529
|
+
var Table = (0, import_react4.forwardRef)(
|
|
530
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "border border-border-200 rounded-xl relative w-full overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
454
531
|
"table",
|
|
455
532
|
{
|
|
456
533
|
ref,
|
|
457
534
|
className: `w-full caption-bottom text-sm ${className ?? ""}`,
|
|
458
535
|
...props,
|
|
459
536
|
children: [
|
|
460
|
-
/* @__PURE__ */
|
|
537
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("caption", { className: "sr-only", children: "My Table" }),
|
|
461
538
|
children
|
|
462
539
|
]
|
|
463
540
|
}
|
|
464
541
|
) })
|
|
465
542
|
);
|
|
466
543
|
Table.displayName = "Table";
|
|
467
|
-
var TableHeader =
|
|
544
|
+
var TableHeader = (0, import_react4.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
468
545
|
"thead",
|
|
469
546
|
{
|
|
470
547
|
ref,
|
|
@@ -473,7 +550,7 @@ var TableHeader = react.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
473
550
|
}
|
|
474
551
|
));
|
|
475
552
|
TableHeader.displayName = "TableHeader";
|
|
476
|
-
var TableBody =
|
|
553
|
+
var TableBody = (0, import_react4.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
477
554
|
"tbody",
|
|
478
555
|
{
|
|
479
556
|
ref,
|
|
@@ -482,7 +559,7 @@ var TableBody = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
482
559
|
}
|
|
483
560
|
));
|
|
484
561
|
TableBody.displayName = "TableBody";
|
|
485
|
-
var TableFooter =
|
|
562
|
+
var TableFooter = (0, import_react4.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
486
563
|
"tfoot",
|
|
487
564
|
{
|
|
488
565
|
ref,
|
|
@@ -497,9 +574,9 @@ var VARIANT_STATES_ROW = {
|
|
|
497
574
|
invalid: "border-b-2 border-indicator-error",
|
|
498
575
|
disabled: "border-b border-border-100 bg-background-50 opacity-50 cursor-not-allowed"
|
|
499
576
|
};
|
|
500
|
-
var TableRow =
|
|
577
|
+
var TableRow = (0, import_react4.forwardRef)(
|
|
501
578
|
({ state = "default", className, ...props }, ref) => {
|
|
502
|
-
return /* @__PURE__ */
|
|
579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
503
580
|
"tr",
|
|
504
581
|
{
|
|
505
582
|
ref,
|
|
@@ -516,7 +593,7 @@ var TableRow = react.forwardRef(
|
|
|
516
593
|
}
|
|
517
594
|
);
|
|
518
595
|
TableRow.displayName = "TableRow";
|
|
519
|
-
var TableHead =
|
|
596
|
+
var TableHead = (0, import_react4.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
520
597
|
"th",
|
|
521
598
|
{
|
|
522
599
|
ref,
|
|
@@ -525,7 +602,7 @@ var TableHead = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
525
602
|
}
|
|
526
603
|
));
|
|
527
604
|
TableHead.displayName = "TableHead";
|
|
528
|
-
var TableCell =
|
|
605
|
+
var TableCell = (0, import_react4.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
529
606
|
"td",
|
|
530
607
|
{
|
|
531
608
|
ref,
|
|
@@ -534,7 +611,7 @@ var TableCell = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
534
611
|
}
|
|
535
612
|
));
|
|
536
613
|
TableCell.displayName = "TableCell";
|
|
537
|
-
var TableCaption =
|
|
614
|
+
var TableCaption = (0, import_react4.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
538
615
|
"caption",
|
|
539
616
|
{
|
|
540
617
|
ref,
|
|
@@ -543,6 +620,12 @@ var TableCaption = react.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
543
620
|
}
|
|
544
621
|
));
|
|
545
622
|
TableCaption.displayName = "TableCaption";
|
|
623
|
+
var Table_default = Table;
|
|
624
|
+
|
|
625
|
+
// src/components/CheckBox/CheckBox.tsx
|
|
626
|
+
var import_react5 = require("react");
|
|
627
|
+
var import_phosphor_react3 = require("phosphor-react");
|
|
628
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
546
629
|
var SIZE_CLASSES3 = {
|
|
547
630
|
small: {
|
|
548
631
|
checkbox: "w-4 h-4",
|
|
@@ -602,7 +685,7 @@ var STATE_CLASSES = {
|
|
|
602
685
|
checked: "border-primary-600 bg-primary-600 text-text cursor-not-allowed opacity-40"
|
|
603
686
|
}
|
|
604
687
|
};
|
|
605
|
-
var CheckBox =
|
|
688
|
+
var CheckBox = (0, import_react5.forwardRef)(
|
|
606
689
|
({
|
|
607
690
|
label,
|
|
608
691
|
size = "medium",
|
|
@@ -618,9 +701,9 @@ var CheckBox = react.forwardRef(
|
|
|
618
701
|
onChange,
|
|
619
702
|
...props
|
|
620
703
|
}, ref) => {
|
|
621
|
-
const generatedId =
|
|
704
|
+
const generatedId = (0, import_react5.useId)();
|
|
622
705
|
const inputId = id ?? `checkbox-${generatedId}`;
|
|
623
|
-
const [internalChecked, setInternalChecked] =
|
|
706
|
+
const [internalChecked, setInternalChecked] = (0, import_react5.useState)(false);
|
|
624
707
|
const isControlled = checkedProp !== void 0;
|
|
625
708
|
const checked = isControlled ? checkedProp : internalChecked;
|
|
626
709
|
const handleChange = (event) => {
|
|
@@ -637,8 +720,8 @@ var CheckBox = react.forwardRef(
|
|
|
637
720
|
const checkboxClasses = `${BASE_CHECKBOX_CLASSES} ${sizeClasses.checkbox} ${borderWidthClass} ${stylingClasses} ${className}`;
|
|
638
721
|
const renderIcon = () => {
|
|
639
722
|
if (indeterminate) {
|
|
640
|
-
return /* @__PURE__ */
|
|
641
|
-
|
|
723
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
724
|
+
import_phosphor_react3.Minus,
|
|
642
725
|
{
|
|
643
726
|
size: sizeClasses.iconSize,
|
|
644
727
|
weight: "bold",
|
|
@@ -647,8 +730,8 @@ var CheckBox = react.forwardRef(
|
|
|
647
730
|
);
|
|
648
731
|
}
|
|
649
732
|
if (checked) {
|
|
650
|
-
return /* @__PURE__ */
|
|
651
|
-
|
|
733
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
734
|
+
import_phosphor_react3.Check,
|
|
652
735
|
{
|
|
653
736
|
size: sizeClasses.iconSize,
|
|
654
737
|
weight: "bold",
|
|
@@ -658,13 +741,13 @@ var CheckBox = react.forwardRef(
|
|
|
658
741
|
}
|
|
659
742
|
return null;
|
|
660
743
|
};
|
|
661
|
-
return /* @__PURE__ */
|
|
662
|
-
/* @__PURE__ */
|
|
744
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col", children: [
|
|
745
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
663
746
|
"div",
|
|
664
747
|
{
|
|
665
748
|
className: `flex flex-row items-center ${sizeClasses.spacing} ${disabled ? "opacity-40" : ""}`,
|
|
666
749
|
children: [
|
|
667
|
-
/* @__PURE__ */
|
|
750
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
668
751
|
"input",
|
|
669
752
|
{
|
|
670
753
|
ref,
|
|
@@ -677,13 +760,13 @@ var CheckBox = react.forwardRef(
|
|
|
677
760
|
...props
|
|
678
761
|
}
|
|
679
762
|
),
|
|
680
|
-
/* @__PURE__ */
|
|
681
|
-
label && /* @__PURE__ */
|
|
763
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { htmlFor: inputId, className: checkboxClasses, children: renderIcon() }),
|
|
764
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
682
765
|
"div",
|
|
683
766
|
{
|
|
684
767
|
className: `flex flex-row items-center ${sizeClasses.labelHeight}`,
|
|
685
|
-
children: /* @__PURE__ */
|
|
686
|
-
|
|
768
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
769
|
+
Text_default,
|
|
687
770
|
{
|
|
688
771
|
as: "label",
|
|
689
772
|
htmlFor: inputId,
|
|
@@ -698,8 +781,8 @@ var CheckBox = react.forwardRef(
|
|
|
698
781
|
]
|
|
699
782
|
}
|
|
700
783
|
),
|
|
701
|
-
errorMessage && /* @__PURE__ */
|
|
702
|
-
|
|
784
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
785
|
+
Text_default,
|
|
703
786
|
{
|
|
704
787
|
size: "sm",
|
|
705
788
|
weight: "normal",
|
|
@@ -708,8 +791,8 @@ var CheckBox = react.forwardRef(
|
|
|
708
791
|
children: errorMessage
|
|
709
792
|
}
|
|
710
793
|
),
|
|
711
|
-
helperText && !errorMessage && /* @__PURE__ */
|
|
712
|
-
|
|
794
|
+
helperText && !errorMessage && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
795
|
+
Text_default,
|
|
713
796
|
{
|
|
714
797
|
size: "sm",
|
|
715
798
|
weight: "normal",
|
|
@@ -722,6 +805,11 @@ var CheckBox = react.forwardRef(
|
|
|
722
805
|
}
|
|
723
806
|
);
|
|
724
807
|
CheckBox.displayName = "CheckBox";
|
|
808
|
+
var CheckBox_default = CheckBox;
|
|
809
|
+
|
|
810
|
+
// src/components/TextArea/TextArea.tsx
|
|
811
|
+
var import_react6 = require("react");
|
|
812
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
725
813
|
var SIZE_CLASSES4 = {
|
|
726
814
|
small: {
|
|
727
815
|
container: "w-72",
|
|
@@ -780,7 +868,7 @@ var STATE_CLASSES2 = {
|
|
|
780
868
|
focus: ""
|
|
781
869
|
}
|
|
782
870
|
};
|
|
783
|
-
var TextArea =
|
|
871
|
+
var TextArea = (0, import_react6.forwardRef)(
|
|
784
872
|
({
|
|
785
873
|
label,
|
|
786
874
|
size = "medium",
|
|
@@ -795,9 +883,9 @@ var TextArea = react.forwardRef(
|
|
|
795
883
|
placeholder,
|
|
796
884
|
...props
|
|
797
885
|
}, ref) => {
|
|
798
|
-
const generatedId =
|
|
886
|
+
const generatedId = (0, import_react6.useId)();
|
|
799
887
|
const inputId = id ?? `textarea-${generatedId}`;
|
|
800
|
-
const [isFocused, setIsFocused] =
|
|
888
|
+
const [isFocused, setIsFocused] = (0, import_react6.useState)(false);
|
|
801
889
|
const handleChange = (event) => {
|
|
802
890
|
onChange?.(event);
|
|
803
891
|
};
|
|
@@ -816,9 +904,9 @@ var TextArea = react.forwardRef(
|
|
|
816
904
|
const sizeClasses = SIZE_CLASSES4[size];
|
|
817
905
|
const stateClasses = STATE_CLASSES2[currentState];
|
|
818
906
|
const textareaClasses = `${BASE_TEXTAREA_CLASSES} ${sizeClasses.textarea} ${stateClasses.base} ${stateClasses.hover} ${stateClasses.focus} ${className}`;
|
|
819
|
-
return /* @__PURE__ */
|
|
820
|
-
label && /* @__PURE__ */
|
|
821
|
-
|
|
907
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: `flex flex-col ${sizeClasses.container}`, children: [
|
|
908
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
909
|
+
Text_default,
|
|
822
910
|
{
|
|
823
911
|
as: "label",
|
|
824
912
|
htmlFor: inputId,
|
|
@@ -829,7 +917,7 @@ var TextArea = react.forwardRef(
|
|
|
829
917
|
children: label
|
|
830
918
|
}
|
|
831
919
|
),
|
|
832
|
-
/* @__PURE__ */
|
|
920
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
833
921
|
"textarea",
|
|
834
922
|
{
|
|
835
923
|
ref,
|
|
@@ -843,27 +931,143 @@ var TextArea = react.forwardRef(
|
|
|
843
931
|
...props
|
|
844
932
|
}
|
|
845
933
|
),
|
|
846
|
-
errorMessage && /* @__PURE__ */
|
|
847
|
-
helperMessage && !errorMessage && /* @__PURE__ */
|
|
934
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text_default, { size: "sm", weight: "normal", className: "mt-1.5 text-error-600", children: errorMessage }),
|
|
935
|
+
helperMessage && !errorMessage && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text_default, { size: "sm", weight: "normal", className: "mt-1.5 text-text-500", children: helperMessage })
|
|
848
936
|
] });
|
|
849
937
|
}
|
|
850
938
|
);
|
|
851
939
|
TextArea.displayName = "TextArea";
|
|
852
|
-
var
|
|
940
|
+
var TextArea_default = TextArea;
|
|
941
|
+
|
|
942
|
+
// src/components/Toast/Toast.tsx
|
|
943
|
+
var import_phosphor_react4 = require("phosphor-react");
|
|
944
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
945
|
+
var VARIANT_ACTION_CLASSES4 = {
|
|
946
|
+
solid: {
|
|
947
|
+
warning: "bg-warning text-warning-600 border-none focus-visible:outline-none",
|
|
948
|
+
success: "bg-success text-success-800 border-none focus-visible:outline-none",
|
|
949
|
+
info: "bg-info text-info-600 border-none focus-visible:outline-none"
|
|
950
|
+
},
|
|
951
|
+
outlined: {
|
|
952
|
+
warning: "bg-warning text-warning-600 border border-warning-300 focus-visible:outline-none",
|
|
953
|
+
success: "bg-success text-success-800 border border-success-200 focus-visible:outline-none",
|
|
954
|
+
info: "bg-info text-info-600 border border-info-600 focus-visible:outline-none"
|
|
955
|
+
}
|
|
956
|
+
};
|
|
957
|
+
var iconMap = {
|
|
958
|
+
success: import_phosphor_react4.CheckCircle,
|
|
959
|
+
info: import_phosphor_react4.Info,
|
|
960
|
+
warning: import_phosphor_react4.WarningCircle
|
|
961
|
+
};
|
|
962
|
+
var Toast = ({
|
|
963
|
+
variant = "outlined",
|
|
964
|
+
action = "success",
|
|
965
|
+
className = "",
|
|
966
|
+
onClose,
|
|
967
|
+
title,
|
|
968
|
+
description,
|
|
969
|
+
position = "default",
|
|
970
|
+
...props
|
|
971
|
+
}) => {
|
|
972
|
+
const variantClasses = VARIANT_ACTION_CLASSES4[variant][action];
|
|
973
|
+
const positionClasses = {
|
|
974
|
+
"top-left": "fixed top-4 left-4",
|
|
975
|
+
"top-center": "fixed top-4 left-1/2 transform -translate-x-1/2",
|
|
976
|
+
"top-right": "fixed top-4 right-4",
|
|
977
|
+
"bottom-left": "fixed bottom-4 left-4",
|
|
978
|
+
"bottom-center": "fixed bottom-4 left-1/2 transform -translate-x-1/2",
|
|
979
|
+
"bottom-right": "fixed bottom-4 right-4",
|
|
980
|
+
default: ""
|
|
981
|
+
};
|
|
982
|
+
const IconAction = iconMap[action] || iconMap["success"];
|
|
983
|
+
const baseClasses = "max-w-[390px] w-full flex flex-row items-start justify-between shadow-lg rounded-lg border p-4 gap-6 group";
|
|
984
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
985
|
+
"div",
|
|
986
|
+
{
|
|
987
|
+
role: "alert",
|
|
988
|
+
"aria-live": "assertive",
|
|
989
|
+
"aria-atomic": "true",
|
|
990
|
+
className: `${baseClasses} ${positionClasses[position]} ${variantClasses} ${className}`,
|
|
991
|
+
...props,
|
|
992
|
+
children: [
|
|
993
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-row items-start gap-3", children: [
|
|
994
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "mt-1", "data-testid": `toast-icon-${action}`, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IconAction, {}) }),
|
|
995
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-col items-start justify-start", children: [
|
|
996
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "font-semibold text-md", children: title }),
|
|
997
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-md text-text-900", children: description })
|
|
998
|
+
] })
|
|
999
|
+
] }),
|
|
1000
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1001
|
+
"button",
|
|
1002
|
+
{
|
|
1003
|
+
onClick: onClose,
|
|
1004
|
+
"aria-label": "Dismiss notification",
|
|
1005
|
+
className: "text-background-500 cursor-pointer opacity-0 group-hover:opacity-100 transition-opacity",
|
|
1006
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_phosphor_react4.X, {})
|
|
1007
|
+
}
|
|
1008
|
+
)
|
|
1009
|
+
]
|
|
1010
|
+
}
|
|
1011
|
+
);
|
|
1012
|
+
};
|
|
1013
|
+
var Toast_default = Toast;
|
|
1014
|
+
|
|
1015
|
+
// src/components/Toast/utils/ToastStore.ts
|
|
1016
|
+
var import_zustand = require("zustand");
|
|
1017
|
+
var useToastStore = (0, import_zustand.create)((set) => ({
|
|
1018
|
+
toasts: [],
|
|
1019
|
+
addToast: (toast) => {
|
|
1020
|
+
const id = crypto.randomUUID();
|
|
1021
|
+
set((state) => ({
|
|
1022
|
+
toasts: [...state.toasts, { id, ...toast }]
|
|
1023
|
+
}));
|
|
1024
|
+
},
|
|
1025
|
+
removeToast: (id) => {
|
|
1026
|
+
set((state) => ({
|
|
1027
|
+
toasts: state.toasts.filter((t) => t.id !== id)
|
|
1028
|
+
}));
|
|
1029
|
+
}
|
|
1030
|
+
}));
|
|
1031
|
+
var ToastStore_default = useToastStore;
|
|
1032
|
+
|
|
1033
|
+
// src/components/Toast/utils/Toaster.tsx
|
|
1034
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1035
|
+
var Toaster = () => {
|
|
1036
|
+
const toasts = ToastStore_default((state) => state.toasts);
|
|
1037
|
+
const removeToast = ToastStore_default((state) => state.removeToast);
|
|
1038
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_jsx_runtime13.Fragment, { children: toasts.map((toast) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1039
|
+
Toast_default,
|
|
1040
|
+
{
|
|
1041
|
+
title: toast.title,
|
|
1042
|
+
description: toast.description,
|
|
1043
|
+
variant: toast.variant,
|
|
1044
|
+
action: toast.action,
|
|
1045
|
+
position: toast.position,
|
|
1046
|
+
onClose: () => removeToast(toast.id)
|
|
1047
|
+
},
|
|
1048
|
+
toast.id
|
|
1049
|
+
)) });
|
|
1050
|
+
};
|
|
1051
|
+
var Toaster_default = Toaster;
|
|
1052
|
+
|
|
1053
|
+
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
1054
|
+
var import_react7 = require("react");
|
|
1055
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1056
|
+
var DropdownMenuContext = (0, import_react7.createContext)(
|
|
853
1057
|
void 0
|
|
854
1058
|
);
|
|
855
1059
|
var DropdownMenu = ({ children, open, onOpenChange }) => {
|
|
856
|
-
const [internalOpen, setInternalOpen] =
|
|
1060
|
+
const [internalOpen, setInternalOpen] = (0, import_react7.useState)(false);
|
|
857
1061
|
const isControlled = open !== void 0;
|
|
858
1062
|
const currentOpen = isControlled ? open : internalOpen;
|
|
859
|
-
const setOpen =
|
|
1063
|
+
const setOpen = (0, import_react7.useCallback)(
|
|
860
1064
|
(newOpen) => {
|
|
861
1065
|
if (onOpenChange) onOpenChange(newOpen);
|
|
862
1066
|
if (!isControlled) setInternalOpen(newOpen);
|
|
863
1067
|
},
|
|
864
1068
|
[isControlled, onOpenChange]
|
|
865
1069
|
);
|
|
866
|
-
const menuRef =
|
|
1070
|
+
const menuRef = (0, import_react7.useRef)(null);
|
|
867
1071
|
const handleArrowDownOrArrowUp = (event) => {
|
|
868
1072
|
const menuContent = menuRef.current?.querySelector('[role="menu"]');
|
|
869
1073
|
if (menuContent) {
|
|
@@ -897,7 +1101,7 @@ var DropdownMenu = ({ children, open, onOpenChange }) => {
|
|
|
897
1101
|
setOpen(false);
|
|
898
1102
|
}
|
|
899
1103
|
};
|
|
900
|
-
|
|
1104
|
+
(0, import_react7.useEffect)(() => {
|
|
901
1105
|
if (currentOpen) {
|
|
902
1106
|
document.addEventListener("mousedown", handleClickOutside);
|
|
903
1107
|
document.addEventListener("keydown", handleDownkey);
|
|
@@ -907,18 +1111,18 @@ var DropdownMenu = ({ children, open, onOpenChange }) => {
|
|
|
907
1111
|
document.removeEventListener("keydown", handleDownkey);
|
|
908
1112
|
};
|
|
909
1113
|
}, [currentOpen]);
|
|
910
|
-
const value =
|
|
1114
|
+
const value = (0, import_react7.useMemo)(
|
|
911
1115
|
() => ({ open: currentOpen, setOpen }),
|
|
912
1116
|
[currentOpen, setOpen]
|
|
913
1117
|
);
|
|
914
|
-
return /* @__PURE__ */
|
|
1118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropdownMenuContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "relative", ref: menuRef, children }) });
|
|
915
1119
|
};
|
|
916
|
-
var DropdownMenuTrigger =
|
|
917
|
-
const context =
|
|
1120
|
+
var DropdownMenuTrigger = (0, import_react7.forwardRef)(({ className, children, onClick, ...props }, ref) => {
|
|
1121
|
+
const context = (0, import_react7.useContext)(DropdownMenuContext);
|
|
918
1122
|
if (!context)
|
|
919
1123
|
throw new Error("DropdownMenuTrigger must be used within a DropdownMenu");
|
|
920
1124
|
const { open, setOpen } = context;
|
|
921
|
-
return /* @__PURE__ */
|
|
1125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
922
1126
|
"button",
|
|
923
1127
|
{
|
|
924
1128
|
ref,
|
|
@@ -950,7 +1154,7 @@ var ALIGN_CLASSES = {
|
|
|
950
1154
|
center: "left-1/2 -translate-x-1/2",
|
|
951
1155
|
end: "right-0"
|
|
952
1156
|
};
|
|
953
|
-
var MenuLabel =
|
|
1157
|
+
var MenuLabel = (0, import_react7.forwardRef)(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
954
1158
|
"fieldset",
|
|
955
1159
|
{
|
|
956
1160
|
ref,
|
|
@@ -960,7 +1164,7 @@ var MenuLabel = react.forwardRef(({ className, inset, ...props }, ref) => /* @__
|
|
|
960
1164
|
}
|
|
961
1165
|
));
|
|
962
1166
|
MenuLabel.displayName = "MenuLabel";
|
|
963
|
-
var MenuContent =
|
|
1167
|
+
var MenuContent = (0, import_react7.forwardRef)(
|
|
964
1168
|
({
|
|
965
1169
|
className,
|
|
966
1170
|
align = "start",
|
|
@@ -969,9 +1173,9 @@ var MenuContent = react.forwardRef(
|
|
|
969
1173
|
children,
|
|
970
1174
|
...props
|
|
971
1175
|
}, ref) => {
|
|
972
|
-
const { open } =
|
|
973
|
-
const [isVisible, setIsVisible] =
|
|
974
|
-
|
|
1176
|
+
const { open } = (0, import_react7.useContext)(DropdownMenuContext);
|
|
1177
|
+
const [isVisible, setIsVisible] = (0, import_react7.useState)(open);
|
|
1178
|
+
(0, import_react7.useEffect)(() => {
|
|
975
1179
|
if (open) {
|
|
976
1180
|
setIsVisible(true);
|
|
977
1181
|
} else {
|
|
@@ -985,7 +1189,7 @@ var MenuContent = react.forwardRef(
|
|
|
985
1189
|
const horizontal = ALIGN_CLASSES[align];
|
|
986
1190
|
return `absolute ${vertical} ${horizontal}`;
|
|
987
1191
|
};
|
|
988
|
-
return /* @__PURE__ */
|
|
1192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
989
1193
|
"div",
|
|
990
1194
|
{
|
|
991
1195
|
ref,
|
|
@@ -1009,7 +1213,7 @@ var MenuContent = react.forwardRef(
|
|
|
1009
1213
|
}
|
|
1010
1214
|
);
|
|
1011
1215
|
MenuContent.displayName = "MenuContent";
|
|
1012
|
-
var MenuItem =
|
|
1216
|
+
var MenuItem = (0, import_react7.forwardRef)(
|
|
1013
1217
|
({
|
|
1014
1218
|
className,
|
|
1015
1219
|
inset,
|
|
@@ -1030,7 +1234,7 @@ var MenuItem = react.forwardRef(
|
|
|
1030
1234
|
}
|
|
1031
1235
|
onClick?.(e);
|
|
1032
1236
|
};
|
|
1033
|
-
return /* @__PURE__ */
|
|
1237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1034
1238
|
"div",
|
|
1035
1239
|
{
|
|
1036
1240
|
ref,
|
|
@@ -1060,7 +1264,7 @@ var MenuItem = react.forwardRef(
|
|
|
1060
1264
|
}
|
|
1061
1265
|
);
|
|
1062
1266
|
MenuItem.displayName = "MenuItem";
|
|
1063
|
-
var MenuSeparator =
|
|
1267
|
+
var MenuSeparator = (0, import_react7.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1064
1268
|
"div",
|
|
1065
1269
|
{
|
|
1066
1270
|
ref,
|
|
@@ -1069,122 +1273,28 @@ var MenuSeparator = react.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
1069
1273
|
}
|
|
1070
1274
|
));
|
|
1071
1275
|
MenuSeparator.displayName = "MenuSeparator";
|
|
1072
|
-
var
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
...props
|
|
1098
|
-
}) => {
|
|
1099
|
-
const variantClasses = VARIANT_ACTION_CLASSES4[variant][action];
|
|
1100
|
-
const positionClasses = {
|
|
1101
|
-
"top-left": "fixed top-4 left-4",
|
|
1102
|
-
"top-center": "fixed top-4 left-1/2 transform -translate-x-1/2",
|
|
1103
|
-
"top-right": "fixed top-4 right-4",
|
|
1104
|
-
"bottom-left": "fixed bottom-4 left-4",
|
|
1105
|
-
"bottom-center": "fixed bottom-4 left-1/2 transform -translate-x-1/2",
|
|
1106
|
-
"bottom-right": "fixed bottom-4 right-4",
|
|
1107
|
-
default: ""
|
|
1108
|
-
};
|
|
1109
|
-
const IconAction = iconMap[action] || iconMap["success"];
|
|
1110
|
-
const baseClasses = "max-w-[390px] w-full flex flex-row items-start justify-between shadow-lg rounded-lg border p-4 gap-6 group";
|
|
1111
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1112
|
-
"div",
|
|
1113
|
-
{
|
|
1114
|
-
role: "alert",
|
|
1115
|
-
"aria-live": "assertive",
|
|
1116
|
-
"aria-atomic": "true",
|
|
1117
|
-
className: `${baseClasses} ${positionClasses[position]} ${variantClasses} ${className}`,
|
|
1118
|
-
...props,
|
|
1119
|
-
children: [
|
|
1120
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row items-start gap-3", children: [
|
|
1121
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-1", "data-testid": `toast-icon-${action}`, children: /* @__PURE__ */ jsxRuntime.jsx(IconAction, {}) }),
|
|
1122
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-start justify-start", children: [
|
|
1123
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-semibold text-md", children: title }),
|
|
1124
|
-
description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-md text-text-900", children: description })
|
|
1125
|
-
] })
|
|
1126
|
-
] }),
|
|
1127
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1128
|
-
"button",
|
|
1129
|
-
{
|
|
1130
|
-
onClick: onClose,
|
|
1131
|
-
"aria-label": "Dismiss notification",
|
|
1132
|
-
className: "text-background-500 cursor-pointer opacity-0 group-hover:opacity-100 transition-opacity",
|
|
1133
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(phosphorReact.X, {})
|
|
1134
|
-
}
|
|
1135
|
-
)
|
|
1136
|
-
]
|
|
1137
|
-
}
|
|
1138
|
-
);
|
|
1139
|
-
};
|
|
1140
|
-
var useToastStore = zustand.create((set) => ({
|
|
1141
|
-
toasts: [],
|
|
1142
|
-
addToast: (toast) => {
|
|
1143
|
-
const id = crypto.randomUUID();
|
|
1144
|
-
set((state) => ({
|
|
1145
|
-
toasts: [...state.toasts, { id, ...toast }]
|
|
1146
|
-
}));
|
|
1147
|
-
},
|
|
1148
|
-
removeToast: (id) => {
|
|
1149
|
-
set((state) => ({
|
|
1150
|
-
toasts: state.toasts.filter((t) => t.id !== id)
|
|
1151
|
-
}));
|
|
1152
|
-
}
|
|
1153
|
-
}));
|
|
1154
|
-
var Toaster = () => {
|
|
1155
|
-
const toasts = useToastStore((state) => state.toasts);
|
|
1156
|
-
const removeToast = useToastStore((state) => state.removeToast);
|
|
1157
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: toasts.map((toast) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1158
|
-
Toast,
|
|
1159
|
-
{
|
|
1160
|
-
title: toast.title,
|
|
1161
|
-
description: toast.description,
|
|
1162
|
-
variant: toast.variant,
|
|
1163
|
-
action: toast.action,
|
|
1164
|
-
position: toast.position,
|
|
1165
|
-
onClose: () => removeToast(toast.id)
|
|
1166
|
-
},
|
|
1167
|
-
toast.id
|
|
1168
|
-
)) });
|
|
1169
|
-
};
|
|
1170
|
-
|
|
1171
|
-
exports.Alert = Alert;
|
|
1172
|
-
exports.Badge = Badge;
|
|
1173
|
-
exports.Button = Button;
|
|
1174
|
-
exports.CheckBox = CheckBox;
|
|
1175
|
-
exports.DropdownMenu = DropdownMenu;
|
|
1176
|
-
exports.DropdownMenuContent = MenuContent;
|
|
1177
|
-
exports.DropdownMenuItem = MenuItem;
|
|
1178
|
-
exports.DropdownMenuLabel = MenuLabel;
|
|
1179
|
-
exports.DropdownMenuSeparator = MenuSeparator;
|
|
1180
|
-
exports.DropdownMenuTrigger = DropdownMenuTrigger;
|
|
1181
|
-
exports.IconButton = IconButton;
|
|
1182
|
-
exports.IconRoundedButton = IconRoundedButton;
|
|
1183
|
-
exports.NavButton = NavButton;
|
|
1184
|
-
exports.SelectionButton = SelectionButton;
|
|
1185
|
-
exports.Table = Table;
|
|
1186
|
-
exports.Text = Text;
|
|
1187
|
-
exports.TextArea = TextArea;
|
|
1188
|
-
exports.Toast = Toast;
|
|
1189
|
-
exports.Toaster = Toaster;
|
|
1190
|
-
exports.useToastStore = useToastStore;
|
|
1276
|
+
var DropdownMenu_default = DropdownMenu;
|
|
1277
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1278
|
+
0 && (module.exports = {
|
|
1279
|
+
Alert,
|
|
1280
|
+
Badge,
|
|
1281
|
+
Button,
|
|
1282
|
+
CheckBox,
|
|
1283
|
+
DropdownMenu,
|
|
1284
|
+
DropdownMenuContent,
|
|
1285
|
+
DropdownMenuItem,
|
|
1286
|
+
DropdownMenuLabel,
|
|
1287
|
+
DropdownMenuSeparator,
|
|
1288
|
+
DropdownMenuTrigger,
|
|
1289
|
+
IconButton,
|
|
1290
|
+
IconRoundedButton,
|
|
1291
|
+
NavButton,
|
|
1292
|
+
SelectionButton,
|
|
1293
|
+
Table,
|
|
1294
|
+
Text,
|
|
1295
|
+
TextArea,
|
|
1296
|
+
Toast,
|
|
1297
|
+
Toaster,
|
|
1298
|
+
useToastStore
|
|
1299
|
+
});
|
|
1300
|
+
//# sourceMappingURL=index.js.map
|