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

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 (118) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +22 -13
  3. package/generated/atom63.figma-sync.json +23201 -0
  4. package/generated/atom63.tokens.json +19625 -8406
  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 +275 -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 +151 -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/color-mix-space.browser.test.ts +101 -0
  75. package/src/tokens/contrast.browser.test.ts +257 -5
  76. package/src/tokens/density.browser.test.ts +167 -0
  77. package/src/tokens/figma-parity.browser.test.ts +270 -0
  78. package/src/tokens/font.css +12 -0
  79. package/src/tokens/font.resolver.json +128 -0
  80. package/src/tokens/form-factor.browser.test.ts +129 -0
  81. package/src/tokens/foundation/effects.css +13 -13
  82. package/src/tokens/foundation/effects.resolver.json +433 -0
  83. package/src/tokens/foundation/fonts.css +11 -5
  84. package/src/tokens/foundation/fonts.tokens.json +45 -0
  85. package/src/tokens/foundation/motion.css +3 -0
  86. package/src/tokens/foundation/motion.tokens.json +53 -0
  87. package/src/tokens/foundation/palette.css +3 -0
  88. package/src/tokens/foundation/palette.tokens.json +1743 -0
  89. package/src/tokens/foundation/primitives.css +20 -43
  90. package/src/tokens/foundation/primitives.tokens.json +3258 -0
  91. package/src/tokens/foundation/radius.css +11 -9
  92. package/src/tokens/foundation/radius.tokens.json +108 -0
  93. package/src/tokens/foundation/typography.css +49 -12
  94. package/src/tokens/foundation/typography.native.css +21 -0
  95. package/src/tokens/foundation/typography.resolver.json +1008 -0
  96. package/src/tokens/foundation.css +0 -1
  97. package/src/tokens/index.css +1 -0
  98. package/src/tokens/motion.css +3 -1
  99. package/src/tokens/motion.resolver.json +135 -0
  100. package/src/tokens/native-values.json +38 -0
  101. package/src/tokens/personalization-axes.browser.test.ts +18 -3
  102. package/src/tokens/plate-scope.browser.test.ts +73 -0
  103. package/src/tokens/radius.css +12 -8
  104. package/src/tokens/radius.resolver.json +138 -0
  105. package/src/tokens/semantics.css +656 -39
  106. package/src/tokens/semantics.resolver.json +1606 -0
  107. package/src/tokens/space.css +8 -6
  108. package/src/tokens/space.tokens.json +78 -0
  109. package/src/tokens/surface.css +13 -19
  110. package/src/tokens/surface.resolver.json +706 -0
  111. package/src/tokens/swift-parity.browser.test.ts +141 -0
  112. package/src/tokens/type-roles.css +88 -0
  113. package/src/tokens/type-roles.resolver.json +419 -0
  114. package/src/tokens/type-scale.css +6 -0
  115. package/src/tokens/type-scale.resolver.json +67 -0
  116. package/generated/atom63.figma-tokens.json +0 -21664
  117. package/src/tokens/foundation/aliases.css +0 -28
  118. package/src/z-layers.ts +0 -40
@@ -1,4 +1,7 @@
1
1
  /*
2
+ * Generated from src/contracts/field.tokens.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
  * Field contract — the RECESSED control (text inputs), the inset counterpart to
3
6
  * the raised control (buttons) in control.css.
4
7
  *
@@ -11,7 +14,7 @@
11
14
  * mode-independent (static inset), so it's safe to declare at :root and let
12
15
  * themes override it on their shell. The OTHER hooks resolve at the recipe
13
16
  * use-site against mode/theme/brand-dependent semantics (--a63-surface-control,
14
- * --a63-border-control, --a63-control-radius, --a63-focus-ring,
17
+ * --a63-border-input, --a63-control-radius, --a63-focus-ring,
15
18
  * --a63-action-primary); declaring THOSE at :root would freeze their var()s to
16
19
  * the root's mode/theme and inherit the wrong value down — the
17
20
  * resolve-at-declaration trap. So they stay UNSET here and the recipe reads
@@ -19,7 +22,6 @@
19
22
  * semantic resolves per the field's own scope. A theme sets --a63-field-shadow
20
23
  * (all four) and, where it re-skins the fill, --a63-field-background (terminal).
21
24
  */
