@newtone-dev/ui-react-web 0.2.0 → 0.6.0

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 (115) hide show
  1. package/README.md +41 -15
  2. package/dist/accordion/accordion.css +5 -3
  3. package/dist/action/action.css +64 -5
  4. package/dist/action/action.d.ts +22 -1
  5. package/dist/action/action.d.ts.map +1 -1
  6. package/dist/action/action.js +16 -2
  7. package/dist/action/action.js.map +1 -1
  8. package/dist/bar-list/bar-list.css +95 -0
  9. package/dist/bar-list/bar-list.d.ts +28 -0
  10. package/dist/bar-list/bar-list.d.ts.map +1 -0
  11. package/dist/bar-list/bar-list.js +9 -0
  12. package/dist/bar-list/bar-list.js.map +1 -0
  13. package/dist/bar-list/index.d.ts +4 -0
  14. package/dist/bar-list/index.d.ts.map +1 -0
  15. package/dist/bar-list/index.js +3 -0
  16. package/dist/bar-list/index.js.map +1 -0
  17. package/dist/button/button.css +81 -5
  18. package/dist/button/button.d.ts +24 -1
  19. package/dist/button/button.d.ts.map +1 -1
  20. package/dist/button/button.js +12 -2
  21. package/dist/button/button.js.map +1 -1
  22. package/dist/chart-key/chart-key.css +33 -0
  23. package/dist/chart-key/chart-key.d.ts +15 -0
  24. package/dist/chart-key/chart-key.d.ts.map +1 -0
  25. package/dist/chart-key/chart-key.js +6 -0
  26. package/dist/chart-key/chart-key.js.map +1 -0
  27. package/dist/chart-key/index.d.ts +4 -0
  28. package/dist/chart-key/index.d.ts.map +1 -0
  29. package/dist/chart-key/index.js +3 -0
  30. package/dist/chart-key/index.js.map +1 -0
  31. package/dist/color/seeds.d.ts +7 -0
  32. package/dist/color/seeds.d.ts.map +1 -1
  33. package/dist/color/seeds.js +21 -0
  34. package/dist/color/seeds.js.map +1 -1
  35. package/dist/column-chart/column-chart.css +89 -0
  36. package/dist/column-chart/column-chart.d.ts +30 -0
  37. package/dist/column-chart/column-chart.d.ts.map +1 -0
  38. package/dist/column-chart/column-chart.js +11 -0
  39. package/dist/column-chart/column-chart.js.map +1 -0
  40. package/dist/column-chart/index.d.ts +4 -0
  41. package/dist/column-chart/index.d.ts.map +1 -0
  42. package/dist/column-chart/index.js +3 -0
  43. package/dist/column-chart/index.js.map +1 -0
  44. package/dist/control/control.css +49 -23
  45. package/dist/control/control.d.ts +33 -9
  46. package/dist/control/control.d.ts.map +1 -1
  47. package/dist/control/control.js +31 -17
  48. package/dist/control/control.js.map +1 -1
  49. package/dist/count-up/count-up.css +8 -0
  50. package/dist/count-up/count-up.d.ts +30 -0
  51. package/dist/count-up/count-up.d.ts.map +1 -0
  52. package/dist/count-up/count-up.js +92 -0
  53. package/dist/count-up/count-up.js.map +1 -0
  54. package/dist/count-up/index.d.ts +4 -0
  55. package/dist/count-up/index.d.ts.map +1 -0
  56. package/dist/count-up/index.js +3 -0
  57. package/dist/count-up/index.js.map +1 -0
  58. package/dist/figure/figure.css +11 -0
  59. package/dist/figure/figure.d.ts +17 -0
  60. package/dist/figure/figure.d.ts.map +1 -0
  61. package/dist/figure/figure.js +7 -0
  62. package/dist/figure/figure.js.map +1 -0
  63. package/dist/figure/index.d.ts +4 -0
  64. package/dist/figure/index.d.ts.map +1 -0
  65. package/dist/figure/index.js +3 -0
  66. package/dist/figure/index.js.map +1 -0
  67. package/dist/index.d.ts +15 -1
  68. package/dist/index.d.ts.map +1 -1
  69. package/dist/index.js +7 -0
  70. package/dist/index.js.map +1 -1
  71. package/dist/navbar/link/drawer/drawer.css +4 -3
  72. package/dist/navbar/link/link.css +15 -3
  73. package/dist/navbar/menu-button/menu-button.css +10 -3
  74. package/dist/navbar/navbar.css +186 -4
  75. package/dist/navbar/navbar.d.ts +33 -1
  76. package/dist/navbar/navbar.d.ts.map +1 -1
  77. package/dist/navbar/navbar.js +4 -2
  78. package/dist/navbar/navbar.js.map +1 -1
  79. package/dist/page/band.d.ts +52 -0
  80. package/dist/page/band.d.ts.map +1 -0
  81. package/dist/page/band.js +36 -0
  82. package/dist/page/band.js.map +1 -0
  83. package/dist/page/index.d.ts +4 -0
  84. package/dist/page/index.d.ts.map +1 -0
  85. package/dist/page/index.js +8 -0
  86. package/dist/page/index.js.map +1 -0
  87. package/dist/page/page.css +240 -0
  88. package/dist/page/page.d.ts +137 -0
  89. package/dist/page/page.d.ts.map +1 -0
  90. package/dist/page/page.js +29 -0
  91. package/dist/page/page.js.map +1 -0
  92. package/dist/quick-action/quick-action.css +36 -7
  93. package/dist/quick-action/quick-action.d.ts +26 -6
  94. package/dist/quick-action/quick-action.d.ts.map +1 -1
  95. package/dist/quick-action/quick-action.js +11 -7
  96. package/dist/quick-action/quick-action.js.map +1 -1
  97. package/dist/segmented-control/segmented-control.css +2 -2
  98. package/dist/split-bar/index.d.ts +4 -0
  99. package/dist/split-bar/index.d.ts.map +1 -0
  100. package/dist/split-bar/index.js +3 -0
  101. package/dist/split-bar/index.js.map +1 -0
  102. package/dist/split-bar/split-bar.css +86 -0
  103. package/dist/split-bar/split-bar.d.ts +27 -0
  104. package/dist/split-bar/split-bar.d.ts.map +1 -0
  105. package/dist/split-bar/split-bar.js +7 -0
  106. package/dist/split-bar/split-bar.js.map +1 -0
  107. package/dist/text/text.css +69 -0
  108. package/dist/text/text.d.ts +6 -4
  109. package/dist/text/text.d.ts.map +1 -1
  110. package/dist/text/text.js.map +1 -1
  111. package/dist/wrapper/wrapper.d.ts +11 -2
  112. package/dist/wrapper/wrapper.d.ts.map +1 -1
  113. package/dist/wrapper/wrapper.js +5 -1
  114. package/dist/wrapper/wrapper.js.map +1 -1
  115. package/package.json +36 -1
