Skip to content

Commit 628134b

Browse files
committed
awsui-screenreader-text
1 parent 1a507e9 commit 628134b

File tree

7 files changed

+40
-13
lines changed

7 files changed

+40
-13
lines changed

src/__integ__/__snapshots__/themes.test.ts.snap

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,8 @@ exports[`CSS Custom Properties match previous snapshot for mode "compact" 1`] =
510510
"motion-duration-avatar-gen-ai-gradient": "3600ms",
511511
"motion-duration-avatar-loading-dots": "1200ms",
512512
"motion-duration-complex": "270ms",
513+
"motion-duration-expand-toggle": "135ms",
514+
"motion-duration-expandable-section": "180ms",
513515
"motion-duration-expressive": "180ms",
514516
"motion-duration-extra-slow": "270ms",
515517
"motion-duration-fast": "90ms",
@@ -528,6 +530,8 @@ exports[`CSS Custom Properties match previous snapshot for mode "compact" 1`] =
528530
"motion-duration-transition-show-quick": "90ms",
529531
"motion-easing-avatar-gen-ai-gradient": "cubic-bezier(0.7, 0, 0.3, 1)",
530532
"motion-easing-ease-out-quart": "cubic-bezier(0.165, 0.84, 0.44, 1)",
533+
"motion-easing-expand-toggle": "cubic-bezier(0.165, 0.84, 0.44, 1)",
534+
"motion-easing-expandable-section": "ease-out",
531535
"motion-easing-expressive": "ease-out",
532536
"motion-easing-refresh-only-a": "cubic-bezier(0, 0, 0, 1)",
533537
"motion-easing-refresh-only-b": "cubic-bezier(1, 0, 0.83, 1)",
@@ -1175,6 +1179,8 @@ exports[`CSS Custom Properties match previous snapshot for mode "dark" 1`] = `
11751179
"motion-duration-avatar-gen-ai-gradient": "3600ms",
11761180
"motion-duration-avatar-loading-dots": "1200ms",
11771181
"motion-duration-complex": "270ms",
1182+
"motion-duration-expand-toggle": "135ms",
1183+
"motion-duration-expandable-section": "180ms",
11781184
"motion-duration-expressive": "180ms",
11791185
"motion-duration-extra-slow": "270ms",
11801186
"motion-duration-fast": "90ms",
@@ -1193,6 +1199,8 @@ exports[`CSS Custom Properties match previous snapshot for mode "dark" 1`] = `
11931199
"motion-duration-transition-show-quick": "90ms",
11941200
"motion-easing-avatar-gen-ai-gradient": "cubic-bezier(0.7, 0, 0.3, 1)",
11951201
"motion-easing-ease-out-quart": "cubic-bezier(0.165, 0.84, 0.44, 1)",
1202+
"motion-easing-expand-toggle": "cubic-bezier(0.165, 0.84, 0.44, 1)",
1203+
"motion-easing-expandable-section": "ease-out",
11961204
"motion-easing-expressive": "ease-out",
11971205
"motion-easing-refresh-only-a": "cubic-bezier(0, 0, 0, 1)",
11981206
"motion-easing-refresh-only-b": "cubic-bezier(1, 0, 0.83, 1)",
@@ -1840,6 +1848,8 @@ exports[`CSS Custom Properties match previous snapshot for mode "light" 1`] = `
18401848
"motion-duration-avatar-gen-ai-gradient": "3600ms",
18411849
"motion-duration-avatar-loading-dots": "1200ms",
18421850
"motion-duration-complex": "270ms",
1851+
"motion-duration-expand-toggle": "135ms",
1852+
"motion-duration-expandable-section": "180ms",
18431853
"motion-duration-expressive": "180ms",
18441854
"motion-duration-extra-slow": "270ms",
18451855
"motion-duration-fast": "90ms",
@@ -1858,6 +1868,8 @@ exports[`CSS Custom Properties match previous snapshot for mode "light" 1`] = `
18581868
"motion-duration-transition-show-quick": "90ms",
18591869
"motion-easing-avatar-gen-ai-gradient": "cubic-bezier(0.7, 0, 0.3, 1)",
18601870
"motion-easing-ease-out-quart": "cubic-bezier(0.165, 0.84, 0.44, 1)",
1871+
"motion-easing-expand-toggle": "cubic-bezier(0.165, 0.84, 0.44, 1)",
1872+
"motion-easing-expandable-section": "ease-out",
18611873
"motion-easing-expressive": "ease-out",
18621874
"motion-easing-refresh-only-a": "cubic-bezier(0, 0, 0, 1)",
18631875
"motion-easing-refresh-only-b": "cubic-bezier(1, 0, 0.83, 1)",
@@ -2505,6 +2517,8 @@ exports[`CSS Custom Properties match previous snapshot for mode "reduced-motion"
25052517
"motion-duration-avatar-gen-ai-gradient": "0ms",
25062518
"motion-duration-avatar-loading-dots": "0ms",
25072519
"motion-duration-complex": "0ms",
2520+
"motion-duration-expand-toggle": "0ms",
2521+
"motion-duration-expandable-section": "0ms",
25082522
"motion-duration-expressive": "0ms",
25092523
"motion-duration-extra-slow": "0ms",
25102524
"motion-duration-fast": "0ms",
@@ -2523,6 +2537,8 @@ exports[`CSS Custom Properties match previous snapshot for mode "reduced-motion"
25232537
"motion-duration-transition-show-quick": "0ms",
25242538
"motion-easing-avatar-gen-ai-gradient": "cubic-bezier(0.7, 0, 0.3, 1)",
25252539
"motion-easing-ease-out-quart": "cubic-bezier(0.165, 0.84, 0.44, 1)",
2540+
"motion-easing-expand-toggle": "cubic-bezier(0.165, 0.84, 0.44, 1)",
2541+
"motion-easing-expandable-section": "ease-out",
25262542
"motion-easing-expressive": "ease-out",
25272543
"motion-easing-refresh-only-a": "cubic-bezier(0, 0, 0, 1)",
25282544
"motion-easing-refresh-only-b": "cubic-bezier(1, 0, 0.83, 1)",
@@ -3170,6 +3186,8 @@ exports[`CSS Custom Properties match previous snapshot for mode "visual-refresh"
31703186
"motion-duration-avatar-gen-ai-gradient": "3600ms",
31713187
"motion-duration-avatar-loading-dots": "1200ms",
31723188
"motion-duration-complex": "250ms",
3189+
"motion-duration-expand-toggle": "135ms",
3190+
"motion-duration-expandable-section": "180ms",
31733191
"motion-duration-expressive": "165ms",
31743192
"motion-duration-extra-slow": "270ms",
31753193
"motion-duration-fast": "90ms",
@@ -3188,6 +3206,8 @@ exports[`CSS Custom Properties match previous snapshot for mode "visual-refresh"
31883206
"motion-duration-transition-show-quick": "90ms",
31893207
"motion-easing-avatar-gen-ai-gradient": "cubic-bezier(0.7, 0, 0.3, 1)",
31903208
"motion-easing-ease-out-quart": "cubic-bezier(0.165, 0.84, 0.44, 1)",
3209+
"motion-easing-expand-toggle": "cubic-bezier(0.165, 0.84, 0.44, 1)",
3210+
"motion-easing-expandable-section": "ease-out",
31913211
"motion-easing-expressive": "cubic-bezier(0.84, 0, 0.16, 1)",
31923212
"motion-easing-refresh-only-a": "cubic-bezier(0, 0, 0, 1)",
31933213
"motion-easing-refresh-only-b": "cubic-bezier(1, 0, 0.83, 1)",
@@ -3835,6 +3855,8 @@ exports[`CSS Custom Properties match previous snapshot for mode "visual-refresh-
38353855
"motion-duration-avatar-gen-ai-gradient": "3600ms",
38363856
"motion-duration-avatar-loading-dots": "1200ms",
38373857
"motion-duration-complex": "250ms",
3858+
"motion-duration-expand-toggle": "135ms",
3859+
"motion-duration-expandable-section": "180ms",
38383860
"motion-duration-expressive": "165ms",
38393861
"motion-duration-extra-slow": "270ms",
38403862
"motion-duration-fast": "90ms",
@@ -3853,6 +3875,8 @@ exports[`CSS Custom Properties match previous snapshot for mode "visual-refresh-
38533875
"motion-duration-transition-show-quick": "90ms",
38543876
"motion-easing-avatar-gen-ai-gradient": "cubic-bezier(0.7, 0, 0.3, 1)",
38553877
"motion-easing-ease-out-quart": "cubic-bezier(0.165, 0.84, 0.44, 1)",
3878+
"motion-easing-expand-toggle": "cubic-bezier(0.165, 0.84, 0.44, 1)",
3879+
"motion-easing-expandable-section": "ease-out",
38563880
"motion-easing-expressive": "cubic-bezier(0.84, 0, 0.16, 1)",
38573881
"motion-easing-refresh-only-a": "cubic-bezier(0, 0, 0, 1)",
38583882
"motion-easing-refresh-only-b": "cubic-bezier(1, 0, 0.83, 1)",
@@ -4500,6 +4524,8 @@ exports[`CSS Custom Properties match previous snapshot for mode "visual-refresh-
45004524
"motion-duration-avatar-gen-ai-gradient": "3600ms",
45014525
"motion-duration-avatar-loading-dots": "1200ms",
45024526
"motion-duration-complex": "250ms",
4527+
"motion-duration-expand-toggle": "135ms",
4528+
"motion-duration-expandable-section": "180ms",
45034529
"motion-duration-expressive": "165ms",
45044530
"motion-duration-extra-slow": "270ms",
45054531
"motion-duration-fast": "90ms",
@@ -4518,6 +4544,8 @@ exports[`CSS Custom Properties match previous snapshot for mode "visual-refresh-
45184544
"motion-duration-transition-show-quick": "90ms",
45194545
"motion-easing-avatar-gen-ai-gradient": "cubic-bezier(0.7, 0, 0.3, 1)",
45204546
"motion-easing-ease-out-quart": "cubic-bezier(0.165, 0.84, 0.44, 1)",
4547+
"motion-easing-expand-toggle": "cubic-bezier(0.165, 0.84, 0.44, 1)",
4548+
"motion-easing-expandable-section": "ease-out",
45214549
"motion-easing-expressive": "cubic-bezier(0.84, 0, 0.16, 1)",
45224550
"motion-easing-refresh-only-a": "cubic-bezier(0, 0, 0, 1)",
45234551
"motion-easing-refresh-only-b": "cubic-bezier(1, 0, 0.83, 1)",
@@ -5165,6 +5193,8 @@ exports[`CSS Custom Properties match previous snapshot for mode "visual-refresh-
51655193
"motion-duration-avatar-gen-ai-gradient": "3600ms",
51665194
"motion-duration-avatar-loading-dots": "1200ms",
51675195
"motion-duration-complex": "250ms",
5196+
"motion-duration-expand-toggle": "135ms",
5197+
"motion-duration-expandable-section": "180ms",
51685198
"motion-duration-expressive": "165ms",
51695199
"motion-duration-extra-slow": "270ms",
51705200
"motion-duration-fast": "90ms",
@@ -5183,6 +5213,8 @@ exports[`CSS Custom Properties match previous snapshot for mode "visual-refresh-
51835213
"motion-duration-transition-show-quick": "90ms",
51845214
"motion-easing-avatar-gen-ai-gradient": "cubic-bezier(0.7, 0, 0.3, 1)",
51855215
"motion-easing-ease-out-quart": "cubic-bezier(0.165, 0.84, 0.44, 1)",
5216+
"motion-easing-expand-toggle": "cubic-bezier(0.165, 0.84, 0.44, 1)",
5217+
"motion-easing-expandable-section": "ease-out",
51865218
"motion-easing-expressive": "cubic-bezier(0.84, 0, 0.16, 1)",
51875219
"motion-easing-refresh-only-a": "cubic-bezier(0, 0, 0, 1)",
51885220
"motion-easing-refresh-only-b": "cubic-bezier(1, 0, 0.83, 1)",

src/__tests__/snapshot-tests/__snapshots__/test-utils-selectors.test.tsx.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ exports[`test-utils selectors 1`] = `
349349
"awsui_application_1fcus",
350350
"awsui_axis-label--x_f0fot",
351351
"awsui_axis-label--y_f0fot",
352+
"awsui_body_dgs8z",
352353
"awsui_button-trigger_18eso",
353354
"awsui_button_m5h9f",
354355
"awsui_chart-filter_1px7g",
@@ -359,8 +360,10 @@ exports[`test-utils selectors 1`] = `
359360
"awsui_dropdown_qwoo0",
360361
"awsui_filter-container_z5mul",
361362
"awsui_filtering-match-highlight_1p2cx",
363+
"awsui_footer_dgs8z",
362364
"awsui_handle_sdha6",
363365
"awsui_has-background_15o6u",
366+
"awsui_header_dgs8z",
364367
"awsui_highlighted_15o6u",
365368
"awsui_inner-list-item_10ipo",
366369
"awsui_key_10ipo",

src/expandable-section/internal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export default function InternalExpandableSection({
109109
<ExpandableSectionHeader
110110
id={triggerControlId}
111111
descriptionId={descriptionId}
112-
className={clsx(styles.header, styles[`header-${baseVariant}`])}
112+
className={clsx(styles.header, styles[`header-${baseVariant}`], 'awsui-screenreader-text')}
113113
variant={baseVariant}
114114
expanded={!!expanded}
115115
header={header}

src/internal/components/chart-popover/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ function ChartPopover(
141141
<PopoverBody
142142
dismissButton={dismissButton}
143143
dismissAriaLabel={dismissAriaLabel}
144-
header={<div className={testClasses.header}>{title}</div>}
144+
header={<span className={testClasses.header}>{title}</span>}
145145
onDismiss={onDismiss}
146146
overflowVisible="content"
147147
className={styles['popover-body']}

src/internal/components/chart-series-details/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ function SubItems({
123123
className={clsx(
124124
styles['inner-list-item'],
125125
styles['key-value-pair'],
126-
(expanded || !expandable) && styles.announced
126+
(expanded || !expandable) && 'awsui-screenreader-text'
127127
)}
128128
>
129129
<span className={styles.key}>{key}</span>
@@ -168,7 +168,7 @@ function ExpandableSeries({
168168
function NonExpandableSeries({ itemKey, value, subItems, markerType, color }: ListItemProps) {
169169
return (
170170
<>
171-
<div className={clsx(styles['key-value-pair'], styles.announced)}>
171+
<div className={clsx(styles['key-value-pair'], 'awsui-screenreader-text')}>
172172
<div className={styles.key}>
173173
{markerType && color && <ChartSeriesMarker type={markerType} color={color} />}
174174
<span>{itemKey}</span>

src/internal/components/chart-series-details/series-details-text.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
3-
import expandabeleSectionHeaderStyles from '../../../expandable-section/styles.css.js';
4-
import styles from './styles.css.js';
53

64
export default function getSeriesDetailsText(element: HTMLElement) {
7-
const elementsWithText = Array.from(
8-
element.querySelectorAll(`.${styles.announced},.${expandabeleSectionHeaderStyles.header}`)
9-
);
5+
const elementsWithText = Array.from(element.querySelectorAll('awsui-screenreader-text'));
106
return elementsWithText
117
.map(element => {
128
if (element instanceof HTMLElement) {

src/internal/components/chart-series-details/styles.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,3 @@ $font-weight-bold: awsui.$font-weight-heading-s;
8888
.full-width {
8989
inline-size: 100%;
9090
}
91-
92-
.announced {
93-
/* Used by getSeriesDetailText to select text to be announced by screen readers */
94-
}

0 commit comments

Comments
 (0)