22
-
23
25
  :root {
24
26
  /* Recessed inset — mode-independent, so safe to default here. */
25
27
  --a63-field-shadow: inset 0 1px 2px color-mix(in oklch, black 6%, transparent);
@@ -0,0 +1,40 @@
1
+ {
2
+ "$description": "Field contract — the RECESSED control (text inputs), the inset counterpart to\nthe raised control (buttons) in control.css.\n\nA field is a control: it reuses the control SIZING ramp\n(--a63-control-height/padding-inline/font-size/radius), so it inherits\ndesign-language (iOS taller) sizing for free.\n\nTheme-overridable hooks: --a63-field-{background,border,radius,shadow,\nfocus-ring,focus-border}. Only --a63-field-shadow gets a default here — it is\nmode-independent (static inset), so it's safe to declare at :root and let\nthemes override it on their shell. The OTHER hooks resolve at the recipe\nuse-site against mode/theme/brand-dependent semantics (--a63-surface-control,\n--a63-border-input, --a63-control-radius, --a63-focus-ring,\n--a63-action-primary); declaring THOSE at :root would freeze their var()s to\nthe root's mode/theme and inherit the wrong value down — the\nresolve-at-declaration trap. So they stay UNSET here and the recipe reads\n`var(--a63-field-X, <semantic>)`: a theme override wins, else the live\nsemantic resolves per the field's own scope. A theme sets --a63-field-shadow\n(all four) and, where it re-skins the fill, --a63-field-background (terminal).",
3
+ "a63": {
4
+ "field": {
5
+ "shadow": {
6
+ "$type": "shadow",
7
+ "$value": [
8
+ {
9
+ "color": {
10
+ "colorSpace": "srgb",
11
+ "components": [0, 0, 0],
12
+ "alpha": 0.06
13
+ },
14
+ "offsetX": {
15
+ "value": 0,
16
+ "unit": "px"
17
+ },
18
+ "offsetY": {
19
+ "value": 1,
20
+ "unit": "px"
21
+ },
22
+ "blur": {
23
+ "value": 2,
24
+ "unit": "px"
25
+ },
26
+ "spread": {
27
+ "value": 0,
28
+ "unit": "px"
29
+ },
30
+ "inset": true
31
+ }
32
+ ],
33
+ "$extensions": {
34
+ "io.atom63.derive": "inset 0 1px 2px color-mix(in oklch, black 6%, transparent)"
35
+ },
36
+ "$description": "Recessed inset — mode-independent, so safe to default here."
37
+ }
38
+ }
39
+ }
40
+ }
@@ -1,4 +1,7 @@
1
1
  /*
2
+ * Generated from src/contracts/marker.tokens.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
  * Marker contract — the tiny NON-interactive labeled chip (keycap, badge, chip,
3
6
  * tag, inline code). Presentational; no state.
4
7
  *
@@ -13,11 +16,10 @@
13
16
  * to default at :root. Default is `none` — modern and terminal are flat pills
14
17
  * (spec: "terminal none"); aqua and retro give it keycap character.
15
18
  */
16
-
17
19
  :root {
18
20
  /* `0 0 #0000` rather than `none`: recipes compose this into comma-separated
19
- box-shadow lists (e.g. `var(--a63-marker-shadow), <focus ring>`), and `none`
20
- is only legal as the sole value — it would invalidate the whole declaration
21
- and silently drop the focus ring. This paints nothing. */
21
+ box-shadow lists (e.g. `var(--a63-marker-shadow), <focus ring>`), and `none`
22
+ is only legal as the sole value — it would invalidate the whole declaration
23
+ and silently drop the focus ring. This paints nothing. */
22
24
  --a63-marker-shadow: 0 0 #0000;
23
25
  }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$description": "Marker contract — the tiny NON-interactive labeled chip (keycap, badge, chip,\ntag, inline code). Presentational; no state.\n\nLean by design (see the taxonomy spec): semantics carry the whole look — the\nrecipe reads --a63-surface-muted (bg), --a63-text-secondary (fg),\n--a63-border-subtle (border), --a63-control-radius (radius) and\n--a63-control-font-family (→ terminal-mono for free) at the use-site. The ONE\nthing themes vary distinctly for a keycap is its BEVEL, so that is the only\ncontract token here.\n\n--a63-marker-shadow is a static keycap shadow (mode-independent), so it's safe\nto default at :root. Default is `none` — modern and terminal are flat pills\n(spec: \"terminal none\"); aqua and retro give it keycap character.",
3
+ "a63": {
4
+ "marker": {
5
+ "shadow": {
6
+ "$type": "shadow",
7
+ "$value": [],
8
+ "$extensions": {
9
+ "io.atom63.derive": "0 0 #0000"
10
+ },
11
+ "$description": "`0 0 #0000` rather than `none`: recipes compose this into comma-separated\n box-shadow lists (e.g. `var(--a63-marker-shadow), <focus ring>`), and `none`\n is only legal as the sole value — it would invalidate the whole declaration\n and silently drop the focus ring. This paints nothing."
12
+ }
13
+ }
14
+ }
15
+ }
@@ -1,4 +1,7 @@
1
1
  /*
2
+ * Generated from src/contracts/menu.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
  * Menu contract — the actionable MENU archetype: DropdownMenu, ContextMenu,
3
6
  * Select, Autocomplete, and Menubar menus. One token set so every menu surface
4
7
  * reads the SAME item / popup treatment (spacing, radius, highlight,
@@ -19,82 +22,43 @@
19
22
  * They are consumed at the recipe USE-SITE with the live-semantic fallback in
20
23
  * the API block below, and a theme overrides them under [data-a63-theme].
21
24
  * Only axis-independent geometry + treatment defaults live at :root here.
25
+ *
26
+ * Menu spacing follows item shape. At the 'none' radius scale, rows become square
27
+ * and the menu collapses to a flat, flush list: no inter-item gap and no popup
28
+ * inset, so highlighted rows span edge-to-edge — the dense CRT / Win98 menu.
29
+ * At every other radius scale (subtle/default/round), the inset/gapped rhythm is
30
+ * restored for rounded highlights.
22
31
  */
