@a2v2ai/uikit 0.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/Alert/Alert.d.ts +11 -0
- package/Alert/Alert.js +64 -0
- package/AlertDialog/AlertDialog.d.ts +35 -0
- package/AlertDialog/AlertDialog.js +121 -0
- package/Avatar/Avatar.d.ts +12 -0
- package/Avatar/Avatar.js +64 -0
- package/Badge/Badge.d.ts +9 -0
- package/Badge/Badge.js +26 -0
- package/Breadcrumb/Breadcrumb.d.ts +19 -0
- package/Breadcrumb/Breadcrumb.js +65 -0
- package/Button/Button.d.ts +14 -0
- package/Button/Button.js +75 -0
- package/Calendar/Calendar.d.ts +16 -0
- package/Calendar/Calendar.js +113 -0
- package/Card/Card.d.ts +14 -0
- package/Card/Card.js +70 -0
- package/ChatBubble/ChatBubble.d.ts +29 -0
- package/ChatBubble/ChatBubble.js +133 -0
- package/Checkbox/Checkbox.d.ts +10 -0
- package/Checkbox/Checkbox.js +57 -0
- package/Dialog/Dialog.d.ts +35 -0
- package/Dialog/Dialog.js +130 -0
- package/Drawer/Drawer.d.ts +31 -0
- package/Drawer/Drawer.js +69 -0
- package/DropdownMenu/DropdownMenu.d.ts +27 -0
- package/DropdownMenu/DropdownMenu.js +85 -0
- package/ErrorMessage/ErrorMessage.d.ts +27 -0
- package/ErrorMessage/ErrorMessage.js +15 -0
- package/Flex/Flex.d.ts +23 -0
- package/Flex/Flex.js +101 -0
- package/IconButton/IconButton.d.ts +17 -0
- package/IconButton/IconButton.js +85 -0
- package/Input/Input.d.ts +16 -0
- package/Input/Input.js +75 -0
- package/InputOTP/InputOTP.d.ts +18 -0
- package/InputOTP/InputOTP.js +85 -0
- package/Label/Label.d.ts +10 -0
- package/Label/Label.js +57 -0
- package/Loader/Loader.d.ts +18 -0
- package/Loader/Loader.js +67 -0
- package/Popover/Popover.d.ts +7 -0
- package/Popover/Popover.js +49 -0
- package/Progress/Progress.d.ts +13 -0
- package/Progress/Progress.js +71 -0
- package/README.md +183 -0
- package/RadioGroup/RadioGroup.d.ts +11 -0
- package/RadioGroup/RadioGroup.js +64 -0
- package/ScrollArea/ScrollArea.d.ts +5 -0
- package/ScrollArea/ScrollArea.js +48 -0
- package/Select/Select.d.ts +19 -0
- package/Select/Select.js +85 -0
- package/Separator/Separator.d.ts +4 -0
- package/Separator/Separator.js +43 -0
- package/Skeleton/Skeleton.d.ts +4 -0
- package/Skeleton/Skeleton.js +8 -0
- package/Spinner/Spinner.d.ts +15 -0
- package/Spinner/Spinner.js +68 -0
- package/Switch/Switch.d.ts +10 -0
- package/Switch/Switch.js +67 -0
- package/Tabs/Tabs.d.ts +13 -0
- package/Tabs/Tabs.js +64 -0
- package/Textarea/Textarea.d.ts +10 -0
- package/Textarea/Textarea.js +64 -0
- package/Toast/Toast.d.ts +10 -0
- package/Toast/Toast.js +29 -0
- package/Tooltip/Tooltip.d.ts +15 -0
- package/Tooltip/Tooltip.js +68 -0
- package/Typography/Typography.d.ts +15 -0
- package/Typography/Typography.js +125 -0
- package/helpers.d.ts +4 -0
- package/helpers.js +13 -0
- package/icons.d.ts +1 -0
- package/icons.js +18 -0
- package/index.css +127 -0
- package/index.d.ts +35 -0
- package/index.js +183 -0
- package/lib/utils.d.ts +3 -0
- package/lib/utils.js +18 -0
- package/package.json +29 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.inputOTPSlotVariants = exports.inputOTPVariants = exports.InputOTPSeparator = exports.InputOTPSlot = exports.InputOTPGroup = exports.InputOTP = void 0;
|
|
38
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
39
|
+
const React = __importStar(require("react"));
|
|
40
|
+
const input_otp_1 = require("input-otp");
|
|
41
|
+
const lucide_react_1 = require("lucide-react");
|
|
42
|
+
const class_variance_authority_1 = require("class-variance-authority");
|
|
43
|
+
const utils_1 = require("../lib/utils");
|
|
44
|
+
const inputOTPVariants = (0, class_variance_authority_1.cva)("flex items-center gap-2 has-[:disabled]:opacity-50", {
|
|
45
|
+
variants: {},
|
|
46
|
+
defaultVariants: {},
|
|
47
|
+
});
|
|
48
|
+
exports.inputOTPVariants = inputOTPVariants;
|
|
49
|
+
const InputOTP = React.forwardRef(({ className, containerClassName, children, ...props }, ref) => ((0, jsx_runtime_1.jsx)(input_otp_1.OTPInput, { ref: ref, containerClassName: (0, utils_1.cn)("flex items-center gap-2 has-[:disabled]:opacity-50", containerClassName), className: (0, utils_1.cn)("disabled:cursor-not-allowed", className), ...props, render: ({ slots, isFocused, isHovering }) => ((0, jsx_runtime_1.jsx)(input_otp_1.OTPInputContext.Provider, { value: { slots, isFocused, isHovering }, children: children })) })));
|
|
50
|
+
exports.InputOTP = InputOTP;
|
|
51
|
+
InputOTP.displayName = "InputOTP";
|
|
52
|
+
const InputOTPGroup = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: (0, utils_1.cn)("flex items-center", className), ...props })));
|
|
53
|
+
exports.InputOTPGroup = InputOTPGroup;
|
|
54
|
+
InputOTPGroup.displayName = "InputOTPGroup";
|
|
55
|
+
const inputOTPSlotVariants = (0, class_variance_authority_1.cva)(
|
|
56
|
+
// Match Input component styles: border-grey-300, rounded-lg, focus ring
|
|
57
|
+
"relative flex items-center justify-center bg-white border border-grey-300 text-main-950 font-sans transition-all first:rounded-l-lg last:rounded-r-lg first:border-l border-l-0", {
|
|
58
|
+
variants: {
|
|
59
|
+
slotSize: {
|
|
60
|
+
sm: "h-8 w-8 text-sm rounded-md first:rounded-l-md last:rounded-r-md",
|
|
61
|
+
default: "h-9 w-9 text-sm",
|
|
62
|
+
lg: "h-10 w-10 text-base",
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
defaultVariants: {
|
|
66
|
+
slotSize: "default",
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
exports.inputOTPSlotVariants = inputOTPSlotVariants;
|
|
70
|
+
const InputOTPSlot = React.forwardRef(({ index, className, slotSize, ...props }, ref) => {
|
|
71
|
+
const inputOTPContext = React.useContext(input_otp_1.OTPInputContext);
|
|
72
|
+
const slot = inputOTPContext.slots[index];
|
|
73
|
+
if (!slot) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
const { char, hasFakeCaret, isActive } = slot;
|
|
77
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, className: (0, utils_1.cn)(inputOTPSlotVariants({ slotSize }),
|
|
78
|
+
// Match Input focus style: ring-[3px] ring-grey-300/50
|
|
79
|
+
isActive && "z-10 border-grey-300 ring-[3px] ring-grey-300/50", className), ...props, children: [char, hasFakeCaret && ((0, jsx_runtime_1.jsx)("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: (0, jsx_runtime_1.jsx)("div", { className: "h-4 w-px animate-caret-blink bg-main-950 duration-1000" }) }))] }));
|
|
80
|
+
});
|
|
81
|
+
exports.InputOTPSlot = InputOTPSlot;
|
|
82
|
+
InputOTPSlot.displayName = "InputOTPSlot";
|
|
83
|
+
const InputOTPSeparator = React.forwardRef(({ ...props }, ref) => ((0, jsx_runtime_1.jsx)("div", { ref: ref, role: "separator", ...props, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Minus, { className: "text-grey-400" }) })));
|
|
84
|
+
exports.InputOTPSeparator = InputOTPSeparator;
|
|
85
|
+
InputOTPSeparator.displayName = "InputOTPSeparator";
|
package/Label/Label.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
3
|
+
import { type VariantProps } from "class-variance-authority";
|
|
4
|
+
declare const labelVariants: (props?: ({
|
|
5
|
+
variant?: "default" | "error" | "muted" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
|
+
export interface LabelProps extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>, VariantProps<typeof labelVariants> {
|
|
8
|
+
}
|
|
9
|
+
declare const Label: React.ForwardRefExoticComponent<LabelProps & React.RefAttributes<HTMLLabelElement>>;
|
|
10
|
+
export { Label, labelVariants };
|
package/Label/Label.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.labelVariants = exports.Label = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const LabelPrimitive = __importStar(require("@radix-ui/react-label"));
|
|
40
|
+
const class_variance_authority_1 = require("class-variance-authority");
|
|
41
|
+
const utils_1 = require("../lib/utils");
|
|
42
|
+
const labelVariants = (0, class_variance_authority_1.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", {
|
|
43
|
+
variants: {
|
|
44
|
+
variant: {
|
|
45
|
+
default: "text-main-950",
|
|
46
|
+
muted: "text-grey-500",
|
|
47
|
+
error: "text-error-600",
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
defaultVariants: {
|
|
51
|
+
variant: "default",
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
exports.labelVariants = labelVariants;
|
|
55
|
+
const Label = React.forwardRef(({ className, variant, ...props }, ref) => ((0, jsx_runtime_1.jsx)(LabelPrimitive.Root, { ref: ref, className: (0, utils_1.cn)(labelVariants({ variant }), className), ...props })));
|
|
56
|
+
exports.Label = Label;
|
|
57
|
+
Label.displayName = LabelPrimitive.Root.displayName;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const loaderVariants: (props?: ({
|
|
4
|
+
size?: "small" | "regular" | "large" | "mini" | null | undefined;
|
|
5
|
+
color?: "main" | "current" | "grey" | "white" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
|
+
export type LoaderProps = Omit<React.HTMLAttributes<HTMLDivElement>, "color"> & VariantProps<typeof loaderVariants> & {
|
|
8
|
+
/** Optional label for accessibility */
|
|
9
|
+
label?: string;
|
|
10
|
+
};
|
|
11
|
+
declare const Loader: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, "color"> & VariantProps<(props?: ({
|
|
12
|
+
size?: "small" | "regular" | "large" | "mini" | null | undefined;
|
|
13
|
+
color?: "main" | "current" | "grey" | "white" | null | undefined;
|
|
14
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string> & {
|
|
15
|
+
/** Optional label for accessibility */
|
|
16
|
+
label?: string;
|
|
17
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
export { Loader, loaderVariants };
|
package/Loader/Loader.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.loaderVariants = exports.Loader = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const lucide_react_1 = require("lucide-react");
|
|
40
|
+
const class_variance_authority_1 = require("class-variance-authority");
|
|
41
|
+
const Flex_1 = require("../Flex/Flex");
|
|
42
|
+
const Typography_1 = require("../Typography/Typography");
|
|
43
|
+
const utils_1 = require("../lib/utils");
|
|
44
|
+
const loaderVariants = (0, class_variance_authority_1.cva)("animate-spin", {
|
|
45
|
+
variants: {
|
|
46
|
+
size: {
|
|
47
|
+
mini: "size-3",
|
|
48
|
+
small: "size-4",
|
|
49
|
+
regular: "size-6",
|
|
50
|
+
large: "size-8",
|
|
51
|
+
},
|
|
52
|
+
color: {
|
|
53
|
+
main: "text-main-600",
|
|
54
|
+
grey: "text-grey-600",
|
|
55
|
+
white: "text-white",
|
|
56
|
+
current: "text-current",
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
defaultVariants: {
|
|
60
|
+
size: "regular",
|
|
61
|
+
color: "main",
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
exports.loaderVariants = loaderVariants;
|
|
65
|
+
const Loader = React.forwardRef(({ className, size, color, label = "Loading...", ...props }, ref) => ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { ref: ref, role: "status", "aria-label": label, align: "center", justify: "center", className: (0, utils_1.cn)("inline-flex", className), ...props, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: (0, utils_1.cn)(loaderVariants({ size, color })) }), (0, jsx_runtime_1.jsx)(Typography_1.Typography, { className: "sr-only", children: label })] })));
|
|
66
|
+
exports.Loader = Loader;
|
|
67
|
+
Loader.displayName = "Loader";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
3
|
+
declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
|
|
4
|
+
declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const PopoverAnchor: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.PopoverAnchor = exports.PopoverContent = exports.PopoverTrigger = exports.Popover = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const PopoverPrimitive = __importStar(require("@radix-ui/react-popover"));
|
|
40
|
+
const utils_1 = require("../lib/utils");
|
|
41
|
+
const Popover = PopoverPrimitive.Root;
|
|
42
|
+
exports.Popover = Popover;
|
|
43
|
+
const PopoverTrigger = PopoverPrimitive.Trigger;
|
|
44
|
+
exports.PopoverTrigger = PopoverTrigger;
|
|
45
|
+
const PopoverAnchor = PopoverPrimitive.Anchor;
|
|
46
|
+
exports.PopoverAnchor = PopoverAnchor;
|
|
47
|
+
const PopoverContent = React.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => ((0, jsx_runtime_1.jsx)(PopoverPrimitive.Portal, { children: (0, jsx_runtime_1.jsx)(PopoverPrimitive.Content, { ref: ref, align: align, sideOffset: sideOffset, className: (0, utils_1.cn)("z-50 w-72 rounded-lg border border-grey-200 bg-white p-4 text-main-950 shadow-md outline-none 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className), ...props }) })));
|
|
48
|
+
exports.PopoverContent = PopoverContent;
|
|
49
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
3
|
+
import { type VariantProps } from "class-variance-authority";
|
|
4
|
+
declare const progressVariants: (props?: ({
|
|
5
|
+
size?: "small" | "regular" | "large" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare const progressIndicatorVariants: (props?: ({
|
|
8
|
+
variant?: "default" | "destructive" | "success" | "warning" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
10
|
+
export interface ProgressProps extends React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>, VariantProps<typeof progressVariants>, VariantProps<typeof progressIndicatorVariants> {
|
|
11
|
+
}
|
|
12
|
+
declare const Progress: React.ForwardRefExoticComponent<ProgressProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export { Progress, progressVariants, progressIndicatorVariants };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.progressIndicatorVariants = exports.progressVariants = exports.Progress = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const ProgressPrimitive = __importStar(require("@radix-ui/react-progress"));
|
|
40
|
+
const class_variance_authority_1 = require("class-variance-authority");
|
|
41
|
+
const utils_1 = require("../lib/utils");
|
|
42
|
+
const progressVariants = (0, class_variance_authority_1.cva)("relative w-full overflow-hidden rounded-full bg-grey-100", {
|
|
43
|
+
variants: {
|
|
44
|
+
size: {
|
|
45
|
+
small: "h-1",
|
|
46
|
+
regular: "h-2",
|
|
47
|
+
large: "h-3",
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
defaultVariants: {
|
|
51
|
+
size: "regular",
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
exports.progressVariants = progressVariants;
|
|
55
|
+
const progressIndicatorVariants = (0, class_variance_authority_1.cva)("h-full w-full flex-1 transition-all", {
|
|
56
|
+
variants: {
|
|
57
|
+
variant: {
|
|
58
|
+
default: "bg-main-950",
|
|
59
|
+
success: "bg-success-600",
|
|
60
|
+
warning: "bg-warning-500",
|
|
61
|
+
destructive: "bg-error-600",
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
defaultVariants: {
|
|
65
|
+
variant: "default",
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
exports.progressIndicatorVariants = progressIndicatorVariants;
|
|
69
|
+
const Progress = React.forwardRef(({ className, value, size, variant, ...props }, ref) => ((0, jsx_runtime_1.jsx)(ProgressPrimitive.Root, { ref: ref, className: (0, utils_1.cn)(progressVariants({ size }), className), ...props, children: (0, jsx_runtime_1.jsx)(ProgressPrimitive.Indicator, { className: (0, utils_1.cn)(progressIndicatorVariants({ variant })), style: { transform: `translateX(-${100 - (value || 0)}%)` } }) })));
|
|
70
|
+
exports.Progress = Progress;
|
|
71
|
+
Progress.displayName = ProgressPrimitive.Root.displayName;
|
package/README.md
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# a2v2-uikit
|
|
2
|
+
|
|
3
|
+
A React UI component library built with shadcn/ui and Tailwind CSS.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install a2v2-uikit
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Setup
|
|
12
|
+
|
|
13
|
+
### 1. Import Styles
|
|
14
|
+
|
|
15
|
+
Add the styles to your app's entry point:
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import "a2v2-uikit/styles.css"
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### 2. Configure Tailwind CSS
|
|
22
|
+
|
|
23
|
+
Make sure you have Tailwind CSS v4+ configured in your project.
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
### Components
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
import { Button, Input, Card, AlertDialog } from "a2v2-uikit"
|
|
31
|
+
|
|
32
|
+
function App() {
|
|
33
|
+
return (
|
|
34
|
+
<Card>
|
|
35
|
+
<Input placeholder="Enter your name" />
|
|
36
|
+
<Button variant="primary">Submit</Button>
|
|
37
|
+
</Card>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Toast Notifications
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
import { Toaster, toast } from "a2v2-uikit"
|
|
46
|
+
|
|
47
|
+
function App() {
|
|
48
|
+
return (
|
|
49
|
+
<>
|
|
50
|
+
<button onClick={() => toast.success("Saved!")}>Show Toast</button>
|
|
51
|
+
<Toaster />
|
|
52
|
+
</>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Form Validation
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
import { Input, Label, ErrorMessage } from "a2v2-uikit"
|
|
61
|
+
|
|
62
|
+
function Form() {
|
|
63
|
+
const errors = { email: "Please enter a valid email" }
|
|
64
|
+
const touched = { email: true }
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<div>
|
|
68
|
+
<Label htmlFor="email">Email</Label>
|
|
69
|
+
<Input id="email" className={errors.email ? "border-error-500" : ""} />
|
|
70
|
+
<ErrorMessage name="email" errors={errors} touched={touched} />
|
|
71
|
+
</div>
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Icons
|
|
77
|
+
|
|
78
|
+
```tsx
|
|
79
|
+
import { Home, Settings, User } from "a2v2-uikit/icons"
|
|
80
|
+
|
|
81
|
+
function Nav() {
|
|
82
|
+
return (
|
|
83
|
+
<nav>
|
|
84
|
+
<Home size={24} />
|
|
85
|
+
<Settings size={24} />
|
|
86
|
+
<User size={24} />
|
|
87
|
+
</nav>
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Helpers
|
|
93
|
+
|
|
94
|
+
```tsx
|
|
95
|
+
import { cn, cva } from "a2v2-uikit/helpers"
|
|
96
|
+
|
|
97
|
+
const buttonVariants = cva("base-class", {
|
|
98
|
+
variants: {
|
|
99
|
+
size: {
|
|
100
|
+
sm: "text-sm",
|
|
101
|
+
lg: "text-lg",
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
function MyButton({ className, size }) {
|
|
107
|
+
return <button className={cn(buttonVariants({ size }), className)} />
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Available Components
|
|
112
|
+
|
|
113
|
+
### Form Controls
|
|
114
|
+
| Component | Description |
|
|
115
|
+
|-----------|-------------|
|
|
116
|
+
| Button | Interactive buttons with variants |
|
|
117
|
+
| IconButton | Icon-only buttons |
|
|
118
|
+
| Input | Text input fields |
|
|
119
|
+
| InputOTP | One-time password input |
|
|
120
|
+
| Textarea | Multi-line text input |
|
|
121
|
+
| Checkbox | Checkbox input |
|
|
122
|
+
| RadioGroup | Radio button groups |
|
|
123
|
+
| Select | Select dropdowns |
|
|
124
|
+
| Switch | Toggle switches |
|
|
125
|
+
| Label | Form labels |
|
|
126
|
+
| ErrorMessage | Form validation errors |
|
|
127
|
+
|
|
128
|
+
### Layout
|
|
129
|
+
| Component | Description |
|
|
130
|
+
|-----------|-------------|
|
|
131
|
+
| Flex | Flexbox layout component |
|
|
132
|
+
| Card | Container for content |
|
|
133
|
+
| Separator | Visual dividers |
|
|
134
|
+
| ScrollArea | Custom scrollable areas |
|
|
135
|
+
|
|
136
|
+
### Feedback
|
|
137
|
+
| Component | Description |
|
|
138
|
+
|-----------|-------------|
|
|
139
|
+
| Alert | Displays important messages |
|
|
140
|
+
| Badge | Status indicators and labels |
|
|
141
|
+
| Loader | Loading spinners |
|
|
142
|
+
| Progress | Progress bars |
|
|
143
|
+
| Skeleton | Loading placeholders |
|
|
144
|
+
| Spinner | Animated loading spinner |
|
|
145
|
+
| ChatBubble | Chat message bubbles |
|
|
146
|
+
| Toast | Toast notifications |
|
|
147
|
+
|
|
148
|
+
### Navigation & Overlay
|
|
149
|
+
| Component | Description |
|
|
150
|
+
|-----------|-------------|
|
|
151
|
+
| AlertDialog | Modal alert dialogs |
|
|
152
|
+
| Breadcrumb | Navigation breadcrumbs |
|
|
153
|
+
| Drawer | Slide-out panels |
|
|
154
|
+
| DropdownMenu | Dropdown menus |
|
|
155
|
+
| Popover | Floating content |
|
|
156
|
+
| Tabs | Tabbed interfaces |
|
|
157
|
+
| Tooltip | Hover tooltips |
|
|
158
|
+
|
|
159
|
+
### Data Display
|
|
160
|
+
| Component | Description |
|
|
161
|
+
|-----------|-------------|
|
|
162
|
+
| Avatar | User profile images |
|
|
163
|
+
| Calendar | Date picker |
|
|
164
|
+
| Typography | Text styling component |
|
|
165
|
+
|
|
166
|
+
## Exports
|
|
167
|
+
|
|
168
|
+
| Path | Description |
|
|
169
|
+
|------|-------------|
|
|
170
|
+
| `a2v2-uikit` | All components and utilities |
|
|
171
|
+
| `a2v2-uikit/icons` | Lucide React icons |
|
|
172
|
+
| `a2v2-uikit/helpers` | Utility functions (cn, cva, clsx, twMerge) |
|
|
173
|
+
| `a2v2-uikit/styles.css` | Component styles |
|
|
174
|
+
|
|
175
|
+
## Peer Dependencies
|
|
176
|
+
|
|
177
|
+
- React 18+ or 19+
|
|
178
|
+
- React DOM 18+ or 19+
|
|
179
|
+
- Tailwind CSS 4+
|
|
180
|
+
|
|
181
|
+
## License
|
|
182
|
+
|
|
183
|
+
MIT
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
3
|
+
import { type VariantProps } from "class-variance-authority";
|
|
4
|
+
declare const RadioGroup: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const radioGroupItemVariants: (props?: ({
|
|
6
|
+
size?: "small" | "regular" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
8
|
+
export interface RadioGroupItemProps extends React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>, VariantProps<typeof radioGroupItemVariants> {
|
|
9
|
+
}
|
|
10
|
+
declare const RadioGroupItem: React.ForwardRefExoticComponent<RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
export { RadioGroup, RadioGroupItem, radioGroupItemVariants };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.radioGroupItemVariants = exports.RadioGroupItem = exports.RadioGroup = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const RadioGroupPrimitive = __importStar(require("@radix-ui/react-radio-group"));
|
|
40
|
+
const lucide_react_1 = require("lucide-react");
|
|
41
|
+
const class_variance_authority_1 = require("class-variance-authority");
|
|
42
|
+
const utils_1 = require("../lib/utils");
|
|
43
|
+
const RadioGroup = React.forwardRef(({ className, ...props }, ref) => {
|
|
44
|
+
return ((0, jsx_runtime_1.jsx)(RadioGroupPrimitive.Root, { className: (0, utils_1.cn)("grid gap-2", className), ...props, ref: ref }));
|
|
45
|
+
});
|
|
46
|
+
exports.RadioGroup = RadioGroup;
|
|
47
|
+
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
48
|
+
const radioGroupItemVariants = (0, class_variance_authority_1.cva)("aspect-square rounded-full border border-grey-300 bg-white text-main-950 ring-offset-white focus:outline-none focus-visible:ring-2 focus-visible:ring-main-950 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-main-950", {
|
|
49
|
+
variants: {
|
|
50
|
+
size: {
|
|
51
|
+
small: "size-4",
|
|
52
|
+
regular: "size-5",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
defaultVariants: {
|
|
56
|
+
size: "regular",
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
exports.radioGroupItemVariants = radioGroupItemVariants;
|
|
60
|
+
const RadioGroupItem = React.forwardRef(({ className, size, ...props }, ref) => {
|
|
61
|
+
return ((0, jsx_runtime_1.jsx)(RadioGroupPrimitive.Item, { ref: ref, className: (0, utils_1.cn)(radioGroupItemVariants({ size }), className), ...props, children: (0, jsx_runtime_1.jsx)(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Circle, { className: (0, utils_1.cn)("fill-main-950 text-main-950", size === "small" ? "size-2" : "size-2.5") }) }) }));
|
|
62
|
+
});
|
|
63
|
+
exports.RadioGroupItem = RadioGroupItem;
|
|
64
|
+
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
3
|
+
declare const ScrollArea: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const ScrollBar: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaScrollbarProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export { ScrollArea, ScrollBar };
|