@rovula/ui 0.1.2 → 0.1.4
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/cjs/bundle.css +436 -111
- package/dist/cjs/bundle.js +4 -4
- package/dist/cjs/bundle.js.map +1 -1
- package/dist/cjs/types/components/ActionButton/ActionButton.d.ts +4 -2
- package/dist/cjs/types/components/ActionButton/ActionButton.stories.d.ts +30 -8
- package/dist/cjs/types/components/ActionButton/ActionButton.styles.d.ts +2 -1
- package/dist/cjs/types/components/Avatar/Avatar.styles.d.ts +1 -1
- package/dist/cjs/types/components/Button/Button.d.ts +4 -2
- package/dist/cjs/types/components/Button/Button.styles.d.ts +2 -1
- package/dist/cjs/types/components/Button/Buttons.stories.d.ts +71 -6
- package/dist/cjs/types/components/Checkbox/Checkbox.stories.d.ts +13 -9
- package/dist/cjs/types/components/Dropdown/Dropdown.stories.d.ts +3 -0
- package/dist/cjs/types/components/InputFilter/InputFilter.stories.d.ts +3 -0
- package/dist/cjs/types/components/MaskedTextInput/MaskedTextInput.d.ts +3 -0
- package/dist/cjs/types/components/MaskedTextInput/MaskedTextInput.stories.d.ts +6 -0
- package/dist/cjs/types/components/PasswordInput/PasswordInput.stories.d.ts +3 -0
- package/dist/cjs/types/components/RadioGroup/RadioGroup.stories.d.ts +10 -7
- package/dist/cjs/types/components/Search/Search.stories.d.ts +3 -0
- package/dist/cjs/types/components/Switch/Switch.d.ts +3 -1
- package/dist/cjs/types/components/Switch/Switch.stories.d.ts +12 -4
- package/dist/cjs/types/components/Switch/Switch.styles.d.ts +7 -0
- package/dist/cjs/types/components/TextInput/TextInput.d.ts +6 -0
- package/dist/cjs/types/components/TextInput/TextInput.stories.d.ts +9 -0
- package/dist/cjs/types/components/TextInput/TextInput.styles.d.ts +4 -0
- package/dist/cjs/types/components/Toast/Toast.d.ts +1 -0
- package/dist/cjs/types/components/Toast/Toast.stories.d.ts +14 -0
- package/dist/cjs/types/components/Toast/Toast.styles.d.ts +1 -0
- package/dist/components/ActionButton/ActionButton.js +2 -1
- package/dist/components/ActionButton/ActionButton.stories.js +40 -7
- package/dist/components/ActionButton/ActionButton.styles.js +77 -17
- package/dist/components/Button/Button.js +9 -2
- package/dist/components/Button/Button.styles.js +51 -14
- package/dist/components/Button/Buttons.stories.js +55 -0
- package/dist/components/Checkbox/Checkbox.js +6 -7
- package/dist/components/Checkbox/Checkbox.stories.js +23 -1
- package/dist/components/InputFilter/InputFilter.js +1 -1
- package/dist/components/InputFilter/InputFilter.styles.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.stories.js +16 -1
- package/dist/components/Switch/Switch.js +4 -17
- package/dist/components/Switch/Switch.stories.js +12 -2
- package/dist/components/Switch/Switch.styles.js +39 -0
- package/dist/components/TextInput/TextInput.js +28 -7
- package/dist/components/TextInput/TextInput.stories.js +13 -0
- package/dist/components/TextInput/TextInput.styles.js +22 -0
- package/dist/components/Toast/Toast.js +5 -5
- package/dist/components/Toast/Toast.stories.js +11 -2
- package/dist/components/Toast/Toast.styles.js +38 -6
- package/dist/components/Toast/Toaster.js +17 -1
- package/dist/esm/bundle.css +436 -111
- package/dist/esm/bundle.js +115 -115
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/types/components/ActionButton/ActionButton.d.ts +4 -2
- package/dist/esm/types/components/ActionButton/ActionButton.stories.d.ts +30 -8
- package/dist/esm/types/components/ActionButton/ActionButton.styles.d.ts +2 -1
- package/dist/esm/types/components/Avatar/Avatar.styles.d.ts +1 -1
- package/dist/esm/types/components/Button/Button.d.ts +4 -2
- package/dist/esm/types/components/Button/Button.styles.d.ts +2 -1
- package/dist/esm/types/components/Button/Buttons.stories.d.ts +71 -6
- package/dist/esm/types/components/Checkbox/Checkbox.stories.d.ts +13 -9
- package/dist/esm/types/components/Dropdown/Dropdown.stories.d.ts +3 -0
- package/dist/esm/types/components/InputFilter/InputFilter.stories.d.ts +3 -0
- package/dist/esm/types/components/MaskedTextInput/MaskedTextInput.d.ts +3 -0
- package/dist/esm/types/components/MaskedTextInput/MaskedTextInput.stories.d.ts +6 -0
- package/dist/esm/types/components/PasswordInput/PasswordInput.stories.d.ts +3 -0
- package/dist/esm/types/components/RadioGroup/RadioGroup.stories.d.ts +10 -7
- package/dist/esm/types/components/Search/Search.stories.d.ts +3 -0
- package/dist/esm/types/components/Switch/Switch.d.ts +3 -1
- package/dist/esm/types/components/Switch/Switch.stories.d.ts +12 -4
- package/dist/esm/types/components/Switch/Switch.styles.d.ts +7 -0
- package/dist/esm/types/components/TextInput/TextInput.d.ts +6 -0
- package/dist/esm/types/components/TextInput/TextInput.stories.d.ts +9 -0
- package/dist/esm/types/components/TextInput/TextInput.styles.d.ts +4 -0
- package/dist/esm/types/components/Toast/Toast.d.ts +1 -0
- package/dist/esm/types/components/Toast/Toast.stories.d.ts +14 -0
- package/dist/esm/types/components/Toast/Toast.styles.d.ts +1 -0
- package/dist/index.d.ts +19 -4
- package/dist/src/theme/global.css +557 -167
- package/package.json +1 -1
- package/src/components/ActionButton/ActionButton.stories.tsx +105 -149
- package/src/components/ActionButton/ActionButton.styles.ts +78 -18
- package/src/components/ActionButton/ActionButton.tsx +7 -2
- package/src/components/Button/Button.styles.ts +51 -14
- package/src/components/Button/Button.tsx +11 -2
- package/src/components/Button/Buttons.stories.tsx +235 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +50 -4
- package/src/components/Checkbox/Checkbox.tsx +12 -8
- package/src/components/InputFilter/InputFilter.styles.ts +2 -2
- package/src/components/InputFilter/InputFilter.tsx +21 -24
- package/src/components/RadioGroup/RadioGroup.stories.tsx +43 -4
- package/src/components/RadioGroup/RadioGroup.tsx +1 -1
- package/src/components/Switch/Switch.stories.tsx +33 -2
- package/src/components/Switch/Switch.styles.ts +48 -0
- package/src/components/Switch/Switch.tsx +68 -45
- package/src/components/TextInput/TextInput.stories.tsx +82 -0
- package/src/components/TextInput/TextInput.styles.ts +22 -0
- package/src/components/TextInput/TextInput.tsx +40 -11
- package/src/components/Toast/Toast.stories.tsx +12 -2
- package/src/components/Toast/Toast.styles.tsx +38 -6
- package/src/components/Toast/Toast.tsx +7 -7
- package/src/components/Toast/Toaster.tsx +26 -4
- package/src/theme/themes/variable.css +1 -1
- package/src/theme/themes/xspector/baseline.css +0 -1
- package/src/theme/tokens/components/switch.css +10 -11
- package/src/theme/themes/xspector/components/switch.css +0 -30
|
@@ -3,10 +3,18 @@ declare const meta: {
|
|
|
3
3
|
title: string;
|
|
4
4
|
component: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-toast").ToastProps & React.RefAttributes<HTMLLIElement>, "ref"> & import("class-variance-authority").VariantProps<(props?: ({
|
|
5
5
|
variant?: "default" | "success" | "info" | "warning" | "error" | null | undefined;
|
|
6
|
+
showBorder?: boolean | null | undefined;
|
|
6
7
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLLIElement>>;
|
|
7
8
|
tags: string[];
|
|
8
9
|
parameters: {
|
|
9
10
|
layout: string;
|
|
11
|
+
backgrounds: {
|
|
12
|
+
default: string;
|
|
13
|
+
values: {
|
|
14
|
+
name: string;
|
|
15
|
+
value: string;
|
|
16
|
+
}[];
|
|
17
|
+
};
|
|
10
18
|
};
|
|
11
19
|
decorators: ((Story: import("@storybook/csf").PartialStoryFn<import("@storybook/react").ReactRenderer, {
|
|
12
20
|
suppressHydrationWarning?: boolean | undefined | undefined;
|
|
@@ -323,6 +331,7 @@ declare const meta: {
|
|
|
323
331
|
};
|
|
324
332
|
}>, "currentTarget">) => void) | undefined;
|
|
325
333
|
variant?: "default" | "success" | "info" | "warning" | "error" | null | undefined;
|
|
334
|
+
showBorder?: boolean | null | undefined;
|
|
326
335
|
ref?: React.LegacyRef<HTMLLIElement> | undefined;
|
|
327
336
|
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
328
337
|
};
|
|
@@ -341,15 +350,20 @@ export declare const Simple: {
|
|
|
341
350
|
control: "select";
|
|
342
351
|
options: string[];
|
|
343
352
|
};
|
|
353
|
+
showBorder: {
|
|
354
|
+
control: "boolean";
|
|
355
|
+
};
|
|
344
356
|
};
|
|
345
357
|
args: {
|
|
346
358
|
variant: "default";
|
|
347
359
|
contentMode: "horizontal";
|
|
348
360
|
position: "top-center";
|
|
361
|
+
showBorder: false;
|
|
349
362
|
};
|
|
350
363
|
render: (args: {
|
|
351
364
|
variant: "default" | "success" | "info" | "warning" | "error" | null | undefined;
|
|
352
365
|
contentMode: "horizontal" | "vertical";
|
|
366
|
+
showBorder: boolean;
|
|
353
367
|
position?: "top-center" | "top-left" | "top-right" | "bottom-center" | "bottom-left" | "bottom-right" | undefined;
|
|
354
368
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
355
369
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const toastVariants: (props?: ({
|
|
2
2
|
variant?: "default" | "success" | "info" | "warning" | "error" | null | undefined;
|
|
3
|
+
showBorder?: boolean | null | undefined;
|
|
3
4
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
4
5
|
export declare const toastViewportVariants: (props?: ({
|
|
5
6
|
position?: "top-center" | "top-left" | "top-right" | "bottom-center" | "bottom-left" | "bottom-right" | null | undefined;
|
|
@@ -14,9 +14,10 @@ import { cn } from "@/utils/cn";
|
|
|
14
14
|
import { forwardRef } from "react";
|
|
15
15
|
import { actionButtonVariants } from "./ActionButton.styles";
|
|
16
16
|
const ActionButton = forwardRef((_a, ref) => {
|
|
17
|
-
var { children, disabled, active, className, size, variant } = _a, props = __rest(_a, ["children", "disabled", "active", "className", "size", "variant"]);
|
|
17
|
+
var { children, disabled, active, className, size, shape, variant } = _a, props = __rest(_a, ["children", "disabled", "active", "className", "size", "shape", "variant"]);
|
|
18
18
|
const actionButtonClassname = actionButtonVariants({
|
|
19
19
|
size,
|
|
20
|
+
shape,
|
|
20
21
|
variant,
|
|
21
22
|
active,
|
|
22
23
|
disabled,
|
|
@@ -6,6 +6,12 @@ const meta = {
|
|
|
6
6
|
title: "Components/ActionButton",
|
|
7
7
|
component: ActionButton,
|
|
8
8
|
tags: ["autodocs"],
|
|
9
|
+
argTypes: {
|
|
10
|
+
shape: {
|
|
11
|
+
control: { type: "inline-radio" },
|
|
12
|
+
options: ["round", "capsule"],
|
|
13
|
+
},
|
|
14
|
+
},
|
|
9
15
|
parameters: {
|
|
10
16
|
layout: "fullscreen",
|
|
11
17
|
},
|
|
@@ -18,18 +24,45 @@ export const Default = {
|
|
|
18
24
|
args: {
|
|
19
25
|
variant: "solid",
|
|
20
26
|
size: "md",
|
|
27
|
+
shape: "round",
|
|
21
28
|
},
|
|
22
29
|
render: (args) => {
|
|
23
|
-
console.log("args ", args);
|
|
24
30
|
const props = Object.assign({}, args);
|
|
25
31
|
return (_jsx("div", { className: "flex flex-row gap-2 items-start", children: _jsx(ActionButton, Object.assign({}, props, { children: _jsx(Icon, { type: "heroicons", name: "arrow-left" }) })) }));
|
|
26
32
|
},
|
|
27
33
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
const previewVariants = [
|
|
35
|
+
{ label: "Solid", variant: "solid", sizes: ["lg", "md", "sm"] },
|
|
36
|
+
{ label: "Outline", variant: "outline", sizes: ["lg", "md", "sm"] },
|
|
37
|
+
{ label: "Icon", variant: "icon", sizes: ["lg", "md", "sm", "xs", "xxs"] },
|
|
38
|
+
];
|
|
39
|
+
const previewStates = [
|
|
40
|
+
{ label: "Default", key: "default" },
|
|
41
|
+
{ label: "Hover", key: "hover" },
|
|
42
|
+
{ label: "Active", key: "active" },
|
|
43
|
+
{ label: "Active - Hover", key: "active-hover" },
|
|
44
|
+
{ label: "Disable", key: "disable" },
|
|
45
|
+
];
|
|
46
|
+
const forcedStateClassName = {
|
|
47
|
+
default: {},
|
|
48
|
+
hover: {
|
|
49
|
+
solid: "!bg-action-button-solid-hover !border-action-button-solid-hover !text-action-button-solid-hover !fill-action-button-solid-hover",
|
|
50
|
+
outline: "!bg-action-button-outline-hover !ring-[var(--action-button-outline-hover-border)] !text-action-button-outline-hover !fill-action-button-outline-hover",
|
|
51
|
+
icon: "!bg-action-button-icon-hover !text-action-button-icon-hover !fill-action-button-icon-hover",
|
|
34
52
|
},
|
|
53
|
+
active: {},
|
|
54
|
+
"active-hover": {
|
|
55
|
+
solid: "!bg-action-button-solid-active-hover !border-action-button-solid-active-hover !text-action-button-solid-active-hover !fill-action-button-solid-active-hover",
|
|
56
|
+
outline: "!bg-action-button-outline-active-hover !ring-[var(--action-button-outline-active-hover-border)] !text-action-button-outline-active-hover !fill-action-button-outline-active-hover",
|
|
57
|
+
icon: "!bg-action-button-icon-active-hover !text-action-button-icon-active-hover !fill-action-button-icon-active-hover",
|
|
58
|
+
},
|
|
59
|
+
disable: {},
|
|
60
|
+
};
|
|
61
|
+
const icon = _jsx(ArrowsUpDownIcon, {});
|
|
62
|
+
const renderPreview = (shape) => (_jsx("div", { className: "bg-base-bg2 p-8 min-h-screen", children: _jsxs("div", { className: "flex flex-col gap-6", children: [_jsx("h3", { className: "text-xl font-semibold tracking-wide text-text-white", children: "Function button" }), previewStates.map((state) => (_jsxs("div", { className: "grid grid-cols-[120px_repeat(3,minmax(0,1fr))] items-stretch gap-4", children: [_jsx("span", { className: "pt-3 text-sm font-semibold text-text-white", children: state.label }), previewVariants.map((previewVariant) => (_jsxs("div", { className: "h-full rounded-lg border border-base-bg-stroke1 bg-base-bg1 p-3", children: [_jsx("span", { className: "text-xs font-semibold tracking-wide text-text-white uppercase", children: previewVariant.label }), _jsx("div", { className: "mt-3 flex flex-wrap items-center gap-2", children: previewVariant.sizes.map((size) => (_jsx(ActionButton, { variant: previewVariant.variant, size: size, shape: shape, active: state.key === "active" || state.key === "active-hover", disabled: state.key === "disable", className: forcedStateClassName[state.key][previewVariant.variant], children: icon }, `${previewVariant.variant}-${size}-${state.key}`))) })] }, previewVariant.variant)))] }, state.key)))] }) }));
|
|
63
|
+
export const FigmaPreview = {
|
|
64
|
+
render: () => renderPreview("round"),
|
|
65
|
+
};
|
|
66
|
+
export const FigmaPreviewCapsule = {
|
|
67
|
+
render: () => renderPreview("capsule"),
|
|
35
68
|
};
|
|
@@ -8,24 +8,28 @@ export const actionButtonVariants = cva(["box-border flex items-center justify-c
|
|
|
8
8
|
"active:bg-action-button-solid-pressed active:border-action-button-solid-pressed active:text-action-button-solid-pressed active:fill-action-button-solid-pressed",
|
|
9
9
|
],
|
|
10
10
|
outline: [
|
|
11
|
-
"
|
|
12
|
-
"bg-action-button-outline-default
|
|
13
|
-
"hover:bg-action-button-outline-hover hover:
|
|
14
|
-
"active:bg-action-button-outline-pressed active:
|
|
11
|
+
"ring-1 ring-inset",
|
|
12
|
+
"bg-action-button-outline-default text-action-button-outline-default fill-action-button-outline-default ring-[var(--action-button-outline-default-border)]",
|
|
13
|
+
"hover:bg-action-button-outline-hover hover:text-action-button-outline-hover hover:fill-action-button-outline-hover hover:ring-[var(--action-button-outline-hover-border)]",
|
|
14
|
+
"active:bg-action-button-outline-pressed active:text-action-button-outline-pressed active:fill-action-button-outline-pressed active:ring-[var(--action-button-outline-pressed-border)]",
|
|
15
15
|
],
|
|
16
16
|
icon: [
|
|
17
|
-
"rounded-full",
|
|
18
17
|
"bg-action-button-icon-default border-action-button-icon-default text-action-button-icon-default fill-action-button-icon-default",
|
|
19
18
|
"hover:bg-action-button-icon-hover hover:border-action-button-icon-hover hover:text-action-button-icon-hover hover:fill-action-button-icon-hover",
|
|
20
19
|
"active:bg-action-button-icon-pressed active:border-action-button-icon-pressed active:text-action-button-icon-pressed active:fill-action-button-icon-pressed",
|
|
21
20
|
],
|
|
22
21
|
},
|
|
23
22
|
size: {
|
|
23
|
+
xxs: "",
|
|
24
24
|
xs: "",
|
|
25
25
|
sm: "",
|
|
26
26
|
md: "",
|
|
27
27
|
lg: "",
|
|
28
28
|
},
|
|
29
|
+
shape: {
|
|
30
|
+
round: "",
|
|
31
|
+
capsule: "",
|
|
32
|
+
},
|
|
29
33
|
disabled: {
|
|
30
34
|
false: "",
|
|
31
35
|
},
|
|
@@ -47,9 +51,9 @@ export const actionButtonVariants = cva(["box-border flex items-center justify-c
|
|
|
47
51
|
variant: "outline",
|
|
48
52
|
active: true,
|
|
49
53
|
className: [
|
|
50
|
-
"bg-action-button-outline-active
|
|
51
|
-
"hover:bg-action-button-outline-active-hover hover:
|
|
52
|
-
"active:bg-action-button-outline-active-pressed active:
|
|
54
|
+
"bg-action-button-outline-active text-action-button-outline-active fill-action-button-outline-active ring-[var(--action-button-outline-active-border)]",
|
|
55
|
+
"hover:bg-action-button-outline-active-hover hover:text-action-button-outline-active-hover hover:fill-action-button-outline-active-hover hover:ring-[var(--action-button-outline-active-hover-border)]",
|
|
56
|
+
"active:bg-action-button-outline-active-pressed active:text-action-button-outline-active-pressed active:fill-action-button-outline-active-pressed active:ring-[var(--action-button-outline-active-pressed-border)]",
|
|
53
57
|
],
|
|
54
58
|
},
|
|
55
59
|
{
|
|
@@ -64,42 +68,97 @@ export const actionButtonVariants = cva(["box-border flex items-center justify-c
|
|
|
64
68
|
{
|
|
65
69
|
size: "lg",
|
|
66
70
|
variant: ["solid", "outline"],
|
|
67
|
-
className: "px-
|
|
71
|
+
className: "px-[12px] py-[12px] [&_svg]:size-[32px]",
|
|
68
72
|
},
|
|
69
73
|
{
|
|
70
74
|
size: "md",
|
|
71
75
|
variant: ["solid", "outline"],
|
|
72
|
-
className: "px-
|
|
76
|
+
className: "px-[8px] py-[8px] [&_svg]:size-[22px]",
|
|
73
77
|
},
|
|
74
78
|
{
|
|
75
79
|
size: "sm",
|
|
76
80
|
variant: ["solid", "outline"],
|
|
77
|
-
className: "px-
|
|
81
|
+
className: "px-[4px] py-[4px] [&_svg]:size-[22px]",
|
|
78
82
|
},
|
|
79
83
|
{
|
|
80
84
|
size: "xs",
|
|
81
85
|
variant: ["solid", "outline"],
|
|
82
|
-
className: "px-
|
|
86
|
+
className: "px-[2px] py-[2px] [&_svg]:size-[14px]",
|
|
83
87
|
},
|
|
84
88
|
{
|
|
85
89
|
size: "lg",
|
|
86
90
|
variant: "icon",
|
|
87
|
-
className: "px-
|
|
91
|
+
className: "px-[12px] py-[12px] [&_svg]:size-[32px]",
|
|
88
92
|
},
|
|
89
93
|
{
|
|
90
94
|
size: "md",
|
|
91
95
|
variant: "icon",
|
|
92
|
-
className: "px-
|
|
96
|
+
className: "px-[8px] py-[8px] [&_svg]:size-[22px]",
|
|
93
97
|
},
|
|
94
98
|
{
|
|
95
99
|
size: "sm",
|
|
96
100
|
variant: "icon",
|
|
97
|
-
className: "px-
|
|
101
|
+
className: "px-[4px] py-[4px] [&_svg]:size-[22px]",
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
size: "xxs",
|
|
105
|
+
variant: "icon",
|
|
106
|
+
className: "px-[1px] py-[1px] [&_svg]:size-[12px]",
|
|
98
107
|
},
|
|
99
108
|
{
|
|
100
109
|
size: "xs",
|
|
101
110
|
variant: "icon",
|
|
102
|
-
className: "px-
|
|
111
|
+
className: "px-[2px] py-[2px] [&_svg]:size-[14px]",
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
size: "lg",
|
|
115
|
+
shape: "round",
|
|
116
|
+
className: "rounded-[var(--function-button-l-round)]",
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
size: "md",
|
|
120
|
+
shape: "round",
|
|
121
|
+
className: "rounded-[var(--function-button-m-round)]",
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
size: "sm",
|
|
125
|
+
shape: "round",
|
|
126
|
+
className: "rounded-[var(--function-button-s-round)]",
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
size: "xs",
|
|
130
|
+
shape: "round",
|
|
131
|
+
className: "rounded-[var(--function-button-xs-round)]",
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
size: "xxs",
|
|
135
|
+
shape: "round",
|
|
136
|
+
className: "rounded-[var(--function-button-xxs-round)]",
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
size: "lg",
|
|
140
|
+
shape: "capsule",
|
|
141
|
+
className: "rounded-[var(--function-button-l-capsule)]",
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
size: "md",
|
|
145
|
+
shape: "capsule",
|
|
146
|
+
className: "rounded-[var(--function-button-m-capsule)]",
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
size: "sm",
|
|
150
|
+
shape: "capsule",
|
|
151
|
+
className: "rounded-[var(--function-button-s-capsule)]",
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
size: "xxs",
|
|
155
|
+
shape: "capsule",
|
|
156
|
+
className: "rounded-[var(--function-button-xxs-capsule)]",
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
size: "xs",
|
|
160
|
+
shape: "capsule",
|
|
161
|
+
className: "rounded-[var(--function-button-xs-capsule)]",
|
|
103
162
|
},
|
|
104
163
|
{
|
|
105
164
|
variant: "solid",
|
|
@@ -114,7 +173,7 @@ export const actionButtonVariants = cva(["box-border flex items-center justify-c
|
|
|
114
173
|
disabled: true,
|
|
115
174
|
className: [
|
|
116
175
|
"pointer-events-none",
|
|
117
|
-
"bg-action-button-outline-disabled
|
|
176
|
+
"bg-action-button-outline-disabled text-action-button-outline-disabled fill-action-button-outline-disabled ring-[var(--action-button-outline-disabled-border)]",
|
|
118
177
|
],
|
|
119
178
|
},
|
|
120
179
|
{
|
|
@@ -129,6 +188,7 @@ export const actionButtonVariants = cva(["box-border flex items-center justify-c
|
|
|
129
188
|
defaultVariants: {
|
|
130
189
|
size: "md",
|
|
131
190
|
variant: "solid",
|
|
191
|
+
shape: "round",
|
|
132
192
|
disabled: false,
|
|
133
193
|
active: false,
|
|
134
194
|
},
|
|
@@ -15,8 +15,15 @@ import { buttonVariants } from "./Button.styles";
|
|
|
15
15
|
import { cn } from "@/utils/cn";
|
|
16
16
|
import Loading from "../Loading/Loading";
|
|
17
17
|
const Button = forwardRef((_a, ref) => {
|
|
18
|
-
var { size = "md", color = "primary", variant = "solid", title, children, startIcon, endIcon, disabled = false, fullwidth = false, isLoading = false, className } = _a, props = __rest(_a, ["size", "color", "variant", "title", "children", "startIcon", "endIcon", "disabled", "fullwidth", "isLoading", "className"]);
|
|
18
|
+
var { size = "md", shape = "round", color = "primary", variant = "solid", title, children, startIcon, endIcon, disabled = false, fullwidth = false, isLoading = false, className } = _a, props = __rest(_a, ["size", "shape", "color", "variant", "title", "children", "startIcon", "endIcon", "disabled", "fullwidth", "isLoading", "className"]);
|
|
19
19
|
const isDisabled = disabled || isLoading;
|
|
20
|
-
return (_jsx("button", Object.assign({ type: "button" }, props, { ref: ref, "aria-disabled": isDisabled || undefined, "data-loading": isLoading || undefined, tabIndex: isDisabled ? -1 : 0, className: cn(buttonVariants({
|
|
20
|
+
return (_jsx("button", Object.assign({ type: "button" }, props, { ref: ref, "aria-disabled": isDisabled || undefined, "data-loading": isLoading || undefined, tabIndex: isDisabled ? -1 : 0, className: cn(buttonVariants({
|
|
21
|
+
size,
|
|
22
|
+
shape,
|
|
23
|
+
color,
|
|
24
|
+
variant,
|
|
25
|
+
disabled,
|
|
26
|
+
fullwidth,
|
|
27
|
+
}), className), disabled: isDisabled, children: _jsxs(_Fragment, { children: [isLoading && _jsx(Loading, {}), startIcon, children || title, endIcon] }) })));
|
|
21
28
|
});
|
|
22
29
|
export default Button;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { cva } from "class-variance-authority";
|
|
2
2
|
export const buttonVariants = cva([
|
|
3
|
-
"gap-2 font-bold inline-flex items-center justify-center outline-none transition ease-in-out duration-45",
|
|
3
|
+
"relative gap-2 font-bold inline-flex items-center justify-center outline-none transition ease-in-out duration-45",
|
|
4
|
+
"before:content-[''] before:absolute before:inset-0 before:rounded-[inherit] before:pointer-events-none before:border-0 before:border-inherit",
|
|
4
5
|
], {
|
|
5
6
|
variants: {
|
|
6
7
|
color: {
|
|
@@ -55,14 +56,19 @@ export const buttonVariants = cva([
|
|
|
55
56
|
],
|
|
56
57
|
},
|
|
57
58
|
size: {
|
|
58
|
-
sm: "px-
|
|
59
|
-
md: "px-
|
|
60
|
-
lg: "px-
|
|
59
|
+
sm: "px-[12px] py-[4px] [&_svg]:size-[18px] typography-buttonMS gap-1",
|
|
60
|
+
md: "px-[16px] py-[8px] [&_svg]:size-5 typography-buttonMS",
|
|
61
|
+
lg: "px-[24px] py-[16px] [&_svg]:size-6 typography-buttonL",
|
|
62
|
+
},
|
|
63
|
+
shape: {
|
|
64
|
+
round: "",
|
|
65
|
+
capsule: "",
|
|
61
66
|
},
|
|
62
67
|
variant: {
|
|
63
|
-
solid: "border",
|
|
64
|
-
outline: "border bg-transparent",
|
|
68
|
+
solid: "before:border",
|
|
69
|
+
outline: "before:border bg-transparent",
|
|
65
70
|
flat: "bg-transparent",
|
|
71
|
+
text: "bg-transparent",
|
|
66
72
|
link: "bg-transparent underline underline-offset-4",
|
|
67
73
|
},
|
|
68
74
|
disabled: {
|
|
@@ -78,6 +84,36 @@ export const buttonVariants = cva([
|
|
|
78
84
|
},
|
|
79
85
|
},
|
|
80
86
|
compoundVariants: [
|
|
87
|
+
{
|
|
88
|
+
size: "sm",
|
|
89
|
+
shape: "round",
|
|
90
|
+
className: "rounded-[var(--button-s-round)]",
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
size: "md",
|
|
94
|
+
shape: "round",
|
|
95
|
+
className: "rounded-[var(--button-m-round)]",
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
size: "lg",
|
|
99
|
+
shape: "round",
|
|
100
|
+
className: "rounded-[var(--button-l-round)]",
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
size: "sm",
|
|
104
|
+
shape: "capsule",
|
|
105
|
+
className: "rounded-[var(--button-s-capsule)]",
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
size: "md",
|
|
109
|
+
shape: "capsule",
|
|
110
|
+
className: "rounded-[var(--button-m-capsule)]",
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
size: "lg",
|
|
114
|
+
shape: "capsule",
|
|
115
|
+
className: "rounded-[var(--button-l-capsule)]",
|
|
116
|
+
},
|
|
81
117
|
{
|
|
82
118
|
variant: "outline",
|
|
83
119
|
color: "primary",
|
|
@@ -90,7 +126,7 @@ export const buttonVariants = cva([
|
|
|
90
126
|
],
|
|
91
127
|
},
|
|
92
128
|
{
|
|
93
|
-
variant: ["flat", "link"],
|
|
129
|
+
variant: ["flat", "text", "link"],
|
|
94
130
|
color: "primary",
|
|
95
131
|
className: [
|
|
96
132
|
"bg-button-primary-flat-default border-button-primary-flat-default text-button-primary-flat-default fill-button-primary-flat-default",
|
|
@@ -112,7 +148,7 @@ export const buttonVariants = cva([
|
|
|
112
148
|
],
|
|
113
149
|
},
|
|
114
150
|
{
|
|
115
|
-
variant: ["flat", "link"],
|
|
151
|
+
variant: ["flat", "text", "link"],
|
|
116
152
|
color: "secondary",
|
|
117
153
|
className: [
|
|
118
154
|
"bg-button-secondary-flat-default border-button-secondary-flat-default text-button-secondary-flat-default fill-button-secondary-flat-default",
|
|
@@ -134,7 +170,7 @@ export const buttonVariants = cva([
|
|
|
134
170
|
],
|
|
135
171
|
},
|
|
136
172
|
{
|
|
137
|
-
variant: ["flat", "link"],
|
|
173
|
+
variant: ["flat", "text", "link"],
|
|
138
174
|
color: "tertiary",
|
|
139
175
|
className: [
|
|
140
176
|
"bg-button-tertiary-flat-default border-button-tertiary-flat-default text-button-tertiary-flat-default fill-button-tertiary-flat-default",
|
|
@@ -156,7 +192,7 @@ export const buttonVariants = cva([
|
|
|
156
192
|
],
|
|
157
193
|
},
|
|
158
194
|
{
|
|
159
|
-
variant: ["flat", "link"],
|
|
195
|
+
variant: ["flat", "text", "link"],
|
|
160
196
|
color: "info",
|
|
161
197
|
className: [
|
|
162
198
|
"bg-button-info-flat-default border-button-info-flat-default text-button-info-flat-default fill-button-info-flat-default",
|
|
@@ -178,7 +214,7 @@ export const buttonVariants = cva([
|
|
|
178
214
|
],
|
|
179
215
|
},
|
|
180
216
|
{
|
|
181
|
-
variant: ["flat", "link"],
|
|
217
|
+
variant: ["flat", "text", "link"],
|
|
182
218
|
color: "success",
|
|
183
219
|
className: [
|
|
184
220
|
"bg-button-success-flat-default border-button-success-flat-default text-button-success-flat-default fill-button-success-flat-default",
|
|
@@ -200,7 +236,7 @@ export const buttonVariants = cva([
|
|
|
200
236
|
],
|
|
201
237
|
},
|
|
202
238
|
{
|
|
203
|
-
variant: ["flat", "link"],
|
|
239
|
+
variant: ["flat", "text", "link"],
|
|
204
240
|
color: "warning",
|
|
205
241
|
className: [
|
|
206
242
|
"bg-button-warning-flat-default border-button-warning-flat-default text-button-warning-flat-default fill-button-warning-flat-default",
|
|
@@ -222,7 +258,7 @@ export const buttonVariants = cva([
|
|
|
222
258
|
],
|
|
223
259
|
},
|
|
224
260
|
{
|
|
225
|
-
variant: ["flat", "link"],
|
|
261
|
+
variant: ["flat", "text", "link"],
|
|
226
262
|
color: "error",
|
|
227
263
|
className: [
|
|
228
264
|
"bg-button-error-flat-default border-button-error-flat-default text-button-error-flat-default fill-button-error-flat-default",
|
|
@@ -234,7 +270,7 @@ export const buttonVariants = cva([
|
|
|
234
270
|
},
|
|
235
271
|
// --- Disabled --
|
|
236
272
|
{
|
|
237
|
-
variant: ["outline", "flat", "link"],
|
|
273
|
+
variant: ["outline", "flat", "text", "link"],
|
|
238
274
|
disabled: true,
|
|
239
275
|
className: [
|
|
240
276
|
"bg-transparent border-disabled-outline text-disable-outline fill-disable-outline",
|
|
@@ -243,6 +279,7 @@ export const buttonVariants = cva([
|
|
|
243
279
|
],
|
|
244
280
|
defaultVariants: {
|
|
245
281
|
size: "md",
|
|
282
|
+
shape: "round",
|
|
246
283
|
color: "primary",
|
|
247
284
|
variant: "solid",
|
|
248
285
|
fullwidth: true,
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ArrowsUpDownIcon } from "@heroicons/react/16/solid";
|
|
2
3
|
import Button from "./Button";
|
|
3
4
|
// More on how to set up stories at: https://storybook.js.org/docs/7.0/react/writing-stories/introduction
|
|
4
5
|
const meta = {
|
|
5
6
|
title: "Components/Button",
|
|
6
7
|
component: Button,
|
|
7
8
|
tags: ["autodocs"],
|
|
9
|
+
argTypes: {
|
|
10
|
+
shape: {
|
|
11
|
+
control: { type: "inline-radio" },
|
|
12
|
+
options: ["round", "capsule"],
|
|
13
|
+
},
|
|
14
|
+
},
|
|
8
15
|
parameters: {
|
|
9
16
|
// More on how to position stories at: https://storybook.js.org/docs/7.0/react/configure/story-layout
|
|
10
17
|
layout: "fullscreen",
|
|
@@ -19,6 +26,7 @@ export const Solid = {
|
|
|
19
26
|
title: "Button",
|
|
20
27
|
disabled: false,
|
|
21
28
|
isLoading: false,
|
|
29
|
+
shape: "round",
|
|
22
30
|
},
|
|
23
31
|
render: (args) => {
|
|
24
32
|
const props = Object.assign(Object.assign({}, args), { className: "capitalize" });
|
|
@@ -31,6 +39,7 @@ export const Outline = {
|
|
|
31
39
|
variant: "outline",
|
|
32
40
|
disabled: false,
|
|
33
41
|
isLoading: false,
|
|
42
|
+
shape: "round",
|
|
34
43
|
},
|
|
35
44
|
render: (args) => {
|
|
36
45
|
const props = Object.assign(Object.assign({}, args), { className: "capitalize" });
|
|
@@ -43,6 +52,20 @@ export const Flat = {
|
|
|
43
52
|
variant: "flat",
|
|
44
53
|
disabled: false,
|
|
45
54
|
isLoading: false,
|
|
55
|
+
shape: "round",
|
|
56
|
+
},
|
|
57
|
+
render: (args) => {
|
|
58
|
+
const props = Object.assign(Object.assign({}, args), { className: "capitalize" });
|
|
59
|
+
return (_jsxs("div", { className: "flex gap-2", children: [_jsx(Button, Object.assign({ color: "primary" }, props, { title: "primary" })), _jsx(Button, Object.assign({ color: "secondary" }, props, { title: "secondary" })), _jsx(Button, Object.assign({ color: "tertiary" }, props, { title: "tertiary" })), _jsx(Button, Object.assign({ color: "info" }, props, { title: "info" })), _jsx(Button, Object.assign({ color: "success" }, props, { title: "success" })), _jsx(Button, Object.assign({ color: "warning" }, props, { title: "warning" })), _jsx(Button, Object.assign({ color: "error" }, props, { title: "error" }))] }));
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
export const Text = {
|
|
63
|
+
args: {
|
|
64
|
+
title: "Button",
|
|
65
|
+
variant: "text",
|
|
66
|
+
disabled: false,
|
|
67
|
+
isLoading: false,
|
|
68
|
+
shape: "round",
|
|
46
69
|
},
|
|
47
70
|
render: (args) => {
|
|
48
71
|
const props = Object.assign(Object.assign({}, args), { className: "capitalize" });
|
|
@@ -55,9 +78,41 @@ export const Link = {
|
|
|
55
78
|
variant: "link",
|
|
56
79
|
disabled: false,
|
|
57
80
|
isLoading: false,
|
|
81
|
+
shape: "round",
|
|
58
82
|
},
|
|
59
83
|
render: (args) => {
|
|
60
84
|
const props = Object.assign(Object.assign({}, args), { className: "capitalize" });
|
|
61
85
|
return (_jsxs("div", { className: "flex gap-2", children: [_jsx(Button, Object.assign({ color: "primary" }, props, { title: "primary" })), _jsx(Button, Object.assign({ color: "secondary" }, props, { title: "secondary" })), _jsx(Button, Object.assign({ color: "tertiary" }, props, { title: "tertiary" })), _jsx(Button, Object.assign({ color: "info" }, props, { title: "info" })), _jsx(Button, Object.assign({ color: "success" }, props, { title: "success" })), _jsx(Button, Object.assign({ color: "warning" }, props, { title: "warning" })), _jsx(Button, Object.assign({ color: "error" }, props, { title: "error" }))] }));
|
|
62
86
|
},
|
|
63
87
|
};
|
|
88
|
+
export const ShapePreview = {
|
|
89
|
+
args: {
|
|
90
|
+
variant: "solid",
|
|
91
|
+
color: "primary",
|
|
92
|
+
},
|
|
93
|
+
render: (args) => (_jsxs("div", { className: "flex flex-col gap-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "w-20 typography-subtitile4", children: "Round" }), _jsx(Button, Object.assign({}, args, { shape: "round", size: "lg", title: "Large" })), _jsx(Button, Object.assign({}, args, { shape: "round", size: "md", title: "Medium" })), _jsx(Button, Object.assign({}, args, { shape: "round", size: "sm", title: "Small" }))] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "w-20 typography-subtitile4", children: "Capsule" }), _jsx(Button, Object.assign({}, args, { shape: "capsule", size: "lg", title: "Large" })), _jsx(Button, Object.assign({}, args, { shape: "capsule", size: "md", title: "Medium" })), _jsx(Button, Object.assign({}, args, { shape: "capsule", size: "sm", title: "Small" }))] })] })),
|
|
94
|
+
};
|
|
95
|
+
const previewColors = ["primary", "secondary", "tertiary", "info", "success", "warning", "error"];
|
|
96
|
+
const previewSizes = ["lg", "md", "sm"];
|
|
97
|
+
const previewSizeLabel = {
|
|
98
|
+
lg: "Large",
|
|
99
|
+
md: "Medium",
|
|
100
|
+
sm: "Small",
|
|
101
|
+
};
|
|
102
|
+
const previewStyles = [
|
|
103
|
+
{ label: "Solid", variant: "solid" },
|
|
104
|
+
{ label: "Outline", variant: "outline" },
|
|
105
|
+
{ label: "Text", variant: "text" },
|
|
106
|
+
];
|
|
107
|
+
const icon = _jsx(ArrowsUpDownIcon, {});
|
|
108
|
+
const previewStates = [
|
|
109
|
+
{ label: "Default", isLoading: false, disabled: false },
|
|
110
|
+
{ label: "Loading", isLoading: true, disabled: false },
|
|
111
|
+
{ label: "Disable", isLoading: false, disabled: true },
|
|
112
|
+
];
|
|
113
|
+
export const FigmaPreview = {
|
|
114
|
+
render: () => (_jsx("div", { className: "bg-base-bg2 p-8 min-h-screen", children: _jsx("div", { className: "flex flex-col gap-10", children: previewColors.map((color) => (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsxs("h3", { className: "text-xl font-semibold tracking-wide text-text-white capitalize", children: [color, " btn"] }), previewStates.map((state) => (_jsx("div", { className: "grid grid-cols-[repeat(3,minmax(0,1fr))] items-stretch gap-2", children: previewStyles.map((style) => (_jsxs("div", { className: "h-full rounded-lg border border-base-bg-stroke1 bg-base-bg1 p-3", children: [_jsxs("span", { className: "text-xs font-semibold tracking-wide text-text-white uppercase", children: [style.label, " (", state.label, ")"] }), _jsx("div", { className: "mt-3 flex flex-col gap-2", children: previewSizes.map((size) => (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Button, { color: color, variant: style.variant, size: size, title: previewSizeLabel[size], startIcon: icon, isLoading: state.isLoading, disabled: state.disabled, fullwidth: false }), _jsx(Button, { color: color, variant: style.variant, size: size, title: previewSizeLabel[size], isLoading: state.isLoading, disabled: state.disabled, fullwidth: false }), _jsx(Button, { color: color, variant: style.variant, size: size, title: previewSizeLabel[size], endIcon: icon, isLoading: state.isLoading, disabled: state.disabled, fullwidth: false })] }, size))) })] }, style.label))) }, state.label)))] }, color))) }) })),
|
|
115
|
+
};
|
|
116
|
+
export const FigmaPreviewCapsule = {
|
|
117
|
+
render: () => (_jsx("div", { className: "bg-base-bg2 p-8 min-h-screen", children: _jsx("div", { className: "flex flex-col gap-10", children: previewColors.map((color) => (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsxs("h3", { className: "text-xl font-semibold tracking-wide text-text-white capitalize", children: [color, " btn"] }), previewStates.map((state) => (_jsx("div", { className: "grid grid-cols-[repeat(3,minmax(0,1fr))] items-stretch gap-4", children: previewStyles.map((style) => (_jsxs("div", { className: "h-full rounded-lg border border-base-bg-stroke1 bg-base-bg1 p-3", children: [_jsxs("span", { className: "text-xs font-semibold tracking-wide text-text-white uppercase", children: [style.label, " (", state.label, ")"] }), _jsx("div", { className: "mt-3 flex flex-col gap-2", children: previewSizes.map((size) => (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Button, { color: color, variant: style.variant, size: size, shape: "capsule", title: previewSizeLabel[size], startIcon: icon, isLoading: state.isLoading, disabled: state.disabled, fullwidth: false }), _jsx(Button, { color: color, variant: style.variant, size: size, shape: "capsule", title: previewSizeLabel[size], isLoading: state.isLoading, disabled: state.disabled, fullwidth: false }), _jsx(Button, { color: color, variant: style.variant, size: size, shape: "capsule", title: previewSizeLabel[size], endIcon: icon, isLoading: state.isLoading, disabled: state.disabled, fullwidth: false })] }, size))) })] }, style.label))) }, state.label)))] }, color))) }) })),
|
|
118
|
+
};
|
|
@@ -10,18 +10,17 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
}
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
import * as React from "react";
|
|
15
15
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
16
|
-
import { CheckIcon } from "@heroicons/react/16/solid";
|
|
16
|
+
import { CheckIcon, MinusIcon } from "@heroicons/react/16/solid";
|
|
17
17
|
import { cn } from "@/utils/cn";
|
|
18
18
|
const Checkbox = React.forwardRef((_a, ref) => {
|
|
19
19
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
20
|
-
return (_jsx(CheckboxPrimitive.Root, Object.assign({ ref: ref, className: cn("peer size-4 shrink-0 rounded-[var(--spacing-spacing-xxs,2px)] border border-function-default-solid ring-offset-background", "hover:border-function-default-hover", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", "disabled:cursor-not-allowed disabled:border-state-disable-solid disabled:text-state-disable-outline", {
|
|
21
|
-
"data-[state=checked]:border-function-active-solid data-[state=checked]:bg-function-active-solid data-[state=checked]:text-function-active-icon": !props.disabled,
|
|
22
|
-
"hover:data-[state=checked]:border-function-active-hover hover:data-[state=checked]:bg-function-active-hover": !props.disabled,
|
|
23
|
-
|
|
24
|
-
}, className) }, props, { children: _jsx(CheckboxPrimitive.Indicator, { className: cn("flex items-center justify-center text-current"), children: _jsx(CheckIcon, { className: "size-4" }) }) })));
|
|
20
|
+
return (_jsx(CheckboxPrimitive.Root, Object.assign({ ref: ref, className: cn("peer size-4 shrink-0 cursor-pointer rounded-[var(--spacing-spacing-xxs,2px)] border border-function-default-solid ring-offset-background", "hover:border-function-default-hover", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", "disabled:cursor-not-allowed disabled:border-state-disable-solid disabled:text-state-disable-outline disabled:data-[state=checked]:bg-state-disable-solid disabled:data-[state=indeterminate]:bg-state-disable-solid", {
|
|
21
|
+
"data-[state=checked]:border-function-active-solid data-[state=checked]:bg-function-active-solid data-[state=checked]:text-function-active-icon data-[state=indeterminate]:border-function-active-solid data-[state=indeterminate]:bg-function-active-solid data-[state=indeterminate]:text-function-active-icon": !props.disabled,
|
|
22
|
+
"hover:data-[state=checked]:border-function-active-hover hover:data-[state=checked]:bg-function-active-hover hover:data-[state=indeterminate]:border-function-active-hover hover:data-[state=indeterminate]:bg-function-active-hover": !props.disabled,
|
|
23
|
+
}, className) }, props, { children: _jsxs(CheckboxPrimitive.Indicator, { className: cn("flex size-[14px] items-center justify-center text-current", "[&[data-state=checked]_.checkbox-check-icon]:block", "[&[data-state=indeterminate]_.checkbox-minus-icon]:block"), children: [_jsx(CheckIcon, { className: "checkbox-check-icon hidden size-[14px]" }), _jsx(MinusIcon, { className: "checkbox-minus-icon hidden size-[14px]" })] }) })));
|
|
25
24
|
});
|
|
26
25
|
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
27
26
|
export { Checkbox };
|