@lofid/web 1.0.0 → 1.1.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 (38) hide show
  1. package/README.md +19 -0
  2. package/custom-elements.json +4853 -3129
  3. package/dist/index.d.ts +424 -16
  4. package/dist/index.js +4069 -1972
  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 +1 -1
  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 +15 -3
  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-progress/README.md +2 -2
  25. package/readmes/lof-radio/README.md +2 -2
  26. package/readmes/lof-rating/README.md +90 -0
  27. package/readmes/lof-segmented-button/README.md +2 -2
  28. package/readmes/lof-select/README.md +2 -2
  29. package/readmes/lof-split-button/README.md +2 -2
  30. package/readmes/lof-stat/README.md +73 -0
  31. package/readmes/lof-stepper/README.md +1 -1
  32. package/readmes/lof-switch/README.md +2 -2
  33. package/readmes/lof-tab/README.md +8 -4
  34. package/readmes/lof-table/README.md +114 -0
  35. package/readmes/lof-textfield/README.md +3 -3
  36. package/readmes/lof-time-picker/README.md +1 -1
  37. package/readmes/lof-tooltip/README.md +2 -2
  38. package/readmes/lof-upload/README.md +1 -1
@@ -1,122 +1,122 @@
1
- # lof-layout
2
-
3
- ## Overview
4
- A responsive CSS Grid layout component with automatic breakpoint handling. Provides a configurable grid with customizable column count and gap, automatically adapting to smaller viewports when `responsive` is enabled.
5
-
6
- ## Usage
7
- ```html
8
- <!-- Basic 4-column grid -->
9
- <lof-layout>
10
- <div>Item 1</div>
11
- <div>Item 2</div>
12
- <div>Item 3</div>
13
- <div>Item 4</div>
14
- <div>Item 5</div>
15
- <div>Item 6</div>
16
- </lof-layout>
17
-
18
- <!-- Custom columns and gap -->
19
- <lof-layout columns="3" gap="24px">
20
- <div>Column 1</div>
21
- <div>Column 2</div>
22
- <div>Column 3</div>
23
- </lof-layout>
24
-
25
- <!-- Fixed layout (non-responsive) -->
26
- <lof-layout columns="2" gap="16px" responsive="false">
27
- <div>Always 2 columns</div>
28
- <div>Even on mobile</div>
29
- </lof-layout>
30
-
31
- <!-- Large gap with 6 columns -->
32
- <lof-layout columns="6" gap="2rem">
33
- <div>Item 1</div>
34
- <div>Item 2</div>
35
- <div>Item 3</div>
36
- <div>Item 4</div>
37
- <div>Item 5</div>
38
- <div>Item 6</div>
39
- </lof-layout>
40
- ```
41
-
42
- <!-- readme-gen:start -->
43
-
44
- <!-- Generated from lof-layout.ts — do not edit; run readme-generate.mjs -->
45
-
46
- ## API
47
-
48
- ### Attributes / Properties
49
-
50
- | Property | Attribute | Type | Default | Description |
51
- | --- | --- | --- | --- | --- |
52
- | `gap` | `gap` | `string` | `"1rem"` | — |
53
- | `columns` | `columns` | `number` | `4` | — |
54
- | `responsive` | `responsive` | `boolean` | `true` | Reflected. |
55
-
56
- ## Events
57
-
58
- | Event | Detail | Bubbles / composed | Description |
59
- | --- | --- | --- | --- |
60
- | — | — | — | This element emits no custom events. |
61
-
62
- ## Slots
63
-
64
- | Slot | Description |
65
- | --- | --- |
66
- | (default) | Main content. |
67
-
68
- ## CSS Parts
69
-
70
- | Part | Description |
71
- | --- | --- |
72
- | — | None exposed. |
73
-
74
- <!-- readme-gen:end -->
75
-
76
- ## API
77
-
78
- ### Attributes/Properties
79
- | Name | Type | Default | Description |
80
- |------|------|---------|-------------|
81
- | `columns` | `number` | `4` | Number of columns in the grid |
82
- | `gap` | `string` | `"1rem"` | CSS gap value (supports any CSS length unit) |
83
- | `responsive` (reflected) | `boolean` | `true` | Enable automatic responsive breakpoints |
84
-
85
- ## Events
86
- None.
87
-
88
- ## Slots
89
- | Slot | Description |
90
- |------|-------------|
91
- | (default) | Grid items (any HTML elements) |
92
-
93
- ## CSS Parts
94
- None exposed.
95
-
96
- ## Tokens / CSS Variables
97
-
98
- ### Semantic Tokens
99
- - `--lof-fonts-font-family` - Font family
100
-
101
- ## Accessibility
102
- - Uses standard CSS Grid, which is accessible by default
103
- - Ensure grid items contain proper semantic HTML
104
-
105
- ### Keyboard Interactions
106
- - Standard browser navigation through grid items
107
-
108
- ### Focus Behavior
109
- - No specific focus handling (relies on slotted content)
110
-
111
- ## Notes / Edge Cases
112
- - **Responsive breakpoints** (only when `responsive` is true):
113
- - **≤1024px**: 3 columns
114
- - **≤768px**: 2 columns
115
- - **≤480px**: 1 column
116
- - The `responsive` attribute is reflected, so CSS can target `:host([responsive])`
117
- - Responsive styles use `!important` to override inline column count
118
- - If `responsive` is set to `false`, the grid maintains the specified column count at all viewport sizes
119
- - The grid is `display: grid` with `width: 100%`
120
- - The `columns` and `gap` properties are applied as inline styles for maximum flexibility
121
- - The component is `display: block` and `width: 100%`
122
- - Grid items do not have any default styling—you must style them yourself
1
+ # lof-layout
2
+
3
+ ## Overview
4
+ A responsive CSS Grid layout component with automatic breakpoint handling. Provides a configurable grid with customizable column count and gap, automatically adapting to smaller viewports when `responsive` is enabled.
5
+
6
+ ## Usage
7
+ ```html
8
+ <!-- Basic 4-column grid -->
9
+ <lof-layout>
10
+ <div>Item 1</div>
11
+ <div>Item 2</div>
12
+ <div>Item 3</div>
13
+ <div>Item 4</div>
14
+ <div>Item 5</div>
15
+ <div>Item 6</div>
16
+ </lof-layout>
17
+
18
+ <!-- Custom columns and gap -->
19
+ <lof-layout columns="3" gap="24px">
20
+ <div>Column 1</div>
21
+ <div>Column 2</div>
22
+ <div>Column 3</div>
23
+ </lof-layout>
24
+
25
+ <!-- Fixed layout (non-responsive) -->
26
+ <lof-layout columns="2" gap="16px" responsive="false">
27
+ <div>Always 2 columns</div>
28
+ <div>Even on mobile</div>
29
+ </lof-layout>
30
+
31
+ <!-- Large gap with 6 columns -->
32
+ <lof-layout columns="6" gap="2rem">
33
+ <div>Item 1</div>
34
+ <div>Item 2</div>
35
+ <div>Item 3</div>
36
+ <div>Item 4</div>
37
+ <div>Item 5</div>
38
+ <div>Item 6</div>
39
+ </lof-layout>
40
+ ```
41
+
42
+ <!-- readme-gen:start -->
43
+
44
+ <!-- Generated from lof-layout.ts — do not edit; run readme-generate.mjs -->
45
+
46
+ ## API
47
+
48
+ ### Attributes / Properties
49
+
50
+ | Property | Attribute | Type | Default | Description |
51
+ | --- | --- | --- | --- | --- |
52
+ | `gap` | `gap` | `string` | `"1rem"` | — |
53
+ | `columns` | `columns` | `number` | `4` | — |
54
+ | `responsive` | `responsive` | `boolean` | `true` | Reflected. |
55
+
56
+ ## Events
57
+
58
+ | Event | Detail | Bubbles / composed | Description |
59
+ | --- | --- | --- | --- |
60
+ | — | — | — | This element emits no custom events. |
61
+
62
+ ## Slots
63
+
64
+ | Slot | Description |
65
+ | --- | --- |
66
+ | (default) | Main content. |
67
+
68
+ ## CSS Parts
69
+
70
+ | Part | Description |
71
+ | --- | --- |
72
+ | — | None exposed. |
73
+
74
+ <!-- readme-gen:end -->
75
+
76
+ ## API
77
+
78
+ ### Attributes/Properties
79
+ | Name | Type | Default | Description |
80
+ |------|------|---------|-------------|
81
+ | `columns` | `number` | `4` | Number of columns in the grid |
82
+ | `gap` | `string` | `"1rem"` | CSS gap value (supports any CSS length unit) |
83
+ | `responsive` (reflected) | `boolean` | `true` | Enable automatic responsive breakpoints |
84
+
85
+ ## Events
86
+ None.
87
+
88
+ ## Slots
89
+ | Slot | Description |
90
+ |------|-------------|
91
+ | (default) | Grid items (any HTML elements) |
92
+
93
+ ## CSS Parts
94
+ None exposed.
95
+
96
+ ## Tokens / CSS Variables
97
+
98
+ ### Semantic Tokens
99
+ - `--lof-font-family` - Font family
100
+
101
+ ## Accessibility
102
+ - Uses standard CSS Grid, which is accessible by default
103
+ - Ensure grid items contain proper semantic HTML
104
+
105
+ ### Keyboard Interactions
106
+ - Standard browser navigation through grid items
107
+
108
+ ### Focus Behavior
109
+ - No specific focus handling (relies on slotted content)
110
+
111
+ ## Notes / Edge Cases
112
+ - **Responsive breakpoints** (only when `responsive` is true):
113
+ - **≤1024px**: 3 columns
114
+ - **≤768px**: 2 columns
115
+ - **≤480px**: 1 column
116
+ - The `responsive` attribute is reflected, so CSS can target `:host([responsive])`
117
+ - Responsive styles use `!important` to override inline column count
118
+ - If `responsive` is set to `false`, the grid maintains the specified column count at all viewport sizes
119
+ - The grid is `display: grid` with `width: 100%`
120
+ - The `columns` and `gap` properties are applied as inline styles for maximum flexibility
121
+ - The component is `display: block` and `width: 100%`
122
+ - Grid items do not have any default styling—you must style them yourself
@@ -0,0 +1,67 @@
1
+ # lof-link
2
+
3
+ `<lof-link>` is a text link: a real `<a>` in the accent colour by default, with an underline style (`hover`, `always`, `dashed` or `none`), three sizes and an optional trailing chevron for "View page ›" calls to action. `tone="mono"` draws it in the text colour and `inverse` on dark surfaces. Use `lof-button variant="link"` for actions that look like links but do something on the page; use `lof-link` to go somewhere. New in the 2026-11 admin refresh.
4
+
5
+ ## Usage
6
+
7
+ ```html
8
+ <lof-link href="/account">View page</lof-link>
9
+ <lof-link href="/account" arrow>View page</lof-link>
10
+ <lof-link href="/start" underline="dashed">Get started</lof-link>
11
+ <lof-link href="/docs" tone="mono" underline="always">Documentation</lof-link>
12
+ <lof-link href="https://example.com" target="_blank">External site</lof-link>
13
+
14
+ <!-- Inside running text: take the paragraph's font -->
15
+ <p>Read the <lof-link href="/terms" inherit underline="always">terms of service</lof-link> before you continue.</p>
16
+ ```
17
+
18
+ <!-- readme-gen:start -->
19
+
20
+ ## API
21
+
22
+ ### Attributes / Properties
23
+
24
+ | Property | Attribute | Type | Default | Description |
25
+ | --- | --- | --- | --- | --- |
26
+ | `href` | `href` | `string` | `""` | |
27
+ | `target` | `target` | `string` | `""` | Passed to the anchor. `_blank` adds `rel="noopener noreferrer"` unless `rel` is set. |
28
+ | `rel` | `rel` | `string` | `""` | |
29
+ | `tone` | `tone` | `"accent" \| "mono" \| "inverse"` | `"accent"` | accent (default) \| mono \| inverse. |
30
+ | `underline` | `underline` | `"hover" \| "always" \| "dashed" \| "none"` | `"hover"` | hover (default) \| always \| dashed \| none. |
31
+ | `size` | `size` | `"small" \| "medium" \| "large"` | `"medium"` | |
32
+ | `arrow` | `arrow` | `boolean` | `false` | A trailing chevron, for "View page ›" calls to action. |
33
+ | `inherit` | `inherit` | `boolean` | `false` | Take the surrounding text's font instead of the link type style (for links inside paragraphs). |
34
+ | `disabled` | `disabled` | `boolean` | `false` | |
35
+
36
+ ## Events
37
+
38
+ | Event | Detail | Bubbles / composed | Description |
39
+ | --- | --- | --- | --- |
40
+ | — | — | — | This element emits no custom events. |
41
+
42
+ ## Slots
43
+
44
+ | Slot | Description |
45
+ | --- | --- |
46
+ | (default) | The link text, and an optional leading lof-icon. |
47
+
48
+ ## CSS Parts
49
+
50
+ | Part | Description |
51
+ | --- | --- |
52
+ | `base` | The `<a>` |
53
+ | `arrow` | The trailing chevron (`arrow`) |
54
+
55
+ <!-- readme-gen:end -->
56
+
57
+ ## Accessibility
58
+
59
+ - A native anchor with focus delegated from the host, so `el.focus()` and label clicks work. Focus shows a 2px ring and the underline.
60
+ - Without `href` the anchor gets `role="link"`, a Tab stop and Enter activation; prefer a real `href`.
61
+ - `disabled` removes the `href` and adds `aria-disabled`; a disabled link is skipped by Tab.
62
+ - Inside running text use `underline="always"`: colour alone does not mark a link in a paragraph.
63
+
64
+ ## Notes / Edge Cases
65
+
66
+ - The chevron is drawn at 1em and follows the link colour.
67
+ - Sizes follow the action type scale: 12 / 13 / 14px Medium.
@@ -0,0 +1,90 @@
1
+ # lof-nav
2
+
3
+ `<lof-nav>` is the vertical navigation of an application sidebar: section headings, items with an icon and an optional badge ("Soon", "New", a count), collapsible groups of child links, and one active item (`value`) drawn with the accent. Items with `href` are real links; items without one are buttons that fire `lof-select` for in-app routing. `collapsed` turns it into an icon rail. New in the 2026-11 admin refresh, after the sidebars of admin dashboards.
4
+
5
+ ## Usage
6
+
7
+ ```html
8
+ <lof-nav id="side" value="light"></lof-nav>
9
+ <script>
10
+ document.getElementById('side').items = [
11
+ { label: 'Dashboards', icon: 'dashboard', children: [
12
+ { label: 'Light sidebar', value: 'light' },
13
+ { label: 'Dark sidebar', value: 'dark' },
14
+ ] },
15
+ { heading: 'User' },
16
+ { label: 'Public profile', icon: 'person', href: '/profile' },
17
+ { label: 'My account', icon: 'settings', href: '/account' },
18
+ { label: 'Network', icon: 'people', href: '/network' },
19
+ { heading: 'Apps' },
20
+ { label: 'Project planning', icon: 'calendar-month', href: '/planning' },
21
+ { label: 'Invoice generator', icon: 'billing-invoices', badge: 'Soon', disabled: true },
22
+ ];
23
+ </script>
24
+
25
+ <!-- Plus / minus group toggles -->
26
+ <lof-nav indicator="plus"></lof-nav>
27
+
28
+ <!-- Icon rail -->
29
+ <lof-nav collapsed></lof-nav>
30
+
31
+ <!-- Route in-app instead of following hrefs -->
32
+ <script>
33
+ document.getElementById('side').addEventListener('lof-select', (e) => {
34
+ e.preventDefault();
35
+ router.go(e.detail.item.href ?? e.detail.value);
36
+ });
37
+ </script>
38
+ ```
39
+
40
+ <!-- readme-gen:start -->
41
+
42
+ ## API
43
+
44
+ ### Attributes / Properties
45
+
46
+ | Property | Attribute | Type | Default | Description |
47
+ | --- | --- | --- | --- | --- |
48
+ | `items` | `items` | `NavEntry[]` | `[]` | Items `{ label, value?, href?, icon?, badge?, disabled?, children?, expanded? }` and section labels `{ heading }`, in order. An item with `children` is a group that toggles instead of navigating. |
49
+ | `value` | `value` | `string` | `""` | The active item's identity (`value`, else `href`, else `label`). |
50
+ | `collapsed` | `collapsed` | `boolean` | `false` | Icon-only rail: labels, badges, headings and children hide; labels move to tooltips. |
51
+ | `indicator` | `indicator` | `"chevron" \| "plus"` | `"chevron"` | Group toggle glyph: chevron (default) or plus / minus. |
52
+ | `fieldAriaLabel` | `field-aria-label` | `string` | `"Main"` | Accessible name of the navigation landmark. |
53
+
54
+ ## Events
55
+
56
+ | Event | Detail | Bubbles / composed | Description |
57
+ | --- | --- | --- | --- |
58
+ | `lof-select` | `CustomEvent<NavSelectDetail>` | yes / yes | An item (not a group) was activated. `detail: { value, item }`. Cancelable: `preventDefault()` stops the link from navigating; `value` still updates. |
59
+ | `lof-toggle` | `CustomEvent<{ value: string; open: boolean; }>` | yes / yes | A group opened or closed. `detail: { value, open }`. |
60
+
61
+ ## Slots
62
+
63
+ | Slot | Description |
64
+ | --- | --- |
65
+ | — | This element has no slots. |
66
+
67
+ ## CSS Parts
68
+
69
+ | Part | Description |
70
+ | --- | --- |
71
+ | `badge` | Each item badge |
72
+ | `link` | Each item link or button (groups also have `group`) |
73
+ | `group` | Each group toggle |
74
+ | `base` | The `<nav>` landmark |
75
+ | `heading` | Each section label |
76
+
77
+ <!-- readme-gen:end -->
78
+
79
+ ## Accessibility
80
+
81
+ - A `<nav>` landmark named by `field-aria-label` (default "Main"), with plain lists inside. Tab moves through the items in order; Enter or Space activates.
82
+ - Group toggles are buttons with `aria-expanded`. A group that holds the active item opens on its own.
83
+ - The active item has `aria-current="page"`. Disabled link items lose their `href` and carry `aria-disabled`.
84
+ - In `collapsed` mode the labels become `title` tooltips; pair the rail with a visible label elsewhere (a header) or an expand control.
85
+
86
+ ## Notes / Edge Cases
87
+
88
+ - An item's identity is `value`, else `href`, else `label`: set `value` when two items share a label.
89
+ - Children are one level deep, drawn with a bullet that takes the accent when active. Icons are shown on top-level items only.
90
+ - The element does not draw a sidebar surface: put it inside your own aside (Metronic-style sidebars are the page background with a hairline divider).
@@ -0,0 +1,71 @@
1
+ # lof-page-header
2
+
3
+ `<lof-page-header>` is the bar at the top of a page: the page title, a line under it (`description`) or a breadcrumb trail (the `breadcrumb` slot), and the page actions on the right (the `actions` slot). `layout="inline"` puts the breadcrumb beside the title; `divider` draws a hairline under the bar. New in the 2026-11 admin refresh.
4
+
5
+ ## Usage
6
+
7
+ ```html
8
+ <lof-page-header heading="Dashboard" description="Central hub for personal customization">
9
+ <lof-button slot="actions" variant="secondary">View profile</lof-button>
10
+ <lof-button slot="actions">Create team</lof-button>
11
+ </lof-page-header>
12
+
13
+ <!-- Breadcrumb beside the title -->
14
+ <lof-page-header id="ph" heading="Team settings" layout="inline" divider>
15
+ <lof-breadcrumbs slot="breadcrumb" id="trail"></lof-breadcrumbs>
16
+ <lof-button slot="actions" variant="secondary"><lof-icon name="download"></lof-icon>Export</lof-button>
17
+ </lof-page-header>
18
+ <script>
19
+ document.getElementById('trail').items = [
20
+ { label: 'Home', href: '/' }, { label: 'Client API', href: '/api' }, { label: 'Team settings' },
21
+ ];
22
+ </script>
23
+ ```
24
+
25
+ <!-- readme-gen:start -->
26
+
27
+ ## API
28
+
29
+ ### Attributes / Properties
30
+
31
+ | Property | Attribute | Type | Default | Description |
32
+ | --- | --- | --- | --- | --- |
33
+ | `heading` | `heading` | `string` | `""` | Page title (rendered as an h1 by default). |
34
+ | `description` | `description` | `string` | `""` | Line under (or beside) the title; the `breadcrumb` slot takes a lof-breadcrumbs instead. |
35
+ | `headingLevel` | `heading-level` | `number` | `1` | Heading level for the title (1 to 6). |
36
+ | `layout` | `layout` | `"stacked" \| "inline"` | `"stacked"` | stacked (default) \| inline. |
37
+ | `divider` | `divider` | `boolean` | `false` | A hairline under the bar. |
38
+
39
+ ## Events
40
+
41
+ | Event | Detail | Bubbles / composed | Description |
42
+ | --- | --- | --- | --- |
43
+ | — | — | — | This element emits no custom events. |
44
+
45
+ ## Slots
46
+
47
+ | Slot | Description |
48
+ | --- | --- |
49
+ | `title` | Rich title content (replaces `heading`). |
50
+ | `breadcrumb` | A lof-breadcrumbs or other line (replaces `description`). |
51
+ | `actions` | Page actions; fields here drop their label row. |
52
+
53
+ ## CSS Parts
54
+
55
+ | Part | Description |
56
+ | --- | --- |
57
+ | `base` | The bar |
58
+ | `title` | The title |
59
+ | `description` | The description |
60
+ | `actions` | The actions region |
61
+
62
+ <!-- readme-gen:end -->
63
+
64
+ ## Accessibility
65
+
66
+ - The title is `role="heading"` at `heading-level` (default 1). Use one level 1 per page.
67
+ - Actions keep their own semantics; order them so the primary action is last (rightmost), as reading order follows the DOM.
68
+
69
+ ## Notes / Edge Cases
70
+
71
+ - The bar wraps on narrow screens: actions drop under the title.
@@ -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` | `calc(var(--lof-body-field-label-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). |
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"` |
@@ -190,4 +190,4 @@ Set these on the host (or an ancestor) to customise the element without touching
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
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.
193
+ - The trigger heights (28 / 34 / 40px) match `lof-textfield` and the date / time / range picker triggers so mixed form rows line up.