@cahyo-dimas/freeday 1.30.0 → 1.31.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/CHANGELOG.md CHANGED
@@ -3,6 +3,35 @@
3
3
  Semua perubahan penting dicatat di sini. Format longgar mengikuti
4
4
  [Keep a Changelog](https://keepachangelog.com/); tiap versi = git tag.
5
5
 
6
+ ## [1.31.0] — 2026-08-18
7
+ Improvement note 002: density was a one-way door.
8
+ ### Added
9
+ - **`[data-density="comfortable"]` is now a real rule.** The kit shipped only the `compact` block,
10
+ and its own comment promised per-subtree density — true in one direction only. These are
11
+ inheriting custom properties, so once `<html>` is compact *every* subtree is compact and a
12
+ `comfortable` wrapper matched nothing at all. An app that is dense overall (a back office where
13
+ most screens are data grids) could not opt its shared chrome back out: measured against a sibling
14
+ product, the logo sat 12px from the edge instead of 16 and the avatar 12 instead of 20 — four
15
+ pixels in two places, from `--space-4` and `--control-h`, which reads as sloppiness rather than as
16
+ a token. The workaround, restating the five defaults on a local class, is exactly the copy that
17
+ goes stale when the kit retunes a step.
18
+ Note the kit's own README has been telling people to write `data-density="comfortable"` on `<html>`
19
+ since long before a rule existed for it — harmless there, because it matched the defaults by
20
+ accident, and broken the moment anyone needed it on a wrapper.
21
+ ### Notes on the shape of the fix
22
+ - The five values are **derived from the tokens' own defaults** at build time, not written out a
23
+ second time. Same key set by construction, so a token that gains a `$compact` value automatically
24
+ gains its way back out, and a retuned default can never leave the two blocks disagreeing. The
25
+ report's hand-written block was correct in all five values — this only removes the chance for it
26
+ to stop being correct.
27
+ ### Added — guards
28
+ - `test/build.test.mjs` asserts the two density blocks cover the *same* tokens, that every
29
+ comfortable value equals the `:root` default, and that none of them equals its compact counterpart
30
+ (a block that resets nothing is as green as one that works).
31
+ - `browser/theme.mjs` measures it in a real engine: a compact root, a `comfortable` island that
32
+ returns to a 40px control and `--space-4: 1rem`, and a `compact` island nested back inside that —
33
+ because the point of the rule is the box that comes out, not the declaration going in.
34
+
6
35
  ## [1.30.0] — 2026-08-18
7
36
  Note 008 (adopting 1.29.0) plus a direct design report: *"the input border looks too dark next to the
8
37
  card and button-group borders."*
package/COMPONENTS.md CHANGED
@@ -232,7 +232,8 @@ utility variant that has to agree with the shell must use `nav`; using `md` leav
232
232
 
233
233
  Density: `data-density="compact"` works on `<html>` **or any wrapper** — the selector is a bare
234
234
  `[data-density="compact"]` over inheriting custom properties, so one screen can be dense while the
235
- rest of the app is not.
235
+ rest of the app is not. `data-density="comfortable"` is a real rule too, so the reverse also works:
236
+ a compact root with one region opted back out (shared chrome that must match a sibling product).
236
237
 
237
238
  ---
238
239
 
package/README.id.md CHANGED
@@ -5,7 +5,7 @@
5
5
  > **Lebih banyak _free day_ buat dev — UI kit-nya sudah siap pakai.**
6
6
 
7
7
  [![Live docs](https://img.shields.io/badge/docs-live-2050d8?style=flat-square)](https://cahyo-dimas.github.io/freeday-ui-kit/)
8
- [![Release](https://img.shields.io/badge/release-v1.30.0-0078d4?style=flat-square)](https://github.com/cahyo-dimas/freeday-ui-kit/tree/v1.30.0)
8
+ [![Release](https://img.shields.io/badge/release-v1.31.0-0078d4?style=flat-square)](https://github.com/cahyo-dimas/freeday-ui-kit/tree/v1.31.0)
9
9
 
10
10
  UI KIT yang token-driven & framework-agnostic — satu sumber kebenaran untuk warna, tipografi,
11
11
  spasi, dan komponen. Blueprint: `docs/superpowers/specs/2026-07-21-freeday-ui-kit-design.md`.
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  > **More free days for devs — the UI kit is ready to use.**
6
6
 
7
7
  [![Live docs](https://img.shields.io/badge/docs-live-2050d8?style=flat-square)](https://cahyo-dimas.github.io/freeday-ui-kit/)
8
- [![Release](https://img.shields.io/badge/release-v1.30.0-0078d4?style=flat-square)](https://github.com/cahyo-dimas/freeday-ui-kit/tree/v1.30.0)
8
+ [![Release](https://img.shields.io/badge/release-v1.31.0-0078d4?style=flat-square)](https://github.com/cahyo-dimas/freeday-ui-kit/tree/v1.31.0)
9
9
 
10
10
  A token-driven, framework-agnostic UI kit — one source of truth for color, typography,
11
11
  spacing, and components. Blueprint: `docs/superpowers/specs/2026-07-21-freeday-ui-kit-design.md`.
package/USAGE.md CHANGED
@@ -130,6 +130,13 @@ container, a single `<section>`. An app whose two list screens are dense and who
130
130
  are not should scope it per screen rather than densifying everything. Set it at one level per screen,
131
131
  never per component.
132
132
 
133
+ **And it goes both ways.** `data-density="comfortable"` is a real rule, not just the absence of
134
+ `compact`, so an app that is dense *at the root* can opt one region back out — a header, a toolbar,
135
+ a footer shared with a sibling product that has to line up pixel for pixel. Inheritance only runs
136
+ downhill; without that rule a compact root left every subtree compact and a `comfortable` wrapper
137
+ changed nothing. Do not restate the five values by hand: that copy goes stale the moment the kit
138
+ retunes a step.
139
+
133
140
  ## 6b. Navigation: one component, two orientations — and never a tab role
134
141
 
135
142
  A navigation link is an `<a class="fdy-nav__item">` marked **`aria-current="page"`**. That does not
@@ -368,6 +368,18 @@
368
368
  --space-6: 1.25rem;
369
369
  --control-h: 2rem;
370
370
  }
371
+ /* ...and the way back out. Inheritance only runs downhill: once the root is compact every subtree is
372
+ * compact, and before this rule existed a data-density="comfortable" wrapper matched nothing — so the
373
+ * comment above was true in one direction only. An app that is dense overall and carries one region
374
+ * of shared chrome (a header, a toolbar, a footer shared with a sibling product) had to restate the
375
+ * defaults by hand, which is exactly the local copy that goes stale when the kit retunes them. */
376
+ [data-density="comfortable"] {
377
+ --space-3: 0.75rem;
378
+ --space-4: 1rem;
379
+ --space-5: 1.25rem;
380
+ --space-6: 1.5rem;
381
+ --control-h: 2.5rem;
382
+ }
371
383
 
372
384
  /* Freeday components — GENERATED by tokens/build.mjs. Do not edit by hand. */
373
385
  /* Freeday base layer — reset ringan + default via token */
@@ -367,3 +367,15 @@
367
367
  --space-6: 1.25rem;
368
368
  --control-h: 2rem;
369
369
  }
370
+ /* ...and the way back out. Inheritance only runs downhill: once the root is compact every subtree is
371
+ * compact, and before this rule existed a data-density="comfortable" wrapper matched nothing — so the
372
+ * comment above was true in one direction only. An app that is dense overall and carries one region
373
+ * of shared chrome (a header, a toolbar, a footer shared with a sibling product) had to restate the
374
+ * defaults by hand, which is exactly the local copy that goes stale when the kit retunes them. */
375
+ [data-density="comfortable"] {
376
+ --space-3: 0.75rem;
377
+ --space-4: 1rem;
378
+ --space-5: 1.25rem;
379
+ --space-6: 1.5rem;
380
+ --control-h: 2.5rem;
381
+ }
@@ -184,7 +184,7 @@ live docs also have a copy button per component.
184
184
  ```bash
185
185
  npm i @cahyo-dimas/freeday
186
186
  ```
187
- Lands in `package.json` as `"@cahyo-dimas/freeday": "^1.30.0"` (public npm package). `dist/` is
187
+ Lands in `package.json` as `"@cahyo-dimas/freeday": "^1.31.0"` (public npm package). `dist/` is
188
188
  committed and published → no build step; `npm ci` runs without auth.
189
189
 
190
190
  ### 2. Import the CSS + enhancers **once** in your entry (`src/main.ts`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cahyo-dimas/freeday",
3
- "version": "1.30.0",
3
+ "version": "1.31.0",
4
4
  "description": "Freeday — token-driven, framework-agnostic UI KIT (design source-of-truth).",
5
5
  "type": "module",
6
6
  "license": "MIT",