package/README.md CHANGED
@@ -9,18 +9,31 @@ Newtone's component library for React on the web.
9
9
 
10
10
  ## What is here
11
11
 
12
- Four components and a colour port. The first real screen —
13
- [`joshuaallen_website`](../../joshuaallen/joshuaallen_website) — is what brought them into
14
- existence.
12
+ **~~Twenty-six~~ Thirty-four components and a colour port** (recounted with `ls src/*/index.ts` on 2026-09-25, when the six chart parts arrived in `0.6.0`; the twenty-six had gone stale before them). `ls src/*/index.ts` is the complete public API that
13
+ JavaScript can reach; `package.json`'s `exports` map is the complete one including stylesheets.
14
+ **This table is the spine and not the list** — the blueprint above carries every component.
15
15
 
16
16
  | | |
17
17
  | --- | --- |
18
18
  | `Surface` | Owns the context its contents read: `theme`, `elevation`, `mode` |
19
- | `Button` | Discharges `contracts/button.md`. Three variants, five states |
19
+ | `Button` | Discharges `contracts/button.md`. Three variants, five states, **three size rungs** |
20
20
  | `Text` | Discharges `contracts/typography.md`. `font`, `weight`, `case`, `figures`, `ligatures` |
21
+ | `Navbar` | Discharges `contracts/navbar.md`. Parts and knobs; arrangements belong to the site |
21
22
  | `Identity` | A scoped seed set: re-derives colour for one subtree |
22
23
  | `color.ts` | A port of `contracts/color-derivation.md` — the runtime half of identity |
23
24
 
25
+ ### Control sizes
26
+
27
+ **Every control here is one of five heights — 36, 40, 44, 48, 56 — on one of two type pairs,
28
+ 14/20 or 16/24.** A `size` prop picks a rung and the rung carries its height, its type pair, its
29
+ glyph and its padding together; there is no second axis. `contracts/button.md`, *Sizes*.
30
+
31
+ | | `sm` | `md` | `lg` |
32
+ | --- | --- | --- | --- |
33
+ | `Control` | 36 | 40 | 44 |
34
+ | `Button`, `Navbar` | 40 | 44 | 48 |
35
+ | `Action`, `QuickAction` | 48 | — | 56 |
36
+
24
37
  ## The idea in one example
25
38
 
26
39
  ```tsx
@@ -43,7 +56,7 @@ what the role layer exists to prevent.
43
56
  ## Scoped identity
44
57
 
45
58
  ```tsx
46
- <Identity seeds={{ system: { accent: { h: 34.5, c: 0.78 } } }}>
59
+ <Identity seeds={{ system: { accent: { h: 35, c: 0.78 } } }}>
47
60
  {/* this subtree wears another brand over the site's own neutrals */}
48
61
  </Identity>
49
62
  ```
@@ -64,20 +77,33 @@ The derivation is computed, not tabulated: fifty-one steps spaced evenly in CIE
64
77
  chroma taken from the Display P3 ceiling. `src/color.ts` and the tokens repo's
65
78
  `compute/` are two implementations of one contract and must produce the same bytes.
66
79
 
67
- ## No build
80
+ ## The build
68
81
 
69
- There is no bundler, no `tsconfig.json` and no `dist/`. The consumer compiles this source,
70
- which is why the only real config is the alias in the app's `vite.config.ts`. Build config
71
- gets written when publishing this repo is what hurts — not before.
82
+ `npm run build` — `tsc` to `dist/`, then `copy-styles.mjs`, which walks `src` and copies all 29
83
+ stylesheets across verbatim because `tsc` emits no CSS. `dist/` is gitignored and built on publish
84
+ by `prepublishOnly`; there is no bundler.
85
+
86
+ **This section said *There is no build* until 2026-09-21**, and had been wrong since the build
87
+ landed. `tsconfig.json` sets `"module": "NodeNext"`, which is why every relative import here carries
88
+ an explicit extension — a bundler resolved `from './button'` and Node ESM does not.
72
89
 
73
90
  ## Consuming
74
91
 
75
- By path reference, not a registry. Nothing is published to npm.
92
+ **Published to npm as `@newtone-dev/ui-react-web`.** It declares `react` as a peer (`^18 || ^19`)
93
+ and does **not** depend on `@newtone-dev/ui-tokens`: every component reads `--newtone-*` custom
94
+ properties by name, and supplying them is the consuming site's job.
95
+
96
+ ```sh
97
+ npm install @newtone-dev/ui-react-web @newtone-dev/ui-tokens
98
+ ```
76
99
 
77
100
  ```ts
78
- // vite.config.ts -- anchored regexes, because a bare string alias for the package
79
- // would also swallow "@newtone-dev/ui-react-web/button.css".
80
- alias: [
81
- { find: /^@newtone\/ui-react-web$/, replacement: '<path>/newtone_ui_react-web/src/index.ts' },
82
- ]
101
+ import { Surface, Button } from '@newtone-dev/ui-react-web'
102
+ import '@newtone-dev/ui-react-web/button.css'
83
103
  ```
104
+
105
+ **Stylesheets are imported one at a time, per component**, and every path a consumer may import is a
106
+ key in the `exports` map. `sideEffects` names `**/*.css` so a bundler keeps them.
107
+
108
+ **This section said *Nothing is published to npm* until 2026-09-21**, three weeks after
109
+ `publishConfig.access` and `prepublishOnly` were added.
@@ -205,7 +205,8 @@
205
205
  * element no longer sets -- a declaration whose subject has gone, which is the shape this house
206
206
  * keeps meeting. Blueprint components/accordion.md carries the pass. */
207
207
  .newtone-accordion-marker > * {
208
- transition: transform 0.15s ease-out;
208
+ /* motion.duration.quick and easing.standard from 0.6.0: the 0.15s ease-out, by name. */
209
+ transition: transform var(--newtone-motion-duration-quick) var(--newtone-motion-easing-standard);
209
210
  }
210
211
 
