@workday/canvas-kit-docs 5.3.0-next.3 → 5.3.0-next.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/LICENSE +1 -1
  2. package/dist/commonjs/lib/specs.js +429 -33
  3. package/dist/es6/lib/specs.js +429 -33
  4. package/dist/mdx/5.0-MIGRATION-GUIDE.mdx +81 -7
  5. package/dist/mdx/6.0-MIGRATION-GUIDE.mdx +560 -0
  6. package/dist/mdx/COMPOUND_COMPONENTS.mdx +31 -30
  7. package/dist/mdx/CONTRIBUTING.mdx +90 -63
  8. package/dist/mdx/TESTING.mdx +29 -5
  9. package/dist/mdx/labs-react/search-form/SearchForm.mdx +64 -0
  10. package/dist/mdx/labs-react/search-form/examples/Basic.tsx +61 -0
  11. package/dist/mdx/labs-react/search-form/examples/CustomTheme.tsx +72 -0
  12. package/dist/mdx/labs-react/search-form/examples/Grow.tsx +62 -0
  13. package/dist/mdx/labs-react/search-form/examples/PropTables.splitProps.tsx +4 -0
  14. package/dist/mdx/labs-react/search-form/examples/RTL.tsx +70 -0
  15. package/dist/mdx/labs-react/search-form/examples/Theming.tsx +64 -0
  16. package/dist/mdx/preview-react/breadcrumbs/Breadcrumbs.mdx +1 -1
  17. package/dist/mdx/preview-react/form-field/FormField.mdx +27 -0
  18. package/dist/mdx/preview-react/form-field/examples/Custom.tsx +57 -0
  19. package/dist/mdx/preview-react/menu/Menu.mdx +17 -9
  20. package/dist/mdx/preview-react/menu/examples/Basic.tsx +65 -10
  21. package/dist/mdx/preview-react/menu/examples/ContextMenu.tsx +47 -29
  22. package/dist/mdx/preview-react/menu/examples/CustomMenuItem.tsx +2 -2
  23. package/dist/mdx/preview-react/menu/examples/Icons.tsx +1 -1
  24. package/dist/mdx/preview-react/menu/examples/ManyItems.tsx +2 -2
  25. package/dist/mdx/preview-react/text-area/TextArea.mdx +122 -0
  26. package/dist/mdx/preview-react/text-area/examples/Alert.tsx +31 -0
  27. package/dist/mdx/preview-react/text-area/examples/Basic.tsx +17 -0
  28. package/dist/mdx/preview-react/text-area/examples/Disabled.tsx +17 -0
  29. package/dist/mdx/preview-react/text-area/examples/Error.tsx +40 -0
  30. package/dist/mdx/preview-react/text-area/examples/Grow.tsx +17 -0
  31. package/dist/mdx/preview-react/text-area/examples/HiddenLabel.tsx +20 -0
  32. package/dist/mdx/preview-react/text-area/examples/LabelPositionHorizontal.tsx +17 -0
  33. package/dist/mdx/preview-react/text-area/examples/LabelPositionVertical.tsx +17 -0
  34. package/dist/mdx/preview-react/text-area/examples/Placeholder.tsx +21 -0
  35. package/dist/mdx/preview-react/text-area/examples/RefForwarding.tsx +28 -0
  36. package/dist/mdx/preview-react/text-area/examples/Required.tsx +17 -0
  37. package/dist/mdx/preview-react/text-area/examples/ResizeConstraints.tsx +22 -0
  38. package/dist/mdx/preview-react/text-input/TextInput.mdx +145 -0
  39. package/dist/mdx/preview-react/text-input/examples/Alert.tsx +40 -0
  40. package/dist/mdx/preview-react/text-input/examples/Basic.tsx +17 -0
  41. package/dist/mdx/preview-react/text-input/examples/Disabled.tsx +17 -0
  42. package/dist/mdx/preview-react/text-input/examples/Error.tsx +40 -0
  43. package/dist/mdx/preview-react/text-input/examples/Grow.tsx +17 -0
  44. package/dist/mdx/preview-react/text-input/examples/HiddenLabel.tsx +20 -0
  45. package/dist/mdx/preview-react/text-input/examples/LabelPositionHorizontal.tsx +17 -0
  46. package/dist/mdx/preview-react/text-input/examples/LabelPositionVertical.tsx +17 -0
  47. package/dist/mdx/preview-react/text-input/examples/LoginForm.tsx +105 -0
  48. package/dist/mdx/preview-react/text-input/examples/Password.tsx +17 -0
  49. package/dist/mdx/preview-react/text-input/examples/Placeholder.tsx +17 -0
  50. package/dist/mdx/preview-react/text-input/examples/RefForwarding.tsx +28 -0
  51. package/dist/mdx/preview-react/text-input/examples/Required.tsx +17 -0
  52. package/dist/mdx/preview-react/text-input/examples/ThemedAlert.tsx +46 -0
  53. package/dist/mdx/preview-react/text-input/examples/ThemedError.tsx +37 -0
  54. package/dist/mdx/react/_examples/CookieBanner.mdx +8 -0
  55. package/dist/mdx/react/_examples/GlobalHeader.mdx +9 -0
  56. package/dist/mdx/react/_examples/PageHeader.mdx +8 -0
  57. package/dist/mdx/react/_examples/examples/CookieBanner.tsx +97 -0
  58. package/dist/mdx/react/_examples/examples/GlobalHeader.tsx +66 -0
  59. package/dist/mdx/react/_examples/examples/PageHeader.tsx +63 -0
  60. package/dist/mdx/react/action-bar/ActionBar.mdx +1 -1
  61. package/dist/mdx/react/button/button/Button.mdx +34 -9
  62. package/dist/mdx/react/button/button/examples/Primary.tsx +11 -1
  63. package/dist/mdx/react/button/button/examples/PrimaryInverse.tsx +14 -0
  64. package/dist/mdx/react/button/button/examples/Secondary.tsx +10 -1
  65. package/dist/mdx/react/button/button/examples/SecondaryInverse.tsx +14 -0
  66. package/dist/mdx/react/button/button/examples/Tertiary.tsx +10 -1
  67. package/dist/mdx/react/button/button/examples/TertiaryInverse.tsx +14 -0
  68. package/dist/mdx/react/button/icon-button/IconButton.mdx +1 -1
  69. package/dist/mdx/react/loading-animation/LoadingAnimation.mdx +5 -0
  70. package/dist/mdx/react/loading-animation/examples/RTL.tsx +16 -0
  71. package/dist/mdx/react/pagination/PropTables.splitprops.tsx +47 -0
  72. package/dist/mdx/react/pagination/examples/{StepControls.tsx → Basic.tsx} +1 -1
  73. package/dist/mdx/react/pagination/examples/GoToForm.tsx +1 -1
  74. package/dist/mdx/react/pagination/examples/HoistedModel.tsx +36 -22
  75. package/dist/mdx/react/pagination/examples/RTL.tsx +1 -1
  76. package/dist/mdx/react/pagination/pagination.mdx +225 -474
  77. package/dist/mdx/react/popup/Popup.mdx +96 -36
  78. package/dist/mdx/react/popup/examples/FullScreen.tsx +115 -0
  79. package/dist/mdx/react/radio/examples/Alert.tsx +3 -3
  80. package/dist/mdx/react/radio/examples/Basic.tsx +3 -3
  81. package/dist/mdx/react/radio/examples/Disabled.tsx +3 -3
  82. package/dist/mdx/react/radio/examples/Error.tsx +3 -3
  83. package/dist/mdx/react/radio/examples/LabelPosition.tsx +3 -3
  84. package/dist/mdx/react/radio/examples/NoValue.tsx +3 -3
  85. package/dist/mdx/react/radio/examples/RefForwarding.tsx +3 -3
  86. package/dist/mdx/react/radio/examples/Required.tsx +3 -3
  87. package/dist/mdx/react/segmented-control/SegmentedControl.mdx +1 -1
  88. package/dist/mdx/react/tabs/Tabs.mdx +67 -36
  89. package/dist/mdx/react/tabs/examples/DisabledTab.tsx +1 -1
  90. package/dist/mdx/react/tabs/examples/DynamicTabs.tsx +82 -38
  91. package/dist/mdx/react/tabs/examples/HoistedModel.tsx +4 -4
  92. package/dist/mdx/react/tabs/examples/Icons.tsx +36 -0
  93. package/dist/mdx/react/tabs/examples/{NamedKeys.tsx → NamedTabs.tsx} +0 -0
  94. package/dist/mdx/react/tabs/examples/OverflowTabs.tsx +58 -0
  95. package/dist/mdx/react/tabs/examples/SinglePanel.tsx +1 -1
  96. package/dist/mdx/react/text-area/TextArea.mdx +1 -1
  97. package/dist/mdx/react/toast/toast.mdx +1 -17
  98. package/dist/mdx/react/tooltip/Tooltip.mdx +9 -1
  99. package/dist/mdx/react/tooltip/examples/DelayedTooltip.tsx +16 -0
  100. package/dist/mdx/react/tooltip/examples/Ellipsis.tsx +6 -0
  101. package/package.json +5 -4
  102. package/dist/mdx/CODE_OF_CONDUCT.md +0 -68
  103. package/dist/mdx/preview-react/menu/examples/ContextMenuTarget.tsx +0 -33
  104. package/dist/mdx/preview-react/menu/examples/ControlButton.tsx +0 -84
  105. package/dist/mdx/react/pagination/examples/ShowAdditionalDetails.tsx +0 -52
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-docs",
3
- "version": "5.3.0-next.3+6f698ff2",
3
+ "version": "5.3.0-next.32+a02de5eb",
4
4
  "description": "Documentation components of Canvas Kit components",
