@atom63/styles 0.1.0-beta.5 → 0.1.0-beta.7

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 (100) hide show
  1. package/README.md +16 -10
  2. package/generated/atom63.figma-sync.json +12897 -6323
  3. package/generated/atom63.tokens.json +8778 -3550
  4. package/package.json +8 -7
  5. package/src/compat/a63-from-shadcn.css +10 -0
  6. package/src/compat/shadcn.browser.test.ts +23 -0
  7. package/src/compat/shadcn.css +118 -16
  8. package/src/contracts/action.css +4 -3
  9. package/src/contracts/action.native.css +11 -0
  10. package/src/contracts/action.tokens.json +66 -0
  11. package/src/contracts/badge.css +83 -58
  12. package/src/contracts/badge.resolver.json +449 -0
  13. package/src/contracts/choice.css +4 -1
  14. package/src/contracts/choice.native.css +9 -0
  15. package/src/contracts/choice.tokens.json +66 -0
  16. package/src/contracts/control.css +43 -52
  17. package/src/contracts/control.native.css +13 -0
  18. package/src/contracts/control.tokens.json +245 -0
  19. package/src/contracts/environment.css +45 -49
  20. package/src/contracts/environment.native.css +23 -0
  21. package/src/contracts/environment.resolver.json +569 -0
  22. package/src/contracts/field.css +3 -1
  23. package/src/contracts/field.tokens.json +40 -0
  24. package/src/contracts/marker.css +6 -4
  25. package/src/contracts/marker.tokens.json +15 -0
  26. package/src/contracts/menu.css +25 -61
  27. package/src/contracts/menu.native.css +10 -0
  28. package/src/contracts/menu.resolver.json +122 -0
  29. package/src/contracts/overlay.css +11 -13
  30. package/src/contracts/overlay.native.css +13 -0
  31. package/src/contracts/overlay.tokens.json +103 -0
  32. package/src/contracts/segment.css +22 -68
  33. package/src/contracts/segment.tokens.json +19 -0
  34. package/src/contracts/selection.css +3 -1
  35. package/src/contracts/selection.tokens.json +37 -0
  36. package/src/contracts/skeleton.css +3 -0
  37. package/src/contracts/skeleton.resolver.json +66 -0
  38. package/src/contracts/surface.css +13 -24
  39. package/src/contracts/surface.native.css +17 -0
  40. package/src/contracts/surface.tokens.json +97 -0
  41. package/src/contracts/toggle.css +3 -1
  42. package/src/contracts/toggle.tokens.json +49 -0
  43. package/src/contracts/track.css +3 -1
  44. package/src/contracts/track.tokens.json +39 -0
  45. package/src/contracts/trigger.css +5 -2
  46. package/src/contracts/trigger.native.css +9 -0
  47. package/src/contracts/trigger.tokens.json +58 -0
  48. package/src/contracts/widget.css +41 -51
  49. package/src/contracts/widget.native.css +23 -0
  50. package/src/contracts/widget.resolver.json +1104 -0
  51. package/src/tailwind/roles.json +172 -0
  52. package/src/tailwind/theme.css +107 -23
  53. package/src/themes/aqua.css +24 -89
  54. package/src/themes/aqua.native.css +80 -0
  55. package/src/themes/aqua.resolver.json +1292 -0
  56. package/src/themes/modern.css +10 -14
  57. package/src/themes/modern.native.css +16 -0
  58. package/src/themes/modern.resolver.json +350 -0
  59. package/src/themes/retro.css +21 -26
  60. package/src/themes/retro.native.css +16 -0
  61. package/src/themes/retro.resolver.json +788 -0
  62. package/src/themes/terminal.css +34 -41
  63. package/src/themes/terminal.native.css +22 -0
  64. package/src/themes/terminal.resolver.json +517 -0
  65. package/src/tokens/brand-action.css +61 -0
  66. package/src/tokens/brand-action.resolver.json +137 -0
  67. package/src/tokens/brand-ramp.css +108 -0
  68. package/src/tokens/brand-ramp.resolver.json +418 -0
  69. package/src/tokens/brand.css +6 -146
  70. package/src/tokens/color-mix-space.browser.test.ts +79 -0
  71. package/src/tokens/contrast.browser.test.ts +82 -3
  72. package/src/tokens/figma-parity.browser.test.ts +270 -0
  73. package/src/tokens/font.css +6 -0
  74. package/src/tokens/font.resolver.json +107 -0
  75. package/src/tokens/foundation/effects.css +13 -13
  76. package/src/tokens/foundation/effects.resolver.json +433 -0
  77. package/src/tokens/foundation/fonts.css +3 -1
  78. package/src/tokens/foundation/fonts.tokens.json +6 -1
  79. package/src/tokens/foundation/radius.css +6 -9
  80. package/src/tokens/foundation/radius.tokens.json +100 -0
  81. package/src/tokens/foundation/typography.css +25 -12
  82. package/src/tokens/foundation/typography.native.css +11 -0
  83. package/src/tokens/foundation/typography.resolver.json +936 -0
  84. package/src/tokens/foundation.css +0 -1
  85. package/src/tokens/motion.css +3 -1
  86. package/src/tokens/motion.resolver.json +135 -0
  87. package/src/tokens/native-values.json +38 -0
  88. package/src/tokens/personalization-axes.browser.test.ts +5 -3
  89. package/src/tokens/radius.css +12 -8
  90. package/src/tokens/radius.resolver.json +138 -0
  91. package/src/tokens/semantics.css +211 -47
  92. package/src/tokens/semantics.resolver.json +1296 -0
  93. package/src/tokens/space.css +8 -6
  94. package/src/tokens/space.tokens.json +78 -0
  95. package/src/tokens/swift-parity.browser.test.ts +141 -0
  96. package/src/tokens/type-scale.css +6 -0
  97. package/src/tokens/type-scale.resolver.json +67 -0
  98. package/generated/atom63.figma-tokens.json +0 -21661
  99. package/src/tokens/foundation/aliases.css +0 -32
  100. package/src/tokens/foundation/aliases.tokens.json +0 -105
