@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
@@ -333,36 +333,6 @@
333
333
  --screen-iphone-16-pro: 402px;
334
334
  --screen-macbook-air: 1280px;
335
335
  --screen-macbook-pro-16: 1728px;
336
- --size-0: 0px;
337
- --size-1: 4px;
338
- --size-2: 8px;
339
- --size-3: 12px;
340
- --size-4: 16px;
341
- --size-5: 20px;
342
- --size-6: 24px;
343
- --size-7: 28px;
344
- --size-8: 32px;
345
- --size-9: 36px;
346
- --size-10: 40px;
347
- --size-11: 44px;
348
- --size-12: 48px;
349
- --size-14: 56px;
350
- --size-16: 64px;
351
- --size-20: 80px;
352
- --size-24: 96px;
353
- --size-28: 112px;
354
- --size-32: 128px;
355
- --size-36: 144px;
356
- --size-40: 160px;
357
- --size-44: 176px;
358
- --size-48: 192px;
359
- --size-52: 208px;
360
- --size-56: 224px;
361
- --size-60: 240px;
362
- --size-64: 256px;
363
- --size-72: 288px;
364
- --size-80: 320px;
365
- --size-96: 384px;
366
336
  --spacing-0: 0px;
367
337
  --spacing-1: 4px;
368
338
  --spacing-2: 8px;
@@ -2897,218 +2897,6 @@
2897
2897
  }
2898
2898
  }
2899
2899
  },
2900
- "size": {
2901
- "0": {
2902
- "$type": "dimension",
2903
- "$value": {
2904
- "value": 0,
2905
- "unit": "px"
2906
- }
2907
- },
2908
- "1": {
2909
- "$type": "dimension",
2910
- "$value": {
2911
- "value": 4,
2912
- "unit": "px"
2913
- }
2914
- },
2915
- "2": {
2916
- "$type": "dimension",
2917
- "$value": {
2918
- "value": 8,
2919
- "unit": "px"
2920
- }
2921
- },
2922
- "3": {
2923
- "$type": "dimension",
2924
- "$value": {
2925
- "value": 12,
2926
- "unit": "px"
2927
- }
2928
- },
2929
- "4": {
2930
- "$type": "dimension",
2931
- "$value": {
2932
- "value": 16,
2933
- "unit": "px"
2934
- }
2935
- },
2936
- "5": {
2937
- "$type": "dimension",
2938
- "$value": {
2939
- "value": 20,
2940
- "unit": "px"
2941
- }
2942
- },
2943
- "6": {
2944
- "$type": "dimension",
2945
- "$value": {
2946
- "value": 24,
2947
- "unit": "px"
2948
- }
2949
- },
2950
- "7": {
2951
- "$type": "dimension",
2952
- "$value": {
2953
- "value": 28,
2954
- "unit": "px"
2955
- }
2956
- },
2957
- "8": {
2958
- "$type": "dimension",
2959
- "$value": {
2960
- "value": 32,
2961
- "unit": "px"
2962
- }
2963
- },
2964
- "9": {
2965
- "$type": "dimension",
2966
- "$value": {
2967
- "value": 36,
2968
- "unit": "px"
2969
- }
2970
- },
2971
- "10": {
2972
- "$type": "dimension",
2973
- "$value": {
2974
- "value": 40,
2975
- "unit": "px"
2976
- }
2977
- },
2978
- "11": {
2979
- "$type": "dimension",
2980
- "$value": {
2981
- "value": 44,
2982
- "unit": "px"
2983
- }
2984
- },
2985
- "12": {
2986
- "$type": "dimension",
2987
- "$value": {
2988
- "value": 48,
2989
- "unit": "px"
2990
- }
2991
- },
2992
- "14": {
2993
- "$type": "dimension",
2994
- "$value": {
2995
- "value": 56,
2996
- "unit": "px"
2997
- }
2998
- },
2999
- "16": {
3000
- "$type": "dimension",
3001
- "$value": {
3002
- "value": 64,
3003
- "unit": "px"
3004
- }
3005
- },
3006
- "20": {
3007
- "$type": "dimension",
3008
- "$value": {
3009
- "value": 80,
3010
- "unit": "px"
3011
- }
3012
- },
3013
- "24": {
3014
- "$type": "dimension",
3015
- "$value": {
3016
- "value": 96,
3017
- "unit": "px"
3018
- }
3019
- },
3020
- "28": {
3021
- "$type": "dimension",
3022
- "$value": {
3023
- "value": 112,
3024
- "unit": "px"
3025
- }
3026
- },
3027
- "32": {
3028
- "$type": "dimension",
3029
- "$value": {
3030
- "value": 128,
3031
- "unit": "px"
3032
- }
3033
- },
3034
- "36": {
3035
- "$type": "dimension",
3036
- "$value": {
3037
- "value": 144,
3038
- "unit": "px"
3039
- }
3040
- },
3041
- "40": {
3042
- "$type": "dimension",
3043
- "$value": {
3044
- "value": 160,
3045
- "unit": "px"
3046
- }
3047
- },
3048
- "44": {
3049
- "$type": "dimension",
3050
- "$value": {
3051
- "value": 176,
3052
- "unit": "px"
3053
- }
3054
- },
3055
- "48": {
3056
- "$type": "dimension",
3057
- "$value": {
3058
- "value": 192,
3059
- "unit": "px"
3060
- }
3061
- },
3062
- "52": {
3063
- "$type": "dimension",
3064
- "$value": {
3065
- "value": 208,
3066
- "unit": "px"
3067
- }
3068
- },
3069
- "56": {
3070
- "$type": "dimension",
3071
- "$value": {
3072
- "value": 224,
3073
- "unit": "px"
3074
- }
3075
- },
3076
- "60": {
3077
- "$type": "dimension",
3078
- "$value": {
3079
- "value": 240,
3080
- "unit": "px"
3081
- }
3082
- },
3083
- "64": {
3084
- "$type": "dimension",
3085
- "$value": {
3086
- "value": 256,
3087
- "unit": "px"
3088
- }
3089
- },
3090
- "72": {
3091
- "$type": "dimension",
3092
- "$value": {
3093
- "value": 288,
3094
- "unit": "px"
3095
- }
3096
- },
3097
- "80": {
3098
- "$type": "dimension",
3099
- "$value": {
3100
- "value": 320,
3101
- "unit": "px"
3102
- }
3103
- },
3104
- "96": {
3105
- "$type": "dimension",
3106
- "$value": {
3107
- "value": 384,
3108
- "unit": "px"
3109
- }
3110
- }
3111
- },
3112
2900
  "spacing": {
3113
2901
  "0": {
3114
2902
  "$type": "dimension",
@@ -30,4 +30,9 @@
30
30
  personalization curve as the rest of the scale instead of a fixed 9999px
31
31
  pill that ignores subtle/none/round wrap. */
32
32
  --radius-full: calc(var(--radius-xl) * 2);
33
+ /* True pill: a fixed 9999px that makes any box a circle or capsule at any size
34
+ and on every radius axis value. Use it where a component promises a circle
35
+ or pill (round buttons, avatars, switches, radios, dots); use --radius-full
36
+ for a large corner that follows the radius axis. */
37
+ --radius-pill: 9999px;
33
38
  }
@@ -95,6 +95,14 @@
95
95
  "io.atom63.derive": "calc({radius.xl} * 2)"
96
96
  },
