@cahyo-dimas/freeday 3.14.2 → 3.15.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
@@ -9,6 +9,41 @@ 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.0] - 2026-11-02
13
+
14
+ **Layar-layar yang tidak pernah punya tiket.** Daftar halaman sistem dan state yang dibutuhkan
15
+ setiap app, dari 404 sampai sesi habis, kini ikut di paket. Ada juga bingkai untuk layar di luar
16
+ shell, dan grup tombol bertumpuk untuk memilih satu dengan ibu jari (`CATATAN-FREEDAY.md` §18).
17
+
18
+ ### Added
19
+ - **`docs/screen-states.md`** (`#106`). Ada 27 layar dan state dalam lima kelompok:
20
+ - halaman sistem (404, 403, sesi habis, 500, perawatan, offline, tautan kedaluwarsa, 429);
21
+ - lima state layar data, dengan tiga jenis kosong dibedakan;
22
+ - umpan balik aksi;
23
+ - alur akun;
24
+ - state elemen.
25
+
26
+ Tiap butir menyebut apa yang harus diberitahukan ke pengguna dan bagian kit mana yang
27
+ membangunnya. Tempat yang tak punya bagian kit disebut terang-terangan, supaya tidak ada agen yang
28
+ mengarang kelas. `agent-onboarding.md` menyuruh agen membangun layar-layar itu bersama layar
29
+ pertama app baru, dan uji kelas tertutup ikut menjaga berkas ini.
30
+ - **`.fdy-btn-group--stack`** (`#107`). Grup yang sama, dibalik menjadi kolom selebar wadahnya
31
+ dengan border tetap menyambung. Hanya kedua ujungnya yang membulat, dan grup berisi satu tombol
32
+ membulat di keempat sudut. Label rata kiri. Dipasangkan dengan `--lg` dan `aria-pressed`, ia
33
+ mengisi celah antara grup mendatar yang terpotong di 375px, `.fdy-chip--choice` yang terlalu
34
+ kecil untuk ditekan sambil berdiri, dan combo yang butuh dua ketukan untuk tiga pilihan.
35
+ - **`.fdy-standalone` + `__panel`** (`#108`). Bingkai untuk layar di luar shell: masuk, daftar,
36
+ reset sandi, perawatan, atau 404 untuk yang belum masuk. Isinya satu panel di tengah, paling
37
+ lebar `26rem`, dengan gutter halaman di HP. Tingginya `min-height` `100vh` lalu `100dvh`, jadi
38
+ panel yang lebih tinggi dari layar (HP dengan papan ketik terbuka) membuat bingkai memanjang dan
39
+ halaman bergulir. Bidang pertamanya tidak pernah terdorong ke luar tepi atas.
40
+
41
+ ### Catatan
42
+ - Deteksi offline dan penjaga "perubahan belum disimpan" sengaja tidak dijadikan API. Keduanya
43
+ cukup beberapa baris di atas event bawaan peramban dan `Freeday.toast` / `Freeday.confirm` yang
44
+ sudah ada. Resepnya ditulis di `screen-states.md`.
45
+ - Ketiga tambahan ini aditif. Tidak ada kelas atau perilaku yang berubah.
46
+
12
47
  ## [3.14.2] - 2026-10-30
13
48
 
14
49
  **`useFreeday(ref)` dengan ref yang masih kosong kini bersuara.** Ref yang lupa dipasang di template
package/COMPONENTS.md CHANGED
@@ -25,7 +25,7 @@ live docs.
25
25
  `var(--space-4)`, `var(--radius-md)`, `var(--shadow-1)`, `var(--dur-2)`. Spacing is a 4px scale
26
26
  (`--space-0`…`--space-24`); a loose value breaks density switching.
27
27
  4. **Freeday owns components + tokens, not layout.** The only layout it ships is the shell
28
- (`.fdy-app`), the composition primitives below, and `.fdy-hidden`/`.fdy-visually-hidden`.
28
+ (`.fdy-app`, and `.fdy-standalone` for screens outside it), the composition primitives below, and `.fdy-hidden`/`.fdy-visually-hidden`.
29
29
  Grids, stacks and one-off gaps come from your own layout layer (a utility framework run
30
30
  **utilities-only, preflight off**, with its theme defined in terms of `var(--space-N)`).
