@nexus-cross/design-system 1.0.3 → 1.0.4
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/cursor-rules/nexus-ui-api.mdc +208 -0
- package/dist/alert.d.mts +17 -0
- package/dist/alert.d.ts +17 -0
- package/dist/alert.js +16 -0
- package/dist/alert.mjs +3 -0
- package/dist/badge.d.mts +18 -0
- package/dist/badge.d.ts +18 -0
- package/dist/badge.js +16 -0
- package/dist/badge.mjs +3 -0
- package/dist/breadcrumb.d.mts +15 -0
- package/dist/breadcrumb.d.ts +15 -0
- package/dist/breadcrumb.js +12 -0
- package/dist/breadcrumb.mjs +3 -0
- package/dist/chunks/chunk-2N2EPBO4.js +120 -0
- package/dist/chunks/chunk-2UPGFY6E.mjs +76 -0
- package/dist/chunks/chunk-3ZWN66YH.js +53 -0
- package/dist/chunks/chunk-5PQ3UCKF.js +99 -0
- package/dist/chunks/chunk-6BWOKTVQ.mjs +87 -0
- package/dist/chunks/chunk-6DBRL6NA.mjs +81 -0
- package/dist/chunks/chunk-B5O6W3Z4.mjs +73 -0
- package/dist/chunks/chunk-C2DSAJTL.js +109 -0
- package/dist/chunks/chunk-CUTMLBC3.mjs +86 -0
- package/dist/chunks/chunk-CV4GMFWP.js +174 -0
- package/dist/chunks/chunk-DICN6GKE.js +99 -0
- package/dist/chunks/chunk-DYPPVXQF.js +143 -0
- package/dist/chunks/chunk-EJY7IVSK.mjs +31 -0
- package/dist/chunks/chunk-FUIBYZZ4.mjs +98 -0
- package/dist/chunks/chunk-H2G5FMRN.mjs +75 -0
- package/dist/chunks/chunk-H2V7RHYV.mjs +120 -0
- package/dist/chunks/chunk-KZ7S5VN2.js +7 -0
- package/dist/chunks/chunk-MMCA33FW.mjs +85 -0
- package/dist/chunks/chunk-NZHK76R3.js +109 -0
- package/dist/chunks/chunk-P73MEU7N.mjs +150 -0
- package/dist/chunks/chunk-PDJTSQOC.js +59 -0
- package/dist/chunks/chunk-PI464222.mjs +5 -0
- package/dist/chunks/chunk-S2GMEC43.js +109 -0
- package/dist/chunks/chunk-X3CTJ7TD.js +108 -0
- package/dist/chunks/chunk-YO5MSDPX.mjs +36 -0
- package/dist/chunks/chunk-ZI4LN2B2.js +96 -0
- package/dist/date-picker.d.mts +17 -0
- package/dist/date-picker.d.ts +17 -0
- package/dist/date-picker.js +12 -0
- package/dist/date-picker.mjs +3 -0
- package/dist/dropdown-menu.d.mts +30 -0
- package/dist/dropdown-menu.d.ts +30 -0
- package/dist/dropdown-menu.js +32 -0
- package/dist/dropdown-menu.mjs +3 -0
- package/dist/empty-state.d.mts +16 -0
- package/dist/empty-state.d.ts +16 -0
- package/dist/empty-state.js +16 -0
- package/dist/empty-state.mjs +3 -0
- package/dist/index.d.mts +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +267 -155
- package/dist/index.mjs +28 -16
- package/dist/modal/index.js +12 -12
- package/dist/modal/index.mjs +3 -3
- package/dist/nx-image.d.mts +13 -0
- package/dist/nx-image.d.ts +13 -0
- package/dist/nx-image.js +12 -0
- package/dist/nx-image.mjs +3 -0
- package/dist/progress.d.mts +18 -0
- package/dist/progress.d.ts +18 -0
- package/dist/progress.js +16 -0
- package/dist/progress.mjs +3 -0
- package/dist/schemas/_all.json +787 -4
- package/dist/schemas/alert.json +49 -0
- package/dist/schemas/badge.json +76 -0
- package/dist/schemas/breadcrumb.json +47 -0
- package/dist/schemas/datePicker.json +56 -0
- package/dist/schemas/dropdownMenu.json +83 -0
- package/dist/schemas/emptyState.json +44 -0
- package/dist/schemas/nxImage.json +56 -0
- package/dist/schemas/progress.json +63 -0
- package/dist/schemas/slider.json +78 -0
- package/dist/schemas/stepper.json +73 -0
- package/dist/schemas/tagInput.json +70 -0
- package/dist/schemas/toggleGroup.json +88 -0
- package/dist/schemas.d.mts +603 -143
- package/dist/schemas.d.ts +603 -143
- package/dist/schemas.js +160 -0
- package/dist/schemas.mjs +149 -1
- package/dist/slider.d.mts +20 -0
- package/dist/slider.d.ts +20 -0
- package/dist/slider.js +16 -0
- package/dist/slider.mjs +3 -0
- package/dist/stepper.d.mts +20 -0
- package/dist/stepper.d.ts +20 -0
- package/dist/stepper.js +16 -0
- package/dist/stepper.mjs +3 -0
- package/dist/styles/layer.js +2 -2
- package/dist/styles/layer.mjs +1 -1
- package/dist/styles.css +1190 -69
- package/dist/styles.js +2 -2
- package/dist/styles.layered.css +1190 -69
- package/dist/styles.mjs +1 -1
- package/dist/tag-input.d.mts +21 -0
- package/dist/tag-input.d.ts +21 -0
- package/dist/tag-input.js +16 -0
- package/dist/tag-input.mjs +3 -0
- package/dist/toggle-group.d.mts +36 -0
- package/dist/toggle-group.d.ts +36 -0
- package/dist/toggle-group.js +16 -0
- package/dist/toggle-group.mjs +3 -0
- package/package.json +67 -2
- package/dist/chunks/chunk-RLPPNY5F.js +0 -7
- package/dist/chunks/chunk-W7IPMNN2.mjs +0 -5
- package/dist/chunks/{chunk-3VFBPFZF.mjs → chunk-CWMLTXOH.mjs} +2 -2
- package/dist/chunks/{chunk-U53UA76K.js → chunk-HFBTS42N.js} +2 -2
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkCZC76ZD5_js = require('./chunk-CZC76ZD5.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
|
|
8
|
+
function _interopNamespace(e) {
|
|
9
|
+
if (e && e.__esModule) return e;
|
|
10
|
+
var n = Object.create(null);
|
|
11
|
+
if (e) {
|
|
12
|
+
Object.keys(e).forEach(function (k) {
|
|
13
|
+
if (k !== 'default') {
|
|
14
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return e[k]; }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
n.default = e;
|
|
23
|
+
return Object.freeze(n);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
27
|
+
|
|
28
|
+
var alertVariants = classVarianceAuthority.cva("nexus-alert", {
|
|
29
|
+
variants: {
|
|
30
|
+
variant: {
|
|
31
|
+
info: "nexus-alert--info",
|
|
32
|
+
success: "nexus-alert--success",
|
|
33
|
+
warning: "nexus-alert--warning",
|
|
34
|
+
danger: "nexus-alert--danger"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
defaultVariants: {
|
|
38
|
+
variant: "info"
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
var statusIcons = {
|
|
42
|
+
info: ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z", clipRule: "evenodd" }) }),
|
|
43
|
+
success: ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z", clipRule: "evenodd" }) }),
|
|
44
|
+
warning: ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { fillRule: "evenodd", d: "M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z", clipRule: "evenodd" }) }),
|
|
45
|
+
danger: ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z", clipRule: "evenodd" }) })
|
|
46
|
+
};
|
|
47
|
+
var CloseIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 4l8 8M12 4l-8 8", strokeLinecap: "round" }) });
|
|
48
|
+
var Alert = React__namespace.forwardRef(
|
|
49
|
+
({
|
|
50
|
+
className,
|
|
51
|
+
children,
|
|
52
|
+
variant = "info",
|
|
53
|
+
title,
|
|
54
|
+
icon,
|
|
55
|
+
closable = false,
|
|
56
|
+
onClose,
|
|
57
|
+
action,
|
|
58
|
+
...props
|
|
59
|
+
}, ref) => {
|
|
60
|
+
const [visible, setVisible] = React__namespace.useState(true);
|
|
61
|
+
const handleClose = React__namespace.useCallback(() => {
|
|
62
|
+
setVisible(false);
|
|
63
|
+
onClose?.();
|
|
64
|
+
}, [onClose]);
|
|
65
|
+
if (!visible) return null;
|
|
66
|
+
const IconComp = icon === void 0 ? statusIcons[variant ?? "info"] : null;
|
|
67
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
68
|
+
"div",
|
|
69
|
+
{
|
|
70
|
+
ref,
|
|
71
|
+
role: "alert",
|
|
72
|
+
className: chunkCZC76ZD5_js.cn(alertVariants({ variant }), className),
|
|
73
|
+
...props,
|
|
74
|
+
children: [
|
|
75
|
+
(icon || IconComp) && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nexus-alert__icon", children: icon ?? (IconComp && /* @__PURE__ */ jsxRuntime.jsx(IconComp, { className: "nexus-alert__icon-svg" })) }),
|
|
76
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nexus-alert__body", children: [
|
|
77
|
+
title && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "nexus-alert__title", children: title }),
|
|
78
|
+
children && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nexus-alert__description", children })
|
|
79
|
+
] }),
|
|
80
|
+
action && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nexus-alert__action", children: action }),
|
|
81
|
+
closable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
82
|
+
"button",
|
|
83
|
+
{
|
|
84
|
+
type: "button",
|
|
85
|
+
className: "nexus-alert__close",
|
|
86
|
+
onClick: handleClose,
|
|
87
|
+
"aria-label": "Close",
|
|
88
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, { className: "nexus-alert__close-icon" })
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
Alert.displayName = "Alert";
|
|
97
|
+
|
|
98
|
+
exports.Alert = Alert;
|
|
99
|
+
exports.alertVariants = alertVariants;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { cn } from './chunk-MCKOWMLS.mjs';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
var ImageIcon = ({ className }) => /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
6
|
+
/* @__PURE__ */ jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2" }),
|
|
7
|
+
/* @__PURE__ */ jsx("circle", { cx: "8.5", cy: "8.5", r: "1.5" }),
|
|
8
|
+
/* @__PURE__ */ jsx("path", { d: "M21 15l-5-5L5 21" })
|
|
9
|
+
] });
|
|
10
|
+
var NxImage = React.forwardRef(
|
|
11
|
+
({
|
|
12
|
+
className,
|
|
13
|
+
src,
|
|
14
|
+
alt,
|
|
15
|
+
fallback,
|
|
16
|
+
fallbackSrc,
|
|
17
|
+
aspectRatio,
|
|
18
|
+
objectFit = "cover",
|
|
19
|
+
lazy = true,
|
|
20
|
+
wrapperClassName,
|
|
21
|
+
style,
|
|
22
|
+
onError,
|
|
23
|
+
onLoad,
|
|
24
|
+
...props
|
|
25
|
+
}, ref) => {
|
|
26
|
+
const [status, setStatus] = React.useState(
|
|
27
|
+
"loading"
|
|
28
|
+
);
|
|
29
|
+
React.useEffect(() => {
|
|
30
|
+
setStatus("loading");
|
|
31
|
+
}, [src]);
|
|
32
|
+
const handleLoad = React.useCallback(
|
|
33
|
+
(e) => {
|
|
34
|
+
setStatus("loaded");
|
|
35
|
+
onLoad?.(e);
|
|
36
|
+
},
|
|
37
|
+
[onLoad]
|
|
38
|
+
);
|
|
39
|
+
const handleError = React.useCallback(
|
|
40
|
+
(e) => {
|
|
41
|
+
if (fallbackSrc && e.currentTarget.src !== fallbackSrc) {
|
|
42
|
+
e.currentTarget.src = fallbackSrc;
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
setStatus("error");
|
|
46
|
+
onError?.(e);
|
|
47
|
+
},
|
|
48
|
+
[fallbackSrc, onError]
|
|
49
|
+
);
|
|
50
|
+
const wrapperStyle = {
|
|
51
|
+
...style,
|
|
52
|
+
...aspectRatio ? { aspectRatio } : {}
|
|
53
|
+
};
|
|
54
|
+
const showFallback = status === "error" || !src;
|
|
55
|
+
return /* @__PURE__ */ jsx(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
className: cn("nexus-image", wrapperClassName),
|
|
59
|
+
style: wrapperStyle,
|
|
60
|
+
children: showFallback ? /* @__PURE__ */ jsx("div", { className: "nexus-image__fallback", children: fallback ?? /* @__PURE__ */ jsx(ImageIcon, { className: "nexus-image__fallback-icon" }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
61
|
+
status === "loading" && /* @__PURE__ */ jsx("div", { className: "nexus-image__skeleton" }),
|
|
62
|
+
/* @__PURE__ */ jsx(
|
|
63
|
+
"img",
|
|
64
|
+
{
|
|
65
|
+
ref,
|
|
66
|
+
src,
|
|
67
|
+
alt: alt ?? "",
|
|
68
|
+
loading: lazy ? "lazy" : "eager",
|
|
69
|
+
className: cn(
|
|
70
|
+
"nexus-image__img",
|
|
71
|
+
`nexus-image__img--${objectFit}`,
|
|
72
|
+
status === "loaded" && "nexus-image__img--loaded",
|
|
73
|
+
className
|
|
74
|
+
),
|
|
75
|
+
onLoad: handleLoad,
|
|
76
|
+
onError: handleError,
|
|
77
|
+
...props
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
] })
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
NxImage.displayName = "NxImage";
|
|
86
|
+
|
|
87
|
+
export { NxImage };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { cn } from './chunk-MCKOWMLS.mjs';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
4
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var DropdownMenu = ({
|
|
7
|
+
children,
|
|
8
|
+
items,
|
|
9
|
+
align = "start",
|
|
10
|
+
side = "bottom",
|
|
11
|
+
className,
|
|
12
|
+
contentClassName
|
|
13
|
+
}) => /* @__PURE__ */ jsxs(DropdownMenuPrimitive.Root, { children: [
|
|
14
|
+
/* @__PURE__ */ jsx(DropdownMenuPrimitive.Trigger, { asChild: true, className, children }),
|
|
15
|
+
/* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
16
|
+
DropdownMenuPrimitive.Content,
|
|
17
|
+
{
|
|
18
|
+
align,
|
|
19
|
+
side,
|
|
20
|
+
sideOffset: 4,
|
|
21
|
+
className: cn("nexus-dropdown-content", contentClassName),
|
|
22
|
+
children: items.map(
|
|
23
|
+
(item, i) => item.separator ? /* @__PURE__ */ jsx(
|
|
24
|
+
DropdownMenuPrimitive.Separator,
|
|
25
|
+
{
|
|
26
|
+
className: "nexus-dropdown-separator"
|
|
27
|
+
},
|
|
28
|
+
i
|
|
29
|
+
) : /* @__PURE__ */ jsxs(
|
|
30
|
+
DropdownMenuPrimitive.Item,
|
|
31
|
+
{
|
|
32
|
+
className: cn(
|
|
33
|
+
"nexus-dropdown-item",
|
|
34
|
+
item.danger && "nexus-dropdown-item--danger"
|
|
35
|
+
),
|
|
36
|
+
disabled: item.disabled,
|
|
37
|
+
onSelect: item.onClick,
|
|
38
|
+
children: [
|
|
39
|
+
item.icon && /* @__PURE__ */ jsx("span", { className: "nexus-dropdown-item__icon", children: item.icon }),
|
|
40
|
+
/* @__PURE__ */ jsx("span", { children: item.label })
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
item.value ?? i
|
|
44
|
+
)
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
) })
|
|
48
|
+
] });
|
|
49
|
+
DropdownMenu.displayName = "DropdownMenu";
|
|
50
|
+
var DropdownMenuRoot = DropdownMenuPrimitive.Root;
|
|
51
|
+
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
52
|
+
var DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
53
|
+
DropdownMenuPrimitive.Content,
|
|
54
|
+
{
|
|
55
|
+
ref,
|
|
56
|
+
sideOffset,
|
|
57
|
+
className: cn("nexus-dropdown-content", className),
|
|
58
|
+
...props
|
|
59
|
+
}
|
|
60
|
+
) }));
|
|
61
|
+
DropdownMenuContent.displayName = "DropdownMenuContent";
|
|
62
|
+
var DropdownMenuItem = React.forwardRef(({ className, danger, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
63
|
+
DropdownMenuPrimitive.Item,
|
|
64
|
+
{
|
|
65
|
+
ref,
|
|
66
|
+
className: cn("nexus-dropdown-item", danger && "nexus-dropdown-item--danger", className),
|
|
67
|
+
...props
|
|
68
|
+
}
|
|
69
|
+
));
|
|
70
|
+
DropdownMenuItem.displayName = "DropdownMenuItem";
|
|
71
|
+
var DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
72
|
+
DropdownMenuPrimitive.Separator,
|
|
73
|
+
{
|
|
74
|
+
ref,
|
|
75
|
+
className: cn("nexus-dropdown-separator", className),
|
|
76
|
+
...props
|
|
77
|
+
}
|
|
78
|
+
));
|
|
79
|
+
DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
|
|
80
|
+
|
|
81
|
+
export { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuTrigger };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { cn } from './chunk-MCKOWMLS.mjs';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var progressVariants = cva("nexus-progress", {
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
primary: "nexus-progress--primary",
|
|
10
|
+
success: "nexus-progress--success",
|
|
11
|
+
warning: "nexus-progress--warning",
|
|
12
|
+
danger: "nexus-progress--danger",
|
|
13
|
+
info: "nexus-progress--info"
|
|
14
|
+
},
|
|
15
|
+
size: {
|
|
16
|
+
sm: "nexus-progress--sm",
|
|
17
|
+
md: "nexus-progress--md",
|
|
18
|
+
lg: "nexus-progress--lg"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
variant: "primary",
|
|
23
|
+
size: "md"
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
var Progress = React.forwardRef(
|
|
27
|
+
({
|
|
28
|
+
className,
|
|
29
|
+
variant,
|
|
30
|
+
size,
|
|
31
|
+
value = 0,
|
|
32
|
+
max = 100,
|
|
33
|
+
showValue = false,
|
|
34
|
+
indeterminate = false,
|
|
35
|
+
label,
|
|
36
|
+
...props
|
|
37
|
+
}, ref) => {
|
|
38
|
+
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
39
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("nexus-progress-wrapper", className), ref, ...props, children: [
|
|
40
|
+
(label || showValue) && /* @__PURE__ */ jsxs("div", { className: "nexus-progress__header", children: [
|
|
41
|
+
label && /* @__PURE__ */ jsx("span", { className: "nexus-progress__label", children: label }),
|
|
42
|
+
showValue && !indeterminate && /* @__PURE__ */ jsxs("span", { className: "nexus-progress__value", children: [
|
|
43
|
+
Math.round(percentage),
|
|
44
|
+
"%"
|
|
45
|
+
] })
|
|
46
|
+
] }),
|
|
47
|
+
/* @__PURE__ */ jsx(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
className: cn(progressVariants({ variant, size })),
|
|
51
|
+
role: "progressbar",
|
|
52
|
+
"aria-valuenow": indeterminate ? void 0 : value,
|
|
53
|
+
"aria-valuemin": 0,
|
|
54
|
+
"aria-valuemax": max,
|
|
55
|
+
"aria-label": label,
|
|
56
|
+
children: /* @__PURE__ */ jsx(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
className: cn(
|
|
60
|
+
"nexus-progress__bar",
|
|
61
|
+
indeterminate && "nexus-progress__bar--indeterminate"
|
|
62
|
+
),
|
|
63
|
+
style: indeterminate ? void 0 : { width: `${percentage}%` }
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
] });
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
Progress.displayName = "Progress";
|
|
72
|
+
|
|
73
|
+
export { Progress, progressVariants };
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkCZC76ZD5_js = require('./chunk-CZC76ZD5.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var DropdownMenuPrimitive = require('@radix-ui/react-dropdown-menu');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
|
|
8
|
+
function _interopNamespace(e) {
|
|
9
|
+
if (e && e.__esModule) return e;
|
|
10
|
+
var n = Object.create(null);
|
|
11
|
+
if (e) {
|
|
12
|
+
Object.keys(e).forEach(function (k) {
|
|
13
|
+
if (k !== 'default') {
|
|
14
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return e[k]; }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
n.default = e;
|
|
23
|
+
return Object.freeze(n);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
27
|
+
var DropdownMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(DropdownMenuPrimitive);
|
|
28
|
+
|
|
29
|
+
var DropdownMenu = ({
|
|
30
|
+
children,
|
|
31
|
+
items,
|
|
32
|
+
align = "start",
|
|
33
|
+
side = "bottom",
|
|
34
|
+
className,
|
|
35
|
+
contentClassName
|
|
36
|
+
}) => /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuPrimitive__namespace.Root, { children: [
|
|
37
|
+
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Trigger, { asChild: true, className, children }),
|
|
38
|
+
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
39
|
+
DropdownMenuPrimitive__namespace.Content,
|
|
40
|
+
{
|
|
41
|
+
align,
|
|
42
|
+
side,
|
|
43
|
+
sideOffset: 4,
|
|
44
|
+
className: chunkCZC76ZD5_js.cn("nexus-dropdown-content", contentClassName),
|
|
45
|
+
children: items.map(
|
|
46
|
+
(item, i) => item.separator ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
47
|
+
DropdownMenuPrimitive__namespace.Separator,
|
|
48
|
+
{
|
|
49
|
+
className: "nexus-dropdown-separator"
|
|
50
|
+
},
|
|
51
|
+
i
|
|
52
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
53
|
+
DropdownMenuPrimitive__namespace.Item,
|
|
54
|
+
{
|
|
55
|
+
className: chunkCZC76ZD5_js.cn(
|
|
56
|
+
"nexus-dropdown-item",
|
|
57
|
+
item.danger && "nexus-dropdown-item--danger"
|
|
58
|
+
),
|
|
59
|
+
disabled: item.disabled,
|
|
60
|
+
onSelect: item.onClick,
|
|
61
|
+
children: [
|
|
62
|
+
item.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nexus-dropdown-item__icon", children: item.icon }),
|
|
63
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: item.label })
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
item.value ?? i
|
|
67
|
+
)
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
) })
|
|
71
|
+
] });
|
|
72
|
+
DropdownMenu.displayName = "DropdownMenu";
|
|
73
|
+
var DropdownMenuRoot = DropdownMenuPrimitive__namespace.Root;
|
|
74
|
+
var DropdownMenuTrigger = DropdownMenuPrimitive__namespace.Trigger;
|
|
75
|
+
var DropdownMenuContent = React__namespace.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
76
|
+
DropdownMenuPrimitive__namespace.Content,
|
|
77
|
+
{
|
|
78
|
+
ref,
|
|
79
|
+
sideOffset,
|
|
80
|
+
className: chunkCZC76ZD5_js.cn("nexus-dropdown-content", className),
|
|
81
|
+
...props
|
|
82
|
+
}
|
|
83
|
+
) }));
|
|
84
|
+
DropdownMenuContent.displayName = "DropdownMenuContent";
|
|
85
|
+
var DropdownMenuItem = React__namespace.forwardRef(({ className, danger, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
86
|
+
DropdownMenuPrimitive__namespace.Item,
|
|
87
|
+
{
|
|
88
|
+
ref,
|
|
89
|
+
className: chunkCZC76ZD5_js.cn("nexus-dropdown-item", danger && "nexus-dropdown-item--danger", className),
|
|
90
|
+
...props
|
|
91
|
+
}
|
|
92
|
+
));
|
|
93
|
+
DropdownMenuItem.displayName = "DropdownMenuItem";
|
|
94
|
+
var DropdownMenuSeparator = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
95
|
+
DropdownMenuPrimitive__namespace.Separator,
|
|
96
|
+
{
|
|
97
|
+
ref,
|
|
98
|
+
className: chunkCZC76ZD5_js.cn("nexus-dropdown-separator", className),
|
|
99
|
+
...props
|
|
100
|
+
}
|
|
101
|
+
));
|
|
102
|
+
DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
|
|
103
|
+
|
|
104
|
+
exports.DropdownMenu = DropdownMenu;
|
|
105
|
+
exports.DropdownMenuContent = DropdownMenuContent;
|
|
106
|
+
exports.DropdownMenuItem = DropdownMenuItem;
|
|
107
|
+
exports.DropdownMenuRoot = DropdownMenuRoot;
|
|
108
|
+
exports.DropdownMenuSeparator = DropdownMenuSeparator;
|
|
109
|
+
exports.DropdownMenuTrigger = DropdownMenuTrigger;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { cn } from './chunk-MCKOWMLS.mjs';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var badgeVariants = cva("nexus-badge", {
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
danger: "nexus-badge--danger",
|
|
10
|
+
primary: "nexus-badge--primary",
|
|
11
|
+
secondary: "nexus-badge--secondary",
|
|
12
|
+
info: "nexus-badge--info",
|
|
13
|
+
success: "nexus-badge--success",
|
|
14
|
+
warning: "nexus-badge--warning"
|
|
15
|
+
},
|
|
16
|
+
size: {
|
|
17
|
+
sm: "nexus-badge--sm",
|
|
18
|
+
md: "nexus-badge--md",
|
|
19
|
+
lg: "nexus-badge--lg"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
variant: "danger",
|
|
24
|
+
size: "md"
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
var Badge = React.forwardRef(
|
|
28
|
+
({
|
|
29
|
+
className,
|
|
30
|
+
children,
|
|
31
|
+
variant,
|
|
32
|
+
size,
|
|
33
|
+
count,
|
|
34
|
+
max = 99,
|
|
35
|
+
dot = false,
|
|
36
|
+
showZero = false,
|
|
37
|
+
offset,
|
|
38
|
+
style,
|
|
39
|
+
...props
|
|
40
|
+
}, ref) => {
|
|
41
|
+
const displayCount = count !== void 0 && max !== void 0 && count > max ? `${max}+` : count;
|
|
42
|
+
const isHidden = !dot && (count === void 0 || count === 0 && !showZero);
|
|
43
|
+
const badgeStyle = {
|
|
44
|
+
...style,
|
|
45
|
+
...offset ? { "--nexus-badge-offset-x": `${offset[0]}px`, "--nexus-badge-offset-y": `${offset[1]}px` } : {}
|
|
46
|
+
};
|
|
47
|
+
if (!children) {
|
|
48
|
+
if (isHidden) return null;
|
|
49
|
+
return /* @__PURE__ */ jsx(
|
|
50
|
+
"span",
|
|
51
|
+
{
|
|
52
|
+
ref,
|
|
53
|
+
className: cn(
|
|
54
|
+
badgeVariants({ variant, size }),
|
|
55
|
+
dot && "nexus-badge--dot",
|
|
56
|
+
className
|
|
57
|
+
),
|
|
58
|
+
style: badgeStyle,
|
|
59
|
+
...props,
|
|
60
|
+
children: !dot && displayCount
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
return /* @__PURE__ */ jsxs("span", { className: "nexus-badge-wrapper", style: { position: "relative", display: "inline-flex" }, children: [
|
|
65
|
+
children,
|
|
66
|
+
!isHidden && /* @__PURE__ */ jsx(
|
|
67
|
+
"span",
|
|
68
|
+
{
|
|
69
|
+
ref,
|
|
70
|
+
className: cn(
|
|
71
|
+
badgeVariants({ variant, size }),
|
|
72
|
+
dot && "nexus-badge--dot",
|
|
73
|
+
"nexus-badge--positioned",
|
|
74
|
+
className
|
|
75
|
+
),
|
|
76
|
+
style: badgeStyle,
|
|
77
|
+
...props,
|
|
78
|
+
children: !dot && displayCount
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
] });
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
Badge.displayName = "Badge";
|
|
85
|
+
|
|
86
|
+
export { Badge, badgeVariants };
|