cherry-styled-components 0.1.0-9 → 0.1.1

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 (60) hide show
  1. package/.claude/settings.local.json +7 -0
  2. package/.prettierrc +9 -9
  3. package/.supermaven/config.json +1 -0
  4. package/README.md +1 -1
  5. package/dist/App.d.ts +0 -1
  6. package/dist/cherry.js +4066 -2890
  7. package/dist/cherry.umd.cjs +916 -791
  8. package/dist/lib/box.d.ts +3 -3
  9. package/dist/lib/button.d.ts +6 -4
  10. package/dist/lib/col.d.ts +3 -3
  11. package/dist/lib/container.d.ts +3 -3
  12. package/dist/lib/flex.d.ts +5 -3
  13. package/dist/lib/grid.d.ts +3 -3
  14. package/dist/lib/index.d.ts +15 -15
  15. package/dist/lib/input.d.ts +16 -5
  16. package/dist/lib/max-width.d.ts +3 -2
  17. package/dist/lib/range.d.ts +3 -3
  18. package/dist/lib/select.d.ts +5 -4
  19. package/dist/lib/space.d.ts +2 -2
  20. package/dist/lib/styled-components/index.d.ts +2 -2
  21. package/dist/lib/styled-components/registry.d.ts +1 -1
  22. package/dist/lib/styled-components/theme-provider.d.ts +10 -4
  23. package/dist/lib/textarea.d.ts +4 -3
  24. package/dist/lib/toggle.d.ts +3 -3
  25. package/dist/lib/utils/global.d.ts +2 -2
  26. package/dist/lib/utils/icons.d.ts +6 -10
  27. package/dist/lib/utils/index.d.ts +5 -5
  28. package/dist/lib/utils/mixins.d.ts +11 -11
  29. package/dist/lib/utils/theme.d.ts +4 -0
  30. package/dist/lib/utils/typography.d.ts +19 -19
  31. package/dist/toggle-theme.d.ts +3 -0
  32. package/package.json +17 -15
  33. package/pnpm-workspace.yaml +3 -0
  34. package/src/App.tsx +80 -93
  35. package/src/lib/box.tsx +26 -21
  36. package/src/lib/button.tsx +162 -159
  37. package/src/lib/col.tsx +45 -43
  38. package/src/lib/container.tsx +59 -64
  39. package/src/lib/flex.tsx +92 -95
  40. package/src/lib/grid.tsx +64 -70
  41. package/src/lib/index.ts +15 -15
  42. package/src/lib/input.tsx +384 -267
  43. package/src/lib/max-width.tsx +50 -43
  44. package/src/lib/range.tsx +208 -226
  45. package/src/lib/select.tsx +121 -131
  46. package/src/lib/space.tsx +52 -54
  47. package/src/lib/styled-components/index.ts +2 -2
  48. package/src/lib/styled-components/registry.tsx +26 -26
  49. package/src/lib/styled-components/theme-provider.tsx +49 -21
  50. package/src/lib/textarea.tsx +94 -103
  51. package/src/lib/toggle.tsx +147 -160
  52. package/src/lib/utils/global.tsx +95 -79
  53. package/src/lib/utils/icons.tsx +84 -170
  54. package/src/lib/utils/index.ts +5 -5
  55. package/src/lib/utils/mixins.tsx +95 -108
  56. package/src/lib/utils/theme.ts +289 -242
  57. package/src/lib/utils/typography.tsx +204 -204
  58. package/src/main.tsx +14 -14
  59. package/src/toggle-theme.tsx +25 -0
  60. package/src/vite-env.d.ts +8 -1
