@multiplatform.one/theme 6.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 (67) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/LICENSE +201 -0
  3. package/package.json +85 -0
  4. package/src/audit/baselines/home-login.json +171 -0
  5. package/src/audit/baselines/home-login.png +0 -0
  6. package/src/audit/baselines/home-pokemon.json +355 -0
  7. package/src/audit/baselines/home-pokemon.png +0 -0
  8. package/src/audit/baselines/home.json +194 -0
  9. package/src/audit/baselines/home.png +0 -0
  10. package/src/audit/baselines/pokemon.json +251 -0
  11. package/src/audit/baselines/pokemon.png +0 -0
  12. package/src/audit/constraintAudit.ts +874 -0
  13. package/src/audit/diffReport.spec.ts +191 -0
  14. package/src/audit/diffReport.ts +344 -0
  15. package/src/audit/index.ts +10 -0
  16. package/src/font.ts +49 -0
  17. package/src/fonts/createFontLoader.ts +15 -0
  18. package/src/fonts/createFontLoader.web.ts +9 -0
  19. package/src/fonts/index.ts +2 -0
  20. package/src/fonts/types.ts +13 -0
  21. package/src/index.ts +3 -0
  22. package/src/theme/Intent.tsx +30 -0
  23. package/src/theme/Preset.tsx +93 -0
  24. package/src/theme/PresetContext.ts +27 -0
  25. package/src/theme/Tint.tsx +44 -0
  26. package/src/theme/__snapshots__/resolveKnobs.spec.ts.snap +69 -0
  27. package/src/theme/animations/css.ts +25 -0
  28. package/src/theme/animations/index.ts +1 -0
  29. package/src/theme/animations/index.web.ts +1 -0
  30. package/src/theme/animations/reactNative.ts +54 -0
  31. package/src/theme/colorRules.spec.ts +195 -0
  32. package/src/theme/colorRules.ts +166 -0
  33. package/src/theme/cookies.spec.ts +185 -0
  34. package/src/theme/cookies.ts +209 -0
  35. package/src/theme/createDefaultThemeConfig.ts +86 -0
  36. package/src/theme/createThemes.ts +286 -0
  37. package/src/theme/devtools/ColorLineVisualizer.tsx +261 -0
  38. package/src/theme/devtools/ThemeDevtoolsPanel.tsx +1657 -0
  39. package/src/theme/devtools/buildSnapshot.spec.ts +113 -0
  40. package/src/theme/devtools/buildSnapshot.ts +103 -0
  41. package/src/theme/devtools/knobIcons.tsx +217 -0
  42. package/src/theme/devtools/vizConstants.spec.ts +58 -0
  43. package/src/theme/devtools/vizConstants.ts +28 -0
  44. package/src/theme/index.ts +21 -0
  45. package/src/theme/intent.spec.tsx +276 -0
  46. package/src/theme/intents.ts +22 -0
  47. package/src/theme/knobs.ts +147 -0
  48. package/src/theme/pokemonScreen.spec.ts +109 -0
  49. package/src/theme/preset.spec.tsx +242 -0
  50. package/src/theme/preset.types.ts +22 -0
  51. package/src/theme/presets.spec.ts +252 -0
  52. package/src/theme/presets.ts +49 -0
  53. package/src/theme/recipes.ts +69 -0
  54. package/src/theme/resolveKnobs.spec.ts +571 -0
  55. package/src/theme/resolveKnobs.ts +226 -0
  56. package/src/theme/shared.spec.ts +84 -0
  57. package/src/theme/shared.tsx +131 -0
  58. package/src/theme/theme.native.tsx +65 -0
  59. package/src/theme/theme.tsx +190 -0
  60. package/src/theme/tint.spec.tsx +179 -0
  61. package/src/theme/useColorScale.native.ts +7 -0
  62. package/src/theme/useColorScale.ts +29 -0
  63. package/src/theme/useResolvedKnobs.ts +121 -0
  64. package/src/theme/useTheme.native.ts +49 -0
  65. package/src/theme/useTheme.ts +213 -0
  66. package/tsconfig.json +11 -0
  67. package/vitest.config.mjs +9 -0