211
212
  .newtone-accordion-row[open] .newtone-accordion-marker > * {
@@ -216,8 +217,9 @@
216
217
  block-size: 0;
217
218
  overflow: clip;
218
219
  transition:
219
- block-size 0.15s ease-out,
220
- content-visibility 0.15s ease-out allow-discrete;
220
+ block-size var(--newtone-motion-duration-quick) var(--newtone-motion-easing-standard),
221
+ content-visibility var(--newtone-motion-duration-quick)
222
+ var(--newtone-motion-easing-standard) allow-discrete;
221
223
  }
222
224
 
223
225
  .newtone-accordion-row[open]::details-content {
@@ -42,11 +42,43 @@
42
42
  align-items: center;
43
43
  justify-content: center;
44
44
  gap: var(--newtone-action-gap);
45
- padding: var(--newtone-action-padding-y) var(--newtone-action-padding-x);
45
+
46
+ /* THE RUNG ARRIVES THROUGH FOUR LOCAL PROPERTIES the size rules below set. That indirection is
47
+ * what keeps `--icon-end` below a single rule -- it resolves the same `--newtone-action-pad-y`
48
+ * without knowing which rung set it -- and what lets the published height name its two numbers
49
+ * once. contracts/button.md, *Sizes*. */
50
+ /* THE BORDER IS SUBTRACTED FROM THE BLOCK PADDING so the rung names the OUTER box, which is
51
+ * what a ladder of heights has to mean -- `Control` has done this since it landed. Without it
52
+ * this rendered 46 against a 44 rung, measured on a page rather than read off this file:
53
+ * governance/evidence/verify-what-renders-not-what-was-written.md. The inline axis is NOT
54
+ * adjusted, because it is a proportion rather than a rung. */
55
+ /* THE INLINE PADDING IS DERIVED AND NOT AUTHORED, from 2026-09-21 late.
56
+ *
57
+ * Joshua, that day: *"48px buttons should have 12/20 paddings, depending on icon/text being on
58
+ * that side. And from there we should implement similar proportions on the bigger and smaller
59
+ * buttons."* A 48 box is 24 of leading in 2 x 12, so **12 IS ITS BLOCK PADDING** -- his glyph
60
+ * number is not a new value, it is the one the rung already has. And 20 is that plus one gap,
61
+ * which is governance/code/an-icon-and-the-text-beside-it-do-not-take-the-same-padding.md
62
+ * stated as arithmetic: *the difference is the component's own gap and never a new number.*
63
+ *
64
+ * SO ONE RELATION REPLACES A VALUE PER RUNG, and every rung gets his proportions for free:
65
+ * 36 -> 8/16, 40 -> 10/18, 44 -> 12/20, 48 -> 12/20, 56 -> 16/24. **44 and 48 share an inset
66
+ * on purpose** -- both hold their type in 12px of clear space, which is what the inset measures.
67
+ *
68
+ * THE BORDER IS SUBTRACTED ON BOTH AXES so these are rim-to-text distances rather than padding
69
+ * box numbers. Without it a 48 button reads 21 on the side he said should read 20. */
70
+ padding: calc(var(--newtone-action-pad-y) - 1px)
71
+ calc(var(--newtone-action-pad-y) + var(--newtone-action-gap) - 1px);
46
72
  font-family: var(--newtone-action-label-family);
47
- font-size: var(--newtone-action-label-size);
73
+ font-size: var(--newtone-action-text-size);
48
74
  font-weight: var(--newtone-action-label-weight);
49
- line-height: var(--newtone-action-label-line-height);
75
+ line-height: var(--newtone-action-text-leading);
76
+
77
+ /* PUBLISHED, NEVER DECLARED -- issues/open/156. `sm` comes to 48, which is Button's `lg`, and a
78
+ * row holding one of each can now read both instead of a consumer tuning one until it matches.
79
+ * Read it; writing it changes no geometry, because the box is the padding. */
80
+ --newtone-action-height: calc(var(--newtone-action-text-leading) + 2 * var(--newtone-action-pad-y));
81
+
50
82
  border: 1px solid;
51
83
  border-radius: var(--newtone-action-radius);
52
84
  cursor: pointer;
@@ -74,10 +106,37 @@
74
106
  outline-offset: 2px;
75
107
  }
76
108
 
109
+ /* ---- the rungs ----------------------------------------------------------
110
+ *
111
+ * 48 and 56 -- the top two of the ladder's five. contracts/button.md, *Sizes*.
112
+ *
113
+ * BOTH TAKE 16/24, so only the box grows. That is what being at the top means here: an Action is
114
+ * *the one thing a page is asking for*, and the two rungs are how loudly, not how much it says.
115
+ *
116
+ * THE LABEL USED TO BE 18/21.6 -- `typography.size.lg` on a ratio -- against a 24px glyph. Three
117
+ * numbers from three places, and 21.6 chosen by nobody. Each rung now names both leaves of one
118
+ * step. issues/open/157. */
119
+ .newtone-action--sm {
120
+ --newtone-action-pad-y: var(--newtone-action-size-sm-padding-y);
121
+ --newtone-action-text-size: var(--newtone-action-size-sm-label-size);
122
+ --newtone-action-text-leading: var(--newtone-action-size-sm-label-line-height);
123
+ }
124
+
125
+ .newtone-action--lg {
126
+ --newtone-action-pad-y: var(--newtone-action-size-lg-padding-y);
127
+ --newtone-action-text-size: var(--newtone-action-size-lg-label-size);
128
+ --newtone-action-text-leading: var(--newtone-action-size-lg-label-line-height);
129
+ }
130
+
77
131
  /* One class, so it publishes at the same 0,1,0 as everything else here, and it touches a property
78
- * `--fill` does not -- the two compose in either order. */
132
+ * `--fill` does not -- the two compose in either order.
133
+ *
134
+ * IT READS THE RUNG'S PADDING AND NOT A TOKEN, so one rule serves both rungs: 24 becomes 16 at
135
+ * `lg`, 20 becomes 12 at `sm`. The gap is 8 at every rung -- deliberately off the ladder -- so the
136
+ * difference between the word's rim and the glyph's is one constant and cannot be recomputed wrong
137
+ * per rung. governance/code/an-icon-and-the-text-beside-it-do-not-take-the-same-padding.md. */
79
138
  .newtone-action--icon-end {
80
- padding-inline-end: calc(var(--newtone-action-padding-x) - var(--newtone-action-gap));
139
+ padding-inline-end: calc(var(--newtone-action-pad-y) - 1px);
81
140
  }
