@hideyukimori/nene2-ui 0.18.0 → 0.19.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
@@ -137,12 +137,13 @@ The theme has two layers, and the line between them is the point.
137
137
 
138
138
  ### ② Slots — 🟢 redefine these
139
139
 
140
- Every design value a component uses comes from a slot, and slots are named per component:
140
+ Every design value a component takes **from the theme** comes from a slot, and slots are named
141
+ per component:
141
142
 
142
143
  ```css
143
144
  /* your product's theme, loaded after the kit's */
144
145
  @theme {
145
- --spacing-x-slot-card-pad: var(--spacing-x-lg); /* roomier cards, everywhere */
146
+ --spacing-x-slot-modal-pad: var(--spacing-x-lg); /* roomier modals, everywhere */
146
147
  --color-x-slot-field-label: var(--color-text-primary); /* darker field labels */
147
148
  --radius-x-slot-control: var(--radius-x-md);
148
149
  }
@@ -151,6 +152,18 @@ Every design value a component uses comes from a slot, and slots are named per c
151
152
  This is where your product decides how it looks. Change a slot and every instance of that
152
153
  component follows.
153
154
 
155
+ 🔴 **"From the theme" is the limit of that sentence, and the limit is load-bearing.** The
156
+ **layout components take their spacing from props, not from slots** — `Box` and `Card` (`pad`),
157
+ `Stack` (`gap`), `Section` and `Grid` (both). That is deliberate rather than an omission: layout
158
+ spacing is a decision the *caller* makes per instance, so it is chosen at the call site. Those
159
+ props still pick a **step from the scale** (`pad="lg"`), so a product cannot invent a value here
160
+ either — but **no slot exists for them**.
161
+
162
+ ⚠️ **This is the part that bites.** Writing `--spacing-x-slot-card-pad` in your theme does
163
+ nothing at all: **there is no such slot**, and nothing warns you — not an error, not a console
164
+ message, not a failing build. To make every card roomier, pass `pad` where you use `Card`, or
165
+ wrap it once in a component of your own.
166
+
154
167
  ### ① The scale — 🔒 do not redefine
155
168
 
156
169
  `--spacing-x-3xs` … `--spacing-x-2xl`, `--radius-x-none` … `--radius-x-3xl` plus
@@ -223,9 +236,12 @@ second only under `@media (pointer: coarse)`.
223
236
 
224
237
  ### Composing a slot
225
238
 
226
- A slot can hold several steps — four-sided padding is just CSS:
239
+ A slot can hold several steps — four-sided padding is just CSS. The slot below belongs to a
240
+ component **of your own**, not to the kit (`login-form` is not a kit component); a product
241
+ names slots for its own parts the same way the kit does:
227
242
 
228
243
  ```css
244
+ /* in your product, for your own <LoginForm> */
229
245
  --spacing-x-slot-login-form-pad: var(--spacing-x-xl) var(--spacing-x-md) var(--spacing-x-lg)
230
246
  var(--spacing-x-md);
