@reliability-design/web 1.4.9 → 1.4.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/CHANGELOG.md +161 -2
  2. package/custom-elements.json +18604 -0
  3. package/dist/components/rel-accordion/README.md +9 -2
  4. package/dist/components/rel-alert/README.md +4 -7
  5. package/dist/components/rel-autocomplete/README.md +209 -209
  6. package/dist/components/rel-avatar/README.md +228 -118
  7. package/dist/components/rel-breadcrumb/README.md +1 -0
  8. package/dist/components/rel-button/README.md +9 -9
  9. package/dist/components/rel-calendar/README.md +111 -109
  10. package/dist/components/rel-cardmedia/README.md +1 -1
  11. package/dist/components/rel-carousel/README.md +187 -187
  12. package/dist/components/rel-checkbox/README.md +159 -147
  13. package/dist/components/rel-chip/README.md +141 -138
  14. package/dist/components/rel-container/README.md +1 -1
  15. package/dist/components/rel-date-picker/README.md +221 -206
  16. package/dist/components/rel-drawer/README.md +4 -4
  17. package/dist/components/rel-kbd/README.md +188 -141
  18. package/dist/components/rel-layout/README.md +34 -34
  19. package/dist/components/rel-menu/README.md +17 -10
  20. package/dist/components/rel-menubar/README.md +218 -218
  21. package/dist/components/rel-otp/README.md +4 -8
  22. package/dist/components/rel-pagination/README.md +141 -100
  23. package/dist/components/rel-popover/README.md +220 -203
  24. package/dist/components/rel-radio/README.md +142 -131
  25. package/dist/components/rel-range-picker/README.md +194 -171
  26. package/dist/components/rel-resizable/README.md +220 -199
  27. package/dist/components/rel-segmented-button/README.md +158 -157
  28. package/dist/components/rel-select/README.md +21 -17
  29. package/dist/components/rel-sheet/README.md +3 -2
  30. package/dist/components/rel-signature-pad/README.md +161 -0
  31. package/dist/components/rel-slider/README.md +140 -131
  32. package/dist/components/rel-snackbar/README.md +170 -168
  33. package/dist/components/rel-split-button/README.md +129 -0
  34. package/dist/components/rel-stepper/README.md +171 -171
  35. package/dist/components/rel-switch/README.md +122 -117
  36. package/dist/components/rel-tab/README.md +184 -174
  37. package/dist/components/rel-textfield/README.md +21 -28
  38. package/dist/components/rel-time-picker/README.md +188 -170
  39. package/dist/components/rel-toast/README.md +20 -11
  40. package/dist/components/rel-tooltip/README.md +5 -4
  41. package/dist/components/rel-tree/README.md +157 -0
  42. package/dist/components/rel-upload/README.md +8 -5
  43. package/dist/index.d.mts +1608 -624
  44. package/dist/index.d.ts +1608 -624
  45. package/dist/index.js +11933 -6802
  46. package/dist/index.js.map +1 -1
  47. package/dist/index.mjs +11009 -5885
  48. package/dist/index.mjs.map +1 -1
  49. package/dist/styles/ag-grid.css +274 -0
  50. package/dist/styles/motion.css +31 -0
  51. package/dist/styles/motion.tokens.json +38 -0
  52. package/dist/styles/vars.css +88 -64
  53. package/dist/{vars-DXX6QOAG.css → vars-E22LYFMV.css} +88 -64
  54. package/package.json +61 -37
  55. package/dist/styles/focus-ring.ts +0 -84
