@eqtylab/equality 1.9.1 → 2.0.1
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.module.module.css.module.css +19 -45
- package/dist/index.cjs +166 -136
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -24
- package/dist/index.d.ts +30 -24
- package/dist/index.js +164 -132
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,24 +1,5 @@
|
|
|
1
1
|
/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */
|
|
2
2
|
.alert {
|
|
3
|
-
&>svg {
|
|
4
|
-
position: absolute;
|
|
5
|
-
}
|
|
6
|
-
&>svg {
|
|
7
|
-
top: calc(0.25rem * 4);
|
|
8
|
-
}
|
|
9
|
-
&>svg {
|
|
10
|
-
left: calc(0.25rem * 4);
|
|
11
|
-
}
|
|
12
|
-
&>svg {
|
|
13
|
-
color: var(--color-text-primary);
|
|
14
|
-
}
|
|
15
|
-
&>svg+div {
|
|
16
|
-
--tw-translate-y: -3px;
|
|
17
|
-
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
18
|
-
}
|
|
19
|
-
&>svg~* {
|
|
20
|
-
padding-left: calc(0.25rem * 7);
|
|
21
|
-
}
|
|
22
3
|
position: relative;
|
|
23
4
|
width: 100%;
|
|
24
5
|
border-radius: 0.5rem;
|
|
@@ -28,39 +9,37 @@
|
|
|
28
9
|
padding-block: calc(0.25rem * 3);
|
|
29
10
|
font-size: 0.875rem;
|
|
30
11
|
line-height: var(--tw-leading, calc(1.25 / 0.875));
|
|
12
|
+
display: grid;
|
|
13
|
+
row-gap: calc(0.25rem * 1);
|
|
14
|
+
}
|
|
15
|
+
.alert--primary {
|
|
16
|
+
color: var(--color-badge-text-primary);
|
|
17
|
+
border-color: var(--color-badge-text-primary);
|
|
18
|
+
background-color: var(--color-badge-background-primary);
|
|
31
19
|
}
|
|
32
|
-
.alert--
|
|
20
|
+
.alert--neutral {
|
|
33
21
|
color: var(--color-badge-text-neutral);
|
|
34
|
-
&>svg {
|
|
35
|
-
color: var(--color-badge-text-neutral);
|
|
36
|
-
}
|
|
37
22
|
border-color: var(--color-badge-text-neutral);
|
|
38
23
|
background-color: var(--color-badge-background-neutral);
|
|
39
24
|
}
|
|
40
25
|
.alert--success {
|
|
41
26
|
color: var(--color-badge-text-success);
|
|
42
|
-
&>svg {
|
|
43
|
-
color: var(--color-badge-text-success);
|
|
44
|
-
}
|
|
45
27
|
border-color: var(--color-badge-text-success);
|
|
46
28
|
background-color: var(--color-badge-background-success);
|
|
47
29
|
}
|
|
48
30
|
.alert--warning {
|
|
49
31
|
color: var(--color-badge-text-warning);
|
|
50
|
-
&>svg {
|
|
51
|
-
color: var(--color-badge-text-warning);
|
|
52
|
-
}
|
|
53
32
|
border-color: var(--color-badge-text-warning);
|
|
54
33
|
background-color: var(--color-badge-background-warning);
|
|
55
34
|
}
|
|
56
35
|
.alert--danger {
|
|
57
36
|
color: var(--color-badge-text-danger);
|
|
58
|
-
&>svg {
|
|
59
|
-
color: var(--color-badge-text-danger);
|
|
60
|
-
}
|
|
61
37
|
border-color: var(--color-badge-text-danger);
|
|
62
38
|
background-color: var(--color-badge-background-danger);
|
|
63
39
|
}
|
|
40
|
+
.alert .alert-icon {
|
|
41
|
+
color: inherit;
|
|
42
|
+
}
|
|
64
43
|
.alert-title {
|
|
65
44
|
--tw-leading: 1;
|
|
66
45
|
line-height: 1;
|
|
@@ -68,7 +47,6 @@
|
|
|
68
47
|
font-weight: 500;
|
|
69
48
|
--tw-tracking: -0.025em;
|
|
70
49
|
letter-spacing: -0.025em;
|
|
71
|
-
margin-bottom: calc(0.25rem * 1);
|
|
72
50
|
}
|
|
73
51
|
.alert-description {
|
|
74
52
|
font-size: 0.875rem;
|
|
@@ -78,20 +56,16 @@
|
|
|
78
56
|
line-height: 1.625;
|
|
79
57
|
}
|
|
80
58
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
initial-value: 0;
|
|
59
|
+
.alert--with-icon {
|
|
60
|
+
grid-template-columns: auto 1fr;
|
|
61
|
+
column-gap: calc(0.25rem * 2);
|
|
85
62
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
initial-value: 0;
|
|
63
|
+
.alert--with-icon .alert-title {
|
|
64
|
+
grid-column-start: 2;
|
|
65
|
+
align-self: center;
|
|
90
66
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
inherits: false;
|
|
94
|
-
initial-value: 0;
|
|
67
|
+
.alert--with-icon .alert-description {
|
|
68
|
+
grid-column-start: 2;
|
|
95
69
|
}
|
|
96
70
|
@property --tw-border-style {
|
|
97
71
|
syntax: "*";
|
package/dist/index.cjs
CHANGED
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
var React16 = require('react');
|
|
4
4
|
var classVarianceAuthority = require('class-variance-authority');
|
|
5
|
-
var
|
|
5
|
+
var styles2 = require('./alert.module.module.css.module.css');
|
|
6
|
+
var LucideIcons = require('lucide-react');
|
|
7
|
+
var styles = require('./icon.module.module.css.module.css');
|
|
6
8
|
var clsx = require('clsx');
|
|
7
9
|
var tailwindMerge = require('tailwind-merge');
|
|
8
10
|
var jsxRuntime = require('react/jsx-runtime');
|
|
9
11
|
var AlertDialogPrimitive = require('@radix-ui/react-alert-dialog');
|
|
10
|
-
var
|
|
12
|
+
var styles4 = require('./alert-dialog.module.module.css.module.css');
|
|
11
13
|
var reactSlot = require('@radix-ui/react-slot');
|
|
12
|
-
var
|
|
14
|
+
var styles3 = require('./button.module.module.css.module.css');
|
|
13
15
|
var AvatarPrimitive = require('@radix-ui/react-avatar');
|
|
14
|
-
var
|
|
15
|
-
var LucideIcons = require('lucide-react');
|
|
16
|
+
var styles5 = require('./avatar.module.module.css.module.css');
|
|
16
17
|
var styles7 = require('./badge.module.module.css.module.css');
|
|
17
|
-
var styles5 = require('./icon.module.module.css.module.css');
|
|
18
18
|
var TooltipPrimitive = require('@radix-ui/react-tooltip');
|
|
19
19
|
var styles6 = require('./tooltip.module.module.css.module.css');
|
|
20
20
|
var styles8 = require('./bar-graph.module.module.css.module.css');
|
|
@@ -114,15 +114,15 @@ function _interopNamespace(e) {
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
var React16__namespace = /*#__PURE__*/_interopNamespace(React16);
|
|
117
|
+
var styles2__default = /*#__PURE__*/_interopDefault(styles2);
|
|
118
|
+
var LucideIcons__namespace = /*#__PURE__*/_interopNamespace(LucideIcons);
|
|
117
119
|
var styles__default = /*#__PURE__*/_interopDefault(styles);
|
|
118
120
|
var AlertDialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(AlertDialogPrimitive);
|
|
121
|
+
var styles4__default = /*#__PURE__*/_interopDefault(styles4);
|
|
119
122
|
var styles3__default = /*#__PURE__*/_interopDefault(styles3);
|
|
120
|
-
var styles2__default = /*#__PURE__*/_interopDefault(styles2);
|
|
121
123
|
var AvatarPrimitive__namespace = /*#__PURE__*/_interopNamespace(AvatarPrimitive);
|
|
122
|
-
var styles4__default = /*#__PURE__*/_interopDefault(styles4);
|
|
123
|
-
var LucideIcons__namespace = /*#__PURE__*/_interopNamespace(LucideIcons);
|
|
124
|
-
var styles7__default = /*#__PURE__*/_interopDefault(styles7);
|
|
125
124
|
var styles5__default = /*#__PURE__*/_interopDefault(styles5);
|
|
125
|
+
var styles7__default = /*#__PURE__*/_interopDefault(styles7);
|
|
126
126
|
var TooltipPrimitive__namespace = /*#__PURE__*/_interopNamespace(TooltipPrimitive);
|
|
127
127
|
var styles6__default = /*#__PURE__*/_interopDefault(styles6);
|
|
128
128
|
var styles8__default = /*#__PURE__*/_interopDefault(styles8);
|
|
@@ -197,47 +197,164 @@ var styles60__default = /*#__PURE__*/_interopDefault(styles60);
|
|
|
197
197
|
var styles61__default = /*#__PURE__*/_interopDefault(styles61);
|
|
198
198
|
|
|
199
199
|
// src/components/alert/alert.tsx
|
|
200
|
+
var ELEVATION = {
|
|
201
|
+
SUNKEN: "sunken",
|
|
202
|
+
BASE: "base",
|
|
203
|
+
RAISED: "raised",
|
|
204
|
+
OVERLAY: "overlay"
|
|
205
|
+
};
|
|
206
|
+
var generateElevationVariants = (styles62, baseClassName, defaultElevation) => {
|
|
207
|
+
const classNames = {};
|
|
208
|
+
Object.values(ELEVATION).forEach((elevation) => {
|
|
209
|
+
classNames[elevation] = styles62[`${baseClassName}--${elevation}`];
|
|
210
|
+
});
|
|
211
|
+
const variants = classVarianceAuthority.cva(styles62[baseClassName], {
|
|
212
|
+
variants: {
|
|
213
|
+
elevation: classNames
|
|
214
|
+
},
|
|
215
|
+
defaultVariants: {
|
|
216
|
+
elevation: defaultElevation
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
return variants;
|
|
220
|
+
};
|
|
221
|
+
var getRelativeElevation = (elevation, offset) => {
|
|
222
|
+
const elevationIndex = Object.values(ELEVATION).indexOf(elevation);
|
|
223
|
+
const newElevationIndex = elevationIndex + offset;
|
|
224
|
+
const relativeElevation = Object.values(ELEVATION)[newElevationIndex];
|
|
225
|
+
if (!relativeElevation) {
|
|
226
|
+
console.warn(`Invalid elevation offset: from ${elevation} with offset ${offset}`);
|
|
227
|
+
}
|
|
228
|
+
return relativeElevation || elevation;
|
|
229
|
+
};
|
|
200
230
|
function cn(...inputs) {
|
|
201
231
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
202
232
|
}
|
|
203
233
|
function getThemeProviderRoot() {
|
|
204
234
|
return document.getElementById("equality-theme-provider-root-portal");
|
|
205
235
|
}
|
|
206
|
-
var
|
|
236
|
+
var iconVariants = classVarianceAuthority.cva(styles__default.default["icon-container"], {
|
|
237
|
+
variants: {
|
|
238
|
+
size: {
|
|
239
|
+
xs: styles__default.default["size--xs"],
|
|
240
|
+
sm: styles__default.default["size--sm"],
|
|
241
|
+
md: styles__default.default["size--md"],
|
|
242
|
+
lg: styles__default.default["size--lg"]
|
|
243
|
+
},
|
|
244
|
+
background: {
|
|
245
|
+
square: styles__default.default["background--square"],
|
|
246
|
+
circle: styles__default.default["background--circle"],
|
|
247
|
+
transparent: styles__default.default["background--transparent"]
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
defaultVariants: {
|
|
251
|
+
size: "md",
|
|
252
|
+
background: "transparent"
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
var iconElevationVariants = generateElevationVariants(styles__default.default, "icon-container", ELEVATION.RAISED);
|
|
256
|
+
var Icon = React16.forwardRef(
|
|
257
|
+
({ className, size, background, icon, elevation = ELEVATION.RAISED, ...props }, ref) => {
|
|
258
|
+
let renderedIcon;
|
|
259
|
+
if (typeof icon === "string") {
|
|
260
|
+
const LucideIcon = LucideIcons__namespace[icon];
|
|
261
|
+
if (!LucideIcon) {
|
|
262
|
+
throw new Error(`Icon "${icon}" not found in lucide-react`);
|
|
263
|
+
}
|
|
264
|
+
renderedIcon = /* @__PURE__ */ jsxRuntime.jsx(LucideIcon, { className: cn(styles__default.default["icon"]) });
|
|
265
|
+
} else if (React16__namespace.isValidElement(icon)) {
|
|
266
|
+
const existingProps = icon.props;
|
|
267
|
+
renderedIcon = React16__namespace.cloneElement(
|
|
268
|
+
icon,
|
|
269
|
+
{
|
|
270
|
+
...existingProps,
|
|
271
|
+
className: cn(styles__default.default["icon"], existingProps.className)
|
|
272
|
+
}
|
|
273
|
+
);
|
|
274
|
+
} else {
|
|
275
|
+
throw new Error("Icon must be either a string (Lucide icon name) or a React element");
|
|
276
|
+
}
|
|
277
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
278
|
+
"div",
|
|
279
|
+
{
|
|
280
|
+
ref,
|
|
281
|
+
className: cn(
|
|
282
|
+
iconVariants({ size, background }),
|
|
283
|
+
iconElevationVariants({ elevation }),
|
|
284
|
+
className
|
|
285
|
+
),
|
|
286
|
+
...props,
|
|
287
|
+
children: renderedIcon
|
|
288
|
+
}
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
);
|
|
292
|
+
Icon.displayName = "Icon";
|
|
293
|
+
var alertVariants = classVarianceAuthority.cva(styles2__default.default["alert"], {
|
|
207
294
|
variants: {
|
|
208
295
|
variant: {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
296
|
+
primary: styles2__default.default["alert--primary"],
|
|
297
|
+
neutral: styles2__default.default["alert--neutral"],
|
|
298
|
+
success: styles2__default.default["alert--success"],
|
|
299
|
+
warning: styles2__default.default["alert--warning"],
|
|
300
|
+
danger: styles2__default.default["alert--danger"]
|
|
213
301
|
}
|
|
214
302
|
},
|
|
215
303
|
defaultVariants: {
|
|
216
|
-
variant: "
|
|
304
|
+
variant: "primary"
|
|
217
305
|
}
|
|
218
306
|
});
|
|
219
|
-
var
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
307
|
+
var defaultVariantIcons = {
|
|
308
|
+
success: "Check",
|
|
309
|
+
warning: "OctagonAlert",
|
|
310
|
+
danger: "TriangleAlert"
|
|
311
|
+
};
|
|
312
|
+
var Alert = React16__namespace.forwardRef(
|
|
313
|
+
({ className, variant, title, description, icon, ...props }, ref) => {
|
|
314
|
+
const effectiveIcon = icon === void 0 ? variant ? defaultVariantIcons[variant] : void 0 : icon;
|
|
315
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
316
|
+
"div",
|
|
317
|
+
{
|
|
318
|
+
ref,
|
|
319
|
+
role: "alert",
|
|
320
|
+
className: cn(
|
|
321
|
+
alertVariants({ variant }),
|
|
322
|
+
effectiveIcon ? styles2__default.default["alert--with-icon"] : "",
|
|
323
|
+
className
|
|
324
|
+
),
|
|
325
|
+
...props,
|
|
326
|
+
children: [
|
|
327
|
+
effectiveIcon ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
328
|
+
Icon,
|
|
329
|
+
{
|
|
330
|
+
icon: effectiveIcon,
|
|
331
|
+
size: "sm",
|
|
332
|
+
background: "transparent",
|
|
333
|
+
className: styles2__default.default["alert-icon"]
|
|
334
|
+
}
|
|
335
|
+
) : null,
|
|
336
|
+
/* @__PURE__ */ jsxRuntime.jsx("h4", { className: styles2__default.default["alert-title"], children: title }),
|
|
337
|
+
description ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: styles2__default.default["alert-description"], children: description }) : null
|
|
338
|
+
]
|
|
339
|
+
}
|
|
340
|
+
);
|
|
341
|
+
}
|
|
223
342
|
);
|
|
224
|
-
|
|
225
|
-
var
|
|
226
|
-
AlertDescription.displayName = "AlertDescription";
|
|
227
|
-
var buttonVariants = classVarianceAuthority.cva(styles2__default.default["button"], {
|
|
343
|
+
Alert.displayName = "Alert";
|
|
344
|
+
var buttonVariants = classVarianceAuthority.cva(styles3__default.default["button"], {
|
|
228
345
|
variants: {
|
|
229
346
|
variant: {
|
|
230
|
-
primary:
|
|
231
|
-
danger:
|
|
232
|
-
secondary:
|
|
233
|
-
tertiary:
|
|
234
|
-
link:
|
|
235
|
-
navigation:
|
|
347
|
+
primary: styles3__default.default["button--primary"],
|
|
348
|
+
danger: styles3__default.default["button--danger"],
|
|
349
|
+
secondary: styles3__default.default["button--secondary"],
|
|
350
|
+
tertiary: styles3__default.default["button--tertiary"],
|
|
351
|
+
link: styles3__default.default["button--link"],
|
|
352
|
+
navigation: styles3__default.default["button--navigation"]
|
|
236
353
|
},
|
|
237
354
|
size: {
|
|
238
|
-
sm:
|
|
239
|
-
md:
|
|
240
|
-
lg:
|
|
355
|
+
sm: styles3__default.default["size--sm"],
|
|
356
|
+
md: styles3__default.default["size--md"],
|
|
357
|
+
lg: styles3__default.default["size--lg"]
|
|
241
358
|
}
|
|
242
359
|
},
|
|
243
360
|
defaultVariants: {
|
|
@@ -291,7 +408,7 @@ var AlertDialogPortal = ({ children }) => /* @__PURE__ */ jsxRuntime.jsx(AlertDi
|
|
|
291
408
|
var AlertDialogOverlay = React16__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
292
409
|
AlertDialogPrimitive__namespace.Overlay,
|
|
293
410
|
{
|
|
294
|
-
className: cn(
|
|
411
|
+
className: cn(styles4__default.default["alert-dialog-overlay"], className),
|
|
295
412
|
...props,
|
|
296
413
|
ref
|
|
297
414
|
}
|
|
@@ -303,21 +420,21 @@ var AlertDialogContent = React16__namespace.forwardRef(({ className, ...props },
|
|
|
303
420
|
AlertDialogPrimitive__namespace.Content,
|
|
304
421
|
{
|
|
305
422
|
ref,
|
|
306
|
-
className: cn(
|
|
423
|
+
className: cn(styles4__default.default["alert-dialog-content"], className),
|
|
307
424
|
...props
|
|
308
425
|
}
|
|
309
426
|
)
|
|
310
427
|
] }));
|
|
311
428
|
AlertDialogContent.displayName = AlertDialogPrimitive__namespace.Content.displayName;
|
|
312
|
-
var AlertDialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
|
|
429
|
+
var AlertDialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(styles4__default.default["alert-dialog-header"], className), ...props });
|
|
313
430
|
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
314
|
-
var AlertDialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
|
|
431
|
+
var AlertDialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(styles4__default.default["alert-dialog-footer"], className), ...props });
|
|
315
432
|
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
316
433
|
var AlertDialogTitle = React16__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
317
434
|
AlertDialogPrimitive__namespace.Title,
|
|
318
435
|
{
|
|
319
436
|
ref,
|
|
320
|
-
className: cn(
|
|
437
|
+
className: cn(styles4__default.default["alert-dialog-title"], className),
|
|
321
438
|
...props
|
|
322
439
|
}
|
|
323
440
|
));
|
|
@@ -326,7 +443,7 @@ var AlertDialogDescription = React16__namespace.forwardRef(({ className, ...prop
|
|
|
326
443
|
AlertDialogPrimitive__namespace.Description,
|
|
327
444
|
{
|
|
328
445
|
ref,
|
|
329
|
-
className: cn(
|
|
446
|
+
className: cn(styles4__default.default["alert-dialog-description"], className),
|
|
330
447
|
...props
|
|
331
448
|
}
|
|
332
449
|
));
|
|
@@ -349,7 +466,7 @@ var AlertDialogCancel = React16__namespace.forwardRef(({ className, variant = "t
|
|
|
349
466
|
AlertDialogPrimitive__namespace.Cancel,
|
|
350
467
|
{
|
|
351
468
|
ref,
|
|
352
|
-
className: cn(buttonVariants({ variant, size }),
|
|
469
|
+
className: cn(buttonVariants({ variant, size }), styles4__default.default["alert-dialog-cancel"], className),
|
|
353
470
|
...props,
|
|
354
471
|
children: [
|
|
355
472
|
prefix,
|
|
@@ -364,110 +481,23 @@ var Avatar = React16__namespace.forwardRef(
|
|
|
364
481
|
AvatarPrimitive__namespace.Root,
|
|
365
482
|
{
|
|
366
483
|
ref,
|
|
367
|
-
className: cn(
|
|
484
|
+
className: cn(styles5__default.default.avatar, styles5__default.default[size], styles5__default.default[shape], className),
|
|
368
485
|
...props
|
|
369
486
|
}
|
|
370
487
|
)
|
|
371
488
|
);
|
|
372
489
|
Avatar.displayName = AvatarPrimitive__namespace.Root.displayName;
|
|
373
|
-
var AvatarImage = React16__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(AvatarPrimitive__namespace.Image, { ref, className: cn(
|
|
490
|
+
var AvatarImage = React16__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(AvatarPrimitive__namespace.Image, { ref, className: cn(styles5__default.default["avatar-image"], className), ...props }));
|
|
374
491
|
AvatarImage.displayName = AvatarPrimitive__namespace.Image.displayName;
|
|
375
492
|
var AvatarFallback = React16__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
376
493
|
AvatarPrimitive__namespace.Fallback,
|
|
377
494
|
{
|
|
378
495
|
ref,
|
|
379
|
-
className: cn(
|
|
496
|
+
className: cn(styles5__default.default["avatar-fallback"], className),
|
|
380
497
|
...props
|
|
381
498
|
}
|
|
382
499
|
));
|
|
383
500
|
AvatarFallback.displayName = AvatarPrimitive__namespace.Fallback.displayName;
|
|
384
|
-
var ELEVATION = {
|
|
385
|
-
SUNKEN: "sunken",
|
|
386
|
-
BASE: "base",
|
|
387
|
-
RAISED: "raised",
|
|
388
|
-
OVERLAY: "overlay"
|
|
389
|
-
};
|
|
390
|
-
var generateElevationVariants = (styles62, baseClassName, defaultElevation) => {
|
|
391
|
-
const classNames = {};
|
|
392
|
-
Object.values(ELEVATION).forEach((elevation) => {
|
|
393
|
-
classNames[elevation] = styles62[`${baseClassName}--${elevation}`];
|
|
394
|
-
});
|
|
395
|
-
const variants = classVarianceAuthority.cva(styles62[baseClassName], {
|
|
396
|
-
variants: {
|
|
397
|
-
elevation: classNames
|
|
398
|
-
},
|
|
399
|
-
defaultVariants: {
|
|
400
|
-
elevation: defaultElevation
|
|
401
|
-
}
|
|
402
|
-
});
|
|
403
|
-
return variants;
|
|
404
|
-
};
|
|
405
|
-
var getRelativeElevation = (elevation, offset) => {
|
|
406
|
-
const elevationIndex = Object.values(ELEVATION).indexOf(elevation);
|
|
407
|
-
const newElevationIndex = elevationIndex + offset;
|
|
408
|
-
const relativeElevation = Object.values(ELEVATION)[newElevationIndex];
|
|
409
|
-
if (!relativeElevation) {
|
|
410
|
-
console.warn(`Invalid elevation offset: from ${elevation} with offset ${offset}`);
|
|
411
|
-
}
|
|
412
|
-
return relativeElevation || elevation;
|
|
413
|
-
};
|
|
414
|
-
var iconVariants = classVarianceAuthority.cva(styles5__default.default["icon-container"], {
|
|
415
|
-
variants: {
|
|
416
|
-
size: {
|
|
417
|
-
xs: styles5__default.default["size--xs"],
|
|
418
|
-
sm: styles5__default.default["size--sm"],
|
|
419
|
-
md: styles5__default.default["size--md"],
|
|
420
|
-
lg: styles5__default.default["size--lg"]
|
|
421
|
-
},
|
|
422
|
-
background: {
|
|
423
|
-
square: styles5__default.default["background--square"],
|
|
424
|
-
circle: styles5__default.default["background--circle"],
|
|
425
|
-
transparent: styles5__default.default["background--transparent"]
|
|
426
|
-
}
|
|
427
|
-
},
|
|
428
|
-
defaultVariants: {
|
|
429
|
-
size: "md",
|
|
430
|
-
background: "transparent"
|
|
431
|
-
}
|
|
432
|
-
});
|
|
433
|
-
var iconElevationVariants = generateElevationVariants(styles5__default.default, "icon-container", ELEVATION.RAISED);
|
|
434
|
-
var Icon = React16.forwardRef(
|
|
435
|
-
({ className, size, background, icon, elevation = ELEVATION.RAISED, ...props }, ref) => {
|
|
436
|
-
let renderedIcon;
|
|
437
|
-
if (typeof icon === "string") {
|
|
438
|
-
const LucideIcon = LucideIcons__namespace[icon];
|
|
439
|
-
if (!LucideIcon) {
|
|
440
|
-
throw new Error(`Icon "${icon}" not found in lucide-react`);
|
|
441
|
-
}
|
|
442
|
-
renderedIcon = /* @__PURE__ */ jsxRuntime.jsx(LucideIcon, { className: cn(styles5__default.default["icon"]) });
|
|
443
|
-
} else if (React16__namespace.isValidElement(icon)) {
|
|
444
|
-
const existingProps = icon.props;
|
|
445
|
-
renderedIcon = React16__namespace.cloneElement(
|
|
446
|
-
icon,
|
|
447
|
-
{
|
|
448
|
-
...existingProps,
|
|
449
|
-
className: cn(styles5__default.default["icon"], existingProps.className)
|
|
450
|
-
}
|
|
451
|
-
);
|
|
452
|
-
} else {
|
|
453
|
-
throw new Error("Icon must be either a string (Lucide icon name) or a React element");
|
|
454
|
-
}
|
|
455
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
456
|
-
"div",
|
|
457
|
-
{
|
|
458
|
-
ref,
|
|
459
|
-
className: cn(
|
|
460
|
-
iconVariants({ size, background }),
|
|
461
|
-
iconElevationVariants({ elevation }),
|
|
462
|
-
className
|
|
463
|
-
),
|
|
464
|
-
...props,
|
|
465
|
-
children: renderedIcon
|
|
466
|
-
}
|
|
467
|
-
);
|
|
468
|
-
}
|
|
469
|
-
);
|
|
470
|
-
Icon.displayName = "Icon";
|
|
471
501
|
var TooltipProvider = TooltipPrimitive__namespace.Provider;
|
|
472
502
|
var Tooltip = TooltipPrimitive__namespace.Root;
|
|
473
503
|
var TooltipTrigger = TooltipPrimitive__namespace.Trigger;
|
|
@@ -507,7 +537,7 @@ var badgeVariants = classVarianceAuthority.cva(styles7__default.default["badge"]
|
|
|
507
537
|
size: "md"
|
|
508
538
|
}
|
|
509
539
|
});
|
|
510
|
-
var
|
|
540
|
+
var defaultVariantIcons2 = {
|
|
511
541
|
success: "Check",
|
|
512
542
|
warning: "OctagonAlert",
|
|
513
543
|
danger: "TriangleAlert"
|
|
@@ -526,7 +556,7 @@ function Badge({
|
|
|
526
556
|
pill = true,
|
|
527
557
|
...props
|
|
528
558
|
}) {
|
|
529
|
-
const effectiveIcon = icon ?? (variant ?
|
|
559
|
+
const effectiveIcon = icon ?? (variant ? defaultVariantIcons2[variant] : void 0);
|
|
530
560
|
const renderClosable = () => {
|
|
531
561
|
if (closeable && handleClosable)
|
|
532
562
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1959,6 +1989,7 @@ var EmptyTableState = ({
|
|
|
1959
1989
|
icon,
|
|
1960
1990
|
title,
|
|
1961
1991
|
description,
|
|
1992
|
+
elevation = ELEVATION.RAISED,
|
|
1962
1993
|
showClearButton = false,
|
|
1963
1994
|
onClear,
|
|
1964
1995
|
className
|
|
@@ -1966,7 +1997,7 @@ var EmptyTableState = ({
|
|
|
1966
1997
|
const showButton = showClearButton && onClear;
|
|
1967
1998
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(styles23__default.default["empty-table-state"], className), children: [
|
|
1968
1999
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles23__default.default["icon-and-title-container"], children: [
|
|
1969
|
-
/* @__PURE__ */ jsxRuntime.jsx(Icon, { icon, size: "md", background: "circle" }),
|
|
2000
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon, { icon, size: "md", background: "circle", elevation }),
|
|
1970
2001
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles23__default.default["title"], children: title })
|
|
1971
2002
|
] }),
|
|
1972
2003
|
description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles23__default.default["description"], children: description }),
|
|
@@ -3201,7 +3232,7 @@ var Tabs = ({
|
|
|
3201
3232
|
styles54__default.default["tabs-list"],
|
|
3202
3233
|
isFilled ? styles54__default.default["tabs-list--filled"] : styles54__default.default["tabs-list--transparent"]
|
|
3203
3234
|
),
|
|
3204
|
-
children: items.map(({ label, value, icon }) => {
|
|
3235
|
+
children: items.map(({ label, value, icon, suffix }) => {
|
|
3205
3236
|
const isActive = activeTab === value;
|
|
3206
3237
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3207
3238
|
TabsTrigger,
|
|
@@ -3215,6 +3246,7 @@ var Tabs = ({
|
|
|
3215
3246
|
children: [
|
|
3216
3247
|
renderIcon(icon),
|
|
3217
3248
|
label,
|
|
3249
|
+
suffix,
|
|
3218
3250
|
renderActiveStyle(isActive)
|
|
3219
3251
|
]
|
|
3220
3252
|
},
|
|
@@ -3587,7 +3619,6 @@ var ThemeProvider = ({ customVars, children }) => {
|
|
|
3587
3619
|
};
|
|
3588
3620
|
|
|
3589
3621
|
exports.Alert = Alert;
|
|
3590
|
-
exports.AlertDescription = AlertDescription;
|
|
3591
3622
|
exports.AlertDialog = AlertDialog;
|
|
3592
3623
|
exports.AlertDialogAction = AlertDialogAction;
|
|
3593
3624
|
exports.AlertDialogCancel = AlertDialogCancel;
|
|
@@ -3599,7 +3630,6 @@ exports.AlertDialogOverlay = AlertDialogOverlay;
|
|
|
3599
3630
|
exports.AlertDialogPortal = AlertDialogPortal;
|
|
3600
3631
|
exports.AlertDialogTitle = AlertDialogTitle;
|
|
3601
3632
|
exports.AlertDialogTrigger = AlertDialogTrigger;
|
|
3602
|
-
exports.AlertTitle = AlertTitle;
|
|
3603
3633
|
exports.Avatar = Avatar;
|
|
3604
3634
|
exports.AvatarFallback = AvatarFallback;
|
|
3605
3635
|
exports.AvatarImage = AvatarImage;
|