@reliability-design/web 1.4.6 → 1.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +211 -49
- package/dist/components/rel-accordion/README.md +132 -132
- package/dist/components/rel-alert/README.md +145 -141
- package/dist/components/rel-autocomplete/README.md +156 -61
- package/dist/components/rel-avatar/README.md +116 -130
- package/dist/components/rel-badge/README.md +98 -93
- package/dist/components/rel-breadcrumb/README.md +96 -102
- package/dist/components/rel-button/README.md +160 -130
- package/dist/components/rel-calendar/README.md +109 -109
- package/dist/components/rel-card/README.md +75 -94
- package/dist/components/rel-cardmedia/README.md +100 -127
- package/dist/components/rel-carousel/README.md +184 -166
- package/dist/components/rel-checkbox/README.md +93 -75
- package/dist/components/rel-chip/README.md +132 -121
- package/dist/components/rel-container/README.md +107 -99
- package/dist/components/rel-date-picker/README.md +200 -289
- package/dist/components/rel-divider/README.md +78 -100
- package/dist/components/rel-drawer/README.md +187 -200
- package/dist/components/rel-kbd/README.md +141 -151
- package/dist/components/rel-menu/README.md +178 -151
- package/dist/components/rel-menubar/README.md +218 -329
- package/dist/components/rel-otp/README.md +170 -440
- package/dist/components/rel-pagination/README.md +100 -424
- package/dist/components/rel-popover/README.md +203 -568
- package/dist/components/rel-progress/README.md +88 -110
- package/dist/components/rel-radio/README.md +131 -138
- package/dist/components/rel-range-picker/README.md +162 -0
- package/dist/components/rel-resizable/README.md +199 -140
- package/dist/components/rel-segmented-button/README.md +155 -141
- package/dist/components/rel-select/README.md +154 -93
- package/dist/components/rel-sheet/README.md +168 -224
- package/dist/components/rel-skeleton/README.md +103 -0
- package/dist/components/rel-slider/README.md +130 -135
- package/dist/components/rel-snackbar/README.md +162 -134
- package/dist/components/rel-stepper/README.md +158 -160
- package/dist/components/rel-switch/README.md +108 -102
- package/dist/components/rel-tab/README.md +171 -163
- package/dist/components/rel-textfield/README.md +159 -69
- package/dist/components/rel-time-picker/README.md +122 -157
- package/dist/components/rel-toast/README.md +157 -148
- package/dist/components/rel-tooltip/README.md +108 -111
- package/dist/components/rel-upload/README.md +220 -0
- package/dist/index.d.mts +1147 -340
- package/dist/index.d.ts +1147 -340
- package/dist/index.js +3451 -3163
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3416 -3118
- package/dist/index.mjs.map +1 -1
- package/dist/styles/vars.css +877 -866
- package/dist/{vars-XNMTSRVN.css → vars-JHTUGNRG.css} +877 -866
- package/package.json +3 -2
- package/dist/components/rel-accordion/rel-accordion.ts +0 -336
- package/dist/components/rel-alert/rel-alert.ts +0 -305
- package/dist/components/rel-autocomplete/rel-autocomplete.ts +0 -720
- package/dist/components/rel-avatar/rel-avatar.ts +0 -142
- package/dist/components/rel-badge/rel-badge.ts +0 -175
- package/dist/components/rel-breadcrumb/rel-breadcrumb.ts +0 -106
- package/dist/components/rel-button/rel-button.ts +0 -560
- package/dist/components/rel-calendar/index.ts +0 -1
- package/dist/components/rel-calendar/rel-calendar.ts +0 -565
- package/dist/components/rel-card/rel-card.ts +0 -88
- package/dist/components/rel-cardmedia/rel-cardmedia.ts +0 -88
- package/dist/components/rel-carousel/index.ts +0 -1
- package/dist/components/rel-carousel/rel-carousel.ts +0 -723
- package/dist/components/rel-chart/README.md +0 -286
- package/dist/components/rel-chart/index.ts +0 -1
- package/dist/components/rel-chart/rel-chart.ts +0 -754
- package/dist/components/rel-checkbox/rel-checkbox.ts +0 -382
- package/dist/components/rel-chip/rel-chip.ts +0 -483
- package/dist/components/rel-container/rel-container.ts +0 -95
- package/dist/components/rel-date-picker/date-format.test.ts +0 -43
- package/dist/components/rel-date-picker/date-format.ts +0 -47
- package/dist/components/rel-date-picker/date-parse.test.ts +0 -116
- package/dist/components/rel-date-picker/date-parse.ts +0 -178
- package/dist/components/rel-date-picker/index.ts +0 -1
- package/dist/components/rel-date-picker/rel-date-picker.ts +0 -1676
- package/dist/components/rel-divider/rel-divider.ts +0 -54
- package/dist/components/rel-drawer/index.ts +0 -1
- package/dist/components/rel-drawer/rel-drawer-footer.ts +0 -27
- package/dist/components/rel-drawer/rel-drawer.ts +0 -607
- package/dist/components/rel-kbd/rel-kbd.ts +0 -188
- package/dist/components/rel-layout/rel-layout.ts +0 -49
- package/dist/components/rel-menu/rel-menu.ts +0 -541
- package/dist/components/rel-menubar/index.ts +0 -2
- package/dist/components/rel-menubar/rel-menubar-menu.css +0 -3
- package/dist/components/rel-menubar/rel-menubar-menu.ts +0 -17
- package/dist/components/rel-menubar/rel-menubar.ts +0 -777
- package/dist/components/rel-nav-menu/README.md +0 -289
- package/dist/components/rel-nav-menu/index.ts +0 -3
- package/dist/components/rel-nav-menu/rel-nav-menu-item.ts +0 -243
- package/dist/components/rel-nav-menu/rel-nav-menu-panel.ts +0 -72
- package/dist/components/rel-nav-menu/rel-nav-menu.ts +0 -270
- package/dist/components/rel-navbar/README.md +0 -126
- package/dist/components/rel-navbar/rel-navbar.ts +0 -105
- package/dist/components/rel-otp/index.ts +0 -1
- package/dist/components/rel-otp/rel-otp.ts +0 -527
- package/dist/components/rel-pagination/index.ts +0 -1
- package/dist/components/rel-pagination/rel-pagination.ts +0 -522
- package/dist/components/rel-popover/index.ts +0 -2
- package/dist/components/rel-popover/rel-popover-content.ts +0 -81
- package/dist/components/rel-popover/rel-popover.ts +0 -475
- package/dist/components/rel-progress/rel-progress.ts +0 -234
- package/dist/components/rel-radio/rel-radio.ts +0 -481
- package/dist/components/rel-range-picker/rel-range-picker.ts +0 -1688
- package/dist/components/rel-resizable/index.ts +0 -3
- package/dist/components/rel-resizable/rel-resizable-group.ts +0 -405
- package/dist/components/rel-resizable/rel-resizable-handle.ts +0 -150
- package/dist/components/rel-resizable/rel-resizable-panel.ts +0 -58
- package/dist/components/rel-segmented-button/rel-segmented-button.ts +0 -217
- package/dist/components/rel-select/rel-select.ts +0 -1416
- package/dist/components/rel-sheet/rel-sheet.ts +0 -610
- package/dist/components/rel-sidebar/README.md +0 -209
- package/dist/components/rel-sidebar/rel-sidebar.ts +0 -1191
- package/dist/components/rel-skeleton/rel-skeleton.ts +0 -143
- package/dist/components/rel-slider/rel-slider.ts +0 -673
- package/dist/components/rel-snackbar/rel-snackbar.ts +0 -329
- package/dist/components/rel-stepper/rel-stepper.ts +0 -567
- package/dist/components/rel-switch/rel-switch.ts +0 -199
- package/dist/components/rel-tab/rel-tab.ts +0 -264
- package/dist/components/rel-table/README.md +0 -178
- package/dist/components/rel-table/rel-table-body.ts +0 -22
- package/dist/components/rel-table/rel-table-caption.ts +0 -30
- package/dist/components/rel-table/rel-table-cell.ts +0 -43
- package/dist/components/rel-table/rel-table-footer.ts +0 -24
- package/dist/components/rel-table/rel-table-head.ts +0 -47
- package/dist/components/rel-table/rel-table-header.ts +0 -22
- package/dist/components/rel-table/rel-table-row.ts +0 -37
- package/dist/components/rel-table/rel-table.ts +0 -62
- package/dist/components/rel-textfield/rel-textfield.ts +0 -1054
- package/dist/components/rel-time-picker/rel-time-picker.ts +0 -1482
- package/dist/components/rel-time-picker/time-parse.test.ts +0 -67
- package/dist/components/rel-time-picker/time-parse.ts +0 -85
- package/dist/components/rel-toast/rel-toast.ts +0 -206
- package/dist/components/rel-tooltip/rel-tooltip.ts +0 -193
- package/dist/components/rel-topbar/rel-topbar-actions.ts +0 -27
- package/dist/components/rel-topbar/rel-topbar-brand.ts +0 -54
- package/dist/components/rel-topbar/rel-topbar-dropdown-item.ts +0 -69
- package/dist/components/rel-topbar/rel-topbar-dropdown.ts +0 -31
- package/dist/components/rel-topbar/rel-topbar-item.ts +0 -324
- package/dist/components/rel-topbar/rel-topbar-mobile-panel.ts +0 -27
- package/dist/components/rel-topbar/rel-topbar-profile.ts +0 -243
- package/dist/components/rel-topbar/rel-topbar-utilities.ts +0 -27
- package/dist/components/rel-topbar/rel-topbar.ts +0 -446
- package/dist/components/rel-upload/UPLOAD-DESIGN-CHANGES.md +0 -134
- package/dist/components/rel-upload/rel-upload-actions.ts +0 -163
- package/dist/components/rel-upload/rel-upload.ts +0 -968
package/CHANGELOG.md
CHANGED
|
@@ -1,49 +1,211 @@
|
|
|
1
|
-
# Changelog — @reliability-design/web
|
|
2
|
-
|
|
3
|
-
## 1.4.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
- `rel-
|
|
19
|
-
- `
|
|
20
|
-
- `
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
1
|
+
# Changelog — @reliability-design/web
|
|
2
|
+
|
|
3
|
+
## 1.4.7 (2026-09-05)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
Designer-audit release. Every rename is **additive** — the new prop or value is canonical, the old one keeps working and is mapped internally, and its first use logs **one** `console.warn` per component per page (never one per instance). Two breaking removals: `rel-topbar` and `rel-navbar` are gone. The full old → new table is under [Migrating](#migrating-to-147) below and on the docs site at `/docs/migration`.
|
|
7
|
+
|
|
8
|
+
Paired releases: `@reliability-design/angular` 1.4.7; `@reliability-design/icons` 1.4.5.
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **`tone` on `rel-alert`, `rel-toast`, `rel-snackbar`** with a new `destructive` value — `rel-alert`: `neutral | info | success | warning | destructive`; `rel-toast`: `default | destructive`; `rel-snackbar`: `neutral | success | warning | destructive`. Replaces `type`; an explicit `tone` wins when both are set. Exported types `AlertTone`, `ToastTone`, `SnackbarTone` (+ `*ToneInput` unions that admit the deprecated spellings).
|
|
13
|
+
- **`surface` on `rel-container`** (`default | elevated | transparent`, reflected). Replaces `background`; an explicit `surface` wins. Exported type `ContainerSurface`.
|
|
14
|
+
- **`tone="destructive"` on `rel-button`** — canonical name for the red tone (`critical` / `danger` become deprecated aliases). **Fix:** `tone="brand"` on the `primary` and `default` styles had no CSS and rendered unstyled; it now paints the brand fill with a hover state. Existing markup is unaffected.
|
|
15
|
+
- **`rel-button` ghost/text + `small` + `icon-only`** now renders 32×32 as specified (a specificity bug left it at 56×32). Medium/large icon-only (40/48) and all label buttons are unchanged.
|
|
16
|
+
- **`rel-button` link style focus** — `:focus-visible` is now a 2px focus-coloured underline bar with focus-coloured text instead of the box outline (still a visible indicator, WCAG 2.4.7).
|
|
17
|
+
- **`arrow` on `rel-popover`** — opt-in boolean; draws a 14×11 chevron on the panel edge facing the trigger, centred on the trigger (clamped ≥ 15px from the corners) and overlapping the panel border by 1px. Colour via `--rel-popover-arrow-bg` / `--rel-popover-arrow-border` (default: panel background / border). With the arrow on, the trigger gap is `max(side-offset, 13px)`. Default rendering (8px gap, no arrow) unchanged.
|
|
18
|
+
- **`variant="text"` on `rel-modal`** — opt-in message-only body: 16 / 20 padding, body-lg text, normalised `<p>` margins; header and divider render above as usual (still shown with only the close button when there is no title). Exported type `ModalVariant`.
|
|
19
|
+
- **`fullwidth` on `rel-range-picker`** (property `fullWidth`, reflected) — `display:block; width:100%`, mirroring `rel-time-picker`. Default unchanged.
|
|
20
|
+
- **`input-mode` on `rel-otp`** (`numeric | alphanumeric`, property `inputMode`) — what the cells *accept*. Replaces `type`. Not to be confused with the lowercase native `inputmode` attribute (`numeric | text`), which remains the *keyboard hint* and passes through unchanged. Exported type `OtpInputMode`.
|
|
21
|
+
- **`rel-otp` sizes** — full-word `small | medium | large` are canonical (`sm | md | lg` keep working); an unset size now reflects `size="medium"` on the host.
|
|
22
|
+
- **`size="large"` on `rel-checkbox`** — 20px box (24 outer with the 2px border), 14px glyph, body-lg label, body-sm supporting text, 30px indent, `lg` icon. `small` / `medium` untouched.
|
|
23
|
+
- **`size="small"` on `rel-accordion`** — new 44px header (heading-xs). Full-word `large` (56px, formerly `md`) and `medium` (48px, formerly `sm`) are now the canonical spellings; `md` / `sm` keep working silently. Default unchanged.
|
|
24
|
+
- **Full-word sizes on `rel-tab`, `rel-kbd`, `rel-kbd-group`** — `small | medium | large` accepted alongside `sm | md | lg`; prefer the full words. `TabSize` / `KbdSize` include both.
|
|
25
|
+
- **`rel-time-picker`** small trigger `min-width` scoped per size: 128px for `small`; `medium` / `large` keep 160px.
|
|
26
|
+
- **`size` on `rel-menu`** (`large | medium | small`, reflected). Default `large` is the Figma default: 48px rows (12/12 padding, body-lg). `medium` = 40px rows with body-md; `small` = 32px rows with body-sm. Exported type `MenuSize`. **Heads-up:** the default row height moves from 36 to 48px — see Visual changes.
|
|
27
|
+
- **`rel-menu` states aligned to Figma** — hover / pressed use the `--rel-action-overlay-hover` / `-pressed` tints (pressed now distinct from hover); the selected list row is the hover tint with a medium-weight label; selected checkbox / select-option rows carry no fill; disabled items dim to 40% opacity instead of switching to the disabled text colour.
|
|
28
|
+
- **Shadow tokens applied** (cosmetic): `rel-alert` solid, `rel-snackbar`, `rel-slider` tooltip, `rel-menu` + submenu and the `rel-switch` knob on hover/pressed use `--rel-shadows-md`; `rel-accordion` `appearance="shadow"` and the `rel-switch` knob at rest use `--rel-shadows-sm`.
|
|
29
|
+
- **`::part(tooltip)` on `rel-slider`** — the value bubble, now a light tooltip above the thumb (see Visual changes).
|
|
30
|
+
- **Shadow tokens `--rel-shadows-sm`** (`0 2px 4px rgba(11,11,11,0.10)`) **and `--rel-shadows-md`** (`0 4px 8px rgba(11,11,11,0.10)`) in `vars.css` — generated from the Figma `shadow/sm` / `shadow/md` effect styles, which had no counterpart on the existing `--rel-shadows-shadow-100…500` scale. They are mode-agnostic in Figma, so one value serves light and dark. The full scale is now documented on the docs Tokens → Shadows page and in Storybook.
|
|
31
|
+
- **Spacing scale extended to the Figma "Web" collection** — new tokens `--rel-spacing-none` (0), `4xl` 36, `5xl` 40, `6xl` 44, `7xl` 48, `8xl` 56, `9xl` 64 and `10xl` 72px. **Two existing values change** to keep the scale monotonic: `--rel-spacing-2xl` 32 → 28px and `--rel-spacing-3xl` 48 → 32px (see Visual changes). Documented on the Foundation → Spacing page and in Storybook.
|
|
32
|
+
|
|
33
|
+
### Deprecated (still supported — removal targeted for 3.0)
|
|
34
|
+
|
|
35
|
+
| Component | Deprecated | Use instead | Console notice |
|
|
36
|
+
| --- | --- | --- | --- |
|
|
37
|
+
| `rel-alert`, `rel-toast`, `rel-snackbar` | `type` | `tone` (snackbar `type="default"` → `tone="neutral"`; `type="error"` → `tone="destructive"`) | once per component |
|
|
38
|
+
| `rel-alert`, `rel-toast`, `rel-snackbar` | `tone="error" \| "danger" \| "critical"` (snackbar also `"default"`) | `tone="destructive"` (snackbar `"default"` → `"neutral"`) | once per spelling |
|
|
39
|
+
| `rel-button` | `tone="critical" \| "danger"` | `tone="destructive"` | once per spelling |
|
|
40
|
+
| `rel-button` | `tone="default"` / `"primary"` (legacy) | `tone="neutral"` / `"brand"` | **none** (silent) |
|
|
41
|
+
| `rel-button` | `variant="text"` / `"outline"` / `"default"` / `"icon"` (legacy spellings) | `ghost` / `secondary` / `default` is still the default style / `icon-only` attribute + `size` | **none** (documented only) |
|
|
42
|
+
| `rel-container` | `background` (`white` / `light` / `none`) | `surface` (`default` / `elevated` / `transparent`) | once |
|
|
43
|
+
| `rel-otp` | `type` | `input-mode` | once |
|
|
44
|
+
| `rel-kbd` | `pill` (spec has one 4px radius; still renders the pill) | drop the attribute | once |
|
|
45
|
+
| types | `ToastType`, `SnackbarType`, `ContainerBackground`, `OtpType` | `ToastToneInput`, `SnackbarToneInput`, `ContainerSurface`, `OtpInputMode` | `@deprecated` JSDoc |
|
|
46
|
+
|
|
47
|
+
The notice format is `[rel-alert] "type" is deprecated and will be removed in 3.0 — use "tone" instead.` and is emitted once per (component, old name) pair via the shared `warnDeprecated` helper. Behaviour note: an unset `rel-container` `background` no longer reflects `background="white"` onto the host — CSS that selected on that attribute should target `surface` instead.
|
|
48
|
+
|
|
49
|
+
Still deprecated from earlier releases, unchanged: the V1 token alias block in `vars.css`.
|
|
50
|
+
|
|
51
|
+
### Removed (breaking)
|
|
52
|
+
|
|
53
|
+
- **`rel-topbar` and its 8 sub-components** — `rel-topbar-brand`, `rel-topbar-item`, `rel-topbar-dropdown`, `rel-topbar-dropdown-item`, `rel-topbar-actions`, `rel-topbar-utilities`, `rel-topbar-profile`, `rel-topbar-mobile-panel` — removed from exports and source. Deprecated since 1.3.1 but still leaking into the build. Replace with the **Navbar recipe** at `/docs/recipes/navbar` (composed from `rel-popover`, `rel-drawer`, `rel-button`; no helper element needed). The Angular `RelTopbar*Component` directives are removed in lockstep.
|
|
54
|
+
- **`rel-navbar`** — removed from exports and source, together with the Angular `RelNavbarComponent` directive. Deprecated since 1.3.x (it logged a console notice) and confirmed unused; the **Navbar recipe** at `/docs/recipes/navbar` replaces it. Component and README counts are now 42.
|
|
55
|
+
- **`dist/` no longer contains a copy of `src/components`.** Only `index.js` / `index.mjs` / `index.d.ts` and `styles/vars.css` ship. The raw source was compiled with the *consumer's* tsconfig and is the root cause of the TypeScript errors reported against 1.4.x. The package `exports` map never exposed deep paths, so only projects reaching into `node_modules/@reliability-design/web/dist/components/…` are affected — import from the package root.
|
|
56
|
+
- **`rel-chart`, `rel-nav-menu`, `rel-sidebar`, `rel-table` folders deleted.** None was exported from the package entry, so no registered element disappears.
|
|
57
|
+
|
|
58
|
+
### Visual changes
|
|
59
|
+
|
|
60
|
+
Layout shift **yes** = the box size or padding changed and neighbouring content can move; **no** = only colour, shadow, radius or state styling changed. Use this as the upgrade QA checklist.
|
|
61
|
+
|
|
62
|
+
| Component | Change | Layout shift | Before → after |
|
|
63
|
+
| --- | --- | --- | --- |
|
|
64
|
+
| `rel-textfield` | Explicit border-box control height (default, underline, legend); vertical input padding zeroed; multiline untouched | yes | S 38 → 32, M 48 → 40, L 58 → 48 (legend visible box at M 58 → 40) |
|
|
65
|
+
| `rel-select` | Trigger height (`height` replaces `min-height` + padding); panel untouched | yes | S 40 → 32, M 48 → 40, L 56 → 48 |
|
|
66
|
+
| `rel-autocomplete` | Inherits the textfield height change | yes | S 38 → 32, M 48 → 40, L 58 → 48 |
|
|
67
|
+
| `rel-date-picker` / `rel-time-picker` | Trigger button height | yes | S 38 → 32, M 48 → 40, L 58 → 48 |
|
|
68
|
+
| `rel-range-picker` | Trigger height (no size prop) | yes | 48 → 40 |
|
|
69
|
+
| `rel-time-picker` | Small trigger min-width (proportional, not a Figma value) | yes | 160 → 128 (small only) |
|
|
70
|
+
| `rel-otp` | Square cells on the field scale; unset size reflects `size="medium"`; radius 8 and gap 4 unchanged | yes | sm 36×40 → 32×32, md 40×48 → 40×40, lg 48×56 → 48×48 |
|
|
71
|
+
| `rel-button` | Ghost/text + small + icon-only width (bug fix) | yes | 56×32 → 32×32 |
|
|
72
|
+
| `rel-button` (link) | Focus-visible treatment; outline/halo removed for link only | no | box outline → 2px focus-coloured underline bar + focus-coloured text |
|
|
73
|
+
| `rel-calendar` | Prev/next nav buttons on ghost tokens | no | hover elevated-2 → ghost-hover; rest transparent; focus ring + halo; disabled 0.5 |
|
|
74
|
+
| `rel-carousel` | Prev/next nav buttons → ghost, dark-mode overrides removed. **Biggest change:** on the light theme the arrows are near-black and can be hard to see over dark slides — tint via `::part(prev-button)` / `::part(next-button)` | no | outlined + shadow-100 elevated circle → transparent ghost circle (40/32 sizes unchanged) |
|
|
75
|
+
| `rel-pagination` | Prev/next → ghost; page-number buttons untouched | no | outlined circle → transparent ghost circle; disabled opacity 0.35 → 0.5 |
|
|
76
|
+
| `rel-alert` | Solid (filled) appearance gains a shadow (Figma shadow/md); subtle/outline untouched | no | none → `--rel-shadows-md` |
|
|
77
|
+
| `rel-menu` | **Row height at the default size — every dropdown gets taller.** `size="medium"` (40px) is closest to the old height; `size="small"` is 32px | **yes** | 36 → 48px rows (padding 12/12, body-lg line-height 24, min-height 48) |
|
|
78
|
+
| `rel-menu` | Label ↔ trailing chevron gap; submenu chevron size | yes | gap 8 → 16; chevron 16 → 20px |
|
|
79
|
+
| `rel-menu` | Outer radius on menu, first/last item corners, submenu | no | 16 → 8px |
|
|
80
|
+
| `rel-menu` | Hover / pressed fills; pressed now distinct from hover | no | hover elevated-1 → `--rel-action-overlay-hover`; pressed → `--rel-action-overlay-pressed` |
|
|
81
|
+
| `rel-menu` | Selected rows | no | list row: overlay-hover tint + medium-weight label; checkbox / select-option rows: no fill |
|
|
82
|
+
| `rel-menu` | Disabled items | no | text-disabled colour → 40% opacity |
|
|
83
|
+
| `rel-menu` | Menu + submenu shadow (Figma shadow/md) | no | `--rel-shadows-shadow-300` → `--rel-shadows-md` |
|
|
84
|
+
| `rel-snackbar` | Shadow (Figma shadow/md) | no | `--rel-shadows-shadow-300` → `--rel-shadows-md` |
|
|
85
|
+
| `rel-modal` | Header padding (Figma Modal Sheet); content 24 and footer 16/20 unchanged | yes | 16 / 20 / 16 → 24 / 20 / 20 |
|
|
86
|
+
| `rel-drawer` | Header padding per side (Figma Drawer); footer unchanged | yes | left/right 16 / 20 / 16 → 24 / 20 / 20; bottom → 16 / 20 / 20 |
|
|
87
|
+
| `rel-tab` | Explicit tab-item heights, border-box, horizontal padding 16 | yes | S 44 → 32, M 46 → 40, L 48 → 48; padding 12/16 → 0/16 |
|
|
88
|
+
| `rel-kbd` | Border-box (heights include the 1px border); scale, padding, type, radius to Figma | yes | S 22 → 20 (pad 2/8, label-xs → label-sm); M 26 → 24 (pad 4/12 → 4/8, label-sm → label-md); L 32 → 28 (pad 8/16 → 4/12, label-lg); radius 8 → 4 |
|
|
89
|
+
| `rel-kbd` | Bespoke drop shadows removed (Figma Kbd has none) | no | hardcoded box-shadow → none |
|
|
90
|
+
| `rel-chip` | Remove ✕ has no own hover; chip hover + focus ring unchanged | no | ✕ opacity 1 on hover → stays 0.7 |
|
|
91
|
+
| `rel-snackbar` | Content padding, two-line spacing | yes | 12/16/12/8 → 12/8/12/16; two-line top pad 12 → 16; message → action gap 4 |
|
|
92
|
+
| `rel-snackbar` | Icon and message → action spacing | yes | icon 24 → 20 with 12px gap (was 10); message → action gap 12 → 32 |
|
|
93
|
+
| tokens | `--rel-spacing-2xl` / `--rel-spacing-3xl` values (Figma "Web" spacing collection) | yes — any consumer CSS using them, plus `rel-container` / `rel-snackbar` / `rel-upload` internals | 2xl 32 → 28px; 3xl 48 → 32px (new `4xl`–`10xl` cover 36–72px) |
|
|
94
|
+
| `rel-snackbar` | Action button | no | bare text with opacity hover → 32px static pill (4/12 pad, r1000, static-hover bg) |
|
|
95
|
+
| `rel-accordion` | Corner radius | no | shadow 8 → 4; plain 8 → 0 |
|
|
96
|
+
| `rel-accordion` | `appearance="shadow"` elevation (Figma shadow/sm) | no | `--rel-shadows-shadow-100` → `--rel-shadows-sm` |
|
|
97
|
+
| `rel-accordion` | Medium header left padding | yes | 12 → 16 |
|
|
98
|
+
| `rel-accordion` | Header icon size | yes | L 24 → 18; M 20 → 16 |
|
|
99
|
+
| `rel-accordion` | Action-type header left pad + leading-icon wrapper | yes | 16 → 8 (L/M); wrapper 40 (L) / 32 (M) |
|
|
100
|
+
| `rel-accordion` | Body padding, action-type body indent | yes | 4/16/20 → 0/16/16; indent 56 (L) / 48 (M, S) |
|
|
101
|
+
| `rel-accordion` | Medium body font | yes | body-sm → body-md |
|
|
102
|
+
| `rel-accordion` | Hover / pressed header background | no | surface-elevated → `--rel-action-overlay-hover` / `-pressed` |
|
|
103
|
+
| `rel-accordion` (action) | Leading fallback expand icon | no | chevron-right rotating 90° → chevron-down rotating 180° |
|
|
104
|
+
| `rel-stepper` | Indicator | yes | 22 → 24px; stroke 2 → 1px (border-strong); dot 12 → 8px |
|
|
105
|
+
| `rel-stepper` | Connectors | yes | 2 → 1px; done/in-progress colour text-label → border-strong |
|
|
106
|
+
| `rel-stepper` | Labels | no | text-label → text-default (body-md-medium) |
|
|
107
|
+
| `rel-stepper` | Disabled step | no | elevated bg / border-default / text-disabled → active at 40% opacity |
|
|
108
|
+
| `rel-slider` | Track | no | elevated-3 → elevated-2; radius 2 → pill |
|
|
109
|
+
| `rel-slider` | Thumb rest / hover / pressed | no | solid dark → neutral fill + 2px strong stroke; hover/pressed 6px overlay ring (was 7px + drop shadows) |
|
|
110
|
+
| `rel-slider` | Ticks | no | dark, white when active → all neutral/white |
|
|
111
|
+
| `rel-slider` | Value bubble (new `::part(tooltip)`) | no | dark SVG pin → light tooltip (bg-neutral, r8/10, `--rel-shadows-md`, chevron) 12px above thumb |
|
|
112
|
+
| `rel-slider` | Disabled | no | track elevated-3 @ 0.4 + thumb elevated-3; tooltip hidden |
|
|
113
|
+
| `rel-switch` | Control geometry (Figma Type=Line) | yes | 42×22 → 44×20; track 12 → 10 tall (40 wide); knob 18 → 20; travel 22 → 20 |
|
|
114
|
+
| `rel-switch` | Hover / pressed / focus / disabled | no | hover: track tint + stronger knob shadow (was white track + 6px halo); pressed: 28px overlay disc + knob squash 20×16 (was scale .9 + halo); focus: 1.5px focus stroke around control (was ring on knob); disabled track elevated-1 → elevated-2, knob shadow removed |
|
|
115
|
+
| `rel-switch` | Knob shadows from hardcoded values to tokens | no | rest → `--rel-shadows-sm`; hover / pressed → `--rel-shadows-md` |
|
|
116
|
+
| `rel-badge` | Medium side padding — two-digit counts no longer overflow the 24px circle into a 26px pill | no | 0 6px → 0 4px ("32" 26×24 → 24×24) |
|
|
117
|
+
| Navbar recipe | Nav-item gap (recipe CSS in docs + Storybook, not a component) | yes | 0 → 8px |
|
|
118
|
+
|
|
119
|
+
### Package hygiene
|
|
120
|
+
|
|
121
|
+
- `dist/` is bundle-only (see Removed). Verified: the packed tarball contains no raw `.ts` and no `dist/components` entries, and a strict TypeScript consumer project (`skipLibCheck` off) installing it type-checks with zero errors.
|
|
122
|
+
- Storybook component-status page, `custom-elements.d.ts`, and the one docs preview that still used an unregistered `<rel-table>` (now a plain `<table>`) cleaned up with the folder removals.
|
|
123
|
+
|
|
124
|
+
### Angular
|
|
125
|
+
|
|
126
|
+
- Typed inputs for every new prop, set through `Renderer2` so template type-checking sees them: `tone` (alert / toast / snackbar / button), `surface`, `fullWidth`, `inputMode` + `inputmode` + `size` (otp), `size` (checkbox, tab, kbd, accordion, menu), `arrow`, `variant` (modal). Deprecated inputs still work and are mapped by the web component; the new input wins when both are set.
|
|
127
|
+
- Exported unions: `RelAlertToneInput`, `RelToastToneInput`, `RelSnackbarToneInput`, `RelContainerSurface`, `RelOtpInputMode`, `RelOtpSize`, `RelCheckboxSize`, `RelButtonTone`, `RelTabSize`, `RelKbdSize`, `RelAccordionSize`, `RelMenuSize`, `RelModalVariant`.
|
|
128
|
+
- Removed: the 9 `RelTopbar*Component` directives (index + `ReliabilityDesignModule`).
|
|
129
|
+
- The wrapper's peer dependency on `@reliability-design/web` is now `^1.4.7`.
|
|
130
|
+
|
|
131
|
+
### Migrating to 1.4.7
|
|
132
|
+
|
|
133
|
+
Nothing here is required today — every old name keeps working until 3.0. Migrate at your own pace; the console notice tells you where.
|
|
134
|
+
|
|
135
|
+
| Old | New |
|
|
136
|
+
| --- | --- |
|
|
137
|
+
| `<rel-alert type="error">` | `<rel-alert tone="destructive">` |
|
|
138
|
+
| `<rel-alert type="info \| success \| warning">` | `<rel-alert tone="info \| success \| warning">` |
|
|
139
|
+
| `<rel-toast type="error">` | `<rel-toast tone="destructive">` |
|
|
140
|
+
| `<rel-snackbar type="default">` | `<rel-snackbar tone="neutral">` |
|
|
141
|
+
| `<rel-snackbar type="error">` | `<rel-snackbar tone="destructive">` |
|
|
142
|
+
| `tone="error" \| "danger" \| "critical"` (alert, toast, snackbar) | `tone="destructive"` |
|
|
143
|
+
| `<rel-button tone="critical">` / `tone="danger"` | `<rel-button tone="destructive">` |
|
|
144
|
+
| `<rel-button tone="default">` / `tone="primary"` | `tone="neutral"` / `tone="brand"` |
|
|
145
|
+
| `<rel-button variant="text">` | `<rel-button variant="ghost">` |
|
|
146
|
+
| `<rel-button variant="outline">` | `<rel-button variant="secondary">` |
|
|
147
|
+
| `<rel-button variant="icon">` | `<rel-button icon-only size="…">` |
|
|
148
|
+
| `<rel-container background="white">` | `<rel-container surface="default">` |
|
|
149
|
+
| `<rel-container background="light">` | `<rel-container surface="elevated">` |
|
|
150
|
+
| `<rel-container background="none">` | `<rel-container surface="transparent">` |
|
|
151
|
+
| CSS `rel-container[background="white"]` | `rel-container[surface="default"]` (unset `background` no longer reflects) |
|
|
152
|
+
| `<rel-otp type="alphanumeric">` | `<rel-otp input-mode="alphanumeric">` (`inputmode` = keyboard hint, unchanged) |
|
|
153
|
+
| `<rel-otp size="sm \| md \| lg">` | `<rel-otp size="small \| medium \| large">` |
|
|
154
|
+
| `<rel-kbd pill>` | `<rel-kbd>` (4px radius is the spec) |
|
|
155
|
+
| `<rel-kbd size="sm \| md \| lg">`, `<rel-tab size="sm \| md \| lg">` | `size="small \| medium \| large"` |
|
|
156
|
+
| `<rel-accordion size="md">` / `size="sm"` | `size="large"` / `size="medium"` |
|
|
157
|
+
| `<rel-topbar>` + `rel-topbar-*` | Navbar recipe — `/docs/recipes/navbar` |
|
|
158
|
+
| `<rel-navbar>` (deprecated earlier) | Navbar recipe — `/docs/recipes/navbar` |
|
|
159
|
+
| `ToastType`, `SnackbarType`, `ContainerBackground`, `OtpType` | `ToastToneInput`, `SnackbarToneInput`, `ContainerSurface`, `OtpInputMode` |
|
|
160
|
+
| `import … from "@reliability-design/web/dist/components/…"` | `import … from "@reliability-design/web"` |
|
|
161
|
+
| Angular `RelTopbar*Component` in `imports: [...]` | remove; use the Navbar recipe |
|
|
162
|
+
|
|
163
|
+
Consumer QA after upgrading: re-check forms with hand-tuned heights (the field scale is now 32 / 40 / 48), any CSS overriding `rel-switch`, `rel-kbd`, `rel-tab` or `rel-otp` dimensions, and carousels over dark imagery (ghost arrows). **Dropdown menus get taller by default** — `rel-menu` rows go from 36 to 48px; set `size="medium"` (40px) on menus that must stay close to their old height.
|
|
164
|
+
|
|
165
|
+
## 1.4.3 (2026-07-30)
|
|
166
|
+
|
|
167
|
+
### Added
|
|
168
|
+
|
|
169
|
+
- **New `rel-time-picker` component.** A form-field trigger button opening an Hour / Min / AM-PM column popup. Follows the range-picker draft model: column clicks stage a draft, **Apply** commits (emitting `rel-change`), Cancel/`Escape`/outside click discards, and a **Now** button snaps the draft to the current time. Supports `format` (`12h` | `24h` — the committed `value` is always 24-hour `"HH:mm"`), `minute-step` intervals, inclusive `min-time`/`max-time` bounds, the standard field API (`label`, `placeholder`, `helper-text`, `error`/`invalid` + `error-message`, `required`, `readonly`, `disabled`, `clearable`, `size`, `fullWidth`, hidden form input via `name`), `::part` hooks (base, label, trigger, value, icon, panel, option, footer, helper), and full keyboard/ARIA support. The Angular package ships a matching ControlValueAccessor wrapper for reactive and template-driven forms.
|
|
170
|
+
- **`label-style` prop (`default` | `floating` | `none`) on `rel-textfield`, `rel-select`, and `rel-autocomplete`.** `"none"` renders no visible label; supply `field-aria-label` or `field-aria-labelledby` to keep the control's accessible name. The old `floatingLabel` boolean remains as a deprecated alias for `label-style="floating"`.
|
|
171
|
+
- **`orientation` prop on `rel-radio` (`vertical` | `horizontal`).** Horizontal lays options out in a wrapping row; the group now renders `role="radiogroup"` with `aria-orientation`.
|
|
172
|
+
- **`size` prop on `rel-radio` (`small` | `medium`).** Small drops the circle from 20px to 16px and steps the label/supporting typography down a size for denser forms.
|
|
173
|
+
|
|
174
|
+
## 1.4.2 (2026-07-29)
|
|
175
|
+
|
|
176
|
+
### Added
|
|
177
|
+
|
|
178
|
+
- **New `rel-autocomplete` component.** A searchable single-select type-ahead built on `rel-textfield`, so every field feature (label, sizes, variants, floating label, icons, error display) carries over. Supports local items with `contains`/`starts-with`/`none` filtering or a remote `searchFn` (debounced, latest-query-wins with stale responses discarded, automatic loading row), per-item icons, bolded match highlighting, `clearable`, a configurable no-results row, full keyboard navigation, and combobox ARIA. Ships with an Angular ControlValueAccessor wrapper.
|
|
179
|
+
- Per-option leading icons in the `rel-select` menu — options accept an `icon` field (`rel-icon` name).
|
|
180
|
+
- `rel-select` multi-select chips no longer wrap to a second line — the visible chip count adapts to the field width, collapsing the rest into the "+N" chip; `max-visible-chips` is now an optional extra cap (default uncapped, was 3).
|
|
181
|
+
- `icon` prop on `rel-checkbox` — a leading `rel-icon` between the checkbox and label.
|
|
182
|
+
- `focus()` method on `rel-textfield` that forwards to the inner input (the host itself is not focusable).
|
|
183
|
+
|
|
184
|
+
### Fixed
|
|
185
|
+
|
|
186
|
+
- Disabled `rel-button` styling — disabled buttons dim to 0.5 opacity, and only fill styles (primary, default, icon) flatten to the disabled fill; outline, ghost, link, and static keep their own shape.
|
|
187
|
+
- `rel-popover` rendering misaligned when anchored inside a centered `rel-modal`.
|
|
188
|
+
- Removed the native title-attribute tooltip on hover over a `rel-modal` title.
|
|
189
|
+
- Tab-focusing a below-fold `rel-checkbox`/`rel-radio` no longer scrolls the wrong container (which shoved the page past fixed shells and broke the layout).
|
|
190
|
+
- Closed `rel-drawer`/`rel-modal` panels are removed from the Tab order — keyboard focus no longer disappears into invisible close buttons or slotted content.
|
|
191
|
+
|
|
192
|
+
## 1.4.1 (2026-07-27)
|
|
193
|
+
|
|
194
|
+
### Fixed
|
|
195
|
+
|
|
196
|
+
- **Restored all 1.3.x design-token names removed by 1.4.0.** The RelDS 2.0 token rework in 1.4.0 renamed the token taxonomy in `vars.css` and dropped 154 of the 169 custom properties that 1.3.x shipped (`--rel-color-*`, `--rel-colors-*`, `--rel-text-*`, `--rel-background-*`, `--rel-surface-*`, `--rel-spacing-space-*`, `--rel-fontSizes-*`, `--rel-borders-*`, …). Apps referencing those tokens in their own CSS got unresolved `var()`s and lost colors/spacing/type across the board. 1.4.1 appends a **V1 compat alias block** to `vars.css`: every 1.3.x token name resolves again, pointing at its RelDS 2.0 equivalent (or its literal 1.3.x value where 2.0 has no counterpart). No import changes needed — `vars.css` remains the only stylesheet.
|
|
197
|
+
|
|
198
|
+
### Upgrading
|
|
199
|
+
|
|
200
|
+
- Your lockfile pins the currently resolved version, so a plain `npm i` will **not** pick this up. Run `npm update @reliability-design/web` or `npm i @reliability-design/web@latest`.
|
|
201
|
+
- Works from any 1.x range: `^1.3.0` and `^1.4.0` both admit 1.4.1.
|
|
202
|
+
|
|
203
|
+
### Notes
|
|
204
|
+
|
|
205
|
+
- The restored V1 names are **deprecated aliases** — removal is targeted for 3.0. Migrate consumer CSS to the RelDS 2.0 semantic tokens (`--rel-text-*`, `--rel-bg-*`, `--rel-border-*`, `--rel-action-*`, `--rel-spacing-*`, …).
|
|
206
|
+
- Aliased tokens follow the RelDS 2.0 **dark palette** (neutral grays). Dark-mode shades therefore differ slightly from 1.3.x's blue-tinted darks; light mode matches 1.3.x closely. Typography scale, spacing, radii, and stroke widths are value-identical to 1.3.x.
|
|
207
|
+
|
|
208
|
+
## 1.4.0 (2026-07-24)
|
|
209
|
+
|
|
210
|
+
- RelDS 2.0 token rework: `vars.css` regenerated from Figma (`RelDS_A1`) with a new semantic token taxonomy; all components repointed to semantic tokens; structural parity with the 2.0 Figma spec.
|
|
211
|
+
- **Known issue (fixed in 1.4.1):** removed the 1.3.x token names without aliases, breaking consumer apps that referenced them.
|
|
@@ -1,132 +1,132 @@
|
|
|
1
|
-
# rel-accordion
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
```html
|
|
8
|
-
<!-- Basic
|
|
9
|
-
<rel-accordion title="
|
|
10
|
-
<p>
|
|
11
|
-
</rel-accordion>
|
|
12
|
-
|
|
13
|
-
<!-- Initially open -->
|
|
14
|
-
<rel-accordion title="
|
|
15
|
-
<p>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
|
100
|
-
|
|
101
|
-
| `
|
|
102
|
-
| `
|
|
103
|
-
| `
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
-
|
|
125
|
-
|
|
126
|
-
-
|
|
127
|
-
|
|
128
|
-
-
|
|
129
|
-
|
|
130
|
-
-
|
|
131
|
-
|
|
132
|
-
-
|
|
1
|
+
# rel-accordion
|
|
2
|
+
|
|
3
|
+
`<rel-accordion>` is a single collapsible section of the Reliability Design System (Figma "Accordion", 6021:1085): a clickable header with a title and a chevron that expands or collapses the slotted body. Each element is independent — stack several to build an FAQ or a settings list, and nothing closes automatically when another opens. Use it for progressive disclosure of secondary content; do not use it to switch between peer views (use tabs) or to hide primary actions.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<!-- Basic: closed by default, opens on click / Enter / Space -->
|
|
9
|
+
<rel-accordion title="Shipping">
|
|
10
|
+
<p>Orders ship within two business days.</p>
|
|
11
|
+
</rel-accordion>
|
|
12
|
+
|
|
13
|
+
<!-- Initially open -->
|
|
14
|
+
<rel-accordion title="Returns" open>
|
|
15
|
+
<p>Free returns within 30 days.</p>
|
|
16
|
+
</rel-accordion>
|
|
17
|
+
|
|
18
|
+
<!-- Header scale: 56 / 48 / 44 px -->
|
|
19
|
+
<rel-accordion size="large" title="Large"></rel-accordion>
|
|
20
|
+
<rel-accordion size="medium" title="Medium"></rel-accordion>
|
|
21
|
+
<rel-accordion size="small" title="Small"></rel-accordion>
|
|
22
|
+
|
|
23
|
+
<!-- Plain style: square corners and a 1px border instead of the shadow card -->
|
|
24
|
+
<rel-accordion appearance="plain" title="Plain"></rel-accordion>
|
|
25
|
+
|
|
26
|
+
<!-- Action type: leading rotating chevron + static trailing arrow-expansion, body indented -->
|
|
27
|
+
<rel-accordion type="action" title="Filters">
|
|
28
|
+
<p>Filter options…</p>
|
|
29
|
+
</rel-accordion>
|
|
30
|
+
|
|
31
|
+
<!-- Action type with a custom leading icon (slotted icons never rotate) -->
|
|
32
|
+
<rel-accordion type="action" title="Preferences">
|
|
33
|
+
<rel-icon slot="icon" name="settings"></rel-icon>
|
|
34
|
+
<p>Preference options…</p>
|
|
35
|
+
</rel-accordion>
|
|
36
|
+
|
|
37
|
+
<!-- Custom trailing icon on the default type -->
|
|
38
|
+
<rel-accordion title="More">
|
|
39
|
+
<rel-icon slot="trailing-icon" name="plus"></rel-icon>
|
|
40
|
+
<p>Extra content…</p>
|
|
41
|
+
</rel-accordion>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
```js
|
|
45
|
+
const accordion = document.querySelector("rel-accordion");
|
|
46
|
+
|
|
47
|
+
accordion.addEventListener("open-change", (e) => {
|
|
48
|
+
e.detail; // true when the body was just expanded, false when collapsed
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// Programmatic toggle (does not fire open-change)
|
|
52
|
+
accordion.open = true;
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Deprecated aliases
|
|
56
|
+
|
|
57
|
+
```html
|
|
58
|
+
<!-- size="md" → size="large", size="sm" → size="medium". Both still work; no console notice is logged. -->
|
|
59
|
+
<rel-accordion size="md" title="Legacy large"></rel-accordion>
|
|
60
|
+
<rel-accordion size="sm" title="Legacy medium"></rel-accordion>
|
|
61
|
+
<!-- canonical -->
|
|
62
|
+
<rel-accordion size="large" title="Large"></rel-accordion>
|
|
63
|
+
<rel-accordion size="medium" title="Medium"></rel-accordion>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
<!-- readme-gen:start -->
|
|
67
|
+
|
|
68
|
+
<!-- Generated from rel-accordion.ts — do not edit; run readme-generate.mjs -->
|
|
69
|
+
|
|
70
|
+
## API
|
|
71
|
+
|
|
72
|
+
### Attributes / Properties
|
|
73
|
+
|
|
74
|
+
| Property | Attribute | Type | Default | Description |
|
|
75
|
+
| --- | --- | --- | --- | --- |
|
|
76
|
+
| `title` | `title` | `string` | `"Accordion"` | Header text. Note it is also the native HTML `title` attribute, so browsers show it as a tooltip on hover. |
|
|
77
|
+
| `open` | `open` | `boolean` | `false` | Whether the body is expanded; toggled by the header and reported via `open-change`. Setting it from code does not fire the event. Reflected. |
|
|
78
|
+
| `size` | `size` | `"md" \| "sm" \| "large" \| "medium" \| "small"` | `"md"` | Header scale (Figma "Size"): `large` = 56px header / heading-md title, `medium` = 48px / heading-sm, `small` = 44px / heading-xs (new in 1.4.7). The historical spellings stay supported as aliases: `md` = large (the default), `sm` = medium. Reflected. |
|
|
79
|
+
| `type` | `type` | `"default" \| "action"` | `"default"` | Header layout (Figma "Type"): `default` = title + trailing rotating chevron; `action` = leading icon slot (rotating chevron by default) + static trailing arrow-expansion icon, with the body indented under the title. Reflected. |
|
|
80
|
+
| `appearance` | `appearance` | `"shadow" \| "plain"` | `"shadow"` | Figma "Style" axis — named appearance because `style` collides with the HTML style attribute. `shadow` = 4px-radius card with the shadow-sm effect and no border; `plain` = square corners with a 1px border-subtle stroke and no elevation. Reflected. |
|
|
81
|
+
|
|
82
|
+
## Events
|
|
83
|
+
|
|
84
|
+
| Event | Detail | Bubbles / composed | Description |
|
|
85
|
+
| --- | --- | --- | --- |
|
|
86
|
+
| `open-change` | `open` | bubbles / composed | Fired when the header toggles the accordion (click, Enter or Space). Detail: the new `open` state (boolean). Not fired when `open` is set programmatically. |
|
|
87
|
+
|
|
88
|
+
## Slots
|
|
89
|
+
|
|
90
|
+
| Slot | Description |
|
|
91
|
+
| --- | --- |
|
|
92
|
+
| (default) | Body content, revealed when `open` |
|
|
93
|
+
| `icon` | Leading icon in the header (`type="action"` only); replaces the default rotating chevron-down |
|
|
94
|
+
| `trailing-icon` | Trailing icon in the header; replaces the default chevron-down (default type) or arrow-expansion (action type) |
|
|
95
|
+
|
|
96
|
+
## CSS Parts
|
|
97
|
+
|
|
98
|
+
| Part | Description |
|
|
99
|
+
| --- | --- |
|
|
100
|
+
| `base` | The outer card (`.accordion`) carrying the appearance border / shadow |
|
|
101
|
+
| `trigger` | The `role="button"` header row |
|
|
102
|
+
| `label` | The title row (leading icon + title text) |
|
|
103
|
+
| `icon` | The trailing icon wrapper |
|
|
104
|
+
| `content` | The `role="region"` body that holds the default slot |
|
|
105
|
+
|
|
106
|
+
<!-- readme-gen:end -->
|
|
107
|
+
|
|
108
|
+
## Accessibility
|
|
109
|
+
|
|
110
|
+
- The header (part `trigger`) is a `role="button"` with `tabindex="0"`, `aria-expanded` mirroring `open`, and `aria-controls` pointing at the body.
|
|
111
|
+
- The body (part `content`) is a `role="region"` labelled by the header (`aria-labelledby`). While closed it carries the `inert` attribute, so collapsed content is removed from the Tab order and from the accessibility tree — not merely hidden visually.
|
|
112
|
+
- The slotted `icon` / `trailing-icon` content and the built-in `rel-icon` chevrons are decorative; the accessible name of the header is the `title` text.
|
|
113
|
+
- Keyboard focus is shown as a 2px `--rel-border-focus` outline inset 2px inside the header (it follows the card radius so it is not clipped).
|
|
114
|
+
- No live-region announcements are made; the `aria-expanded` change is what screen readers report.
|
|
115
|
+
|
|
116
|
+
| Key (header focused) | Action |
|
|
117
|
+
| --- | --- |
|
|
118
|
+
| Enter | Toggle open / closed (fires `open-change`) |
|
|
119
|
+
| Space | Toggle open / closed (fires `open-change`) |
|
|
120
|
+
| Tab / Shift + Tab | Move to the next / previous focusable element; the body's content is only reachable while open |
|
|
121
|
+
|
|
122
|
+
## Notes / Edge Cases
|
|
123
|
+
|
|
124
|
+
- `size` defaults to the legacy spelling `"md"`, which renders the Figma Large (56px) header; `"sm"` renders Medium (48px). The full-word values are the canonical ones — see Deprecated aliases.
|
|
125
|
+
- `title` is also the element's native `title` attribute, so browsers show it as a hover tooltip on the whole component.
|
|
126
|
+
- `open-change` fires only from user toggles (click, Enter, Space). Setting `open` from code updates the UI silently.
|
|
127
|
+
- The body stays in the DOM when closed; it is collapsed with `max-height: 0` / `overflow: hidden` and `inert`. When open the cap is `max-height: 1000px`, so content taller than 1000px is clipped.
|
|
128
|
+
- Rotation on open applies only to the built-in fallback icons (`chevron-down` in the trailing slot for `type="default"`, in the leading slot for `type="action"`). Anything you slot into `icon` or `trailing-icon` stays static, and the Action type's trailing `arrow-expansion` never rotates (Figma audit 1b).
|
|
129
|
+
- `type="action"` indents the open body under the title: 56px at `large`, 48px at `medium` / `small`. The leading icon wrapper is 40px / 18px icon at `large` and 32px / 16px at the other sizes; the trailing icon wrapper follows the same tiers.
|
|
130
|
+
- Header hover / pressed use the `--rel-action-overlay-hover` / `--rel-action-overlay-pressed` tokens. `appearance="shadow"` uses `--rel-shadows-sm` with a transparent border; `appearance="plain"` uses `--rel-border-subtle` with no shadow and zero radius.
|
|
131
|
+
- Transitions (chevron rotation, body max-height and padding) are disabled under `prefers-reduced-motion: reduce`.
|
|
132
|
+
- The host is `display: block; width: 100%`; wrap it to constrain the width.
|