From 2e2acae789463516429867835345599bc4f82247 Mon Sep 17 00:00:00 2001 From: Geoffrey Chong Date: Wed, 27 Sep 2023 12:07:29 +1000 Subject: [PATCH 1/2] Update README.md --- README.md | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 50317ca..619527b 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,32 @@ # Kaizen Legacy -**WARNING: Do NOT use for new projects.** These components are **not maintained**. - -Please use the main supported [kaizen-design-system](https://github.com/cultureamp/kaizen-design-system/) repo. +This repo serves as a holding ground for all our existing packages that support the legacy versions of React 16/17. +We are currently in the process of migrating all components available in this repo to our new architecture. ## Why this repository exists To help projects continue to use components that are tested in React 16 and 17 while they transition to React 18. See [Solution Preview](https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3215819020/Solution+Preview+Ending+support+for+React+16+17+in+Kaizen) for more detail. + +## Is it safe to use these "legacy" components? + +**TL;DR yes.** + +These components support the legacy versions of React 16 & 17. +If your project is not running React 18 yet, then these are the components you should use. + +## Are these components going to be replaced by newer ones? + +**TL;DR no.** + +We are currently in the process of migrating all non-deprecated components within this repo to our new architecture, where they will continue to be made available. + +## Do I need to wait for the new version? + +No. Our goal is to modify as little as possible when moving the components from this repo to our new architecture. **Any changes made here will be migrated over.** + ## Contribution Please consider upgrading to use components in the [kaizen-design-system](https://github.com/cultureamp/kaizen-design-system/) repo **before** making any pull requests to this repo. From d1615e5271d23608b32b44fbdd155f7445ef46fd Mon Sep 17 00:00:00 2001 From: Michael Winter <36558508+mcwinter07@users.noreply.github.com> Date: Wed, 27 Sep 2023 14:16:52 +1000 Subject: [PATCH 2/2] fix(button): add check for workingLabel to GenericButton for aria-live (#39) * fix(button): add check for workingLabel to GenericButton for aria-live * remove aria-polite from snapshot tests --- .changeset/stale-crabs-protect.md | 7 ++ .../Menu/__snapshots__/Menu.spec.tsx.snap | 1 - .../Tile/__snapshots__/Tile.spec.tsx.snap | 18 ----- .../__snapshots__/BrandMoment.spec.tsx.snap | 3 - .../Button/components/GenericButton.spec.tsx | 69 +++++++++++++++++++ .../src/Button/components/GenericButton.tsx | 3 +- 6 files changed, 78 insertions(+), 23 deletions(-) create mode 100644 .changeset/stale-crabs-protect.md diff --git a/.changeset/stale-crabs-protect.md b/.changeset/stale-crabs-protect.md new file mode 100644 index 0000000..834e7f6 --- /dev/null +++ b/.changeset/stale-crabs-protect.md @@ -0,0 +1,7 @@ +--- +"@kaizen/button": patch +--- + +Fix aria-polite presence on buttons without working states. +* The aria-live="polite" will only be added when a workingLabel is provided to the button. + * This will mean the content should only be read when inner content updates on buttons with working states \ No newline at end of file diff --git a/draft-packages/menu/KaizenDraft/Menu/__snapshots__/Menu.spec.tsx.snap b/draft-packages/menu/KaizenDraft/Menu/__snapshots__/Menu.spec.tsx.snap index 04406b5..0f5ed06 100644 --- a/draft-packages/menu/KaizenDraft/Menu/__snapshots__/Menu.spec.tsx.snap +++ b/draft-packages/menu/KaizenDraft/Menu/__snapshots__/Menu.spec.tsx.snap @@ -6,7 +6,6 @@ exports[`Dropdown renders default view 1`] = ` class="buttonWrapper" > + )} + /> + ) + const button = getByTestId("id--generic-test") + const buttonContainer = button.parentElement + + expect(buttonContainer).toHaveAttribute("aria-live", "polite") + }) +}) diff --git a/packages/button/src/Button/components/GenericButton.tsx b/packages/button/src/Button/components/GenericButton.tsx index c5128a7..c5069f3 100755 --- a/packages/button/src/Button/components/GenericButton.tsx +++ b/packages/button/src/Button/components/GenericButton.tsx @@ -60,6 +60,7 @@ export type WorkingProps = { export type WorkingUndefinedProps = { working?: false + workingLabel?: string } type Props = ButtonProps & { @@ -116,7 +117,7 @@ const GenericButton = forwardRef( styles.container, props.fullWidth && styles.fullWidth )} - aria-live="polite" + aria-live={props.workingLabel ? "polite" : undefined} > {determineButtonRenderer()}