cherry-styled-components 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.
Files changed (45) hide show
  1. package/.claude/settings.local.json +1 -3
  2. package/.prettierignore +5 -0
  3. package/.prettierrc +2 -2
  4. package/.supermaven/config.json +6 -1
  5. package/CLAUDE.md +70 -0
  6. package/dist/cherry.js +20154 -2610
  7. package/dist/cherry.umd.cjs +650 -478
  8. package/dist/lib/button.d.ts +2 -1
  9. package/dist/lib/icon.d.ts +10 -0
  10. package/dist/lib/index.d.ts +1 -0
  11. package/dist/lib/input.d.ts +1 -0
  12. package/dist/lib/range.d.ts +1 -0
  13. package/dist/lib/select.d.ts +1 -0
  14. package/dist/lib/textarea.d.ts +1 -0
  15. package/dist/lib/toggle.d.ts +1 -0
  16. package/package.json +9 -8
  17. package/src/App.tsx +101 -80
  18. package/src/lib/box.tsx +26 -26
  19. package/src/lib/button.tsx +207 -162
  20. package/src/lib/col.tsx +48 -45
  21. package/src/lib/container.tsx +69 -59
  22. package/src/lib/flex.tsx +99 -92
  23. package/src/lib/grid.tsx +76 -64
  24. package/src/lib/icon.tsx +18 -0
  25. package/src/lib/index.ts +16 -15
  26. package/src/lib/input.tsx +418 -384
  27. package/src/lib/max-width.tsx +53 -50
  28. package/src/lib/range.tsx +234 -208
  29. package/src/lib/select.tsx +136 -121
  30. package/src/lib/space.tsx +55 -52
  31. package/src/lib/styled-components/index.ts +2 -2
  32. package/src/lib/styled-components/registry.tsx +29 -26
  33. package/src/lib/styled-components/theme-provider.tsx +50 -49
  34. package/src/lib/textarea.tsx +115 -94
  35. package/src/lib/toggle.tsx +158 -147
  36. package/src/lib/utils/global.tsx +95 -95
  37. package/src/lib/utils/icons.tsx +84 -84
  38. package/src/lib/utils/index.ts +5 -5
  39. package/src/lib/utils/mixins.tsx +108 -95
  40. package/src/lib/utils/theme.ts +289 -289
  41. package/src/lib/utils/typography.tsx +204 -204
  42. package/src/main.tsx +19 -14
  43. package/src/toggle-theme.tsx +25 -25
  44. package/src/vite-env.d.ts +8 -8
  45. package/vite.config.js +18 -18
@@ -8,8 +8,9 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
8
8
  $fullWidth?: boolean;
9
9
  $icon?: React.ReactNode;
10
10
  $iconPosition?: "left" | "right";
11
+ $isError?: boolean;
11
12
  theme?: Theme;
12
13
  }
13
- export declare const buttonStyles: (theme: Theme, $variant?: "primary" | "secondary" | "tertiary", $size?: "default" | "big", $outline?: boolean, $fullWidth?: boolean, disabled?: boolean) => import('styled-components').RuleSet<object>;
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
15
  declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
15
16
  export { Button };
@@ -0,0 +1,10 @@
1
+ import { icons } from 'lucide-react';
2
+ export type IconProps = keyof typeof icons;
3
+ interface Props {
4
+ name: IconProps;
5
+ color?: string;
6
+ size?: number;
7
+ className?: string;
8
+ }
9
+ declare const Icon: ({ name, color, size, className }: Props) => import("react").JSX.Element;
10
+ export { Icon };
@@ -6,6 +6,7 @@ export * from './col';
6
6
  export * from './container';
7
7
  export * from './flex';
8
8
  export * from './grid';
9
+ export * from './icon';
9
10
  export * from './input';
10
11
  export * from './max-width';
11
12
  export * from './range';