32
+ @import './menu.native.css';
23
33
 
24
34
  :root {
25
35
  /* ── Popup box metrics (surface treatment = OVERLAY contract) ──────────── */
26
36
  --a63-menu-popup-padding: var(--a63-space-1);
27
-
28
- /*
29
- * NOTE: --a63-menu-popup-radius and --a63-menu-item-radius are NOT declared
30
- * here. Radius is a THEME-VARYING axis (themes set --a63-overlay-radius /
31
- * --a63-control-radius), so declaring them at :root would freeze them to the
32
- * root (modern) value and inherit it into every theme — the same resolve-at-
33
- * declaration trap as the colour hooks. They are read at the recipe use-site:
34
- * popup -> var(--a63-menu-popup-radius, var(--a63-overlay-radius, --radius-lg))
35
- * item -> popup radius - popup border - popup padding (concentric inset)
36
- * A theme MAY set --a63-menu-*-radius under [data-a63-theme] to override.
37
- */
38
-
39
- /* ── Item geometry ─────────────────────────────────────────────────────── */
37
+ /* NOTE: --a63-menu-popup-radius and --a63-menu-item-radius are NOT declared
38
+ here. Radius is a THEME-VARYING axis (themes set --a63-overlay-radius /
39
+ --a63-control-radius), so declaring them at :root would freeze them to the
40
+ root (modern) value and inherit it into every theme — the same resolve-at-
41
+ declaration trap as the colour hooks. They are read at the recipe use-site:
42
+ popup -> var(--a63-menu-popup-radius, var(--a63-overlay-radius, --radius-lg))
43
+ item -> popup radius - popup border - popup padding (concentric inset)
44
+ A theme MAY set --a63-menu-*-radius under [data-a63-theme] to override.
45
+ ── Item geometry ─────────────────────────────────────────────────────── */
40
46
  --a63-menu-item-padding-block: var(--a63-space-1_5);
41
47
  --a63-menu-item-padding-inline: var(--a63-space-2);
42
- --a63-menu-item-gap: var(--a63-space-2); /* icon <-> label gap WITHIN an item */
43
- --a63-menu-gap: var(--a63-space-0_5); /* vertical gap BETWEEN items/rows */
48
+ /* icon <-> label gap WITHIN an item */
49
+ --a63-menu-item-gap: var(--a63-space-2);
44
50
  --a63-menu-item-font-size: var(--a63-control-font-size-sm);
45
- --a63-menu-item-inset: 2rem; /* checkbox / radio / inset indent */
46
-
47
- /* ── Highlight treatment (theme-varying gel / glow; none at :root = flat) ── */
48
- --a63-menu-highlight-gloss: none;
51
+ /* checkbox / radio / inset indent */
52
+ --a63-menu-item-inset: 2rem;
53
+ /* vertical gap BETWEEN items/rows */
54
+ --a63-menu-gap: var(--a63-space-0_5);
49
55
  --a63-menu-highlight-shadow: none;
50
-
51
56
  /* ── Disabled fade (foreground-only intent, like Button) ───────────────── */
52
57
  --a63-menu-disabled-opacity: 0.56;
53
58
  }
54
59
 
55
- /*
56
- * Menu spacing follows item shape. At the 'none' radius scale, rows become square
57
- * and the menu collapses to a flat, flush list: no inter-item gap and no popup
58
- * inset, so highlighted rows span edge-to-edge — the dense CRT / Win98 menu.
59
- * At every other radius scale (subtle/default/round), the inset/gapped rhythm is
60
- * restored for rounded highlights.
61
- */
62
60
  [data-a63-radius='none'] {
63
61
  --a63-menu-gap: 0;
64
62
  --a63-menu-item-radius: 0;
65
63
  --a63-menu-popup-padding: 0;
66
64
  }