@@ -0,0 +1,355 @@
1
+ {
2
+ "url": "http://localhost:3000/pokemon",
3
+ "timestamp": "2026-03-25T05:33:41.560Z",
4
+ "preset": "unknown",
5
+ "scheme": "light",
6
+ "summary": {
7
+ "totalElements": 36,
8
+ "auditedElements": 13,
9
+ "totalViolations": 3,
10
+ "byProperty": {
11
+ "borderRadius": 1,
12
+ "borderWidth": 0,
13
+ "gap": 2,
14
+ "padding": 1,
15
+ "fontWeight": 0,
16
+ "fontFamily": 0,
17
+ "inlineColor": 1
18
+ }
19
+ },
20
+ "violations": [
21
+ {
22
+ "label": "div",
23
+ "tag": "div",
24
+ "id": "",
25
+ "classes": [],
26
+ "violations": [
27
+ "inlineColor: backgroundColor=\"rgba(60, 100, 200, 0.65)\" bypasses theme tokens"
28
+ ],
29
+ "inlineColor": {
30
+ "value": "backgroundColor: rgba(60, 100, 200, 0.65)",
31
+ "knob": "off-scale (hardcoded)",
32
+ "offScale": true
33
+ }
34
+ },
35
+ {
36
+ "label": "button.is_Button.is_View._outlineColor-0focus-visible-outlineColo114[role=button]",
37
+ "tag": "button",
38
+ "id": "",
39
+ "classes": [
40
+ "is_Button",
41
+ "is_View",
42
+ "_outlineColor-0focus-visible-outlineColo114",
43
+ "_outlineStyle-0focus-visible-solid",
44
+ "_outlineWidth-0focus-visible-2px"
45
+ ],
46
+ "violations": [
47
+ "borderRadius: 100000px is off-scale (no matching token)",
48
+ "rowGap: 9px is off-scale (no matching token)"
49
+ ],
50
+ "borderRadius": {
51
+ "value": 100000,
52
+ "unit": "px",
53
+ "knob": "off-scale",
54
+ "offScale": true
55
+ },
56
+ "borderWidth": {
57
+ "value": 1,
58
+ "unit": "px",
59
+ "knob": "medium",
60
+ "offScale": false
61
+ },
62
+ "rowGap": {
63
+ "value": 9,
64
+ "unit": "px",
65
+ "knob": "off-scale",
66
+ "offScale": true
67
+ }
68
+ },
69
+ {
70
+ "label": "button.is_Button.is_View._outlineColor-0focus-visible-outlineColo114[role=button]",
71
+ "tag": "button",
72
+ "id": "",
73
+ "classes": [
74
+ "is_Button",
75
+ "is_View",
76
+ "_outlineColor-0focus-visible-outlineColo114",
77
+ "_outlineStyle-0focus-visible-solid",
78
+ "_outlineWidth-0focus-visible-2px"
79
+ ],
80
+ "violations": [
81
+ "rowGap: 5px is off-scale (no matching token)",
82
+ "paddingRight: 7px is off-scale (no matching token)",
83
+ "paddingLeft: 7px is off-scale (no matching token)"
84
+ ],
85
+ "borderRadius": {
86
+ "value": 5,
87
+ "unit": "px",
88
+ "knob": "small",
89
+ "offScale": false
90
+ },
91
+ "borderWidth": {
92
+ "value": 1,
93
+ "unit": "px",
94
+ "knob": "medium",
95
+ "offScale": false
96
+ },
97
+ "rowGap": {
98
+ "value": 5,
99
+ "unit": "px",
100
+ "knob": "off-scale",
101
+ "offScale": true
102
+ },
103
+ "paddingRight": {
104
+ "value": 7,
105
+ "unit": "px",
106
+ "knob": "off-scale",
107
+ "offScale": true
108
+ },
109
+ "paddingLeft": {
110
+ "value": 7,
111
+ "unit": "px",
112
+ "knob": "off-scale",
113
+ "offScale": true
114
+ }
115
+ }
116
+ ],
117
+ "elements": [
118
+ {
119
+ "label": "div",
120
+ "tag": "div",
121
+ "id": "",
122
+ "classes": [],
123
+ "violations": [
124
+ "inlineColor: backgroundColor=\"rgba(60, 100, 200, 0.65)\" bypasses theme tokens"
125
+ ],
126
+ "inlineColor": {
127
+ "value": "backgroundColor: rgba(60, 100, 200, 0.65)",
128
+ "knob": "off-scale (hardcoded)",
129
+ "offScale": true
130
+ }
131
+ },
132
+ {
133
+ "label": "span._dsp_contents.t_unmounted.font_body",
134
+ "tag": "span",
135
+ "id": "",
136
+ "classes": ["_dsp_contents", "t_unmounted", "font_body"],
137
+ "violations": [],
138
+ "fontFamily": {
139
+ "value": "Inter, -apple-system, system-ui, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif",
140
+ "knob": "sans-serif ($body/$heading)",
141
+ "offScale": false
142
+ }
143
+ },
144
+ {
145
+ "label": "nav.is_View",
146
+ "tag": "nav",
147
+ "id": "",
148
+ "classes": ["is_View"],
149
+ "violations": [],
150
+ "borderWidth": {
151
+ "value": 1,
152
+ "unit": "px",
153
+ "knob": "medium",
154
+ "offScale": false
155
+ }
156
+ },
157
+ {
158
+ "label": "div.is_View",
159
+ "tag": "div",
160
+ "id": "",
161
+ "classes": ["is_View"],
162
+ "violations": [],
163
+ "rowGap": {
164
+ "value": 13,
165
+ "unit": "px",
166
+ "knob": "medium",
167
+ "offScale": false
168
+ }
169
+ },
170
+ {
171
+ "label": "button.is_Button.is_View._outlineColor-0focus-visible-outlineColo114[role=button]",
172
+ "tag": "button",
173
+ "id": "",
174
+ "classes": [
175
+ "is_Button",
176
+ "is_View",
177
+ "_outlineColor-0focus-visible-outlineColo114",
178
+ "_outlineStyle-0focus-visible-solid",
179
+ "_outlineWidth-0focus-visible-2px"
180
+ ],
181
+ "violations": [
182
+ "borderRadius: 100000px is off-scale (no matching token)",
183
+ "rowGap: 9px is off-scale (no matching token)"
184
+ ],
185
+ "borderRadius": {
186
+ "value": 100000,
187
+ "unit": "px",
188
+ "knob": "off-scale",
189
+ "offScale": true
190
+ },
191
+ "borderWidth": {
192
+ "value": 1,
193
+ "unit": "px",
194
+ "knob": "medium",
195
+ "offScale": false
196
+ },
197
+ "rowGap": {
198
+ "value": 9,
199
+ "unit": "px",
200
+ "knob": "off-scale",
201
+ "offScale": true
202
+ }
203
+ },
204
+ {
205
+ "label": "div.is_View",
206
+ "tag": "div",
207
+ "id": "",
208
+ "classes": ["is_View"],
209
+ "violations": [],
210
+ "rowGap": {
211
+ "value": 13,
212
+ "unit": "px",
213
+ "knob": "medium",
214
+ "offScale": false
215
+ }
216
+ },
217
+ {
218
+ "label": "button.is_Button.is_View._outlineColor-0focus-visible-outlineColo114[role=button]",
219
+ "tag": "button",
220
+ "id": "",
221
+ "classes": [
222
+ "is_Button",
223
+ "is_View",
224
+ "_outlineColor-0focus-visible-outlineColo114",
225
+ "_outlineStyle-0focus-visible-solid",
226
+ "_outlineWidth-0focus-visible-2px"
227
+ ],
228
+ "violations": [
229
+ "rowGap: 5px is off-scale (no matching token)",
230
+ "paddingRight: 7px is off-scale (no matching token)",
231
+ "paddingLeft: 7px is off-scale (no matching token)"
232
+ ],
233
+ "borderRadius": {
234
+ "value": 5,
235
+ "unit": "px",
236
+ "knob": "small",
237
+ "offScale": false
238
+ },
239
+ "borderWidth": {
240
+ "value": 1,
241
+ "unit": "px",
242
+ "knob": "medium",
243
+ "offScale": false
244
+ },
245
+ "rowGap": {
246
+ "value": 5,
247
+ "unit": "px",
248
+ "knob": "off-scale",
249
+ "offScale": true
250
+ },
251
+ "paddingRight": {
252
+ "value": 7,
253
+ "unit": "px",
254
+ "knob": "off-scale",
255
+ "offScale": true
256
+ },
257
+ "paddingLeft": {
258
+ "value": 7,
259
+ "unit": "px",
260
+ "knob": "off-scale",
261
+ "offScale": true
262
+ }
263
+ },
264
+ {
265
+ "label": "div.is_View",
266
+ "tag": "div",
267
+ "id": "",
268
+ "classes": ["is_View"],
269
+ "violations": [],
270
+ "rowGap": {
271
+ "value": 18,
272
+ "unit": "px",
273
+ "knob": "large",
274
+ "offScale": false
275
+ }
276
+ },
277
+ {
278
+ "label": "div.is_View",
279
+ "tag": "div",
280
+ "id": "",
281
+ "classes": ["is_View"],
282
+ "violations": [],
283
+ "rowGap": {
284
+ "value": 13,
285
+ "unit": "px",
286
+ "knob": "medium",
287
+ "offScale": false
288
+ }
289
+ },
290
+ {
291
+ "label": "h1.is_H1.is_Text.font_heading[role=heading]",
292
+ "tag": "h1",
293
+ "id": "",
294
+ "classes": ["is_H1", "is_Text", "font_heading"],
295
+ "violations": [],
296
+ "fontWeight": {
297
+ "value": 700,
298
+ "unit": "px",
299
+ "knob": "bold",
300
+ "offScale": false
301
+ }
302
+ },
303
+ {
304
+ "label": "button.is_Toggle.is_View._outlineColor-0focus-visible-outlineColo114",
305
+ "tag": "button",
306
+ "id": "",
307
+ "classes": [
308
+ "is_Toggle",
309
+ "is_View",
310
+ "_outlineColor-0focus-visible-outlineColo114",
311
+ "_outlineWidth-0focus-visible-2px",
312
+ "_outlineStyle-0focus-visible-solid"
313
+ ],
314
+ "violations": [],
315
+ "borderWidth": {
316
+ "value": 1,
317
+ "unit": "px",
318
+ "knob": "medium",
319
+ "offScale": false
320
+ }
321
+ },
322
+ {
323
+ "label": "button.is_Toggle.is_View._outlineColor-0focus-visible-outlineColo114",
324
+ "tag": "button",
325
+ "id": "",
326
+ "classes": [
327
+ "is_Toggle",
328
+ "is_View",
329
+ "_outlineColor-0focus-visible-outlineColo114",
330
+ "_outlineWidth-0focus-visible-2px",
331
+ "_outlineStyle-0focus-visible-solid"
332
+ ],
333
+ "violations": [],
334
+ "borderWidth": {
335
+ "value": 1,
336
+ "unit": "px",
337
+ "knob": "medium",
338
+ "offScale": false
339
+ }
340
+ },
341
+ {
342
+ "label": "div.is_View[data-testid=pokemon-list]",
343
+ "tag": "div",
344
+ "id": "",
345
+ "classes": ["is_View"],
346
+ "violations": [],
347
+ "rowGap": {
348
+ "value": 13,
349
+ "unit": "px",
350
+ "knob": "medium",
351
+ "offScale": false
352
+ }
353
+ }
354
+ ]
355
+ }
@@ -0,0 +1,194 @@
1
+ {
2
+ "url": "http://localhost:3000/",
3
+ "timestamp": "2026-03-25T06:05:33.532Z",
4
+ "preset": "unknown",
5
+ "scheme": "light",
6
+ "summary": {
7
+ "totalElements": 34,
8
+ "auditedElements": 10,
9
+ "totalViolations": 0,
10
+ "byProperty": {
11
+ "borderRadius": 0,
12
+ "borderWidth": 0,
13
+ "gap": 0,
14
+ "padding": 0,
15
+ "fontWeight": 0,
16
+ "fontFamily": 0,
17
+ "inlineColor": 0
18
+ }
19
+ },
20
+ "violations": [],
21
+ "elements": [
22
+ {
23
+ "label": "span._dsp_contents.font_body",
24
+ "tag": "span",
25
+ "id": "",
26
+ "classes": ["_dsp_contents", "font_body"],
27
+ "violations": [],
28
+ "fontFamily": {
29
+ "value": "Inter, -apple-system, system-ui, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif",
30
+ "knob": "sans-serif ($body/$heading)",
31
+ "offScale": false
32
+ }
33
+ },
34
+ {
35
+ "label": "nav.is_View",
36
+ "tag": "nav",
37
+ "id": "",
38
+ "classes": ["is_View"],
39
+ "violations": [],
40
+ "borderWidth": {
41
+ "value": 1,
42
+ "unit": "px",
43
+ "knob": "medium",
44
+ "offScale": false
45
+ }
46
+ },
47
+ {
48
+ "label": "div.is_View",
49
+ "tag": "div",
50
+ "id": "",
51
+ "classes": ["is_View"],
52
+ "violations": [],
53
+ "rowGap": {
54
+ "value": 13,
55
+ "unit": "px",
56
+ "knob": "medium",
57
+ "offScale": false
58
+ }
59
+ },
60
+ {
61
+ "label": "h4.is_H4.is_Text.font_heading",
62
+ "tag": "h4",
63
+ "id": "",
64
+ "classes": ["is_H4", "is_Text", "font_heading"],
65
+ "violations": [],
66
+ "fontWeight": {
67
+ "value": 700,
68
+ "unit": "px",
69
+ "knob": "bold",
70
+ "offScale": false
71
+ }
72
+ },
73
+ {
74
+ "label": "div.t_unmounted.is_View",
75
+ "tag": "div",
76
+ "id": "",
77
+ "classes": ["t_unmounted", "is_View"],
78
+ "violations": [],
79
+ "borderRadius": {
80
+ "value": 9,
81
+ "unit": "px",
82
+ "knob": "medium",
83
+ "offScale": false
84
+ },
85
+ "borderWidth": {
86
+ "value": 1,
87
+ "unit": "px",
88
+ "knob": "medium",
89
+ "offScale": false
90
+ }
91
+ },
92
+ {
93
+ "label": "div.is_GroupFrame.is_View._outlineStyle-none[role=tablist]",
94
+ "tag": "div",
95
+ "id": "",
96
+ "classes": ["is_GroupFrame", "is_View", "_outlineStyle-none"],
97
+ "violations": [],
98
+ "borderRadius": {
99
+ "value": 9,
100
+ "unit": "px",
101
+ "knob": "medium",
102
+ "offScale": false
103
+ },
104
+ "rowGap": {
105
+ "value": 13,
106
+ "unit": "px",
107
+ "knob": "medium",
108
+ "offScale": false
109
+ }
110
+ },
111
+ {
112
+ "label": "div.is_View",
113
+ "tag": "div",
114
+ "id": "",
115
+ "classes": ["is_View"],
116
+ "violations": [],
117
+ "rowGap": {
118
+ "value": 13,
119
+ "unit": "px",
120
+ "knob": "medium",
121
+ "offScale": false
122
+ }
123
+ },
124
+ {
125
+ "label": "button.is_Button.is_View._outlineColor-0focus-visible-outlineColo114[role=button]",
126
+ "tag": "button",
127
+ "id": "",
128
+ "classes": [
129
+ "is_Button",
130
+ "is_View",
131
+ "_outlineColor-0focus-visible-outlineColo114",
132
+ "_outlineStyle-0focus-visible-solid",
133
+ "_outlineWidth-0focus-visible-2px"
134
+ ],
135
+ "violations": [],
136
+ "borderRadius": {
137
+ "value": 5,
138
+ "unit": "px",
139
+ "knob": "small",
140
+ "offScale": false
141
+ },
142
+ "borderWidth": {
143
+ "value": 1,
144
+ "unit": "px",
145
+ "knob": "medium",
146
+ "offScale": false
147
+ },
148
+ "rowGap": {
149
+ "value": 5,
150
+ "unit": "px",
151
+ "knob": "size-token(5px)",
152
+ "offScale": false
153
+ },
154
+ "paddingRight": {
155
+ "value": 7,
156
+ "unit": "px",
157
+ "knob": "size-token(7px)",
158
+ "offScale": false
159
+ },
160
+ "paddingLeft": {
161
+ "value": 7,
162
+ "unit": "px",
163
+ "knob": "size-token(7px)",
164
+ "offScale": false
165
+ }
166
+ },
167
+ {
168
+ "label": "span.is_SizableText.is_Text.font_body",
169
+ "tag": "span",
170
+ "id": "",
171
+ "classes": ["is_SizableText", "is_Text", "font_body", "_textOverflow-ellipsis"],
172
+ "violations": [],
173
+ "fontWeight": {
174
+ "value": 300,
175
+ "unit": "px",
176
+ "knob": "light",
177
+ "offScale": false
178
+ }
179
+ },
180
+ {
181
+ "label": "div.is_View",
182
+ "tag": "div",
183
+ "id": "",
184
+ "classes": ["is_View"],
185
+ "violations": [],
186
+ "rowGap": {
187
+ "value": 13,
188
+ "unit": "px",
189
+ "knob": "medium",
190
+ "offScale": false
191
+ }
192
+ }
193
+ ]
194
+ }
Binary file