@ethlete/components 1.0.0-next.88 → 1.0.0-next.90

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 (92) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/design/sdk/components/accent-on-light/accent-on-light.ts +5 -0
  3. package/design/sdk/components/accordion/accordion.ts +11 -0
  4. package/design/sdk/components/action-sheet/action-sheet.ts +37 -1
  5. package/design/sdk/components/anchored-dialog/anchored-dialog.css +2 -5
  6. package/design/sdk/components/anchored-dialog/anchored-dialog.ts +22 -8
  7. package/design/sdk/components/avatar/avatar.ts +16 -0
  8. package/design/sdk/components/badge/badge.css +18 -0
  9. package/design/sdk/components/badge/badge.ts +39 -3
  10. package/design/sdk/components/banner/banner.ts +48 -1
  11. package/design/sdk/components/bracket/bracket.ts +17 -0
  12. package/design/sdk/components/breadcrumb/breadcrumb.ts +15 -1
  13. package/design/sdk/components/button/button.ts +106 -3
  14. package/design/sdk/components/calendar/calendar.ts +56 -4
  15. package/design/sdk/components/card/card.ts +50 -1
  16. package/design/sdk/components/carousel/carousel.ts +60 -5
  17. package/design/sdk/components/chart/chart.ts +31 -2
  18. package/design/sdk/components/checkbox/checkbox.ts +53 -3
  19. package/design/sdk/components/chip/chip.ts +39 -8
  20. package/design/sdk/components/copy-button/copy-button.ts +18 -1
  21. package/design/sdk/components/description-list/description-list.ts +10 -0
  22. package/design/sdk/components/dialog/dialog.ts +71 -1
  23. package/design/sdk/components/divider/divider.ts +5 -0
  24. package/design/sdk/components/empty-state/empty-state.ts +10 -0
  25. package/design/sdk/components/floating-action/floating-action.ts +15 -0
  26. package/design/sdk/components/form-field/form-field.ts +102 -16
  27. package/design/sdk/components/grid/grid.ts +16 -1
  28. package/design/sdk/components/input/input.ts +50 -0
  29. package/design/sdk/components/kbd/kbd.ts +12 -0
  30. package/design/sdk/components/loader/loader.ts +11 -0
  31. package/design/sdk/components/masonry/masonry.ts +7 -0
  32. package/design/sdk/components/match/match.ts +17 -0
  33. package/design/sdk/components/menu/menu.ts +17 -0
  34. package/design/sdk/components/notification/notification.ts +19 -0
  35. package/design/sdk/components/otp-input/otp-input.ts +21 -0
  36. package/design/sdk/components/pagination/pagination.ts +22 -1
  37. package/design/sdk/components/picture/picture.ts +15 -0
  38. package/design/sdk/components/progress-steps/progress-steps.ts +17 -0
  39. package/design/sdk/components/query-error/query-error.ts +26 -1
  40. package/design/sdk/components/radio-group/radio-group.ts +43 -1
  41. package/design/sdk/components/scheduler/scheduler.ts +34 -1
  42. package/design/sdk/components/scrollable/scrollable.ts +58 -2
  43. package/design/sdk/components/scrollbar/scrollbar.css +1 -1
  44. package/design/sdk/components/scrollbar/scrollbar.ts +28 -0
  45. package/design/sdk/components/select/select.ts +26 -0
  46. package/design/sdk/components/select/shared/select-part.ts +4 -12
  47. package/design/sdk/components/select-panel/select-panel.ts +19 -0
  48. package/design/sdk/components/skeleton/skeleton.ts +7 -0
  49. package/design/sdk/components/slider/slider.ts +34 -0
  50. package/design/sdk/components/standings/standings.ts +16 -1
  51. package/design/sdk/components/stat-tile/stat-tile.ts +12 -0
  52. package/design/sdk/components/stream/stream.ts +23 -3
  53. package/design/sdk/components/switch/switch.ts +32 -4
  54. package/design/sdk/components/table/table.ts +128 -12
  55. package/design/sdk/components/tabs/tabs.ts +22 -1
  56. package/design/sdk/components/textarea/textarea.ts +63 -2
  57. package/design/sdk/components/timeline/timeline.ts +11 -0
  58. package/design/sdk/components/toolbar/toolbar.ts +16 -0
  59. package/design/sdk/components/tooltip/tooltip.ts +11 -0
  60. package/design/sdk/components/tree/tree.ts +20 -1
  61. package/design/sdk/foundations/colors/colors.ts +22 -0
  62. package/design/sdk/foundations/elevation/elevation.ts +7 -0
  63. package/design/sdk/foundations/icons/icons.ts +6 -0
  64. package/design/sdk/ready.json +334 -87
  65. package/design/sdk/rule-baseline.json +48 -0
  66. package/design/table.ts +11 -4
  67. package/design/tooltip.ts +7 -1
  68. package/fesm2022/ethlete-components.mjs +528 -103
  69. package/fesm2022/ethlete-components.mjs.map +1 -1
  70. package/package.json +1 -1
  71. package/src/lib/accordion/accordion-group.component.css +1 -1
  72. package/src/lib/accordion/accordion.component.css +19 -5
  73. package/src/lib/bracket/bracket.component.css +4 -1
  74. package/src/lib/button/button-properties-styles.component.css +46 -0
  75. package/src/lib/button/button.component.css +3 -2
  76. package/src/lib/button/fab.component.css +8 -2
  77. package/src/lib/button/icon-button.component.css +3 -3
  78. package/src/lib/forms/choice-field/choice-field.component.css +4 -2
  79. package/src/lib/forms/dropzone/dropzone-crop.component.css +21 -0
  80. package/src/lib/forms/form-field/form-field-text-shell-styles.component.css +5 -4
  81. package/src/lib/forms/select/select-option-styles.component.css +1 -0
  82. package/src/lib/match/match-card.component.css +8 -2
  83. package/src/lib/match/match-participant.component.css +21 -1
  84. package/src/lib/progress-steps/progress-step.component.css +12 -0
  85. package/src/lib/stream/consent/stream-consent.component.css +1 -0
  86. package/src/lib/stream/error/stream-player-error.component.css +1 -0
  87. package/src/lib/stream/stream-overlay-card-styles.component.css +9 -3
  88. package/src/lib/table/table.component.css +6 -2
  89. package/src/lib/tabs/tab-bar-styles.component.css +8 -8
  90. package/src/lib/timeline/timeline-item.component.css +13 -1
  91. package/types/ethlete-components.d.ts +136 -13
  92. package/design/sdk/components/switch/switch.css +0 -37
