@workday/canvas-kit-docs 5.3.0-next.10 → 5.3.0-next.24

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 (95) hide show
  1. package/LICENSE +1 -1
  2. package/dist/commonjs/lib/specs.js +295 -33
  3. package/dist/es6/lib/specs.js +295 -33
  4. package/dist/mdx/6.0-MIGRATION-GUIDE.mdx +265 -1
  5. package/dist/mdx/COMPOUND_COMPONENTS.mdx +31 -30
  6. package/dist/mdx/CONTRIBUTING.mdx +90 -63
  7. package/dist/mdx/preview-react/breadcrumbs/Breadcrumbs.mdx +1 -1
  8. package/dist/mdx/preview-react/form-field/FormField.mdx +27 -0
  9. package/dist/mdx/preview-react/form-field/examples/Custom.tsx +57 -0
  10. package/dist/mdx/preview-react/menu/examples/Icons.tsx +1 -1
  11. package/dist/mdx/preview-react/menu/examples/ManyItems.tsx +1 -1
  12. package/dist/mdx/preview-react/text-area/TextArea.mdx +122 -0
  13. package/dist/mdx/preview-react/text-area/examples/Alert.tsx +31 -0
  14. package/dist/mdx/preview-react/text-area/examples/Basic.tsx +17 -0
  15. package/dist/mdx/preview-react/text-area/examples/Disabled.tsx +17 -0
  16. package/dist/mdx/preview-react/text-area/examples/Error.tsx +40 -0
  17. package/dist/mdx/preview-react/text-area/examples/Grow.tsx +17 -0
  18. package/dist/mdx/preview-react/text-area/examples/HiddenLabel.tsx +20 -0
  19. package/dist/mdx/preview-react/text-area/examples/LabelPositionHorizontal.tsx +17 -0
  20. package/dist/mdx/preview-react/text-area/examples/LabelPositionVertical.tsx +17 -0
  21. package/dist/mdx/preview-react/text-area/examples/Placeholder.tsx +21 -0
  22. package/dist/mdx/preview-react/text-area/examples/RefForwarding.tsx +28 -0
  23. package/dist/mdx/preview-react/text-area/examples/Required.tsx +17 -0
  24. package/dist/mdx/preview-react/text-area/examples/ResizeConstraints.tsx +22 -0
  25. package/dist/mdx/{labs-react → preview-react}/text-input/TextInput.mdx +40 -18
  26. package/dist/mdx/preview-react/text-input/examples/Alert.tsx +40 -0
  27. package/dist/mdx/{labs-react/text-input/examples/HiddenLabel.tsx → preview-react/text-input/examples/Basic.tsx} +3 -3
  28. package/dist/mdx/preview-react/text-input/examples/Disabled.tsx +17 -0
  29. package/dist/mdx/{labs-react → preview-react}/text-input/examples/Error.tsx +6 -9
  30. package/dist/mdx/preview-react/text-input/examples/Grow.tsx +17 -0
  31. package/dist/mdx/preview-react/text-input/examples/HiddenLabel.tsx +20 -0
  32. package/dist/mdx/preview-react/text-input/examples/LabelPositionHorizontal.tsx +17 -0
  33. package/dist/mdx/preview-react/text-input/examples/LabelPositionVertical.tsx +17 -0
  34. package/dist/mdx/{labs-react → preview-react}/text-input/examples/LoginForm.tsx +10 -5
  35. package/dist/mdx/preview-react/text-input/examples/Password.tsx +17 -0
  36. package/dist/mdx/preview-react/text-input/examples/Placeholder.tsx +17 -0
  37. package/dist/mdx/{labs-react → preview-react}/text-input/examples/RefForwarding.tsx +7 -6
  38. package/dist/mdx/preview-react/text-input/examples/Required.tsx +17 -0
  39. package/dist/mdx/preview-react/text-input/examples/ThemedAlert.tsx +46 -0
  40. package/dist/mdx/{labs-react → preview-react}/text-input/examples/ThemedError.tsx +8 -11
  41. package/dist/mdx/react/_examples/GlobalHeader.mdx +9 -0
  42. package/dist/mdx/react/_examples/PageHeader.mdx +8 -0
  43. package/dist/mdx/react/_examples/examples/GlobalHeader.tsx +66 -0
  44. package/dist/mdx/react/_examples/examples/PageHeader.tsx +63 -0
  45. package/dist/mdx/react/action-bar/ActionBar.mdx +1 -1
  46. package/dist/mdx/react/button/button/Button.mdx +34 -9
  47. package/dist/mdx/react/button/button/examples/Primary.tsx +10 -1
  48. package/dist/mdx/react/button/button/examples/PrimaryInverse.tsx +14 -0
  49. package/dist/mdx/react/button/button/examples/Secondary.tsx +10 -1
  50. package/dist/mdx/react/button/button/examples/SecondaryInverse.tsx +14 -0
  51. package/dist/mdx/react/button/button/examples/Tertiary.tsx +10 -1
  52. package/dist/mdx/react/button/button/examples/TertiaryInverse.tsx +14 -0
  53. package/dist/mdx/react/button/icon-button/IconButton.mdx +1 -1
  54. package/dist/mdx/react/loading-animation/LoadingAnimation.mdx +5 -0
  55. package/dist/mdx/react/loading-animation/examples/RTL.tsx +16 -0
  56. package/dist/mdx/react/pagination/PropTables.splitprops.tsx +47 -0
  57. package/dist/mdx/react/pagination/examples/{StepControls.tsx → Basic.tsx} +1 -1
  58. package/dist/mdx/react/pagination/examples/GoToForm.tsx +1 -1
  59. package/dist/mdx/react/pagination/examples/HoistedModel.tsx +36 -22
  60. package/dist/mdx/react/pagination/examples/RTL.tsx +1 -1
  61. package/dist/mdx/react/pagination/pagination.mdx +225 -474
  62. package/dist/mdx/react/popup/Popup.mdx +34 -36
  63. package/dist/mdx/react/radio/examples/Alert.tsx +3 -3
  64. package/dist/mdx/react/radio/examples/Basic.tsx +3 -3
  65. package/dist/mdx/react/radio/examples/Disabled.tsx +3 -3
  66. package/dist/mdx/react/radio/examples/Error.tsx +3 -3
  67. package/dist/mdx/react/radio/examples/LabelPosition.tsx +3 -3
  68. package/dist/mdx/react/radio/examples/NoValue.tsx +3 -3
  69. package/dist/mdx/react/radio/examples/RefForwarding.tsx +3 -3
  70. package/dist/mdx/react/radio/examples/Required.tsx +3 -3
  71. package/dist/mdx/react/segmented-control/SegmentedControl.mdx +1 -1
  72. package/dist/mdx/react/tabs/Tabs.mdx +67 -36
  73. package/dist/mdx/react/tabs/examples/DisabledTab.tsx +1 -1
  74. package/dist/mdx/react/tabs/examples/DynamicTabs.tsx +41 -13
  75. package/dist/mdx/react/tabs/examples/HoistedModel.tsx +4 -4
  76. package/dist/mdx/react/tabs/examples/Icons.tsx +36 -0
  77. package/dist/mdx/react/tabs/examples/{NamedKeys.tsx → NamedTabs.tsx} +0 -0
  78. package/dist/mdx/react/tabs/examples/OverflowTabs.tsx +58 -0
  79. package/dist/mdx/react/tabs/examples/SinglePanel.tsx +1 -1
  80. package/dist/mdx/react/toast/toast.mdx +1 -17
  81. package/dist/mdx/react/tooltip/Tooltip.mdx +9 -1
  82. package/dist/mdx/react/tooltip/examples/DelayedTooltip.tsx +16 -0
  83. package/dist/mdx/react/tooltip/examples/Ellipsis.tsx +6 -0
  84. package/package.json +5 -4
  85. package/dist/mdx/CODE_OF_CONDUCT.md +0 -68
  86. package/dist/mdx/labs-react/text-input/examples/Alert.tsx +0 -46
  87. package/dist/mdx/labs-react/text-input/examples/Basic.tsx +0 -20
  88. package/dist/mdx/labs-react/text-input/examples/Disabled.tsx +0 -20
  89. package/dist/mdx/labs-react/text-input/examples/Grow.tsx +0 -20
  90. package/dist/mdx/labs-react/text-input/examples/LabelPosition.tsx +0 -20
  91. package/dist/mdx/labs-react/text-input/examples/Password.tsx +0 -20
  92. package/dist/mdx/labs-react/text-input/examples/Placeholder.tsx +0 -20
  93. package/dist/mdx/labs-react/text-input/examples/Required.tsx +0 -20
  94. package/dist/mdx/labs-react/text-input/examples/ThemedAlert.tsx +0 -51
  95. package/dist/mdx/react/pagination/examples/ShowAdditionalDetails.tsx +0 -52