67
-
68
- /*
69
- * ── COLOUR API ──────────────────────────────────────────────────────────────
70
- * Consume each at the recipe USE-SITE with the live-semantic fallback shown, e.g.
71
- * background: var(--a63-menu-highlight-background, var(--a63-surface-control-hover));
72
- * A theme overrides any of these under [data-a63-theme='…'] (non-:root, resolves
73
- * in context). NEVER declare these at :root.
74
- *
75
- * Item (resting) — shared by both tones:
76
- * --a63-menu-item-foreground → var(--a63-text-primary)
77
- * --a63-menu-item-icon → var(--a63-text-secondary)
78
- *
79
- * Highlighted item — NEUTRAL tone (default):
80
- * --a63-menu-highlight-background → var(--a63-surface-control-hover)
81
- * --a63-menu-highlight-foreground → var(--a63-text-primary)
82
- *
83
- * Highlighted item — PRIMARY tone ([data-tone='primary'] or a themed default):
84
- * --a63-menu-highlight-primary-background → var(--a63-action-primary)
85
- * --a63-menu-highlight-primary-foreground → var(--a63-action-primary-foreground)
86
- *
87
- * Destructive item:
88
- * --a63-menu-destructive-foreground → var(--a63-action-danger)
89
- * --a63-menu-destructive-highlight-background
90
- * → color-mix(in oklch, var(--a63-action-danger) 10%, transparent)
91
- *
92
- * Chrome:
93
- * --a63-menu-popup-background → var(--a63-surface-overlay)
94
- * --a63-menu-popup-gloss → var(--a63-overlay-gloss)
95
- * --a63-menu-label-foreground → var(--a63-text-secondary)
96
- * --a63-menu-separator → var(--a63-border-subtle)
97
- * --a63-menu-shortcut-foreground → var(--a63-text-secondary)
98
- * --a63-menu-indicator → var(--a63-text-primary) (check/radio mark)
99
- * --a63-menu-selected-indicator → var(--a63-action-primary) (Select current-value check)
100
- */
@@ -0,0 +1,10 @@
1
+ /*
2
+ * CSS-native values of the menu contract: values with no DTCG type. The rest of
3
+ * the contract is generated from menu.resolver.json. Each declaration here is listed
4
+ * in native-values.json; see docs/design-system/token-single-source.md.
5
+ */
6
+
7
+ :root {
8
+ /* ── Highlight treatment (theme-varying gel / glow; none at :root = flat) ── */
9
+ --a63-menu-highlight-gloss: none;
10
+ }
@@ -0,0 +1,122 @@
1
+ {
2
+ "version": "2025.10",
3
+ "description": "Menu contract — the actionable MENU archetype: DropdownMenu, ContextMenu,\nSelect, Autocomplete, and Menubar menus. One token set so every menu surface\nreads the SAME item / popup treatment (spacing, radius, highlight,\ndestructive), consumed by the shared `.a63-Menu-*` recipe (including Select /\nAutocomplete surfaces + items). The popup *surface* treatment (gel / bevel /\nbackdrop / elevation) comes from the OVERLAY contract — this contract only\nadds the menu-specific item + chrome vocabulary.\n\n── TWO tonal styles for the HIGHLIGHTED item (mirrors `segment`) ───────────\n 1. neutral (default) — a quiet hover fill (--a63-surface-control-hover).\n 2. primary — the accent fill (the classic macOS menu highlight).\n Selected by a tone flag / theme default; the RESTING + destructive treatment\n is shared by both tones.\n\n── AXIS TRAP (see selection.css) ──────────────────────────────────────────\n Colour hooks reference mode/theme/brand semantics, so they are NOT declared\n at :root (a var(--a63-action-*) resolved at :root freezes to the root mode).\n They are consumed at the recipe USE-SITE with the live-semantic fallback in\n the API block below, and a theme overrides them under [data-a63-theme].\n Only axis-independent geometry + treatment defaults live at :root here.\n\nMenu spacing follows item shape. At the 'none' radius scale, rows become square\nand the menu collapses to a flat, flush list: no inter-item gap and no popup\ninset, so highlighted rows span edge-to-edge — the dense CRT / Win98 menu.\nAt every other radius scale (subtle/default/round), the inset/gapped rhythm is\nrestored for rounded highlights.",
4
+ "sets": {
5
+ "01-root": {
6
+ "sources": [
7
+ {
8
+ "a63": {
9
+ "menu": {
10
+ "popup": {
11
+ "padding": {
12
+ "$type": "dimension",
13
+ "$value": "{a63.space.1}",
14
+ "$description": "── Popup box metrics (surface treatment = OVERLAY contract) ────────────"
15
+ }
16
+ },
17
+ "item": {
18
+ "padding": {
19
+ "block": {
20
+ "$type": "dimension",
21
+ "$value": "{a63.space.1_5}",
22
+ "$description": "NOTE: --a63-menu-popup-radius and --a63-menu-item-radius are NOT declared\nhere. Radius is a THEME-VARYING axis (themes set --a63-overlay-radius /\n--a63-control-radius), so declaring them at :root would freeze them to the\nroot (modern) value and inherit it into every theme — the same resolve-at-\ndeclaration trap as the colour hooks. They are read at the recipe use-site:\n popup -> var(--a63-menu-popup-radius, var(--a63-overlay-radius, --radius-lg))\n item -> popup radius - popup border - popup padding (concentric inset)\nA theme MAY set --a63-menu-*-radius under [data-a63-theme] to override.\n── Item geometry ───────────────────────────────────────────────────────"
23
+ },
24
+ "inline": {
25
+ "$type": "dimension",
26
+ "$value": "{a63.space.2}"
27
+ }
28
+ },
29
+ "gap": {
30
+ "$type": "dimension",
31
+ "$value": "{a63.space.2}",
32
+ "$description": "icon <-> label gap WITHIN an item"
33
+ },
34
+ "font": {
35
+ "size": {
36
+ "$type": "dimension",
37
+ "$value": "{a63.control.font.size.sm}"
38
+ }
39
+ },
40
+ "inset": {
41
+ "$type": "dimension",
42
+ "$value": {
43
+ "value": 2,
44
+ "unit": "rem"
45
+ },
46
+ "$description": "checkbox / radio / inset indent"
47
+ }
48
+ },
49
+ "gap": {
50
+ "$type": "dimension",
51
+ "$value": "{a63.space.0_5}",
52
+ "$description": "vertical gap BETWEEN items/rows"
53
+ },
54
+ "highlight": {
55
+ "shadow": {
56
+ "$type": "shadow",
57
+ "$value": []
58
+ }
59
+ },
60
+ "disabled": {
61
+ "opacity": {
62
+ "$type": "number",
63
+ "$value": 0.56,
64
+ "$description": "── Disabled fade (foreground-only intent, like Button) ─────────────────"
65
+ }
66
+ }
67
+ }
68
+ }
69
+ }
70
+ ],
71
+ "$extensions": {
72
+ "io.atom63.css": {
73
+ "selector": ":root"
74
+ }
75
+ }
76
+ },
77
+ "02-data-a63-radius-none": {
78
+ "sources": [
79
+ {
80
+ "a63": {
81
+ "menu": {
82
+ "gap": {
83
+ "$type": "number",
84
+ "$value": 0
85
+ },
86
+ "item": {
87
+ "radius": {
88
+ "$type": "number",
89
+ "$value": 0
90
+ }
91
+ },
92
+ "popup": {
93
+ "padding": {
94
+ "$type": "number",
95
+ "$value": 0
96
+ }
97
+ }
98
+ }
99
+ }
100
+ }
101
+ ],
102
+ "$extensions": {
103
+ "io.atom63.css": {
104
+ "selector": "[data-a63-radius='none']"
105
+ }
106
+ }
107
+ }
108
+ },
109
+ "resolutionOrder": [
110
+ {
111
+ "$ref": "#/sets/01-root"
112
+ },
113
+ {
114
+ "$ref": "#/sets/02-data-a63-radius-none"
115
+ }
116
+ ],
117
+ "$extensions": {
118
+ "io.atom63.css": {
119
+ "imports": ["./menu.native.css"]
120
+ }
121
+ }
122
+ }
@@ -1,4 +1,7 @@
1
1
  /*
2
+ * Generated from src/contracts/overlay.tokens.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
  * Overlay contract — the FLOATING elevated surface (menus, popovers, select
3
6
  * popups, tooltips, dialogs, toasts, drawers).
4
7
  *
@@ -14,31 +17,26 @@
14
17
  *
15
18
  * The contract now carries the full treatment vocabulary plus a drag-shadow
16
19
  * (elevation while a floating surface is dragged).
20
+ *
21
+ * --a63-overlay-radius intentionally unset at :root; recipes read
22
+ * var(--a63-overlay-radius, <own default>) so themes can square all overlays.
17
23
  */
