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