31
31
  5. **`aria-invalid="true"` is the canonical error state** on form controls. It drives the visual
@@ -251,6 +251,31 @@ tall containing block. The brand goes in the **sidebar** (sized to match the top
251
251
  </div>
252
252
  ```
253
253
 
254
+ ## Standalone frame — `.fdy-standalone`
255
+ The frame for a screen that lives outside the app shell: sign in, sign up, a password reset or its
256
+ expired link, maintenance, a 404 for someone not signed in. One `.fdy-standalone__panel`, centred on
257
+ the shell's ground, at most `26rem` wide, with the page gutter around it on a phone.
258
+
259
+ ```html
260
+ <main class="fdy-standalone">
261
+ <div class="fdy-standalone__panel">
262
+ <form class="fdy-card" data-fdy-validate>
263
+ <div class="fdy-card__body">…</div>
264
+ </form>
265
+ </div>
266
+ </main>
267
+ ```
268
+
269
+ - The panel holds whatever the screen is: a `.fdy-card` with a form, or a `.fdy-state` for an error
270
+ page. Brand marks above it are yours.
271
+ - A panel taller than the screen makes the frame grow, so the panel starts at the top and the page
272
+ scrolls. A phone with its keyboard up needs exactly that. A frame with a fixed height would
273
+ centre the panel past the top edge, where no scroll can reach its first field.
274
+ - Its height is `100dvh` after a `100vh` fallback, so the iOS toolbar does not cover the bottom and
275
+ an engine without `dvh` still gets a full-height frame.
276
+ - [`docs/screen-states.md`](docs/screen-states.md) lists which screens need it and what each one
277
+ must tell the user.
278
+
254
279
  ## Page composition — `.fdy-page`
255
280
  Vertical section rhythm (`--space-8` between children). Assemble every screen from these; they
256
281
  carry the doctrine in markup.
@@ -502,6 +527,11 @@ a compact root with one region opted back out (shared chrome that must match a s
502
527
  - Modifiers: `--ghost` `--danger` `--text` `--icon` (square, icon-only) `--sm` `--lg`
503
528
  - Parts: `.fdy-btn__icon` (wraps the `<svg>`) · `.fdy-btn-group` (segmented row, `role="group"` +
504
529
  `aria-label`)
530
+ - **Stacked group:** `.fdy-btn-group--stack` turns the group into a full-width column with the same
531
+ joined borders. Use it for picking one of a few options with a thumb on a phone (a payment method,
532
+ which item was delivered), where a row of three names clips at 375px, a `.fdy-chip--choice` is too
533
+ small to hit standing up, and a combo costs two taps for three options. Pair it with `--lg`
534
+ buttons and `aria-pressed`, and keep exactly one pressed; the app owns which one.
505
535
  - **Toggle / segmented:** `aria-pressed="true"` gives a real pressed state (soft primary fill on
506
536
  `--ghost`/`--text`, an inset-sunk gradient on the solid button). No extra class: `aria-pressed`
507
537
  is already the right attribute, and it is what turns `.fdy-btn-group` from a joined row into a
@@ -514,6 +544,11 @@ a compact root with one region opted back out (shared chrome that must match a s
514
544
  <button class="fdy-btn fdy-btn--ghost fdy-btn--icon" type="button" aria-label="Settings">
515
545
  <span class="fdy-btn__icon"><!--svg--></span>
516
546
  </button>
547
+
548
+ <div class="fdy-btn-group fdy-btn-group--stack" role="group" aria-label="Payment method">
549
+ <button class="fdy-btn fdy-btn--ghost fdy-btn--lg" type="button" aria-pressed="true">Bank transfer</button>
550
+ <button class="fdy-btn fdy-btn--ghost fdy-btn--lg" type="button" aria-pressed="false">Cash</button>
551
+ </div>
517
552
  ```
518
553
 
519
554
  **Quiet destructive:** combine `--danger` with `--ghost` or `--text`. The ground stays quiet and only
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.14.2-0078d4?style=flat-square)](https://github.com/cahyo-dimas/freeday-ui-kit/tree/v3.14.2)
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)
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.14.2-0078d4?style=flat-square)](https://github.com/cahyo-dimas/freeday-ui-kit/tree/v3.14.2)
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)
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`.
@@ -236,6 +236,7 @@ USAGE.md the usage doctrine (which token/role when)
236
236
  docs/index.html living reference / demo site
237
237
  docs/reference-screen.html one complete screen, assembled
238
238
  docs/agent-onboarding.md onboarding for AI coding agents
239
+ docs/screen-states.md the screens and states every app needs (404, empty, loading…)
239
240
  reference/ input material, never shipped (port source + layout archetypes)
240
241
  ```
