cherry-styled-components 0.1.11 → 0.1.13
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/README.md +2 -0
- package/dist/box.js +17 -0
- package/{src/lib/button.tsx → dist/button.js} +45 -98
- package/dist/col.js +25 -0
- package/dist/container.js +36 -0
- package/dist/flex.js +40 -0
- package/dist/grid.js +39 -0
- package/dist/icon.js +26 -0
- package/dist/index.js +89 -0
- package/{src/lib/input.tsx → dist/input.js} +95 -151
- package/dist/lib/button.d.ts +2 -3
- package/dist/lib/col.d.ts +0 -2
- package/dist/lib/container.d.ts +0 -2
- package/dist/lib/flex.d.ts +1 -3
- package/dist/lib/grid.d.ts +0 -2
- package/dist/lib/icon.d.ts +2 -1
- package/dist/lib/input.d.ts +0 -3
- package/dist/lib/range.d.ts +0 -2
- package/dist/lib/select.d.ts +0 -2
- package/dist/lib/styled-components/theme-provider.d.ts +1 -1
- package/dist/lib/textarea.d.ts +0 -2
- package/dist/lib/toggle.d.ts +0 -2
- package/dist/lib/utils/mixins.d.ts +2 -2
- package/dist/lib/utils/theme.d.ts +1 -2
- package/dist/lib/utils/typography.d.ts +3 -2
- package/dist/max-width.js +35 -0
- package/{src/lib/range.tsx → dist/range.js} +44 -71
- package/dist/select.js +108 -0
- package/dist/space.js +37 -0
- package/dist/styled-components/registry.js +25 -0
- package/dist/styled-components/theme-provider.js +35 -0
- package/dist/textarea.js +86 -0
- package/{src/lib/toggle.tsx → dist/toggle.js} +41 -67
- package/{src/lib/utils/global.tsx → dist/utils/global.js} +4 -5
- package/dist/utils/icons.js +86 -0
- package/{src/lib/utils/mixins.tsx → dist/utils/mixins.js} +23 -51
- package/dist/utils/theme.js +156 -0
- package/dist/utils/typography.js +51 -0
- package/package.json +28 -10
- package/.claude/settings.local.json +0 -21
- package/.eslintrc.cjs +0 -18
- package/.prettierignore +0 -5
- package/.prettierrc +0 -11
- package/.supermaven/config.json +0 -6
- package/CLAUDE.md +0 -70
- package/dist/cherry.js +0 -22802
- package/dist/cherry.umd.cjs +0 -1424
- package/index.html +0 -13
- package/pnpm-workspace.yaml +0 -3
- package/src/App.tsx +0 -311
- package/src/lib/box.tsx +0 -26
- package/src/lib/col.tsx +0 -48
- package/src/lib/container.tsx +0 -69
- package/src/lib/flex.tsx +0 -99
- package/src/lib/grid.tsx +0 -76
- package/src/lib/icon.tsx +0 -19
- package/src/lib/index.ts +0 -16
- package/src/lib/max-width.tsx +0 -53
- package/src/lib/select.tsx +0 -136
- package/src/lib/space.tsx +0 -55
- package/src/lib/styled-components/index.ts +0 -2
- package/src/lib/styled-components/registry.tsx +0 -29
- package/src/lib/styled-components/theme-provider.tsx +0 -50
- package/src/lib/textarea.tsx +0 -118
- package/src/lib/utils/icons.tsx +0 -84
- package/src/lib/utils/index.ts +0 -5
- package/src/lib/utils/theme.ts +0 -297
- package/src/lib/utils/typography.tsx +0 -204
- package/src/main.tsx +0 -19
- package/src/toggle-theme.tsx +0 -25
- package/src/vite-env.d.ts +0 -8
- package/tsconfig.json +0 -24
- package/vite.config.js +0 -24
|
@@ -1,53 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef } from "react";
|
|
3
4
|
import styled, { css } from "styled-components";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
IconCheck,
|
|
8
|
-
formElementHeightStyles,
|
|
9
|
-
fullWidthStyles,
|
|
10
|
-
resetButton,
|
|
11
|
-
resetInput,
|
|
12
|
-
statusBorderStyles,
|
|
13
|
-
IconCalendar,
|
|
14
|
-
} from "./utils";
|
|
15
|
-
|
|
16
|
-
interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
17
|
-
children?: React.ReactNode;
|
|
18
|
-
$wrapperClassName?: string;
|
|
19
|
-
$label?: string;
|
|
20
|
-
$size?: "default" | "big" | "small";
|
|
21
|
-
$error?: boolean;
|
|
22
|
-
$success?: boolean;
|
|
23
|
-
$fullWidth?: boolean;
|
|
24
|
-
$icon?: React.ReactNode;
|
|
25
|
-
$iconPosition?: "left" | "right";
|
|
26
|
-
theme?: Theme;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
|
|
30
|
-
$label?: string;
|
|
31
|
-
$size?: "default" | "big" | "small";
|
|
32
|
-
$error?: boolean;
|
|
33
|
-
$success?: boolean;
|
|
34
|
-
$fullWidth?: boolean;
|
|
35
|
-
theme?: Theme;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export const StyledInputWrapper: IStyledComponent<
|
|
39
|
-
"web",
|
|
40
|
-
React.HTMLAttributes<HTMLSpanElement> &
|
|
41
|
-
Pick<InputProps, "$label" | "$fullWidth" | "type">
|
|
42
|
-
> = styled.span<Pick<InputProps, "$label" | "$fullWidth" | "type">>`
|
|
5
|
+
import { IconCheck, IconCalendar } from "./utils/icons.js";
|
|
6
|
+
import { fullWidthStyles, resetButton, statusBorderStyles, resetInput, formElementHeightStyles } from "./utils/mixins.js";
|
|
7
|
+
const StyledInputWrapper = styled.span`
|
|
43
8
|
display: inline-flex;
|
|
44
|
-
flex-wrap: ${({ type }) =>
|
|
45
|
-
type === "checkbox" || type === "radio" ? "nowrap" : "wrap"};
|
|
9
|
+
flex-wrap: ${({ type }) => type === "checkbox" || type === "radio" ? "nowrap" : "wrap"};
|
|
46
10
|
align-items: center;
|
|
47
11
|
|
|
48
|
-
${({ $label }) =>
|
|
49
|
-
$label &&
|
|
50
|
-
css`
|
|
12
|
+
${({ $label }) => $label && css`
|
|
51
13
|
gap: 5px;
|
|
52
14
|
align-items: flex-start;
|
|
53
15
|
`}
|
|
@@ -67,18 +29,15 @@ export const StyledInputWrapper: IStyledComponent<
|
|
|
67
29
|
}
|
|
68
30
|
}
|
|
69
31
|
|
|
70
|
-
${({ $fullWidth }) => fullWidthStyles($fullWidth
|
|
32
|
+
${({ $fullWidth }) => fullWidthStyles($fullWidth)}
|
|
71
33
|
`;
|
|
72
|
-
|
|
73
|
-
export const StyledLabel: IStyledComponent<"web", LabelProps> =
|
|
74
|
-
styled.label<LabelProps>`
|
|
34
|
+
const StyledLabel = styled.label`
|
|
75
35
|
display: inline-block;
|
|
76
36
|
color: ${({ theme }) => theme.colors.grayDark};
|
|
77
37
|
font-size: ${({ theme }) => theme.fontSizes.small.lg};
|
|
78
38
|
line-height: ${({ theme }) => theme.lineHeights.small.lg};
|
|
79
39
|
`;
|
|
80
|
-
|
|
81
|
-
const StyledInput = styled.input<InputProps>`
|
|
40
|
+
const StyledInput = styled.input`
|
|
82
41
|
${resetButton};
|
|
83
42
|
${resetInput};
|
|
84
43
|
font-family: inherit;
|
|
@@ -175,39 +134,27 @@ const StyledInput = styled.input<InputProps>`
|
|
|
175
134
|
|
|
176
135
|
${({ $size }) => formElementHeightStyles($size)}
|
|
177
136
|
|
|
178
|
-
${({ $size, theme }) =>
|
|
179
|
-
$size === "big"
|
|
180
|
-
? `font-size: ${theme.fontSizes.inputBig.lg};
|
|
137
|
+
${({ $size, theme }) => $size === "big" ? `font-size: ${theme.fontSizes.inputBig.lg};
|
|
181
138
|
line-height: ${theme.lineHeights.inputBig.lg};
|
|
182
|
-
`
|
|
183
|
-
: $size === "small"
|
|
184
|
-
? `font-size: ${theme.fontSizes.inputSmall.lg};
|
|
139
|
+
` : $size === "small" ? `font-size: ${theme.fontSizes.inputSmall.lg};
|
|
185
140
|
line-height: ${theme.lineHeights.inputSmall.lg};
|
|
186
141
|
padding: 12px 12px;
|
|
187
|
-
`
|
|
188
|
-
: `font-size: ${theme.fontSizes.input.lg};
|
|
142
|
+
` : `font-size: ${theme.fontSizes.input.lg};
|
|
189
143
|
line-height: ${theme.lineHeights.input.lg};`}
|
|
190
144
|
|
|
191
145
|
${({ $error, $success, theme }) => {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
$success ? true : false,
|
|
195
|
-
theme,
|
|
196
|
-
);
|
|
197
|
-
}}
|
|
146
|
+
return statusBorderStyles($error, $success, theme);
|
|
147
|
+
}}
|
|
198
148
|
|
|
199
|
-
${({ disabled, theme }) =>
|
|
200
|
-
disabled &&
|
|
201
|
-
`cursor: not-allowed;
|
|
149
|
+
${({ disabled, theme }) => disabled && `cursor: not-allowed;
|
|
202
150
|
background: ${theme.colors.grayLight};
|
|
203
151
|
border-color: ${theme.colors.gray};
|
|
204
152
|
color: ${theme.colors.gray};
|
|
205
153
|
`}
|
|
206
154
|
|
|
207
|
-
${({ $fullWidth }) => fullWidthStyles($fullWidth
|
|
155
|
+
${({ $fullWidth }) => fullWidthStyles($fullWidth)}
|
|
208
156
|
`;
|
|
209
|
-
|
|
210
|
-
const StyledIconWrapper = styled.span<InputProps>`
|
|
157
|
+
const StyledIconWrapper = styled.span`
|
|
211
158
|
display: inline-flex;
|
|
212
159
|
position: relative;
|
|
213
160
|
line-height: 0;
|
|
@@ -231,8 +178,7 @@ const StyledIconWrapper = styled.span<InputProps>`
|
|
|
231
178
|
transition: all 0.3s ease;
|
|
232
179
|
}
|
|
233
180
|
`;
|
|
234
|
-
|
|
235
|
-
const StyledRadioCheckboxInput = styled.input<InputProps>`
|
|
181
|
+
const StyledRadioCheckboxInput = styled.input`
|
|
236
182
|
${resetButton};
|
|
237
183
|
display: inline-block;
|
|
238
184
|
background: ${({ theme }) => theme.colors.light};
|
|
@@ -253,30 +199,21 @@ const StyledRadioCheckboxInput = styled.input<InputProps>`
|
|
|
253
199
|
box-shadow: 0 0 0 2px ${({ theme }) => theme.colors.primaryLight};
|
|
254
200
|
}
|
|
255
201
|
|
|
256
|
-
${({ type, theme }) =>
|
|
257
|
-
type === "checkbox"
|
|
258
|
-
? `border-radius: ${theme.spacing.radius.xs};`
|
|
259
|
-
: `border-radius: 50%;`}
|
|
202
|
+
${({ type, theme }) => type === "checkbox" ? `border-radius: ${theme.spacing.radius.xs};` : `border-radius: 50%;`}
|
|
260
203
|
|
|
261
|
-
${({ disabled, theme }) =>
|
|
262
|
-
disabled &&
|
|
263
|
-
`cursor: not-allowed;
|
|
204
|
+
${({ disabled, theme }) => disabled && `cursor: not-allowed;
|
|
264
205
|
background: ${theme.colors.grayLight};
|
|
265
206
|
border: solid 2px ${theme.colors.gray};
|
|
266
207
|
color: ${theme.colors.gray};
|
|
267
208
|
`}
|
|
268
209
|
|
|
269
210
|
${({ $error, $success, theme }) => {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
$success ? true : false,
|
|
273
|
-
theme,
|
|
274
|
-
);
|
|
275
|
-
}}
|
|
211
|
+
return statusBorderStyles($error, $success, theme);
|
|
212
|
+
}}
|
|
276
213
|
|
|
277
214
|
${({ $size }) => {
|
|
278
|
-
|
|
279
|
-
|
|
215
|
+
if ($size === "big") {
|
|
216
|
+
return `
|
|
280
217
|
min-width: 32px;
|
|
281
218
|
width: 32px;
|
|
282
219
|
min-height: 32px;
|
|
@@ -296,8 +233,8 @@ const StyledRadioCheckboxInput = styled.input<InputProps>`
|
|
|
296
233
|
height: 14px;
|
|
297
234
|
}
|
|
298
235
|
`;
|
|
299
|
-
|
|
300
|
-
|
|
236
|
+
} else if ($size === "small") {
|
|
237
|
+
return `
|
|
301
238
|
min-width: 18px;
|
|
302
239
|
width: 18px;
|
|
303
240
|
min-height: 18px;
|
|
@@ -317,8 +254,8 @@ const StyledRadioCheckboxInput = styled.input<InputProps>`
|
|
|
317
254
|
height: 6px;
|
|
318
255
|
}
|
|
319
256
|
`;
|
|
320
|
-
|
|
321
|
-
|
|
257
|
+
} else {
|
|
258
|
+
return `
|
|
322
259
|
min-width: 22px;
|
|
323
260
|
width: 22px;
|
|
324
261
|
min-height: 22px;
|
|
@@ -338,8 +275,8 @@ const StyledRadioCheckboxInput = styled.input<InputProps>`
|
|
|
338
275
|
height: 8px;
|
|
339
276
|
}
|
|
340
277
|
`;
|
|
341
|
-
|
|
342
|
-
|
|
278
|
+
}
|
|
279
|
+
}}
|
|
343
280
|
|
|
344
281
|
&:checked ~ svg,
|
|
345
282
|
&:checked ~ em {
|
|
@@ -347,10 +284,9 @@ const StyledRadioCheckboxInput = styled.input<InputProps>`
|
|
|
347
284
|
transform: translate(-50%, -50%) scale(1);
|
|
348
285
|
}
|
|
349
286
|
`;
|
|
350
|
-
|
|
351
|
-
const StyledCustomIconWrapper = styled.span<InputProps>`
|
|
287
|
+
const StyledCustomIconWrapper = styled.span`
|
|
352
288
|
position: relative;
|
|
353
|
-
${({ $fullWidth }) => fullWidthStyles($fullWidth
|
|
289
|
+
${({ $fullWidth }) => fullWidthStyles($fullWidth)};
|
|
354
290
|
|
|
355
291
|
& svg {
|
|
356
292
|
position: absolute;
|
|
@@ -363,9 +299,7 @@ const StyledCustomIconWrapper = styled.span<InputProps>`
|
|
|
363
299
|
color: ${({ theme }) => theme.colors.primary};
|
|
364
300
|
}
|
|
365
301
|
|
|
366
|
-
${({ $icon, $iconPosition }) =>
|
|
367
|
-
$icon && $iconPosition === "right"
|
|
368
|
-
? css`
|
|
302
|
+
${({ $icon, $iconPosition }) => $icon && $iconPosition === "right" ? css`
|
|
369
303
|
& svg {
|
|
370
304
|
right: 16px;
|
|
371
305
|
}
|
|
@@ -373,8 +307,7 @@ const StyledCustomIconWrapper = styled.span<InputProps>`
|
|
|
373
307
|
& input {
|
|
374
308
|
padding-right: 50px;
|
|
375
309
|
}
|
|
376
|
-
`
|
|
377
|
-
: css`
|
|
310
|
+
` : css`
|
|
378
311
|
& svg {
|
|
379
312
|
left: 16px;
|
|
380
313
|
}
|
|
@@ -384,58 +317,69 @@ const StyledCustomIconWrapper = styled.span<InputProps>`
|
|
|
384
317
|
}
|
|
385
318
|
`}
|
|
386
319
|
`;
|
|
387
|
-
|
|
388
|
-
function LocalInput(
|
|
389
|
-
{ ...props }: InputProps,
|
|
390
|
-
ref: React.Ref<HTMLInputElement>,
|
|
391
|
-
) {
|
|
320
|
+
function LocalInput({ ...props }, ref) {
|
|
392
321
|
if (props.type === "checkbox" || props.type === "radio") {
|
|
393
|
-
return (
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
322
|
+
return /* @__PURE__ */ jsxs(
|
|
323
|
+
StyledInputWrapper,
|
|
324
|
+
{
|
|
325
|
+
$fullWidth: props.$fullWidth,
|
|
326
|
+
type: props.type,
|
|
327
|
+
$label: props.$label,
|
|
328
|
+
className: props.$wrapperClassName,
|
|
329
|
+
children: [
|
|
330
|
+
/* @__PURE__ */ jsxs(StyledIconWrapper, { children: [
|
|
331
|
+
/* @__PURE__ */ jsx(
|
|
332
|
+
StyledRadioCheckboxInput,
|
|
333
|
+
{
|
|
334
|
+
...props,
|
|
335
|
+
"aria-invalid": props.$error || void 0,
|
|
336
|
+
ref
|
|
337
|
+
}
|
|
338
|
+
),
|
|
339
|
+
!props.disabled && props.type === "checkbox" ? /* @__PURE__ */ jsx(IconCheck, {}) : /* @__PURE__ */ jsx("em", {})
|
|
340
|
+
] }),
|
|
341
|
+
props.$label && /* @__PURE__ */ jsx(StyledLabel, { htmlFor: props.id, children: props.$label })
|
|
342
|
+
]
|
|
343
|
+
}
|
|
412
344
|
);
|
|
413
345
|
}
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
$fullWidth
|
|
418
|
-
type
|
|
419
|
-
$label
|
|
420
|
-
className
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
346
|
+
return /* @__PURE__ */ jsxs(
|
|
347
|
+
StyledInputWrapper,
|
|
348
|
+
{
|
|
349
|
+
$fullWidth: props.$fullWidth,
|
|
350
|
+
type: props.type,
|
|
351
|
+
$label: props.$label,
|
|
352
|
+
className: props.$wrapperClassName,
|
|
353
|
+
children: [
|
|
354
|
+
props.$label && /* @__PURE__ */ jsx(StyledLabel, { htmlFor: props.id, children: props.$label }),
|
|
355
|
+
/* @__PURE__ */ jsxs(
|
|
356
|
+
StyledCustomIconWrapper,
|
|
357
|
+
{
|
|
358
|
+
$fullWidth: props.$fullWidth,
|
|
359
|
+
$iconPosition: props.$iconPosition,
|
|
360
|
+
$icon: props.$icon,
|
|
361
|
+
children: [
|
|
362
|
+
props.$iconPosition !== "right" && props.$icon && props.$icon,
|
|
363
|
+
/* @__PURE__ */ jsx(
|
|
364
|
+
StyledInput,
|
|
365
|
+
{
|
|
366
|
+
...props,
|
|
367
|
+
"aria-invalid": props.$error || void 0,
|
|
368
|
+
ref
|
|
369
|
+
}
|
|
370
|
+
),
|
|
371
|
+
props.$iconPosition === "right" && props.$icon && props.$icon,
|
|
372
|
+
props.type === "date" && /* @__PURE__ */ jsx(IconCalendar, { className: "icon-calendar" })
|
|
373
|
+
]
|
|
374
|
+
}
|
|
375
|
+
)
|
|
376
|
+
]
|
|
377
|
+
}
|
|
436
378
|
);
|
|
437
379
|
}
|
|
438
|
-
|
|
439
380
|
const Input = forwardRef(LocalInput);
|
|
440
|
-
|
|
441
|
-
|
|
381
|
+
export {
|
|
382
|
+
Input,
|
|
383
|
+
StyledInputWrapper,
|
|
384
|
+
StyledLabel
|
|
385
|
+
};
|
package/dist/lib/button.d.ts
CHANGED
|
@@ -8,9 +8,8 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
|
|
|
8
8
|
$fullWidth?: boolean;
|
|
9
9
|
$icon?: React.ReactNode;
|
|
10
10
|
$iconPosition?: "left" | "right";
|
|
11
|
-
$
|
|
12
|
-
theme?: Theme;
|
|
11
|
+
$error?: boolean;
|
|
13
12
|
}
|
|
14
|
-
export declare const buttonStyles: (theme: Theme, $variant?: "primary" | "secondary" | "tertiary", $size?: "default" | "big" | "small", $outline?: boolean, $fullWidth?: boolean, $
|
|
13
|
+
export declare const buttonStyles: (theme: Theme, $variant?: "primary" | "secondary" | "tertiary", $size?: "default" | "big" | "small", $outline?: boolean, $fullWidth?: boolean, $error?: boolean, disabled?: boolean) => import('styled-components').RuleSet<object>;
|
|
15
14
|
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
16
15
|
export { Button };
|
package/dist/lib/col.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { Theme } from './utils';
|
|
3
2
|
interface ColProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
3
|
children?: React.ReactNode;
|
|
5
4
|
$span?: number;
|
|
@@ -10,7 +9,6 @@ interface ColProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
10
9
|
$xlSpan?: number;
|
|
11
10
|
$xxlSpan?: number;
|
|
12
11
|
$xxxlSpan?: number;
|
|
13
|
-
theme?: Theme;
|
|
14
12
|
}
|
|
15
13
|
declare const Col: React.ForwardRefExoticComponent<ColProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
14
|
export { Col };
|
package/dist/lib/container.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { Theme } from './utils';
|
|
3
2
|
export interface ContainerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
3
|
className?: string;
|
|
5
4
|
children?: React.ReactNode;
|
|
@@ -13,7 +12,6 @@ export interface ContainerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
13
12
|
$xlPadding?: number | "none";
|
|
14
13
|
$xxlPadding?: number | "none";
|
|
15
14
|
$xxxlPadding?: number | "none";
|
|
16
|
-
theme?: Theme;
|
|
17
15
|
}
|
|
18
16
|
declare const Container: React.ForwardRefExoticComponent<ContainerProps & React.RefAttributes<HTMLDivElement>>;
|
|
19
17
|
export { Container };
|
package/dist/lib/flex.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { Theme } from './utils';
|
|
3
2
|
type JustifyContentType = "center" | "flex-start" | "flex-end" | "space-between" | "space-around" | "space-evenly";
|
|
4
3
|
type GapType = number | "none";
|
|
5
|
-
interface FlexProps extends React.
|
|
4
|
+
interface FlexProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
5
|
children?: React.ReactNode;
|
|
7
6
|
$justifyContent?: JustifyContentType;
|
|
8
7
|
$xsJustifyContent?: JustifyContentType;
|
|
@@ -23,7 +22,6 @@ interface FlexProps extends React.AllHTMLAttributes<FlexProps> {
|
|
|
23
22
|
$xxxlGap?: GapType;
|
|
24
23
|
$direction?: "row" | "column" | "row-reverse" | "column-reverse";
|
|
25
24
|
$fullWidth?: boolean;
|
|
26
|
-
theme?: Theme;
|
|
27
25
|
}
|
|
28
26
|
declare const Flex: React.ForwardRefExoticComponent<FlexProps & React.RefAttributes<HTMLDivElement>>;
|
|
29
27
|
export { Flex };
|
package/dist/lib/grid.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { Theme } from './utils';
|
|
3
2
|
interface GridProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
3
|
children?: React.ReactNode;
|
|
5
4
|
$gap?: number | "none";
|
|
@@ -18,7 +17,6 @@ interface GridProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
18
17
|
$xlCols?: number;
|
|
19
18
|
$xxlCols?: number;
|
|
20
19
|
$xxxlCols?: number;
|
|
21
|
-
theme?: Theme;
|
|
22
20
|
}
|
|
23
21
|
declare const Grid: React.ForwardRefExoticComponent<GridProps & React.RefAttributes<HTMLDivElement>>;
|
|
24
22
|
export { Grid };
|
package/dist/lib/icon.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ interface Props {
|
|
|
5
5
|
color?: string;
|
|
6
6
|
size?: number;
|
|
7
7
|
className?: string;
|
|
8
|
+
"aria-label"?: string;
|
|
8
9
|
}
|
|
9
|
-
declare const Icon: ({ name, color, size, className }: Props) => import("react").JSX.Element | null;
|
|
10
|
+
declare const Icon: ({ name, color, size, className, "aria-label": ariaLabel, }: Props) => import("react").JSX.Element | null;
|
|
10
11
|
export { Icon };
|
package/dist/lib/input.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { IStyledComponent } from 'styled-components';
|
|
3
|
-
import { Theme } from './utils';
|
|
4
3
|
interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
5
4
|
children?: React.ReactNode;
|
|
6
5
|
$wrapperClassName?: string;
|
|
@@ -11,7 +10,6 @@ interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
|
11
10
|
$fullWidth?: boolean;
|
|
12
11
|
$icon?: React.ReactNode;
|
|
13
12
|
$iconPosition?: "left" | "right";
|
|
14
|
-
theme?: Theme;
|
|
15
13
|
}
|
|
16
14
|
interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
|
|
17
15
|
$label?: string;
|
|
@@ -19,7 +17,6 @@ interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
|
|
|
19
17
|
$error?: boolean;
|
|
20
18
|
$success?: boolean;
|
|
21
19
|
$fullWidth?: boolean;
|
|
22
|
-
theme?: Theme;
|
|
23
20
|
}
|
|
24
21
|
export declare const StyledInputWrapper: IStyledComponent<"web", React.HTMLAttributes<HTMLSpanElement> & Pick<InputProps, "$label" | "$fullWidth" | "type">>;
|
|
25
22
|
export declare const StyledLabel: IStyledComponent<"web", LabelProps>;
|
package/dist/lib/range.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { Theme } from './utils';
|
|
3
2
|
interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> {
|
|
4
3
|
className?: string;
|
|
5
4
|
$wrapperClassName?: string;
|
|
@@ -8,7 +7,6 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
|
8
7
|
$error?: boolean;
|
|
9
8
|
$success?: boolean;
|
|
10
9
|
$fullWidth?: boolean;
|
|
11
|
-
theme?: Theme;
|
|
12
10
|
}
|
|
13
11
|
declare const Range: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
14
12
|
export { Range };
|
package/dist/lib/select.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { IStyledComponent } from 'styled-components';
|
|
3
|
-
import { Theme } from './utils';
|
|
4
3
|
interface SelectProps extends React.InputHTMLAttributes<HTMLSelectElement> {
|
|
5
4
|
children?: React.ReactNode;
|
|
6
5
|
$wrapperClassName?: string;
|
|
@@ -9,7 +8,6 @@ interface SelectProps extends React.InputHTMLAttributes<HTMLSelectElement> {
|
|
|
9
8
|
$error?: boolean;
|
|
10
9
|
$success?: boolean;
|
|
11
10
|
$fullWidth?: boolean;
|
|
12
|
-
theme?: Theme;
|
|
13
11
|
}
|
|
14
12
|
export declare const StyledIconWrapper: IStyledComponent<"web", SelectProps>;
|
|
15
13
|
declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLSelectElement>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { Theme } from '../utils';
|
|
3
3
|
interface ThemeContextProps {
|
|
4
|
-
setTheme:
|
|
4
|
+
setTheme: React.Dispatch<React.SetStateAction<Theme>>;
|
|
5
5
|
}
|
|
6
6
|
export declare const ThemeContext: React.Context<ThemeContextProps>;
|
|
7
7
|
declare function CherryThemeProvider({ children, theme, themeDark, }: {
|
package/dist/lib/textarea.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { Theme } from './utils';
|
|
3
2
|
interface TextareaProps extends Omit<React.InputHTMLAttributes<HTMLTextAreaElement>, "size"> {
|
|
4
3
|
children?: React.ReactNode;
|
|
5
4
|
$wrapperClassName?: string;
|
|
@@ -8,7 +7,6 @@ interface TextareaProps extends Omit<React.InputHTMLAttributes<HTMLTextAreaEleme
|
|
|
8
7
|
$error?: boolean;
|
|
9
8
|
$success?: boolean;
|
|
10
9
|
$fullWidth?: boolean;
|
|
11
|
-
theme?: Theme;
|
|
12
10
|
rows?: number;
|
|
13
11
|
}
|
|
14
12
|
declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
package/dist/lib/toggle.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { Theme } from './utils';
|
|
3
2
|
interface ToggleProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
4
3
|
children?: React.ReactNode;
|
|
5
4
|
type?: "checkbox" | "radio";
|
|
@@ -9,7 +8,6 @@ interface ToggleProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
|
9
8
|
$error?: boolean;
|
|
10
9
|
$success?: boolean;
|
|
11
10
|
$fullWidth?: boolean;
|
|
12
|
-
theme?: Theme;
|
|
13
11
|
}
|
|
14
12
|
declare const Toggle: React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLInputElement>>;
|
|
15
13
|
export { Toggle };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Breakpoints, Theme } from './theme';
|
|
2
2
|
export declare const resetButton: import('styled-components').RuleSet<object>;
|
|
3
3
|
export declare const resetInput: import('styled-components').RuleSet<object>;
|
|
4
|
-
export declare const fullWidthStyles: (fullWidth
|
|
5
|
-
export declare const statusBorderStyles: ($error
|
|
4
|
+
export declare const fullWidthStyles: (fullWidth?: boolean) => import('styled-components').RuleSet<object> | undefined;
|
|
5
|
+
export declare const statusBorderStyles: ($error?: boolean, $success?: boolean, theme?: Theme) => import('styled-components').RuleSet<object> | undefined;
|
|
6
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>;
|
|
@@ -58,7 +58,7 @@ export interface Colors<TString = string> {
|
|
|
58
58
|
dark: TString;
|
|
59
59
|
light: TString;
|
|
60
60
|
}
|
|
61
|
-
interface Shadows<TString = string> {
|
|
61
|
+
export interface Shadows<TString = string> {
|
|
62
62
|
xs: TString;
|
|
63
63
|
sm: TString;
|
|
64
64
|
md: TString;
|
|
@@ -244,4 +244,3 @@ export interface Theme {
|
|
|
244
244
|
lineHeights: LineHeights;
|
|
245
245
|
isDark: boolean;
|
|
246
246
|
}
|
|
247
|
-
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Theme } from './theme';
|
|
1
|
+
import { FontSizes, Theme } from './theme';
|
|
2
|
+
declare const createTypographyStyle: (key: keyof FontSizes) => (theme: Theme) => import('styled-components').RuleSet<object>;
|
|
2
3
|
declare const styledHero1: (theme: Theme) => import('styled-components').RuleSet<object>;
|
|
3
4
|
declare const styledHero2: (theme: Theme) => import('styled-components').RuleSet<object>;
|
|
4
5
|
declare const styledHero3: (theme: Theme) => import('styled-components').RuleSet<object>;
|
|
@@ -17,4 +18,4 @@ declare const styledButton: (theme: Theme) => import('styled-components').RuleSe
|
|
|
17
18
|
declare const styledButtonBig: (theme: Theme) => import('styled-components').RuleSet<object>;
|
|
18
19
|
declare const styledInput: (theme: Theme) => import('styled-components').RuleSet<object>;
|
|
19
20
|
declare const styledInputBig: (theme: Theme) => import('styled-components').RuleSet<object>;
|
|
20
|
-
export { styledHero1, styledHero2, styledHero3, styledH1, styledH2, styledH3, styledH4, styledH5, styledH6, styledText, styledStrong, styledSmall, styledBlockquote, styledCode, styledButton, styledButtonBig, styledInput, styledInputBig, };
|
|
21
|
+
export { createTypographyStyle, styledHero1, styledHero2, styledHero3, styledH1, styledH2, styledH3, styledH4, styledH5, styledH6, styledText, styledStrong, styledSmall, styledBlockquote, styledCode, styledButton, styledButtonBig, styledInput, styledInputBig, };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import styled from "styled-components";
|
|
5
|
+
import { mq } from "./utils/theme.js";
|
|
6
|
+
const styles = ($size) => `max-width: ${$size}px;`;
|
|
7
|
+
const breakpointKeys = ["xs", "sm", "md", "lg", "xl", "xxl", "xxxl"];
|
|
8
|
+
function responsiveStyles(props) {
|
|
9
|
+
const propMap = {
|
|
10
|
+
xs: props.$xs,
|
|
11
|
+
sm: props.$sm,
|
|
12
|
+
md: props.$md,
|
|
13
|
+
lg: props.$lg,
|
|
14
|
+
xl: props.$xl,
|
|
15
|
+
xxl: props.$xxl,
|
|
16
|
+
xxxl: props.$xxxl
|
|
17
|
+
};
|
|
18
|
+
return breakpointKeys.filter((key) => propMap[key] !== void 0).map((key) => mq(key) + `{ ${styles(propMap[key])} }`).join("");
|
|
19
|
+
}
|
|
20
|
+
const StyledMaxWidth = styled.div`
|
|
21
|
+
display: block;
|
|
22
|
+
margin: ${({ $m0 }) => $m0 ? "0" : "auto"};
|
|
23
|
+
|
|
24
|
+
${({ $size }) => `
|
|
25
|
+
${$size && styles($size)};
|
|
26
|
+
`}
|
|
27
|
+
${(props) => responsiveStyles(props)}
|
|
28
|
+
`;
|
|
29
|
+
function LocalMaxWidth({ ...props }, ref) {
|
|
30
|
+
return /* @__PURE__ */ jsx(StyledMaxWidth, { ...props, ref, children: props.children });
|
|
31
|
+
}
|
|
32
|
+
const MaxWidth = forwardRef(LocalMaxWidth);
|
|
33
|
+
export {
|
|
34
|
+
MaxWidth
|
|
35
|
+
};
|