@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,14 +4,17 @@ import frame from './table.css?inline';
4
4
 
5
5
  type Interaction = 'hover' | 'active' | 'focus-visible';
6
6
 
7
+ type Selection = 'some' | 'row-added' | 'row-removed' | 'all' | 'none';
8
+
7
9
  type Props = {
8
10
  appearance?: TableMockOptions['appearance'];
9
11
  sort?: 'asc' | 'desc';
10
12
  header?: Interaction;
11
13
  row?: Interaction;
12
14
  cell?: 'focus-visible';
13
- selection?: boolean;
15
+ selection?: Selection;
14
16
  expanded?: boolean;
17
+ collapsed?: boolean;
15
18
  expander?: Interaction;
16
19
  groups?: boolean;
17
20
  cellError?: boolean;
@@ -38,18 +41,33 @@ const PLAYERS: [string, string, string, string][] = [
38
41
 
39
42
  const LONG = 'Hoffmann-Wiesenthal-Brandenburger-Lindqvist-Oberhausen';
40
43
 
44
+ const SORT = 'data-et-action="emit:sortChange"';
45
+
46
+ const action = (state: string) => `data-et-action="${state}"`;
47
+
48
+ const SELECTED: Record<Selection, number[]> = {
49
+ some: [1, 2],
50
+ 'row-added': [0, 1, 2],
51
+ 'row-removed': [2],
52
+ all: [0, 1, 2, 3],
53
+ none: [],
54
+ };
55
+
56
+ const selectAll = (selection: Selection): TableMockOptions['selection'] =>
57
+ selection === 'all' ? 'checked' : selection === 'none' ? 'unchecked' : 'mixed';
58
+
41
59
  const columns = (
42
60
  sort: Props['sort'],
43
61
  header: Props['header'],
44
62
  align: TableColumnMock['align'] = 'end',
45
63
  ): TableColumnMock[] => [
46
- { header: 'Player', sortable: true, sort: sort ?? 'asc' },
64
+ { header: 'Player', sortable: true, sort: sort ?? 'asc', labelAttributes: SORT },
47
65
  {
48
66
  header: 'Team',
49
67
  sortable: true,
50
- labelAttributes: header ? `data-et-force="${header}"` : undefined,
68
+ labelAttributes: header ? `${SORT} data-et-force="${header}"` : SORT,
51
69
  },
52
- { header: 'Goals', sortable: true, align },
70
+ { header: 'Goals', sortable: true, align, labelAttributes: SORT },
53
71
  { header: 'Assists', align },
54
72
  ];
55
73
 
@@ -66,7 +84,13 @@ const wideTable = (scrolled: boolean) =>
66
84
  errorColor: 'danger',
67
85
  tracks: '140px 132px repeat(5, 96px)',
68
86
  columns: [
69
- { header: 'Player', sortable: true, sort: 'asc', sticky: scrolled ? { side: 'start', offset: 0 } : undefined },
87
+ {
88
+ header: 'Player',
89
+ sortable: true,
90
+ sort: 'asc',
91
+ labelAttributes: SORT,
92
+ sticky: scrolled ? { side: 'start', offset: 0 } : undefined,
93
+ },
70
94
  ...WIDE_HEADERS.map((header, index) => ({ header, align: index === 0 ? undefined : ('end' as const) })),
71
95
  ],
72
96
  rows: WIDE.map((cells, index) => ({ cells: [PLAYERS[index]?.[0] ?? '', ...cells] })),
@@ -74,6 +98,8 @@ const wideTable = (scrolled: boolean) =>
74
98
  attributes: scrolled ? 'data-scrolled' : undefined,
75
99
  });
76
100
 
101
+ const expandable = (props: Props) => props.expanded || props.collapsed || props.expander !== undefined;
102
+
77
103
  const rows = (props: Props): TableRowMock[] =>