241
242
 
@@ -1454,6 +1454,14 @@ a { color: var(--color-primary-strong); }
1454
1454
  .fdy-app--nav-overlay.fdy-app--nav-open .fdy-app__backdrop{transition:none;}
1455
1455
  }
1456
1456
 
1457
+ /* Standalone: the frame for a screen outside the app shell, such as sign in, sign up, a password
1458
+ * reset, maintenance, or a 404 for someone not signed in. One panel, centred, on the shell's ground.
1459
+ * MIN-height, never height: a panel taller than the screen (a phone with its keyboard up) makes the
1460
+ * frame grow and the page scroll. A fixed height would centre it into negative space and put its
1461
+ * first field above the top edge, out of reach of any scroll. */
1462
+ .fdy-standalone{display:flex;flex-direction:column;box-sizing:border-box;min-height:100vh;min-height:100dvh;padding:var(--space-8) var(--space-4);background:var(--color-surface-2);}
1463
+ .fdy-standalone__panel{box-sizing:border-box;width:100%;max-width:26rem;margin:auto;}
1464
+
1457
1465
  /* Freeday. App bar (standalone top bar: brand · actions · spacer).
1458
1466
  * Distinct from .fdy-app__topbar (which is bound to the shell grid). Use anywhere;
1459
1467
  * sticky / elevated / dense / coloured via modifiers. Pure CSS. */
@@ -1810,6 +1818,16 @@ a { color: var(--color-primary-strong); }
1810
1818
  .fdy-btn-group .fdy-btn:hover,.fdy-btn-group .fdy-btn:focus-visible{z-index:1;}
1811
1819
  .fdy-btn-group .fdy-btn:first-child{border-top-left-radius:var(--radius-md);border-bottom-left-radius:var(--radius-md);}
1812
1820
  .fdy-btn-group .fdy-btn:last-child{border-top-right-radius:var(--radius-md);border-bottom-right-radius:var(--radius-md);}
1821
+ /* Stacked: the same joined group turned on its side, every button as wide as the group, for picking
1822
+ one of a few with a thumb on a phone. In a row, three names on a 375px screen become three
1823
+ clipped columns. The column's stretch is what makes each button full width. Labels start-align because a column of names is read down its left edge.
1824
+ Each corner rule sets all four corners, so the row's corners never leak in. */
1825
+ .fdy-btn-group--stack{display:flex;flex-direction:column;}
1826
+ .fdy-btn-group--stack .fdy-btn{justify-content:flex-start;text-align:start;}
1827
+ .fdy-btn-group--stack .fdy-btn:not(:first-child){margin-left:0;margin-top:calc(var(--bw) * -1);}
1828
+ .fdy-btn-group--stack .fdy-btn:first-child{border-radius:var(--radius-md) var(--radius-md) 0 0;}
1829
+ .fdy-btn-group--stack .fdy-btn:last-child{border-radius:0 0 var(--radius-md) var(--radius-md);}
1830
+ .fdy-btn-group--stack .fdy-btn:only-child{border-radius:var(--radius-md);}
1813
1831
 
1814
1832
  /* FAB, circular elevated action button (icon), optional extended pill with label */
1815
1833
  .fdy-fab{display:inline-flex;align-items:center;justify-content:center;gap:var(--space-2);width:3.5rem;height:3.5rem;padding:0;border:var(--bw) solid transparent;border-radius:var(--radius-full);cursor:pointer;color:var(--color-on-primary);background:var(--color-primary) linear-gradient(180deg,rgba(0,0,0,0),rgba(0,0,0,.1));box-shadow:var(--shadow-3);transition:transform var(--dur-fast) var(--ease-standard),box-shadow var(--dur-fast) var(--ease-standard);}
