@lofid/web 0.0.0-stage → 1.0.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.
Files changed (55) hide show
  1. package/README.md +85 -2
  2. package/custom-elements.json +11166 -0
  3. package/dist/index.d.ts +2784 -0
  4. package/dist/index.js +18710 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/styles/ag-grid.css +145 -0
  7. package/dist/styles/motion.css +32 -0
  8. package/dist/styles/motion.tokens.json +38 -0
  9. package/dist/styles/vars.css +870 -0
  10. package/package.json +44 -4
  11. package/readmes/lof-accordion/README.md +140 -0
  12. package/readmes/lof-alert/README.md +142 -0
  13. package/readmes/lof-autocomplete/README.md +209 -0
  14. package/readmes/lof-avatar/README.md +228 -0
  15. package/readmes/lof-badge/README.md +102 -0
  16. package/readmes/lof-breadcrumb/README.md +97 -0
  17. package/readmes/lof-button/README.md +190 -0
  18. package/readmes/lof-calendar/README.md +111 -0
  19. package/readmes/lof-card/README.md +75 -0
  20. package/readmes/lof-cardmedia/README.md +100 -0
  21. package/readmes/lof-carousel/README.md +187 -0
  22. package/readmes/lof-checkbox/README.md +159 -0
  23. package/readmes/lof-chip/README.md +141 -0
  24. package/readmes/lof-container/README.md +107 -0
  25. package/readmes/lof-date-picker/README.md +221 -0
  26. package/readmes/lof-divider/README.md +88 -0
  27. package/readmes/lof-drawer/README.md +188 -0
  28. package/readmes/lof-kbd/README.md +188 -0
  29. package/readmes/lof-layout/README.md +122 -0
  30. package/readmes/lof-menu/README.md +187 -0
  31. package/readmes/lof-menubar/README.md +218 -0
  32. package/readmes/lof-otp/README.md +167 -0
  33. package/readmes/lof-pagination/README.md +141 -0
  34. package/readmes/lof-popover/README.md +220 -0
  35. package/readmes/lof-progress/README.md +88 -0
  36. package/readmes/lof-radio/README.md +142 -0
  37. package/readmes/lof-range-picker/README.md +194 -0
  38. package/readmes/lof-resizable/README.md +220 -0
  39. package/readmes/lof-segmented-button/README.md +158 -0
  40. package/readmes/lof-select/README.md +193 -0
  41. package/readmes/lof-sheet/README.md +170 -0
  42. package/readmes/lof-signature-pad/README.md +161 -0
  43. package/readmes/lof-skeleton/README.md +104 -0
  44. package/readmes/lof-slider/README.md +140 -0
  45. package/readmes/lof-snackbar/README.md +170 -0
  46. package/readmes/lof-split-button/README.md +129 -0
  47. package/readmes/lof-stepper/README.md +171 -0
  48. package/readmes/lof-switch/README.md +122 -0
  49. package/readmes/lof-tab/README.md +184 -0
  50. package/readmes/lof-textfield/README.md +206 -0
  51. package/readmes/lof-time-picker/README.md +188 -0
  52. package/readmes/lof-toast/README.md +174 -0
  53. package/readmes/lof-tooltip/README.md +120 -0
  54. package/readmes/lof-tree/README.md +157 -0
  55. package/readmes/lof-upload/README.md +223 -0
