Skip to content

Commit b7224ed

Browse files
authored
Merge pull request #1740 from chanzuckerberg/release-v13.1.1
### [13.1.1](v13.1.0...v13.1.1) (2023-09-01) ### Bug Fixes * generate valid tab ids ([#1737](#1737)) ([d1493ea](d1493ea)) * update deploy docs for storybook 7.x ([#1733](#1733)) ([b3a091e](b3a091e))
2 parents 345bdbf + 211fa8f commit b7224ed

File tree

9 files changed

+1290
-960
lines changed

9 files changed

+1290
-960
lines changed

.github/workflows/docs.yml

+20-14
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,35 @@
1-
name: Deploy Docs
1+
name: Deploy Docs to GH Pages
22

33
on:
44
push:
55
branches:
66
- main
77

88
jobs:
9-
deploy_docs:
9+
deploy:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v3
14-
- name: Setup node 😻
15-
uses: actions/setup-node@v3
16-
with:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Setup Node
17+
uses: actions/setup-node@v3
18+
with:
1719
node-version-file: '.node-version'
1820
cache: 'yarn'
1921

20-
- name: Install Dependencies ⬆️
21-
run: yarn install --immutable
22+
- name: Install Dependencies
23+
run: yarn install --immutable
24+
25+
- name: Build EDS
26+
run: yarn build
2227

23-
- name: Build Dist 🔧
24-
run: yarn run build
28+
- name: Build Storybook
29+
run: yarn build:storybook
2530

26-
- name: Deploy Storybook Docs 🚀
27-
run: yarn run deploy:docs
28-
env:
29-
GH_TOKEN: '${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}'
31+
- name: Deploy Storybook
32+
uses: peaceiris/actions-gh-pages@v3
33+
with:
34+
publish_dir: ./storybook-static
35+
github_token: ${{ secrets.GITHUB_TOKEN }}

.yarn/releases/yarn-3.6.2.cjs renamed to .yarn/releases/yarn-3.6.3.cjs

+2-2
Large diffs are not rendered by default.

.yarnrc.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ plugins:
66
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
77
spec: "@yarnpkg/plugin-interactive-tools"
88

