@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
package/package.json
CHANGED
|
@@ -9,6 +9,12 @@ const meta = {
|
|
|
9
9
|
title: "Components/ActionButton",
|
|
10
10
|
component: ActionButton,
|
|
11
11
|
tags: ["autodocs"],
|
|
12
|
+
argTypes: {
|
|
13
|
+
shape: {
|
|
14
|
+
control: { type: "inline-radio" },
|
|
15
|
+
options: ["round", "capsule"],
|
|
16
|
+
},
|
|
17
|
+
},
|
|
12
18
|
parameters: {
|
|
13
19
|
layout: "fullscreen",
|
|
14
20
|
},
|
|
@@ -22,14 +28,15 @@ const meta = {
|
|
|
22
28
|
} satisfies Meta<typeof ActionButton>;
|
|
23
29
|
|
|
24
30
|
export default meta;
|
|
31
|
+
type Story = StoryObj<typeof ActionButton>;
|
|
25
32
|
|
|
26
33
|
export const Default = {
|
|
27
34
|
args: {
|
|
28
35
|
variant: "solid",
|
|
29
36
|
size: "md",
|
|
37
|
+
shape: "round",
|
|
30
38
|
},
|
|
31
39
|
render: (args) => {
|
|
32
|
-
console.log("args ", args);
|
|
33
40
|
const props: typeof args = {
|
|
34
41
|
...args,
|
|
35
42
|
};
|
|
@@ -41,155 +48,104 @@ export const Default = {
|
|
|
41
48
|
</div>
|
|
42
49
|
);
|
|
43
50
|
},
|
|
44
|
-
} satisfies
|
|
51
|
+
} satisfies Story;
|
|
45
52
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
console.log("args ", args);
|
|
50
|
-
const props: typeof args = {
|
|
51
|
-
...args,
|
|
52
|
-
};
|
|
53
|
-
return (
|
|
54
|
-
<div className="flex flex-col gap-2 w-full p-20">
|
|
55
|
-
<div className="flex flex-row justify-between items-center">
|
|
56
|
-
<h6 className="w-[20px] text-white">Default:</h6>
|
|
57
|
-
<div className="flex flex-row gap-2 items-start ">
|
|
58
|
-
<ActionButton variant="solid" size="lg">
|
|
59
|
-
<Icon type="heroicons" name="arrows-up-down" />
|
|
60
|
-
</ActionButton>
|
|
61
|
-
<ActionButton variant="solid" size="md">
|
|
62
|
-
<ArrowsUpDownIcon />
|
|
63
|
-
</ActionButton>
|
|
64
|
-
<ActionButton variant="solid" size="sm">
|
|
65
|
-
<ArrowsUpDownIcon />
|
|
66
|
-
</ActionButton>
|
|
67
|
-
<ActionButton variant="solid" size="xs">
|
|
68
|
-
<ArrowsUpDownIcon />
|
|
69
|
-
</ActionButton>
|
|
70
|
-
</div>
|
|
71
|
-
<div className="flex flex-row gap-2 items-start">
|
|
72
|
-
<ActionButton variant="outline" size="lg">
|
|
73
|
-
<ArrowsUpDownIcon />
|
|
74
|
-
</ActionButton>
|
|
75
|
-
<ActionButton variant="outline" size="md">
|
|
76
|
-
<ArrowsUpDownIcon />
|
|
77
|
-
</ActionButton>
|
|
78
|
-
<ActionButton variant="outline" size="sm">
|
|
79
|
-
<ArrowsUpDownIcon />
|
|
80
|
-
</ActionButton>
|
|
81
|
-
<ActionButton variant="outline" size="xs">
|
|
82
|
-
<ArrowsUpDownIcon />
|
|
83
|
-
</ActionButton>
|
|
84
|
-
</div>
|
|
85
|
-
<div className="flex flex-row gap-2 items-start">
|
|
86
|
-
<ActionButton variant="icon" size="lg">
|
|
87
|
-
<ArrowsUpDownIcon />
|
|
88
|
-
</ActionButton>
|
|
89
|
-
<ActionButton variant="icon" size="md">
|
|
90
|
-
<ArrowsUpDownIcon />
|
|
91
|
-
</ActionButton>
|
|
92
|
-
<ActionButton variant="icon" size="sm">
|
|
93
|
-
<ArrowsUpDownIcon />
|
|
94
|
-
</ActionButton>
|
|
95
|
-
<ActionButton variant="icon" size="xs">
|
|
96
|
-
<ArrowsUpDownIcon />
|
|
97
|
-
</ActionButton>
|
|
98
|
-
</div>
|
|
99
|
-
</div>
|
|
53
|
+
type ActionButtonVariant = "solid" | "outline" | "icon";
|
|
54
|
+
type ActionButtonSize = "xxs" | "xs" | "sm" | "md" | "lg";
|
|
55
|
+
type PreviewState = "default" | "hover" | "active" | "active-hover" | "disable";
|
|
100
56
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
<ActionButton variant="solid" size="sm" active>
|
|
111
|
-
<ArrowsUpDownIcon />
|
|
112
|
-
</ActionButton>
|
|
113
|
-
<ActionButton variant="solid" size="xs" active>
|
|
114
|
-
<ArrowsUpDownIcon />
|
|
115
|
-
</ActionButton>
|
|
116
|
-
</div>
|
|
117
|
-
<div className="flex flex-row gap-2 items-start">
|
|
118
|
-
<ActionButton variant="outline" size="lg" active>
|
|
119
|
-
<ArrowsUpDownIcon />
|
|
120
|
-
</ActionButton>
|
|
121
|
-
<ActionButton variant="outline" size="md" active>
|
|
122
|
-
<ArrowsUpDownIcon />
|
|
123
|
-
</ActionButton>
|
|
124
|
-
<ActionButton variant="outline" size="sm" active>
|
|
125
|
-
<ArrowsUpDownIcon />
|
|
126
|
-
</ActionButton>
|
|
127
|
-
<ActionButton variant="outline" size="xs" active>
|
|
128
|
-
<ArrowsUpDownIcon />
|
|
129
|
-
</ActionButton>
|
|
130
|
-
</div>
|
|
131
|
-
<div className="flex flex-row gap-2 items-start">
|
|
132
|
-
<ActionButton variant="icon" size="lg" active>
|
|
133
|
-
<ArrowsUpDownIcon />
|
|
134
|
-
</ActionButton>
|
|
135
|
-
<ActionButton variant="icon" size="md" active>
|
|
136
|
-
<ArrowsUpDownIcon />
|
|
137
|
-
</ActionButton>
|
|
138
|
-
<ActionButton variant="icon" size="sm" active>
|
|
139
|
-
<ArrowsUpDownIcon />
|
|
140
|
-
</ActionButton>
|
|
141
|
-
<ActionButton variant="icon" size="xs" active>
|
|
142
|
-
<ArrowsUpDownIcon />
|
|
143
|
-
</ActionButton>
|
|
144
|
-
</div>
|
|
145
|
-
</div>
|
|
57
|
+
const previewVariants: Array<{
|
|
58
|
+
label: string;
|
|
59
|
+
variant: ActionButtonVariant;
|
|
60
|
+
sizes: ActionButtonSize[];
|
|
61
|
+
}> = [
|
|
62
|
+
{ label: "Solid", variant: "solid", sizes: ["lg", "md", "sm"] },
|
|
63
|
+
{ label: "Outline", variant: "outline", sizes: ["lg", "md", "sm"] },
|
|
64
|
+
{ label: "Icon", variant: "icon", sizes: ["lg", "md", "sm", "xs", "xxs"] },
|
|
65
|
+
];
|
|
146
66
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
</ActionButton>
|
|
176
|
-
</div>
|
|
177
|
-
<div className="flex flex-row gap-2 items-start">
|
|
178
|
-
<ActionButton variant="icon" size="lg" disabled>
|
|
179
|
-
<ArrowsUpDownIcon />
|
|
180
|
-
</ActionButton>
|
|
181
|
-
<ActionButton variant="icon" size="md" disabled>
|
|
182
|
-
<ArrowsUpDownIcon />
|
|
183
|
-
</ActionButton>
|
|
184
|
-
<ActionButton variant="icon" size="sm" disabled>
|
|
185
|
-
<ArrowsUpDownIcon />
|
|
186
|
-
</ActionButton>
|
|
187
|
-
<ActionButton variant="icon" size="xs" disabled>
|
|
188
|
-
<ArrowsUpDownIcon />
|
|
189
|
-
</ActionButton>
|
|
190
|
-
</div>
|
|
191
|
-
</div>
|
|
192
|
-
</div>
|
|
193
|
-
);
|
|
67
|
+
const previewStates: Array<{ label: string; key: PreviewState }> = [
|
|
68
|
+
{ label: "Default", key: "default" },
|
|
69
|
+
{ label: "Hover", key: "hover" },
|
|
70
|
+
{ label: "Active", key: "active" },
|
|
71
|
+
{ label: "Active - Hover", key: "active-hover" },
|
|
72
|
+
{ label: "Disable", key: "disable" },
|
|
73
|
+
];
|
|
74
|
+
|
|
75
|
+
const forcedStateClassName: Record<
|
|
76
|
+
PreviewState,
|
|
77
|
+
Partial<Record<ActionButtonVariant, string>>
|
|
78
|
+
> = {
|
|
79
|
+
default: {},
|
|
80
|
+
hover: {
|
|
81
|
+
solid:
|
|
82
|
+
"!bg-action-button-solid-hover !border-action-button-solid-hover !text-action-button-solid-hover !fill-action-button-solid-hover",
|
|
83
|
+
outline:
|
|
84
|
+
"!bg-action-button-outline-hover !ring-[var(--action-button-outline-hover-border)] !text-action-button-outline-hover !fill-action-button-outline-hover",
|
|
85
|
+
icon: "!bg-action-button-icon-hover !text-action-button-icon-hover !fill-action-button-icon-hover",
|
|
86
|
+
},
|
|
87
|
+
active: {},
|
|
88
|
+
"active-hover": {
|
|
89
|
+
solid:
|
|
90
|
+
"!bg-action-button-solid-active-hover !border-action-button-solid-active-hover !text-action-button-solid-active-hover !fill-action-button-solid-active-hover",
|
|
91
|
+
outline:
|
|
92
|
+
"!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",
|
|
93
|
+
icon:
|
|
94
|
+
"!bg-action-button-icon-active-hover !text-action-button-icon-active-hover !fill-action-button-icon-active-hover",
|
|
194
95
|
},
|
|
195
|
-
}
|
|
96
|
+
disable: {},
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const icon = <ArrowsUpDownIcon />;
|
|
100
|
+
|
|
101
|
+
const renderPreview = (shape: "round" | "capsule") => (
|
|
102
|
+
<div className="bg-base-bg2 p-8 min-h-screen">
|
|
103
|
+
<div className="flex flex-col gap-6">
|
|
104
|
+
<h3 className="text-xl font-semibold tracking-wide text-text-white">Function button</h3>
|
|
105
|
+
|
|
106
|
+
{previewStates.map((state) => (
|
|
107
|
+
<div
|
|
108
|
+
key={state.key}
|
|
109
|
+
className="grid grid-cols-[120px_repeat(3,minmax(0,1fr))] items-stretch gap-4"
|
|
110
|
+
>
|
|
111
|
+
<span className="pt-3 text-sm font-semibold text-text-white">{state.label}</span>
|
|
112
|
+
|
|
113
|
+
{previewVariants.map((previewVariant) => (
|
|
114
|
+
<div
|
|
115
|
+
key={previewVariant.variant}
|
|
116
|
+
className="h-full rounded-lg border border-base-bg-stroke1 bg-base-bg1 p-3"
|
|
117
|
+
>
|
|
118
|
+
<span className="text-xs font-semibold tracking-wide text-text-white uppercase">
|
|
119
|
+
{previewVariant.label}
|
|
120
|
+
</span>
|
|
121
|
+
|
|
122
|
+
<div className="mt-3 flex flex-wrap items-center gap-2">
|
|
123
|
+
{previewVariant.sizes.map((size) => (
|
|
124
|
+
<ActionButton
|
|
125
|
+
key={`${previewVariant.variant}-${size}-${state.key}`}
|
|
126
|
+
variant={previewVariant.variant}
|
|
127
|
+
size={size}
|
|
128
|
+
shape={shape}
|
|
129
|
+
active={state.key === "active" || state.key === "active-hover"}
|
|
130
|
+
disabled={state.key === "disable"}
|
|
131
|
+
className={forcedStateClassName[state.key][previewVariant.variant]}
|
|
132
|
+
>
|
|
133
|
+
{icon}
|
|
134
|
+
</ActionButton>
|
|
135
|
+
))}
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
))}
|
|
139
|
+
</div>
|
|
140
|
+
))}
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
);
|
|
144
|
+
|
|
145
|
+
export const FigmaPreview = {
|
|
146
|
+
render: () => renderPreview("round"),
|
|
147
|
+
} satisfies Story;
|
|
148
|
+
|
|
149
|
+
export const FigmaPreviewCapsule = {
|
|
150
|
+
render: () => renderPreview("capsule"),
|
|
151
|
+
} satisfies Story;
|
|
@@ -11,24 +11,28 @@ export const actionButtonVariants = cva(
|
|
|
11
11
|
"active:bg-action-button-solid-pressed active:border-action-button-solid-pressed active:text-action-button-solid-pressed active:fill-action-button-solid-pressed",
|
|
12
12
|
],
|
|
13
13
|
outline: [
|
|
14
|
-
"
|
|
15
|
-
"bg-action-button-outline-default
|
|
16
|
-
"hover:bg-action-button-outline-hover hover:
|
|
17
|
-
"active:bg-action-button-outline-pressed active:
|
|
14
|
+
"ring-1 ring-inset",
|
|
15
|
+
"bg-action-button-outline-default text-action-button-outline-default fill-action-button-outline-default ring-[var(--action-button-outline-default-border)]",
|
|
16
|
+
"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)]",
|
|
17
|
+
"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)]",
|
|
18
18
|
],
|
|
19
19
|
icon: [
|
|
20
|
-
"rounded-full",
|
|
21
20
|
"bg-action-button-icon-default border-action-button-icon-default text-action-button-icon-default fill-action-button-icon-default",
|
|
22
21
|
"hover:bg-action-button-icon-hover hover:border-action-button-icon-hover hover:text-action-button-icon-hover hover:fill-action-button-icon-hover",
|
|
23
22
|
"active:bg-action-button-icon-pressed active:border-action-button-icon-pressed active:text-action-button-icon-pressed active:fill-action-button-icon-pressed",
|
|
24
23
|
],
|
|
25
24
|
},
|
|
26
25
|
size: {
|
|
26
|
+
xxs: "",
|
|
27
27
|
xs: "",
|
|
28
28
|
sm: "",
|
|
29
29
|
md: "",
|
|
30
30
|
lg: "",
|
|
31
31
|
},
|
|
32
|
+
shape: {
|
|
33
|
+
round: "",
|
|
34
|
+
capsule: "",
|
|
35
|
+
},
|
|
32
36
|
disabled: {
|
|
33
37
|
false: "",
|
|
34
38
|
},
|
|
@@ -50,9 +54,9 @@ export const actionButtonVariants = cva(
|
|
|
50
54
|
variant: "outline",
|
|
51
55
|
active: true,
|
|
52
56
|
className: [
|
|
53
|
-
"bg-action-button-outline-active
|
|
54
|
-
"hover:bg-action-button-outline-active-hover hover:
|
|
55
|
-
"active:bg-action-button-outline-active-pressed active:
|
|
57
|
+
"bg-action-button-outline-active text-action-button-outline-active fill-action-button-outline-active ring-[var(--action-button-outline-active-border)]",
|
|
58
|
+
"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)]",
|
|
59
|
+
"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)]",
|
|
56
60
|
],
|
|
57
61
|
},
|
|
58
62
|
{
|
|
@@ -67,42 +71,97 @@ export const actionButtonVariants = cva(
|
|
|
67
71
|
{
|
|
68
72
|
size: "lg",
|
|
69
73
|
variant: ["solid", "outline"],
|
|
70
|
-
className: "px-
|
|
74
|
+
className: "px-[12px] py-[12px] [&_svg]:size-[32px]",
|
|
71
75
|
},
|
|
72
76
|
{
|
|
73
77
|
size: "md",
|
|
74
78
|
variant: ["solid", "outline"],
|
|
75
|
-
className: "px-
|
|
79
|
+
className: "px-[8px] py-[8px] [&_svg]:size-[22px]",
|
|
76
80
|
},
|
|
77
81
|
{
|
|
78
82
|
size: "sm",
|
|
79
83
|
variant: ["solid", "outline"],
|
|
80
|
-
className: "px-
|
|
84
|
+
className: "px-[4px] py-[4px] [&_svg]:size-[22px]",
|
|
81
85
|
},
|
|
82
86
|
{
|
|
83
87
|
size: "xs",
|
|
84
88
|
variant: ["solid", "outline"],
|
|
85
|
-
className: "px-
|
|
89
|
+
className: "px-[2px] py-[2px] [&_svg]:size-[14px]",
|
|
86
90
|
},
|
|
87
91
|
{
|
|
88
92
|
size: "lg",
|
|
89
93
|
variant: "icon",
|
|
90
|
-
className: "px-
|
|
94
|
+
className: "px-[12px] py-[12px] [&_svg]:size-[32px]",
|
|
91
95
|
},
|
|
92
96
|
{
|
|
93
97
|
size: "md",
|
|
94
98
|
variant: "icon",
|
|
95
|
-
className: "px-
|
|
99
|
+
className: "px-[8px] py-[8px] [&_svg]:size-[22px]",
|
|
96
100
|
},
|
|
97
101
|
{
|
|
98
102
|
size: "sm",
|
|
99
103
|
variant: "icon",
|
|
100
|
-
className: "px-
|
|
104
|
+
className: "px-[4px] py-[4px] [&_svg]:size-[22px]",
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
size: "xxs",
|
|
108
|
+
variant: "icon",
|
|
109
|
+
className: "px-[1px] py-[1px] [&_svg]:size-[12px]",
|
|
101
110
|
},
|
|
102
111
|
{
|
|
103
112
|
size: "xs",
|
|
104
113
|
variant: "icon",
|
|
105
|
-
className: "px-
|
|
114
|
+
className: "px-[2px] py-[2px] [&_svg]:size-[14px]",
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
size: "lg",
|
|
118
|
+
shape: "round",
|
|
119
|
+
className: "rounded-[var(--function-button-l-round)]",
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
size: "md",
|
|
123
|
+
shape: "round",
|
|
124
|
+
className: "rounded-[var(--function-button-m-round)]",
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
size: "sm",
|
|
128
|
+
shape: "round",
|
|
129
|
+
className: "rounded-[var(--function-button-s-round)]",
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
size: "xs",
|
|
133
|
+
shape: "round",
|
|
134
|
+
className: "rounded-[var(--function-button-xs-round)]",
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
size: "xxs",
|
|
138
|
+
shape: "round",
|
|
139
|
+
className: "rounded-[var(--function-button-xxs-round)]",
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
size: "lg",
|
|
143
|
+
shape: "capsule",
|
|
144
|
+
className: "rounded-[var(--function-button-l-capsule)]",
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
size: "md",
|
|
148
|
+
shape: "capsule",
|
|
149
|
+
className: "rounded-[var(--function-button-m-capsule)]",
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
size: "sm",
|
|
153
|
+
shape: "capsule",
|
|
154
|
+
className: "rounded-[var(--function-button-s-capsule)]",
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
size: "xxs",
|
|
158
|
+
shape: "capsule",
|
|
159
|
+
className: "rounded-[var(--function-button-xxs-capsule)]",
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
size: "xs",
|
|
163
|
+
shape: "capsule",
|
|
164
|
+
className: "rounded-[var(--function-button-xs-capsule)]",
|
|
106
165
|
},
|
|
107
166
|
{
|
|
108
167
|
variant: "solid",
|
|
@@ -117,7 +176,7 @@ export const actionButtonVariants = cva(
|
|
|
117
176
|
disabled: true,
|
|
118
177
|
className: [
|
|
119
178
|
"pointer-events-none",
|
|
120
|
-
"bg-action-button-outline-disabled
|
|
179
|
+
"bg-action-button-outline-disabled text-action-button-outline-disabled fill-action-button-outline-disabled ring-[var(--action-button-outline-disabled-border)]",
|
|
121
180
|
],
|
|
122
181
|
},
|
|
123
182
|
{
|
|
@@ -132,8 +191,9 @@ export const actionButtonVariants = cva(
|
|
|
132
191
|
defaultVariants: {
|
|
133
192
|
size: "md",
|
|
134
193
|
variant: "solid",
|
|
194
|
+
shape: "round",
|
|
135
195
|
disabled: false,
|
|
136
196
|
active: false,
|
|
137
197
|
},
|
|
138
|
-
}
|
|
198
|
+
},
|
|
139
199
|
);
|
|
@@ -4,7 +4,8 @@ import { actionButtonVariants } from "./ActionButton.styles";
|
|
|
4
4
|
|
|
5
5
|
export type ActionButtonProps = {
|
|
6
6
|
title?: string;
|
|
7
|
-
size?: "xs" | "sm" | "md" | "lg";
|
|
7
|
+
size?: "xxs" | "xs" | "sm" | "md" | "lg";
|
|
8
|
+
shape?: "round" | "capsule";
|
|
8
9
|
variant?: "solid" | "outline" | "icon";
|
|
9
10
|
disabled?: boolean;
|
|
10
11
|
active?: boolean;
|
|
@@ -13,9 +14,13 @@ export type ActionButtonProps = {
|
|
|
13
14
|
} & React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
14
15
|
|
|
15
16
|
const ActionButton = forwardRef<HTMLButtonElement, ActionButtonProps>(
|
|
16
|
-
(
|
|
17
|
+
(
|
|
18
|
+
{ children, disabled, active, className, size, shape, variant, ...props },
|
|
19
|
+
ref
|
|
20
|
+
) => {
|
|
17
21
|
const actionButtonClassname = actionButtonVariants({
|
|
18
22
|
size,
|
|
23
|
+
shape,
|
|
19
24
|
variant,
|
|
20
25
|
active,
|
|
21
26
|
disabled,
|
|
@@ -2,7 +2,8 @@ import { cva } from "class-variance-authority";
|
|
|
2
2
|
|
|
3
3
|
export const buttonVariants = cva(
|
|
4
4
|
[
|
|
5
|
-
"gap-2 font-bold inline-flex items-center justify-center outline-none transition ease-in-out duration-45",
|
|
5
|
+
"relative gap-2 font-bold inline-flex items-center justify-center outline-none transition ease-in-out duration-45",
|
|
6
|
+
"before:content-[''] before:absolute before:inset-0 before:rounded-[inherit] before:pointer-events-none before:border-0 before:border-inherit",
|
|
6
7
|
],
|
|
7
8
|
{
|
|
8
9
|
variants: {
|
|
@@ -58,14 +59,19 @@ export const buttonVariants = cva(
|
|
|
58
59
|
],
|
|
59
60
|
},
|
|
60
61
|
size: {
|
|
61
|
-
sm: "px-
|
|
62
|
-
md: "px-
|
|
63
|
-
lg: "px-
|
|
62
|
+
sm: "px-[12px] py-[4px] [&_svg]:size-[18px] typography-buttonMS gap-1",
|
|
63
|
+
md: "px-[16px] py-[8px] [&_svg]:size-5 typography-buttonMS",
|
|
64
|
+
lg: "px-[24px] py-[16px] [&_svg]:size-6 typography-buttonL",
|
|
65
|
+
},
|
|
66
|
+
shape: {
|
|
67
|
+
round: "",
|
|
68
|
+
capsule: "",
|
|
64
69
|
},
|
|
65
70
|
variant: {
|
|
66
|
-
solid: "border",
|
|
67
|
-
outline: "border bg-transparent",
|
|
71
|
+
solid: "before:border",
|
|
72
|
+
outline: "before:border bg-transparent",
|
|
68
73
|
flat: "bg-transparent",
|
|
74
|
+
text: "bg-transparent",
|
|
69
75
|
link: "bg-transparent underline underline-offset-4",
|
|
70
76
|
},
|
|
71
77
|
disabled: {
|
|
@@ -81,6 +87,36 @@ export const buttonVariants = cva(
|
|
|
81
87
|
},
|
|
82
88
|
},
|
|
83
89
|
compoundVariants: [
|
|
90
|
+
{
|
|
91
|
+
size: "sm",
|
|
92
|
+
shape: "round",
|
|
93
|
+
className: "rounded-[var(--button-s-round)]",
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
size: "md",
|
|
97
|
+
shape: "round",
|
|
98
|
+
className: "rounded-[var(--button-m-round)]",
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
size: "lg",
|
|
102
|
+
shape: "round",
|
|
103
|
+
className: "rounded-[var(--button-l-round)]",
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
size: "sm",
|
|
107
|
+
shape: "capsule",
|
|
108
|
+
className: "rounded-[var(--button-s-capsule)]",
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
size: "md",
|
|
112
|
+
shape: "capsule",
|
|
113
|
+
className: "rounded-[var(--button-m-capsule)]",
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
size: "lg",
|
|
117
|
+
shape: "capsule",
|
|
118
|
+
className: "rounded-[var(--button-l-capsule)]",
|
|
119
|
+
},
|
|
84
120
|
{
|
|
85
121
|
variant: "outline",
|
|
86
122
|
color: "primary",
|
|
@@ -93,7 +129,7 @@ export const buttonVariants = cva(
|
|
|
93
129
|
],
|
|
94
130
|
},
|
|
95
131
|
{
|
|
96
|
-
variant: ["flat", "link"],
|
|
132
|
+
variant: ["flat", "text", "link"],
|
|
97
133
|
color: "primary",
|
|
98
134
|
className: [
|
|
99
135
|
"bg-button-primary-flat-default border-button-primary-flat-default text-button-primary-flat-default fill-button-primary-flat-default",
|
|
@@ -115,7 +151,7 @@ export const buttonVariants = cva(
|
|
|
115
151
|
],
|
|
116
152
|
},
|
|
117
153
|
{
|
|
118
|
-
variant: ["flat", "link"],
|
|
154
|
+
variant: ["flat", "text", "link"],
|
|
119
155
|
color: "secondary",
|
|
120
156
|
className: [
|
|
121
157
|
"bg-button-secondary-flat-default border-button-secondary-flat-default text-button-secondary-flat-default fill-button-secondary-flat-default",
|
|
@@ -137,7 +173,7 @@ export const buttonVariants = cva(
|
|
|
137
173
|
],
|
|
138
174
|
},
|
|
139
175
|
{
|
|
140
|
-
variant: ["flat", "link"],
|
|
176
|
+
variant: ["flat", "text", "link"],
|
|
141
177
|
color: "tertiary",
|
|
142
178
|
className: [
|
|
143
179
|
"bg-button-tertiary-flat-default border-button-tertiary-flat-default text-button-tertiary-flat-default fill-button-tertiary-flat-default",
|
|
@@ -159,7 +195,7 @@ export const buttonVariants = cva(
|
|
|
159
195
|
],
|
|
160
196
|
},
|
|
161
197
|
{
|
|
162
|
-
variant: ["flat", "link"],
|
|
198
|
+
variant: ["flat", "text", "link"],
|
|
163
199
|
color: "info",
|
|
164
200
|
className: [
|
|
165
201
|
"bg-button-info-flat-default border-button-info-flat-default text-button-info-flat-default fill-button-info-flat-default",
|
|
@@ -181,7 +217,7 @@ export const buttonVariants = cva(
|
|
|
181
217
|
],
|
|
182
218
|
},
|
|
183
219
|
{
|
|
184
|
-
variant: ["flat", "link"],
|
|
220
|
+
variant: ["flat", "text", "link"],
|
|
185
221
|
color: "success",
|
|
186
222
|
className: [
|
|
187
223
|
"bg-button-success-flat-default border-button-success-flat-default text-button-success-flat-default fill-button-success-flat-default",
|
|
@@ -203,7 +239,7 @@ export const buttonVariants = cva(
|
|
|
203
239
|
],
|
|
204
240
|
},
|
|
205
241
|
{
|
|
206
|
-
variant: ["flat", "link"],
|
|
242
|
+
variant: ["flat", "text", "link"],
|
|
207
243
|
color: "warning",
|
|
208
244
|
className: [
|
|
209
245
|
"bg-button-warning-flat-default border-button-warning-flat-default text-button-warning-flat-default fill-button-warning-flat-default",
|
|
@@ -225,7 +261,7 @@ export const buttonVariants = cva(
|
|
|
225
261
|
],
|
|
226
262
|
},
|
|
227
263
|
{
|
|
228
|
-
variant: ["flat", "link"],
|
|
264
|
+
variant: ["flat", "text", "link"],
|
|
229
265
|
color: "error",
|
|
230
266
|
className: [
|
|
231
267
|
"bg-button-error-flat-default border-button-error-flat-default text-button-error-flat-default fill-button-error-flat-default",
|
|
@@ -237,7 +273,7 @@ export const buttonVariants = cva(
|
|
|
237
273
|
},
|
|
238
274
|
// --- Disabled --
|
|
239
275
|
{
|
|
240
|
-
variant: ["outline", "flat", "link"],
|
|
276
|
+
variant: ["outline", "flat", "text", "link"],
|
|
241
277
|
disabled: true,
|
|
242
278
|
className: [
|
|
243
279
|
"bg-transparent border-disabled-outline text-disable-outline fill-disable-outline",
|
|
@@ -246,6 +282,7 @@ export const buttonVariants = cva(
|
|
|
246
282
|
],
|
|
247
283
|
defaultVariants: {
|
|
248
284
|
size: "md",
|
|
285
|
+
shape: "round",
|
|
249
286
|
color: "primary",
|
|
250
287
|
variant: "solid",
|
|
251
288
|
fullwidth: true,
|