@@ -0,0 +1,194 @@
1
+ # lof-range-picker
2
+
3
+ `<lof-range-picker>` is the date-range form field of the Lofid Design System (Figma "Date Range Picker"). It is a text field you can type a "from → to" range into, backed by a two-pane panel: quick-select presets with single-key shortcuts and editable From / To inputs on the left, a month grid with live range preview on the right, and a Reset / Cancel / Apply footer. The grid and presets edit a draft; only Apply (or typed entry / clear) commits `from`/`to` as ISO `YYYY-MM-DD` strings. Use it for filters and reports that need a start and an end. For a single date use `<lof-date-picker>`, for an always-visible grid use `<lof-calendar>`.
4
+
5
+ ## Usage
6
+
7
+ ```html
8
+ <!-- Basic -->
9
+ <lof-range-picker placeholder="Select date range"></lof-range-picker>
10
+
11
+ <!-- Preselected range with a clear icon -->
12
+ <lof-range-picker from="2026-01-05" to="2026-01-09" clearable></lof-range-picker>
13
+
14
+ <!-- Bounded, Monday-first grid -->
15
+ <lof-range-picker min-date="2026-01-01" max-date="2026-12-31" week-start="mon"></lof-range-picker>
16
+
17
+ <!-- Centred popup with a dimmed backdrop instead of an anchored popover -->
18
+ <lof-range-picker mode="popup"></lof-range-picker>
19
+
20
+ <!-- Icon-only trigger (no typed entry, no clear icon) -->
21
+ <lof-range-picker trigger-variant="icon" placeholder="Filter by date"></lof-range-picker>
22
+
23
+ <!-- Sizing the host: explicit width, or fill the parent -->
24
+ <lof-range-picker width="320px" min-width="240px"></lof-range-picker>
25
+ <lof-range-picker full-width></lof-range-picker>
26
+
27
+ <!-- Disabled -->
28
+ <lof-range-picker from="2026-01-05" to="2026-01-09" disabled></lof-range-picker>
29
+ ```
30
+
31
+ ```js
32
+ const picker = document.querySelector("lof-range-picker");
33
+
34
+ picker.addEventListener("lof-change", (e) => {
35
+ e.detail.from; // "2026-01-05" ("" when cleared)
36
+ e.detail.to; // "2026-01-09"
37
+ e.detail.label; // "01/05/2026 → 01/09/2026"
38
+ });
39
+ picker.addEventListener("lof-open-change", (e) => e.detail.open);
40
+ picker.addEventListener("lof-blur", () => {/* run validation */});
41
+
42
+ picker.displayLabel; // same formatted label for the committed range
43
+ ```
44
+
45
+ ### Typed entry
46
+
47
+ With the default trigger the field is editable and commits on Enter or when focus leaves the component. Two dates are separated by `→`, `..`, a spaced `-`, or the word `to` (`2026-01-05 to 2026-01-09`, `21/7 .. 28/7`, `t - t+7`); a single date gives a one-day range and a reversed pair is normalised so `from` ≤ `to`. Each side accepts everything `lof-date-picker` parses — ISO, numeric, month names, partial `21/7` / `21`, and the `t` / `today` / `t±N` shortcuts — with ambiguous `a/b` always read as month/day, matching the `MM/DD/YYYY` display. Unparseable text shows "Invalid date range" and a date outside `min-date`/`max-date` shows "Date not available"; the text stays for correction and the committed range is untouched. Escape reverts the text; committing an empty field clears the range like the clear icon.
48
+
49
+ ### Presets and shortcuts
50
+
51
+ The left pane lists Today (`T`), Tomorrow (`M`), Yesterday (`Y`), This Week (`W`), Next Week (`N`), Next 7 Days (`7`) and Next 30 Days (`3`), one per row. Weeks in the presets always run Sunday–Saturday regardless of `week-start`. While the panel is open, pressing the key (no modifier, focus not in an editable field) selects that preset; a preset only fills the draft — Apply still commits it. Following Figma's ".Suggested Range" row, the key is not printed on the row: each preset carries it as `aria-keyshortcuts` and a `title` tooltip instead.
52
+
53
+ <!-- @unreleased-begin 1.5.0 -->
54
+ New in 1.5.0: a preset whose range equals the picked days shows as selected (picking next Sunday to Saturday selects Next Week). Apply stays disabled while only a start day is picked. After a mouse click on the start day, the To box draws its hover border to show it is next; keyboard focus stays on the day in the grid.
55
+ <!-- @unreleased-end -->
56
+
57
+ > **Changed in this release.** The `Before Today` preset (`B`, `1970-01-01` → yesterday) has been replaced by `Yesterday` (`Y`, yesterday → yesterday) to match Figma. The `B` key no longer selects anything; use typed entry (for example `1970-01-01 to t-1`) if you need the old open-ended range.
58
+
59
+ ### Deprecated aliases
60
+
61
+ ```html
62
+ <!-- fullwidth → full-width (since 1.5.0; still works, logs a one-time console notice, removed in 3.0) -->
63
+ <lof-range-picker fullwidth></lof-range-picker>
64
+ <lof-range-picker full-width></lof-range-picker>
65
+ ```
66
+
67
+ <!-- readme-gen:start -->
68
+
69
+ <!-- Generated from lof-range-picker.ts — do not edit; run readme-generate.mjs -->
70
+
71
+ ## API
72
+
73
+ ### Attributes / Properties
74
+
75
+ | Property | Attribute | Type | Default | Description |
76
+ | --- | --- | --- | --- | --- |
77
+ | `from` | `from` | `string` | `""` | Committed range start as an ISO `YYYY-MM-DD` string; empty string when no range is set. |
78
+ | `to` | `to` | `string` | `""` | Committed range end as an ISO `YYYY-MM-DD` string; empty string when no range is set. Always ≥ `from`. |
79
+ | `locale` | `locale` | `string` | `"en-US"` | Locale used to match month names in typed input; the visible trigger text and calendar labels are always `en-US` (`MM/DD/YYYY`). |
80
+ | `weekStart` | `week-start` | `"mon" \| "sun"` | `"sun"` | First column of the calendar grid: `"sun"` (default) or `"mon"`. Presets always compute weeks Sunday–Saturday. |
81
+ | `minDate` | `min-date` | `string` | `""` | Earliest selectable date (ISO `YYYY-MM-DD`); earlier days are disabled and typed ranges starting before it are rejected. |
82
+ | `maxDate` | `max-date` | `string` | `""` | Latest selectable date (ISO `YYYY-MM-DD`); later days are disabled and typed ranges ending after it are rejected. |
83
+ | `disabled` | `disabled` | `boolean` | `false` | Disables the trigger, the icons and the panel controls. The field looks like a disabled `lof-textfield`: the whole field at 0.65 opacity, an elevated-2 box with the accent border, and the value and placeholder in `--lof-text-caption` (changed in 1.5.0: it was the enabled look at 60% opacity). Reflected. |
84
+ | `open` | `open` | `boolean` | `false` | Whether the panel is open. Setting it directly shows/hides the panel but does not seed the draft from `from`/`to` or fire `lof-open-change` — user interaction does both. Reflected. |
85
+ | `mode` | `mode` | `"popover" \| "popup"` | `"popover"` | `popover` anchors the panel below the trigger; `popup` centres it in the viewport behind a dimmed backdrop (part `overlay`). |
86
+ | `width` | `width` | `string` | `""` | CSS width applied to the host (any CSS length, e.g. `320px`); empty leaves the intrinsic width. |
87
+ | `minWidth` | `min-width` | `string` | `""` | CSS `min-width` applied to the host. |
88
+ | `maxWidth` | `max-width` | `string` | `""` | CSS `max-width` applied to the host. |
89
+ | `height` | `height` | `string` | `""` | CSS height applied to the host. |
90
+ | `minHeight` | `min-height` | `string` | `""` | CSS `min-height` applied to the host. |
91
+ | `maxHeight` | `max-height` | `string` | `""` | CSS `max-height` applied to the host. |
92
+ | `placeholder` | `placeholder` | `string` | `"Select date range"` | Placeholder shown in the empty field; also the accessible name of the input (and of the icon trigger while no range is set). |
93
+ | `triggerVariant` | `trigger-variant` | `"default" \| "icon"` | `"default"` | `default` renders the text field; `icon` renders a single calendar icon button instead (no typed entry, no clear button, parts `trigger`/`value` absent). |
94
+ | `clearable` | `clearable` | `boolean` | `false` | Shows a clear (×) icon while a range is set; clearing fires `lof-change` with empty `from`/`to`. Only with the default trigger. |
95
+ | `fullWidth` | `full-width` | `boolean` | `false` | Stretches the host to fill its parent's width (attribute `full-width`), mirroring lof-time-picker / lof-date-picker. Off by default so the existing intrinsic-width (`inline-block`) rendering is unchanged. Reflected (as `fullwidth` in 1.x). The `fullwidth` attribute spelling is deprecated (still works; removal targeted for 3.0). |
96
+ | `size` | `size` | `"small" \| "medium" \| "large" \| "sm" \| "md" \| "lg"` | `"medium"` | Trigger height on the shared field scale — `small` 32 / `medium` 40 / `large` 48px border-box — matching lof-textfield, lof-date-picker and lof-time-picker so the four align in a form row. Also ramps the trigger's text and inline padding. The panel is unaffected: Figma specifies one panel size. `sm` / `md` / `lg` are alternative spellings and stay supported — normalised to the full words, not deprecated. Reflected. |
97
+
98
+ ### Public fields / accessors
99
+
100
+ | Name | Type | Description |
101
+ | --- | --- | --- |
102
+ | `displayLabel` | `string` | Formatted "MM/DD/YYYY → MM/DD/YYYY" (or single date / "") for the current committed `from`/`to`. |
103
+
104
+ ## Events
105
+
106
+ | Event | Detail | Bubbles / composed | Description |
107
+ | --- | --- | --- | --- |
108
+ | `lof-blur` | — | bubbles / composed | Fired when the text input loses focus (before any typed text is committed). No detail. |
109
+ | `lof-change` | `{ from: this.from, to: this.to, label: this.displayLabel } / { from: "", to: "", label: "" }` | bubbles / composed | Fired when the committed range changes — Apply, typed entry, or clear. Detail: `{ from: string, to: string, label: string }` (ISO dates and the formatted `MM/DD/YYYY → MM/DD/YYYY` label; all empty strings when cleared). |
110
+ | `lof-open-change` | `{ open: true } / { open: false }` | bubbles / composed | Fired when the panel opens or closes (open, Cancel, Escape, outside click, Apply). Detail: `{ open: boolean }`. |
111
+
112
+ ## Slots
113
+
114
+ | Slot | Description |
115
+ | --- | --- |
116
+ | — | This element has no slots. |
117
+
118
+ ## CSS Parts
119
+
120
+ | Part | Description |
121
+ | --- | --- |
122
+ | `trigger` | The field box that wraps the text input and the clear/calendar icons (default trigger variant only) |
123
+ | `value` | The editable text input inside the trigger |
124
+ | `overlay` | The full-screen backdrop rendered in `mode="popup"` while open |
125
+ | `panel` | The floating panel (`role="dialog"`) holding presets and calendar |
126
+ | `list` | The preset column and the day grid |
127
+ | `option` | Each quick-select preset button |
128
+ | `action` | The header's previous and next buttons; they step a month, a year or a 12-year page depending on which view the panel is showing |
129
+ | `unavailable` | Day cells that cannot be picked (outside `min-date` / `max-date`). They are `aria-disabled` and stay focusable, so `:disabled` does not match them; style them with `::part(unavailable)` |
130
+ | `footer` | The Reset / Cancel / Apply button row |
131
+
132
+ ## Tokens / CSS Variables
133
+
134
+ ### Component hooks
135
+
136
+ Set these on the host (or an ancestor) to customise the element without touching design tokens.
137
+
138
+ | Custom property | Default | Description |
139
+ | --- | --- | --- |
140
+ | `--lof-overlay-fallback-z` | `1001` | z-index of the panel on the **no-Popover-API fallback path only**. Wherever the browser top layer is available the panel is promoted into it and this value is inert, because top-layer elements are not in the page stacking order at all. Shared with the other overlays (select, autocomplete, the three pickers) so the whole family can be moved from one place. |
141
+
142
+ <!-- readme-gen:end -->
143
+
144
+
145
+ ## CSS Custom Properties
146
+
147
+ | Custom property | Default | Description |
148
+ | --- | --- | --- |
149
+ | `--lof-overlay-fallback-z` | `1001` | z-index of the panel on the **no-Popover-API fallback path only**. Wherever the browser top layer is available the panel is promoted into it and this value is inert, because top-layer elements are not in the page stacking order at all. Shared with the other overlays (select, autocomplete, the three pickers) so the whole family can be moved from one place. |
150
+ ## Accessibility
151
+
152
+ - Default trigger: the input is a `role="combobox"` with `aria-haspopup="dialog"`, `aria-expanded`, `aria-controls` pointing at the panel, `aria-label` = `placeholder`, `aria-invalid` while typed text is in error and `aria-describedby` pointing at the error line. The icon buttons are labelled "Clear date range" and "Open date range panel" (with `aria-expanded`).
153
+ - Icon trigger (`trigger-variant="icon"`): a `<lof-button>` with `aria-haspopup="dialog"`, `aria-expanded`, and an `aria-label` of the current range label or the `placeholder`.
154
+ - The panel is a `role="dialog"` named "Select date range". Presets sit in a `role="group"` named "Quick date selections"; each preset button carries `aria-pressed` plus an `aria-keyshortcuts` naming its single-key shortcut. The From / To boxes are text inputs labelled "From" / "To" (`<label for>`); a box in error carries `aria-invalid="true"` and `aria-describedby` pointing at its error line ("Invalid date" / "Date not available"). Focus is not trapped inside the panel.
155
+ - The calendar is a `role="grid"` named "Select date range" with `role="columnheader"` weekday names, `role="row"` weeks and `role="gridcell"` days whose `aria-label` is the full long date plus ", range start" / ", range end" for the endpoints; `aria-selected` is true for the endpoints and every day between them, `aria-disabled` marks unavailable days. Exactly one cell is a Tab stop: the day last interacted with (arrowed to, clicked or tabbed onto — changed, unreleased: clicks and Tab used to be ignored), else the draft start, else today, else the first enabled day — so Shift+Tab then Tab returns to the day you left. A clicked leading/trailing day keeps the Tab stop itself, since picking one does not move the view. The key map is shared with `lof-date-picker`.
156
+ - Focus: opening the panel does not move focus; Escape closes it and returns focus to the input. Keyboard navigation in the grid previews the range exactly like mouse hover does.
157
+ - Screen readers hear "<Month> <Year>" after every month change and "From date MM/DD/YYYY" / "To date MM/DD/YYYY" when an endpoint is chosen, through the shared `announce()` region (`utils/announce.ts`).
158
+
159
+ | Key (in the field) | Action |
160
+ | --- | --- |
161
+ | Enter | Nothing typed: open the panel. Text typed: commit it |
162
+ | ArrowDown | Open the panel |
163
+ | Escape | Revert uncommitted text; close the panel and refocus the input |
164
+
165
+ | Key (panel open, focus outside an editable field) | Action |
166
+ | --- | --- |
167
+ | T / M / Y / W / N / 7 / 3 | Select the matching preset into the draft |
168
+ | Escape | Cancel: discard the draft, close, refocus the input |
169
+
170
+ | Key (in the grid) | Action |
171
+ | --- | --- |
172
+ | ArrowLeft / ArrowRight | Previous / next day (switches month at the edge) |
173
+ | ArrowUp / ArrowDown | Same weekday one week earlier / later |
174
+ | Home / End | First / last day of the row, honouring `week-start` |
175
+ | PageUp / PageDown | Same day previous / next month (clamped to the month's last day, e.g. 31 Jan → 28 Feb; unreleased fix — it used to overflow to early March) |
176
+ | Shift + PageUp / Shift + PageDown | Same day previous / next year |
177
+ | Enter / Space | Pick the day as range start, then as range end. Does nothing on an unavailable day — the arrows land on those days rather than skipping them |
178
+
179
+ ## Notes / Edge Cases
180
+
181
+ - **The header month and year are buttons.** Clicking the month opens a 12-month grid; clicking the year opens a 12-year page that pages back indefinitely with the chevrons, so a date years in the past is a few clicks rather than a few dozen. Picking a year drills to Months, picking a month returns to the day grid. The chevrons step whatever the current view shows — a month, a year or a whole page — and the panel always reopens on the day grid.
182
+ - **Navigating does not select.** The switcher moves the VIEW only: it writes to the month and year on display and never to the draft or the committed range, so Reset, Cancel and Apply behave exactly as they did, and reopening still seeds the view from the committed start date.
183
+ - Draft vs committed: grid picks, presets and the panel's From / To inputs only change the draft. Typing in a From / To input commits to the DRAFT on Enter or blur, through the same parser as the trigger (`MM/DD/YYYY`, month names, `t` / `t±N`); the calendar moves to the typed month, a From after the To swaps the two, an empty box clears that side, and an invalid or unavailable date keeps its text with an error. The first Escape in a box with pending text reverts it; the next closes the panel. Apply refuses to commit while a box shows an error (it focuses that box). Apply commits it (fires `lof-change`, closes); Cancel, Escape, an outside click, or the popup backdrop discard it; Reset empties the draft. Reset followed by Apply clears the committed range (`lof-change` with empty strings) — Apply is disabled only when both the draft and the committed range are empty.
184
+ - Second-click ordering: picking a day before the current draft start makes it the new start and the old start the end.
185
+ - Setting `open = true` from code shows the panel but neither seeds the draft from `from`/`to` nor fires `lof-open-change`; only user interaction does both.
186
+ - The trigger text, From / To inputs, month names and day labels are always rendered in `en-US` (`MM/DD/YYYY`); `locale` only affects month-name matching in typed input.
187
+ - Leading and trailing cells of adjacent months are interactive, as in `lof-calendar` (changed, unreleased — they used to be inert): they hover, press, focus and can be picked as the range start or end, and the band and hover preview run across the month boundary. `min-date` / `max-date` disable them exactly as they would an in-month day. Picking one keeps the current month in view, so a range that crosses the boundary can be finished without paging (the date picker and `lof-calendar` do move the view). Out-of-month and weekend labels use the caption colour (`--lof-text-caption`; 1.5.0, they used to fade to 40% / 70%), except on a range endpoint, inside the selected band (where they are part of the selection and show at full strength) and on today. Today gets a 1 px brand ring.
188
+ - Range styling follows Figma ".Date Range Days": the selected run is an `elevated-1` band across the full cell, rounded at the two ends (a one-day range, and a start picked before its end, is a single rounded pill), and the two endpoints are `inverse-2` discs with inverse semibold labels. Days between the endpoints keep their normal label on the band.
189
+ - The panel (and the popup backdrop) is promoted to the browser top layer (`popover="manual"`), so it works inside `lof-modal` / `lof-drawer` and above transformed or `overflow: hidden` ancestors. In `popover` mode it anchors below the host, flips above when there is no room, stays 8 px inside the viewport, repositions on resize. On an outside scroll (since 1.5.0) it **stays open and moves with the field while the field is still visible**, and closes once the field scrolls out of the viewport or its scroll container, or under a sticky header — so the top-layer panel never paints over page furniture (the reason 1.4.9 closed it on every scroll). Only the window and the field's own scroll containers count, including ones inside shadow roots such as `lof-modal`'s body; scrolls of unrelated elements and of the panel itself are ignored, and a wheel or swipe over the panel never scrolls the page (`overscroll-behavior: contain`) (popover mode only). In `popup` mode it is fixed-centred behind a 40% black backdrop (part `overlay`) whose click cancels. It never exceeds the viewport and scrolls internally.
190
+ - `width`, `min-width`, `max-width`, `height`, `min-height` and `max-height` are copied to the host's inline style on every update, so they override stylesheet rules on the host.
191
+ - The icon trigger has no typed entry, no clear icon and no error line; parts `trigger` and `value` are not rendered in that variant.
192
+ - There is no helper-text or external error API; the only text below the field is the typed-entry error.
193
+ - The footer buttons are `<lof-button>` instances — `ghost` for Reset, `secondary` for Cancel and `primary tone="brand"` for Apply — and the icon trigger uses `<lof-button>` with `<lof-icon name="calendar-range">`, so `@lofid/icons` is loaded by this component.
194
+ - The host is `inline-block` with an intrinsic width by default; `full-width` switches it to a block that fills the parent.
@@ -0,0 +1,220 @@
1
+ # lof-resizable
2
+
3
+ `lof-resizable` is a three-element split-pane system: `<lof-resizable-group>` lays out its direct-child `<lof-resizable-panel>`s along one axis (`direction="horizontal"` side by side, `"vertical"` stacked) and lets the user drag or keyboard-nudge the `<lof-resizable-handle>` between two neighbours to trade percentage size between them, within each panel's `min-size` / `max-size`. Use it for editor / preview splits, sidebar + content layouts and inspector panes where the user should control the proportions. It has no Figma component of its own; it follows the WAI-ARIA window-splitter pattern. It is not a general grid or an accordion — every panel stays visible and cannot be collapsed below its `min-size`.
4
+
5
+ ## Usage
6
+
7
+ ```html
8
+ <!-- Horizontal split (default direction) -->
9
+ <lof-resizable-group direction="horizontal" style="height: 320px;">
10
+ <lof-resizable-panel default-size="50">
11
+ <h3>Left</h3>
12
+ </lof-resizable-panel>
13
+ <lof-resizable-handle></lof-resizable-handle>
14
+ <lof-resizable-panel default-size="50">
15
+ <h3>Right</h3>
16
+ </lof-resizable-panel>
17
+ </lof-resizable-group>
18
+
19
+ <!-- Vertical split: the group needs an explicit height to divide -->
20
+ <lof-resizable-group direction="vertical" style="height: 480px;">
21
+ <lof-resizable-panel default-size="40">Top</lof-resizable-panel>
22
+ <lof-resizable-handle></lof-resizable-handle>
23
+ <lof-resizable-panel default-size="60">Bottom</lof-resizable-panel>
24
+ </lof-resizable-group>
25
+
26
+ <!-- Constraints: percentages of the group -->
27
+ <lof-resizable-group style="height: 320px;">
28
+ <lof-resizable-panel default-size="30" min-size="20" max-size="50">Sidebar</lof-resizable-panel>
29
+ <lof-resizable-handle></lof-resizable-handle>
30
+ <lof-resizable-panel default-size="70">Main</lof-resizable-panel>
31
+ </lof-resizable-group>
32
+
33
+ <!-- Nested: a vertical group inside the right panel of a horizontal one -->
34
+ <lof-resizable-group direction="horizontal" style="height: 480px;">
35
+ <lof-resizable-panel default-size="33">Sidebar</lof-resizable-panel>
36
+ <lof-resizable-handle></lof-resizable-handle>
37
+ <lof-resizable-panel default-size="67">
38
+ <lof-resizable-group direction="vertical">
39
+ <lof-resizable-panel default-size="50">Editor</lof-resizable-panel>
40
+ <lof-resizable-handle></lof-resizable-handle>
41
+ <lof-resizable-panel default-size="50">Preview</lof-resizable-panel>
42
+ </lof-resizable-group>
43
+ </lof-resizable-panel>
44
+ </lof-resizable-group>
45
+
46
+ <!-- Scrollable panel (new in 1.5.0): while the content overflows, the panel is a
47
+ focusable region named by panel-label, so keyboard users can scroll it -->
48
+ <lof-resizable-group style="height: 240px;">
49
+ <lof-resizable-panel default-size="30" panel-label="Project list">…long list…</lof-resizable-panel>
50
+ <lof-resizable-handle aria-label="Resize project list"></lof-resizable-handle>
51
+ <lof-resizable-panel default-size="70">Details</lof-resizable-panel>
52
+ </lof-resizable-group>
53
+
54
+ <!-- Listening for size changes -->
55
+ <lof-resizable-group id="split" style="height: 320px;">
56
+ <lof-resizable-panel>A</lof-resizable-panel>
57
+ <lof-resizable-handle></lof-resizable-handle>
58
+ <lof-resizable-panel>B</lof-resizable-panel>
59
+ </lof-resizable-group>
60
+ <script>
61
+ const split = document.getElementById('split');
62
+ // fires continuously while dragging
63
+ split.addEventListener('lof-resize', (e) => console.log(e.detail.sizes));
64
+ // fires once per drag, and after every keyboard step — good for persisting
65
+ split.addEventListener('lof-resize-end', (e) => localStorage.setItem('split', JSON.stringify(e.detail.sizes)));
66
+ </script>
67
+ ```
68
+
69
+ ### Deprecated aliases
70
+
71
+ ```html
72
+ <!-- defaultsize / minsize / maxsize → default-size / min-size / max-size (since 1.5.0; still work,
73
+ log a one-time console notice, removed in 3.0) -->
74
+ <lof-resizable-panel defaultsize="30" minsize="20" maxsize="50">Sidebar</lof-resizable-panel>
75
+ <lof-resizable-panel default-size="30" min-size="20" max-size="50">Sidebar</lof-resizable-panel>
76
+ ```
77
+
78
+ <!-- readme-gen:start -->
79
+
80
+ <!-- Generated from lof-resizable-group.ts, lof-resizable-handle.ts, lof-resizable-panel.ts — do not edit; run readme-generate.mjs -->
81
+
82
+ ## Elements
83
+
84
+ | Element | Class | Source |
85
+ | --- | --- | --- |
86
+ | `<lof-resizable-group>` | `LofResizableGroup` | `lof-resizable-group.ts` |
87
+ | `<lof-resizable-handle>` | `LofResizableHandle` | `lof-resizable-handle.ts` |
88
+ | `<lof-resizable-panel>` | `LofResizablePanel` | `lof-resizable-panel.ts` |
89
+
90
+ ## API
91
+
92
+ ### `<lof-resizable-group>`
93
+
94
+ #### Attributes / Properties
95
+
96
+ | Property | Attribute | Type | Default | Description |
97
+ | --- | --- | --- | --- | --- |
98
+ | `direction` | `direction` | `"horizontal" \| "vertical"` | `"horizontal"` | Layout axis: `horizontal` places panels side by side and resizes widths, `vertical` stacks them and resizes heights; also pushed to every child handle's `orientation`. Reflected. |
99
+
100
+ ### Events
101
+
102
+ | Event | Detail | Bubbles / composed | Description |
103
+ | --- | --- | --- | --- |
104
+ | `lof-resize` | `{ direction: this.direction, sizes, }` | bubbles / composed | Fired continuously while a handle is dragged. Detail: `{ direction, sizes: number[] }` with one percentage per panel. |
105
+ | `lof-resize-end` | `{ direction: this.direction, sizes, }` | bubbles / composed | Fired once when a drag ends (pointerup) and after every keyboard resize step. Detail: `{ direction, sizes: number[] }` with one percentage per panel. |
106
+
107
+ ### Slots
108
+
109
+ | Slot | Description |
110
+ | --- | --- |
111
+ | (default) | The panels and handles, as direct children in display order (panel, handle, panel, …) |
112
+
113
+ ### CSS Parts
114
+
115
+ | Part | Description |
116
+ | --- | --- |
117
+ | — | None exposed. |
118
+
119
+ ### `<lof-resizable-handle>`
120
+
121
+ #### Attributes / Properties
122
+
123
+ | Property | Attribute | Type | Default | Description |
124
+ | --- | --- | --- | --- | --- |
125
+ | `orientation` | `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | Axis the handle separates: `horizontal` = 8px-wide vertical bar with `col-resize` cursor, `vertical` = 8px-tall bar with `row-resize`; set automatically from the parent group's `direction` on first render and mirrored to `aria-orientation`. Reflected. |
126
+
127
+ #### Public fields / accessors
128
+
129
+ | Name | Type | Description |
130
+ | --- | --- | --- |
131
+ | `splitValue` | `number` | Current split of the two neighbouring panels as a percentage 0–100 (share held by the leading panel); read-only — the parent group updates it and mirrors it to `aria-valuenow`. |
132
+
133
+ ### Events
134
+
135
+ | Event | Detail | Bubbles / composed | Description |
136
+ | --- | --- | --- | --- |
137
+ | — | — | — | This element emits no custom events. |
138
+
139
+ ### Slots
140
+
141
+ | Slot | Description |
142
+ | --- | --- |
143
+ | — | This element has no slots. |
144
+
145
+ ### CSS Parts
146
+
147
+ | Part | Description |
148
+ | --- | --- |
149
+ | — | None exposed. |
150
+
151
+ ### `<lof-resizable-panel>`
152
+
153
+ #### Attributes / Properties
154
+
155
+ | Property | Attribute | Type | Default | Description |
156
+ | --- | --- | --- | --- | --- |
157
+ | `defaultSize` | `default-size` | `number` | `undefined` | Initial size as a percentage of the group; panels without one share whatever is left of 100%, then all sizes are normalised to sum to 100. The `defaultsize` attribute spelling is deprecated (still works; removal targeted for 3.0). |
158
+ | `minSize` | `min-size` | `number` | `10` | Smallest size (percentage) the panel can be resized to. The `minsize` attribute spelling is deprecated (still works; removal targeted for 3.0). |
159
+ | `maxSize` | `max-size` | `number` | `90` | Largest size (percentage) the panel can be resized to. The `maxsize` attribute spelling is deprecated (still works; removal targeted for 3.0). |
160
+ | `panelLabel` | `panel-label` | `string` | `undefined` | New in 1.5.0. Accessible name the panel carries while its content overflows (it is then a focusable `role="region"`). Defaults to "Panel N", N being its position among the group's panels. Ignored when the page sets its own `aria-label` / `aria-labelledby`. |
161
+
162
+ #### Public fields / accessors
163
+
164
+ | Name | Type | Description |
165
+ | --- | --- | --- |
166
+ | `currentSize` | `number` | Current size as a percentage of the group (also written to the host's `flex-basis`); read-only — the parent group updates it on every resize. |
167
+ | `scrollable` | `boolean` | True while the content overflows the panel in either axis; read-only, kept current by a ResizeObserver. |
168
+
169
+ ### Events
170
+
171
+ | Event | Detail | Bubbles / composed | Description |
172
+ | --- | --- | --- | --- |
173
+ | — | — | — | This element emits no custom events. |
174
+
175
+ ### Slots
176
+
177
+ | Slot | Description |
178
+ | --- | --- |
179
+ | (default) | The panel's content; slotted `h1`–`h4` get the headings-md role |
180
+
181
+ ### CSS Parts
182
+
183
+ | Part | Description |
184
+ | --- | --- |
185
+ | — | None exposed. |
186
+
187
+ <!-- readme-gen:end -->
188
+
189
+ ## Accessibility
190
+
191
+ - Each `<lof-resizable-handle>` makes itself focusable (`tabindex="0"`) and takes `role="separator"` with `aria-orientation` mirroring its `orientation`. The group writes `aria-valuenow` (the leading panel's share of the pair, rounded, 0–100), `aria-valuemin="0"` and `aria-valuemax="100"` on first render and after every resize, so assistive technology can read the current split before and after any interaction.
192
+ - Handles have no accessible name of their own; when several handles are on a page add `aria-label` to each (e.g. `aria-label="Resize sidebar"`).
193
+ - The group sets no role and is not focusable. Panels are `overflow: auto`, and any interactive content inside keeps its own tab order.
194
+ - Scrollable panels (new in 1.5.0): while a panel's content overflows it (either axis), the panel gets `tabindex="0"`, `role="region"` and an `aria-label` (`panel-label`, default "Panel 1", "Panel 2"… by position), so a keyboard user can Tab to it and scroll with the arrow keys, Page Up / Page Down and Home / End. Focus shows a 2px `--lof-border-focus` ring drawn inside the panel edge (the group clips anything outside), or the system highlight colour in forced-colors mode. When the content fits again (resized larger, content removed) all three are removed, so a panel that cannot scroll is never a dead tab stop; a panel that is focused at that moment keeps its tab stop until focus leaves. Overflow is re-measured on panel and content resizes and on content changes.
195
+ - A `tabindex` you set yourself is never changed or removed (including `-1`), and the panel then leaves `role` and `aria-label` to you as well. A `role` or `aria-label` / `aria-labelledby` you set is never overridden. Give each scrollable panel a distinct `panel-label` when the defaults would repeat (for example in nested groups, where each group numbers its panels from 1).
196
+ - A focused handle shows a 2px focus ring (`--lof-border-focus`) and a lighter background; hover and drag states change the background and grab-bar colours only.
197
+ - Keyboard resizing (handled by the group, on a focused handle):
198
+
199
+ | Key | Direction | Action |
200
+ | --- | --- | --- |
201
+ | `ArrowLeft` / `ArrowRight` | `horizontal` | Shrink / grow the leading panel by 2% (of the group). |
202
+ | `ArrowUp` / `ArrowDown` | `vertical` | Shrink / grow the leading panel by 2%. |
203
+ | `Shift` + arrow | either | Same, in 5% steps. |
204
+ | `Home` | either | Collapse the leading panel to its `min-size` (as far as the neighbour allows). |
205
+ | `End` | either | Grow the leading panel to its `max-size` (as far as the neighbour allows). |
206
+
207
+ - Every keyboard step dispatches `lof-resize-end` (not `lof-resize`).
208
+ - Motion: the handle's background transitions are removed under `prefers-reduced-motion: reduce`.
209
+
210
+ ## Notes / Edge Cases
211
+
212
+ - Panels and handles must be **direct children** of the group (`:scope > lof-resizable-panel`), alternating panel / handle / panel. A handle at the start or end, or two handles in a row, has no valid pair and does nothing.
213
+ - Layout is computed once in `firstUpdated`: panels without `default-size` share whatever remains of 100%, then all sizes are normalised to sum to exactly 100 (so `default-size="50"` + `default-size="70"` ends up as 41.7 / 58.3). Panels or handles added or removed later are **not** observed; re-attach the group to re-initialise.
214
+ - Sizes are always percentages of the group, applied as `flex-basis` with `flex-grow: 0; flex-shrink: 0`. The group itself is `display: flex; width: 100%; height: 100%`, so a `vertical` group needs an ancestor with a definite height or it has nothing to divide.
215
+ - Only the two panels adjacent to the dragged handle change; each is clamped to its own `min-size` / `max-size`, then the pair is rescaled so their combined share stays constant. A panel therefore cannot go below its `min-size` (default 10) and never collapses to 0 unless you set `min-size="0"`.
216
+ - Attribute names are kebab-case: `default-size`, `min-size`, `max-size` (properties `defaultSize`, `minSize`, `maxSize`). The older lowercase spellings still work since 1.5.0 but log a one-time console notice and are removed in 3.0; see Deprecated aliases.
217
+ - While a drag is in progress the active handle carries a `data-dragging` attribute (the group sets and removes it) — the only hook for drag-specific styling from outside.
218
+ - Each handle's `orientation` is overwritten from the group's `direction` on first render; set `direction` on the group, not `orientation` on the handles.
219
+ - `lof-resize` fires on every pointer move during a drag; throttle any expensive listener. `lof-resize-end` fires once on pointer-up and after each keyboard step; both carry `{ direction, sizes }` where `sizes[i]` is panel *i*'s current percentage.
220
+ - Nested groups work because the inner group is ordinary panel content; pointer events are handled by the nearest group whose handle is in the event's composed path.
@@ -0,0 +1,158 @@
1
+ # lof-segmented-button
2
+
3
+ A single-select segmented button group: a row of buttons on a 2px-inset track where exactly one segment is active at a time. Each entry in `options` renders as a native `<button role="radio">` inside a `role="radiogroup"`, so the group behaves like a compact radio group (one Tab stop, arrow keys move the selection). Use it for mutually exclusive view or mode switches with two to five short options (list / grid, day / week / month, sort order); do not use it for navigation between pages (use `lof-tab`) or for actions (use `lof-button`).
4
+
5
+ The control comes in three sizes that match the text field ramp — `small` 32px, `medium` 40px, `large` 48px — and each option can carry a leading `icon`.
6
+
7
+ ## Usage
8
+
9
+ ```html
10
+ <!-- Basic: options are set as a property, `active` holds the selected value -->
11
+ <lof-segmented-button id="view-mode" active="grid" field-aria-label="View mode"></lof-segmented-button>
12
+ <script>
13
+ document.getElementById('view-mode').options = [
14
+ { label: 'List', value: 'list' },
15
+ { label: 'Grid', value: 'grid' },
16
+ { label: 'Table', value: 'table' }
17
+ ];
18
+ </script>
19
+
20
+ <!-- Options as a JSON attribute, small size -->
21
+ <lof-segmented-button
22
+ size="small"
23
+ active="week"
24
+ field-aria-label="Calendar range"
25
+ options='[{"label":"Day","value":"day"},{"label":"Week","value":"week"},{"label":"Month","value":"month"}]'>
26
+ </lof-segmented-button>
27
+
28
+ <!-- Large size (48px), matching a large text field -->
29
+ <lof-segmented-button
30
+ size="large"
31
+ active="grid"
32
+ field-aria-label="View mode"
33
+ options='[{"label":"List","value":"list"},{"label":"Grid","value":"grid"}]'>
34
+ </lof-segmented-button>
35
+
36
+ <!-- Leading icons: `icon` names a lof-icon, sized 16 / 18 / 20 with the control -->
37
+ <lof-segmented-button
38
+ active="list"
39
+ field-aria-label="View mode"
40
+ options='[{"label":"List","value":"list","icon":"bullet-list"},{"label":"Grid","value":"grid","icon":"dashboard"}]'>
41
+ </lof-segmented-button>
42
+
43
+ <!-- Disabled option: rendered but not selectable or focusable -->
44
+ <lof-segmented-button id="plan" active="free" field-aria-label="Plan"></lof-segmented-button>
45
+ <script>
46
+ document.getElementById('plan').options = [
47
+ { label: 'Free', value: 'free' },
48
+ { label: 'Pro', value: 'pro' },
49
+ { label: 'Enterprise', value: 'enterprise', disabled: true }
50
+ ];
51
+ </script>
52
+
53
+ <!-- Alignment inside a wider host (align only matters when the host is stretched) -->
54
+ <lof-segmented-button
55
+ style="display: block; width: 100%"
56
+ align="middle"
57
+ active="asc"
58
+ field-aria-label="Sort direction"
59
+ options='[{"label":"Ascending","value":"asc"},{"label":"Descending","value":"desc"}]'>
60
+ </lof-segmented-button>
61
+
62
+ <!-- Listen for changes -->
63
+ <lof-segmented-button id="sort-order" active="newest" field-aria-label="Sort order"></lof-segmented-button>
64
+ <script>
65
+ const sortOrder = document.getElementById('sort-order');
66
+ sortOrder.options = [
67
+ { label: 'Newest', value: 'newest' },
68
+ { label: 'Oldest', value: 'oldest' },
69
+ { label: 'Popular', value: 'popular' }
70
+ ];
71
+ sortOrder.addEventListener('lof-change', (e) => {
72
+ console.log('Selected:', e.detail.value);
73
+ });
74
+ </script>
75
+ ```
76
+
77
+ The `SegmentOption` interface and the `SegmentSize` / `SegmentAlign` unions are exported from the package:
78
+
79
+ ```typescript
80
+ import type { SegmentOption } from '@lofid/web';
81
+
82
+ const options: SegmentOption[] = [
83
+ { label: 'List', value: 'list' }, // label = visible text, value = what `active` / the event carry
84
+ { label: 'Grid', value: 'grid', icon: 'dashboard' }, // icon = a lof-icon name, drawn before the label
85
+ { label: 'Archive', value: 'archive', disabled: true } // rendered at 50% opacity, skipped by the arrow keys
86
+ ];
87
+ ```
88
+
89
+ <!-- readme-gen:start -->
90
+
91
+ <!-- Generated from lof-segmented-button.ts — do not edit; run readme-generate.mjs -->
92
+
93
+ ## API
94
+
95
+ ### Attributes / Properties
96
+
97
+ | Property | Attribute | Type | Default | Description |
98
+ | --- | --- | --- | --- | --- |
99
+ | `options` | `options` | `SegmentOption[]` | `[]` | The segments in order, each `{ label: string; value: string; disabled?: boolean; icon?: string; badge?: number \| string \| boolean }`. Set as a property (or a JSON array attribute); a disabled entry is rendered but cannot be selected, and `icon` names a `lof-icon` drawn before the label. |
100
+ | `active` | `active` | `string` | `""` | `value` of the currently selected segment. Updated by the component on click / arrow keys; set it to pre-select a segment (an unknown value selects nothing). |
101
+ | `disabled` | `disabled` | `boolean` | `false` | Disables the whole group (click and keyboard) without changing individual `options[].disabled` settings. Angular `control.disable()` uses it. New in 1.5.0. Reflected. |
102
+ | `size` | `size` | `"small" \| "medium" \| "large"` | `"medium"` | Control height, matching the TextField ramp: `small` (32px — 28px segments, `action-md` 12px text, 16px icons), `medium` (default, 40px — 36px segments, `action-lg` 14px text, 18px icons) or `large` (48px — 44px segments, `action-xl` 16px text, 20px icons). |
103
+ | `align` | `align` | `"left" \| "middle" \| "right"` | `"left"` | `justify-content` of the group's inline-flex container: `left` (default), `middle` or `right`. Only visible when the host is made wider than its content. |
104
+ | `fieldAriaLabel` | `field-aria-label` | `string` | `undefined` | Accessible name for the radiogroup (it renders no visible group label). |
105
+
106
+ ## Events
107
+
108
+ | Event | Detail | Bubbles / composed | Description |
109
+ | --- | --- | --- | --- |
110
+ | `changed` | `{ value: option.value }` | bubbles / composed | Legacy alias of `lof-change`, fired with the same detail at the same time. Kept indefinitely so existing listeners keep working; new code should use `lof-change`. |
111
+ | `lof-change` | `{ value: option.value }` | bubbles / composed | Fired after a non-disabled segment is selected by click or arrow / Home / End key (also when it was already the active one). Detail: `{ value: string }`. The canonical name — prefer it over the legacy `changed`, which fires alongside it with the same detail. |
112
+
113
+ ## Slots
114
+
115
+ | Slot | Description |
116
+ | --- | --- |
117
+ | — | This element has no slots. |
118
+
119
+ ## CSS Parts
120
+
121
+ | Part | Description |
122
+ | --- | --- |
123
+ | `option` | Each segment's native `<button role="radio">`; the active one carries the `active` class and `aria-checked="true"`. |
124
+ | `icon` | A segment's optional leading `lof-icon` element. |
125
+ | `label` | The wrapper around a segment's label text. |
126
+ | `badge` | A segment's optional trailing `lof-badge`; rendered only when the option sets `badge`. |
127
+ | `base` | The `role="radiogroup"` track that lays out the segments. |
128
+
129
+ <!-- readme-gen:end -->
130
+
131
+ ## Accessibility
132
+
133
+ - The container is a `role="radiogroup"`; give it a name with `field-aria-label` — the component renders no visible group label, so without it screen readers announce an unnamed group.
134
+ - Every segment is a native `<button role="radio">` with `aria-checked="true"` on the active one and `aria-checked="false"` on the rest. Disabled options get the native `disabled` attribute, so they are not focusable and do not fire `click`.
135
+ - Roving tabindex (APG radio-group pattern): the whole group is a single Tab stop. The active segment carries `tabindex="0"`; if `active` matches no enabled option, the first enabled segment takes the Tab stop instead (without becoming selected). All other segments are `tabindex="-1"`.
136
+ - Arrow keys both move focus and select, so they emit the change event immediately. Focus is moved to the newly active segment after the re-render.
137
+ - Focus ring: a 2px `border-focus` outline drawn inside the segment (`outline-offset: -2px`) and raised with `z-index: 1` so it stays above the neighbouring segment.
138
+ - Nothing is announced beyond the native `aria-checked` change.
139
+
140
+ | Key | Action |
141
+ | --- | --- |
142
+ | `Tab` / `Shift+Tab` | Move focus into / out of the group (one stop, on the active segment) |
143
+ | `ArrowRight` / `ArrowDown` | Select and focus the next enabled segment (wraps to the first) |
144
+ | `ArrowLeft` / `ArrowUp` | Select and focus the previous enabled segment (wraps to the last) |
145
+ | `Home` / `End` | Select and focus the first / last enabled segment |
146
+ | `Enter` / `Space` | Native button activation: selects the focused segment |
147
+
148
+ ## Notes / Edge Cases
149
+
150
+ - **Two events fire for one selection — listen to ONE of them or your handler runs twice.** The change event is `lof-change`, matching the rest of the library. The legacy un-prefixed `changed` fires alongside it with the same detail and is kept so existing listeners keep working — listen to one, not both. Both bubble and are composed, so either can be caught on any ancestor, and both fire when the already-active segment is clicked again.
151
+ - `active` is a plain string compared against `option.value`; setting it to a value that is not in `options` (or to a disabled option's value) renders no active segment.
152
+ - `options` is compared by reference: mutate-in-place changes are not picked up — assign a new array.
153
+ - The host is `display: inline-block` and the group `inline-flex`, so it sizes to its content; `align` has no visible effect until the host is stretched (e.g. `style="display: block; width: 100%"`). Every segment has `min-width: 80px`, so a group is never narrower than 80px per segment.
154
+ - Sizing: the track is a `bg-neutral` surface with `spacing-3xs` (2px) padding and a `border-radius-xs` corner — there is no outer border and no dividers between segments. Each segment carries the full `border-radius-xs` on all four corners in every state. Segment heights are 28 / 36 / 44 for `small` / `medium` / `large`, which with the 2px inset give control heights of 32 / 40 / 48.
155
+ - Per size: padding `spacing-3xs spacing-sm` / `spacing-2xs spacing-md` / `spacing-xs spacing-lg`, text `action-md` (12px) / `action-lg` (14px) / `action-xl` (16px), and leading icons at 16 / 18 / 20px with an `spacing-xs` (8px) gap.
156
+ - Colours: the active segment uses `action-neutral-fill` with inverse text (and `action-neutral-fill-hover` on hover); a non-active segment is transparent so the `action-overlay-hover` alpha composites over the track; disabled segments are drawn at 50% opacity with `bg-neutral-elevated-1` and a `not-allowed` cursor. Background and colour transitions are 0.2s.
157
+ - A per-option `icon` renders a `lof-icon` before the label. Its size rides `--lof-icon-size` set directly on the `lof-icon` element — not on a wrapper, since `lof-icon` reflects `size="md"` and its own `:host([size])` rule would otherwise win.
158
+ - No design-token overrides or `--lof-segmented-button-*` hooks are exposed; style through the `base` / `option` / `icon` / `label` parts.