@cahyo-dimas/freeday 3.15.0 → 3.15.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/CHANGELOG.md CHANGED
@@ -9,6 +9,38 @@ benar. Perubahan seperti itu ditulis di bawah `### Changed: BREAKING (types)`
9
9
  lama → tipe baru, dan cara menyempitkannya — bukan di bawah `### Added`, betapapun aditifnya dari
10
10
  sisi kit.
11
11
 
12
+ ## [3.15.1] - 2026-11-04
13
+
14
+ **`.fdy-btn--stretch` yang lepas dari kartunya kini bersuara.** Di luar `.fdy-card` atau
15
+ `.fdy-list__row`, tanpa leluhur ber-`position`, lapisannya menutup seluruh halaman. Semua tautan
16
+ tampak normal, tetapi setiap tap jatuh ke tombol itu. Tidak ada gejala visual, uji klik tetap
17
+ lolos, dan konsol diam (`CATATAN-FREEDAY.md` §19: tombol Keluar yang merampas sembilan tautan di
18
+ layar setelan).
19
+
20
+ ### Added
21
+ - **Satu `console.warn` per tombol pada klik pertama yang diterimanya** (`#109`), di
22
+ `freeday-unhydrated.js`, yang sudah ikut di impor akar. Ada dua bentuk:
23
+ - lapisannya tidak punya containing block di bawah `<body>`, jadi menutup seluruh halaman;
24
+ - ada target stretch lain yang dirender di area yang ditutupnya, jadi yang terakhir di DOM
25
+ merebut tap untuk yang lain (bentuk lama `.fdy-list` sebelum baris punya jangkar).
26
+
27
+ Containing block dihitung seperti peramban menghitungnya: `position`, `transform`, `filter`,
28
+ `perspective`, `backdrop-filter`, `contain`, `container-type`, dan `will-change` atas properti
29
+ itu. Pemicunya klik, bukan init, dengan alasan yang sama seperti peringatan hook. Lapisan yang
30
+ salah tempat menjadikan dirinya target dari apa pun yang ditap, jadi tap pertama di mana saja
31
+ sudah cukup. Klik e2e yang menembak koordinat juga memicunya.
32
+
33
+ ### Catatan
34
+ - Pemeriksaannya membaca containing block, bukan `closest('.fdy-card, .fdy-list__row')`. Wadah
35
+ sendiri yang dibuat `position:relative` adalah jalan keluar yang terdokumentasi dan tidak boleh
36
+ ikut diperingatkan. `offsetParent`, usulan di catatan, tidak dipakai. Ia bernilai `null` untuk
37
+ elemen yang tersembunyi, dan mengembalikan `td`/`th`/`table` yang tidak berposisi, padahal
38
+ ketiganya bukan jangkar lapisan.
39
+ - Audit kelasnya: semua lapisan `absolute` + `inset` lain di kit (chip, donut) berjangkar ke
40
+ elemennya sendiri, dan backdrop memakai `fixed` dengan sengaja. Hanya `--stretch` yang menempel
41
+ ke apa pun yang kebetulan ada di atasnya.
42
+ - Tidak ada perilaku yang berubah. Tombol yang sudah di tempatnya tidak memicu apa pun.
43
+
12
44
  ## [3.15.0] - 2026-11-02
13
45
 
14
46
  **Layar-layar yang tidak pernah punya tiket.** Daftar halaman sistem dan state yang dibutuhkan
package/COMPONENTS.md CHANGED
@@ -57,6 +57,11 @@ live docs.
57
57
  document: everything works, wider than asked, and other markup on the page can come to rely on
58
58
  that scan unnoticed. It logs one `console.warn` per component. Put the ref on an element that is
59
59
  always rendered, or write `useFreeday()` with no argument when the document is what you mean.
60
+ **A `.fdy-btn--stretch` whose overlay escaped its host says so too.** On the first click it
61
+ receives, it logs one `console.warn` if the overlay covers the whole page (no positioned
62
+ ancestor below `<body>`), or if another stretched target sits inside the area it covers. Both
63
+ render correctly and take taps meant for something else, so the press that lands on the wrong
64
+ button is the one that reports it.
60
65
  **`data-fdy-ignore` says "not yours".** On an element or any ancestor, every enhancer skips that
61
66
  subtree, even under an explicit `initAll(document)`, and the warning above stays quiet. Use it
62
67
  where the app drives kit-styled markup itself, such as a chip matrix with its own removal flow.
@@ -2343,6 +2348,9 @@ while it stays a real `<button>`/`<a>` with real keyboard semantics.
2343
2348
  make the element `position:relative` yourself, or the overlay resolves against whatever is
