@lofid/web 1.0.0 → 1.1.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.
Files changed (39) hide show
  1. package/README.md +19 -0
  2. package/custom-elements.json +4853 -3129
  3. package/dist/index.d.ts +441 -16
  4. package/dist/index.js +4217 -1994
  5. package/dist/index.js.map +1 -1
  6. package/dist/styles/motion.css +1 -1
  7. package/dist/styles/typography.css +41 -0
  8. package/dist/styles/typography.json +858 -0
  9. package/dist/styles/vars.css +660 -305
  10. package/package.json +4 -2
  11. package/readmes/lof-avatar/README.md +3 -2
  12. package/readmes/lof-button/README.md +22 -23
  13. package/readmes/lof-calendar/README.md +1 -1
  14. package/readmes/lof-card/README.md +41 -11
  15. package/readmes/lof-chip/README.md +153 -141
  16. package/readmes/lof-date-picker/README.md +1 -1
  17. package/readmes/lof-empty-state/README.md +78 -0
  18. package/readmes/lof-image-input/README.md +75 -0
  19. package/readmes/lof-kbd/README.md +3 -3
  20. package/readmes/lof-layout/README.md +122 -122
  21. package/readmes/lof-link/README.md +67 -0
  22. package/readmes/lof-nav/README.md +90 -0
  23. package/readmes/lof-page-header/README.md +71 -0
  24. package/readmes/lof-pagination/README.md +141 -141
  25. package/readmes/lof-progress/README.md +2 -2
  26. package/readmes/lof-radio/README.md +2 -2
  27. package/readmes/lof-rating/README.md +90 -0
  28. package/readmes/lof-segmented-button/README.md +2 -2
  29. package/readmes/lof-select/README.md +3 -3
  30. package/readmes/lof-split-button/README.md +2 -2
  31. package/readmes/lof-stat/README.md +73 -0
  32. package/readmes/lof-stepper/README.md +1 -1
  33. package/readmes/lof-switch/README.md +2 -2
  34. package/readmes/lof-tab/README.md +8 -4
  35. package/readmes/lof-table/README.md +114 -0
  36. package/readmes/lof-textfield/README.md +4 -4
  37. package/readmes/lof-time-picker/README.md +1 -1
  38. package/readmes/lof-tooltip/README.md +2 -2
  39. package/readmes/lof-upload/README.md +1 -1
