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.mjs
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { Minus, Check, Bell, WarningCircle, Info, CheckCircle, X, XCircle } from 'phosphor-react';
|
|
3
|
-
import { forwardRef, useId, useState, createContext, useContext, useEffect, useCallback, useRef, useMemo } from 'react';
|
|
4
|
-
import { create } from 'zustand';
|
|
5
|
-
|
|
6
1
|
// src/components/Text/Text.tsx
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
3
|
var Text = ({
|
|
8
4
|
children,
|
|
9
5
|
size = "md",
|
|
@@ -51,6 +47,10 @@ var Text = ({
|
|
|
51
47
|
}
|
|
52
48
|
);
|
|
53
49
|
};
|
|
50
|
+
var Text_default = Text;
|
|
51
|
+
|
|
52
|
+
// src/components/Button/Button.tsx
|
|
53
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
54
54
|
var VARIANT_ACTION_CLASSES = {
|
|
55
55
|
solid: {
|
|
56
56
|
primary: "bg-primary-950 text-text border border-primary-950 hover:bg-primary-800 hover:border-primary-800 focus-visible:outline-none focus-visible:bg-primary-950 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-primary-700 active:border-primary-700 disabled:bg-primary-500 disabled:border-primary-500 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
@@ -98,13 +98,18 @@ var Button = ({
|
|
|
98
98
|
type,
|
|
99
99
|
...props,
|
|
100
100
|
children: [
|
|
101
|
-
iconLeft && /* @__PURE__ */
|
|
101
|
+
iconLeft && /* @__PURE__ */ jsx2("span", { className: "mr-2 flex items-center", children: iconLeft }),
|
|
102
102
|
children,
|
|
103
|
-
iconRight && /* @__PURE__ */
|
|
103
|
+
iconRight && /* @__PURE__ */ jsx2("span", { className: "ml-2 flex items-center", children: iconRight })
|
|
104
104
|
]
|
|
105
105
|
}
|
|
106
106
|
);
|
|
107
107
|
};
|
|
108
|
+
var Button_default = Button;
|
|
109
|
+
|
|
110
|
+
// src/components/Badge/Badge.tsx
|
|
111
|
+
import { Bell } from "phosphor-react";
|
|
112
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
108
113
|
var VARIANT_ACTION_CLASSES2 = {
|
|
109
114
|
solid: {
|
|
110
115
|
error: "bg-error text-error-700 focus-visible:outline-none",
|
|
@@ -160,14 +165,14 @@ var Badge = ({
|
|
|
160
165
|
const baseClasses = "inline-flex items-center justify-center rounded-xs font-normal gap-1 relative";
|
|
161
166
|
const baseClassesIcon = "flex items-center";
|
|
162
167
|
if (variant === "notification") {
|
|
163
|
-
return /* @__PURE__ */
|
|
168
|
+
return /* @__PURE__ */ jsxs2(
|
|
164
169
|
"div",
|
|
165
170
|
{
|
|
166
171
|
className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
|
|
167
172
|
...props,
|
|
168
173
|
children: [
|
|
169
|
-
/* @__PURE__ */
|
|
170
|
-
notificationActive && /* @__PURE__ */
|
|
174
|
+
/* @__PURE__ */ jsx3(Bell, { size: 24, className: "text-primary-950" }),
|
|
175
|
+
notificationActive && /* @__PURE__ */ jsx3(
|
|
171
176
|
"span",
|
|
172
177
|
{
|
|
173
178
|
"data-testid": "notification-dot",
|
|
@@ -178,19 +183,24 @@ var Badge = ({
|
|
|
178
183
|
}
|
|
179
184
|
);
|
|
180
185
|
}
|
|
181
|
-
return /* @__PURE__ */
|
|
186
|
+
return /* @__PURE__ */ jsxs2(
|
|
182
187
|
"div",
|
|
183
188
|
{
|
|
184
189
|
className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
|
|
185
190
|
...props,
|
|
186
191
|
children: [
|
|
187
|
-
iconLeft && /* @__PURE__ */
|
|
192
|
+
iconLeft && /* @__PURE__ */ jsx3("span", { className: `${baseClassesIcon} ${sizeClassesIcon}`, children: iconLeft }),
|
|
188
193
|
children,
|
|
189
|
-
iconRight && /* @__PURE__ */
|
|
194
|
+
iconRight && /* @__PURE__ */ jsx3("span", { className: `${baseClassesIcon} ${sizeClassesIcon}`, children: iconRight })
|
|
190
195
|
]
|
|
191
196
|
}
|
|
192
197
|
);
|
|
193
198
|
};
|
|
199
|
+
var Badge_default = Badge;
|
|
200
|
+
|
|
201
|
+
// src/components/Alert/Alert.tsx
|
|
202
|
+
import { CheckCircle, Info, WarningCircle, XCircle } from "phosphor-react";
|
|
203
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
194
204
|
var VARIANT_ACTION_CLASSES3 = {
|
|
195
205
|
solid: {
|
|
196
206
|
default: "bg-background-50 border-transparent",
|
|
@@ -215,11 +225,11 @@ var COLOR_CLASSES = {
|
|
|
215
225
|
error: "text-error-800"
|
|
216
226
|
};
|
|
217
227
|
var ICONS = {
|
|
218
|
-
default: /* @__PURE__ */
|
|
219
|
-
info: /* @__PURE__ */
|
|
220
|
-
success: /* @__PURE__ */
|
|
221
|
-
warning: /* @__PURE__ */
|
|
222
|
-
error: /* @__PURE__ */
|
|
228
|
+
default: /* @__PURE__ */ jsx4(CheckCircle, { size: 18 }),
|
|
229
|
+
info: /* @__PURE__ */ jsx4(Info, { size: 18 }),
|
|
230
|
+
success: /* @__PURE__ */ jsx4(CheckCircle, { size: 18 }),
|
|
231
|
+
warning: /* @__PURE__ */ jsx4(WarningCircle, { size: 18 }),
|
|
232
|
+
error: /* @__PURE__ */ jsx4(XCircle, { size: 18 })
|
|
223
233
|
};
|
|
224
234
|
var Alert = ({
|
|
225
235
|
variant = "solid",
|
|
@@ -234,16 +244,16 @@ var Alert = ({
|
|
|
234
244
|
const variantColor = COLOR_CLASSES[action];
|
|
235
245
|
const variantIcon = ICONS[action];
|
|
236
246
|
const hasHeading = Boolean(title);
|
|
237
|
-
return /* @__PURE__ */
|
|
247
|
+
return /* @__PURE__ */ jsxs3(
|
|
238
248
|
"div",
|
|
239
249
|
{
|
|
240
250
|
className: `${baseClasses} ${variantClasses} ${className ?? ""}`,
|
|
241
251
|
...props,
|
|
242
252
|
children: [
|
|
243
|
-
/* @__PURE__ */
|
|
244
|
-
/* @__PURE__ */
|
|
245
|
-
hasHeading && /* @__PURE__ */
|
|
246
|
-
|
|
253
|
+
/* @__PURE__ */ jsx4("span", { className: `mt-0.5 ${variantColor}`, children: variantIcon }),
|
|
254
|
+
/* @__PURE__ */ jsxs3("div", { children: [
|
|
255
|
+
hasHeading && /* @__PURE__ */ jsx4(
|
|
256
|
+
Text_default,
|
|
247
257
|
{
|
|
248
258
|
size: "md",
|
|
249
259
|
weight: "medium",
|
|
@@ -252,8 +262,8 @@ var Alert = ({
|
|
|
252
262
|
children: title
|
|
253
263
|
}
|
|
254
264
|
),
|
|
255
|
-
/* @__PURE__ */
|
|
256
|
-
|
|
265
|
+
/* @__PURE__ */ jsx4(
|
|
266
|
+
Text_default,
|
|
257
267
|
{
|
|
258
268
|
size: hasHeading ? "sm" : "md",
|
|
259
269
|
weight: "normal",
|
|
@@ -266,6 +276,11 @@ var Alert = ({
|
|
|
266
276
|
}
|
|
267
277
|
);
|
|
268
278
|
};
|
|
279
|
+
var Alert_default = Alert;
|
|
280
|
+
|
|
281
|
+
// src/components/IconButton/IconButton.tsx
|
|
282
|
+
import { forwardRef } from "react";
|
|
283
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
269
284
|
var IconButton = forwardRef(
|
|
270
285
|
({ icon, size = "md", active = false, className = "", disabled, ...props }, ref) => {
|
|
271
286
|
const baseClasses = [
|
|
@@ -298,7 +313,7 @@ var IconButton = forwardRef(
|
|
|
298
313
|
...activeClasses
|
|
299
314
|
].join(" ");
|
|
300
315
|
const ariaLabel = props["aria-label"] ?? "Bot\xE3o de a\xE7\xE3o";
|
|
301
|
-
return /* @__PURE__ */
|
|
316
|
+
return /* @__PURE__ */ jsx5(
|
|
302
317
|
"button",
|
|
303
318
|
{
|
|
304
319
|
ref,
|
|
@@ -308,12 +323,16 @@ var IconButton = forwardRef(
|
|
|
308
323
|
"aria-pressed": active,
|
|
309
324
|
"aria-label": ariaLabel,
|
|
310
325
|
...props,
|
|
311
|
-
children: /* @__PURE__ */
|
|
326
|
+
children: /* @__PURE__ */ jsx5("span", { className: "flex items-center justify-center", children: icon })
|
|
312
327
|
}
|
|
313
328
|
);
|
|
314
329
|
}
|
|
315
330
|
);
|
|
316
331
|
IconButton.displayName = "IconButton";
|
|
332
|
+
var IconButton_default = IconButton;
|
|
333
|
+
|
|
334
|
+
// src/components/IconRoundedButton/IconRoundedButton.tsx
|
|
335
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
317
336
|
var IconRoundedButton = ({
|
|
318
337
|
icon,
|
|
319
338
|
className = "",
|
|
@@ -341,18 +360,23 @@ var IconRoundedButton = ({
|
|
|
341
360
|
"disabled:opacity-50",
|
|
342
361
|
"disabled:cursor-not-allowed"
|
|
343
362
|
].join(" ");
|
|
344
|
-
return /* @__PURE__ */
|
|
363
|
+
return /* @__PURE__ */ jsx6(
|
|
345
364
|
"button",
|
|
346
365
|
{
|
|
347
366
|
type: "button",
|
|
348
367
|
className: `${baseClasses} ${className}`,
|
|
349
368
|
disabled,
|
|
350
369
|
...props,
|
|
351
|
-
children: /* @__PURE__ */
|
|
370
|
+
children: /* @__PURE__ */ jsx6("span", { className: "flex items-center justify-center w-5 h-5", children: icon })
|
|
352
371
|
}
|
|
353
372
|
);
|
|
354
373
|
};
|
|
355
|
-
var
|
|
374
|
+
var IconRoundedButton_default = IconRoundedButton;
|
|
375
|
+
|
|
376
|
+
// src/components/NavButton/NavButton.tsx
|
|
377
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
378
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
379
|
+
var NavButton = forwardRef2(
|
|
356
380
|
({ icon, label, selected = false, className = "", disabled, ...props }, ref) => {
|
|
357
381
|
const baseClasses = [
|
|
358
382
|
"flex",
|
|
@@ -379,7 +403,7 @@ var NavButton = forwardRef(
|
|
|
379
403
|
];
|
|
380
404
|
const stateClasses = selected ? ["bg-primary-50", "text-primary-950"] : [];
|
|
381
405
|
const allClasses = [...baseClasses, ...stateClasses].join(" ");
|
|
382
|
-
return /* @__PURE__ */
|
|
406
|
+
return /* @__PURE__ */ jsxs4(
|
|
383
407
|
"button",
|
|
384
408
|
{
|
|
385
409
|
ref,
|
|
@@ -389,15 +413,20 @@ var NavButton = forwardRef(
|
|
|
389
413
|
"aria-pressed": selected,
|
|
390
414
|
...props,
|
|
391
415
|
children: [
|
|
392
|
-
/* @__PURE__ */
|
|
393
|
-
/* @__PURE__ */
|
|
416
|
+
/* @__PURE__ */ jsx7("span", { className: "flex items-center justify-center w-5 h-5", children: icon }),
|
|
417
|
+
/* @__PURE__ */ jsx7("span", { className: "whitespace-nowrap", children: label })
|
|
394
418
|
]
|
|
395
419
|
}
|
|
396
420
|
);
|
|
397
421
|
}
|
|
398
422
|
);
|
|
399
423
|
NavButton.displayName = "NavButton";
|
|
400
|
-
var
|
|
424
|
+
var NavButton_default = NavButton;
|
|
425
|
+
|
|
426
|
+
// src/components/SelectionButton/SelectionButton.tsx
|
|
427
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
428
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
429
|
+
var SelectionButton = forwardRef3(
|
|
401
430
|
({ icon, label, selected = false, className = "", disabled, ...props }, ref) => {
|
|
402
431
|
const baseClasses = [
|
|
403
432
|
"inline-flex",
|
|
@@ -429,7 +458,7 @@ var SelectionButton = forwardRef(
|
|
|
429
458
|
];
|
|
430
459
|
const stateClasses = selected ? ["ring-primary-950", "ring-2", "ring-offset-0", "shadow-none"] : [];
|
|
431
460
|
const allClasses = [...baseClasses, ...stateClasses].join(" ");
|
|
432
|
-
return /* @__PURE__ */
|
|
461
|
+
return /* @__PURE__ */ jsxs5(
|
|
433
462
|
"button",
|
|
434
463
|
{
|
|
435
464
|
ref,
|
|
@@ -439,30 +468,35 @@ var SelectionButton = forwardRef(
|
|
|
439
468
|
"aria-pressed": selected,
|
|
440
469
|
...props,
|
|
441
470
|
children: [
|
|
442
|
-
/* @__PURE__ */
|
|
443
|
-
/* @__PURE__ */
|
|
471
|
+
/* @__PURE__ */ jsx8("span", { className: "flex items-center justify-center w-6 h-6", children: icon }),
|
|
472
|
+
/* @__PURE__ */ jsx8("span", { children: label })
|
|
444
473
|
]
|
|
445
474
|
}
|
|
446
475
|
);
|
|
447
476
|
}
|
|
448
477
|
);
|
|
449
478
|
SelectionButton.displayName = "SelectionButton";
|
|
450
|
-
var
|
|
451
|
-
|
|
479
|
+
var SelectionButton_default = SelectionButton;
|
|
480
|
+
|
|
481
|
+
// src/components/Table/Table.tsx
|
|
482
|
+
import { forwardRef as forwardRef4 } from "react";
|
|
483
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
484
|
+
var Table = forwardRef4(
|
|
485
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx9("div", { className: "border border-border-200 rounded-xl relative w-full overflow-hidden", children: /* @__PURE__ */ jsxs6(
|
|
452
486
|
"table",
|
|
453
487
|
{
|
|
454
488
|
ref,
|
|
455
489
|
className: `w-full caption-bottom text-sm ${className ?? ""}`,
|
|
456
490
|
...props,
|
|
457
491
|
children: [
|
|
458
|
-
/* @__PURE__ */
|
|
492
|
+
/* @__PURE__ */ jsx9("caption", { className: "sr-only", children: "My Table" }),
|
|
459
493
|
children
|
|
460
494
|
]
|
|
461
495
|
}
|
|
462
496
|
) })
|
|
463
497
|
);
|
|
464
498
|
Table.displayName = "Table";
|
|
465
|
-
var TableHeader =
|
|
499
|
+
var TableHeader = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
466
500
|
"thead",
|
|
467
501
|
{
|
|
468
502
|
ref,
|
|
@@ -471,7 +505,7 @@ var TableHeader = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ j
|
|
|
471
505
|
}
|
|
472
506
|
));
|
|
473
507
|
TableHeader.displayName = "TableHeader";
|
|
474
|
-
var TableBody =
|
|
508
|
+
var TableBody = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
475
509
|
"tbody",
|
|
476
510
|
{
|
|
477
511
|
ref,
|
|
@@ -480,7 +514,7 @@ var TableBody = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx
|
|
|
480
514
|
}
|
|
481
515
|
));
|
|
482
516
|
TableBody.displayName = "TableBody";
|
|
483
|
-
var TableFooter =
|
|
517
|
+
var TableFooter = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
484
518
|
"tfoot",
|
|
485
519
|
{
|
|
486
520
|
ref,
|
|
@@ -495,9 +529,9 @@ var VARIANT_STATES_ROW = {
|
|
|
495
529
|
invalid: "border-b-2 border-indicator-error",
|
|
496
530
|
disabled: "border-b border-border-100 bg-background-50 opacity-50 cursor-not-allowed"
|
|
497
531
|
};
|
|
498
|
-
var TableRow =
|
|
532
|
+
var TableRow = forwardRef4(
|
|
499
533
|
({ state = "default", className, ...props }, ref) => {
|
|
500
|
-
return /* @__PURE__ */
|
|
534
|
+
return /* @__PURE__ */ jsx9(
|
|
501
535
|
"tr",
|
|
502
536
|
{
|
|
503
537
|
ref,
|
|
@@ -514,7 +548,7 @@ var TableRow = forwardRef(
|
|
|
514
548
|
}
|
|
515
549
|
);
|
|
516
550
|
TableRow.displayName = "TableRow";
|
|
517
|
-
var TableHead =
|
|
551
|
+
var TableHead = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
518
552
|
"th",
|
|
519
553
|
{
|
|
520
554
|
ref,
|
|
@@ -523,7 +557,7 @@ var TableHead = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx
|
|
|
523
557
|
}
|
|
524
558
|
));
|
|
525
559
|
TableHead.displayName = "TableHead";
|
|
526
|
-
var TableCell =
|
|
560
|
+
var TableCell = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
527
561
|
"td",
|
|
528
562
|
{
|
|
529
563
|
ref,
|
|
@@ -532,7 +566,7 @@ var TableCell = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx
|
|
|
532
566
|
}
|
|
533
567
|
));
|
|
534
568
|
TableCell.displayName = "TableCell";
|
|
535
|
-
var TableCaption =
|
|
569
|
+
var TableCaption = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
536
570
|
"caption",
|
|
537
571
|
{
|
|
538
572
|
ref,
|
|
@@ -541,6 +575,16 @@ var TableCaption = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
541
575
|
}
|
|
542
576
|
));
|
|
543
577
|
TableCaption.displayName = "TableCaption";
|
|
578
|
+
var Table_default = Table;
|
|
579
|
+
|
|
580
|
+
// src/components/CheckBox/CheckBox.tsx
|
|
581
|
+
import {
|
|
582
|
+
forwardRef as forwardRef5,
|
|
583
|
+
useState,
|
|
584
|
+
useId
|
|
585
|
+
} from "react";
|
|
586
|
+
import { Check, Minus } from "phosphor-react";
|
|
587
|
+
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
544
588
|
var SIZE_CLASSES3 = {
|
|
545
589
|
small: {
|
|
546
590
|
checkbox: "w-4 h-4",
|
|
@@ -600,7 +644,7 @@ var STATE_CLASSES = {
|
|
|
600
644
|
checked: "border-primary-600 bg-primary-600 text-text cursor-not-allowed opacity-40"
|
|
601
645
|
}
|
|
602
646
|
};
|
|
603
|
-
var CheckBox =
|
|
647
|
+
var CheckBox = forwardRef5(
|
|
604
648
|
({
|
|
605
649
|
label,
|
|
606
650
|
size = "medium",
|
|
@@ -635,7 +679,7 @@ var CheckBox = forwardRef(
|
|
|
635
679
|
const checkboxClasses = `${BASE_CHECKBOX_CLASSES} ${sizeClasses.checkbox} ${borderWidthClass} ${stylingClasses} ${className}`;
|
|
636
680
|
const renderIcon = () => {
|
|
637
681
|
if (indeterminate) {
|
|
638
|
-
return /* @__PURE__ */
|
|
682
|
+
return /* @__PURE__ */ jsx10(
|
|
639
683
|
Minus,
|
|
640
684
|
{
|
|
641
685
|
size: sizeClasses.iconSize,
|
|
@@ -645,7 +689,7 @@ var CheckBox = forwardRef(
|
|
|
645
689
|
);
|
|
646
690
|
}
|
|
647
691
|
if (checked) {
|
|
648
|
-
return /* @__PURE__ */
|
|
692
|
+
return /* @__PURE__ */ jsx10(
|
|
649
693
|
Check,
|
|
650
694
|
{
|
|
651
695
|
size: sizeClasses.iconSize,
|
|
@@ -656,13 +700,13 @@ var CheckBox = forwardRef(
|
|
|
656
700
|
}
|
|
657
701
|
return null;
|
|
658
702
|
};
|
|
659
|
-
return /* @__PURE__ */
|
|
660
|
-
/* @__PURE__ */
|
|
703
|
+
return /* @__PURE__ */ jsxs7("div", { className: "flex flex-col", children: [
|
|
704
|
+
/* @__PURE__ */ jsxs7(
|
|
661
705
|
"div",
|
|
662
706
|
{
|
|
663
707
|
className: `flex flex-row items-center ${sizeClasses.spacing} ${disabled ? "opacity-40" : ""}`,
|
|
664
708
|
children: [
|
|
665
|
-
/* @__PURE__ */
|
|
709
|
+
/* @__PURE__ */ jsx10(
|
|
666
710
|
"input",
|
|
667
711
|
{
|
|
668
712
|
ref,
|
|
@@ -675,13 +719,13 @@ var CheckBox = forwardRef(
|
|
|
675
719
|
...props
|
|
676
720
|
}
|
|
677
721
|
),
|
|
678
|
-
/* @__PURE__ */
|
|
679
|
-
label && /* @__PURE__ */
|
|
722
|
+
/* @__PURE__ */ jsx10("label", { htmlFor: inputId, className: checkboxClasses, children: renderIcon() }),
|
|
723
|
+
label && /* @__PURE__ */ jsx10(
|
|
680
724
|
"div",
|
|
681
725
|
{
|
|
682
726
|
className: `flex flex-row items-center ${sizeClasses.labelHeight}`,
|
|
683
|
-
children: /* @__PURE__ */
|
|
684
|
-
|
|
727
|
+
children: /* @__PURE__ */ jsx10(
|
|
728
|
+
Text_default,
|
|
685
729
|
{
|
|
686
730
|
as: "label",
|
|
687
731
|
htmlFor: inputId,
|
|
@@ -696,8 +740,8 @@ var CheckBox = forwardRef(
|
|
|
696
740
|
]
|
|
697
741
|
}
|
|
698
742
|
),
|
|
699
|
-
errorMessage && /* @__PURE__ */
|
|
700
|
-
|
|
743
|
+
errorMessage && /* @__PURE__ */ jsx10(
|
|
744
|
+
Text_default,
|
|
701
745
|
{
|
|
702
746
|
size: "sm",
|
|
703
747
|
weight: "normal",
|
|
@@ -706,8 +750,8 @@ var CheckBox = forwardRef(
|
|
|
706
750
|
children: errorMessage
|
|
707
751
|
}
|
|
708
752
|
),
|
|
709
|
-
helperText && !errorMessage && /* @__PURE__ */
|
|
710
|
-
|
|
753
|
+
helperText && !errorMessage && /* @__PURE__ */ jsx10(
|
|
754
|
+
Text_default,
|
|
711
755
|
{
|
|
712
756
|
size: "sm",
|
|
713
757
|
weight: "normal",
|
|
@@ -720,6 +764,15 @@ var CheckBox = forwardRef(
|
|
|
720
764
|
}
|
|
721
765
|
);
|
|
722
766
|
CheckBox.displayName = "CheckBox";
|
|
767
|
+
var CheckBox_default = CheckBox;
|
|
768
|
+
|
|
769
|
+
// src/components/TextArea/TextArea.tsx
|
|
770
|
+
import {
|
|
771
|
+
forwardRef as forwardRef6,
|
|
772
|
+
useState as useState2,
|
|
773
|
+
useId as useId2
|
|
774
|
+
} from "react";
|
|
775
|
+
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
723
776
|
var SIZE_CLASSES4 = {
|
|
724
777
|
small: {
|
|
725
778
|
container: "w-72",
|
|
@@ -778,7 +831,7 @@ var STATE_CLASSES2 = {
|
|
|
778
831
|
focus: ""
|
|
779
832
|
}
|
|
780
833
|
};
|
|
781
|
-
var TextArea =
|
|
834
|
+
var TextArea = forwardRef6(
|
|
782
835
|
({
|
|
783
836
|
label,
|
|
784
837
|
size = "medium",
|
|
@@ -793,9 +846,9 @@ var TextArea = forwardRef(
|
|
|
793
846
|
placeholder,
|
|
794
847
|
...props
|
|
795
848
|
}, ref) => {
|
|
796
|
-
const generatedId =
|
|
849
|
+
const generatedId = useId2();
|
|
797
850
|
const inputId = id ?? `textarea-${generatedId}`;
|
|
798
|
-
const [isFocused, setIsFocused] =
|
|
851
|
+
const [isFocused, setIsFocused] = useState2(false);
|
|
799
852
|
const handleChange = (event) => {
|
|
800
853
|
onChange?.(event);
|
|
801
854
|
};
|
|
@@ -814,9 +867,9 @@ var TextArea = forwardRef(
|
|
|
814
867
|
const sizeClasses = SIZE_CLASSES4[size];
|
|
815
868
|
const stateClasses = STATE_CLASSES2[currentState];
|
|
816
869
|
const textareaClasses = `${BASE_TEXTAREA_CLASSES} ${sizeClasses.textarea} ${stateClasses.base} ${stateClasses.hover} ${stateClasses.focus} ${className}`;
|
|
817
|
-
return /* @__PURE__ */
|
|
818
|
-
label && /* @__PURE__ */
|
|
819
|
-
|
|
870
|
+
return /* @__PURE__ */ jsxs8("div", { className: `flex flex-col ${sizeClasses.container}`, children: [
|
|
871
|
+
label && /* @__PURE__ */ jsx11(
|
|
872
|
+
Text_default,
|
|
820
873
|
{
|
|
821
874
|
as: "label",
|
|
822
875
|
htmlFor: inputId,
|
|
@@ -827,7 +880,7 @@ var TextArea = forwardRef(
|
|
|
827
880
|
children: label
|
|
828
881
|
}
|
|
829
882
|
),
|
|
830
|
-
/* @__PURE__ */
|
|
883
|
+
/* @__PURE__ */ jsx11(
|
|
831
884
|
"textarea",
|
|
832
885
|
{
|
|
833
886
|
ref,
|
|
@@ -841,17 +894,142 @@ var TextArea = forwardRef(
|
|
|
841
894
|
...props
|
|
842
895
|
}
|
|
843
896
|
),
|
|
844
|
-
errorMessage && /* @__PURE__ */
|
|
845
|
-
helperMessage && !errorMessage && /* @__PURE__ */
|
|
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 })
|
|
846
899
|
] });
|
|
847
900
|
}
|
|
848
901
|
);
|
|
849
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;
|
|
1015
|
+
|
|
1016
|
+
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
1017
|
+
import {
|
|
1018
|
+
createContext,
|
|
1019
|
+
useState as useState3,
|
|
1020
|
+
useCallback,
|
|
1021
|
+
useContext,
|
|
1022
|
+
forwardRef as forwardRef7,
|
|
1023
|
+
useEffect,
|
|
1024
|
+
useRef,
|
|
1025
|
+
useMemo
|
|
1026
|
+
} from "react";
|
|
1027
|
+
import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
850
1028
|
var DropdownMenuContext = createContext(
|
|
851
1029
|
void 0
|
|
852
1030
|
);
|
|
853
1031
|
var DropdownMenu = ({ children, open, onOpenChange }) => {
|
|
854
|
-
const [internalOpen, setInternalOpen] =
|
|
1032
|
+
const [internalOpen, setInternalOpen] = useState3(false);
|
|
855
1033
|
const isControlled = open !== void 0;
|
|
856
1034
|
const currentOpen = isControlled ? open : internalOpen;
|
|
857
1035
|
const setOpen = useCallback(
|
|
@@ -909,14 +1087,14 @@ var DropdownMenu = ({ children, open, onOpenChange }) => {
|
|
|
909
1087
|
() => ({ open: currentOpen, setOpen }),
|
|
910
1088
|
[currentOpen, setOpen]
|
|
911
1089
|
);
|
|
912
|
-
return /* @__PURE__ */
|
|
1090
|
+
return /* @__PURE__ */ jsx14(DropdownMenuContext.Provider, { value, children: /* @__PURE__ */ jsx14("div", { className: "relative", ref: menuRef, children }) });
|
|
913
1091
|
};
|
|
914
|
-
var DropdownMenuTrigger =
|
|
1092
|
+
var DropdownMenuTrigger = forwardRef7(({ className, children, onClick, ...props }, ref) => {
|
|
915
1093
|
const context = useContext(DropdownMenuContext);
|
|
916
1094
|
if (!context)
|
|
917
1095
|
throw new Error("DropdownMenuTrigger must be used within a DropdownMenu");
|
|
918
1096
|
const { open, setOpen } = context;
|
|
919
|
-
return /* @__PURE__ */
|
|
1097
|
+
return /* @__PURE__ */ jsx14(
|
|
920
1098
|
"button",
|
|
921
1099
|
{
|
|
922
1100
|
ref,
|
|
@@ -948,7 +1126,7 @@ var ALIGN_CLASSES = {
|
|
|
948
1126
|
center: "left-1/2 -translate-x-1/2",
|
|
949
1127
|
end: "right-0"
|
|
950
1128
|
};
|
|
951
|
-
var MenuLabel =
|
|
1129
|
+
var MenuLabel = forwardRef7(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
952
1130
|
"fieldset",
|
|
953
1131
|
{
|
|
954
1132
|
ref,
|
|
@@ -958,7 +1136,7 @@ var MenuLabel = forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__
|
|
|
958
1136
|
}
|
|
959
1137
|
));
|
|
960
1138
|
MenuLabel.displayName = "MenuLabel";
|
|
961
|
-
var MenuContent =
|
|
1139
|
+
var MenuContent = forwardRef7(
|
|
962
1140
|
({
|
|
963
1141
|
className,
|
|
964
1142
|
align = "start",
|
|
@@ -968,7 +1146,7 @@ var MenuContent = forwardRef(
|
|
|
968
1146
|
...props
|
|
969
1147
|
}, ref) => {
|
|
970
1148
|
const { open } = useContext(DropdownMenuContext);
|
|
971
|
-
const [isVisible, setIsVisible] =
|
|
1149
|
+
const [isVisible, setIsVisible] = useState3(open);
|
|
972
1150
|
useEffect(() => {
|
|
973
1151
|
if (open) {
|
|
974
1152
|
setIsVisible(true);
|
|
@@ -983,7 +1161,7 @@ var MenuContent = forwardRef(
|
|
|
983
1161
|
const horizontal = ALIGN_CLASSES[align];
|
|
984
1162
|
return `absolute ${vertical} ${horizontal}`;
|
|
985
1163
|
};
|
|
986
|
-
return /* @__PURE__ */
|
|
1164
|
+
return /* @__PURE__ */ jsx14(
|
|
987
1165
|
"div",
|
|
988
1166
|
{
|
|
989
1167
|
ref,
|
|
@@ -1007,7 +1185,7 @@ var MenuContent = forwardRef(
|
|
|
1007
1185
|
}
|
|
1008
1186
|
);
|
|
1009
1187
|
MenuContent.displayName = "MenuContent";
|
|
1010
|
-
var MenuItem =
|
|
1188
|
+
var MenuItem = forwardRef7(
|
|
1011
1189
|
({
|
|
1012
1190
|
className,
|
|
1013
1191
|
inset,
|
|
@@ -1028,7 +1206,7 @@ var MenuItem = forwardRef(
|
|
|
1028
1206
|
}
|
|
1029
1207
|
onClick?.(e);
|
|
1030
1208
|
};
|
|
1031
|
-
return /* @__PURE__ */
|
|
1209
|
+
return /* @__PURE__ */ jsxs10(
|
|
1032
1210
|
"div",
|
|
1033
1211
|
{
|
|
1034
1212
|
ref,
|
|
@@ -1058,7 +1236,7 @@ var MenuItem = forwardRef(
|
|
|
1058
1236
|
}
|
|
1059
1237
|
);
|
|
1060
1238
|
MenuItem.displayName = "MenuItem";
|
|
1061
|
-
var MenuSeparator =
|
|
1239
|
+
var MenuSeparator = forwardRef7(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
1062
1240
|
"div",
|
|
1063
1241
|
{
|
|
1064
1242
|
ref,
|
|
@@ -1067,103 +1245,27 @@ var MenuSeparator = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
1067
1245
|
}
|
|
1068
1246
|
));
|
|
1069
1247
|
MenuSeparator.displayName = "MenuSeparator";
|
|
1070
|
-
var
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1248
|
+
var DropdownMenu_default = DropdownMenu;
|
|
1249
|
+
export {
|
|
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,
|
|
1255
|
+
MenuContent as DropdownMenuContent,
|
|
1256
|
+
MenuItem as DropdownMenuItem,
|
|
1257
|
+
MenuLabel as DropdownMenuLabel,
|
|
1258
|
+
MenuSeparator as DropdownMenuSeparator,
|
|
1259
|
+
DropdownMenuTrigger,
|
|
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
|
|
1081
1270
|
};
|
|
1082
|
-
|
|
1083
|
-
success: CheckCircle,
|
|
1084
|
-
info: Info,
|
|
1085
|
-
warning: WarningCircle
|
|
1086
|
-
};
|
|
1087
|
-
var Toast = ({
|
|
1088
|
-
variant = "outlined",
|
|
1089
|
-
action = "success",
|
|
1090
|
-
className = "",
|
|
1091
|
-
onClose,
|
|
1092
|
-
title,
|
|
1093
|
-
description,
|
|
1094
|
-
position = "default",
|
|
1095
|
-
...props
|
|
1096
|
-
}) => {
|
|
1097
|
-
const variantClasses = VARIANT_ACTION_CLASSES4[variant][action];
|
|
1098
|
-
const positionClasses = {
|
|
1099
|
-
"top-left": "fixed top-4 left-4",
|
|
1100
|
-
"top-center": "fixed top-4 left-1/2 transform -translate-x-1/2",
|
|
1101
|
-
"top-right": "fixed top-4 right-4",
|
|
1102
|
-
"bottom-left": "fixed bottom-4 left-4",
|
|
1103
|
-
"bottom-center": "fixed bottom-4 left-1/2 transform -translate-x-1/2",
|
|
1104
|
-
"bottom-right": "fixed bottom-4 right-4",
|
|
1105
|
-
default: ""
|
|
1106
|
-
};
|
|
1107
|
-
const IconAction = iconMap[action] || iconMap["success"];
|
|
1108
|
-
const baseClasses = "max-w-[390px] w-full flex flex-row items-start justify-between shadow-lg rounded-lg border p-4 gap-6 group";
|
|
1109
|
-
return /* @__PURE__ */ jsxs(
|
|
1110
|
-
"div",
|
|
1111
|
-
{
|
|
1112
|
-
role: "alert",
|
|
1113
|
-
"aria-live": "assertive",
|
|
1114
|
-
"aria-atomic": "true",
|
|
1115
|
-
className: `${baseClasses} ${positionClasses[position]} ${variantClasses} ${className}`,
|
|
1116
|
-
...props,
|
|
1117
|
-
children: [
|
|
1118
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-row items-start gap-3", children: [
|
|
1119
|
-
/* @__PURE__ */ jsx("span", { className: "mt-1", "data-testid": `toast-icon-${action}`, children: /* @__PURE__ */ jsx(IconAction, {}) }),
|
|
1120
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-start justify-start", children: [
|
|
1121
|
-
/* @__PURE__ */ jsx("p", { className: "font-semibold text-md", children: title }),
|
|
1122
|
-
description && /* @__PURE__ */ jsx("p", { className: "text-md text-text-900", children: description })
|
|
1123
|
-
] })
|
|
1124
|
-
] }),
|
|
1125
|
-
/* @__PURE__ */ jsx(
|
|
1126
|
-
"button",
|
|
1127
|
-
{
|
|
1128
|
-
onClick: onClose,
|
|
1129
|
-
"aria-label": "Dismiss notification",
|
|
1130
|
-
className: "text-background-500 cursor-pointer opacity-0 group-hover:opacity-100 transition-opacity",
|
|
1131
|
-
children: /* @__PURE__ */ jsx(X, {})
|
|
1132
|
-
}
|
|
1133
|
-
)
|
|
1134
|
-
]
|
|
1135
|
-
}
|
|
1136
|
-
);
|
|
1137
|
-
};
|
|
1138
|
-
var useToastStore = create((set) => ({
|
|
1139
|
-
toasts: [],
|
|
1140
|
-
addToast: (toast) => {
|
|
1141
|
-
const id = crypto.randomUUID();
|
|
1142
|
-
set((state) => ({
|
|
1143
|
-
toasts: [...state.toasts, { id, ...toast }]
|
|
1144
|
-
}));
|
|
1145
|
-
},
|
|
1146
|
-
removeToast: (id) => {
|
|
1147
|
-
set((state) => ({
|
|
1148
|
-
toasts: state.toasts.filter((t) => t.id !== id)
|
|
1149
|
-
}));
|
|
1150
|
-
}
|
|
1151
|
-
}));
|
|
1152
|
-
var Toaster = () => {
|
|
1153
|
-
const toasts = useToastStore((state) => state.toasts);
|
|
1154
|
-
const removeToast = useToastStore((state) => state.removeToast);
|
|
1155
|
-
return /* @__PURE__ */ jsx(Fragment, { children: toasts.map((toast) => /* @__PURE__ */ jsx(
|
|
1156
|
-
Toast,
|
|
1157
|
-
{
|
|
1158
|
-
title: toast.title,
|
|
1159
|
-
description: toast.description,
|
|
1160
|
-
variant: toast.variant,
|
|
1161
|
-
action: toast.action,
|
|
1162
|
-
position: toast.position,
|
|
1163
|
-
onClose: () => removeToast(toast.id)
|
|
1164
|
-
},
|
|
1165
|
-
toast.id
|
|
1166
|
-
)) });
|
|
1167
|
-
};
|
|
1168
|
-
|
|
1169
|
-
export { Alert, Badge, Button, CheckBox, DropdownMenu, MenuContent as DropdownMenuContent, MenuItem as DropdownMenuItem, MenuLabel as DropdownMenuLabel, MenuSeparator as DropdownMenuSeparator, DropdownMenuTrigger, IconButton, IconRoundedButton, NavButton, SelectionButton, Table, Text, TextArea, Toast, Toaster, useToastStore };
|
|
1271
|
+
//# sourceMappingURL=index.mjs.map
|