@workday/canvas-kit-docs 11.0.0-alpha.790-next.0 → 11.0.0-alpha.793-next.0
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/dist/es6/lib/docs.js +52 -3
- package/dist/mdx/preview-react/_examples/examples/TextInputWithReactHookForm.tsx +9 -5
- package/dist/mdx/preview-react/form-field/examples/AllFields.tsx +10 -8
- package/dist/mdx/preview-react/form-field/examples/RefForwarding.tsx +9 -1
- package/dist/mdx/preview-react/form-field/examples/ThemedErrors.tsx +9 -1
- package/dist/mdx/preview-react/radio/examples/Basic.tsx +6 -1
- package/dist/mdx/preview-react/radio/examples/Custom.tsx +21 -4
- package/dist/mdx/preview-react/radio/examples/Inverse.tsx +16 -10
- package/dist/mdx/preview-react/status-indicator/examples/Emphasis.tsx +7 -1
- package/dist/mdx/preview-react/status-indicator/examples/Icon.tsx +7 -1
- package/dist/mdx/preview-react/status-indicator/examples/Overflow.tsx +7 -1
- package/dist/mdx/preview-react/status-indicator/examples/Variants.tsx +15 -3
- package/dist/mdx/react/button/button/examples/Delete.tsx +8 -1
- package/dist/mdx/react/button/button/examples/ExternalHyperlinkInverse.tsx +8 -1
- package/dist/mdx/react/button/button/examples/HyperlinkInverse.tsx +8 -1
- package/dist/mdx/react/button/button/examples/Primary.tsx +8 -1
- package/dist/mdx/react/button/button/examples/PrimaryInverse.tsx +9 -1
- package/dist/mdx/react/button/button/examples/Secondary.tsx +8 -1
- package/dist/mdx/react/button/button/examples/SecondaryInverse.tsx +9 -1
- package/dist/mdx/react/button/button/examples/Tertiary.tsx +8 -1
- package/dist/mdx/react/button/button/examples/TertiaryInverse.tsx +9 -2
- package/dist/mdx/react/checkbox/examples/Indeterminate.tsx +8 -1
- package/dist/mdx/react/checkbox/examples/Inverse.tsx +9 -1
- package/dist/mdx/react/combobox/examples/Autocomplete.tsx +20 -4
- package/dist/mdx/react/icon/examples/AccentIconList.tsx +23 -10
- package/dist/mdx/react/icon/examples/AppletIconList.tsx +23 -10
- package/dist/mdx/react/icon/examples/IconList.tsx +24 -10
- package/dist/mdx/react/icon/examples/Overview.tsx +15 -2
- package/dist/mdx/react/loading-dots/examples/Accessible.tsx +12 -7
- package/dist/mdx/react/select/examples/Alert.tsx +6 -1
- package/dist/mdx/react/select/examples/Basic.tsx +6 -1
- package/dist/mdx/react/select/examples/Complex.tsx +6 -1
- package/dist/mdx/react/select/examples/Disabled.tsx +6 -1
- package/dist/mdx/react/select/examples/DisabledOption.tsx +6 -1
- package/dist/mdx/react/select/examples/Error.tsx +6 -1
- package/dist/mdx/react/select/examples/FetchingDynamicItems.tsx +7 -1
- package/dist/mdx/react/select/examples/InitialSelectedItem.tsx +6 -1
- package/dist/mdx/react/select/examples/MenuHeight.tsx +6 -1
- package/dist/mdx/react/select/examples/Placeholder.tsx +6 -1
- package/dist/mdx/react/select/examples/Required.tsx +6 -1
- package/dist/mdx/react/select/examples/WithIcons.tsx +12 -2
- package/dist/mdx/react/table/examples/Basic.tsx +8 -2
- package/dist/mdx/react/table/examples/BasicWithHeading.tsx +14 -3
- package/dist/mdx/react/table/examples/FixedColumn.tsx +21 -17
- package/dist/mdx/react/table/examples/RightToLeft.tsx +8 -2
- package/package.json +6 -6
|
@@ -17,6 +17,8 @@ import {FormField} from '@workday/canvas-kit-preview-react/form-field';
|
|
|
17
17
|
import {StyledMenuItem} from '@workday/canvas-kit-react/menu';
|
|
18
18
|
import {LoadingDots} from '@workday/canvas-kit-react/loading-dots';
|
|
19
19
|
import {InputGroup, TextInput} from '@workday/canvas-kit-react/text-input';
|
|
20
|
+
import {createStyles, px2rem} from '@workday/canvas-kit-styling';
|
|
21
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
20
22
|
|
|
21
23
|
const colors = ['Red', 'Blue', 'Purple', 'Green', 'Pink'];
|
|
22
24
|
const fruits = ['Apple', 'Orange', 'Banana', 'Grape', 'Lemon', 'Lime'];
|
|
@@ -44,6 +46,20 @@ const AutoCompleteInput = createSubcomponent(TextInput)({
|
|
|
44
46
|
return <Combobox.Input as={Element} {...elemProps} />;
|
|
45
47
|
});
|
|
46
48
|
|
|
49
|
+
const styleOverrides = {
|
|
50
|
+
inputGroupInner: createStyles({
|
|
51
|
+
width: px2rem(20),
|
|
52
|
+
transition: 'opacity 100ms ease',
|
|
53
|
+
}),
|
|
54
|
+
loadingDots: createStyles({
|
|
55
|
+
display: 'flex',
|
|
56
|
+
transform: 'scale(0.3)',
|
|
57
|
+
}),
|
|
58
|
+
comboboxMenuList: createStyles({
|
|
59
|
+
maxHeight: px2rem(200),
|
|
60
|
+
}),
|
|
61
|
+
};
|
|
62
|
+
|
|
47
63
|
export default () => {
|
|
48
64
|
const {model, loader} = useComboboxLoader(
|
|
49
65
|
{
|
|
@@ -95,12 +111,12 @@ export default () => {
|
|
|
95
111
|
<InputGroup>
|
|
96
112
|
<InputGroup.Input as={FormField.Input.as(AutoCompleteInput)} />
|
|
97
113
|
<InputGroup.InnerEnd
|
|
114
|
+
cs={styleOverrides.inputGroupInner}
|
|
98
115
|
pointerEvents="none"
|
|
99
|
-
style={{opacity: loader.isLoading ?
|
|
100
|
-
width={20}
|
|
116
|
+
style={{opacity: loader.isLoading ? system.opacity.full : system.opacity.zero}}
|
|
101
117
|
data-loading={loader.isLoading}
|
|
102
118
|
>
|
|
103
|
-
<LoadingDots
|
|
119
|
+
<LoadingDots cs={styleOverrides.loadingDots} />
|
|
104
120
|
</InputGroup.InnerEnd>
|
|
105
121
|
<InputGroup.InnerEnd>
|
|
106
122
|
<InputGroup.ClearButton data-testid="clear" />
|
|
@@ -112,7 +128,7 @@ export default () => {
|
|
|
112
128
|
<StyledMenuItem as="span">No Results Found</StyledMenuItem>
|
|
113
129
|
)}
|
|
114
130
|
{model.state.items.length > 0 && (
|
|
115
|
-
<Combobox.Menu.List
|
|
131
|
+
<Combobox.Menu.List cs={styleOverrides.comboboxMenuList}>
|
|
116
132
|
{item => <Combobox.Menu.Item>{item}</Combobox.Menu.Item>}
|
|
117
133
|
</Combobox.Menu.List>
|
|
118
134
|
)}
|
|
@@ -3,11 +3,31 @@ import * as CanvasAccenttIcons from '@workday/canvas-accent-icons-web';
|
|
|
3
3
|
import {Box, Flex} from '@workday/canvas-kit-react/layout';
|
|
4
4
|
import {AccentIcon} from '@workday/canvas-kit-react/icon';
|
|
5
5
|
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
6
|
+
import {createStyles, px2rem} from '@workday/canvas-kit-styling';
|
|
7
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
6
8
|
|
|
7
9
|
const ImportedIcons = Object.keys(CanvasAccenttIcons);
|
|
8
10
|
|
|
9
11
|
const allIcons = ImportedIcons.filter(icon => icon !== 'CanvasAccenttIcons');
|
|
10
12
|
|
|
13
|
+
const styleOverrides = {
|
|
14
|
+
parentContainer: createStyles({
|
|
15
|
+
flexDirection: 'column',
|
|
16
|
+
alignItems: 'center',
|
|
17
|
+
gap: system.space.x6,
|
|
18
|
+
}),
|
|
19
|
+
iconGroupContainer: createStyles({
|
|
20
|
+
flexWrap: 'wrap',
|
|
21
|
+
}),
|
|
22
|
+
individualIconContainer: createStyles({
|
|
23
|
+
alignItems: 'center',
|
|
24
|
+
width: `max(${px2rem(320)},20%)`,
|
|
25
|
+
flexDirection: 'row',
|
|
26
|
+
gap: system.space.x3,
|
|
27
|
+
padding: system.space.x3,
|
|
28
|
+
}),
|
|
29
|
+
};
|
|
30
|
+
|
|
11
31
|
export default () => {
|
|
12
32
|
const [value, setValue] = React.useState('');
|
|
13
33
|
|
|
@@ -16,9 +36,9 @@ export default () => {
|
|
|
16
36
|
};
|
|
17
37
|
|
|
18
38
|
return (
|
|
19
|
-
<Flex
|
|
39
|
+
<Flex cs={styleOverrides.parentContainer}>
|
|
20
40
|
<TextInput onKeyDown={e => handleSearch(e)} placeholder="Search for an icon" />
|
|
21
|
-
<Flex
|
|
41
|
+
<Flex cs={styleOverrides.iconGroupContainer}>
|
|
22
42
|
{allIcons
|
|
23
43
|
.filter(icon => {
|
|
24
44
|
if (value === '') {
|
|
@@ -29,14 +49,7 @@ export default () => {
|
|
|
29
49
|
})
|
|
30
50
|
.map((singleIcon, index) => {
|
|
31
51
|
return (
|
|
32
|
-
<Flex
|
|
33
|
-
alignItems="center"
|
|
34
|
-
width={'max(320px,20%)'}
|
|
35
|
-
flexDirection="row"
|
|
36
|
-
gap="xs"
|
|
37
|
-
padding="xs"
|
|
38
|
-
key={index}
|
|
39
|
-
>
|
|
52
|
+
<Flex cs={styleOverrides.individualIconContainer} key={index}>
|
|
40
53
|
<Box>
|
|
41
54
|
<AccentIcon icon={CanvasAccenttIcons[singleIcon]} />
|
|
42
55
|
</Box>
|
|
@@ -3,11 +3,31 @@ import * as CanvasAppletIcons from '@workday/canvas-applet-icons-web';
|
|
|
3
3
|
import {Box, Flex} from '@workday/canvas-kit-react/layout';
|
|
4
4
|
import {AppletIcon} from '@workday/canvas-kit-react/icon';
|
|
5
5
|
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
6
|
+
import {createStyles, px2rem} from '@workday/canvas-kit-styling';
|
|
7
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
6
8
|
|
|
7
9
|
const ImportedIcons = Object.keys(CanvasAppletIcons);
|
|
8
10
|
|
|
9
11
|
const allIcons = ImportedIcons.filter(icon => icon !== 'CanvasAppletIcons');
|
|
10
12
|
|
|
13
|
+
const styleOverrides = {
|
|
14
|
+
parentContainer: createStyles({
|
|
15
|
+
flexDirection: 'column',
|
|
16
|
+
alignItems: 'center',
|
|
17
|
+
gap: system.space.x6,
|
|
18
|
+
}),
|
|
19
|
+
iconGroupContainer: createStyles({
|
|
20
|
+
flexWrap: 'wrap',
|
|
21
|
+
}),
|
|
22
|
+
individualIconContainer: createStyles({
|
|
23
|
+
alignItems: 'center',
|
|
24
|
+
width: `max(${px2rem(320)},20%)`,
|
|
25
|
+
flexDirection: 'row',
|
|
26
|
+
gap: system.space.x3,
|
|
27
|
+
padding: system.space.x3,
|
|
28
|
+
}),
|
|
29
|
+
};
|
|
30
|
+
|
|
11
31
|
export default () => {
|
|
12
32
|
const [value, setValue] = React.useState('');
|
|
13
33
|
|
|
@@ -16,9 +36,9 @@ export default () => {
|
|
|
16
36
|
};
|
|
17
37
|
|
|
18
38
|
return (
|
|
19
|
-
<Flex
|
|
39
|
+
<Flex cs={styleOverrides.parentContainer}>
|
|
20
40
|
<TextInput onKeyDown={e => handleSearch(e)} placeholder="Search for an icon" />
|
|
21
|
-
<Flex
|
|
41
|
+
<Flex cs={styleOverrides.iconGroupContainer}>
|
|
22
42
|
{allIcons
|
|
23
43
|
.filter(icon => {
|
|
24
44
|
if (value === '') {
|
|
@@ -29,14 +49,7 @@ export default () => {
|
|
|
29
49
|
})
|
|
30
50
|
.map((singleIcon, index) => {
|
|
31
51
|
return (
|
|
32
|
-
<Flex
|
|
33
|
-
alignItems="center"
|
|
34
|
-
width={'max(320px,20%)'}
|
|
35
|
-
flexDirection="row"
|
|
36
|
-
gap="xs"
|
|
37
|
-
padding="xs"
|
|
38
|
-
key={index}
|
|
39
|
-
>
|
|
52
|
+
<Flex cs={styleOverrides.individualIconContainer} key={index}>
|
|
40
53
|
<Box>
|
|
41
54
|
<AppletIcon icon={CanvasAppletIcons[singleIcon]} />
|
|
42
55
|
</Box>
|
|
@@ -3,10 +3,31 @@ import * as CanvasIcons from '@workday/canvas-system-icons-web';
|
|
|
3
3
|
import {Box, Flex} from '@workday/canvas-kit-react/layout';
|
|
4
4
|
import {SystemIcon} from '@workday/canvas-kit-react/icon';
|
|
5
5
|
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
6
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
7
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
6
8
|
|
|
7
9
|
const ImportedIcons = Object.keys(CanvasIcons);
|
|
8
10
|
|
|
9
11
|
const allIcons = ImportedIcons.filter(icon => icon !== 'CanvasSystemIcons');
|
|
12
|
+
|
|
13
|
+
const styleOverrides = {
|
|
14
|
+
parentContainer: createStyles({
|
|
15
|
+
flexDirection: 'column',
|
|
16
|
+
alignItems: 'center',
|
|
17
|
+
gap: system.space.x6,
|
|
18
|
+
}),
|
|
19
|
+
firstChildContainer: createStyles({
|
|
20
|
+
flexWrap: 'wrap',
|
|
21
|
+
}),
|
|
22
|
+
secondChildContainer: createStyles({
|
|
23
|
+
alignItems: 'center',
|
|
24
|
+
width: `max(320px,20%)`,
|
|
25
|
+
flexDirection: 'row',
|
|
26
|
+
gap: system.space.x3,
|
|
27
|
+
padding: system.space.x3,
|
|
28
|
+
}),
|
|
29
|
+
};
|
|
30
|
+
|
|
10
31
|
export default () => {
|
|
11
32
|
const [value, setValue] = React.useState('');
|
|
12
33
|
|
|
@@ -15,9 +36,9 @@ export default () => {
|
|
|
15
36
|
};
|
|
16
37
|
|
|
17
38
|
return (
|
|
18
|
-
<Flex
|
|
39
|
+
<Flex cs={styleOverrides.parentContainer}>
|
|
19
40
|
<TextInput onKeyDown={e => handleSearch(e)} placeholder="Search for an icon" />
|
|
20
|
-
<Flex
|
|
41
|
+
<Flex cs={styleOverrides.firstChildContainer}>
|
|
21
42
|
{allIcons
|
|
22
43
|
.filter(icon => {
|
|
23
44
|
if (value === '') {
|
|
@@ -28,14 +49,7 @@ export default () => {
|
|
|
28
49
|
})
|
|
29
50
|
.map((singleIcon, index) => {
|
|
30
51
|
return (
|
|
31
|
-
<Flex
|
|
32
|
-
alignItems="center"
|
|
33
|
-
width={'max(320px,20%)'}
|
|
34
|
-
flexDirection="row"
|
|
35
|
-
gap="xs"
|
|
36
|
-
padding="xs"
|
|
37
|
-
key={index}
|
|
38
|
-
>
|
|
52
|
+
<Flex cs={styleOverrides.secondChildContainer} key={index}>
|
|
39
53
|
<Box>
|
|
40
54
|
<SystemIcon icon={CanvasIcons[singleIcon]} />
|
|
41
55
|
</Box>
|
|
@@ -8,6 +8,8 @@ import {CanvasGraphic, CanvasIconTypes} from '@workday/design-assets-types';
|
|
|
8
8
|
|
|
9
9
|
import {AccentIcon, AppletIcon, SystemIcon, SystemIconCircle, Graphic} from '../../index';
|
|
10
10
|
import {activityStreamIcon} from '@workday/canvas-system-icons-web';
|
|
11
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
12
|
+
import {base, system} from '@workday/canvas-tokens-web';
|
|
11
13
|
|
|
12
14
|
const graphicExample: CanvasGraphic = {
|
|
13
15
|
name: 'badgeAchievement',
|
|
@@ -18,11 +20,22 @@ const graphicExample: CanvasGraphic = {
|
|
|
18
20
|
tags: [],
|
|
19
21
|
};
|
|
20
22
|
|
|
23
|
+
const styleOverrides = {
|
|
24
|
+
container: createStyles({
|
|
25
|
+
flexDirection: 'row',
|
|
26
|
+
alignItems: 'center',
|
|
27
|
+
gap: system.space.x4,
|
|
28
|
+
}),
|
|
29
|
+
systemIconStyles: createStyles({
|
|
30
|
+
background: base.berrySmoothie100,
|
|
31
|
+
}),
|
|
32
|
+
};
|
|
33
|
+
|
|
21
34
|
export default () => (
|
|
22
|
-
<Flex
|
|
35
|
+
<Flex cs={styleOverrides.container}>
|
|
23
36
|
<AccentIcon icon={shieldIcon} />
|
|
24
37
|
<AppletIcon icon={benefitsIcon} />
|
|
25
|
-
<SystemIcon icon={activityStreamIcon}
|
|
38
|
+
<SystemIcon icon={activityStreamIcon} cs={styleOverrides.systemIconStyles} />
|
|
26
39
|
<SystemIconCircle icon={activityStreamIcon} />
|
|
27
40
|
<Graphic src={graphicExample} />
|
|
28
41
|
</Flex>
|
|
@@ -3,13 +3,18 @@ import {LoadingDots} from '@workday/canvas-kit-react/loading-dots';
|
|
|
3
3
|
import {base, system} from '@workday/canvas-tokens-web';
|
|
4
4
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
5
5
|
import {SecondaryButton} from '@workday/canvas-kit-react/button';
|
|
6
|
-
import {createStyles
|
|
6
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
7
7
|
import {AccessibleHide, AriaLiveRegion} from '@workday/canvas-kit-react/common';
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
})
|
|
9
|
+
const styleOverrides = {
|
|
10
|
+
parentContainer: createStyles({
|
|
11
|
+
gap: system.space.x4,
|
|
12
|
+
}),
|
|
13
|
+
loadingStyles: createStyles({
|
|
14
|
+
backgroundColor: system.color.bg.muted.default,
|
|
15
|
+
padding: system.space.x3,
|
|
16
|
+
}),
|
|
17
|
+
};
|
|
13
18
|
|
|
14
19
|
export default () => {
|
|
15
20
|
const [loadingState, setLoadingState] = React.useState('idle');
|
|
@@ -31,11 +36,11 @@ export default () => {
|
|
|
31
36
|
};
|
|
32
37
|
|
|
33
38
|
return (
|
|
34
|
-
<Flex
|
|
39
|
+
<Flex cs={styleOverrides.parentContainer}>
|
|
35
40
|
<SecondaryButton onClick={handleLoad}>Start</SecondaryButton>
|
|
36
41
|
<AriaLiveRegion aria-label="Loading">
|
|
37
42
|
{loadingState === 'loading' && (
|
|
38
|
-
<LoadingDots
|
|
43
|
+
<LoadingDots cs={styleOverrides.loadingStyles} role="img" aria-label="Please wait..." />
|
|
39
44
|
)}
|
|
40
45
|
{loadingState === 'success' && <AccessibleHide>Complete.</AccessibleHide>}
|
|
41
46
|
</AriaLiveRegion>
|
|
@@ -2,6 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import {FormField} from '@workday/canvas-kit-preview-react/form-field';
|
|
3
3
|
import {Select} from '@workday/canvas-kit-react/select';
|
|
4
4
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
5
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
6
|
+
|
|
7
|
+
const parentContainerStyles = createStyles({
|
|
8
|
+
flexDirection: 'column',
|
|
9
|
+
});
|
|
5
10
|
|
|
6
11
|
const options = [
|
|
7
12
|
'E-mail',
|
|
@@ -19,7 +24,7 @@ export default () => {
|
|
|
19
24
|
setValue(event.target.value);
|
|
20
25
|
};
|
|
21
26
|
return (
|
|
22
|
-
<Flex
|
|
27
|
+
<Flex cs={parentContainerStyles}>
|
|
23
28
|
<Select items={options}>
|
|
24
29
|
<FormField error="alert">
|
|
25
30
|
<FormField.Label>Contact</FormField.Label>
|
|
@@ -2,6 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import {FormField} from '@workday/canvas-kit-preview-react/form-field';
|
|
3
3
|
import {Select} from '@workday/canvas-kit-react/select';
|
|
4
4
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
5
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
6
|
+
|
|
7
|
+
const parentContainerStyles = createStyles({
|
|
8
|
+
flexDirection: 'column',
|
|
9
|
+
});
|
|
5
10
|
|
|
6
11
|
const options = [
|
|
7
12
|
'E-mail',
|
|
@@ -20,7 +25,7 @@ export default () => {
|
|
|
20
25
|
};
|
|
21
26
|
|
|
22
27
|
return (
|
|
23
|
-
<Flex
|
|
28
|
+
<Flex cs={parentContainerStyles}>
|
|
24
29
|
<Select items={options}>
|
|
25
30
|
<FormField>
|
|
26
31
|
<FormField.Label>Contact</FormField.Label>
|
|
@@ -2,6 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import {FormField} from '@workday/canvas-kit-preview-react/form-field';
|
|
3
3
|
import {Select} from '@workday/canvas-kit-react/select';
|
|
4
4
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
5
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
6
|
+
|
|
7
|
+
const parentContainerStyles = createStyles({
|
|
8
|
+
flexDirection: 'column',
|
|
9
|
+
});
|
|
5
10
|
|
|
6
11
|
const options = [
|
|
7
12
|
{serverId: 'email', label: 'E-mail'},
|
|
@@ -25,7 +30,7 @@ export default () => {
|
|
|
25
30
|
};
|
|
26
31
|
|
|
27
32
|
return (
|
|
28
|
-
<Flex
|
|
33
|
+
<Flex cs={parentContainerStyles}>
|
|
29
34
|
<Select items={options} getId={item => item.serverId} getTextValue={item => item.label}>
|
|
30
35
|
<FormField>
|
|
31
36
|
<FormField.Label>Contact</FormField.Label>
|
|
@@ -2,6 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import {FormField} from '@workday/canvas-kit-preview-react/form-field';
|
|
3
3
|
import {Select} from '@workday/canvas-kit-react/select';
|
|
4
4
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
5
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
6
|
+
|
|
7
|
+
const parentContainerStyles = createStyles({
|
|
8
|
+
flexDirection: 'column',
|
|
9
|
+
});
|
|
5
10
|
|
|
6
11
|
const options = [
|
|
7
12
|
'E-mail',
|
|
@@ -20,7 +25,7 @@ export default () => {
|
|
|
20
25
|
};
|
|
21
26
|
|
|
22
27
|
return (
|
|
23
|
-
<Flex
|
|
28
|
+
<Flex cs={parentContainerStyles}>
|
|
24
29
|
<Select items={options} nonInteractiveIds={['Fax (disabled)']}>
|
|
25
30
|
<FormField>
|
|
26
31
|
<FormField.Label>Contact</FormField.Label>
|
|
@@ -2,6 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import {FormField} from '@workday/canvas-kit-preview-react/form-field';
|
|
3
3
|
import {Select} from '@workday/canvas-kit-react/select';
|
|
4
4
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
5
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
6
|
+
|
|
7
|
+
const parentContainerStyles = createStyles({
|
|
8
|
+
flexDirection: 'column',
|
|
9
|
+
});
|
|
5
10
|
|
|
6
11
|
const options = [
|
|
7
12
|
'E-mail',
|
|
@@ -20,7 +25,7 @@ export default () => {
|
|
|
20
25
|
};
|
|
21
26
|
|
|
22
27
|
return (
|
|
23
|
-
<Flex
|
|
28
|
+
<Flex cs={parentContainerStyles}>
|
|
24
29
|
<Select items={options} nonInteractiveIds={['Fax (disabled)', 'Mobile Phone']}>
|
|
25
30
|
<FormField>
|
|
26
31
|
<FormField.Label>Contact</FormField.Label>
|
|
@@ -2,6 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import {FormField} from '@workday/canvas-kit-preview-react/form-field';
|
|
3
3
|
import {Select} from '@workday/canvas-kit-react/select';
|
|
4
4
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
5
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
6
|
+
|
|
7
|
+
const parentContainerStyles = createStyles({
|
|
8
|
+
flexDirection: 'column',
|
|
9
|
+
});
|
|
5
10
|
|
|
6
11
|
const options = [
|
|
7
12
|
'E-mail',
|
|
@@ -19,7 +24,7 @@ export default () => {
|
|
|
19
24
|
setValue(event.target.value);
|
|
20
25
|
};
|
|
21
26
|
return (
|
|
22
|
-
<Flex
|
|
27
|
+
<Flex cs={parentContainerStyles}>
|
|
23
28
|
<Select items={options} nonInteractiveIds={['Fax (disabled)']}>
|
|
24
29
|
<FormField error="error">
|
|
25
30
|
<FormField.Label>Contact</FormField.Label>
|
|
@@ -4,6 +4,12 @@ import {Select, useSelectModel} from '@workday/canvas-kit-react/select';
|
|
|
4
4
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
5
5
|
import {PrimaryButton} from '@workday/canvas-kit-react/button';
|
|
6
6
|
import {useMount} from '@workday/canvas-kit-react/common';
|
|
7
|
+
import {createStyles, px2rem} from '@workday/canvas-kit-styling';
|
|
8
|
+
|
|
9
|
+
const parentContainerStyles = createStyles({
|
|
10
|
+
flexDirection: 'column',
|
|
11
|
+
maxWidth: px2rem(300),
|
|
12
|
+
});
|
|
7
13
|
|
|
8
14
|
const movieListItems = [
|
|
9
15
|
{
|
|
@@ -68,7 +74,7 @@ export default () => {
|
|
|
68
74
|
});
|
|
69
75
|
|
|
70
76
|
return (
|
|
71
|
-
<Flex
|
|
77
|
+
<Flex cs={parentContainerStyles}>
|
|
72
78
|
<Select model={model}>
|
|
73
79
|
<FormField label="Choose a Film">
|
|
74
80
|
<Select.Input
|
|
@@ -2,6 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
3
3
|
import {Select} from '@workday/canvas-kit-react/select';
|
|
4
4
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
5
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
6
|
+
|
|
7
|
+
const parentContainerStyles = createStyles({
|
|
8
|
+
flexDirection: 'column',
|
|
9
|
+
});
|
|
5
10
|
|
|
6
11
|
const options = [
|
|
7
12
|
{
|
|
@@ -37,7 +42,7 @@ export default () => {
|
|
|
37
42
|
};
|
|
38
43
|
|
|
39
44
|
return (
|
|
40
|
-
<Flex
|
|
45
|
+
<Flex cs={parentContainerStyles}>
|
|
41
46
|
<Select
|
|
42
47
|
items={options}
|
|
43
48
|
initialSelectedIds={['da594226446c11de98360015c5e6daf6']}
|
|
@@ -2,6 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import {FormField} from '@workday/canvas-kit-preview-react/form-field';
|
|
3
3
|
import {Select} from '@workday/canvas-kit-react/select';
|
|
4
4
|
import {Box} from '@workday/canvas-kit-react/layout';
|
|
5
|
+
import {createStyles, px2rem} from '@workday/canvas-kit-styling';
|
|
6
|
+
|
|
7
|
+
const selectCardStyles = createStyles({
|
|
8
|
+
maxHeight: px2rem(200),
|
|
9
|
+
});
|
|
5
10
|
|
|
6
11
|
const cities = [
|
|
7
12
|
'Atlanta (United States)',
|
|
@@ -43,7 +48,7 @@ export default () => {
|
|
|
43
48
|
<Select items={cities}>
|
|
44
49
|
<FormField.Input as={Select.Input} />
|
|
45
50
|
<Select.Popper>
|
|
46
|
-
<Select.Card
|
|
51
|
+
<Select.Card cs={selectCardStyles}>
|
|
47
52
|
<Select.List>{item => <Select.Item>{item}</Select.Item>}</Select.List>
|
|
48
53
|
</Select.Card>
|
|
49
54
|
</Select.Popper>
|
|
@@ -2,6 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
3
3
|
import {Select} from '@workday/canvas-kit-react/select';
|
|
4
4
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
5
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
6
|
+
|
|
7
|
+
const parentContainerStyles = createStyles({
|
|
8
|
+
flexDirection: 'column',
|
|
9
|
+
});
|
|
5
10
|
|
|
6
11
|
const options = [
|
|
7
12
|
'E-mail',
|
|
@@ -20,7 +25,7 @@ export default () => {
|
|
|
20
25
|
};
|
|
21
26
|
|
|
22
27
|
return (
|
|
23
|
-
<Flex
|
|
28
|
+
<Flex cs={parentContainerStyles}>
|
|
24
29
|
<Select items={options}>
|
|
25
30
|
<FormField label="Contact">
|
|
26
31
|
<Select.Input placeholder="Make a Selection" onChange={e => handleChange(e)} />
|
|
@@ -2,6 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import {FormField} from '@workday/canvas-kit-preview-react/form-field';
|
|
3
3
|
import {Select} from '@workday/canvas-kit-react/select';
|
|
4
4
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
5
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
6
|
+
|
|
7
|
+
const parentContainerStyles = createStyles({
|
|
8
|
+
flexDirection: 'column',
|
|
9
|
+
});
|
|
5
10
|
|
|
6
11
|
const options = [
|
|
7
12
|
'E-mail',
|
|
@@ -20,7 +25,7 @@ export default () => {
|
|
|
20
25
|
};
|
|
21
26
|
|
|
22
27
|
return (
|
|
23
|
-
<Flex
|
|
28
|
+
<Flex cs={parentContainerStyles}>
|
|
24
29
|
<FormField isRequired>
|
|
25
30
|
<Select items={options}>
|
|
26
31
|
<FormField.Label>Contact</FormField.Label>
|
|
@@ -8,6 +8,16 @@ import {
|
|
|
8
8
|
uploadCloudIcon,
|
|
9
9
|
userIcon,
|
|
10
10
|
} from '@workday/canvas-system-icons-web';
|
|
11
|
+
import {createStyles, px2rem} from '@workday/canvas-kit-styling';
|
|
12
|
+
|
|
13
|
+
const styleOverrides = {
|
|
14
|
+
formfieldInputStyles: createStyles({
|
|
15
|
+
width: px2rem(300),
|
|
16
|
+
}),
|
|
17
|
+
selectCardStyles: createStyles({
|
|
18
|
+
maxHeight: px2rem(200),
|
|
19
|
+
}),
|
|
20
|
+
};
|
|
11
21
|
|
|
12
22
|
const customOptions = [
|
|
13
23
|
{text: 'Activity Stream', id: 'activity-stream', icon: activityStreamIcon},
|
|
@@ -28,11 +38,11 @@ export default () => {
|
|
|
28
38
|
<FormField.Label>Contact</FormField.Label>
|
|
29
39
|
<FormField.Input
|
|
30
40
|
as={Select.Input}
|
|
31
|
-
|
|
41
|
+
cs={styleOverrides.formfieldInputStyles}
|
|
32
42
|
inputStartIcon={selectedItem.value.icon}
|
|
33
43
|
/>
|
|
34
44
|
<Select.Popper>
|
|
35
|
-
<Select.Card
|
|
45
|
+
<Select.Card cs={styleOverrides.selectCardStyles}>
|
|
36
46
|
{model.state.items.length > 0 && (
|
|
37
47
|
<Select.List>
|
|
38
48
|
{item => (
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import {Table} from '@workday/canvas-kit-react/table';
|
|
4
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
5
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
6
|
+
|
|
7
|
+
const tableHeaderStyles = createStyles({
|
|
8
|
+
backgroundColor: system.color.bg.alt.softer,
|
|
9
|
+
});
|
|
4
10
|
|
|
5
11
|
export default () => {
|
|
6
12
|
return (
|
|
@@ -8,10 +14,10 @@ export default () => {
|
|
|
8
14
|
<Table.Caption>Coffee Drinks and Sizes</Table.Caption>
|
|
9
15
|
<Table.Head>
|
|
10
16
|
<Table.Row>
|
|
11
|
-
<Table.Header scope="col"
|
|
17
|
+
<Table.Header scope="col" cs={tableHeaderStyles}>
|
|
12
18
|
Drink
|
|
13
19
|
</Table.Header>
|
|
14
|
-
<Table.Header scope="col"
|
|
20
|
+
<Table.Header scope="col" cs={tableHeaderStyles}>
|
|
15
21
|
Size
|
|
16
22
|
</Table.Header>
|
|
17
23
|
</Table.Row>
|
|
@@ -3,22 +3,33 @@ import React from 'react';
|
|
|
3
3
|
import {Table} from '@workday/canvas-kit-react/table';
|
|
4
4
|
import {Heading} from '@workday/canvas-kit-react/text';
|
|
5
5
|
import {useUniqueId} from '@workday/canvas-kit-react/common';
|
|
6
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
7
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
8
|
+
|
|
9
|
+
const styleOverrides = {
|
|
10
|
+
parentContainerStyles: createStyles({
|
|
11
|
+
marginBottom: system.space.x4,
|
|
12
|
+
}),
|
|
13
|
+
tableHeaderStyles: createStyles({
|
|
14
|
+
backgroundColor: system.color.bg.alt.softer,
|
|
15
|
+
}),
|
|
16
|
+
};
|
|
6
17
|
|
|
7
18
|
export default () => {
|
|
8
19
|
const headingID = useUniqueId();
|
|
9
20
|
|
|
10
21
|
return (
|
|
11
22
|
<>
|
|
12
|
-
<Heading as="h3" id={headingID} size="small"
|
|
23
|
+
<Heading as="h3" id={headingID} size="small" cs={styleOverrides.parentContainerStyles}>
|
|
13
24
|
Pizza Toppings
|
|
14
25
|
</Heading>
|
|
15
26
|
<Table aria-labelledby={headingID}>
|
|
16
27
|
<Table.Head>
|
|
17
28
|
<Table.Row>
|
|
18
|
-
<Table.Header scope="col"
|
|
29
|
+
<Table.Header scope="col" cs={styleOverrides.tableHeaderStyles}>
|
|
19
30
|
Toppings
|
|
20
31
|
</Table.Header>
|
|
21
|
-
<Table.Header scope="col"
|
|
32
|
+
<Table.Header scope="col" cs={styleOverrides.tableHeaderStyles}>
|
|
22
33
|
Amount
|
|
23
34
|
</Table.Header>
|
|
24
35
|
</Table.Row>
|