@react-cupertino-ui/shared 0.0.0

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 (34) hide show
  1. package/LICENSE +24 -0
  2. package/dist/index.d.ts +9 -0
  3. package/dist/index.js +9 -0
  4. package/dist/lib/constants/animations.d.ts +26 -0
  5. package/dist/lib/constants/animations.js +24 -0
  6. package/dist/lib/constants/themes/dartk.d.ts +55 -0
  7. package/dist/lib/constants/themes/dartk.js +27 -0
  8. package/dist/lib/constants/themes/index.d.ts +271 -0
  9. package/dist/lib/constants/themes/index.js +29 -0
  10. package/dist/lib/constants/themes/lemon.d.ts +55 -0
  11. package/dist/lib/constants/themes/lemon.js +27 -0
  12. package/dist/lib/constants/themes/light.d.ts +49 -0
  13. package/dist/lib/constants/themes/light.js +25 -0
  14. package/dist/lib/constants/tokens/breakpoints/index.d.ts +8 -0
  15. package/dist/lib/constants/tokens/breakpoints/index.js +7 -0
  16. package/dist/lib/constants/tokens/colors/dark-colors.d.ts +19 -0
  17. package/dist/lib/constants/tokens/colors/dark-colors.js +18 -0
  18. package/dist/lib/constants/tokens/colors/index.d.ts +3 -0
  19. package/dist/lib/constants/tokens/colors/index.js +3 -0
  20. package/dist/lib/constants/tokens/colors/lemon-colors.d.ts +19 -0
  21. package/dist/lib/constants/tokens/colors/lemon-colors.js +18 -0
  22. package/dist/lib/constants/tokens/colors/light-colors.d.ts +19 -0
  23. package/dist/lib/constants/tokens/colors/light-colors.js +18 -0
  24. package/dist/lib/constants/tokens/glass/index.d.ts +37 -0
  25. package/dist/lib/constants/tokens/glass/index.js +36 -0
  26. package/dist/lib/constants/tokens/size/index.d.ts +8 -0
  27. package/dist/lib/constants/tokens/size/index.js +7 -0
  28. package/dist/lib/constants/tokens/spacing/index.d.ts +24 -0
  29. package/dist/lib/constants/tokens/spacing/index.js +23 -0
  30. package/dist/lib/interfaces/BaseProps.d.ts +27 -0
  31. package/dist/lib/interfaces/BaseProps.js +36 -0
  32. package/dist/lib/utils.d.ts +2 -0
  33. package/dist/lib/utils.js +5 -0
  34. package/package.json +31 -0
