@react-native-rethemed/chakra-ui-tokens 0.1.0 → 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.
@@ -0,0 +1,213 @@
1
+ const require_colors = require("./colors.cjs");
2
+ //#region src/scales.ts
3
+ /**
4
+ * Radius scale, aligned with Chakra UI's radii tokens.
5
+ * https://www.chakra-ui.com/docs/theming/radii
6
+ */
7
+ const radii = {
8
+ none: 0,
9
+ "2xs": 1,
10
+ xs: 2,
11
+ sm: 4,
12
+ md: 6,
13
+ lg: 8,
14
+ xl: 12,
15
+ "2xl": 16,
16
+ "3xl": 24,
17
+ "4xl": 32,
18
+ full: 9999
19
+ };
20
+ /**
21
+ * Spacing scale, aligned with Chakra UI's spacing tokens. 1 unit = 4px,
22
+ * matching Chakra/Tailwind's proportional scale.
23
+ * https://www.chakra-ui.com/docs/theming/spacing
24
+ */
25
+ const spacing = {
26
+ px: 1,
27
+ 0: 0,
28
+ .5: 2,
29
+ 1: 4,
30
+ 1.5: 6,
31
+ 2: 8,
32
+ 2.5: 10,
33
+ 3: 12,
34
+ 3.5: 14,
35
+ 4: 16,
36
+ 5: 20,
37
+ 6: 24,
38
+ 7: 28,
39
+ 8: 32,
40
+ 9: 36,
41
+ 10: 40,
42
+ 11: 44,
43
+ 12: 48,
44
+ 14: 56,
45
+ 16: 64,
46
+ 20: 80,
47
+ 24: 96,
48
+ 28: 112,
49
+ 32: 128,
50
+ 36: 144,
51
+ 40: 160,
52
+ 44: 176,
53
+ 48: 192,
54
+ 52: 208,
55
+ 56: 224,
56
+ 60: 240,
57
+ 64: 256,
58
+ 72: 288,
59
+ 80: 320,
60
+ 96: 384
61
+ };
62
+ /**
63
+ * Font size scale, aligned with Chakra UI's fontSizes tokens.
64
+ * https://www.chakra-ui.com/docs/theming/typography
65
+ */
66
+ const fontSizes = {
67
+ "2xs": 10,
68
+ xs: 12,
69
+ sm: 14,
70
+ md: 16,
71
+ lg: 18,
72
+ xl: 20,
73
+ "2xl": 24,
74
+ "3xl": 30,
75
+ "4xl": 36,
76
+ "5xl": 48,
77
+ "6xl": 60,
78
+ "7xl": 72,
79
+ "8xl": 96,
80
+ "9xl": 128
81
+ };
82
+ /** Font weight scale — the standard 9-step CSS scale (thin..black). */
83
+ const fontWeights = {
84
+ thin: "100",
85
+ extralight: "200",
86
+ light: "300",
87
+ normal: "400",
88
+ medium: "500",
89
+ semibold: "600",
90
+ bold: "700",
91
+ extrabold: "800",
92
+ black: "900"
93
+ };
94
+ /**
95
+ * Line height scale, aligned with Chakra UI's lineHeights tokens: unitless
96
+ * ratios, as Chakra defines them. `themed` resolves a token to
97
+ * `fontSize × ratio` (see `defaults.fontSize` for styles without a fontSize).
98
+ */
99
+ const lineHeights = {
100
+ shorter: 1.25,
101
+ short: 1.375,
102
+ moderate: 1.5,
103
+ tall: 1.625,
104
+ taller: 2
105
+ };
106
+ /**
107
+ * Letter spacing scale. Chakra's tokens are em-based; these are the
108
+ * approximate px equivalents at a 16px base font size.
109
+ */
110
+ const letterSpacings = {
111
+ tighter: -.8,
112
+ tight: -.4,
113
+ wide: .4,
114
+ wider: .8,
115
+ widest: 1.6
116
+ };
117
+ /**
118
+ * z-index scale, aligned with Chakra UI's zIndices tokens.
119
+ * https://www.chakra-ui.com/docs/theming/z-index
120
+ */
121
+ const zIndices = {
122
+ hide: -1,
123
+ base: 0,
124
+ docked: 10,
125
+ dropdown: 1e3,
126
+ sticky: 1100,
127
+ banner: 1200,
128
+ overlay: 1300,
129
+ modal: 1400,
130
+ popover: 1500,
131
+ skipNav: 1600,
132
+ toast: 1700,
133
+ tooltip: 1800,
134
+ max: 2147483647
135
+ };
136
+ /**
137
+ * Chakra's `xs`/`sm`/`md`/`lg`/`xl`/`2xl` box-shadow scale, approximated as
138
+ * single-layer RN shadow objects since RN doesn't support multi-layer
139
+ * shadows the way CSS `box-shadow` does. Chakra's `inner` (inset) shadow
140
+ * isn't included — not representable with RN's native shadow props.
141
+ */
142
+ const shadowColor = require_colors.colors.black;
143
+ const shadows = {
144
+ xs: {
145
+ shadowColor,
146
+ shadowOffset: {
147
+ width: 0,
148
+ height: 1
149
+ },
150
+ shadowOpacity: .05,
151
+ shadowRadius: 1,
152
+ elevation: 1
153
+ },
154
+ sm: {
155
+ shadowColor,
156
+ shadowOffset: {
157
+ width: 0,
158
+ height: 1
159
+ },
160
+ shadowOpacity: .1,
161
+ shadowRadius: 2,
162
+ elevation: 2
163
+ },
164
+ md: {
165
+ shadowColor,
166
+ shadowOffset: {
167
+ width: 0,
168
+ height: 2
169
+ },
170
+ shadowOpacity: .12,
171
+ shadowRadius: 6,
172
+ elevation: 4
173
+ },
174
+ lg: {
175
+ shadowColor,
176
+ shadowOffset: {
177
+ width: 0,
178
+ height: 4
179
+ },
180
+ shadowOpacity: .14,
181
+ shadowRadius: 10,
182
+ elevation: 8
183
+ },
184
+ xl: {
185
+ shadowColor,
186
+ shadowOffset: {
187
+ width: 0,
188
+ height: 8
189
+ },
190
+ shadowOpacity: .16,
191
+ shadowRadius: 16,
192
+ elevation: 12
193
+ },
194
+ "2xl": {
195
+ shadowColor,
196
+ shadowOffset: {
197
+ width: 0,
198
+ height: 12
199
+ },
200
+ shadowOpacity: .2,
201
+ shadowRadius: 24,
202
+ elevation: 16
203
+ }
204
+ };
205
+ //#endregion
206
+ exports.fontSizes = fontSizes;
207
+ exports.fontWeights = fontWeights;
208
+ exports.letterSpacings = letterSpacings;
209
+ exports.lineHeights = lineHeights;
210
+ exports.radii = radii;
211
+ exports.shadows = shadows;
212
+ exports.spacing = spacing;
213
+ exports.zIndices = zIndices;
@@ -0,0 +1,197 @@
1
+ //#region src/scales.d.ts
2
+ /**
3
+ * Radius scale, aligned with Chakra UI's radii tokens.
4
+ * https://www.chakra-ui.com/docs/theming/radii
5
+ */
6
+ export declare const radii: {
7
+ readonly none: 0;
8
+ readonly '2xs': 1;
9
+ readonly xs: 2;
10
+ readonly sm: 4;
11
+ readonly md: 6;
12
+ readonly lg: 8;
13
+ readonly xl: 12;
14
+ readonly '2xl': 16;
15
+ readonly '3xl': 24;
16
+ readonly '4xl': 32;
17
+ readonly full: 9999;
18
+ };
19
+ /**
20
+ * Spacing scale, aligned with Chakra UI's spacing tokens. 1 unit = 4px,
21
+ * matching Chakra/Tailwind's proportional scale.
22
+ * https://www.chakra-ui.com/docs/theming/spacing
23
+ */
24
+ export declare const spacing: {
25
+ readonly px: 1;
26
+ readonly 0: 0;
27
+ readonly 0.5: 2;
28
+ readonly 1: 4;
29
+ readonly 1.5: 6;
30
+ readonly 2: 8;
31
+ readonly 2.5: 10;
32
+ readonly 3: 12;
33
+ readonly 3.5: 14;
34
+ readonly 4: 16;
35
+ readonly 5: 20;
36
+ readonly 6: 24;
37
+ readonly 7: 28;
38
+ readonly 8: 32;
39
+ readonly 9: 36;
40
+ readonly 10: 40;
41
+ readonly 11: 44;
42
+ readonly 12: 48;
43
+ readonly 14: 56;
44
+ readonly 16: 64;
45
+ readonly 20: 80;
46
+ readonly 24: 96;
47
+ readonly 28: 112;
48
+ readonly 32: 128;
49
+ readonly 36: 144;
50
+ readonly 40: 160;
51
+ readonly 44: 176;
52
+ readonly 48: 192;
53
+ readonly 52: 208;
54
+ readonly 56: 224;
55
+ readonly 60: 240;
56
+ readonly 64: 256;
57
+ readonly 72: 288;
58
+ readonly 80: 320;
59
+ readonly 96: 384;
60
+ };
61
+ /**
62
+ * Font size scale, aligned with Chakra UI's fontSizes tokens.
63
+ * https://www.chakra-ui.com/docs/theming/typography
64
+ */
65
+ export declare const fontSizes: {
66
+ readonly '2xs': 10;
67
+ readonly xs: 12;
68
+ readonly sm: 14;
69
+ readonly md: 16;
70
+ readonly lg: 18;
71
+ readonly xl: 20;
72
+ readonly '2xl': 24;
73
+ readonly '3xl': 30;
74
+ readonly '4xl': 36;
75
+ readonly '5xl': 48;
76
+ readonly '6xl': 60;
77
+ readonly '7xl': 72;
78
+ readonly '8xl': 96;
79
+ readonly '9xl': 128;
80
+ };
81
+ /** Font weight scale — the standard 9-step CSS scale (thin..black). */
82
+ export declare const fontWeights: {
83
+ readonly thin: "100";
84
+ readonly extralight: "200";
85
+ readonly light: "300";
86
+ readonly normal: "400";
87
+ readonly medium: "500";
88
+ readonly semibold: "600";
89
+ readonly bold: "700";
90
+ readonly extrabold: "800";
91
+ readonly black: "900";
92
+ };
93
+ /**
94
+ * Line height scale, aligned with Chakra UI's lineHeights tokens: unitless
95
+ * ratios, as Chakra defines them. `themed` resolves a token to
96
+ * `fontSize × ratio` (see `defaults.fontSize` for styles without a fontSize).
97
+ */
98
+ export declare const lineHeights: {
99
+ readonly shorter: 1.25;
100
+ readonly short: 1.375;
101
+ readonly moderate: 1.5;
102
+ readonly tall: 1.625;
103
+ readonly taller: 2;
104
+ };
105
+ /**
106
+ * Letter spacing scale. Chakra's tokens are em-based; these are the
107
+ * approximate px equivalents at a 16px base font size.
108
+ */
109
+ export declare const letterSpacings: {
110
+ readonly tighter: -0.8;
111
+ readonly tight: -0.4;
112
+ readonly wide: 0.4;
113
+ readonly wider: 0.8;
114
+ readonly widest: 1.6;
115
+ };
116
+ /**
117
+ * z-index scale, aligned with Chakra UI's zIndices tokens.
118
+ * https://www.chakra-ui.com/docs/theming/z-index
119
+ */
120
+ export declare const zIndices: {
121
+ readonly hide: -1;
122
+ readonly base: 0;
123
+ readonly docked: 10;
124
+ readonly dropdown: 1000;
125
+ readonly sticky: 1100;
126
+ readonly banner: 1200;
127
+ readonly overlay: 1300;
128
+ readonly modal: 1400;
129
+ readonly popover: 1500;
130
+ readonly skipNav: 1600;
131
+ readonly toast: 1700;
132
+ readonly tooltip: 1800;
133
+ readonly max: 2147483647;
134
+ };
135
+ export declare const shadows: {
136
+ readonly xs: {
137
+ readonly shadowColor: "#000000";
138
+ readonly shadowOffset: {
139
+ readonly width: 0;
140
+ readonly height: 1;
141
+ };
142
+ readonly shadowOpacity: 0.05;
143
+ readonly shadowRadius: 1;
144
+ readonly elevation: 1;
145
+ };
146
+ readonly sm: {
147
+ readonly shadowColor: "#000000";
148
+ readonly shadowOffset: {
149
+ readonly width: 0;
150
+ readonly height: 1;
151
+ };
152
+ readonly shadowOpacity: 0.1;
153
+ readonly shadowRadius: 2;
154
+ readonly elevation: 2;
155
+ };
156
+ readonly md: {
157
+ readonly shadowColor: "#000000";
158
+ readonly shadowOffset: {
159
+ readonly width: 0;
160
+ readonly height: 2;
161
+ };
162
+ readonly shadowOpacity: 0.12;
163
+ readonly shadowRadius: 6;
164
+ readonly elevation: 4;
165
+ };
166
+ readonly lg: {
167
+ readonly shadowColor: "#000000";
168
+ readonly shadowOffset: {
169
+ readonly width: 0;
170
+ readonly height: 4;
171
+ };
172
+ readonly shadowOpacity: 0.14;
173
+ readonly shadowRadius: 10;
174
+ readonly elevation: 8;
175
+ };
176
+ readonly xl: {
177
+ readonly shadowColor: "#000000";
178
+ readonly shadowOffset: {
179
+ readonly width: 0;
180
+ readonly height: 8;
181
+ };
182
+ readonly shadowOpacity: 0.16;
183
+ readonly shadowRadius: 16;
184
+ readonly elevation: 12;
185
+ };
186
+ readonly '2xl': {
187
+ readonly shadowColor: "#000000";
188
+ readonly shadowOffset: {
189
+ readonly width: 0;
190
+ readonly height: 12;
191
+ };
192
+ readonly shadowOpacity: 0.2;
193
+ readonly shadowRadius: 24;
194
+ readonly elevation: 16;
195
+ };
196
+ };
197
+ //#endregion
@@ -0,0 +1,197 @@
1
+ //#region src/scales.d.ts
2
+ /**
3
+ * Radius scale, aligned with Chakra UI's radii tokens.
4
+ * https://www.chakra-ui.com/docs/theming/radii
5
+ */
6
+ export declare const radii: {
7
+ readonly none: 0;
8
+ readonly '2xs': 1;
9
+ readonly xs: 2;
10
+ readonly sm: 4;
11
+ readonly md: 6;
12
+ readonly lg: 8;
13
+ readonly xl: 12;
14
+ readonly '2xl': 16;
15
+ readonly '3xl': 24;
16
+ readonly '4xl': 32;
17
+ readonly full: 9999;
18
+ };
19
+ /**
20
+ * Spacing scale, aligned with Chakra UI's spacing tokens. 1 unit = 4px,
21
+ * matching Chakra/Tailwind's proportional scale.
22
+ * https://www.chakra-ui.com/docs/theming/spacing
23
+ */
24
+ export declare const spacing: {
25
+ readonly px: 1;
26
+ readonly 0: 0;
27
+ readonly 0.5: 2;
28
+ readonly 1: 4;
29
+ readonly 1.5: 6;
30
+ readonly 2: 8;
31
+ readonly 2.5: 10;
32
+ readonly 3: 12;
33
+ readonly 3.5: 14;
34
+ readonly 4: 16;
35
+ readonly 5: 20;
36
+ readonly 6: 24;
37
+ readonly 7: 28;
38
+ readonly 8: 32;
39
+ readonly 9: 36;
40
+ readonly 10: 40;
41
+ readonly 11: 44;
42
+ readonly 12: 48;
43
+ readonly 14: 56;
44
+ readonly 16: 64;
45
+ readonly 20: 80;
46
+ readonly 24: 96;
47
+ readonly 28: 112;
48
+ readonly 32: 128;
49
+ readonly 36: 144;
50
+ readonly 40: 160;
51
+ readonly 44: 176;
52
+ readonly 48: 192;
53
+ readonly 52: 208;
54
+ readonly 56: 224;
55
+ readonly 60: 240;
56
+ readonly 64: 256;
57
+ readonly 72: 288;
58
+ readonly 80: 320;
59
+ readonly 96: 384;
60
+ };
61
+ /**
62
+ * Font size scale, aligned with Chakra UI's fontSizes tokens.
63
+ * https://www.chakra-ui.com/docs/theming/typography
64
+ */
65
+ export declare const fontSizes: {
66
+ readonly '2xs': 10;
67
+ readonly xs: 12;
68
+ readonly sm: 14;
69
+ readonly md: 16;
70
+ readonly lg: 18;
71
+ readonly xl: 20;
72
+ readonly '2xl': 24;
73
+ readonly '3xl': 30;
74
+ readonly '4xl': 36;
75
+ readonly '5xl': 48;
76
+ readonly '6xl': 60;
77
+ readonly '7xl': 72;
78
+ readonly '8xl': 96;
79
+ readonly '9xl': 128;
80
+ };
81
+ /** Font weight scale — the standard 9-step CSS scale (thin..black). */
82
+ export declare const fontWeights: {
83
+ readonly thin: "100";
84
+ readonly extralight: "200";
85
+ readonly light: "300";
86
+ readonly normal: "400";
87
+ readonly medium: "500";
88
+ readonly semibold: "600";
89
+ readonly bold: "700";
90
+ readonly extrabold: "800";
91
+ readonly black: "900";
92
+ };
93
+ /**
94
+ * Line height scale, aligned with Chakra UI's lineHeights tokens: unitless
95
+ * ratios, as Chakra defines them. `themed` resolves a token to
96
+ * `fontSize × ratio` (see `defaults.fontSize` for styles without a fontSize).
97
+ */
98
+ export declare const lineHeights: {
99
+ readonly shorter: 1.25;
100
+ readonly short: 1.375;
101
+ readonly moderate: 1.5;
102
+ readonly tall: 1.625;
103
+ readonly taller: 2;
104
+ };
105
+ /**
106
+ * Letter spacing scale. Chakra's tokens are em-based; these are the
107
+ * approximate px equivalents at a 16px base font size.
108
+ */
109
+ export declare const letterSpacings: {
110
+ readonly tighter: -0.8;
111
+ readonly tight: -0.4;
112
+ readonly wide: 0.4;
113
+ readonly wider: 0.8;
114
+ readonly widest: 1.6;
115
+ };
116
+ /**
117
+ * z-index scale, aligned with Chakra UI's zIndices tokens.
118
+ * https://www.chakra-ui.com/docs/theming/z-index
119
+ */
120
+ export declare const zIndices: {
121
+ readonly hide: -1;
122
+ readonly base: 0;
123
+ readonly docked: 10;
124
+ readonly dropdown: 1000;
125
+ readonly sticky: 1100;
126
+ readonly banner: 1200;
127
+ readonly overlay: 1300;
128
+ readonly modal: 1400;
129
+ readonly popover: 1500;
130
+ readonly skipNav: 1600;
131
+ readonly toast: 1700;
132
+ readonly tooltip: 1800;
133
+ readonly max: 2147483647;
134
+ };
135
+ export declare const shadows: {
136
+ readonly xs: {
137
+ readonly shadowColor: "#000000";
138
+ readonly shadowOffset: {
139
+ readonly width: 0;
140
+ readonly height: 1;
141
+ };
142
+ readonly shadowOpacity: 0.05;
143
+ readonly shadowRadius: 1;
144
+ readonly elevation: 1;
145
+ };
146
+ readonly sm: {
147
+ readonly shadowColor: "#000000";
148
+ readonly shadowOffset: {
149
+ readonly width: 0;
150
+ readonly height: 1;
151
+ };
152
+ readonly shadowOpacity: 0.1;
153
+ readonly shadowRadius: 2;
154
+ readonly elevation: 2;
155
+ };
156
+ readonly md: {
157
+ readonly shadowColor: "#000000";
158
+ readonly shadowOffset: {
159
+ readonly width: 0;
160
+ readonly height: 2;
161
+ };
162
+ readonly shadowOpacity: 0.12;
163
+ readonly shadowRadius: 6;
164
+ readonly elevation: 4;
165
+ };
166
+ readonly lg: {
167
+ readonly shadowColor: "#000000";
168
+ readonly shadowOffset: {
169
+ readonly width: 0;
170
+ readonly height: 4;
171
+ };
172
+ readonly shadowOpacity: 0.14;
173
+ readonly shadowRadius: 10;
174
+ readonly elevation: 8;
175
+ };
176
+ readonly xl: {
177
+ readonly shadowColor: "#000000";
178
+ readonly shadowOffset: {
179
+ readonly width: 0;
180
+ readonly height: 8;
181
+ };
182
+ readonly shadowOpacity: 0.16;
183
+ readonly shadowRadius: 16;
184
+ readonly elevation: 12;
185
+ };
186
+ readonly '2xl': {
187
+ readonly shadowColor: "#000000";
188
+ readonly shadowOffset: {
189
+ readonly width: 0;
190
+ readonly height: 12;
191
+ };
192
+ readonly shadowOpacity: 0.2;
193
+ readonly shadowRadius: 24;
194
+ readonly elevation: 16;
195
+ };
196
+ };
197
+ //#endregion