@@ -4,8 +4,10 @@ import frame from './calendar.css?inline';
4
4
 
5
5
  type Interaction = 'hover' | 'focus-visible';
6
6
 
7
+ type View = NonNullable<CalendarMockOptions['view']>;
8
+
7
9
  type Props = {
8
- view?: CalendarMockOptions['view'];
10
+ view?: View;
9
11
  selected?: boolean;
10
12
  range?: boolean;
11
13
  day?: Interaction;
@@ -25,11 +27,33 @@ const TODAY = '2026-09-14';
25
27
  const force = (interaction: Interaction | undefined, key: string) =>
26
28
  interaction ? { [key]: `data-et-force="${interaction}"` } : {};
27
29
 
30
+ const ZOOM_OUT: Record<View, string> = { month: 'year-view', year: 'multi-year-view', multiYear: 'selected' };
31
+
32
+ const action = (key: string) => `data-et-action="${key}"`;
33
+
34
+ const cellAction = (view: View, range: boolean) =>
35
+ view === 'year'
36
+ ? 'emit:monthSelect'
37
+ : view === 'multiYear'
38
+ ? 'emit:yearSelect'
39
+ : range
40
+ ? 'emit:rangeValueChange'
41
+ : 'emit:valueChange';
42
+
43
+ const declareCells = (html: string, key: string) =>
44
+ html.replace(/<button [^>]*class="et-calendar-cell[^>]*>/g, (cell) =>
45
+ cell.includes('aria-disabled') ? cell : cell.replace('<button ', `<button ${action(key)} `),
46
+ );
47
+
48
+ const withAction = (key: string | undefined, extra?: string) =>
49
+ [key && action(key), extra].filter(Boolean).join(' ') || undefined;
50
+
28
51
  const render = (props: Props) => {
29
52
  const view = props.view ?? 'month';
30
53
  const coarseKey = view === 'year' ? '2026-03' : '2021';
54
+ const navigate = props.limits ? undefined : 'emit:activeMonthChange';
31
55
 
32
- return calendar({
56
+ const html = calendar({
33
57
  view,
34
58
  month: '2026-09',
35
59
  today: TODAY,
@@ -55,10 +79,13 @@ const render = (props: Props) => {
55
79
  ...force(props.selectedDay, '2026-09-17'),
56
80
  ...force(props.rangeDay, '2026-09-09'),
57
81
  },
58
- nextAttributes: props.nav ? `data-et-force="${props.nav}"` : undefined,
59
- labelAttributes: props.label ? `data-et-force="${props.label}"` : undefined,
82
+ previousAttributes: withAction(navigate),
83
+ nextAttributes: withAction(navigate, props.nav ? `data-et-force="${props.nav}"` : undefined),
84
+ labelAttributes: withAction(ZOOM_OUT[view], props.label ? `data-et-force="${props.label}"` : undefined),
60
85
  attributes: props.compact ? 'style="--et-calendar-cell-size: 32px"' : undefined,
61
86
  });
87
+
88
+ return declareCells(html, cellAction(view, Boolean(props.range || props.comparison)));
62
89
  };
63
90
 
64
91
  export default definePart({
@@ -87,6 +114,31 @@ export default definePart({
87
114
  'label-focus-visible': { label: 'focus-visible' },
88
115
  'long-label': { compact: true, selected: true },
89
116
  },
117
+ describe: {
118
+ rest: 'September 2026 with today on the 14th; check the today mark, the weekday header and the month label.',
119
+ selected: 'The 17th selected; check the filled day and that today keeps its own mark.',
120
+ 'selected-hover': 'The selected 17th hovered; check that the fill shows its hover step.',
121
+ 'selected-focus-visible': 'The selected 17th with keyboard focus; check that the ring shows around the filled day.',
122
+ range: 'The range from the 9th to the 16th; check the filled ends and the band between them.',
123
+ 'range-focus-visible': 'The range start with keyboard focus; check that the ring shows over the range end.',
124
+ 'day-hover': 'The 22nd hovered; check its hover tint.',
125
+ 'day-focus-visible': 'The 22nd with keyboard focus; check the focus ring around the day.',
126
+ disabled: 'Four weekend days disabled; check that they fade and the others stay normal.',
127
+ limits: 'Days outside the 7th to the 24th out of range, the 17th selected; check that the out-of-range days fade.',
128
+ 'week-numbers':
129
+ 'The month with a week number column and the 17th selected; check that the numbers align with their rows.',
130
+ comparison: 'A range of the 15th to the 18th beside a comparison week; check that the two ranges read apart.',
131
+ 'year-view': 'The months of 2026 with May selected; check the filled month and the grid of twelve.',
132
+ 'year-view-hover': 'The year view with March hovered; check its hover tint.',
133
+ 'year-view-focus-visible': 'The year view with March under keyboard focus; check the focus ring around it.',
134
+ 'multi-year-view': 'A span of years with 2024 selected; check the filled year and the grid.',
135
+ 'nav-hover': 'The next-month button hovered; check its hover tint.',
136
+ 'nav-focus-visible': 'The next-month button with keyboard focus; check the focus ring around it.',
137
+ 'label-hover': 'The month label button hovered; check its hover tint.',
138
+ 'label-focus-visible': 'The month label button with keyboard focus; check the focus ring around it.',
139
+ 'long-label':
140
+ 'The month at a 32 px cell size with the 17th selected; check that the header label fits and the grid stays square.',
141
+ },
90
142
  widths: [480],
91
143
  frame: (body) => `<div class="t-frame">${body}</div>`,
92
144
  render: (props: Props) =>
@@ -38,16 +38,65 @@ const content = (props: Props) => {
38
38
 
39
39
  export default definePart({
40
40
  note: 'Decided rules only',
41
- madeBy: ['claude-opus-5-5'],
41
+ consumerAction: 'its buttons are actions the consumer projects',
42
+ madeBy: ['claude-opus-5-5', 'design check'],
42
43
  states: {
43
44
  outlined: { variant: 'outlined' },
44
45
  elevated: { variant: 'elevated' },
45
46
  filled: { variant: 'filled' },
46
47
  media: { variant: 'outlined', form: 'media' },
47
48
  plain: { variant: 'outlined', form: 'plain' },
49
+ confirm: { variant: 'outlined' },
50
+ 'confirm-hover': { variant: 'outlined', confirm: 'hover' },
51
+ 'confirm-active': { variant: 'outlined', confirm: 'active' },
48
52
  'confirm-focus-visible': { variant: 'outlined', confirm: 'focus-visible' },
53
+ 'cancel-hover': { variant: 'outlined', cancel: 'hover' },
54
+ 'cancel-active': { variant: 'outlined', cancel: 'active' },
49
55
  'cancel-focus-visible': { variant: 'outlined', cancel: 'focus-visible' },
50
56
  },
57
+ describe: {
58
+ outlined: 'The outlined card with title, subtitle, text, Cancel and Open; check the border against the page.',
59
+ elevated: 'The elevated card; check the shadow and the raised fill against the page.',
60
+ filled: 'The filled card; check that its fill differs from the page without a border.',
61
+ media: 'The outlined card with a media image on top; check that the image fills the top edge inside the radius.',
62
+ plain: 'A plain outlined card with Revenue and an amount only; check the padding without actions.',
63
+ confirm: 'The outlined card at rest as the Open row of the grid; check Open at rest.',
64
+ 'confirm-hover': 'Open hovered; check that the filled button takes its hover fill inside the card.',
65
+ 'confirm-active': 'Open pressed; check that the fill goes a step past hover.',
66
+ 'confirm-focus-visible': 'Open with keyboard focus; check the focus ring around the button inside the card.',
67
+ 'cancel-hover': 'Cancel hovered; check that the outline button takes its hover tint inside the card.',
68
+ 'cancel-active': 'Cancel pressed; check that the tint goes a step past hover.',
69
+ 'cancel-focus-visible': 'Cancel with keyboard focus; check the focus ring around the outline button.',
70
+ },
71
+ motions: {
72
+ 'cancel-hover-in': { from: 'outlined', to: 'cancel-hover' },
73
+ 'cancel-hover-out': { from: 'cancel-hover', to: 'outlined' },
74
+ 'cancel-press': { from: 'cancel-hover', to: 'cancel-active' },
75
+ 'cancel-release': { from: 'cancel-active', to: 'cancel-hover' },
76
+ 'confirm-hover-in': { from: 'confirm', to: 'confirm-hover' },
77
+ 'confirm-hover-out': { from: 'confirm-hover', to: 'confirm' },
78
+ 'confirm-press': { from: 'confirm-hover', to: 'confirm-active' },
79
+ 'confirm-release': { from: 'confirm-active', to: 'confirm-hover' },
80
+ 'confirm-tap': { from: 'confirm', to: 'confirm-active' },
81
+ 'confirm-lift': { from: 'confirm-active', to: 'confirm' },
82
+ },
83
+ grid: {
84
+ columns: ['rest', 'hover', 'active', 'focus-visible'] as const,
85
+ rows: {
86
+ cancel: {
87
+ rest: 'outlined',
88
+ hover: 'cancel-hover',
89
+ active: 'cancel-active',
90
+ 'focus-visible': 'cancel-focus-visible',
91
+ },
92
+ confirm: {
93
+ rest: 'confirm',
94
+ hover: 'confirm-hover',
95
+ active: 'confirm-active',
96
+ 'focus-visible': 'confirm-focus-visible',
97
+ },
98
+ },
99
+ },
51
100
  widths: [480],
52
101
  controls: {
53
102
  cancel: { kind: 'button', input: ['pointer', 'keyboard'] },
@@ -17,7 +17,9 @@ const TITLES = ['Kick-off', 'First half', 'Half time', 'Second half', 'Full time
17
17
  const LONG_CAPTION =
18
18
  'A long caption that wraps over several lines inside the slide, the way a match report teaser runs on past a single line of text.';
19
19
 
20
- const force = (interaction: Interaction | undefined) => (interaction ? `data-et-force="${interaction}"` : undefined);
20
+ const INDEX_CHANGE = 'data-et-action="emit:activeIndexChange"';
21
+
22
+ const force = (interaction: Interaction | undefined) => (interaction ? `data-et-force="${interaction}"` : '');
21
23
 
22
24
  const slideContent = (index: number, count: number, longCaption: boolean) =>
23
25
  `<div class="carousel-slide"><p class="carousel-slide-title">${index + 1}. ${TITLES[index % TITLES.length]}</p>` +
@@ -28,10 +30,15 @@ const render = ({ count = 5, longCaption = false, previous, next, playToggle, do
28
30
  carousel({
29
31
  ...options,
30
32
  slides: Array.from({ length: count }, (_, index) => ({ content: slideContent(index, count, longCaption) })),
31
- previousAttributes: force(previous),
32
- nextAttributes: force(next),
33
- playToggleAttributes: force(playToggle),
34
- dotAttributes: dot ? { [dot.index]: `data-et-force="${dot.interaction}"` } : undefined,
33
+ previousAttributes: `${INDEX_CHANGE} ${force(previous)}`,
34
+ nextAttributes: `${INDEX_CHANGE} ${force(next)}`,
35
+ playToggleAttributes: `data-et-action="${options.playing === false ? 'autoplay-playing' : 'autoplay-paused'}" ${force(playToggle)}`,
36
+ dotAttributes: Object.fromEntries(
37
+ Array.from({ length: count }, (_, index) => [
38
+ index,
39
+ `${INDEX_CHANGE} ${dot?.index === index ? force(dot.interaction) : ''}`,
40
+ ]),
41
+ ),
35
42
  trackAttributes: 'data-et-skip="CLIPPED"',
36
43
  }).replaceAll(
37
44
  'class="et-carousel-dot-progress-half"',
@@ -65,8 +72,56 @@ export default definePart({
65
72
  'long-caption': { longCaption: true },
66
73
  'single-slide': { count: 1 },
67
74
  },
75
+ describe: {
76
+ 'first-slide': 'The first of five slides with arrows and dots; check that the first dot is active.',
77
+ 'middle-slide': 'The third slide active; check that the third dot is active and both arrows show.',
78
+ 'last-slide': 'The fifth slide active; check the last dot and that next still shows for the loop.',
79
+ 'no-loop-first': 'The first slide without loop; check that previous is disabled.',
80
+ 'no-loop-last': 'The last slide without loop; check that next is disabled.',
81
+ 'next-hover': 'The next arrow hovered; check its hover tint.',
82
+ 'next-active': 'The next arrow pressed; check that it goes past hover.',
83
+ 'next-focus-visible': 'The next arrow with keyboard focus; check the focus ring around it.',
84
+ 'dot-hover': 'The fourth dot hovered; check its hover look against the active dot.',
85
+ 'active-dot-hover': 'The active dot hovered; check that it keeps its active look.',
86
+ 'dot-focus-visible': 'The fourth dot with keyboard focus; check the focus ring around the dot.',
87
+ 'active-dot-focus-visible': 'The active dot with keyboard focus; check the ring around the active dot.',
88
+ 'autoplay-playing':
89
+ 'Autoplay running on the second slide; check the pause toggle and the progress in the active dot.',
90
+ 'autoplay-paused': 'Autoplay paused; check the play icon and the halted progress.',
91
+ 'play-toggle-hover': 'The play toggle hovered; check its hover tint.',
92
+ 'play-toggle-focus-visible': 'The play toggle with keyboard focus; check the focus ring around it.',
93
+ 'multiple-items': 'Two slides per view with a 16 px gap; check the gap and that both slides show whole.',
94
+ 'item-size-third': 'Three slides per view; check that the slides share the width evenly.',
95
+ 'center-aligned': 'Half-width slides centred on the third; check that the active slide sits in the middle.',
96
+ 'no-controls': 'The carousel without arrows and dots; check that only the slide shows.',
97
+ 'long-caption': 'A slide with a caption over several lines; check that the text wraps inside the slide.',
98
+ 'single-slide': 'A carousel with one slide; check how arrows and dots show with nothing to move to.',
99
+ },
68
100
  widths: [480],
69
101
  frame: (body) => `<div class="carousel-frame">${body}</div>`,
102
+ scrolls: [
103
+ 'first-slide',
104
+ 'middle-slide',
105
+ 'last-slide',
106
+ 'no-loop-first',
107
+ 'no-loop-last',
108
+ 'next-hover',
109
+ 'next-active',
110
+ 'next-focus-visible',
111
+ 'dot-hover',
112
+ 'active-dot-hover',
113
+ 'dot-focus-visible',
114
+ 'active-dot-focus-visible',
115
+ 'autoplay-playing',
116
+ 'autoplay-paused',
117
+ 'play-toggle-hover',
118
+ 'play-toggle-focus-visible',
119
+ 'multiple-items',
120
+ 'item-size-third',
121
+ 'center-aligned',
122
+ 'no-controls',
123
+ 'long-caption',
124
+ ],
70
125
  render: (props: Props) =>
71
126
  drawing({
72
127
  body: render(props),
@@ -36,7 +36,13 @@ const LONG_SOURCES = [
36
36
 
37
37
  const PLOT_WIDTH = 410;
38
38
 
39
- const render = (props: Props) => {
39
+ const declareMarks = (html: string) =>
40
+ html.replace(
41
+ /<g class="et-(bar-chart-bar|line-chart-slice|pie-chart-slice)\b/g,
42
+ (mark) => `${mark.slice(0, 2)} data-et-action="emit:markActivate"${mark.slice(2)}`,
43
+ );
44
+
45
+ const marks = (props: Props) => {
40
46
  if (props.kind === 'bar') {
41
47
  return barChart({
42
48
  plotWidth: PLOT_WIDTH,
@@ -89,11 +95,34 @@ export default definePart({
89
95
  'pie-empty': { kind: 'pie', empty: true },
90
96
  'pie-long-label': { kind: 'pie', longLabel: true },
91
97
  },
98
+ describe: {
99
+ bar: 'A bar chart from Jan to Jun in the accent; check the bars, the axis labels and the grid lines.',
100
+ 'bar-series': 'Bars for 2025 and 2026 with a legend; check the two mix steps and their legend keys.',
101
+ 'bar-hover': 'The Apr bar hovered; check the hover tint behind it.',
102
+ 'bar-focus-visible': 'The Apr bar with keyboard focus; check the 2 px focus ring.',
103
+ 'bar-tooltip':
104
+ 'The Mar 2025 bar hovered with its tooltip; check that the tooltip names the month, series and value.',
105
+ 'bar-empty': 'A bar chart without data; check the No sales in this period text inside the plot.',
106
+ 'bar-long-label': 'Bars with long month labels; check that the labels thin to every second one and do not overlap.',
107
+ line: 'A line of visits from Mon to Sun; check the line stroke, the axis and the grid.',
108
+ 'line-series': 'Visits and Sign-ups with a legend; check that the two lines and their keys read apart.',
109
+ 'line-points': 'The visits line with a dot on every point; check that the dots sit on the line.',
110
+ 'line-hover': 'Thu hovered on two lines; check the crosshair and the slice dots.',
111
+ 'line-focus-visible': 'Thu with keyboard focus; check the focus box around the slice.',
112
+ 'line-tooltip': 'Wed hovered with the multi-series tooltip; check both values and keys in the tooltip.',
113
+ pie: 'A pie of four traffic sources with a legend; check the four slices and their legend keys.',
114
+ donut: 'The sources as a donut with the total in the middle; check the ring width and the total.',
115
+ 'pie-hover': 'The Search slice hovered; check its hover look.',
116
+ 'pie-focus-visible': 'The Search slice with keyboard focus; check the focus ring around the slice.',
117
+ 'pie-tooltip': 'The Direct slice hovered with its tooltip; check the label and value in the tooltip.',
118
+ 'pie-empty': 'A pie where every value is zero; check the empty ring.',
119
+ 'pie-long-label': 'A pie with a long legend label; check that the label is cut with an ellipsis.',
120
+ },
92
121
  widths: [480],
93
122
  frame: (body) => `<div class="t-frame">${body}</div>`,
94
123
  render: (props: Props) =>
95
124
  drawing({
96
- body: render(props),
125
+ body: declareMarks(marks(props)),
97
126
  styles: [chartStyles, frame].join('\n'),
98
127
  }),
99
128
  });
@@ -44,7 +44,7 @@ const gridStates = Object.fromEntries(
44
44
  (Object.keys(ROWS) as Row[]).flatMap((row) =>
45
45
  COLUMNS.map((column) => [stateOf(row, column), { checkbox: cellOf(row, column) }]),
46
46
  ),
47
- ) as Record<string, Props>;
47
+ ) as Record<Row | `${Row}-${Exclude<Column, 'rest'>}`, Props>;
48
48
 
49
49
  const CARD: CheckboxMockOptions = {
50
50
  id: 'card',
@@ -57,11 +57,12 @@ const EVENTS = ['Kick-off', 'Goals', 'Half-time', 'Full-time'];
57
57
 
58
58
  const eventsGroup = (
59
59
  checked: number,
60
- extra: { force?: CheckboxMockForce[]; selectAllForce?: CheckboxMockForce[] } = {},
60
+ extra: { force?: CheckboxMockForce[]; selectAllForce?: CheckboxMockForce[]; disabled?: boolean } = {},
61
61
  ): CheckboxGroupMockOptions => ({
62
62
  id: 'events',
63
63
  label: 'Notify me about',
64
64
  selectAll: 'All events',
65
+ disabled: extra.disabled,
65
66
  selectAllForce: extra.selectAllForce,
66
67
  options: EVENTS.map((label, index): CheckboxGroupMockOption => ({
67
68
  label,
@@ -97,7 +98,8 @@ const render = (props: Props) =>
97
98
 
98
99
  export default definePart({
99
100
  note: "The SDK checkbox (et-checkbox) in flow, first drawing, drawn by the mock from @ethlete/components/design/checkbox with the real markup and CSS: et-checkbox alone and inside et-choice-field (label, et-description, hint, error, required marker), the card variant (et-selection-card), and et-checkbox-group with et-checkbox-group-select-all and et-checkbox-option, plus the color-interactive and focus-ring sheets; the brand theme, danger as the error theme. Fixtures are fictional: a match-report preferences form (Send me the match report, One email per match, no ads., hint We send it after the final whistle.; I accept the terms of use, required, error Accept the terms to continue.; card Weekly digest, A summary of every match day, each Monday.; group Notify me about with All events over Kick-off, Goals, Half-time, Full-time; horizontal group Show matches: Home, Away, Neutral ground). Framed as a page with 16px padding at 360 and 640. States: a grid of unchecked, checked and indeterminate by rest, hover, focus-visible, active, disabled and readonly (all labelled); box-only (checked, no label); support (description and hint); invalid and invalid-focus-visible; card-rest, card-checked, card-hover, card-focus-visible, card-checked-focus-visible; group-unchecked, group-partial (2 of 4, select-all mixed), group-checked, group-option-hover, group-option-pressed (force hover and active), group-option-focus-visible, group-select-all-focus-visible and group-horizontal. Numbers (light / dark), from shot pixels at scale 2 at 360, brand mint, a: unchecked box border (surface border) vs page 1.26 / 1.73, the same for the option and select-all boxes and the card edge; hover border 10.37 / 13.07; checked and indeterminate fill (primary) vs page 1.33 / 13.50, check and dash on it 15.82; checked hover fill (-hover) 1.37 / 13.06, 1.03 from rest; active fill 2.24 / 8.01; focus-visible fill (-focus) 1.37 / 13.06; focus ring on a checked or indeterminate box (primary -focus) 1.37 / 13.06, on an unchecked box (surface text colour) 17.93 / 17.18; card checked edge and card ring (primary) 1.33 / 13.50; option and select-all ring 1.37 / 13.06; invalid box border (danger) 4.83 / 3.71, its focus ring (danger -focus) 6.47 / 2.77; disabled checked fill 2.20 / 1.70, disabled unchecked border 1.12 / 1.27 (exempt under 1.4.11). Decided rules that arise: Q88 (the checked and indeterminate ring, the invalid ring, the card ring, the option and select-all rings in ink; the unchecked ring is the surface text colour, not a primary ring, so it stays), Q99a (the card checked and focus edge and the focused option, select-all and card box borders take light-dark(ink, primary); the checked and indeterminate box, the checked option box and the checked or mixed select-all box are mint fills, so they take a 1px inset ink edge, an outline at -1px as in the table round; on the option and select-all the focus ring owns the outline, so the edge leaves while it shows) and Q101 (a filled checked or indeterminate box hovers to -active). The ink edge on a mint fill arises, so Q102 arises: b draws the edges in both schemes, c keeps dark as today (light-dark(ink, transparent)). The error border is the danger theme, not mint, and passes 3:1, so it is kept. Findings for later: (1) lib bug: .et-checkbox-box, .et-checkbox-option-box and .et-checkbox-group-select-all-box were content-box, so --et-checkbox-size 20px drew a 24px box (48 sheet px at scale 2) in an app without a global border-box reset, and the hint and error started 4px left of the label column. Fixed in the lib (box-sizing: border-box on the three boxes): every box draws 20px (40 sheet px), and the label, description and hint share one column (44 CSS px from the frame edge). (2) WCAG 1.4.11: the unchecked box border is 1.26 / 1.73 vs page, under 3:1; it is the only edge of an unchecked box (the same question as the switch off track, switch r1, open). Not drawn. (3) The required marker takes the error theme primary: 3.71:1 in dark, under 4.5:1; exempted here. (4) Focus-visible lightens the checked fill to -focus (1.37 vs page, light), so a focused checked box reads paler than at rest; the ink ring carries the state in b and c. (5) Readonly draws exactly like rest (no affordance by design); a checked readonly box cannot be told from an editable one. (6) Mock: et-description now has its own stylesheet (description.component.css, f5722a1f5), so the mock's inline copy can import it instead. Later rounds, left out here: the sizes sm and lg, the card with the control at start, a coloured (non-brand) checkbox, the group's bulk-edit mixed state (dashed option boxes, a primary mark that Q99a would reach), a disabled or readonly group, a group with error and the group card variant, long labels that wrap, RTL and the check and uncheck animation.",
100
- madeBy: ['claude-opus-5-5'],
101
+ consumerAction: 'a form control whose value the consumer binds',
102
+ madeBy: ['claude-opus-5-5', 'design check'],
101
103
  states: {
102
104
  ...gridStates,
103
105
  'box-only': { checkbox: { id: 'box-only', checked: true } },
@@ -139,9 +141,57 @@ export default definePart({
139
141
  'group-option-hover': { group: eventsGroup(0, { force: ['hover'] }) },
140
142
  'group-option-pressed': { group: eventsGroup(0, { force: ['hover', 'active'] }) },
141
143
  'group-option-focus-visible': { group: eventsGroup(2, { force: ['focus-visible'] }) },
144
+ 'group-select-all-hover': { group: eventsGroup(2, { selectAllForce: ['hover'] }) },
145
+ 'group-select-all-pressed': { group: eventsGroup(2, { selectAllForce: ['hover', 'active'] }) },
142
146
  'group-select-all-focus-visible': { group: eventsGroup(2, { selectAllForce: ['focus-visible'] }) },
147
+ 'group-disabled': { group: eventsGroup(2, { disabled: true }) },
143
148
  'group-horizontal': { group: venueGroup },
144
149
  },
150
+ describe: {
151
+ unchecked: 'The unchecked checkbox; check the box edge, the mark and the label.',
152
+ 'unchecked-hover': 'The unchecked checkbox hovered; check the hover tint around the box.',
153
+ 'unchecked-focus-visible': 'The unchecked checkbox with keyboard focus; check the focus ring around the box.',
154
+ 'unchecked-active': 'The unchecked checkbox pressed; check that the press goes past hover.',
155
+ 'unchecked-disabled': 'The unchecked checkbox disabled; check that box and label fade.',
156
+ 'unchecked-readonly': 'The unchecked checkbox readonly; check that it reads as not editable but stays legible.',
157
+ checked: 'The checked checkbox; check the box edge, the mark and the label.',
158
+ 'checked-hover': 'The checked checkbox hovered; check the hover tint around the box.',
159
+ 'checked-focus-visible': 'The checked checkbox with keyboard focus; check the focus ring around the box.',
160
+ 'checked-active': 'The checked checkbox pressed; check that the press goes past hover.',
161
+ 'checked-disabled': 'The checked checkbox disabled; check that box and label fade.',
162
+ 'checked-readonly': 'The checked checkbox readonly; check that it reads as not editable but stays legible.',
163
+ indeterminate: 'The mixed checkbox; check the box edge, the mark and the label.',
164
+ 'indeterminate-hover': 'The mixed checkbox hovered; check the hover tint around the box.',
165
+ 'indeterminate-focus-visible': 'The mixed checkbox with keyboard focus; check the focus ring around the box.',
166
+ 'indeterminate-active': 'The mixed checkbox pressed; check that the press goes past hover.',
167
+ 'indeterminate-disabled': 'The mixed checkbox disabled; check that box and label fade.',
168
+ 'indeterminate-readonly': 'The mixed checkbox readonly; check that it reads as not editable but stays legible.',
169
+ 'box-only': 'A checked box without a label; check that the box alone keeps its size and touch area.',
170
+ support: 'The checkbox with a description and a hint; check that both sit under the label in muted text.',
171
+ invalid: 'A required unchecked box with its error; check the danger edge and the error text under it.',
172
+ 'invalid-focus-visible':
173
+ 'The invalid box with keyboard focus; check that the focus ring and the error colour both show.',
174
+ 'card-rest': 'The Weekly digest card with its description and the box at the end; check the card edge and padding.',
175
+ 'card-checked': 'The card checked; check that the card edge and the box take the accent.',
176
+ 'card-hover': 'The card hovered; check the hover tint over the whole card.',
177
+ 'card-focus-visible': 'The card with keyboard focus; check the focus ring around the card.',
178
+ 'card-checked-focus-visible':
179
+ 'The checked card with keyboard focus; check that the ring and the checked edge both show.',
180
+ 'group-unchecked':
181
+ 'The Notify me about group with All events and four options off; check the indent under All events.',
182
+ 'group-partial': 'Two of four options checked; check that All events shows the mixed mark.',
183
+ 'group-checked': 'All four options checked; check that All events shows the check.',
184
+ 'group-option-hover': 'The Goals option hovered; check its hover tint.',
185
+ 'group-option-pressed': 'The Goals option pressed; check that the press goes past hover.',
186
+ 'group-option-focus-visible': 'The Goals option with keyboard focus; check the focus ring around its box.',
187
+ 'group-select-all-hover': 'All events hovered over a partial group; check the hover tint around the mixed box.',
188
+ 'group-select-all-pressed': 'All events pressed over a partial group; check that the press goes past hover.',
189
+ 'group-select-all-focus-visible':
190
+ 'All events with keyboard focus over a partial group; check the ring around the mixed box.',
191
+ 'group-disabled':
192
+ 'The partial group disabled; check that All events and every option fade together and show no pointer state.',
193
+ 'group-horizontal': 'The Show matches group in one row; check the gaps between Home, Away and Neutral ground.',
194
+ },
145
195
  grid: {
146
196
  columns: COLUMNS,
147
197
  rows: Object.fromEntries(
@@ -27,25 +27,28 @@ const ROW: ChipMockOptions[] = [
27
27
  { label: 'Archived', selection: 'checkbox', disabled: true },
28
28
  ];
29
29
 
30
- export const { states: rows, grid } = interactionRows<
31
- Props,
32
- 'removable' | 'filter' | 'selected' | 'danger' | 'disabled' | 'disabled-selected' | 'disabled-removable',
33
- Interaction
34
- >(
30
+ const interactive = interactionRows<Props, 'removable' | 'filter' | 'selected' | 'danger', Interaction>(
35
31
  {
36
32
  removable: { label: 'U19', removable: true },
37
33
  filter: { label: 'Upcoming', selection: 'checkbox' },
38
34
  selected: { label: 'Live', selection: 'checkbox', selected: true },
39
35
  danger: { label: 'Overdue', selection: 'checkbox', selected: true, color: 'danger' },
40
- disabled: { label: 'Archived', selection: 'checkbox', disabled: true },
41
- 'disabled-selected': { label: 'Archived', selection: 'checkbox', selected: true, disabled: true },
42
- 'disabled-removable': { label: 'U19', removable: true, disabled: true },
43
36
  },
44
37
  { interactions: ['hover', 'active', 'focus-visible'], force: (props, interaction) => ({ ...props, interaction }) },
45
38
  );
46
39
 
40
+ const disabledRows = {
41
+ disabled: { label: 'Archived', selection: 'checkbox', disabled: true },
42
+ 'disabled-selected': { label: 'Archived', selection: 'checkbox', selected: true, disabled: true },
43
+ 'disabled-removable': { label: 'U19', removable: true, disabled: true },
44
+ } satisfies Record<string, Props>;
45
+
46
+ export const rows = { ...interactive.states, ...disabledRows };
47
+ export const grid = interactive.grid;
48
+
47
49
  export default definePart({
48
50
  note: 'Decided rules only',
51
+ consumerAction: 'a chip whose press and removal the consumer binds',
49
52
  madeBy: ['claude-opus-5-5'],
50
53
  states: {
51
54
  ...rows,
@@ -54,6 +57,34 @@ export default definePart({
54
57
  row: { label: '', row: true },
55
58
  },
56
59
  grid,
60
+ describe: {
61
+ removable: 'The removable U19 chip; check the label and the remove button inside the chip.',
62
+ 'removable-hover': 'The removable U19 chip with its remove button hovered; check the round tint behind the x.',
63
+ 'removable-active': 'The removable U19 chip with its remove button pressed; check that the tint goes past hover.',
64
+ 'removable-focus-visible':
65
+ 'The removable U19 chip with its remove button focused; check the focus ring around the x.',
66
+ filter: 'The unselected Upcoming filter chip; check the outline look without a check.',
67
+ 'filter-hover': 'The unselected Upcoming filter chip, hovered; check that its tint changes from rest.',
68
+ 'filter-active': 'The unselected Upcoming filter chip, pressed; check that it goes a step past hover.',
69
+ 'filter-focus-visible':
70
+ 'The unselected Upcoming filter chip, with keyboard focus; check the focus ring around the control.',
71
+ selected: 'The selected Live filter chip; check the check and the selected fill.',
72
+ 'selected-hover': 'The selected Live filter chip, hovered; check that its tint changes from rest.',
73
+ 'selected-active': 'The selected Live filter chip, pressed; check that it goes a step past hover.',
74
+ 'selected-focus-visible':
75
+ 'The selected Live filter chip, with keyboard focus; check the focus ring around the control.',
76
+ danger: 'The selected Overdue chip in the danger colour; check that the danger fill and label read.',
77
+ 'danger-hover': 'The selected Overdue chip in the danger colour, hovered; check that its tint changes from rest.',
78
+ 'danger-active': 'The selected Overdue chip in the danger colour, pressed; check that it goes a step past hover.',
79
+ 'danger-focus-visible':
80
+ 'The selected Overdue chip in the danger colour, with keyboard focus; check the focus ring around the control.',
81
+ disabled: 'The disabled Archived chip; check that the chip fades and shows no pointer state.',
82
+ 'disabled-selected': 'The disabled selected Archived chip; check that the check stays but the chip fades.',
83
+ 'disabled-removable': 'The disabled removable U19 chip; check that the remove button fades with the chip.',
84
+ plain: 'The plain Bundesliga chip; check the label and the neutral fill.',
85
+ readonly: 'The selected read-only Finished chip; check that it keeps the check but reads as not editable.',
86
+ row: 'Plain, removable, filter, selected, read-only and disabled chips in one row; check that each kind reads apart.',
87
+ },
57
88
  widths: [480],
58
89
  controls: {
59
90
  chip: { kind: 'button', input: ['pointer', 'keyboard'], disabled: true },
@@ -12,7 +12,10 @@ type Props = {
12
12
  };
13
13
 
14
14
  const mark = (control: 'icon' | 'text', interaction?: Interaction) =>
15
- [`data-et-control="${control}" data-can-animate`, interaction && `data-et-force="${interaction}"`]
15
+ [
16
+ `data-et-control="${control}" data-et-action="emit:copySucceed" data-can-animate`,
17
+ interaction && `data-et-force="${interaction}"`,
18
+ ]
16
19
  .filter(Boolean)
17
20
  .join(' ');
18
21
 
@@ -46,6 +49,20 @@ export default definePart({
46
49
  'size-lg': { size: 'lg' },
47
50
  'size-xl': { size: 'xl' },
48
51
  },
52
+ describe: {
53
+ idle: 'The icon and text copy buttons at rest; check the copy icon and the label.',
54
+ copied: 'Both buttons after a copy; check the check icon and the Copied feedback.',
55
+ failed: 'Both buttons after a failed copy; check the error icon and the failed feedback.',
56
+ hover: 'Both buttons hovered; check the hover tint.',
57
+ active: 'Both buttons pressed; check that the press goes past hover.',
58
+ 'focus-visible': 'Both buttons with keyboard focus; check the focus ring around each.',
59
+ 'copied-focus-visible': 'The copied buttons with keyboard focus; check that ring and copied feedback both show.',
60
+ disabled: 'Both buttons disabled; check that they fade.',
61
+ 'size-xs': 'Both buttons at xs; check the icon and text size of the step.',
62
+ 'size-sm': 'Both buttons at sm; check the icon and text size of the step.',
63
+ 'size-lg': 'Both buttons at lg; check the icon and text size of the step.',
64
+ 'size-xl': 'Both buttons at xl; check the icon and text size of the step.',
65
+ },
49
66
  widths: [480],
50
67
  controls: {
51
68
  icon: { kind: 'button', input: ['pointer', 'keyboard'] },
@@ -44,6 +44,16 @@ export default definePart({
44
44
  grouped: { items: GROUPED },
45
45
  'grouped-stacked': { items: GROUPED, variant: 'stacked' },
46
46
  },
47
+ describe: {
48
+ default:
49
+ 'Name, Email, Role and Notes inline; check that terms align in one column and the long note wraps beside it.',
50
+ stacked: 'The same list with each detail under its term; check the gap between term and detail.',
51
+ 'long-value': 'A long URL and a long term inline; check that the URL breaks and the term wraps without overlap.',
52
+ 'long-value-stacked': 'The long values stacked; check that the URL breaks inside the width.',
53
+ 'empty-value': 'A list with an empty Phone detail; check how the empty detail shows.',
54
+ grouped: 'The list with grouped items inline; check the group look around the items.',
55
+ 'grouped-stacked': 'The grouped items stacked; check the group look and the gaps.',
56
+ },
47
57
  widths: [480],
48
58
  frame: (body) => `<div class="description-list-frame">${body}</div>`,
49
59
  render: ({ variant, items = STORY }: Props) =>
@@ -52,18 +52,87 @@ const render = ({ kind, long, close, confirm, cancel }: Props) =>
52
52
 
53
53
  export default definePart({
54
54
  note: 'Decided rules only',
55
- madeBy: ['claude-opus-5-5'],
55
+ consumerAction: 'its buttons are actions the consumer projects',
56
+ madeBy: ['claude-opus-5-5', 'design check'],
56
57
  states: {
57
58
  default: { kind: 'dialog' },
59
+ cancel: { kind: 'dialog' },
60
+ confirm: { kind: 'dialog' },
58
61
  'close-hover': { kind: 'dialog', close: 'hover' },
62
+ 'close-active': { kind: 'dialog', close: 'active' },
59
63
  'close-focus-visible': { kind: 'dialog', close: 'focus-visible' },
64
+ 'confirm-hover': { kind: 'dialog', confirm: 'hover' },
65
+ 'confirm-active': { kind: 'dialog', confirm: 'active' },
60
66
  'confirm-focus-visible': { kind: 'dialog', confirm: 'focus-visible' },
67
+ 'cancel-hover': { kind: 'dialog', cancel: 'hover' },
68
+ 'cancel-active': { kind: 'dialog', cancel: 'active' },
61
69
  'cancel-focus-visible': { kind: 'dialog', cancel: 'focus-visible' },
62
70
  alert: { kind: 'alert' },
63
71
  'alert-cancel-focus-visible': { kind: 'alert', cancel: 'focus-visible' },
64
72
  'alert-confirm-focus-visible': { kind: 'alert', confirm: 'focus-visible' },
65
73
  'long-body': { kind: 'dialog', long: true },
66
74
  },
75
+ describe: {
76
+ default:
77
+ 'Move kick-off over the backdrop with text, close, Cancel and Save; check the title row and the actions at the end.',
78
+ cancel: 'Move kick-off at rest as the Cancel row of the grid; check Cancel at rest.',
79
+ confirm: 'Move kick-off at rest as the Save row of the grid; check Save at rest.',
80
+ 'close-hover': 'The close button hovered; check its round hover tint.',
81
+ 'close-active': 'The close button pressed; check that the round tint goes a step past hover.',
82
+ 'close-focus-visible': 'The close button with keyboard focus; check the focus ring around it.',
83
+ 'confirm-hover': 'Save hovered; check that the filled button takes its hover fill.',
84
+ 'confirm-active': 'Save pressed; check that the fill goes a step past hover.',
85
+ 'confirm-focus-visible': 'Save with keyboard focus; check the focus ring around the filled button.',
86
+ 'cancel-hover': 'Cancel hovered; check that the outline button takes its hover tint.',
87
+ 'cancel-active': 'Cancel pressed; check that the tint goes a step past hover.',
88
+ 'cancel-focus-visible': 'Cancel with keyboard focus; check the focus ring around the outline button.',
89
+ alert: 'The Delete this match? alert with Cancel and Delete; check the message and the two actions.',
90
+ 'alert-cancel-focus-visible': 'The alert Cancel with keyboard focus; check the focus ring around it.',
91
+ 'alert-confirm-focus-visible': 'The alert Delete with keyboard focus; check the focus ring around it.',
92
+ 'long-body':
93
+ 'Move the season with eight paragraphs; check that the body scrolls and the dividers show above and below it.',
94
+ },
95
+ motions: {
96
+ 'close-hover-in': { from: 'default', to: 'close-hover' },
97
+ 'close-hover-out': { from: 'close-hover', to: 'default' },
98
+ 'close-press': { from: 'close-hover', to: 'close-active' },
99
+ 'close-release': { from: 'close-active', to: 'close-hover' },
100
+ 'cancel-hover-in': { from: 'cancel', to: 'cancel-hover' },
101
+ 'cancel-hover-out': { from: 'cancel-hover', to: 'cancel' },
102
+ 'cancel-press': { from: 'cancel-hover', to: 'cancel-active' },
103
+ 'cancel-release': { from: 'cancel-active', to: 'cancel-hover' },
104
+ 'cancel-tap': { from: 'cancel', to: 'cancel-active' },
105
+ 'cancel-lift': { from: 'cancel-active', to: 'cancel' },
106
+ 'confirm-hover-in': { from: 'confirm', to: 'confirm-hover' },
107
+ 'confirm-hover-out': { from: 'confirm-hover', to: 'confirm' },
108
+ 'confirm-press': { from: 'confirm-hover', to: 'confirm-active' },
109
+ 'confirm-release': { from: 'confirm-active', to: 'confirm-hover' },
110
+ 'confirm-tap': { from: 'confirm', to: 'confirm-active' },
111
+ 'confirm-lift': { from: 'confirm-active', to: 'confirm' },
112
+ },
113
+ grid: {
114
+ columns: ['rest', 'hover', 'active', 'focus-visible'] as const,
115
+ rows: {
116
+ close: {
117
+ rest: 'default',
118
+ hover: 'close-hover',
119
+ active: 'close-active',
120
+ 'focus-visible': 'close-focus-visible',
121
+ },
122
+ cancel: {
123
+ rest: 'cancel',
124
+ hover: 'cancel-hover',
125
+ active: 'cancel-active',
126
+ 'focus-visible': 'cancel-focus-visible',
127
+ },
128
+ confirm: {
129
+ rest: 'confirm',
130
+ hover: 'confirm-hover',
131
+ active: 'confirm-active',
132
+ 'focus-visible': 'confirm-focus-visible',
133
+ },
134
+ },
135
+ },
67
136
  widths: [480],
68
137
  controls: {
69
138
  close: { kind: 'button', input: ['pointer', 'keyboard'] },
@@ -71,6 +140,7 @@ export default definePart({
71
140
  confirm: { kind: 'button', input: ['pointer', 'keyboard'] },
72
141
  },
73
142
  frame: (body) => `<div class="dialog-frame">${body}</div>`,
143
+ scrolls: ['long-body'],
74
144
  render: (props: Props) =>
75
145
  drawing({
76
146
  body: overlayBackdrop(render(props)),
@@ -34,6 +34,11 @@ export default definePart({
34
34
  vertical: { set: 'vertical' },
35
35
  list: { set: 'list' },
36
36
  },
37
+ describe: {
38
+ default: 'A horizontal divider between two paragraphs; check its colour and the gap above and below.',
39
+ vertical: 'Vertical dividers between Overview, Squad and Fixtures; check that they span the text height.',
40
+ list: 'Decorative dividers between three list rows; check that they run the full width.',
41
+ },
37
42
  widths: [480],
38
43
  frame: (body) => `<div class="divider-frame">${body}</div>`,
39
44
  render: (props: Props) =>