@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.
- package/CHANGELOG.md +45 -0
- package/design/sdk/components/accent-on-light/accent-on-light.ts +5 -0
- package/design/sdk/components/accordion/accordion.ts +11 -0
- package/design/sdk/components/action-sheet/action-sheet.ts +37 -1
- package/design/sdk/components/anchored-dialog/anchored-dialog.css +2 -5
- package/design/sdk/components/anchored-dialog/anchored-dialog.ts +22 -8
- package/design/sdk/components/avatar/avatar.ts +16 -0
- package/design/sdk/components/badge/badge.css +18 -0
- package/design/sdk/components/badge/badge.ts +39 -3
- package/design/sdk/components/banner/banner.ts +48 -1
- package/design/sdk/components/bracket/bracket.ts +17 -0
- package/design/sdk/components/breadcrumb/breadcrumb.ts +15 -1
- package/design/sdk/components/button/button.ts +106 -3
- package/design/sdk/components/calendar/calendar.ts +56 -4
- package/design/sdk/components/card/card.ts +50 -1
- package/design/sdk/components/carousel/carousel.ts +60 -5
- package/design/sdk/components/chart/chart.ts +31 -2
- package/design/sdk/components/checkbox/checkbox.ts +53 -3
- package/design/sdk/components/chip/chip.ts +39 -8
- package/design/sdk/components/copy-button/copy-button.ts +18 -1
- package/design/sdk/components/description-list/description-list.ts +10 -0
- package/design/sdk/components/dialog/dialog.ts +71 -1
- package/design/sdk/components/divider/divider.ts +5 -0
- package/design/sdk/components/empty-state/empty-state.ts +10 -0
- package/design/sdk/components/floating-action/floating-action.ts +15 -0
- package/design/sdk/components/form-field/form-field.ts +102 -16
- package/design/sdk/components/grid/grid.ts +16 -1
- package/design/sdk/components/input/input.ts +50 -0
- package/design/sdk/components/kbd/kbd.ts +12 -0
- package/design/sdk/components/loader/loader.ts +11 -0
- package/design/sdk/components/masonry/masonry.ts +7 -0
- package/design/sdk/components/match/match.ts +17 -0
- package/design/sdk/components/menu/menu.ts +17 -0
- package/design/sdk/components/notification/notification.ts +19 -0
- package/design/sdk/components/otp-input/otp-input.ts +21 -0
- package/design/sdk/components/pagination/pagination.ts +22 -1
- package/design/sdk/components/picture/picture.ts +15 -0
- package/design/sdk/components/progress-steps/progress-steps.ts +17 -0
- package/design/sdk/components/query-error/query-error.ts +26 -1
- package/design/sdk/components/radio-group/radio-group.ts +43 -1
- package/design/sdk/components/scheduler/scheduler.ts +34 -1
- package/design/sdk/components/scrollable/scrollable.ts +58 -2
- package/design/sdk/components/scrollbar/scrollbar.css +1 -1
- package/design/sdk/components/scrollbar/scrollbar.ts +28 -0
- package/design/sdk/components/select/select.ts +26 -0
- package/design/sdk/components/select/shared/select-part.ts +4 -12
- package/design/sdk/components/select-panel/select-panel.ts +19 -0
- package/design/sdk/components/skeleton/skeleton.ts +7 -0
- package/design/sdk/components/slider/slider.ts +34 -0
- package/design/sdk/components/standings/standings.ts +16 -1
- package/design/sdk/components/stat-tile/stat-tile.ts +12 -0
- package/design/sdk/components/stream/stream.ts +23 -3
- package/design/sdk/components/switch/switch.ts +32 -4
- package/design/sdk/components/table/table.ts +128 -12
- package/design/sdk/components/tabs/tabs.ts +22 -1
- package/design/sdk/components/textarea/textarea.ts +63 -2
- package/design/sdk/components/timeline/timeline.ts +11 -0
- package/design/sdk/components/toolbar/toolbar.ts +16 -0
- package/design/sdk/components/tooltip/tooltip.ts +11 -0
- package/design/sdk/components/tree/tree.ts +20 -1
- package/design/sdk/foundations/colors/colors.ts +22 -0
- package/design/sdk/foundations/elevation/elevation.ts +7 -0
- package/design/sdk/foundations/icons/icons.ts +6 -0
- package/design/sdk/ready.json +334 -87
- package/design/sdk/rule-baseline.json +48 -0
- package/design/table.ts +11 -4
- package/design/tooltip.ts +7 -1
- package/fesm2022/ethlete-components.mjs +528 -103
- package/fesm2022/ethlete-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/accordion/accordion-group.component.css +1 -1
- package/src/lib/accordion/accordion.component.css +19 -5
- package/src/lib/bracket/bracket.component.css +4 -1
- package/src/lib/button/button-properties-styles.component.css +46 -0
- package/src/lib/button/button.component.css +3 -2
- package/src/lib/button/fab.component.css +8 -2
- package/src/lib/button/icon-button.component.css +3 -3
- package/src/lib/forms/choice-field/choice-field.component.css +4 -2
- package/src/lib/forms/dropzone/dropzone-crop.component.css +21 -0
- package/src/lib/forms/form-field/form-field-text-shell-styles.component.css +5 -4
- package/src/lib/forms/select/select-option-styles.component.css +1 -0
- package/src/lib/match/match-card.component.css +8 -2
- package/src/lib/match/match-participant.component.css +21 -1
- package/src/lib/progress-steps/progress-step.component.css +12 -0
- package/src/lib/stream/consent/stream-consent.component.css +1 -0
- package/src/lib/stream/error/stream-player-error.component.css +1 -0
- package/src/lib/stream/stream-overlay-card-styles.component.css +9 -3
- package/src/lib/table/table.component.css +6 -2
- package/src/lib/tabs/tab-bar-styles.component.css +8 -8
- package/src/lib/timeline/timeline-item.component.css +13 -1
- package/types/ethlete-components.d.ts +136 -13
- package/design/sdk/components/switch/switch.css +0 -37
|
@@ -45,7 +45,7 @@ const gridStates = Object.fromEntries(
|
|
|
45
45
|
(Object.keys(ROWS) as Row[]).flatMap((row) =>
|
|
46
46
|
COLUMNS.map((column) => [stateOf(row, column), { group: cellOf(row, column) }]),
|
|
47
47
|
),
|
|
48
|
-
) as Record<
|
|
48
|
+
) as Record<Row | `${Row}-${Exclude<Column, 'rest'>}`, Props>;
|
|
49
49
|
|
|
50
50
|
const marked = (markup: string) =>
|
|
51
51
|
markup.replace(/<et-radio(?=[\s>])/gu, (tag) => control(`${tag}>`, 'radio').slice(0, -1));
|
|
@@ -88,6 +88,7 @@ const INVALID = {
|
|
|
88
88
|
|
|
89
89
|
export default definePart({
|
|
90
90
|
note: 'The SDK radio group (et-radio-group with et-radio) in flow, first drawing, drawn by the mock from @ethlete/components/design/radio-group with the real markup and CSS: et-label, et-radio in the plain and the card variant (et-selection-card), et-description, et-form-support with hint and error, the required marker, plus the color-interactive sheet; the brand theme, danger as the error theme. Fixtures are fictional: a match reminder form (Kick-off reminder: One hour before, Fifteen minutes before, At kick-off; hint We send it as a push notification.; required with error Pick a reminder to continue.; mixed hint The selected matches disagree.; card group Match report format: Short, The score and the scorers. / Full, Every event, with the line-ups.; horizontal group Show matches at: Home, Away, Neutral ground; grid label Remind me one hour before). Framed as a page with 16px padding at 360 and 640. States: a grid of unchecked and checked by rest, hover, focus-visible, active, disabled and readonly (one-option groups); group-none, group-checked, group-support (descriptions and hint), group-option-hover, group-option-pressed, group-option-focus-visible, group-mixed (bulk edit, dashed circles), group-disabled, group-readonly, invalid, invalid-focus-visible, invalid-checked, group-horizontal, card-rest, card-checked, card-hover, card-focus-visible and card-checked-focus-visible. Numbers (light / dark), from shot pixels at scale 2 at 360, brand mint, a: circle 20px with a 2px border and a 10px dot (border-box, fixed in 00072d935); unchecked circle border (surface border) vs page 1.26 / 1.73; checked ring and dot (primary) 1.33 / 13.50; checked hover dot and ring (-hover via color-interactive; the lib hover rule skips a checked radio) 1.37 / 13.06, 1.03 from rest; active 2.24 / 8.01; focus ring and focused border (primary -focus), checked or unchecked, 1.37 / 13.06; card checked edge and ring (primary) 1.33 / 13.50; mixed dashed border (primary) 1.33 / 13.50; invalid circle border (danger) 4.83 / 3.71; disabled checked ring 2.12 / 1.65, disabled label 1.41 / 1.65 (exempt under 1.4.11). Decided rules that arise: Q88 (every radio focus ring in ink, the unchecked one too, since unlike the checkbox it is primary, not the surface text colour; the invalid ring takes the danger ink; the card ring in ink), Q99a (the checked circle border, the focused circle border, the mixed dashed border and the card checked and focus edge take light-dark(ink, primary); the checked dot is a mint fill, so it takes a 1px inset ink edge, an outline at -1px) and Q101 (a checked radio hovers to -active). The ink edge on a mint fill arises, so Q102 arises: b draws the dot edge 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: no new lib CSS bug; the radio circle box-sizing bug is fixed (00072d935, measured 40 sheet px = 20px). (1) WCAG 1.4.11: the unchecked circle border is 1.26 / 1.73 vs page, under 3:1, the only edge of an unchecked radio (the same open question as the checkbox box and the switch off track). Not drawn. (2) The required marker takes the error theme primary: 3.71:1 in dark, under 4.5:1; exempted here as in checkbox r1. (3) A checked radio has no hover rule of its own; only color-interactive shifts it to -hover, 1.03 from rest, so hover on a checked radio is invisible in a; Q101 fixes it in b and c. (4) Readonly draws exactly like rest, as with the checkbox. (5) A disabled group dims its options (opacity 0.5 and the disabled label colour, both at once) but not the group label, which keeps 7.81 in light; the same holds for the checkbox group. Later rounds, left out here: the sizes sm and lg, the card with the control at start and the card slots, a coloured (non-brand) radio, the warning state, a disabled option inside an enabled group, a pending (aria-busy) group, long labels that wrap, RTL and the check animation.',
|
|
91
|
+
consumerAction: 'a form control whose value the consumer binds',
|
|
91
92
|
madeBy: ['claude-opus-5-5'],
|
|
92
93
|
states: {
|
|
93
94
|
...gridStates,
|
|
@@ -127,6 +128,47 @@ export default definePart({
|
|
|
127
128
|
'card-focus-visible': { group: formatGroup(1, ['focus-visible']) },
|
|
128
129
|
'card-checked-focus-visible': { group: formatGroup(0, ['focus-visible']) },
|
|
129
130
|
},
|
|
131
|
+
describe: {
|
|
132
|
+
unchecked: 'One unchecked radio at rest; check that the empty circle border shows next to the label.',
|
|
133
|
+
'unchecked-hover': 'The unchecked radio hovered; check that the circle border darkens.',
|
|
134
|
+
'unchecked-focus-visible':
|
|
135
|
+
'The unchecked radio focused by keyboard; check that the focus ring shows around the circle.',
|
|
136
|
+
'unchecked-active': 'The unchecked radio pressed; check that the press look shows on the circle.',
|
|
137
|
+
'unchecked-disabled': 'The unchecked radio disabled; check that circle and label fade.',
|
|
138
|
+
'unchecked-readonly': 'The unchecked radio read-only; check that it draws like rest.',
|
|
139
|
+
checked: 'One checked radio at rest; check that the primary ring and dot show.',
|
|
140
|
+
'checked-hover': 'The checked radio hovered; check that ring and dot shift visibly from rest.',
|
|
141
|
+
'checked-focus-visible':
|
|
142
|
+
'The checked radio focused by keyboard; check that the focus ring shows around the checked circle.',
|
|
143
|
+
'checked-active': 'The checked radio pressed; check that ring and dot darken.',
|
|
144
|
+
'checked-disabled': 'The checked radio disabled; check that ring, dot and label fade but stay recognisable.',
|
|
145
|
+
'checked-readonly': 'The checked radio read-only; check that it draws like the checked rest.',
|
|
146
|
+
'group-none':
|
|
147
|
+
'The three-option Kick-off reminder group with nothing picked; check the group label and even option gaps.',
|
|
148
|
+
'group-checked': 'The reminder group with One hour before picked; check that only the first option shows the dot.',
|
|
149
|
+
'group-support':
|
|
150
|
+
'A group with option descriptions and a hint; check that descriptions sit under labels and the hint below.',
|
|
151
|
+
'group-option-hover': 'The group with Fifteen minutes before hovered; check that only that circle shows hover.',
|
|
152
|
+
'group-option-pressed': 'The group with Fifteen minutes before pressed; check the press look on that circle.',
|
|
153
|
+
'group-option-focus-visible':
|
|
154
|
+
'The group with the second option picked and focused by keyboard; check the focus ring on its circle.',
|
|
155
|
+
'group-mixed': 'The group in bulk edit with mixed values; check the dashed circles and the mixed hint.',
|
|
156
|
+
'group-disabled': 'The whole group disabled; check that options fade and the group label stays.',
|
|
157
|
+
'group-readonly': 'The whole group read-only; check that it draws like the checked group.',
|
|
158
|
+
invalid: 'The required group with nothing picked and an error; check the danger circles and error text.',
|
|
159
|
+
'invalid-focus-visible':
|
|
160
|
+
'The invalid group, nothing picked, second option focused; check that the focus ring takes the danger ink.',
|
|
161
|
+
'invalid-checked': 'The invalid group with the second option picked; check that the error stays and the dot shows.',
|
|
162
|
+
'group-horizontal':
|
|
163
|
+
'The Show matches at group laid out in a row; check that options sit side by side with even gaps.',
|
|
164
|
+
'card-rest': 'Two card options with descriptions, none picked; check the card borders and the radio at the end.',
|
|
165
|
+
'card-checked': 'The Short card picked; check that its edge and ring take the checked color.',
|
|
166
|
+
'card-hover': 'The Full card picked and the Short card hovered; check that only Short shows the hover look.',
|
|
167
|
+
'card-focus-visible':
|
|
168
|
+
'The Full card picked and Short focused by keyboard; check that the focus ring wraps the whole Short card.',
|
|
169
|
+
'card-checked-focus-visible':
|
|
170
|
+
'The checked Short card focused; check that focus and checked edge both stay visible.',
|
|
171
|
+
},
|
|
130
172
|
grid: {
|
|
131
173
|
columns: COLUMNS,
|
|
132
174
|
rows: Object.fromEntries(
|
|
@@ -210,6 +210,27 @@ const render = (props: Props) => {
|
|
|
210
210
|
return scheduler({ view: props.view, headerLabel: HEADER_LABELS[props.view], addAction: true, body });
|
|
211
211
|
};
|
|
212
212
|
|
|
213
|
+
const action = (key: string) => `data-et-action="${key}"`;
|
|
214
|
+
|
|
215
|
+
const BUTTON_ACTIONS: [string, string][] = [
|
|
216
|
+
['et-scheduler-today-button', 'emit:focusedDateChange'],
|
|
217
|
+
['et-scheduler-nav-button--previous', 'emit:focusedDateChange'],
|
|
218
|
+
['et-scheduler-nav-button--next', 'emit:focusedDateChange'],
|
|
219
|
+
['et-scheduler-month-view-overflow-trigger', 'opens:components/menu'],
|
|
220
|
+
];
|
|
221
|
+
|
|
222
|
+
const declareActions = (markup: string) =>
|
|
223
|
+
BUTTON_ACTIONS.reduce(
|
|
224
|
+
(html, [name, key]) => html.replace(new RegExp(`<button ([^>]*\\b${name}\\b)`), `<button ${action(key)} $1`),
|
|
225
|
+
markup,
|
|
226
|
+
)
|
|
227
|
+
.replaceAll('<et-segmented-button value=', `<et-segmented-button ${action('emit:viewChange')} value=`)
|
|
228
|
+
.replace(/<button [^>]*class="et-scheduler-(appointment|time-grid-block)[^>]*>/g, (appointment) =>
|
|
229
|
+
appointment.includes('data-selected')
|
|
230
|
+
? appointment
|
|
231
|
+
: appointment.replace('<button ', `<button ${action('emit:selectedAppointmentIdChange')} `),
|
|
232
|
+
);
|
|
233
|
+
|
|
213
234
|
const skipClipped = (markup: string) =>
|
|
214
235
|
markup.replaceAll(
|
|
215
236
|
'class="et-scheduler-time-grid-block',
|
|
@@ -230,11 +251,23 @@ export default definePart({
|
|
|
230
251
|
'month-cell-focus-visible': { view: 'month', cell: 'focus-visible' },
|
|
231
252
|
agenda: { view: 'agenda' },
|
|
232
253
|
},
|
|
254
|
+
describe: {
|
|
255
|
+
week: 'The week of March 2 with overlapping, all-day and selected appointments; check the now line on Wednesday and the gridlines.',
|
|
256
|
+
'week-dragging': 'The week with Retro lifted half an hour; check that it shows the drag shadow and the new time.',
|
|
257
|
+
'appointment-hover': "Monday's Daily sync hovered; check that only that appointment takes the hover tint.",
|
|
258
|
+
'appointment-focus-visible': "Monday's Daily sync focused by keyboard; check that the focus ring wraps the block.",
|
|
259
|
+
'slot-focus-visible': 'The Thursday 11:00 slot focused by keyboard; check that the ring marks one hour cell.',
|
|
260
|
+
day: 'Wednesday alone in the day view; check the today column, the now line at 11:15 and the selected Design review.',
|
|
261
|
+
month: 'March 2026 in the month grid; check the dim outside-month days, the today circle and the +3 more trigger.',
|
|
262
|
+
'month-cell-focus-visible': 'The month with March 19 focused by keyboard; check that the ring wraps that one cell.',
|
|
263
|
+
agenda:
|
|
264
|
+
'The agenda from Wednesday to Friday; check the month heading, nested rows with tree guides and the selection.',
|
|
265
|
+
},
|
|
233
266
|
widths: [560, 800, 1200],
|
|
234
267
|
frame: (body) => `<div class="t-frame">${body}</div>`,
|
|
235
268
|
render: (props: Props) =>
|
|
236
269
|
drawing({
|
|
237
|
-
body: skipClipped(render(props)),
|
|
270
|
+
body: skipClipped(declareActions(render(props))),
|
|
238
271
|
styles: [schedulerStyles, frame].join('\n'),
|
|
239
272
|
}),
|
|
240
273
|
});
|
|
@@ -68,7 +68,7 @@ const render = (props: Props) => {
|
|
|
68
68
|
navigationActive: props.navigation ? active : undefined,
|
|
69
69
|
darken: props.darken,
|
|
70
70
|
itemSize: props.itemSize,
|
|
71
|
-
itemGap:
|
|
71
|
+
itemGap: GAP,
|
|
72
72
|
color: props.color,
|
|
73
73
|
endButtonAttributes: props.endButton ? `data-et-force="${props.endButton}"` : undefined,
|
|
74
74
|
containerAttributes: `data-et-skip="CLIPPED" style="--scrollable-offset: -${offset}px"`,
|
|
@@ -94,7 +94,8 @@ const render = (props: Props) => {
|
|
|
94
94
|
|
|
95
95
|
export default definePart({
|
|
96
96
|
note: 'scale of the decided shape, Q182, lead merge',
|
|
97
|
-
|
|
97
|
+
consumerAction: 'the buttons inside are content the consumer projects',
|
|
98
|
+
madeBy: ['claude-opus-5-5', 'claude-sonnet-5-5', 'design check'],
|
|
98
99
|
states: {
|
|
99
100
|
'horizontal-start': {},
|
|
100
101
|
'horizontal-middle': { position: 'middle' },
|
|
@@ -124,7 +125,62 @@ export default definePart({
|
|
|
124
125
|
]),
|
|
125
126
|
) as Record<`item-size-${ItemSize}`, Props>),
|
|
126
127
|
},
|
|
128
|
+
describe: {
|
|
129
|
+
'horizontal-start': 'Eight items scrolled to the start; check that only the end shows a mask and a scroll button.',
|
|
130
|
+
'horizontal-middle': 'The row scrolled to the middle; check that masks and buttons show at both ends.',
|
|
131
|
+
'horizontal-end': 'The row scrolled to the end; check that only the start shows a mask and a scroll button.',
|
|
132
|
+
'vertical-start': 'A vertical list at the start; check that only the bottom shows a mask and a button.',
|
|
133
|
+
'vertical-middle': 'The vertical list in the middle; check that masks and buttons show at top and bottom.',
|
|
134
|
+
'vertical-end': 'The vertical list at the end; check that only the top shows a mask and a button.',
|
|
135
|
+
'button-hover': 'The middle row with the end button hovered; check that only the end button shows hover.',
|
|
136
|
+
'button-active': 'The middle row with the end button pressed; check that the press look is deeper than hover.',
|
|
137
|
+
'border-mask': 'The middle row with the border mask; check that edges show a border line instead of a gradient.',
|
|
138
|
+
'vertical-border-mask': 'The vertical list with the border mask; check the border lines at top and bottom.',
|
|
139
|
+
'navigation-start': 'The row at the start with navigation dots; check that the first dot is active.',
|
|
140
|
+
'navigation-middle': 'The middle row with navigation dots; check that the dot of the most visible item is active.',
|
|
141
|
+
'navigation-end': 'The row at the end with navigation dots; check that the last dot is active.',
|
|
142
|
+
'vertical-navigation':
|
|
143
|
+
'The vertical list with navigation; check that the dots run along the side and one is active.',
|
|
144
|
+
'footer-buttons':
|
|
145
|
+
'The middle row with buttons in the footer; check that buttons sit beside the dots, not over items.',
|
|
146
|
+
'footer-button-hover': 'The footer end button hovered; check that only that footer button shows hover.',
|
|
147
|
+
'danger-navigation': 'The middle row with navigation in danger; check that the active dot takes the danger color.',
|
|
148
|
+
darken: 'The middle row with darken on; check that partly visible items dim and whole ones stay full.',
|
|
149
|
+
'item-focus-visible': 'Item 1 focused by keyboard; check that its focus ring is not cut by the container.',
|
|
150
|
+
'short-content': 'Two items that fit; check that no mask, button or scroll shows.',
|
|
151
|
+
'short-content-navigation': 'Two items that fit, with navigation on; check that no dots show when nothing scrolls.',
|
|
152
|
+
'item-size-same': 'Two items at the same size; check that both share the width evenly with the gap.',
|
|
153
|
+
'item-size-full': 'Items at full size; check that each item fills the viewport width.',
|
|
154
|
+
'item-size-half': 'Items at half size; check that two items fill the viewport with one gap.',
|
|
155
|
+
'item-size-third': 'Items at a third; check that three items fill the viewport with two gaps.',
|
|
156
|
+
'item-size-quarter': 'Items at a quarter; check that four items fill the viewport with three gaps.',
|
|
157
|
+
},
|
|
127
158
|
widths: [480],
|
|
159
|
+
scrolls: [
|
|
160
|
+
'horizontal-start',
|
|
161
|
+
'horizontal-middle',
|
|
162
|
+
'horizontal-end',
|
|
163
|
+
'vertical-start',
|
|
164
|
+
'vertical-middle',
|
|
165
|
+
'vertical-end',
|
|
166
|
+
'button-hover',
|
|
167
|
+
'button-active',
|
|
168
|
+
'border-mask',
|
|
169
|
+
'vertical-border-mask',
|
|
170
|
+
'navigation-start',
|
|
171
|
+
'navigation-middle',
|
|
172
|
+
'navigation-end',
|
|
173
|
+
'vertical-navigation',
|
|
174
|
+
'footer-buttons',
|
|
175
|
+
'footer-button-hover',
|
|
176
|
+
'danger-navigation',
|
|
177
|
+
'darken',
|
|
178
|
+
'item-focus-visible',
|
|
179
|
+
'item-size-full',
|
|
180
|
+
'item-size-half',
|
|
181
|
+
'item-size-third',
|
|
182
|
+
'item-size-quarter',
|
|
183
|
+
],
|
|
128
184
|
render: (props: Props) =>
|
|
129
185
|
drawing({
|
|
130
186
|
body: `<div class="scrollable-frame ${props.itemSize ? 'scrollable-frame--sized' : ''}">${render(props)}</div>`,
|
|
@@ -114,8 +114,36 @@ export default definePart({
|
|
|
114
114
|
dragging: { layout: 'vertical', scroll: 424, thumb: 'dragging' },
|
|
115
115
|
'auto-hidden': { layout: 'vertical', visible: false },
|
|
116
116
|
},
|
|
117
|
+
describe: {
|
|
118
|
+
vertical:
|
|
119
|
+
'24 rows at the top with a vertical bar; check that the thumb sits at the top of the track, inset from the edge.',
|
|
120
|
+
'vertical-scrolled': 'The rows scrolled halfway; check that the thumb sits in the middle of the track.',
|
|
121
|
+
'vertical-end': 'The rows scrolled to the end; check that the thumb meets the bottom inset.',
|
|
122
|
+
horizontal: '14 cards at the start with a horizontal bar; check that the thumb starts at the left inset.',
|
|
123
|
+
'horizontal-scrolled': 'The cards scrolled 600px; check that the thumb moved along the track to match.',
|
|
124
|
+
'both-axes': 'A grid scrolled on both axes; check that both bars show and do not overlap in the corner.',
|
|
125
|
+
rtl: 'The cards in right-to-left; check that the thumb starts at the right edge.',
|
|
126
|
+
'short-content': 'Six rows scrolled slightly; check that the thumb is long, close to the track length.',
|
|
127
|
+
'long-content': '200 rows scrolled deep; check that the thumb keeps its minimum size of 24px.',
|
|
128
|
+
'thumb-hover': 'The halfway thumb hovered; check that the thumb darkens or grows.',
|
|
129
|
+
dragging: 'The halfway thumb being dragged; check that it shows the dragging look, stronger than hover.',
|
|
130
|
+
'auto-hidden': 'The rows with the bar auto-hidden; check that no thumb or track shows.',
|
|
131
|
+
},
|
|
117
132
|
widths: [480],
|
|
118
133
|
frame: (body, props) => `<div class="scrollbar-frame"${props.layout === 'rtl' ? ' dir="rtl"' : ''}>${body}</div>`,
|
|
134
|
+
scrolls: [
|
|
135
|
+
'vertical',
|
|
136
|
+
'vertical-scrolled',
|
|
137
|
+
'horizontal',
|
|
138
|
+
'horizontal-scrolled',
|
|
139
|
+
'both-axes',
|
|
140
|
+
'rtl',
|
|
141
|
+
'short-content',
|
|
142
|
+
'long-content',
|
|
143
|
+
'thumb-hover',
|
|
144
|
+
'dragging',
|
|
145
|
+
'auto-hidden',
|
|
146
|
+
],
|
|
119
147
|
render: (props: Props) =>
|
|
120
148
|
drawing({
|
|
121
149
|
body: `<div class="scrollbar-wrapper">${render(props)}</div>`,
|
|
@@ -5,8 +5,34 @@ import { grid, moreStates, selectBody, SelectProps, states } from './shared/sele
|
|
|
5
5
|
|
|
6
6
|
export default definePart<SelectProps>({
|
|
7
7
|
note: 'scale of the decided shape, Q182, lead merge',
|
|
8
|
+
consumerAction: 'a form control whose value the consumer binds',
|
|
8
9
|
madeBy: ['claude-opus-5-5', 'claude-sonnet-5-5'],
|
|
9
10
|
states: { ...states, ...moreStates },
|
|
11
|
+
describe: {
|
|
12
|
+
placeholder:
|
|
13
|
+
'A closed select with no value; check that the placeholder reads muted and the chevron sits at the end.',
|
|
14
|
+
'placeholder-hover': 'The empty select hovered; check that the field border darkens.',
|
|
15
|
+
'placeholder-active': 'The empty select pressed; check the press look on the field frame.',
|
|
16
|
+
'placeholder-focus-visible': 'The empty select focused by keyboard; check that the focus ring wraps the field.',
|
|
17
|
+
selected: 'A closed select showing In review; check that the value uses full text color.',
|
|
18
|
+
'selected-hover': 'The filled select hovered; check that the border darkens and the value stays in place.',
|
|
19
|
+
'selected-active': 'The filled select pressed; check the press look on the field frame.',
|
|
20
|
+
'selected-focus-visible': 'The filled select focused by keyboard; check that the focus ring wraps the field.',
|
|
21
|
+
disabled: 'The filled select disabled; check that field, value and chevron fade.',
|
|
22
|
+
open: 'The select open on In review with Merged active by keyboard; check the panel under the field and the marks.',
|
|
23
|
+
'open-option-hover':
|
|
24
|
+
'The open select with Drafts under the pointer; check that the pointer highlight shows on Drafts.',
|
|
25
|
+
'size-sm': 'The filled select at size sm; check that field and text shrink together.',
|
|
26
|
+
'size-sm-hover': 'The size sm select hovered; check that the border darkens at the smaller field height.',
|
|
27
|
+
'size-sm-active': 'The size sm select pressed; check the press look on the smaller field frame.',
|
|
28
|
+
'size-sm-focus-visible':
|
|
29
|
+
'The size sm select focused by keyboard; check that the focus ring wraps the smaller field.',
|
|
30
|
+
'size-lg': 'The filled select at size lg; check that field and text grow together.',
|
|
31
|
+
'size-lg-hover': 'The size lg select hovered; check that the border darkens at the larger field height.',
|
|
32
|
+
'size-lg-active': 'The size lg select pressed; check the press look on the larger field frame.',
|
|
33
|
+
'size-lg-focus-visible':
|
|
34
|
+
'The size lg select focused by keyboard; check that the focus ring wraps the larger field.',
|
|
35
|
+
},
|
|
10
36
|
grid,
|
|
11
37
|
widths: [320],
|
|
12
38
|
controls: {
|
|
@@ -36,31 +36,23 @@ const markControl = (markup: string, { interaction, pointerActive }: SelectProps
|
|
|
36
36
|
: marked;
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
const interactive = interactionRows<SelectProps, 'placeholder' | 'selected', FieldInteraction>(
|
|
39
|
+
const interactive = interactionRows<SelectProps, 'placeholder' | 'selected' | 'size-sm' | 'size-lg', FieldInteraction>(
|
|
40
40
|
{
|
|
41
41
|
placeholder: {},
|
|
42
42
|
selected: { value: 'review' },
|
|
43
|
+
'size-sm': { value: 'review', size: 'sm' },
|
|
44
|
+
'size-lg': { value: 'review', size: 'lg' },
|
|
43
45
|
},
|
|
44
46
|
{ interactions: ['hover', 'active', 'focus-visible'], force: (props, interaction) => ({ ...props, interaction }) },
|
|
45
47
|
);
|
|
46
48
|
|
|
47
|
-
const SIZES = ['sm', 'lg'] as const;
|
|
48
|
-
|
|
49
49
|
export const states = interactive.states;
|
|
50
|
-
export const grid =
|
|
51
|
-
columns: interactive.grid.columns,
|
|
52
|
-
rows: {
|
|
53
|
-
...interactive.grid.rows,
|
|
54
|
-
...Object.fromEntries(SIZES.map((size) => [`size ${size}`, { rest: `size-${size}` as const }])),
|
|
55
|
-
},
|
|
56
|
-
};
|
|
50
|
+
export const grid = interactive.grid;
|
|
57
51
|
|
|
58
52
|
export const moreStates = {
|
|
59
53
|
disabled: { value: 'review', disabled: true },
|
|
60
54
|
open: { value: 'review', open: true, active: 'merged' },
|
|
61
55
|
'open-option-hover': { value: 'review', open: true, active: 'drafts', pointerActive: true },
|
|
62
|
-
'size-sm': { value: 'review', size: 'sm' },
|
|
63
|
-
'size-lg': { value: 'review', size: 'lg' },
|
|
64
56
|
} satisfies Record<string, SelectProps>;
|
|
65
57
|
|
|
66
58
|
export const selectBody = (props: SelectProps) =>
|
|
@@ -105,12 +105,31 @@ const { states, grid } = interactionRows(
|
|
|
105
105
|
|
|
106
106
|
export default definePart({
|
|
107
107
|
note: 'The SDK select option and open panel, shared by select, page-size-select and phone-input, drawn by the mocks from @ethlete/components/design.',
|
|
108
|
+
consumerAction: 'a form control whose value the consumer binds',
|
|
108
109
|
madeBy: ['claude-opus-5-5'],
|
|
109
110
|
states: {
|
|
110
111
|
...states,
|
|
111
112
|
'panel-grouped': { panel: true },
|
|
112
113
|
'panel-all-selected': { panel: true, allSelected: true },
|
|
113
114
|
},
|
|
115
|
+
describe: {
|
|
116
|
+
option: 'One unselected In review option in an open panel; check its padding and the empty check slot.',
|
|
117
|
+
'option-hover': 'The option hovered; check that the row takes the pointer highlight.',
|
|
118
|
+
'option-active': 'The option pressed; check that the pressed tint is deeper than hover.',
|
|
119
|
+
'option-focus-visible': 'The option active by keyboard; check that the row shows the keyboard focus look.',
|
|
120
|
+
selected: 'One selected In review option; check that the check mark and selected color show.',
|
|
121
|
+
'selected-hover': 'The selected option hovered; check that the highlight shows and the check stays visible.',
|
|
122
|
+
'selected-active': 'The selected option pressed; check that the press look keeps the check readable.',
|
|
123
|
+
'selected-focus-visible': 'The selected option active by keyboard; check that focus shows with the check mark.',
|
|
124
|
+
'disabled-hover': 'The disabled option under the pointer; check that it gives no highlight.',
|
|
125
|
+
'disabled-active': 'The disabled option pressed; check that it gives no press look.',
|
|
126
|
+
'disabled-focus-visible': 'The disabled option reached by keyboard; check that it shows no focus look.',
|
|
127
|
+
disabled: 'One disabled In review option; check that the label fades and no highlight shows.',
|
|
128
|
+
'panel-grouped':
|
|
129
|
+
'A multi-select panel with Select all and two groups; check the group labels, the mixed Select all and Merged active.',
|
|
130
|
+
'panel-all-selected':
|
|
131
|
+
'The grouped panel with all selected; check that Select all is checked and disabled Archived stays off.',
|
|
132
|
+
},
|
|
114
133
|
grid,
|
|
115
134
|
widths: [280],
|
|
116
135
|
controls: {
|
|
@@ -41,6 +41,13 @@ export default definePart({
|
|
|
41
41
|
'in-text': { form: 'in-text', animated: true },
|
|
42
42
|
static: { form: 'card', animated: false },
|
|
43
43
|
},
|
|
44
|
+
describe: {
|
|
45
|
+
card: 'An animated card skeleton with avatar, two lines and an image block; check the shimmer and the rounded image.',
|
|
46
|
+
text: 'An animated text skeleton; check that the lines vary in length like a paragraph.',
|
|
47
|
+
shapes: 'A line, a block and circles at 24, 40 and 64px; check that each shape keeps its size and radius.',
|
|
48
|
+
'in-text': 'A skeleton bar inside a sentence; check that it sits on the text line and is capped at 120px.',
|
|
49
|
+
static: 'The card skeleton without animation; check that no shimmer runs and the shapes match the animated card.',
|
|
50
|
+
},
|
|
44
51
|
widths: [480],
|
|
45
52
|
frame: (body) => `<div class="skeleton-frame">${body}</div>`,
|
|
46
53
|
render: (props: Props) =>
|
|
@@ -63,6 +63,40 @@ export default definePart({
|
|
|
63
63
|
field: { id: 'quality', label: 'Quality', value: 1, max: 2, marks: QUALITY, orientation: 'vertical' },
|
|
64
64
|
},
|
|
65
65
|
},
|
|
66
|
+
describe: {
|
|
67
|
+
min: 'Volume at 0; check that the thumb sits at the start, inside the host, and no fill shows.',
|
|
68
|
+
mid: 'Volume at 40; check that the fill runs from the start to the thumb.',
|
|
69
|
+
max: 'Volume at 100; check that the thumb sits at the end, inside the host, with a full fill.',
|
|
70
|
+
hover: 'The thumb hovered; check the hover look on the thumb.',
|
|
71
|
+
'focus-visible': 'The thumb focused by keyboard; check that the focus ring wraps the thumb.',
|
|
72
|
+
active: 'The thumb pressed; check the press look on the thumb.',
|
|
73
|
+
dragging: 'The thumb being dragged; check the dragging look on thumb and host.',
|
|
74
|
+
'value-label': 'Volume 40 with the value bubble; check that the bubble sits above the thumb clear of the label.',
|
|
75
|
+
'value-label-max':
|
|
76
|
+
'Volume 100 with the value bubble; check that the bubble clamps at the end and stays in the host.',
|
|
77
|
+
steps: 'Volume in steps of 10 with a hint; check that it looks like the plain slider with the hint below.',
|
|
78
|
+
marks: 'Volume in steps of 10 with ticks; check that a tick sits at every step and active ticks read on the fill.',
|
|
79
|
+
'labelled-marks':
|
|
80
|
+
'Quality with Low, Medium and High ticks; check that labels sit under their ticks and the ends clamp.',
|
|
81
|
+
hint: 'Volume with a hint; check that the hint sits under the track in muted text.',
|
|
82
|
+
required: 'The required volume with a hint; check that the required marker shows next to the label.',
|
|
83
|
+
invalid: 'Volume at 95 with an error; check that fill and thumb turn danger and the error text shows.',
|
|
84
|
+
'invalid-focus-visible': 'The invalid slider focused; check that the focus ring takes the danger ink.',
|
|
85
|
+
disabled: 'The slider disabled; check that rail, fill, thumb and label fade.',
|
|
86
|
+
readonly: 'The slider read-only; check how it differs from the editable slider.',
|
|
87
|
+
'readonly-focus-visible': 'The read-only slider focused by keyboard; check that a focus ring still shows.',
|
|
88
|
+
mixed: 'Volume in bulk edit with Different volumes; check the dashed rail and the mixed hint.',
|
|
89
|
+
'no-label': 'A slider with no label; check that the track keeps its height without label space.',
|
|
90
|
+
range: 'A Price range from 20 to 80; check that two thumbs show and the fill runs between them.',
|
|
91
|
+
'range-value-label': 'The range with value bubbles; check that both bubbles show and do not overlap.',
|
|
92
|
+
'range-ends': 'The range at 0 and 100 with bubbles; check that both bubbles clamp inside the host.',
|
|
93
|
+
'range-met': 'Both thumbs met at 50, the end one dragged; check that the thumbs stack cleanly.',
|
|
94
|
+
'range-focus-visible': 'The range with the end thumb focused; check that only that thumb shows a focus ring.',
|
|
95
|
+
'range-marks': 'The range 20 to 60 in steps of 20 with ticks; check the ticks and the hint below.',
|
|
96
|
+
vertical:
|
|
97
|
+
'A vertical volume slider with a bubble; check that the fill runs bottom up and the bubble clears the label.',
|
|
98
|
+
'vertical-marks': 'Vertical Quality with labelled ticks; check that labels take their own column inside the host.',
|
|
99
|
+
},
|
|
66
100
|
widths: [320, 360, 640],
|
|
67
101
|
frame: (body) => `<div class="t-frame">${body}</div>`,
|
|
68
102
|
render: (props: Props) =>
|
|
@@ -121,11 +121,26 @@ export default definePart({
|
|
|
121
121
|
'pick-dragging': { view: 'pick', dragging: true },
|
|
122
122
|
'pick-locked': { view: 'pick', locked: true },
|
|
123
123
|
},
|
|
124
|
+
describe: {
|
|
125
|
+
table:
|
|
126
|
+
'Six teams with zones, a legend and Pinewood highlighted; check the zone marks, the form dots and the numbers align.',
|
|
127
|
+
'table-plain': 'The six teams without zones, highlight or legend; check that rows read evenly with no zone marks.',
|
|
128
|
+
'table-empty': 'The table with no rows; check that the header stays and the empty body does not collapse oddly.',
|
|
129
|
+
pick: 'The pick list of six teams with two advancing; check the cut line after the second card and the point marks.',
|
|
130
|
+
'pick-card-hover': 'Harbor City hovered in the pick list; check that only that card shows the hover look.',
|
|
131
|
+
'pick-card-focus-visible': 'Harbor City focused by keyboard; check that the focus ring wraps that card.',
|
|
132
|
+
'pick-dragging':
|
|
133
|
+
'Pinewood lifted and dragged up; check the drag shadow, the ghost slot and the shifted card below.',
|
|
134
|
+
'pick-locked': 'The pick list locked; check that cards show no drag handle and read as fixed.',
|
|
135
|
+
},
|
|
124
136
|
widths: [480, 800],
|
|
125
137
|
frame: (body) => `<div class="t-frame">${body}</div>`,
|
|
126
138
|
render: (props: Props) =>
|
|
127
139
|
drawing({
|
|
128
|
-
body:
|
|
140
|
+
body:
|
|
141
|
+
props.view === 'table'
|
|
142
|
+
? table(props)
|
|
143
|
+
: pick(props).replaceAll('role="group"', 'role="group" data-et-action="emit:orderChange"'),
|
|
129
144
|
styles: [standingsStyles, frame].join('\n'),
|
|
130
145
|
}),
|
|
131
146
|
});
|
|
@@ -75,6 +75,18 @@ export default definePart({
|
|
|
75
75
|
'without-sparkline': { form: 'without-sparkline' },
|
|
76
76
|
loading: { form: 'loading' },
|
|
77
77
|
},
|
|
78
|
+
describe: {
|
|
79
|
+
default:
|
|
80
|
+
'Weekly active users 25.2K, up 6.8% and good, with a sparkline; check that the delta reads positive and the line fits.',
|
|
81
|
+
'up-bad': 'p95 latency 212 ms, up 18 and bad; check that the delta takes the danger color though it points up.',
|
|
82
|
+
'down-good': 'Churn rate 3.4%, down 2.1% and good; check that the delta reads positive though it points down.',
|
|
83
|
+
'down-unrated': 'Page views down 310 with no sentiment; check that the delta stays neutral in color.',
|
|
84
|
+
unchanged: 'Open tickets with a delta of 0; check that the neutral arrow and text show.',
|
|
85
|
+
unit: 'p95 latency 212 with the ms unit and no delta; check that the unit sits after the value, smaller.',
|
|
86
|
+
'no-value': 'Weekly active users with no value; check that a placeholder holds the value line.',
|
|
87
|
+
'without-sparkline': 'The default tile without a sparkline; check that the tile closes after the caption.',
|
|
88
|
+
loading: 'The default tile loading; check that skeletons replace value, delta and sparkline at the same size.',
|
|
89
|
+
},
|
|
78
90
|
widths: [480],
|
|
79
91
|
frame: (body) => `<div class="stat-tile-frame">${body}</div>`,
|
|
80
92
|
render: ({ form }: Props) =>
|
|
@@ -8,8 +8,17 @@ type Props = { state: StreamMockState; button?: Interaction };
|
|
|
8
8
|
|
|
9
9
|
const VIDEO = '<div class="t-video" aria-hidden="true"></div>';
|
|
10
10
|
|
|
11
|
-
const
|
|
12
|
-
|
|
11
|
+
const ACTIONS: Partial<Record<StreamMockState, string>> = {
|
|
12
|
+
consent: 'loading',
|
|
13
|
+
error: 'loading',
|
|
14
|
+
'pip-placeholder': 'player',
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const buttonAttributes = (state: StreamMockState, interaction: Interaction | undefined) =>
|
|
18
|
+
[
|
|
19
|
+
`data-et-control="action" data-et-action="${ACTIONS[state]}" data-can-animate`,
|
|
20
|
+
interaction && `data-et-force="${interaction}"`,
|
|
21
|
+
]
|
|
13
22
|
.filter(Boolean)
|
|
14
23
|
.join(' ');
|
|
15
24
|
|
|
@@ -26,6 +35,17 @@ export default definePart({
|
|
|
26
35
|
'consent-active': { state: 'consent', button: 'active' },
|
|
27
36
|
'consent-focus-visible': { state: 'consent', button: 'focus-visible' },
|
|
28
37
|
},
|
|
38
|
+
describe: {
|
|
39
|
+
player: 'The stream slot holding the player; check that the video fills the slot at its ratio.',
|
|
40
|
+
consent: 'The consent screen before the player loads; check the message and the action button, centered.',
|
|
41
|
+
loading: 'The stream slot loading; check that the spinner sits centered in the slot.',
|
|
42
|
+
error: 'The stream slot after an error; check the error message, centered in the slot.',
|
|
43
|
+
'pip-placeholder':
|
|
44
|
+
'The placeholder while the stream plays picture-in-picture; check its message in the empty slot.',
|
|
45
|
+
'consent-hover': 'The consent action hovered; check that only the button shows the hover look.',
|
|
46
|
+
'consent-active': 'The consent action pressed; check that the press look is deeper than hover.',
|
|
47
|
+
'consent-focus-visible': 'The consent action focused by keyboard; check that the focus ring wraps the button.',
|
|
48
|
+
},
|
|
29
49
|
widths: [320, 480, 720],
|
|
30
50
|
controls: {
|
|
31
51
|
action: { kind: 'button', input: ['pointer', 'keyboard'] },
|
|
@@ -36,7 +56,7 @@ export default definePart({
|
|
|
36
56
|
body: streamPlayerSlot({
|
|
37
57
|
state: props.state,
|
|
38
58
|
player: VIDEO,
|
|
39
|
-
buttonAttributes: buttonAttributes(props.button),
|
|
59
|
+
buttonAttributes: buttonAttributes(props.state, props.button),
|
|
40
60
|
}).replace('<et-spinner ', '<et-spinner data-et-skip="CLIPPED" '),
|
|
41
61
|
styles: [streamStyles, frame].join('\n'),
|
|
42
62
|
}),
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { switchControl, type SwitchMockOptions, switchStyles } from '@ethlete/components/design/switch';
|
|
2
2
|
import { definePart, drawing } from '@design-system';
|
|
3
|
-
import offTrack from './switch.css?inline';
|
|
4
3
|
|
|
5
4
|
type Interaction = 'hover' | 'focus-visible' | 'active';
|
|
6
5
|
|
|
@@ -28,6 +27,7 @@ const columns = ['rest', ...INTERACTIONS, 'disabled'] as const;
|
|
|
28
27
|
|
|
29
28
|
export default definePart({
|
|
30
29
|
note: 'The SDK switch, drawn by its mock from @ethlete/components/design: alone off, on and indeterminate in every interaction, and inside an et-choice-field with a label in each size and as a card. The label area skips CLIPPED: its 1.2 line height rounds the 12 and 16 px line box down by under a pixel, with no glyph cut.',
|
|
30
|
+
consumerAction: 'a form control whose value the consumer binds',
|
|
31
31
|
madeBy: ['claude-opus-5-5', 'claude-sonnet-5-5'],
|
|
32
32
|
states: {
|
|
33
33
|
...rowStates,
|
|
@@ -37,6 +37,28 @@ export default definePart({
|
|
|
37
37
|
'card-off': { label: 'Weekly digest', variant: 'card' },
|
|
38
38
|
'card-on': { label: 'Weekly digest', variant: 'card', checked: true },
|
|
39
39
|
},
|
|
40
|
+
describe: {
|
|
41
|
+
off: 'The switch off; check that the off track has a visible edge and the handle sits at the start.',
|
|
42
|
+
'off-hover': 'The off switch hovered; check that the track shows the hover look.',
|
|
43
|
+
'off-focus-visible': 'The off switch focused by keyboard; check that the focus ring wraps the track.',
|
|
44
|
+
'off-active': 'The off switch pressed; check the press look on the track and handle.',
|
|
45
|
+
'off-disabled': 'The off switch disabled; check that track and handle fade.',
|
|
46
|
+
on: 'The switch on; check that the track fills with the brand color and the handle sits at the end.',
|
|
47
|
+
'on-hover': 'The on switch hovered; check that the filled track shifts visibly.',
|
|
48
|
+
'on-focus-visible': 'The on switch focused by keyboard; check that the focus ring wraps the filled track.',
|
|
49
|
+
'on-active': 'The on switch pressed; check the press look on the filled track.',
|
|
50
|
+
'on-disabled': 'The on switch disabled; check that it fades but still reads as on.',
|
|
51
|
+
indeterminate: 'The switch indeterminate; check that the handle sits in the middle.',
|
|
52
|
+
'indeterminate-hover': 'The indeterminate switch hovered; check the hover look on the track.',
|
|
53
|
+
'indeterminate-focus-visible': 'The indeterminate switch focused by keyboard; check that the focus ring shows.',
|
|
54
|
+
'indeterminate-active': 'The indeterminate switch pressed; check the press look on the track.',
|
|
55
|
+
'indeterminate-disabled': 'The indeterminate switch disabled; check that it fades and the handle stays centered.',
|
|
56
|
+
'label-sm': 'An on switch with a label at size sm; check that switch and label shrink and stay aligned.',
|
|
57
|
+
'label-md': 'An on switch with a label at size md; check that the label centers on the switch.',
|
|
58
|
+
'label-lg': 'An on switch with a label at size lg; check that switch and label grow and stay aligned.',
|
|
59
|
+
'card-off': 'The Weekly digest card with the switch off; check the card border and the switch inside.',
|
|
60
|
+
'card-on': 'The Weekly digest card with the switch on; check that the card takes the checked look.',
|
|
61
|
+
},
|
|
40
62
|
grid: {
|
|
41
63
|
columns,
|
|
42
64
|
rows: Object.fromEntries(
|
|
@@ -54,10 +76,16 @@ export default definePart({
|
|
|
54
76
|
body: switchControl({
|
|
55
77
|
...options,
|
|
56
78
|
color: 'brand',
|
|
57
|
-
attributes: [
|
|
79
|
+
attributes: [
|
|
80
|
+
options.attributes,
|
|
81
|
+
options.label === undefined && 'data-et-control="switch"',
|
|
82
|
+
interaction && `data-et-force="${interaction}"`,
|
|
83
|
+
]
|
|
58
84
|
.filter(Boolean)
|
|
59
85
|
.join(' '),
|
|
60
|
-
})
|
|
61
|
-
|
|
86
|
+
})
|
|
87
|
+
.replace('<et-choice-field ', '<et-choice-field data-et-control="switch" ')
|
|
88
|
+
.replace('class="et-choice-field-label-area', 'data-et-skip="CLIPPED" class="et-choice-field-label-area'),
|
|
89
|
+
styles: switchStyles,
|
|
62
90
|
}),
|
|
63
91
|
});
|