24
+ @import './overlay.native.css';
18
25
 
19
26
  :root {
20
27
  /* Outer elevation (existing lever, unchanged). */
21
28
  --a63-overlay-shadow:
22
29
  0 8px 24px -6px color-mix(in oklch, black 22%, transparent),
23
30
  0 2px 6px -2px color-mix(in oklch, black 12%, transparent);
24
-
25
31
  /* Elevation while a floating surface is dragged (widgets, window frames).
26
- Defaults to the resting shadow; a theme/consumer lifts it during drag. */
32
+ Defaults to the resting shadow; a theme/consumer lifts it during drag. */
27
33
  --a63-overlay-drag-shadow: var(--a63-overlay-shadow);
28
-
29
34
  /* `0 0 #0000` not `none`: composed into comma-separated box-shadow lists
30
- (`var(--a63-overlay-inner-shadow), var(--a63-overlay-shadow)`). `none` is
31
- only legal as the sole value, so it invalidates the whole declaration and
32
- silently drops the overlay's elevation. */
35
+ (`var(--a63-overlay-inner-shadow), var(--a63-overlay-shadow)`). `none` is
36
+ only legal as the sole value, so it invalidates the whole declaration and
37
+ silently drops the overlay's elevation. */
33
38
  --a63-overlay-inner-shadow: 0 0 #0000;
34
- --a63-overlay-gloss: none;
35
- --a63-overlay-highlight: none;
36
39
  --a63-overlay-highlight-opacity: 1;
37
- --a63-overlay-backdrop: none;
38
40
  --a63-overlay-border-style: solid;
39
41
  --a63-overlay-border-width: 1px;
40
- --a63-overlay-texture-image: none;
41
- --a63-overlay-texture-blend: normal;
42
- /* --a63-overlay-radius intentionally unset at :root; recipes read
43
- var(--a63-overlay-radius, <own default>) so themes can square all overlays. */
44
42
  }
