@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lofid/web",
3
- "version": "1.0.0",
3
+ "version": "1.1.1",
4
4
  "description": "Lofid Design System web components (Lit) — rebuilt, API-compatible with 1.5.0",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -13,6 +13,8 @@
13
13
  "import": "./dist/index.js"
14
14
  },
15
15
  "./vars.css": "./dist/styles/vars.css",
16
+ "./typography.css": "./dist/styles/typography.css",
17
+ "./typography.json": "./dist/styles/typography.json",
16
18
  "./motion.css": "./dist/styles/motion.css",
17
19
  "./motion.tokens.json": "./dist/styles/motion.tokens.json",
18
20
  "./custom-elements.json": "./custom-elements.json",
@@ -32,7 +34,7 @@
32
34
  "cem": "node scripts/cem.mjs"
33
35
  },
34
36
  "dependencies": {
35
- "@lofid/icons": "1.0.0",
37
+ "@lofid/icons": "1.1.1",
36
38
  "lit": "^3.3.0"
37
39
  },
38
40
  "devDependencies": {
@@ -94,7 +94,7 @@
94
94
  | --- | --- | --- | --- | --- |
95
95
  | `size` | `size` | `"large" \| "medium" \| "small" \| "extra-small" \| "lg" \| "md" \| "sm" \| "xs"` | `"medium"` | Diameter step: `large` 40px, `medium` 32px, `small` 24px, `extra-small` 20px; each binds the matching body-*-semibold text role for initials. `lg` / `md` / `sm` / `xs` are alternative spellings and stay supported — they are normalised to the full words, not deprecated. Reflected. |
96
96
  | `type` | `type` | `"image" \| "text" \| "icon"` | `"image"` | What is rendered inside the circle: `image` shows `src`, `text` shows the `text` initials, `icon` shows the default slot. Reflected. |
97
- | `variant` | `variant` | `"fill" \| "subtle" \| "outline"` | `"fill"` | Fill style: `fill` = solid inverse background with light text, `subtle` = elevated neutral background, `outline` = `--lof-bg-neutral` fill with a 1px `--lof-border-default` border (opaque, so it stays readable over any background). Reflected. |
97
+ | `variant` | `variant` | `"fill" \| "subtle" \| "outline"` | `"subtle"` | Default since the 2026-11 refresh: `subtle` (muted disc, hairline edge, dark initials). Fill style: `fill` = solid inverse background with light text, `subtle` = elevated neutral background, `outline` = `--lof-bg-neutral` fill with a 1px `--lof-border-default` border (opaque, so it stays readable over any background). Reflected. |
98
98
  | `src` | `src` | `string` | `""` | Image URL for `type="image"`; when empty nothing is rendered inside the circle (there is no fallback to initials). |
99
99
  | `text` | `text` | `string` | `""` | Initials shown for `type="text"`; rendered uppercase via `text-transform`. |
100
100
  | `alt` | `alt` | `string` | `"Avatar"` | Alt text of the `<img>` for `type="image"`; the default is the generic word "Avatar", so pass the person's name. |
@@ -144,6 +144,7 @@ Set these on the host (or an ancestor) to customise the element without touching
144
144
  | `--lof-avatar-color-outline` | `var(--lof-text-default)` | Text / icon colour of the `outline` variant |
145
145
  | `--lof-avatar-color-subtle` | `var(--lof-text-default)` | Text / icon colour of the `subtle` variant |
146
146
  | `--lof-avatar-font-size` | `var(--_lof-avatar-font-size)` | Overrides the initials' font-size, for use alongside `--lof-avatar-size`; defaults to the preset's text role |
147
+ | `--lof-avatar-label-inset-end` | `0px` | Moves the initials off the end edge by half this length, to centre them in what stays visible when something covers that edge; an avatar group sets it to its overlap |
147
148
  | `--lof-avatar-icon-size` | `var(--_lof-avatar-icon-size)` | Overrides the slotted icon's size; defaults to the preset ramp (20 / 18 / 16 / 12px) |
148
149
  | `--lof-avatar-ring-color` | `var(--lof-border-inverse)` | Colour of the `ring`; defaults to `--lof-border-inverse` (new in 1.5.0) |
149
150
  | `--lof-avatar-size` | `var(--_lof-avatar-size)` | Overrides the circle's width/height for sizes between (or below) the `size` presets; defaults to the preset's diameter |
@@ -224,5 +225,5 @@ Set these on the host (or an ancestor) to customise the element without touching
224
225
  - **Badge** (new in 1.5.0): 12 / 10 / 8 / 6px by size, flush with the bottom-right of the avatar's box, with a 1px outside edge. `dot` fills with `--lof-bg-success` (Figma has only the green dot); `icon` fills with `--lof-bg-neutral-elevated-2` and draws `badge-icon` at two thirds of the disc. Recolour either with `--lof-avatar-badge-bg`. At the two smallest sizes an icon badge is too small to read; prefer `dot` there.
225
226
  - **`icon` vs the slot:** when `icon` is set it replaces the slot; leave it empty to slot your own SVG.
226
227
  <!-- @unreleased-begin 1.5.0 -->
227
- - **Avatar group.** The group writes `size` and `ring` on its avatars, so a size set on an avatar inside a group is replaced by the group's. It hides avatars beyond `max` with a `data-lof-group-hidden` attribute it manages itself; your own `hidden` attributes are left alone. The "+N" text steps down to 36% of the diameter from two digits ("+10"), and counts above 99 show "99+". Change the overlap with `--lof-avatar-group-overlap`.
228
+ - **Avatar group.** The group writes `size` and `ring` on its avatars, so a size set on an avatar inside a group is replaced by the group's. It hides avatars beyond `max` with a `data-lof-group-hidden` attribute it manages itself; your own `hidden` attributes are left alone. The "+N" text steps down to 36% of the diameter from two digits ("+10"), and counts above 99 show "99+". Change the overlap with `--lof-avatar-group-overlap`. Initials inside a group step down to 38% of the diameter (at least 10px) and centre in the part the next avatar leaves visible, so two letters stay readable; set `--lof-avatar-font-size` or `--lof-avatar-label-inset-end` on an avatar to override.
228
229
  <!-- @unreleased-end -->
@@ -22,14 +22,15 @@ Action button implementing the Figma "Button" component: a native `<button>` wit
22
22
  <lof-button variant="secondary" tone="destructive">Remove</lof-button>
23
23
  <lof-button variant="ghost" tone="destructive">Discard</lof-button>
24
24
 
25
- <!-- Sizes: 32 / 40 / 48px -->
25
+ <!-- Sizes: 28 / 34 / 40px -->
26
26
  <lof-button size="small">Small</lof-button>
27
27
  <lof-button size="medium">Medium</lof-button>
28
28
  <lof-button size="large">Large</lof-button>
29
29
 
30
30
  <!-- Corner radius -->
31
- <lof-button border="corner-radius">Pill</lof-button>
32
- <lof-button border="small-corner-radius">Small radius</lof-button>
31
+ <lof-button border="corner-radius">6px corners (default)</lof-button>
32
+ <lof-button border="small-corner-radius">4px corners</lof-button>
33
+ <lof-button border="pill">Pill</lof-button>
33
34
  <lof-button border="no-corner-radius">Square</lof-button>
34
35
 
35
36
  <!-- Icon + label, and icon-only (needs an accessible name) -->
@@ -93,12 +94,12 @@ Action button implementing the Figma "Button" component: a native `<button>` wit
93
94
  | Property | Attribute | Type | Default | Description |
94
95
  | --- | --- | --- | --- | --- |
95
96
  | `variant` | `variant` | `"default" \| "primary" \| "secondary" \| "text" \| "link" \| "icon" \| "static" \| "outline" \| "ghost"` | `"default"` | Style axis (Figma "Style"). Canonical: `default` (legacy neutral fill), `primary`, `secondary` (outlined), `ghost` (text-only), `link` (underlined inline text), `static` (transparent, static-light label for dark/colored surfaces). Deprecated aliases still accepted: `outline` = secondary, `text` = ghost, and `icon` (pre-2.0 40px circular icon button — use `icon-only` with a style instead). |
96
- | `tone` | `tone` | `"default" \| "primary" \| "secondary" \| "critical" \| "success" \| "neutral" \| "brand" \| "danger" \| "destructive"` | `undefined` | Tone axis (Figma "Tone"). Canonical: `neutral` (= `default`), `brand` (= `primary`), `destructive`. Deprecated aliases `critical` and `danger` map to destructive and log a one-time console notice. `secondary` and `success` are legacy extras with no Figma counterpart: `secondary` styles only the legacy `icon` variant; on every other variant it renders as `neutral` and logs a one-time notice. Left UNSET it means `neutral`, except on `variant="primary"`, where it still means `brand` for one release — see `effectiveTone`. Write the tone explicitly and you always get what you wrote. |
97
- | `iconOnly` | `icon-only` | `boolean` | `false` | Figma "Type=Icon Only": renders a square button (32/40/48px per `size`) of the current style and tone with no padding or min-width. Composes with every `variant`; slot a single `lof-icon` and set `aria-label`. Reflected. |
97
+ | `tone` | `tone` | `"accent" \| "primary" \| "neutral" \| "mono" \| "default" \| "brand" \| "destructive" \| "success" \| "secondary" \| "critical" \| "danger"` | `undefined` | Tone axis. Canonical: `accent` (= `primary`, the green accent), `neutral` (= `mono` = `default`, the black fill), `brand` (mint), `destructive`. Unset: `accent` on fill and link styles, `neutral` on outline and ghost. `critical` / `danger` are deprecated spellings of `destructive`; `secondary` only applies to the legacy `icon` variant. |
98
+ | `iconOnly` | `icon-only` | `boolean` | `false` | Figma "Type=Icon Only": renders a square button (28/34/40px per `size`) of the current style and tone with no padding or min-width. Composes with every `variant`; slot a single `lof-icon` and set `aria-label`. Reflected. |
98
99
  | `loading` | `loading` | `boolean` | `false` | Figma "State=Loading": replaces the label with a spinner (`indicator` part), sets `aria-busy`, and blocks pointer and programmatic clicks. The button keeps its width. Reflected. |
99
100
  | `size` | `size` | `"small" \| "medium" \| "large"` | `"medium"` | Figma "Size": `small` = 32px, `medium` = 40px, `large` = 48px height, with matching padding, typography and minimum width. |
100
- | `border` | `border` | `"corner-radius" \| "small-corner-radius" \| "no-corner-radius"` | `"corner-radius"` | Corner treatment: `corner-radius` = fully rounded pill, `small-corner-radius` = small radius token, `no-corner-radius` = square corners. |
101
- | `disabled` | `disabled` | `boolean` | `false` | Figma "State=Disabled": dims the button to 50% opacity, flattens filled styles to the disabled fill, shows a `not-allowed` cursor and swallows every click (including programmatic `.click()`). Reflected. |
101
+ | `border` | `border` | `"corner-radius" \| "small-corner-radius" \| "pill" \| "no-corner-radius"` | `"corner-radius"` | Corner treatment: `corner-radius` = the 6px control radius (`--lof-radius-control`), `small-corner-radius` = 4px, `pill` = fully rounded, `no-corner-radius` = square. |
102
+ | `disabled` | `disabled` | `boolean` | `false` | Disabled look: no opacity fade (since the 2026-11 refresh); every style switches to the disabled text colour, filled styles flatten to the neutral wash and outlines to the subtle edge; shows a `not-allowed` cursor and swallows every click (including programmatic `.click()`). Reflected. |
102
103
  | `ariaLabel` | `aria-label` | `string \| null` | `null` | Accessible name forwarded to the inner native `<button>`. Required for `icon-only` buttons, whose slotted icon has no visible text. |
103
104
  | `badge` | `badge` | `string` | `""` | Text for a small `lof-badge` anchored to the top-right corner (e.g. "3", "999+"). Empty string renders no badge. Ignored when `badge-dot` is set. |
104
105
  | `badgeDot` | `badge-dot` | `boolean` | `false` | Renders a small dot badge in the top-right corner instead of a numbered badge; takes precedence over `badge`. The dot is inset 2px from the corner so it lands on a circular icon button's edge. |
@@ -150,22 +151,20 @@ Focus: `:focus-visible` shows the shared 2px focus outline plus inner/outer halo
150
151
 
151
152
  ## Notes / Edge Cases
152
153
 
153
- ### The `variant="primary"` tone transition
154
+ ### Tone defaults (2026-11 admin refresh)
154
155
 
155
- Figma's `Style=Primary` is the **filled** style, and `Tone` picks its colour — so Primary + Neutral is the neutral fill and Primary + Brand is the brand fill. This component's `variant="primary"` historically meant *both* "filled" and "brand-coloured", which left the Figma-canonical Primary/Neutral cell unreachable by its own names.
156
+ The accent (Lofid green) is the primary-action colour; black is the "mono" companion; the light mint (`brand`) stays available for brand moments.
156
157
 
157
- That cell now works: **`variant="primary" tone="neutral"` renders the neutral fill.**
158
-
159
- For one release there is a deliberate wrinkle, and it is worth knowing before you debug it:
160
-
161
- | Markup | Renders | Why |
162
- | --- | --- | --- |
163
- | `<lof-button>` | neutral fill | Unchanged. `variant` defaults to `default`, which is Figma's Primary/Neutral. |
164
- | `<lof-button variant="primary">` | **brand** fill | Unset tone still means brand *here only*, so existing brand buttons do not silently turn neutral. Logs a one-time console notice. |
165
- | `<lof-button variant="primary" tone="brand">` | brand fill | The explicit form. **Write this.** |
166
- | `<lof-button variant="primary" tone="neutral">` | neutral fill | The Figma-canonical cell, now reachable. |
158
+ | Markup | Renders |
159
+ | --- | --- |
160
+ | `<lof-button>` / `<lof-button variant="primary">` | accent fill |
161
+ | `<lof-button tone="neutral">` (or `tone="mono"`) | black (mono) fill |
162
+ | `<lof-button variant="primary" tone="brand">` | mint brand fill |
163
+ | `<lof-button variant="secondary">` | outline: hairline border on the surface, muted icon |
164
+ | `<lof-button variant="ghost">` | no chrome until hover |
165
+ | `<lof-button variant="link">` | accent text, underline on hover |
167
166
 
168
- So for this release, writing the default value explicitly changes the result: `variant="primary"` alone and `variant="primary" tone="neutral"` render differently. Setting `tone` explicitly always gives you exactly what you wrote. A future major will make an unset tone mean `neutral` everywhere, matching every other style.
167
+ An unset tone now has one meaning per style, so the one-time console notice for `variant="primary"` without a tone is gone. Before this refresh an unset tone rendered the brand (mint) fill on `variant="primary"` and the black fill on `default`: write `tone="brand"` or `tone="neutral"` to keep those looks.
169
168
 
170
169
  ### Tone × Style matrix
171
170
 
@@ -180,11 +179,11 @@ Figma populates only part of the grid. Combinations outside it have no design-sy
180
179
  `Link` additionally has no icon-only and no loading state in the design.
181
180
 
182
181
  - **Events.** The element dispatches no custom events. The native `click` is `composed`, so a listener on `<lof-button>` (or an ancestor) receives exactly one event per activation — do not re-dispatch it.
183
- - **Minimum widths** come from the Figma master: small/medium/large = 80/100/120px, static = 40/50/60px. `link` has no minimum, `icon-only` is a fixed square (32/40/48px) and the legacy `icon` variant is always a 40px circle regardless of `size`. Override per instance with `--lof-button-min-width`.
184
- - **`border`** exposes `small-corner-radius` and `no-corner-radius`, which have no design-system backing — every one of Figma's 624 button nodes is fully rounded. They are a code-only extension, kept for existing layouts.
182
+ - **No minimum width** since the 2026-11 refresh: buttons size to their label, as dense admin layouts expect. Set `--lof-button-min-width` (e.g. `100px`) to restore a floor. `icon-only` is a fixed square (28/34/40px) and the legacy `icon` variant is a 34px circle regardless of `size`.
183
+ - **`border`**: buttons default to the 6px control radius shared with fields, selects and the segmented control; `pill` restores the fully rounded shape of earlier releases.
185
184
  - **Legacy `icon` variant vs `icon-only`.** `variant="icon"` keeps its pre-2.0 look (40px circle, tone-driven fill, `tone="secondary"` gives it an outline) and ignores `size` and `border`. Since 1.5.0 the neutral tone's hover and pressed state is the Icon Only (ghost) hover tint laid over its grey fill; before, its hover showed no change. `icon-only` is an axis that composes with any style and size — prefer it.
186
185
  - **`tone` on `secondary` / `ghost` / `link`** changes the label, border or text colour only; the fill stays on the surface. The destructive outline border is deliberately subtle at rest and only goes solid on hover/pressed, matching Figma.
187
186
  - **`static`** is a neutral-only style meant for coloured or dark backgrounds; other tones have no static treatment.
188
187
  - **`success`** is a legacy tone without a Figma counterpart; it renders a green fill/outline/ghost tint but is not part of the current spec.
189
188
  - **Badges** render a small `lof-badge` positioned outside the button's box (numbered) or 2px inside the corner (dot); give the button room in tight layouts. `badge-dot` wins when both are set.
190
- - **Disabled styling**: only filled styles (`default`, `primary`, `icon`) flatten to the neutral disabled fill; `secondary`, `ghost`, `link` and `static` keep their shape at 50% opacity so they still read as their own style.
189
+ - **Disabled styling**: every style keeps its look at 50% opacity and drops its shadow; the inner button is `aria-disabled` and leaves the tab order.
@@ -106,6 +106,6 @@ calendar.addEventListener("lof-change", (e) => {
106
106
  - Comparisons happen at local midnight: the `Date` passed to `isDateDisabled` and returned in `lof-change` is `new Date(y, m, d)`, so read it with local getters, not `toISOString()`.
107
107
  - `disabled` makes every day fail the disabled check and natively disables every day button and both navigation buttons, so nothing in the calendar is in the tab order; pointer events stay on the host so the `not-allowed` cursor shows.
108
108
  - Each cell follows Figma ".Date Days": a 36 px full-rounded halo around a 28 px disc. The halo carries hover (`action/overlay/hover`), the focus ring and the selected day's `elevated-1` backing; the disc carries today's 1 px brand ring and the selected day's `inverse-2` fill with an inverse semibold label.
109
- - Figma treats the cell tone as one axis, so exactly one applies per day: today beats weekend beats adjacent-month. Adjacent-month and weekend labels use the caption colour (`--lof-text-caption`; changed in 1.5.0, they used to fade to 40% / 70% opacity) — on the label only, so a *selected* weekend or adjacent-month day still reads at full contrast on the dark disc. A disabled day switches to the disabled text colour, with no extra fade when it is also a weekend or adjacent-month day (changed in 1.5.0; those used to fade further), and today keeps its brand ring even when it is unavailable or the calendar is disabled (changed in 1.5.0; it used to switch to a neutral ring).
109
+ - Figma treats the cell tone as one axis, so exactly one applies per day: today beats weekend beats adjacent-month. Adjacent-month labels use the placeholder colour (`--lof-text-placeholder`); weekend labels read like any other day (2026-11 refresh: weekends used to share the caption colour, which made them look unavailable) — on the label only, so a *selected* adjacent-month day still reads at full contrast on the dark disc. A disabled day switches to the disabled text colour, with no extra fade when it is also a weekend or adjacent-month day (changed in 1.5.0; those used to fade further), and today is marked by semibold type and a 4px dot under the number (2026-11 refresh; it used to be a 1px brand ring, which measured about 1.5:1 on white), kept even when it is unavailable or the calendar is disabled.
110
110
  - The month-navigation buttons are hand-rolled ghost buttons that bind the same action tokens as `<lof-button variant="ghost">` (audit 8b) — they are intentionally not `<lof-button>` instances.
111
111
  - The host has a fixed `max-width: 320px`, its own radius, shadow and padding and no border (Figma draws the card with `shadow/xl`, approximated here by `--lof-shadows-shadow-400`, the nearest shipped step); wrap it or override on the host if you need a different footprint.
@@ -1,6 +1,6 @@
1
1
  # lof-card
2
2
 
3
- `<lof-card>` is an elevated, padded surface that groups related content — the Figma "Card" component. `type="custom"` (the default) pads whatever you slot in and applies the Figma card typography to slotted headings and paragraphs; `type="media"` adds a flush media region above the body, meant for a `<lof-card-media>` image header. Use it for dashboard tiles, summary blocks and list items that pair a title with body copy. It is a static container with no interaction of its own — for transient content use `lof-modal` or `lof-drawer` instead, and for a surface with its own tone/elevation variants use `lof-container`.
3
+ `<lof-card>` is a surface that groups related content: a 12px card with a hairline edge and an xs shadow. Since the 2026-11 admin refresh it has an optional anatomy: a header row (`heading` and `description`, or the `title` slot, with a `toolbar` slot for actions on the right), the body, and a `footer` slot, divided by hairlines; `flush` lets the body run edge to edge for tables and lists. `type="custom"` (the default) pads whatever you slot in and applies the Figma card typography to slotted headings and paragraphs; `type="media"` adds a flush media region above the body, meant for a `<lof-card-media>` image header. Use it for dashboard tiles, summary blocks and list items that pair a title with body copy. It is a static container with no interaction of its own — for transient content use `lof-modal` or `lof-drawer` instead, and for a surface with its own tone/elevation variants use `lof-container`.
4
4
 
5
5
  ## Usage
6
6
 
@@ -18,6 +18,18 @@
18
18
  <p>12 meeting rooms · 24/7 operations</p>
19
19
  </lof-card>
20
20
 
21
+ <!-- Header, toolbar and footer -->
22
+ <lof-card heading="Highlights" description="All time sales">
23
+ <lof-button slot="toolbar" variant="ghost" icon-only aria-label="More"><lof-icon name="more-vertical"></lof-icon></lof-button>
24
+ <p>$295.7k across three channels.</p>
25
+ <lof-link slot="footer" href="/reports" arrow>View report</lof-link>
26
+ </lof-card>
27
+
28
+ <!-- Edge-to-edge body for a table -->
29
+ <lof-card heading="Teams" flush>
30
+ <lof-table appearance="plain"></lof-table>
31
+ </lof-card>
32
+
21
33
  <!-- Cards in a grid -->
22
34
  <div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;">
23
35
  <lof-card><h4>On time</h4><p>98.2%</p></lof-card>
@@ -28,15 +40,16 @@
28
40
 
29
41
  <!-- readme-gen:start -->
30
42
 
31
- <!-- Generated from lof-card.ts — do not edit; run readme-generate.mjs -->
32
-
33
43
  ## API
34
44
 
35
45
  ### Attributes / Properties
36
46
 
37
47
  | Property | Attribute | Type | Default | Description |
38
48
  | --- | --- | --- | --- | --- |
39
- | `type` | `type` | `"custom" \| "media"` | `"custom"` | Figma "Type" axis: custom (default) renders slotted content with card padding; media adds a flush media region (slot name="media") above the content — pair it with <lof-card-media>. Reflected. |
49
+ | `type` | `type` | `"custom" \| "media"` | `"custom"` | custom (default): padded body. media: adds a flush media region (slot `media`) above the body — pair it with <lof-card-media>. Reflected. |
50
+ | `heading` | `heading` | `string` | `""` | Header title; renders the header row. The `title` slot replaces it. |
51
+ | `description` | `description` | `string` | `""` | Muted line under the header title. |
52
+ | `flush` | `flush` | `boolean` | `false` | The body runs edge to edge (no padding): for tables, lists and media. Reflected. |
40
53
 
41
54
  ## Events
42
55
 
@@ -48,16 +61,32 @@
48
61
 
49
62
  | Slot | Description |
50
63
  | --- | --- |
51
- | (default) | Card body; slotted headings and paragraphs receive the Figma card typography |
52
- | `media` | Flush media region above the body; rendered only when `type="media"` |
64
+ | (default) | The body. Slotted `h1`–`h4` and `p` get the card type styles. |
65
+ | `media` | A flush media region above the body (`type="media"` only). |
66
+ | `title` | Rich header title content (replaces `heading`). |
67
+ | `toolbar` | Actions on the right of the header row: buttons, a switch, a menu. Fields slotted here drop their label row. |
68
+ | `footer` | A footer row under a hairline: links, actions, totals. |
53
69
 
54
70
  ## CSS Parts
55
71
 
56
72
  | Part | Description |
57
73
  | --- | --- |
58
- | `base` | The outer elevated card surface |
59
- | `header` | The media region wrapper (present only when `type="media"`) |
60
- | `content` | The padded body that wraps the default slot |
74
+ | `base` | The card surface |
75
+ | `head` | The header row (hidden without a heading, title or toolbar) |
76
+ | `title` | The header title (`heading`) |
77
+ | `description` | The header description |
78
+ | `toolbar` | The toolbar region |
79
+ | `header` | The media region (`type="media"` only) |
80
+ | `content` | The body |
81
+ | `footer` | The footer row (hidden without footer content) |
82
+
83
+ ## Tokens / CSS Variables
84
+
85
+ ### Component hooks
86
+
87
+ | Custom property | Default | Description |
88
+ | --- | --- | --- |
89
+ | `--lof-card-padding` | `20px` | Inline padding of the header, body and footer, and the body's block padding |
61
90
 
62
91
  <!-- readme-gen:end -->
63
92
 
@@ -69,7 +98,8 @@
69
98
 
70
99
  ## Notes / Edge Cases
71
100
 
72
- - `type="media"` removes the card's own padding and clips overflow so the media sits flush against the rounded border; the body (`content` part) keeps the standard padding. Content placed in the `media` slot without `type="media"` is not rendered, because the slot only exists in that mode.
101
+ - `type="media"` clips overflow so the media sits flush against the rounded border; the body (`content` part) keeps the standard padding. Content placed in the `media` slot without `type="media"` is not rendered, because the slot only exists in that mode.
73
102
  - The `header` part exists only while `type="media"`; `::part(header)` matches nothing otherwise.
74
103
  - Slotted `h1`–`h4` and `p` elements get the Figma card roles (heading md / body lg) with their default margins reset; wrap other content in your own elements to style it.
75
- - The card is elevated with Figma's `shadow/sm` and draws no border, in both light and dark themes. There is no hover lift or transition.
104
+ - The card draws its edge as a 1px ring in its shadow (`--lof-shadow-surface`: a hairline in `--lof-border-subtle` plus the xs shadow), so the border never changes its size. There is no hover lift or transition.
105
+ - The header row is at least 56px tall; header, body and footer share the 20px inline padding (`--lof-card-padding`).
@@ -1,141 +1,153 @@
1
- # lof-chip
2
-
3
- `<lof-chip>` is the compact chip from the Figma "Chip" component: a short label with tone × variant colouring, an optional leading icon or initials avatar, an optional trailing icon, a remove control and opt-in drag-and-drop. Use it for tags, active filters, selected values in a multi-select and small status labels. Do not use it as a general button (use `lof-button`) or for status counts (use `lof-badge`); for long-lived toggles use `lof-switch` or `lof-checkbox`.
4
-
5
- ## Usage
6
-
7
- ```html
8
- <!-- Basic chip (tone="neutral" variant="fill" size="medium" border="default") -->
9
- <lof-chip label="Active"></lof-chip>
10
-
11
- <!-- Tones -->
12
- <lof-chip label="Info" tone="info"></lof-chip>
13
- <lof-chip label="Warning" tone="warning"></lof-chip>
14
- <lof-chip label="Error" tone="destructive"></lof-chip>
15
- <lof-chip label="Success" tone="success"></lof-chip>
16
-
17
- <!-- Subtle variant: tinted background, tone-coloured text -->
18
- <lof-chip label="Subtle" tone="info" variant="subtle"></lof-chip>
19
-
20
- <!-- Sizes -->
21
- <lof-chip label="Small" size="small"></lof-chip>
22
- <lof-chip label="Medium" size="medium"></lof-chip>
23
- <lof-chip label="Large" size="large"></lof-chip>
24
-
25
- <!-- Deprecated aliases — these still render, but prefer the canonical spellings above.
26
- tone="danger" is an alias of tone="destructive" and logs a one-time console notice.
27
- size="sm" / "md" / "lg" are alternative spellings (NOT deprecated, no notice). -->
28
- <lof-chip label="Error" tone="danger"></lof-chip>
29
- <lof-chip label="Small" size="sm"></lof-chip>
30
-
31
- <!-- Fully rounded corners -->
32
- <lof-chip label="Rounded" border="rounded"></lof-chip>
33
-
34
- <!-- Leading / trailing icons (icon dictionary names, rendered via <lof-icon>) -->
35
- <lof-chip label="Settings" leading-icon="settings"></lof-chip>
36
- <lof-chip label="Next" trailing-icon="chevron-right"></lof-chip>
37
-
38
- <!-- Initials avatar (takes precedence over leading-icon) -->
39
- <lof-chip label="John Doe" avatar="JD"></lof-chip>
40
-
41
- <!-- Removable chip -->
42
- <lof-chip id="removableChip" label="Removable" removable></lof-chip>
43
- <script>
44
- document.getElementById("removableChip").addEventListener("removed", () => {
45
- console.log("Chip was removed");
46
- });
47
- </script>
48
-
49
- <!-- Draggable chip: native drag-and-drop plus Left/Right arrow reordering -->
50
- <lof-chip id="dragChip" label="Reorder me" draggable-chip></lof-chip>
51
- <script>
52
- document.getElementById("dragChip").addEventListener("chip-move", (e) => {
53
- console.log("move", e.detail.direction); // -1 = left, 1 = right
54
- });
55
- </script>
56
- ```
57
-
58
- <!-- readme-gen:start -->
59
-
60
- <!-- Generated from lof-chip.ts — do not edit; run readme-generate.mjs -->
61
-
62
- ## API
63
-
64
- ### Attributes / Properties
65
-
66
- | Property | Attribute | Type | Default | Description |
67
- | --- | --- | --- | --- | --- |
68
- | `label` | `label` | `string` | `"Label"` | Text shown in the chip; also its accessible name and the drag payload. |
69
- | `fieldAriaLabel` | `field-aria-label` | `string` | `undefined` | Accessible name for an icon-only or intentionally unlabelled chip; overrides `label` for the chip and its remove button. |
70
- | `tone` | `tone` | `"neutral" \| "destructive" \| "warning" \| "success" \| "info" \| "danger"` | `"neutral"` | Colour tone (Figma Tone): `neutral`, `destructive`, `warning`, `success` or `info`. Combined with `variant`. `"danger"` is a deprecated alias of `"destructive"`: it keeps working, logs a one-time console notice, and is normalised to `"destructive"` on the property and the reflected attribute. Reflected. |
71
- | `variant` | `variant` | `"fill" \| "subtle" \| "primary" \| "secondary"` | `"fill"` | Emphasis (Figma Style): `fill` = solid tone background, `subtle` = tinted background with tone-coloured text. Figma's own spellings `primary` and `secondary` are accepted and normalised to `fill` / `subtle`. Reflected. |
72
- | `size` | `size` | `"small" \| "medium" \| "large" \| "sm" \| "md" \| "lg"` | `"medium"` | Height scale (Figma Size): `small` 24px / body-sm, `medium` 28px / body-md, `large` 32px / body-lg. Icon size follows (12 / 14 / 16px). `sm` / `md` / `lg` are accepted and normalised to the full words. Reflected. |
73
- | `border` | `border` | `"default" \| "rounded"` | `"default"` | Corner shape (Figma Border): `default` = 4px radius, `rounded` = fully rounded with 12px horizontal padding. Reflected. |
74
- | `leadingIcon` | `leading-icon` | `string` | `undefined` | Icon name from the generated icon dictionary (e.g. "settings") — rendered via <lof-icon> before the label. Ignored when `avatar` is set. |
75
- | `trailingIcon` | `trailing-icon` | `string` | `undefined` | Icon name from the generated icon dictionary, rendered after the label. |
76
- | `avatar` | `avatar` | `string` | `undefined` | Initials text for the avatar (e.g. "JD"), rendered as a `<lof-avatar type="text">` before the label. Mutually exclusive with leadingIcon (avatar wins). |
77
- | `removable` | `removable` | `boolean` | `false` | Shows a remove (close) button after the label; clicking it sets `removed` and fires `removed`. |
78
- | `presentational` | `presentational` | `boolean` | `false` | New in 1.5.0. Makes the chip body plain text: no `button` role, no Tab stop, no Enter / Space / Delete handling and no host click re-dispatch. The remove button (when `removable`) stays a real button. For chips that only display a value inside another control, e.g. lof-select's multi-select chips. Reflected. |
79
- | `removed` | `removed` | `boolean` | `false` | `true` once the chip has been removed — the host is hidden via `:host([removed])`. Reflected so CSS and Angular can see it; reset to `false` to show the chip again. Reflected. |
80
- | `draggableChip` | `draggable-chip` | `boolean` | `false` | Opt-in native drag-and-drop: sets `draggable="true"` on the host, shows the Figma "Dragged" state during a real drag gesture, and makes Left/Right arrow keys fire `chip-move`. |
81
-
82
- ## Events
83
-
84
- | Event | Detail | Bubbles / composed | Description |
85
- | --- | --- | --- | --- |
86
- | `chip-move` | `{ direction: e.key === "ArrowLeft" ? -1 : 1 }` | bubbles / composed | Fired on Left/Right arrow keys when `draggable-chip` is set — the keyboard alternative to drag-and-drop; the container should reorder the chip. Detail: `{ direction: -1 \| 1 }` (-1 = left, 1 = right). |
87
- | `removed` | — | bubbles / composed | Fired when the chip is removed via its remove button or Delete/Backspace (after `removed` is set to `true`). No detail. |
88
-
89
- ## Slots
90
-
91
- | Slot | Description |
92
- | --- | --- |
93
- | — | This element has no slots. |
94
-
95
- ## CSS Parts
96
-
97
- | Part | Description |
98
- | --- | --- |
99
- | `base` | The chip body (`.chip`) that carries size, tone, variant and border styling |
100
- | `icon` | The leading `<lof-icon>` (rendered only when `leading-icon` is set and no avatar) |
101
- | `label` | The label text |
102
- | `remove` | The remove `<button>` (rendered only when `removable`) |
103
-
104
- ## Tokens / CSS Variables
105
-
106
- ### Component hooks
107
-
108
- Set these on the host (or an ancestor) to customise the element without touching design tokens.
109
-
110
- | Custom property | Default | Description |
111
- | --- | --- | --- |
112
- | `--lof-chip-focus-ring` | `var(--lof-border-focus)` | Colour of the keyboard focus outline; default `var(--lof-border-focus)` |
113
-
114
- <!-- readme-gen:end -->
115
-
116
- ## Accessibility
117
-
118
- - The chip body is a `<span role="button" tabindex="0">` whose `aria-label` is the `label` text. The shadow root uses `delegatesFocus`, so calling `focus()` on the host focuses that inner span.
119
- - The remove control is a real `<button>` labelled `Remove {label}`; it is a second Tab stop after the chip body.
120
- - Removing a chip (button or keyboard) calls the shared `announce()` helper with `"{label} removed"`, so screen readers hear the removal even though the chip disappears.
121
- - Icons and the avatar are decorative; the accessible name comes only from `label`.
122
-
123
- | Key | Action |
124
- |-----|--------|
125
- | `Tab` | Focus the chip body, then the remove button (when `removable`) |
126
- | `Enter` / `Space` | Re-dispatches a `click` on the host so consumer `click` handlers run |
127
- | `Delete` / `Backspace` | Removes the chip when `removable` (sets `removed`, fires `removed`) |
128
- | `ArrowLeft` / `ArrowRight` | Fires `chip-move` with `direction: -1` / `1` when `draggable-chip` is set |
129
-
130
- Focus is shown as a 2px outline in `--lof-chip-focus-ring` (defaults to `--lof-border-focus`) around the whole chip, plus an inner `--lof-border-focus-inner` ring, only for keyboard focus (`:focus-visible`). The remove button gets its own `currentColor` outline.
131
-
132
- ## Notes / Edge Cases
133
-
134
- - `avatar` and `leading-icon` are mutually exclusive: when both are set the avatar wins and a console warning is logged. The avatar is a `lof-avatar type="text"` sized to fill the chip's content box — 16 / 20 / 24px for `sm` / `md` / `lg`, driven through `--lof-avatar-size` rather than the avatar's own `size` presets (the small chip needs 16px, below the 20px `xs` floor).
135
- - The trailing icon has no CSS part; only the leading icon is exposed as `icon`.
136
- - The remove `✕` is drawn at the same size as the leading/trailing icons (12 / 14 / 16px) and in the same colour as the label — it carries no opacity dulling, so it keeps the label's contrast ratio on the `subtle` tones.
137
- - `border="rounded"` also widens the horizontal padding to 12px at every size, per the Figma spec.
138
- - `removed` is reflected: once `true` the host is `display: none` via `:host([removed])`. Set it back to `false` to show the chip again. Clicking the remove button stops propagation, so chip-level `click` handlers do not fire on removal.
139
- - `draggable-chip` sets the native `draggable="true"` attribute on the host and puts the label in `dataTransfer` as `text/plain`. During a real drag the host carries a `dragging` attribute that maps to the Figma "Dragged" state; the same look is used for `:active`. The component does not reorder anything itself — the container must handle `drop` / `chip-move`.
140
- - The remove button has no hover state of its own; the hover/pressed colours belong to the whole chip (per-tone action tokens).
141
- - The host is `display: inline-flex` with `flex: 0 0 auto`, so chips flow inline and never stretch in a flex row.
1
+ # lof-chip
2
+
3
+ `<lof-chip>` is the compact chip from the Figma "Chip" component: a short label with tone × variant colouring, an optional leading icon or initials avatar, an optional trailing icon, a remove control and opt-in drag-and-drop. Use it for tags, active filters, selected values in a multi-select and small status labels. Do not use it as a general button (use `lof-button`) or for status counts (use `lof-badge`); for long-lived toggles use `lof-switch` or `lof-checkbox`.
4
+
5
+ ## Usage
6
+
7
+ ```html
8
+ <!-- Basic chip (tone="neutral" variant="fill" size="medium" border="default") -->
9
+ <lof-chip label="Active"></lof-chip>
10
+
11
+ <!-- Tones -->
12
+ <lof-chip label="Info" tone="info"></lof-chip>
13
+ <lof-chip label="Warning" tone="warning"></lof-chip>
14
+ <lof-chip label="Error" tone="destructive"></lof-chip>
15
+ <lof-chip label="Success" tone="success"></lof-chip>
16
+
17
+ <!-- Subtle variant: tinted background, tone-coloured text -->
18
+ <lof-chip label="Subtle" tone="info" variant="subtle"></lof-chip>
19
+
20
+ <!-- Sizes -->
21
+ <lof-chip label="Small" size="small"></lof-chip>
22
+ <lof-chip label="Medium" size="medium"></lof-chip>
23
+ <lof-chip label="Large" size="large"></lof-chip>
24
+
25
+ <!-- Deprecated aliases — these still render, but prefer the canonical spellings above.
26
+ tone="danger" is an alias of tone="destructive" and logs a one-time console notice.
27
+ size="sm" / "md" / "lg" are alternative spellings (NOT deprecated, no notice). -->
28
+ <lof-chip label="Error" tone="danger"></lof-chip>
29
+ <lof-chip label="Small" size="sm"></lof-chip>
30
+
31
+ <!-- Fully rounded corners -->
32
+ <lof-chip label="Rounded" border="rounded"></lof-chip>
33
+
34
+ <!-- Leading / trailing icons (icon dictionary names, rendered via <lof-icon>) -->
35
+ <lof-chip label="Settings" leading-icon="settings"></lof-chip>
36
+ <lof-chip label="Next" trailing-icon="chevron-right"></lof-chip>
37
+
38
+ <!-- Initials avatar (takes precedence over leading-icon) -->
39
+ <lof-chip label="John Doe" avatar="JD"></lof-chip>
40
+
41
+ <!-- Removable chip -->
42
+ <lof-chip id="removableChip" label="Removable" removable></lof-chip>
43
+ <script>
44
+ document.getElementById("removableChip").addEventListener("removed", () => {
45
+ console.log("Chip was removed");
46
+ });
47
+ </script>
48
+
49
+ <!-- Draggable chip: native drag-and-drop plus Left/Right arrow reordering -->
50
+ <lof-chip id="dragChip" label="Reorder me" draggable-chip></lof-chip>
51
+ <script>
52
+ document.getElementById("dragChip").addEventListener("chip-move", (e) => {
53
+ console.log("move", e.detail.direction); // -1 = left, 1 = right
54
+ });
55
+ </script>
56
+ ```
57
+
58
+ <!-- readme-gen:start -->
59
+
60
+ <!-- Generated from lof-chip.ts — do not edit; run readme-generate.mjs -->
61
+
62
+ ## API
63
+
64
+ ### Attributes / Properties
65
+
66
+ | Property | Attribute | Type | Default | Description |
67
+ | --- | --- | --- | --- | --- |
68
+ | `label` | `label` | `string` | `"Label"` | Text shown in the chip; also its accessible name and the drag payload. |
69
+ | `fieldAriaLabel` | `field-aria-label` | `string` | `undefined` | Accessible name for an icon-only or intentionally unlabelled chip; overrides `label` for the chip and its remove button. |
70
+ | `tone` | `tone` | `"neutral" \| "accent" \| "destructive" \| "warning" \| "success" \| "info" \| "danger"` | `"neutral"` | Colour tone (Figma Tone): `neutral`, `destructive`, `warning`, `success` or `info`. Combined with `variant`. `"danger"` is a deprecated alias of `"destructive"`: it keeps working, logs a one-time console notice, and is normalised to `"destructive"` on the property and the reflected attribute. Reflected. |
71
+ | `variant` | `variant` | `"fill" \| "subtle" \| "outline" \| "primary" \| "secondary"` | `"fill"` | Emphasis (Figma Style): `fill` = solid tone background, `subtle` = tinted background with tone-coloured text. Figma's own spellings `primary` and `secondary` are accepted and normalised to `fill` / `subtle`. Reflected. |
72
+ | `size` | `size` | `"small" \| "medium" \| "large" \| "sm" \| "md" \| "lg"` | `"medium"` | Height scale (Figma Size): `small` 24px / body-sm, `medium` 28px / body-md, `large` 32px / body-lg. Icon size follows (12 / 14 / 16px). `sm` / `md` / `lg` are accepted and normalised to the full words. Reflected. |
73
+ | `border` | `border` | `"default" \| "rounded"` | `"default"` | Corner shape (Figma Border): `default` = 6px radius, `rounded` = fully rounded with 12px horizontal padding. Reflected. |
74
+ | `leadingIcon` | `leading-icon` | `string` | `undefined` | Icon name from the generated icon dictionary (e.g. "settings") — rendered via <lof-icon> before the label. Ignored when `avatar` is set. |
75
+ | `trailingIcon` | `trailing-icon` | `string` | `undefined` | Icon name from the generated icon dictionary, rendered after the label. |
76
+ | `avatar` | `avatar` | `string` | `undefined` | Initials text for the avatar (e.g. "JD"), rendered as a `<lof-avatar type="text">` before the label. Mutually exclusive with leadingIcon (avatar wins). |
77
+ | `removable` | `removable` | `boolean` | `false` | Shows a remove (close) button after the label; clicking it sets `removed` and fires `removed`. |
78
+ | `presentational` | `presentational` | `boolean` | `false` | New in 1.5.0. Makes the chip body plain text: no `button` role, no Tab stop, no Enter / Space / Delete handling and no host click re-dispatch. The remove button (when `removable`) stays a real button. For chips that only display a value inside another control, e.g. lof-select's multi-select chips. Reflected. |
79
+ | `removed` | `removed` | `boolean` | `false` | `true` once the chip has been removed — the host is hidden via `:host([removed])`. Reflected so CSS and Angular can see it; reset to `false` to show the chip again. Reflected. |
80
+ | `draggableChip` | `draggable-chip` | `boolean` | `false` | Opt-in native drag-and-drop: sets `draggable="true"` on the host, shows the Figma "Dragged" state during a real drag gesture, and makes Left/Right arrow keys fire `chip-move`. |
81
+
82
+ ## Events
83
+
84
+ | Event | Detail | Bubbles / composed | Description |
85
+ | --- | --- | --- | --- |
86
+ | `chip-move` | `{ direction: e.key === "ArrowLeft" ? -1 : 1 }` | bubbles / composed | Fired on Left/Right arrow keys when `draggable-chip` is set — the keyboard alternative to drag-and-drop; the container should reorder the chip. Detail: `{ direction: -1 \| 1 }` (-1 = left, 1 = right). |
87
+ | `removed` | — | bubbles / composed | Fired when the chip is removed via its remove button or Delete/Backspace (after `removed` is set to `true`). No detail. |
88
+
89
+ ## Slots
90
+
91
+ | Slot | Description |
92
+ | --- | --- |
93
+ | — | This element has no slots. |
94
+
95
+ ## CSS Parts
96
+
97
+ | Part | Description |
98
+ | --- | --- |
99
+ | `base` | The chip body (`.chip`) that carries size, tone, variant and border styling |
100
+ | `icon` | The leading `<lof-icon>` (rendered only when `leading-icon` is set and no avatar) |
101
+ | `label` | The label text |
102
+ | `remove` | The remove `<button>` (rendered only when `removable`) |
103
+
104
+ ## Tokens / CSS Variables
105
+
106
+ ### Component hooks
107
+
108
+ Set these on the host (or an ancestor) to customise the element without touching design tokens.
109
+
110
+ | Custom property | Default | Description |
111
+ | --- | --- | --- |
112
+ | `--lof-chip-focus-ring` | `var(--lof-border-focus)` | Colour of the keyboard focus outline; default `var(--lof-border-focus)` |
113
+
114
+ <!-- readme-gen:end -->
115
+
116
+ ## 2026-11 admin refresh
117
+
118
+ - Chips are status labels: 20 / 24 / 28px tall (small / medium / large), 4px corners at small and 6px above, 12px Medium text (10px at small).
119
+ - `variant="subtle"` is a light tint with a 1px edge in the same hue; `variant="outline"` (new) is the surface colour with a hairline, the tone tinting only the text.
120
+ - `tone="accent"` (new) uses the green accent: a solid accent fill, or the accent tint when subtle.
121
+
122
+ ```html
123
+ <lof-chip label="Public" tone="success" variant="subtle" size="small"></lof-chip>
124
+ <lof-chip label="Management" variant="outline"></lof-chip>
125
+ <lof-chip label="New" tone="accent" variant="subtle"></lof-chip>
126
+ ```
127
+
128
+ ## Accessibility
129
+
130
+ - The chip body is a `<span role="button" tabindex="0">` whose `aria-label` is the `label` text. The shadow root uses `delegatesFocus`, so calling `focus()` on the host focuses that inner span.
131
+ - The remove control is a real `<button>` labelled `Remove {label}`; it is a second Tab stop after the chip body.
132
+ - Removing a chip (button or keyboard) calls the shared `announce()` helper with `"{label} removed"`, so screen readers hear the removal even though the chip disappears.
133
+ - Icons and the avatar are decorative; the accessible name comes only from `label`.
134
+
135
+ | Key | Action |
136
+ |-----|--------|
137
+ | `Tab` | Focus the chip body, then the remove button (when `removable`) |
138
+ | `Enter` / `Space` | Re-dispatches a `click` on the host so consumer `click` handlers run |
139
+ | `Delete` / `Backspace` | Removes the chip when `removable` (sets `removed`, fires `removed`) |
140
+ | `ArrowLeft` / `ArrowRight` | Fires `chip-move` with `direction: -1` / `1` when `draggable-chip` is set |
141
+
142
+ Focus is shown as a 2px outline in `--lof-chip-focus-ring` (defaults to `--lof-border-focus`) around the whole chip, plus an inner `--lof-border-focus-inner` ring, only for keyboard focus (`:focus-visible`). The remove button gets its own `currentColor` outline.
143
+
144
+ ## Notes / Edge Cases
145
+
146
+ - `avatar` and `leading-icon` are mutually exclusive: when both are set the avatar wins and a console warning is logged. The avatar is a `lof-avatar type="text"` sized to fill the chip's content box — 16 / 20 / 24px for `sm` / `md` / `lg`, driven through `--lof-avatar-size` rather than the avatar's own `size` presets (the small chip needs 16px, below the 20px `xs` floor).
147
+ - The trailing icon has no CSS part; only the leading icon is exposed as `icon`.
148
+ - The remove `✕` is drawn at the same size as the leading/trailing icons (12 / 14 / 16px) and in the same colour as the label — it carries no opacity dulling, so it keeps the label's contrast ratio on the `subtle` tones.
149
+ - `border="rounded"` also widens the horizontal padding to 12px at every size, per the Figma spec.
150
+ - `removed` is reflected: once `true` the host is `display: none` via `:host([removed])`. Set it back to `false` to show the chip again. Clicking the remove button stops propagation, so chip-level `click` handlers do not fire on removal.
151
+ - `draggable-chip` sets the native `draggable="true"` attribute on the host and puts the label in `dataTransfer` as `text/plain`. During a real drag the host carries a `dragging` attribute that maps to the Figma "Dragged" state; the same look is used for `:active`. The component does not reorder anything itself — the container must handle `drop` / `chip-move`.
152
+ - The remove button has no hover state of its own; the hover/pressed colours belong to the whole chip (per-tone action tokens).
153
+ - The host is `display: inline-flex` with `flex: 0 0 auto`, so chips flow inline and never stretch in a flex row.
@@ -14,7 +14,7 @@
14
14
  <!-- Bounded to 2026, Monday-first grid -->
15
15
  <lof-date-picker label="Handoff" min-date="2026-01-01" max-date="2026-12-31" week-start="mon"></lof-date-picker>
16
16
 
17
- <!-- Field heights 32 / 40 / 48; full-width fills the parent -->
17
+ <!-- Field heights 28 / 34 / 40; full-width fills the parent -->
18
18
  <lof-date-picker size="small" label="Small"></lof-date-picker>
19
19
  <lof-date-picker size="medium" label="Medium" variant="outlined"></lof-date-picker>
20
20
  <lof-date-picker size="large" label="Large" full-width></lof-date-picker>