97
97
  "$description": "Soft “full” = 2× md (already includes the multiplier). Stays on the same\npersonalization curve as the rest of the scale instead of a fixed 9999px\npill that ignores subtle/none/round wrap."
98
+ },
99
+ "pill": {
100
+ "$type": "dimension",
101
+ "$value": {
102
+ "value": 9999,
103
+ "unit": "px"
104
+ },
105
+ "$description": "True pill: a fixed 9999px that makes any box a circle or capsule at any size\nand on every radius axis value. Use it where a component promises a circle\nor pill (round buttons, avatars, switches, radios, dots); use --radius-full\nfor a large corner that follows the radius axis."
98
106
  }
99
107
  }
100
108
  }
@@ -16,6 +16,8 @@
16
16
  @import './typography.native.css';
17
17
 
18
18
  :root {
19
+ --typography-2xs-font-size: calc(11px * var(--typography-scale, 1));
20
+ --typography-2xs-line-height: calc(13px * var(--typography-scale, 1));
19
21
  --typography-xs-font-size: calc(12px * var(--typography-scale, 1));
20
22
  --typography-xs-line-height: calc(18px * var(--typography-scale, 1));
21
23
  --typography-sm-font-size: calc(13px * var(--typography-scale, 1));
@@ -42,6 +44,10 @@
42
44
  --typography-8xl-line-height: calc(44px * var(--typography-scale, 1));
43
45
  --typography-9xl-font-size: calc(39px * var(--typography-scale, 1));
44
46
  --typography-9xl-line-height: calc(49px * var(--typography-scale, 1));
47
+ --typography-10xl-font-size: calc(40px * var(--typography-scale, 1));
48
+ --typography-10xl-line-height: calc(44px * var(--typography-scale, 1));
49
+ --typography-11xl-font-size: calc(56px * var(--typography-scale, 1));
50
+ --typography-11xl-line-height: calc(60px * var(--typography-scale, 1));
45
51
  }
