Skip to content

Commit

Permalink
Merge branch 'main' into remove-scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahgm committed Nov 24, 2022
2 parents 6fe1cb8 + 473ae72 commit 15a1fb3
Show file tree
Hide file tree
Showing 10 changed files with 652 additions and 637 deletions.
5 changes: 5 additions & 0 deletions .changeset/lazy-buckets-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@marigold/components": patch
---

chore(deps): update react-aria
4 changes: 2 additions & 2 deletions config/eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
},
"peerDependencies": {
"eslint": "8.x.x",
"typescript": "4.8.x"
"typescript": "4.8.x || 4.9.x"
},
"devDependencies": {
"eslint": "8.26.0",
"typescript": "4.8.4"
"typescript": "4.9.3"
}
}
2 changes: 1 addition & 1 deletion config/jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@
"devDependencies": {
"jest": "29.3.1",
"react": "18.2.0",
"typescript": "4.8.4"
"typescript": "4.9.3"
}
}
4 changes: 2 additions & 2 deletions config/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@
"devDependencies": {
"react": "18.2.0",
"react-dom": "18.2.0",
"typescript": "4.8.4"
"typescript": "4.9.3"
},
"peerDependencies": {
"@storybook/react": "6.5.13",
"react": "18.x",
"react-dom": "18.x",
"typescript": "4.8.4"
"typescript": "4.9.3"
},
"scripts": {
"start": "start-storybook -p 1337 -c .",
Expand Down
6 changes: 3 additions & 3 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
"@marigold/types": "workspace:*",
"@mdx-js/loader": "2.1.5",
"@mdx-js/react": "1.6.22",
"@next/mdx": "12.3.1",
"@next/mdx": "12.3.3",
"estree-util-visit": "1.2.0",
"fs-extra": "10.1.0",
"globby": "13.1.2",
"mdast-util-from-markdown": "1.2.0",
"mdast-util-mdx": "2.0.0",
"mdast-util-toc": "6.1.0",
"micromark-extension-mdxjs": "1.0.0",
"next": "12.3.1",
"next": "12.3.3",
"prism-react-renderer": "1.3.5",
"react": "18.2.0",
"react-dom": "18.2.0",
Expand All @@ -49,6 +49,6 @@
"@types/mdx-js__react": "1.5.5",
"@types/node": "18.0.0",
"@types/react": "18.0.25",
"typescript": "4.8.4"
"typescript": "4.9.3"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"engines": {
"node": ">=16.x"
},
"packageManager": "pnpm@7.14.0",
"packageManager": "pnpm@7.16.0",
"dependencies": {
"@babel/core": "7.20.2",
"@changesets/changelog-github": "0.4.7",
Expand Down
82 changes: 41 additions & 41 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,48 +27,48 @@
"@marigold/system": "workspace:*",
"@marigold/tokens": "workspace:*",
"@marigold/types": "workspace:*",
"@react-aria/button": "3.6.2",
"@react-aria/checkbox": "3.6.0",
"@react-aria/dialog": "3.4.0",
"@react-aria/focus": "3.9.0",
"@react-aria/i18n": "3.6.1",
"@react-aria/interactions": "3.12.0",
"@react-aria/link": "3.3.4",
"@react-aria/listbox": "3.7.0",
"@react-aria/menu": "3.6.2",
"@react-aria/numberfield": "3.3.2",
"@react-aria/overlays": "3.11.0",
"@react-aria/radio": "3.4.0",
"@react-aria/select": "3.8.2",
"@react-aria/separator": "3.2.4",
"@react-aria/slider": "3.2.2",
"@react-aria/ssr": "3.3.0",
"@react-aria/switch": "3.2.4",
"@react-aria/table": "3.5.0",
"@react-aria/textfield": "3.7.2",
"@react-aria/tooltip": "3.3.2",
"@react-aria/utils": "3.14.0",
"@react-aria/visually-hidden": "3.5.0",
"@react-stately/checkbox": "3.3.0",
"@react-stately/collections": "3.4.4",
"@react-aria/button": "3.6.3",
"@react-aria/checkbox": "3.7.0",
"@react-aria/dialog": "3.4.1",
"@react-aria/focus": "3.10.0",
"@react-aria/i18n": "3.6.2",
"@react-aria/interactions": "3.13.0",
"@react-aria/link": "3.3.5",
"@react-aria/listbox": "3.7.1",
"@react-aria/menu": "3.7.0",
"@react-aria/numberfield": "3.3.3",
"@react-aria/overlays": "3.12.0",
"@react-aria/radio": "3.4.1",
"@react-aria/select": "3.8.3",
"@react-aria/separator": "3.2.5",
"@react-aria/slider": "3.2.3",
"@react-aria/ssr": "3.4.0",
"@react-aria/switch": "3.3.0",
"@react-aria/table": "3.6.0",
"@react-aria/textfield": "3.8.0",
"@react-aria/tooltip": "3.3.3",
"@react-aria/utils": "3.14.1",
"@react-aria/visually-hidden": "3.6.0",
"@react-stately/checkbox": "3.3.1",
"@react-stately/collections": "3.5.0",
"@react-stately/data": "^3.6.0",
"@react-stately/list": "3.5.4",
"@react-stately/menu": "3.4.2",
"@react-stately/numberfield": "3.2.2",
"@react-stately/overlays": "3.4.2",
"@react-stately/radio": "3.6.0",
"@react-stately/select": "3.3.2",
"@react-stately/slider": "3.2.2",
"@react-stately/table": "3.5.0",
"@react-stately/toggle": "3.4.2",
"@react-stately/tooltip": "3.2.2",
"@react-stately/tree": "3.3.4",
"@react-types/checkbox": "3.4.0",
"@react-types/dialog": "3.4.4",
"@react-types/numberfield": "3.3.4",
"@react-types/radio": "3.3.0",
"@react-types/shared": "3.15.0",
"@react-types/tooltip": "3.2.4",
"@react-stately/list": "3.6.0",
"@react-stately/menu": "3.4.3",
"@react-stately/numberfield": "3.3.0",
"@react-stately/overlays": "3.4.3",
"@react-stately/radio": "3.6.1",
"@react-stately/select": "3.3.3",
"@react-stately/slider": "3.2.3",
"@react-stately/table": "3.6.0",
"@react-stately/toggle": "3.4.3",
"@react-stately/tooltip": "3.2.3",
"@react-stately/tree": "3.4.0",
"@react-types/checkbox": "3.4.1",
"@react-types/dialog": "3.4.5",
"@react-types/numberfield": "3.3.5",
"@react-types/radio": "3.3.1",
"@react-types/shared": "3.16.0",
"@react-types/tooltip": "3.2.5",
"deepmerge": "^4.2.2",
"react-is": "18.2.0"
},
Expand Down
5 changes: 3 additions & 2 deletions packages/components/src/Checkbox/Checkbox.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,9 @@ test('support default checked', () => {
</Checkbox>
</ThemeProvider>
);
const input = screen.getByTestId('checkbox');
expect(input).toHaveAttribute('aria-checked', 'true');

const input: HTMLInputElement = screen.getByTestId('checkbox');
expect(input.checked).toBeTruthy();

// Visible checkbox looks checked
const checkbox = getVisibleCheckbox();
Expand Down
18 changes: 9 additions & 9 deletions packages/components/src/Switch/Switch.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const getSwitchParts = () => {
// eslint-disable-next-line testing-library/no-node-access
const thumb = track.lastChild!;

const input = screen.getByRole('switch');
const input: HTMLInputElement = screen.getByRole('switch');

return { label, input, container, track, thumb };
};
Expand Down Expand Up @@ -175,11 +175,11 @@ test('toggle switch per click', () => {

fireEvent.click(input);
expect(track).toHaveStyle(`background-color: orange`);
expect(input).toHaveAttribute('aria-checked', 'true');
expect(input.checked).toBeTruthy();

fireEvent.click(input);
expect(track).toHaveStyle(`background-color: blue`);
expect(input).toHaveAttribute('aria-checked', 'false');
expect(input.checked).toBeFalsy();
});

test('focus element and toggle switch per keyboard space', async () => {
Expand All @@ -198,13 +198,13 @@ test('focus element and toggle switch per keyboard space', async () => {
// eslint-disable-next-line testing-library/await-async-utils
waitFor(() => expect(track).toHaveStyle(`background-color: orange`));
// eslint-disable-next-line testing-library/await-async-utils
waitFor(() => expect(input).toHaveAttribute('aria-checked', 'true'));
waitFor(() => expect(input.checked).toBeTruthy());

user.keyboard('{space}');
// eslint-disable-next-line testing-library/await-async-utils
waitFor(() => expect(track).toHaveStyle(`background-color: blue`));
// eslint-disable-next-line testing-library/await-async-utils
waitFor(() => expect(input).toHaveAttribute('aria-checked', 'false'));
waitFor(() => expect(input.checked).toBeFalsy());
});

test('supports default checked', () => {
Expand All @@ -216,9 +216,9 @@ test('supports default checked', () => {

const { input } = getSwitchParts();

expect(input).toHaveAttribute('aria-checked', 'true');
expect(input.checked).toBeTruthy();
fireEvent.click(input);
expect(input).toHaveAttribute('aria-checked', 'false');
expect(input.checked).toBeFalsy();
});

test('supports controlled component usage', () => {
Expand All @@ -233,11 +233,11 @@ test('supports controlled component usage', () => {

fireEvent.click(input);
expect(onChange).toHaveBeenCalledWith(true);
expect(input).toHaveAttribute('aria-checked', 'true');
expect(input.checked).toBeTruthy();

fireEvent.click(input);
expect(onChange).toHaveBeenCalledWith(false);
expect(input).toHaveAttribute('aria-checked', 'false');
expect(input.checked).toBeFalsy();
});

test('forwards ref', () => {
Expand Down
Loading

0 comments on commit 15a1fb3

Please sign in to comment.