package/dist/freeday.css CHANGED
@@ -277,6 +277,14 @@ a { color: var(--color-primary-strong); }
277
277
  .fdy-app--nav-overlay.fdy-app--nav-open .fdy-app__backdrop{transition:none;}
278
278
  }
279
279
 
280
+ /* Standalone: the frame for a screen outside the app shell, such as sign in, sign up, a password
281
+ * reset, maintenance, or a 404 for someone not signed in. One panel, centred, on the shell's ground.
282
+ * MIN-height, never height: a panel taller than the screen (a phone with its keyboard up) makes the
283
+ * frame grow and the page scroll. A fixed height would centre it into negative space and put its
284
+ * first field above the top edge, out of reach of any scroll. */
285
+ .fdy-standalone{display:flex;flex-direction:column;box-sizing:border-box;min-height:100vh;min-height:100dvh;padding:var(--space-8) var(--space-4);background:var(--color-surface-2);}
286
+ .fdy-standalone__panel{box-sizing:border-box;width:100%;max-width:26rem;margin:auto;}
287
+
280
288
  /* Freeday. App bar (standalone top bar: brand · actions · spacer).
281
289
  * Distinct from .fdy-app__topbar (which is bound to the shell grid). Use anywhere;
282
290
  * sticky / elevated / dense / coloured via modifiers. Pure CSS. */
@@ -633,6 +641,16 @@ a { color: var(--color-primary-strong); }
633
641
  .fdy-btn-group .fdy-btn:hover,.fdy-btn-group .fdy-btn:focus-visible{z-index:1;}
634
642
  .fdy-btn-group .fdy-btn:first-child{border-top-left-radius:var(--radius-md);border-bottom-left-radius:var(--radius-md);}
635
643
  .fdy-btn-group .fdy-btn:last-child{border-top-right-radius:var(--radius-md);border-bottom-right-radius:var(--radius-md);}
644
+ /* Stacked: the same joined group turned on its side, every button as wide as the group, for picking
645
+ one of a few with a thumb on a phone. In a row, three names on a 375px screen become three
646
+ clipped columns. The column's stretch is what makes each button full width. Labels start-align because a column of names is read down its left edge.
647
+ Each corner rule sets all four corners, so the row's corners never leak in. */
648
+ .fdy-btn-group--stack{display:flex;flex-direction:column;}
649
+ .fdy-btn-group--stack .fdy-btn{justify-content:flex-start;text-align:start;}
650
+ .fdy-btn-group--stack .fdy-btn:not(:first-child){margin-left:0;margin-top:calc(var(--bw) * -1);}
651
+ .fdy-btn-group--stack .fdy-btn:first-child{border-radius:var(--radius-md) var(--radius-md) 0 0;}
652
+ .fdy-btn-group--stack .fdy-btn:last-child{border-radius:0 0 var(--radius-md) var(--radius-md);}
653
+ .fdy-btn-group--stack .fdy-btn:only-child{border-radius:var(--radius-md);}
636
654
 
637
655
  /* FAB, circular elevated action button (icon), optional extended pill with label */
638
656
  .fdy-fab{display:inline-flex;align-items:center;justify-content:center;gap:var(--space-2);width:3.5rem;height:3.5rem;padding:0;border:var(--bw) solid transparent;border-radius:var(--radius-full);cursor:pointer;color:var(--color-on-primary);background:var(--color-primary) linear-gradient(180deg,rgba(0,0,0,0),rgba(0,0,0,.1));box-shadow:var(--shadow-3);transition:transform var(--dur-fast) var(--ease-standard),box-shadow var(--dur-fast) var(--ease-standard);}
@@ -58,6 +58,9 @@ wrapper, use the raw markup and hydrate it:
58
58
  - `node_modules/@cahyo-dimas/freeday/USAGE.md` is the doctrine: which token/role/shadow to use when.
59
59
  - `node_modules/@cahyo-dimas/freeday/docs/reference-screen.html` is one complete screen, assembled
60
60
  the intended way. Copy this structure for a new screen.
61
+ - `node_modules/@cahyo-dimas/freeday/docs/screen-states.md` lists the screens and states an app
62
+ needs beyond its ideal screens: 404/403/session expired, the three kinds of empty, loading, load
63
+ error, action feedback, account flows. **Starting a new app, build these with the first screens.**
61
64
 