231
247
  ```
@@ -16,6 +16,6 @@ const TONE_CLASS = {
16
16
  * find every such lie afterwards except by reading every screen.
17
17
  */
18
18
  export function Badge({ tone = 'neutral', className, children }) {
19
- return (_jsx("span", { className: cx('inline-flex items-center rounded-x-slot-badge border px-x-slot-badge-pad-x py-x-slot-badge-pad-y font-sans', TONE_CLASS[tone], className), children: children }));
19
+ return (_jsx("span", { className: cx('inline-flex items-center gap-x-slot-badge-gap rounded-x-slot-badge border px-x-slot-badge-pad-x py-x-slot-badge-pad-y font-sans text-x-slot-badge font-x-slot-badge', TONE_CLASS[tone], className), children: children }));
20
20
  }
21
21
  //# sourceMappingURL=Badge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.js","sourceRoot":"","sources":["../../src/feedback/Badge.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAkBlC,MAAM,UAAU,GAAoD;IAClE,OAAO,EACL,4FAA4F;IAC9F,MAAM,EAAE,yFAAyF;IACjG,MAAM,EAAE,yFAAyF;IACjG,OAAO,EACL,4FAA4F;IAC9F,IAAI,EAAE,mFAAmF;IACzF,IAAI,EAAE,mFAAmF;CAC1F,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,KAAK,CAAC,EAAE,IAAI,GAAG,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAc;IACzE,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,4GAA4G,EAC5G,UAAU,CAAC,IAAI,CAAC,EAChB,SAAS,CACV,YAEA,QAAQ,GACJ,CACR,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"Badge.js","sourceRoot":"","sources":["../../src/feedback/Badge.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAkBlC,MAAM,UAAU,GAAoD;IAClE,OAAO,EACL,4FAA4F;IAC9F,MAAM,EAAE,yFAAyF;IACjG,MAAM,EAAE,yFAAyF;IACjG,OAAO,EACL,4FAA4F;IAC9F,IAAI,EAAE,mFAAmF;IACzF,IAAI,EAAE,mFAAmF;CAC1F,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,KAAK,CAAC,EAAE,IAAI,GAAG,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAc;IACzE,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,qKAAqK,EACrK,UAAU,CAAC,IAAI,CAAC,EAChB,SAAS,CACV,YAEA,QAAQ,GACJ,CACR,CAAC;AACJ,CAAC"}
package/dist/index.js CHANGED
@@ -39,8 +39,10 @@ export { Pagination } from './data/Pagination.js';
39
39
  export { tokens } from './theme/tokens.js';
40
40
  // Internal helpers, exported so downstream components can compose consistently.
41
41
  export { cx } from './lib/cx.js';
42
- // Controls the kit does not ship yet (Textarea has 7 independent implementations in the
43
- // fleet) can at least carry the same focus and disabled behaviour instead of inventing it.
42
+ // A control the kit does not ship — one a product writes for itself, or one still waiting for
43
+ // a slot in the kit — can at least carry the same focus and disabled behaviour instead of
44
+ // inventing it. (Written when `Textarea` was the example, with 7 independent implementations
45
+ // across the fleet; `Textarea` ships now, so the example is gone but the reason is not.)
44
46
  export { CLICKABLE_CLASS, CONTROL_CLASS, DISABLED_CLASS, FOCUS_CLASS, HOVER_CLASS, } from './lib/states.js';
45
47
  // Lets a consumer's build prove the kit is in its Tailwind `@source` (#316).
46
48
  export { SOURCE_PROBE_CLASS } from './lib/source-probe.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js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,mBAAmB,CAAC;AAE3C,gFAAgF;AAChF,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,8FAA8F;AAC9F,0FAA0F;AAC1F,6FAA6F;AAC7F,yFAAyF;AACzF,OAAO,EACL,eAAe,EACf,aAAa,EACb,cAAc,EACd,WAAW,EACX,WAAW,GACZ,MAAM,iBAAiB,CAAC;AACzB,6EAA6E;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hideyukimori/nene2-ui",
3
- "version": "0.18.0",
3
+ "version": "0.19.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",
@@ -130,10 +130,15 @@
130
130
  /* ─────────────────────────────────────────────────────────────────────────
131
131
  * ② SLOTS — a product may redefine these.
132
132
  *
133
- * Every design value a component uses comes from here, and every slot's default points
134
- * back at the scale above. That split is the whole idea: a product decides **which step
135
- * a part uses**, and cannot invent a step. Change `--spacing-x-slot-card-pad` to
136
- * `var(--spacing-x-lg)` and cards get roomier everywhere; you still cannot write `2.25`.
133
+ * Every design value a component takes **from the theme** comes from here, and every slot's
134
+ * default points back at the scale above. That split is the whole idea: a product decides
135
+ * **which step a part uses**, and cannot invent a step. Change `--spacing-x-slot-modal-pad`
136
+ * to `var(--spacing-x-lg)` and every modal gets roomier; you still cannot write `2.25`.
137
+ *
138
+ * 🔴 The layout components (`Box`, `Card`, `Stack`, `Section`, `Grid`) are the exception:
139
+ * their padding and gap come from **props**, not from slots, because the caller decides
140
+ * them per instance. There is no `--spacing-x-slot-card-pad` — setting one does nothing,
141
+ * silently. See README §② (#389).
137
142
  *
138
143
  * Named per component rather than per role (hide's ruling, 2026-08-23): sharing one slot
139
144
  * between `Modal` and `Card` can be arranged later by pointing both at the same value,
@@ -159,6 +164,12 @@
159
164
  --spacing-x-slot-choice-box: var(--spacing-x-sm);
160
165
  --spacing-x-slot-badge-pad-x: var(--spacing-x-2xs);
161
166
  --spacing-x-slot-badge-pad-y: var(--spacing-x-3xs);
167
+ /* 🔴 Between a badge's icon and its label (#463). Unlike every other slot added so far,
168
+ * this one **changes what a Badge already renders**: the current default is *nothing
169
+ * specified*, so an icon sits flush against its text. Both consumers — nene-vault and
170
+ * nene-deal — were already correcting that independently, so the painting this replaces
171
+ * is one no consumer used. */
172
+ --spacing-x-slot-badge-gap: var(--spacing-x-3xs);
162
173
  --spacing-x-slot-switch-pad-x: var(--spacing-x-2xs);
163
174
  --spacing-x-slot-switch-pad-y: var(--spacing-x-3xs);
164
175
  --spacing-x-slot-alert-pad: var(--spacing-x-2xs);
@@ -180,6 +191,10 @@
180
191
  --radius-x-slot-button: var(--radius-x-md);
181
192
  --radius-x-slot-control: var(--radius-x-md);
182
193
  --radius-x-slot-badge: var(--radius-x-md);
194
+ /* A badge is a label, not body copy (#463). Inherited type made it the size and weight of
195
+ * whatever it sat in; both consumers overrode both. Same caveat as the gap above: this
196
+ * changes the current render. */
197
+ --text-x-slot-badge: var(--text-x-2xs);
183
198
  --radius-x-slot-switch: var(--radius-x-md);
184
199
  --radius-x-slot-alert: var(--radius-x-md);
185
200
  --radius-x-slot-toast: var(--radius-x-md);
@@ -405,7 +420,15 @@
405
420
  --spacing-x-slot-button-icon: var(--spacing-x-lg);
406
421
 
407
422
  /* ── Weight slots ─────────────────────────────────────────────────────────────
408
- * `font-medium` appeared inline in four components. Same rule, same reason as colour. */
423
+ * `font-medium` appeared inline in four components. Same rule, same reason as colour.
424
+ *
425
+ * 🔴 The badge is `semibold`, and it is the one slot here that is not preserving an
426
+ * existing inline weight — it had none, which is why #463 exists. So the reason the other
427
+ * six are `medium` (that is what they already rendered) does not reach it, and the only
428
+ * evidence left is the consumers: nene-vault ships `font-semibold` and nene-deal measures
429
+ * 600 in production. **Nothing ships 500.** A badge also carries its weight at 11px, where
430
+ * the others sit at body size — the weight is doing work the size cannot. */
431
+ --font-weight-x-slot-badge: var(--font-weight-semibold);
409
432
  --font-weight-x-slot-button: var(--font-weight-medium);
410
433
  --font-weight-x-slot-table-header: var(--font-weight-medium);
411
434
  --font-weight-x-slot-detail-term: var(--font-weight-medium);