-
Notifications
You must be signed in to change notification settings - Fork 561
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
224 changed files
with
7,433 additions
and
6,351 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"buildCommand": "build", | ||
"sandboxes": ["/.codesandbox/templates/reach-ui"] | ||
"sandboxes": ["/.codesandbox/templates/reach-ui"], | ||
"node": "14" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
yarn pretty-quick --staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1 @@ | ||
import { configure } from "@storybook/react"; | ||
import "./styles.css"; | ||
|
||
configure(() => { | ||
const req = require.context( | ||
"../packages", | ||
true, | ||
/^((?!node_modules).)*\.example\.(js|ts|tsx)$/ | ||
); | ||
|
||
let allExports = {}; | ||
for (let pathToExample of req.keys()) { | ||
let { Comp, default: defaultExport } = req(pathToExample); | ||
|
||
if (!Comp || !defaultExport) { | ||
continue; | ||
} | ||
|
||
let { name } = Comp.story; | ||
let { title } = defaultExport; | ||
|
||
allExports[title] = { | ||
...(allExports[title] || {}), | ||
default: { title }, | ||
[name]: Comp, | ||
}; | ||
} | ||
|
||
return Object.keys(allExports).reduce((prev, cur) => { | ||
return [...prev, allExports[cur]]; | ||
}, []); | ||
}, module); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import * as React from "react"; | ||
import { render, fireEvent } from "$test/utils"; | ||
import { axe } from "jest-axe"; | ||
import { | ||
Accordion, | ||
AccordionItem, | ||
AccordionButton, | ||
AccordionPanel, | ||
} from "@reach/accordion"; | ||
|
||
describe("<Accordion /> with axe", () => { | ||
it("Should not have ARIA violations", async () => { | ||
jest.useRealTimers(); | ||
let { getByText, container } = render( | ||
<Accordion data-testid="wrapper"> | ||
<AccordionItem data-testid="item1"> | ||
<AccordionButton>Button One</AccordionButton> | ||
<AccordionPanel>Panel One</AccordionPanel> | ||
</AccordionItem> | ||
<AccordionItem data-testid="item2"> | ||
<AccordionButton>Button Two</AccordionButton> | ||
<AccordionPanel>Panel Two</AccordionPanel> | ||
</AccordionItem> | ||
<AccordionItem data-testid="item3"> | ||
<AccordionButton>Button Three</AccordionButton> | ||
<AccordionPanel>Panel Three</AccordionPanel> | ||
</AccordionItem> | ||
</Accordion> | ||
); | ||
|
||
let results = await axe(container); | ||
|
||
expect(results).toHaveNoViolations(); | ||
|
||
// Toggle to another panel and check again | ||
fireEvent.click(getByText("Button Two")); | ||
results = await axe(container); | ||
expect(results).toHaveNoViolations(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.