9-
yarnPath: .yarn/releases/yarn-3.6.2.cjs
9+
yarnPath: .yarn/releases/yarn-3.6.3.cjs

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
### [13.1.1](https://github.com/chanzuckerberg/edu-design-system/compare/v13.1.0...v13.1.1) (2023-09-01)
6+
7+
8+
### Bug Fixes
9+
10+
* generate valid tab ids ([#1737](https://github.com/chanzuckerberg/edu-design-system/issues/1737)) ([d1493ea](https://github.com/chanzuckerberg/edu-design-system/commit/d1493ea6b1e55f608701c32900c5089fb19f01e3))
11+
* update deploy docs for storybook 7.x ([#1733](https://github.com/chanzuckerberg/edu-design-system/issues/1733)) ([b3a091e](https://github.com/chanzuckerberg/edu-design-system/commit/b3a091ed6a3636c61e7df926eba98b20ecbaaf20))
12+
513
## [13.1.0](https://github.com/chanzuckerberg/edu-design-system/compare/v13.0.0...v13.1.0) (2023-08-23)
614

715

package.json

+21-23
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@chanzuckerberg/eds",
3-
"version": "13.1.0",
3+
"version": "13.1.1",
44
"description": "The React-powered design system library for Chan Zuckerberg Initiative education web applications",
55
"author": "CZI <[email protected]>",
66
"homepage": "https://github.com/chanzuckerberg/edu-design-system",
@@ -44,7 +44,6 @@
4444
"chromatic": "chromatic",
4545
"copy-fonts-to-lib": "copyfiles -u 3 src/design-tokens/tier-1-definitions/fonts.css src/design-tokens/tier-1-definitions/fonts/**/* lib/tokens",
4646
"create-component": "plop",
47-
"deploy:docs": "storybook-to-ghpages --ci",
4847
"lint": "yarn run lint:styles && yarn run lint:scripts",
4948
"lint:fix": "yarn run lint:styles:fix && yarn run lint:scripts:fix",
5049
"lint:styles": "stylelint --ignore-path .gitignore src/**/*.css .storybook/**/*.css",
@@ -100,7 +99,7 @@
10099
"devDependencies": {
101100
"@babel/preset-env": "^7.22.10",
102101
"@babel/preset-react": "^7.22.5",
103-
"@babel/preset-typescript": "^7.22.5",
102+
"@babel/preset-typescript": "^7.22.11",
104103
"@chanzuckerberg/axe-storybook-testing": "^7.1.2",
105104
"@chanzuckerberg/eslint-config-edu-js": "^1.1.0",
106105
"@chanzuckerberg/eslint-config-edu-ts": "^1.0.9",
@@ -112,31 +111,30 @@
112111
"@commitlint/config-conventional": "^17.7.0",
113112
"@geometricpanda/storybook-addon-badges": "^2.0.0",
114113
"@omlet/cli": "^1.0.1-beta.34",
115-
"@rollup/plugin-node-resolve": "^15.2.0",
114+
"@rollup/plugin-node-resolve": "^15.2.1",
116115
"@rollup/plugin-typescript": "^11.1.2",
117116
"@size-limit/file": "^8.2.6",
118-
"@storybook/addon-a11y": "^7.3.1",
119-
"@storybook/addon-docs": "^7.3.1",
120-
"@storybook/addon-essentials": "^7.3.1",
121-
"@storybook/addon-interactions": "^7.3.1",
122-
"@storybook/addon-links": "^7.3.1",
123-
"@storybook/addon-styling": "^1.3.6",
124-
"@storybook/react": "^7.3.1",
125-
"@storybook/react-webpack5": "^7.3.1",
126-
"@storybook/storybook-deployer": "^2.8.16",
117+
"@storybook/addon-a11y": "^7.4.0",
118+
"@storybook/addon-docs": "^7.4.0",
119+
"@storybook/addon-essentials": "^7.4.0",
120+
"@storybook/addon-interactions": "^7.4.0",
121+
"@storybook/addon-links": "^7.4.0",
122+
"@storybook/addon-styling": "^1.3.7",
123+
"@storybook/react": "^7.4.0",
124+
"@storybook/react-webpack5": "^7.4.0",
127125
"@storybook/testing-library": "^0.2.0",
128126
"@storybook/testing-react": "^2.0.1",
129127
"@testing-library/jest-dom": "^5.17.0",
130128
"@testing-library/react": "^13.4.0",
131129
"@testing-library/user-event": "^14.4.3",
132-
"@types/jest": "^29.5.3",
133-
"@types/node": "^18.17.5",
134-
"@types/react": "^18.2.20",
130+
"@types/jest": "^29.5.4",
131+
"@types/node": "^18.17.11",
132+
"@types/react": "^18.2.21",
135133
"@types/react-beautiful-dnd": "^13.1.4",
136134
"@types/react-dom": "^18.2.7",
137135
"@types/react-portal": "^4.0.4",
138136
"axe-core": "4.7.2",
139-
"chromatic": "^6.22.0",
137+
"chromatic": "^6.24.0",
140138
"codecov": "^3.8.3",
141139
"copyfiles": "^2.4.1",
142140
"eslint": "^8.47.0",
@@ -147,8 +145,8 @@
147145
"eslint-plugin-testing-library": "^5.11.1",
148146
"husky": "^8.0.3",
149147
"identity-obj-proxy": "^3.0.0",
150-
"jest": "^29.6.2",
151-
"jest-environment-jsdom": "^29.6.2",
148+
"jest": "^29.6.4",
149+
"jest-environment-jsdom": "^29.6.4",
152150
"jest-preset-stylelint": "^6.2.0",
153151
"lint-staged": "^13.3.0",
154152
"pascal-case": "^3.1.2",
@@ -162,14 +160,14 @@
162160
"prettier": "^2.8.8",
163161
"react": "^18.2.0",
164162
"react-dom": "^18.2.0",
165-
"rollup": "^3.28.0",
163+
"rollup": "^3.28.1",
166164
"rollup-plugin-postcss": "^4.0.2",
167165
"size-limit": "^8.2.6",
168166
"snake-case": "^3.0.4",
169167
"standard-version": "^9.5.0",
170-
"storybook": "^7.3.1",
168+
"storybook": "^7.4.0",
171169
"style-dictionary": "^3.8.0",
172-
"stylelint": "^15.10.2",
170+
"stylelint": "^15.10.3",
173171
"stylelint-config-recommended": "^10.0.1",
174172
"tailwindcss": "^3.3.3",
175173
"ts-jest": "^29.1.1",
@@ -184,5 +182,5 @@
184182
"stylelint --fix"
185183
]
186184
},
187-
"packageManager": "[email protected].2"
185+
"packageManager": "[email protected].3"
188186
}

src/components/Tabs/Tabs.test.tsx

+16
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { act, render, screen } from '@testing-library/react';
44
import userEvent from '@testing-library/user-event';
55
import React from 'react';
66
import * as stories from './Tabs.stories';
7+
import Tab from '../Tab';
78

89
const { Default } = composeStories(stories);
910

@@ -59,4 +60,19 @@ describe('<Tabs />', () => {
5960
rerender(<Default activeIndex={1} />);
6061
expect(screen.getByRole('heading', { name: 'Tab 2' })).toBeInTheDocument();
6162
});
63+
64+
it('does not include invalid characters in tab ids', () => {
65+
render(
66+
<Default id="foo">
67+
<Tab data-testid="tab-1" title="Tab Title 1">
68+
Tab numero uno
69+
</Tab>
70+
</Default>,
71+
);
72+
73+
expect(screen.getByTestId('tab-1')).toHaveAttribute(
74+
'aria-labelledby',
75+
'foo-Tab-Title-1',
76+
);
77+
});
6278
});

