@hideyukimori/nene2-ui 0.18.0 → 0.18.1
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 +19 -3
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/themes/default.css +9 -4
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
|
|
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-
|
|
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
|
```
|
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
|
-
//
|
|
43
|
-
//
|
|
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.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A6F;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.
|
|
3
|
+
"version": "0.18.1",
|
|
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",
|
package/themes/default.css
CHANGED
|
@@ -130,10 +130,15 @@
|
|
|
130
130
|
/* ─────────────────────────────────────────────────────────────────────────
|
|
131
131
|
* ② SLOTS — a product may redefine these.
|
|
132
132
|
*
|
|
133
|
-
* Every design value a component
|
|
134
|
-
* back at the scale above. That split is the whole idea: a product decides
|
|
135
|
-
* a part uses**, and cannot invent a step. Change `--spacing-x-slot-
|
|
136
|
-
* `var(--spacing-x-lg)` and
|
|
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,
|