cherry-styled-components 0.1.7 → 0.1.8
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/.claude/settings.local.json +7 -1
- package/dist/cherry.js +6752 -6675
- package/dist/cherry.umd.cjs +194 -139
- package/dist/lib/button.d.ts +2 -2
- package/dist/lib/icon.d.ts +1 -1
- package/dist/lib/input.d.ts +2 -2
- package/dist/lib/range.d.ts +1 -1
- package/dist/lib/select.d.ts +1 -1
- package/dist/lib/textarea.d.ts +1 -1
- package/dist/lib/toggle.d.ts +1 -1
- package/dist/lib/utils/mixins.d.ts +1 -1
- package/dist/lib/utils/theme.d.ts +16 -0
- package/package.json +3 -3
- package/src/App.tsx +205 -0
- package/src/lib/button.tsx +8 -3
- package/src/lib/icon.tsx +1 -0
- package/src/lib/input.tsx +29 -3
- package/src/lib/range.tsx +26 -1
- package/src/lib/select.tsx +4 -2
- package/src/lib/textarea.tsx +7 -2
- package/src/lib/toggle.tsx +8 -6
- package/src/lib/utils/mixins.tsx +9 -1
- package/src/lib/utils/theme.ts +8 -0
package/dist/lib/button.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { Theme } from './utils';
|
|
|
3
3
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
4
|
children?: React.ReactNode;
|
|
5
5
|
$variant?: "primary" | "secondary" | "tertiary";
|
|
6
|
-
$size?: "default" | "big";
|
|
6
|
+
$size?: "default" | "big" | "small";
|
|
7
7
|
$outline?: boolean;
|
|
8
8
|
$fullWidth?: boolean;
|
|
9
9
|
$icon?: React.ReactNode;
|
|
@@ -11,6 +11,6 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
|
|
|
11
11
|
$isError?: boolean;
|
|
12
12
|
theme?: Theme;
|
|
13
13
|
}
|
|
14
|
-
export declare const buttonStyles: (theme: Theme, $variant?: "primary" | "secondary" | "tertiary", $size?: "default" | "big", $outline?: boolean, $fullWidth?: boolean, $isError?: boolean, disabled?: boolean) => import('styled-components').RuleSet<object>;
|
|
14
|
+
export declare const buttonStyles: (theme: Theme, $variant?: "primary" | "secondary" | "tertiary", $size?: "default" | "big" | "small", $outline?: boolean, $fullWidth?: boolean, $isError?: boolean, disabled?: boolean) => import('styled-components').RuleSet<object>;
|
|
15
15
|
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
16
16
|
export { Button };
|
package/dist/lib/icon.d.ts
CHANGED
|
@@ -6,5 +6,5 @@ interface Props {
|
|
|
6
6
|
size?: number;
|
|
7
7
|
className?: string;
|
|
8
8
|
}
|
|
9
|
-
declare const Icon: ({ name, color, size, className }: Props) => import("react").JSX.Element;
|
|
9
|
+
declare const Icon: ({ name, color, size, className }: Props) => import("react").JSX.Element | null;
|
|
10
10
|
export { Icon };
|
package/dist/lib/input.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
$wrapperClassName?: string;
|
|
7
7
|
$label?: string;
|
|
8
|
-
$size?: "default" | "big";
|
|
8
|
+
$size?: "default" | "big" | "small";
|
|
9
9
|
$error?: boolean;
|
|
10
10
|
$success?: boolean;
|
|
11
11
|
$fullWidth?: boolean;
|
|
@@ -15,7 +15,7 @@ interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
|
15
15
|
}
|
|
16
16
|
interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
|
|
17
17
|
$label?: string;
|
|
18
|
-
$size?: "default" | "big";
|
|
18
|
+
$size?: "default" | "big" | "small";
|
|
19
19
|
$error?: boolean;
|
|
20
20
|
$success?: boolean;
|
|
21
21
|
$fullWidth?: boolean;
|
package/dist/lib/range.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
|
4
4
|
className?: string;
|
|
5
5
|
$wrapperClassName?: string;
|
|
6
6
|
$label?: string;
|
|
7
|
-
$size?: "default" | "big";
|
|
7
|
+
$size?: "default" | "big" | "small";
|
|
8
8
|
$error?: boolean;
|
|
9
9
|
$success?: boolean;
|
|
10
10
|
$fullWidth?: boolean;
|
package/dist/lib/select.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ interface SelectProps extends React.InputHTMLAttributes<HTMLSelectElement> {
|
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
$wrapperClassName?: string;
|
|
7
7
|
$label?: string;
|
|
8
|
-
$size?: "default" | "big";
|
|
8
|
+
$size?: "default" | "big" | "small";
|
|
9
9
|
$error?: boolean;
|
|
10
10
|
$success?: boolean;
|
|
11
11
|
$fullWidth?: boolean;
|
package/dist/lib/textarea.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ interface TextareaProps extends Omit<React.InputHTMLAttributes<HTMLTextAreaEleme
|
|
|
4
4
|
children?: React.ReactNode;
|
|
5
5
|
$wrapperClassName?: string;
|
|
6
6
|
$label?: string;
|
|
7
|
-
$size?: "default" | "big";
|
|
7
|
+
$size?: "default" | "big" | "small";
|
|
8
8
|
$error?: boolean;
|
|
9
9
|
$success?: boolean;
|
|
10
10
|
$fullWidth?: boolean;
|
package/dist/lib/toggle.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ interface ToggleProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
|
5
5
|
type?: "checkbox" | "radio";
|
|
6
6
|
$wrapperClassName?: string;
|
|
7
7
|
$label?: string;
|
|
8
|
-
$size?: "default" | "big";
|
|
8
|
+
$size?: "default" | "big" | "small";
|
|
9
9
|
$error?: boolean;
|
|
10
10
|
$success?: boolean;
|
|
11
11
|
$fullWidth?: boolean;
|
|
@@ -3,7 +3,7 @@ export declare const resetButton: import('styled-components').RuleSet<object>;
|
|
|
3
3
|
export declare const resetInput: import('styled-components').RuleSet<object>;
|
|
4
4
|
export declare const fullWidthStyles: (fullWidth: boolean) => import('styled-components').RuleSet<object> | undefined;
|
|
5
5
|
export declare const statusBorderStyles: ($error: boolean, $success: boolean, theme: Theme) => import('styled-components').RuleSet<object> | undefined;
|
|
6
|
-
export declare const formElementHeightStyles: ($size?: "default" | "big") => import('styled-components').RuleSet<object>;
|
|
6
|
+
export declare const formElementHeightStyles: ($size?: "default" | "big" | "small") => import('styled-components').RuleSet<object>;
|
|
7
7
|
export declare const generateGapStyles: (size: keyof Breakpoints<number>, gap: number | "none") => import('styled-components').RuleSet<object>;
|
|
8
8
|
export declare const generateColsStyles: (size: keyof Breakpoints<number>, cols: number) => import('styled-components').RuleSet<object>;
|
|
9
9
|
export declare const generateColSpanStyles: (size: keyof Breakpoints<number>, span: number) => import('styled-components').RuleSet<object>;
|
|
@@ -135,6 +135,10 @@ export interface FontSizes<TString = string> {
|
|
|
135
135
|
xs: TString;
|
|
136
136
|
lg: TString;
|
|
137
137
|
};
|
|
138
|
+
buttonSmall: {
|
|
139
|
+
xs: TString;
|
|
140
|
+
lg: TString;
|
|
141
|
+
};
|
|
138
142
|
input: {
|
|
139
143
|
xs: TString;
|
|
140
144
|
lg: TString;
|
|
@@ -143,6 +147,10 @@ export interface FontSizes<TString = string> {
|
|
|
143
147
|
xs: TString;
|
|
144
148
|
lg: TString;
|
|
145
149
|
};
|
|
150
|
+
inputSmall: {
|
|
151
|
+
xs: TString;
|
|
152
|
+
lg: TString;
|
|
153
|
+
};
|
|
146
154
|
}
|
|
147
155
|
export interface LineHeights<TString = string> {
|
|
148
156
|
hero1: {
|
|
@@ -209,6 +217,10 @@ export interface LineHeights<TString = string> {
|
|
|
209
217
|
xs: TString;
|
|
210
218
|
lg: TString;
|
|
211
219
|
};
|
|
220
|
+
buttonSmall: {
|
|
221
|
+
xs: TString;
|
|
222
|
+
lg: TString;
|
|
223
|
+
};
|
|
212
224
|
input: {
|
|
213
225
|
xs: TString;
|
|
214
226
|
lg: TString;
|
|
@@ -217,6 +229,10 @@ export interface LineHeights<TString = string> {
|
|
|
217
229
|
xs: TString;
|
|
218
230
|
lg: TString;
|
|
219
231
|
};
|
|
232
|
+
inputSmall: {
|
|
233
|
+
xs: TString;
|
|
234
|
+
lg: TString;
|
|
235
|
+
};
|
|
220
236
|
}
|
|
221
237
|
export interface Theme {
|
|
222
238
|
breakpoints: Breakpoints;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cherry-styled-components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Cherry is a design system for the modern web. Designed in Figma, built in React using Typescript.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"polished": "^4.3.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@types/node": "^25.2.
|
|
38
|
+
"@types/node": "^25.2.2",
|
|
39
39
|
"@types/react": "^19.2.13",
|
|
40
40
|
"@types/react-dom": "^19.2.3",
|
|
41
41
|
"@vitejs/plugin-react": "^5.1.3",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"eslint-plugin-react-refresh": "^0.5.0",
|
|
44
44
|
"next": "^16.1.6",
|
|
45
45
|
"prettier": "^3.8.1",
|
|
46
|
-
"styled-components": "^6.3.
|
|
46
|
+
"styled-components": "^6.3.9",
|
|
47
47
|
"typescript": "^5.9.3",
|
|
48
48
|
"vite": "^7.3.1",
|
|
49
49
|
"vite-plugin-dts": "^4.5.4"
|
package/src/App.tsx
CHANGED
|
@@ -92,6 +92,211 @@ function App() {
|
|
|
92
92
|
</Flex>
|
|
93
93
|
</Col>
|
|
94
94
|
</Grid>
|
|
95
|
+
|
|
96
|
+
<Space $size={40} />
|
|
97
|
+
<hr />
|
|
98
|
+
<Space $size={20} />
|
|
99
|
+
|
|
100
|
+
{/* Big Size */}
|
|
101
|
+
<h2>Big</h2>
|
|
102
|
+
<Space $size={10} />
|
|
103
|
+
<Input
|
|
104
|
+
$size="big"
|
|
105
|
+
$fullWidth
|
|
106
|
+
$label="Input Big"
|
|
107
|
+
id="date-big"
|
|
108
|
+
type="date"
|
|
109
|
+
/>
|
|
110
|
+
<Space $size={20} />
|
|
111
|
+
<Grid $xsCols={1} $lgCols={3} $gap={20}>
|
|
112
|
+
<Col $xsSpan={1} $lgSpan={2}>
|
|
113
|
+
<Grid $xsCols={1} $lgCols={2} $gap={20}>
|
|
114
|
+
<Input
|
|
115
|
+
$size="big"
|
|
116
|
+
placeholder="Placeholder"
|
|
117
|
+
$fullWidth
|
|
118
|
+
$label="Input Big"
|
|
119
|
+
id="input-big"
|
|
120
|
+
/>
|
|
121
|
+
<Select $size="big" $fullWidth $label="Select Big" id="select-big">
|
|
122
|
+
<option>Select</option>
|
|
123
|
+
</Select>
|
|
124
|
+
<Col $lgSpan={2}>
|
|
125
|
+
<Flex
|
|
126
|
+
$xsGap={10}
|
|
127
|
+
$lgGap={20}
|
|
128
|
+
$wrap="nowrap"
|
|
129
|
+
$justifyContent="space-between"
|
|
130
|
+
>
|
|
131
|
+
<Input $size="big" type="checkbox" id="checkbox-big-1" />
|
|
132
|
+
<Input
|
|
133
|
+
$size="big"
|
|
134
|
+
type="checkbox"
|
|
135
|
+
id="checkbox-big-2"
|
|
136
|
+
defaultChecked
|
|
137
|
+
/>
|
|
138
|
+
<Input
|
|
139
|
+
$size="big"
|
|
140
|
+
type="radio"
|
|
141
|
+
id="radio-big-1"
|
|
142
|
+
name="demo-radio-big"
|
|
143
|
+
/>
|
|
144
|
+
<Input
|
|
145
|
+
$size="big"
|
|
146
|
+
type="radio"
|
|
147
|
+
id="radio-big-2"
|
|
148
|
+
name="demo-radio-big"
|
|
149
|
+
defaultChecked
|
|
150
|
+
/>
|
|
151
|
+
<Range $size="big" />
|
|
152
|
+
<Toggle $size="big" />
|
|
153
|
+
<Toggle $size="big" defaultChecked />
|
|
154
|
+
</Flex>
|
|
155
|
+
</Col>
|
|
156
|
+
</Grid>
|
|
157
|
+
</Col>
|
|
158
|
+
<Textarea
|
|
159
|
+
$size="big"
|
|
160
|
+
$label="Textarea Big"
|
|
161
|
+
$fullWidth
|
|
162
|
+
defaultValue="Textarea"
|
|
163
|
+
id="textarea-big"
|
|
164
|
+
/>
|
|
165
|
+
</Grid>
|
|
166
|
+
<Space $size={20} />
|
|
167
|
+
<Grid $xsCols={1} $lgCols={2} $gap={20}>
|
|
168
|
+
<Col>
|
|
169
|
+
<Flex $wrap="nowrap" $gap={20}>
|
|
170
|
+
<Button $size="big" $fullWidth>
|
|
171
|
+
Button
|
|
172
|
+
</Button>
|
|
173
|
+
<Button $size="big" $variant="secondary" $fullWidth>
|
|
174
|
+
Button
|
|
175
|
+
</Button>
|
|
176
|
+
<Button $size="big" $variant="tertiary" $fullWidth>
|
|
177
|
+
Button
|
|
178
|
+
</Button>
|
|
179
|
+
</Flex>
|
|
180
|
+
</Col>
|
|
181
|
+
<Col>
|
|
182
|
+
<Flex $wrap="nowrap" $gap={20}>
|
|
183
|
+
<Button $size="big" $outline $fullWidth>
|
|
184
|
+
Button
|
|
185
|
+
</Button>
|
|
186
|
+
<Button $size="big" $variant="secondary" $outline $fullWidth>
|
|
187
|
+
Button
|
|
188
|
+
</Button>
|
|
189
|
+
<Button $size="big" $variant="tertiary" $outline $fullWidth>
|
|
190
|
+
Button
|
|
191
|
+
</Button>
|
|
192
|
+
</Flex>
|
|
193
|
+
</Col>
|
|
194
|
+
</Grid>
|
|
195
|
+
|
|
196
|
+
<Space $size={40} />
|
|
197
|
+
<hr />
|
|
198
|
+
<Space $size={20} />
|
|
199
|
+
|
|
200
|
+
{/* Small Size */}
|
|
201
|
+
<h2>Small</h2>
|
|
202
|
+
<Space $size={10} />
|
|
203
|
+
<Input
|
|
204
|
+
$size="small"
|
|
205
|
+
$fullWidth
|
|
206
|
+
$label="Input Small"
|
|
207
|
+
id="date-small"
|
|
208
|
+
type="date"
|
|
209
|
+
/>
|
|
210
|
+
<Space $size={20} />
|
|
211
|
+
<Grid $xsCols={1} $lgCols={3} $gap={20}>
|
|
212
|
+
<Col $xsSpan={1} $lgSpan={2}>
|
|
213
|
+
<Grid $xsCols={1} $lgCols={2} $gap={20}>
|
|
214
|
+
<Input
|
|
215
|
+
$size="small"
|
|
216
|
+
placeholder="Placeholder"
|
|
217
|
+
$fullWidth
|
|
218
|
+
$label="Input Small"
|
|
219
|
+
id="input-small"
|
|
220
|
+
/>
|
|
221
|
+
<Select
|
|
222
|
+
$size="small"
|
|
223
|
+
$fullWidth
|
|
224
|
+
$label="Select Small"
|
|
225
|
+
id="select-small"
|
|
226
|
+
>
|
|
227
|
+
<option>Select</option>
|
|
228
|
+
</Select>
|
|
229
|
+
<Col $lgSpan={2}>
|
|
230
|
+
<Flex
|
|
231
|
+
$xsGap={10}
|
|
232
|
+
$lgGap={20}
|
|
233
|
+
$wrap="nowrap"
|
|
234
|
+
$justifyContent="space-between"
|
|
235
|
+
>
|
|
236
|
+
<Input $size="small" type="checkbox" id="checkbox-small-1" />
|
|
237
|
+
<Input
|
|
238
|
+
$size="small"
|
|
239
|
+
type="checkbox"
|
|
240
|
+
id="checkbox-small-2"
|
|
241
|
+
defaultChecked
|
|
242
|
+
/>
|
|
243
|
+
<Input
|
|
244
|
+
$size="small"
|
|
245
|
+
type="radio"
|
|
246
|
+
id="radio-small-1"
|
|
247
|
+
name="demo-radio-small"
|
|
248
|
+
/>
|
|
249
|
+
<Input
|
|
250
|
+
$size="small"
|
|
251
|
+
type="radio"
|
|
252
|
+
id="radio-small-2"
|
|
253
|
+
name="demo-radio-small"
|
|
254
|
+
defaultChecked
|
|
255
|
+
/>
|
|
256
|
+
<Range $size="small" />
|
|
257
|
+
<Toggle $size="small" />
|
|
258
|
+
<Toggle $size="small" defaultChecked />
|
|
259
|
+
</Flex>
|
|
260
|
+
</Col>
|
|
261
|
+
</Grid>
|
|
262
|
+
</Col>
|
|
263
|
+
<Textarea
|
|
264
|
+
$size="small"
|
|
265
|
+
$label="Textarea Small"
|
|
266
|
+
$fullWidth
|
|
267
|
+
defaultValue="Textarea"
|
|
268
|
+
id="textarea-small"
|
|
269
|
+
/>
|
|
270
|
+
</Grid>
|
|
271
|
+
<Space $size={20} />
|
|
272
|
+
<Grid $xsCols={1} $lgCols={2} $gap={20}>
|
|
273
|
+
<Col>
|
|
274
|
+
<Flex $wrap="nowrap" $gap={20}>
|
|
275
|
+
<Button $size="small" $fullWidth>
|
|
276
|
+
Button
|
|
277
|
+
</Button>
|
|
278
|
+
<Button $size="small" $variant="secondary" $fullWidth>
|
|
279
|
+
Button
|
|
280
|
+
</Button>
|
|
281
|
+
<Button $size="small" $variant="tertiary" $fullWidth>
|
|
282
|
+
Button
|
|
283
|
+
</Button>
|
|
284
|
+
</Flex>
|
|
285
|
+
</Col>
|
|
286
|
+
<Col>
|
|
287
|
+
<Flex $wrap="nowrap" $gap={20}>
|
|
288
|
+
<Button $size="small" $outline $fullWidth>
|
|
289
|
+
Button
|
|
290
|
+
</Button>
|
|
291
|
+
<Button $size="small" $variant="secondary" $outline $fullWidth>
|
|
292
|
+
Button
|
|
293
|
+
</Button>
|
|
294
|
+
<Button $size="small" $variant="tertiary" $outline $fullWidth>
|
|
295
|
+
Button
|
|
296
|
+
</Button>
|
|
297
|
+
</Flex>
|
|
298
|
+
</Col>
|
|
299
|
+
</Grid>
|
|
95
300
|
</MaxWidth>
|
|
96
301
|
<Space $size={100} />
|
|
97
302
|
</Container>
|
package/src/lib/button.tsx
CHANGED
|
@@ -8,7 +8,7 @@ import { Theme, formElementHeightStyles, resetButton } from "./utils";
|
|
|
8
8
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
9
9
|
children?: React.ReactNode;
|
|
10
10
|
$variant?: "primary" | "secondary" | "tertiary";
|
|
11
|
-
$size?: "default" | "big";
|
|
11
|
+
$size?: "default" | "big" | "small";
|
|
12
12
|
$outline?: boolean;
|
|
13
13
|
$fullWidth?: boolean;
|
|
14
14
|
$icon?: React.ReactNode;
|
|
@@ -20,7 +20,7 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
|
|
|
20
20
|
export const buttonStyles = (
|
|
21
21
|
theme: Theme,
|
|
22
22
|
$variant?: "primary" | "secondary" | "tertiary",
|
|
23
|
-
$size?: "default" | "big",
|
|
23
|
+
$size?: "default" | "big" | "small",
|
|
24
24
|
$outline?: boolean,
|
|
25
25
|
$fullWidth?: boolean,
|
|
26
26
|
$isError?: boolean,
|
|
@@ -149,7 +149,12 @@ export const buttonStyles = (
|
|
|
149
149
|
line-height: ${theme.lineHeights.buttonBig.lg};
|
|
150
150
|
padding: 18px 30px;
|
|
151
151
|
`
|
|
152
|
-
:
|
|
152
|
+
: $size === "small"
|
|
153
|
+
? `font-size: ${theme.fontSizes.buttonSmall.lg};
|
|
154
|
+
line-height: ${theme.lineHeights.buttonSmall.lg};
|
|
155
|
+
padding: 10px 20px;
|
|
156
|
+
`
|
|
157
|
+
: `font-size: ${theme.fontSizes.button.lg};
|
|
153
158
|
line-height: ${theme.lineHeights.button.lg};`}
|
|
154
159
|
|
|
155
160
|
${disabled &&
|
package/src/lib/icon.tsx
CHANGED
package/src/lib/input.tsx
CHANGED
|
@@ -17,7 +17,7 @@ interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
|
17
17
|
children?: React.ReactNode;
|
|
18
18
|
$wrapperClassName?: string;
|
|
19
19
|
$label?: string;
|
|
20
|
-
$size?: "default" | "big";
|
|
20
|
+
$size?: "default" | "big" | "small";
|
|
21
21
|
$error?: boolean;
|
|
22
22
|
$success?: boolean;
|
|
23
23
|
$fullWidth?: boolean;
|
|
@@ -28,7 +28,7 @@ interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
|
28
28
|
|
|
29
29
|
interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
|
|
30
30
|
$label?: string;
|
|
31
|
-
$size?: "default" | "big";
|
|
31
|
+
$size?: "default" | "big" | "small";
|
|
32
32
|
$error?: boolean;
|
|
33
33
|
$success?: boolean;
|
|
34
34
|
$fullWidth?: boolean;
|
|
@@ -180,7 +180,12 @@ const StyledInput = styled.input<InputProps>`
|
|
|
180
180
|
? `font-size: ${theme.fontSizes.inputBig.lg};
|
|
181
181
|
line-height: ${theme.lineHeights.inputBig.lg};
|
|
182
182
|
`
|
|
183
|
-
:
|
|
183
|
+
: $size === "small"
|
|
184
|
+
? `font-size: ${theme.fontSizes.inputSmall.lg};
|
|
185
|
+
line-height: ${theme.lineHeights.inputSmall.lg};
|
|
186
|
+
padding: 12px 12px;
|
|
187
|
+
`
|
|
188
|
+
: `font-size: ${theme.fontSizes.input.lg};
|
|
184
189
|
line-height: ${theme.lineHeights.input.lg};`}
|
|
185
190
|
|
|
186
191
|
${({ $error, $success, theme }) => {
|
|
@@ -291,6 +296,27 @@ const StyledRadioCheckboxInput = styled.input<InputProps>`
|
|
|
291
296
|
height: 14px;
|
|
292
297
|
}
|
|
293
298
|
`;
|
|
299
|
+
} else if ($size === "small") {
|
|
300
|
+
return `
|
|
301
|
+
min-width: 18px;
|
|
302
|
+
width: 18px;
|
|
303
|
+
min-height: 18px;
|
|
304
|
+
height: 18px;
|
|
305
|
+
|
|
306
|
+
& ~ svg {
|
|
307
|
+
min-width: 10px;
|
|
308
|
+
width: 10px;
|
|
309
|
+
min-height: 10px;
|
|
310
|
+
height: 10px;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
& ~ em {
|
|
314
|
+
min-width: 6px;
|
|
315
|
+
width: 6px;
|
|
316
|
+
min-height: 6px;
|
|
317
|
+
height: 6px;
|
|
318
|
+
}
|
|
319
|
+
`;
|
|
294
320
|
} else {
|
|
295
321
|
return `
|
|
296
322
|
min-width: 22px;
|
package/src/lib/range.tsx
CHANGED
|
@@ -16,7 +16,7 @@ interface InputProps extends Omit<
|
|
|
16
16
|
className?: string;
|
|
17
17
|
$wrapperClassName?: string;
|
|
18
18
|
$label?: string;
|
|
19
|
-
$size?: "default" | "big";
|
|
19
|
+
$size?: "default" | "big" | "small";
|
|
20
20
|
$error?: boolean;
|
|
21
21
|
$success?: boolean;
|
|
22
22
|
$fullWidth?: boolean;
|
|
@@ -45,6 +45,7 @@ const StyledInput = styled.input<InputProps>`
|
|
|
45
45
|
width: 100%;
|
|
46
46
|
cursor: pointer;
|
|
47
47
|
border-radius: ${({ theme }) => theme.spacing.radius.xl};
|
|
48
|
+
background: ${({ theme }) => theme.colors.light};
|
|
48
49
|
border: solid 2px ${({ theme }) => theme.colors.grayLight};
|
|
49
50
|
box-shadow: 0 0 0 0 ${({ theme }) => theme.colors.primaryLight};
|
|
50
51
|
transition: all 0.3s ease;
|
|
@@ -61,6 +62,7 @@ const StyledInput = styled.input<InputProps>`
|
|
|
61
62
|
width: 100%;
|
|
62
63
|
cursor: pointer;
|
|
63
64
|
border-radius: ${({ theme }) => theme.spacing.radius.xl};
|
|
65
|
+
background: ${({ theme }) => theme.colors.light};
|
|
64
66
|
border: solid 2px ${({ theme }) => theme.colors.grayLight};
|
|
65
67
|
box-shadow: 0 0 0 0 ${({ theme }) => theme.colors.primaryLight};
|
|
66
68
|
transition: all 0.3s ease;
|
|
@@ -183,6 +185,29 @@ const StyledInput = styled.input<InputProps>`
|
|
|
183
185
|
height: 32px;
|
|
184
186
|
}
|
|
185
187
|
`;
|
|
188
|
+
} else if ($size === "small") {
|
|
189
|
+
return `
|
|
190
|
+
height: 18px;
|
|
191
|
+
|
|
192
|
+
&::-webkit-slider-runnable-track {
|
|
193
|
+
height: 8px;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
&::-moz-range-track {
|
|
197
|
+
height: 4px;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
&::-webkit-slider-thumb {
|
|
201
|
+
width: 18px;
|
|
202
|
+
height: 18px;
|
|
203
|
+
margin-top: -7px;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
&::-moz-range-thumb {
|
|
207
|
+
width: 18px;
|
|
208
|
+
height: 18px;
|
|
209
|
+
}
|
|
210
|
+
`;
|
|
186
211
|
} else {
|
|
187
212
|
return `
|
|
188
213
|
height: 22px;
|
package/src/lib/select.tsx
CHANGED
|
@@ -16,7 +16,7 @@ interface SelectProps extends React.InputHTMLAttributes<HTMLSelectElement> {
|
|
|
16
16
|
children?: React.ReactNode;
|
|
17
17
|
$wrapperClassName?: string;
|
|
18
18
|
$label?: string;
|
|
19
|
-
$size?: "default" | "big";
|
|
19
|
+
$size?: "default" | "big" | "small";
|
|
20
20
|
$error?: boolean;
|
|
21
21
|
$success?: boolean;
|
|
22
22
|
$fullWidth?: boolean;
|
|
@@ -61,7 +61,9 @@ const StyledSelect = styled.select<SelectProps>`
|
|
|
61
61
|
${({ $size, theme }) =>
|
|
62
62
|
$size === "big"
|
|
63
63
|
? `font-size: ${theme.fontSizes.inputBig.lg};`
|
|
64
|
-
:
|
|
64
|
+
: $size === "small"
|
|
65
|
+
? `font-size: ${theme.fontSizes.inputSmall.lg}; padding: 0 12px;`
|
|
66
|
+
: `font-size: ${theme.fontSizes.input.lg};`}
|
|
65
67
|
|
|
66
68
|
${({ $error, $success, theme }) => {
|
|
67
69
|
return statusBorderStyles(
|
package/src/lib/textarea.tsx
CHANGED
|
@@ -17,7 +17,7 @@ interface TextareaProps extends Omit<
|
|
|
17
17
|
children?: React.ReactNode;
|
|
18
18
|
$wrapperClassName?: string;
|
|
19
19
|
$label?: string;
|
|
20
|
-
$size?: "default" | "big";
|
|
20
|
+
$size?: "default" | "big" | "small";
|
|
21
21
|
$error?: boolean;
|
|
22
22
|
$success?: boolean;
|
|
23
23
|
$fullWidth?: boolean;
|
|
@@ -64,7 +64,12 @@ const StyledTextarea = styled.textarea<TextareaProps>`
|
|
|
64
64
|
? `font-size: ${theme.fontSizes.inputBig.lg};
|
|
65
65
|
line-height: ${theme.lineHeights.text.lg};
|
|
66
66
|
`
|
|
67
|
-
:
|
|
67
|
+
: $size === "small"
|
|
68
|
+
? `font-size: ${theme.fontSizes.inputSmall.lg};
|
|
69
|
+
line-height: ${theme.lineHeights.text.lg};
|
|
70
|
+
padding: 10px 12px;
|
|
71
|
+
`
|
|
72
|
+
: `font-size: ${theme.fontSizes.input.lg};
|
|
68
73
|
line-height: ${theme.lineHeights.text.lg};`}
|
|
69
74
|
|
|
70
75
|
${({ $error, $success, theme }) => {
|
package/src/lib/toggle.tsx
CHANGED
|
@@ -9,7 +9,7 @@ interface ToggleProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
|
9
9
|
type?: "checkbox" | "radio";
|
|
10
10
|
$wrapperClassName?: string;
|
|
11
11
|
$label?: string;
|
|
12
|
-
$size?: "default" | "big";
|
|
12
|
+
$size?: "default" | "big" | "small";
|
|
13
13
|
$error?: boolean;
|
|
14
14
|
$success?: boolean;
|
|
15
15
|
$fullWidth?: boolean;
|
|
@@ -32,8 +32,8 @@ const StyledFakeToggle = styled.span<ToggleProps>`
|
|
|
32
32
|
transition: all 0.3s ease;
|
|
33
33
|
box-shadow: 0 0 0 0 ${({ theme }) => theme.colors.primaryLight};
|
|
34
34
|
transform: none;
|
|
35
|
-
width: ${({ $size }) => ($size === "big" ? "56px" : "46px")};
|
|
36
|
-
height: ${({ $size }) => ($size === "big" ? "32px" : "22px")};
|
|
35
|
+
width: ${({ $size }) => ($size === "big" ? "56px" : $size === "small" ? "38px" : "46px")};
|
|
36
|
+
height: ${({ $size }) => ($size === "big" ? "32px" : $size === "small" ? "18px" : "22px")};
|
|
37
37
|
|
|
38
38
|
${({ $error, $success, theme }) => {
|
|
39
39
|
return statusBorderStyles(
|
|
@@ -68,8 +68,8 @@ const StyledFakeToggle = styled.span<ToggleProps>`
|
|
|
68
68
|
transition: all 0.3s ease;
|
|
69
69
|
transform: translateX(0);
|
|
70
70
|
background: ${({ theme }) => theme.colors.primary};
|
|
71
|
-
width: ${({ $size }) => ($size === "big" ? "32px" : "22px")};
|
|
72
|
-
height: ${({ $size }) => ($size === "big" ? "32px" : "22px")};
|
|
71
|
+
width: ${({ $size }) => ($size === "big" ? "32px" : $size === "small" ? "18px" : "22px")};
|
|
72
|
+
height: ${({ $size }) => ($size === "big" ? "32px" : $size === "small" ? "18px" : "22px")};
|
|
73
73
|
}
|
|
74
74
|
`;
|
|
75
75
|
|
|
@@ -90,7 +90,9 @@ const StyledToggle = styled.input<ToggleProps>`
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
&::after {
|
|
93
|
-
transform: translateX(
|
|
93
|
+
transform: translateX(
|
|
94
|
+
${({ $size }) => ($size === "big" ? "25px" : $size === "small" ? "20px" : "25px")}
|
|
95
|
+
);
|
|
94
96
|
}
|
|
95
97
|
}
|
|
96
98
|
|
package/src/lib/utils/mixins.tsx
CHANGED
|
@@ -44,13 +44,21 @@ export const statusBorderStyles = (
|
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
export const formElementHeightStyles = (
|
|
47
|
+
export const formElementHeightStyles = (
|
|
48
|
+
$size?: "default" | "big" | "small",
|
|
49
|
+
) => {
|
|
48
50
|
if ($size === "big") {
|
|
49
51
|
return css`
|
|
50
52
|
height: 60px;
|
|
51
53
|
`;
|
|
52
54
|
}
|
|
53
55
|
|
|
56
|
+
if ($size === "small") {
|
|
57
|
+
return css`
|
|
58
|
+
height: 40px;
|
|
59
|
+
`;
|
|
60
|
+
}
|
|
61
|
+
|
|
54
62
|
return css`
|
|
55
63
|
height: 50px;
|
|
56
64
|
`;
|