@ferrlabs/ui-ng 1.63.0 → 1.64.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -0
- package/fesm2022/ferrlabs-ui-ng.mjs +331 -36
- package/fesm2022/ferrlabs-ui-ng.mjs.map +1 -1
- package/package.json +1 -1
- package/types/ferrlabs-ui-ng.d.ts +50 -0
- package/types/ferrlabs-ui-ng.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -41,6 +41,30 @@ import { ButtonComponent } from '@ferrlabs/ui-ng';
|
|
|
41
41
|
export class Demo {}
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
+
## Shell on narrow viewports
|
|
45
|
+
|
|
46
|
+
At `max-width: 880px` `flr-shell` takes the sidebar out of the layout and shows a
|
|
47
|
+
menu button in the topbar instead of the rail toggle. The button opens the sidebar
|
|
48
|
+
as an off-canvas drawer with the app switcher, the org switcher, the nav and the
|
|
49
|
+
user menu, always expanded whatever `collapsed` says.
|
|
50
|
+
|
|
51
|
+
While the drawer is open the rest of the shell is `inert`, focus moves into the
|
|
52
|
+
drawer and page scroll is locked. Escape, the backdrop, a nav item and a
|
|
53
|
+
`currentPath` change close it and return focus to the menu button. No setup is
|
|
54
|
+
needed. The drawer is announced as a dialog. Its name and the two button labels
|
|
55
|
+
are inputs, for translation:
|
|
56
|
+
|
|
57
|
+
```html
|
|
58
|
+
<flr-shell
|
|
59
|
+
navLabel="Navigation"
|
|
60
|
+
navOpenLabel="Ouvrir la navigation"
|
|
61
|
+
navCloseLabel="Fermer la navigation"
|
|
62
|
+
/>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
A standalone `flr-sidebar` gets the same drawer through `[(drawerOpen)]`; the
|
|
66
|
+
trigger and the `inert` handling are then yours.
|
|
67
|
+
|
|
44
68
|
## Splitter
|
|
45
69
|
|
|
46
70
|
Resizable panes with a draggable, keyboard accessible handle between each pair.
|
|
@@ -93,6 +117,30 @@ direction is read from CSS `direction`. Stored sizes are restored once per `stor
|
|
|
93
117
|
or removing a pane later keeps the live layout. A drag is cancelled if its handle goes away
|
|
94
118
|
(for example when the splitter crosses `stackBelow`).
|
|
95
119
|
|
|
120
|
+
## Segmented
|
|
121
|
+
|
|
122
|
+
`flr-segmented` is a radio group drawn as a pill of options: `options` (`{ value, label, icon? }[]`),
|
|
123
|
+
`[(value)]`, `iconOnly`, and `aria-label` / `aria-labelledby` / `aria-describedby`.
|
|
124
|
+
|
|
125
|
+
The selected option takes its colour from `--color-accent`, so each app gets its own accent with no
|
|
126
|
+
override: accent text, an accent border, and a 12% accent tint over `--color-card`. The accent keeps
|
|
127
|
+
its hue and saturation, and its lightness is clamped against `--color-ink` (at most 0.45 in OKLab on
|
|
128
|
+
a light theme, at least 0.8 on a dark one) so the label stays above 4.5:1 on the tint whatever the
|
|
129
|
+
accent. A theme that remaps `--color-card`, `--color-app-bg-2`, `--color-ink`, `--color-ink-3` or
|
|
130
|
+
`--color-rule` on the `flr-segmented` host is followed automatically.
|
|
131
|
+
|
|
132
|
+
To set the selection by hand, declare any of these on `flr-segmented` or an ancestor:
|
|
133
|
+
|
|
134
|
+
| Custom property | Applies to | Default |
|
|
135
|
+
| ------------------------- | ----------------------------------- | -------------------------------- |
|
|
136
|
+
| `--flr-seg-selected-bg` | Thumb background | 12% clamped accent over the card |
|
|
137
|
+
| `--flr-seg-selected-rule` | Thumb border | Clamped accent |
|
|
138
|
+
| `--flr-seg-selected-ink` | Selected label and icon, focus ring | Clamped accent |
|
|
139
|
+
|
|
140
|
+
Hover on the other options keeps using `--color-ink`, and idle options `--color-ink-3`. Before the
|
|
141
|
+
thumb is placed (prerendered HTML that has not hydrated yet) the selected option carries the same
|
|
142
|
+
tint and border itself. In `forced-colors` mode the selection uses `Highlight` and `HighlightText`.
|
|
143
|
+
|
|
96
144
|
## Versioned docs (`@ferrlabs/ui-ng/docs`)
|
|
97
145
|
|
|
98
146
|
Brand-agnostic versioned-documentation layout, shared across product sites.
|