@a2v2ai/uikit 0.0.37 → 0.0.38
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.stories.tsx +121 -0
- package/Alert/Alert.tsx +71 -0
- package/AlertDialog/AlertDialog.stories.tsx +665 -0
- package/AlertDialog/AlertDialog.tsx +241 -0
- package/Avatar/Avatar.stories.tsx +128 -0
- package/Avatar/Avatar.tsx +71 -0
- package/Badge/Badge.stories.tsx +76 -0
- package/Badge/Badge.tsx +39 -0
- package/Breadcrumb/Breadcrumb.stories.tsx +231 -0
- package/Breadcrumb/Breadcrumb.tsx +114 -0
- package/Button/Button.stories.tsx +684 -0
- package/Button/Button.tsx +107 -0
- package/Calendar/Calendar.stories.tsx +291 -0
- package/Calendar/Calendar.tsx +246 -0
- package/Card/Card.stories.tsx +136 -0
- package/Card/Card.tsx +96 -0
- package/Carousel/Carousel.stories.tsx +256 -0
- package/Carousel/Carousel.tsx +301 -0
- package/ChatBubble/ChatBubble.stories.tsx +339 -0
- package/ChatBubble/ChatBubble.tsx +179 -0
- package/Checkbox/Checkbox.stories.tsx +137 -0
- package/Checkbox/Checkbox.tsx +53 -0
- package/DataTable/DataTable.stories.tsx +400 -0
- package/DataTable/DataTable.tsx +207 -0
- package/Drawer/Drawer.stories.tsx +721 -0
- package/Drawer/Drawer.tsx +201 -0
- package/DropdownMenu/DropdownMenu.stories.tsx +251 -0
- package/DropdownMenu/DropdownMenu.tsx +199 -0
- package/ErrorMessage/ErrorMessage.stories.tsx +159 -0
- package/ErrorMessage/ErrorMessage.tsx +55 -0
- package/Flex/Flex.stories.tsx +390 -0
- package/Flex/Flex.tsx +102 -0
- package/IconButton/IconButton.stories.tsx +566 -0
- package/IconButton/IconButton.tsx +95 -0
- package/Input/Input.stories.tsx +566 -0
- package/Input/Input.tsx +168 -0
- package/InputOTP/InputOTP.stories.tsx +246 -0
- package/InputOTP/InputOTP.tsx +127 -0
- package/Label/Label.stories.tsx +110 -0
- package/Label/Label.tsx +44 -0
- package/Loader/Loader.stories.tsx +170 -0
- package/Loader/Loader.tsx +62 -0
- package/Menubar/Menubar.stories.tsx +382 -0
- package/Menubar/Menubar.tsx +274 -0
- package/Menubar/index.ts +18 -0
- package/Pagination/Pagination.stories.tsx +196 -0
- package/Pagination/Pagination.tsx +122 -0
- package/Popover/Popover.stories.tsx +133 -0
- package/Popover/Popover.tsx +31 -0
- package/Progress/Progress.stories.tsx +146 -0
- package/Progress/Progress.tsx +67 -0
- package/RadioGroup/RadioGroup.stories.tsx +159 -0
- package/RadioGroup/RadioGroup.tsx +68 -0
- package/ScrollArea/ScrollArea.stories.tsx +136 -0
- package/ScrollArea/ScrollArea.tsx +46 -0
- package/Select/Select.stories.tsx +378 -0
- package/Select/Select.tsx +230 -0
- package/Separator/Separator.stories.tsx +110 -0
- package/Separator/Separator.tsx +29 -0
- package/Sidebar/Sidebar.stories.tsx +340 -0
- package/Sidebar/Sidebar.tsx +414 -0
- package/Sidebar/index.ts +28 -0
- package/Skeleton/Skeleton.stories.tsx +117 -0
- package/Skeleton/Skeleton.tsx +16 -0
- package/Slider/Slider.stories.tsx +216 -0
- package/Slider/Slider.tsx +29 -0
- package/Spinner/Spinner.stories.tsx +210 -0
- package/Spinner/Spinner.tsx +78 -0
- package/Switch/Switch.stories.tsx +146 -0
- package/Switch/Switch.tsx +59 -0
- package/Table/Table.stories.tsx +510 -0
- package/Table/Table.tsx +114 -0
- package/Tabs/Tabs.stories.tsx +197 -0
- package/Tabs/Tabs.tsx +74 -0
- package/Textarea/Textarea.stories.tsx +187 -0
- package/Textarea/Textarea.tsx +73 -0
- package/Toast/Toast.stories.tsx +285 -0
- package/Toast/Toast.tsx +59 -0
- package/Tooltip/Tooltip.stories.tsx +463 -0
- package/Tooltip/Tooltip.tsx +96 -0
- package/Typography/Typography.stories.tsx +425 -0
- package/Typography/Typography.tsx +106 -0
- package/helpers.ts +5 -0
- package/{icons.js → icons.ts} +1 -1
- package/index.ts +217 -0
- package/lib/typography-types.ts +223 -0
- package/lib/utils.ts +15 -0
- package/package.json +5 -2
- package/tsconfig.json +22 -0
- package/Alert/Alert.d.ts +0 -13
- package/Alert/Alert.js +0 -25
- package/AlertDialog/AlertDialog.d.ts +0 -43
- package/AlertDialog/AlertDialog.js +0 -71
- package/Avatar/Avatar.d.ts +0 -14
- package/Avatar/Avatar.js +0 -25
- package/Badge/Badge.d.ts +0 -11
- package/Badge/Badge.js +0 -23
- package/Breadcrumb/Breadcrumb.d.ts +0 -19
- package/Breadcrumb/Breadcrumb.js +0 -23
- package/Button/Button.d.ts +0 -23
- package/Button/Button.js +0 -52
- package/Calendar/Calendar.d.ts +0 -20
- package/Calendar/Calendar.js +0 -78
- package/Card/Card.d.ts +0 -16
- package/Card/Card.js +0 -28
- package/Carousel/Carousel.d.ts +0 -37
- package/Carousel/Carousel.js +0 -132
- package/ChatBubble/ChatBubble.d.ts +0 -33
- package/ChatBubble/ChatBubble.js +0 -107
- package/Checkbox/Checkbox.d.ts +0 -12
- package/Checkbox/Checkbox.js +0 -20
- package/DataTable/DataTable.d.ts +0 -35
- package/DataTable/DataTable.js +0 -51
- package/Drawer/Drawer.d.ts +0 -33
- package/Drawer/Drawer.js +0 -55
- package/DropdownMenu/DropdownMenu.d.ts +0 -27
- package/DropdownMenu/DropdownMenu.js +0 -35
- package/ErrorMessage/ErrorMessage.d.ts +0 -27
- package/ErrorMessage/ErrorMessage.js +0 -14
- package/Flex/Flex.d.ts +0 -31
- package/Flex/Flex.js +0 -64
- package/IconButton/IconButton.d.ts +0 -23
- package/IconButton/IconButton.js +0 -48
- package/Input/Input.d.ts +0 -27
- package/Input/Input.js +0 -42
- package/InputOTP/InputOTP.d.ts +0 -20
- package/InputOTP/InputOTP.js +0 -44
- package/Label/Label.d.ts +0 -13
- package/Label/Label.js +0 -19
- package/Loader/Loader.d.ts +0 -21
- package/Loader/Loader.js +0 -30
- package/Menubar/Menubar.d.ts +0 -26
- package/Menubar/Menubar.js +0 -54
- package/Menubar/index.d.ts +0 -1
- package/Menubar/index.js +0 -1
- package/Pagination/Pagination.d.ts +0 -35
- package/Pagination/Pagination.js +0 -37
- package/Popover/Popover.d.ts +0 -7
- package/Popover/Popover.js +0 -10
- package/Progress/Progress.d.ts +0 -17
- package/Progress/Progress.js +0 -33
- package/RadioGroup/RadioGroup.d.ts +0 -13
- package/RadioGroup/RadioGroup.js +0 -26
- package/ScrollArea/ScrollArea.d.ts +0 -5
- package/ScrollArea/ScrollArea.js +0 -11
- package/Select/Select.d.ts +0 -29
- package/Select/Select.js +0 -50
- package/Separator/Separator.d.ts +0 -4
- package/Separator/Separator.js +0 -7
- package/Sidebar/Sidebar.d.ts +0 -48
- package/Sidebar/Sidebar.js +0 -116
- package/Sidebar/index.d.ts +0 -2
- package/Sidebar/index.js +0 -1
- package/Skeleton/Skeleton.d.ts +0 -4
- package/Skeleton/Skeleton.js +0 -7
- package/Slider/Slider.d.ts +0 -6
- package/Slider/Slider.js +0 -7
- package/Spinner/Spinner.d.ts +0 -19
- package/Spinner/Spinner.js +0 -31
- package/Switch/Switch.d.ts +0 -12
- package/Switch/Switch.js +0 -30
- package/Table/Table.d.ts +0 -10
- package/Table/Table.js +0 -20
- package/Tabs/Tabs.d.ts +0 -15
- package/Tabs/Tabs.js +0 -24
- package/Textarea/Textarea.d.ts +0 -19
- package/Textarea/Textarea.js +0 -31
- package/Toast/Toast.d.ts +0 -12
- package/Toast/Toast.js +0 -25
- package/Tooltip/Tooltip.d.ts +0 -17
- package/Tooltip/Tooltip.js +0 -29
- package/Typography/Typography.d.ts +0 -20
- package/Typography/Typography.js +0 -43
- package/helpers.d.ts +0 -4
- package/helpers.js +0 -5
- package/icons.d.ts +0 -1
- package/index.d.ts +0 -42
- package/index.js +0 -45
- package/lib/typography-types.d.ts +0 -4
- package/lib/typography-types.js +0 -90
- package/lib/utils.d.ts +0 -3
- package/lib/utils.js +0 -14
package/ChatBubble/ChatBubble.js
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { cva } from "class-variance-authority";
|
|
4
|
-
import { cn } from "../lib/utils";
|
|
5
|
-
const chatBubbleVariants = cva("flex flex-col gap-1.5 w-full", {
|
|
6
|
-
variants: {
|
|
7
|
-
side: {
|
|
8
|
-
left: "items-start",
|
|
9
|
-
right: "items-end",
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
defaultVariants: {
|
|
13
|
-
side: "left",
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
|
-
const bubbleContentVariants = cva("px-4 py-3 leading-normal max-w-[85%]", {
|
|
17
|
-
variants: {
|
|
18
|
-
color: {
|
|
19
|
-
blue: "bg-blue-500",
|
|
20
|
-
grey: "",
|
|
21
|
-
green: "bg-green-500",
|
|
22
|
-
lightGrey: "",
|
|
23
|
-
},
|
|
24
|
-
theme: {
|
|
25
|
-
dark: "",
|
|
26
|
-
light: "",
|
|
27
|
-
},
|
|
28
|
-
side: {
|
|
29
|
-
left: "rounded-t-2xl rounded-br-2xl rounded-bl-md",
|
|
30
|
-
right: "rounded-t-2xl rounded-bl-2xl rounded-br-md",
|
|
31
|
-
},
|
|
32
|
-
size: {
|
|
33
|
-
small: "text-sm px-3 py-2",
|
|
34
|
-
medium: "text-base px-4 py-3",
|
|
35
|
-
large: "text-lg px-4 py-3",
|
|
36
|
-
xlarge: "text-xl px-5 py-4",
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
compoundVariants: [
|
|
40
|
-
// Blue variants
|
|
41
|
-
{
|
|
42
|
-
color: "blue",
|
|
43
|
-
theme: "dark",
|
|
44
|
-
className: "bg-blue-500 text-white",
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
color: "blue",
|
|
48
|
-
theme: "light",
|
|
49
|
-
className: "bg-[#2e9dfb] text-white",
|
|
50
|
-
},
|
|
51
|
-
// Grey variants
|
|
52
|
-
{
|
|
53
|
-
color: "grey",
|
|
54
|
-
theme: "dark",
|
|
55
|
-
className: "bg-[#3F3F46] text-[#F4F4F5]",
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
color: "grey",
|
|
59
|
-
theme: "light",
|
|
60
|
-
className: "bg-main-100 text-[#52525B]",
|
|
61
|
-
},
|
|
62
|
-
// Green variants
|
|
63
|
-
{
|
|
64
|
-
color: "green",
|
|
65
|
-
theme: "dark",
|
|
66
|
-
className: "bg-green-500 text-white",
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
color: "green",
|
|
70
|
-
theme: "light",
|
|
71
|
-
className: "bg-green-500 text-white",
|
|
72
|
-
},
|
|
73
|
-
// Light-grey variants
|
|
74
|
-
{
|
|
75
|
-
color: "lightGrey",
|
|
76
|
-
theme: "dark",
|
|
77
|
-
className: "bg-background-neutral-100 text-main-600",
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
color: "lightGrey",
|
|
81
|
-
theme: "light",
|
|
82
|
-
className: "bg-background-neutral-100 text-main-600",
|
|
83
|
-
},
|
|
84
|
-
],
|
|
85
|
-
defaultVariants: {
|
|
86
|
-
color: "blue",
|
|
87
|
-
theme: "dark",
|
|
88
|
-
side: "left",
|
|
89
|
-
size: "small",
|
|
90
|
-
},
|
|
91
|
-
});
|
|
92
|
-
const labelVariants = cva("text-sm text-neutral-400 mb-0.5", {
|
|
93
|
-
variants: {
|
|
94
|
-
side: {
|
|
95
|
-
left: "ml-3",
|
|
96
|
-
right: "mr-3",
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
defaultVariants: {
|
|
100
|
-
side: "left",
|
|
101
|
-
},
|
|
102
|
-
});
|
|
103
|
-
const ChatBubble = React.forwardRef(({ className, side = "left", color = "blue", theme = "dark", size = "small", children, label, showLabel = true, ...props }, ref) => {
|
|
104
|
-
return (_jsxs("div", { ref: ref, className: cn(chatBubbleVariants({ side, className })), ...props, children: [showLabel && label && (_jsx("span", { className: cn(labelVariants({ side })), children: label })), _jsx("div", { className: cn(bubbleContentVariants({ color, theme, side, size })), children: children })] }));
|
|
105
|
-
});
|
|
106
|
-
ChatBubble.displayName = "ChatBubble";
|
|
107
|
-
export { ChatBubble, chatBubbleVariants, bubbleContentVariants };
|
package/Checkbox/Checkbox.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
3
|
-
type CheckboxSize = "small" | "regular";
|
|
4
|
-
declare const checkboxVariants: (props?: ({
|
|
5
|
-
size?: "small" | "regular" | null | undefined;
|
|
6
|
-
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
-
export interface CheckboxProps extends React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> {
|
|
8
|
-
size?: CheckboxSize;
|
|
9
|
-
}
|
|
10
|
-
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
-
export { Checkbox, checkboxVariants };
|
|
12
|
-
export type { CheckboxSize };
|
package/Checkbox/Checkbox.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
4
|
-
import { Check, Minus } from "lucide-react";
|
|
5
|
-
import { cva } from "class-variance-authority";
|
|
6
|
-
import { cn } from "../lib/utils";
|
|
7
|
-
const checkboxVariants = cva("peer shrink-0 border border-grey-300 bg-white ring-offset-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-600 focus-visible:ring-offset-2 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-accent-600 data-[state=checked]:border-accent-600 data-[state=checked]:text-white data-[state=indeterminate]:bg-accent-600 data-[state=indeterminate]:border-accent-600 data-[state=indeterminate]:text-white", {
|
|
8
|
-
variants: {
|
|
9
|
-
size: {
|
|
10
|
-
small: "size-4 rounded-[4px]",
|
|
11
|
-
regular: "size-5 rounded-md",
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
defaultVariants: {
|
|
15
|
-
size: "regular",
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
const Checkbox = React.forwardRef(({ className, size, ...props }, ref) => (_jsx(CheckboxPrimitive.Root, { ref: ref, className: cn(checkboxVariants({ size }), className), ...props, children: _jsx(CheckboxPrimitive.Indicator, { className: cn("flex items-center justify-center text-current"), children: props.checked === "indeterminate" ? (_jsx(Minus, { className: cn(size === "small" ? "size-3" : "size-3.5") })) : (_jsx(Check, { className: cn(size === "small" ? "size-3" : "size-3.5") })) }) })));
|
|
19
|
-
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
20
|
-
export { Checkbox, checkboxVariants };
|
package/DataTable/DataTable.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
interface DataTableColumn<T> {
|
|
3
|
-
key: string;
|
|
4
|
-
title: string;
|
|
5
|
-
titleRender?: () => ReactNode;
|
|
6
|
-
dataIndex?: keyof T;
|
|
7
|
-
width?: string | number;
|
|
8
|
-
render?: (value: unknown, record: T, index: number) => ReactNode;
|
|
9
|
-
className?: string;
|
|
10
|
-
}
|
|
11
|
-
interface DataTablePagination {
|
|
12
|
-
current: number;
|
|
13
|
-
pageSize: number;
|
|
14
|
-
total: number;
|
|
15
|
-
onChange: (page: number) => void;
|
|
16
|
-
}
|
|
17
|
-
interface DataTableScroll {
|
|
18
|
-
y?: number | string;
|
|
19
|
-
}
|
|
20
|
-
interface DataTableProps<T extends object> {
|
|
21
|
-
columns: DataTableColumn<T>[];
|
|
22
|
-
dataSource: T[];
|
|
23
|
-
rowKey: keyof T | ((record: T) => string);
|
|
24
|
-
className?: string;
|
|
25
|
-
pagination?: DataTablePagination;
|
|
26
|
-
scroll?: DataTableScroll;
|
|
27
|
-
loading?: boolean;
|
|
28
|
-
loadingRows?: number;
|
|
29
|
-
}
|
|
30
|
-
declare const DataTable: {
|
|
31
|
-
<T extends object>({ columns, dataSource, rowKey, className, pagination, scroll, loading, loadingRows, }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
32
|
-
displayName: string;
|
|
33
|
-
};
|
|
34
|
-
export { DataTable };
|
|
35
|
-
export type { DataTableColumn, DataTableProps, DataTablePagination, DataTableScroll };
|
package/DataTable/DataTable.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "../Table/Table";
|
|
3
|
-
import { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, } from "../Pagination/Pagination";
|
|
4
|
-
import { Skeleton } from "../Skeleton/Skeleton";
|
|
5
|
-
const getPageNumbers = (current, totalPages) => {
|
|
6
|
-
const pages = [];
|
|
7
|
-
if (totalPages <= 7) {
|
|
8
|
-
for (let i = 1; i <= totalPages; i++) {
|
|
9
|
-
pages.push(i);
|
|
10
|
-
}
|
|
11
|
-
return pages;
|
|
12
|
-
}
|
|
13
|
-
// Always show first page
|
|
14
|
-
pages.push(1);
|
|
15
|
-
if (current <= 3) {
|
|
16
|
-
// Near the start
|
|
17
|
-
pages.push(2, 3, 4, "ellipsis", totalPages);
|
|
18
|
-
}
|
|
19
|
-
else if (current >= totalPages - 2) {
|
|
20
|
-
// Near the end
|
|
21
|
-
pages.push("ellipsis", totalPages - 3, totalPages - 2, totalPages - 1, totalPages);
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
// In the middle
|
|
25
|
-
pages.push("ellipsis", current - 1, current, current + 1, "ellipsis", totalPages);
|
|
26
|
-
}
|
|
27
|
-
return pages;
|
|
28
|
-
};
|
|
29
|
-
const DataTable = ({ columns, dataSource, rowKey, className, pagination, scroll, loading, loadingRows = 5, }) => {
|
|
30
|
-
const getRowKey = (record) => {
|
|
31
|
-
if (typeof rowKey === "function") {
|
|
32
|
-
return rowKey(record);
|
|
33
|
-
}
|
|
34
|
-
return String(record[rowKey]);
|
|
35
|
-
};
|
|
36
|
-
const getCellValue = (record, column, index) => {
|
|
37
|
-
const value = column.dataIndex ? record[column.dataIndex] : undefined;
|
|
38
|
-
if (column.render) {
|
|
39
|
-
return column.render(value, record, index);
|
|
40
|
-
}
|
|
41
|
-
return value;
|
|
42
|
-
};
|
|
43
|
-
const totalPages = pagination ? Math.ceil(pagination.total / pagination.pageSize) : 0;
|
|
44
|
-
const pageNumbers = pagination ? getPageNumbers(pagination.current, totalPages) : [];
|
|
45
|
-
const tableContent = (_jsxs(Table, { className: className, children: [_jsx(TableHeader, { className: scroll?.y ? "sticky top-0 z-10" : undefined, children: _jsx(TableRow, { children: columns.map((column) => (_jsx(TableHead, { className: column.className, style: { width: column.width }, children: column.titleRender ? column.titleRender() : column.title }, column.key))) }) }), _jsx(TableBody, { children: loading
|
|
46
|
-
? Array.from({ length: loadingRows }).map((_, rowIndex) => (_jsx(TableRow, { children: columns.map((column) => (_jsx(TableCell, { children: _jsx(Skeleton, { className: "h-4 w-full" }) }, column.key))) }, `skeleton-${rowIndex}`)))
|
|
47
|
-
: dataSource.map((record, index) => (_jsx(TableRow, { children: columns.map((column) => (_jsx(TableCell, { children: getCellValue(record, column, index) }, column.key))) }, getRowKey(record)))) })] }));
|
|
48
|
-
return (_jsxs("div", { className: "w-full", children: [scroll?.y ? (_jsx("div", { className: "relative w-full overflow-auto", style: { maxHeight: scroll.y }, children: tableContent })) : (tableContent), pagination && totalPages > 1 && (_jsx("div", { className: "mt-4", children: _jsx(Pagination, { children: _jsxs(PaginationContent, { children: [_jsx(PaginationItem, { children: _jsx(PaginationPrevious, { disabled: pagination.current === 1, onClick: () => pagination.onChange(pagination.current - 1) }) }), pageNumbers.map((page, index) => (_jsx(PaginationItem, { children: page === "ellipsis" ? (_jsx(PaginationEllipsis, {})) : (_jsx(PaginationLink, { isActive: page === pagination.current, onClick: () => pagination.onChange(page), children: page })) }, index))), _jsx(PaginationItem, { children: _jsx(PaginationNext, { disabled: pagination.current === totalPages, onClick: () => pagination.onChange(pagination.current + 1) }) })] }) }) }))] }));
|
|
49
|
-
};
|
|
50
|
-
DataTable.displayName = "DataTable";
|
|
51
|
-
export { DataTable };
|
package/Drawer/Drawer.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { Drawer as DrawerPrimitive } from "vaul";
|
|
3
|
-
type DrawerDirection = "bottom" | "top" | "left" | "right";
|
|
4
|
-
declare const drawerContentVariants: (props?: ({
|
|
5
|
-
direction?: "left" | "right" | "bottom" | "top" | null | undefined;
|
|
6
|
-
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
-
declare const drawerOverlayVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
8
|
-
export type DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root> & {
|
|
9
|
-
/** Direction the drawer slides in from */
|
|
10
|
-
direction?: DrawerDirection;
|
|
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"> & {
|
|
15
|
-
direction?: DrawerDirection;
|
|
16
|
-
/** Whether to show the drag handle */
|
|
17
|
-
showHandle?: boolean;
|
|
18
|
-
/** Whether the drawer content is in a loading state */
|
|
19
|
-
loading?: boolean;
|
|
20
|
-
};
|
|
21
|
-
declare function Drawer({ direction, dismissible, ...props }: DrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
declare function DrawerTrigger({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
declare function DrawerPortal({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
declare function DrawerClose({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
declare function DrawerOverlay({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
declare function DrawerContent({ className, children, direction, showHandle, loading, ...props }: DrawerContentProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
-
declare function DrawerHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
declare function DrawerFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
29
|
-
declare function DrawerBody({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
30
|
-
declare function DrawerTitle({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
|
|
31
|
-
declare function DrawerDescription({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
|
|
32
|
-
export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerBody, DrawerTitle, DrawerDescription, drawerContentVariants, drawerOverlayVariants, };
|
|
33
|
-
export type { DrawerDirection };
|
package/Drawer/Drawer.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { Drawer as DrawerPrimitive } from "vaul";
|
|
4
|
-
import { cva } from "class-variance-authority";
|
|
5
|
-
import { Loader } from "../Loader/Loader";
|
|
6
|
-
import { cn } from "../lib/utils";
|
|
7
|
-
const drawerContentVariants = cva("group/drawer-content fixed z-50 flex h-auto flex-col bg-white", {
|
|
8
|
-
variants: {
|
|
9
|
-
direction: {
|
|
10
|
-
bottom: "inset-x-0 bottom-0 mt-24 max-h-[80vh] rounded-t-[10px]",
|
|
11
|
-
top: "inset-x-0 top-0 mb-24 max-h-[80vh] rounded-b-[10px]",
|
|
12
|
-
left: "inset-y-0 left-0 w-3/4 sm:max-w-sm rounded-r-[10px]",
|
|
13
|
-
right: "inset-y-0 right-0 w-3/4 sm:max-w-sm rounded-l-[10px]",
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
defaultVariants: {
|
|
17
|
-
direction: "bottom",
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
|
-
const drawerOverlayVariants = cva("fixed inset-0 z-50 bg-black/60 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0");
|
|
21
|
-
function Drawer({ direction = "bottom", dismissible = true, ...props }) {
|
|
22
|
-
return (_jsx(DrawerPrimitive.Root, { direction: direction, dismissible: dismissible, ...props }));
|
|
23
|
-
}
|
|
24
|
-
function DrawerTrigger({ ...props }) {
|
|
25
|
-
return _jsx(DrawerPrimitive.Trigger, { ...props });
|
|
26
|
-
}
|
|
27
|
-
function DrawerPortal({ ...props }) {
|
|
28
|
-
return _jsx(DrawerPrimitive.Portal, { ...props });
|
|
29
|
-
}
|
|
30
|
-
function DrawerClose({ ...props }) {
|
|
31
|
-
return _jsx(DrawerPrimitive.Close, { ...props });
|
|
32
|
-
}
|
|
33
|
-
function DrawerOverlay({ className, ...props }) {
|
|
34
|
-
return (_jsx(DrawerPrimitive.Overlay, { className: cn(drawerOverlayVariants(), className), ...props }));
|
|
35
|
-
}
|
|
36
|
-
function DrawerContent({ className, children, direction = "bottom", showHandle = true, loading = false, ...props }) {
|
|
37
|
-
const isVertical = direction === "bottom" || direction === "top";
|
|
38
|
-
return (_jsxs(DrawerPortal, { children: [_jsx(DrawerOverlay, {}), _jsxs(DrawerPrimitive.Content, { className: cn(drawerContentVariants({ direction }), "shadow-lg", className), ...props, children: [showHandle && isVertical && (_jsx("div", { className: cn("mx-auto shrink-0 rounded-full bg-neutral-200", direction === "bottom" ? "mt-2 mb-4" : "mb-2 mt-4", "h-[3px] w-[50px]") })), loading ? (_jsx("div", { className: "flex flex-1 items-center justify-center p-8", children: _jsx(Loader, { size: "large", color: "grey" }) })) : (children)] })] }));
|
|
39
|
-
}
|
|
40
|
-
function DrawerHeader({ className, ...props }) {
|
|
41
|
-
return (_jsx("div", { className: cn("flex flex-col gap-1.5 p-4 text-center sm:text-left", className), ...props }));
|
|
42
|
-
}
|
|
43
|
-
function DrawerFooter({ className, ...props }) {
|
|
44
|
-
return (_jsx("div", { className: cn("mt-auto flex flex-col gap-2 p-4", className), ...props }));
|
|
45
|
-
}
|
|
46
|
-
function DrawerBody({ className, ...props }) {
|
|
47
|
-
return (_jsx("div", { className: cn("flex-1 overflow-auto p-4", className), ...props }));
|
|
48
|
-
}
|
|
49
|
-
function DrawerTitle({ className, ...props }) {
|
|
50
|
-
return (_jsx(DrawerPrimitive.Title, { className: cn("text-lg font-semibold text-neutral-900", className), ...props }));
|
|
51
|
-
}
|
|
52
|
-
function DrawerDescription({ className, ...props }) {
|
|
53
|
-
return (_jsx(DrawerPrimitive.Description, { className: cn("text-sm text-neutral-500", className), ...props }));
|
|
54
|
-
}
|
|
55
|
-
export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerBody, DrawerTitle, DrawerDescription, drawerContentVariants, drawerOverlayVariants, };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
3
|
-
declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
4
|
-
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
-
declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
-
declare const DropdownMenuPortal: React.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
|
|
7
|
-
declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
|
8
|
-
declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
-
declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
10
|
-
inset?: boolean;
|
|
11
|
-
} & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
-
declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
-
declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
-
declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
15
|
-
inset?: boolean;
|
|
16
|
-
} & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
-
declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
-
declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
-
declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
20
|
-
inset?: boolean;
|
|
21
|
-
} & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
-
declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
-
declare const DropdownMenuShortcut: {
|
|
24
|
-
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
displayName: string;
|
|
26
|
-
};
|
|
27
|
-
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
4
|
-
import { Check, ChevronRight, Circle } from "lucide-react";
|
|
5
|
-
import { cn } from "../lib/utils";
|
|
6
|
-
const DropdownMenu = DropdownMenuPrimitive.Root;
|
|
7
|
-
const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
8
|
-
const DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
9
|
-
const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
10
|
-
const DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
11
|
-
const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
12
|
-
const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.SubTrigger, { ref: ref, className: cn("flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none focus:bg-grey-100 data-[state=open]:bg-grey-100 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", inset && "pl-8", className), ...props, children: [children, _jsx(ChevronRight, { className: "ml-auto" })] })));
|
|
13
|
-
DropdownMenuSubTrigger.displayName =
|
|
14
|
-
DropdownMenuPrimitive.SubTrigger.displayName;
|
|
15
|
-
const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.SubContent, { ref: ref, className: cn("z-50 min-w-[8rem] overflow-hidden rounded-lg border border-grey-200 bg-white p-1 text-main-950 shadow-lg 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 })));
|
|
16
|
-
DropdownMenuSubContent.displayName =
|
|
17
|
-
DropdownMenuPrimitive.SubContent.displayName;
|
|
18
|
-
const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { ref: ref, sideOffset: sideOffset, className: cn("z-50 min-w-[8rem] overflow-hidden rounded-lg border border-grey-200 bg-white p-1 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", className), ...props }) })));
|
|
19
|
-
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
20
|
-
const DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Item, { ref: ref, className: cn("relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none transition-colors focus:bg-grey-100 focus:text-main-950 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0", inset && "pl-8", className), ...props })));
|
|
21
|
-
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
22
|
-
const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.CheckboxItem, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-md py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-grey-100 focus:text-main-950 data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), checked: checked, ...props, children: [_jsx("span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Check, { className: "size-4" }) }) }), children] })));
|
|
23
|
-
DropdownMenuCheckboxItem.displayName =
|
|
24
|
-
DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
25
|
-
const DropdownMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.RadioItem, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-md py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-grey-100 focus:text-main-950 data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), ...props, children: [_jsx("span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Circle, { className: "size-2 fill-current" }) }) }), children] })));
|
|
26
|
-
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
27
|
-
const DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Label, { ref: ref, className: cn("px-2 py-1.5 text-sm font-semibold text-main-950", inset && "pl-8", className), ...props })));
|
|
28
|
-
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
29
|
-
const DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Separator, { ref: ref, className: cn("-mx-1 my-1 h-px bg-grey-100", className), ...props })));
|
|
30
|
-
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
31
|
-
const DropdownMenuShortcut = ({ className, ...props }) => {
|
|
32
|
-
return (_jsx("span", { className: cn("ml-auto text-xs tracking-widest text-grey-400", className), ...props }));
|
|
33
|
-
};
|
|
34
|
-
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
35
|
-
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { type TypographyColor } from "../Typography/Typography";
|
|
3
|
-
export interface ErrorMessageProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "color"> {
|
|
4
|
-
/**
|
|
5
|
-
* The field name to check for errors
|
|
6
|
-
*/
|
|
7
|
-
name: string;
|
|
8
|
-
/**
|
|
9
|
-
* Object containing error messages keyed by field name
|
|
10
|
-
*/
|
|
11
|
-
errors: Record<string, string | undefined>;
|
|
12
|
-
/**
|
|
13
|
-
* Optional object containing touched state keyed by field name
|
|
14
|
-
* If provided, error is only shown when field is touched
|
|
15
|
-
*/
|
|
16
|
-
touched?: Record<string, boolean | undefined>;
|
|
17
|
-
/**
|
|
18
|
-
* Color variant for the error message
|
|
19
|
-
* @default "error-600"
|
|
20
|
-
*/
|
|
21
|
-
color?: TypographyColor;
|
|
22
|
-
}
|
|
23
|
-
declare function ErrorMessage({ name, errors, touched, className, color, ...props }: ErrorMessageProps): import("react/jsx-runtime").JSX.Element | null;
|
|
24
|
-
declare namespace ErrorMessage {
|
|
25
|
-
var displayName: string;
|
|
26
|
-
}
|
|
27
|
-
export { ErrorMessage };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { Typography } from "../Typography/Typography";
|
|
4
|
-
import { cn } from "../lib/utils";
|
|
5
|
-
function ErrorMessage({ name, errors, touched, className, color = "error-600", ...props }) {
|
|
6
|
-
const hasError = errors && typeof errors[name] === "string";
|
|
7
|
-
const shouldShow = touched ? hasError && touched[name] : hasError;
|
|
8
|
-
if (!shouldShow) {
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
return (_jsx(Typography, { variant: "caption", color: color, className: cn("mt-1", className), ...props, children: errors[name] }));
|
|
12
|
-
}
|
|
13
|
-
ErrorMessage.displayName = "ErrorMessage";
|
|
14
|
-
export { ErrorMessage };
|
package/Flex/Flex.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
type FlexDirection = "row" | "column" | "row-reverse" | "column-reverse";
|
|
3
|
-
type FlexAlign = "start" | "center" | "end" | "stretch" | "baseline";
|
|
4
|
-
type FlexJustify = "start" | "center" | "end" | "between" | "around" | "evenly";
|
|
5
|
-
type FlexWrap = "nowrap" | "wrap" | "wrap-reverse";
|
|
6
|
-
type FlexGap = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | 20 | 24 | 32 | 40 | 48;
|
|
7
|
-
declare const flexVariants: (props?: ({
|
|
8
|
-
direction?: "row" | "column" | "row-reverse" | "column-reverse" | null | undefined;
|
|
9
|
-
align?: "center" | "start" | "end" | "baseline" | "stretch" | null | undefined;
|
|
10
|
-
justify?: "center" | "start" | "end" | "between" | "around" | "evenly" | null | undefined;
|
|
11
|
-
wrap?: "nowrap" | "wrap" | "wrap-reverse" | null | undefined;
|
|
12
|
-
gap?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | 20 | 24 | 32 | 40 | 48 | null | undefined;
|
|
13
|
-
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
14
|
-
type FlexProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
15
|
-
direction?: FlexDirection;
|
|
16
|
-
align?: FlexAlign;
|
|
17
|
-
justify?: FlexJustify;
|
|
18
|
-
wrap?: FlexWrap;
|
|
19
|
-
gap?: FlexGap;
|
|
20
|
-
as?: React.ElementType;
|
|
21
|
-
};
|
|
22
|
-
declare const Flex: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
23
|
-
direction?: FlexDirection;
|
|
24
|
-
align?: FlexAlign;
|
|
25
|
-
justify?: FlexJustify;
|
|
26
|
-
wrap?: FlexWrap;
|
|
27
|
-
gap?: FlexGap;
|
|
28
|
-
as?: React.ElementType;
|
|
29
|
-
} & React.RefAttributes<HTMLDivElement>>;
|
|
30
|
-
export { Flex, flexVariants };
|
|
31
|
-
export type { FlexProps, FlexDirection, FlexAlign, FlexJustify, FlexWrap, FlexGap };
|
package/Flex/Flex.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { cva } from "class-variance-authority";
|
|
4
|
-
import { cn } from "../lib/utils";
|
|
5
|
-
const flexVariants = cva("flex", {
|
|
6
|
-
variants: {
|
|
7
|
-
direction: {
|
|
8
|
-
row: "flex-row",
|
|
9
|
-
column: "flex-col",
|
|
10
|
-
"row-reverse": "flex-row-reverse",
|
|
11
|
-
"column-reverse": "flex-col-reverse",
|
|
12
|
-
},
|
|
13
|
-
align: {
|
|
14
|
-
start: "items-start",
|
|
15
|
-
center: "items-center",
|
|
16
|
-
end: "items-end",
|
|
17
|
-
stretch: "items-stretch",
|
|
18
|
-
baseline: "items-baseline",
|
|
19
|
-
},
|
|
20
|
-
justify: {
|
|
21
|
-
start: "justify-start",
|
|
22
|
-
center: "justify-center",
|
|
23
|
-
end: "justify-end",
|
|
24
|
-
between: "justify-between",
|
|
25
|
-
around: "justify-around",
|
|
26
|
-
evenly: "justify-evenly",
|
|
27
|
-
},
|
|
28
|
-
wrap: {
|
|
29
|
-
nowrap: "flex-nowrap",
|
|
30
|
-
wrap: "flex-wrap",
|
|
31
|
-
"wrap-reverse": "flex-wrap-reverse",
|
|
32
|
-
},
|
|
33
|
-
gap: {
|
|
34
|
-
0: "gap-0",
|
|
35
|
-
1: "gap-1",
|
|
36
|
-
2: "gap-2",
|
|
37
|
-
3: "gap-3",
|
|
38
|
-
4: "gap-4",
|
|
39
|
-
5: "gap-5",
|
|
40
|
-
6: "gap-6",
|
|
41
|
-
8: "gap-8",
|
|
42
|
-
10: "gap-10",
|
|
43
|
-
12: "gap-12",
|
|
44
|
-
16: "gap-16",
|
|
45
|
-
20: "gap-20",
|
|
46
|
-
24: "gap-24",
|
|
47
|
-
32: "gap-32",
|
|
48
|
-
40: "gap-40",
|
|
49
|
-
48: "gap-48",
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
defaultVariants: {
|
|
53
|
-
direction: "column",
|
|
54
|
-
align: "start",
|
|
55
|
-
justify: "start",
|
|
56
|
-
wrap: "nowrap",
|
|
57
|
-
gap: 0,
|
|
58
|
-
},
|
|
59
|
-
});
|
|
60
|
-
const Flex = React.forwardRef(({ className, direction, align, justify, wrap, gap, as: Component = "div", ...props }, ref) => {
|
|
61
|
-
return (_jsx(Component, { ref: ref, className: cn(flexVariants({ direction, align, justify, wrap, gap, className })), ...props }));
|
|
62
|
-
});
|
|
63
|
-
Flex.displayName = "Flex";
|
|
64
|
-
export { Flex, flexVariants };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
type IconButtonVariant = "primary" | "secondary" | "outline" | "ghost";
|
|
3
|
-
type IconButtonSize = "mini" | "small" | "regular" | "large";
|
|
4
|
-
type IconButtonRoundness = "default" | "round";
|
|
5
|
-
declare const iconButtonVariants: (props?: ({
|
|
6
|
-
variant?: "secondary" | "outline" | "primary" | "ghost" | null | undefined;
|
|
7
|
-
size?: "small" | "regular" | "large" | "mini" | null | undefined;
|
|
8
|
-
roundness?: "default" | "round" | null | undefined;
|
|
9
|
-
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
-
export interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
11
|
-
variant?: IconButtonVariant;
|
|
12
|
-
size?: IconButtonSize;
|
|
13
|
-
roundness?: IconButtonRoundness;
|
|
14
|
-
/** Use the Slot component to render a different element */
|
|
15
|
-
asChild?: boolean;
|
|
16
|
-
/** The icon to render inside the button */
|
|
17
|
-
icon?: React.ReactNode;
|
|
18
|
-
/** Accessible label for screen readers */
|
|
19
|
-
"aria-label": string;
|
|
20
|
-
}
|
|
21
|
-
declare const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
22
|
-
export { IconButton, iconButtonVariants };
|
|
23
|
-
export type { IconButtonVariant, IconButtonSize, IconButtonRoundness };
|
package/IconButton/IconButton.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
4
|
-
import { cva } from "class-variance-authority";
|
|
5
|
-
import { cn } from "../lib/utils";
|
|
6
|
-
const iconButtonVariants = cva("inline-flex items-center justify-center shrink-0 cursor-pointer transition-colors focus-visible:outline-none focus-visible:shadow-[0_0_0_3px_#d4d4d4] disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed [&_svg]:pointer-events-none [&_svg]:shrink-0", {
|
|
7
|
-
variants: {
|
|
8
|
-
variant: {
|
|
9
|
-
primary: "bg-accent-600 text-white hover:bg-accent-700",
|
|
10
|
-
secondary: "bg-main-100 text-main-950 hover:bg-main-200",
|
|
11
|
-
outline: "border border-main-300 bg-transparent text-main-950 hover:bg-main-100",
|
|
12
|
-
ghost: "bg-transparent text-main-600 hover:bg-main-100 hover:text-main-950",
|
|
13
|
-
},
|
|
14
|
-
size: {
|
|
15
|
-
mini: "size-6 [&_svg]:size-3",
|
|
16
|
-
small: "size-8 [&_svg]:size-4",
|
|
17
|
-
regular: "size-9 [&_svg]:size-4",
|
|
18
|
-
large: "size-10 [&_svg]:size-5",
|
|
19
|
-
},
|
|
20
|
-
roundness: {
|
|
21
|
-
default: "rounded-lg",
|
|
22
|
-
round: "rounded-full",
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
compoundVariants: [
|
|
26
|
-
{
|
|
27
|
-
size: "mini",
|
|
28
|
-
roundness: "default",
|
|
29
|
-
className: "rounded-md",
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
size: "small",
|
|
33
|
-
roundness: "default",
|
|
34
|
-
className: "rounded-md",
|
|
35
|
-
},
|
|
36
|
-
],
|
|
37
|
-
defaultVariants: {
|
|
38
|
-
variant: "primary",
|
|
39
|
-
size: "regular",
|
|
40
|
-
roundness: "default",
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
const IconButton = React.forwardRef(({ className, variant, size, roundness, asChild = false, icon, children, ...props }, ref) => {
|
|
44
|
-
const Comp = asChild ? Slot : "button";
|
|
45
|
-
return (_jsx(Comp, { className: cn(iconButtonVariants({ variant, size, roundness, className })), ref: ref, ...props, children: icon || children }));
|
|
46
|
-
});
|
|
47
|
-
IconButton.displayName = "IconButton";
|
|
48
|
-
export { IconButton, iconButtonVariants };
|
package/Input/Input.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { type TextVariant, type TextColor } from "../lib/typography-types";
|
|
3
|
-
type InputSize = "mini" | "small" | "regular" | "large";
|
|
4
|
-
type InputRoundness = "default" | "round";
|
|
5
|
-
type InputVariant = "default" | "error";
|
|
6
|
-
declare const inputVariants: (props?: ({
|
|
7
|
-
size?: "small" | "regular" | "large" | "mini" | null | undefined;
|
|
8
|
-
roundness?: "default" | "round" | null | undefined;
|
|
9
|
-
variant?: "default" | "error" | null | undefined;
|
|
10
|
-
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
|
-
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> {
|
|
12
|
-
size?: InputSize;
|
|
13
|
-
roundness?: InputRoundness;
|
|
14
|
-
variant?: InputVariant;
|
|
15
|
-
label?: string;
|
|
16
|
-
labelVariant?: TextVariant;
|
|
17
|
-
labelColor?: TextColor;
|
|
18
|
-
leftIcon?: React.ReactNode;
|
|
19
|
-
rightIcon?: React.ReactNode;
|
|
20
|
-
leftAddon?: React.ReactNode;
|
|
21
|
-
rightAddon?: React.ReactNode;
|
|
22
|
-
rightElement?: React.ReactNode;
|
|
23
|
-
error?: string;
|
|
24
|
-
}
|
|
25
|
-
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
26
|
-
export { Input, inputVariants };
|
|
27
|
-
export type { InputSize, InputRoundness, InputVariant };
|