78
104
  PLAYERS.slice(props.stickyHeader ? 3 : 0, props.stickyHeader ? 8 : 4).map((cells, index) => {
79
105
  const row: TableRowMock = { cells: [...cells] };
@@ -84,12 +110,18 @@ const rows = (props: Props): TableRowMock[] =>
84
110
  }
85
111
  if (props.cell && index === 1) row.cells[1] = { value: cells[1], attributes: `data-et-force="${props.cell}"` };
86
112
  if (props.row && index === 1) row.attributes = `data-et-force="${props.row}"`;
87
- if (props.selection) row.selected = index === 1 || index === 2;
113
+ if (props.selection) {
114
+ row.selected = SELECTED[props.selection].includes(index);
115
+ row.selectAttributes = action(row.selected ? 'selection-removed' : 'selection-added');
116
+ }
88
117
  if (props.expanded && index === 1) {
89
118
  row.detail = `<div class="t-detail"><span>Club since 2021</span><span>Left foot</span><span>2 hat-tricks this season</span></div>`;
90
119
  }
91
- if (props.expander && index === 1) row.expanderAttributes = `data-et-force="${props.expander}"`;
92
- if (props.expanded && index === 3) row.noExpander = true;
120
+ if (expandable(props)) {
121
+ const force = props.expander && index === 1 ? ` data-et-force="${props.expander}"` : '';
122
+ row.expanderAttributes = `${action(row.detail === undefined ? 'expanded' : 'collapsed')}${force}`;
123
+ }
124
+ if (expandable(props) && index === 3) row.noExpander = true;
93
125
 
94
126
  return row;
95
127
  });
