@ferrlabs/ui-ng 1.66.3 → 1.67.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/README.md CHANGED
@@ -145,6 +145,32 @@ Hover on the other options keeps using `--color-ink`, and idle options `--color-
145
145
  thumb is placed (prerendered HTML that has not hydrated yet) the selected option carries the same
146
146
  fill and border itself. In `forced-colors` mode the selection uses `Highlight` and `HighlightText`.
147
147
 
148
+ `--flr-seg-size` (option height, and width when `iconOnly`, default 30px) and `--flr-seg-pad` (track
149
+ padding, default 4px) resize the control. Inside a `flr-menu`, set `inMenu`: the group becomes
150
+ `role="group"` with `role="menuitemradio"` options, and Up and Down are left to the menu.
151
+
152
+ ## User menu and theme
153
+
154
+ `flr-user-menu` takes `name`, `email`, `avatarSrc`, `accent`, `showName` and `items`
155
+ (`{ id?, label, href?, icon?, shortcut?, danger?, separatorAbove? }[]`), and emits `select`. `icon` is
156
+ SVG markup from `@ferrlabs/ui-foundation/icons` (any other string is shown as text) and `shortcut` is
157
+ a keyboard hint shown on the right. Items with `danger` are grouped at the bottom.
158
+
159
+ The panel always has a Theme row (System, Light, Dark) wired to `ThemeService`, so an app needs no
160
+ code for it. Pass `locales` (`{ code, label }[]`) and `locale` to get a Language row; it opens the
161
+ list in place and emits `localeChange` with the chosen code. The app applies the locale itself.
162
+ `labels` translates the built-in copy (`theme`, `system`, `light`, `dark`, `language`).
163
+
164
+ `ThemeService` (root) holds the preference as a signal (`preference()`, `resolved()`,
165
+ `setPreference()`), stores it in `localStorage` under `flr-theme`, sets `data-theme="dark"` on
166
+ `<html>` for dark and removes the attribute for light, and follows `prefers-color-scheme` while the
167
+ preference is `system`. It runs once something injects it. To avoid a light flash before Angular
168
+ starts, an app can set the attribute from the same key in an inline script in `index.html`.
169
+
170
+ To add a row of your own to a `flr-menu`, provide `MENU_FOCUSABLE` (`focus()`, `disabled()`) on it so
171
+ the arrow keys reach it. `flr-menu-item` takes `keepOpen` (the click does not close the menu) and
172
+ `checked` (renders a `menuitemradio`).
173
+
148
174
  ## Versioned docs (`@ferrlabs/ui-ng/docs`)
149
175
 
150
176
  Brand-agnostic versioned-documentation layout, shared across product sites.