@@ -3,6 +3,7 @@ import { IStyledComponent } from 'styled-components';
3
3
  import { Theme } from './utils';
4
4
  interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
5
5
  children?: React.ReactNode;
6
+ $wrapperClassName?: string;
6
7
  $label?: string;
7
8
  $size?: "default" | "big";
8
9
  $error?: boolean;
@@ -2,6 +2,7 @@ import { default as React } from 'react';
2
2
  import { Theme } from './utils';
3
3
  interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> {
4
4
  className?: string;
5
+ $wrapperClassName?: string;
5
6
  $label?: string;
6
7
  $size?: "default" | "big";
7
8
  $error?: boolean;
@@ -3,6 +3,7 @@ import { IStyledComponent } from 'styled-components';
3
3
  import { Theme } from './utils';
4
4
  interface SelectProps extends React.InputHTMLAttributes<HTMLSelectElement> {
5
5
  children?: React.ReactNode;
6
+ $wrapperClassName?: string;
6
7
  $label?: string;
7
8
  $size?: "default" | "big";
8
9
  $error?: boolean;
@@ -2,6 +2,7 @@ import { default as React } from 'react';
2
2
  import { Theme } from './utils';
3
3
  interface TextareaProps extends Omit<React.InputHTMLAttributes<HTMLTextAreaElement>, "size"> {
4
4
  children?: React.ReactNode;
5
+ $wrapperClassName?: string;
5
6
  $label?: string;
6
7
  $size?: "default" | "big";
7
8
  $error?: boolean;
@@ -3,6 +3,7 @@ import { Theme } from './utils';
3
3
  interface ToggleProps extends React.InputHTMLAttributes<HTMLInputElement> {
4
4
  children?: React.ReactNode;
5
5
  type?: "checkbox" | "radio";
6
+ $wrapperClassName?: string;
6
7
  $label?: string;
7
8
  $size?: "default" | "big";
8
9
  $error?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cherry-styled-components",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
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",
@@ -26,24 +26,25 @@
26
26
  "scripts": {
27
27
  "dev": "vite dev",
28
28
  "build": "vite build",
29
- "format": "prettier --write \"./src/**/*.{js,json,ts,tsx}\" \"!.node_modules/**\""
29
+ "format": "prettier --write \"./**/*.{js,json,ts,tsx}\""
30
30
  },
31
31
  "dependencies": {
32
- "react": "^19",
33
- "react-dom": "^19"
32
+ "react": "^19.2.4",
33
+ "react-dom": "^19.2.4"
34
34
  },
35
35
  "devDependencies": {
36
- "@types/node": "^25",
37
- "@types/react": "^19",
38
- "@types/react-dom": "^19",
36
+ "@types/node": "^25.2.1",
37
+ "@types/react": "^19.2.13",
38
+ "@types/react-dom": "^19.2.3",
39
39
  "@vitejs/plugin-react": "^5.1.3",
40
40
  "eslint-plugin-react-hooks": "^7.0.1",
41
41
  "eslint-plugin-react-refresh": "^0.5.0",
42
+ "lucide-react": "^0.563.0",
42
43
  "next": "^16.1.6",
43
44
  "polished": "^4.3.1",
44
45
  "prettier": "^3.8.1",
45
46
  "styled-components": "^6.3.8",
46
- "typescript": "^5",
47
+ "typescript": "^5.9.3",
47
48
  "vite": "^7.3.1",
48
49
  "vite-plugin-dts": "^4.5.4"
49
50
  }
package/src/App.tsx CHANGED
@@ -1,80 +1,101 @@
1
- import {
2
- Container,
3
- Button,
4
- Col,
5
- Flex,
6
- Grid,
7
- Input,
8
- MaxWidth,
9
- Range,
10
- Select,
11
- Space,
12
- Textarea,
13
- Toggle,
14
- } from "./lib";
15
- import { ToggleTheme } from "./toggle-theme";
16
-
17
- function App() {
18
- return (
19
- <Container>
20
- <Space $size={100} />
21
- <MaxWidth $xs={845}>
22
- <ToggleTheme />
23
- <hr />
24
- <Input $fullWidth $label="Input" id="data-1" type="date" />
25
- <Grid $xsCols={1} $lgCols={3} $gap={20}>
26
- <Col $xsSpan={1} $lgSpan={2}>
27
- <Grid $xsCols={1} $lgCols={2} $gap={20}>
28
- <Input placeholder="Placeholder" $fullWidth $label="Input" id="input-1" />
29
- <Select $fullWidth $label="Select" id="select-1">
30
- <option>Select</option>
31
- </Select>
32
- <Col $lgSpan={2}>
33
- <Flex $xsGap={10} $lgGap={20} $wrap="nowrap" $justifyContent="space-between">
34
- <Input type="checkbox" id="checkbox-1" />
35
- <Input type="checkbox" id="checkbox-2" defaultChecked />
36
- <Input type="radio" id="radio-2" name="demo-radio" />
37
- <Input type="radio" id="radio-3" name="demo-radio" defaultChecked />
38
- <Range />
39
- <Toggle />
40
- <Toggle defaultChecked />
41
- </Flex>
42
- </Col>
43
- </Grid>
44
- </Col>
45
- <Textarea $label="Textarea" $fullWidth defaultValue="Textarea" id="textarea-1" />
46
- </Grid>
47
- <Space $size={20} />
48
- <Grid $xsCols={1} $lgCols={2} $gap={20}>
49
- <Col>
50
- <Flex $wrap="nowrap" $gap={20}>
51
- <Button $fullWidth>Button</Button>
52
- <Button $variant="secondary" $fullWidth>
53
- Button
54
- </Button>
55
- <Button $variant="tertiary" $fullWidth>
56
- Button
57
- </Button>
58
- </Flex>
59
- </Col>
60
- <Col>
61
- <Flex $wrap="nowrap" $gap={20}>
62
- <Button $outline $fullWidth>
63
- Button
64
- </Button>
65
- <Button $variant="secondary" $outline $fullWidth>
66
- Button
67
- </Button>
68
- <Button $variant="tertiary" $outline $fullWidth>
69
- Button
70
- </Button>
71
- </Flex>
72
- </Col>
73
- </Grid>
74
- </MaxWidth>
75
- <Space $size={100} />
76
- </Container>
77
- );
78
- }
79
-
80
- export default App;
1
+ import {
2
+ Container,
3
+ Button,
4
+ Col,
5
+ Flex,
6
+ Grid,
7
+ Input,
8
+ MaxWidth,
9
+ Range,
10
+ Select,
11
+ Space,
12
+ Textarea,
13
+ Toggle,
14
+ } from "./lib";
15
+ import { ToggleTheme } from "./toggle-theme";
16
+
17
+ function App() {
18
+ return (
19
+ <Container>
20
+ <Space $size={100} />
21
+ <MaxWidth $xs={845}>
22
+ <ToggleTheme />
23
+ <hr />
24
+ <Input $fullWidth $label="Input" id="data-1" type="date" />
25
+ <Space $size={20} />
26
+ <Grid $xsCols={1} $lgCols={3} $gap={20}>
27
+ <Col $xsSpan={1} $lgSpan={2}>
28
+ <Grid $xsCols={1} $lgCols={2} $gap={20}>
29
+ <Input
30
+ placeholder="Placeholder"
31
+ $fullWidth
32
+ $label="Input"
33
+ id="input-1"
34
+ />
35
+ <Select $fullWidth $label="Select" id="select-1">
36
+ <option>Select</option>
37
+ </Select>
38
+ <Col $lgSpan={2}>
39
+ <Flex
40
+ $xsGap={10}
41
+ $lgGap={20}
42
+ $wrap="nowrap"
43
+ $justifyContent="space-between"
44
+ >
45
+ <Input type="checkbox" id="checkbox-1" />
46
+ <Input type="checkbox" id="checkbox-2" defaultChecked />
47
+ <Input type="radio" id="radio-2" name="demo-radio" />
48
+ <Input
49
+ type="radio"
50
+ id="radio-3"
51
+ name="demo-radio"
52
+ defaultChecked
53
+ />
54
+ <Range />
55
+ <Toggle />
56
+ <Toggle defaultChecked />
57
+ </Flex>
58
+ </Col>
59
+ </Grid>
60
+ </Col>
61
+ <Textarea
62
+ $label="Textarea"
63
+ $fullWidth
64
+ defaultValue="Textarea"
65
+ id="textarea-1"
66
+ />
67
+ </Grid>
68
+ <Space $size={20} />
69
+ <Grid $xsCols={1} $lgCols={2} $gap={20}>
70
+ <Col>
71
+ <Flex $wrap="nowrap" $gap={20}>
72
+ <Button $fullWidth>Button</Button>
73
+ <Button $variant="secondary" $fullWidth>
74
+ Button
75
+ </Button>
76
+ <Button $variant="tertiary" $fullWidth>
77
+ Button
78
+ </Button>
79
+ </Flex>
80
+ </Col>
81
+ <Col>
82
+ <Flex $wrap="nowrap" $gap={20}>
83
+ <Button $outline $fullWidth>
84
+ Button
85
+ </Button>
86
+ <Button $variant="secondary" $outline $fullWidth>
87
+ Button
88
+ </Button>
89
+ <Button $variant="tertiary" $outline $fullWidth>
90
+ Button
91
+ </Button>
92
+ </Flex>
93
+ </Col>
94
+ </Grid>
95
+ </MaxWidth>
96
+ <Space $size={100} />
97
+ </Container>
98
+ );
99
+ }
100
+
101
+ export default App;
package/src/lib/box.tsx CHANGED
@@ -1,26 +1,26 @@
1
- "use client";
2
- import React, { forwardRef } from "react";
3
- import styled from "styled-components";
4
- import { Container, ContainerProps } from "./container";
5
- import { theme as defaultTheme } from "./utils";
6
-
7
- const StyledBox = styled(Container)<ContainerProps>`
8
- background: ${({ theme }) => theme.colors.light};
9
- border-radius: ${({ theme }) => theme.spacing.radius.lg};
10
- border: solid 1px ${({ theme }) => theme.colors.grayLight};
11
- `;
12
-
13
- function LocalBox(
14
- { theme = defaultTheme, ...props }: ContainerProps,
15
- ref: React.Ref<HTMLDivElement>,
16
- ) {
17
- return (
18
- <StyledBox {...props} theme={theme} ref={ref}>
19
- {props.children}
20
- </StyledBox>
21
- );
22
- }
23
-
24
- const Box = forwardRef(LocalBox);
25
-
26
- export { Box };
1
+ "use client";
2
+ import React, { forwardRef } from "react";
3
+ import styled from "styled-components";
4
+ import { Container, ContainerProps } from "./container";
5
+ import { theme as defaultTheme } from "./utils";
6
+
7
+ const StyledBox = styled(Container)<ContainerProps>`
8
+ background: ${({ theme }) => theme.colors.light};
9
+ border-radius: ${({ theme }) => theme.spacing.radius.lg};
10
+ border: solid 1px ${({ theme }) => theme.colors.grayLight};
11
+ `;
12
+
13
+ function LocalBox(
14
+ { theme = defaultTheme, ...props }: ContainerProps,
15
+ ref: React.Ref<HTMLDivElement>,
16
+ ) {
17
+ return (
18
+ <StyledBox {...props} theme={theme} ref={ref}>
19
+ {props.children}
20
+ </StyledBox>
21
+ );
22
+ }
23
+
24
+ const Box = forwardRef(LocalBox);
25
+
26
+ export { Box };