package/LICENSE ADDED
@@ -0,0 +1,24 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Anderson Lima
4
+
5
+ This project is inspired by Apple's design principles but is not affiliated with, endorsed, or sponsored by Apple Inc.
6
+
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ of this software and associated documentation files (the "Software"), to deal
10
+ in the Software without restriction, including without limitation the rights
11
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ copies of the Software, and to permit persons to whom the Software is
13
+ furnished to do so, subject to the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in all
16
+ copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ SOFTWARE.
@@ -0,0 +1,9 @@
1
+ export * from "./lib/interfaces/BaseProps";
2
+ export * from "./lib/utils";
3
+ export * from "./lib/constants/animations";
4
+ export * from "./lib/constants/themes";
5
+ export * from "./lib/constants/tokens/glass";
6
+ export * from "./lib/constants/tokens/colors";
7
+ export * from "./lib/constants/tokens/spacing";
8
+ export * from "./lib/constants/tokens/size";
9
+ export * from "./lib/constants/tokens/breakpoints";
package/dist/index.js ADDED
@@ -0,0 +1,9 @@
1
+ export * from "./lib/interfaces/BaseProps";
2
+ export * from "./lib/utils";
3
+ export * from "./lib/constants/animations";
4
+ export * from "./lib/constants/themes";
5
+ export * from "./lib/constants/tokens/glass";
6
+ export * from "./lib/constants/tokens/colors";
7
+ export * from "./lib/constants/tokens/spacing";
8
+ export * from "./lib/constants/tokens/size";
9
+ export * from "./lib/constants/tokens/breakpoints";
@@ -0,0 +1,26 @@
1
+ export declare const springConfig: {
2
+ readonly gentle: {
3
+ readonly tension: 120;
4
+ readonly friction: 14;
5
+ };
6
+ readonly wobbly: {
7
+ readonly tension: 180;
8
+ readonly friction: 12;
9
+ };
10
+ readonly stiff: {
11
+ readonly tension: 210;
12
+ readonly friction: 20;
13
+ };
14
+ readonly slow: {
15
+ readonly tension: 280;
16
+ readonly friction: 60;
17
+ };
18
+ };
19
+ export declare const transitions: {
20
+ readonly fast: "150ms cubic-bezier(0.25, 0.1, 0.25, 1)";
21
+ readonly normal: "250ms cubic-bezier(0.25, 0.1, 0.25, 1)";
22
+ readonly slow: "400ms cubic-bezier(0.25, 0.1, 0.25, 1)";
23
+ readonly spring: "500ms cubic-bezier(0.175, 0.885, 0.32, 1.275)";
24
+ };
25
+ export type SpringPreset = keyof typeof springConfig;
26
+ export type TransitionPreset = keyof typeof transitions;
@@ -0,0 +1,24 @@
1
+ export const springConfig = {
2
+ gentle: {
3
+ tension: 120,
4
+ friction: 14,
5
+ },
6
+ wobbly: {
7
+ tension: 180,
8
+ friction: 12,
9
+ },
10
+ stiff: {
11
+ tension: 210,
12
+ friction: 20,
13
+ },
14
+ slow: {
15
+ tension: 280,
16
+ friction: 60,
17
+ },
18
+ };
19
+ export const transitions = {
20
+ fast: "150ms cubic-bezier(0.25, 0.1, 0.25, 1)",
21
+ normal: "250ms cubic-bezier(0.25, 0.1, 0.25, 1)",
22
+ slow: "400ms cubic-bezier(0.25, 0.1, 0.25, 1)",
23
+ spring: "500ms cubic-bezier(0.175, 0.885, 0.32, 1.275)",
24
+ };
@@ -0,0 +1,55 @@
1
+ export declare const darkTheme: {
2
+ colors: {
3
+ "--background": string;
4
+ "--foreground": string;
5
+ "--card": string;
6
+ "--card-foreground": string;
7
+ "--popover": string;
8
+ "--popover-foreground": string;
9
+ "--primary": string;
10
+ "--primary-foreground": string;
11
+ "--secondary": string;
12
+ "--secondary-foreground": string;
13
+ "--muted": string;
14
+ "--muted-foreground": string;
15
+ "--accent": string;
16
+ "--accent-foreground": string;
17
+ "--destructive": string;
18
+ "--destructive-foreground": string;
19
+ };
20
+ spacing: {
21
+ stack: {
22
+ xxxs: string;
23
+ xxs: string;
24
+ xs: string;
25
+ sm: string;
26
+ md: string;
27
+ lg: string;
28
+ xlg: string;
29
+ xxlg: string;
30
+ };
31
+ inline: {
32
+ xxxs: string;
33
+ xxs: string;
34
+ xs: string;
35
+ sm: string;
36
+ md: string;
37
+ lg: string;
38
+ xlg: string;
39
+ xxlg: string;
40
+ };
41
+ };
42
+ size: {
43
+ default: string;
44
+ sm: string;
45
+ lg: string;
46
+ icon: string;
47
+ };
48
+ breakpoints: {
49
+ mobile: string;
50
+ tablet: string;
51
+ desktop: string;
52
+ largeDesktop: string;
53
+ };
54
+ };
55
+ export type DarkTheme = typeof darkTheme;
@@ -0,0 +1,27 @@
1
+ import breakpoints from "../tokens/breakpoints";
2
+ import { darkColors as colors } from "../tokens/colors";
3
+ import sizeTokens from "../tokens/size";
4
+ import spacingTokens from "../tokens/spacing";
5
+ export const darkTheme = {
6
+ colors: {
7
+ "--background": colors.foreground,
8
+ "--foreground": colors.background,
9
+ "--card": colors.foreground,
10
+ "--card-foreground": colors.background,
11
+ "--popover": colors.foreground,
12
+ "--popover-foreground": colors.background,
13
+ "--primary": colors.primaryForeground,
14
+ "--primary-foreground": colors.primary,
15
+ "--secondary": colors.secondaryForeground,
16
+ "--secondary-foreground": colors.secondary,
17
+ "--muted": colors.mutedForeground,
18
+ "--muted-foreground": colors.muted,
19
+ "--accent": colors.accentForeground,
20
+ "--accent-foreground": colors.accent,
21
+ "--destructive": colors.destructive,
22
+ "--destructive-foreground": colors.destructiveForeground,
23
+ },
24
+ spacing: spacingTokens,
25
+ size: sizeTokens,
26
+ breakpoints,
27
+ };
@@ -0,0 +1,271 @@
1
+ export declare const themes: {
2
+ dark: {
3
+ colors: {
4
+ background: string;
5
+ foreground: string;
6
+ card: string;
7
+ cardForeground: string;
8
+ popover: string;
9
+ popoverForeground: string;
10
+ primary: string;
11
+ primaryForeground: string;
12
+ secondary: string;
13
+ secondaryForeground: string;
14
+ muted: string;
15
+ mutedForeground: string;
16
+ accent: string;
17
+ accentForeground: string;
18
+ destructive: string;
19
+ destructiveForeground: string;
20
+ };
21
+ glass: {
22
+ blur: {
23
+ sm: string;
24
+ md: string;
25
+ lg: string;
26
+ };
27
+ saturation: string;
28
+ opacity: {
29
+ surface: number;
30
+ hover: number;
31
+ pressed: number;
32
+ dark: number;
33
+ };
34
+ surface: {
35
+ light: string;
36
+ hover: string;
37
+ strong: string;
38
+ dark: string;
39
+ };
40
+ border: {
41
+ light: string;
42
+ dark: string;
43
+ };
44
+ shadow: {
45
+ light: string;
46
+ dark: string;
47
+ };
48
+ refraction: string;
49
+ glow: string;
50
+ press: {
51
+ duration: string;
52
+ scale: number;
53
+ rebound: number;
54
+ };
55
+ };
56
+ spacing: {
57
+ stack: {
58
+ xxxs: string;
59
+ xxs: string;
60
+ xs: string;
61
+ sm: string;
62
+ md: string;
63
+ lg: string;
64
+ xlg: string;
65
+ xxlg: string;
66
+ };
67
+ inline: {
68
+ xxxs: string;
69
+ xxs: string;
70
+ xs: string;
71
+ sm: string;
72
+ md: string;
73
+ lg: string;
74
+ xlg: string;
75
+ xxlg: string;
76
+ };
77
+ };
78
+ size: {
79
+ default: string;
80
+ sm: string;
81
+ lg: string;
82
+ icon: string;
83
+ };
84
+ breakpoints: {
85
+ mobile: string;
86
+ tablet: string;
87
+ desktop: string;
88
+ largeDesktop: string;
89
+ };
90
+ };
91
+ light: {
92
+ colors: {
93
+ background: string;
94
+ foreground: string;
95
+ card: string;
96
+ cardForeground: string;
97
+ popover: string;
98
+ popoverForeground: string;
99
+ primary: string;
100
+ primaryForeground: string;
101
+ secondary: string;
102
+ secondaryForeground: string;
103
+ muted: string;
104
+ mutedForeground: string;
105
+ accent: string;
106
+ accentForeground: string;
107
+ destructive: string;
108
+ destructiveForeground: string;
109
+ };
110
+ glass: {
111
+ blur: {
112
+ sm: string;
113
+ md: string;
114
+ lg: string;
115
+ };
116
+ saturation: string;
117
+ opacity: {
118
+ surface: number;
119
+ hover: number;
120
+ pressed: number;
121
+ dark: number;
122
+ };
123
+ surface: {
124
+ light: string;
125
+ hover: string;
126
+ strong: string;
127
+ dark: string;
128
+ };
129
+ border: {
130
+ light: string;
131
+ dark: string;
132
+ };
133
+ shadow: {
134
+ light: string;
135
+ dark: string;
136
+ };
137
+ refraction: string;
138
+ glow: string;
139
+ press: {
140
+ duration: string;
141
+ scale: number;
142
+ rebound: number;
143
+ };
144
+ };
145
+ spacing: {
146
+ stack: {
147
+ xxxs: string;
148
+ xxs: string;
149
+ xs: string;
150
+ sm: string;
151
+ md: string;
152
+ lg: string;
153
+ xlg: string;
154
+ xxlg: string;
155
+ };
156
+ inline: {
157
+ xxxs: string;
158
+ xxs: string;
159
+ xs: string;
160
+ sm: string;
161
+ md: string;
162
+ lg: string;
163
+ xlg: string;
164
+ xxlg: string;
165
+ };
166
+ };
167
+ size: {
168
+ default: string;
169
+ sm: string;
170
+ lg: string;
171
+ icon: string;
172
+ };
173
+ breakpoints: {
174
+ mobile: string;
175
+ tablet: string;
176
+ desktop: string;
177
+ largeDesktop: string;
178
+ };
179
+ };
180
+ lemon: {
181
+ colors: {
182
+ background: string;
183
+ foreground: string;
184
+ card: string;
185
+ cardForeground: string;
186
+ popover: string;
187
+ popoverForeground: string;
188
+ primary: string;
189
+ primaryForeground: string;
190
+ secondary: string;
191
+ secondaryForeground: string;
192
+ muted: string;
193
+ mutedForeground: string;
194
+ accent: string;
195
+ accentForeground: string;
196
+ destructive: string;
197
+ destructiveForeground: string;
198
+ };
199
+ glass: {
200
+ blur: {
201
+ sm: string;
202
+ md: string;
203
+ lg: string;
204
+ };
205
+ saturation: string;
206
+ opacity: {
207
+ surface: number;
208
+ hover: number;
209
+ pressed: number;
210
+ dark: number;
211
+ };
212
+ surface: {
213
+ light: string;
214
+ hover: string;
215
+ strong: string;
216
+ dark: string;
217
+ };
218
+ border: {
219
+ light: string;
220
+ dark: string;
221
+ };
222
+ shadow: {
223
+ light: string;
224
+ dark: string;
225
+ };
226
+ refraction: string;
227
+ glow: string;
228
+ press: {
229
+ duration: string;
230
+ scale: number;
231
+ rebound: number;
232
+ };
233
+ };
234
+ spacing: {
235
+ stack: {
236
+ xxxs: string;
237
+ xxs: string;
238
+ xs: string;
239
+ sm: string;
240
+ md: string;
241
+ lg: string;
242
+ xlg: string;
243
+ xxlg: string;
244
+ };
245
+ inline: {
246
+ xxxs: string;
247
+ xxs: string;
248
+ xs: string;
249
+ sm: string;
250
+ md: string;
251
+ lg: string;
252
+ xlg: string;
253
+ xxlg: string;
254
+ };
255
+ };
256
+ size: {
257
+ default: string;
258
+ sm: string;
259
+ lg: string;
260
+ icon: string;
261
+ };
262
+ breakpoints: {
263
+ mobile: string;
264
+ tablet: string;
265
+ desktop: string;
266
+ largeDesktop: string;
267
+ };
268
+ };
269
+ };
270
+ export default themes;
271
+ export type ThemeTypes = typeof themes;
@@ -0,0 +1,29 @@
1
+ import breakpoints from "../tokens/breakpoints";
2
+ import { darkColors, lightColors, lemonColors } from "../tokens/colors";
3
+ import glassTokens from "../tokens/glass";
4
+ import sizeTokens from "../tokens/size";
5
+ import spacingTokens from "../tokens/spacing";
6
+ export const themes = {
7
+ dark: {
8
+ colors: darkColors,
9
+ glass: glassTokens,
10
+ spacing: spacingTokens,
11
+ size: sizeTokens,
12
+ breakpoints,
13
+ },
14
+ light: {
15
+ colors: lightColors,
16
+ glass: glassTokens,
17
+ spacing: spacingTokens,
18
+ size: sizeTokens,
19
+ breakpoints,
20
+ },
21
+ lemon: {
22
+ colors: lemonColors,
23
+ glass: glassTokens,
24
+ spacing: spacingTokens,
25
+ size: sizeTokens,
26
+ breakpoints,
27
+ },
28
+ };
29
+ export default themes;
@@ -0,0 +1,55 @@
1
+ export declare const lemonTheme: {
2
+ colors: {
3
+ "--background": string;
4
+ "--foreground": string;
5
+ "--card": string;
6
+ "--card-foreground": string;
7
+ "--popover": string;
8
+ "--popover-foreground": string;
9
+ "--primary": string;
10
+ "--primary-foreground": string;
11
+ "--secondary": string;
12
+ "--secondary-foreground": string;
13
+ "--muted": string;
14
+ "--muted-foreground": string;
15
+ "--accent": string;
16
+ "--accent-foreground": string;
17
+ "--destructive": string;
18
+ "--destructive-foreground": string;
19
+ };
20
+ spacing: {
21
+ stack: {
22
+ xxxs: string;
23
+ xxs: string;
24
+ xs: string;
25
+ sm: string;
26
+ md: string;
27
+ lg: string;
28
+ xlg: string;
29
+ xxlg: string;
30
+ };
31
+ inline: {
32
+ xxxs: string;
33
+ xxs: string;
34
+ xs: string;
35
+ sm: string;
36
+ md: string;
37
+ lg: string;
38
+ xlg: string;
39
+ xxlg: string;
40
+ };
41
+ };
42
+ size: {
43
+ default: string;
44
+ sm: string;
45
+ lg: string;
46
+ icon: string;
47
+ };
48
+ breakpoints: {
49
+ mobile: string;
50
+ tablet: string;
51
+ desktop: string;
52
+ largeDesktop: string;
53
+ };
54
+ };
55
+ export type LemonTheme = typeof lemonTheme;
@@ -0,0 +1,27 @@
1
+ import breakpoints from "../tokens/breakpoints";
2
+ import { darkColors as colors } from "../tokens/colors";
3
+ import sizeTokens from "../tokens/size";
4
+ import spacingTokens from "../tokens/spacing";
5
+ export const lemonTheme = {
6
+ colors: {
7
+ "--background": colors.foreground,
8
+ "--foreground": colors.background,
9
+ "--card": colors.foreground,
10
+ "--card-foreground": colors.background,
11
+ "--popover": colors.foreground,
12
+ "--popover-foreground": colors.background,
13
+ "--primary": colors.primaryForeground,
14
+ "--primary-foreground": colors.primary,
15
+ "--secondary": colors.secondaryForeground,
16
+ "--secondary-foreground": colors.secondary,
17
+ "--muted": colors.mutedForeground,
18
+ "--muted-foreground": colors.muted,
19
+ "--accent": colors.accentForeground,
20
+ "--accent-foreground": colors.accent,
21
+ "--destructive": colors.destructive,
22
+ "--destructive-foreground": colors.destructiveForeground,
23
+ },
24
+ spacing: spacingTokens,
25
+ size: sizeTokens,
26
+ breakpoints,
27
+ };
@@ -0,0 +1,49 @@
1
+ export declare const lightTheme: {
2
+ colors: {
3
+ "--background": string;
4
+ "--foreground": string;
5
+ "--card": string;
6
+ "--card-foreground": string;
7
+ "--popover": string;
8
+ "--popover-foreground": string;
9
+ "--primary": string;
10
+ "--primary-foreground": string;
11
+ "--secondary": string;
12
+ "--secondary-foreground": string;
13
+ "--muted": string;
14
+ "--muted-foreground": string;
15
+ "--accent": string;
16
+ "--accent-foreground": string;
17
+ "--destructive": string;
18
+ "--destructive-foreground": string;
19
+ };
20
+ spacing: {
21
+ stack: {
22
+ xxxs: string;
23
+ xxs: string;
24
+ xs: string;
25
+ sm: string;
26
+ md: string;
27
+ lg: string;
28
+ xlg: string;
29
+ xxlg: string;
30
+ };
31
+ inline: {
32
+ xxxs: string;
33
+ xxs: string;
34
+ xs: string;
35
+ sm: string;
36
+ md: string;
37
+ lg: string;
38
+ xlg: string;
39
+ xxlg: string;
40
+ };
41
+ };
42
+ size: {
43
+ default: string;
44
+ sm: string;
45
+ lg: string;
46
+ icon: string;
47
+ };
48
+ };
49
+ export type LightTheme = typeof lightTheme;
@@ -0,0 +1,25 @@
1
+ import { lightColors as colors } from "../tokens/colors";
2
+ import sizeTokens from "../tokens/size";
3
+ import spacingTokens from "../tokens/spacing";
4
+ export const lightTheme = {
5
+ colors: {
6
+ "--background": colors.foreground,
7
+ "--foreground": colors.background,
8
+ "--card": colors.foreground,
9
+ "--card-foreground": colors.background,
10
+ "--popover": colors.foreground,
11
+ "--popover-foreground": colors.background,
12
+ "--primary": colors.primaryForeground,
13
+ "--primary-foreground": colors.primary,
14
+ "--secondary": colors.secondaryForeground,
15
+ "--secondary-foreground": colors.secondary,
16
+ "--muted": colors.mutedForeground,
17
+ "--muted-foreground": colors.muted,
18
+ "--accent": colors.accentForeground,
19
+ "--accent-foreground": colors.accent,
20
+ "--destructive": colors.destructive,
21
+ "--destructive-foreground": colors.destructiveForeground,
22
+ },
23
+ spacing: spacingTokens,
24
+ size: sizeTokens,
25
+ };
@@ -0,0 +1,8 @@
1
+ export declare const breakpoints: {
2
+ mobile: string;
3
+ tablet: string;
4
+ desktop: string;
5
+ largeDesktop: string;
6
+ };
7
+ export default breakpoints;
8
+ export type Breakpoints = typeof breakpoints;
@@ -0,0 +1,7 @@
1
+ export const breakpoints = {
2
+ mobile: "480px",
3
+ tablet: "768px",
4
+ desktop: "1024px",
5
+ largeDesktop: "1200px",
6
+ };
7
+ export default breakpoints;
@@ -0,0 +1,19 @@
1
+ export declare const darkColors: {
2
+ background: string;
3
+ foreground: string;
4
+ card: string;
5
+ cardForeground: string;
6
+ popover: string;
7
+ popoverForeground: string;
8
+ primary: string;
9
+ primaryForeground: string;
10
+ secondary: string;
11
+ secondaryForeground: string;
12
+ muted: string;
13
+ mutedForeground: string;
14
+ accent: string;
15
+ accentForeground: string;
16
+ destructive: string;
17
+ destructiveForeground: string;
18
+ };
19
+ export type DarkColors = typeof darkColors;
@@ -0,0 +1,18 @@
1
+ export const darkColors = {
2
+ background: "0 0% 100%",
3
+ foreground: "20 14.3% 4.1%",
4
+ card: "0 0% 100%",
5
+ cardForeground: "20 14.3% 4.1%",
6
+ popover: "0 0% 100%",
7
+ popoverForeground: "20 14.3% 4.1%",
8
+ primary: "24 9.8% 10%",
9
+ primaryForeground: "60 9.1% 97.8%",
10
+ secondary: "60 4.8% 95.9%",
11
+ secondaryForeground: "24 9.8% 10%",
12
+ muted: "60 4.8% 95.9%",
13
+ mutedForeground: "25 5.3% 44.7%",
14
+ accent: "60 4.8% 95.9%",
15
+ accentForeground: "24 9.8% 10%",
16
+ destructive: "0 84.2% 60.2%",
17
+ destructiveForeground: "60 9.1% 97.8%",
18
+ };
@@ -0,0 +1,3 @@
1
+ export * from "./dark-colors";
2
+ export * from "./light-colors";
3
+ export * from "./lemon-colors";
@@ -0,0 +1,3 @@
1
+ export * from "./dark-colors";
2
+ export * from "./light-colors";
3
+ export * from "./lemon-colors";
@@ -0,0 +1,19 @@
1
+ export declare const lemonColors: {
2
+ background: string;
3
+ foreground: string;
4
+ card: string;
5
+ cardForeground: string;
6
+ popover: string;
7
+ popoverForeground: string;
8
+ primary: string;
9
+ primaryForeground: string;
10
+ secondary: string;
11
+ secondaryForeground: string;
12
+ muted: string;
13
+ mutedForeground: string;
14
+ accent: string;
15
+ accentForeground: string;
16
+ destructive: string;
17
+ destructiveForeground: string;
18
+ };
19
+ export type LemonColors = typeof lemonColors;
@@ -0,0 +1,18 @@
1
+ export const lemonColors = {
2
+ background: "0 0% 100%",
3
+ foreground: "20 14.3% 4.1%",
4
+ card: "0 0% 100%",
5
+ cardForeground: "20 14.3% 4.1%",
6
+ popover: "0 0% 100%",
7
+ popoverForeground: "20 14.3% 4.1%",
8
+ primary: "24 9.8% 10%",
9
+ primaryForeground: "60 9.1% 97.8%",
10
+ secondary: "60 4.8% 95.9%",
11
+ secondaryForeground: "24 9.8% 10%",
12
+ muted: "60 4.8% 95.9%",
13
+ mutedForeground: "25 5.3% 44.7%",
14
+ accent: "60 4.8% 95.9%",
15
+ accentForeground: "24 9.8% 10%",
16
+ destructive: "0 84.2% 60.2%",
17
+ destructiveForeground: "60 9.1% 97.8%",
18
+ };
@@ -0,0 +1,19 @@
1
+ export declare const lightColors: {
2
+ background: string;
3
+ foreground: string;
4
+ card: string;
5
+ cardForeground: string;
6
+ popover: string;
7
+ popoverForeground: string;
8
+ primary: string;
9
+ primaryForeground: string;
10
+ secondary: string;
11
+ secondaryForeground: string;
12
+ muted: string;
13
+ mutedForeground: string;
14
+ accent: string;
15
+ accentForeground: string;
16
+ destructive: string;
17
+ destructiveForeground: string;
18
+ };
19
+ export type LightColors = typeof lightColors;
@@ -0,0 +1,18 @@
1
+ export const lightColors = {
2
+ background: "0 0% 100%",
3
+ foreground: "20 14.3% 4.1%",
4
+ card: "0 0% 100%",
5
+ cardForeground: "20 14.3% 4.1%",
6
+ popover: "0 0% 100%",
7
+ popoverForeground: "20 14.3% 4.1%",
8
+ primary: "24 9.8% 10%",
9
+ primaryForeground: "60 9.1% 97.8%",
10
+ secondary: "60 4.8% 95.9%",
11
+ secondaryForeground: "24 9.8% 10%",
12
+ muted: "60 4.8% 95.9%",
13
+ mutedForeground: "25 5.3% 44.7%",
14
+ accent: "60 4.8% 95.9%",
15
+ accentForeground: "24 9.8% 10%",
16
+ destructive: "0 84.2% 60.2%",
17
+ destructiveForeground: "60 9.1% 97.8%",
18
+ };
@@ -0,0 +1,37 @@
1
+ export declare const glassTokens: {
2
+ blur: {
3
+ sm: string;
4
+ md: string;
5
+ lg: string;
6
+ };
7
+ saturation: string;
8
+ opacity: {
9
+ surface: number;
10
+ hover: number;
11
+ pressed: number;
12
+ dark: number;
13
+ };
14
+ surface: {
15
+ light: string;
16
+ hover: string;
17
+ strong: string;
18
+ dark: string;
19
+ };
20
+ border: {
21
+ light: string;
22
+ dark: string;
23
+ };
24
+ shadow: {
25
+ light: string;
26
+ dark: string;
27
+ };
28
+ refraction: string;
29
+ glow: string;
30
+ press: {
31
+ duration: string;
32
+ scale: number;
33
+ rebound: number;
34
+ };
35
+ };
36
+ export type GlassTokens = typeof glassTokens;
37
+ export default glassTokens;
@@ -0,0 +1,36 @@
1
+ export const glassTokens = {
2
+ blur: {
3
+ sm: "20px",
4
+ md: "32px",
5
+ lg: "48px",
6
+ },
7
+ saturation: "180%",
8
+ opacity: {
9
+ surface: 0.7,
10
+ hover: 0.82,
11
+ pressed: 0.6,
12
+ dark: 0.45,
13
+ },
14
+ surface: {
15
+ light: "rgba(255, 255, 255, 0.7)",
16
+ hover: "rgba(255, 255, 255, 0.85)",
17
+ strong: "rgba(255, 255, 255, 0.95)",
18
+ dark: "rgba(16, 16, 16, 0.6)",
19
+ },
20
+ border: {
21
+ light: "rgba(255, 255, 255, 0.18)",
22
+ dark: "rgba(255, 255, 255, 0.12)",
23
+ },
24
+ shadow: {
25
+ light: "0 8px 32px rgba(0, 0, 0, 0.12)",
26
+ dark: "0 20px 50px rgba(0, 0, 0, 0.45)",
27
+ },
28
+ refraction: "linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, transparent 60%)",
29
+ glow: "0 0 40px rgba(0, 122, 255, 0.35)",
30
+ press: {
31
+ duration: "220ms",
32
+ scale: 0.97,
33
+ rebound: 1.02,
34
+ },
35
+ };
36
+ export default glassTokens;
@@ -0,0 +1,8 @@
1
+ export declare const sizeTokens: {
2
+ default: string;
3
+ sm: string;
4
+ lg: string;
5
+ icon: string;
6
+ };
7
+ export default sizeTokens;
8
+ export type SizeTokens = typeof sizeTokens;
@@ -0,0 +1,7 @@
1
+ export const sizeTokens = {
2
+ default: "0 0% 100%",
3
+ sm: "h-9 rounded-md px-3",
4
+ lg: "h-11 rounded-md px-8",
5
+ icon: "h-10 w-10",
6
+ };
7
+ export default sizeTokens;
@@ -0,0 +1,24 @@
1
+ export declare const spacingTokens: {
2
+ stack: {
3
+ xxxs: string;
4
+ xxs: string;
5
+ xs: string;
6
+ sm: string;
7
+ md: string;
8
+ lg: string;
9
+ xlg: string;
10
+ xxlg: string;
11
+ };
12
+ inline: {
13
+ xxxs: string;
14
+ xxs: string;
15
+ xs: string;
16
+ sm: string;
17
+ md: string;
18
+ lg: string;
19
+ xlg: string;
20
+ xxlg: string;
21
+ };
22
+ };
23
+ export default spacingTokens;
24
+ export type SpacingTokens = typeof spacingTokens;
@@ -0,0 +1,23 @@
1
+ export const spacingTokens = {
2
+ stack: {
3
+ xxxs: "1rem",
4
+ xxs: "2rem",
5
+ xs: "3rem",
6
+ sm: "4rem",
7
+ md: "5rem",
8
+ lg: "6rem",
9
+ xlg: "7rem",
10
+ xxlg: "8rem",
11
+ },
12
+ inline: {
13
+ xxxs: "0.5rem",
14
+ xxs: "1rem",
15
+ xs: "1.5rem",
16
+ sm: "2rem",
17
+ md: "2.5rem",
18
+ lg: "3rem",
19
+ xlg: "3.5rem",
20
+ xxlg: "4rem",
21
+ },
22
+ };
23
+ export default spacingTokens;
@@ -0,0 +1,27 @@
1
+ import type React from "react";
2
+ export interface BaseProps<TElement = HTMLElement> {
3
+ className?: string;
4
+ variant?: "default" | "glass" | "solid" | "destructive" | "outline" | "secondary" | "ghost" | "link";
5
+ size?: "default" | "sm" | "lg" | "icon";
6
+ asChild?: boolean;
7
+ onClick?: React.MouseEventHandler<TElement>;
8
+ children?: React.ReactNode;
9
+ }
10
+ type VariantClassMap = Record<string, string>;
11
+ interface VariantOverrideOptions {
12
+ variants?: {
13
+ variant?: VariantClassMap;
14
+ size?: VariantClassMap;
15
+ };
16
+ defaultVariants?: {
17
+ variant?: string;
18
+ size?: string;
19
+ };
20
+ }
21
+ interface VariantInput {
22
+ className?: string;
23
+ variant?: string | null;
24
+ size?: string | null;
25
+ }
26
+ export declare const BaseVariants: (wrapperName: string, props: VariantInput, overrides?: VariantOverrideOptions) => string;
27
+ export {};
@@ -0,0 +1,36 @@
1
+ import { cva } from "class-variance-authority";
2
+ export const BaseVariants = (wrapperName, props, overrides) => {
3
+ const variantMap = {
4
+ default: "variant-default",
5
+ glass: "variant-glass",
6
+ solid: "variant-solid",
7
+ destructive: "variant-destructive",
8
+ outline: "variant-outline",
9
+ secondary: "variant-secondary",
10
+ ghost: "variant-ghost",
11
+ link: "variant-link",
12
+ ...(overrides?.variants?.variant || {}),
13
+ };
14
+ const sizeMap = {
15
+ default: "size-default",
16
+ sm: "size-sm",
17
+ lg: "size-lg",
18
+ icon: "size-icon",
19
+ ...(overrides?.variants?.size || {}),
20
+ };
21
+ const builder = cva(wrapperName, {
22
+ variants: {
23
+ variant: variantMap,
24
+ size: sizeMap,
25
+ },
26
+ defaultVariants: {
27
+ variant: overrides?.defaultVariants?.variant || "default",
28
+ size: overrides?.defaultVariants?.size || "default",
29
+ },
30
+ });
31
+ return builder({
32
+ variant: props.variant || undefined,
33
+ size: props.size || undefined,
34
+ className: props.className,
35
+ });
36
+ };
@@ -0,0 +1,2 @@
1
+ import { type ClassValue } from "clsx";
2
+ export declare function cn(...inputs: ClassValue[]): string;
@@ -0,0 +1,5 @@
1
+ import { clsx } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+ export function cn(...inputs) {
4
+ return twMerge(clsx(inputs));
5
+ }
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@react-cupertino-ui/shared",
3
+ "version": "0.0.0",
4
+ "description": "Shared utilities and tokens for React Cupertino UI",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "sideEffects": false,
13
+ "scripts": {
14
+ "build": "tsc -p tsconfig.build.json"
15
+ },
16
+ "peerDependencies": {
17
+ "react": "^18.3.1"
18
+ },
19
+ "dependencies": {
20
+ "class-variance-authority": "^0.7.0",
21
+ "clsx": "^2.1.1",
22
+ "tailwind-merge": "^2.4.0"
23
+ },
24
+ "devDependencies": {
25
+ "typescript": "^5.2.2"
26
+ },
27
+ "gitHead": "a6b07a7a8a0ab6f4c80884b6fb9d5eb16ee6da1d",
28
+ "publishConfig": {
29
+ "access": "public"
30
+ }
31
+ }