@cahyo-dimas/freeday 3.4.0 → 3.5.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 +43 -0
- package/COMPONENTS.md +27 -4
- package/README.id.md +9 -5
- package/README.md +9 -5
- package/dist/freeday.bundle.css +15 -2
- package/dist/freeday.css +15 -2
- package/dist/freeday.media.css +27 -0
- package/docs/agent-onboarding.md +2 -0
- package/docs/getting-started.md +1 -1
- package/package.json +5 -1
- package/src/components/breakpoints.css +7 -1
- package/src/components/filterbar.css +8 -1
- package/tokens/breakpoints.d.ts +4 -0
- package/tokens/breakpoints.mjs +22 -8
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,49 @@ 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.5.0] - 2026-09-15
|
|
13
|
+
|
|
14
|
+
**Sebuah angka yang hanya bisa ditemukan dengan membaca stylesheet kit.** `#058` (dari
|
|
15
|
+
`IDU_AI_DOC_SAPB1_CLIENT` dan `IDU_AI_DOC_SAAS`, satu sapuan atas dua konsol) datang dari audit yang
|
|
16
|
+
hasilnya nyaris bersih: tipografi, spasi dan warna tak menyisakan satu pun nilai mentah. Yang tersisa
|
|
17
|
+
cuma media query — dan di situlah dua hal yang sama-sama berakar pada satu kenyataan CSS: `@media`
|
|
18
|
+
tak bisa membaca custom property.
|
|
19
|
+
|
|
20
|
+
Akibatnya angka breakpoint kit hanya hidup sebagai literal, app mengetik ulang literal itu, dan
|
|
21
|
+
literal yang diketik ulang hanyut. Dua konsol itu menuliskan satu lebar yang sama dengan tiga cara
|
|
22
|
+
(`640px`, `40rem`, `45rem`) untuk satu maksud yang sama.
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
- **`@cahyo-dimas/freeday/media`** — berkas `@custom-media` (`dist/freeday.media.css`), jawaban
|
|
26
|
+
sisi-CSS untuk apa yang selama ini hanya dijawab `tokens/breakpoints.mjs` di sisi JS. App menulis
|
|
27
|
+
`@media (--fdy-below-sm)` atau `@media (--fdy-filterbar-stacked)`, bukan literal yang diketik
|
|
28
|
+
ulang, dan karenanya tak bisa hanyut.
|
|
29
|
+
Isinya `--fdy-below-*` / `--fdy-from-*` untuk ramp (`sm`·`md`·`lg`·`xl`), plus `--fdy-nav-drawer`,
|
|
30
|
+
`--fdy-nav-static` dan `--fdy-filterbar-stacked` untuk dua lebar yang bukan anak tangga ramp.
|
|
31
|
+
**Opt-in, dan tak mengubah apa pun bagi yang tidak memakainya:** `@custom-media` adalah transform
|
|
32
|
+
PostCSS (`postcss-custom-media`, sudah termasuk di `postcss-preset-env`), jadi app ber-Vite
|
|
33
|
+
mendapatkannya cuma-cuma dan app tanpa PostCSS tetap menulis literal seperti kemarin. Berkas ini
|
|
34
|
+
**tidak** ikut `freeday.css` maupun `freeday.bundle.css` — at-rule waktu-build tak punya urusan di
|
|
35
|
+
stylesheet yang dimuat tiap app — dan tak membawa satu rule pun, jadi meng-import-nya tak berbiaya
|
|
36
|
+
saat runtime.
|
|
37
|
+
Di-**generate** dari objek yang sama yang diekspor sisi JS, jadi kedua paruh skala itu tak mungkin
|
|
38
|
+
berbeda pendapat; yang menjaganya agar tetap sama dengan CSS yang dideskripsikannya adalah dua tes
|
|
39
|
+
baru di `test/docs.test.mjs`, diverifikasi dengan mutasi.
|
|
40
|
+
- **`breakpoints.filterbar` (640)** — lebar tempat `.fdy-filterbar` menumpuk fieldnya jadi selebar
|
|
41
|
+
penuh, kini bernama, bukan cuma tertulis di `filterbar.css:45`.
|
|
42
|
+
|
|
43
|
+
### Changed
|
|
44
|
+
- **640 tetap 640, tapi berhenti jadi angka siluman.** Ia bukan anak tangga ramp (`sm` = 600) dan
|
|
45
|
+
sengaja tidak dipindahkan: 640 adalah lebar telepon-lanskap yang nyata, dan menggesernya akan
|
|
46
|
+
me-reflow setiap filter bar di setiap app. Yang salah bukan angkanya, melainkan bahwa satu-satunya
|
|
47
|
+
cara menemukannya adalah membaca stylesheet kit lalu mempercayai sumber di atas dokumentasi.
|
|
48
|
+
Menyelaraskan rule app ke `sm` — hal yang wajar dilakukan dari dokumentasi saja — merusak
|
|
49
|
+
600–640px: fieldnya sudah ditumpuk kit sementara app masih membatasi lebar field `--w-grow`-nya,
|
|
50
|
+
sehingga field itu terlihat lebih sempit dari tetangganya di tumpukan.
|
|
51
|
+
Header `breakpoints.css`, komentar `filterbar.css`, `COMPONENTS.md` dan kedua README kini menyebut
|
|
52
|
+
`nav` **dan** `filterbar` sebagai dua lebar yang bukan ramp, lengkap dengan pita px yang rusak
|
|
53
|
+
kalau dibulatkan ke anak tangga terdekat.
|
|
54
|
+
|
|
12
55
|
## [3.4.0] - 2026-09-07
|
|
13
56
|
|
|
14
57
|
**Tiga hal yang hanya terlihat setelah sebuah app bertemu telepon sungguhan.** `#057` (dari
|
package/COMPONENTS.md
CHANGED
|
@@ -313,10 +313,33 @@ Responsive display: `.fdy-hide-below-sm|md|lg` · `.fdy-hide-above-sm|md|lg`.
|
|
|
313
313
|
Breakpoints (min-width): `sm` 600 · `md` 960 · `lg` 1280 · `xl` 1920, importable as
|
|
314
314
|
`import { breakpoints } from '@cahyo-dimas/freeday/breakpoints'`.
|
|
315
315
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
316
|
+
**Two widths in that object are not ramp steps**, and each is the one to use when your rule has to
|
|
317
|
+
fire with a kit rule. Aligning either to the nearest ramp step leaves a band of broken widths, in
|
|
318
|
+
which the kit has already switched and your app has not:
|
|
319
|
+
|
|
320
|
+
| | px | Governs | Aligning to the ramp instead breaks |
|
|
321
|
+
|---|---|---|---|
|
|
322
|
+
| `breakpoints.nav` | 721 | `.fdy-app` switches the sidebar from off-canvas drawer to static column — and `.fdy-app__main`'s padding step and `.fdy-bottomnav` ride the same width | 721–959px, if you use `md`: sidebar already static while your script still treats it as an overlay |
|
|
323
|
+
| `breakpoints.filterbar` | 640 | `.fdy-filterbar` stacks every field full-width | 600–640px, if you use `sm`: fields already stacked while your rule still caps the `--w-grow` one, so it sits visibly narrower than the fields under it |
|
|
324
|
+
|
|
325
|
+
**In CSS, import the breakpoints instead of retyping them.** `@media` cannot read a custom property,
|
|
326
|
+
so there is no `--breakpoint-*` token and never will be; `@cahyo-dimas/freeday/media` answers it the
|
|
327
|
+
only way CSS can, as a `@custom-media` sheet:
|
|
328
|
+
|
|
329
|
+
```css
|
|
330
|
+
@import '@cahyo-dimas/freeday/media'; /* once, above the rules that use it */
|
|
331
|
+
|
|
332
|
+
@media (--fdy-filterbar-stacked) { .page-filters > .fdy-field--w-grow { max-width: none } }
|
|
333
|
+
@media (--fdy-nav-drawer) { .page-banner { padding-inline: var(--space-5) } }
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
Declared: `--fdy-below-sm|md|lg|xl` and `--fdy-from-sm|md|lg|xl` (the ramp, matching the utilities
|
|
337
|
+
above), plus `--fdy-nav-drawer` / `--fdy-nav-static` and `--fdy-filterbar-stacked` for the two
|
|
338
|
+
widths in the table. It is **opt-in**: `@custom-media` is a PostCSS transform
|
|
339
|
+
(`postcss-custom-media`, included in `postcss-preset-env`), so an app that runs PostCSS — anything on
|
|
340
|
+
Vite already does — gets it, and an app that does not keeps writing literals exactly as before. The
|
|
341
|
+
sheet carries no rules, so importing it costs nothing at runtime, and it is deliberately not part of
|
|
342
|
+
`freeday.css` or `freeday.bundle.css`.
|
|
320
343
|
|
|
321
344
|
**Visual style: `data-style="soft | glass"`.** `soft` is the default and the look the kit has always
|
|
322
345
|
had; `glass` frosts the **raised** surfaces — card, modal, drawer, menu, appbar, the app shell's
|
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.5.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`.
|
|
@@ -60,7 +60,7 @@ npm i @cahyo-dimas/freeday
|
|
|
60
60
|
```js
|
|
61
61
|
import '@cahyo-dimas/freeday/css'; // token + komponen (satu file)
|
|
62
62
|
import '@cahyo-dimas/freeday'; // semua enhancer JS (auto-init [data-fdy-*])
|
|
63
|
-
// granular bila perlu: '@cahyo-dimas/freeday/tokens' · '@cahyo-dimas/freeday/css/components' · '@cahyo-dimas/freeday/enhancers/<nama>'
|
|
63
|
+
// granular bila perlu: '@cahyo-dimas/freeday/tokens' · '@cahyo-dimas/freeday/css/components' · '@cahyo-dimas/freeday/enhancers/<nama>' · '@cahyo-dimas/freeday/media' (breakpoint @custom-media)
|
|
64
64
|
```
|
|
65
65
|
Set tema di root app: `<html data-theme="light" data-density="comfortable">`. `dist/` di-commit &
|
|
66
66
|
ter-publish → install tanpa build step; minify diserahkan ke bundler konsumen. Karena terbit di
|
|
@@ -153,9 +153,13 @@ container-nya, bukan scroll sendiri.
|
|
|
153
153
|
menyusut/melebar saat `data-density` berubah.
|
|
154
154
|
- (roadmap) `data-style` untuk varian visual lain.
|
|
155
155
|
- Skala breakpoint (`sm`/`md`/`lg`/`xl` = 600/960/1280/1920px, sama dengan utilitas
|
|
156
|
-
`src/components/breakpoints.css`)
|
|
157
|
-
'@cahyo-dimas/freeday/breakpoints'
|
|
158
|
-
|
|
156
|
+
`src/components/breakpoints.css`) tersedia untuk app-mu dalam dua bahasa: `import { breakpoints }
|
|
157
|
+
from '@cahyo-dimas/freeday/breakpoints'` untuk JS (`matchMedia`, varian utility), dan `@import
|
|
158
|
+
'@cahyo-dimas/freeday/media'` untuk CSS, yang mendeklarasikan tiap lebar sebagai `@custom-media`
|
|
159
|
+
sehingga sebuah rule ditulis `@media (--fdy-below-sm)`, bukan literal yang diketik ulang (butuh
|
|
160
|
+
PostCSS; opt-in). Objeknya juga membawa dua lebar yang **bukan** anak tangga ramp dan tak boleh
|
|
161
|
+
dibulatkan ke salah satunya: `nav` (721, saklar drawer↔sidebar milik shell) dan `filterbar` (640,
|
|
162
|
+
tempat `.fdy-filterbar` menumpuk). Lihat [`COMPONENTS.md`](COMPONENTS.md) untuk apa yang diaturnya.
|
|
159
163
|
|
|
160
164
|
## Integrasi framework (SPA)
|
|
161
165
|
> **Peta library lengkap:** [`docs/integrations.md`](docs/integrations.md). Tiap area
|
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.5.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`.
|
|
@@ -61,7 +61,7 @@ npm i @cahyo-dimas/freeday
|
|
|
61
61
|
```js
|
|
62
62
|
import '@cahyo-dimas/freeday/css'; // tokens + components (single file)
|
|
63
63
|
import '@cahyo-dimas/freeday'; // all JS enhancers (auto-init [data-fdy-*])
|
|
64
|
-
// granular if needed: '@cahyo-dimas/freeday/tokens' · '@cahyo-dimas/freeday/css/components' · '@cahyo-dimas/freeday/enhancers/<name>'
|
|
64
|
+
// granular if needed: '@cahyo-dimas/freeday/tokens' · '@cahyo-dimas/freeday/css/components' · '@cahyo-dimas/freeday/enhancers/<name>' · '@cahyo-dimas/freeday/media' (@custom-media breakpoints)
|
|
65
65
|
```
|
|
66
66
|
Set the theme on your app root: `<html data-theme="light" data-density="comfortable">`. `dist/` is
|
|
67
67
|
committed and published, so install needs **no build step**; minification is left to the consumer's
|
|
@@ -154,9 +154,13 @@ of scrolling.
|
|
|
154
154
|
to shrink or grow when `data-density` changes.
|
|
155
155
|
- (roadmap) `data-style` for alternative visual variants.
|
|
156
156
|
- The breakpoint scale (`sm`/`md`/`lg`/`xl` = 600/960/1280/1920px, matching the
|
|
157
|
-
`src/components/breakpoints.css` utilities) is
|
|
158
|
-
'@cahyo-dimas/freeday/breakpoints'
|
|
159
|
-
|
|
157
|
+
`src/components/breakpoints.css` utilities) is available to your app in both languages: `import
|
|
158
|
+
{ breakpoints } from '@cahyo-dimas/freeday/breakpoints'` for JS (`matchMedia`, utility variants),
|
|
159
|
+
and `@import '@cahyo-dimas/freeday/media'` for CSS, which declares each one as a `@custom-media`
|
|
160
|
+
so a rule reads `@media (--fdy-below-sm)` instead of a retyped literal (needs PostCSS; opt-in).
|
|
161
|
+
The object also carries the two widths that are **not** ramp steps and must not be rounded to one:
|
|
162
|
+
`nav` (721, the shell's drawer↔sidebar switch) and `filterbar` (640, where `.fdy-filterbar`
|
|
163
|
+
stacks). See [`COMPONENTS.md`](COMPONENTS.md) for what each governs.
|
|
160
164
|
|
|
161
165
|
## Framework integration (SPA)
|
|
162
166
|
> **Full library map:** [`docs/integrations.md`](docs/integrations.md). Each area (forms/validation,
|
package/dist/freeday.bundle.css
CHANGED
|
@@ -1290,8 +1290,14 @@ a { color: var(--color-primary); }
|
|
|
1290
1290
|
|
|
1291
1291
|
/* Freeday. Responsive display utilities (pairs with freeday-breakpoint.js).
|
|
1292
1292
|
* Breakpoint scale (min-width, px): sm 600 · md 960 · lg 1280 · xl 1920.
|
|
1293
|
+
* Two further widths exist and are NOT ramp steps: `nav` (app-shell.css, off-canvas drawer vs
|
|
1294
|
+
* static sidebar) and `filterbar` (filterbar.css, the width its fields stack at). Both are named
|
|
1295
|
+
* in tokens/breakpoints.mjs; a rule that has to fire with one of them aligns to it, not to the
|
|
1296
|
+
* nearest ramp step, which is a band of broken widths in both directions.
|
|
1293
1297
|
* NOTE: media-query breakpoints must be literal. CSS can't read custom properties
|
|
1294
|
-
* inside @media, so these px are structural, not stray magic numbers.
|
|
1298
|
+
* inside @media, so these px are structural, not stray magic numbers. An app that runs PostCSS
|
|
1299
|
+
* need not retype them: `@cahyo-dimas/freeday/media` declares every width above as a
|
|
1300
|
+
* @custom-media, so it can write `@media (--fdy-below-sm)` and never drift (#058 §2). */
|
|
1295
1301
|
.fdy-hidden{display:none !important;}
|
|
1296
1302
|
|
|
1297
1303
|
/* hide-below-X, hidden when the viewport is narrower than X (content shows at X and up) */
|
|
@@ -2077,7 +2083,14 @@ a { color: var(--color-primary); }
|
|
|
2077
2083
|
/* Opt-in: sit the actions inline right after the last field instead of at the far edge, so when the
|
|
2078
2084
|
* bar wraps they read as attached to the filters rather than shoved to the right of a lonely row. */
|
|
2079
2085
|
.fdy-filterbar--actions-inline .fdy-filterbar__actions{margin-left:0;}
|
|
2080
|
-
/* Stack on narrow screens so nothing overflows the row.
|
|
2086
|
+
/* Stack on narrow screens so nothing overflows the row.
|
|
2087
|
+
* 640 is deliberately not a ramp step (sm is 600): it is a real phone-landscape width, and moving
|
|
2088
|
+
* it now would reflow every filter bar in every consuming app. So it is NAMED instead — `filterbar`
|
|
2089
|
+
* in tokens/breakpoints.mjs, `--fdy-filterbar-stacked` in the media sheet — because an app rule
|
|
2090
|
+
* that must fire with the stack (releasing a --w-grow field's max-width, say) has to match this
|
|
2091
|
+
* exact condition, and aligning it to sm from the docs alone leaves 600–640px half-stacked: the
|
|
2092
|
+
* fields are already full width while the app still caps the growing one. Raised from
|
|
2093
|
+
* IDU_AI_DOC_SAPB1_CLIENT and IDU_AI_DOC_SAAS (#058 §1). */
|
|
2081
2094
|
@media (max-width:640px){
|
|
2082
2095
|
.fdy-filterbar>.fdy-field,.fdy-filterbar>.fdy-field--w-sm,.fdy-filterbar>.fdy-field--w-lg,.fdy-filterbar>.fdy-field--w-xl,.fdy-filterbar>.fdy-field--w-2xl,.fdy-filterbar>.fdy-field--w-grow{width:100%;flex:1 1 100%;}
|
|
2083
2096
|
.fdy-filterbar__actions{width:100%;margin-left:0;}
|
package/dist/freeday.css
CHANGED
|
@@ -412,8 +412,14 @@ a { color: var(--color-primary); }
|
|
|
412
412
|
|
|
413
413
|
/* Freeday. Responsive display utilities (pairs with freeday-breakpoint.js).
|
|
414
414
|
* Breakpoint scale (min-width, px): sm 600 · md 960 · lg 1280 · xl 1920.
|
|
415
|
+
* Two further widths exist and are NOT ramp steps: `nav` (app-shell.css, off-canvas drawer vs
|
|
416
|
+
* static sidebar) and `filterbar` (filterbar.css, the width its fields stack at). Both are named
|
|
417
|
+
* in tokens/breakpoints.mjs; a rule that has to fire with one of them aligns to it, not to the
|
|
418
|
+
* nearest ramp step, which is a band of broken widths in both directions.
|
|
415
419
|
* NOTE: media-query breakpoints must be literal. CSS can't read custom properties
|
|
416
|
-
* inside @media, so these px are structural, not stray magic numbers.
|
|
420
|
+
* inside @media, so these px are structural, not stray magic numbers. An app that runs PostCSS
|
|
421
|
+
* need not retype them: `@cahyo-dimas/freeday/media` declares every width above as a
|
|
422
|
+
* @custom-media, so it can write `@media (--fdy-below-sm)` and never drift (#058 §2). */
|
|
417
423
|
.fdy-hidden{display:none !important;}
|
|
418
424
|
|
|
419
425
|
/* hide-below-X, hidden when the viewport is narrower than X (content shows at X and up) */
|
|
@@ -1199,7 +1205,14 @@ a { color: var(--color-primary); }
|
|
|
1199
1205
|
/* Opt-in: sit the actions inline right after the last field instead of at the far edge, so when the
|
|
1200
1206
|
* bar wraps they read as attached to the filters rather than shoved to the right of a lonely row. */
|
|
1201
1207
|
.fdy-filterbar--actions-inline .fdy-filterbar__actions{margin-left:0;}
|
|
1202
|
-
/* Stack on narrow screens so nothing overflows the row.
|
|
1208
|
+
/* Stack on narrow screens so nothing overflows the row.
|
|
1209
|
+
* 640 is deliberately not a ramp step (sm is 600): it is a real phone-landscape width, and moving
|
|
1210
|
+
* it now would reflow every filter bar in every consuming app. So it is NAMED instead — `filterbar`
|
|
1211
|
+
* in tokens/breakpoints.mjs, `--fdy-filterbar-stacked` in the media sheet — because an app rule
|
|
1212
|
+
* that must fire with the stack (releasing a --w-grow field's max-width, say) has to match this
|
|
1213
|
+
* exact condition, and aligning it to sm from the docs alone leaves 600–640px half-stacked: the
|
|
1214
|
+
* fields are already full width while the app still caps the growing one. Raised from
|
|
1215
|
+
* IDU_AI_DOC_SAPB1_CLIENT and IDU_AI_DOC_SAAS (#058 §1). */
|
|
1203
1216
|
@media (max-width:640px){
|
|
1204
1217
|
.fdy-filterbar>.fdy-field,.fdy-filterbar>.fdy-field--w-sm,.fdy-filterbar>.fdy-field--w-lg,.fdy-filterbar>.fdy-field--w-xl,.fdy-filterbar>.fdy-field--w-2xl,.fdy-filterbar>.fdy-field--w-grow{width:100%;flex:1 1 100%;}
|
|
1205
1218
|
.fdy-filterbar__actions{width:100%;margin-left:0;}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/* Freeday breakpoints as @custom-media. GENERATED by tokens/build.mjs. Do not edit by hand.
|
|
2
|
+
*
|
|
3
|
+
* Requires postcss-custom-media (or any PostCSS setup that includes postcss-preset-env); without it
|
|
4
|
+
* a browser ignores the at-rules and every @media (--fdy-*) in your CSS never matches. Import it
|
|
5
|
+
* ONCE, above the rules that use it:
|
|
6
|
+
*
|
|
7
|
+
* @import '@cahyo-dimas/freeday/media';
|
|
8
|
+
* @media (--fdy-below-sm) { .page-header { display: block } }
|
|
9
|
+
*
|
|
10
|
+
* This file carries no rules of its own, so importing it costs nothing at runtime; it is not part
|
|
11
|
+
* of freeday.css or freeday.bundle.css. */
|
|
12
|
+
@custom-media --fdy-below-sm (max-width: 599.98px);
|
|
13
|
+
@custom-media --fdy-from-sm (min-width: 600px);
|
|
14
|
+
@custom-media --fdy-below-md (max-width: 959.98px);
|
|
15
|
+
@custom-media --fdy-from-md (min-width: 960px);
|
|
16
|
+
@custom-media --fdy-below-lg (max-width: 1279.98px);
|
|
17
|
+
@custom-media --fdy-from-lg (min-width: 1280px);
|
|
18
|
+
@custom-media --fdy-below-xl (max-width: 1919.98px);
|
|
19
|
+
@custom-media --fdy-from-xl (min-width: 1920px);
|
|
20
|
+
|
|
21
|
+
/* NOT ramp steps. Each mirrors one hard-wired rule in the kit, and a rule that must fire with it
|
|
22
|
+
* uses THIS condition, never the nearest ramp step: aligning shell-dependent code to --fdy-below-md
|
|
23
|
+
* leaves 721–959px broken, and aligning a filter-bar rule to --fdy-below-sm leaves 600–640px
|
|
24
|
+
* half-stacked. See tokens/breakpoints.mjs for what each one governs. */
|
|
25
|
+
@custom-media --fdy-nav-drawer (max-width: 720px);
|
|
26
|
+
@custom-media --fdy-nav-static (min-width: 721px);
|
|
27
|
+
@custom-media --fdy-filterbar-stacked (max-width: 640px);
|
package/docs/agent-onboarding.md
CHANGED
|
@@ -96,6 +96,7 @@ Blazor). Then verify the agent can actually read those files. An agent that can'
|
|
|
96
96
|
| `docs/agent-onboarding.md` | This file. |
|
|
97
97
|
| `CHANGELOG.md` | **What changed between the version this project had and the one it has now.** Read it after every upgrade; each entry says what broke, what is new, and why. |
|
|
98
98
|
| `dist/` | Built CSS + enhancers. **`freeday.bundle.css` = tokens + components** (what `@cahyo-dimas/freeday/css` resolves to); `freeday.css` is components **only**, `freeday.tokens.css` tokens only, so linking `freeday.css` alone leaves every `var(--…)` unresolved. Plus `freeday-*.js` and the `.d.ts` files. |
|
|
99
|
+
| `dist/freeday.media.css` | The breakpoints as `@custom-media` (`@cahyo-dimas/freeday/media`), so a responsive rule in your CSS states the kit's condition instead of a retyped literal. Needs PostCSS; carries no rules, and is **not** in the bundle. |
|
|
99
100
|
| `src/components/*.css` | The authoritative source for every class, when a doc is ambiguous. |
|
|
100
101
|
| `tokens/tokens.json` | Every token in W3C DTCG format, machine-readable. |
|
|
101
102
|
| `adapters/vue` · `adapters/react` · `adapters/blazor` | Typed wrappers, 11 components each (plus `FdyTableFooter`). |
|
|
@@ -138,6 +139,7 @@ Recent additions most likely to replace something an app hand-rolled (all detail
|
|
|
138
139
|
| `.fdy-field--full` | `max-width: none` on the form container, once per form, because the fields are a flex column and not a `.fdy-form-grid` |
|
|
139
140
|
| `.fdy-nav--flat` | undoing the caret, the pointer cursor and the group divider yourself, on a sidebar whose group labels never collapse |
|
|
140
141
|
| `--fdy-app-sidebar-w` | overriding `width` on `.fdy-app__sidebar`, which is also the rule that animates the collapse |
|
|
142
|
+
| `@media (--fdy-filterbar-stacked)` / `(--fdy-nav-drawer)`, from `@cahyo-dimas/freeday/media` | a literal `640px` or `720px` retyped into your stylesheet, which no longer matches the kit's rule the day the kit retunes it — and which you could only have found by reading `filterbar.css` |
|
|
141
143
|
|
|
142
144
|
## 3. Starting a new screen
|
|
143
145
|
|
package/docs/getting-started.md
CHANGED
|
@@ -191,7 +191,7 @@ live docs also have a copy button per component.
|
|
|
191
191
|
```bash
|
|
192
192
|
npm i @cahyo-dimas/freeday
|
|
193
193
|
```
|
|
194
|
-
Lands in `package.json` as `"@cahyo-dimas/freeday": "^3.
|
|
194
|
+
Lands in `package.json` as `"@cahyo-dimas/freeday": "^3.5.0"` (public npm package). `dist/` is
|
|
195
195
|
committed and published → no build step; `npm ci` runs without auth.
|
|
196
196
|
|
|
197
197
|
### 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.
|
|
3
|
+
"version": "3.5.0",
|
|
4
4
|
"description": "Freeday: token-driven, framework-agnostic UI KIT (design source-of-truth).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -54,6 +54,10 @@
|
|
|
54
54
|
"types": "./dist/asset.d.ts",
|
|
55
55
|
"default": "./dist/freeday.tokens.css"
|
|
56
56
|
},
|
|
57
|
+
"./media": {
|
|
58
|
+
"types": "./dist/asset.d.ts",
|
|
59
|
+
"default": "./dist/freeday.media.css"
|
|
60
|
+
},
|
|
57
61
|
"./breakpoints": {
|
|
58
62
|
"types": "./tokens/breakpoints.d.ts",
|
|
59
63
|
"default": "./tokens/breakpoints.mjs"
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
/* Freeday. Responsive display utilities (pairs with freeday-breakpoint.js).
|
|
2
2
|
* Breakpoint scale (min-width, px): sm 600 · md 960 · lg 1280 · xl 1920.
|
|
3
|
+
* Two further widths exist and are NOT ramp steps: `nav` (app-shell.css, off-canvas drawer vs
|
|
4
|
+
* static sidebar) and `filterbar` (filterbar.css, the width its fields stack at). Both are named
|
|
5
|
+
* in tokens/breakpoints.mjs; a rule that has to fire with one of them aligns to it, not to the
|
|
6
|
+
* nearest ramp step, which is a band of broken widths in both directions.
|
|
3
7
|
* NOTE: media-query breakpoints must be literal. CSS can't read custom properties
|
|
4
|
-
* inside @media, so these px are structural, not stray magic numbers.
|
|
8
|
+
* inside @media, so these px are structural, not stray magic numbers. An app that runs PostCSS
|
|
9
|
+
* need not retype them: `@cahyo-dimas/freeday/media` declares every width above as a
|
|
10
|
+
* @custom-media, so it can write `@media (--fdy-below-sm)` and never drift (#058 §2). */
|
|
5
11
|
.fdy-hidden{display:none !important;}
|
|
6
12
|
|
|
7
13
|
/* hide-below-X, hidden when the viewport is narrower than X (content shows at X and up) */
|
|
@@ -41,7 +41,14 @@
|
|
|
41
41
|
/* Opt-in: sit the actions inline right after the last field instead of at the far edge, so when the
|
|
42
42
|
* bar wraps they read as attached to the filters rather than shoved to the right of a lonely row. */
|
|
43
43
|
.fdy-filterbar--actions-inline .fdy-filterbar__actions{margin-left:0;}
|
|
44
|
-
/* Stack on narrow screens so nothing overflows the row.
|
|
44
|
+
/* Stack on narrow screens so nothing overflows the row.
|
|
45
|
+
* 640 is deliberately not a ramp step (sm is 600): it is a real phone-landscape width, and moving
|
|
46
|
+
* it now would reflow every filter bar in every consuming app. So it is NAMED instead — `filterbar`
|
|
47
|
+
* in tokens/breakpoints.mjs, `--fdy-filterbar-stacked` in the media sheet — because an app rule
|
|
48
|
+
* that must fire with the stack (releasing a --w-grow field's max-width, say) has to match this
|
|
49
|
+
* exact condition, and aligning it to sm from the docs alone leaves 600–640px half-stacked: the
|
|
50
|
+
* fields are already full width while the app still caps the growing one. Raised from
|
|
51
|
+
* IDU_AI_DOC_SAPB1_CLIENT and IDU_AI_DOC_SAAS (#058 §1). */
|
|
45
52
|
@media (max-width:640px){
|
|
46
53
|
.fdy-filterbar>.fdy-field,.fdy-filterbar>.fdy-field--w-sm,.fdy-filterbar>.fdy-field--w-lg,.fdy-filterbar>.fdy-field--w-xl,.fdy-filterbar>.fdy-field--w-2xl,.fdy-filterbar>.fdy-field--w-grow{width:100%;flex:1 1 100%;}
|
|
47
54
|
.fdy-filterbar__actions{width:100%;margin-left:0;}
|
package/tokens/breakpoints.d.ts
CHANGED
|
@@ -4,6 +4,10 @@ export declare const breakpoints: {
|
|
|
4
4
|
/** Width at which .fdy-app's sidebar turns from off-canvas drawer into a static column.
|
|
5
5
|
* Not part of the sm/md/lg/xl ramp; it mirrors app-shell.css and nothing else. */
|
|
6
6
|
nav: number;
|
|
7
|
+
/** Width at or below which .fdy-filterbar stacks every field full-width.
|
|
8
|
+
* Not part of the sm/md/lg/xl ramp; it mirrors filterbar.css and nothing else. A rule that
|
|
9
|
+
* must fire with the stack uses this, not `sm` — `sm` leaves 600–640px half-stacked. */
|
|
10
|
+
filterbar: number;
|
|
7
11
|
sm: number;
|
|
8
12
|
md: number;
|
|
9
13
|
lg: number;
|
package/tokens/breakpoints.mjs
CHANGED
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
// Freeday breakpoint scale in px, mirrors src/components/breakpoints.css utilities
|
|
2
2
|
// (sm/md/lg/xl). CSS @media can't read custom properties, so this is the JS-side
|
|
3
|
-
// source of the scale for matchMedia / app @media alignment.
|
|
3
|
+
// source of the scale for matchMedia / app @media alignment. The CSS-side answer to the
|
|
4
|
+
// same problem is dist/freeday.media.css (`@cahyo-dimas/freeday/media`), a @custom-media
|
|
5
|
+
// sheet GENERATED from this object, so the two halves cannot disagree.
|
|
4
6
|
//
|
|
5
|
-
// `nav`
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
|
|
7
|
+
// `nav` and `filterbar` are not part of the sm/md/lg/xl ramp. Each mirrors one hard-wired rule in
|
|
8
|
+
// the kit, and each must be used INSTEAD of the nearest ramp step — that is the whole reason they
|
|
9
|
+
// are named here rather than left to be discovered by reading the stylesheet.
|
|
10
|
+
//
|
|
11
|
+
// `nav` is the width at which .fdy-app switches the sidebar from an off-canvas drawer (below) to a
|
|
12
|
+
// static column (at and above), hard-wired in src/components/app-shell.css. Anything that has to
|
|
13
|
+
// agree with the shell, a matchMedia guard deciding whether the nav toggle sets --nav-open or
|
|
14
|
+
// --nav-collapsed, a utility-framework variant, must use THIS number, not md. Aligning such code to
|
|
15
|
+
// md (960) leaves 721–959px broken: the sidebar is already static while the script still thinks it
|
|
16
|
+
// is an overlay.
|
|
17
|
+
//
|
|
18
|
+
// `filterbar` is the width at which .fdy-filterbar stacks every field full-width, hard-wired in
|
|
19
|
+
// src/components/filterbar.css. It is deliberately not sm: 640 is a real phone-landscape width and
|
|
20
|
+
// moving it would reflow every filter bar in every consuming app. An app rule that has to fire in
|
|
21
|
+
// lockstep with the stack — releasing a growing field's max-width, say — must use THIS number.
|
|
22
|
+
// Aligning it to sm (600) leaves 600–640px broken: the kit has already stacked the fields while the
|
|
23
|
+
// app still caps one of them, so it sits visibly narrower than the fields under it. Raised from
|
|
24
|
+
// IDU_AI_DOC_SAPB1_CLIENT and IDU_AI_DOC_SAAS (#058 §1).
|
|
25
|
+
export const breakpoints = { nav: 721, filterbar: 640, sm: 600, md: 960, lg: 1280, xl: 1920 };
|