@@ -1,51 +0,0 @@
1
- import React from 'react';
2
- import {TextInput} from '@workday/canvas-kit-labs-react/text-input';
3
- import {useThemedRing} from '@workday/canvas-kit-labs-react/common';
4
- import {VStack} from '@workday/canvas-kit-labs-react/layout';
5
- import {CanvasProvider, PartialEmotionCanvasTheme, styled} from '@workday/canvas-kit-react/common';
6
- import {colors, CSSProperties, space} from '@workday/canvas-kit-react/tokens';
7
-
8
- export default () => {
9
- const theme: PartialEmotionCanvasTheme = {
10
- canvas: {
11
- palette: {
12
- common: {
13
- focusOutline: colors.grapeSoda300,
14
- },
15
- alert: {
16
- main: colors.kiwi500,
17
- darkest: colors.kiwi600,
18
- },
19
- },
20
- },
21
- };
22
- return (
23
- <CanvasProvider theme={theme}>
24
- <AlertInput />
25
- </CanvasProvider>
26
- );
27
- };
28
-
29
- const StyledField = styled(TextInput.Field)<{alertStyles?: CSSProperties}>(
30
- ({alertStyles}) => alertStyles
31
- );
32
-
33
- const AlertInput = () => {
34
- const [value, setValue] = React.useState('invalid@email');
35
-
36
- const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
37
- setValue(event.target.value);
38
- };
39
-
40
- const alertStyles = useThemedRing('alert');
41
-
42
- return (
43
- <VStack spacing="xxxs" alignItems="flex-start">
44
- <TextInput>
45
- <TextInput.Label>Email</TextInput.Label>
46
- <StyledField alertStyles={alertStyles} onChange={handleChange} value={value} />
47
- <TextInput.Hint paddingTop={space.xxs}>Please enter a valid email.</TextInput.Hint>
48
- </TextInput>
49
- </VStack>
50
- );
51
- };
@@ -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
- };