82
141
 
83
142
  .newtone-action--fill {
@@ -1,4 +1,16 @@
1
1
  import type { AnchorHTMLAttributes, ButtonHTMLAttributes } from 'react';
2
+ /**
3
+ * Two rungs of the ladder's five: **48 and 56**, the top of it.
4
+ *
5
+ * AN ACTION IS ABOVE A BUTTON AT BOTH, which is the whole of what this component is -- *a pill,
6
+ * larger than a Button*, with no `variant`, because a second task would mean neither is the task.
7
+ * contracts/button.md, *Sizes*.
8
+ *
9
+ * `sm` IS 48, WHICH IS ALSO BUTTON'S `lg`, ON PURPOSE. adenario_website's hero holds one of each
10
+ * and had been keeping them level with three hand-tuned custom properties in its own scope --
11
+ * issues/open/156. They now agree because both name a rung, and both publish their height.
12
+ */
13
+ export type ActionSize = 'sm' | 'lg';
2
14
  interface ActionCommon {
3
15
  /** The action's words. Required and always rendered -- an action is a specific, named ask. */
4
16
  label: string;
@@ -13,6 +25,15 @@ interface ActionCommon {
13
25
  * `action.css` and governance/code/an-icon-and-the-text-beside-it-do-not-take-the-same-padding.md.
14
26
  */
15
27
  iconEnd?: string;
28
+ /**
29
+ * Which rung: 48 or 56. Defaults to `lg`, which is 56 -- where the one existing call site
30
+ * already was, so nothing on any page moves by more than half a pixel.
31
+ *
32
+ * **The label moves a lot even though the box does not.** It was `typography.size.lg` on a
33
+ * ratio -- 18/21.6 -- and is now the 16/24 step at both rungs. A reader sees that and not the
34
+ * 0.4px the box gained.
35
+ */
36
+ size?: ActionSize;
16
37
  /** Stretch to the container's inline size -- a phone's call to action, a card's footer. */
17
38
  fill?: boolean;
18
39
  }
@@ -57,6 +78,6 @@ export type ActionProps = ActionCommon & ((Omit<ButtonHTMLAttributes<HTMLButtonE
57
78
  * does nothing, which is an honest placeholder and not a form control: `type="button"` is
58
79
  * hardcoded, so it cannot submit a form it happens to be standing in.
59
80
  */
60
- export declare function Action({ label, ariaLabel, iconEnd, fill, className, ...rest }: ActionProps): import("react").JSX.Element;
81
+ export declare function Action({ label, ariaLabel, iconEnd, size, fill, className, ...rest }: ActionProps): import("react").JSX.Element;
61
82
  export {};
62
83
  //# sourceMappingURL=action.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../src/action/action.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAA;AAGvE,UAAU,YAAY;IAClB,8FAA8F;IAC9F,KAAK,EAAE,MAAM,CAAA;IACb,qFAAqF;IACrF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,2FAA2F;IAC3F,IAAI,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,MAAM,WAAW,GAAG,YAAY,GAClC,CACM,CAAC,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC,GAAG;IACxE,IAAI,CAAC,EAAE,SAAS,CAAA;CACnB,CAAC,GACF,CAAC,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,YAAY,CAAC,GAAG;IACjF,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAA;CACf,CAAC,CACP,CAAA;AAEL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,MAAM,CAAC,EACnB,KAAK,EACL,SAAS,EACT,OAAO,EACP,IAAY,EACZ,SAAS,EACT,GAAG,IAAI,EACV,EAAE,WAAW,+BA4Cb"}
1
+ {"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../src/action/action.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAA;AAGvE;;;;;;;;;;GAUG;AACH,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,CAAA;AAgBpC,UAAU,YAAY;IAClB,8FAA8F;IAC9F,KAAK,EAAE,MAAM,CAAA;IACb,qFAAqF;IACrF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,2FAA2F;IAC3F,IAAI,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,MAAM,WAAW,GAAG,YAAY,GAClC,CACM,CAAC,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC,GAAG;IACxE,IAAI,CAAC,EAAE,SAAS,CAAA;CACnB,CAAC,GACF,CAAC,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,YAAY,CAAC,GAAG;IACjF,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAA;CACf,CAAC,CACP,CAAA;AAEL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,MAAM,CAAC,EACnB,KAAK,EACL,SAAS,EACT,OAAO,EACP,IAAW,EACX,IAAY,EACZ,SAAS,EACT,GAAG,IAAI,EACV,EAAE,WAAW,+BA6Cb"}
@@ -1,5 +1,18 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Icon } from '../icon/index.js';
3
+ /**
4
+ * THE GLYPH THAT PAIRS WITH EACH RUNG'S LABEL LEADING.
5
+ *
6
+ * Both rungs take 16/24, so both take the 24px mark. **It is a map and not a constant** because the
7
+ * pairing is the fact: a glyph is sized to the leading of the text beside it, and a rung that took
8
+ * 14/20 would take 20. governance/code/an-icon-and-the-text-beside-it-share-one-size-and-leading-pair.md.
9
+ *
10
+ * IT WAS `size="md"` WRITTEN INTO THE RENDER until 2026-09-21, against a label of 18/21.6 -- so the
11
+ * glyph belonged to the 16/24 pair, the size belonged to no pair at all, and the leading was 2.4px
12
+ * short of the mark it stood against. issues/open/157 named it in those words: *a size written into
13
+ * the render is a size that cannot follow the component's own step*.
14
+ */
15
+ const GLYPH = { sm: 'md', lg: 'md' };
3
16
  /**
4
17
  * The one thing a page is asking for.
5
18
  *
@@ -35,12 +48,13 @@ import { Icon } from '../icon/index.js';
35
48
  * does nothing, which is an honest placeholder and not a form control: `type="button"` is
36
49
  * hardcoded, so it cannot submit a form it happens to be standing in.
37
50
  */
38
- export function Action({ label, ariaLabel, iconEnd, fill = false, className, ...rest }) {
51
+ export function Action({ label, ariaLabel, iconEnd, size = 'lg', fill = false, className, ...rest }) {
39
52
  // `--icon-end` is keyed on the glyph being PRESENT and not on the prop being declared, because
40
53
  // the class does one thing -- take a gap off the padding on the glyph's side -- and a pill with
41
54
  // no glyph in it would be 16px short on one side for nothing. See action.css.
42
55
  const classes = [
43
56
  'newtone-action',
57
+ `newtone-action--${size}`,
44
58
  iconEnd === undefined ? null : 'newtone-action--icon-end',
45
59
  fill ? 'newtone-action--fill' : null,
46
60
  className,
@@ -49,7 +63,7 @@ export function Action({ label, ariaLabel, iconEnd, fill = false, className, ...
49
63
  .join(' ');
50
64
  // The label is always present, so the control always has a name and the glyph is decorative.
51
65
  // `Icon` writes its own `aria-hidden`.
52
- const content = (_jsxs(_Fragment, { children: [_jsx("span", { className: "newtone-action-label", children: label }), iconEnd === undefined ? null : _jsx(Icon, { name: iconEnd, size: "md" })] }));
66
+ const content = (_jsxs(_Fragment, { children: [_jsx("span", { className: "newtone-action-label", children: label }), iconEnd === undefined ? null : _jsx(Icon, { name: iconEnd, size: GLYPH[size] })] }));
53
67
  if (rest.href !== undefined) {
54
68
  const { href, ...anchor } = rest;
55
69
  return (_jsx("a", { href: href, className: classes, "aria-label": ariaLabel, ...anchor, children: content }));
@@ -1 +1 @@
1
- {"version":3,"file":"action.js","sourceRoot":"","sources":["../../src/action/action.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AA+BvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,UAAU,MAAM,CAAC,EACnB,KAAK,EACL,SAAS,EACT,OAAO,EACP,IAAI,GAAG,KAAK,EACZ,SAAS,EACT,GAAG,IAAI,EACG;IACV,+FAA+F;IAC/F,gGAAgG;IAChG,8EAA8E;IAC9E,MAAM,OAAO,GAAG;QACZ,gBAAgB;QAChB,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,0BAA0B;QACzD,IAAI,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,IAAI;QACpC,SAAS;KACZ;SACI,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,GAAG,CAAC,CAAA;IAEd,6FAA6F;IAC7F,uCAAuC;IACvC,MAAM,OAAO,GAAG,CACZ,8BACI,eAAM,SAAS,EAAC,sBAAsB,YAAE,KAAK,GAAQ,EACpD,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAC,IAAI,GAAG,IAClE,CACN,CAAA;IAED,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC1B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,GAAG,IAG3B,CAAA;QACD,OAAO,CACH,YAAG,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,gBAAc,SAAS,KAAM,MAAM,YAC/D,OAAO,GACR,CACP,CAAA;IACL,CAAC;IAED,OAAO,CACH,iBACI,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,OAAO,gBACN,SAAS,KAChB,IAAgD,YAEpD,OAAO,GACH,CACZ,CAAA;AACL,CAAC"}
1
+ {"version":3,"file":"action.js","sourceRoot":"","sources":["../../src/action/action.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAiB,MAAM,kBAAkB,CAAA;AAetD;;;;;;;;;;;GAWG;AACH,MAAM,KAAK,GAAiC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,CAAA;AAwClE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,UAAU,MAAM,CAAC,EACnB,KAAK,EACL,SAAS,EACT,OAAO,EACP,IAAI,GAAG,IAAI,EACX,IAAI,GAAG,KAAK,EACZ,SAAS,EACT,GAAG,IAAI,EACG;IACV,+FAA+F;IAC/F,gGAAgG;IAChG,8EAA8E;IAC9E,MAAM,OAAO,GAAG;QACZ,gBAAgB;QAChB,mBAAmB,IAAI,EAAE;QACzB,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,0BAA0B;QACzD,IAAI,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,IAAI;QACpC,SAAS;KACZ;SACI,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,GAAG,CAAC,CAAA;IAEd,6FAA6F;IAC7F,uCAAuC;IACvC,MAAM,OAAO,GAAG,CACZ,8BACI,eAAM,SAAS,EAAC,sBAAsB,YAAE,KAAK,GAAQ,EACpD,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,GAAI,IAC3E,CACN,CAAA;IAED,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC1B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,GAAG,IAG3B,CAAA;QACD,OAAO,CACH,YAAG,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,gBAAc,SAAS,KAAM,MAAM,YAC/D,OAAO,GACR,CACP,CAAA;IACL,CAAC;IAED,OAAO,CACH,iBACI,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,OAAO,gBACN,SAAS,KAChB,IAAgD,YAEpD,OAAO,GACH,CACZ,CAAA;AACL,CAAC"}
@@ -0,0 +1,95 @@
1
+ /* BarList -- blueprint components/bar-list.md. One grid; each row is `display: contents`, so every
2
+ name shares one column as wide as the longest. The share is a registered number so the width
3
+ itself animates and the value rides the bar's end. The bar leaves 3rem for its value. */
4
+
5
+ @property --_bar-list-share {
6
+ syntax: '<number>';
7
+ inherits: false;
8
+ initial-value: 0;
9
+ }
10
+
11
+ .newtone-bar-list {
12
+ display: grid;
13
+ grid-template-columns: max-content minmax(0, 1fr);
14
+ align-items: center;
15
+ column-gap: var(--newtone-space-4);
16
+ row-gap: var(--newtone-space-2);
17
+ }
18
+
19
+ .newtone-bar-list-row {
20
+ display: contents;
21
+ }
22
+
23
+ .newtone-bar-list-label,
24
+ .newtone-bar-list-value {
25
+ color: var(--newtone-chart-label);
26
+ }
27
+
28
+ .newtone-bar-list-track {
29
+ position: relative;
30
+ display: flex;
31
+ align-items: center;
32
+ gap: var(--newtone-space-2);
33
+ height: var(--newtone-space-5);
34
+ }
35
+
36
+ /* The axis every bar starts on: one segment per row reaching half the gap each way, so they meet. */
37
+ .newtone-bar-list-track::before {
38
+ content: '';
39
+ position: absolute;
40
+ top: calc(var(--newtone-space-2) / -2);
41
+ bottom: calc(var(--newtone-space-2) / -2);
42
+ left: 0;
43
+ width: 1px;
44
+ background: var(--newtone-chart-axis);
45
+ }
46
+
47
+ .newtone-bar-list-bar {
48
+ flex: none;
49
+ width: calc((100% - 3rem) * var(--_bar-list-share));
50
+ height: 100%;
51
+ border-radius: 0 var(--newtone-chart-radius) var(--newtone-chart-radius) 0;
52
+ background: var(--newtone-chart-mark);
53
+ }
54
+
55
+ .newtone-bar-list[data-tone='muted'] .newtone-bar-list-bar {
56
+ background: var(--newtone-chart-mark-muted);
57
+ }
58
+
59
+ .newtone-bar-list[data-fill] {
60
+ height: 100%;
61
+ grid-auto-rows: minmax(0, 1fr);
62
+ }
63
+
64
+ .newtone-bar-list[data-fill] .newtone-bar-list-track {
65
+ height: 100%;
66
+ }
67
+
68
+ @keyframes newtone-bar-list-grow {
69
+ from {
70
+ --_bar-list-share: 0;
71
+ }
72
+ }
73
+
74
+ @media screen and (prefers-reduced-motion: no-preference) {
75
+ .newtone-bar-list-bar {
76
+ animation: newtone-bar-list-grow var(--newtone-motion-duration-reveal)
77
+ var(--newtone-motion-easing-reveal) both;
78
+ }
79
+ }
80
+
81
+ /* Below `stack`, each name above its bar; the rows keep their fixed height. */
82
+ @media (max-width: 40rem) {
83
+ .newtone-bar-list {
84
+ grid-template-columns: minmax(0, 1fr);
85
+ row-gap: var(--newtone-space-1);
86
+ }
87
+
88
+ .newtone-bar-list[data-fill] {
89
+ grid-auto-rows: auto;
90
+ }
91
+
92
+ .newtone-bar-list[data-fill] .newtone-bar-list-track {
93
+ height: var(--newtone-space-5);
94
+ }
95
+ }
@@ -0,0 +1,28 @@
1
+ import type { HTMLAttributes, ReactNode } from 'react';
2
+ /**
3
+ * A ranked list of horizontal bars: a name, a bar, and the value riding the bar's end. From 0.6.0,
4
+ * 2026-09-25. Blueprint components/bar-list.md.
5
+ *
6
+ * Names sit in one column as wide as the longest (each row is `display: contents` in one grid), the
7
+ * bars start on one axis rule, and each bar's free end takes `chart.radius`. The bar's WIDTH grows,
8
+ * not a transform of it, so the value after it moves with it. Reads only `--newtone-chart-*`,
9
+ * `--newtone-motion-*` and space steps. The share each bar draws is a private custom property the
10
+ * component writes; no consumer writes one.
11
+ */
12
+ export interface BarListItem {
13
+ label: ReactNode;
14
+ value: number;
15
+ /** The value as written after the bar: `1.4`, `29`. Defaults to `String(value)`. */
16
+ display?: string;
17
+ }
18
+ export interface BarListProps extends HTMLAttributes<HTMLDivElement> {
19
+ items: BarListItem[];
20
+ /** The value a full bar stands for. Defaults to the largest `value`. */
21
+ max?: number;
22
+ /** `mark` (default) or `muted`. */
23
+ tone?: 'mark' | 'muted';
24
+ /** Rows share the height of the list's container. */
25
+ fill?: boolean;
26
+ }
27
+ export declare function BarList({ items, max, tone, fill, className, ...rest }: BarListProps): import("react").JSX.Element;
28
+ //# sourceMappingURL=bar-list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bar-list.d.ts","sourceRoot":"","sources":["../../src/bar-list/bar-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGrE;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAW;IACxB,KAAK,EAAE,SAAS,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,oFAAoF;IACpF,OAAO,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,YAAa,SAAQ,cAAc,CAAC,cAAc,CAAC;IAChE,KAAK,EAAE,WAAW,EAAE,CAAA;IACpB,wEAAwE;IACxE,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IACvB,qDAAqD;IACrD,IAAI,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,wBAAgB,OAAO,CAAC,EACpB,KAAK,EACL,GAAG,EACH,IAAa,EACb,IAAY,EACZ,SAAS,EACT,GAAG,IAAI,EACV,EAAE,YAAY,+BAoCd"}
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Text } from '../text/index.js';
3
+ export function BarList({ items, max, tone = 'mark', fill = false, className, ...rest }) {
4
+ const top = max ?? Math.max(...items.map((item) => item.value));
5
+ return (_jsx("div", { className: className ? `newtone-bar-list ${className}` : 'newtone-bar-list', "data-tone": tone, "data-fill": fill ? '' : undefined, ...rest, children: items.map((item, i) => (_jsxs("div", { className: "newtone-bar-list-row", children: [_jsx(Text, { as: "div", scale: "body-sm", className: "newtone-bar-list-label", children: item.label }), _jsxs("div", { className: "newtone-bar-list-track", children: [_jsx("div", { className: "newtone-bar-list-bar", style: {
6
+ '--_bar-list-share': top > 0 ? item.value / top : 0,
7
+ } }), _jsx(Text, { as: "div", scale: "body-sm", figures: "tabular", className: "newtone-bar-list-value", children: item.display ?? String(item.value) })] })] }, i))) }));
8
+ }
9
+ //# sourceMappingURL=bar-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bar-list.js","sourceRoot":"","sources":["../../src/bar-list/bar-list.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AA6BvC,MAAM,UAAU,OAAO,CAAC,EACpB,KAAK,EACL,GAAG,EACH,IAAI,GAAG,MAAM,EACb,IAAI,GAAG,KAAK,EACZ,SAAS,EACT,GAAG,IAAI,EACI;IACX,MAAM,GAAG,GAAG,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;IAC/D,OAAO,CACH,cACI,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,oBAAoB,SAAS,EAAE,CAAC,CAAC,CAAC,kBAAkB,eAChE,IAAI,eACJ,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,KAC5B,IAAI,YAEP,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACpB,eAAa,SAAS,EAAC,sBAAsB,aACzC,KAAC,IAAI,IAAC,EAAE,EAAC,KAAK,EAAC,KAAK,EAAC,SAAS,EAAC,SAAS,EAAC,wBAAwB,YAC5D,IAAI,CAAC,KAAK,GACR,EACP,eAAK,SAAS,EAAC,wBAAwB,aACnC,cACI,SAAS,EAAC,sBAAsB,EAChC,KAAK,EACD;gCACI,mBAAmB,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;6BACrC,GAExB,EACF,KAAC,IAAI,IACD,EAAE,EAAC,KAAK,EACR,KAAK,EAAC,SAAS,EACf,OAAO,EAAC,SAAS,EACjB,SAAS,EAAC,wBAAwB,YAEjC,IAAI,CAAC,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,GAChC,IACL,KArBA,CAAC,CAsBL,CACT,CAAC,GACA,CACT,CAAA;AACL,CAAC"}
@@ -0,0 +1,4 @@
1
+ /** The door. See the repo blueprint, section 3. */
2
+ export { BarList } from './bar-list.js';
3
+ export type { BarListProps, BarListItem } from './bar-list.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bar-list/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA"}
@@ -0,0 +1,3 @@
1
+ /** The door. See the repo blueprint, section 3. */
2
+ export { BarList } from './bar-list.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/bar-list/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA"}
@@ -1,17 +1,59 @@
1
1
  /* Button's own styles. Every value is a button.* token; nothing here names a colour, and
2
- nothing here mentions a facet. Radius and border width are literals because the tokens
3
- repo has no scale to point at yet -- see contracts/button.md, "Deliberately not in v1". */
2
+ nothing here mentions a facet. Border width is a literal because the tokens repo has nothing
3
+ to point at and says so -- contracts/button.md, "Deliberately not in v1", Border width. */
4
4
 
5
5
  .newtone-button {
6
6
  display: inline-flex;
7
7
  align-items: center;
8
8
  justify-content: center;
9
9
  gap: var(--newtone-button-gap);
10
- padding: var(--newtone-button-padding-y) var(--newtone-button-padding-x);
10
+
11
+ /* THE RUNG IS READ FROM THREE LOCAL PROPERTIES THE SIZE RULES BELOW SET, rather than from
12
+ `--newtone-button-size-md-*` directly. That indirection is what lets a rung be ONE rule --
13
+ three declarations instead of a copy of this whole block per size -- and it is also what
14
+ makes the height below expressible, since `calc()` needs the two numbers by one name.
15
+ contracts/button.md, *Sizes*. */
16
+ /* THE BORDER IS SUBTRACTED FROM THE BLOCK PADDING so the rung names the OUTER box, which is
17
+ * what a ladder of heights has to mean -- `Control` has done this since it landed. Without it
18
+ * this rendered 46 against a 44 rung, measured on a page rather than read off this file:
19
+ * governance/evidence/verify-what-renders-not-what-was-written.md. The inline axis is NOT
20
+ * adjusted, because it is a proportion rather than a rung. */
21
+ /* THE INLINE PADDING IS DERIVED AND NOT AUTHORED, from 2026-09-21 late.
22
+ *
23
+ * Joshua, that day: *"48px buttons should have 12/20 paddings, depending on icon/text being on
24
+ * that side. And from there we should implement similar proportions on the bigger and smaller
25
+ * buttons."* A 48 box is 24 of leading in 2 x 12, so **12 IS ITS BLOCK PADDING** -- his glyph
26
+ * number is not a new value, it is the one the rung already has. And 20 is that plus one gap,
27
+ * which is governance/code/an-icon-and-the-text-beside-it-do-not-take-the-same-padding.md
28
+ * stated as arithmetic: *the difference is the component's own gap and never a new number.*
29
+ *
30
+ * SO ONE RELATION REPLACES A VALUE PER RUNG, and every rung gets his proportions for free:
31
+ * 36 -> 8/16, 40 -> 10/18, 44 -> 12/20, 48 -> 12/20, 56 -> 16/24. **44 and 48 share an inset
32
+ * on purpose** -- both hold their type in 12px of clear space, which is what the inset measures.
33
+ *
34
+ * THE BORDER IS SUBTRACTED ON BOTH AXES so these are rim-to-text distances rather than padding
35
+ * box numbers. Without it a 48 button reads 21 on the side he said should read 20. */
36
+ padding: calc(var(--newtone-button-pad-y) - 1px)
37
+ calc(var(--newtone-button-pad-y) + var(--newtone-button-gap) - 1px);
11
38
  font-family: var(--newtone-button-label-family);
12
- font-size: var(--newtone-button-label-size);
39
+ font-size: var(--newtone-button-text-size);
13
40
  font-weight: var(--newtone-button-label-weight);
14
- line-height: var(--newtone-button-label-line-height);
41
+ line-height: var(--newtone-button-text-leading);
42
+
43
+ /* THE HEIGHT IS PUBLISHED AND NEVER DECLARED, and the difference is the whole of why this is
44
+ one line rather than a `min-block-size` beside the padding. The box is already
45
+ leading + 2 x padding + 2 x border; writing that number again as a declaration would be a
46
+ second copy of one fact, free to drift from the padding that produces it --
47
+ governance/documents/staleness/a-second-copy-is-a-thing-that-drifts.md.
48
+
49
+ So this ASSERTS NOTHING and merely states, in a property a neighbour can read, what the box
50
+ came to. issues/open/156 is the reason it exists: two controls in one row agreed on a height
51
+ with nothing anywhere able to say so, and a hand-tuned padding in a consumer's scope was
52
+ keeping them level. A row can now read both and compare them.
53
+
54
+ READ IT; DO NOT WRITE IT. Setting this changes no geometry -- the box is the padding. */
55
+ --newtone-button-height: calc(var(--newtone-button-text-leading) + 2 * var(--newtone-button-pad-y));
56
+
15
57
  border: 1px solid;
16
58
  border-radius: var(--newtone-button-radius);
17
59
  cursor: pointer;
@@ -27,6 +69,40 @@
27
69
  text-align: center;
28
70
  }
29
71
 
72
+ /* ---- the rungs ----------------------------------------------------------
73
+ *
74
+ * 40, 44, 48 -- three of the ladder's five. contracts/button.md, *Sizes*.
75
+ *
76
+ * ONE RULE EACH, AND EACH NAMES BOTH LEAVES OF ONE STEP. A rung may not take a size from
77
+ * `typography.size` and a leading from `typography.line-height`: that is a ratio applied to a
78
+ * size, and it is how this component came to render 16 / 19.2 for five days after the step group
79
+ * was built to end exactly that. governance/code/an-icon-and-the-text-beside-it-share-one-size-
80
+ * and-leading-pair.md, and contracts/typography.md section 7.2.
81
+ *
82
+ * PADDING-BLOCK IS THE LADDER AND PADDING-INLINE IS THIS COMPONENT'S OWN PROPORTION, which is why
83
+ * the first barely moves and the second does. The block padding is whatever makes the height; the
84
+ * inline padding is a judgement about how a word should sit in a box, and a 48px box with a 40px
85
+ * box's inset reads as cramped.
86
+ */
87
+
88
+ .newtone-button--sm {
89
+ --newtone-button-pad-y: var(--newtone-button-size-sm-padding-y);
90
+ --newtone-button-text-size: var(--newtone-button-size-sm-label-size);
91
+ --newtone-button-text-leading: var(--newtone-button-size-sm-label-line-height);
92
+ }
93
+
94
+ .newtone-button--md {
95
+ --newtone-button-pad-y: var(--newtone-button-size-md-padding-y);
96
+ --newtone-button-text-size: var(--newtone-button-size-md-label-size);
97
+ --newtone-button-text-leading: var(--newtone-button-size-md-label-line-height);
98
+ }
99
+
100
+ .newtone-button--lg {
101
+ --newtone-button-pad-y: var(--newtone-button-size-lg-padding-y);
102
+ --newtone-button-text-size: var(--newtone-button-size-lg-label-size);
103
+ --newtone-button-text-leading: var(--newtone-button-size-lg-label-line-height);
104
+ }
105
+
30
106
  /* :focus-visible, not :focus -- the contract is explicit, and focus is not optional.
31
107
  The ring is per variant: it sits against that variant's own fill, and area decides
32
108
  how much contrast it needs. */
@@ -1,8 +1,31 @@
1
1
  import type { AnchorHTMLAttributes, ButtonHTMLAttributes, ReactNode } from 'react';
2
2
  export type ButtonVariant = 'primary' | 'secondary' | 'tertiary';
3
+ /**
4
+ * Three rungs of the ladder's five: **40, 44, 48**.
5
+ *
6
+ * A rung is one decision, not two. It carries its height, its type pair, its padding and (when this
7
+ * component gains a glyph slot) its icon size TOGETHER, so a caller cannot assemble a combination
8
+ * nobody chose -- governance/code/a-controls-size-is-one-rung-and-the-rung-carries-everything.md.
9
+ * There is deliberately no second axis: five heights against two type pairs is ten combinations,
10
+ * eight of which nobody decided.
11
+ *
12
+ * `Control` sits a rung below this at every position and `Action` above it. A Button reaching
13
+ * either end would be one of those two wearing the wrong name.
14
+ */
15
+ export type ButtonSize = 'sm' | 'md' | 'lg';
3
16
  interface ButtonCommon {
4
17
  /** All three exist. There is no default-by-omission in the contract. */
5
18
  variant?: ButtonVariant;
19
+ /**
20
+ * Which rung. Defaults to `md` -- 44px on 14/20.
21
+ *
22
+ * **This default is not what an un-sized Button used to render.** Until 2026-09-21 the box was
23
+ * 37.2px on 16/19.2, which is on no ladder and no type step: the size came from
24
+ * `typography.size.base` and the leading from a RATIO, so nobody chose either number. Every
25
+ * existing call site grows by about seven pixels, and that is the correction rather than a
26
+ * side effect.
27
+ */
28
+ size?: ButtonSize;
6
29
  /** The `label` slot. Required; a Button has no other slot in v1. */
7
30
  children: ReactNode;
8
31
  }
@@ -31,6 +54,6 @@ export type ButtonProps = (ButtonCommon & Omit<ButtonHTMLAttributes<HTMLButtonEl
31
54
  * sits on -- so the same Button inverts on an `emphasis` surface with nothing passed to it.
32
55
  * Adding a `theme` prop here would put the 24-way context product back on every component.
33
56
  */
34
- export declare function Button({ variant, children, className, ...rest }: ButtonProps): import("react").JSX.Element;
57
+ export declare function Button({ variant, size, children, className, ...rest }: ButtonProps): import("react").JSX.Element;
35
58
  export {};
36
59
  //# sourceMappingURL=button.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/button/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAElF,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,CAAA;AAEhE,UAAU,YAAY;IAClB,wEAAwE;IACxE,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB,oEAAoE;IACpE,QAAQ,EAAE,SAAS,CAAA;CACtB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GACjB,CAAC,YAAY,GACT,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC,GAAG;IACxD,oEAAoE;IACpE,IAAI,CAAC,EAAE,SAAS,CAAA;CACnB,CAAC,GACN,CAAC,YAAY,GACT,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC,GAAG;IACjE;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAA;CACf,CAAC,CAAA;AAEZ;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,EAAE,OAAmB,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,WAAW,+BA8BxF"}
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/button/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAElF,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,CAAA;AAEhE;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAE3C,UAAU,YAAY;IAClB,wEAAwE;IACxE,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,oEAAoE;IACpE,QAAQ,EAAE,SAAS,CAAA;CACtB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GACjB,CAAC,YAAY,GACT,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC,GAAG;IACxD,oEAAoE;IACpE,IAAI,CAAC,EAAE,SAAS,CAAA;CACnB,CAAC,GACN,CAAC,YAAY,GACT,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC,GAAG;IACjE;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAA;CACf,CAAC,CAAA;AAEZ;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,EACnB,OAAmB,EACnB,IAAW,EACX,QAAQ,EACR,SAAS,EACT,GAAG,IAAI,EACV,EAAE,WAAW,+BAwCb"}
@@ -7,10 +7,20 @@ import { jsx as _jsx } from "react/jsx-runtime";
7
7
  * sits on -- so the same Button inverts on an `emphasis` surface with nothing passed to it.
8
8
  * Adding a `theme` prop here would put the 24-way context product back on every component.
9
9
  */
10
- export function Button({ variant = 'primary', children, className, ...rest }) {
10
+ export function Button({ variant = 'primary', size = 'md', children, className, ...rest }) {
11
11
  // One class list, both arms. The whole of the destination change is which element wears it --
12
12
  // no token moves, no variant is added, and `button.*` stays the only group this file reads.
13
- const classes = ['newtone-button', `newtone-button--${variant}`, className]
13
+ //
14
+ // THE RUNG IS A CLASS AND NOT AN INLINE STYLE, so a consuming site can still out-specify it the
15
+ // way it out-specifies everything else here, and so the three rung rules sit at the same one
16
+ // class of specificity as the variants -- newtone_ui_react-web.md section 5, *Every rule in a
17
+ // component's stylesheet is at one class of specificity*.
18
+ const classes = [
19
+ 'newtone-button',
20
+ `newtone-button--${variant}`,
21
+ `newtone-button--${size}`,
22
+ className,
23
+ ]
14
24
  .filter(Boolean)
15
25
  .join(' ');
16
26
  if (rest.href !== undefined) {