@@ -104,8 +136,11 @@ const render = (props: Props) => {
104
136
  density: props.density,
105
137
  columns: columns(props.sort, props.header, props.center ? 'center' : undefined),
106
138
  rows: rows(props),
107
- selection: props.selection ? 'mixed' : undefined,
108
- expandable: props.expanded || props.expander !== undefined,
139
+ selection: props.selection ? selectAll(props.selection) : undefined,
140
+ selectAllAttributes: props.selection
141
+ ? action(props.selection === 'all' ? 'selection-none' : 'selection-all')
142
+ : undefined,
143
+ expandable: expandable(props),
109
144
  groups: props.groups ? [{ span: 2 }, { label: 'Season', span: 2 }] : undefined,
110
145
  message: props.message,
111
146
  placeholder: props.loading ? { rows: 4, widths: [70, 55, 30, 30] } : undefined,
@@ -132,9 +167,14 @@ export default definePart({
132
167
  zebra: { appearance: 'zebra' },
133
168
  grid: { appearance: 'grid' },
134
169
  bare: { appearance: 'bare' },
135
- selection: { selection: true },
136
- 'selection-hover': { selection: true, row: 'hover' },
170
+ selection: { selection: 'some' },
171
+ 'selection-hover': { selection: 'some', row: 'hover' },
172
+ 'selection-added': { selection: 'row-added' },
173
+ 'selection-removed': { selection: 'row-removed' },
174
+ 'selection-all': { selection: 'all' },
175
+ 'selection-none': { selection: 'none' },
137
176
  expanded: { expanded: true },
177
+ collapsed: { collapsed: true },
138
178
  'expander-hover': { expanded: true, expander: 'hover' },
139
179
  'expander-focus-visible': { expanded: true, expander: 'focus-visible' },
140
180
  'group-header': { groups: true },
@@ -151,8 +191,84 @@ export default definePart({
151
191
  'density-lg': { density: 'lg' },
152
192
  'align-center': { center: true },
153
193
  },
194
+ describe: {
195
+ rest: 'Four players sorted by Player ascending; check the header row, the sort arrow and the numbers aligned at the end.',
196
+ 'sort-desc': 'The players sorted by Player descending; check that the sort arrow flips.',
197
+ 'header-hover': 'The Team header hovered; check that only the Team sort label shows hover.',
198
+ 'header-active': 'The Team header pressed; check that the press look is deeper than hover.',
199
+ 'header-focus-visible': 'The Team header focused by keyboard; check that the focus ring wraps its sort label.',
200
+ 'row-hover': 'An interactive table with the second row hovered; check that only that row tints.',
201
+ 'row-active': 'The second row pressed; check that the press tint is deeper than hover.',
202
+ 'cell-focus-visible': 'Cell navigation with the second Team cell focused; check that the ring wraps one cell.',
203
+ divided: 'The divided appearance; check that lines separate the rows.',
204
+ zebra: 'The zebra appearance; check that every other row takes a light stripe.',
205
+ grid: 'The grid appearance; check that lines separate both rows and columns.',
206
+ bare: 'The bare appearance; check that no row lines or stripes show.',
207
+ selection: 'A selection column with two rows selected; check the mixed header checkbox and the selected row tint.',
208
+ 'selection-hover':
209
+ 'The selection table with the selected second row hovered; check that hover and selection both read.',
210
+ 'selection-added': 'Lena selected on top of the selection; check her checkbox and row tint, header still mixed.',
211
+ 'selection-removed': 'Mara cleared from the selection; only Ida stays selected and the header stays mixed.',
212
+ 'selection-all': 'Every row selected; check that the header checkbox is checked and all four rows tint.',
213
+ 'selection-none': 'No row selected; check that every checkbox, the header one too, is empty and no row tints.',
214
+ expanded:
215
+ 'The second row expanded with its detail; check that the detail sits under the row and Pia has no expander.',
216
+ collapsed: 'The expander column with every row collapsed; check the closed chevrons and that Pia has no expander.',
217
+ 'expander-hover': 'The second row expander hovered; check that only the expander button shows hover.',
218
+ 'expander-focus-visible': 'The second row expander focused by keyboard; check that the ring wraps the expander.',
219
+ 'group-header': 'A Season group over Goals and Assists; check that the group label spans its two columns.',
220
+ 'cell-error': 'A failed Goals cell in the second row; check that the dash shows with the danger error mark.',
221
+ empty: 'The table with the empty message; check that the message sits under the header.',
222
+ error: 'The table with the error message; check that it reads as an error under the header.',
223
+ loading: 'Four placeholder rows loading; check that skeleton bars fill the cells at varied widths.',
224
+ busy: 'The table busy at 40 %; check the progress indicator and that the rows stay readable.',
225
+ 'long-value': 'A long name in the second row; check that it truncates or wraps inside its column.',
226
+ 'wide-scroll': 'A seven-column table at its start; check that it scrolls sideways with a shadow at the end edge.',
227
+ 'sticky-column': 'The wide table scrolled; check that Player sticks at the start with shadows on both edges.',
228
+ 'sticky-header': 'Five rows scrolled under a sticky header; check that the header stays on top with its shadow.',
229
+ 'density-sm': 'The table at density sm; check that rows are tighter but cells stay readable.',
230
+ 'density-lg': 'The table at density lg; check that rows are roomier with the same columns.',
231
+ 'align-center': 'Goals and Assists centered; check that numbers and headers sit in the middle of their columns.',
232
+ },
154
233
  widths: [480],
234
+ motions: {
235
+ expand: { from: 'collapsed', to: 'expanded' },
236
+ collapse: { from: 'expanded', to: 'collapsed' },
237
+ },
238
+ unreachable: [
239
+ {
240
+ from: 'rest',
241
+ to: 'collapsed',
242
+ reason: 'The collapsed table has an expander column the rest table lacks; no step adds or drops that column.',
243
+ },
244
+ {
245
+ from: 'collapsed',
246
+ to: 'rest',
247
+ reason: 'The collapsed table has an expander column the rest table lacks; no step adds or drops that column.',
248
+ },
249
+ {
250
+ from: 'loading',
251
+ to: 'collapsed',
252
+ reason: 'The loading table draws placeholder rows without an expander column; no step adds that column.',
253
+ },
254
+ {
255
+ from: 'collapsed',
256
+ to: 'loading',
257
+ reason: 'The loading table draws placeholder rows without an expander column; no step drops that column.',
258
+ },
259
+ {
260
+ from: 'busy',
261
+ to: 'collapsed',
262
+ reason: 'The busy table has no expander column, the collapsed one has; no step adds that column.',
263
+ },
264
+ {
265
+ from: 'collapsed',
266
+ to: 'busy',
267
+ reason: 'The busy table has no expander column, the collapsed one has; no step drops that column.',
268
+ },
269
+ ],
155
270
  frame: (body) => `<div class="t-frame">${body}</div>`,
271
+ scrolls: ['wide-scroll', 'sticky-column'],
156
272
  render: (props: Props) =>
157
273
  drawing({
158
274
  body: render(props),
@@ -56,6 +56,27 @@ export default definePart({
56
56
  vertical: { tabs: TABS, orientation: 'vertical' },
57
57
  panel: { tabs: TABS, panel: '<p>Three open tasks, two of them due this week.</p>' },
58
58
  },
59
+ describe: {
60
+ tab: 'Overview selected, Activity at rest; check that Activity reads as a plain tab beside the underlined Overview.',
61
+ 'tab-hover': 'The unselected Activity tab hovered; check that only Activity shows the hover look.',
62
+ 'tab-active': 'The unselected Activity tab pressed; check that the press look is deeper than hover.',
63
+ 'tab-focus-visible': 'The unselected Activity tab focused by keyboard; check that the ring wraps Activity.',
64
+ selected: 'Activity selected; check that its underline and label color mark it on the baseline.',
65
+ 'selected-hover': 'The selected Activity tab hovered; check that it keeps its underline under hover.',
66
+ 'selected-active': 'The selected Activity tab pressed; check that the underline stays while pressed.',
67
+ 'selected-focus-visible': 'The selected Activity tab focused by keyboard; check that ring and underline both show.',
68
+ disabled: 'Four tabs with Billing disabled; check that Billing fades and the others stay full.',
69
+ sm: 'The tabs at size sm; check that triggers and text shrink together.',
70
+ lg: 'The tabs at size lg; check that triggers and text grow together.',
71
+ primary: 'The tabs in the primary variant; check the selected look differs from the default variant.',
72
+ icons: 'Tabs with an icon before each label; check that icons center on the labels.',
73
+ 'primary-icons': 'Icon tabs in the primary variant; check icon and label alignment in the selected tab.',
74
+ 'icon-only': 'Tabs showing only icons; check that each trigger keeps an even size and the selected underline.',
75
+ 'primary-icon-only': 'Icon-only tabs in the primary variant; check that the selected icon stands out.',
76
+ 'no-divider': 'The tabs without a divider; check that no baseline shows under the bar.',
77
+ vertical: 'The tabs stacked vertically; check that the selected marker sits on the side.',
78
+ panel: 'The tabs with a panel below; check the gap between bar and panel text.',
79
+ },
59
80
  grid,
60
81
  widths: [480],
61
82
  controls: {
@@ -68,7 +89,7 @@ export default definePart({
68
89
  triggerAttributes: forced
69
90
  ? { ...props.triggerAttributes, [forced.tab]: `data-et-force="${forced.interaction}"` }
70
91
  : props.triggerAttributes,
71
- }).replaceAll('role="tab"', 'data-et-control="tab" role="tab"'),
92
+ }).replaceAll('role="tab"', 'data-et-control="tab" data-et-action="emit:selectedIndexChange" role="tab"'),
72
93
  styles: [tabsStyles, edge].join('\n'),
73
94
  }),
74
95
  });
@@ -20,6 +20,12 @@ const INVALID = {
20
20
  errorColor: 'danger',
21
21
  } satisfies Partial<TextareaFieldMockOptions>;
22
22
 
23
+ const markControl = (markup: string) =>
24
+ markup
25
+ .replace('<et-form-field ', '<et-form-field data-et-control="textarea" ')
26
+ .replace('<div class="et-form-field-control-frame"', '$& data-et-control-part')
27
+ .replace('<textarea ', '<textarea data-et-control-part ');
28
+
23
29
  export default definePart({
24
30
  note: 'scale of the decided shape, Q182, lead merge',
25
31
  madeBy: ['claude-opus-5-5', 'claude-sonnet-5-5', 'design check'],
@@ -53,13 +59,68 @@ export default definePart({
53
59
  'size-sm': message({ value: VALUE, size: 'sm' }),
54
60
  'size-lg': message({ value: VALUE, size: 'lg' }),
55
61
  },
62
+ describe: {
63
+ empty:
64
+ 'The Message textarea with no value or placeholder; check that the label sits above an empty, evenly padded box.',
65
+ placeholder: 'The empty textarea with its placeholder; check that the placeholder reads muted.',
66
+ filled: 'The textarea holding three lines; check that the box grows to fit them.',
67
+ hover: 'The empty textarea hovered; check that the border darkens without shifting the box.',
68
+ 'hover-filled': 'The filled textarea hovered; check that the border darkens and the text stays put.',
69
+ focus: 'The empty textarea focused by keyboard; check that the focus ring shows without resizing the box.',
70
+ 'focus-filled': 'The filled textarea focused by keyboard; check that the ring shows around the grown box.',
71
+ 'focus-hover': 'The filled textarea focused and hovered; check that the focus ring wins over hover.',
72
+ hint: 'The textarea with a hint; check that the hint sits under the box in muted text.',
73
+ description: 'The textarea with a description; check that it reads as help text apart from the box.',
74
+ required: 'The required textarea with a hint; check that the required mark shows next to the label.',
75
+ invalid: 'A required textarea with too little text; check that the border and error text use the danger color.',
76
+ 'invalid-hover': 'The invalid textarea hovered; check that the danger border stays.',
77
+ 'invalid-focus': 'The invalid textarea focused; check that the focus ring takes the danger color.',
78
+ disabled: 'The empty textarea disabled; check that box, label and placeholder fade.',
79
+ 'disabled-filled': 'The filled textarea disabled; check that the text fades but stays readable.',
80
+ readonly: 'The filled textarea read-only; check that it looks static and the text stays clear.',
81
+ 'readonly-focus': 'The read-only textarea focused by keyboard; check that a focus ring still shows.',
82
+ 'long-autosize': 'Eight lines with autosize; check that the box grows to show every line with no scrollbar.',
83
+ 'long-max-rows': 'Eight lines capped at four rows; check that the box stops at four rows and scrolls.',
84
+ 'long-max-rows-scrolled':
85
+ 'The capped textarea scrolled down; check that later lines show and the box keeps four rows.',
86
+ 'manual-resize': 'Three lines in a fixed four-row box; check the resize handle in the corner.',
87
+ 'manual-resize-overflow': 'Eight lines in a fixed four-row box; check that the text scrolls inside it.',
88
+ 'single-row': 'A one-row textarea with a placeholder; check that it starts at one line tall.',
89
+ mixed: 'The textarea in the mixed state; check that the Mixed values label shows instead of the text.',
90
+ 'no-label': 'A textarea without a label; check that the box keeps its padding with no label space.',
91
+ 'size-sm': 'The filled textarea at size sm; check that padding and text shrink together.',
92
+ 'size-lg': 'The filled textarea at size lg; check that padding and text grow together.',
93
+ },
56
94
  widths: [320, 360, 640],
95
+ controls: {
96
+ textarea: { kind: 'field', part: 'components/form-field', disabled: true },
97
+ },
98
+ motions: {
99
+ 'hover-in': { from: 'empty', to: 'hover' },
100
+ 'hover-out': { from: 'hover', to: 'empty' },
101
+ 'hover-in-filled': { from: 'filled', to: 'hover-filled' },
102
+ 'hover-out-filled': { from: 'hover-filled', to: 'filled' },
103
+ 'hover-in-invalid': { from: 'invalid', to: 'invalid-hover' },
104
+ 'hover-out-invalid': { from: 'invalid-hover', to: 'invalid' },
105
+ disable: { from: 'empty', to: 'disabled' },
106
+ enable: { from: 'disabled', to: 'empty' },
107
+ 'disable-hovered': { from: 'hover', to: 'disabled' },
108
+ 'enable-hovered': { from: 'disabled', to: 'hover' },
109
+ 'disable-filled': { from: 'filled', to: 'disabled-filled' },
110
+ 'enable-filled': { from: 'disabled-filled', to: 'filled' },
111
+ 'disable-hovered-filled': { from: 'hover-filled', to: 'disabled-filled' },
112
+ 'enable-hovered-filled': { from: 'disabled-filled', to: 'hover-filled' },
113
+ },
57
114
  frame: (body, props) => `<div class="t-frame ${props.scrolled ? 't-scrolled' : ''}">${body}</div>`,
115
+ scrolls: ['long-max-rows', 'manual-resize-overflow'],
58
116
  render: (props: Props) =>
59
117
  drawing({
60
118
  body: props.scrolled
61
- ? textareaField(props.field).replace('<div class="et-form-field-control-frame"', '$& data-et-skip="CLIPPED"')
62
- : textareaField(props.field),
119
+ ? markControl(textareaField(props.field)).replace(
120
+ '<div class="et-form-field-control-frame"',
121
+ '$& data-et-skip="CLIPPED"',
122
+ )
123
+ : markControl(textareaField(props.field)),
63
124
  styles: [textareaFieldStyles, frame].join('\n'),
64
125
  }),
65
126
  });
@@ -78,6 +78,17 @@ export default definePart({
78
78
  'long-content': { long: true, markers: true },
79
79
  single: { count: 1 },
80
80
  },
81
+ describe: {
82
+ default:
83
+ 'Four match events with times, labels and descriptions; check that dots line up on one rail with even gaps.',
84
+ 'with-markers': 'The events with icon markers in their theme colors; check that each icon centers on the rail.',
85
+ 'themed-dots': 'The events with plain dots in their theme colors; check that each dot takes its color.',
86
+ compact: 'The events with labels only; check that rows tighten and the rail stays continuous.',
87
+ 'compact-markers': 'The compact events with icon markers; check that markers fit the tighter rows.',
88
+ 'no-time': 'The events without times; check that the content shifts over and the rail stays aligned.',
89
+ 'long-content': 'A long label and a long URL in the second event; check that both wrap and nothing overflows.',
90
+ single: 'A single event; check that no rail runs past its dot.',
91
+ },
81
92
  widths: [480],
82
93
  render: (props: Props) =>
83
94
  drawing({
@@ -61,6 +61,7 @@ const render = (props: Props) => {
61
61
 
62
62
  export default definePart({
63
63
  note: 'scale of the decided shape, Q182, lead merge',
64
+ consumerAction: 'its buttons run the commands the consumer binds',
64
65
  madeBy: ['claude-opus-5-5'],
65
66
  states: {
66
67
  default: {},
@@ -75,6 +76,21 @@ export default definePart({
75
76
  'size-lg': { size: 'lg' },
76
77
  'size-xl': { size: 'xl' },
77
78
  },
79
+ describe: {
80
+ default:
81
+ 'Seven format buttons in three groups with Bold and Bulleted pressed; check the dividers and the pressed fill.',
82
+ hover: 'Pressed Bold and unpressed Italic hovered; check that hover reads on both and Bold stays pressed.',
83
+ active: 'Pressed Bold and unpressed Italic pressed down; check that the press look is deeper than hover on both.',
84
+ 'focus-visible': 'The pressed Bold button focused by keyboard; check that the ring shows around the pressed fill.',
85
+ 'focus-visible-unpressed':
86
+ 'Italic as tab stop and focused by keyboard; check that the ring wraps the unpressed button.',
87
+ disabled: 'Italic disabled; check that only Italic fades.',
88
+ vertical: 'The toolbar stacked vertically; check that dividers turn horizontal between the groups.',
89
+ 'size-xs': 'The toolbar at size xs; check that buttons and icons shrink together.',
90
+ 'size-md': 'The toolbar at size md; check button and icon sizes against the default.',
91
+ 'size-lg': 'The toolbar at size lg; check that buttons and icons grow together.',
92
+ 'size-xl': 'The toolbar at size xl; check that it still fits the 528px frame.',
93
+ },
78
94
  widths: [528],
79
95
  controls: Object.fromEntries(
80
96
  BUTTONS.map(({ control }) => [control, { kind: 'button', input: ['pointer', 'keyboard'] }]),
@@ -20,6 +20,17 @@ export default definePart<TooltipMockOptions>({
20
20
  'bottom-start': { text: 'Copy the link to this board', placement: 'bottom-start' },
21
21
  'top-end': { text: 'Copy the link to this board', placement: 'top-end' },
22
22
  },
23
+ describe: {
24
+ short: 'The tooltip with Copy link; check the pane padding and the arrow.',
25
+ long: 'A long tooltip text; check that it wraps at the 34ch max width.',
26
+ template: 'Template content with a bold shortcut and a line; check the spacing between the two paragraphs.',
27
+ top: 'The tooltip placed on top; check that the arrow points down, centered.',
28
+ right: 'The tooltip placed on the right; check that the arrow points left, centered.',
29
+ bottom: 'The tooltip placed below; check that the arrow points up, centered.',
30
+ left: 'The tooltip placed on the left; check that the arrow points right, centered.',
31
+ 'bottom-start': 'The tooltip below at start; check that the arrow points up, 20px in from the start.',
32
+ 'top-end': 'The tooltip on top at end; check that the arrow points down, 20px in from the end.',
33
+ },
23
34
  render: (options: TooltipMockOptions) =>
24
35
  drawing({
25
36
  body: `<div class="sdk-tooltip-stage">${tooltip(options)}</div>`,
@@ -28,6 +28,8 @@ const FILES: TreeMockItem[] = [
28
28
  { label: 'package.json' },
29
29
  ];
30
30
 
31
+ const SELECT = 'data-et-action="emit:valueChange"';
32
+
31
33
  const SHORT: TreeMockItem[] = [{ label: 'docs' }, { label: 'notes.md' }, { label: 'README.md' }];
32
34
 
33
35
  const { states, grid } = interactionRows(
@@ -53,6 +55,18 @@ export default definePart({
53
55
  collapsed: { items: FILES },
54
56
  expanded: { items: FILES, expanded: ['src', 'src/app', 'docs'], value: 'src/app/app.config.ts' },
55
57
  },
58
+ describe: {
59
+ row: 'Three flat rows, none selected; check row padding and that notes.md looks like the others.',
60
+ 'row-hover': 'The notes.md row hovered; check that only that row tints.',
61
+ 'row-active': 'The notes.md row pressed; check that the press tint is deeper than hover.',
62
+ 'row-focus-visible': 'The notes.md row focused by keyboard; check that the focus ring wraps the row.',
63
+ selected: 'The notes.md row selected; check the selected tint on that row.',
64
+ 'selected-hover': 'The selected notes.md row hovered; check that hover and selection both read.',
65
+ 'selected-active': 'The selected notes.md row pressed; check that the selected tint stays readable.',
66
+ 'selected-focus-visible': 'The selected notes.md row focused by keyboard; check that ring and tint both show.',
67
+ collapsed: 'The file tree collapsed; check that folders show closed chevrons and files have none.',
68
+ expanded: 'src, app and docs open with app.config.ts selected; check the indent per level and the dim legacy.ts.',
69
+ },
56
70
  grid,
57
71
  widths: [320],
58
72
  controls: {
@@ -64,7 +78,12 @@ export default definePart({
64
78
  ...props,
65
79
  label: 'Files',
66
80
  rowAttributes: forced && { [forced.row]: `data-et-force="${forced.interaction}"` },
67
- }).replaceAll('role="treeitem"', 'data-et-control="row" role="treeitem"'),
81
+ }).replace(/<div [^>]*role="treeitem"[^>]*>/g, (row) =>
82
+ row.replace(
83
+ 'role="treeitem"',
84
+ `data-et-control="row"${row.includes('aria-disabled') ? '' : ` ${SELECT}`} role="treeitem"`,
85
+ ),
86
+ ),
68
87
  styles: [treeStyles, selectedTint].join('\n'),
69
88
  }),
70
89
  });
@@ -190,5 +190,27 @@ export default definePart<Props>({
190
190
  'contrast-light': { group: 'contrast', surface: 'light' },
191
191
  'contrast-dark': { group: 'contrast', surface: 'dark' },
192
192
  },
193
+ describe: {
194
+ 'surface-light':
195
+ 'The light surface tokens: background, text steps, border, interaction tints and shadow; check that the text steps stay apart and the tints read on the page.',
196
+ 'surface-dark':
197
+ 'The dark surface tokens: background, text steps, border, interaction tints and shadow; check that the text steps stay apart and the tints read on the page.',
198
+ 'brand-light':
199
+ 'The brand colour tokens on the light surface: primary, its ink and on-colour in each interaction step; check that the steps differ and the on-colour reads on the fill.',
200
+ 'brand-dark':
201
+ 'The brand colour tokens on the dark surface in each interaction step; check that the steps differ and the on-colour reads on the fill.',
202
+ 'danger-light':
203
+ 'The danger colour tokens on the light surface in each interaction step; check that the steps differ and the on-colour reads on the fill.',
204
+ 'danger-dark':
205
+ 'The danger colour tokens on the dark surface in each interaction step; check that the steps differ and the on-colour reads on the fill.',
206
+ 'warning-light':
207
+ 'The warning colour tokens on the light surface in each interaction step; check that the ink stays readable and the on-colour reads on the fill.',
208
+ 'warning-dark':
209
+ 'The warning colour tokens on the dark surface in each interaction step; check that the steps differ and the on-colour reads on the fill.',
210
+ 'contrast-light':
211
+ 'The AA contrast pairs of text and fills on the light surface; check that every pair shows its ratio and none falls under its threshold.',
212
+ 'contrast-dark':
213
+ 'The AA contrast pairs of text and fills on the dark surface; check that every pair shows its ratio and none falls under its threshold.',
214
+ },
193
215
  render,
194
216
  });
@@ -4,8 +4,15 @@ import edge from './elevation.css?inline';
4
4
 
5
5
  export default definePart<ElevationProps>({
6
6
  note: 'How the SDK lifts things off the base surface: a card, an elevated panel and an overlay pane (the select panel mock), side by side and as a pane over a panel. Fills come from the elevated surface tokens; no background colour differs from the product. In the dark scheme a 1 px ring in --et-surface-ring-solid (24 % --et-surface-color-solid over the fill) replaces the border colour. The token is defined here; the generator does not emit it yet.',
7
+ consumerAction: 'a showcase whose select the consumer binds',
7
8
  madeBy: ['claude-opus-5-5'],
8
9
  states: ELEVATION_STATES,
10
+ describe: {
11
+ overview:
12
+ 'A card, an elevated panel and an overlay pane side by side; check that each lifts off the base surface and the dark scheme shows the 1 px ring.',
13
+ stacked:
14
+ 'An overlay pane over an elevated panel; check that the pane stays apart from the panel under it in both schemes.',
15
+ },
9
16
  render: (props: ElevationProps) =>
10
17
  elevationScene(props, { card: 'sdk-ring', panel: 'sdk-ring', pane: 'sdk-ring' }, edge),
11
18
  });
@@ -115,5 +115,11 @@ export default definePart<{ view: View }>({
115
115
  note: "Today's look",
116
116
  madeBy: ['claude-opus-5-5'],
117
117
  states: { catalogue: { view: 'catalogue' }, construction: { view: 'construction' } },
118
+ describe: {
119
+ catalogue:
120
+ 'Every icon the SDK ships at 16, 20 and 24 px; check that each stays crisp and optically even across the sizes.',
121
+ construction:
122
+ 'Every icon on the candidate grid with pixel lines, centre lines and padding; check that strokes sit on the pixel lines inside the padding.',
123
+ },
118
124
  render: ({ view }) => iconSheet({ view, title: titles[view], icons, sizes: [16, 20, 24] }),
119
125
  });