@hideyukimori/nene2-ui 0.7.0 → 0.8.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.
package/README.md CHANGED
@@ -153,7 +153,16 @@ component follows.
153
153
 
154
154
  ### ① The scale — 🔒 do not redefine
155
155
 
156
- `--spacing-x-3xs` … `--spacing-x-2xl`, and the radius and colour tokens they point at.
156
+ `--spacing-x-3xs` … `--spacing-x-2xl`, `--radius-x-none` `--radius-x-3xl` plus
157
+ `--radius-x-pill`, `--text-x-2xs` … `--text-x-xl`, and the colour palette.
158
+
159
+ 🔴 **A namespace with one step has no slots, only aliases.** Until 0.8.0 the radius
160
+ namespace held a single value and eight slots pointed at it, so a product following the
161
+ rules could render exactly one rounding — and every structural check passed, because the
162
+ slots existed and their defaults referenced the scale. The scale had been promoted verbatim
163
+ from the one product with the fewest conformance violations, which turned out to be the
164
+ product with the fewest choices. **A component implementation may come from one ship; the
165
+ set of choices may only come from the fleet's distribution.**
157
166
 
158
167
  ```css
159
168
  --spacing-x-slot-card-pad: 1.375rem; /* 🔴 no */
@@ -177,6 +186,21 @@ to match it also fits _worse_, not better:
177
186
  More exact matches, five times the worst error — a scale bent toward one histogram drops its
178
187
  own ends.
179
188
 
189
+ The radius scale was measured the same way, across the 266 radius values ten products apply
190
+ (2026-08-23). Candidates were scored on a second axis as well: whether two values that exist
191
+ **by design** land on the same step. Average error alone would have accepted folding `2px`
192
+ into `0`, because 2px is a 2px error — but nene-records ships nine themes at 0px and three at
193
+ 2–3px as separate product themes, so that error deletes a distinction rather than rounding
194
+ one.
195
+
196
+ | radius scale | exact match | within 2px | designed values collapsed |
197
+ | --------------------------- | ----------: | ---------: | ------------------------: |
198
+ | **the kit's nine + pill** | **69.9%** | **97.7%** | **3** (all 1px apart) |
199
+ | eight, without a `10px` step | 64.3% | 97.7% | 4 |
200
+ | seven, without `2px` | 43.2% | 97.7% | 4 |
201
+
202
+ 🔑 **A scale is judged by what it can still tell apart, not only by how far it moves things.**
203
+
180
204
  🔑 **The scale is the set you keep to. The slots are what your brand looks like.**
181
205
 
182
206
  ### 🔴 One slot is not yours to tune
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hideyukimori/nene2-ui",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "NeNe fleet shared React UI kit — token-driven primitives on Tailwind v4 @theme. Components carry no design of their own; themes do.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -138,7 +138,12 @@
138
138
  --color-x-slot-field-error: var(--color-danger);
139
139
  --text-x-slot-field-error-size: var(--text-x-2xs);
140
140
  --text-x-slot-field-label-size: var(--text-x-xs);
141
- --font-weight-x-slot-field-label: 500;
141
+ /* 🔴 `var(--font-weight-medium)`, not `500`. Identical output — Tailwind defines that
142
+ * step as 500 — but a literal here is a weight the kit invented, and the namespace has a
143
+ * nine-step scale already (thin…black). This one escaped the "slot defaults are scale
144
+ * references only" check because that check listed the namespaces it knew about; found
145
+ * while adding the radius scale (#348). */
146
+ --font-weight-x-slot-field-label: var(--font-weight-medium);
142
147
  /* Control text. Two slots, because one value cannot answer "how is this being pointed at".
143
148
  *
144
149
  * 0.6.0 used `max(var(--text-x-md), var(--text-x-ios-floor))`, which raised every control
@@ -163,7 +168,50 @@
163
168
  * gave them nothing (50 x10, 40 x4, 30 x6, measured 2026-08-23 across 20 uses). */
164
169
  --opacity-x-disabled: 50%;
165
170
 
171
+ /* The radius scale. Nine steps plus pill, chosen the same way the spacing scale was —
172
+ * by measuring the fleet, not by taste. Snapping the 266 radius values the fleet actually
173
+ * applies (`border-radius` declarations and `--radius-*` theme tokens across ten products,
174
+ * 2026-08-23, #348) onto these nine puts 69.9% exactly on a step and 97.7% within 2px.
175
+ *
176
+ * 🔴 This replaces a scale that had ONE step. Eight slots all pointed at `--radius-x-md`,
177
+ * so a product following the rules could only ever render 8px — and a slot whose value set
178
+ * has one member is not a slot. The cause is recorded because it generalizes: the kit's
179
+ * theme was promoted verbatim from nene-payout, and payout is the fleet's only product
180
+ * with a single radius. Promoting from the product with the fewest conformance violations
181
+ * exported its poverty as the norm — having no choices is not the same as choosing well.
182
+ * A component implementation may come from one ship; the SET OF CHOICES may not.
183
+ *
184
+ * 🔴 `2px` is its own step because it is the single most common radius in the fleet
185
+ * (56 of 266). nene-records ships 9 themes at 0px and 3 at 2-3px as separate product
186
+ * themes — so folding 2px into 0 would not be a rounding error, it would delete a
187
+ * distinction somebody drew on purpose. Candidate scales were therefore scored on a
188
+ * second axis besides average error: whether two values that exist by design collapse
189
+ * onto one step (vault's proposal). The steps kept apart here are 0/2, 6/8 and 10/12;
190
+ * what still collapses (3-4, 5-6, 9-10) is 1px apart, below a scale's resolution.
191
+ *
192
+ * `--radius-x-md` keeps the value it had. Every slot points at it, so changing it would
193
+ * move every product's appearance silently — the scale gains steps, the default does not
194
+ * move. */
195
+ --radius-x-none: 0;
196
+ --radius-x-2xs: 2px;
197
+ --radius-x-xs: 4px;
198
+ --radius-x-sm: 6px;
166
199
  --radius-x-md: 0.5rem;
200
+ --radius-x-lg: 10px;
201
+ --radius-x-xl: 12px;
202
+ --radius-x-2xl: 16px;
203
+ --radius-x-3xl: 24px;
204
+
205
+ /* Fully round. A step, not a footnote: `rounded-x-pill` is the most-used radius in
206
+ * nene-field (48 uses) and appears in five products (64 uses total).
207
+ *
208
+ * 🔴 A product whose design language has no rounding does NOT redefine this step — it
209
+ * points its slots at `--radius-x-none`. nene-records reaches the same end today by
210
+ * setting its own `--radius-full: 0px`, which works only because its components hard-code
211
+ * `rounded-full`. Overriding a scale step changes what a name means fleet-wide; overriding
212
+ * a slot changes one product's choice. The second is the mechanism; the first is the drift
213
+ * the scale exists to prevent. */
214
+ --radius-x-pill: 9999px;
167
215
 
168
216
  /* The spacing scale. Nine steps, chosen by measurement rather than taste: snapping the
169
217
  * 944 spacing utilities the fleet writes by hand onto these nine moves 98.2% of them by