5
5
  "author": "Workday, Inc. (https://www.workday.com)",
6
6
  "license": "Apache-2.0",
@@ -35,7 +35,8 @@
35
35
  "build:specs": "node ./utils/build-specifications.js",
36
36
  "build:downlevel-dts": "yarn run downlevel-dts dist ts3.5/dist",
37
37
  "build": "npm-run-all --parallel build:cjs build:es6 build:mdx --sequential build:specs build:downlevel-dts",
38
- "depcheck": "node ../../utils/check-dependencies-exist.js"
38
+ "depcheck": "node ../../utils/check-dependencies-exist.js",
39
+ "typecheck:src": "tsc -p . --noEmit --incremental false"
39
40
  },
40
41
  "publishConfig": {
41
42
  "access": "public"
@@ -49,7 +50,7 @@
49
50
  ],
50
51
  "dependencies": {
51
52
  "@storybook/csf": "0.0.1",
52
- "@workday/canvas-kit-react": "^5.3.0-next.3+6f698ff2"
53
+ "@workday/canvas-kit-react": "^5.3.0-next.32+a02de5eb"
53
54
  },
54
55
  "devDependencies": {
55
56
  "fs-extra": "^10.0.0",
@@ -57,5 +58,5 @@
57
58
  "mkdirp": "^1.0.3",
58
59
  "typescript": "^3.8.3"
59
60
  },
