@atom63/styles 0.1.0-beta.1 → 0.1.0-beta.11

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 (119) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +22 -13
  3. package/generated/atom63.figma-sync.json +23277 -0
  4. package/generated/atom63.tokens.json +19650 -8403
  5. package/generated/z-layers.d.ts +33 -0
  6. package/generated/z-layers.js +31 -0
  7. package/package.json +29 -15
  8. package/src/compat/a63-from-shadcn.css +281 -0
  9. package/src/compat/shadcn.browser.test.ts +23 -0
  10. package/src/compat/shadcn.css +133 -17
  11. package/src/contracts/action.css +4 -3
  12. package/src/contracts/action.native.css +11 -0
  13. package/src/contracts/action.tokens.json +66 -0
  14. package/src/contracts/badge.css +128 -58
  15. package/src/contracts/badge.resolver.json +454 -0
  16. package/src/contracts/choice.css +5 -2
  17. package/src/contracts/choice.native.css +9 -0
  18. package/src/contracts/choice.tokens.json +66 -0
  19. package/src/contracts/control.css +54 -57
  20. package/src/contracts/control.native.css +13 -0
  21. package/src/contracts/control.tokens.json +294 -0
  22. package/src/contracts/environment.css +178 -60
  23. package/src/contracts/environment.native.css +23 -0
  24. package/src/contracts/environment.resolver.json +1210 -0
  25. package/src/contracts/field.css +4 -2
  26. package/src/contracts/field.tokens.json +40 -0
  27. package/src/contracts/marker.css +6 -4
  28. package/src/contracts/marker.tokens.json +15 -0
  29. package/src/contracts/menu.css +25 -61
  30. package/src/contracts/menu.native.css +10 -0
  31. package/src/contracts/menu.resolver.json +122 -0
  32. package/src/contracts/overlay.css +11 -13
  33. package/src/contracts/overlay.native.css +13 -0
  34. package/src/contracts/overlay.tokens.json +103 -0
  35. package/src/contracts/segment.css +22 -68
  36. package/src/contracts/segment.tokens.json +19 -0
  37. package/src/contracts/selection.css +5 -1
  38. package/src/contracts/selection.tokens.json +42 -0
  39. package/src/contracts/skeleton.css +18 -2
  40. package/src/contracts/skeleton.resolver.json +62 -0
  41. package/src/contracts/surface.css +17 -24
  42. package/src/contracts/surface.native.css +17 -0
  43. package/src/contracts/surface.tokens.json +154 -0
  44. package/src/contracts/toggle.css +27 -3
  45. package/src/contracts/toggle.resolver.json +129 -0
  46. package/src/contracts/track.css +3 -1
  47. package/src/contracts/track.tokens.json +39 -0
  48. package/src/contracts/trigger.css +5 -2
  49. package/src/contracts/trigger.native.css +9 -0
  50. package/src/contracts/trigger.tokens.json +58 -0
  51. package/src/contracts/widget.css +76 -51
  52. package/src/contracts/widget.native.css +23 -0
  53. package/src/contracts/widget.resolver.json +1110 -0
  54. package/src/tailwind/roles.json +189 -0
  55. package/src/tailwind/theme.css +216 -24
  56. package/src/tailwind/utilities.css +17 -0
  57. package/src/themes/aqua.css +126 -89
  58. package/src/themes/aqua.native.css +80 -0
  59. package/src/themes/aqua.resolver.json +1304 -0
  60. package/src/themes/modern.css +10 -14
  61. package/src/themes/modern.native.css +16 -0
  62. package/src/themes/modern.resolver.json +350 -0
  63. package/src/themes/retro.css +22 -26
  64. package/src/themes/retro.native.css +16 -0
  65. package/src/themes/retro.resolver.json +794 -0
  66. package/src/themes/terminal.css +164 -41
  67. package/src/themes/terminal.native.css +22 -0
  68. package/src/themes/terminal.resolver.json +585 -0
  69. package/src/tokens/brand-action.css +65 -0
  70. package/src/tokens/brand-action.resolver.json +155 -0
  71. package/src/tokens/brand-ramp.css +108 -0
  72. package/src/tokens/brand-ramp.resolver.json +418 -0
  73. package/src/tokens/brand.css +6 -146
  74. package/src/tokens/chart-palette.browser.test.ts +188 -0
  75. package/src/tokens/color-mix-space.browser.test.ts +101 -0
  76. package/src/tokens/contrast.browser.test.ts +303 -5
  77. package/src/tokens/density.browser.test.ts +167 -0
  78. package/src/tokens/figma-parity.browser.test.ts +270 -0
  79. package/src/tokens/font.css +12 -0
  80. package/src/tokens/font.resolver.json +128 -0
  81. package/src/tokens/form-factor.browser.test.ts +129 -0
  82. package/src/tokens/foundation/effects.css +13 -13
  83. package/src/tokens/foundation/effects.resolver.json +433 -0
  84. package/src/tokens/foundation/fonts.css +11 -5
  85. package/src/tokens/foundation/fonts.tokens.json +45 -0
  86. package/src/tokens/foundation/motion.css +3 -0
  87. package/src/tokens/foundation/motion.tokens.json +53 -0
  88. package/src/tokens/foundation/palette.css +3 -0
  89. package/src/tokens/foundation/palette.tokens.json +1743 -0
  90. package/src/tokens/foundation/primitives.css +20 -43
  91. package/src/tokens/foundation/primitives.tokens.json +3258 -0
  92. package/src/tokens/foundation/radius.css +11 -9
  93. package/src/tokens/foundation/radius.tokens.json +108 -0
  94. package/src/tokens/foundation/typography.css +49 -12
  95. package/src/tokens/foundation/typography.native.css +21 -0
  96. package/src/tokens/foundation/typography.resolver.json +1008 -0
  97. package/src/tokens/foundation.css +0 -1
  98. package/src/tokens/index.css +1 -0
  99. package/src/tokens/motion.css +3 -1
  100. package/src/tokens/motion.resolver.json +135 -0
  101. package/src/tokens/native-values.json +38 -0
  102. package/src/tokens/personalization-axes.browser.test.ts +18 -3
  103. package/src/tokens/plate-scope.browser.test.ts +73 -0
  104. package/src/tokens/radius.css +12 -8
  105. package/src/tokens/radius.resolver.json +138 -0
  106. package/src/tokens/semantics.css +716 -41
  107. package/src/tokens/semantics.resolver.json +1639 -0
  108. package/src/tokens/space.css +8 -6
  109. package/src/tokens/space.tokens.json +78 -0
  110. package/src/tokens/surface.css +13 -19
  111. package/src/tokens/surface.resolver.json +706 -0
  112. package/src/tokens/swift-parity.browser.test.ts +141 -0
  113. package/src/tokens/type-roles.css +88 -0
  114. package/src/tokens/type-roles.resolver.json +419 -0
  115. package/src/tokens/type-scale.css +6 -0
  116. package/src/tokens/type-scale.resolver.json +67 -0
  117. package/generated/atom63.figma-tokens.json +0 -21664
  118. package/src/tokens/foundation/aliases.css +0 -28
  119. package/src/z-layers.ts +0 -40
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 You Zhang (ATOM63)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -100,13 +100,16 @@ Tailwind/shadcn names are the day-to-day design surface. Shared-scale drift
100
100
  Default entry `@atom63/styles` (`src/index.css`) imports **tokens → contracts →
