@szum-tech/design-system 2.0.4 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-463KEXY6.cjs +79 -0
- package/dist/chunk-4YZSPNLW.cjs +42 -0
- package/dist/chunk-5EN2HNFU.js +50 -0
- package/dist/chunk-5ENMEB5L.cjs +341 -0
- package/dist/chunk-AO4TMCYJ.js +88 -0
- package/dist/chunk-C5YRMEKV.js +319 -0
- package/dist/chunk-H2BWO3SI.cjs +0 -1
- package/dist/chunk-HFHADY43.js +36 -0
- package/dist/chunk-HIWVHD4V.js +56 -0
- package/dist/chunk-HXC3EALP.js +39 -0
- package/dist/chunk-IFBQNWVG.js +70 -0
- package/dist/chunk-INJBKPIE.js +0 -1
- package/dist/chunk-J264N6AZ.js +22 -0
- package/dist/chunk-J56UDYA3.js +70 -0
- package/dist/chunk-KPB3CBHE.cjs +40 -0
- package/dist/chunk-LI7IHIOM.cjs +30 -0
- package/dist/chunk-LND2W67K.cjs +17 -0
- package/dist/chunk-N7DXGCBJ.cjs +30 -0
- package/dist/chunk-PB3EGVTV.cjs +116 -0
- package/dist/chunk-QRSQCHBO.cjs +59 -0
- package/dist/chunk-RF5YR553.cjs +24 -0
- package/dist/chunk-TD2KDWNP.js +57 -0
- package/dist/chunk-TSN5DAKH.cjs +0 -1
- package/dist/chunk-US32J7DK.js +15 -0
- package/dist/chunk-UZBZFCWX.js +28 -0
- package/dist/chunk-V4POHGAW.cjs +60 -0
- package/dist/chunk-VFRIU5CV.cjs +16 -0
- package/dist/chunk-VQMM75HD.cjs +66 -0
- package/dist/chunk-WTVBTZ3P.js +29 -0
- package/dist/chunk-XGA2F5GG.cjs +72 -0
- package/dist/chunk-XPM62WMM.js +23 -0
- package/dist/chunk-YHU2OW52.js +14 -0
- package/dist/chunk-YXTTED5V.cjs +31 -0
- package/dist/chunk-ZD2QRAOX.js +0 -1
- package/dist/components/alert-dialog/index.cjs +43 -0
- package/dist/components/alert-dialog/index.d.cts +32 -0
- package/dist/components/alert-dialog/index.d.ts +32 -0
- package/dist/components/alert-dialog/index.js +2 -0
- package/dist/components/avatar/index.cjs +19 -0
- package/dist/components/avatar/index.d.cts +28 -0
- package/dist/components/avatar/index.d.ts +28 -0
- package/dist/components/avatar/index.js +2 -0
- package/dist/components/button/index.cjs +11 -0
- package/dist/components/button/index.d.cts +64 -0
- package/dist/components/button/index.d.ts +64 -0
- package/dist/components/button/index.js +2 -0
- package/dist/components/card/index.cjs +30 -0
- package/dist/components/card/index.d.cts +22 -0
- package/dist/components/card/index.d.ts +22 -0
- package/dist/components/card/index.js +1 -0
- package/dist/components/dialog/index.cjs +38 -0
- package/dist/components/dialog/index.d.cts +40 -0
- package/dist/components/dialog/index.d.ts +40 -0
- package/dist/components/dialog/index.js +1 -0
- package/dist/components/form/index.cjs +50 -0
- package/dist/components/form/index.d.cts +32 -0
- package/dist/components/form/index.d.ts +32 -0
- package/dist/components/form/index.js +17 -0
- package/dist/components/header/index.cjs +10 -0
- package/dist/components/header/index.d.cts +9 -0
- package/dist/components/header/index.d.ts +9 -0
- package/dist/components/header/index.js +1 -0
- package/dist/components/helper-text/index.cjs +10 -0
- package/dist/components/helper-text/index.d.cts +18 -0
- package/dist/components/helper-text/index.d.ts +18 -0
- package/dist/components/helper-text/index.js +1 -0
- package/dist/components/index.cjs +230 -0
- package/dist/components/index.d.cts +22 -0
- package/dist/components/index.d.ts +22 -0
- package/dist/components/index.js +17 -0
- package/dist/components/input/index.cjs +11 -0
- package/dist/components/input/index.d.cts +11 -0
- package/dist/components/input/index.d.ts +11 -0
- package/dist/components/input/index.js +2 -0
- package/dist/components/label/index.cjs +10 -0
- package/dist/components/label/index.d.cts +8 -0
- package/dist/components/label/index.d.ts +8 -0
- package/dist/components/label/index.js +1 -0
- package/dist/components/select/index.cjs +14 -0
- package/dist/components/select/index.d.cts +15 -0
- package/dist/components/select/index.d.ts +15 -0
- package/dist/components/select/index.js +1 -0
- package/dist/components/separator/index.cjs +11 -0
- package/dist/components/separator/index.d.cts +8 -0
- package/dist/components/separator/index.d.ts +8 -0
- package/dist/components/separator/index.js +2 -0
- package/dist/components/sheet/index.cjs +38 -0
- package/dist/components/sheet/index.d.cts +40 -0
- package/dist/components/sheet/index.d.ts +40 -0
- package/dist/components/sheet/index.js +1 -0
- package/dist/components/textarea/index.cjs +10 -0
- package/dist/components/textarea/index.d.cts +9 -0
- package/dist/components/textarea/index.d.ts +9 -0
- package/dist/components/textarea/index.js +1 -0
- package/dist/components/tooltip/index.cjs +14 -0
- package/dist/components/tooltip/index.d.cts +20 -0
- package/dist/components/tooltip/index.d.ts +20 -0
- package/dist/components/tooltip/index.js +1 -0
- package/dist/{icons.cjs → icons/index.cjs} +1 -1
- package/dist/{icons.js → icons/index.js} +1 -1
- package/dist/{utils.cjs → utils/index.cjs} +1 -1
- package/dist/utils/index.js +1 -0
- package/package.json +42 -32
- package/dist/index.cjs +0 -908
- package/dist/index.d.cts +0 -285
- package/dist/index.d.ts +0 -285
- package/dist/index.js +0 -832
- package/dist/utils.js +0 -1
- /package/dist/{icons.d.cts → icons/index.d.cts} +0 -0
- /package/dist/{icons.d.ts → icons/index.d.ts} +0 -0
- /package/dist/{utils.d.cts → utils/index.d.cts} +0 -0
- /package/dist/{utils.d.ts → utils/index.d.ts} +0 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var radixUi = require('radix-ui');
|
|
4
|
+
var tailwindMerge = require('tailwind-merge');
|
|
5
|
+
var reactIcons = require('@radix-ui/react-icons');
|
|
6
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
|
|
9
|
+
var Dialog = radixUi.Dialog.Root;
|
|
10
|
+
var DialogClose = radixUi.Dialog.Close;
|
|
11
|
+
var dialogContentStyles = classVarianceAuthority.cva(
|
|
12
|
+
[
|
|
13
|
+
"bg-foreground fixed left-1/2 top-1/2 z-50 flex w-full -translate-x-1/2 -translate-y-1/2 flex-col rounded border border-gray-400 p-4 shadow-lg",
|
|
14
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] duration-200"
|
|
15
|
+
],
|
|
16
|
+
{
|
|
17
|
+
variants: {
|
|
18
|
+
width: {
|
|
19
|
+
xs: "max-w-xs",
|
|
20
|
+
sm: "max-w-sm",
|
|
21
|
+
md: "max-w-md",
|
|
22
|
+
lg: "max-w-lg",
|
|
23
|
+
xl: "max-w-xl",
|
|
24
|
+
"2xl": "max-w-2xl",
|
|
25
|
+
"3xl": "max-w-3xl",
|
|
26
|
+
"4xl": "max-w-4xl",
|
|
27
|
+
"5xl": "max-w-5xl",
|
|
28
|
+
"6xl": "max-w-6xl",
|
|
29
|
+
full: "max-w-full"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
defaultVariants: {
|
|
33
|
+
width: "md"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
function DialogOverlay(props) {
|
|
38
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
39
|
+
radixUi.Dialog.Overlay,
|
|
40
|
+
{
|
|
41
|
+
className: "bg-background/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 backdrop-blur-xs",
|
|
42
|
+
...props
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
function DialogContent({ className, children, width = "md", ...props }) {
|
|
47
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(radixUi.Dialog.Portal, { children: [
|
|
48
|
+
/* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
|
|
49
|
+
/* @__PURE__ */ jsxRuntime.jsxs(radixUi.Dialog.Content, { className: tailwindMerge.twMerge(dialogContentStyles({ width }), className), ...props, children: [
|
|
50
|
+
children,
|
|
51
|
+
/* @__PURE__ */ jsxRuntime.jsxs(radixUi.Dialog.Close, { className: "focus:ring-ring ring-primary-500 ring-offset-foreground data-[state=open]:bg-foreground absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none", children: [
|
|
52
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactIcons.Cross1Icon, { className: "size-4" }),
|
|
53
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
|
|
54
|
+
] })
|
|
55
|
+
] })
|
|
56
|
+
] });
|
|
57
|
+
}
|
|
58
|
+
var DialogTrigger = radixUi.Dialog.Trigger;
|
|
59
|
+
function DialogHeader({ className, ...props }) {
|
|
60
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: tailwindMerge.twMerge("mb-4 flex flex-col space-y-1.5 text-center sm:text-left", className), ...props });
|
|
61
|
+
}
|
|
62
|
+
function DialogFooter({ className, ...props }) {
|
|
63
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: tailwindMerge.twMerge("mt-4 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className), ...props });
|
|
64
|
+
}
|
|
65
|
+
function DialogTitle({ className, ...props }) {
|
|
66
|
+
return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Title, { className: tailwindMerge.twMerge("text-heading-6", className), ...props });
|
|
67
|
+
}
|
|
68
|
+
function DialogDescription({ className, ...props }) {
|
|
69
|
+
return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Description, { className: tailwindMerge.twMerge("text-body-2 text-gray-200", className), ...props });
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
exports.Dialog = Dialog;
|
|
73
|
+
exports.DialogClose = DialogClose;
|
|
74
|
+
exports.DialogContent = DialogContent;
|
|
75
|
+
exports.DialogDescription = DialogDescription;
|
|
76
|
+
exports.DialogFooter = DialogFooter;
|
|
77
|
+
exports.DialogHeader = DialogHeader;
|
|
78
|
+
exports.DialogTitle = DialogTitle;
|
|
79
|
+
exports.DialogTrigger = DialogTrigger;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var radixUi = require('radix-ui');
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
|
|
6
|
+
function Tooltip({
|
|
7
|
+
defaultOpen,
|
|
8
|
+
content,
|
|
9
|
+
open,
|
|
10
|
+
onOpenChange,
|
|
11
|
+
children,
|
|
12
|
+
side,
|
|
13
|
+
align,
|
|
14
|
+
collisionPadding = 8,
|
|
15
|
+
sideOffset = 8,
|
|
16
|
+
...props
|
|
17
|
+
}) {
|
|
18
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(radixUi.Tooltip.Root, { delayDuration: 0, open, defaultOpen, onOpenChange, children: [
|
|
19
|
+
/* @__PURE__ */ jsxRuntime.jsx(radixUi.Tooltip.Trigger, { asChild: true, children }),
|
|
20
|
+
content ? /* @__PURE__ */ jsxRuntime.jsx(radixUi.Tooltip.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
21
|
+
radixUi.Tooltip.Content,
|
|
22
|
+
{
|
|
23
|
+
className: "text-body-1 data-[state=delayed-open]:data-[side=bottom]:animate-slideUpAndFade data-[state=delayed-open]:data-[side=left]:animate-slideRightAndFade data-[state=delayed-open]:data-[side=right]:animate-slideLeftAndFade data-[state=delayed-open]:data-[side=top]:animate-slideDownAndFade rounded bg-white p-2 text-gray-100 will-change-[transform,opacity] select-none",
|
|
24
|
+
sideOffset,
|
|
25
|
+
side,
|
|
26
|
+
align,
|
|
27
|
+
collisionPadding,
|
|
28
|
+
...props,
|
|
29
|
+
children: [
|
|
30
|
+
content,
|
|
31
|
+
/* @__PURE__ */ jsxRuntime.jsx(radixUi.Tooltip.Arrow, { width: 8, height: 4, className: "fill-white" })
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
) }) : null
|
|
35
|
+
] });
|
|
36
|
+
}
|
|
37
|
+
function TooltipProvider({ children }) {
|
|
38
|
+
return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Tooltip.Provider, { skipDelayDuration: 500, children });
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
exports.Tooltip = Tooltip;
|
|
42
|
+
exports.TooltipProvider = TooltipProvider;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { cn } from './chunk-ZD2QRAOX.js';
|
|
2
|
+
import { AlertDialog as AlertDialog$1 } from 'radix-ui';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { twMerge } from 'tailwind-merge';
|
|
5
|
+
|
|
6
|
+
var AlertDialog = AlertDialog$1.Root;
|
|
7
|
+
var AlertDialogTrigger = AlertDialog$1.Trigger;
|
|
8
|
+
function AlertDialogOverlay({ className, ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(
|
|
10
|
+
AlertDialog$1.Overlay,
|
|
11
|
+
{
|
|
12
|
+
className: cn(
|
|
13
|
+
"bg-background/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 backdrop-blur-xs",
|
|
14
|
+
className
|
|
15
|
+
),
|
|
16
|
+
...props
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
function AlertDialogContent({ className, ...props }) {
|
|
21
|
+
return /* @__PURE__ */ jsxs(AlertDialog$1.Portal, { children: [
|
|
22
|
+
/* @__PURE__ */ jsx(AlertDialogOverlay, {}),
|
|
23
|
+
/* @__PURE__ */ jsx(
|
|
24
|
+
AlertDialog$1.Content,
|
|
25
|
+
{
|
|
26
|
+
className: cn(
|
|
27
|
+
"bg-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed top-1/2 left-1/2 z-50 flex w-full max-w-lg -translate-x-1/2 -translate-y-1/2 flex-col rounded border border-gray-400 p-4 shadow-lg duration-200",
|
|
28
|
+
className
|
|
29
|
+
),
|
|
30
|
+
...props
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
] });
|
|
34
|
+
}
|
|
35
|
+
function AlertDialogHeader({ className, ...props }) {
|
|
36
|
+
return /* @__PURE__ */ jsx("div", { className: twMerge("mb-4 flex flex-col space-y-2 text-center sm:text-left", className), ...props });
|
|
37
|
+
}
|
|
38
|
+
function AlertDialogFooter({ className, ...props }) {
|
|
39
|
+
return /* @__PURE__ */ jsx("div", { className: twMerge("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className), ...props });
|
|
40
|
+
}
|
|
41
|
+
function AlertDialogTitle({ className, ref, ...props }) {
|
|
42
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Title, { ref, className: cn("text-heading-6", className), ...props });
|
|
43
|
+
}
|
|
44
|
+
function AlertDialogDescription({ className, ...props }) {
|
|
45
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Description, { className: cn("text-body-2 text-gray-200", className), ...props });
|
|
46
|
+
}
|
|
47
|
+
var AlertDialogAction = AlertDialog$1.Action;
|
|
48
|
+
var AlertDialogCancel = AlertDialog$1.Cancel;
|
|
49
|
+
|
|
50
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger };
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkTSN5DAKH_cjs = require('./chunk-TSN5DAKH.cjs');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var reactSlot = require('@radix-ui/react-slot');
|
|
6
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
|
|
9
|
+
function _interopNamespace(e) {
|
|
10
|
+
if (e && e.__esModule) return e;
|
|
11
|
+
var n = Object.create(null);
|
|
12
|
+
if (e) {
|
|
13
|
+
Object.keys(e).forEach(function (k) {
|
|
14
|
+
if (k !== 'default') {
|
|
15
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return e[k]; }
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
n.default = e;
|
|
24
|
+
return Object.freeze(n);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
28
|
+
|
|
29
|
+
var buttonCva = classVarianceAuthority.cva(
|
|
30
|
+
[
|
|
31
|
+
"inline-flex cursor-pointer items-center justify-center align-middle no-underline transition-colors duration-300 ease-in-out",
|
|
32
|
+
"select-none appearance-none rounded-sm border font-sans font-medium tracking-[.02857em]",
|
|
33
|
+
"aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:opacity-50"
|
|
34
|
+
],
|
|
35
|
+
{
|
|
36
|
+
variants: {
|
|
37
|
+
fullWidth: {
|
|
38
|
+
true: "w-full"
|
|
39
|
+
},
|
|
40
|
+
color: {
|
|
41
|
+
neutral: "",
|
|
42
|
+
primary: "",
|
|
43
|
+
success: "",
|
|
44
|
+
warning: "",
|
|
45
|
+
error: ""
|
|
46
|
+
},
|
|
47
|
+
size: {
|
|
48
|
+
sm: "px-2.5 py-1 text-[.8125rem] leading-4",
|
|
49
|
+
md: "px-4 py-1.5 text-[0.875rem] leading-5",
|
|
50
|
+
lg: "px-5 py-2 text-[.9375rem] leading-6"
|
|
51
|
+
},
|
|
52
|
+
variant: {
|
|
53
|
+
text: "border-transparent bg-transparent",
|
|
54
|
+
outlined: "bg-transparent",
|
|
55
|
+
contained: ""
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
compoundVariants: [
|
|
59
|
+
// ---------- TEXT ---------- //
|
|
60
|
+
{
|
|
61
|
+
variant: "text",
|
|
62
|
+
color: "neutral",
|
|
63
|
+
class: [
|
|
64
|
+
"text-gray-100",
|
|
65
|
+
"hover:border-gray-350 hover:bg-gray-350 hover:text-gray-100",
|
|
66
|
+
"active:border-gray-400 active:bg-gray-400"
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
variant: "text",
|
|
71
|
+
color: "primary",
|
|
72
|
+
class: [
|
|
73
|
+
"text-primary-500",
|
|
74
|
+
"hover:border-primary-500 hover:bg-primary-500 hover:text-white",
|
|
75
|
+
"active:border-primary-600 active:bg-primary-600 active:text-white"
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
variant: "text",
|
|
80
|
+
color: "success",
|
|
81
|
+
class: [
|
|
82
|
+
"text-success-500",
|
|
83
|
+
"hover:border-success-500 hover:bg-success-500 hover:text-white",
|
|
84
|
+
"active:border-success-600 active:bg-success-600 active:text-white"
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
variant: "text",
|
|
89
|
+
color: "warning",
|
|
90
|
+
class: [
|
|
91
|
+
"text-warning-500",
|
|
92
|
+
"hover:border-warning-500 hover:bg-warning-500 hover:text-white",
|
|
93
|
+
"active:border-warning-600 active:bg-warning-600 active:text-white"
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
variant: "text",
|
|
98
|
+
color: "error",
|
|
99
|
+
class: [
|
|
100
|
+
"text-error-500",
|
|
101
|
+
"hover:border-error-500 hover:bg-error-500 hover:text-white",
|
|
102
|
+
"active:border-error-600 active:bg-error-600 active:text-white"
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
// ---------- OUTLINED ---------- //
|
|
106
|
+
{
|
|
107
|
+
variant: "outlined",
|
|
108
|
+
color: "neutral",
|
|
109
|
+
class: ["border-gray-350 text-gray-100", "hover:bg-gray-350", "active:bg-gray-400"]
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
variant: "outlined",
|
|
113
|
+
color: "primary",
|
|
114
|
+
class: [
|
|
115
|
+
"text-primary-500 border-primary-500",
|
|
116
|
+
"hover:bg-primary-500 hover:text-white",
|
|
117
|
+
"active:bg-primary-600 active:text-white"
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
variant: "outlined",
|
|
122
|
+
color: "success",
|
|
123
|
+
class: [
|
|
124
|
+
"text-success-500 border-success-500",
|
|
125
|
+
"hover:bg-success-500 hover:text-white",
|
|
126
|
+
"active:bg-success-600 active:text-white"
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
variant: "outlined",
|
|
131
|
+
color: "warning",
|
|
132
|
+
class: [
|
|
133
|
+
"text-warning-500 border-warning-500",
|
|
134
|
+
"hover:bg-warning-500 hover:text-white",
|
|
135
|
+
"active:bg-warning-600 active:text-white"
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
variant: "outlined",
|
|
140
|
+
color: "error",
|
|
141
|
+
class: [
|
|
142
|
+
"text-error-500 border-error-500",
|
|
143
|
+
"hover:bg-error-500 hover:text-white",
|
|
144
|
+
"active:bg-error-600 active:text-white"
|
|
145
|
+
]
|
|
146
|
+
},
|
|
147
|
+
// ---------- OUTLINED ---------- //
|
|
148
|
+
{
|
|
149
|
+
variant: "contained",
|
|
150
|
+
color: "neutral",
|
|
151
|
+
class: [
|
|
152
|
+
"border-gray-350 bg-gray-350 text-gray-100",
|
|
153
|
+
"hover:border-gray-300 hover:bg-gray-300",
|
|
154
|
+
"active:border-gray-400 active:bg-gray-400"
|
|
155
|
+
]
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
variant: "contained",
|
|
159
|
+
color: "primary",
|
|
160
|
+
class: [
|
|
161
|
+
"border-primary-500 bg-primary-500 text-white",
|
|
162
|
+
"hover:border-primary-400 hover:bg-primary-400",
|
|
163
|
+
"active:border-primary-600 active:bg-primary-600"
|
|
164
|
+
]
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
variant: "contained",
|
|
168
|
+
color: "success",
|
|
169
|
+
class: [
|
|
170
|
+
"border-success-500 bg-success-500 text-white",
|
|
171
|
+
"hover:border-success-400 hover:bg-success-400",
|
|
172
|
+
"active:border-success-600 active:bg-success-600"
|
|
173
|
+
]
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
variant: "contained",
|
|
177
|
+
color: "warning",
|
|
178
|
+
class: [
|
|
179
|
+
"border-warning-500 bg-warning-500 text-white",
|
|
180
|
+
"hover:border-warning-400 hover:bg-warning-400",
|
|
181
|
+
"active:border-warning-600 active:bg-warning-600"
|
|
182
|
+
]
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
variant: "contained",
|
|
186
|
+
color: "error",
|
|
187
|
+
class: [
|
|
188
|
+
"border-error-500 bg-error-500 text-white",
|
|
189
|
+
"hover:border-error-400 hover:bg-error-400",
|
|
190
|
+
"active:border-error-600 active:bg-error-600"
|
|
191
|
+
]
|
|
192
|
+
}
|
|
193
|
+
],
|
|
194
|
+
defaultVariants: {
|
|
195
|
+
fullWidth: false,
|
|
196
|
+
color: "primary",
|
|
197
|
+
size: "md",
|
|
198
|
+
variant: "text"
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
);
|
|
202
|
+
var iconContainerCva = classVarianceAuthority.cva("", {
|
|
203
|
+
variants: {
|
|
204
|
+
site: {
|
|
205
|
+
left: "",
|
|
206
|
+
right: ""
|
|
207
|
+
},
|
|
208
|
+
size: {
|
|
209
|
+
sm: "",
|
|
210
|
+
md: "",
|
|
211
|
+
lg: ""
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
compoundVariants: [
|
|
215
|
+
// ---------- LEFT ---------- //
|
|
216
|
+
{
|
|
217
|
+
site: "left",
|
|
218
|
+
size: "sm",
|
|
219
|
+
class: "-ml-0.5 mr-1.5"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
site: "left",
|
|
223
|
+
size: "md",
|
|
224
|
+
class: "-ml-1 mr-2"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
site: "left",
|
|
228
|
+
size: "lg",
|
|
229
|
+
class: "-ml-1.5 mr-2.5"
|
|
230
|
+
},
|
|
231
|
+
// ---------- RIGHT ---------- //
|
|
232
|
+
{
|
|
233
|
+
site: "right",
|
|
234
|
+
size: "sm",
|
|
235
|
+
class: "-mr-0.5 ml-1.5"
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
site: "right",
|
|
239
|
+
size: "md",
|
|
240
|
+
class: "-mr-1 ml-2"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
site: "right",
|
|
244
|
+
size: "lg",
|
|
245
|
+
class: "-mr-1.5 ml-2.5"
|
|
246
|
+
}
|
|
247
|
+
],
|
|
248
|
+
defaultVariants: {
|
|
249
|
+
site: "left",
|
|
250
|
+
size: "md"
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
var iconCva = classVarianceAuthority.cva("", {
|
|
254
|
+
variants: {
|
|
255
|
+
loading: {
|
|
256
|
+
true: "animate-spin motion-reduce:hidden"
|
|
257
|
+
},
|
|
258
|
+
size: {
|
|
259
|
+
sm: "h-4.5 w-4.5",
|
|
260
|
+
md: "size-5",
|
|
261
|
+
lg: "h-5.5 w-5.5"
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
defaultVariants: {
|
|
265
|
+
loading: false,
|
|
266
|
+
size: "md"
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
function Button({
|
|
270
|
+
asChild = false,
|
|
271
|
+
variant = "text",
|
|
272
|
+
color = "primary",
|
|
273
|
+
disabled = false,
|
|
274
|
+
fullWidth = false,
|
|
275
|
+
loadingPosition = "start",
|
|
276
|
+
ref,
|
|
277
|
+
...props
|
|
278
|
+
}) {
|
|
279
|
+
const {
|
|
280
|
+
children,
|
|
281
|
+
type = "button",
|
|
282
|
+
loading = false,
|
|
283
|
+
size = "md",
|
|
284
|
+
endIcon,
|
|
285
|
+
startIcon,
|
|
286
|
+
...rest
|
|
287
|
+
} = { ...props, loadingPosition };
|
|
288
|
+
const Comp = asChild ? reactSlot.Slot : "button";
|
|
289
|
+
const buttonStyles = buttonCva({ fullWidth, size, variant, color });
|
|
290
|
+
const isDisabled = disabled || loading;
|
|
291
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
292
|
+
Comp,
|
|
293
|
+
{
|
|
294
|
+
...asChild ? props : rest,
|
|
295
|
+
"aria-disabled": isDisabled || void 0,
|
|
296
|
+
className: buttonStyles,
|
|
297
|
+
"data-state": loading ? "loading" : void 0,
|
|
298
|
+
disabled: isDisabled,
|
|
299
|
+
ref,
|
|
300
|
+
role: Comp !== "button" ? "button" : void 0,
|
|
301
|
+
tabIndex: isDisabled ? -1 : 0,
|
|
302
|
+
type: Comp === "button" ? type : void 0,
|
|
303
|
+
children: asChild ? /* @__PURE__ */ jsxRuntime.jsx(ButtonContent, { children }) : /* @__PURE__ */ jsxRuntime.jsx(ButtonContent, { ...props })
|
|
304
|
+
}
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
function ButtonContent({
|
|
308
|
+
children,
|
|
309
|
+
loading = false,
|
|
310
|
+
size = "md",
|
|
311
|
+
loadingPosition = "start",
|
|
312
|
+
startIcon,
|
|
313
|
+
endIcon,
|
|
314
|
+
...props
|
|
315
|
+
}) {
|
|
316
|
+
const isStartLoading = loading && loadingPosition === "start";
|
|
317
|
+
const StartIcon = isStartLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunkTSN5DAKH_cjs.LoadingIcon, { "aria-label": "Loading" }) : startIcon || null;
|
|
318
|
+
const startIconStyles = iconCva({ size, loading: isStartLoading });
|
|
319
|
+
const startIconContainerStyles = iconContainerCva({ size, site: "left" });
|
|
320
|
+
const isEndLoading = loading && loadingPosition === "end";
|
|
321
|
+
const EndIcon = isEndLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunkTSN5DAKH_cjs.LoadingIcon, { "aria-label": "Loading" }) : endIcon || null;
|
|
322
|
+
const endIconStyles = iconCva({ size, loading: isEndLoading });
|
|
323
|
+
const endIconContainerStyles = iconContainerCva({ size, site: "right" });
|
|
324
|
+
const LeadingIcon = StartIcon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: startIconContainerStyles, role: isStartLoading ? "progressbar" : void 0, children: React__namespace.cloneElement(StartIcon, { className: startIconStyles }) }) : null;
|
|
325
|
+
const TrailingIcon = EndIcon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: endIconContainerStyles, role: isEndLoading ? "progressbar" : void 0, children: React__namespace.cloneElement(EndIcon, { className: endIconStyles }) }) : null;
|
|
326
|
+
return React__namespace.isValidElement(children) ? React__namespace.cloneElement(
|
|
327
|
+
children,
|
|
328
|
+
props,
|
|
329
|
+
/* @__PURE__ */ jsxRuntime.jsxs(React__namespace.Fragment, { children: [
|
|
330
|
+
LeadingIcon,
|
|
331
|
+
React__namespace.isValidElement(children) ? children.props?.children : null,
|
|
332
|
+
TrailingIcon
|
|
333
|
+
] })
|
|
334
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(React__namespace.Fragment, { children: [
|
|
335
|
+
LeadingIcon,
|
|
336
|
+
children,
|
|
337
|
+
TrailingIcon
|
|
338
|
+
] });
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
exports.Button = Button;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { HelperText } from './chunk-WTVBTZ3P.js';
|
|
2
|
+
import { Label } from './chunk-US32J7DK.js';
|
|
3
|
+
import { useFormContext, FormProvider, Controller } from 'react-hook-form';
|
|
4
|
+
import * as React2 from 'react';
|
|
5
|
+
import { twMerge } from 'tailwind-merge';
|
|
6
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
8
|
+
|
|
9
|
+
var Form = FormProvider;
|
|
10
|
+
var FormItemContext = React2.createContext({});
|
|
11
|
+
var FormItem = React2.forwardRef(function({ className, ...props }, ref) {
|
|
12
|
+
const id = React2.useId();
|
|
13
|
+
return /* @__PURE__ */ jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx("div", { ref, className: twMerge("space-y-2", className), ...props }) });
|
|
14
|
+
});
|
|
15
|
+
FormItem.displayName = "FormItem";
|
|
16
|
+
var FormFieldContext = React2.createContext({});
|
|
17
|
+
var FormField = ({
|
|
18
|
+
...props
|
|
19
|
+
}) => {
|
|
20
|
+
return /* @__PURE__ */ jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx(Controller, { ...props }) });
|
|
21
|
+
};
|
|
22
|
+
var useFormField = () => {
|
|
23
|
+
const fieldContext = React2.useContext(FormFieldContext);
|
|
24
|
+
const itemContext = React2.useContext(FormItemContext);
|
|
25
|
+
const { getFieldState, formState } = useFormContext();
|
|
26
|
+
const fieldState = getFieldState(fieldContext.name, formState);
|
|
27
|
+
if (!fieldContext) {
|
|
28
|
+
throw new Error("useFormField should be used within <FormField>");
|
|
29
|
+
}
|
|
30
|
+
const { id } = itemContext;
|
|
31
|
+
return {
|
|
32
|
+
id,
|
|
33
|
+
name: fieldContext.name,
|
|
34
|
+
formItemId: `${id}-form-item`,
|
|
35
|
+
formDescriptionId: `${id}-form-item-description`,
|
|
36
|
+
formMessageId: `${id}-form-item-message`,
|
|
37
|
+
...fieldState
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
var FormLabel = React2.forwardRef(
|
|
41
|
+
({ className, caption, ...props }, ref) => {
|
|
42
|
+
const { error, formItemId } = useFormField();
|
|
43
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-end justify-between", children: [
|
|
44
|
+
/* @__PURE__ */ jsx(
|
|
45
|
+
Label,
|
|
46
|
+
{
|
|
47
|
+
ref,
|
|
48
|
+
className: twMerge(error ? "text-error-500" : null, className),
|
|
49
|
+
htmlFor: formItemId,
|
|
50
|
+
...props
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
caption ? /* @__PURE__ */ jsx("div", { className: "typography-caption text-gray-200", children: caption }) : null
|
|
54
|
+
] });
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
FormLabel.displayName = "FormLabel";
|
|
58
|
+
var FormControl = React2.forwardRef(function(props, ref) {
|
|
59
|
+
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
60
|
+
const newProps = { ...props, invalid: !!error };
|
|
61
|
+
return /* @__PURE__ */ jsx(
|
|
62
|
+
Slot,
|
|
63
|
+
{
|
|
64
|
+
ref,
|
|
65
|
+
id: formItemId,
|
|
66
|
+
"aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,
|
|
67
|
+
"aria-invalid": !!error,
|
|
68
|
+
...newProps
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
});
|
|
72
|
+
FormControl.displayName = "FormControl";
|
|
73
|
+
var FormMessage = React2.forwardRef(function({ children, ...props }, ref) {
|
|
74
|
+
const { error, formMessageId } = useFormField();
|
|
75
|
+
const body = error ? String(error?.message) : children;
|
|
76
|
+
if (!body) {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
return /* @__PURE__ */ jsx(HelperText, { ref, type: "error", id: formMessageId, ...props, children: body });
|
|
80
|
+
});
|
|
81
|
+
FormMessage.displayName = "FormMessage";
|
|
82
|
+
var FormDescription = React2.forwardRef(function(props, ref) {
|
|
83
|
+
const { formDescriptionId } = useFormField();
|
|
84
|
+
return /* @__PURE__ */ jsx(HelperText, { ref, id: formDescriptionId, ...props });
|
|
85
|
+
});
|
|
86
|
+
FormDescription.displayName = "FormDescription";
|
|
87
|
+
|
|
88
|
+
export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage };
|