@workday/canvas-kit-docs 6.0.0-alpha.0-next.30 → 6.0.0-alpha.0-next.36
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.
- package/LICENSE +1 -1
- package/dist/commonjs/lib/specs.js +295 -33
- package/dist/es6/lib/specs.js +295 -33
- package/dist/mdx/6.0-MIGRATION-GUIDE.mdx +117 -14
- package/dist/mdx/7.0-MIGRATION-GUIDE.mdx +33 -0
- package/dist/mdx/COMPOUND_COMPONENTS.mdx +31 -30
- package/dist/mdx/CONTRIBUTING.mdx +90 -63
- package/dist/mdx/preview-react/breadcrumbs/Breadcrumbs.mdx +1 -1
- package/dist/mdx/preview-react/form-field/FormField.mdx +27 -0
- package/dist/mdx/preview-react/form-field/examples/Custom.tsx +57 -0
- package/dist/mdx/preview-react/menu/examples/Icons.tsx +1 -1
- package/dist/mdx/preview-react/menu/examples/ManyItems.tsx +1 -1
- package/dist/mdx/preview-react/text-area/TextArea.mdx +122 -0
- package/dist/mdx/preview-react/text-area/examples/Alert.tsx +31 -0
- package/dist/mdx/preview-react/text-area/examples/Basic.tsx +17 -0
- package/dist/mdx/preview-react/text-area/examples/Disabled.tsx +17 -0
- package/dist/mdx/preview-react/text-area/examples/Error.tsx +40 -0
- package/dist/mdx/preview-react/text-area/examples/Grow.tsx +17 -0
- package/dist/mdx/preview-react/text-area/examples/HiddenLabel.tsx +20 -0
- package/dist/mdx/preview-react/text-area/examples/LabelPositionHorizontal.tsx +17 -0
- package/dist/mdx/preview-react/text-area/examples/LabelPositionVertical.tsx +17 -0
- package/dist/mdx/preview-react/text-area/examples/Placeholder.tsx +21 -0
- package/dist/mdx/preview-react/text-area/examples/RefForwarding.tsx +28 -0
- package/dist/mdx/preview-react/text-area/examples/Required.tsx +17 -0
- package/dist/mdx/preview-react/text-area/examples/ResizeConstraints.tsx +22 -0
- package/dist/mdx/{labs-react → preview-react}/text-input/TextInput.mdx +40 -18
- package/dist/mdx/preview-react/text-input/examples/Alert.tsx +40 -0
- package/dist/mdx/{labs-react/text-input/examples/HiddenLabel.tsx → preview-react/text-input/examples/Basic.tsx} +3 -3
- package/dist/mdx/preview-react/text-input/examples/Disabled.tsx +17 -0
- package/dist/mdx/{labs-react → preview-react}/text-input/examples/Error.tsx +6 -9
- package/dist/mdx/preview-react/text-input/examples/Grow.tsx +17 -0
- package/dist/mdx/preview-react/text-input/examples/HiddenLabel.tsx +20 -0
- package/dist/mdx/preview-react/text-input/examples/LabelPositionHorizontal.tsx +17 -0
- package/dist/mdx/preview-react/text-input/examples/LabelPositionVertical.tsx +17 -0
- package/dist/mdx/{labs-react → preview-react}/text-input/examples/LoginForm.tsx +10 -5
- package/dist/mdx/preview-react/text-input/examples/Password.tsx +17 -0
- package/dist/mdx/preview-react/text-input/examples/Placeholder.tsx +17 -0
- package/dist/mdx/{labs-react → preview-react}/text-input/examples/RefForwarding.tsx +7 -6
- package/dist/mdx/preview-react/text-input/examples/Required.tsx +17 -0
- package/dist/mdx/preview-react/text-input/examples/ThemedAlert.tsx +46 -0
- package/dist/mdx/{labs-react → preview-react}/text-input/examples/ThemedError.tsx +8 -11
- package/dist/mdx/react/_examples/GlobalHeader.mdx +9 -0
- package/dist/mdx/react/_examples/PageHeader.mdx +8 -0
- package/dist/mdx/react/_examples/examples/GlobalHeader.tsx +66 -0
- package/dist/mdx/react/_examples/examples/PageHeader.tsx +63 -0
- package/dist/mdx/react/action-bar/ActionBar.mdx +1 -1
- package/dist/mdx/react/button/button/Button.mdx +7 -7
- package/dist/mdx/react/button/icon-button/IconButton.mdx +1 -1
- package/dist/mdx/react/loading-animation/LoadingAnimation.mdx +5 -0
- package/dist/mdx/react/loading-animation/examples/RTL.tsx +16 -0
- package/dist/mdx/react/pagination/PropTables.splitprops.tsx +47 -0
- package/dist/mdx/react/pagination/examples/{StepControls.tsx → Basic.tsx} +1 -1
- package/dist/mdx/react/pagination/examples/GoToForm.tsx +1 -1
- package/dist/mdx/react/pagination/examples/HoistedModel.tsx +36 -22
- package/dist/mdx/react/pagination/examples/RTL.tsx +1 -1
- package/dist/mdx/react/pagination/pagination.mdx +225 -474
- package/dist/mdx/react/popup/Popup.mdx +34 -36
- package/dist/mdx/react/radio/examples/Alert.tsx +3 -3
- package/dist/mdx/react/radio/examples/Basic.tsx +3 -3
- package/dist/mdx/react/radio/examples/Disabled.tsx +3 -3
- package/dist/mdx/react/radio/examples/Error.tsx +3 -3
- package/dist/mdx/react/radio/examples/LabelPosition.tsx +3 -3
- package/dist/mdx/react/radio/examples/NoValue.tsx +3 -3
- package/dist/mdx/react/radio/examples/RefForwarding.tsx +3 -3
- package/dist/mdx/react/radio/examples/Required.tsx +3 -3
- package/dist/mdx/react/segmented-control/SegmentedControl.mdx +1 -1
- package/dist/mdx/react/tabs/Tabs.mdx +67 -36
- package/dist/mdx/react/tabs/examples/DisabledTab.tsx +1 -1
- package/dist/mdx/react/tabs/examples/DynamicTabs.tsx +41 -13
- package/dist/mdx/react/tabs/examples/HoistedModel.tsx +4 -4
- package/dist/mdx/react/tabs/examples/Icons.tsx +36 -0
- package/dist/mdx/react/tabs/examples/{NamedKeys.tsx → NamedTabs.tsx} +0 -0
- package/dist/mdx/react/tabs/examples/OverflowTabs.tsx +58 -0
- package/dist/mdx/react/tabs/examples/SinglePanel.tsx +1 -1
- package/dist/mdx/react/toast/toast.mdx +1 -17
- package/dist/mdx/react/tooltip/Tooltip.mdx +9 -1
- package/dist/mdx/react/tooltip/examples/DelayedTooltip.tsx +16 -0
- package/dist/mdx/react/tooltip/examples/Ellipsis.tsx +6 -0
- package/package.json +5 -4
- package/dist/mdx/CODE_OF_CONDUCT.md +0 -68
- package/dist/mdx/labs-react/text-input/examples/Alert.tsx +0 -46
- package/dist/mdx/labs-react/text-input/examples/Basic.tsx +0 -20
- package/dist/mdx/labs-react/text-input/examples/Disabled.tsx +0 -20
- package/dist/mdx/labs-react/text-input/examples/Grow.tsx +0 -20
- package/dist/mdx/labs-react/text-input/examples/LabelPosition.tsx +0 -20
- package/dist/mdx/labs-react/text-input/examples/Password.tsx +0 -20
- package/dist/mdx/labs-react/text-input/examples/Placeholder.tsx +0 -20
- package/dist/mdx/labs-react/text-input/examples/Required.tsx +0 -20
- package/dist/mdx/labs-react/text-input/examples/ThemedAlert.tsx +0 -51
- 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
|
-
};
|