src/components/Tabs/Tabs.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@ export const Tabs = ({
8181
const generatedId = useId();
8282
const tabIdPrefix = other.id || generatedId;
8383
const tabIds = useMemo(
84-
() => tabs.map((tab) => `${tabIdPrefix}-${tab.props.title}`),
84+
() =>
85+
tabs.map(
86+
(tab) => `${tabIdPrefix}-${tab.props.title.replace(/\s/g, '-')}`,
87+
),
8588
[tabs, tabIdPrefix],
8689
);
8790

src/components/Tabs/__snapshots__/Tabs.test.tsx.snap

+10-10
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ exports[`<Tabs /> Default story renders snapshot 1`] = `
2020
aria-selected="true"
2121
class="tabs__link"
2222
href="#:r0:"
23-
id=":r1:-Tab Title 1"
23+
id=":r1:-Tab-Title-1"
2424
role="tab"
2525
tabindex="0"
2626
>
@@ -36,7 +36,7 @@ exports[`<Tabs /> Default story renders snapshot 1`] = `
3636
aria-selected="false"
3737
class="tabs__link"
3838
href="#:r0:"
39-
id=":r1:-Tab Title 2"
39+
id=":r1:-Tab-Title-2"
4040
role="tab"
4141
tabindex="-1"
4242
>
@@ -52,7 +52,7 @@ exports[`<Tabs /> Default story renders snapshot 1`] = `
5252
aria-selected="false"
5353
class="tabs__link"
5454
href="#:r0:"
55-
id=":r1:-Tab Title 3"
55+
id=":r1:-Tab-Title-3"
5656
role="tab"
5757
tabindex="-1"
5858
>
@@ -68,7 +68,7 @@ exports[`<Tabs /> Default story renders snapshot 1`] = `
6868
aria-selected="false"
6969
class="tabs__link"
7070
href="#:r0:"
71-
id=":r1:-Tab Title 4"
71+
id=":r1:-Tab-Title-4"
7272
role="tab"
7373
tabindex="-1"
7474
>
@@ -84,7 +84,7 @@ exports[`<Tabs /> Default story renders snapshot 1`] = `
8484
aria-selected="false"
8585
class="tabs__link"
8686
href="#:r0:"
87-
id=":r1:-Tab Title 5"
87+
id=":r1:-Tab-Title-5"
8888
role="tab"
8989
tabindex="-1"
9090
>
@@ -100,7 +100,7 @@ exports[`<Tabs /> Default story renders snapshot 1`] = `
100100
aria-selected="false"
101101
class="tabs__link"
102102
href="#:r0:"
103-
id=":r1:-Tab Title 6"
103+
id=":r1:-Tab-Title-6"
104104
role="tab"
105105
tabindex="-1"
106106
>
@@ -116,7 +116,7 @@ exports[`<Tabs /> Default story renders snapshot 1`] = `
116116
aria-selected="false"
117117
class="tabs__link"
118118
href="#:r0:"
119-
id=":r1:-Tab Title 7"
119+
id=":r1:-Tab-Title-7"
120120
role="tab"
121121
tabindex="-1"
122122
>
@@ -132,7 +132,7 @@ exports[`<Tabs /> Default story renders snapshot 1`] = `
132132
aria-selected="false"
133133
class="tabs__link"
134134
href="#:r0:"
135-
id=":r1:-Tab Title 8"
135+
id=":r1:-Tab-Title-8"
136136
role="tab"
137137
tabindex="-1"
138138
>
@@ -148,7 +148,7 @@ exports[`<Tabs /> Default story renders snapshot 1`] = `
148148
aria-selected="false"
149149
class="tabs__link"
150150
href="#:r0:"
151-
id=":r1:-Tab Title 9"
151+
id=":r1:-Tab-Title-9"
152152
role="tab"
153153
tabindex="-1"
154154
>
@@ -160,7 +160,7 @@ exports[`<Tabs /> Default story renders snapshot 1`] = `
160160
<div>
161161
<div
162162
aria-hidden="false"
163-
aria-labelledby=":r1:-Tab Title 1"
163+
aria-labelledby=":r1:-Tab-Title-1"
164164
id=":r0:"
165165
role="tabpanel"
166166
>

0 commit comments

Comments
 (0)