diff --git a/.changeset/curvy-bottles-dance.md b/.changeset/curvy-bottles-dance.md deleted file mode 100644 index eee72789f7..0000000000 --- a/.changeset/curvy-bottles-dance.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -'@leafygreen-ui/tabs': minor ---- - -[LG-4473](https://jira.mongodb.org/browse/LG-4473) Updates the `selected` and `setSelected` props to accept both strings and numbers. The string must match the text content from the `name` prop on the `Tab` component. - -```js - const [selectedTab, setSelectedTab] = useState('Tab 4'); - - return ( -
- - - - Content 1 - - - Content 2 - - - Content 3 - - - Content 4 - - -
- ); -``` diff --git a/.changeset/mighty-clouds-impress.md b/.changeset/mighty-clouds-impress.md deleted file mode 100644 index e4736cb6f2..0000000000 --- a/.changeset/mighty-clouds-impress.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -'@leafygreen-ui/testing-lib': minor ---- - -Adds `renderHookServer` method - -@testing-library/react-hooks/server exposed a `renderHook` method -that allowed for one to render hooks as if SSR, and control -hydration. This is no longer supported in versions >=18. - -This code was extracted from @testing-library/react-hooks/server and -updated to be compatible with React version >= 18 using `hydrateRoot`. - -More context found here: -https://github.com/testing-library/react-testing-library/issues/1120 diff --git a/.changeset/short-eels-deliver.md b/.changeset/short-eels-deliver.md deleted file mode 100644 index e1f18753fb..0000000000 --- a/.changeset/short-eels-deliver.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@leafygreen-ui/hooks': minor ---- - -Adds `useSsrCheck` and adds it to viewport check in `useViewportSize`. - -When server side rendering is used, `window` is not defined. This is causing build issues on the server where we access `window` in `useViewportSize`. To fix this, this change adds a hook, `useSsrCheck`, that checks the rendering environment and can be used before attempting to access `window`. It adds a check of this to `useViewportSize` to fix the current build issue. diff --git a/packages/code/package.json b/packages/code/package.json index 54fa5456c2..e4eab1beee 100644 --- a/packages/code/package.json +++ b/packages/code/package.json @@ -26,7 +26,7 @@ "@leafygreen-ui/a11y": "^1.4.13", "@leafygreen-ui/button": "^21.1.0", "@leafygreen-ui/emotion": "^4.0.8", - "@leafygreen-ui/hooks": "^8.1.4", + "@leafygreen-ui/hooks": "^8.2.0", "@leafygreen-ui/icon": "^12.5.4", "@leafygreen-ui/icon-button": "^15.0.23", "@leafygreen-ui/lib": "^13.6.0", @@ -44,7 +44,7 @@ "polished": "^4.2.2" }, "devDependencies": { - "@leafygreen-ui/testing-lib": "^0.6.0", + "@leafygreen-ui/testing-lib": "^0.7.0", "@lg-tools/storybook-utils": "^0.1.0" }, "peerDependencies": { diff --git a/packages/combobox/package.json b/packages/combobox/package.json index ac415c2ae9..6694421e24 100644 --- a/packages/combobox/package.json +++ b/packages/combobox/package.json @@ -26,7 +26,7 @@ "@leafygreen-ui/chip": "^1.2.1", "@leafygreen-ui/emotion": "^4.0.8", "@leafygreen-ui/form-field": "^1.2.4", - "@leafygreen-ui/hooks": "^8.1.4", + "@leafygreen-ui/hooks": "^8.2.0", "@leafygreen-ui/icon": "^12.5.4", "@leafygreen-ui/icon-button": "^15.0.23", "@leafygreen-ui/input-option": "^2.0.2", @@ -44,7 +44,7 @@ }, "devDependencies": { "@leafygreen-ui/button": "^21.2.0", - "@leafygreen-ui/testing-lib": "^0.6.1", + "@leafygreen-ui/testing-lib": "^0.7.0", "@lg-tools/storybook-utils": "^0.1.1" }, "homepage": "https://github.com/mongodb/leafygreen-ui/tree/main/packages/combobox", diff --git a/packages/copyable/package.json b/packages/copyable/package.json index f748132f9e..b5e66a9525 100644 --- a/packages/copyable/package.json +++ b/packages/copyable/package.json @@ -24,7 +24,7 @@ "dependencies": { "@leafygreen-ui/button": "^21.2.0", "@leafygreen-ui/emotion": "^4.0.8", - "@leafygreen-ui/hooks": "^8.1.3", + "@leafygreen-ui/hooks": "^8.2.0", "@leafygreen-ui/icon": "^12.5.4", "@leafygreen-ui/lib": "^13.6.0", "@leafygreen-ui/palette": "^4.0.9", @@ -46,7 +46,7 @@ "url": "https://jira.mongodb.org/projects/PD/summary" }, "devDependencies": { - "@leafygreen-ui/testing-lib": "^0.6.0", + "@leafygreen-ui/testing-lib": "^0.7.0", "@lg-tools/storybook-utils": "^0.1.1" } } diff --git a/packages/date-picker/package.json b/packages/date-picker/package.json index ae295ec060..4a770d6a6a 100644 --- a/packages/date-picker/package.json +++ b/packages/date-picker/package.json @@ -19,7 +19,7 @@ "@leafygreen-ui/date-utils": "^0.1.2", "@leafygreen-ui/emotion": "^4.0.8", "@leafygreen-ui/form-field": "^1.2.4", - "@leafygreen-ui/hooks": "^8.1.3", + "@leafygreen-ui/hooks": "^8.2.0", "@leafygreen-ui/icon": "^12.5.4", "@leafygreen-ui/icon-button": "^15.0.21", "@leafygreen-ui/lib": "^13.6.0", @@ -40,7 +40,7 @@ "@jest/globals": "^29.7.0", "@leafygreen-ui/button": "^21.2.1", "@leafygreen-ui/modal": "^16.0.8", - "@leafygreen-ui/testing-lib": "^0.6.0", + "@leafygreen-ui/testing-lib": "^0.7.0", "mockdate": "^3.0.5", "@lg-tools/storybook-utils": "^0.1.1" }, diff --git a/packages/descendants/package.json b/packages/descendants/package.json index a346ed713d..f55a67433c 100644 --- a/packages/descendants/package.json +++ b/packages/descendants/package.json @@ -15,7 +15,7 @@ "access": "public" }, "dependencies": { - "@leafygreen-ui/hooks": "^8.1.3", + "@leafygreen-ui/hooks": "^8.2.0", "@leafygreen-ui/lib": "^13.7.0", "lodash": "^4.17.21" }, @@ -24,7 +24,7 @@ "@leafygreen-ui/button": "^21.1.0", "@leafygreen-ui/emotion": "^4.0.8", "@leafygreen-ui/popover": "^11.4.0", - "@leafygreen-ui/testing-lib": "^0.6.1", + "@leafygreen-ui/testing-lib": "^0.7.0", "@lg-tools/storybook-utils": "^0.1.0" }, "peerDependencies": { diff --git a/packages/hooks/CHANGELOG.md b/packages/hooks/CHANGELOG.md index 71dab25323..4cfba82cbc 100644 --- a/packages/hooks/CHANGELOG.md +++ b/packages/hooks/CHANGELOG.md @@ -1,5 +1,13 @@ # @leafygreen-ui/hooks +## 8.2.0 + +### Minor Changes + +- 9776f5f42: Adds `useSsrCheck` and adds it to viewport check in `useViewportSize`. + + When server side rendering is used, `window` is not defined. This is causing build issues on the server where we access `window` in `useViewportSize`. To fix this, this change adds a hook, `useSsrCheck`, that checks the rendering environment and can be used before attempting to access `window`. It adds a check of this to `useViewportSize` to fix the current build issue. + ## 8.1.4 ### Patch Changes diff --git a/packages/hooks/package.json b/packages/hooks/package.json index 995224726f..fe410be259 100644 --- a/packages/hooks/package.json +++ b/packages/hooks/package.json @@ -1,6 +1,6 @@ { "name": "@leafygreen-ui/hooks", - "version": "8.1.4", + "version": "8.2.0", "description": "LeafyGreen UI Kit Custom Hooks", "main": "./dist/index.js", "module": "./dist/esm/index.js", diff --git a/packages/menu/package.json b/packages/menu/package.json index 3798536066..c9fff2498c 100644 --- a/packages/menu/package.json +++ b/packages/menu/package.json @@ -24,7 +24,7 @@ "dependencies": { "@leafygreen-ui/descendants": "^1.0.1", "@leafygreen-ui/emotion": "^4.0.8", - "@leafygreen-ui/hooks": "^8.1.4", + "@leafygreen-ui/hooks": "^8.2.0", "@leafygreen-ui/icon": "^12.5.4", "@leafygreen-ui/icon-button": "^15.0.23", "@leafygreen-ui/input-option": "^2.0.2", @@ -40,7 +40,7 @@ }, "devDependencies": { "@leafygreen-ui/button": "^21.2.0", - "@leafygreen-ui/testing-lib": "^0.6.1", + "@leafygreen-ui/testing-lib": "^0.7.0", "@leafygreen-ui/text-input": "^13.1.0", "@lg-tools/storybook-utils": "^0.1.1", "@storybook/react": "^7.6.17" diff --git a/packages/select/package.json b/packages/select/package.json index 09e4e53ab8..c11b2d228d 100644 --- a/packages/select/package.json +++ b/packages/select/package.json @@ -25,7 +25,7 @@ "@leafygreen-ui/button": "^21.2.0", "@leafygreen-ui/emotion": "^4.0.8", "@leafygreen-ui/form-field": "^1.2.4", - "@leafygreen-ui/hooks": "^8.1.3", + "@leafygreen-ui/hooks": "^8.2.0", "@leafygreen-ui/icon": "^12.5.4", "@leafygreen-ui/input-option": "^2.0.1", "@leafygreen-ui/lib": "^13.6.1", @@ -51,7 +51,7 @@ "url": "https://jira.mongodb.org/projects/PD/summary" }, "devDependencies": { - "@leafygreen-ui/testing-lib": "^0.6.1", + "@leafygreen-ui/testing-lib": "^0.7.0", "@lg-tools/storybook-utils": "^0.1.1" } } diff --git a/packages/tabs/CHANGELOG.md b/packages/tabs/CHANGELOG.md index fd7840c8ac..3c1749acff 100644 --- a/packages/tabs/CHANGELOG.md +++ b/packages/tabs/CHANGELOG.md @@ -1,5 +1,45 @@ # @leafygreen-ui/tabs +## 13.1.0 + +### Minor Changes + +- 30f111498: [LG-4473](https://jira.mongodb.org/browse/LG-4473) Updates the `selected` and `setSelected` props to accept both strings and numbers. The string must match the text content from the `name` prop on the `Tab` component. + + ```js + const [selectedTab, setSelectedTab] = useState('Tab 4'); + + return ( +
+ + + + Content 1 + + + Content 2 + + + Content 3 + + + Content 4 + + +
+ ); + ``` + +### Patch Changes + +- Updated dependencies [9776f5f42] + - @leafygreen-ui/hooks@8.2.0 + ## 13.0.1 ### Patch Changes diff --git a/packages/tabs/package.json b/packages/tabs/package.json index 856070d5da..0f4362c2d7 100644 --- a/packages/tabs/package.json +++ b/packages/tabs/package.json @@ -1,6 +1,6 @@ { "name": "@leafygreen-ui/tabs", - "version": "13.0.1", + "version": "13.1.0", "description": "leafyGreen UI Kit Tabs", "main": "./dist/index.js", "module": "./dist/esm/index.js", @@ -25,7 +25,7 @@ "@leafygreen-ui/a11y": "^1.5.0", "@leafygreen-ui/descendants": "^1.0.0", "@leafygreen-ui/emotion": "^4.0.8", - "@leafygreen-ui/hooks": "^8.1.4", + "@leafygreen-ui/hooks": "^8.2.0", "@leafygreen-ui/lib": "^13.7.0", "@leafygreen-ui/palette": "^4.1.0", "@leafygreen-ui/polymorphic": "^2.0.2", diff --git a/packages/testing-lib/CHANGELOG.md b/packages/testing-lib/CHANGELOG.md index 3f0bda118e..d79e83a459 100644 --- a/packages/testing-lib/CHANGELOG.md +++ b/packages/testing-lib/CHANGELOG.md @@ -1,5 +1,21 @@ # @leafygreen-ui/testing-lib +## 0.7.0 + +### Minor Changes + +- 9776f5f42: Adds `renderHookServer` method + + @testing-library/react-hooks/server exposed a `renderHook` method + that allowed for one to render hooks as if SSR, and control + hydration. This is no longer supported in versions >=18. + + This code was extracted from @testing-library/react-hooks/server and + updated to be compatible with React version >= 18 using `hydrateRoot`. + + More context found here: + https://github.com/testing-library/react-testing-library/issues/1120 + ## 0.6.1 ### Patch Changes diff --git a/packages/testing-lib/package.json b/packages/testing-lib/package.json index aece2d370e..542862c236 100644 --- a/packages/testing-lib/package.json +++ b/packages/testing-lib/package.json @@ -1,6 +1,6 @@ { "name": "@leafygreen-ui/testing-lib", - "version": "0.6.1", + "version": "0.7.0", "description": "leafyGreen UI Kit Internal Testing Library", "main": "./dist/index.js", "module": "./dist/esm/index.js", diff --git a/tools/cli/CHANGELOG.md b/tools/cli/CHANGELOG.md index 4c31a8dc15..57069fb258 100644 --- a/tools/cli/CHANGELOG.md +++ b/tools/cli/CHANGELOG.md @@ -1,5 +1,11 @@ # @lg-tools/cli +## 0.6.2 + +### Patch Changes + +- @lg-tools/test@0.4.10 + ## 0.6.1 ### Patch Changes diff --git a/tools/cli/package.json b/tools/cli/package.json index b9dcae73c5..de3912dbee 100644 --- a/tools/cli/package.json +++ b/tools/cli/package.json @@ -1,6 +1,6 @@ { "name": "@lg-tools/cli", - "version": "0.6.1", + "version": "0.6.2", "description": "Command Line tools for LeafyGreen", "license": "Apache-2.0", "main": "./dist/index.js", @@ -23,7 +23,7 @@ "@lg-tools/link": "0.2.4", "@lg-tools/lint": "0.2.3", "@lg-tools/slackbot": "0.2.7", - "@lg-tools/test": "0.4.9", + "@lg-tools/test": "0.4.10", "@lg-tools/update": "0.1.9", "@lg-tools/validate": "0.1.11", "commander": "^11.0.0", diff --git a/tools/test/CHANGELOG.md b/tools/test/CHANGELOG.md index 3824355f1b..4ca2801cf7 100644 --- a/tools/test/CHANGELOG.md +++ b/tools/test/CHANGELOG.md @@ -1,5 +1,12 @@ # @lg-tools/test +## 0.4.10 + +### Patch Changes + +- Updated dependencies [9776f5f42] + - @leafygreen-ui/testing-lib@0.7.0 + ## 0.4.9 ### Patch Changes diff --git a/tools/test/package.json b/tools/test/package.json index 71f333e4a5..5b8b375ac0 100644 --- a/tools/test/package.json +++ b/tools/test/package.json @@ -1,6 +1,6 @@ { "name": "@lg-tools/test", - "version": "0.4.9", + "version": "0.4.10", "description": "Jest setup & config for LeafyGreen repositories", "license": "Apache-2.0", "main": "dist/index.js", @@ -17,7 +17,7 @@ "@emotion/css": "11.9.0", "@emotion/react": "11.11.1", "@emotion/server": "11.11.0", - "@leafygreen-ui/testing-lib": "^0.6.0", + "@leafygreen-ui/testing-lib": "^0.7.0", "@lg-tools/build": "0.6.0", "@lg-tools/meta": "0.3.4", "@testing-library/dom": "9.3.1",