Skip to content

Commit 88f45e8

Browse files
Merge branch 'main' of github.com:aws-amplify/docs
2 parents e08f3df + 3a21b61 commit 88f45e8

File tree

95 files changed

+2138
-541
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+2138
-541
lines changed

Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ let mut a = String::from("a");
175175
Videos can be added using the `<Video />` component and referencing a path to the video file. The video should be an `.mp4` file and should exist in the `/public` directory
176176

177177
```jsx
178-
<Video src="/path/to/video.mp4" />
178+
<Video src="/path/to/video.mp4" description="Video - [video description]" />
179179
```
180180

181181
## Accessibility testing

cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,6 +1396,7 @@
13961396
"validationData",
13971397
"vanillajs",
13981398
"varchar",
1399+
"vendedlogs",
13991400
"verify.js",
14001401
"VerifyAuthChallengeResponse",
14011402
"VeriSign",

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"@types/react": "^18.0.0",
4343
"@types/url-parse": "^1.4.3",
4444
"@typescript-eslint/eslint-plugin": "^6.13.1",
45-
"axios": "^1.3.4",
45+
"axios": "^1.7.4",
4646
"cheerio": "^1.0.0-rc.12",
4747
"classnames": "^2.3.2",
4848
"cross-env": "^7.0.3",
@@ -89,7 +89,7 @@
8989
"loader-utils": "2.0.4",
9090
"minimatch": "3.1.2",
9191
"decode-uri-component": "0.2.1",
92-
"fast-xml-parser": "4.2.5",
92+
"**/fast-xml-parser": "4.4.1",
9393
"semver": "7.5.2",
9494
"tough-cookie": "4.1.3",
9595
"aws-cdk-lib": "2.80.0",
3.75 KB
Loading
643 KB
Binary file not shown.
994 KB
Binary file not shown.
1.5 MB
Binary file not shown.

src/components/Accordion/Accordion.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,12 @@ export const Accordion: React.FC<AccordionProps> = ({
6969

7070
const closeAccordion = () => {
7171
const details = detailsRef.current;
72+
const summary = summaryRef.current;
7273
if (details) {
7374
const scrollToLoc = details.offsetTop - 48 - 70 - 10; // account for nav heights and 10px buffer
7475
setDetailsOpen(false);
7576
details.animate(collapse, animationTiming);
77+
summary?.focus();
7678
window.scrollTo({
7779
left: 0,
7880
top: scrollToLoc,

src/components/Accordion/__tests__/Accordion.test.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,13 @@ describe('Accordion', () => {
6565
});
6666
});
6767

68-
it('should collapse Accordion when close button is clicked', async () => {
68+
it('should collapse Accordion and refocus on Accordion element when close button is clicked', async () => {
6969
render(component);
7070
const accordionHeading = screen.getByText('Accordion component example');
7171
userEvent.click(accordionHeading);
7272
const detailsEl = await screen.getByRole('group');
73+
const summaryEl = detailsEl.firstChild;
74+
7375
expect(detailsEl).toHaveAttribute('open');
7476

7577
const text = await screen.getByText(content);
@@ -79,6 +81,7 @@ describe('Accordion', () => {
7981
await waitFor(() => {
8082
expect(text).not.toBeVisible();
8183
expect(detailsEl).not.toHaveAttribute('open');
84+
expect(summaryEl).toHaveFocus();
8285
});
8386
});
8487

src/components/Callout/Callout.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,21 @@ import { Message, View } from '@aws-amplify/ui-react';
33
interface CalloutProps {
44
info?: boolean;
55
warning?: boolean;
6+
backgroundColor?: string;
67
children?: React.ReactNode;
78
}
89

9-
export const Callout = ({ warning, children }: CalloutProps) => {
10+
export const Callout = ({
11+
warning,
12+
backgroundColor,
13+
children
14+
}: CalloutProps) => {
1015
return (
11-
<Message variation="filled" colorTheme={warning ? 'warning' : 'info'}>
16+
<Message
17+
variation="filled"
18+
colorTheme={warning ? 'warning' : 'info'}
19+
backgroundColor={backgroundColor}
20+
>
1221
<View>{children}</View>
1322
</Message>
1423
);

0 commit comments

Comments
 (0)