60
- "gitHead": "6f698ff217cb6ab7bf9aecd86e326eb60a85edbc"
61
+ "gitHead": "a02de5eb284c706211aa55ef3554b11f52668b28"
61
62
  }
@@ -1,68 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as contributors and maintainers
6
- pledge to making participation in our project and our community a harassment-free experience for
7
- everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity
8
- and expression, level of experience, education, socio-economic status, nationality, personal
9
- appearance, race, religion, or sexual identity and orientation.
10
-
11
- ## Our Standards
12
-
13
- Examples of behavior that contributes to creating a positive environment include:
14
-
15
- - Using welcoming and inclusive language
16
- - Being respectful of differing viewpoints and experiences
17
- - Gracefully accepting constructive criticism
18
- - Focusing on what is best for the community
19
- - Showing empathy towards other community members
20
-
21
- Examples of unacceptable behavior by participants include:
22
-
23
- - The use of sexualized language or imagery and unwelcome sexual attention or advances
24
- - Trolling, insulting/derogatory comments, and personal or political attacks
25
- - Public or private harassment
26
- - Publishing others' private information, such as a physical or electronic address, without explicit
27
- permission
28
- - Other conduct which could reasonably be considered inappropriate in a professional setting
29
-
30
- ## Our Responsibilities
31
-
32
- Project maintainers are responsible for clarifying the standards of acceptable behavior and are
33
- expected to take appropriate and fair corrective action in response to any instances of unacceptable
34
- behavior.
35
-
36
- Project maintainers have the right and responsibility to remove, edit, or reject comments, commits,
37
- code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or
38
- to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate,
39
- threatening, offensive, or harmful.
40
-
41
- ## Scope
42
-
43
- This Code of Conduct applies both within project spaces and in public spaces when an individual is
44
- representing the project or its community. Examples of representing a project or community include
45
- using an official project e-mail address, posting via an official social media account, or acting as
46
- an appointed representative at an online or offline event. Representation of a project may be
47
- further defined and clarified by project maintainers.
48
-
49
- ## Enforcement
50
-
51
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting
52
- the project team at design@workday.com. All complaints will be reviewed and investigated and will
53
- result in a response that is deemed necessary and appropriate to the circumstances. The project team
54
- is obligated to maintain confidentiality with regard to the reporter of an incident. Further details
55
- of specific enforcement policies may be posted separately.
56
-
57
- Project maintainers who do not follow or enforce the Code of Conduct in good faith may face
58
- temporary or permanent repercussions as determined by other members of the project's leadership.
59
-
60
- ## Attribution
61
-
62
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at
63
- https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
64
-
65
- [homepage]: https://www.contributor-covenant.org
66
-
67
- For answers to common questions about this code of conduct, see
68
- https://www.contributor-covenant.org/faq
@@ -1,33 +0,0 @@
1
- import React from 'react';
2
-
3
- import {createComponent, useForkRef} from '@workday/canvas-kit-react/common';
4
- import {PopupModelContext} from '@workday/canvas-kit-react/popup';
5
-
6
- interface ContextMenuTargetProps {
7
- children: React.ReactNode;
8
- }
9
-
10
- export default createComponent('div')({
11
- displayName: 'Popup.ContextMenuTarget',
12
- Component: ({children, ...elemProps}: ContextMenuTargetProps, ref, Element) => {
13
- const model = React.useContext(PopupModelContext);
14
- const elementRef = useForkRef(ref, model.state.targetRef as any);
15
-
16
- const onContextMenu = (event: React.MouseEvent) => {
17
- if (model.state.visibility === 'visible') {
18
- model.events.hide({event});
19
- } else if (model.state.visibility === 'hidden') {
20
- model.events.show({event});
21
- }
22
-
23
- // prevent the default context menu from showing to avoid double menus
24
- event.preventDefault();
25
- };
26
-
27
- return (
28
- <Element ref={elementRef} onContextMenu={onContextMenu} {...elemProps}>
29
- {children}
30
- </Element>
31
- );
32
- },
33
- });
@@ -1,84 +0,0 @@
1
- import React, {useRef} from 'react';
2
- import ClickAwayListener from '@material-ui/core/ClickAwayListener';
3
- import {Popper} from '@workday/canvas-kit-react/popup';
4
- import {Menu, MenuItem} from '@workday/canvas-kit-preview-react/menu';
5
- import {SecondaryButton} from '@workday/canvas-kit-react/button';
6
- import uuid from 'uuid/v4';
7
-
8
- export default () => {
9
- const [isOpen, setOpened] = React.useState<boolean | undefined>();
10
- const [anchorEl, setAnchorEl] = React.useState<HTMLElement | null>();
11
- const [selectedItemIndex, setSelectedItemIndex] = React.useState<number>();
12
-
13
- const menuId = `menu-controlled-${uuid()}`;
14
- const controlButtonId = `${menuId}-button`;
15
- const buttonRef = useRef(null);
16
-
17
- const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
18
- const {currentTarget} = event;
19
-
20
- setAnchorEl(currentTarget);
21
- setOpened(!isOpen);
22
- };
23
-
24
- const handleKeyDown = (event: React.KeyboardEvent): void => {
25
- let isShortcut = false;
26
- let nextSelectedIndex = 0;
27
- if (event.key === `Spacebar` || event.key === ` ` || event.key === `Enter`) {
28
- isShortcut = true;
29
- setOpened(!isOpen);
30
- } else if (event.key === `ArrowDown`) {
31
- isShortcut = true;
32
- setOpened(true);
33
- } else if (event.key === `ArrowUp`) {
34
- isShortcut = true;
35
- setOpened(true);
36
-
37
- nextSelectedIndex = -1;
38
- }
39
- if (isShortcut) {
40
- setSelectedItemIndex(nextSelectedIndex);
41
- // this.setState({selectedItemIndex: nextSelectedIndex});
42
- event.stopPropagation();
43
- event.preventDefault();
44
- }
45
- };
46
-
47
- const handleClose = () => {
48
- if (!isOpen) {
49
- return;
50
- }
51
-
52
- setOpened(false);
53
-
54
- if (buttonRef && buttonRef.current) {
55
- buttonRef.current.focus();
56
- }
57
- };
58
-
59
- return (
60
- <ClickAwayListener onClickAway={handleClose}>
61
- <div>
62
- <SecondaryButton
63
- onClick={handleClick}
64
- onKeyDown={handleKeyDown}
65
- aria-expanded={!!isOpen}
66
- aria-haspopup={true}
67
- aria-controls={menuId}
68
- id={controlButtonId}
69
- ref={buttonRef}
70
- >
71
- Open Menu
72
- </SecondaryButton>
73
- <Popper placement={'bottom-start'} open={isOpen} anchorElement={anchorEl}>
74
- <div style={{opacity: isOpen ? 1 : 0, display: isOpen ? `initial` : `none`}}>
75
- <Menu initialSelectedItem={selectedItemIndex} isOpen={isOpen} onClose={handleClose}>
76
- <MenuItem>First Item</MenuItem>
77
- <MenuItem>Second Item</MenuItem>
78
- </Menu>
79
- </div>
80
- </Popper>
81
- </div>
82
- </ClickAwayListener>
83
- );
84
- };
@@ -1,52 +0,0 @@
1
- import * as React from 'react';
2
- import {
3
- Pagination,
4
- getLastPage,
5
- getVisibleResultsMax,
6
- getVisibleResultsMin,
7
- } from '@workday/canvas-kit-react/pagination';
8
-
9
- export default () => {
10
- const resultCount = 10;
11
- const totalCount = 100;
12
- const lastPage = getLastPage(resultCount, totalCount);
13
-
14
- return (
15
- <Pagination
16
- onPageChange={pageNumber => console.log(pageNumber)}
17
- aria-label="Pagination"
18
- lastPage={lastPage}
19
- rangeSize={3}
20
- initialCurrentPage={3}
21
- >
22
- <Pagination.Controls>
23
- <Pagination.JumpToFirstButton aria-label="First" />
24
- <Pagination.StepToPreviousButton aria-label="Previous" />
25
- <Pagination.PageList>
26
- {({state}) =>
27
- state.range.map(pageNumber => (
28
- <Pagination.PageListItem key={pageNumber}>
29
- <Pagination.PageButton aria-label={`Page ${pageNumber}`} pageNumber={pageNumber} />
30
- </Pagination.PageListItem>
31
- ))
32
- }
33
- </Pagination.PageList>
34
- <Pagination.StepToNextButton aria-label="Next" />
35
- <Pagination.JumpToLastButton aria-label="Last" />
36
- <Pagination.GoToForm>
37
- <Pagination.GoToTextInput aria-label="Go to page number" />
38
- <Pagination.GoToLabel>{() => `of ${totalCount} results`}</Pagination.GoToLabel>
39
- </Pagination.GoToForm>
40
- </Pagination.Controls>
41
- <Pagination.AdditionalDetails>
42
- {({state}) =>
43
- `${getVisibleResultsMin(state.currentPage, resultCount)}-${getVisibleResultsMax(
44
- state.currentPage,
45
- resultCount,
46
- totalCount
47
- )} of ${totalCount} results`
48
- }
49
- </Pagination.AdditionalDetails>
50
- </Pagination>
51
- );
52
- };