@@ -0,0 +1,13 @@
1
+ /*
2
+ * CSS-native values of the overlay contract: values with no DTCG type. The rest of
3
+ * the contract is generated from overlay.tokens.json. Each declaration here is listed
4
+ * in native-values.json; see docs/design-system/token-single-source.md.
5
+ */
6
+
7
+ :root {
8
+ --a63-overlay-gloss: none;
9
+ --a63-overlay-highlight: none;
10
+ --a63-overlay-backdrop: none;
11
+ --a63-overlay-texture-image: none;
12
+ --a63-overlay-texture-blend: normal;
13
+ }
@@ -0,0 +1,103 @@
1
+ {
2
+ "$description": "Overlay contract — the FLOATING elevated surface (menus, popovers, select\npopups, tooltips, dialogs, toasts, drawers).\n\nLean by design (see the taxonomy spec): semantics carry the default look — the\nrecipe reads --a63-surface-overlay (bg), --a63-border-subtle (border),\n--radius-lg (radius), --z-layer-popover (stacking), --a63-control-feedback-*\n(entrance) at the use-site. The ONE thing themes vary distinctly for a floating\nsurface is its ELEVATION, so that is the only contract token here.\n\n--a63-overlay-shadow is a drop/elevation (mode-independent), so it's safe to\ndefault at :root and let each theme override it on its shell (modern soft,\naqua glassy halo, retro hard Win98 offset, terminal phosphor glow).\n\nThe contract now carries the full treatment vocabulary plus a drag-shadow\n(elevation while a floating surface is dragged).\n\n--a63-overlay-radius intentionally unset at :root; recipes read\n var(--a63-overlay-radius, <own default>) so themes can square all overlays.",
3
+ "a63": {
4
+ "overlay": {
5
+ "shadow": {
6
+ "$type": "shadow",
7
+ "$value": [
8
+ {
9
+ "color": {
10
+ "colorSpace": "srgb",
11
+ "components": [0, 0, 0],
12
+ "alpha": 0.22
13
+ },
14
+ "offsetX": {
15
+ "value": 0,
16
+ "unit": "px"
17
+ },
18
+ "offsetY": {
19
+ "value": 8,
20
+ "unit": "px"
21
+ },
22
+ "blur": {
23
+ "value": 24,
24
+ "unit": "px"
25
+ },
26
+ "spread": {
27
+ "value": -6,
28
+ "unit": "px"
29
+ }
30
+ },
31
+ {
32
+ "color": {
33
+ "colorSpace": "srgb",
34
+ "components": [0, 0, 0],
35
+ "alpha": 0.12
36
+ },
37
+ "offsetX": {
38
+ "value": 0,
39
+ "unit": "px"
40
+ },
41
+ "offsetY": {
42
+ "value": 2,
43
+ "unit": "px"
44
+ },
45
+ "blur": {
46
+ "value": 6,
47
+ "unit": "px"
48
+ },
49
+ "spread": {
50
+ "value": -2,
51
+ "unit": "px"
52
+ }
53
+ }
54
+ ],
55
+ "$extensions": {
56
+ "io.atom63.derive": "0 8px 24px -6px color-mix(in oklch, black 22%, transparent), 0 2px 6px -2px color-mix(in oklch, black 12%, transparent)"
57
+ },
58
+ "$description": "Outer elevation (existing lever, unchanged)."
59
+ },
60
+ "drag": {
61
+ "shadow": {
62
+ "$type": "shadow",
63
+ "$value": "{a63.overlay.shadow}",
64
+ "$description": "Elevation while a floating surface is dragged (widgets, window frames).\n Defaults to the resting shadow; a theme/consumer lifts it during drag."
65
+ }
66
+ },
67
+ "inner": {
68
+ "shadow": {
69
+ "$type": "shadow",
70
+ "$value": [],
71
+ "$extensions": {
72
+ "io.atom63.derive": "0 0 #0000"
73
+ },
74
+ "$description": "`0 0 #0000` not `none`: composed into comma-separated box-shadow lists\n (`var(--a63-overlay-inner-shadow), var(--a63-overlay-shadow)`). `none` is\n only legal as the sole value, so it invalidates the whole declaration and\n silently drops the overlay's elevation."
75
+ }
76
+ },
77
+ "highlight": {
78
+ "opacity": {
79
+ "$type": "number",
80
+ "$value": 1
81
+ }
82
+ },
83
+ "border": {
84
+ "style": {
85
+ "$type": "strokeStyle",
86
+ "$value": "solid"
87
+ },
88
+ "width": {
89
+ "$type": "dimension",
90
+ "$value": {
91
+ "value": 1,
92
+ "unit": "px"
93
+ }
94
+ }
95
+ }
96
+ }
97
+ },
98
+ "$extensions": {
99
+ "io.atom63.css": {
100
+ "imports": ["./overlay.native.css"]
101
+ }
102
+ }
103
+ }
@@ -1,4 +1,7 @@
1
1
  /*
2
+ * Generated from src/contracts/segment.tokens.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
  * Segment contract — the SELECTABLE / GROUPED action-control archetype.
3
6
  *
4
7
  * Covers the controls that present a SET of options where a resting cell flips to
@@ -25,76 +28,27 @@
25
28
  * fallback shown in the API block below, and a THEME overrides them under its
26
29
  * own [data-a63-theme='…'] scope (never :root). Only axis-INDEPENDENT geometry
27
30
  * + treatment defaults are declared at :root here.
31
+ *
32
+ * RADIUS is read at the recipe USE-SITE, NOT declared here. It's multiplier-
33
+ * dependent (--radius-md/-sm), so a :root declaration would freeze to the root
34
+ * multiplier and ignore the radius axis (the same trap fixed in menu.css):
35
+ * bar / outer cell -> var(--a63-segment-radius, var(--radius-md))
36
+ * inset selected -> var(--a63-segment-selected-radius, var(--radius-sm))
37
+ * Grouped/segmented controls stay TIGHTER than a standalone control pill (they
38
+ * do NOT read --a63-control-radius, which a theme can inflate to a pill).
39
+ *
40
+ * TREATMENT (track/selected gloss + shadow) is likewise read at the use-site,
41
+ * bridging to the control archetype until a theme/Figma sets a segment value:
42
+ * track -> var(--a63-segment-track-gloss, var(--a63-control-gloss))
43
+ * var(--a63-segment-track-shadow, var(--a63-control-shadow))
44
+ * selected -> var(--a63-segment-selected-gloss, var(--a63-control-gloss))
45
+ * var(--a63-segment-selected-shadow,var(--a63-control-shadow))
46
+ * A theme/Figma overrides any of these under [data-a63-theme='…'] to give
47
+ * segments their OWN character instead of borrowing the button's.
28
48
  */