46
52
 
47
53
  @media (min-width: 40rem) {
@@ -91,6 +97,8 @@
91
97
  }
92
98
 
93
99
  [data-window-size='xs'] {
100
+ --typography-2xs-font-size: calc(11px * var(--typography-scale, 1));
101
+ --typography-2xs-line-height: calc(13px * var(--typography-scale, 1));
94
102
  --typography-xs-font-size: calc(12px * var(--typography-scale, 1));
95
103
  --typography-xs-line-height: calc(18px * var(--typography-scale, 1));
96
104
  --typography-sm-font-size: calc(13px * var(--typography-scale, 1));
@@ -117,9 +125,15 @@
117
125
  --typography-8xl-line-height: calc(44px * var(--typography-scale, 1));
118
126
  --typography-9xl-font-size: calc(39px * var(--typography-scale, 1));
119
127
  --typography-9xl-line-height: calc(49px * var(--typography-scale, 1));
128
+ --typography-10xl-font-size: calc(40px * var(--typography-scale, 1));
129
+ --typography-10xl-line-height: calc(44px * var(--typography-scale, 1));
130
+ --typography-11xl-font-size: calc(56px * var(--typography-scale, 1));
131
+ --typography-11xl-line-height: calc(60px * var(--typography-scale, 1));
120
132
  }
121
133
 
122
134
  [data-window-size='sm'] {
135
+ --typography-2xs-font-size: calc(11px * var(--typography-scale, 1));
136
+ --typography-2xs-line-height: calc(13px * var(--typography-scale, 1));
123
137
  --typography-xs-font-size: calc(12px * var(--typography-scale, 1));
124
138
  --typography-xs-line-height: calc(18px * var(--typography-scale, 1));
125
139
  --typography-sm-font-size: calc(13px * var(--typography-scale, 1));
@@ -146,11 +160,17 @@
146
160
  --typography-8xl-line-height: calc(49px * var(--typography-scale, 1));
147
161
  --typography-9xl-font-size: calc(44px * var(--typography-scale, 1));
148
162
  --typography-9xl-line-height: calc(55px * var(--typography-scale, 1));
163
+ --typography-10xl-font-size: calc(40px * var(--typography-scale, 1));
164
+ --typography-10xl-line-height: calc(44px * var(--typography-scale, 1));
165
+ --typography-11xl-font-size: calc(56px * var(--typography-scale, 1));
166
+ --typography-11xl-line-height: calc(60px * var(--typography-scale, 1));
149
167
  }
150
168
 
151
169
  [data-window-size='md'],
152
170
  [data-window-size='lg'],
153
171
  [data-window-size='xl'] {
172
+ --typography-2xs-font-size: calc(11px * var(--typography-scale, 1));
173
+ --typography-2xs-line-height: calc(13px * var(--typography-scale, 1));
154
174
  --typography-xs-font-size: calc(12px * var(--typography-scale, 1));
155
175
  --typography-xs-line-height: calc(18px * var(--typography-scale, 1));
156
176
  --typography-sm-font-size: calc(13px * var(--typography-scale, 1));
@@ -177,6 +197,10 @@
177
197
  --typography-8xl-line-height: calc(54px * var(--typography-scale, 1));
178
198
  --typography-9xl-font-size: calc(49px * var(--typography-scale, 1));
179
199
  --typography-9xl-line-height: calc(61px * var(--typography-scale, 1));
200
+ --typography-10xl-font-size: calc(40px * var(--typography-scale, 1));
201
+ --typography-10xl-line-height: calc(44px * var(--typography-scale, 1));
202
+ --typography-11xl-font-size: calc(56px * var(--typography-scale, 1));
203
+ --typography-11xl-line-height: calc(60px * var(--typography-scale, 1));
180
204
  }
181
205
 
