@cahyo-dimas/freeday 3.20.0 → 3.22.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 +106 -2
- package/COMPONENTS.md +63 -3
- package/README.id.md +6 -4
- package/README.md +6 -4
- package/USAGE.md +152 -2
- package/dist/freeday.bundle.css +964 -226
- package/dist/freeday.css +80 -1
- package/dist/freeday.tokens.css +884 -225
- package/docs/agent-onboarding.md +27 -14
- package/docs/getting-started.md +4 -4
- package/package.json +2 -2
- package/src/components/actionbar.css +68 -0
- package/src/components/bottomnav.css +11 -1
- package/tokens/tokens.json +81 -46
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,110 @@ 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.22.0] - 2026-11-24
|
|
13
|
+
|
|
14
|
+
**Sebuah app yang dipakai di HP punya tombol berukuran ibu jari, isian primary yang lebih dalam, dan
|
|
15
|
+
bilah aksi yang menempel di atas navigasi bawah.** Tanpa atribut baru, setiap token tetap bernilai
|
|
16
|
+
sama dengan 3.21.0 di terang, gelap, `soft`, `glass`, di bawah semua palet dan netral, selain satu
|
|
17
|
+
token baru, `--primary-700-rgb`, di setiap blok palet (tak ada yang membacanya tanpa
|
|
18
|
+
`data-primary-fill="deep"`). `test/token-snapshot.test.mjs` menjaganya.
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
- **`data-density="touch"`.** Menyetel `--control-h` ke `2.75rem` (44px) dan tidak mengubah yang lain.
|
|
22
|
+
Di dalam region `compact` ia mempertahankan spasi compact.
|
|
23
|
+
- **`data-primary-fill="deep"`.** Isian primary memakai shade 700; hover, active, dan strong memakai 800;
|
|
24
|
+
`--color-primary-rgb` dan cincin fokus memakai 700; label memakai `onDeep`. Hanya tema terang; tema
|
|
25
|
+
gelap tidak berubah. `onDeep` bernilai putih di 18 palet (terukur: terendah lime 4,99:1, di ketiga
|
|
26
|
+
netral slate, grey, dan stone). Setiap blok palet kini juga membawa `--primary-700-rgb`. Region bersarang mengulang `data-theme` dan `data-primary` di elemen yang sama. Wrapper
|
|
27
|
+
polos memakai nilai terang `deep` di semua tema, jadi di bawah tema gelap (milik leluhur atau OS)
|
|
28
|
+
isian dan tinta strong-nya salah.
|
|
29
|
+
- **`.fdy-actionbar`** (`src/components/actionbar.css`, hanya CSS): aksi yang menempel di atas navigasi
|
|
30
|
+
bawah dan tidak pernah menutup baris terakhir. Boleh berada di dalam satu wrapper halaman seperti
|
|
31
|
+
`.fdy-page` yang menjadi anak terakhir `main`. Di HP (720px ke bawah) bar selebar layar, seperti
|
|
32
|
+
navigasi bawah. Bersamanya token `--fdy-bottomnav-h`.
|
|
33
|
+
- **`USAGE.md` §8 Mobile**: HP adalah layout sendiri, bukan desktop yang diperkecil.
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
- **Tinta label palet di bawah pengaturan gelap OS.** Tujuh palet bertinta gelap (orange, amber, lime,
|
|
37
|
+
green, emerald, teal, cyan) menampilkan label putih di isian 500 selama OS gelap, bahkan dengan
|
|
38
|
+
`data-theme="dark"`. Terukur sebelum perbaikan: orange 2,80, amber 2,15, lime 1,98, green 2,28,
|
|
39
|
+
emerald 2,54, teal 2,49, cyan 2,43 :1. Sebabnya: aturan dasar `:root:not([data-theme="light"])` (0,2,0)
|
|
40
|
+
mengalahkan blok palet (0,1,0), dan `buildPrimariesCss` hanya menulis kembaran gelap bila `onDark`
|
|
41
|
+
berbeda dari `on`. Gerbang kontras tidak pernah memodelkan cakupan gelap OS. Kini ada kembaran
|
|
42
|
+
gelap, dan tes kontras serta tes browser menjaganya.
|
|
43
|
+
|
|
44
|
+
### Changed
|
|
45
|
+
- **Tinggi navigasi bawah kini dinyatakan.** `--fdy-bottomnav-h` dideklarasikan di
|
|
46
|
+
`.fdy-app--has-bottomnav` dan navigasi mengambil tingginya dari sana. Tingginya dulu 61,39px karena
|
|
47
|
+
isi satu item (ikon, label) 0,39px lebih tinggi dari 44px; kini tepat 61px. Dengan font app yang lebih
|
|
48
|
+
tinggi, label meluap ke padding bawah dan tidak lagi menambah tinggi bilah.
|
|
49
|
+
- **`.fdy-actionbar` sebagai anak terakhir `.fdy-app__main`** meniadakan padding bawah main dengan margin
|
|
50
|
+
negatif per konteks, sehingga di akhir halaman ia bersandar rata pada navigasi atau tepi viewport.
|
|
51
|
+
- **Docs.** `USAGE.md` §0 kini menyebut "di luar jaminan kit" sebagai ganti "terkunci". Daftar
|
|
52
|
+
`data-density` di README, `docs/getting-started.md`, dan `docs/agent-onboarding.md` memuat `touch`.
|
|
53
|
+
|
|
54
|
+
### Upgrade
|
|
55
|
+
- Ganti `--control-h: 2.75rem` yang disetel tangan dengan `data-density="touch"`.
|
|
56
|
+
- Ganti primary yang lebih dalam yang disetel tangan (`--color-primary: var(--primary-700)` dan
|
|
57
|
+
kawan-kawannya) dengan `data-primary-fill="deep"`.
|
|
58
|
+
- Penyetelan `--color-on-primary` bertinta gelap di bawah `[data-theme='dark']` baru boleh dihapus
|
|
59
|
+
setelah region gelap itu membawa `data-primary` di sebelah `data-theme` (`USAGE.md` §5b). Perbaikan
|
|
60
|
+
kit hanya berlaku di scope yang menaruh keduanya pada elemen yang sama; region gelap bersarang yang
|
|
61
|
+
mewarisi palet dari `<html>` masih butuh aturan itu.
|
|
62
|
+
- `--color-on-primary` yang disetel tangan di bawah `:root[data-primary=…]` kini kalah dari
|
|
63
|
+
`:root:not([data-theme="light"])[data-primary=…]` saat OS gelap. Hapus override itu dan pakai
|
|
64
|
+
`data-primary-fill="deep"` dalam perubahan yang sama.
|
|
65
|
+
|
|
66
|
+
## [3.21.0] - 2026-11-20
|
|
67
|
+
|
|
68
|
+
**Sebuah app memutuskan tampilannya sendiri.** Sebelum rilis ini kit hanya menawarkan palet primary,
|
|
69
|
+
dan semua abu-abu tetap slate yang kebiruan. App yang tidak mengubah apa pun tampil persis seperti
|
|
70
|
+
halaman docs kit, jadi keputusan tampilan sering tidak pernah diambil.
|
|
71
|
+
|
|
72
|
+
### Added
|
|
73
|
+
- **`data-neutral="slate|grey|stone"`, sumbu kelima.** Ia mengarahkan ulang ramp alias `--neutral-*`
|
|
74
|
+
yang dibaca setiap abu-abu: permukaan, teks, border, kontrol, dan tinta `on-*`. `slate` tetap
|
|
75
|
+
bawaan. `grey` tanpa rona; `stone` hangat. Keduanya mempertahankan kecerahan slate di tiap shade,
|
|
76
|
+
jadi rasio kontras bergeser paling banyak sekitar 0,1 (terukur: grey 0,04, stone 0,11). Gerbang kontras mengukur semua
|
|
77
|
+
pasangan di kedua tema, `soft` dan `glass`, dan di bawah 18 palet. Ramp alias kini punya 14 shade
|
|
78
|
+
karena `slate` mendapat shade `850` (`#1c2130`, nilai `--color-border-muted` gelap yang dulu
|
|
79
|
+
literal).
|
|
80
|
+
- **Kontrak identitas di `USAGE.md` §0**: apa yang dimiliki app (sumbu, keluarga huruf, bobot, bentuk,
|
|
81
|
+
kedalaman, gerak) dan apa yang tidak, ditambah brief identitas yang diisi sebelum layar pertama.
|
|
82
|
+
- **Tabel komposisi di `USAGE.md` §7b.** Tabel 15 arketipe layout kini ikut terkirim di paket;
|
|
83
|
+
sebelumnya ia hanya ada di `reference/README.md`, yang tak pernah dikirim.
|
|
84
|
+
|
|
85
|
+
### Changed
|
|
86
|
+
- **Blok onboarding di `docs/agent-onboarding.md` ditulis ulang**: app baru memutuskan tampilannya
|
|
87
|
+
sebelum layar pertama. Proyek yang menyalin blok itu perlu menggantinya seluruhnya.
|
|
88
|
+
|
|
89
|
+
### Fixed (docs)
|
|
90
|
+
- **Klaim soal `data-primary` pada elemen bersarang dikoreksi.** Yang tertulis: palet bisa dipasang
|
|
91
|
+
di elemen mana pun untuk mengubah satu region. Yang benar: ramp `--primary-*` ikut berubah, tetapi
|
|
92
|
+
token semantic yang membacanya dihitung di `:root` dan tidak ikut turun. Region bersarang butuh
|
|
93
|
+
`data-theme` di elemen yang sama supaya token semantic dihitung ulang di sana. Dikoreksi di
|
|
94
|
+
`docs/index.html`, `tokens/build.mjs`, `USAGE.md` §5b, `COMPONENTS.md`, dan
|
|
95
|
+
`docs/agent-onboarding.md`, dan dijaga satu uji peramban.
|
|
96
|
+
- **Di wrapper polos, sumbu hanya setengah berlaku.** Palet menggeser tinta label tetapi tidak
|
|
97
|
+
fill-nya; netral menggeser tinta tone, border, stripe, dan border danger tetapi tidak
|
|
98
|
+
permukaannya. Jadi jangan pasang sumbu di wrapper polos: pasang di `<html>`, atau di region
|
|
99
|
+
bersama `data-theme`.
|
|
100
|
+
- **Batasan yang didokumentasikan:** island terbalik (`data-theme` di sebuah region) di app dengan
|
|
101
|
+
palet atau netral bukan-default harus mengulang `data-primary` dan `data-neutral` di elemen yang
|
|
102
|
+
sama. Tanpa itu, label di atas fill oranye, amber, lime, hijau, emerald, teal, atau cyan jatuh ke kisaran
|
|
103
|
+
2 sampai 3,8:1 (lime 1,98:1 dan oranye 2,80:1 di island gelap; island terang di app gelap 3,09 sampai 3,77:1). Sudah begitu sejak 3.20.0; akar masalahnya dicatat di `NEXT-UP.md`.
|
|
104
|
+
- `noir` kini mengikuti netral yang dipilih, dan nama token `--bw` serta `--dur-base` di docs
|
|
105
|
+
dikoreksi.
|
|
106
|
+
|
|
107
|
+
### Catatan
|
|
108
|
+
- **Tanpa `data-neutral`, keluarannya tidak berubah.** Setiap token bernilai sama dengan 3.20.0 di
|
|
109
|
+
terang, gelap, `soft`, `glass`, dan di bawah tiap palet. `test/token-snapshot.test.mjs` menjaganya
|
|
110
|
+
terhadap nilai yang direkam dari 3.20.0.
|
|
111
|
+
- **Tiga triple Tier-1 tidak lagi dikeluarkan**: `--slate-0-rgb`, `--slate-900-rgb`, dan
|
|
112
|
+
`--slate-950-rgb`. Pengganti bagi yang membacanya langsung: `--neutral-0-rgb`, `--neutral-900-rgb`,
|
|
113
|
+
`--neutral-950-rgb`. Nilainya sama di bawah slate.
|
|
114
|
+
- Tidak ada perubahan pada `src/components/*.css`, enhancer, atau pembungkus.
|
|
115
|
+
|
|
12
116
|
## [3.20.0] - 2026-11-19
|
|
13
117
|
|
|
14
118
|
**Rentang tanggal dalam satu kolom.** `FdyDateRange` selama ini dua picker bersebelahan: makan dua
|
|
@@ -642,7 +746,7 @@ perbaikan ini terdengar jauh lebih mahal daripada yang ternyata.
|
|
|
642
746
|
|
|
643
747
|
### Catatan
|
|
644
748
|
- `FdyAutocomplete` dan `FdyCfl` **di luar** aturan ini: keduanya merender `<input>` asli, jadi
|
|
645
|
-
`required` native yang cocok. Belum ada prop yang mengeksposnya, dan atribut tak dikenal jatuh ke
|
|
749
|
+
`required` native yang cocok. Belum ada prop yang mengeksposnya, dan atribut tak dikenal jatuh ke kisaran
|
|
646
750
|
AKAR wrapper bukan ke input di dalamnya, jadi hari ini keduanya tak bisa dijadikan wajib di stack
|
|
647
751
|
mana pun. Dicatat terbuka di `NEXT-UP.md` alih-alih ditutup separuh: mengalirkannya lewat jalur
|
|
648
752
|
kit akan memberi satu field dua sumber kebenaran.
|
|
@@ -1068,7 +1172,7 @@ mentok di iOS 15.
|
|
|
1068
1172
|
|
|
1069
1173
|
Perbaikan pertama yang dicoba justru membuktikan sebabnya. Pola cadangan yang biasa dipakai orang,
|
|
1070
1174
|
nilai statis dulu lalu `color-mix()` sesudahnya, tidak bekerja ketika deklarasinya memuat `var()`:
|
|
1071
|
-
deklarasi itu sah saat parse dan baru gagal saat computed-value, dan di jalur itu properti jatuh ke
|
|
1175
|
+
deklarasi itu sah saat parse dan baru gagal saat computed-value, dan di jalur itu properti jatuh ke kisaran
|
|
1072
1176
|
nilai initial, bukan ke baris sebelumnya. Untuk `border-color` nilai initial itu `currentColor`,
|
|
1073
1177
|
yaitu hitam. Keluhan tentang garis hitam tebal di mana-mana itulah bukti mekanismenya. Jadi
|
|
1074
1178
|
`color-mix()`-nya yang dibuang.
|
package/COMPONENTS.md
CHANGED
|
@@ -22,7 +22,7 @@ live docs.
|
|
|
22
22
|
2. **Never invent a class.** If it is not in this file, it does not exist. Freeday has no
|
|
23
23
|
`fdy-grid`, no `fdy-flex`, no `fdy-mt-4`, no `fdy-primary`.
|
|
24
24
|
3. **Never write a raw hex or px value** in app CSS. Use the tokens: `var(--color-primary)`,
|
|
25
|
-
`var(--space-4)`, `var(--radius-md)`, `var(--shadow-1)`, `var(--dur-
|
|
25
|
+
`var(--space-4)`, `var(--radius-md)`, `var(--shadow-1)`, `var(--dur-base)`. 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
28
|
(`.fdy-app`, and `.fdy-standalone` for screens outside it), the composition primitives below, and `.fdy-hidden`/`.fdy-visually-hidden`.
|
|
@@ -525,10 +525,23 @@ without a reload.
|
|
|
525
525
|
<script>try{var t=localStorage.getItem('fdy-theme');if(t==='light'||t==='dark')document.documentElement.setAttribute('data-theme',t)}catch(e){}</script>
|
|
526
526
|
```
|
|
527
527
|
|
|
528
|
+
**Neutral: `data-neutral`.** Three options for every grey in the kit (surfaces, borders, text
|
|
529
|
+
inks, the chart grid, and the `noir` palette): `slate` (the default, and what you get with no
|
|
530
|
+
attribute), `grey` (no hue) and `stone` (warm). Each shade keeps the lightness of the slate shade
|
|
531
|
+
with the same number, and every option is contrast-gated in both themes and under all 18 palettes.
|
|
532
|
+
Set it on `<html>`; on a region, only together with `data-theme`, because a bare wrapper takes the ink but not the surfaces (`USAGE.md` §5b).
|
|
533
|
+
|
|
534
|
+
```html
|
|
535
|
+
<html data-neutral="stone" data-primary="noir">
|
|
536
|
+
```
|
|
537
|
+
|
|
528
538
|
**Primary palette: `data-primary`.** 18 options — `azure` (the default, and what you get with no
|
|
529
539
|
attribute) · `sky` `blue` `indigo` `violet` `purple` `fuchsia` `pink` `rose` · `orange` `amber`
|
|
530
|
-
`yellow` `lime` `green` `emerald` `teal` `cyan` · `noir`. Set it
|
|
531
|
-
|
|
540
|
+
`yellow` `lime` `green` `emerald` `teal` `cyan` · `noir`. Set it on `<html>`. To re-brand one
|
|
541
|
+
region, put it on that region together with `data-theme`: the palette only reaches the semantic
|
|
542
|
+
tokens where `data-theme` re-declares them. On a bare wrapper it half-applies: the label ink
|
|
543
|
+
moves but the fill does not, so never do that. An inverted island (`data-theme` on a region) in an
|
|
544
|
+
app with a non-default look repeats `data-primary` and `data-neutral` beside its `data-theme`.
|
|
532
545
|
|
|
533
546
|
```html
|
|
534
547
|
<html data-primary="emerald" data-theme="dark">
|
|
@@ -550,10 +563,23 @@ and `violet` shift one step lighter in dark, because at their mid shade neither
|
|
|
550
563
|
reaches 4.5:1. `noir` is not a hue at all — it re-points the alias ramp at the neutral ramp, so
|
|
551
564
|
"primary" becomes near-black in light and near-white in dark.
|
|
552
565
|
|
|
566
|
+
**Deep fill: `data-primary-fill="deep"`.** For a white label on a darker fill, in the light theme
|
|
567
|
+
only. The fill, hover, active and strong ink move one shade down the palette's ramp (fill 700,
|
|
568
|
+
hover/active/strong 800, focus ring 700), and the label becomes the palette's measured `onDeep` ink,
|
|
569
|
+
which is white for all 18 palettes (lowest: lime, 4.99:1). The soft wash does not change, and the
|
|
570
|
+
dark theme keeps its normal values. Set it beside `data-primary`, on `<html>` or on a region, and on
|
|
571
|
+
a region only together with `data-theme` and `data-primary` on the same element. A bare wrapper
|
|
572
|
+
applies deep's light values in every theme, so under any dark theme (an ancestor's or the OS's) its fill
|
|
573
|
+
and strong ink are wrong. Noir is the odd one: its deep fill (neutral-800) is lighter than its standard
|
|
574
|
+
fill (neutral-900).
|
|
575
|
+
|
|
553
576
|
Density: `data-density="compact"` works on `<html>` **or any wrapper**, because the selector is a bare
|
|
554
577
|
`[data-density="compact"]` over inheriting custom properties, so one screen can be dense while the
|
|
555
578
|
rest of the app is not. `data-density="comfortable"` is a real rule too, so the reverse also works:
|
|
556
579
|
a compact root with one region opted back out (shared chrome that must match a sibling product).
|
|
580
|
+
`data-density="touch"` is the third value: 2.75rem (44px) controls, for an app used standing up or on
|
|
581
|
+
the move. It sets only the control height, so a touch region inside a compact one keeps compact
|
|
582
|
+
spacing; put `touch` on a comfortable ancestor to avoid that. `comfortable` resets it too.
|
|
557
583
|
|
|
558
584
|
---
|
|
559
585
|
|
|
@@ -2125,6 +2151,10 @@ and a row nobody can scroll to is a row nobody knows is there.
|
|
|
2125
2151
|
glyph means. Long labels ellipsis rather than wrap, so the bar keeps one height.
|
|
2126
2152
|
- Bottom padding includes `env(safe-area-inset-bottom)`, so labels do not sit under the home
|
|
2127
2153
|
indicator on a notched phone.
|
|
2154
|
+
- **`--fdy-bottomnav-h`** is the bar's stated height (a 44px item, the vertical padding and the top
|
|
2155
|
+
hairline), declared on `.fdy-app--has-bottomnav`. The bar is drawn at that height, and
|
|
2156
|
+
`.fdy-actionbar` reads it to rest on top of the bar. The trade-off: a taller app font overflows
|
|
2157
|
+
into the bar's padding instead of making the bar taller.
|
|
2128
2158
|
|
|
2129
2159
|
```html
|
|
2130
2160
|
<nav class="fdy-bottomnav" aria-label="Main">
|
|
@@ -2139,6 +2169,36 @@ and a row nobody can scroll to is a row nobody knows is there.
|
|
|
2139
2169
|
</nav>
|
|
2140
2170
|
```
|
|
2141
2171
|
|
|
2172
|
+
## Action bar — `.fdy-actionbar`
|
|
2173
|
+
One to three actions pinned to the bottom of the screen, where a thumb reaches them on a phone: the
|
|
2174
|
+
sign-in button, approve and reject on a document, save at the end of a long form. Put it as the last
|
|
2175
|
+
child of the page content (`.fdy-app__main`), or of one page wrapper such as `.fdy-page` inside it. The
|
|
2176
|
+
wrapper must be the last in-flow content of main and have no bottom padding, border or margin of its own;
|
|
2177
|
+
the fixed bottom nav and closed dialogs may follow it. A bar inside a modal or drawer is not offset.
|
|
2178
|
+
Nested deeper than one wrapper (inside a form, say), the bar still rests on the nav while scrolling but stops short of it at the end of the page. An in-flow block after the wrapper is overlapped at the end of the page.
|
|
2179
|
+
It holds `.fdy-btn` elements. They share the width, and
|
|
2180
|
+
the primary action goes last, nearest the thumb.
|
|
2181
|
+
|
|
2182
|
+
- It is `position: sticky`, so it keeps its place in the flow and never covers the last row above it.
|
|
2183
|
+
- In a shell with `.fdy-app--has-bottomnav`, below 720px it rests on top of the bottom nav, using
|
|
2184
|
+
`--fdy-bottomnav-h` (declared on that shell). Elsewhere it clears the home indicator with
|
|
2185
|
+
`env(safe-area-inset-bottom)`.
|
|
2186
|
+
- Below 720px it runs edge to edge, like the bottom nav, by cancelling main's side padding. The
|
|
2187
|
+
wrapper rule holds here too: a wrapper between main and the bar adds no side padding, border or
|
|
2188
|
+
margin. The bar's own side padding clears a landscape notch.
|
|
2189
|
+
- No ARIA of its own: it is a row of buttons, and each keeps its own name.
|
|
2190
|
+
- CSS only. Vue, React and Blazor use the same markup.
|
|
2191
|
+
|
|
2192
|
+
```html
|
|
2193
|
+
<main class="fdy-app__main">
|
|
2194
|
+
<!-- the screen -->
|
|
2195
|
+
<div class="fdy-actionbar">
|
|
2196
|
+
<button class="fdy-btn fdy-btn--ghost" type="button">Reject</button>
|
|
2197
|
+
<button class="fdy-btn" type="button">Approve</button>
|
|
2198
|
+
</div>
|
|
2199
|
+
</main>
|
|
2200
|
+
```
|
|
2201
|
+
|
|
2142
2202
|
## Nav (menu) — `.fdy-nav`
|
|
2143
2203
|
Navigation links, **vertical by default** (the app shell sidebar), horizontal with `--horizontal`. Items are `<a class="fdy-nav__item">` with
|
|
2144
2204
|
`__icon` / `__label` / `__badge`; the current one gets `aria-current="page"`.
|
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
|
[](https://cahyo-dimas.github.io/freeday-ui-kit/)
|
|
8
|
-
[](https://github.com/cahyo-dimas/freeday-ui-kit/tree/v3.22.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`.
|
|
@@ -143,15 +143,17 @@ Tabel lebar (banyak kolom) butuh wrapper untuk scroll horizontal: bungkus `.fdy-
|
|
|
143
143
|
border/shadow-nya sudah ada sendiri). Tanpa salah satu wrapper ini, tabel lebar akan overflow
|
|
144
144
|
container-nya, bukan scroll sendiri.
|
|
145
145
|
|
|
146
|
-
### 3. Theming:
|
|
146
|
+
### 3. Theming: 5 sumbu lewat `data-*` di root
|
|
147
147
|
- `data-theme="light|dark"` me-redefinisi token semantic (bind ke state tema app-mu).
|
|
148
148
|
Berlaku di **ancestor mana pun**, tak harus root: `<section data-theme="dark">` membalik region itu
|
|
149
149
|
dan semua komponen di dalamnya ikut (lihat [`USAGE.md`](USAGE.md) §5b).
|
|
150
|
-
- `data-density="comfortable|compact"` mengatur tinggi kontrol (`--control-h`) untuk layar padat data.
|
|
150
|
+
- `data-density="comfortable|compact|touch"` mengatur tinggi kontrol (`--control-h`): `compact` untuk layar padat data, `touch` (44px) untuk app yang dipakai di HP.
|
|
151
151
|
Ini auto-apply hanya ke kontrol bawaan Freeday (button, input, combo, dst); komponen
|
|
152
152
|
custom/hand-built harus baca `--control-h` sendiri (mis. `height: var(--control-h)`) supaya ikut
|
|
153
153
|
menyusut/melebar saat `data-density` berubah.
|
|
154
|
-
-
|
|
154
|
+
- `data-style="soft|glass"` memilih gaya visual, `data-primary` satu dari 18 palet primary, dan
|
|
155
|
+
`data-neutral="slate|grey|stone"` keluarga semua abu-abu. Pasang dua yang terakhir di `<html>`;
|
|
156
|
+
di sebuah region hanya bersama `data-theme` (lihat [`USAGE.md`](USAGE.md) §0 dan §5b).
|
|
155
157
|
- Skala breakpoint (`sm`/`md`/`lg`/`xl` = 600/960/1280/1920px, sama dengan utilitas
|
|
156
158
|
`src/components/breakpoints.css`) tersedia untuk app-mu dalam dua bahasa: `import { breakpoints }
|
|
157
159
|
from '@cahyo-dimas/freeday/breakpoints'` untuk JS (`matchMedia`, varian utility), dan `@import
|
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
|
[](https://cahyo-dimas.github.io/freeday-ui-kit/)
|
|
8
|
-
[](https://github.com/cahyo-dimas/freeday-ui-kit/tree/v3.22.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`.
|
|
@@ -145,15 +145,17 @@ Wide tables (many columns) need a wrapper for horizontal scroll: wrap `.fdy-tabl
|
|
|
145
145
|
border/shadow shell). Without one of these wrappers, a wide table overflows its container instead
|
|
146
146
|
of scrolling.
|
|
147
147
|
|
|
148
|
-
### 3. Theming:
|
|
148
|
+
### 3. Theming: 5 axes via `data-*` on the root
|
|
149
149
|
- `data-theme="light|dark"` redefines the semantic tokens (bind it to your app's theme state).
|
|
150
150
|
Works on **any ancestor**, not just the root: `<section data-theme="dark">` inverts that region
|
|
151
151
|
and every component inside it follows (see [`USAGE.md`](USAGE.md) §5b).
|
|
152
|
-
- `data-density="comfortable|compact"` sets control height (`--control-h`) for data-dense screens.
|
|
152
|
+
- `data-density="comfortable|compact|touch"` sets control height (`--control-h`): `compact` for data-dense screens, `touch` (44px) for apps used on a phone.
|
|
153
153
|
This auto-applies only to Freeday's built-in controls (button, input, combo, etc.);
|
|
154
154
|
custom/hand-built components must read `--control-h` themselves (e.g. `height: var(--control-h)`)
|
|
155
155
|
to shrink or grow when `data-density` changes.
|
|
156
|
-
-
|
|
156
|
+
- `data-style="soft|glass"` picks the visual style, `data-primary` one of 18 primary palettes, and
|
|
157
|
+
`data-neutral="slate|grey|stone"` the family of every grey. Set the last two on `<html>`; on a
|
|
158
|
+
region only beside `data-theme` (see [`USAGE.md`](USAGE.md) §0 and §5b).
|
|
157
159
|
- The breakpoint scale (`sm`/`md`/`lg`/`xl` = 600/960/1280/1920px, matching the
|
|
158
160
|
`src/components/breakpoints.css` utilities) is available to your app in both languages: `import
|
|
159
161
|
{ breakpoints } from '@cahyo-dimas/freeday/breakpoints'` for JS (`matchMedia`, utility variants),
|
package/USAGE.md
CHANGED
|
@@ -10,6 +10,75 @@ but start here, not from a blank page.
|
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
+
## 0. App identity: what the app decides
|
|
14
|
+
|
|
15
|
+
Freeday supplies components and tokens. How an app looks is the app's decision, made inside the
|
|
16
|
+
contract below. An app that changes nothing looks like the kit's docs page. That suits the docs
|
|
17
|
+
page and wastes the decision everywhere else.
|
|
18
|
+
|
|
19
|
+
The look lives in two places: the `data-*` attributes on `<html>`, and one file,
|
|
20
|
+
`app.identity.css`, loaded after the Freeday bundle.
|
|
21
|
+
|
|
22
|
+
| The app owns | Where |
|
|
23
|
+
|---|---|
|
|
24
|
+
| Palette (18), neutral (`slate`, `grey`, `stone`), style, density, default theme | `data-primary`, `data-neutral`, `data-style`, `data-density`, `data-theme` on `<html>` |
|
|
25
|
+
| Type families: `--font-display`, `--font-body`, `--font-mono` | `app.identity.css` |
|
|
26
|
+
| Weights and tracking: `--weight-*`, `--tracking-*` | `app.identity.css` |
|
|
27
|
+
| Shape: `--radius-xs` to `--radius-xl` | `app.identity.css` |
|
|
28
|
+
| Depth: `--shadow-1` to `--shadow-4`, `--shadow-lift`, `--shadow-lift-hover` | `app.identity.css`, light and dark |
|
|
29
|
+
| Motion: `--dur-*`, `--ease-*` | `app.identity.css` |
|
|
30
|
+
| One component, locally: `--fdy-<component>-<property>` | your own CSS |
|
|
31
|
+
|
|
32
|
+
Everything else is outside the kit's guarantee. You may override it, and some apps need to, but the
|
|
33
|
+
contrast gate and the kit's own tests no longer cover what you change: check the contrast yourself
|
|
34
|
+
and write down why in `DESIGN.md`. Take a sanctioned route first when one exists. Colour reaches an
|
|
35
|
+
app through the attributes, including `data-primary-fill="deep"` for a white label on a darker fill.
|
|
36
|
+
Control size has `data-density="touch"` for 44px targets. Spacing (`--space-*`) carries density, and
|
|
37
|
+
the type size scale (`--text-*`, `--leading-*`) sets control heights and table density, so a screen
|
|
38
|
+
that wants big type uses `var(--text-xl)` and up in its own content. `--radius-full`, `--bw` and the
|
|
39
|
+
focus ring are accessibility contracts, and no reason in `DESIGN.md` makes overriding them safe.
|
|
40
|
+
|
|
41
|
+
`app.identity.css` is the one file where literal values belong, and only as values of the tokens
|
|
42
|
+
in the table. Shadows need four blocks in this order, because the kit sets dark shadows in three
|
|
43
|
+
scopes and a lone `:root` rule loses to one of them in each dark mode:
|
|
44
|
+
|
|
45
|
+
```css
|
|
46
|
+
/* app.identity.css: load after @cahyo-dimas/freeday/css. Owned tokens only. */
|
|
47
|
+
:root {
|
|
48
|
+
--font-display: 'Fraunces', ui-serif, Georgia, serif;
|
|
49
|
+
--font-body: 'Inter', ui-sans-serif, system-ui, sans-serif;
|
|
50
|
+
--radius-sm: 2px;
|
|
51
|
+
--radius-md: 4px;
|
|
52
|
+
--shadow-1: 0 1px 0 rgba(0,0,0,.06);
|
|
53
|
+
}
|
|
54
|
+
@media (prefers-color-scheme: dark) {
|
|
55
|
+
:root:not([data-theme="light"]) { --shadow-1: 0 1px 0 rgba(0,0,0,.5); }
|
|
56
|
+
}
|
|
57
|
+
[data-theme="dark"] { --shadow-1: 0 1px 0 rgba(0,0,0,.5); }
|
|
58
|
+
[data-theme="light"] { --shadow-1: 0 1px 0 rgba(0,0,0,.06); }
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Fonts, radius and motion have no dark value and need only the `:root` block. The file loads its
|
|
62
|
+
own fonts. A replacement body or display font needs tabular figures (the OpenType `tnum` feature):
|
|
63
|
+
stat values, calendar days, chart values and the slider readout set `tabular-nums`, and without
|
|
64
|
+
it their digits shift as they change.
|
|
65
|
+
|
|
66
|
+
Decide before the first screen. A new app starts with a short brief in its own `DESIGN.md`,
|
|
67
|
+
then `app.identity.css`, then the attributes. Leaving an axis at its default is fine when the
|
|
68
|
+
brief says why.
|
|
69
|
+
|
|
70
|
+
```markdown
|
|
71
|
+
## Design brief
|
|
72
|
+
- Who uses this, and the one task they do most:
|
|
73
|
+
- Density: comfortable | compact, and why
|
|
74
|
+
- Mood, in three words (not "clean", "modern" or "intuitive"):
|
|
75
|
+
- Axes: data-primary=… data-neutral=… data-style=… default theme=…
|
|
76
|
+
- Type: display / body / mono, and why they suit these users
|
|
77
|
+
- Shape and depth: radius scale, shadow scale
|
|
78
|
+
- Screens and their archetype (§7b):
|
|
79
|
+
- One thing this app has that a default Freeday app does not:
|
|
80
|
+
```
|
|
81
|
+
|
|
13
82
|
## 1. Type roles: three title levels, not eleven
|
|
14
83
|
|
|
15
84
|
Do **not** reuse `.fdy-card__title` for a page title. Collapsing page/section/card into one style is
|
|
@@ -170,6 +239,21 @@ restating colours per element.
|
|
|
170
239
|
The **system** default (`@media (prefers-color-scheme: dark)`) stays root-scoped on purpose: that
|
|
171
240
|
rule is about the document, and un-rooting it would re-darken the children of a light island.
|
|
172
241
|
|
|
242
|
+
`data-primary`, `data-neutral` and `data-primary-fill="deep"` follow the same selectors, with one difference. They re-point
|
|
243
|
+
an alias ramp, and the semantic tokens resolve that ramp where they are declared: on `<html>`, or
|
|
244
|
+
on an element that carries `data-theme`. So put them on `<html>`. To re-brand or re-tint a single
|
|
245
|
+
region, put the axis on that region together with `data-theme`. Never put any of them on a bare
|
|
246
|
+
wrapper. A palette moves the label ink (`--color-on-primary`) but not the fill, so
|
|
247
|
+
orange, amber, lime, green, emerald, teal and cyan leave dark ink on the azure fill (2.87:1 for orange); a neutral moves
|
|
248
|
+
the tone inks, borders, stripe and danger border but not the surfaces. A bare `deep` wrapper applies
|
|
249
|
+
its light values in every theme, so under any dark theme (an ancestor's or the OS's) its fill and
|
|
250
|
+
strong ink are wrong: on teal, the 800 strong ink measures about 2.5:1 on the dark surface.
|
|
251
|
+
An inverted island inside an app with a non-default look must repeat `data-primary`, `data-neutral`
|
|
252
|
+
and `data-primary-fill` beside its `data-theme`; a deep island that leaves out `data-primary` inherits
|
|
253
|
+
the page palette's ink, and teal gets white on its 500 fill.
|
|
254
|
+
Otherwise the island keeps the app's fill but takes the default label ink, and white labels on
|
|
255
|
+
those fills drop to between 2:1 and 3.8:1 (lime 1.98:1 and orange 2.80:1 in a dark island).
|
|
256
|
+
|
|
173
257
|
## 6. Density: `compact` for data-dense screens
|
|
174
258
|
|
|
175
259
|
`data-density="compact"` tightens control height **and** the mid-range spacing scale
|
|
@@ -189,6 +273,14 @@ downhill; without that rule a compact root left every subtree compact and a `com
|
|
|
189
273
|
changed nothing. Do not restate the five values by hand: that copy goes stale the moment the kit
|
|
190
274
|
retunes a step.
|
|
191
275
|
|
|
276
|
+
**`touch` is for apps used on the move.** `data-density="touch"` sets the control height to 2.75rem
|
|
277
|
+
(44px), the smallest target a thumb or a gloved finger hits reliably. It changes only the control
|
|
278
|
+
height, so spacing stays whatever the surrounding density gives. Use it for a whole app used standing
|
|
279
|
+
up (a guard's phone, a warehouse scanner) or for one shell of a mixed app, and avoid `.fdy-btn--sm`
|
|
280
|
+
there: it is 36px under `touch`. A `touch` region nested inside a compact one keeps compact spacing;
|
|
281
|
+
to get touch with comfortable spacing there, put `touch` on a comfortable ancestor (or nest
|
|
282
|
+
`comfortable` first). `comfortable` resets `touch` the way it resets `compact`.
|
|
283
|
+
|
|
192
284
|
## 6b. Navigation: one component, two orientations, and never a tab role
|
|
193
285
|
|
|
194
286
|
A navigation link is an `<a class="fdy-nav__item">` marked **`aria-current="page"`**. That does not
|
|
@@ -241,7 +333,65 @@ own language; for the rest (grids, one-off spacing), pair a utility framework ru
|
|
|
241
333
|
preflight-off**, and build its theme on `var(--space-N)` so the two systems agree. See
|
|
242
334
|
`docs/getting-started.md` §Core concepts.
|
|
243
335
|
|
|
244
|
-
---
|
|
245
|
-
|
|
246
336
|
*Layout classes here live in `src/components/composition.css`. If a screen needs a primitive that
|
|
247
337
|
isn't here, it probably belongs here. Open an issue rather than re-inventing it per screen.*
|
|
338
|
+
|
|
339
|
+
## 7b. Composition: pick the screen's shape first
|
|
340
|
+
|
|
341
|
+
Decide what kind of screen this is before reaching for components. Freeday owns components and
|
|
342
|
+
tokens, not layout, so for most shapes the frame is yours and the kit fills it. This table splits
|
|
343
|
+
the work for 15 common web-app archetypes:
|
|
344
|
+
|
|
345
|
+
| # | Archetype | Freeday gives you | You build |
|
|
346
|
+
|---|---|---|---|
|
|
347
|
+
| 1 | **Dashboard / admin** | `.fdy-app` · `.fdy-page` · `.fdy-stats`/`.fdy-stat` · `.fdy-card` · `data-fdy-chart` · `.fdy-datatable` | nothing, fully covered; see [`docs/reference-screen.html`](docs/reference-screen.html) |
|
|
348
|
+
| 2 | **Master-detail** | list = `.fdy-datatable` + `.fdy-table__row--activatable`; detail = `.fdy-card` + `.fdy-dl` + `.fdy-tabs`; narrow screens = `.fdy-drawer` | the two-pane split |
|
|
349
|
+
| 3 | **Kanban board** | cards = `.fdy-card--interactive` / `--button`; labels = `.fdy-chip--tone-N`; counts = `.fdy-badge` | the column grid **and** drag-and-drop (no DnD in the kit) |
|
|
350
|
+
| 4 | **Feed / timeline** | `.fdy-timeline` (event feed) · `.fdy-card` (items) · `.fdy-avatar` · `.fdy-skeleton` while loading | the column widths |
|
|
351
|
+
| 5 | **Chat / messaging** | conversation list = `.fdy-nav`; unread = `.fdy-badge-ov`; composer = `.fdy-textarea` + `.fdy-btn`; `.fdy-avatar` | the bubbles and the scroll-to-bottom behaviour |
|
|
352
|
+
| 6 | **Canvas / whiteboard** | chrome only: `.fdy-appbar` · `.fdy-btn-group` · `.fdy-fab` · `.fdy-menu` · `.fdy-tooltip` | the canvas itself |
|
|
353
|
+
| 7 | **Calendar / scheduler** | range filter = `.fdy-daterange`; events = `.fdy-chip` / `.fdy-badge`; day detail = `.fdy-drawer` | the month grid: there is **no** calendar-view component (`.fdy-cal__grid` / `.fdy-cal__day` are datepicker internals, not public layout) |
|
|
354
|
+
| 8 | **Document editor** | `.fdy-app` shell · outline = `.fdy-tree` · `.fdy-toolbar` + `.fdy-btn-group` · `.fdy-kbd` for shortcuts | the editing surface |
|
|
355
|
+
| 9 | **Media / streaming** | tiles = `.fdy-card` · rails = `.fdy-carousel` · `.fdy-skeleton` · playback = `.fdy-progress` | the poster grid |
|
|
356
|
+
| 10 | **E-commerce account** | `.fdy-page-section` · `.fdy-dl` · orders = `.fdy-table` · status = `.fdy-badge` · `.fdy-accordion` | nothing much, mostly covered |
|
|
357
|
+
| 11 | **Analytics / BI** | `.fdy-stats` · `data-fdy-chart` (sparkline/bar/line/area/donut, palette `--chart-1`…`8`) · `.fdy-filterbar` · `.fdy-daterange` | the tile grid |
|
|
358
|
+
| 12 | **Point of sale** | `.fdy-app--nav-collapsed` for screen space · product tiles = `.fdy-card--button` · cart = `.fdy-table` + `.fdy-table__num` · totals = `.fdy-stat` · `.fdy-fab` to pay · `data-density="compact"` | the two-column till layout |
|
|
359
|
+
| 13 | **Wizard / multi-step** | `.fdy-stepper` · `.fdy-step-panels` · `.fdy-step-nav` · `.fdy-form-grid` | nothing, fully covered |
|
|
360
|
+
| 14 | **File manager** | folders = `.fdy-tree` · upload = `.fdy-dropzone` + `.fdy-filelist` + `.fdy-file` · actions = `.fdy-menu` · `.fdy-breadcrumb` | the icon grid |
|
|
361
|
+
| 15 | **Community / forum** | threads = `.fdy-card` · `.fdy-avatar--tone-N` · tags = `.fdy-chip` · `.fdy-pagination` · replies = `.fdy-timeline` | the thread list layout |
|
|
362
|
+
|
|
363
|
+
If a shape needs something the kit has no component for, build the shape and fill it with kit
|
|
364
|
+
components. Never invent an `fdy-` class for it; the complete list is `COMPONENTS.md`.
|
|
365
|
+
|
|
366
|
+
Three habits make every app look like the same template, so avoid them:
|
|
367
|
+
|
|
368
|
+
- **A stats row on top of every screen.** `.fdy-stats` belongs on a screen whose job is the
|
|
369
|
+
numbers. On a list or a form it pushes the work below the fold.
|
|
370
|
+
- **A page that is a grid of identical cards.** See §3: one raised element that matters, the rest
|
|
371
|
+
flat.
|
|
372
|
+
- **A sidebar for a handful of destinations.** An app with only a few places to go reads better
|
|
373
|
+
with `.fdy-nav.fdy-nav--horizontal` in the app bar (§6b), and gets the width back.
|
|
374
|
+
|
|
375
|
+
## 8. Mobile: the phone is its own layout
|
|
376
|
+
|
|
377
|
+
A phone gets its own layout. Most of these rules already live in COMPONENTS.md; they are collected
|
|
378
|
+
here because apps miss them.
|
|
379
|
+
|
|
380
|
+
- **Navigation.** A bottom nav (`.fdy-bottomnav`) carries three to five destinations, chosen by role.
|
|
381
|
+
Everything else goes behind an account or "More" item. Labels are required.
|
|
382
|
+
- **Lists, not tables.** Below `md`, a table becomes a `.fdy-list` (COMPONENTS.md, List). A row is
|
|
383
|
+
one tap target that opens its detail. Row actions move into a `.fdy-menu` behind a "..." button or
|
|
384
|
+
onto the detail screen; a column of stacked buttons makes one row as tall as the screen.
|
|
385
|
+
- **The primary action stays in reach.** Put it in `.fdy-actionbar`, which stays on screen as
|
|
386
|
+
the page scrolls. A `.fdy-fab--extended` works too, but the app positions it (above `--fdy-bottomnav-h`
|
|
387
|
+
when there is a bottom nav); the kit does not.
|
|
388
|
+
- **One frame.** The page header is not wrapped in a card on a phone, because the screen already is
|
|
389
|
+
the frame.
|
|
390
|
+
- **Drop the views a phone cannot use.** A list/box/grid switch shows only list (and box, if it
|
|
391
|
+
reads) below `md`.
|
|
392
|
+
- **Say where the user is.** A multi-tenant app (several sites, clusters or companies) shows the
|
|
393
|
+
current one as a chip in the topbar, with the switch beside it.
|
|
394
|
+
- **Size targets for the way the app is held.** An app used standing up or on the move sets
|
|
395
|
+
`data-density="touch"` (§6), per app or per shell.
|
|
396
|
+
|
|
397
|
+
---
|