diff --git a/CHANGELOG.md b/CHANGELOG.md index ba645f9ab7..72b8dc4dd2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,26 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# 3.7.0 (2020-05-06) + +### Infrastructure +- ci: Enable Github Actions for pull requests ([#557](https://github.com/Workday/canvas-kit/pull/557)) [@NicholasBoll](https://github.com/NicholasBoll) +- ci: Fix annotation for extra dependencies ([#578](https://github.com/Workday/canvas-kit/pull/578)) [@NicholasBoll](https://github.com/NicholasBoll) +- chore: Update Lerna ([#583](https://github.com/Workday/canvas-kit/pull/583)) [@lychyi](https://github.com/lychyi) +- fix: Fix eslint for VSCode ([#589](https://github.com/Workday/canvas-kit/pull/589)) [@NicholasBoll](https://github.com/NicholasBoll) +- chore: Update Cypress to 4.4.1 and remove custom TS handling ([#596](https://github.com/Workday/canvas-kit/pull/596)) [@NicholasBoll](https://github.com/NicholasBoll) +- chore: Refactor control wrapper to hooks for easier examples ([#597](https://github.com/Workday/canvas-kit/pull/597)) [@NicholasBoll](https://github.com/NicholasBoll) +- chore: Decrease output of build-storybook ([#598](https://github.com/Workday/canvas-kit/pull/598)) [@NicholasBoll](https://github.com/NicholasBoll) +- fix: Fix ESLint VSCode plugin ([#599](https://github.com/Workday/canvas-kit/pull/599)) [@NicholasBoll](https://github.com/NicholasBoll) +- chore: Update copyright in license files ([#615](https://github.com/Workday/canvas-kit/pull/615)) [@jpante](https://github.com/jpante) + +### Components +- fix(ColorPicker): Export ColorSwatch from the ColorPicker index ([#580](https://github.com/Workday/canvas-kit/pull/580)) [@BlueVajra](https://github.com/BlueVajra) +- fix(table): Remove focus on CSS table rows ([#595](https://github.com/Workday/canvas-kit/pull/595)) [@NicholasBoll](https://github.com/NicholasBoll) +- test(toast): Write test for Toasts ([#584](https://github.com/Workday/canvas-kit/pull/584)) [@mannycarrera4](https://github.com/mannycarrera4) +- feat(select): Implement Canvas menu ([#454](https://github.com/Workday/canvas-kit/pull/454)) [@jamesfan](https://github.com/jamesfan) +- test(popup): Add tests for Popup ([#600](https://github.com/Workday/canvas-kit/pull/600)) [@mannycarrera4](https://github.com/mannycarrera4) + # 4.0.0-beta.1 (2020-04-13) ### Infrastructure @@ -16,6 +36,21 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline - feat(tooltip): Refactor to a simpler API ([#528](https://github.com/Workday/canvas-kit/pull/528)) [@NicholasBoll](https://github.com/NicholasBoll) - feat(core): Allow InputProvider to use a configurable container ([#546](https://github.com/Workday/canvas-kit/pull/546)) [@mannycarrera4](https://github.com/mannycarrera4) +# 3.6.0 (2020-04-13) + +### Infrastructure +- chore: Update thank you on README ([#511](https://github.com/Workday/canvas-kit/pull/511)) [@lychyi](https://github.com/lychyi) +- ci: Quiet Travis build-storybook webpack logs ([#516](https://github.com/Workday/canvas-kit/pull/516)) [@anicholls](https://github.com/anicholls) +- docs: Update Component Status ([#547](https://github.com/Workday/canvas-kit/pull/547)) [@jpante](https://github.com/jpante) + +### Components +- feat(color-picker): Add color picker ([#462](https://github.com/Workday/canvas-kit/pull/462)) [@laurenraddatz](https://github.com/laurenraddatz) +- fix: Combobox and search bar not in container ([#513](https://github.com/Workday/canvas-kit/pull/513)) [@vibdev](https://github.com/vibdev) +- test(form-field): Add testing-library/react and cypress tests ([#482](https://github.com/Workday/canvas-kit/pull/482)) [@mannycarrera4](https://github.com/mannycarrera4) +- fix(menu): Update aria role for menu ([#520](https://github.com/Workday/canvas-kit/pull/520)) [@mannycarrera4](https://github.com/mannycarrera4) +- feat(combobox): Convert to functional component and add translation function for status text ([#532](https://github.com/Workday/canvas-kit/pull/532)) [@vibdev](https://github.com/vibdev) +- fix(color-picker): Design & use case improvements ([#519](https://github.com/Workday/canvas-kit/pull/519)) [@anicholls](https://github.com/anicholls) +- fix(menu): Fix flashing on initial selected index ([#561](https://github.com/Workday/canvas-kit/pull/561)) [@NicholasBoll](https://github.com/NicholasBoll) # 4.0.0-beta.0 (2020-03-30) @@ -35,22 +70,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline - fix(button): Misc. fixes after refactor ([#509](https://github.com/Workday/canvas-kit/pull/509)) [@anicholls](https://github.com/anicholls) - feat(button): Add theming support to buttons ([#527](https://github.com/Workday/canvas-kit/pull/527)) [@anicholls](https://github.com/anicholls) -# 3.6.0 (2020-04-13) - -### Infrastructure -- chore: Update thank you on README ([#511](https://github.com/Workday/canvas-kit/pull/511)) [@lychyi](https://github.com/lychyi) -- ci: Quiet Travis build-storybook webpack logs ([#516](https://github.com/Workday/canvas-kit/pull/516)) [@anicholls](https://github.com/anicholls) -- docs: Update Component Status ([#547](https://github.com/Workday/canvas-kit/pull/547)) [@jpante](https://github.com/jpante) - -### Components -- feat(color-picker): Add color picker ([#462](https://github.com/Workday/canvas-kit/pull/462)) [@laurenraddatz](https://github.com/laurenraddatz) -- fix: Combobox and search bar not in container ([#513](https://github.com/Workday/canvas-kit/pull/513)) [@vibdev](https://github.com/vibdev) -- test(form-field): Add testing-library/react and cypress tests ([#482](https://github.com/Workday/canvas-kit/pull/482)) [@mannycarrera4](https://github.com/mannycarrera4) -- fix(menu): Update aria role for menu ([#520](https://github.com/Workday/canvas-kit/pull/520)) [@mannycarrera4](https://github.com/mannycarrera4) -- feat(combobox): Convert to functional component and add translation function for status text ([#532](https://github.com/Workday/canvas-kit/pull/532)) [@vibdev](https://github.com/vibdev) -- fix(color-picker): Design & use case improvements ([#519](https://github.com/Workday/canvas-kit/pull/519)) [@anicholls](https://github.com/anicholls) -- fix(menu): Fix flashing on initial selected index ([#561](https://github.com/Workday/canvas-kit/pull/561)) [@NicholasBoll](https://github.com/NicholasBoll) - # 3.5.0 (2020-03-12) ### Infrastructure diff --git a/LICENSE b/LICENSE index 0edd43cffc..594eb66af8 100644 --- a/LICENSE +++ b/LICENSE @@ -43,7 +43,8 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/cypress/integration/Popup.spec.ts b/cypress/integration/Popup.spec.ts new file mode 100644 index 0000000000..92ca86bb84 --- /dev/null +++ b/cypress/integration/Popup.spec.ts @@ -0,0 +1,70 @@ +import * as h from '../helpers'; + +function getPopup() { + return cy.findByRole('dialog'); +} + +function getPopupTargetButton() { + return cy.contains('Delete Item'); +} + +function getCloseButton() { + return getPopup().find('[data-close]'); +} + +describe('Popup', () => { + before(() => { + h.stories.visit(); + }); + context(`given the open popup`, () => { + beforeEach(() => { + h.stories.load('Components|Popups/Popup/React', 'Open'); + }); + it('should not have any axe errors', () => { + cy.checkA11y(); + }); + + it('should have a role of dialog', () => { + getPopup().should('have.attr', 'role', 'dialog'); + }); + }); + + context(`given the default popup`, () => { + beforeEach(() => { + h.stories.load('Components|Popups/Popup/React', 'Default'); + }); + context('when the target buttton is clicked', () => { + beforeEach(() => { + getPopupTargetButton().click(); + }); + + it('should open the popup', () => { + getPopup().should('be.visible'); + }); + + it('should not have any axe errors', () => { + cy.checkA11y(); + }); + + context('popup', () => { + it('should have a role of dialog', () => { + getPopup().should('have.attr', 'role', 'dialog'); + }); + + it('should have an aria-labelledby attribute when a heading is provided', () => { + getPopup().should('have.attr', 'aria-labelledby'); + }); + }); + + context('when the close button is clicked', () => { + beforeEach(() => { + getCloseButton().click(); + }); + + it('should close the popup', () => { + getPopup().should('not.visible'); + }); + }); + }); + }); +}); diff --git a/lerna.json b/lerna.json index ed40c756d6..b7da21685d 100644 --- a/lerna.json +++ b/lerna.json @@ -1,7 +1,5 @@ { - "packages": [ - "modules/**" - ], + "packages": ["modules/**"], "version": "4.0.0-beta.1", "npmClient": "yarn", "useWorkspaces": true, diff --git a/modules/_canvas-kit-react/LICENSE b/modules/_canvas-kit-react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/_canvas-kit-react/LICENSE +++ b/modules/_canvas-kit-react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/_labs/color-picker/react/LICENSE b/modules/_labs/color-picker/react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/_labs/color-picker/react/LICENSE +++ b/modules/_labs/color-picker/react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/_labs/combobox/react/LICENSE b/modules/_labs/combobox/react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/_labs/combobox/react/LICENSE +++ b/modules/_labs/combobox/react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/_labs/core/react/LICENSE b/modules/_labs/core/react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/_labs/core/react/LICENSE +++ b/modules/_labs/core/react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/_labs/drawer/react/LICENSE b/modules/_labs/drawer/react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/_labs/drawer/react/LICENSE +++ b/modules/_labs/drawer/react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/_labs/header/react/LICENSE b/modules/_labs/header/react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/_labs/header/react/LICENSE +++ b/modules/_labs/header/react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/_labs/menu/react/LICENSE b/modules/_labs/menu/react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/_labs/menu/react/LICENSE +++ b/modules/_labs/menu/react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/_labs/pagination/react/LICENSE b/modules/_labs/pagination/react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/_labs/pagination/react/LICENSE +++ b/modules/_labs/pagination/react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/_labs/select/react/LICENSE b/modules/_labs/select/react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/_labs/select/react/LICENSE +++ b/modules/_labs/select/react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/action-bar/css/LICENSE b/modules/action-bar/css/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/action-bar/css/LICENSE +++ b/modules/action-bar/css/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/action-bar/react/LICENSE b/modules/action-bar/react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/action-bar/react/LICENSE +++ b/modules/action-bar/react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/avatar/react/LICENSE b/modules/avatar/react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/avatar/react/LICENSE +++ b/modules/avatar/react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/banner/css/LICENSE b/modules/banner/css/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/banner/css/LICENSE +++ b/modules/banner/css/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/banner/react/LICENSE b/modules/banner/react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/banner/react/LICENSE +++ b/modules/banner/react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/button/css/LICENSE b/modules/button/css/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/button/css/LICENSE +++ b/modules/button/css/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/button/react/LICENSE b/modules/button/react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/button/react/LICENSE +++ b/modules/button/react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/card/react/LICENSE b/modules/card/react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/card/react/LICENSE +++ b/modules/card/react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/checkbox/css/LICENSE b/modules/checkbox/css/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/checkbox/css/LICENSE +++ b/modules/checkbox/css/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/checkbox/react/LICENSE b/modules/checkbox/react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/checkbox/react/LICENSE +++ b/modules/checkbox/react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/color-picker/react/LICENSE b/modules/color-picker/react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/color-picker/react/LICENSE +++ b/modules/color-picker/react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/common/css/LICENSE b/modules/common/css/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/common/css/LICENSE +++ b/modules/common/css/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/common/react/LICENSE b/modules/common/react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/common/react/LICENSE +++ b/modules/common/react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/cookie-banner/react/LICENSE b/modules/cookie-banner/react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/cookie-banner/react/LICENSE +++ b/modules/cookie-banner/react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/core/css/LICENSE b/modules/core/css/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/core/css/LICENSE +++ b/modules/core/css/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/core/react/LICENSE b/modules/core/react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/core/react/LICENSE +++ b/modules/core/react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/fonts/css/LICENSE b/modules/fonts/css/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/fonts/css/LICENSE +++ b/modules/fonts/css/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/fonts/react/LICENSE b/modules/fonts/react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/fonts/react/LICENSE +++ b/modules/fonts/react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/form-field/css/LICENSE b/modules/form-field/css/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/form-field/css/LICENSE +++ b/modules/form-field/css/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/form-field/react/LICENSE b/modules/form-field/react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/form-field/react/LICENSE +++ b/modules/form-field/react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/icon/css/LICENSE b/modules/icon/css/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/icon/css/LICENSE +++ b/modules/icon/css/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/icon/react/LICENSE b/modules/icon/react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/icon/react/LICENSE +++ b/modules/icon/react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/layout/css/LICENSE b/modules/layout/css/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/layout/css/LICENSE +++ b/modules/layout/css/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/layout/react/LICENSE b/modules/layout/react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/layout/react/LICENSE +++ b/modules/layout/react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/loading-animation/css/LICENSE b/modules/loading-animation/css/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/loading-animation/css/LICENSE +++ b/modules/loading-animation/css/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/loading-animation/react/LICENSE b/modules/loading-animation/react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/loading-animation/react/LICENSE +++ b/modules/loading-animation/react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/menu/css/LICENSE b/modules/menu/css/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/menu/css/LICENSE +++ b/modules/menu/css/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/modal/css/LICENSE b/modules/modal/css/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/modal/css/LICENSE +++ b/modules/modal/css/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/page-header/css/LICENSE b/modules/page-header/css/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/page-header/css/LICENSE +++ b/modules/page-header/css/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/page-header/react/LICENSE b/modules/page-header/react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/page-header/react/LICENSE +++ b/modules/page-header/react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/popup/css/LICENSE b/modules/popup/css/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/popup/css/LICENSE +++ b/modules/popup/css/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/popup/react/LICENSE b/modules/popup/react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/popup/react/LICENSE +++ b/modules/popup/react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/popup/react/lib/Popup.tsx b/modules/popup/react/lib/Popup.tsx index 4864671cf4..e687cffbf7 100644 --- a/modules/popup/react/lib/Popup.tsx +++ b/modules/popup/react/lib/Popup.tsx @@ -34,7 +34,7 @@ export interface PopupProps extends React.HTMLAttributes { * The origin from which the Popup will animate. * @default {horizontal: 'center', vertical: 'top'} */ - transformOrigin?: TransformOrigin; + transformOrigin?: TransformOrigin | null; /** * The size of the Popup close button. Accepts `small` or `medium`. * @default 'medium' @@ -94,12 +94,17 @@ const Container = styled('div', { maxWidth: `calc(100vw - ${spacing.l})`, }, ({width}) => width && {width}, - ({transformOrigin}) => ({ - animation: popupAnimation(transformOrigin), - animationDuration: '150ms', - animationTimingFunction: 'ease-out', - transformOrigin: `${transformOrigin.vertical} ${transformOrigin.horizontal}`, - }) + ({transformOrigin}) => { + if (transformOrigin === null) { + return {}; + } + return { + animation: popupAnimation(transformOrigin), + animationDuration: '150ms', + animationTimingFunction: 'ease-out', + transformOrigin: `${transformOrigin.vertical} ${transformOrigin.horizontal}`, + }; + } ); const getHeadingId = (heading: React.ReactNode, id: string) => (heading ? id : undefined); diff --git a/modules/popup/react/package.json b/modules/popup/react/package.json index ab6e42204d..edf1dff065 100644 --- a/modules/popup/react/package.json +++ b/modules/popup/react/package.json @@ -55,6 +55,9 @@ "@workday/canvas-system-icons-web": "^1.0.20", "uuid": "^3.3.3" }, + "devDependencies": { + "@workday/canvas-kit-labs-react-core": "^4.0.0-beta.1" + }, "peerDependencies": { "react": ">= 16.8 < 17" } diff --git a/modules/popup/react/spec/Popup.spec.tsx b/modules/popup/react/spec/Popup.spec.tsx index 987e9153dd..56890f6b63 100644 --- a/modules/popup/react/spec/Popup.spec.tsx +++ b/modules/popup/react/spec/Popup.spec.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; +import {render, fireEvent} from '@testing-library/react'; import Popup from '../lib/Popup'; -import {mount} from 'enzyme'; describe('Popup', () => { const cb = jest.fn(); @@ -8,18 +8,81 @@ describe('Popup', () => { cb.mockReset(); }); - test('should call a callback function', () => { - const component = mount(Hello World); - const popup = component.find('button'); - popup.simulate('click'); - expect(cb.mock.calls.length).toBe(1); - component.unmount(); + describe('when rendered with a heading', () => { + it('should render popup with heading text', () => { + const headingText = 'Delete item'; + const {getByRole} = render( + +
Are you sure you'd like to delete the item titled 'My Item'?
+ + +
+ ); + expect(getByRole('dialog').querySelector('h3')).toContainHTML(headingText); + }); + }); + + describe('when rendered with a handleClose', () => { + it('should render popup with a close button', () => { + const closeButtonAriaLabel = 'close'; + const {getByRole} = render( + +
Are you sure you'd like to delete the item titled 'My Item'?
+ + +
+ ); + getByRole('dialog').querySelector('[data-close]'); + expect(getByRole('dialog').querySelector('[data-close]')).toHaveAttribute( + 'aria-label', + closeButtonAriaLabel + ); + }); + + it('should call the handleClose callback when clicked', () => { + const closeButtonAriaLabel = 'close'; + const {getByRole} = render( + +
Are you sure you'd like to delete the item titled 'My Item'?
+ + +
+ ); + + fireEvent.click(getByRole('dialog').querySelector('[data-close]')); + + expect(cb).toHaveBeenCalledTimes(1); + }); }); - test('Popup should spread extra props', () => { - const component = mount(); - const container = component.at(0).getDOMNode(); - expect(container.getAttribute('data-propspread')).toBe('test'); - component.unmount(); + describe('when rendered with extra props', () => { + it('should render popup with extra props', () => { + const {getByRole} = render( + +
Are you sure you'd like to delete the item titled 'My Item'?
+ + +
+ ); + + expect(getByRole('dialog')).toHaveAttribute('data-propspread', 'test'); + }); + }); + + describe('when rendered with a popup ref', () => { + it('should set the ref to the div element', () => { + const ref = React.createRef(); + + render( + +
Are you sure you'd like to delete the item titled 'My Item'?
+ + +
+ ); + + expect(ref.current).not.toBeNull(); + expect(ref.current).toHaveAttribute('role', 'dialog'); + }); }); }); diff --git a/modules/popup/react/stories/stories_VisualTesting.tsx b/modules/popup/react/stories/stories_VisualTesting.tsx new file mode 100644 index 0000000000..10087c5cad --- /dev/null +++ b/modules/popup/react/stories/stories_VisualTesting.tsx @@ -0,0 +1,102 @@ +/// +/** @jsx jsx */ +import {jsx} from '@emotion/core'; +import {storiesOf} from '@storybook/react'; +import {StaticStates} from '@workday/canvas-kit-labs-react-core'; +import {action} from '@storybook/addon-actions'; +import {ComponentStatesTable} from '../../../../utils/storybook'; +import {Popup} from '../index'; +import {PopupPadding} from '../lib/Popup'; +import {depth} from '@workday/canvas-kit-react-core'; + +storiesOf('Components|Popups/Popup/React/Visual Testing', module) + .addParameters({ + component: Popup, + chromatic: { + disable: false, + }, + }) + .add('States', () => ( + + + {props => ( + + Your workbook was successfully processed. + + )} + + + )); diff --git a/modules/radio/css/LICENSE b/modules/radio/css/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/radio/css/LICENSE +++ b/modules/radio/css/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/radio/react/LICENSE b/modules/radio/react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/radio/react/LICENSE +++ b/modules/radio/react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/select/css/LICENSE b/modules/select/css/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/select/css/LICENSE +++ b/modules/select/css/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/status-indicator/react/LICENSE b/modules/status-indicator/react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/status-indicator/react/LICENSE +++ b/modules/status-indicator/react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/table/css/LICENSE b/modules/table/css/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/table/css/LICENSE +++ b/modules/table/css/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/text-area/css/LICENSE b/modules/text-area/css/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/text-area/css/LICENSE +++ b/modules/text-area/css/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/text-area/react/LICENSE b/modules/text-area/react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/text-area/react/LICENSE +++ b/modules/text-area/react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/text-input/css/LICENSE b/modules/text-input/css/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/text-input/css/LICENSE +++ b/modules/text-input/css/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/text-input/react/LICENSE b/modules/text-input/react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/text-input/react/LICENSE +++ b/modules/text-input/react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/toast/react/LICENSE b/modules/toast/react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/toast/react/LICENSE +++ b/modules/toast/react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/toast/react/spec/Toast.spec.tsx b/modules/toast/react/spec/Toast.spec.tsx index 7c3086372a..4ccd616b38 100644 --- a/modules/toast/react/spec/Toast.spec.tsx +++ b/modules/toast/react/spec/Toast.spec.tsx @@ -41,8 +41,8 @@ describe('Toast', () => { {toastMessage} ); - const closeIcon = container.querySelector('[data-close="close"]'); /*? */ - fireEvent.click(closeIcon); /*? */ + const closeIcon = container.querySelector('[data-close="close"]'); + fireEvent.click(closeIcon); expect(cb).toHaveBeenCalledTimes(1); }); }); diff --git a/modules/tooltip/css/LICENSE b/modules/tooltip/css/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/tooltip/css/LICENSE +++ b/modules/tooltip/css/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/modules/tooltip/react/LICENSE b/modules/tooltip/react/LICENSE index 0edd43cffc..5bcbbab3b9 100644 --- a/modules/tooltip/react/LICENSE +++ b/modules/tooltip/react/LICENSE @@ -43,7 +43,7 @@ While redistributing the Work or Derivative Works thereof, You may choose to off END OF TERMS AND CONDITIONS -©2019. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. +©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0