@atom63/styles 0.1.0-beta.6 → 0.1.0-beta.8

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 (52) hide show
  1. package/README.md +7 -4
  2. package/generated/atom63.figma-sync.json +10559 -5138
  3. package/generated/atom63.tokens.json +13034 -7792
  4. package/package.json +6 -4
  5. package/src/compat/a63-from-shadcn.css +5 -1
  6. package/src/compat/shadcn.browser.test.ts +23 -0
  7. package/src/compat/shadcn.css +133 -17
  8. package/src/contracts/badge.css +81 -65
  9. package/src/contracts/badge.resolver.json +145 -62
  10. package/src/contracts/choice.css +1 -1
  11. package/src/contracts/choice.tokens.json +1 -1
  12. package/src/contracts/control.css +14 -8
  13. package/src/contracts/control.tokens.json +57 -8
  14. package/src/contracts/environment.css +134 -12
  15. package/src/contracts/environment.resolver.json +664 -23
  16. package/src/contracts/field.css +1 -1
  17. package/src/contracts/field.tokens.json +1 -1
  18. package/src/contracts/selection.css +2 -0
  19. package/src/contracts/selection.tokens.json +5 -0
  20. package/src/contracts/surface.css +4 -0
  21. package/src/contracts/surface.tokens.json +57 -0
  22. package/src/tailwind/roles.json +189 -0
  23. package/src/tailwind/theme.css +210 -22
  24. package/src/tailwind/utilities.css +17 -0
  25. package/src/themes/aqua.css +1 -0
  26. package/src/themes/aqua.resolver.json +6 -0
  27. package/src/themes/retro.css +1 -0
  28. package/src/themes/retro.resolver.json +6 -0
  29. package/src/themes/terminal.css +8 -0
  30. package/src/themes/terminal.resolver.json +37 -0
  31. package/src/tokens/brand-action.css +16 -1
  32. package/src/tokens/brand-action.resolver.json +42 -5
  33. package/src/tokens/contrast.browser.test.ts +59 -0
  34. package/src/tokens/density.browser.test.ts +167 -0
  35. package/src/tokens/figma-parity.browser.test.ts +27 -14
  36. package/src/tokens/form-factor.browser.test.ts +129 -0
  37. package/src/tokens/foundation/primitives.css +0 -30
  38. package/src/tokens/foundation/primitives.tokens.json +0 -212
  39. package/src/tokens/foundation/radius.css +5 -0
  40. package/src/tokens/foundation/radius.tokens.json +8 -0
  41. package/src/tokens/foundation/typography.css +24 -0
  42. package/src/tokens/foundation/typography.native.css +12 -2
  43. package/src/tokens/foundation/typography.resolver.json +72 -0
  44. package/src/tokens/index.css +1 -0
  45. package/src/tokens/personalization-axes.browser.test.ts +13 -0
  46. package/src/tokens/semantics.css +251 -4
  47. package/src/tokens/semantics.resolver.json +1148 -12
  48. package/src/tokens/surface.css +8 -0
  49. package/src/tokens/surface.resolver.json +49 -0
  50. package/src/tokens/swift-parity.browser.test.ts +4 -0
  51. package/src/tokens/type-roles.css +75 -0
  52. package/src/tokens/type-roles.resolver.json +366 -0
@@ -7,7 +7,7 @@
7
7
  "$type": "dimension",
8
8
  "$value": "{a63.space.unit}",
9
9
  "$extensions": {
10
- "io.atom63.derive": "calc({a63.space.unit} * 6)"
10
+ "io.atom63.derive": "round(nearest, calc({a63.space.unit} * 6), 1px)"
11
11
  },
12
12
  "$description": "Height ramp (xs..xl) — web defaults (desktop density: 24/28/32/36/40, to\n match production @atom63/ui). iOS overrides in environment.css."
13
13
  },
@@ -15,28 +15,28 @@
15
15
  "$type": "dimension",
16
16
  "$value": "{a63.space.unit}",
