@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,113 @@
|
|
|
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.Calendar = Calendar;
|
|
38
|
+
exports.CalendarDayButton = CalendarDayButton;
|
|
39
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
40
|
+
const React = __importStar(require("react"));
|
|
41
|
+
const lucide_react_1 = require("lucide-react");
|
|
42
|
+
const react_day_picker_1 = require("react-day-picker");
|
|
43
|
+
const utils_1 = require("../lib/utils");
|
|
44
|
+
const Button_1 = require("../Button/Button");
|
|
45
|
+
function Calendar({ className, classNames, showOutsideDays = true, captionLayout = "label", buttonVariant = "ghost", formatters, components, ...props }) {
|
|
46
|
+
const defaultClassNames = (0, react_day_picker_1.getDefaultClassNames)();
|
|
47
|
+
return ((0, jsx_runtime_1.jsx)(react_day_picker_1.DayPicker, { showOutsideDays: showOutsideDays, className: (0, utils_1.cn)("bg-white group/calendar p-3 rounded-lg border border-grey-200", className), captionLayout: captionLayout, formatters: {
|
|
48
|
+
formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
|
|
49
|
+
...formatters,
|
|
50
|
+
}, classNames: {
|
|
51
|
+
root: (0, utils_1.cn)("w-fit", defaultClassNames.root),
|
|
52
|
+
months: (0, utils_1.cn)("flex gap-4 flex-col md:flex-row relative", defaultClassNames.months),
|
|
53
|
+
month: (0, utils_1.cn)("flex flex-col w-full gap-4", defaultClassNames.month),
|
|
54
|
+
nav: (0, utils_1.cn)("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between", defaultClassNames.nav),
|
|
55
|
+
button_previous: (0, utils_1.cn)((0, Button_1.buttonVariants)({ variant: buttonVariant, size: "small" }), "size-8 aria-disabled:opacity-50 p-0 select-none", defaultClassNames.button_previous),
|
|
56
|
+
button_next: (0, utils_1.cn)((0, Button_1.buttonVariants)({ variant: buttonVariant, size: "small" }), "size-8 aria-disabled:opacity-50 p-0 select-none", defaultClassNames.button_next),
|
|
57
|
+
month_caption: (0, utils_1.cn)("flex items-center justify-center h-8 w-full px-8", defaultClassNames.month_caption),
|
|
58
|
+
dropdowns: (0, utils_1.cn)("w-full flex items-center text-sm font-medium justify-center h-8 gap-1.5", defaultClassNames.dropdowns),
|
|
59
|
+
dropdown_root: (0, utils_1.cn)("relative has-focus:border-grey-400 border border-grey-300 shadow-xs has-focus:ring-grey-300/50 has-focus:ring-[3px] rounded-md", defaultClassNames.dropdown_root),
|
|
60
|
+
dropdown: (0, utils_1.cn)("absolute bg-white inset-0 opacity-0", defaultClassNames.dropdown),
|
|
61
|
+
caption_label: (0, utils_1.cn)("select-none font-medium text-main-900", captionLayout === "label"
|
|
62
|
+
? "text-sm"
|
|
63
|
+
: "rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-main-400 [&>svg]:size-3.5", defaultClassNames.caption_label),
|
|
64
|
+
table: "w-full border-collapse",
|
|
65
|
+
weekdays: (0, utils_1.cn)("flex", defaultClassNames.weekdays),
|
|
66
|
+
weekday: (0, utils_1.cn)("text-main-500 rounded-md flex-1 font-normal text-[0.8rem] select-none w-8 h-8 flex items-center justify-center", defaultClassNames.weekday),
|
|
67
|
+
week: (0, utils_1.cn)("flex w-full mt-2", defaultClassNames.week),
|
|
68
|
+
week_number_header: (0, utils_1.cn)("select-none w-8", defaultClassNames.week_number_header),
|
|
69
|
+
week_number: (0, utils_1.cn)("text-[0.8rem] select-none text-main-400", defaultClassNames.week_number),
|
|
70
|
+
day: (0, utils_1.cn)("relative w-8 h-8 p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day select-none", props.showWeekNumber
|
|
71
|
+
? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-md"
|
|
72
|
+
: "[&:first-child[data-selected=true]_button]:rounded-l-md", defaultClassNames.day),
|
|
73
|
+
range_start: (0, utils_1.cn)("rounded-l-md bg-main-100", defaultClassNames.range_start),
|
|
74
|
+
range_middle: (0, utils_1.cn)("rounded-none", defaultClassNames.range_middle),
|
|
75
|
+
range_end: (0, utils_1.cn)("rounded-r-md bg-main-100", defaultClassNames.range_end),
|
|
76
|
+
today: (0, utils_1.cn)("bg-main-100 text-main-900 rounded-md data-[selected=true]:rounded-none", defaultClassNames.today),
|
|
77
|
+
outside: (0, utils_1.cn)("text-main-300 aria-selected:text-main-400", defaultClassNames.outside),
|
|
78
|
+
disabled: (0, utils_1.cn)("text-main-300 opacity-50", defaultClassNames.disabled),
|
|
79
|
+
hidden: (0, utils_1.cn)("invisible", defaultClassNames.hidden),
|
|
80
|
+
...classNames,
|
|
81
|
+
}, components: {
|
|
82
|
+
Root: ({ className, rootRef, ...props }) => {
|
|
83
|
+
return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "calendar", ref: rootRef, className: (0, utils_1.cn)(className), ...props }));
|
|
84
|
+
},
|
|
85
|
+
Chevron: ({ className, orientation, ...props }) => {
|
|
86
|
+
if (orientation === "left") {
|
|
87
|
+
return ((0, jsx_runtime_1.jsx)(lucide_react_1.ChevronLeftIcon, { className: (0, utils_1.cn)("size-4", className), ...props }));
|
|
88
|
+
}
|
|
89
|
+
if (orientation === "right") {
|
|
90
|
+
return ((0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRightIcon, { className: (0, utils_1.cn)("size-4", className), ...props }));
|
|
91
|
+
}
|
|
92
|
+
return ((0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDownIcon, { className: (0, utils_1.cn)("size-4", className), ...props }));
|
|
93
|
+
},
|
|
94
|
+
DayButton: CalendarDayButton,
|
|
95
|
+
WeekNumber: ({ children, ...props }) => {
|
|
96
|
+
return ((0, jsx_runtime_1.jsx)("td", { ...props, children: (0, jsx_runtime_1.jsx)("div", { className: "flex size-8 items-center justify-center text-center", children: children }) }));
|
|
97
|
+
},
|
|
98
|
+
...components,
|
|
99
|
+
}, ...props }));
|
|
100
|
+
}
|
|
101
|
+
function CalendarDayButton({ className, day, modifiers, ...props }) {
|
|
102
|
+
const defaultClassNames = (0, react_day_picker_1.getDefaultClassNames)();
|
|
103
|
+
const ref = React.useRef(null);
|
|
104
|
+
React.useEffect(() => {
|
|
105
|
+
if (modifiers.focused)
|
|
106
|
+
ref.current?.focus();
|
|
107
|
+
}, [modifiers.focused]);
|
|
108
|
+
return ((0, jsx_runtime_1.jsx)(Button_1.Button, { ref: ref, variant: "ghost", size: "small", "data-day": day.date.toLocaleDateString(), "data-selected-single": modifiers.selected &&
|
|
109
|
+
!modifiers.range_start &&
|
|
110
|
+
!modifiers.range_end &&
|
|
111
|
+
!modifiers.range_middle, "data-range-start": modifiers.range_start, "data-range-end": modifiers.range_end, "data-range-middle": modifiers.range_middle, className: (0, utils_1.cn)("size-8 p-0 font-normal", "data-[selected-single=true]:bg-main-900 data-[selected-single=true]:text-white", "data-[range-middle=true]:bg-main-100 data-[range-middle=true]:text-main-900", "data-[range-start=true]:bg-main-900 data-[range-start=true]:text-white", "data-[range-end=true]:bg-main-900 data-[range-end=true]:text-white", "group-data-[focused=true]/day:border-grey-400 group-data-[focused=true]/day:ring-grey-300/50", "hover:bg-main-100 hover:text-main-900", "group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px]", "data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md", "data-[range-middle=true]:rounded-none", "data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md", defaultClassNames.day, className), ...props }));
|
|
112
|
+
}
|
|
113
|
+
Calendar.displayName = "Calendar";
|
package/Card/Card.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const cardVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "outline" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
6
|
+
export interface CardProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof cardVariants> {
|
|
7
|
+
}
|
|
8
|
+
declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent, cardVariants };
|
package/Card/Card.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
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.cardVariants = exports.CardContent = exports.CardDescription = exports.CardTitle = exports.CardFooter = exports.CardHeader = exports.Card = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const class_variance_authority_1 = require("class-variance-authority");
|
|
40
|
+
const utils_1 = require("../lib/utils");
|
|
41
|
+
const cardVariants = (0, class_variance_authority_1.cva)("rounded-xl border bg-white text-main-950 shadow-sm", {
|
|
42
|
+
variants: {
|
|
43
|
+
variant: {
|
|
44
|
+
default: "border-grey-200",
|
|
45
|
+
outline: "border-grey-300 shadow-none",
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
defaultVariants: {
|
|
49
|
+
variant: "default",
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
exports.cardVariants = cardVariants;
|
|
53
|
+
const Card = React.forwardRef(({ className, variant, ...props }, ref) => ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: (0, utils_1.cn)(cardVariants({ variant }), className), ...props })));
|
|
54
|
+
exports.Card = Card;
|
|
55
|
+
Card.displayName = "Card";
|
|
56
|
+
const CardHeader = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: (0, utils_1.cn)("flex flex-col space-y-1.5 p-6", className), ...props })));
|
|
57
|
+
exports.CardHeader = CardHeader;
|
|
58
|
+
CardHeader.displayName = "CardHeader";
|
|
59
|
+
const CardTitle = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: (0, utils_1.cn)("font-semibold leading-none tracking-tight", className), ...props })));
|
|
60
|
+
exports.CardTitle = CardTitle;
|
|
61
|
+
CardTitle.displayName = "CardTitle";
|
|
62
|
+
const CardDescription = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: (0, utils_1.cn)("text-sm text-grey-500", className), ...props })));
|
|
63
|
+
exports.CardDescription = CardDescription;
|
|
64
|
+
CardDescription.displayName = "CardDescription";
|
|
65
|
+
const CardContent = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: (0, utils_1.cn)("p-6 pt-0", className), ...props })));
|
|
66
|
+
exports.CardContent = CardContent;
|
|
67
|
+
CardContent.displayName = "CardContent";
|
|
68
|
+
const CardFooter = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: (0, utils_1.cn)("flex items-center p-6 pt-0", className), ...props })));
|
|
69
|
+
exports.CardFooter = CardFooter;
|
|
70
|
+
CardFooter.displayName = "CardFooter";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const chatBubbleVariants: (props?: ({
|
|
4
|
+
side?: "left" | "right" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
6
|
+
declare const bubbleContentVariants: (props?: ({
|
|
7
|
+
color?: "blue" | "grey" | "green" | null | undefined;
|
|
8
|
+
theme?: "dark" | "light" | null | undefined;
|
|
9
|
+
side?: "left" | "right" | null | undefined;
|
|
10
|
+
size?: "small" | "large" | "xlarge" | "medium" | null | undefined;
|
|
11
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
12
|
+
export interface ChatBubbleProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof chatBubbleVariants> {
|
|
13
|
+
/** The side of the chat bubble (left for received, right for sent) */
|
|
14
|
+
side?: "left" | "right";
|
|
15
|
+
/** The color variant of the bubble */
|
|
16
|
+
color?: "blue" | "grey" | "green";
|
|
17
|
+
/** The theme variant */
|
|
18
|
+
theme?: "dark" | "light";
|
|
19
|
+
/** The text size of the bubble */
|
|
20
|
+
size?: "small" | "medium" | "large" | "xlarge";
|
|
21
|
+
/** The message content */
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
/** Optional label shown above the bubble (e.g., sender name) */
|
|
24
|
+
label?: string;
|
|
25
|
+
/** Whether to show the label */
|
|
26
|
+
showLabel?: boolean;
|
|
27
|
+
}
|
|
28
|
+
declare const ChatBubble: React.ForwardRefExoticComponent<ChatBubbleProps & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
+
export { ChatBubble, chatBubbleVariants, bubbleContentVariants };
|
|
@@ -0,0 +1,133 @@
|
|
|
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.bubbleContentVariants = exports.chatBubbleVariants = exports.ChatBubble = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const class_variance_authority_1 = require("class-variance-authority");
|
|
40
|
+
const utils_1 = require("../lib/utils");
|
|
41
|
+
const chatBubbleVariants = (0, class_variance_authority_1.cva)("flex flex-col gap-1.5 w-full", {
|
|
42
|
+
variants: {
|
|
43
|
+
side: {
|
|
44
|
+
left: "items-start",
|
|
45
|
+
right: "items-end",
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
defaultVariants: {
|
|
49
|
+
side: "left",
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
exports.chatBubbleVariants = chatBubbleVariants;
|
|
53
|
+
const bubbleContentVariants = (0, class_variance_authority_1.cva)("px-4 py-3 font-medium leading-normal max-w-[85%]", {
|
|
54
|
+
variants: {
|
|
55
|
+
color: {
|
|
56
|
+
blue: "bg-blue-500",
|
|
57
|
+
grey: "",
|
|
58
|
+
green: "bg-green-500",
|
|
59
|
+
},
|
|
60
|
+
theme: {
|
|
61
|
+
dark: "",
|
|
62
|
+
light: "",
|
|
63
|
+
},
|
|
64
|
+
side: {
|
|
65
|
+
left: "rounded-2xl rounded-bl-md",
|
|
66
|
+
right: "rounded-2xl rounded-br-md",
|
|
67
|
+
},
|
|
68
|
+
size: {
|
|
69
|
+
small: "text-sm px-3 py-2",
|
|
70
|
+
medium: "text-base px-4 py-3",
|
|
71
|
+
large: "text-lg px-4 py-3",
|
|
72
|
+
xlarge: "text-xl px-5 py-4",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
compoundVariants: [
|
|
76
|
+
// Blue variants
|
|
77
|
+
{
|
|
78
|
+
color: "blue",
|
|
79
|
+
theme: "dark",
|
|
80
|
+
className: "bg-blue-500 text-white",
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
color: "blue",
|
|
84
|
+
theme: "light",
|
|
85
|
+
className: "bg-[#2e9dfb] text-white",
|
|
86
|
+
},
|
|
87
|
+
// Grey variants
|
|
88
|
+
{
|
|
89
|
+
color: "grey",
|
|
90
|
+
theme: "dark",
|
|
91
|
+
className: "bg-[#232323] text-white",
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
color: "grey",
|
|
95
|
+
theme: "light",
|
|
96
|
+
className: "bg-[#e7e7e7] text-neutral-900",
|
|
97
|
+
},
|
|
98
|
+
// Green variants
|
|
99
|
+
{
|
|
100
|
+
color: "green",
|
|
101
|
+
theme: "dark",
|
|
102
|
+
className: "bg-green-500 text-white",
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
color: "green",
|
|
106
|
+
theme: "light",
|
|
107
|
+
className: "bg-green-500 text-white",
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
defaultVariants: {
|
|
111
|
+
color: "blue",
|
|
112
|
+
theme: "dark",
|
|
113
|
+
side: "left",
|
|
114
|
+
size: "small",
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
exports.bubbleContentVariants = bubbleContentVariants;
|
|
118
|
+
const labelVariants = (0, class_variance_authority_1.cva)("text-sm text-neutral-400 mb-0.5", {
|
|
119
|
+
variants: {
|
|
120
|
+
side: {
|
|
121
|
+
left: "ml-3",
|
|
122
|
+
right: "mr-3",
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
defaultVariants: {
|
|
126
|
+
side: "left",
|
|
127
|
+
},
|
|
128
|
+
});
|
|
129
|
+
const ChatBubble = React.forwardRef(({ className, side = "left", color = "blue", theme = "dark", size = "small", children, label, showLabel = true, ...props }, ref) => {
|
|
130
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, className: (0, utils_1.cn)(chatBubbleVariants({ side, className })), ...props, children: [showLabel && label && ((0, jsx_runtime_1.jsx)("span", { className: (0, utils_1.cn)(labelVariants({ side })), children: label })), (0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)(bubbleContentVariants({ color, theme, side, size })), children: children })] }));
|
|
131
|
+
});
|
|
132
|
+
exports.ChatBubble = ChatBubble;
|
|
133
|
+
ChatBubble.displayName = "ChatBubble";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
3
|
+
import { type VariantProps } from "class-variance-authority";
|
|
4
|
+
declare const checkboxVariants: (props?: ({
|
|
5
|
+
size?: "small" | "regular" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
|
+
export interface CheckboxProps extends React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>, VariantProps<typeof checkboxVariants> {
|
|
8
|
+
}
|
|
9
|
+
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
+
export { Checkbox, checkboxVariants };
|
|
@@ -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.checkboxVariants = exports.Checkbox = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const CheckboxPrimitive = __importStar(require("@radix-ui/react-checkbox"));
|
|
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 checkboxVariants = (0, class_variance_authority_1.cva)("peer shrink-0 border border-grey-300 bg-white ring-offset-white focus-visible: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]:bg-main-950 data-[state=checked]:border-main-950 data-[state=checked]:text-main-50 data-[state=indeterminate]:bg-main-950 data-[state=indeterminate]:border-main-950 data-[state=indeterminate]:text-main-50", {
|
|
44
|
+
variants: {
|
|
45
|
+
size: {
|
|
46
|
+
small: "size-4 rounded-[4px]",
|
|
47
|
+
regular: "size-5 rounded-md",
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
defaultVariants: {
|
|
51
|
+
size: "regular",
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
exports.checkboxVariants = checkboxVariants;
|
|
55
|
+
const Checkbox = React.forwardRef(({ className, size, ...props }, ref) => ((0, jsx_runtime_1.jsx)(CheckboxPrimitive.Root, { ref: ref, className: (0, utils_1.cn)(checkboxVariants({ size }), className), ...props, children: (0, jsx_runtime_1.jsx)(CheckboxPrimitive.Indicator, { className: (0, utils_1.cn)("flex items-center justify-center text-current"), children: props.checked === "indeterminate" ? ((0, jsx_runtime_1.jsx)(lucide_react_1.Minus, { className: (0, utils_1.cn)(size === "small" ? "size-3" : "size-3.5") })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.Check, { className: (0, utils_1.cn)(size === "small" ? "size-3" : "size-3.5") })) }) })));
|
|
56
|
+
exports.Checkbox = Checkbox;
|
|
57
|
+
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
3
|
+
import { type VariantProps } from "class-variance-authority";
|
|
4
|
+
declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
|
|
5
|
+
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
7
|
+
declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const dialogContentVariants: (props?: ({
|
|
10
|
+
type?: "desktop" | "mobile" | null | undefined;
|
|
11
|
+
scrollable?: boolean | null | undefined;
|
|
12
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
13
|
+
export interface DialogContentProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, VariantProps<typeof dialogContentVariants> {
|
|
14
|
+
showCloseButton?: boolean;
|
|
15
|
+
closeButtonVariant?: "default" | "icon-button";
|
|
16
|
+
disableOutsideClick?: boolean;
|
|
17
|
+
loading?: boolean;
|
|
18
|
+
}
|
|
19
|
+
declare const DialogContent: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
declare const dialogHeaderVariants: (props?: ({
|
|
21
|
+
type?: "header" | "close-only" | "icon-button-close" | null | undefined;
|
|
22
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
23
|
+
export interface DialogHeaderProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof dialogHeaderVariants> {
|
|
24
|
+
}
|
|
25
|
+
declare const DialogHeader: React.ForwardRefExoticComponent<DialogHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
26
|
+
declare const dialogFooterVariants: (props?: ({
|
|
27
|
+
type?: "buttons-right" | "full-width" | "single-full-width" | null | undefined;
|
|
28
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
29
|
+
export interface DialogFooterProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof dialogFooterVariants> {
|
|
30
|
+
}
|
|
31
|
+
declare const DialogFooter: React.ForwardRefExoticComponent<DialogFooterProps & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
+
declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
33
|
+
declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
34
|
+
declare const DialogBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
35
|
+
export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, DialogBody, dialogContentVariants, dialogHeaderVariants, dialogFooterVariants, };
|
package/Dialog/Dialog.js
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
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.dialogFooterVariants = exports.dialogHeaderVariants = exports.dialogContentVariants = exports.DialogBody = exports.DialogDescription = exports.DialogTitle = exports.DialogFooter = exports.DialogHeader = exports.DialogContent = exports.DialogTrigger = exports.DialogClose = exports.DialogOverlay = exports.DialogPortal = exports.Dialog = void 0;
|
|
37
|
+
const React = __importStar(require("react"));
|
|
38
|
+
const DialogPrimitive = __importStar(require("@radix-ui/react-dialog"));
|
|
39
|
+
const lucide_react_1 = require("lucide-react");
|
|
40
|
+
const class_variance_authority_1 = require("class-variance-authority");
|
|
41
|
+
const Button_1 = require("../Button/Button");
|
|
42
|
+
const utils_1 = require("../lib/utils");
|
|
43
|
+
const Dialog = DialogPrimitive.Root;
|
|
44
|
+
exports.Dialog = Dialog;
|
|
45
|
+
const DialogTrigger = DialogPrimitive.Trigger;
|
|
46
|
+
exports.DialogTrigger = DialogTrigger;
|
|
47
|
+
const DialogPortal = DialogPrimitive.Portal;
|
|
48
|
+
exports.DialogPortal = DialogPortal;
|
|
49
|
+
const DialogClose = DialogPrimitive.Close;
|
|
50
|
+
exports.DialogClose = DialogClose;
|
|
51
|
+
const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => (React.createElement(DialogPrimitive.Overlay, { ref: ref, className: (0, utils_1.cn)("fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className), ...props })));
|
|
52
|
+
exports.DialogOverlay = DialogOverlay;
|
|
53
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
54
|
+
const dialogContentVariants = (0, class_variance_authority_1.cva)("fixed z-50 grid gap-4 bg-white border border-grey-200 shadow-lg duration-200 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", {
|
|
55
|
+
variants: {
|
|
56
|
+
type: {
|
|
57
|
+
desktop: "left-[50%] top-[50%] translate-x-[-50%] translate-y-[-50%] w-full max-w-[640px] rounded-lg",
|
|
58
|
+
mobile: "left-[50%] top-[50%] translate-x-[-50%] translate-y-[-50%] w-full max-w-[320px] rounded-lg",
|
|
59
|
+
},
|
|
60
|
+
scrollable: {
|
|
61
|
+
true: "max-h-[80vh] overflow-y-auto",
|
|
62
|
+
false: "",
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
defaultVariants: {
|
|
66
|
+
type: "desktop",
|
|
67
|
+
scrollable: false,
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
exports.dialogContentVariants = dialogContentVariants;
|
|
71
|
+
const DialogContent = React.forwardRef(({ className, children, type, scrollable, showCloseButton = true, closeButtonVariant = "default", disableOutsideClick = false, loading = false, ...props }, ref) => (React.createElement(DialogPortal, null,
|
|
72
|
+
React.createElement(DialogOverlay, null),
|
|
73
|
+
React.createElement(DialogPrimitive.Content, { ref: ref, className: (0, utils_1.cn)(dialogContentVariants({ type, scrollable, className })), onPointerDownOutside: disableOutsideClick ? (e) => e.preventDefault() : undefined, onEscapeKeyDown: disableOutsideClick ? (e) => e.preventDefault() : undefined, ...props },
|
|
74
|
+
loading && (React.createElement("div", { className: "absolute inset-0 z-10 flex items-center justify-center bg-white/80 rounded-lg" },
|
|
75
|
+
React.createElement(lucide_react_1.Loader2, { className: "size-8 text-main-600 animate-spin" }))),
|
|
76
|
+
children,
|
|
77
|
+
showCloseButton && closeButtonVariant === "default" && !loading && (React.createElement(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:shadow-[0_0_0_3px_#d4d4d4] disabled:pointer-events-none cursor-pointer" },
|
|
78
|
+
React.createElement(lucide_react_1.X, { className: "size-4 text-grey-600" }),
|
|
79
|
+
React.createElement("span", { className: "sr-only" }, "Close"))),
|
|
80
|
+
showCloseButton && closeButtonVariant === "icon-button" && !loading && (React.createElement(DialogPrimitive.Close, { asChild: true },
|
|
81
|
+
React.createElement(Button_1.Button, { variant: "ghost", size: "small", className: "absolute right-2 top-2 size-9 p-0" },
|
|
82
|
+
React.createElement(lucide_react_1.X, { className: "size-4" }),
|
|
83
|
+
React.createElement("span", { className: "sr-only" }, "Close"))))))));
|
|
84
|
+
exports.DialogContent = DialogContent;
|
|
85
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
86
|
+
const dialogHeaderVariants = (0, class_variance_authority_1.cva)("flex p-4", {
|
|
87
|
+
variants: {
|
|
88
|
+
type: {
|
|
89
|
+
header: "flex-row items-center justify-between",
|
|
90
|
+
"close-only": "flex-col items-end",
|
|
91
|
+
"icon-button-close": "flex-col items-end justify-center pr-0",
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
defaultVariants: {
|
|
95
|
+
type: "header",
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
exports.dialogHeaderVariants = dialogHeaderVariants;
|
|
99
|
+
const DialogHeader = React.forwardRef(({ className, type, ...props }, ref) => (React.createElement("div", { ref: ref, className: (0, utils_1.cn)(dialogHeaderVariants({ type, className })), ...props })));
|
|
100
|
+
exports.DialogHeader = DialogHeader;
|
|
101
|
+
DialogHeader.displayName = "DialogHeader";
|
|
102
|
+
const dialogFooterVariants = (0, class_variance_authority_1.cva)("flex gap-2 p-4", {
|
|
103
|
+
variants: {
|
|
104
|
+
type: {
|
|
105
|
+
"buttons-right": "flex-row items-center justify-end",
|
|
106
|
+
"full-width": "flex-row items-start",
|
|
107
|
+
"single-full-width": "flex-row items-start",
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
defaultVariants: {
|
|
111
|
+
type: "buttons-right",
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
exports.dialogFooterVariants = dialogFooterVariants;
|
|
115
|
+
const DialogFooter = React.forwardRef(({ className, type, children, ...props }, ref) => (React.createElement("div", { ref: ref, className: (0, utils_1.cn)(dialogFooterVariants({ type, className })), ...props }, type === "full-width" || type === "single-full-width" ? (React.createElement("div", { className: "flex gap-2 w-full" }, React.Children.map(children, (child) => React.isValidElement(child)
|
|
116
|
+
? React.cloneElement(child, {
|
|
117
|
+
className: (0, utils_1.cn)("flex-1", child.props.className),
|
|
118
|
+
})
|
|
119
|
+
: child))) : (children))));
|
|
120
|
+
exports.DialogFooter = DialogFooter;
|
|
121
|
+
DialogFooter.displayName = "DialogFooter";
|
|
122
|
+
const DialogTitle = React.forwardRef(({ className, ...props }, ref) => (React.createElement(DialogPrimitive.Title, { ref: ref, className: (0, utils_1.cn)("text-2xl font-bold leading-[1.2] tracking-tight text-main-950 font-display", className), ...props })));
|
|
123
|
+
exports.DialogTitle = DialogTitle;
|
|
124
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
125
|
+
const DialogDescription = React.forwardRef(({ className, ...props }, ref) => (React.createElement(DialogPrimitive.Description, { ref: ref, className: (0, utils_1.cn)("text-sm text-grey-600", className), ...props })));
|
|
126
|
+
exports.DialogDescription = DialogDescription;
|
|
127
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
128
|
+
const DialogBody = React.forwardRef(({ className, ...props }, ref) => (React.createElement("div", { ref: ref, className: (0, utils_1.cn)("flex-1 px-4 py-2", className), ...props })));
|
|
129
|
+
exports.DialogBody = DialogBody;
|
|
130
|
+
DialogBody.displayName = "DialogBody";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Drawer as DrawerPrimitive } from "vaul";
|
|
3
|
+
import { type VariantProps } from "class-variance-authority";
|
|
4
|
+
declare const drawerContentVariants: (props?: ({
|
|
5
|
+
direction?: "left" | "right" | "bottom" | "top" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare const drawerOverlayVariants: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
8
|
+
export type DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root> & {
|
|
9
|
+
/** Direction the drawer slides in from */
|
|
10
|
+
direction?: "bottom" | "top" | "left" | "right";
|
|
11
|
+
/** Whether clicking outside or dragging down dismisses the drawer */
|
|
12
|
+
dismissible?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type DrawerContentProps = Omit<React.ComponentProps<typeof DrawerPrimitive.Content>, "direction"> & VariantProps<typeof drawerContentVariants> & {
|
|
15
|
+
/** Whether to show the drag handle */
|
|
16
|
+
showHandle?: boolean;
|
|
17
|
+
/** Whether the drawer content is in a loading state */
|
|
18
|
+
loading?: boolean;
|
|
19
|
+
};
|
|
20
|
+
declare function Drawer({ direction, dismissible, ...props }: DrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare function DrawerTrigger({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
declare function DrawerPortal({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
declare function DrawerClose({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare function DrawerOverlay({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
declare function DrawerContent({ className, children, direction, showHandle, loading, ...props }: DrawerContentProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
declare function DrawerHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
declare function DrawerFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
declare function DrawerBody({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
declare function DrawerTitle({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
declare function DrawerDescription({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerBody, DrawerTitle, DrawerDescription, drawerContentVariants, drawerOverlayVariants, };
|