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
@@ -1,204 +1,204 @@
1
- "use client";
2
- import { css } from "styled-components";
3
- import { Theme, mq } from "./theme";
4
-
5
- const styledHero1 = (theme: Theme) => css`
6
- font-size: ${theme.fontSizes.hero1.xs};
7
- line-height: ${theme.lineHeights.hero1.xs};
8
-
9
- ${mq("lg")} {
10
- font-size: ${theme.fontSizes.hero1.lg};
11
- line-height: ${theme.lineHeights.hero1.lg};
12
- }
13
- `;
14
-
15
- const styledHero2 = (theme: Theme) => css`
16
- font-size: ${theme.fontSizes.hero2.xs};
17
- line-height: ${theme.lineHeights.hero2.xs};
18
-
19
- ${mq("lg")} {
20
- font-size: ${theme.fontSizes.hero2.lg};
21
- line-height: ${theme.lineHeights.hero2.lg};
22
- }
23
- `;
24
-
25
- const styledHero3 = (theme: Theme) => css`
26
- font-size: ${theme.fontSizes.hero3.xs};
27
- line-height: ${theme.lineHeights.hero3.xs};
28
-
29
- ${mq("lg")} {
30
- font-size: ${theme.fontSizes.hero3.lg};
31
- line-height: ${theme.lineHeights.hero3.lg};
32
- }
33
- `;
34
-
35
- const styledH1 = (theme: Theme) => css`
36
- font-size: ${theme.fontSizes.h1.xs};
37
- line-height: ${theme.lineHeights.h1.xs};
38
-
39
- ${mq("lg")} {
40
- font-size: ${theme.fontSizes.h1.lg};
41
- line-height: ${theme.lineHeights.h1.lg};
42
- }
43
- `;
44
-
45
- const styledH2 = (theme: Theme) => css`
46
- font-size: ${theme.fontSizes.h2.xs};
47
- line-height: ${theme.lineHeights.h2.xs};
48
-
49
- ${mq("lg")} {
50
- font-size: ${theme.fontSizes.h2.lg};
51
- line-height: ${theme.lineHeights.h2.lg};
52
- }
53
- `;
54
-
55
- const styledH3 = (theme: Theme) => css`
56
- font-size: ${theme.fontSizes.h3.xs};
57
- line-height: ${theme.lineHeights.h3.xs};
58
-
59
- ${mq("lg")} {
60
- font-size: ${theme.fontSizes.h3.lg};
61
- line-height: ${theme.lineHeights.h3.lg};
62
- }
63
- `;
64
-
65
- const styledH4 = (theme: Theme) => css`
66
- font-size: ${theme.fontSizes.h4.xs};
67
- line-height: ${theme.lineHeights.h4.xs};
68
-
69
- ${mq("lg")} {
70
- font-size: ${theme.fontSizes.h4.lg};
71
- line-height: ${theme.lineHeights.h4.lg};
72
- }
73
- `;
74
-
75
- const styledH5 = (theme: Theme) => css`
76
- font-size: ${theme.fontSizes.h5.xs};
77
- line-height: ${theme.lineHeights.h5.xs};
78
-
79
- ${mq("lg")} {
80
- font-size: ${theme.fontSizes.h5.lg};
81
- line-height: ${theme.lineHeights.h5.lg};
82
- }
83
- `;
84
-
85
- const styledH6 = (theme: Theme) => css`
86
- font-size: ${theme.fontSizes.h6.xs};
87
- line-height: ${theme.lineHeights.h6.xs};
88
-
89
- ${mq("lg")} {
90
- font-size: ${theme.fontSizes.h6.lg};
91
- line-height: ${theme.lineHeights.h6.lg};
92
- }
93
- `;
94
-
95
- const styledText = (theme: Theme) => css`
96
- font-size: ${theme.fontSizes.text.xs};
97
- line-height: ${theme.lineHeights.text.xs};
98
-
99
- ${mq("lg")} {
100
- font-size: ${theme.fontSizes.text.lg};
101
- line-height: ${theme.lineHeights.text.lg};
102
- }
103
- `;
104
-
105
- const styledStrong = (theme: Theme) => css`
106
- font-size: ${theme.fontSizes.strong.xs};
107
- line-height: ${theme.lineHeights.strong.xs};
108
-
109
- ${mq("lg")} {
110
- font-size: ${theme.fontSizes.strong.lg};
111
- line-height: ${theme.lineHeights.strong.lg};
112
- }
113
- `;
114
-
115
- const styledSmall = (theme: Theme) => css`
116
- font-size: ${theme.fontSizes.small.xs};
117
- line-height: ${theme.lineHeights.small.xs};
118
-
119
- ${mq("lg")} {
120
- font-size: ${theme.fontSizes.small.lg};
121
- line-height: ${theme.lineHeights.small.lg};
122
- }
123
- `;
124
-
125
- const styledBlockquote = (theme: Theme) => css`
126
- font-size: ${theme.fontSizes.blockquote.xs};
127
- line-height: ${theme.lineHeights.blockquote.xs};
128
-
129
- ${mq("lg")} {
130
- font-size: ${theme.fontSizes.blockquote.lg};
131
- line-height: ${theme.lineHeights.blockquote.lg};
132
- }
133
- `;
134
-
135
- const styledCode = (theme: Theme) => css`
136
- font-size: ${theme.fontSizes.code.xs};
137
- line-height: ${theme.lineHeights.code.xs};
138
-
139
- ${mq("lg")} {
140
- font-size: ${theme.fontSizes.code.lg};
141
- line-height: ${theme.lineHeights.code.lg};
142
- }
143
- `;
144
-
145
- const styledButton = (theme: Theme) => css`
146
- font-size: ${theme.fontSizes.button.xs};
147
- line-height: ${theme.lineHeights.button.xs};
148
-
149
- ${mq("lg")} {
150
- font-size: ${theme.fontSizes.button.lg};
151
- line-height: ${theme.lineHeights.button.lg};
152
- }
153
- `;
154
-
155
- const styledButtonBig = (theme: Theme) => css`
156
- font-size: ${theme.fontSizes.buttonBig.xs};
157
- line-height: ${theme.lineHeights.buttonBig.xs};
158
-
159
- ${mq("lg")} {
160
- font-size: ${theme.fontSizes.buttonBig.lg};
161
- line-height: ${theme.lineHeights.buttonBig.lg};
162
- }
163
- `;
164
-
165
- const styledInput = (theme: Theme) => css`
166
- font-size: ${theme.fontSizes.input.xs};
167
- line-height: ${theme.lineHeights.input.xs};
168
-
169
- ${mq("lg")} {
170
- font-size: ${theme.fontSizes.input.lg};
171
- line-height: ${theme.lineHeights.input.lg};
172
- }
173
- `;
174
-
175
- const styledInputBig = (theme: Theme) => css`
176
- font-size: ${theme.fontSizes.inputBig.xs};
177
- line-height: ${theme.lineHeights.inputBig.xs};
178
-
179
- ${mq("lg")} {
180
- font-size: ${theme.fontSizes.inputBig.lg};
181
- line-height: ${theme.lineHeights.inputBig.lg};
182
- }
183
- `;
184
-
185
- export {
186
- styledHero1,
187
- styledHero2,
188
- styledHero3,
189
- styledH1,
190
- styledH2,
191
- styledH3,
192
- styledH4,
193
- styledH5,
194
- styledH6,
195
- styledText,
196
- styledStrong,
197
- styledSmall,
198
- styledBlockquote,
199
- styledCode,
200
- styledButton,
201
- styledButtonBig,
202
- styledInput,
203
- styledInputBig,
204
- };
1
+ "use client";
2
+ import { css } from "styled-components";
3
+ import { Theme, mq } from "./theme";
4
+
5
+ const styledHero1 = (theme: Theme) => css`
6
+ font-size: ${theme.fontSizes.hero1.xs};
7
+ line-height: ${theme.lineHeights.hero1.xs};
8
+
9
+ ${mq("lg")} {
10
+ font-size: ${theme.fontSizes.hero1.lg};
11
+ line-height: ${theme.lineHeights.hero1.lg};
12
+ }
13
+ `;
14
+
15
+ const styledHero2 = (theme: Theme) => css`
16
+ font-size: ${theme.fontSizes.hero2.xs};
17
+ line-height: ${theme.lineHeights.hero2.xs};
18
+
19
+ ${mq("lg")} {
20
+ font-size: ${theme.fontSizes.hero2.lg};
21
+ line-height: ${theme.lineHeights.hero2.lg};
22
+ }
23
+ `;
24
+
25
+ const styledHero3 = (theme: Theme) => css`
26
+ font-size: ${theme.fontSizes.hero3.xs};
27
+ line-height: ${theme.lineHeights.hero3.xs};
28
+
29
+ ${mq("lg")} {
30
+ font-size: ${theme.fontSizes.hero3.lg};
31
+ line-height: ${theme.lineHeights.hero3.lg};
32
+ }
33
+ `;
34
+
35
+ const styledH1 = (theme: Theme) => css`
36
+ font-size: ${theme.fontSizes.h1.xs};
37
+ line-height: ${theme.lineHeights.h1.xs};
38
+
39
+ ${mq("lg")} {
40
+ font-size: ${theme.fontSizes.h1.lg};
41
+ line-height: ${theme.lineHeights.h1.lg};
42
+ }
43
+ `;
44
+
45
+ const styledH2 = (theme: Theme) => css`
46
+ font-size: ${theme.fontSizes.h2.xs};
47
+ line-height: ${theme.lineHeights.h2.xs};
48
+
49
+ ${mq("lg")} {
50
+ font-size: ${theme.fontSizes.h2.lg};
51
+ line-height: ${theme.lineHeights.h2.lg};
52
+ }
53
+ `;
54
+
55
+ const styledH3 = (theme: Theme) => css`
56
+ font-size: ${theme.fontSizes.h3.xs};
57
+ line-height: ${theme.lineHeights.h3.xs};
58
+
59
+ ${mq("lg")} {
60
+ font-size: ${theme.fontSizes.h3.lg};
61
+ line-height: ${theme.lineHeights.h3.lg};
62
+ }
63
+ `;
64
+
65
+ const styledH4 = (theme: Theme) => css`
66
+ font-size: ${theme.fontSizes.h4.xs};
67
+ line-height: ${theme.lineHeights.h4.xs};
68
+
69
+ ${mq("lg")} {
70
+ font-size: ${theme.fontSizes.h4.lg};
71
+ line-height: ${theme.lineHeights.h4.lg};
72
+ }
73
+ `;
74
+
75
+ const styledH5 = (theme: Theme) => css`
76
+ font-size: ${theme.fontSizes.h5.xs};
77
+ line-height: ${theme.lineHeights.h5.xs};
78
+
79
+ ${mq("lg")} {
80
+ font-size: ${theme.fontSizes.h5.lg};
81
+ line-height: ${theme.lineHeights.h5.lg};
82
+ }
83
+ `;
84
+
85
+ const styledH6 = (theme: Theme) => css`
86
+ font-size: ${theme.fontSizes.h6.xs};
87
+ line-height: ${theme.lineHeights.h6.xs};
88
+
89
+ ${mq("lg")} {
90
+ font-size: ${theme.fontSizes.h6.lg};
91
+ line-height: ${theme.lineHeights.h6.lg};
92
+ }
93
+ `;
94
+
95
+ const styledText = (theme: Theme) => css`
96
+ font-size: ${theme.fontSizes.text.xs};
97
+ line-height: ${theme.lineHeights.text.xs};
98
+
99
+ ${mq("lg")} {
100
+ font-size: ${theme.fontSizes.text.lg};
101
+ line-height: ${theme.lineHeights.text.lg};
102
+ }
103
+ `;
104
+
105
+ const styledStrong = (theme: Theme) => css`
106
+ font-size: ${theme.fontSizes.strong.xs};
107
+ line-height: ${theme.lineHeights.strong.xs};
108
+
109
+ ${mq("lg")} {
110
+ font-size: ${theme.fontSizes.strong.lg};
111
+ line-height: ${theme.lineHeights.strong.lg};
112
+ }
113
+ `;
114
+
115
+ const styledSmall = (theme: Theme) => css`
116
+ font-size: ${theme.fontSizes.small.xs};
117
+ line-height: ${theme.lineHeights.small.xs};
118
+
119
+ ${mq("lg")} {
120
+ font-size: ${theme.fontSizes.small.lg};
121
+ line-height: ${theme.lineHeights.small.lg};
122
+ }
123
+ `;
124
+
125
+ const styledBlockquote = (theme: Theme) => css`
126
+ font-size: ${theme.fontSizes.blockquote.xs};
127
+ line-height: ${theme.lineHeights.blockquote.xs};
128
+
129
+ ${mq("lg")} {
130
+ font-size: ${theme.fontSizes.blockquote.lg};
131
+ line-height: ${theme.lineHeights.blockquote.lg};
132
+ }
133
+ `;
134
+
135
+ const styledCode = (theme: Theme) => css`
136
+ font-size: ${theme.fontSizes.code.xs};
137
+ line-height: ${theme.lineHeights.code.xs};
138
+
139
+ ${mq("lg")} {
140
+ font-size: ${theme.fontSizes.code.lg};
141
+ line-height: ${theme.lineHeights.code.lg};
142
+ }
143
+ `;
144
+
145
+ const styledButton = (theme: Theme) => css`
146
+ font-size: ${theme.fontSizes.button.xs};
147
+ line-height: ${theme.lineHeights.button.xs};
148
+
149
+ ${mq("lg")} {
150
+ font-size: ${theme.fontSizes.button.lg};
151
+ line-height: ${theme.lineHeights.button.lg};
152
+ }
153
+ `;
154
+
155
+ const styledButtonBig = (theme: Theme) => css`
156
+ font-size: ${theme.fontSizes.buttonBig.xs};
157
+ line-height: ${theme.lineHeights.buttonBig.xs};
158
+
159
+ ${mq("lg")} {
160
+ font-size: ${theme.fontSizes.buttonBig.lg};
161
+ line-height: ${theme.lineHeights.buttonBig.lg};
162
+ }
163
+ `;
164
+
165
+ const styledInput = (theme: Theme) => css`
166
+ font-size: ${theme.fontSizes.input.xs};
167
+ line-height: ${theme.lineHeights.input.xs};
168
+
169
+ ${mq("lg")} {
170
+ font-size: ${theme.fontSizes.input.lg};
171
+ line-height: ${theme.lineHeights.input.lg};
172
+ }
173
+ `;
174
+
175
+ const styledInputBig = (theme: Theme) => css`
176
+ font-size: ${theme.fontSizes.inputBig.xs};
177
+ line-height: ${theme.lineHeights.inputBig.xs};
178
+
179
+ ${mq("lg")} {
180
+ font-size: ${theme.fontSizes.inputBig.lg};
181
+ line-height: ${theme.lineHeights.inputBig.lg};
182
+ }
183
+ `;
184
+
185
+ export {
186
+ styledHero1,
187
+ styledHero2,
188
+ styledHero3,
189
+ styledH1,
190
+ styledH2,
191
+ styledH3,
192
+ styledH4,
193
+ styledH5,
194
+ styledH6,
195
+ styledText,
196
+ styledStrong,
197
+ styledSmall,
198
+ styledBlockquote,
199
+ styledCode,
200
+ styledButton,
201
+ styledButtonBig,
202
+ styledInput,
203
+ styledInputBig,
204
+ };
package/src/main.tsx CHANGED
@@ -1,14 +1,14 @@
1
- import React from "react";
2
- import ReactDOM from "react-dom/client";
3
- import { CherryThemeProvider, StyledComponentsRegistry } from "./lib/index.js";
4
- import App from "./App";
5
-
6
- ReactDOM.createRoot(document.getElementById("root")!).render(
7
- <React.StrictMode>
8
- <StyledComponentsRegistry>
9
- <CherryThemeProvider>
10
- <App />
11
- </CherryThemeProvider>
12
- </StyledComponentsRegistry>
13
- </React.StrictMode>,
14
- );
1
+ import React from "react";
2
+ import ReactDOM from "react-dom/client";
3
+ import { CherryThemeProvider, StyledComponentsRegistry, theme, themeDark } from "./lib/index.js";
4
+ import App from "./App";
5
+
6
+ ReactDOM.createRoot(document.getElementById("root")!).render(
7
+ <React.StrictMode>
8
+ <StyledComponentsRegistry>
9
+ <CherryThemeProvider theme={theme} themeDark={themeDark}>
10
+ <App />
11
+ </CherryThemeProvider>
12
+ </StyledComponentsRegistry>
13
+ </React.StrictMode>,
14
+ );
@@ -0,0 +1,25 @@
1
+ import React, { useContext } from "react";
2
+ import { useTheme } from "styled-components";
3
+ import { theme as themeLight, themeDark, ThemeContext, Toggle } from "./lib";
4
+
5
+ function ToggleTheme() {
6
+ const theme = useTheme();
7
+ const { setTheme } = useContext(ThemeContext);
8
+
9
+ return (
10
+ <Toggle
11
+ $label="Toggle Theme"
12
+ onChange={() => {
13
+ if (theme.isDark) {
14
+ setTheme(themeLight);
15
+ localStorage.theme = "light";
16
+ } else {
17
+ setTheme(themeDark);
18
+ localStorage.theme = "dark";
19
+ }
20
+ }}
21
+ />
22
+ );
23
+ }
24
+
25
+ export { ToggleTheme };
package/src/vite-env.d.ts CHANGED
@@ -1 +1,8 @@
1
- /// <reference types="vite/client" />
1
+ /// <reference types="vite/client" />
2
+
3
+ import "styled-components";
4
+ import { Theme } from "./lib/utils/theme";
5
+
6
+ declare module "styled-components" {
7
+ export interface DefaultTheme extends Theme {}
8
+ }