17
17
  "$extensions": {
18
- "io.atom63.derive": "calc({a63.space.unit} * 7)"
18
+ "io.atom63.derive": "round(nearest, calc({a63.space.unit} * 7), 1px)"
19
19
  }
20
20
  },
21
21
  "md": {
22
22
  "$type": "dimension",
23
23
  "$value": "{a63.space.unit}",
24
24
  "$extensions": {
25
- "io.atom63.derive": "calc({a63.space.unit} * 8)"
25
+ "io.atom63.derive": "round(nearest, calc({a63.space.unit} * 8), 1px)"
26
26
  }
27
27
  },
28
28
  "lg": {
29
29
  "$type": "dimension",
30
30
  "$value": "{a63.space.unit}",
31
31
  "$extensions": {
32
- "io.atom63.derive": "calc({a63.space.unit} * 9)"
32
+ "io.atom63.derive": "round(nearest, calc({a63.space.unit} * 9), 1px)"
33
33
  }
34
34
  },
35
35
  "xl": {
36
36
  "$type": "dimension",
37
37
  "$value": "{a63.space.unit}",
38
38
  "$extensions": {
39
- "io.atom63.derive": "calc({a63.space.unit} * 10)"
39
+ "io.atom63.derive": "round(nearest, calc({a63.space.unit} * 10), 1px)"
40
40
  }
41
41
  }
42
42
  },
@@ -145,6 +145,46 @@
145
145
  "unit": "rem"
146
146
  }
147
147
  }
148
+ },
149
+ "only": {
150
+ "size": {
151
+ "xs": {
152
+ "$type": "dimension",
153
+ "$value": {
154
+ "value": 0.875,
155
+ "unit": "rem"
156
+ },
157
+ "$description": "The glyph of an icon-only control (24/14, 28/16, 32/18, 36/20, 40/22): about 0.56 of the box, where an icon beside a label keeps the size ramp above. The iOS design language and the phone form factor already draw that ramp at these values on their taller boxes, so they need no override."
158
+ },
159
+ "sm": {
160
+ "$type": "dimension",
161
+ "$value": {
162
+ "value": 1,
163
+ "unit": "rem"
164
+ }
165
+ },
166
+ "md": {
167
+ "$type": "dimension",
168
+ "$value": {
169
+ "value": 1.125,
170
+ "unit": "rem"
171
+ }
172
+ },
173
+ "lg": {
174
+ "$type": "dimension",
175
+ "$value": {
176
+ "value": 1.25,
177
+ "unit": "rem"
178
+ }
179
+ },
180
+ "xl": {
181
+ "$type": "dimension",
182
+ "$value": {
183
+ "value": 1.375,
184
+ "unit": "rem"
185
+ }
186
+ }
187
+ }
148
188
  }
149
189
  },
150
190
  "gap": {
@@ -223,15 +263,24 @@
223
263
  "xs": {
224
264
  "$type": "dimension",
225
265
  "$value": "{a63.space.2}",
226
- "$description": "Row block padding. Rows (Item today; Menu/Command rows are the intended\n next tenants) take their height from content + this padding, floored by the\n control ramp, so a single-line row lands on ~44pt and a two-line row on\n ~59pt. Those targets come from our own measurement of shipping iOS apps\n (docs/design-system/web-ios-token-parity.md) — Apple publishes no iOS row\n height, so do not cite UIKit cell metrics for them. It lives here rather\n than in the recipe\n because the design-language axis has to retune it (contracts/environment.css)\n and axes own tokens; recipes only read them."
266
+ "$description": "Row block padding. Rows (Item today; Menu/Command rows are the intended\n next tenants) take their height from content + this padding, floored by the\n control ramp, so a single-line row lands on ~44pt and a two-line row on\n ~59pt. Those targets come from our own measurement of shipping iOS apps\n (docs/design-system/web-ios-token-parity.md) — Apple publishes no iOS row\n height, so do not cite UIKit cell metrics for them. It lives here rather\n than in the recipe\n because the design-language axis has to retune it (contracts/environment.css)\n and axes own tokens; recipes only read them.",
267
+ "$extensions": {
268
+ "io.atom63.derive": "round(nearest, {a63.space.2}, 1px)"
269
+ }
227
270
  },
228
271
  "sm": {
229
272
  "$type": "dimension",
230
- "$value": "{a63.space.3}"
273
+ "$value": "{a63.space.3}",
274
+ "$extensions": {
275
+ "io.atom63.derive": "round(nearest, {a63.space.3}, 1px)"
276
+ }
231
277
  },
232
278
  "md": {
233
279
  "$type": "dimension",
234
- "$value": "{a63.space.4}"
280
+ "$value": "{a63.space.4}",
281
+ "$extensions": {
282
+ "io.atom63.derive": "round(nearest, {a63.space.4}, 1px)"
283
+ }
235
284
  }
236
285
  }