29
-
30
49
  :root {
31
50
  /* ── Geometry (axis-independent, safe at :root) ──────────────────────── */
32
51
  --a63-segment-border-width: var(--a63-control-border-width);
33
- --a63-segment-gap: 0; /* welded by default; a gapped variant overrides */
34
-
35
- /*
36
- * RADIUS is read at the recipe USE-SITE, NOT declared here. It's multiplier-
37
- * dependent (--radius-md/-sm), so a :root declaration would freeze to the root
38
- * multiplier and ignore the radius axis (the same trap fixed in menu.css):
39
- * bar / outer cell -> var(--a63-segment-radius, var(--radius-md))
40
- * inset selected -> var(--a63-segment-selected-radius, var(--radius-sm))
41
- * Grouped/segmented controls stay TIGHTER than a standalone control pill (they
42
- * do NOT read --a63-control-radius, which a theme can inflate to a pill).
43
- *
44
- * TREATMENT (track/selected gloss + shadow) is likewise read at the use-site,
45
- * bridging to the control archetype until a theme/Figma sets a segment value:
46
- * track -> var(--a63-segment-track-gloss, var(--a63-control-gloss))
47
- * var(--a63-segment-track-shadow, var(--a63-control-shadow))
48
- * selected -> var(--a63-segment-selected-gloss, var(--a63-control-gloss))
49
- * var(--a63-segment-selected-shadow,var(--a63-control-shadow))
50
- * A theme/Figma overrides any of these under [data-a63-theme='…'] to give
51
- * segments their OWN character instead of borrowing the button's.
52
- */
52
+ /* welded by default; a gapped variant overrides */
53
+ --a63-segment-gap: 0;
53
54
  }
