@a2v2ai/uikit 0.0.3 → 0.0.5
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 +13 -0
- package/Alert/Alert.js +64 -0
- package/AlertDialog/AlertDialog.d.ts +43 -0
- package/AlertDialog/AlertDialog.js +121 -0
- package/Avatar/Avatar.d.ts +14 -0
- package/Avatar/Avatar.js +64 -0
- package/Badge/Badge.d.ts +11 -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 +20 -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 +16 -0
- package/Card/Card.js +70 -0
- package/ChatBubble/ChatBubble.d.ts +33 -0
- package/ChatBubble/ChatBubble.js +133 -0
- package/Checkbox/Checkbox.d.ts +12 -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 +33 -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 +31 -0
- package/Flex/Flex.js +101 -0
- package/IconButton/IconButton.d.ts +23 -0
- package/IconButton/IconButton.js +85 -0
- package/Input/Input.d.ts +22 -0
- package/Input/Input.js +75 -0
- package/InputOTP/InputOTP.d.ts +20 -0
- package/InputOTP/InputOTP.js +85 -0
- package/Label/Label.d.ts +12 -0
- package/Label/Label.js +57 -0
- package/Loader/Loader.d.ts +21 -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 +17 -0
- package/Progress/Progress.js +71 -0
- package/RadioGroup/RadioGroup.d.ts +13 -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 +21 -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 +19 -0
- package/Spinner/Spinner.js +68 -0
- package/Switch/Switch.d.ts +12 -0
- package/Switch/Switch.js +67 -0
- package/Tabs/Tabs.d.ts +15 -0
- package/Tabs/Tabs.js +64 -0
- package/Textarea/Textarea.d.ts +14 -0
- package/Textarea/Textarea.js +64 -0
- package/Toast/Toast.d.ts +12 -0
- package/Toast/Toast.js +29 -0
- package/Tooltip/Tooltip.d.ts +17 -0
- package/Tooltip/Tooltip.js +68 -0
- package/Typography/Typography.d.ts +19 -0
- package/Typography/Typography.js +131 -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 +21 -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 +1 -1
- package/Alert/Alert.stories.tsx +0 -121
- package/Alert/Alert.tsx +0 -71
- package/AlertDialog/AlertDialog.stories.tsx +0 -665
- package/AlertDialog/AlertDialog.tsx +0 -241
- package/Avatar/Avatar.stories.tsx +0 -128
- package/Avatar/Avatar.tsx +0 -71
- package/Badge/Badge.stories.tsx +0 -76
- package/Badge/Badge.tsx +0 -39
- package/Breadcrumb/Breadcrumb.stories.tsx +0 -231
- package/Breadcrumb/Breadcrumb.tsx +0 -114
- package/Button/Button.stories.tsx +0 -684
- package/Button/Button.tsx +0 -90
- package/Calendar/Calendar.stories.tsx +0 -207
- package/Calendar/Calendar.tsx +0 -232
- package/Card/Card.stories.tsx +0 -136
- package/Card/Card.tsx +0 -96
- package/ChatBubble/ChatBubble.stories.tsx +0 -307
- package/ChatBubble/ChatBubble.tsx +0 -167
- package/Checkbox/Checkbox.stories.tsx +0 -137
- package/Checkbox/Checkbox.tsx +0 -53
- package/Drawer/Drawer.stories.tsx +0 -721
- package/Drawer/Drawer.tsx +0 -201
- package/DropdownMenu/DropdownMenu.stories.tsx +0 -251
- package/DropdownMenu/DropdownMenu.tsx +0 -199
- package/ErrorMessage/ErrorMessage.stories.tsx +0 -159
- package/ErrorMessage/ErrorMessage.tsx +0 -55
- package/Flex/Flex.tsx +0 -102
- package/IconButton/IconButton.stories.tsx +0 -566
- package/IconButton/IconButton.tsx +0 -95
- package/Input/Input.stories.tsx +0 -456
- package/Input/Input.tsx +0 -129
- package/InputOTP/InputOTP.stories.tsx +0 -246
- package/InputOTP/InputOTP.tsx +0 -127
- package/Label/Label.stories.tsx +0 -105
- package/Label/Label.tsx +0 -43
- package/Loader/Loader.stories.tsx +0 -170
- package/Loader/Loader.tsx +0 -62
- package/Popover/Popover.stories.tsx +0 -133
- package/Popover/Popover.tsx +0 -31
- package/Progress/Progress.stories.tsx +0 -146
- package/Progress/Progress.tsx +0 -67
- package/RadioGroup/RadioGroup.stories.tsx +0 -159
- package/RadioGroup/RadioGroup.tsx +0 -68
- package/ScrollArea/ScrollArea.stories.tsx +0 -136
- package/ScrollArea/ScrollArea.tsx +0 -46
- package/Select/Select.stories.tsx +0 -242
- package/Select/Select.tsx +0 -180
- package/Separator/Separator.stories.tsx +0 -110
- package/Separator/Separator.tsx +0 -29
- package/Skeleton/Skeleton.stories.tsx +0 -117
- package/Skeleton/Skeleton.tsx +0 -16
- package/Spinner/Spinner.stories.tsx +0 -210
- package/Spinner/Spinner.tsx +0 -78
- package/Switch/Switch.stories.tsx +0 -146
- package/Switch/Switch.tsx +0 -59
- package/Tabs/Tabs.stories.tsx +0 -197
- package/Tabs/Tabs.tsx +0 -74
- package/Textarea/Textarea.stories.tsx +0 -170
- package/Textarea/Textarea.tsx +0 -51
- package/Toast/Toast.stories.tsx +0 -285
- package/Toast/Toast.tsx +0 -59
- package/Tooltip/Tooltip.stories.tsx +0 -463
- package/Tooltip/Tooltip.tsx +0 -96
- package/Typography/Typography.stories.tsx +0 -235
- package/Typography/Typography.tsx +0 -171
- package/helpers.ts +0 -5
- package/icons.ts +0 -2
- package/index.ts +0 -136
- package/lib/utils.ts +0 -15
- package/tsconfig.json +0 -24
|
@@ -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,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
3
|
+
type LabelVariant = "default" | "muted" | "error";
|
|
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> {
|
|
8
|
+
variant?: LabelVariant;
|
|
9
|
+
}
|
|
10
|
+
declare const Label: React.ForwardRefExoticComponent<LabelProps & React.RefAttributes<HTMLLabelElement>>;
|
|
11
|
+
export { Label, labelVariants };
|
|
12
|
+
export type { LabelVariant };
|
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,21 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type LoaderSize = "mini" | "small" | "regular" | "large";
|
|
3
|
+
type LoaderColor = "main" | "grey" | "white" | "current";
|
|
4
|
+
declare const loaderVariants: (props?: ({
|
|
5
|
+
size?: "small" | "regular" | "large" | "mini" | null | undefined;
|
|
6
|
+
color?: "main" | "current" | "grey" | "white" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
8
|
+
export type LoaderProps = Omit<React.HTMLAttributes<HTMLDivElement>, "color"> & {
|
|
9
|
+
size?: LoaderSize;
|
|
10
|
+
color?: LoaderColor;
|
|
11
|
+
/** Optional label for accessibility */
|
|
12
|
+
label?: string;
|
|
13
|
+
};
|
|
14
|
+
declare const Loader: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, "color"> & {
|
|
15
|
+
size?: LoaderSize;
|
|
16
|
+
color?: LoaderColor;
|
|
17
|
+
/** Optional label for accessibility */
|
|
18
|
+
label?: string;
|
|
19
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
export { Loader, loaderVariants };
|
|
21
|
+
export type { LoaderSize, LoaderColor };
|
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,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
3
|
+
type ProgressSize = "small" | "regular" | "large";
|
|
4
|
+
type ProgressVariant = "default" | "success" | "warning" | "destructive";
|
|
5
|
+
declare const progressVariants: (props?: ({
|
|
6
|
+
size?: "small" | "regular" | "large" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
8
|
+
declare const progressIndicatorVariants: (props?: ({
|
|
9
|
+
variant?: "default" | "destructive" | "success" | "warning" | null | undefined;
|
|
10
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
11
|
+
export interface ProgressProps extends React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root> {
|
|
12
|
+
size?: ProgressSize;
|
|
13
|
+
variant?: ProgressVariant;
|
|
14
|
+
}
|
|
15
|
+
declare const Progress: React.ForwardRefExoticComponent<ProgressProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export { Progress, progressVariants, progressIndicatorVariants };
|
|
17
|
+
export type { ProgressSize, ProgressVariant };
|
|
@@ -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;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
3
|
+
type RadioGroupItemSize = "small" | "regular";
|
|
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> {
|
|
9
|
+
size?: RadioGroupItemSize;
|
|
10
|
+
}
|
|
11
|
+
declare const RadioGroupItem: React.ForwardRefExoticComponent<RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
12
|
+
export { RadioGroup, RadioGroupItem, radioGroupItemVariants };
|
|
13
|
+
export type { RadioGroupItemSize };
|
|
@@ -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 };
|
|
@@ -0,0 +1,48 @@
|
|
|
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.ScrollBar = exports.ScrollArea = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const ScrollAreaPrimitive = __importStar(require("@radix-ui/react-scroll-area"));
|
|
40
|
+
const utils_1 = require("../lib/utils");
|
|
41
|
+
const ScrollArea = React.forwardRef(({ className, children, ...props }, ref) => ((0, jsx_runtime_1.jsxs)(ScrollAreaPrimitive.Root, { ref: ref, className: (0, utils_1.cn)("relative overflow-hidden", className), ...props, children: [(0, jsx_runtime_1.jsx)(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit]", children: children }), (0, jsx_runtime_1.jsx)(ScrollBar, {}), (0, jsx_runtime_1.jsx)(ScrollAreaPrimitive.Corner, {})] })));
|
|
42
|
+
exports.ScrollArea = ScrollArea;
|
|
43
|
+
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
44
|
+
const ScrollBar = React.forwardRef(({ className, orientation = "vertical", ...props }, ref) => ((0, jsx_runtime_1.jsx)(ScrollAreaPrimitive.ScrollAreaScrollbar, { ref: ref, orientation: orientation, className: (0, utils_1.cn)("flex touch-none select-none transition-colors", orientation === "vertical" &&
|
|
45
|
+
"h-full w-2.5 border-l border-l-transparent p-[1px]", orientation === "horizontal" &&
|
|
46
|
+
"h-2.5 flex-col border-t border-t-transparent p-[1px]", className), ...props, children: (0, jsx_runtime_1.jsx)(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-grey-300" }) })));
|
|
47
|
+
exports.ScrollBar = ScrollBar;
|
|
48
|
+
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
3
|
+
type SelectTriggerSize = "small" | "regular" | "large";
|
|
4
|
+
declare const Select: React.FC<SelectPrimitive.SelectProps>;
|
|
5
|
+
declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
|
|
7
|
+
declare const selectTriggerVariants: (props?: ({
|
|
8
|
+
size?: "small" | "regular" | "large" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
10
|
+
export interface SelectTriggerProps extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> {
|
|
11
|
+
size?: SelectTriggerSize;
|
|
12
|
+
}
|
|
13
|
+
declare const SelectTrigger: React.ForwardRefExoticComponent<SelectTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
14
|
+
declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, selectTriggerVariants, };
|
|
21
|
+
export type { SelectTriggerSize };
|
package/Select/Select.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
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.selectTriggerVariants = exports.SelectScrollDownButton = exports.SelectScrollUpButton = exports.SelectSeparator = exports.SelectItem = exports.SelectLabel = exports.SelectContent = exports.SelectTrigger = exports.SelectValue = exports.SelectGroup = exports.Select = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const SelectPrimitive = __importStar(require("@radix-ui/react-select"));
|
|
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 Select = SelectPrimitive.Root;
|
|
44
|
+
exports.Select = Select;
|
|
45
|
+
const SelectGroup = SelectPrimitive.Group;
|
|
46
|
+
exports.SelectGroup = SelectGroup;
|
|
47
|
+
const SelectValue = SelectPrimitive.Value;
|
|
48
|
+
exports.SelectValue = SelectValue;
|
|
49
|
+
const selectTriggerVariants = (0, class_variance_authority_1.cva)("flex w-full items-center justify-between whitespace-nowrap border border-grey-300 bg-white text-main-950 ring-offset-white placeholder:text-grey-400 focus:outline-none focus:ring-2 focus:ring-main-950 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1", {
|
|
50
|
+
variants: {
|
|
51
|
+
size: {
|
|
52
|
+
small: "h-8 px-3 text-sm rounded-md",
|
|
53
|
+
regular: "h-9 px-3 text-sm rounded-lg",
|
|
54
|
+
large: "h-10 px-3 text-base rounded-lg",
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
defaultVariants: {
|
|
58
|
+
size: "regular",
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
exports.selectTriggerVariants = selectTriggerVariants;
|
|
62
|
+
const SelectTrigger = React.forwardRef(({ className, size, children, ...props }, ref) => ((0, jsx_runtime_1.jsxs)(SelectPrimitive.Trigger, { ref: ref, className: (0, utils_1.cn)(selectTriggerVariants({ size }), className), ...props, children: [children, (0, jsx_runtime_1.jsx)(SelectPrimitive.Icon, { asChild: true, children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: "size-4 opacity-50" }) })] })));
|
|
63
|
+
exports.SelectTrigger = SelectTrigger;
|
|
64
|
+
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
65
|
+
const SelectScrollUpButton = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(SelectPrimitive.ScrollUpButton, { ref: ref, className: (0, utils_1.cn)("flex cursor-default items-center justify-center py-1", className), ...props, children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronUp, { className: "size-4" }) })));
|
|
66
|
+
exports.SelectScrollUpButton = SelectScrollUpButton;
|
|
67
|
+
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
68
|
+
const SelectScrollDownButton = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(SelectPrimitive.ScrollDownButton, { ref: ref, className: (0, utils_1.cn)("flex cursor-default items-center justify-center py-1", className), ...props, children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: "size-4" }) })));
|
|
69
|
+
exports.SelectScrollDownButton = SelectScrollDownButton;
|
|
70
|
+
SelectScrollDownButton.displayName =
|
|
71
|
+
SelectPrimitive.ScrollDownButton.displayName;
|
|
72
|
+
const SelectContent = React.forwardRef(({ className, children, position = "popper", ...props }, ref) => ((0, jsx_runtime_1.jsx)(SelectPrimitive.Portal, { children: (0, jsx_runtime_1.jsxs)(SelectPrimitive.Content, { ref: ref, className: (0, utils_1.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-lg border border-grey-200 bg-white text-main-950 shadow-md 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", position === "popper" &&
|
|
73
|
+
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className), position: position, ...props, children: [(0, jsx_runtime_1.jsx)(SelectScrollUpButton, {}), (0, jsx_runtime_1.jsx)(SelectPrimitive.Viewport, { className: (0, utils_1.cn)("p-1", position === "popper" &&
|
|
74
|
+
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"), children: children }), (0, jsx_runtime_1.jsx)(SelectScrollDownButton, {})] }) })));
|
|
75
|
+
exports.SelectContent = SelectContent;
|
|
76
|
+
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
77
|
+
const SelectLabel = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(SelectPrimitive.Label, { ref: ref, className: (0, utils_1.cn)("px-2 py-1.5 text-sm font-semibold text-grey-500", className), ...props })));
|
|
78
|
+
exports.SelectLabel = SelectLabel;
|
|
79
|
+
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
80
|
+
const SelectItem = React.forwardRef(({ className, children, ...props }, ref) => ((0, jsx_runtime_1.jsxs)(SelectPrimitive.Item, { ref: ref, className: (0, utils_1.cn)("relative flex w-full cursor-default select-none items-center rounded-md py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-grey-100 focus:text-main-950 data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), ...props, children: [(0, jsx_runtime_1.jsx)("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: (0, jsx_runtime_1.jsx)(SelectPrimitive.ItemIndicator, { children: (0, jsx_runtime_1.jsx)(lucide_react_1.Check, { className: "size-4" }) }) }), (0, jsx_runtime_1.jsx)(SelectPrimitive.ItemText, { children: children })] })));
|
|
81
|
+
exports.SelectItem = SelectItem;
|
|
82
|
+
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
83
|
+
const SelectSeparator = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(SelectPrimitive.Separator, { ref: ref, className: (0, utils_1.cn)("-mx-1 my-1 h-px bg-grey-100", className), ...props })));
|
|
84
|
+
exports.SelectSeparator = SelectSeparator;
|
|
85
|
+
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|