237
286
  }
@@ -16,7 +16,11 @@
16
16
  * Prevent focus zoom in mobile Safari without inflating non-editable control
17
17
  * labels. Editable recipes combine this floor with their normal type token.
18
18
  *
19
- * Density — proportional rhythm
19
+ * Density — proportional rhythm. A density scope sets --a63-space-unit, and every :root token
20
+ * built on it (the space steps, control heights and paddings, row padding, gaps) is declared
21
+ * again on [data-a63-density], so a nested scope recomputes them once, the same as the root.
22
+ * The design-language and phone scopes are also declared on a density scope inside them, so
23
+ * it keeps their sizes.
20
24
  *
21
25
  * Auto-detect coarse pointers. Without this, touch ergonomics only apply when an
22
26
  * app explicitly passes `input` to UIProvider — an opt-in almost nothing does, so
@@ -31,10 +35,16 @@
31
35
  * Design language — component sizing/proportions + interaction feedback only.
32
36
  * The base :root (control.css) is the web default; iOS overrides sizing + feel.
33
37
  * No radius, color, or touch-target here.
38
+ *
39
+ * Form factor — a phone screen. [data-a63-form-factor='phone'] sets the type steps and the
40
+ * control sizing of a phone (iOS text sizes: body 17, subheadline 15, footnote 13). Viewport
41
+ * width does not apply it; a phone layout stamps it (AppView layout="phone"). The type roles
42
+ * are redeclared on the same scope (type-roles.css), so text-body and the other roles follow it.
34
43
  */
35
44
  @import './environment.native.css';
36
45
 