54
-
55
- /*
56
- * ── COLOUR API ─────────────────────────────────────────────────────────────
57
- * Consume each at the recipe USE-SITE with the live-semantic fallback shown, e.g.
58
- * background: var(--a63-segment-selected-background, var(--a63-action-neutral));
59
- * Themes override any of these under [data-a63-theme='…'] (a non-:root scope, so
60
- * the value resolves in context, not frozen). Do NOT declare these at :root.
61
- *
62
- * Track (the grouped container / bar):
63
- * --a63-segment-track-background → transparent
64
- * --a63-segment-track-border → var(--a63-border-subtle)
65
- * --a63-segment-seam → var(--a63-border-subtle) (divider between cells)
66
- *
67
- * Resting cell (unselected) — shared by BOTH tones:
68
- * --a63-segment-foreground → var(--a63-text-secondary)
69
- * --a63-segment-background → transparent (or a muted fill)
70
- * --a63-segment-gloss → none (aqua: soft mid-line gel + card→muted)
71
- * --a63-segment-hover-background → var(--a63-surface-control-hover)
72
- * --a63-segment-hover-foreground → var(--a63-text-primary)
73
- *
74
- * Selected cell — NEUTRAL tone (default):
75
- * --a63-segment-selected-background → var(--a63-action-neutral)
76
- * --a63-segment-selected-foreground → var(--a63-action-neutral-foreground)
77
- * --a63-segment-selected-gloss → var(--a63-control-gloss)
78
- * --a63-segment-selected-shadow → var(--a63-control-shadow)
79
- * (aqua Toggle: inset pressed-in; SegmentedControl indicator uses control shadow)
80
- *
81
- * Selected cell — PRIMARY / accent tone:
82
- * --a63-segment-primary-background → var(--a63-action-primary)
83
- * --a63-segment-primary-foreground → var(--a63-action-primary-foreground)
84
- * --a63-segment-primary-shadow → (optional deeper inset; falls back to selected)
85
- *
86
- * Disabled foreground fade (matches Button — foreground only, fill intact):
87
- * --a63-segment-disabled-opacity → 0.56 (aqua ToggleGroup: 0.4 per Figma)
88
- *
89
- * ── TRANSITIONAL FALLBACKS (Toggle/ToggleGroup wired 2026-07-21) ───────────────
90
- * The fallbacks ABOVE are the target intent. To land the Toggle/ToggleGroup
91
- * rewire value-preservingly, the recipes currently fall back to the PRE-EXISTING
92
- * toggle values (the tokens are unset, so these apply until a theme/Figma sets a
93
- * --a63-segment-* value). Differences to retune in Figma:
94
- * - resting foreground: recipe falls back to --a63-text-primary (intent above =
95
- * --a63-text-secondary, i.e. quieter unselected cells).
96
- * - NEUTRAL selected: standalone Toggle falls back to --a63-surface-muted (the
97
- * quiet pressed pill), while a welded ToggleGroup cell falls back to
98
- * --a63-action-neutral (the loud inverted segmented-cell). Same token, two
99
- * use-site fallbacks — Figma decides whether to unify or split (muted vs loud).
100
- */
@@ -0,0 +1,19 @@
1
+ {
2
+ "$description": "Segment contract — the SELECTABLE / GROUPED action-control archetype.\n\nCovers the controls that present a SET of options where a resting cell flips to\na SELECTED cell: Toggle, ToggleGroup, SegmentedControl, Tabs, and other option\n/ group-action rows. These are NOT single call-to-action buttons (that is the\n`control` archetype) — so they get their OWN namespace and never borrow the\nButton's control chrome. This is the token home for \"secondary action controls.\"\n\n── TWO authored tonal styles for the SELECTED cell ────────────────────────\n 1. neutral (default) — a quiet neutral fill (the segmented-control default).\n 2. primary — the brand-accent fill (radio-like emphasis / a\n highlighted current selection).\n The recipe picks one via a tone flag, e.g. [data-tone='primary'].\n The RESTING + HOVER treatment is shared by both tones — only the selected\n cell differs between neutral and primary.\n\n── AXIS TRAP (learned on Input/Switch — see selection.css) ────────────────\n Tokens whose value references mode/theme/brand semantics — every COLOUR here\n (the fills + foregrounds, e.g. --a63-action-neutral is mode-split light/dark,\n --a63-action-primary follows the brand axis) — must NOT be declared at :root.\n A var(--a63-action-*) resolved at :root freezes to the root's mode/theme and\n inherits that frozen value into .dark / [data-a63-theme] subtrees.\n So: the COLOUR hooks are consumed at the recipe USE-SITE with the live-semantic\n fallback shown in the API block below, and a THEME overrides them under its\n own [data-a63-theme='…'] scope (never :root). Only axis-INDEPENDENT geometry\n + treatment defaults are declared at :root here.\n\nRADIUS is read at the recipe USE-SITE, NOT declared here. It's multiplier-\ndependent (--radius-md/-sm), so a :root declaration would freeze to the root\nmultiplier and ignore the radius axis (the same trap fixed in menu.css):\n bar / outer cell -> var(--a63-segment-radius, var(--radius-md))\n inset selected -> var(--a63-segment-selected-radius, var(--radius-sm))\nGrouped/segmented controls stay TIGHTER than a standalone control pill (they\ndo NOT read --a63-control-radius, which a theme can inflate to a pill).\n\nTREATMENT (track/selected gloss + shadow) is likewise read at the use-site,\nbridging to the control archetype until a theme/Figma sets a segment value:\n track -> var(--a63-segment-track-gloss, var(--a63-control-gloss))\n var(--a63-segment-track-shadow, var(--a63-control-shadow))\n selected -> var(--a63-segment-selected-gloss, var(--a63-control-gloss))\n var(--a63-segment-selected-shadow,var(--a63-control-shadow))\nA theme/Figma overrides any of these under [data-a63-theme='…'] to give\nsegments their OWN character instead of borrowing the button's.",
3
+ "a63": {
4
+ "segment": {
5
+ "border": {
6
+ "width": {
7
+ "$type": "dimension",
8
+ "$value": "{a63.control.border.width}",
9
+ "$description": "── Geometry (axis-independent, safe at :root) ────────────────────────"
10
+ }
11
+ },
12
+ "gap": {
13
+ "$type": "number",
14
+ "$value": 0,
15
+ "$description": "welded by default; a gapped variant overrides"
16
+ }
17
+ }
18
+ }
19
+ }