@rovula/ui 0.1.1 → 0.1.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/cjs/bundle.css +358 -73
- package/dist/cjs/bundle.js +1564 -1570
- 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 +1 -0
- package/dist/cjs/types/components/InputFilter/InputFilter.stories.d.ts +1 -0
- package/dist/cjs/types/components/MaskedTextInput/MaskedTextInput.d.ts +1 -0
- package/dist/cjs/types/components/MaskedTextInput/MaskedTextInput.stories.d.ts +2 -0
- package/dist/cjs/types/components/PasswordInput/PasswordInput.stories.d.ts +1 -0
- package/dist/cjs/types/components/RadioGroup/RadioGroup.stories.d.ts +10 -7
- package/dist/cjs/types/components/Search/Search.stories.d.ts +1 -0
- package/dist/cjs/types/components/TextInput/TextInput.d.ts +2 -0
- package/dist/cjs/types/components/TextInput/TextInput.stories.d.ts +10 -0
- package/dist/cjs/types/components/TextInput/TextInput.styles.d.ts +15 -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/PasswordInput/PasswordInput.js +2 -2
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.stories.js +16 -1
- package/dist/components/TextArea/TextArea.styles.js +1 -1
- package/dist/components/TextInput/TextInput.js +33 -24
- package/dist/components/TextInput/TextInput.stories.js +14 -2
- package/dist/components/TextInput/TextInput.styles.js +25 -10
- package/dist/esm/bundle.css +358 -73
- package/dist/esm/bundle.js +1564 -1570
- 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 +1 -0
- package/dist/esm/types/components/InputFilter/InputFilter.stories.d.ts +1 -0
- package/dist/esm/types/components/MaskedTextInput/MaskedTextInput.d.ts +1 -0
- package/dist/esm/types/components/MaskedTextInput/MaskedTextInput.stories.d.ts +2 -0
- package/dist/esm/types/components/PasswordInput/PasswordInput.stories.d.ts +1 -0
- package/dist/esm/types/components/RadioGroup/RadioGroup.stories.d.ts +10 -7
- package/dist/esm/types/components/Search/Search.stories.d.ts +1 -0
- package/dist/esm/types/components/TextInput/TextInput.d.ts +2 -0
- package/dist/esm/types/components/TextInput/TextInput.stories.d.ts +10 -0
- package/dist/esm/types/components/TextInput/TextInput.styles.d.ts +15 -0
- package/dist/index.d.ts +9 -3
- package/dist/src/theme/global.css +453 -84
- 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/PasswordInput/PasswordInput.tsx +2 -2
- package/src/components/RadioGroup/RadioGroup.stories.tsx +43 -4
- package/src/components/RadioGroup/RadioGroup.tsx +1 -1
- package/src/components/TextArea/TextArea.styles.ts +1 -1
- package/src/components/TextInput/TextInput.stories.tsx +60 -2
- package/src/components/TextInput/TextInput.styles.ts +36 -19
- package/src/components/TextInput/TextInput.tsx +83 -55
- package/src/theme/themes/variable.css +1 -1
|
@@ -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 };
|
|
@@ -29,10 +29,32 @@ export const WithText = {
|
|
|
29
29
|
return (_jsxs("div", { className: "items-top flex space-x-2", children: [_jsx(Checkbox, { id: "terms1" }), _jsxs("div", { className: "grid gap-1.5 leading-none", children: [_jsx("label", { htmlFor: "terms1", className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: "Accept terms and conditions" }), _jsx("p", { className: "text-sm text-muted-foreground", children: "You agree to our Terms of Service and Privacy Policy." })] })] }));
|
|
30
30
|
},
|
|
31
31
|
};
|
|
32
|
-
export const
|
|
32
|
+
export const Disabled = {
|
|
33
33
|
args: {},
|
|
34
34
|
render: (args) => {
|
|
35
35
|
const props = Object.assign({}, args);
|
|
36
36
|
return (_jsxs("div", { className: "flex items-center space-x-2", children: [_jsx(Checkbox, { id: "terms2", disabled: true }), _jsx("label", { htmlFor: "terms2", className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: "Accept terms and conditions" })] }));
|
|
37
37
|
},
|
|
38
38
|
};
|
|
39
|
+
const checkboxPreviewRows = [
|
|
40
|
+
{ label: "Default", checked: false },
|
|
41
|
+
{ label: "Hover", checked: false, className: "!border-function-default-hover" },
|
|
42
|
+
{ label: "Disable", checked: false, disabled: true },
|
|
43
|
+
{ label: "Checked", checked: true },
|
|
44
|
+
{
|
|
45
|
+
label: "Checked - Hover",
|
|
46
|
+
checked: true,
|
|
47
|
+
className: "!data-[state=checked]:border-function-active-hover !data-[state=checked]:bg-function-active-hover",
|
|
48
|
+
},
|
|
49
|
+
{ label: "Checked - Disable", checked: true, disabled: true },
|
|
50
|
+
{ label: "Indeterminate", checked: "indeterminate" },
|
|
51
|
+
{
|
|
52
|
+
label: "Indeterminate - Hover",
|
|
53
|
+
checked: "indeterminate",
|
|
54
|
+
className: "!data-[state=indeterminate]:border-function-active-hover !data-[state=indeterminate]:bg-function-active-hover",
|
|
55
|
+
},
|
|
56
|
+
{ label: "Indeterminate - Disable", checked: "indeterminate", disabled: true },
|
|
57
|
+
];
|
|
58
|
+
export const FigmaPreview = {
|
|
59
|
+
render: () => (_jsx("div", { className: "bg-base-bg2 p-8 min-h-screen", children: _jsx("div", { className: "mx-auto flex w-full max-w-[360px] flex-col gap-4 rounded-lg border border-base-bg-stroke1 bg-base-bg1 p-6", children: checkboxPreviewRows.map((row) => (_jsxs("div", { className: "grid grid-cols-[160px_16px] items-center gap-4", children: [_jsx("span", { className: "text-sm font-medium text-text-white", children: row.label }), _jsx(Checkbox, { checked: row.checked, disabled: row.disabled, className: row.className })] }, row.label))) }) })),
|
|
60
|
+
};
|
|
@@ -119,6 +119,6 @@ const InputFilter = forwardRef((_a, ref) => {
|
|
|
119
119
|
active: !!values.length,
|
|
120
120
|
disabled,
|
|
121
121
|
});
|
|
122
|
-
return (_jsxs("div", { ref: containerRef, className: `relative ${fullwidth ? "w-full" : ""}`, children: [_jsx(TextInput, Object.assign({ hasClearIcon: false, endIcon: _jsx(
|
|
122
|
+
return (_jsxs("div", { ref: containerRef, className: `relative ${fullwidth ? "w-full" : ""}`, children: [_jsx(TextInput, Object.assign({ hasClearIcon: false, endIcon: _jsx(Icon, { type: "heroicons", name: "adjustments-horizontal", variant: "outline", color: "inherit", stroke: "inherit", fill: "transparent" }), classes: { endIconWrapper: filterIconClassName } }, props, { ref: ref, readOnly: !filterMode, value: textValue, onChange: handleOnChangeText, label: label, placeholder: " ", type: "text", rounded: rounded, variant: variant, helperText: helperText, errorMessage: errorMessage, fullwidth: fullwidth, error: error, required: required, id: _id, disabled: disabled, size: size, className: customInputVariant({ size }), onFocus: handleOnFocus, onKeyDown: handleOnKeyDown })), isFocused && renderOptions()] }));
|
|
123
123
|
});
|
|
124
124
|
export { InputFilter };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cva } from "class-variance-authority";
|
|
2
2
|
export const filterIconVariant = cva([
|
|
3
3
|
// Base styles
|
|
4
|
-
"absolute
|
|
4
|
+
"absolute flex items-center justify-center cursor-pointer",
|
|
5
5
|
// Border styles
|
|
6
6
|
"border-l border-l-input-default-stroke",
|
|
7
7
|
"peer-hover:border-l-input-active-stroke",
|
|
@@ -28,8 +28,8 @@ export const PasswordInput = forwardRef((_a, ref) => {
|
|
|
28
28
|
onClickEndIcon === null || onClickEndIcon === void 0 ? void 0 : onClickEndIcon();
|
|
29
29
|
};
|
|
30
30
|
const toggleIcon = visible
|
|
31
|
-
? showIcon !== null && showIcon !== void 0 ? showIcon : _jsx(Icon, { name: "eye", type: "lucide", size: "inherit", className: "size-full", "aria-label": "Hide password" })
|
|
32
|
-
: hideIcon !== null && hideIcon !== void 0 ? hideIcon : _jsx(Icon, { name: "eye-closed", type: "lucide", size: "inherit", className: "size-full", "aria-label": "Show password" });
|
|
31
|
+
? showIcon !== null && showIcon !== void 0 ? showIcon : _jsx(Icon, { name: "eye", type: "lucide", size: "inherit", className: "size-full stroke-input-default-stroke hover:stroke-input-active-stroke", "aria-label": "Hide password" })
|
|
32
|
+
: hideIcon !== null && hideIcon !== void 0 ? hideIcon : _jsx(Icon, { name: "eye-closed", type: "lucide", size: "inherit", className: "size-full stroke-input-default-stroke hover:stroke-input-active-stroke", "aria-label": "Show password" });
|
|
33
33
|
return (_jsx(TextInput, Object.assign({ iconMode: "flat" }, props, { ref: inputRef, type: visible ? "text" : "password", hasClearIcon: hasClearIcon, endIcon: showToggle ? toggleIcon : endIcon, renderEndIcon: renderEndIcon, onClickEndIcon: showToggle ? handleToggleVisibility : onClickEndIcon, autoComplete: (_b = props.autoComplete) !== null && _b !== void 0 ? _b : "current-password" })));
|
|
34
34
|
});
|
|
35
35
|
PasswordInput.displayName = "PasswordInput";
|
|
@@ -20,7 +20,7 @@ const RadioGroup = React.forwardRef((_a, ref) => {
|
|
|
20
20
|
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
21
21
|
const RadioGroupItem = React.forwardRef((_a, ref) => {
|
|
22
22
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
23
|
-
return (_jsx(RadioGroupPrimitive.Item, Object.assign({ ref: ref, className: cn("aspect-square box-border size-4 rounded-full border border-function-default-solid text-function-default-solid", "hover:border-function-default-hover", "focus:outline-none",
|
|
23
|
+
return (_jsx(RadioGroupPrimitive.Item, Object.assign({ ref: ref, className: cn("aspect-square box-border size-4 cursor-pointer rounded-full border border-function-default-solid text-function-default-solid", "hover:border-function-default-hover", "focus:outline-none",
|
|
24
24
|
// Disabled state styles
|
|
25
25
|
"data-[disabled]:!border-state-disable-solid data-[disabled]:!fill-state-disable-solid data-[disabled]:!cursor-not-allowed data-[disabled]:!pointer-events-none data-[disabled]:!text-state-disable-solid",
|
|
26
26
|
// Checked state styles
|
|
@@ -22,7 +22,7 @@ export const Default = {
|
|
|
22
22
|
return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsxs(RadioGroup, Object.assign({ defaultValue: "option-one" }, props, { children: [_jsxs("div", { className: "flex items-center space-x-2", children: [_jsx(RadioGroupItem, { value: "option-one", id: "option-one" }), _jsx(Label, { htmlFor: "option-one", children: "Option One" })] }), _jsxs("div", { className: "flex items-center space-x-2", children: [_jsx(RadioGroupItem, { value: "option-two", id: "option-two" }), _jsx(Label, { htmlFor: "option-two", children: "Option Two" })] })] })) }));
|
|
23
23
|
},
|
|
24
24
|
};
|
|
25
|
-
export const
|
|
25
|
+
export const Disabled = {
|
|
26
26
|
args: {
|
|
27
27
|
disabled: true,
|
|
28
28
|
},
|
|
@@ -40,3 +40,18 @@ export const Horizontal = {
|
|
|
40
40
|
return (_jsxs(RadioGroup, { defaultValue: "option1", className: "flex flex-row space-x-4", children: [_jsxs("div", { className: "flex items-center space-x-2", children: [_jsx(RadioGroupItem, { value: "option1", id: "option1" }), _jsx(Label, { htmlFor: "option1", children: "Option 1" })] }), _jsxs("div", { className: "flex items-center space-x-2", children: [_jsx(RadioGroupItem, { value: "option2", id: "option2" }), _jsx(Label, { htmlFor: "option2", children: "Option 2" })] }), _jsxs("div", { className: "flex items-center space-x-2", children: [_jsx(RadioGroupItem, { value: "option3", id: "option3" }), _jsx(Label, { htmlFor: "option3", children: "Option 3" })] })] }));
|
|
41
41
|
},
|
|
42
42
|
};
|
|
43
|
+
const radioPreviewRows = [
|
|
44
|
+
{ label: "Default", checked: false },
|
|
45
|
+
{ label: "Hover", checked: false, className: "!border-function-default-hover" },
|
|
46
|
+
{ label: "Disable", checked: false, disabled: true },
|
|
47
|
+
{ label: "Checked", checked: true },
|
|
48
|
+
{
|
|
49
|
+
label: "Checked - Hover",
|
|
50
|
+
checked: true,
|
|
51
|
+
className: "!data-[state=checked]:border-function-active-hover !data-[state=checked]:text-function-active-hover",
|
|
52
|
+
},
|
|
53
|
+
{ label: "Checked - Disable", checked: true, disabled: true },
|
|
54
|
+
];
|
|
55
|
+
export const FigmaPreview = {
|
|
56
|
+
render: () => (_jsx("div", { className: "bg-base-bg2 p-8 min-h-screen", children: _jsx("div", { className: "mx-auto flex w-full max-w-[360px] flex-col gap-4 rounded-lg border border-base-bg-stroke1 bg-base-bg1 p-6", children: radioPreviewRows.map((row) => (_jsxs("div", { className: "grid grid-cols-[160px_16px] items-center gap-4", children: [_jsx("span", { className: "text-sm font-medium text-text-white", children: row.label }), _jsx(RadioGroup, { defaultValue: row.checked ? "option" : undefined, disabled: row.disabled, children: _jsx(RadioGroupItem, { value: "option", className: row.className }) })] }, row.label))) }) })),
|
|
57
|
+
};
|
|
@@ -184,7 +184,7 @@ export const clearIconVariant = cva([
|
|
|
184
184
|
size: "md",
|
|
185
185
|
},
|
|
186
186
|
});
|
|
187
|
-
export const helperTextVariant = cva(["
|
|
187
|
+
export const helperTextVariant = cva(["typography-small1 flex flex-row items-center gap-1"], {
|
|
188
188
|
variants: {
|
|
189
189
|
size: {
|
|
190
190
|
sm: "mt-1",
|