37
46
  :root {
47
+ /* An extra multiplier recipes apply to control heights. It stays 1 in every density: density reaches sizes through --a63-space-unit, which the control heights are built on, so scaling them again would shrink controls twice. */
38
48
  --a63-density-scale: 1;
39
49
  --a63-editable-font-size-min: 0px;
40
50
  /* Two different numbers, deliberately separate:
@@ -73,15 +83,48 @@
73
83
  }
74
84
 
75
85
  :is([data-a63-density='compact'], [data-density='compact']) {
76
- --a63-density-scale: 0.9;
77
86
  --a63-space-unit: calc(var(--spacing-1) * 0.875);
78
87
  }
79
88
 
80
89
  :is([data-a63-density='comfortable'], [data-density='comfortable']) {
81
- --a63-density-scale: 1;
82
90
  --a63-space-unit: var(--spacing-1);
83
91
  }
84
92
 
93
+ :is([data-a63-density], [data-density]) {
94
+ --a63-space-1: var(--a63-space-unit);
95
+ --a63-space-2: calc(var(--a63-space-unit) * 2);
96
+ --a63-space-3: calc(var(--a63-space-unit) * 3);
97
+ --a63-space-4: calc(var(--a63-space-unit) * 4);
98
+ --a63-space-5: calc(var(--a63-space-unit) * 5);
99
+ --a63-space-6: calc(var(--a63-space-unit) * 6);
100
+ --a63-space-0_5: calc(var(--a63-space-unit) * 0.5);
101
+ --a63-space-1_5: calc(var(--a63-space-unit) * 1.5);
102
+ --a63-space-2_5: calc(var(--a63-space-unit) * 2.5);
103
+ --a63-space-3_5: calc(var(--a63-space-unit) * 3.5);
104
+ --a63-action-control-gap: var(--a63-control-gap);
105
+ --a63-control-height-xs: round(nearest, calc(var(--a63-space-unit) * 6), 1px);
106
+ --a63-control-height-sm: round(nearest, calc(var(--a63-space-unit) * 7), 1px);
107
+ --a63-control-height-md: round(nearest, calc(var(--a63-space-unit) * 8), 1px);
108
+ --a63-control-height-lg: round(nearest, calc(var(--a63-space-unit) * 9), 1px);
109
+ --a63-control-height-xl: round(nearest, calc(var(--a63-space-unit) * 10), 1px);
110
+ --a63-control-padding-inline-xs: var(--a63-space-2);
111
+ --a63-control-padding-inline-sm: var(--a63-space-2_5);
112
+ --a63-control-padding-inline-md: var(--a63-space-3);
113
+ --a63-control-padding-inline-lg: var(--a63-space-3_5);
114
+ --a63-control-padding-inline-xl: var(--a63-space-4);
115
+ --a63-control-gap: var(--a63-space-2);
116
+ --a63-row-padding-block-xs: round(nearest, var(--a63-space-2), 1px);
117
+ --a63-row-padding-block-sm: round(nearest, var(--a63-space-3), 1px);
118
+ --a63-row-padding-block-md: round(nearest, var(--a63-space-4), 1px);
119
+ --a63-menu-popup-padding: var(--a63-space-1);
120
+ --a63-menu-item-padding-block: var(--a63-space-1_5);
121
+ --a63-menu-item-padding-inline: var(--a63-space-2);
122
+ --a63-menu-item-gap: var(--a63-space-2);
123
+ --a63-menu-gap: var(--a63-space-0_5);
124
+ --a63-toggle-gap: var(--a63-control-gap);
125
+ --a63-trigger-gap: var(--a63-control-gap);
126
+ }
127
+
85
128
  @media (pointer: coarse) {
86
129
  :root {
87
130
  --a63-control-min-size: 2rem;
@@ -119,12 +162,14 @@
119
162
  --a63-row-min-size: var(--a63-control-min-size);
120
163
  }
121
164
 
122
- :is([data-a63-design-language='ios'], [data-design-language='ios']) {
123
- --a63-control-height-xs: calc(var(--a63-space-unit) * 9);
124
- --a63-control-height-sm: calc(var(--a63-space-unit) * 10);
125
- --a63-control-height-md: calc(var(--a63-space-unit) * 11);
126
- --a63-control-height-lg: calc(var(--a63-space-unit) * 12);
127
- --a63-control-height-xl: calc(var(--a63-space-unit) * 13);
165
+ :is([data-a63-design-language='ios'], [data-design-language='ios']),
166
+ :is([data-a63-design-language='ios'], [data-design-language='ios'])
167
+ :is([data-a63-density], [data-density]) {
168
+ --a63-control-height-xs: round(nearest, calc(var(--a63-space-unit) * 9), 1px);
169
+ --a63-control-height-sm: round(nearest, calc(var(--a63-space-unit) * 10), 1px);
170
+ --a63-control-height-md: round(nearest, calc(var(--a63-space-unit) * 11), 1px);
171
+ --a63-control-height-lg: round(nearest, calc(var(--a63-space-unit) * 12), 1px);
172
+ --a63-control-height-xl: round(nearest, calc(var(--a63-space-unit) * 13), 1px);
128
173
  --a63-control-padding-inline-xs: var(--a63-space-3);
129
174
  --a63-control-padding-inline-sm: var(--a63-space-3_5);
130
175
  --a63-control-padding-inline-md: var(--a63-space-4);
@@ -146,9 +191,86 @@
146
191
  so a single-line row lands on 44pt and a two-line row on ~59pt, instead of
147
192
  52pt and 75pt. Targets are from our measurement study, not a published
148
193
  Apple row height — there isn't one. */
149
- --a63-row-padding-block-xs: var(--a63-space-1);
150
- --a63-row-padding-block-sm: var(--a63-space-1_5);
151
- --a63-row-padding-block-md: var(--a63-space-2);
194
+ --a63-row-padding-block-xs: round(nearest, var(--a63-space-1), 1px);
195
+ --a63-row-padding-block-sm: round(nearest, var(--a63-space-1_5), 1px);
196
+ --a63-row-padding-block-md: round(nearest, var(--a63-space-2), 1px);
152
197
  /* Larger, iconic iOS pill switch (web default is 1rem in selection.css). */
153
198
  --a63-switch-thumb-size: 1.375rem;
154
199
  }
