@yakad/ui 2.0.1 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Avatar/Avatar.d.ts +14 -4
- package/dist/Avatar/Avatar.js +49 -8
- package/dist/Button/Button.d.ts +9 -13
- package/dist/Button/Button.js +28 -14
- package/dist/ButtonGroup/ButtonGroup.d.ts +12 -0
- package/dist/ButtonGroup/ButtonGroup.js +60 -0
- package/dist/Card/Card.d.ts +14 -9
- package/dist/Card/Card.js +41 -7
- package/dist/CheckBox/CheckBox.d.ts +12 -8
- package/dist/CheckBox/CheckBox.js +47 -10
- package/dist/Field/Field.d.ts +21 -0
- package/dist/Field/Field.js +154 -0
- package/dist/Label/Label.d.ts +8 -0
- package/dist/{Spacer/Spacer.js → Label/Label.js} +9 -6
- package/dist/Navigation/Navigation.d.ts +19 -9
- package/dist/Navigation/Navigation.js +158 -11
- package/dist/RadioGroup/RadioGroup.d.ts +19 -12
- package/dist/RadioGroup/RadioGroup.js +61 -14
- package/dist/Separator/Separator.d.ts +9 -0
- package/dist/Separator/Separator.js +24 -0
- package/dist/Table/Table.d.ts +18 -36
- package/dist/Table/Table.js +90 -38
- package/dist/index.d.ts +2 -8
- package/dist/index.js +2 -8
- package/package.json +12 -5
- package/dist/Avatar/Avatar.module.css +0 -32
- package/dist/Avatar/default-avatar.svg +0 -17
- package/dist/Button/Button.module.css +0 -190
- package/dist/Card/Card.module.css +0 -48
- package/dist/CheckBox/CheckBox.module.css +0 -50
- package/dist/CodeBox/CodeBox.d.ts +0 -7
- package/dist/CodeBox/CodeBox.js +0 -22
- package/dist/CodeBox/CodeBox.module.css +0 -0
- package/dist/CodeField/CodeField.d.ts +0 -10
- package/dist/CodeField/CodeField.js +0 -43
- package/dist/CodeField/CodeField.module.css +0 -27
- package/dist/Dropdown/Dropdown.d.ts +0 -8
- package/dist/Dropdown/Dropdown.js +0 -99
- package/dist/Dropdown/Dropdown.module.css +0 -39
- package/dist/Form/Form.d.ts +0 -9
- package/dist/Form/Form.js +0 -20
- package/dist/Form/Form.module.css +0 -3
- package/dist/Navigation/Navigation.module.css +0 -61
- package/dist/Popup/Popup.d.ts +0 -8
- package/dist/Popup/Popup.js +0 -40
- package/dist/Popup/Popup.module.css +0 -15
- package/dist/RadioButton/RadioButton.d.ts +0 -14
- package/dist/RadioButton/RadioButton.js +0 -31
- package/dist/RadioButton/RadioButton.module.css +0 -22
- package/dist/Spacer/Spacer.d.ts +0 -5
- package/dist/Spacer/Spacer.module.css +0 -5
- package/dist/Table/Table.module.css +0 -41
- package/dist/WithOverlay/WithOverlay.d.ts +0 -15
- package/dist/WithOverlay/WithOverlay.js +0 -40
package/dist/Avatar/Avatar.d.ts
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
3
|
+
import { type VariantProps } from "class-variance-authority";
|
|
4
|
+
declare const avatarVariants: (props?: ({
|
|
5
|
+
size?: "default" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
|
+
export interface AvatarProps extends React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>, VariantProps<typeof avatarVariants> {
|
|
5
8
|
}
|
|
6
|
-
|
|
9
|
+
declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLSpanElement>>;
|
|
10
|
+
export interface AvatarImageProps extends React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image> {
|
|
11
|
+
}
|
|
12
|
+
declare const AvatarImage: React.ForwardRefExoticComponent<AvatarImageProps & React.RefAttributes<HTMLImageElement>>;
|
|
13
|
+
export interface AvatarFallbackProps extends React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback> {
|
|
14
|
+
}
|
|
15
|
+
declare const AvatarFallback: React.ForwardRefExoticComponent<AvatarFallbackProps & React.RefAttributes<HTMLSpanElement>>;
|
|
16
|
+
export { Avatar, AvatarImage, AvatarFallback, };
|
package/dist/Avatar/Avatar.js
CHANGED
|
@@ -10,11 +10,52 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
13
|
+
import React from "react";
|
|
14
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
15
|
+
import { cva } from "class-variance-authority";
|
|
16
|
+
const avatarVariants = cva("relative flex shrink-0 overflow-hidden rounded-full", {
|
|
17
|
+
variants: {
|
|
18
|
+
size: {
|
|
19
|
+
default: "size-10",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
size: "default",
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
const Avatar = React.forwardRef((_a, ref) => {
|
|
27
|
+
var { className, size } = _a, props = __rest(_a, ["className", "size"]);
|
|
28
|
+
const avatarClassName = [
|
|
29
|
+
avatarVariants({
|
|
30
|
+
size,
|
|
31
|
+
}),
|
|
32
|
+
className,
|
|
33
|
+
]
|
|
34
|
+
.filter(Boolean)
|
|
35
|
+
.join(" ");
|
|
36
|
+
return (_jsx(AvatarPrimitive.Root, Object.assign({ ref: ref, "data-slot": "avatar", className: avatarClassName }, props)));
|
|
37
|
+
});
|
|
38
|
+
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
39
|
+
const AvatarImage = React.forwardRef((_a, ref) => {
|
|
40
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
41
|
+
const avatarImageClassName = [
|
|
42
|
+
"aspect-square size-full",
|
|
43
|
+
className,
|
|
44
|
+
]
|
|
45
|
+
.filter(Boolean)
|
|
46
|
+
.join(" ");
|
|
47
|
+
return (_jsx(AvatarPrimitive.Image, Object.assign({ ref: ref, "data-slot": "avatar-image", className: avatarImageClassName }, props)));
|
|
48
|
+
});
|
|
49
|
+
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
50
|
+
const AvatarFallback = React.forwardRef((_a, ref) => {
|
|
51
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
52
|
+
const avatarFallbackClassName = [
|
|
53
|
+
"flex size-full items-center justify-center rounded-full bg-muted text-sm font-medium text-muted-foreground",
|
|
54
|
+
className,
|
|
55
|
+
]
|
|
56
|
+
.filter(Boolean)
|
|
57
|
+
.join(" ");
|
|
58
|
+
return (_jsx(AvatarPrimitive.Fallback, Object.assign({ ref: ref, "data-slot": "avatar-fallback", className: avatarFallbackClassName }, props)));
|
|
59
|
+
});
|
|
60
|
+
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
61
|
+
export { Avatar, AvatarImage, AvatarFallback, };
|
package/dist/Button/Button.d.ts
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
iconPosition?: "start" | "end";
|
|
9
|
-
loadingPosition?: "auto" | "center";
|
|
10
|
-
loadingVariant?: "scaleOut" | "dots" | "spinner";
|
|
11
|
-
children?: React.ReactNode;
|
|
12
|
-
ref?: React.Ref<HTMLButtonElement>;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "text" | "filled" | "elevated" | "outlined" | "tonal" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
6
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
7
|
+
asChild?: boolean;
|
|
13
8
|
}
|
|
14
|
-
|
|
9
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
+
export { Button, buttonVariants };
|
package/dist/Button/Button.js
CHANGED
|
@@ -9,17 +9,31 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import React from "react";
|
|
14
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
15
|
+
import { cva } from "class-variance-authority";
|
|
16
|
+
const buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-full text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", {
|
|
17
|
+
variants: {
|
|
18
|
+
variant: {
|
|
19
|
+
filled: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
20
|
+
tonal: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
21
|
+
outlined: "border border-outline bg-transparent text-foreground hover:bg-muted",
|
|
22
|
+
elevated: "bg-surface text-foreground shadow-sm hover:bg-muted",
|
|
23
|
+
text: "bg-transparent text-primary hover:bg-primary/10",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
variant: "filled",
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
const Button = React.forwardRef((_a, ref) => {
|
|
31
|
+
var { className, variant, asChild = false } = _a, props = __rest(_a, ["className", "variant", "asChild"]);
|
|
32
|
+
const Comp = asChild ? Slot : "button";
|
|
33
|
+
return (_jsx(Comp, Object.assign({ ref: ref, "data-slot": "button", className: buttonVariants({
|
|
34
|
+
variant,
|
|
35
|
+
className,
|
|
36
|
+
}) }, props)));
|
|
37
|
+
});
|
|
38
|
+
Button.displayName = "Button";
|
|
39
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
import { Separator } from "../Separator/Separator";
|
|
4
|
+
declare const buttonGroupVariants: (props?: ({
|
|
5
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare function ButtonGroup({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>): React.JSX.Element;
|
|
8
|
+
declare function ButtonGroupText({ className, asChild, ...props }: React.ComponentProps<"div"> & {
|
|
9
|
+
asChild?: boolean;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
declare function ButtonGroupSeparator({ className, orientation, ...props }: React.ComponentProps<typeof Separator>): React.JSX.Element;
|
|
12
|
+
export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
14
|
+
import { cva } from "class-variance-authority";
|
|
15
|
+
import { Separator } from "../Separator/Separator";
|
|
16
|
+
const buttonGroupVariants = cva("flex w-fit items-stretch [&>*]:focus-visible:z-10", {
|
|
17
|
+
variants: {
|
|
18
|
+
orientation: {
|
|
19
|
+
horizontal: "flex-row",
|
|
20
|
+
vertical: "flex-col",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: {
|
|
24
|
+
orientation: "horizontal",
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
function ButtonGroup(_a) {
|
|
28
|
+
var { className, orientation } = _a, props = __rest(_a, ["className", "orientation"]);
|
|
29
|
+
const buttonGroupClassName = [
|
|
30
|
+
buttonGroupVariants({ orientation }),
|
|
31
|
+
className,
|
|
32
|
+
]
|
|
33
|
+
.filter(Boolean)
|
|
34
|
+
.join(" ");
|
|
35
|
+
return (_jsx("div", Object.assign({ role: "group", "data-slot": "button-group", "data-orientation": orientation, className: buttonGroupClassName }, props)));
|
|
36
|
+
}
|
|
37
|
+
function ButtonGroupText(_a) {
|
|
38
|
+
var { className, asChild = false } = _a, props = __rest(_a, ["className", "asChild"]);
|
|
39
|
+
const Comp = asChild ? Slot : "div";
|
|
40
|
+
const buttonGroupTextClassName = [
|
|
41
|
+
"bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs",
|
|
42
|
+
"[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
|
43
|
+
className,
|
|
44
|
+
]
|
|
45
|
+
.filter(Boolean)
|
|
46
|
+
.join(" ");
|
|
47
|
+
return (_jsx(Comp, Object.assign({ "data-slot": "button-group-text", className: buttonGroupTextClassName }, props)));
|
|
48
|
+
}
|
|
49
|
+
function ButtonGroupSeparator(_a) {
|
|
50
|
+
var { className, orientation = "vertical" } = _a, props = __rest(_a, ["className", "orientation"]);
|
|
51
|
+
const buttonGroupSeparatorClassName = [
|
|
52
|
+
"bg-border relative !m-0 self-stretch",
|
|
53
|
+
"data-[orientation=vertical]:h-auto",
|
|
54
|
+
className,
|
|
55
|
+
]
|
|
56
|
+
.filter(Boolean)
|
|
57
|
+
.join(" ");
|
|
58
|
+
return (_jsx(Separator, Object.assign({ "data-slot": "button-group-separator", orientation: orientation, className: buttonGroupSeparatorClassName }, props)));
|
|
59
|
+
}
|
|
60
|
+
export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, };
|
package/dist/Card/Card.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const cardVariants: (props?: ({
|
|
4
|
+
variant?: "filled" | "elevated" | "outlined" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
6
|
+
type CardProps = React.ComponentProps<"div"> & VariantProps<typeof cardVariants>;
|
|
7
|
+
declare function Card({ className, variant, ...props }: CardProps): React.JSX.Element;
|
|
8
|
+
declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
9
|
+
declare function CardTitle({ className, ...props }: React.ComponentProps<"h3">): React.JSX.Element;
|
|
10
|
+
declare function CardDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
|
|
11
|
+
declare function CardContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
12
|
+
declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
13
|
+
declare function CardAction({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
14
|
+
export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, CardAction, };
|
package/dist/Card/Card.js
CHANGED
|
@@ -10,11 +10,45 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
import { cva } from "class-variance-authority";
|
|
14
|
+
const cardVariants = cva("relative flex w-full flex-col overflow-hidden rounded-xl", {
|
|
15
|
+
variants: {
|
|
16
|
+
variant: {
|
|
17
|
+
elevated: "bg-white shadow-sm",
|
|
18
|
+
filled: "bg-gray-100",
|
|
19
|
+
outlined: "bg-white border border-gray-300",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
variant: "elevated",
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
function Card(_a) {
|
|
27
|
+
var { className, variant } = _a, props = __rest(_a, ["className", "variant"]);
|
|
28
|
+
return (_jsx("div", Object.assign({ "data-slot": "card", className: `${cardVariants({ variant })} ${className !== null && className !== void 0 ? className : ""}` }, props)));
|
|
20
29
|
}
|
|
30
|
+
function CardHeader(_a) {
|
|
31
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
32
|
+
return (_jsx("div", Object.assign({ "data-slot": "card-header", className: `grid grid-cols-[1fr_auto] items-start gap-4 p-6 ${className !== null && className !== void 0 ? className : ""}` }, props)));
|
|
33
|
+
}
|
|
34
|
+
function CardTitle(_a) {
|
|
35
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
36
|
+
return (_jsx("h3", Object.assign({ "data-slot": "card-title", className: `text-xl font-medium leading-7 ${className !== null && className !== void 0 ? className : ""}` }, props)));
|
|
37
|
+
}
|
|
38
|
+
function CardDescription(_a) {
|
|
39
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
40
|
+
return (_jsx("p", Object.assign({ "data-slot": "card-description", className: `mt-1 text-sm text-gray-600 ${className !== null && className !== void 0 ? className : ""}` }, props)));
|
|
41
|
+
}
|
|
42
|
+
function CardContent(_a) {
|
|
43
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
44
|
+
return (_jsx("div", Object.assign({ "data-slot": "card-content", className: `px-6 pb-6 ${className !== null && className !== void 0 ? className : ""}` }, props)));
|
|
45
|
+
}
|
|
46
|
+
function CardFooter(_a) {
|
|
47
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
48
|
+
return (_jsx("div", Object.assign({ "data-slot": "card-footer", className: `flex items-center gap-2 px-6 pb-6 ${className !== null && className !== void 0 ? className : ""}` }, props)));
|
|
49
|
+
}
|
|
50
|
+
function CardAction(_a) {
|
|
51
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
52
|
+
return (_jsx("div", Object.assign({ "data-slot": "card-action", className: `col-start-2 row-span-2 row-start-1 self-start ${className !== null && className !== void 0 ? className : ""}` }, props)));
|
|
53
|
+
}
|
|
54
|
+
export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, CardAction, };
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
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" | "medium" | "large" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
|
+
type CheckboxProps = React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> & VariantProps<typeof checkboxVariants>;
|
|
8
|
+
declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
|
|
9
|
+
size?: "small" | "medium" | "large" | null | undefined;
|
|
10
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
export { Checkbox, checkboxVariants };
|
|
12
|
+
export type { CheckboxProps };
|
|
@@ -9,13 +9,50 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
15
|
+
import { cva } from "class-variance-authority";
|
|
16
|
+
const checkboxVariants = cva([
|
|
17
|
+
"peer",
|
|
18
|
+
"relative",
|
|
19
|
+
"inline-flex",
|
|
20
|
+
"shrink-0",
|
|
21
|
+
"items-center",
|
|
22
|
+
"justify-center",
|
|
23
|
+
"rounded-[4px]",
|
|
24
|
+
"border",
|
|
25
|
+
"border-slate-500",
|
|
26
|
+
"bg-transparent",
|
|
27
|
+
"text-white",
|
|
28
|
+
"transition-colors",
|
|
29
|
+
"duration-150",
|
|
30
|
+
"ease-out",
|
|
31
|
+
"outline-none",
|
|
32
|
+
"focus-visible:ring-2",
|
|
33
|
+
"focus-visible:ring-slate-500",
|
|
34
|
+
"focus-visible:ring-offset-2",
|
|
35
|
+
"disabled:pointer-events-none",
|
|
36
|
+
"disabled:opacity-50",
|
|
37
|
+
"data-[state=checked]:border-slate-900",
|
|
38
|
+
"data-[state=checked]:bg-slate-900",
|
|
39
|
+
"data-[state=indeterminate]:border-slate-900",
|
|
40
|
+
"data-[state=indeterminate]:bg-slate-900",
|
|
41
|
+
], {
|
|
42
|
+
variants: {
|
|
43
|
+
size: {
|
|
44
|
+
small: "h-4 w-4",
|
|
45
|
+
medium: "h-[18px] w-[18px]",
|
|
46
|
+
large: "h-5 w-5",
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
defaultVariants: {
|
|
50
|
+
size: "medium",
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
const Checkbox = React.forwardRef((_a, ref) => {
|
|
54
|
+
var { className, size } = _a, props = __rest(_a, ["className", "size"]);
|
|
55
|
+
return (_jsx(CheckboxPrimitive.Root, Object.assign({ ref: ref, className: checkboxVariants({ size, className }) }, props, { children: _jsx(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center", children: _jsx("svg", { viewBox: "0 0 24 24", className: "h-full w-full", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("path", { d: "M5 12.5 10 17l9-10" }) }) }) })));
|
|
56
|
+
});
|
|
57
|
+
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
58
|
+
export { Checkbox, checkboxVariants };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const Field: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & VariantProps<(props?: ({
|
|
4
|
+
orientation?: "horizontal" | "vertical" | "responsive" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const FieldGroup: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const FieldLabel: React.ForwardRefExoticComponent<Omit<import("../Label/Label").LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
|
|
8
|
+
declare const FieldDescription: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
9
|
+
declare const FieldError: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
10
|
+
errors?: ({
|
|
11
|
+
message?: string | undefined;
|
|
12
|
+
} | undefined)[] | undefined;
|
|
13
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
declare const FieldContent: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
declare const FieldLegend: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLLegendElement>, HTMLLegendElement>, "ref"> & VariantProps<(props?: ({
|
|
16
|
+
variant?: "label" | "legend" | null | undefined;
|
|
17
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLLegendElement>>;
|
|
18
|
+
declare const FieldSet: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>, "ref"> & React.RefAttributes<HTMLFieldSetElement>>;
|
|
19
|
+
declare const FieldTitle: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
declare const FieldSeparator: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
export { Field, FieldLabel, FieldDescription, FieldError, FieldGroup, FieldLegend, FieldSeparator, FieldSet, FieldContent, FieldTitle, };
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import React from "react";
|
|
14
|
+
import { cva } from "class-variance-authority";
|
|
15
|
+
import { Label } from "../Label/Label";
|
|
16
|
+
import { Separator } from "../Separator/Separator";
|
|
17
|
+
const fieldVariants = cva("flex w-full gap-2", {
|
|
18
|
+
variants: {
|
|
19
|
+
orientation: {
|
|
20
|
+
vertical: "flex-col",
|
|
21
|
+
horizontal: "flex-row items-start",
|
|
22
|
+
responsive: "flex-col @md:flex-row @md:items-start",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: {
|
|
26
|
+
orientation: "vertical",
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
const fieldLegendVariants = cva("font-medium text-foreground", {
|
|
30
|
+
variants: {
|
|
31
|
+
variant: {
|
|
32
|
+
legend: "text-base",
|
|
33
|
+
label: "text-sm",
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
defaultVariants: {
|
|
37
|
+
variant: "legend",
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
const Field = React.forwardRef((_a, ref) => {
|
|
41
|
+
var { className, orientation } = _a, props = __rest(_a, ["className", "orientation"]);
|
|
42
|
+
const fieldClassName = [
|
|
43
|
+
fieldVariants({ orientation }),
|
|
44
|
+
className,
|
|
45
|
+
]
|
|
46
|
+
.filter(Boolean)
|
|
47
|
+
.join(" ");
|
|
48
|
+
return (_jsx("div", Object.assign({ ref: ref, "data-slot": "field", "data-orientation": orientation }, props, { className: fieldClassName })));
|
|
49
|
+
});
|
|
50
|
+
Field.displayName = "Field";
|
|
51
|
+
const FieldGroup = React.forwardRef((_a, ref) => {
|
|
52
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
53
|
+
const fieldGroupClassName = [
|
|
54
|
+
"flex w-full flex-col gap-6",
|
|
55
|
+
className,
|
|
56
|
+
]
|
|
57
|
+
.filter(Boolean)
|
|
58
|
+
.join(" ");
|
|
59
|
+
return (_jsx("div", Object.assign({ ref: ref, "data-slot": "field-group" }, props, { className: fieldGroupClassName })));
|
|
60
|
+
});
|
|
61
|
+
FieldGroup.displayName = "FieldGroup";
|
|
62
|
+
const FieldLabel = React.forwardRef((_a, ref) => {
|
|
63
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
64
|
+
const fieldLabelClassName = [
|
|
65
|
+
"data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50",
|
|
66
|
+
className,
|
|
67
|
+
]
|
|
68
|
+
.filter(Boolean)
|
|
69
|
+
.join(" ");
|
|
70
|
+
return (_jsx(Label, Object.assign({ ref: ref, "data-slot": "field-label" }, props, { className: fieldLabelClassName })));
|
|
71
|
+
});
|
|
72
|
+
FieldLabel.displayName = "FieldLabel";
|
|
73
|
+
const FieldDescription = React.forwardRef((_a, ref) => {
|
|
74
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
75
|
+
const fieldDescriptionClassName = [
|
|
76
|
+
"text-sm text-muted-foreground",
|
|
77
|
+
className,
|
|
78
|
+
]
|
|
79
|
+
.filter(Boolean)
|
|
80
|
+
.join(" ");
|
|
81
|
+
return (_jsx("p", Object.assign({ ref: ref, "data-slot": "field-description" }, props, { className: fieldDescriptionClassName })));
|
|
82
|
+
});
|
|
83
|
+
FieldDescription.displayName = "FieldDescription";
|
|
84
|
+
const FieldError = React.forwardRef((_a, ref) => {
|
|
85
|
+
var { className, children, errors } = _a, props = __rest(_a, ["className", "children", "errors"]);
|
|
86
|
+
const messages = errors === null || errors === void 0 ? void 0 : errors.map((error) => error === null || error === void 0 ? void 0 : error.message).filter(Boolean);
|
|
87
|
+
if (!children && !(messages === null || messages === void 0 ? void 0 : messages.length)) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
const fieldErrorClassName = [
|
|
91
|
+
"text-sm font-medium text-destructive",
|
|
92
|
+
className,
|
|
93
|
+
]
|
|
94
|
+
.filter(Boolean)
|
|
95
|
+
.join(" ");
|
|
96
|
+
return (_jsxs("div", Object.assign({ ref: ref, role: "alert", "data-slot": "field-error" }, props, { className: fieldErrorClassName, children: [children, (messages === null || messages === void 0 ? void 0 : messages.length) ? (_jsx("ul", { className: "mt-1 list-disc space-y-1 pl-5", children: messages.map((message, index) => (_jsx("li", { children: message }, index))) })) : null] })));
|
|
97
|
+
});
|
|
98
|
+
FieldError.displayName = "FieldError";
|
|
99
|
+
const FieldContent = React.forwardRef((_a, ref) => {
|
|
100
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
101
|
+
const fieldContentClassName = [
|
|
102
|
+
"flex flex-1 flex-col gap-1.5",
|
|
103
|
+
className,
|
|
104
|
+
]
|
|
105
|
+
.filter(Boolean)
|
|
106
|
+
.join(" ");
|
|
107
|
+
return (_jsx("div", Object.assign({ ref: ref, "data-slot": "field-content" }, props, { className: fieldContentClassName })));
|
|
108
|
+
});
|
|
109
|
+
FieldContent.displayName = "FieldContent";
|
|
110
|
+
const FieldLegend = React.forwardRef((_a, ref) => {
|
|
111
|
+
var { className, variant } = _a, props = __rest(_a, ["className", "variant"]);
|
|
112
|
+
const fieldLegendClassName = [
|
|
113
|
+
fieldLegendVariants({ variant }),
|
|
114
|
+
className,
|
|
115
|
+
]
|
|
116
|
+
.filter(Boolean)
|
|
117
|
+
.join(" ");
|
|
118
|
+
return (_jsx("legend", Object.assign({ ref: ref, "data-slot": "field-legend" }, props, { className: fieldLegendClassName })));
|
|
119
|
+
});
|
|
120
|
+
FieldLegend.displayName = "FieldLegend";
|
|
121
|
+
const FieldSet = React.forwardRef((_a, ref) => {
|
|
122
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
123
|
+
const fieldSetClassName = [
|
|
124
|
+
"flex w-full min-w-0 flex-col gap-6",
|
|
125
|
+
className,
|
|
126
|
+
]
|
|
127
|
+
.filter(Boolean)
|
|
128
|
+
.join(" ");
|
|
129
|
+
return (_jsx("fieldset", Object.assign({ ref: ref, "data-slot": "field-set" }, props, { className: fieldSetClassName })));
|
|
130
|
+
});
|
|
131
|
+
FieldSet.displayName = "FieldSet";
|
|
132
|
+
const FieldTitle = React.forwardRef((_a, ref) => {
|
|
133
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
134
|
+
const fieldTitleClassName = [
|
|
135
|
+
"text-sm font-medium text-foreground",
|
|
136
|
+
className,
|
|
137
|
+
]
|
|
138
|
+
.filter(Boolean)
|
|
139
|
+
.join(" ");
|
|
140
|
+
return (_jsx("div", Object.assign({ ref: ref, "data-slot": "field-title" }, props, { className: fieldTitleClassName })));
|
|
141
|
+
});
|
|
142
|
+
FieldTitle.displayName = "FieldTitle";
|
|
143
|
+
const FieldSeparator = React.forwardRef((_a, ref) => {
|
|
144
|
+
var { className, children } = _a, props = __rest(_a, ["className", "children"]);
|
|
145
|
+
const fieldSeparatorClassName = [
|
|
146
|
+
"relative -my-2 flex h-5 items-center",
|
|
147
|
+
className,
|
|
148
|
+
]
|
|
149
|
+
.filter(Boolean)
|
|
150
|
+
.join(" ");
|
|
151
|
+
return (_jsxs("div", Object.assign({ ref: ref, "data-slot": "field-separator" }, props, { className: fieldSeparatorClassName, children: [_jsx(Separator, { orientation: "horizontal", className: "absolute inset-0 top-1/2" }), children ? (_jsx("span", { className: "relative mx-auto bg-background px-2 text-xs text-muted-foreground", children: children })) : null] })));
|
|
152
|
+
});
|
|
153
|
+
FieldSeparator.displayName = "FieldSeparator";
|
|
154
|
+
export { Field, FieldLabel, FieldDescription, FieldError, FieldGroup, FieldLegend, FieldSeparator, FieldSet, FieldContent, FieldTitle, };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
3
|
+
import { type VariantProps } from "class-variance-authority";
|
|
4
|
+
declare const labelVariants: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
5
|
+
export interface LabelProps extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>, VariantProps<typeof labelVariants> {
|
|
6
|
+
}
|
|
7
|
+
declare const Label: React.ForwardRefExoticComponent<LabelProps & React.RefAttributes<HTMLLabelElement>>;
|
|
8
|
+
export { Label, labelVariants };
|
|
@@ -10,10 +10,13 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
|
|
13
|
+
import React from "react";
|
|
14
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
15
|
+
import { cva } from "class-variance-authority";
|
|
16
|
+
const labelVariants = cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
|
|
17
|
+
const Label = React.forwardRef((_a, ref) => {
|
|
16
18
|
var { className } = _a, restProps = __rest(_a, ["className"]);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
return (_jsx(LabelPrimitive.Root, Object.assign({ ref: ref, className: labelVariants({ className }) }, restProps)));
|
|
20
|
+
});
|
|
21
|
+
Label.displayName = LabelPrimitive.Root.displayName;
|
|
22
|
+
export { Label, labelVariants };
|