2344
2349
  positioned further up (in a list that used to be `.fdy-list` itself, so every row's target covered
2345
2350
  the whole list and the last one in the DOM won, so a click on row one opened row two).
2351
+ Outside a card or row with no positioned ancestor at all, the overlay covers the **whole page**:
2352
+ every tap on every link lands on this one button, and nothing looks wrong. The first click it
2353
+ receives logs a warning (hard rule 7), as does an overlay with a second stretched target inside it.
2346
2354
  A row whose *whole* surface is one control is still better as `.fdy-list__row--button`.
2347
2355
  - `.fdy-btn` nudges itself on `:hover`/`:active`, and a transformed element becomes the containing
2348
2356
  block for its own absolutely positioned descendants, so a hand-rolled `::after{inset:0}` overlay
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-v3.15.0-0078d4?style=flat-square)](https://github.com/cahyo-dimas/freeday-ui-kit/tree/v3.15.0)
8
+ [![Release](https://img.shields.io/badge/release-v3.15.1-0078d4?style=flat-square)](https://github.com/cahyo-dimas/freeday-ui-kit/tree/v3.15.1)
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-v3.15.0-0078d4?style=flat-square)](https://github.com/cahyo-dimas/freeday-ui-kit/tree/v3.15.0)
8
+ [![Release](https://img.shields.io/badge/release-v3.15.1-0078d4?style=flat-square)](https://github.com/cahyo-dimas/freeday-ui-kit/tree/v3.15.1)
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`.
@@ -20,6 +20,15 @@
20
20
  * that subtree, and this stays quiet about it. It is for markup whose behaviour something else
21
21
  * owns: the kit's own Vue/React FdyDrawer, and kit classes an app uses for their look
22
22
  * alone (CATATAN-FREEDAY §14: a chip matrix the app drives itself).
23
+ *
24
+ * The same click also checks `.fdy-btn--stretch`, the other kit piece whose misuse renders fine and
25
+ * fails silently. Its overlay covers the nearest ancestor that is a containing block. With none but
26
+ * <body>/<html>, it covers the whole page: every tap anywhere lands on that one button, and nothing
27
+ * looks wrong (CATATAN-FREEDAY §19: a sign-out button that took every tap on a settings screen).
28
+ * A second stretched target inside the area one covers overlaps it the same way, and the last one
29
+ * in the DOM takes every tap meant for the other. A misplaced overlay makes itself the click target of
30
+ * whatever is tapped, so the first tap anywhere on the page is enough to report it. Hit-testing
31
+ * clicks in e2e tests reach it too.
23
32
  */
24
33
  (function () {
25
34
  'use strict';
@@ -75,9 +84,50 @@
75
84
  }
76
85
  }
77
86
 
87
+ /* What an absolutely positioned box resolves against: the nearest ancestor that is positioned or
88
+ that a transform, filter, perspective, containment or will-change of those turns into a
89
+ containing block. null means the initial containing block, i.e. the viewport. */
90
+ function anchorOf(el) {
91
+ for (var n = el.parentElement; n; n = n.parentElement) {
92
+ var s = getComputedStyle(n);
93
+ if (s.position !== 'static' || s.transform !== 'none' || s.filter !== 'none' || s.perspective !== 'none'
94
+ || (s.backdropFilter && s.backdropFilter !== 'none')
95
+ || /layout|paint|strict|content/.test(s.contain || '')
96
+ || (s.containerType && s.containerType !== 'normal')
97
+ || /transform|filter|perspective/.test(s.willChange || '')) return n;
98
+ }
99
+ return null;
100
+ }
101
+
102
+ function checkStretch(e) {
103
+ var btn = warned && e.target && e.target.closest ? e.target.closest('.fdy-btn--stretch') : null;
104
+ if (!btn || warned.has(btn)) return;
105
+ var host = anchorOf(btn);
106
+ if (host === null || host === document.body || host === document.documentElement) {
107
+ warned.add(btn);
108
+ console.warn('Freeday: this .fdy-btn--stretch has no containing block below <body>, so its hit '
109
+ + 'area covers the whole page and a tap anywhere lands on it. Put it in a .fdy-card or '
110
+ + '.fdy-list__row, make the element it should cover position:relative, or drop the modifier '
111
+ + 'if the button is not meant to cover anything.', btn);
112
+ return;
113
+ }
114
+ /* Any other rendered target in the covered area counts, even one inside a card of its own: this
115
+ overlay paints over that card as well. */
116
+ var rivals = Array.prototype.filter.call(host.querySelectorAll('.fdy-btn--stretch'), function (o) {
117
+ return o !== btn && o.getClientRects().length > 0;
118
+ });
119
+ if (rivals.length === 0) return;
120
+ warned.add(btn);
121
+ console.warn('Freeday: this .fdy-btn--stretch shares its covered area with ' + rivals.length + ' other '
122
+ + 'stretched target(s), so the last one in the DOM takes every tap in it, including taps meant '
123
+ + 'for the others. Give each one its own .fdy-card / .fdy-list__row, or make each one\'s own '
124
+ + 'container position:relative.', btn, host);
125
+ }
126
+
78
127
  ['click', 'focusin', 'submit'].forEach(function (type) {
79
128
  document.addEventListener(type, check, true);
80
129
  });
130
+ document.addEventListener('click', checkStretch, true);
81
131
 
82
132
  window.FreedayUnhydrated = { hooks: HOOKS };
83
133
  })();
package/dist/freeday.js CHANGED
@@ -5756,6 +5756,15 @@
5756
5756
  * that subtree, and this stays quiet about it. It is for markup whose behaviour something else
5757
5757
  * owns: the kit's own Vue/React FdyDrawer, and kit classes an app uses for their look
5758
5758
  * alone (CATATAN-FREEDAY §14: a chip matrix the app drives itself).
5759
+ *
5760
+ * The same click also checks `.fdy-btn--stretch`, the other kit piece whose misuse renders fine and
5761
+ * fails silently. Its overlay covers the nearest ancestor that is a containing block. With none but
5762
+ * <body>/<html>, it covers the whole page: every tap anywhere lands on that one button, and nothing
5763
+ * looks wrong (CATATAN-FREEDAY §19: a sign-out button that took every tap on a settings screen).
5764
+ * A second stretched target inside the area one covers overlaps it the same way, and the last one
5765
+ * in the DOM takes every tap meant for the other. A misplaced overlay makes itself the click target of
5766
+ * whatever is tapped, so the first tap anywhere on the page is enough to report it. Hit-testing
5767
+ * clicks in e2e tests reach it too.
5759
5768
  */
5760
5769
  (function () {
5761
5770
  'use strict';
@@ -5811,9 +5820,50 @@
5811
5820
  }
5812
5821
  }
5813
5822
 
5823
+ /* What an absolutely positioned box resolves against: the nearest ancestor that is positioned or
5824
+ that a transform, filter, perspective, containment or will-change of those turns into a
5825
+ containing block. null means the initial containing block, i.e. the viewport. */
5826
+ function anchorOf(el) {
5827
+ for (var n = el.parentElement; n; n = n.parentElement) {
5828
+ var s = getComputedStyle(n);
5829
+ if (s.position !== 'static' || s.transform !== 'none' || s.filter !== 'none' || s.perspective !== 'none'
5830
+ || (s.backdropFilter && s.backdropFilter !== 'none')
5831
+ || /layout|paint|strict|content/.test(s.contain || '')
5832
+ || (s.containerType && s.containerType !== 'normal')
5833
+ || /transform|filter|perspective/.test(s.willChange || '')) return n;
5834
+ }
5835
+ return null;
5836
+ }
5837
+
5838
+ function checkStretch(e) {
5839
+ var btn = warned && e.target && e.target.closest ? e.target.closest('.fdy-btn--stretch') : null;
5840
+ if (!btn || warned.has(btn)) return;
5841
+ var host = anchorOf(btn);
5842
+ if (host === null || host === document.body || host === document.documentElement) {
5843
+ warned.add(btn);
5844
+ console.warn('Freeday: this .fdy-btn--stretch has no containing block below <body>, so its hit '
5845
+ + 'area covers the whole page and a tap anywhere lands on it. Put it in a .fdy-card or '
5846
+ + '.fdy-list__row, make the element it should cover position:relative, or drop the modifier '
5847
+ + 'if the button is not meant to cover anything.', btn);
5848
+ return;
5849
+ }
5850
+ /* Any other rendered target in the covered area counts, even one inside a card of its own: this
5851
+ overlay paints over that card as well. */
5852
+ var rivals = Array.prototype.filter.call(host.querySelectorAll('.fdy-btn--stretch'), function (o) {
5853
+ return o !== btn && o.getClientRects().length > 0;
5854
+ });
5855
+ if (rivals.length === 0) return;
5856
+ warned.add(btn);
5857
+ console.warn('Freeday: this .fdy-btn--stretch shares its covered area with ' + rivals.length + ' other '
5858
+ + 'stretched target(s), so the last one in the DOM takes every tap in it, including taps meant '
5859
+ + 'for the others. Give each one its own .fdy-card / .fdy-list__row, or make each one\'s own '
5860
+ + 'container position:relative.', btn, host);
5861
+ }
5862
+
5814
5863
  ['click', 'focusin', 'submit'].forEach(function (type) {
5815
5864
  document.addEventListener(type, check, true);
5816
5865
  });
5866
+ document.addEventListener('click', checkStretch, true);
5817
5867
 
5818
5868
  window.FreedayUnhydrated = { hooks: HOOKS };
5819
5869
  })();
@@ -198,7 +198,7 @@ live docs also have a copy button per component.
198
198
  ```bash
199
199
  npm i @cahyo-dimas/freeday
200
200
  ```
201
- Lands in `package.json` as `"@cahyo-dimas/freeday": "^3.15.0"` (public npm package). `dist/` is
201
+ Lands in `package.json` as `"@cahyo-dimas/freeday": "^3.15.1"` (public npm package). `dist/` is
202
202
  committed and published → no build step; `npm ci` runs without auth.
203
203
 
204
204
  ### 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": "3.15.0",
3
+ "version": "3.15.1",
4
4
  "description": "Freeday: token-driven, framework-agnostic UI KIT (design source-of-truth).",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -97,7 +97,7 @@
97
97
  "scripts": {
98
98
  "build": "node tokens/build.mjs",
99
99
  "test": "node --test",
100
- "test:browser": "node --test --test-concurrency=3 browser/color-mix.mjs browser/vanilla.mjs browser/adapter.mjs browser/layout.mjs browser/theme.mjs browser/state.mjs browser/root-init.mjs browser/upload-states.mjs browser/number.mjs browser/card-stretch.mjs browser/text-override.mjs browser/control-heights.mjs browser/field-width.mjs browser/cfl-multi.mjs browser/cfl-dialog-only.mjs browser/crowding.mjs browser/over-dialog.mjs browser/chart-scale.mjs browser/overlay-stack.mjs browser/chart-a11y.mjs browser/app-shell.mjs browser/bottom-nav.mjs browser/picker-states.mjs browser/tabs-strip.mjs browser/tabs-vertical.mjs browser/menu-align.mjs browser/cfl-narrow.mjs browser/form-reveal.mjs browser/confirm-search-copy.mjs browser/daterange-settled.mjs browser/display-parts.mjs browser/table-empty.mjs browser/table-footer-text.mjs browser/month-mode.mjs browser/monthpicker.mjs browser/page-columns.mjs browser/table-hover.mjs browser/typed-popover.mjs browser/filter-parity.mjs browser/filter-wrap.mjs browser/filter-stack.mjs browser/timepicker.mjs browser/form-kit-required.mjs browser/picker-in-modal.mjs browser/harness-contract.mjs browser/app-owned.mjs browser/sortable.mjs browser/modal-phone.mjs browser/empty-ref.mjs browser/stack-standalone.mjs",
100
+ "test:browser": "node --test --test-concurrency=3 browser/color-mix.mjs browser/vanilla.mjs browser/adapter.mjs browser/layout.mjs browser/theme.mjs browser/state.mjs browser/root-init.mjs browser/upload-states.mjs browser/number.mjs browser/card-stretch.mjs browser/stretch-warn.mjs browser/text-override.mjs browser/control-heights.mjs browser/field-width.mjs browser/cfl-multi.mjs browser/cfl-dialog-only.mjs browser/crowding.mjs browser/over-dialog.mjs browser/chart-scale.mjs browser/overlay-stack.mjs browser/chart-a11y.mjs browser/app-shell.mjs browser/bottom-nav.mjs browser/picker-states.mjs browser/tabs-strip.mjs browser/tabs-vertical.mjs browser/menu-align.mjs browser/cfl-narrow.mjs browser/form-reveal.mjs browser/confirm-search-copy.mjs browser/daterange-settled.mjs browser/display-parts.mjs browser/table-empty.mjs browser/table-footer-text.mjs browser/month-mode.mjs browser/monthpicker.mjs browser/page-columns.mjs browser/table-hover.mjs browser/typed-popover.mjs browser/filter-parity.mjs browser/filter-wrap.mjs browser/filter-stack.mjs browser/timepicker.mjs browser/form-kit-required.mjs browser/picker-in-modal.mjs browser/harness-contract.mjs browser/app-owned.mjs browser/sortable.mjs browser/modal-phone.mjs browser/empty-ref.mjs browser/stack-standalone.mjs",
101
101
  "prepack": "node tokens/build.mjs",
102
102
  "version": "node tokens/build.mjs && git add dist",
103
103
  "typecheck:react": "tsc -p adapters/react/tsconfig.json --noEmit",