101
101
  themes → os → animations → utils only** — never `tailwind/`, never `compat/`.
102
102
 
103
+ Most layers are authored as DTCG sources (`*.tokens.json`, `*.resolver.json`); the `.css` next to
104
+ each source is generated by `pnpm --filter @atom63/styles generate:tokens` and must not be edited.
105
+
103
106
  | Layer | Path | Purpose | May reference |
104
107
  | --- | --- | --- | --- |
105
108
  | **Foundation** | `tokens/foundation/*` | **Shared dictionaries** — palette, spacing, sizes, z, radius, fonts, typography, generic shadow/blur scales, motion | nothing (literals) or other foundation |
106
- | **Semantic** (canonical) | `tokens/semantics.css` + `tokens/brand.css` | `--a63-*` intent roles (surface/text/border/status; primary + focus in brand). Alias/compose foundation; light/dark resolution lives here | foundation |
109
+ | **Semantic** (canonical) | `tokens/semantics.resolver.json` + `tokens/brand-{ramp,action}.resolver.json` (generated `semantics.css`, `brand.css`) | `--a63-*` intent roles (surface/text/border/status; primary + focus in brand). Alias/compose foundation; light/dark resolution lives here | foundation |
107
110
  | **Scale bridges** | `tokens/{space,radius,type-scale,font,motion}.css` | `--a63-*` semantic scale aliases over the foundation | foundation |
108
- | **Contract** | `contracts/*` | Shared component-family contracts (`control`, `field`, `overlay`, `badge`, …) + environment dimensions (`environment.css`) | semantic + scale bridges |
109
- | **Theme** | `themes/*` | Skin character under `[data-a63-theme]` — assigns contracts; **may** own theme-private material (gel/bevel/CRT). No new shared scales; never structure | semantic + foundation |
111
+ | **Contract** | `contracts/*.tokens.json`, `contracts/*.resolver.json` | Shared component-family contracts (`control`, `field`, `overlay`, `badge`, …) + environment dimensions (`environment.resolver.json`) | semantic + scale bridges |
112
+ | **Theme** | `themes/*.resolver.json` | Skin character under `[data-a63-theme]` — assigns contracts; **may** own theme-private material (gel/bevel/CRT). No new shared scales; never structure | semantic + foundation |
110
113
  | **OS** | `os/*` | Chrome **structure** + chrome-specific paint tokens that compose from semantics (`--a63-os-*`) under `[data-a63-os]` — peer of theme | foundation + semantic |