@@ -7,7 +7,6 @@
7
7
  */
8
8
  @import './foundation/primitives.css';
9
9
  @import './foundation/palette.css';
10
- @import './foundation/aliases.css';
11
10
  @import './foundation/effects.css';
12
11
  @import './foundation/radius.css';
13
12
  @import './foundation/fonts.css';
@@ -1,10 +1,12 @@
1
1
  /*
2
+ * Generated from src/tokens/motion.resolver.json by scripts/build-css-from-dtcg.mjs. Do not edit;
3
+ * change the DTCG source and run `pnpm --filter @atom63/styles generate:tokens`.
4
+ *
2
5
  * Motion contract.
3
6
  *
4
7
  * The interaction-timing intents the system uses. Raw --duration-* / --ease-*
5
8
  * primitives remain available for anything else.
6
9
  */
7
-
8
10
  :root {
9
11
  --a63-motion-duration-fast: var(--duration-fast);
10
12
  --a63-motion-duration-overlay: var(--duration-overlay);
@@ -0,0 +1,135 @@
1
+ {
2
+ "version": "2025.10",
3
+ "description": "Motion contract.\n\nThe interaction-timing intents the system uses. Raw --duration-* / --ease-*\nprimitives remain available for anything else.",
4
+ "sets": {
5
+ "01-root": {
6
+ "sources": [
7
+ {
8
+ "a63": {
9
+ "motion": {
10
+ "duration": {
11
+ "fast": {
12
+ "$type": "duration",
13
+ "$value": "{duration.fast}"
14
+ },
15
+ "overlay": {
16
+ "$type": "duration",
17
+ "$value": "{duration.overlay}"
18
+ },
19
+ "swipe": {
20
+ "dismiss": {
21
+ "$type": "duration",
22
+ "$value": "{duration.swipe.dismiss}"
23
+ }
24
+ }
25
+ },
26
+ "ease": {
27
+ "overlay": {
28
+ "$type": "cubicBezier",
29
+ "$value": "{ease.overlay}"
30
+ },
31
+ "scrim": {
32
+ "$type": "cubicBezier",
33
+ "$value": "{ease.scrim}"
34
+ },
35
+ "standard": {
36
+ "$type": "cubicBezier",
37
+ "$value": "{ease.standard}"
38
+ },
39
+ "emphasized": {
40
+ "$type": "cubicBezier",
41
+ "$value": "{ease.emphasized}"
42
+ }
43
+ },
44
+ "control": {
45
+ "feedback": {
46
+ "duration": {
47
+ "$type": "duration",
48
+ "$value": "{a63.motion.duration.fast}"
49
+ }
50
+ }
51
+ },
52
+ "skeleton": {
53
+ "shimmer": {
54
+ "duration": {
55
+ "$type": "duration",
56
+ "$value": "{duration.1500}"
57
+ }
58
+ }
59
+ }
60
+ }
61
+ }
62
+ }
63
+ ],
64
+ "$extensions": {
65
+ "io.atom63.css": {
66
+ "selector": ":root"
67
+ }
68
+ }
69
+ },
70
+ "02-media-prefers-reduced-motion-reduce-root": {
71
+ "sources": [
72
+ {
73
+ "a63": {
74
+ "motion": {
75
+ "control": {
76
+ "feedback": {
77
+ "duration": {
78
+ "$type": "duration",
79
+ "$value": {
80
+ "value": 0,
81
+ "unit": "ms"
82
+ }
83
+ }
84
+ }
85
+ },
86
+ "duration": {
87
+ "overlay": {
88
+ "$type": "duration",
89
+ "$value": {
90
+ "value": 0,
91
+ "unit": "ms"
92
+ }
93
+ },
94
+ "swipe": {
95
+ "dismiss": {
96
+ "$type": "duration",
97
+ "$value": {
98
+ "value": 0,
99
+ "unit": "ms"
100
+ }
101
+ }
102
+ }
103
+ },
104
+ "skeleton": {
105
+ "shimmer": {
106
+ "duration": {
107
+ "$type": "duration",
108
+ "$value": {
109
+ "value": 0,
110
+ "unit": "ms"
111
+ }
112
+ }
113
+ }
114
+ }
115
+ }
116
+ }
117
+ }
118
+ ],
119
+ "$extensions": {
120
+ "io.atom63.css": {
121
+ "selector": ":root",
122
+ "atRule": "@media (prefers-reduced-motion: reduce)"
123
+ }
124
+ }
125
+ }
126
+ },
127
+ "resolutionOrder": [
128
+ {
129
+ "$ref": "#/sets/01-root"
130
+ },
131
+ {
132
+ "$ref": "#/sets/02-media-prefers-reduced-motion-reduce-root"
133
+ }
134
+ ]
135
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "$description": "CSS-native token values: values with no DTCG type, declared by hand in *.native.css files. Each entry says why it cannot be a DTCG token. build-css-from-dtcg.mjs --check fails on an unlisted declaration or a stale entry. See docs/design-system/token-single-source.md.",
3
+ "values": {
4
+ "--a63-action-control-gloss": "A background-image layer (default none, a gradient in glossy themes); DTCG has no image or gradient type.",
5
+ "--a63-action-control-highlight": "A background-image layer (default none, a gradient in glossy themes); DTCG has no image or gradient type.",
6
+ "--a63-action-control-press-transform": "A CSS transform (translateY / scale); DTCG has no transform type.",
7
+ "--a63-choice-indicator-gloss": "A background-image layer (default none, a gradient in glossy themes); DTCG has no image or gradient type.",
8
+ "--a63-control-gloss": "A background-image layer (default none, a gradient in glossy themes); DTCG has no image or gradient type.",
9
+ "--a63-control-highlight": "A background-image layer (default none, a gradient in glossy themes); DTCG has no image or gradient type.",
10
+ "--a63-control-press-transform": "A CSS transform (translateY / scale); DTCG has no transform type.",
11
+ "--a63-menu-highlight-gloss": "A background-image layer (default none, a gradient in glossy themes); DTCG has no image or gradient type.",
12
+ "--a63-menu-popup-gloss": "A background-image layer (default none, a gradient in glossy themes); DTCG has no image or gradient type.",
13
+ "--a63-overlay-backdrop": "A backdrop-filter value (default none, blur in translucent themes); DTCG has no filter type.",
14
+ "--a63-overlay-gloss": "A background-image layer (default none, a gradient in glossy themes); DTCG has no image or gradient type.",
15
+ "--a63-overlay-highlight": "A background-image layer (default none, a gradient in glossy themes); DTCG has no image or gradient type.",
16
+ "--a63-overlay-texture-blend": "A mix-blend-mode keyword; DTCG has no blend-mode type.",
17
+ "--a63-overlay-texture-image": "A background-image texture (default none); DTCG has no image type.",
18
+ "--a63-safe-area-bottom": "env(safe-area-inset-*, 0px): a device value only the browser knows; DTCG has no environment-variable value.",
19
+ "--a63-safe-area-left": "env(safe-area-inset-*, 0px): a device value only the browser knows; DTCG has no environment-variable value.",
20
+ "--a63-safe-area-right": "env(safe-area-inset-*, 0px): a device value only the browser knows; DTCG has no environment-variable value.",
21
+ "--a63-safe-area-top": "env(safe-area-inset-*, 0px): a device value only the browser knows; DTCG has no environment-variable value.",
22
+ "--a63-segment-gloss": "A background-image layer (default none, a gradient in glossy themes); DTCG has no image or gradient type.",
23
+ "--a63-segment-selected-gloss": "A background-image layer (default none, a gradient in glossy themes); DTCG has no image or gradient type.",
24
+ "--a63-segment-track-gloss": "A background-image layer (default none, a gradient in glossy themes); DTCG has no image or gradient type.",
25
+ "--a63-surface-backdrop": "A backdrop-filter value (default none, blur in translucent themes); DTCG has no filter type.",
26
+ "--a63-surface-gloss": "A background-image layer (default none, a gradient in glossy themes); DTCG has no image or gradient type.",
27
+ "--a63-surface-highlight": "A background-image layer (default none, a gradient in glossy themes); DTCG has no image or gradient type.",
28
+ "--a63-surface-texture-blend": "A mix-blend-mode keyword; DTCG has no blend-mode type.",
29
+ "--a63-surface-texture-image": "A background-image texture (default none); DTCG has no image type.",
30
+ "--a63-trigger-indicator-size": "Sized in em, relative to the trigger's font size; DTCG dimensions are px or rem only.",
31
+ "--a63-viewport-height": "100vh / 100dvh: viewport units, with dvh behind @supports; DTCG dimensions are px or rem only.",
32
+ "--a63-weather-backdrop": "A backdrop-filter value; DTCG has no filter type.",
33
+ "--a63-weather-background-blend": "A blend-mode keyword; DTCG has no blend-mode type.",
34
+ "--a63-widget-backdrop": "A backdrop-filter value; DTCG has no filter type.",
35
+ "--a63-widget-rim-backdrop": "A backdrop-filter value; DTCG has no filter type.",
36
+ "--a63-widget-rim-image": "A background-image layer; DTCG has no image or gradient type."
37
+ }
38
+ }
@@ -155,12 +155,14 @@ describe('os axis', () => {
155
155
  })
156
156
 
157
157
  describe('auto brand ramp', () => {
158
+ // The primary action uses step 600 of the ramp, which keeps white text at
159
+ // WCAG AA contrast (see tokens/brand.css).
158
160
  it('falls back to the b1 ramp when no --color-auto-* is set', () => {
159
161
  const el = root()
160
162
  el.setAttribute('data-a63-brand', 'auto')
161
- // --a63-action-primary = --a63-brand-500 = var(--color-auto-500, var(--color-b1-500))
163
+ // --a63-action-primary = --a63-brand-600 = var(--color-auto-600, var(--color-b1-600))
162
164
  const primary = cssVar('--a63-action-primary')
163
- const b1 = getComputedStyle(el).getPropertyValue('--color-b1-500').trim()
165
+ const b1 = getComputedStyle(el).getPropertyValue('--color-b1-600').trim()
164
166
  expect(primary).toBe(b1)
165
167
  expect(primary).not.toBe('')
166
168
  })
@@ -168,7 +170,7 @@ describe('auto brand ramp', () => {
168
170
  it('uses the extracted --color-auto ramp when present', () => {
169
171
  const el = root()
170
172
  el.setAttribute('data-a63-brand', 'auto')
171
- el.style.setProperty('--color-auto-500', 'rgb(10, 20, 30)')
173
+ el.style.setProperty('--color-auto-600', 'rgb(10, 20, 30)')
172
174
  expect(cssVar('--a63-action-primary')).toBe('rgb(10, 20, 30)')
173
175
  })
174
176
  })
@@ -1,34 +1,38 @@
1
1
  /*
2
+ * Generated from src/tokens/radius.resolver.json by scripts/build-css-from-dtcg.mjs. Do not edit;
3
+ * change the DTCG source and run `pnpm --filter @atom63/styles generate:tokens`.
4
+ *
2
5
  * Radius contract.
3
6
  *
4
7
  * A stable intent name over the radius anchor/multiplier model for executable UI
5
8
  * recipes. Raw --radius-* primitives remain available for other needs.
6
- */
7
-
8
- :root {
9
- --a63-avatar-radius: 50%;
10
- --a63-radius-control: var(--radius-lg);
11
- }
12
-
13
- /*
9
+ *
14
10
  * Radius personalization axis.
15
11
  *
16
12
  * [data-a63-radius] sets the multiplier the whole --radius-* scale (foundation/
17
13
  * radius.css) already multiplies by, so one attribute rescales every corner.
18
14
  * `default` = 1 restates the foundation default so a subtree can override back.
19
15
  */
16
+ :root {
17
+ --a63-avatar-radius: 50%;
18
+ --a63-radius-control: var(--radius-lg);
19
+ }
20
+
20
21
  [data-a63-radius='none'] {
21
22
  --a63-avatar-radius: 0;
22
23
  --radius-multiplier: 0;
23
24
  }
25
+
24
26
  [data-a63-radius='subtle'] {
25
27
  --a63-avatar-radius: var(--radius-full);
26
28
  --radius-multiplier: 0.5;
27
29
  }
30
+
28
31
  [data-a63-radius='default'] {
29
32
  --a63-avatar-radius: 50%;
30
33
  --radius-multiplier: 1;
31
34
  }
35
+
32
36
  [data-a63-radius='round'] {
33
37
  --a63-avatar-radius: 50%;
34
38
  --radius-multiplier: 1.5;
@@ -0,0 +1,138 @@
1
+ {
2
+ "version": "2025.10",
3
+ "description": "Radius contract.\n\nA stable intent name over the radius anchor/multiplier model for executable UI\nrecipes. Raw --radius-* primitives remain available for other needs.\n\nRadius personalization axis.\n\n[data-a63-radius] sets the multiplier the whole --radius-* scale (foundation/\nradius.css) already multiplies by, so one attribute rescales every corner.\n`default` = 1 restates the foundation default so a subtree can override back.",
4
+ "sets": {
5
+ "base": {
6
+ "sources": [
7
+ {
8
+ "a63": {
9
+ "avatar": {
10
+ "radius": {
11
+ "$type": "number",
12
+ "$value": 50,
13
+ "$extensions": {
14
+ "io.atom63.derive": "50%"
15
+ }
16
+ }
17
+ },
18
+ "radius": {
19
+ "control": {
20
+ "$type": "dimension",
21
+ "$value": "{radius.lg}"
22
+ }
23
+ }
24
+ }
25
+ }
26
+ ],
27
+ "$extensions": {
28
+ "io.atom63.css": {
29
+ "selector": ":root"
30
+ }
31
+ }
32
+ }
33
+ },
34
+ "modifiers": {
35
+ "radius": {
36
+ "default": "default",
37
+ "contexts": {
38
+ "none": [
39
+ {
40
+ "a63": {
41
+ "avatar": {
42
+ "radius": {
43
+ "$type": "number",
44
+ "$value": 0
45
+ }
46
+ }
47
+ },
48
+ "radius": {
49
+ "multiplier": {
50
+ "$type": "number",
51
+ "$value": 0
52
+ }
53
+ }
54
+ }
55
+ ],
56
+ "subtle": [
57
+ {
58
+ "a63": {
59
+ "avatar": {
60
+ "radius": {
61
+ "$type": "dimension",
62
+ "$value": "{radius.full}"
63
+ }
64
+ }
65
+ },
66
+ "radius": {
67
+ "multiplier": {
68
+ "$type": "number",
69
+ "$value": 0.5
70
+ }
71
+ }
72
+ }
73
+ ],
74
+ "default": [
75
+ {
76
+ "a63": {
77
+ "avatar": {
78
+ "radius": {
79
+ "$type": "number",
80
+ "$value": 50,
81
+ "$extensions": {
82
+ "io.atom63.derive": "50%"
83
+ }
84
+ }
85
+ }
86
+ },
87
+ "radius": {
88
+ "multiplier": {
89
+ "$type": "number",
90
+ "$value": 1
91
+ }
92
+ }
93
+ }
94
+ ],
95
+ "round": [
96
+ {
97
+ "a63": {
98
+ "avatar": {
99
+ "radius": {
100
+ "$type": "number",
101
+ "$value": 50,
102
+ "$extensions": {
103
+ "io.atom63.derive": "50%"
104
+ }
105
+ }
106
+ }
107
+ },
108
+ "radius": {
109
+ "multiplier": {
110
+ "$type": "number",
111
+ "$value": 1.5
112
+ }
113
+ }
114
+ }
115
+ ]
116
+ }
117
+ }
118
+ },
119
+ "resolutionOrder": [
120
+ {
121
+ "$ref": "#/sets/base"
122
+ },
123
+ {
124
+ "$ref": "#/modifiers/radius"
125
+ }
126
+ ],
127
+ "$extensions": {
128
+ "io.atom63.css": {
129
+ "attribute": "data-a63-radius",
130
+ "selectors": {
131
+ "none": "[data-a63-radius='none']",
132
+ "subtle": "[data-a63-radius='subtle']",
133
+ "default": "[data-a63-radius='default']",
134
+ "round": "[data-a63-radius='round']"
135
+ }
136
+ }
137
+ }
138
+ }