fold-ng 0.6.0 → 0.7.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
@@ -8,6 +8,100 @@ All notable changes to **fold-ng** are documented here. The format follows
8
8
 
9
9
  _Nothing yet._
10
10
 
11
+ ## [0.7.0] - 2026-07-29
12
+
13
+ ### Added
14
+
15
+ - **`fold-panel-host` gains two per-panel options: `modal` and `surface`.**
16
+ Passed through `FoldPanelHostService.open(component, { modal, surface })` (and
17
+ available on template-panel descriptors).
18
+ - **`modal`** (default `true`) — the existing modal barrier: page scroll frozen,
19
+ background `inert`, focus trapped, backdrop click dismisses. **`modal: false`**
20
+ makes a **non-modal** panel: the page keeps scrolling and stays interactive
21
+ behind it, focus is not trapped, and clicking outside no longer closes it
22
+ (only the header / `Escape` / `close()` do). The barrier is now gated on
23
+ _whether any open panel is modal_, so a lone non-modal panel never freezes the
24
+ page; `aria-modal` reflects the real modality.
25
+ - **`surface`** (`"glass"` default · `"solid"`) — `solid` renders an **opaque**
26
+ sheet (`--fold-color-surface-card`, no `backdrop-filter`) for content that must
27
+ stay legible over any background or a plain white-sheet design; `glass` keeps
28
+ the frosted translucent look. Both default to today's behaviour, so existing
29
+ panels are unchanged. Specs cover barrier-gating, scroll-lock, pass-through
30
+ dock, surface + `aria-modal` reflection, and focus-trap gating.
31
+
32
+ - **Panel config now cascades through three layers instead of only the call
33
+ site.** A panel's shape (`side`, `width`, `modal`, `surface`) is resolved
34
+ highest-priority-first: the per-call `open()` option → the component's own
35
+ `static readonly foldPanel: FoldPanelDefaults` → an app-wide
36
+ `FOLD_PANEL_DEFAULTS` token. So a panel declares its **intrinsic** nature once
37
+ on the class (a cart _is_ non-modal + solid → `open(CartPanel)` with no
38
+ options), an app sets its **identity** once at bootstrap
39
+ (`provideFoldPanelDefaults({ surface: "solid" })`), and the call site is left
40
+ for genuine one-offs. `data` / `providers` / `stack` / `ariaLabel` stay
41
+ per-call. Fully backward-compatible: with no token and no static, every panel
42
+ keeps today's literal defaults (`right` / `490` / modal / `glass`). New
43
+ exports: `FOLD_PANEL_DEFAULTS`, `provideFoldPanelDefaults`, and the
44
+ `FoldPanelDefaults` / `FoldPanelDefaultsProvider` / `FoldPanelSurface` types.
45
+ Specs cover each layer and their precedence.
46
+
47
+ - **Named panel widths — `width: 'sm' | 'md' | 'lg' | 'xl'`.** A token scale
48
+ (`360 · 490 · 640 · 820px`) replaces the magic pixel number at the call site;
49
+ `md` is the historical default, and a raw `number` still works for a bespoke
50
+ case. Cascades like the rest (`FoldPanelDefaults.width`). New `FoldPanelSize`
51
+ type.
52
+
53
+ - **`disableClose` — guard the casual close.** Set it (per-call, on the
54
+ component static, or app-wide) to suppress the host's _implicit_ dismiss
55
+ gestures — `Escape` and a backdrop click — for a panel with unsaved edits. The
56
+ header close button and `FoldPanelRef.close()` are unaffected, so the panel
57
+ stays closeable on purpose. Default `false`; orthogonal to `modal`. Specs cover
58
+ Escape + backdrop suppression and that an ordinary panel still dismisses.
59
+
60
+ ### Fixed
61
+
62
+ - **A vertical `fold-view-nav` / `fold-tabs` rail no longer flips to a crammed
63
+ horizontal bar on a narrow _window_ while its layout keeps it on the side.**
64
+ The shared tab-bar carried a leftover `@media (max-width: 768px)` block that
65
+ rotated `.dir-vertical` items to a row on the **viewport** width. Since the nav
66
+ redesign, orientation is owned entirely by `resolvedDirection` — an explicit
67
+ `direction`, or, inside a `fold-nav-layout`, the layout folding the rail on top
68
+ on its **own** width. The viewport query fought that: when the window dropped
69
+ below `768px` but the nav-layout's own width stayed above `foldAt` (so it kept
70
+ the rail on the side, `is-row`), the items turned horizontal _inside_ the
71
+ vertical rail instead of moving above the content. The block is removed;
72
+ orientation is now purely container-driven, honouring fold's "responsive on its
73
+ own width, never the viewport" contract. A standalone vertical nav that must
74
+ collapse belongs in a `fold-nav-layout` (the container-driven tool).
75
+
76
+ ## [0.6.1] - 2026-07-28
77
+
78
+ ### Changed
79
+
80
+ - **`fold-tab-panel` now owns the vertical rhythm between its children.** It was
81
+ a neutral `display: block` with no spacing, so stacked `fold-page-section`s (or
82
+ cards) inside a panel sat flush against each other — the page gap only reaches
83
+ the _direct_ children of `.page-body`, and a tab panel isn't one. A panel is a
84
+ content region, like `.page-body`, so it now lays its children out as a flex
85
+ column with a `gap`. The gap is the new **`--fold-panel-gap`** token — fluid
86
+ `16 → 24px`, deliberately one notch tighter than `--fold-page-gap` (`20 → 32px`)
87
+ so panel content reads as one screen rather than distinct page bands. Escape
88
+ hatch unchanged from `.page-body`: wrap two elements in a container to tighten
89
+ them (a single child gets no gap at all). Consumers that re-established this
90
+ spacing by hand on the panel can drop it.
91
+
92
+ ### Fixed
93
+
94
+ - **`fold-page-layout` header no longer starves the title/description on narrow
95
+ screens.** The head was a permanent `space-between` row: the actions slot held
96
+ its intrinsic width (`flex: none`) while the text column carried `min-width: 0`,
97
+ so wide `[pageActions]` (e.g. two full-label buttons) squeezed the description
98
+ down to its longest word — one word per line, stacked vertically. Below `640px`
99
+ the head now stacks: title/description take the full width and the actions drop
100
+ onto their own row beneath. Keyed to **both** the viewport (`@media`) and an
101
+ ancestor container (`@container`, for the gallery's responsive preview), mirroring
102
+ `app-shell`. The actions slot also gained `flex-wrap` so several wide buttons
103
+ wrap among themselves instead of overflowing the gutter.
104
+
11
105
  ## [0.6.0] - 2026-07-28
12
106
 
13
107
  ### Added
@@ -621,7 +715,9 @@ design-token stylesheet.
621
715
  `currentColor`; `prefers-reduced-motion` + `forced-colors` are respected;
622
716
  strings localise via inputs / providers (`provideFoldPanelLabels`).
623
717
 
624
- [unreleased]: https://github.com/hugoheynard/fold-ng/compare/v0.6.0...HEAD
718
+ [unreleased]: https://github.com/hugoheynard/fold-ng/compare/v0.7.0...HEAD
719
+ [0.7.0]: https://github.com/hugoheynard/fold-ng/releases/tag/v0.7.0
720
+ [0.6.1]: https://github.com/hugoheynard/fold-ng/releases/tag/v0.6.1
625
721
  [0.6.0]: https://github.com/hugoheynard/fold-ng/releases/tag/v0.6.0
626
722
  [0.5.2]: https://github.com/hugoheynard/fold-ng/releases/tag/v0.5.2
627
723
  [0.5.1]: https://github.com/hugoheynard/fold-ng/releases/tag/v0.5.1