111
114
  | **Animations** | `animations/*` | Generic executable CSS (keyframes) | foundation |
112
115
  | **Utils** | `utils/*` | Reusable utilities (scrollbars, masks, code highlighting, view transitions, debug) | semantic + foundation |
@@ -123,8 +126,11 @@ Primitive → Semantic (--a63-*) → Design Language → Mode → Theme → OS
123
126
  ```
124
127
 
125
128
  - **Primitive / Semantic** — `tokens/foundation/*`, `tokens/semantics.css`
126
- - **Design Language / Input / Density** — `contracts/environment.css`
127
- (`[data-a63-design-language]`, `[data-a63-input]`, `[data-a63-density]`)
129
+ - **Design Language / Input / Density / Form factor** — `contracts/environment.css`
130
+ (`[data-a63-design-language]`, `[data-a63-input]`, `[data-a63-density]`,
131
+ `[data-a63-form-factor='phone']`). The phone form factor sets the type steps
132
+ to the iOS text sizes (body 17px) and the iOS control ramp inside a phone
133
+ screen; `AppView layout="phone"` stamps it, viewport width does not.
128
134
  - **Mode** — `.light` / `.dark` (`[data-a63-mode]`) on the semantic layer
129
135
  - **Theme** — `themes/*.css` under `[data-a63-theme]` (visual skin / paint)
130
136
  - **OS** — `os/*.css` under `[data-a63-os]` (chrome structure + chrome paint
@@ -154,21 +160,24 @@ of bug; run it after touching the token layers.
154
160
 
155
161
  ## Canonical `--a63-*` semantic tokens
156
162
 
157
- Surfaces, text, borders, danger/status, and scrim are defined in
163
+ Surfaces, text, borders, danger/status, scrim and media colors are defined in
164
+ `tokens/semantics.resolver.json`, one resolver context per mode, generated into
158
165
  `tokens/semantics.css` (`:root, .light` + `.dark` overrides). Primary action and
159
- focus ring are brand-derived in `tokens/brand.css` (scoped to
160
- `:root, [data-a63-brand]` so they re-resolve per ramp). Together these are the
161
- single source of semantic truth.
166
+ focus ring are brand-derived in `tokens/brand-action.resolver.json`, generated into
167
+ `tokens/brand.css` (scoped to `:root, [data-a63-brand]` so they re-resolve per
168
+ ramp). Together these are the single source of semantic truth.
162
169
 
163
170
  | Group | Tokens | Home |
164
171
  | --- | --- | --- |
165
172
  | Surface | `--a63-surface-page`, `--a63-surface-panel`, `--a63-surface-overlay`, `--a63-surface-muted`, `--a63-surface-control`, `--a63-surface-control-hover` | `semantics.css` |
166
- | Text | `--a63-text-primary`, `--a63-text-secondary` | `semantics.css` |
173
+ | Text | `--a63-text-primary`, `--a63-text-secondary`, `--a63-text-danger` (error and destructive text; `--a63-action-danger` is the fill) | `semantics.css` |
167
174
  | Border | `--a63-border-subtle`, `--a63-border-control` | `semantics.css` |
168
- | Action | `--a63-action-primary` (+ `-hover`, `-foreground`), `--a63-action-danger` (+ `-hover`, `-foreground`), `--a63-action-neutral` (+ `-foreground`) | primary/focus in `brand.css`; danger/neutral in `semantics.css` |
169
- | Status | `--a63-status-info`, `--a63-status-success`, `--a63-status-warning` (+ `-foreground`) | `semantics.css` |
170
- | Focus | `--a63-focus-ring` | `brand.css` |
175
+ | Action | `--a63-action-primary` (+ `-hover`, `-foreground`), `--a63-action-danger` (+ `-hover`, `-foreground`), `--a63-action-neutral` (+ `-foreground`) | primary in `brand-action.css`; danger/neutral in `semantics.css` |
176
+ | Status | `--a63-status-info`, `--a63-status-success`, `--a63-status-warning`, `--a63-status-danger` (+ `-foreground`) | `semantics.css` |
177
+ | Focus | `--a63-focus-ring` (brand step 600 in light, 400 in dark: 3:1 against surfaces, WCAG 1.4.11) | `semantics.css` |
171
178
  | Scrim | `--a63-scrim` | `semantics.css` |
179
+ | Media | `--a63-media-stage`, `--a63-media-scrim` (behind full-screen photos and video, black in every theme) | `semantics.css` |
180
+ | On media | `--a63-on-media-foreground`, `--a63-on-media-surface` (+ `-strong`), `--a63-on-media-border`, `--a63-on-media-ring`, `--a63-on-media-veil` (+ `-strong`) — controls over photos and video, whose colors are unknowable, so these hold in every theme | `semantics.css` |
172
181
 
173
182
  Contract tokens (`--a63-control-*`, `--a63-field-*`, `--a63-overlay-*`,
174
183
  `--a63-badge-*`, `--a63-space-*`, `--a63-radius-*`, `--a63-motion-*`,