package/src/App.tsx CHANGED
@@ -1,93 +1,80 @@
1
- import {
2
- Button,
3
- Col,
4
- Flex,
5
- Grid,
6
- Input,
7
- MaxWidth,
8
- Range,
9
- Select,
10
- Space,
11
- Textarea,
12
- Toggle,
13
- } from "./lib";
14
-
15
- function App() {
16
- return (
17
- <>
18
- <Space $size={100} />
19
- <MaxWidth $xs={845}>
20
- <Grid $xsCols={1} $lgCols={3} $gap={20}>
21
- <Col $xsSpan={1} $lgSpan={2}>
22
- <Grid $xsCols={1} $lgCols={2} $gap={20}>
23
- <Input placeholder="Placeholder" $fullWidth />
24
- <Select $fullWidth>
25
- <option>Select</option>
26
- </Select>
27
- <Col $lgSpan={2}>
28
- <Flex
29
- $xsGap={10}
30
- $lgGap={20}
31
- $wrap="nowrap"
32
- $justifyContent="space-between"
33
- >
34
- <Input type="checkbox" id="checkbox-1" />
35
- <Input
36
- type="checkbox"
37
- id="checkbox-2"
38
- defaultChecked
39
- />
40
- <Input
41
- type="radio"
42
- id="radio-2"
43
- name="demo-radio"
44
- />
45
- <Input
46
- type="radio"
47
- id="radio-3"
48
- name="demo-radio"
49
- defaultChecked
50
- />
51
- <Range />
52
- <Toggle />
53
- <Toggle defaultChecked />
54
- </Flex>
55
- </Col>
56
- </Grid>
57
- </Col>
58
- <Textarea $fullWidth defaultValue="Textarea" />
59
- </Grid>
60
- <Space $size={20} />
61
- <Grid $xsCols={1} $lgCols={2} $gap={20}>
62
- <Col>
63
- <Flex $wrap="nowrap" $gap={20}>
64
- <Button $fullWidth>Button</Button>
65
- <Button $variant="secondary" $fullWidth>
66
- Button
67
- </Button>
68
- <Button $variant="tertiary" $fullWidth>
69
- Button
70
- </Button>
71
- </Flex>
72
- </Col>
73
- <Col>
74
- <Flex $wrap="nowrap" $gap={20}>
75
- <Button $outline $fullWidth>
76
- Button
77
- </Button>
78
- <Button $variant="secondary" $outline $fullWidth>
79
- Button
80
- </Button>
81
- <Button $variant="tertiary" $outline $fullWidth>
82
- Button
83
- </Button>
84
- </Flex>
85
- </Col>
86
- </Grid>
87
- </MaxWidth>
88
- <Space $size={100} />
89
- </>
90
- );
91
- }
92
-
93
- 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
+ <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;
package/src/lib/box.tsx CHANGED
@@ -1,21 +1,26 @@
1
- "use client";
2
- import React from "react";
3
- import styled from "styled-components";
4
- import { Container, ContainerProps } from "./container";
5
- import { theme as defaultTheme } from "./utils";
6
-
7
- const StylesBox = 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 Box({ theme = defaultTheme, ...props }: ContainerProps) {
14
- return (
15
- <StylesBox {...props} theme={theme}>
16
- {props.children}
17
- </StylesBox>
18
- );
19
- }
20
-
21
- 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 };
@@ -1,159 +1,162 @@
1
- "use client";
2
- import React from "react";
3
- import styled, { css } from "styled-components";
4
- import {
5
- theme as defaultTheme,
6
- Theme,
7
- formElementHeightStyles,
8
- resetButton,
9
- } from "./utils";
10
-
11
- export interface ButtonProps
12
- extends React.ButtonHTMLAttributes<HTMLButtonElement> {
13
- children?: React.ReactNode;
14
- $variant?: "primary" | "secondary" | "tertiary";
15
- $size?: "default" | "big";
16
- $outline?: boolean;
17
- $fullWidth?: boolean;
18
- theme?: Theme;
19
- }
20
-
21
- export const buttonStyles = (
22
- theme: Theme,
23
- $variant?: "primary" | "secondary" | "tertiary",
24
- $size?: "default" | "big",
25
- $outline?: boolean,
26
- $fullWidth?: boolean,
27
- disabled?: boolean,
28
- ) => css`
29
- ${resetButton};
30
- font-family: inherit;
31
- display: inline-block;
32
- padding: 15px 30px;
33
- border-radius: 100px;
34
- font-weight: 600;
35
- white-space: nowrap;
36
- hyphens: auto;
37
- color: ${theme.colors.light};
38
- text-decoration: none;
39
- transition: all 0.3s ease;
40
-
41
- ${!disabled &&
42
- $variant === "primary" &&
43
- css`
44
- color: ${$outline ? theme.colors.primary : theme.colors.light};
45
- background: ${$outline ? "transparent" : theme.colors.primary};
46
- border: solid 2px ${theme.colors.primary};
47
- box-shadow: 0 0 0 0px ${theme.colors.primary};
48
-
49
- @media (hover: hover) {
50
- &:hover {
51
- background: ${$outline
52
- ? "transparent"
53
- : theme.colors.primaryDark};
54
- border-color: ${theme.colors.primaryDark};
55
- ${$outline && `color: ${theme.colors.primaryDark}`};
56
- }
57
- }
58
-
59
- &:focus {
60
- box-shadow: 0 0 0 4px ${theme.colors.primaryLight};
61
- }
62
-
63
- &:active {
64
- box-shadow: 0 0 0 2px ${theme.colors.primaryLight};
65
- }
66
- `}
67
-
68
- ${!disabled &&
69
- $variant === "secondary" &&
70
- css`
71
- color: ${$outline ? theme.colors.secondary : theme.colors.light};
72
- background: ${$outline ? "transparent" : theme.colors.secondary};
73
- border: solid 2px ${theme.colors.secondary};
74
- box-shadow: 0 0 0 0px ${theme.colors.secondary};
75
-
76
- @media (hover: hover) {
77
- &:hover {
78
- background: ${$outline
79
- ? "transparent"
80
- : theme.colors.secondaryDark};
81
- border-color: ${theme.colors.secondaryDark};
82
- ${$outline && `color: ${theme.colors.secondaryDark}`};
83
- }
84
- }
85
-
86
- &:focus {
87
- box-shadow: 0 0 0 4px ${theme.colors.secondaryLight};
88
- }
89
-
90
- &:active {
91
- box-shadow: 0 0 0 2px ${theme.colors.secondaryLight};
92
- }
93
- `}
94
-
95
- ${!disabled &&
96
- $variant === "tertiary" &&
97
- css`
98
- color: ${$outline ? theme.colors.tertiary : theme.colors.light};
99
- background: ${$outline ? "transparent" : theme.colors.tertiary};
100
- border: solid 2px ${theme.colors.tertiary};
101
- box-shadow: 0 0 0 0px ${theme.colors.tertiary};
102
-
103
- @media (hover: hover) {
104
- &:hover {
105
- background: ${$outline
106
- ? "transparent"
107
- : theme.colors.tertiaryDark};
108
- border-color: ${theme.colors.tertiaryDark};
109
- ${$outline && `color: ${theme.colors.tertiaryDark}`};
110
- }
111
- }
112
-
113
- &:focus {
114
- box-shadow: 0 0 0 4px ${theme.colors.tertiaryLight};
115
- }
116
-
117
- &:active {
118
- box-shadow: 0 0 0 2px ${theme.colors.tertiaryLight};
119
- }
120
- `}
121
-
122
- ${formElementHeightStyles($size)}
123
-
124
- ${$size === "big"
125
- ? `font-size: ${theme.fontSizes.buttonBig.lg};
126
- line-height: ${theme.lineHeights.buttonBig.lg};
127
- `
128
- : `font-size: ${theme.fontSizes.button.lg};
129
- line-height: ${theme.lineHeights.button.lg};`}
130
-
131
- ${disabled &&
132
- `
133
- cursor: not-allowed;
134
- background: ${theme.colors.grayLight};
135
- border-color: ${theme.colors.grayLight};
136
- color: ${theme.colors.gray};
137
- `}
138
-
139
- ${$fullWidth && `width: 100%;`}
140
- `;
141
-
142
- const StyledButton = styled.button<ButtonProps>`
143
- ${({ theme, $variant, $size, $outline, $fullWidth, disabled }) =>
144
- buttonStyles(theme, $variant, $size, $outline, $fullWidth, disabled)}
145
- `;
146
-
147
- function Button({
148
- theme = defaultTheme,
149
- $variant = "primary",
150
- ...props
151
- }: ButtonProps) {
152
- return (
153
- <StyledButton $variant={$variant} {...props} theme={theme}>
154
- {props.children}
155
- </StyledButton>
156
- );
157
- }
158
-
159
- export { Button };
1
+ "use client";
2
+ import React, { forwardRef } from "react";
3
+ import styled, { css } from "styled-components";
4
+ import { Theme, formElementHeightStyles, resetButton } from "./utils";
5
+
6
+ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
7
+ children?: React.ReactNode;
8
+ $variant?: "primary" | "secondary" | "tertiary";
9
+ $size?: "default" | "big";
10
+ $outline?: boolean;
11
+ $fullWidth?: boolean;
12
+ $icon?: React.ReactNode;
13
+ $iconPosition?: "left" | "right";
14
+ theme?: Theme;
15
+ }
16
+
17
+ export const buttonStyles = (
18
+ theme: Theme,
19
+ $variant?: "primary" | "secondary" | "tertiary",
20
+ $size?: "default" | "big",
21
+ $outline?: boolean,
22
+ $fullWidth?: boolean,
23
+ disabled?: boolean,
24
+ ) => css`
25
+ ${resetButton};
26
+ font-family: inherit;
27
+ display: inline-flex;
28
+ padding: 15px 30px;
29
+ border-radius: 100px;
30
+ font-weight: 600;
31
+ white-space: nowrap;
32
+ hyphens: auto;
33
+ color: ${theme.isDark ? theme.colors.dark : theme.colors.light};
34
+ text-decoration: none;
35
+ transition: all 0.3s ease;
36
+ text-align: center;
37
+ gap: 10px;
38
+ text-overflow: ellipsis;
39
+ justify-content: center;
40
+
41
+ & .icon,
42
+ & .lucide {
43
+ margin: auto 0;
44
+ }
45
+
46
+ ${!disabled &&
47
+ $variant === "primary" &&
48
+ css`
49
+ color: ${$outline ? theme.colors.primary : theme.colors.light};
50
+ background: ${$outline ? "transparent" : theme.colors.primary};
51
+ border: solid 2px ${theme.colors.primary};
52
+ box-shadow: 0 0 0 0px ${theme.colors.primary};
53
+
54
+ @media (hover: hover) {
55
+ &:hover {
56
+ background: ${$outline ? "transparent" : theme.colors.primaryDark};
57
+ border-color: ${theme.colors.primaryDark};
58
+ ${$outline && `color: ${theme.colors.primaryDark}`};
59
+ }
60
+ }
61
+
62
+ &:focus {
63
+ box-shadow: 0 0 0 4px ${theme.colors.primaryLight};
64
+ }
65
+
66
+ &:active {
67
+ box-shadow: 0 0 0 2px ${theme.colors.primaryLight};
68
+ }
69
+ `}
70
+
71
+ ${!disabled &&
72
+ $variant === "secondary" &&
73
+ css`
74
+ color: ${$outline ? theme.colors.secondary : theme.colors.light};
75
+ background: ${$outline ? "transparent" : theme.colors.secondary};
76
+ border: solid 2px ${theme.colors.secondary};
77
+ box-shadow: 0 0 0 0px ${theme.colors.secondary};
78
+
79
+ @media (hover: hover) {
80
+ &:hover {
81
+ background: ${$outline ? "transparent" : theme.colors.secondaryDark};
82
+ border-color: ${theme.colors.secondaryDark};
83
+ ${$outline && `color: ${theme.colors.secondaryDark}`};
84
+ }
85
+ }
86
+
87
+ &:focus {
88
+ box-shadow: 0 0 0 4px ${theme.colors.secondaryLight};
89
+ }
90
+
91
+ &:active {
92
+ box-shadow: 0 0 0 2px ${theme.colors.secondaryLight};
93
+ }
94
+ `}
95
+
96
+ ${!disabled &&
97
+ $variant === "tertiary" &&
98
+ css`
99
+ color: ${$outline ? theme.colors.tertiary : theme.colors.light};
100
+ background: ${$outline ? "transparent" : theme.colors.tertiary};
101
+ border: solid 2px ${theme.colors.tertiary};
102
+ box-shadow: 0 0 0 0px ${theme.colors.tertiary};
103
+
104
+ @media (hover: hover) {
105
+ &:hover {
106
+ background: ${$outline ? "transparent" : theme.colors.tertiaryDark};
107
+ border-color: ${theme.colors.tertiaryDark};
108
+ ${$outline && `color: ${theme.colors.tertiaryDark}`};
109
+ }
110
+ }
111
+
112
+ &:focus {
113
+ box-shadow: 0 0 0 4px ${theme.colors.tertiaryLight};
114
+ }
115
+
116
+ &:active {
117
+ box-shadow: 0 0 0 2px ${theme.colors.tertiaryLight};
118
+ }
119
+ `}
120
+
121
+ ${formElementHeightStyles($size)}
122
+
123
+ ${$size === "big"
124
+ ? `font-size: ${theme.fontSizes.buttonBig.lg};
125
+ line-height: ${theme.lineHeights.buttonBig.lg};
126
+ padding: 18px 30px;
127
+ `
128
+ : `font-size: ${theme.fontSizes.button.lg};
129
+ line-height: ${theme.lineHeights.button.lg};`}
130
+
131
+ ${disabled &&
132
+ `
133
+ cursor: not-allowed;
134
+ background: ${theme.colors.grayLight};
135
+ border: solid 2px ${theme.colors.grayLight};
136
+ color: ${theme.colors.gray};
137
+ `}
138
+
139
+ ${$fullWidth && `width: 100%;`}
140
+ `;
141
+
142
+ const StyledButton = styled.button<ButtonProps>`
143
+ ${({ theme, $variant, $size, $outline, $fullWidth, disabled }) =>
144
+ buttonStyles(theme, $variant, $size, $outline, $fullWidth, disabled)}
145
+ `;
146
+
147
+ function LocalButton(
148
+ { $variant = "primary", ...props }: ButtonProps,
149
+ ref: React.Ref<HTMLButtonElement>,
150
+ ) {
151
+ return (
152
+ <StyledButton $variant={$variant} {...props} ref={ref}>
153
+ {props.$iconPosition !== "right" && props.$icon && props.$icon}
154
+ {props.children}
155
+ {props.$iconPosition === "right" && props.$icon && props.$icon}
156
+ </StyledButton>
157
+ );
158
+ }
159
+
160
+ const Button = forwardRef(LocalButton);
161
+
162
+ export { Button };
package/src/lib/col.tsx CHANGED
@@ -1,43 +1,45 @@
1
- "use client";
2
- import React from "react";
3
- import styled from "styled-components";
4
- import { theme as defaultTheme, Theme, generateColSpanStyles } from "./utils";
5
-
6
- interface ColProps extends React.HTMLAttributes<HTMLDivElement> {
7
- children?: React.ReactNode;
8
- $span?: number;
9
- $xsSpan?: number;
10
- $smSpan?: number;
11
- $mdSpan?: number;
12
- $lgSpan?: number;
13
- $xlSpan?: number;
14
- $xxlSpan?: number;
15
- $xxxlSpan?: number;
16
- theme?: Theme;
17
- }
18
-
19
- const StyledCol = styled.div<ColProps>`
20
- ${({ $span }) =>
21
- $span &&
22
- `
23
- grid-column: span ${$span};
24
- `}
25
-
26
- ${({ $xsSpan }) => $xsSpan && generateColSpanStyles("xs", $xsSpan)}
27
- ${({ $smSpan }) => $smSpan && generateColSpanStyles("sm", $smSpan)}
28
- ${({ $mdSpan }) => $mdSpan && generateColSpanStyles("md", $mdSpan)}
29
- ${({ $lgSpan }) => $lgSpan && generateColSpanStyles("lg", $lgSpan)}
30
- ${({ $xlSpan }) => $xlSpan && generateColSpanStyles("xl", $xlSpan)}
31
- ${({ $xxlSpan }) => $xxlSpan && generateColSpanStyles("xxl", $xxlSpan)}
32
- ${({ $xxxlSpan }) => $xxxlSpan && generateColSpanStyles("xxxl", $xxxlSpan)}
33
- `;
34
-
35
- function Col({ theme = defaultTheme, ...props }: ColProps) {
36
- return (
37
- <StyledCol {...props} theme={theme}>
38
- {props.children}
39
- </StyledCol>
40
- );
41
- }
42
-
43
- export { Col };
1
+ "use client";
2
+ import React, { forwardRef } from "react";
3
+ import styled from "styled-components";
4
+ import { theme as defaultTheme, Theme, generateColSpanStyles } from "./utils";
5
+
6
+ interface ColProps extends React.HTMLAttributes<HTMLDivElement> {
7
+ children?: React.ReactNode;
8
+ $span?: number;
9
+ $xsSpan?: number;
10
+ $smSpan?: number;
11
+ $mdSpan?: number;
12
+ $lgSpan?: number;
13
+ $xlSpan?: number;
14
+ $xxlSpan?: number;
15
+ $xxxlSpan?: number;
16
+ theme?: Theme;
17
+ }
18
+
19
+ const StyledCol = styled.div<ColProps>`
20
+ ${({ $span }) =>
21
+ $span &&
22
+ `
23
+ grid-column: span ${$span};
24
+ `}
25
+
26
+ ${({ $xsSpan }) => $xsSpan && generateColSpanStyles("xs", $xsSpan)}
27
+ ${({ $smSpan }) => $smSpan && generateColSpanStyles("sm", $smSpan)}
28
+ ${({ $mdSpan }) => $mdSpan && generateColSpanStyles("md", $mdSpan)}
29
+ ${({ $lgSpan }) => $lgSpan && generateColSpanStyles("lg", $lgSpan)}
30
+ ${({ $xlSpan }) => $xlSpan && generateColSpanStyles("xl", $xlSpan)}
31
+ ${({ $xxlSpan }) => $xxlSpan && generateColSpanStyles("xxl", $xxlSpan)}
32
+ ${({ $xxxlSpan }) => $xxxlSpan && generateColSpanStyles("xxxl", $xxxlSpan)}
33
+ `;
34
+
35
+ function LocalCol({ theme = defaultTheme, ...props }: ColProps, ref: React.Ref<HTMLDivElement>) {
36
+ return (
37
+ <StyledCol {...props} theme={theme} ref={ref}>
38
+ {props.children}
39
+ </StyledCol>
40
+ );
41
+ }
42
+
43
+ const Col = forwardRef(LocalCol);
44
+
45
+ export { Col };