@@ -1,109 +1,111 @@
1
- # rel-calendar
2
-
3
- `<rel-calendar>` is the inline, always-visible month calendar of the Reliability Design System (Figma "Calendar"). It renders one month as a 7-column grid with previous/next navigation, a today ring, dimmed weekends and adjacent-month days, `min`/`max` bounds and a custom disabled-day predicate, and lets the user select a single date. Use it when the calendar itself is the interface — a scheduling sidebar, an inline availability view. For a form field that opens a calendar in a popover use `<rel-date-picker>`; for a from/to range use `<rel-range-picker>`.
4
-
5
- ## Usage
6
-
7
- ```html
8
- <!-- Default: today's month, nothing selected -->
9
- <rel-calendar></rel-calendar>
10
-
11
- <!-- Preselected date (ISO YYYY-MM-DD); the grid opens on that month -->
12
- <rel-calendar value="2026-01-16"></rel-calendar>
13
-
14
- <!-- Bounded: days outside min/max render disabled -->
15
- <rel-calendar min="2026-01-01" max="2026-12-31"></rel-calendar>
16
-
17
- <!-- Monday-first week with German month and weekday names -->
18
- <rel-calendar week-start="mon" locale="de-DE"></rel-calendar>
19
-
20
- <!-- Disabled: every cell and both navigation buttons are inert -->
21
- <rel-calendar value="2026-01-16" disabled></rel-calendar>
22
- ```
23
-
24
- ```js
25
- const calendar = document.querySelector("rel-calendar");
26
-
27
- // Disable individual days on top of min/max (property only — there is no attribute)
28
- calendar.isDateDisabled = (date) => date.getDay() === 0 || date.getDay() === 6;
29
-
30
- calendar.addEventListener("rel-change", (e) => {
31
- e.detail.value; // "2026-01-16"
32
- e.detail.date; // Date at local midnight
33
- });
34
- ```
35
-
36
- <!-- readme-gen:start -->
37
-
38
- <!-- Generated from rel-calendar.ts — do not edit; run readme-generate.mjs -->
39
-
40
- ## API
41
-
42
- ### Attributes / Properties
43
-
44
- | Property | Attribute | Type | Default | Description |
45
- | --- | --- | --- | --- | --- |
46
- | `value` | `value` | `string \| null` | `null` | Selected date as an ISO `YYYY-MM-DD` string, or `null` for no selection; setting it also moves the visible month. Reflected. |
47
- | `min` | `min` | `string \| null` | `null` | Earliest selectable date (ISO `YYYY-MM-DD`); earlier days render disabled. |
48
- | `max` | `max` | `string \| null` | `null` | Latest selectable date (ISO `YYYY-MM-DD`); later days render disabled. |
49
- | `disabled` | `disabled` | `boolean` | `false` | Disables every day cell and the month navigation; the host dims to 40% opacity (Figma State=Disabled). Reflected. |
50
- | `weekStart` | `week-start` | `"sun" \| "mon"` | `"sun"` | First column of the week grid: `"sun"` (default) or `"mon"`. |
51
- | `locale` | `locale` | `string` | `"en-US"` | BCP 47 locale for the month name, weekday headers and day cell labels (via `Intl.DateTimeFormat`). |
52
-
53
- ### Public fields / accessors
54
-
55
- | Name | Type | Description |
56
- | --- | --- | --- |
57
- | `isDateDisabled` | `(date: Date) => boolean` | Custom predicate that disables individual days (return `true` to disable); applied on top of `min`/`max`. Property only — assign it from JavaScript. |
58
-
59
- ## Events
60
-
61
- | Event | Detail | Bubbles / composed | Description |
62
- | --- | --- | --- | --- |
63
- | `rel-change` | `{ value: newValue, date: new Date(day.date), }` | bubbles / composed | Fired when the user selects a day. Detail: `{ value: string, date: Date }` — the ISO `YYYY-MM-DD` string and a local-midnight Date. |
64
-
65
- ## Slots
66
-
67
- | Slot | Description |
68
- | --- | --- |
69
- | — | This element has no slots. |
70
-
71
- ## CSS Parts
72
-
73
- | Part | Description |
74
- | --- | --- |
75
- | `header` | Month navigation row (previous button, month/year label, next button) |
76
- | `action` | The previous-month and next-month buttons |
77
- | `label` | The month/year heading and each weekday column header |
78
- | `list` | The weekday-header row and the day grid |
79
- | `item` | Each day cell button |
80
-
81
- <!-- readme-gen:end -->
82
-
83
- ## Accessibility
84
-
85
- - The day area is a `role="grid"` named "<Month> <Year>" (e.g. "January 2026"); the weekday header row and each week are `role="row"`, weekday names are `role="columnheader"`.
86
- - Every day is a native `<button role="gridcell">` whose `aria-label` is the full long date in `locale` ("Friday, January 16, 2026"), with `aria-selected` for the selected day, `aria-current="date"` on today, and the native `disabled` attribute for days outside `min`/`max`, rejected by `isDateDisabled`, or when the host is `disabled`.
87
- - The navigation buttons are labelled "Previous month" / "Next month".
88
- - Roving tabindex: exactly one cell is a Tab stop — the last cell the user arrowed to, else the selected day, else today, else the first enabled day of the month — so Tab can always re-enter the grid.
89
- - After every month or year change (buttons, PageUp/PageDown, or arrowing past the edge of the month) the new "<Month> <Year>" is read to screen readers through the shared `announce()` live region (`utils/announce.ts`).
90
-
91
- | Key | Action |
92
- | --- | --- |
93
- | ArrowLeft / ArrowRight | Focus the previous / next day (crossing into the adjacent month switches the view) |
94
- | ArrowUp / ArrowDown | Focus the same weekday one week earlier / later |
95
- | Home / End | Focus the first / last cell of the current row |
96
- | PageUp / PageDown | Show the previous / next month |
97
- | Shift + PageUp / Shift + PageDown | Show the previous / next year |
98
- | Enter / Space | Select the focused day (fires `rel-change`) |
99
-
100
- ## Notes / Edge Cases
101
-
102
- - `value`, `min` and `max` must be `YYYY-MM-DD`; any other string is ignored (no selection, view unchanged). Setting `value` moves the visible month; clearing it to `null` leaves the view where it is.
103
- - The grid always renders six weeks (42 cells). The leading/trailing cells belong to the adjacent months and, unlike in `rel-date-picker`, they are selectable (subject to `min`/`max`/`isDateDisabled`); picking one fires `rel-change` and the view jumps to that month.
104
- - Comparisons happen at local midnight: the `Date` passed to `isDateDisabled` and returned in `rel-change` is `new Date(y, m, d)`, so read it with local getters, not `toISOString()`.
105
- - `disabled` makes every day fail the disabled check and disables both navigation buttons; pointer events stay on the host so the `not-allowed` cursor shows.
106
- - 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.
107
- - Figma treats the cell tone as one axis, so exactly one applies per day: today beats weekend beats adjacent-month. Adjacent-month labels render at 40% and weekend labels at 70% — 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, and a disabled today swaps its brand ring for a neutral one.
108
- - The month-navigation buttons are hand-rolled ghost buttons that bind the same action tokens as `<rel-button variant="ghost">` (audit 8b) — they are intentionally not `<rel-button>` instances.
109
- - 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 `--rel-shadows-shadow-400`, the nearest shipped step); wrap it or override on the host if you need a different footprint.
1
+ # rel-calendar
2
+
3
+ `<rel-calendar>` is the inline, always-visible month calendar of the Reliability Design System (Figma "Calendar"). It renders one month as a 7-column grid with previous/next navigation, a today ring, dimmed weekends and adjacent-month days, `min`/`max` bounds and a custom disabled-day predicate, and lets the user select a single date. Use it when the calendar itself is the interface — a scheduling sidebar, an inline availability view. For a form field that opens a calendar in a popover use `<rel-date-picker>`; for a from/to range use `<rel-range-picker>`.
4
+
5
+ ## Usage
6
+
7
+ ```html
8
+ <!-- Default: today's month, nothing selected -->
9
+ <rel-calendar></rel-calendar>
10
+
11
+ <!-- Preselected date (ISO YYYY-MM-DD); the grid opens on that month -->
12
+ <rel-calendar value="2026-01-16"></rel-calendar>
13
+
14
+ <!-- Bounded: days outside min/max render disabled -->
15
+ <rel-calendar min="2026-01-01" max="2026-12-31"></rel-calendar>
16
+
17
+ <!-- Monday-first week with German month and weekday names -->
18
+ <rel-calendar week-start="mon" locale="de-DE"></rel-calendar>
19
+
20
+ <!-- Disabled: every cell and both navigation buttons are inert -->
21
+ <rel-calendar value="2026-01-16" disabled></rel-calendar>
22
+ ```
23
+
24
+ ```js
25
+ const calendar = document.querySelector("rel-calendar");
26
+
27
+ // Disable individual days on top of min/max (property only — there is no attribute)
28
+ calendar.isDateDisabled = (date) => date.getDay() === 0 || date.getDay() === 6;
29
+
30
+ calendar.addEventListener("rel-change", (e) => {
31
+ e.detail.value; // "2026-01-16"
32
+ e.detail.date; // Date at local midnight
33
+ });
34
+ ```
35
+
36
+ <!-- readme-gen:start -->
37
+
38
+ <!-- Generated from rel-calendar.ts — do not edit; run readme-generate.mjs -->
39
+
40
+ ## API
41
+
42
+ ### Attributes / Properties
43
+
44
+ | Property | Attribute | Type | Default | Description |
45
+ | --- | --- | --- | --- | --- |
46
+ | `value` | `value` | `string \| null` | `null` | Selected date as an ISO `YYYY-MM-DD` string, or `null` for no selection; setting it also moves the visible month. Reflected. |
47
+ | `min` | `min` | `string \| null` | `null` | Earliest selectable date (ISO `YYYY-MM-DD`); earlier days render disabled. |
48
+ | `max` | `max` | `string \| null` | `null` | Latest selectable date (ISO `YYYY-MM-DD`); later days render disabled. |
49
+ | `disabled` | `disabled` | `boolean` | `false` | Disables every day cell and the month navigation; the host dims to 40% opacity (Figma State=Disabled). Reflected. |
50
+ | `weekStart` | `week-start` | `"sun" \| "mon"` | `"sun"` | First column of the week grid: `"sun"` (default) or `"mon"`. |
51
+ | `locale` | `locale` | `string` | `"en-US"` | BCP 47 locale for the month name, weekday headers and day cell labels (via `Intl.DateTimeFormat`). |
52
+
53
+ ### Public fields / accessors
54
+
55
+ | Name | Type | Description |
56
+ | --- | --- | --- |
57
+ | `isDateDisabled` | `(date: Date) => boolean` | Custom predicate that disables individual days (return `true` to disable); applied on top of `min`/`max`. Property only — assign it from JavaScript. |
58
+
59
+ ## Events
60
+
61
+ | Event | Detail | Bubbles / composed | Description |
62
+ | --- | --- | --- | --- |
63
+ | `rel-change` | `{ value: newValue, date: new Date(day.date), }` | bubbles / composed | Fired when the user selects a day. Detail: `{ value: string, date: Date }` — the ISO `YYYY-MM-DD` string and a local-midnight Date. |
64
+
65
+ ## Slots
66
+
67
+ | Slot | Description |
68
+ | --- | --- |
69
+ | — | This element has no slots. |
70
+
71
+ ## CSS Parts
72
+
73
+ | Part | Description |
74
+ | --- | --- |
75
+ | `header` | Month navigation row (previous button, month/year label, next button) |
76
+ | `action` | The previous-month and next-month buttons |
77
+ | `label` | The month/year heading and each weekday column header |
78
+ | `list` | The weekday-header row and the day grid |
79
+ | `item` | Each day cell button (unavailable days also carry `unavailable`) |
80
+ | `unavailable` | Day cells that cannot be picked (outside `min` / `max`, or blocked by `isDateDisabled`), alongside `item`. They are `aria-disabled` and stay focusable, so `::part(item):disabled` does not match them; style them with `::part(unavailable)` |
81
+
82
+ <!-- readme-gen:end -->
83
+
84
+ ## Accessibility
85
+
86
+ - The day area is a `role="grid"` named "<Month> <Year>" (e.g. "January 2026"); the weekday header row and each week are `role="row"`, weekday names are `role="columnheader"`.
87
+ - Every day is a native `<button role="gridcell">` whose `aria-label` is the full long date in `locale` ("Friday, January 16, 2026"), with `aria-selected` for the selected day and `aria-current="date"` on today. Days outside `min`/`max` or rejected by `isDateDisabled` are `aria-disabled="true"`, not natively disabled: they stay focusable so the arrow keys can land on them (rather than getting stuck in front of one), and Enter, Space and click do nothing there. When the host is `disabled`, every day button is also natively disabled, so the grid leaves the tab order.
88
+ - The navigation buttons are labelled "Previous month" / "Next month".
89
+ - Roving tabindex: exactly one cell is a Tab stop — the day last interacted with (arrowed to, clicked, or tabbed onto), else the selected day, else today, else the first enabled day of the month — so Tab can always re-enter the grid, and Shift+Tab then Tab returns to the day you left. The day last interacted with keeps the Tab stop after a chevron click as long as it is still on screen as a leading/trailing cell.
90
+ - The key map is shared with `<rel-date-picker>` and `<rel-range-picker>` (`dayGridTarget` in `rel-date-picker/period-page.ts`). Keys move by date, so crossing a month edge lands on the right day (Sun 27 Sep + ArrowDown → Sun 4 Oct) and the view follows.
91
+ - After every month or year change (buttons, PageUp/PageDown, or arrowing past the edge of the month) the new "<Month> <Year>" is read to screen readers through the shared `announce()` live region (`utils/announce.ts`).
92
+
93
+ | Key | Action |
94
+ | --- | --- |
95
+ | ArrowLeft / ArrowRight | Focus the previous / next day (crossing into the adjacent month switches the view) |
96
+ | ArrowUp / ArrowDown | Focus the same weekday one week earlier / later |
97
+ | Home / End | Focus the first / last day of the week (honours `week-start`; may cross into the adjacent month) |
98
+ | PageUp / PageDown | Focus the same day in the previous / next month, clamped to that month's last day (31 Jan → 28 Feb) |
99
+ | Shift + PageUp / Shift + PageDown | Focus the same day in the previous / next year (29 Feb → 28 Feb) |
100
+ | Enter / Space | Select the focused day (fires `rel-change`); does nothing on an unavailable day |
101
+
102
+ ## Notes / Edge Cases
103
+
104
+ - `value`, `min` and `max` must be `YYYY-MM-DD`; any other string is ignored (no selection, view unchanged). Setting `value` moves the visible month; clearing it to `null` leaves the view where it is.
105
+ - The grid always renders six weeks (42 cells). The leading/trailing cells belong to the adjacent months and, unlike in `rel-date-picker`, they are selectable (subject to `min`/`max`/`isDateDisabled`); picking one fires `rel-change`, the view jumps to that month and focus moves with the picked day.
106
+ - Comparisons happen at local midnight: the `Date` passed to `isDateDisabled` and returned in `rel-change` is `new Date(y, m, d)`, so read it with local getters, not `toISOString()`.
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
+ - 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 (`--rel-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).
110
+ - The month-navigation buttons are hand-rolled ghost buttons that bind the same action tokens as `<rel-button variant="ghost">` (audit 8b) — they are intentionally not `<rel-button>` instances.
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 `--rel-shadows-shadow-400`, the nearest shipped step); wrap it or override on the host if you need a different footprint.
@@ -21,7 +21,7 @@ Media card (element `<rel-card-media>`, folder `rel-cardmedia`): a bordered surf
21
21
  subtitle="$99.99"
22
22
  >
23
23
  <p>Closed-back, 40 mm drivers, detachable cable.</p>
24
- <rel-button variant="primary" size="small">Add to cart</rel-button>
24
+ <rel-button variant="primary" tone="brand" size="small">Add to cart</rel-button>
25
25
  </rel-card-media>
26
26
 
27
27
  <!-- No image: just the content area -->