200
+
201
+ [data-a63-form-factor='phone'],
202
+ [data-a63-form-factor='phone'] :is([data-a63-density], [data-density]) {
203
+ /* The type steps of a phone screen, after the iOS text styles at the default Dynamic Type size:
204
+ body 17 (base), subheadline 15 (sm), footnote 13 (xs), caption2 11 (2xs), title3 20 (2xl),
205
+ title2 22 (3xl), title1 28 (5xl), largeTitle 34 (6xl). Steps without an iOS style keep the
206
+ scale in order. Complete, so the phone scope wins over the viewport and window steps. */
207
+ --typography-2xs-font-size: calc(11px * var(--typography-scale, 1));
208
+ --typography-2xs-line-height: calc(13px * var(--typography-scale, 1));
209
+ --typography-xs-font-size: calc(13px * var(--typography-scale, 1));
210
+ --typography-xs-line-height: calc(18px * var(--typography-scale, 1));
211
+ --typography-sm-font-size: calc(15px * var(--typography-scale, 1));
212
+ --typography-sm-line-height: calc(20px * var(--typography-scale, 1));
213
+ --typography-base-font-size: calc(17px * var(--typography-scale, 1));
214
+ --typography-base-line-height: calc(22px * var(--typography-scale, 1));
215
+ --typography-lg-font-size: calc(18px * var(--typography-scale, 1));
216
+ --typography-lg-line-height: calc(24px * var(--typography-scale, 1));
217
+ --typography-xl-font-size: calc(19px * var(--typography-scale, 1));
218
+ --typography-xl-line-height: calc(24px * var(--typography-scale, 1));
219
+ --typography-2xl-font-size: calc(20px * var(--typography-scale, 1));
220
+ --typography-2xl-line-height: calc(25px * var(--typography-scale, 1));
221
+ --typography-3xl-font-size: calc(22px * var(--typography-scale, 1));
222
+ --typography-3xl-line-height: calc(28px * var(--typography-scale, 1));
223
+ --typography-4xl-font-size: calc(25px * var(--typography-scale, 1));
224
+ --typography-4xl-line-height: calc(31px * var(--typography-scale, 1));
225
+ --typography-5xl-font-size: calc(28px * var(--typography-scale, 1));
226
+ --typography-5xl-line-height: calc(34px * var(--typography-scale, 1));
227
+ --typography-6xl-font-size: calc(34px * var(--typography-scale, 1));
228
+ --typography-6xl-line-height: calc(41px * var(--typography-scale, 1));
229
+ --typography-7xl-font-size: calc(36px * var(--typography-scale, 1));
230
+ --typography-7xl-line-height: calc(44px * var(--typography-scale, 1));
231
+ --typography-8xl-font-size: calc(39px * var(--typography-scale, 1));
232
+ --typography-8xl-line-height: calc(49px * var(--typography-scale, 1));
233
+ --typography-9xl-font-size: calc(44px * var(--typography-scale, 1));
234
+ --typography-9xl-line-height: calc(55px * var(--typography-scale, 1));
235
+ --typography-10xl-font-size: calc(40px * var(--typography-scale, 1));
236
+ --typography-10xl-line-height: calc(44px * var(--typography-scale, 1));
237
+ --typography-11xl-font-size: calc(56px * var(--typography-scale, 1));
238
+ --typography-11xl-line-height: calc(60px * var(--typography-scale, 1));
239
+ /* Controls on a phone: the iOS height ramp (36/40/44/48/52), and every standard control label
240
+ at body size (17), as iOS sets buttons, rows, fields and menus. xs stays at footnote size
241
+ for badges, shortcuts and initials. Weight and press feedback stay with the design language. */
242
+ --a63-control-height-xs: round(nearest, calc(var(--a63-space-unit) * 9), 1px);
243
+ --a63-control-height-sm: round(nearest, calc(var(--a63-space-unit) * 10), 1px);
244
+ --a63-control-height-md: round(nearest, calc(var(--a63-space-unit) * 11), 1px);
245
+ --a63-control-height-lg: round(nearest, calc(var(--a63-space-unit) * 12), 1px);
246
+ --a63-control-height-xl: round(nearest, calc(var(--a63-space-unit) * 13), 1px);
247
+ --a63-control-padding-inline-xs: var(--a63-space-3);
248
+ --a63-control-padding-inline-sm: var(--a63-space-3_5);
249
+ --a63-control-padding-inline-md: var(--a63-space-4);
250
+ --a63-control-padding-inline-lg: var(--a63-space-5);
251
+ --a63-control-padding-inline-xl: var(--a63-space-6);
252
+ --a63-control-font-size-xs: var(--typography-xs-font-size);
253
+ --a63-control-font-size-sm: var(--typography-base-font-size);
254
+ --a63-control-font-size-md: var(--typography-base-font-size);
255
+ --a63-control-font-size-lg: var(--typography-base-font-size);
256
+ --a63-control-font-size-xl: var(--typography-lg-font-size);
257
+ /* The secondary line under a title or label (an Item, Field or Form description, a Frame or
258
+ ConnectedPanel description): subheadline size (15), so it stays below the 17px title. Declared
259
+ only here; recipes fall back to --a63-control-font-size-sm, so other scopes are unchanged. */
260
+ --a63-control-font-size-secondary: var(--typography-sm-font-size);
261
+ --a63-control-icon-size-xs: 0.875rem;
262
+ --a63-control-icon-size-sm: 1rem;
263
+ --a63-control-icon-size-md: 1.125rem;
264
+ --a63-control-icon-size-lg: 1.25rem;
265
+ --a63-control-icon-size-xl: 1.375rem;
266
+ --a63-row-padding-block-xs: round(nearest, var(--a63-space-1), 1px);
267
+ --a63-row-padding-block-sm: round(nearest, var(--a63-space-1_5), 1px);
268
+ --a63-row-padding-block-md: round(nearest, var(--a63-space-2), 1px);
269
+ /* The switch of a phone (iOS 26): a 22px-tall pill knob 1.6 times as wide, on a track of about 63 by 28, as measured on a 3x iPhone screenshot. The height matches the iOS design language; the wide thumb is the phone's own. */
270
+ --a63-switch-thumb-size: 1.375rem;
271
+ --a63-switch-thumb-aspect: 1.6;
272
+ /* The row of a phone's grouped list (ItemGroup variant="inset", default and sm rows): 52px tall, as iOS 26 Settings and a 3x reference capture both measure (51-52pt). Declared only here; the Item recipe falls back to its control-height floor elsewhere. */
273
+ --a63-inset-row-min-size: round(nearest, calc(var(--a63-space-unit) * 13), 1px);
274
+ /* The corner of a phone's grouped-list card (ItemGroup variant="inset"): the 2xl step (18px at defaults), after a 3x reference capture that fits a 19pt corner. Follows the radius axis. Declared only here; the Item recipe falls back to --radius-lg elsewhere. */
275
+ --a63-inset-group-radius: var(--radius-2xl);
276
+ }