@@ -1,141 +1,141 @@
1
- # lof-pagination
2
-
3
- Page navigation implementing the Figma "Pagination" component in its three **Type** layouts: `extended` (prev/next ghost buttons around numbered page chips, with a windowed ellipsis for long ranges), `compact` (prev/next around a "Page X of Y" readout) and `count-text` (a "1–10 of 50" item range with the nav on the right). Use it under tables, lists and search results that load one page at a time. It never fetches data or reads the URL: listen for `lof-change` and load the requested page yourself.
4
-
5
- ## Usage
6
-
7
- ```html
8
- <!-- Extended (default): numbered pages, uncontrolled -->
9
- <lof-pagination total-pages="12" default-page="3"></lof-pagination>
10
-
11
- <!-- Extended with the "Viewing page X of Y" caption -->
12
- <lof-pagination total-pages="20" show-label></lof-pagination>
13
-
14
- <!-- Compact: prev / "Page X of Y" / next -->
15
- <lof-pagination type="compact" total-pages="8"></lof-pagination>
16
-
17
- <!-- Count-text: item range computed from total-items and per-page -->
18
- <lof-pagination type="count-text" total-items="137" per-page="25"></lof-pagination>
19
-
20
- <!-- Controlled: the parent owns the page -->
21
- <lof-pagination id="results" page="1" total-pages="40" ariaLabel="Search results pagination"></lof-pagination>
22
- <script>
23
- const pager = document.getElementById('results');
24
- pager.addEventListener('lof-change', (e) => {
25
- loadResults(e.detail.page).then(() => {
26
- pager.page = e.detail.page; // commit once the data is in
27
- });
28
- });
29
- </script>
30
-
31
- <!-- Disabled while loading -->
32
- <lof-pagination total-pages="12" disabled></lof-pagination>
33
-
34
- <!-- New in 1.5.0. Page select: prev / "Page [dropdown] of Y" / next; the dropdown jumps to any page -->
35
- <lof-pagination type="page-select" total-pages="40"></lof-pagination>
36
-
37
- <!-- New in 1.5.0. A rows-per-page selector after the navigation (Figma "Extended with Rows").
38
- Works with every type; choosing a value updates per-page and returns to page 1. -->
39
- <lof-pagination total-items="137" per-page="20" show-rows-per-page></lof-pagination>
40
- <lof-pagination type="count-text" total-items="137" per-page="25"
41
- show-rows-per-page rows-per-page-options="[25, 50, 100]"></lof-pagination>
42
- <script>
43
- document.querySelector('lof-pagination[show-rows-per-page]')
44
- .addEventListener('lof-per-page-change', (e) => reload({ perPage: e.detail.perPage, page: 1 }));
45
- </script>
46
- ```
47
-
48
- Without `show-rows-per-page` there is no rows-per-page selector, and every type except `page-select` has no jump-to-page control: those are the defaults, so existing markup renders exactly as before.
49
-
50
- ### Deprecated aliases
51
-
52
- ```html
53
- <!-- Lowercase-joined attribute spellings → kebab-case (since 1.5.0; still work, log a one-time
54
- console notice, removed in 3.0). camelCase markup (totalPages="12") lands on these too. -->
55
- <lof-pagination totalpages="12" defaultpage="3" showlabel></lof-pagination>
56
- <lof-pagination type="count-text" totalitems="137" perpage="25" hreftemplate="?page={page}"></lof-pagination>
57
- <!-- canonical -->
58
- <lof-pagination total-pages="12" default-page="3" show-label></lof-pagination>
59
- <lof-pagination type="count-text" total-items="137" per-page="25" href-template="?page={page}"></lof-pagination>
60
- ```
61
-
62
- <!-- readme-gen:start -->
63
-
64
- <!-- Generated from lof-pagination.ts — do not edit; run readme-generate.mjs -->
65
-
66
- ## API
67
-
68
- ### Attributes / Properties
69
-
70
- | Property | Attribute | Type | Default | Description |
71
- | --- | --- | --- | --- | --- |
72
- | `type` | `type` | `"extended" \| "compact" \| "count-text" \| "page-select"` | `"extended"` | Figma "Type": `extended` = prev/next + numbered page buttons (auto-collapses to compact under 480px container width), `compact` = prev/next + "Page X of Y", `count-text` = "start–end of total" item range + prev/next around the current page number, `page-select` = prev/next around "Page [select] of Y", a dropdown that jumps to any page (new in 1.5.0). Every type except `page-select` has no jump-to-page control. Reflected. |
73
- | `page` | `page` | `number` | `undefined` | Controlled current page (1-based). When set, the element only emits `lof-change` and waits for the parent to update `page`; leave unset for uncontrolled behaviour. |
74
- | `defaultPage` | `default-page` | `number` | `1` | Starting page for uncontrolled use (ignored when `page` is set). The `defaultpage` attribute spelling is deprecated (still works; removal targeted for 3.0). |
75
- | `totalPages` | `total-pages` | `number` | `0` | Total number of pages. `0` (the default) lets `totalItems` / `perPage` compute the page count instead. The `totalpages` attribute spelling is deprecated (still works; removal targeted for 3.0). |
76
- | `totalItems` | `total-items` | `number` | `0` | Total item count; with `perPage` it computes the page count when `totalPages` is `0` and is the "of N" figure in the count-text readout. The `totalitems` attribute spelling is deprecated (still works; removal targeted for 3.0). |
77
- | `perPage` | `per-page` | `number` | `10` | Items per page, used to compute the page count from `totalItems` and the "start–end" range in the count-text readout. The `perpage` attribute spelling is deprecated (still works; removal targeted for 3.0). |
78
- | `showLabel` | `show-label` | `boolean` | `false` | Shows a "Viewing page X of Y" caption under the extended layout (ignored by the other types). Off by default. The `showlabel` attribute spelling is deprecated (still works; removal targeted for 3.0). |
79
- | `disabled` | `disabled` | `boolean` | `false` | Dims the whole control to 40% opacity, shows a `not-allowed` cursor and ignores every page change. Reflected. |
80
- | `hrefTemplate` | `href-template` | `string` | `""` | Reserved for link-mode pagination. Currently accepted but not rendered: every page control is a `<button>`, so navigate in your `lof-change` handler instead. The `hreftemplate` attribute spelling is deprecated (still works; removal targeted for 3.0). |
81
- | `ariaLabel` | `arialabel` | `string` | `"Pagination"` | Accessible name of the `role="navigation"` landmark (attribute `ariaLabel`). Set it when a page contains more than one pagination control. |
82
- | `showRowsPerPage` | `show-rows-per-page` | `boolean` | `false` | New in 1.5.0. Adds a rows-per-page selector after the navigation, with any `type` (Figma "Extended with Rows" is `type="extended"` with this set). Choosing a value sets `perPage`, fires `lof-per-page-change` and returns to page 1. Off by default: no rows-per-page selector. |
83
- | `rowsPerPageOptions` | `rows-per-page-options` | `number[]` | `[10, 20, 50, 100]` | New in 1.5.0. The values the rows-per-page selector offers (a number array, or a JSON array in the attribute). The current `perPage` is added to the list when it is not in it. |
84
- | `rowsPerPageLabel` | `rows-per-page-label` | `string` | `"Results per Page"` | New in 1.5.0. Text before the rows-per-page selector, also its accessible name. |
85
-
86
- ## Events
87
-
88
- | Event | Detail | Bubbles / composed | Description |
89
- | --- | --- | --- | --- |
90
- | `lof-change` | `{ page: newPage }` | bubbles / composed | Fired when the user picks another page (prev/next or a page number). Detail: `{ page: number }` (1-based). In controlled mode the parent must then set `page`. |
91
- | `lof-per-page-change` | `{ perPage }` | bubbles / composed | New in 1.5.0. Fired when the user picks a value in the rows-per-page selector (`show-rows-per-page`). Detail: `{ perPage: number }`. `perPage` is already updated; the element then returns to page 1 (in controlled mode it fires `lof-change` with `{ page: 1 }` for the parent to commit). |
92
-
93
- ## Slots
94
-
95
- | Slot | Description |
96
- | --- | --- |
97
- | — | This element has no slots. |
98
-
99
- ## CSS Parts
100
-
101
- | Part | Description |
102
- | --- | --- |
103
- | `base` | The `role="navigation"` root of the extended layout (page buttons plus the optional "Viewing page" label). |
104
- | `label` | The `role="navigation"` root row of the count-text layout (item-range text plus prev/next nav). |
105
- | `page-select` | The `lof-select` of the `page-select` layout (the jump-to-page dropdown). New in 1.5.0. |
106
- | `rows-per-page` | The rows-per-page block (its text plus the `lof-select`), rendered with `show-rows-per-page`. New in 1.5.0. |
107
-
108
- <!-- readme-gen:end -->
109
-
110
- ## Accessibility
111
-
112
- - The control is a `role="navigation"` landmark named by `ariaLabel` (default "Pagination"); give each pager on a page a distinct name.
113
- - Prev/next are native buttons labelled "Previous page" / "Next page"; they are disabled (not hidden) on the first / last page.
114
- - Each page chip is a native button labelled "Page N" with `aria-current="page"` on the current one. Abbreviated first/last chips (e.g. "368k") keep the exact number in their `title`.
115
- - Every page change is announced to screen readers as "Page N of M" via the shared live region.
116
- - If a prev/next button becomes disabled while it has focus (you reached the first/last page), focus moves to the other nav button instead of being lost.
117
- - `type="page-select"` (new in 1.5.0): the dropdown is a `lof-select` combobox named "Page (of N)", so it is read as, for example, "Page (of 40), 3". The visible "Page" and "of N" texts are hidden from assistive technology because the name already carries them. It sits inside the navigation landmark, and picking a page is announced like any other page change.
118
- - `show-rows-per-page` (new in 1.5.0): the rows-per-page dropdown is a `lof-select` combobox named by `rows-per-page-label` (default "Results per Page"), placed after the navigation landmark rather than inside it. Its visible text is hidden from assistive technology for the same reason.
119
- - `disabled` also disables both dropdowns.
120
-
121
- | Key | Action |
122
- | --- | --- |
123
- | `Tab` / `Shift+Tab` | Move between the prev button, page chips (or the page dropdown) and next button, then the rows-per-page dropdown |
124
- | `Enter` / `Space` | Activate the focused button (native behaviour); on a dropdown, open it |
125
- | `ArrowDown` / `ArrowUp`, `Enter`, `Escape` (dropdown open) | Move the highlight, pick the highlighted value, close without picking (lof-select's keyboard model) |
126
- | Typing (page dropdown open) | Moves the highlight to the next page that starts with the digits typed within half a second (2 then 5 for page 25); Enter picks it |
127
-
128
- The page chips and nav buttons have no arrow-key navigation; they are regular tab stops.
129
-
130
- ## Notes / Edge Cases
131
-
132
- - **Attribute names.** Multi-word attributes are kebab-case: `total-pages`, `default-page`, `total-items`, `per-page`, `show-label`, `href-template`. They are observed like any other attribute, so later changes apply. The older lowercase spellings (which camelCase markup also produces, since HTML attribute names are case-insensitive) still work since 1.5.0 but log a one-time console notice and are removed in 3.0; see Deprecated aliases. `ariaLabel` keeps its `arialabel` attribute.
133
- - **Page count.** `totalPages` wins when greater than `0`; otherwise the count is `ceil(totalItems / perPage)`. With neither set the element renders no page chips and both nav buttons disabled.
134
- - **Controlled vs uncontrolled.** With `page` unset the element tracks the current page itself starting at `defaultPage`. Once `page` is set it stays on that page until the parent changes it — clicking only emits `lof-change`.
135
- - **Ellipsis window.** Up to 7 pages render in full. Beyond that: the first 5 + last near the start, first + last 5 near the end, otherwise first, current ±1 and last, with `…` between. Far first/last chips abbreviate large numbers (`10000` → `10k`, `2500000` → `2.5M`); chips inside the window are never abbreviated.
136
- - **Responsive.** `extended` uses a container query on the host: between 480px and 768px only first, last and current ±1 stay visible, with `…` wherever that hides two or more pages (a single hidden page stays visible instead); under 480px the whole control swaps to the compact layout (media-query fallback for browsers without container queries). The `label` part belongs to the `count-text` layout, not to the "Viewing page" caption.
137
- - **`hrefTemplate`** is accepted but currently unused — chips are always buttons, not links. Perform navigation in the `lof-change` handler.
138
- - **`lof-change` is not fired** for the current page, out-of-range pages, or while `disabled`.
139
- - **Page select.** The dropdown lists every page. Above 1,000 pages it lists a window of 1,000 around the current page plus the first and last, so the list stays fast. In controlled mode the dropdown snaps back to `page` until the parent commits the new one.
140
- - **Rows per page.** `rows-per-page-options` defaults to `[10, 20, 50, 100]`; the current `per-page` is added when it is not in the list. A pick sets `perPage`, fires `lof-per-page-change` (`{ perPage }`), then returns to page 1: uncontrolled, the element moves and fires `lof-change` with `{ page: 1 }`; controlled, it only fires `lof-change` with `{ page: 1 }`. When it is already on page 1, no `lof-change` fires. The inner dropdowns' own `changed` / `lof-change` events stop at the dropdown, so a listener on the pagination only ever sees `{ page }`.
141
- - **Narrow containers.** With `show-rows-per-page` the navigation and the rows-per-page block share one row, 16px apart, and wrap onto two rows when they do not fit.
1
+ # lof-pagination
2
+
3
+ Page navigation implementing the Figma "Pagination" component in its three **Type** layouts: `extended` (prev/next ghost buttons around numbered page chips, with a windowed ellipsis for long ranges), `compact` (prev/next around a "Page X of Y" readout) and `count-text` (a "1–10 of 50" item range with the nav on the right). Use it under tables, lists and search results that load one page at a time. It never fetches data or reads the URL: listen for `lof-change` and load the requested page yourself.
4
+
5
+ ## Usage
6
+
7
+ ```html
8
+ <!-- Extended (default): numbered pages, uncontrolled -->
9
+ <lof-pagination total-pages="12" default-page="3"></lof-pagination>
10
+
11
+ <!-- Extended with the "Viewing page X of Y" caption -->
12
+ <lof-pagination total-pages="20" show-label></lof-pagination>
13
+
14
+ <!-- Compact: prev / "Page X of Y" / next -->
15
+ <lof-pagination type="compact" total-pages="8"></lof-pagination>
16
+
17
+ <!-- Count-text: item range computed from total-items and per-page -->
18
+ <lof-pagination type="count-text" total-items="137" per-page="25"></lof-pagination>
19
+
20
+ <!-- Controlled: the parent owns the page -->
21
+ <lof-pagination id="results" page="1" total-pages="40" ariaLabel="Search results pagination"></lof-pagination>
22
+ <script>
23
+ const pager = document.getElementById('results');
24
+ pager.addEventListener('lof-change', (e) => {
25
+ loadResults(e.detail.page).then(() => {
26
+ pager.page = e.detail.page; // commit once the data is in
27
+ });
28
+ });
29
+ </script>
30
+
31
+ <!-- Disabled while loading -->
32
+ <lof-pagination total-pages="12" disabled></lof-pagination>
33
+
34
+ <!-- New in 1.5.0. Page select: prev / "Page [dropdown] of Y" / next; the dropdown jumps to any page -->
35
+ <lof-pagination type="page-select" total-pages="40"></lof-pagination>
36
+
37
+ <!-- New in 1.5.0. A rows-per-page selector after the navigation (Figma "Extended with Rows").
38
+ Works with every type; choosing a value updates per-page and returns to page 1. -->
39
+ <lof-pagination total-items="137" per-page="20" show-rows-per-page></lof-pagination>
40
+ <lof-pagination type="count-text" total-items="137" per-page="25"
41
+ show-rows-per-page rows-per-page-options="[25, 50, 100]"></lof-pagination>
42
+ <script>
43
+ document.querySelector('lof-pagination[show-rows-per-page]')
44
+ .addEventListener('lof-per-page-change', (e) => reload({ perPage: e.detail.perPage, page: 1 }));
45
+ </script>
46
+ ```
47
+
48
+ Without `show-rows-per-page` there is no rows-per-page selector, and every type except `page-select` has no jump-to-page control: those are the defaults, so existing markup renders exactly as before.
49
+
50
+ ### Deprecated aliases
51
+
52
+ ```html
53
+ <!-- Lowercase-joined attribute spellings → kebab-case (since 1.5.0; still work, log a one-time
54
+ console notice, removed in 3.0). camelCase markup (totalPages="12") lands on these too. -->
55
+ <lof-pagination totalpages="12" defaultpage="3" showlabel></lof-pagination>
56
+ <lof-pagination type="count-text" totalitems="137" perpage="25" hreftemplate="?page={page}"></lof-pagination>
57
+ <!-- canonical -->
58
+ <lof-pagination total-pages="12" default-page="3" show-label></lof-pagination>
59
+ <lof-pagination type="count-text" total-items="137" per-page="25" href-template="?page={page}"></lof-pagination>
60
+ ```
61
+
62
+ <!-- readme-gen:start -->
63
+
64
+ <!-- Generated from lof-pagination.ts — do not edit; run readme-generate.mjs -->
65
+
66
+ ## API
67
+
68
+ ### Attributes / Properties
69
+
70
+ | Property | Attribute | Type | Default | Description |
71
+ | --- | --- | --- | --- | --- |
72
+ | `type` | `type` | `"extended" \| "compact" \| "count-text" \| "page-select"` | `"extended"` | Figma "Type": `extended` = prev/next + numbered page buttons (auto-collapses to compact under 480px container width), `compact` = prev/next + "Page X of Y", `count-text` = "start–end of total" item range + prev/next around the current page number, `page-select` = prev/next around "Page [select] of Y", a dropdown that jumps to any page (new in 1.5.0). Every type except `page-select` has no jump-to-page control. Reflected. |
73
+ | `page` | `page` | `number` | `undefined` | Controlled current page (1-based). When set, the element only emits `lof-change` and waits for the parent to update `page`; leave unset for uncontrolled behaviour. |
74
+ | `defaultPage` | `default-page` | `number` | `1` | Starting page for uncontrolled use (ignored when `page` is set). The `defaultpage` attribute spelling is deprecated (still works; removal targeted for 3.0). |
75
+ | `totalPages` | `total-pages` | `number` | `0` | Total number of pages. `0` (the default) lets `totalItems` / `perPage` compute the page count instead. The `totalpages` attribute spelling is deprecated (still works; removal targeted for 3.0). |
76
+ | `totalItems` | `total-items` | `number` | `0` | Total item count; with `perPage` it computes the page count when `totalPages` is `0` and is the "of N" figure in the count-text readout. The `totalitems` attribute spelling is deprecated (still works; removal targeted for 3.0). |
77
+ | `perPage` | `per-page` | `number` | `10` | Items per page, used to compute the page count from `totalItems` and the "start–end" range in the count-text readout. The `perpage` attribute spelling is deprecated (still works; removal targeted for 3.0). |
78
+ | `showLabel` | `show-label` | `boolean` | `false` | Shows a "Viewing page X of Y" caption under the extended layout (ignored by the other types). Off by default. The `showlabel` attribute spelling is deprecated (still works; removal targeted for 3.0). |
79
+ | `disabled` | `disabled` | `boolean` | `false` | Dims the whole control to 40% opacity, shows a `not-allowed` cursor and ignores every page change. Reflected. |
80
+ | `hrefTemplate` | `href-template` | `string` | `""` | Reserved for link-mode pagination. Currently accepted but not rendered: every page control is a `<button>`, so navigate in your `lof-change` handler instead. The `hreftemplate` attribute spelling is deprecated (still works; removal targeted for 3.0). |
81
+ | `ariaLabel` | `arialabel` | `string` | `"Pagination"` | Accessible name of the `role="navigation"` landmark (attribute `ariaLabel`). Set it when a page contains more than one pagination control. |
82
+ | `showRowsPerPage` | `show-rows-per-page` | `boolean` | `false` | New in 1.5.0. Adds a rows-per-page selector after the navigation, with any `type` (Figma "Extended with Rows" is `type="extended"` with this set). Choosing a value sets `perPage`, fires `lof-per-page-change` and returns to page 1. Off by default: no rows-per-page selector. |
83
+ | `rowsPerPageOptions` | `rows-per-page-options` | `number[]` | `[10, 20, 50, 100]` | New in 1.5.0. The values the rows-per-page selector offers (a number array, or a JSON array in the attribute). The current `perPage` is added to the list when it is not in it. |
84
+ | `rowsPerPageLabel` | `rows-per-page-label` | `string` | `"Results per Page"` | New in 1.5.0. Text before the rows-per-page selector, also its accessible name. |
85
+
86
+ ## Events
87
+
88
+ | Event | Detail | Bubbles / composed | Description |
89
+ | --- | --- | --- | --- |
90
+ | `lof-change` | `{ page: newPage }` | bubbles / composed | Fired when the user picks another page (prev/next or a page number). Detail: `{ page: number }` (1-based). In controlled mode the parent must then set `page`. |
91
+ | `lof-per-page-change` | `{ perPage }` | bubbles / composed | New in 1.5.0. Fired when the user picks a value in the rows-per-page selector (`show-rows-per-page`). Detail: `{ perPage: number }`. `perPage` is already updated; the element then returns to page 1 (in controlled mode it fires `lof-change` with `{ page: 1 }` for the parent to commit). |
92
+
93
+ ## Slots
94
+
95
+ | Slot | Description |
96
+ | --- | --- |
97
+ | — | This element has no slots. |
98
+
99
+ ## CSS Parts
100
+
101
+ | Part | Description |
102
+ | --- | --- |
103
+ | `base` | The `role="navigation"` root of the extended layout (page buttons plus the optional "Viewing page" label). |
104
+ | `label` | The `role="navigation"` root row of the count-text layout (item-range text plus prev/next nav). |
105
+ | `page-select` | The `lof-select` of the `page-select` layout (the jump-to-page dropdown). New in 1.5.0. |
106
+ | `rows-per-page` | The rows-per-page block (its text plus the `lof-select`), rendered with `show-rows-per-page`. New in 1.5.0. |
107
+
108
+ <!-- readme-gen:end -->
109
+
110
+ ## Accessibility
111
+
112
+ - The control is a `role="navigation"` landmark named by `ariaLabel` (default "Pagination"); give each pager on a page a distinct name.
113
+ - Prev/next are native buttons labelled "Previous page" / "Next page"; they are disabled (not hidden) on the first / last page.
114
+ - Each page chip is a native button labelled "Page N" with `aria-current="page"` on the current one. Abbreviated first/last chips (e.g. "368k") keep the exact number in their `title`.
115
+ - Every page change is announced to screen readers as "Page N of M" via the shared live region.
116
+ - If a prev/next button becomes disabled while it has focus (you reached the first/last page), focus moves to the other nav button instead of being lost.
117
+ - `type="page-select"` (new in 1.5.0): the dropdown is a `lof-select` combobox named "Page (of N)", so it is read as, for example, "Page (of 40), 3". The visible "Page" and "of N" texts are hidden from assistive technology because the name already carries them. It sits inside the navigation landmark, and picking a page is announced like any other page change.
118
+ - `show-rows-per-page` (new in 1.5.0): the rows-per-page dropdown is a `lof-select` combobox named by `rows-per-page-label` (default "Results per Page"), placed after the navigation landmark rather than inside it. Its visible text is hidden from assistive technology for the same reason.
119
+ - `disabled` also disables both dropdowns.
120
+
121
+ | Key | Action |
122
+ | --- | --- |
123
+ | `Tab` / `Shift+Tab` | Move between the prev button, page chips (or the page dropdown) and next button, then the rows-per-page dropdown |
124
+ | `Enter` / `Space` | Activate the focused button (native behaviour); on a dropdown, open it |
125
+ | `ArrowDown` / `ArrowUp`, `Enter`, `Escape` (dropdown open) | Move the highlight, pick the highlighted value, close without picking (lof-select's keyboard model) |
126
+ | Typing (page dropdown open) | Moves the highlight to the next page that starts with the digits typed within half a second (2 then 5 for page 25); Enter picks it |
127
+
128
+ The page chips and nav buttons have no arrow-key navigation; they are regular tab stops.
129
+
130
+ ## Notes / Edge Cases
131
+
132
+ - **Attribute names.** Multi-word attributes are kebab-case: `total-pages`, `default-page`, `total-items`, `per-page`, `show-label`, `href-template`. They are observed like any other attribute, so later changes apply. The older lowercase spellings (which camelCase markup also produces, since HTML attribute names are case-insensitive) still work since 1.5.0 but log a one-time console notice and are removed in 3.0; see Deprecated aliases. `ariaLabel` keeps its `arialabel` attribute.
133
+ - **Page count.** `totalPages` wins when greater than `0`; otherwise the count is `ceil(totalItems / perPage)`. With neither set the element renders no page chips and both nav buttons disabled.
134
+ - **Controlled vs uncontrolled.** With `page` unset the element tracks the current page itself starting at `defaultPage`. Once `page` is set it stays on that page until the parent changes it — clicking only emits `lof-change`.
135
+ - **Ellipsis window.** Up to 7 pages render in full. Beyond that: the first 5 + last near the start, first + last 5 near the end, otherwise first, current ±1 and last, with `…` between. Far first/last chips abbreviate large numbers (`10000` → `10k`, `2500000` → `2.5M`); chips inside the window are never abbreviated.
136
+ - **Responsive.** `extended` uses a container query on the host: between 480px and 768px only first, last and current ±1 stay visible, with `…` wherever that hides two or more pages (a single hidden page stays visible instead); under 480px the whole control swaps to the compact layout (media-query fallback for browsers without container queries). Because the host is a size container it takes its width from its container, not its content: in a flex row give it a basis (`flex: 1 1 18rem`) or it shrinks to zero width and its buttons spill out. The `label` part belongs to the `count-text` layout, not to the "Viewing page" caption.
137
+ - **`hrefTemplate`** is accepted but currently unused — chips are always buttons, not links. Perform navigation in the `lof-change` handler.
138
+ - **`lof-change` is not fired** for the current page, out-of-range pages, or while `disabled`.
139
+ - **Page select.** The dropdown lists every page. Above 1,000 pages it lists a window of 1,000 around the current page plus the first and last, so the list stays fast. In controlled mode the dropdown snaps back to `page` until the parent commits the new one.
140
+ - **Rows per page.** `rows-per-page-options` defaults to `[10, 20, 50, 100]`; the current `per-page` is added when it is not in the list. A pick sets `perPage`, fires `lof-per-page-change` (`{ perPage }`), then returns to page 1: uncontrolled, the element moves and fires `lof-change` with `{ page: 1 }`; controlled, it only fires `lof-change` with `{ page: 1 }`. When it is already on page 1, no `lof-change` fires. The inner dropdowns' own `changed` / `lof-change` events stop at the dropdown, so a listener on the pagination only ever sees `{ page }`.
141
+ - **Narrow containers.** With `show-rows-per-page` the navigation and the rows-per-page block share one row, 16px apart, and wrap onto two rows when they do not fit.
@@ -1,6 +1,6 @@
1
1
  # lof-progress
2
2
 
3
- `<lof-progress>` is the Figma "Progress" indicator in its two shapes and two behaviours: a full-width 2px linear bar or a 36px circular ring, each either determinate (fills to `value`, 0–100) or indeterminate (loops an animation while you wait). Use `linear-determinate` / `circular-determinate` for uploads, imports and multi-step flows where progress is known, and the `*-indeterminate` modes as a loading signal while a request is in flight. It is a passive `role="progressbar"` element — it does not block interaction (use `lof-modal` with `loading` for that) and does not announce completion on its own.
3
+ `<lof-progress>` is the Figma "Progress" indicator in its two shapes and two behaviours: a full-width 4px linear bar or a 36px circular ring, each either determinate (fills to `value`, 0–100) or indeterminate (loops an animation while you wait). Use `linear-determinate` / `circular-determinate` for uploads, imports and multi-step flows where progress is known, and the `*-indeterminate` modes as a loading signal while a request is in flight. It is a passive `role="progressbar"` element — it does not block interaction (use `lof-modal` with `loading` for that) and does not announce completion on its own.
4
4
 
5
5
  ## Usage
6
6
 
@@ -82,7 +82,7 @@
82
82
 
83
83
  - `value` is clamped to 0–100 before rendering and before `aria-valuenow`; the indeterminate modes ignore it entirely.
84
84
  - The `track` and `indicator` parts exist only in the two linear modes. The circular modes render an inline `<svg>` with no parts, so `::part(track)` matches nothing there.
85
- - Linear bars are 2px tall with a 4px radius and stretch to the host's width (host is `display: block`). Circular rings are fixed at 36px and the host switches to `display: inline-block`, so they sit inline with text.
85
+ - Linear bars are 4px tall (`--lof-progress-height`) with fully rounded ends and stretch to the host's width (host is `display: block`); circular rings use round caps. Circular rings are fixed at 36px and the host switches to `display: inline-block`, so they sit inline with text.
86
86
  - The linear determinate width animates over 0.3s and the circular arc over 0.35s; a value that jumps from 0 to 100 therefore takes a moment to catch up visually.
87
87
  - Circular strokes are 3px (determinate) and 4px (indeterminate) with a flat (`butt`) line cap; the determinate ring starts at 12 o'clock via a −90° rotation.
88
88
  - The indeterminate linear bar is a 30%-wide segment that sweeps left to right on a 1.5s loop; the spinner rotates on a 2s loop with a 1.5s dash animation.
@@ -17,7 +17,7 @@
17
17
  <lof-radio id="plan" name="plan" field-aria-label="Plan"></lof-radio>
18
18
  <lof-radio id="billing" name="billing" field-aria-label="Billing cycle" orientation="horizontal"></lof-radio>
19
19
 
20
- <!-- Sizes (S and M share the 20px control; L is 24px) -->
20
+ <!-- Sizes (16 / 18 / 20px controls, the same frames as lof-checkbox) -->
21
21
  <lof-radio id="small" name="size-small" size="small"></lof-radio>
22
22
  <lof-radio id="medium" name="size-medium" size="medium"></lof-radio>
23
23
  <lof-radio id="large" name="size-large" size="large"></lof-radio>
@@ -72,7 +72,7 @@ plan.addEventListener("lof-change", (e) => {
72
72
  | `options` | `options` | `RadioOption[]` | `[]` | The options to render, in order. Each entry is a `RadioOption` (`value`, `label`, optional `supportingText`, `disabled`, `icon` or `avatar`). Set as a property (`.options=`) or as a JSON attribute. |
73
73
  | `name` | `name` | `string` | `"radio-group"` | `name` given to every native radio input inside this element. It scopes native radio-group behaviour (arrow-key movement, mutual exclusion) to this group, so give each group on a page a distinct name. |
74
74
  | `orientation` | `orientation` | `"horizontal" \| "vertical"` | `"vertical"` | Layout axis of the option list. `"vertical"` (default) stacks options in a column; `"horizontal"` lays them out in a wrapping row. Reflected. |
75
- | `size` | `size` | `"small" \| "medium" \| "large" \| "sm" \| "md" \| "lg"` | `"medium"` | Control scale, matching Figma's Size axis. `"small"` and `"medium"` (default) both draw a 20px control — they differ by TYPE, body-md labels against body-lg — and `"large"` steps the control to 24px with body-xl labels. Supporting text sits one body step below the label at every size (body-sm / md / lg, i.e. 12 / 14 / 16px). `sm` / `md` / `lg` are alternative spellings and stay supported — normalised to the full words, not deprecated. Small and Medium sharing a control is Figma's design, not an oversight: verified against the live Published DS file on 2026-09-25, `.Radio Control` measures 20x20 in all 15 Small variants and all 15 Medium ones. v1.4.8 briefly gave Small its own 16px control on the mistaken premise that the ramp was 16/20/24; 1.4.9 reverts that. Reflected. |
75
+ | `size` | `size` | `"small" \| "medium" \| "large" \| "sm" \| "md" \| "lg"` | `"medium"` | Control scale. Since the 2026-11 refresh the radio pairs with `lof-checkbox`: `"small"` draws a 16px control with body-sm labels, `"medium"` (default) 18px with body-md, and `"large"` 20px with body-lg. Supporting text sits one body step below the label at every size (10 / 12 / 14px). `sm` / `md` / `lg` are alternative spellings and stay supported — normalised to the full words, not deprecated. (Before the refresh, Small and Medium shared a 20px control and Large was 24px, following the Figma file.) Reflected. |
76
76
  | `density` | `density` | `"compact" \| "comfortable"` | `"compact"` | Supporting-text layout (Figma Density). `"compact"` (default) puts the supporting text on its own line under the row, indented past the control; `"comfortable"` stacks label + supporting text beside the control. Reflected. |
77
77
  | `alignment` | `alignment` | `"leading" \| "trailing"` | `"leading"` | Control position (Figma Layout). `"leading"` (default) renders the control before the label; `"trailing"` pushes it to the far edge of the row. Trailing has no compact layout in the spec, so it always renders with comfortable density. Meant for vertical orientation — trailing options stretch to the group's full width. Reflected. |
78
78
  | `selectedValue` | `selected-value` | `string \| null` | `null` | `value` of the currently selected option, or `null` when nothing is selected. Set it to preselect an option; it is updated on every user selection. Reflected (as `selectedvalue` in 1.x). The `selectedvalue` attribute spelling is deprecated (still works; removal targeted for 3.0). |
@@ -0,0 +1,90 @@
1
+ # lof-rating
2
+
3
+ `<lof-rating>` is a star rating. Read-only it displays any value, fractions included (4.5 draws a half star), as one image with a spoken name such as "Rating: 4.5 of 5". Interactive it is a slider: arrow keys step by `step`, Home and End jump to 0 and `max`, and a click or a hover over a star previews and commits a value. It is form-associated: with a `name` it submits its value like a native input. New in the 2026-11 admin refresh, modelled on the ratings in admin team tables.
4
+
5
+ ## Usage
6
+
7
+ ```html
8
+ <!-- Read-only, as in a table cell -->
9
+ <lof-rating value="4.5" readonly></lof-rating>
10
+
11
+ <!-- Interactive, half steps, with the number beside it -->
12
+ <lof-rating value="3" step="0.5" show-value field-aria-label="Your rating"></lof-rating>
13
+
14
+ <!-- Sizes -->
15
+ <lof-rating value="4" readonly size="small"></lof-rating>
16
+ <lof-rating value="4" readonly size="large"></lof-rating>
17
+
18
+ <!-- In a form: submits score=4 -->
19
+ <form>
20
+ <lof-rating name="score" value="4" field-aria-label="Score"></lof-rating>
21
+ </form>
22
+
23
+ <!-- Listen for changes -->
24
+ <lof-rating id="r" field-aria-label="Rate this team"></lof-rating>
25
+ <script>
26
+ document.getElementById('r').addEventListener('lof-change', (e) => console.log(e.detail.value));
27
+ </script>
28
+ ```
29
+
30
+ <!-- readme-gen:start -->
31
+
32
+ ## API
33
+
34
+ ### Attributes / Properties
35
+
36
+ | Property | Attribute | Type | Default | Description |
37
+ | --- | --- | --- | --- | --- |
38
+ | `value` | `value` | `number` | `0` | Current value, 0 to `max`. Fractions display as partial stars. |
39
+ | `max` | `max` | `number` | `5` | Number of stars. |
40
+ | `step` | `step` | `number` | `1` | Step committed by clicks and keys: `1` (whole stars) or `0.5` (half stars). Display always shows the exact `value`. |
41
+ | `readonly` | `readonly` | `boolean` | `false` | Display only: no hover, clicks or Tab stop. |
42
+ | `disabled` | `disabled` | `boolean` | `false` | |
43
+ | `size` | `size` | `"small" \| "medium" \| "large"` | `"medium"` | Star size: 14 / 16 / 20px. Reflected. |
44
+ | `name` | `name` | `string` | `""` | Form field name; the value is submitted as a number string. |
45
+ | `fieldAriaLabel` | `field-aria-label` | `string` | `""` | Accessible name. Default: "Rating". |
46
+ | `showValue` | `show-value` | `boolean` | `false` | Show the numeric value ("4.5") after the stars. |
47
+
48
+ ## Events
49
+
50
+ | Event | Detail | Bubbles / composed | Description |
51
+ | --- | --- | --- | --- |
52
+ | `lof-change` | `CustomEvent<RatingChangeDetail>` | yes / yes | A click or key committed a new value. `detail.value` is the number. |
53
+
54
+ ## Slots
55
+
56
+ | Slot | Description |
57
+ | --- | --- |
58
+ | — | This element has no slots. |
59
+
60
+ ## CSS Parts
61
+
62
+ | Part | Description |
63
+ | --- | --- |
64
+ | `star` | Each star cell |
65
+ | `base` | The rating group (`role="slider"`, or `role="img"` when read-only) |
66
+ | `label` | The numeric value beside the stars (`show-value`) |
67
+
68
+ ## Tokens / CSS Variables
69
+
70
+ ### Component hooks
71
+
72
+ | Custom property | Default | Description |
73
+ | --- | --- | --- |
74
+ | `--lof-rating-color` | `var(--lof-colors-yellow-400)` | Filled star colour |
75
+ | `--lof-rating-empty-color` | `var(--lof-border-default)` | Empty star colour |
76
+
77
+ <!-- readme-gen:end -->
78
+
79
+ ## Accessibility
80
+
81
+ - Interactive: one Tab stop with `role="slider"`, `aria-valuenow`, `aria-valuemin` (0), `aria-valuemax` (`max`) and `aria-valuetext` ("3.5 of 5"). Arrow Right / Up and Left / Down step by `step` (mirrored in right-to-left), Home goes to 0 and End to `max`.
82
+ - Read-only: `role="img"` named "Rating: 4.5 of 5" (prefix from `field-aria-label`), not focusable.
83
+ - Name an interactive rating with `field-aria-label` (default "Rating").
84
+ - Stars are drawn in SVG and switch to system colours in forced-colours mode.
85
+
86
+ ## Notes / Edge Cases
87
+
88
+ - A value between steps (3.3 with `step="0.5"`) still displays exactly; the next key or click snaps to a step.
89
+ - Hovering previews the value under the pointer; leaving the stars restores `value`.
90
+ - `formResetCallback` restores the `value` attribute when the form resets.
@@ -25,7 +25,7 @@ The control comes in three sizes that match the text field ramp — `small` 32px
25
25
  options='[{"label":"Day","value":"day"},{"label":"Week","value":"week"},{"label":"Month","value":"month"}]'>
26
26
  </lof-segmented-button>
27
27
 
28
- <!-- Large size (48px), matching a large text field -->
28
+ <!-- Large size (40px), matching a large text field -->
29
29
  <lof-segmented-button
30
30
  size="large"
31
31
  active="grid"
@@ -151,7 +151,7 @@ const options: SegmentOption[] = [
151
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
152
  - `options` is compared by reference: mutate-in-place changes are not picked up — assign a new array.
153
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.
154
+ - Sizing (2026-11 refresh): a joined, outlined group — 1px `--lof-border-default` edge, 6px outer corners, hairline seams between segments — 28 / 34 / 40px tall like the buttons. The selected segment takes the muted fill (`--lof-bg-muted`) and Medium weight; hover shows a lighter wash.
155
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
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
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.
@@ -123,7 +123,7 @@ Set these on the host (or an ancestor) to customise the element without touching
123
123
 
124
124
  | Custom property | Default | Description |
125
125
  | --- | --- | --- |
126
- | `--lof-field-label-reserve` | `calc(var(--lof-body-md-regular-line-height) + var(--lof-spacing-2xs))` | Height held for the label row whenever no label renders above the trigger — `labelStyle="none"`, and `labelStyle="floating"` where the label sits inside the trigger — so the trigger still lines up with labelled siblings in a form row. Defaults to that size's label line-height plus the wrapper gap (24px at `small`, 26px at `medium` and `large`). Set to `0` to collapse the row entirely (toolbars, table cells). |
126
+ | `--lof-field-label-reserve` | `0px` | Height held for the label row whenever no label renders above the trigger — `labelStyle="none"`, and `labelStyle="floating"` where the label sits inside the trigger. Nothing is held by default, so an unlabelled field (a search bar) lines up with the buttons beside it. In a form row that mixes labelled and unlabelled fields, set it to the label row's height — `calc(var(--lof-body-field-label-line-height) + var(--lof-spacing-2xs))` (24px at `small`, 26px at `medium` and `large`) — so the triggers share a bottom edge. |
127
127
  | `--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. |
128
128
  | `--lof-select-bg` | `var(--lof-bg-neutral)` | Background of the trigger, the panel and its sticky header. No longer paints behind the floating label — see `--lof-select-surface`. |
129
129
  | `--lof-select-bg-disabled` | `var(--lof-bg-neutral-elevated-2)` | Trigger background when `state="disabled"` |
@@ -189,5 +189,5 @@ Set these on the host (or an ancestor) to customise the element without touching
189
189
  - The search field uses the small field sizing for both `small` and `medium` selects; only `large` bumps it to medium. Empty results show "No matches found" (or "No options available" when `options` is empty).
190
190
  - The `helper` part exists only while `supporting-text` is non-empty.
191
191
  - The open listbox is promoted to the browser top layer (native Popover API, `popover="manual"`) so it renders correctly inside transformed or `overflow: hidden` containers such as a centered `lof-modal` or a `lof-drawer`; engines without the Popover API fall back to `position: fixed` with a measure-and-cancel correction. The panel matches the trigger width, flips above the trigger when there is not enough room below, is capped at 360px with internal scrolling, and closes on any outside pointerdown. 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`).
192
- - `--lof-field-label-reserve` (see Component hooks) keeps a `label-style="none"` select bottom-aligned with labelled siblings; set it to `0` in toolbars or table cells.
193
- - The trigger heights (32 / 40 / 48px) match `lof-textfield` and the date / time / range picker triggers so mixed form rows line up.
192
+ - No label row is held when no label renders above the trigger, so `label-style="none"` sits flush with buttons in toolbars and page headers. To bottom-align it with labelled siblings in a form row, set `--lof-field-label-reserve` (see Component hooks) on the row.
193
+ - The trigger heights (28 / 34 / 40px) match `lof-textfield` and the date / time / range picker triggers so mixed form rows line up.
@@ -4,7 +4,7 @@
4
4
 
5
5
  A button with a main action and a menu of related actions, also called a combo button. It is one pill in two segments with a 1px divider between them: the main action on the left, and a chevron on the right that opens a `lof-menu` of `items`, anchored below and end-aligned. Use it when one action is the usual choice and a few close variants should stay one click away, such as "New order" with "Duplicate" and "Save as template". Use `lof-button` for a single action, and a `lof-popover` with a `lof-menu` when no action is the default.
6
6
 
7
- Each segment is a native `<button>` drawn with lof-button's own styles for the chosen `variant`, `tone` and `size`. The heights (32 / 40 / 48px), padding, type, hover, pressed, focus ring and disabled look are therefore lof-button's. The outer corners keep the pill radius and the seam between the segments is square. While the menu is open, the chevron keeps its pressed look and its arrow turns up.
7
+ Each segment is a native `<button>` drawn with lof-button's own styles for the chosen `variant`, `tone` and `size`. The heights (28 / 34 / 40px), padding, type, hover, pressed, focus ring and disabled look are therefore lof-button's. The outer corners keep the pill radius and the seam between the segments is square. While the menu is open, the chevron keeps its pressed look and its arrow turns up.
8
8
 
9
9
  ## Usage
10
10
 
@@ -67,7 +67,7 @@ The divider is its own 1px column, so the pill is the main action, plus 1px, plu
67
67
  | `size` | `size` | `"small" \| "medium" \| "large"` | `"medium"` | Height of the pill and size of its text and icons, as lof-button's `size`: `small` = 32px, `medium` = 40px (default), `large` = 48px. The menu rows take the same size. Reflected. |
68
68
  | `disabled` | `disabled` | `boolean` | `false` | Dims both segments to lof-button's disabled look (the divider keeps its colour), removes them from the Tab order and keeps the menu closed. Reflected. |
69
69
  | `loading` | `loading` | `boolean` | `false` | The main action shows only lof-button's spinner, at its minimum width; its text stays its accessible name (visually hidden) and it is `aria-busy`. Its clicks are blocked and the chevron is disabled, so nothing else starts mid-request; an open menu closes. Reflected. |
70
- | `iconOnly` | `icon-only` | `boolean` | `false` | The main action is a square of the button's height (32 / 40 / 48), as lof-button's `icon-only`: give it a single icon (`icon`, or a slotted `lof-icon`) and set `aria-label`. Reflected. |
70
+ | `iconOnly` | `icon-only` | `boolean` | `false` | The main action is a square of the button's height (28 / 34 / 40), as lof-button's `icon-only`: give it a single icon (`icon`, or a slotted `lof-icon`) and set `aria-label`. Reflected. |
71
71
  | `ariaLabel` | `aria-label` | `string \| null` | `null` | Accessible name of the main action, forwarded to its native `<button>`. Required with `icon-only`, where the main action has no visible text (a console warning names split buttons without one). |
72
72
  | `menuLabel` | `menu-label` | `string` | `"More options"` | Accessible name of the chevron button (attribute `menu-label`); it has no visible text. |
73
73
  | `icon` | `icon` | `string` | `""` | `lof-icon` name drawn before the main action's text (16 / 18 / 20px by size). |
@@ -0,0 +1,73 @@
1
+ # lof-stat
2
+
3
+ `<lof-stat>` is a KPI tile: an optional icon (the `icon` slot), the figure, what it counts and an optional trend chip ("+2.7%") that is green going up and red going down. `appearance="card"` (default) draws the hairline card surface; `plain` sits inside another card, as the headline figure of a panel. Format the number yourself ("9.3k", "$295.7k"). New in the 2026-11 admin refresh, after admin dashboard KPI rows.
4
+
5
+ ## Usage
6
+
7
+ ```html
8
+ <div style="display:grid;grid-template-columns:repeat(4,1fr);gap:16px">
9
+ <lof-stat value="9.3k" label="Amazing mates"><lof-icon slot="icon" name="person"></lof-icon></lof-stat>
10
+ <lof-stat value="24k" label="Lesson views" change="+12%"><lof-icon slot="icon" name="visibility"></lof-icon></lof-stat>
11
+ <lof-stat value="608" label="New subscribers" change="-0.7%"><lof-icon slot="icon" name="email"></lof-icon></lof-stat>
12
+ <lof-stat value="2.5k" label="Stream audience" change="0%" trend="neutral"></lof-stat>
13
+ </div>
14
+
15
+ <!-- Headline figure inside a card -->
16
+ <lof-card heading="Highlights">
17
+ <lof-stat appearance="plain" size="large" value="$295.7k" label="All time sales" change="+2.7%" change-label="up 2.7% from last month"></lof-stat>
18
+ </lof-card>
19
+ ```
20
+
21
+ <!-- readme-gen:start -->
22
+
23
+ ## API
24
+
25
+ ### Attributes / Properties
26
+
27
+ | Property | Attribute | Type | Default | Description |
28
+ | --- | --- | --- | --- | --- |
29
+ | `value` | `value` | `string` | `""` | The figure, already formatted ("9.3k", "$295.7k"). |
30
+ | `label` | `label` | `string` | `""` | What the figure counts ("Amazing mates"). |
31
+ | `change` | `change` | `string` | `""` | Trend text ("+2.7%"); renders the trend chip. |
32
+ | `trend` | `trend` | `"up" \| "down" \| "neutral"` | `—` | Whether the change is good (`up`, green), bad (`down`, red) or `neutral`. Default: from the sign of `change`. It sets the colour only: the arrow follows `change` itself (its sign, or the words lower / higher), so `change="−0.4 pts" trend="up"` is a green chip with a down arrow — right for a refund rate that fell. |
33
+ | `changeLabel` | `change-label` | `string` | `""` | Spoken direction words, e.g. "up 2.7% from last month". Default: "increase" / "decrease". |
34
+ | `size` | `size` | `"medium" \| "large"` | `"medium"` | |
35
+ | `appearance` | `appearance` | `"card" \| "plain"` | `"card"` | |
36
+
37
+ ## Events
38
+
39
+ | Event | Detail | Bubbles / composed | Description |
40
+ | --- | --- | --- | --- |
41
+ | — | — | — | This element emits no custom events. |
42
+
43
+ ## Slots
44
+
45
+ | Slot | Description |
46
+ | --- | --- |
47
+ | `icon` | A lof-icon (drawn on a 36px muted tile), a logo or an image. |
48
+ | (default) | Extra content under the label. |
49
+ | `value` | Rich figure content after `value`. |
50
+ | `footer` | A sparkline, a progress bar or a link. |
51
+
52
+ ## CSS Parts
53
+
54
+ | Part | Description |
55
+ | --- | --- |
56
+ | `base` | The tile |
57
+ | `icon` | The icon tile |
58
+ | `value` | The figure |
59
+ | `trend` | The trend chip |
60
+ | `label` | The label |
61
+ | `footer` | The footer region |
62
+
63
+ <!-- readme-gen:end -->
64
+
65
+ ## Accessibility
66
+
67
+ - The figure and label are plain text in reading order. The trend chip starts with a visually hidden direction word ("increase:", "decrease:"), so colour and the arrow are not the only cue; set `change-label` for a fuller phrase.
68
+ - The tile is not interactive. Wrap it in a link, or put a lof-link in the footer, to make it go somewhere.
69
+
70
+ ## Notes / Edge Cases
71
+
72
+ - Figures use tabular numerals so a row of tiles lines up.
73
+ - `size="large"` uses the display heading size for headline totals.
@@ -164,7 +164,7 @@ Set these on the host (or an ancestor) to customise the element without touching
164
164
  - `label-placement` is the canonical layout switch (Figma `Typel`). When it is unset the deprecated `textalign` prop decides: `below` renders like `inverted` (indicator above the label), `right` renders like `centered` (label beside the indicator). `top` differs from `centered` only in aligning the label to the top of the indicator. Figma marks Top + Horizontal as an unsupported combination.
165
165
  - Statuses map to the Figma `.Artwork` states: `done` = inverse fill with a check mark (or the number when `type="number"`, nothing when `type="dot"`), `progress` = neutral fill with a strong 1px border, `disabled` = the same drawn at 40% opacity. Connectors are `border-strong` after a `done` / `progress` step and `border-default` otherwise.
166
166
  - `type="icon"` shows the check mark on every step regardless of status; `type="dot"` shrinks the indicator to 8px and fills it for `done` and `progress`.
167
- - Two axes spell one value "dot" and they are independent: `type="dot"` is the INDICATOR (an 8px disc replacing the number), `connector="dot"` is the LINE between steps. `connector="dot"` draws a 1px rule dashed 2px on / 2px off, matching Figma `.Line Types` `Type=Dot` (`strokeWeight=1`, `strokeDashes=[2,2]`). It is a repeating gradient rather than a dashed border because no engine lets you state a 2/2 dash period. The dash takes the connector's own state colour, so it goes `border-strong` after a `done` / `progress` step like the solid line does.
167
+ - Two axes spell one value "dot" and they are independent: `type="dot"` is the INDICATOR (a 10px disc replacing the number), `connector="dot"` is the LINE between steps. `connector="dot"` draws a 1px rule dashed 2px on / 2px off, matching Figma `.Line Types` `Type=Dot` (`strokeWeight=1`, `strokeDashes=[2,2]`). It is a repeating gradient rather than a dashed border because no engine lets you state a 2/2 dash period. The dash takes the connector's own state colour, so it goes `border-strong` after a `done` / `progress` step like the solid line does.
168
168
  - Connector length doubles as the gap between steps and depends on `size` and `orientation`: large = `--lof-stepper-connector-length-lg` (86px) in both orientations; small horizontal = `--lof-stepper-connector-length-md` (60px); small vertical = `--lof-stepper-connector-length-sm` (42px). Note the `md` / `sm` suffixes refer to those defaults, not to a size value.
169
169
  - Labels never wrap (`white-space: nowrap`); keep titles short or widen the connector hooks.
170
170
  - `steps` is compared by reference: mutate-in-place changes are not picked up — assign a new array.