62
65
  **Non-negotiables:**
63
66
  1. No raw hex or px in app CSS. Use tokens: `var(--color-primary)`, `var(--space-4)` (4px scale),
@@ -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.14.2"` (public npm package). `dist/` is
201
+ Lands in `package.json` as `"@cahyo-dimas/freeday": "^3.15.0"` (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`)
@@ -0,0 +1,183 @@
1
+ # Freeday — the screens and states every app needs
2
+
3
+ A checklist for **starting an app from scratch**, and for reviewing one before release. Most of
4
+ these screens have no ticket. Nobody asks for "the page after a session expires" until a user
5
+ hits a blank screen. Build them from the start, with the rest of the app.
6
+
7
+ Each entry says what the user has to be told and which Freeday pieces build it. Every class named
8
+ here exists in the kit (a test holds this file to that). Where the kit has no piece, the entry says
9
+ so. **Do not invent a class to fill the gap.** Layout, such as centring a block on the page, belongs
10
+ to your app's own layer (COMPONENTS.md, hard rule on layout).
11
+
12
+ The middle part follows the "UI stack" idea: every data screen has five states (ideal, empty,
13
+ loading, partial, error), and the ideal one is the only one a design usually shows.
14
+
15
+
16
+ ## A. System pages
17
+
18
+ A system page replaces the whole screen body. Build it as one `.fdy-page` holding one `.fdy-state`
19
+ inside the app's normal frame when the user is signed in, so the navigation still works. When they
20
+ are not signed in, put the `.fdy-state` in a `.fdy-standalone__panel` instead. Every system page answers three questions: **what happened, whose
21
+ fault it is, and what to do now.** "Error" answers none of them.
22
+
23
+ ```html
24
+ <div class="fdy-page">
25
+ <div class="fdy-state">
26
+ <span class="fdy-state__icon" aria-hidden="true"><!-- icon --></span>
27
+ <h1 class="fdy-state__title">Page not found</h1>
28
+ <p class="fdy-state__text">The address may be mistyped, or the page was moved.</p>
29
+ <div class="fdy-state__actions">
30
+ <a class="fdy-btn" href="/">Back to home</a>
31
+ </div>
32
+ </div>
33
+ </div>
34
+ ```
35
+
36
+ The state's title is the page's only `<h1>` here, so it takes the `h1` element. It keeps
37
+ `.fdy-state__title`, the role that belongs to this block.
38
+
39
+ | # | Page | When | Tell the user | Primary action |
40
+ |---|---|---|---|---|
41
+ | 1 | **404 Not found** | No route matches, or the record no longer exists | The address is wrong, or the item was moved or deleted. For a deleted record, say that it was deleted. | Back to home, or back to the list the record came from |
42
+ | 2 | **403 Forbidden** | Signed in, but this role may not open it | Which permission is missing, and who can grant it | Back. Optionally "Ask for access" |
43
+ | 3 | **401 Session expired** | Not signed in, or the token expired | The session ended. **Nothing is lost** if that is true. | Sign in again, then **return to the same page** |
44
+ | 4 | **500 Server error** | The server failed | It is our fault, not theirs. Give a reference code they can quote. | Try again |
45
+ | 5 | **503 Maintenance** | Planned downtime | When it will be back | None, or a status page link |
46
+ | 6 | **Offline** | No network | What still works offline, and that it retries by itself | Try again |
47
+ | 7 | **Link expired or invalid** | A reset, invite or verification link is used late or twice | The link is no longer valid, and why (expired, already used) | Send a new link |
48
+ | 8 | **429 Too many attempts** | Rate limited, for example a wrong PIN | How long to wait, as a time, not "later" | None until the wait ends |
49
+ | 9 | **Unsupported browser** | A required feature is missing | Which browser versions work | None |
50
+
51
+ Notes:
52
+
53
+ - **401 and 403 are different pages.** Sending an expired session to "Forbidden" tells a user who
54
+ is allowed in that they are not. Sending a forbidden user to the sign-in page loops forever.
55
+ - The 401 path is the one most often broken. Keep the requested URL, sign the user in, and send
56
+ them back to it. If a form was open, say whether its input survived.
57
+ - Use `.fdy-state--danger` for 500 and offline, where something failed. Do not use it for 404 or
58
+ 403, where nothing broke.
59
+ - A system page inside the app frame keeps the frame's one primary button rule: the page's own
60
+ action is the primary, and the frame has none.
61
+ - Offline needs no kit API. The browser's own events and a sticky toast cover a short drop, and
62
+ the full page is for when nothing on the screen can work:
63
+
64
+ ```js
65
+ addEventListener('offline', () => Freeday.toast({ variant: 'warning', key: 'offline', timeout: 0,
66
+ title: 'You are offline', message: 'Changes are kept and sent when the connection returns.' }))
67
+ addEventListener('online', () => Freeday.dismiss('offline'))
68
+ ```
69
+
70
+ Only write "changes are kept" if the app really queues them.
71
+
72
+
73
+ ## B. States inside a data screen
74
+
75
+ These replace one data area (a table, a list, a card), not the page. Put the `.fdy-state` inside
76
+ the card or section it replaces, so the page header and its actions stay usable.
77
+
78
+ ### 10. Ideal
79
+
80
+ The data as designed. Design it last, after the four below, because those decide whether the
81
+ layout survives real data.
82
+
83
+ ### 11. Empty: three different screens
84
+
85
+ One "No data" message for all three is the most common defect on this list. Each one needs
86
+ different words and a different action:
87
+
88
+ | Kind | Cause | Words | Action |
89
+ |---|---|---|---|
90
+ | **First use** | Nothing created yet | What will appear here, and why it is useful | Create the first one (the screen's primary button) |
91
+ | **No match** | A search or filter emptied it | Nothing matches *this filter*; name the filter | Clear the filter. A "Create" button is wrong here, since the data exists. |
92
+ | **All done** | Everything was handled | Confirmation that the work is finished | Usually none |
93
+
94
+ - `FdyTable` tells the first two apart for you: its empty slot (`empty` in React, the `empty` slot
95
+ in Vue, `EmptyTemplate` in Blazor) receives `filtered` and `clearFilters`.
96
+ - In a small card or dashboard widget, use `.fdy-state--compact`.
97
+
98
+ ### 12. Loading: pick by how long, and by what is waiting
99
+
100
+ | What is waiting | Use |
101
+ |---|---|
102
+ | Content whose shape is known (a list, a card, a profile) | `.fdy-skeleton` sized like the real content, so nothing jumps when it lands |
103
+ | A table | `FdyTable`'s `loading` (the in-table row, `.fdy-table__state`) |
104
+ | One button's action, a short one | Disable the button and put a `.fdy-spinner--sm` in it |
105
+ | A long job with a known end (upload, import) | `.fdy-progress` with a real percentage |
106
+ | A long job with no known end | `.fdy-progress--indeterminate`, plus words saying what is happening |
107
+ | An action the user must not interrupt or repeat (posting, paying) | `Freeday.busy({ caption })`, which also blocks double submission |
108
+
109
+ - A fast answer gets no spinner, because a flash of one reads as a glitch. `Freeday.busy()` waits
110
+ 120 ms before it appears for this reason; give your own loading UI the same delay.
111
+ - After about ten seconds, say so ("This is taking longer than usual"). A spinner with no end looks
112
+ the same as a hung app.
113
+
114
+ ### 13. Partial
115
+
116
+ Some data arrived and some did not, or there is very little of it.
117
+
118
+ - **A section failed and the rest loaded:** show the rest, and put a `.fdy-state--compact
119
+ .fdy-state--danger` with a retry action where the failed part would be. Do not fail the whole
120
+ page for one widget.
121
+ - **Very little data:** a list of one row should still look intentional. Do not stretch it to fill
122
+ a layout designed for fifty rows.
123
+ - **Stale data:** if what is shown is cached or old, say how old ("Updated 10 minutes ago").
124
+
125
+ ### 14. Load error: not the same as empty
126
+
127
+ **A failed request must never render as empty or as zero.** "No payments" when the request failed
128
+ tells the user there is nothing to do, which is the opposite of what happened.
129
+
130
+ - In a data area, use `.fdy-state.fdy-state--danger` with "Try again" in `__actions`. In a widget,
131
+ use the `--compact` form.
132
+ - Say whose problem it is. "Could not reach the server" is ours. "You are offline" is the device's.
133
+ - Keep the detail (status, request id) available for support, but out of the headline.
134
+
135
+
136
+ ## C. Feedback on actions
137
+
138
+ | # | Moment | Use | Rule |
139
+ |---|---|---|---|
140
+ | 15 | **Success** | `Freeday.toast({ variant: 'success' })` | Name the thing ("INV-1042 saved"), not just "Saved". For an action that ends a flow (a payment), use a confirmation page or `.fdy-state` instead, because a toast is gone before it is read. |
141
+ | 16 | **Destructive confirm** | `Freeday.confirm({ tone: 'danger', details })` | Put the consequence in numbers ("3 schedules are deleted with it"), not "Are you sure?". Name the button for the action ("Delete order"), not "OK". |
142
+ | 17 | **Unsaved changes** | `Freeday.confirm` in the router's leave hook, `beforeunload` for the tab | In the router: `return isDirty() ? Freeday.confirm({ … }) : true`. For a closed tab or a reload: `addEventListener('beforeunload', e => { if (isDirty()) { e.preventDefault(); e.returnValue = '' } })`; the `returnValue` line is for older engines. The browser shows its own wording there and ignores a custom message. |
143
+ | 18 | **Form validation** | `data-fdy-validate`, `.fdy-help--error` | The message sits under the field it belongs to, not in one alert at the top. Say how to fix it ("At least 8 characters"), not only that it is wrong. |
144
+ | 19 | **Submitting** | Disabled button with `.fdy-spinner--sm`, or `Freeday.busy()` | The second click must do nothing. A double-submitted payment is the expensive version of this bug. |
145
+
146
+ - Errors from the server after submit (a duplicate code, a rejected payment) go in a
147
+ `.fdy-alert--danger` above the form, and the field it concerns also gets `aria-invalid`.
148
+ - Status is never colour-only. Every toast, alert and badge carries words.
149
+
150
+
151
+ ## D. Account flows
152
+
153
+ The kit ships the frame, `.fdy-standalone`, and no ready-made screens, because every app's identity
154
+ model differs. Build each one as a `.fdy-card` in a `.fdy-standalone__panel`, with `.fdy-field` and
155
+ `data-fdy-validate`.
156
+
157
+ | # | Screen | What it must get right |
158
+ |---|---|---|
159
+ | 20 | **Sign in** | Say which part was wrong only when that is safe: "Wrong username or password" does not reveal which accounts exist. Show the caps-lock state. After sign-in, return to the page the user asked for (see 401). |
160
+ | 21 | **Sign up** | Ask only for what is needed now. Show password rules **before** the user types, not after a failure. |
161
+ | 22 | **Forgot / reset password** | The request page says "If that account exists, a link is on its way", whether or not it exists. The reset link expires; its expired page is item 7. |
162
+ | 23 | **Verify email or OTP** | Say where the code went (a masked address or number). Offer resend with a visible countdown, and accept a pasted code. |
163
+ | 24 | **Onboarding / first run** | Short, skippable, and it ends in the first-use empty state (11) with its create action. `.fdy-stepper` for a multi-step setup; a step that picks one of a few options can use `.fdy-btn-group--stack`. |
164
+ | 25 | **Profile and settings** | Each change saves visibly (a toast, or a saved state on the section). Changing the email or password asks for the current password. |
165
+ | 26 | **Sign out** | Lands on the sign-in page with "You have signed out", so a shared device is visibly signed out. |
166
+
167
+
168
+ ## E. Element states
169
+
170
+ | # | State | Kit |
171
+ |---|---|---|
172
+ | 27 | hover, focus, active, disabled, read-only, invalid | Built into every control. Your job is to not remove them: never `outline: none` without a replacement, and never style a disabled control so it looks enabled. |
173
+
174
+ - **Disabled versus hidden:** hide an action the user can never take. Disable an action they could
175
+ take once something changes, and say what has to change (a `.fdy-help` line or a tooltip).
176
+ - Read-only shows the value as text, so it can be selected and copied. It is not a disabled input.
177
+
178
+
179
+ ## Before release
180
+
181
+ Walk every data screen through: ideal · first-use empty · no-match empty · loading · load error ·
182
+ one row · a very long name · a phone width. Then walk the app through: 404 · 403 · an expired
183
+ session mid-form · offline · a double click on every submit button.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cahyo-dimas/freeday",
3
- "version": "3.14.2",
3
+ "version": "3.15.0",
4
4
  "description": "Freeday: token-driven, framework-agnostic UI KIT (design source-of-truth).",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -35,7 +35,8 @@
35
35
  "docs/getting-started.md",
36
36
  "docs/integrations.md",
37
37
  "docs/agent-onboarding.md",
38
- "docs/reference-screen.html"
38
+ "docs/reference-screen.html",
39
+ "docs/screen-states.md"
39
40
  ],
40
41
  "exports": {
41
42
  ".": {
@@ -96,7 +97,7 @@
96
97
  "scripts": {
97
98
  "build": "node tokens/build.mjs",
98
99
  "test": "node --test",
99
- "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",
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
101
  "prepack": "node tokens/build.mjs",
101
102
  "version": "node tokens/build.mjs && git add dist",
102
103
  "typecheck:react": "tsc -p adapters/react/tsconfig.json --noEmit",
@@ -174,3 +174,11 @@
174
174
  .fdy-app--nav-overlay .fdy-app__backdrop,
175
175
  .fdy-app--nav-overlay.fdy-app--nav-open .fdy-app__backdrop{transition:none;}
176
176
  }
177
+
178
+ /* Standalone: the frame for a screen outside the app shell, such as sign in, sign up, a password
179
+ * reset, maintenance, or a 404 for someone not signed in. One panel, centred, on the shell's ground.
180
+ * MIN-height, never height: a panel taller than the screen (a phone with its keyboard up) makes the
181
+ * frame grow and the page scroll. A fixed height would centre it into negative space and put its
182
+ * first field above the top edge, out of reach of any scroll. */
183
+ .fdy-standalone{display:flex;flex-direction:column;box-sizing:border-box;min-height:100vh;min-height:100dvh;padding:var(--space-8) var(--space-4);background:var(--color-surface-2);}
184
+ .fdy-standalone__panel{box-sizing:border-box;width:100%;max-width:26rem;margin:auto;}
@@ -92,6 +92,16 @@
92
92
  .fdy-btn-group .fdy-btn:hover,.fdy-btn-group .fdy-btn:focus-visible{z-index:1;}
93
93
  .fdy-btn-group .fdy-btn:first-child{border-top-left-radius:var(--radius-md);border-bottom-left-radius:var(--radius-md);}
94
94
  .fdy-btn-group .fdy-btn:last-child{border-top-right-radius:var(--radius-md);border-bottom-right-radius:var(--radius-md);}
95
+ /* Stacked: the same joined group turned on its side, every button as wide as the group, for picking
96
+ one of a few with a thumb on a phone. In a row, three names on a 375px screen become three
97
+ clipped columns. The column's stretch is what makes each button full width. Labels start-align because a column of names is read down its left edge.
98
+ Each corner rule sets all four corners, so the row's corners never leak in. */
99
+ .fdy-btn-group--stack{display:flex;flex-direction:column;}
100
+ .fdy-btn-group--stack .fdy-btn{justify-content:flex-start;text-align:start;}
101
+ .fdy-btn-group--stack .fdy-btn:not(:first-child){margin-left:0;margin-top:calc(var(--bw) * -1);}
102
+ .fdy-btn-group--stack .fdy-btn:first-child{border-radius:var(--radius-md) var(--radius-md) 0 0;}
103
+ .fdy-btn-group--stack .fdy-btn:last-child{border-radius:0 0 var(--radius-md) var(--radius-md);}
104
+ .fdy-btn-group--stack .fdy-btn:only-child{border-radius:var(--radius-md);}
95
105
 
96
106
  /* FAB, circular elevated action button (icon), optional extended pill with label */
97
107
  .fdy-fab{display:inline-flex;align-items:center;justify-content:center;gap:var(--space-2);width:3.5rem;height:3.5rem;padding:0;border:var(--bw) solid transparent;border-radius:var(--radius-full);cursor:pointer;color:var(--color-on-primary);background:var(--color-primary) linear-gradient(180deg,rgba(0,0,0,0),rgba(0,0,0,.1));box-shadow:var(--shadow-3);transition:transform var(--dur-fast) var(--ease-standard),box-shadow var(--dur-fast) var(--ease-standard);}