182
206
  @layer base {
@@ -1,11 +1,21 @@
1
1
  /*
2
2
  * Element styles that belong with the type scale but are not tokens: <small>
3
- * uses the xs step. Kept next to typography.resolver.json, which generates the
4
- * scale itself; see docs/design-system/token-single-source.md.
3
+ * uses the xs step, and text without a size class takes the body role. Kept
4
+ * next to typography.resolver.json, which generates the scale itself; see
5
+ * docs/design-system/token-single-source.md.
5
6
  */
6
7
  @layer base {
7
8
  small {
8
9
  font-size: var(--typography-xs-font-size);
9
10
  line-height: var(--typography-xs-line-height);
10
11
  }
12
+
13
+ /* The body role (15/23 on the web, 17/22 on a phone), instead of the browser's
14
+ 16px and a 1.5 line height. Set on body, not html, so 1rem stays 16px. A phone
15
+ scope redeclares the role, so it sets the size again for the text inside it. */
16
+ body,
17
+ [data-a63-form-factor] {
18
+ font-size: var(--a63-type-body-font-size);
19
+ line-height: var(--a63-type-body-line-height);
20
+ }
11
21
  }
@@ -6,6 +6,30 @@
6
6
  "sources": [
7
7
  {
8
8
  "typography": {
9
+ "2xs": {
10
+ "font": {
11
+ "size": {
12
+ "$value": {
13
+ "value": 11,
14
+ "unit": "px"
15
+ },
16
+ "$extensions": {
17
+ "io.atom63.derive": "calc({$value} * var(--typography-scale, 1))"
18
+ }
19
+ }
20
+ },
21
+ "line": {
22
+ "height": {
23
+ "$value": {
24
+ "value": 13,
25
+ "unit": "px"
26
+ },
27
+ "$extensions": {
28
+ "io.atom63.derive": "calc({$value} * var(--typography-scale, 1))"
29
+ }
30
+ }
31
+ }
32
+ },
9
33
  "xs": {
10
34
  "font": {
11
35
  "size": {
@@ -317,6 +341,54 @@
317
341
  }
318
342
  }
319
343
  }
344
+ },
345
+ "10xl": {
346
+ "font": {
347
+ "size": {
348
+ "$value": {
349
+ "value": 40,
350
+ "unit": "px"
351
+ },
352
+ "$extensions": {
353
+ "io.atom63.derive": "calc({$value} * var(--typography-scale, 1))"
354
+ }
355
+ }
356
+ },
357
+ "line": {
358
+ "height": {
359
+ "$value": {
360
+ "value": 44,
361
+ "unit": "px"
362
+ },
363
+ "$extensions": {
364
+ "io.atom63.derive": "calc({$value} * var(--typography-scale, 1))"
365
+ }
366
+ }
367
+ }
368
+ },
369
+ "11xl": {
370
+ "font": {
371
+ "size": {
372
+ "$value": {
373
+ "value": 56,
374
+ "unit": "px"
375
+ },
376
+ "$extensions": {
377
+ "io.atom63.derive": "calc({$value} * var(--typography-scale, 1))"
378
+ }
379
+ }
380
+ },
381
+ "line": {
382
+ "height": {
383
+ "$value": {
384
+ "value": 60,
385
+ "unit": "px"
386
+ },
387
+ "$extensions": {
388
+ "io.atom63.derive": "calc({$value} * var(--typography-scale, 1))"
389
+ }
390
+ }
391
+ }
320
392
  }
321
393
  },
322
394
  "$type": "dimension"
@@ -3,6 +3,7 @@
3
3
  @import './radius.css';
4
4
  @import './type-scale.css';
5
5
  @import './font.css';
6
+ @import './type-roles.css';
6
7
  @import './motion.css';
7
8
  @import './semantics.css';
8
9
  @import './brand.css';
@@ -53,6 +53,19 @@ describe('radius scale axis', () => {
53
53
  probe.remove()
54
54
  })
55
55
 
56
+ it('keeps --radius-pill a fixed 9999px pill on every radius axis value', () => {
57
+ const probe = document.createElement('div')
58
+ probe.style.borderRadius = 'var(--radius-pill)'
59
+ document.body.appendChild(probe)
60
+
61
+ expect(getComputedStyle(probe).borderRadius).toBe('9999px')
62
+ for (const value of ['none', 'subtle', 'default', 'round']) {
63
+ root().setAttribute('data-a63-radius', value)
64
+ expect(getComputedStyle(probe).borderRadius).toBe('9999px')
65
+ }
66
+ probe.remove()
67
+ })
68
+
56
69
  it('keeps avatar radius circular by default while still following the radius axis', () => {
57
70
  const probe = document.createElement('div')
58
71
  probe.style.borderRadius = 'var(--a63-avatar-radius)'