@workday/canvas-kit-docs 15.0.3 → 15.0.5
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/ExampleCodeBlock.js +1 -1
- package/dist/es6/lib/Table.js +2 -2
- package/dist/es6/lib/docs.js +34 -11
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.js +5 -5
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.ts +5 -5
- package/dist/es6/lib/widgetUtils.js +1 -1
- package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/FilterListWithLiveStatus.js +2 -2
- package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/IconButtonsWithLiveBadges.d.ts.map +1 -1
- package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/IconButtonsWithLiveBadges.js +7 -2
- package/dist/es6/mdx/accessibility/examples/GlobalHeader.js +1 -1
- package/dist/es6/mdx/accessibility/examples/Popups/InlinePopupNoPortal.js +2 -2
- package/dist/es6/mdx/accessibility/examples/SidePanelWithNavigation.js +3 -3
- package/dist/es6/mdx/welcomePage.js +2 -2
- package/dist/mdx/accessibility/InlinePortals.mdx +3 -2
- package/dist/mdx/accessibility/PageStructure.mdx +0 -1
- package/dist/mdx/accessibility/Popups.mdx +1 -0
- package/dist/mdx/accessibility/WindowsHighContrastThemes.mdx +2 -2
- package/dist/mdx/preview-react/_examples/mdx/examples/TextInputWithReactHookForm.tsx +2 -2
- package/dist/mdx/preview-react/multi-select/examples/Controlled.tsx +56 -57
- package/dist/mdx/preview-react/radio/examples/Basic.tsx +1 -1
- package/dist/mdx/preview-react/radio/examples/Custom.tsx +1 -1
- package/dist/mdx/preview-react/radio/examples/StandaloneRadio.tsx +6 -4
- package/dist/mdx/preview-react/side-panel/examples/AlwaysOpen.tsx +1 -1
- package/dist/mdx/preview-react/side-panel/examples/RightOrigin.tsx +1 -1
- package/dist/mdx/react/_examples/mdx/ContextualHelp.mdx +28 -18
- package/dist/mdx/react/_examples/mdx/examples/ContextualHelp/ContextualHelpDialogFocusRedirect.tsx +8 -2
- package/dist/mdx/react/_examples/mdx/examples/ContextualHelp/ContextualHelpDialogFocusTrap.tsx +10 -2
- package/dist/mdx/react/_examples/mdx/examples/CookieBanner.tsx +75 -58
- package/dist/mdx/react/_examples/mdx/examples/ListOfUploadedFiles.tsx +10 -10
- package/dist/mdx/react/_examples/mdx/examples/MediaModal.tsx +31 -19
- package/dist/mdx/react/_examples/mdx/examples/SelectWithFormik.tsx +5 -4
- package/dist/mdx/react/_examples/mdx/examples/layout/AreaColumnPositioning.tsx +32 -13
- package/dist/mdx/react/_examples/mdx/examples/layout/CustomColumnPositioning.tsx +37 -25
- package/dist/mdx/react/_examples/mdx/examples/layout/CustomColumnWidth.tsx +29 -13
- package/dist/mdx/react/_examples/mdx/examples/layout/FullWidthWith3Columns.tsx +6 -7
- package/dist/mdx/react/_examples/mdx/examples/layout/FullWidthWith3Columns2Rows.tsx +43 -14
- package/dist/mdx/react/_examples/mdx/examples/layout/Masonry.tsx +33 -32
- package/dist/mdx/react/_examples/mdx/examples/layout/ResponsiveColumns.tsx +16 -7
- package/dist/mdx/react/_examples/mdx/examples/layout/Tiled2and3Columns.tsx +60 -25
- package/dist/mdx/react/_examples/mdx/examples/layout/Tiled4and2Columns.tsx +60 -23
- package/dist/mdx/react/action-bar/examples/OverflowActionBar.tsx +4 -2
- package/dist/mdx/react/avatar/Avatar.mdx +5 -7
- package/dist/mdx/react/badge/examples/CustomLimit.tsx +1 -1
- package/dist/mdx/react/banner/examples/RefForwarding.tsx +2 -1
- package/dist/mdx/react/banner/examples/Sticky.tsx +6 -5
- package/dist/mdx/react/banner/examples/StickyRTL.tsx +7 -7
- package/dist/mdx/react/breadcrumbs/examples/Overflow.tsx +5 -2
- package/dist/mdx/react/button/button/examples/Grow.tsx +10 -3
- package/dist/mdx/react/checkbox/examples/Indeterminate.tsx +1 -1
- package/dist/mdx/react/collection/mdx/examples/BasicGrid.tsx +25 -12
- package/dist/mdx/react/collection/mdx/examples/DataLoader.tsx +8 -6
- package/dist/mdx/react/collection/mdx/examples/MultiSelection.tsx +18 -6
- package/dist/mdx/react/collection/mdx/examples/OverflowVerticalList.tsx +14 -11
- package/dist/mdx/react/collection/mdx/examples/Selection.tsx +5 -1
- package/dist/mdx/react/collection/mdx/examples/WrappingGrid.tsx +25 -12
- package/dist/mdx/react/combobox/examples/Autocomplete.tsx +3 -4
- package/dist/mdx/react/common/mdx/Responsive.mdx +7 -0
- package/dist/mdx/react/common/mdx/examples/ResponsiveStyles.tsx +1 -0
- package/dist/mdx/react/common/mdx/examples/ResponsiveViewport.tsx +5 -5
- package/dist/mdx/react/dialog/examples/Basic.tsx +8 -2
- package/dist/mdx/react/dialog/examples/DialogWithFallbackPlacements.tsx +32 -8
- package/dist/mdx/react/dialog/examples/Focus.tsx +13 -3
- package/dist/mdx/react/form-field/examples/ThemedErrors.tsx +1 -1
- package/dist/mdx/react/layout/Box.mdx +7 -1
- package/dist/mdx/react/layout/Flex.mdx +6 -0
- package/dist/mdx/react/layout/Grid.mdx +6 -0
- package/dist/mdx/react/layout/examples/Flex/Basic.tsx +28 -39
- package/dist/mdx/react/layout/examples/Grid/GridCard.tsx +1 -1
- package/dist/mdx/react/layout/examples/Grid/GridLayout.tsx +46 -36
- package/dist/mdx/react/layout/examples/Grid/GridLayoutInteractive.tsx +34 -35
- package/dist/mdx/react/menu/examples/Basic.tsx +2 -1
- package/dist/mdx/react/menu/examples/ContextMenu.tsx +2 -1
- package/dist/mdx/react/menu/examples/Grouping.tsx +2 -1
- package/dist/mdx/react/menu/examples/Icons.tsx +2 -1
- package/dist/mdx/react/menu/examples/MenuWithFallbackPlacements.tsx +14 -7
- package/dist/mdx/react/menu/examples/Nested.tsx +2 -1
- package/dist/mdx/react/menu/examples/NestedDynamic.tsx +1 -1
- package/dist/mdx/react/menu/examples/SelectableMenu.tsx +2 -1
- package/dist/mdx/react/modal/examples/Basic.tsx +1 -1
- package/dist/mdx/react/modal/examples/BodyOverflow.tsx +4 -5
- package/dist/mdx/react/modal/examples/CustomFocus.tsx +4 -3
- package/dist/mdx/react/modal/examples/FullOverflow.tsx +5 -6
- package/dist/mdx/react/modal/examples/IframeTest.tsx +2 -1
- package/dist/mdx/react/modal/examples/ModalWithPopup.tsx +3 -2
- package/dist/mdx/react/modal/examples/ModalWithPopupRTL.tsx +3 -2
- package/dist/mdx/react/modal/examples/NoTargetRTL.tsx +1 -1
- package/dist/mdx/react/modal/examples/StackedModals.tsx +3 -2
- package/dist/mdx/react/modal/examples/WithRadioButtons.tsx +1 -0
- package/dist/mdx/react/modal/examples/WithTooltips.tsx +3 -2
- package/dist/mdx/react/modal/examples/WithoutCloseIcon.tsx +1 -1
- package/dist/mdx/react/popup/examples/CloseOnTargetHiddenTest.tsx +31 -17
- package/dist/mdx/react/popup/examples/FullScreen.tsx +6 -6
- package/dist/mdx/react/popup/examples/InlinePopup.tsx +2 -2
- package/dist/mdx/react/popup/examples/MixedPopupTypes.tsx +8 -6
- package/dist/mdx/react/popup/examples/NestedPopups.tsx +5 -6
- package/dist/mdx/react/popup/examples/PopupWithFallbackPlacements.tsx +6 -6
- package/dist/mdx/react/popup/examples/PopupWithNonHidablePopup.tsx +2 -1
- package/dist/mdx/react/popup/examples/ReturnFocusTest.tsx +20 -8
- package/dist/mdx/react/radio/examples/Inverse.tsx +2 -1
- package/dist/mdx/react/segmented-control/examples/Basic.tsx +2 -1
- package/dist/mdx/react/segmented-control/examples/Sizes.tsx +2 -3
- package/dist/mdx/react/select/examples/Controlled.tsx +2 -1
- package/dist/mdx/react/skeleton/examples/Basic.tsx +1 -1
- package/dist/mdx/react/skeleton/examples/Color.tsx +1 -1
- package/dist/mdx/react/skeleton/examples/Simulation.tsx +3 -3
- package/dist/mdx/react/table/examples/BasicWithHeading.tsx +1 -1
- package/dist/mdx/react/table/examples/FixedColumn.tsx +2 -2
- package/dist/mdx/react/tabs/examples/AlternativeTabStop.tsx +1 -1
- package/dist/mdx/react/tabs/examples/Basic.tsx +1 -1
- package/dist/mdx/react/tabs/examples/DisabledTab.tsx +1 -1
- package/dist/mdx/react/tabs/examples/DynamicTabs.tsx +6 -2
- package/dist/mdx/react/tabs/examples/HoistedModel.tsx +1 -1
- package/dist/mdx/react/tabs/examples/Icons.tsx +1 -1
- package/dist/mdx/react/tabs/examples/NamedTabs.tsx +1 -1
- package/dist/mdx/react/tabs/examples/OverflowTabs.tsx +7 -3
- package/dist/mdx/react/tabs/examples/RightToLeft.tsx +1 -1
- package/dist/mdx/react/tabs/examples/SinglePanel.tsx +1 -1
- package/dist/mdx/react/text/examples/LabelText/Disabled.tsx +1 -1
- package/dist/mdx/react/tokens/examples/Overview.tsx +9 -11
- package/dist/mdx/react/tokens/examples/Tokens.tsx +3 -2
- package/dist/mdx/react/tooltip/examples/DescriptionType.tsx +2 -1
- package/dist/mdx/react/tooltip/examples/Ellipsis.tsx +2 -2
- package/dist/mdx/styling/mdx/MergingStyles.mdx +1 -0
- package/dist/mdx/styling/mdx/examples/EmotionButton.tsx +1 -0
- package/dist/mdx/styling/mdx/examples/StylingOverrides.tsx +5 -5
- package/dist/mdx/tokens/TokenMigrationFinal.mdx +1 -1
- package/lib/ExampleCodeBlock.tsx +1 -1
- package/lib/Table.tsx +2 -2
- package/lib/widgetUtils.tsx +1 -1
- package/package.json +8 -8
package/dist/mdx/react/_examples/mdx/examples/ContextualHelp/ContextualHelpDialogFocusRedirect.tsx
CHANGED
|
@@ -57,12 +57,18 @@ export function ContextualHelpDialogFocusRedirect() {
|
|
|
57
57
|
<Dialog.Popper placement="right">
|
|
58
58
|
<Dialog.Card>
|
|
59
59
|
<Dialog.CloseIcon aria-label="Close" />
|
|
60
|
-
<Dialog.Heading cs={{
|
|
60
|
+
<Dialog.Heading cs={{paddingBlockStart: system.padding.xxl}}>
|
|
61
|
+
Information
|
|
62
|
+
</Dialog.Heading>
|
|
61
63
|
<Dialog.Body>
|
|
62
64
|
This dialog does not trap focus, so tabbing out of it will cause it to close
|
|
63
65
|
</Dialog.Body>
|
|
64
66
|
<Flex
|
|
65
|
-
cs={{
|
|
67
|
+
cs={{
|
|
68
|
+
gap: system.gap.md,
|
|
69
|
+
padding: system.padding.xs,
|
|
70
|
+
marginBlockStart: system.gap.sm,
|
|
71
|
+
}}
|
|
66
72
|
>
|
|
67
73
|
<Hyperlink href="/">Link</Hyperlink>
|
|
68
74
|
</Flex>
|
package/dist/mdx/react/_examples/mdx/examples/ContextualHelp/ContextualHelpDialogFocusTrap.tsx
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
1
3
|
import {Hyperlink, TertiaryButton} from '@workday/canvas-kit-react/button';
|
|
2
4
|
import {useUniqueId} from '@workday/canvas-kit-react/common';
|
|
3
5
|
import {Dialog} from '@workday/canvas-kit-react/dialog';
|
|
@@ -56,13 +58,19 @@ export function ContextualHelpDialogFocusTrap() {
|
|
|
56
58
|
<Dialog.Popper placement="right">
|
|
57
59
|
<Dialog.Card>
|
|
58
60
|
<Dialog.CloseIcon aria-label="Close" />
|
|
59
|
-
<Dialog.Heading cs={{
|
|
61
|
+
<Dialog.Heading cs={{paddingBlockStart: system.padding.xl}}>
|
|
62
|
+
Information
|
|
63
|
+
</Dialog.Heading>
|
|
60
64
|
<Dialog.Body>
|
|
61
65
|
This dialog traps focus. Focus will only return to the rest of the page when the
|
|
62
66
|
dialog is closed
|
|
63
67
|
</Dialog.Body>
|
|
64
68
|
<Flex
|
|
65
|
-
cs={{
|
|
69
|
+
cs={{
|
|
70
|
+
gap: system.gap.md,
|
|
71
|
+
padding: system.padding.xs,
|
|
72
|
+
marginBlockStart: system.gap.sm,
|
|
73
|
+
}}
|
|
66
74
|
>
|
|
67
75
|
<Hyperlink href="/">Link</Hyperlink>
|
|
68
76
|
</Flex>
|
|
@@ -1,40 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
3
|
import {PrimaryButton, TertiaryButton} from '@workday/canvas-kit-react/button';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import {createComponent} from '@workday/canvas-kit-react/common';
|
|
5
|
+
import {
|
|
6
|
+
CSProps,
|
|
7
|
+
createStencil,
|
|
8
|
+
createStyles,
|
|
9
|
+
handleCsProp,
|
|
10
|
+
px2rem,
|
|
11
|
+
} from '@workday/canvas-kit-styling';
|
|
12
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
6
13
|
|
|
7
|
-
|
|
8
|
-
displayName: 'CookieBanner.Item',
|
|
9
|
-
Component: ({isRow, ...elProps}: ItemProps, ref) => (
|
|
10
|
-
<BannerItem ref={ref} isRow={isRow} {...elProps} />
|
|
11
|
-
),
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
const CookieBanner = createComponent('div')({
|
|
15
|
-
displayName: 'CookieBanner',
|
|
16
|
-
Component: (props: BannerProps, ref, Element) => <Banner ref={ref} as={Element} {...props} />,
|
|
17
|
-
subComponents: {Item: CookieBannerItem},
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
export default () => {
|
|
21
|
-
const DefaultNotice = `We use cookies to ensure that we give you the best experience on our website.
|
|
22
|
-
If you continue without changing your settings, we'll assume that you are willing to receive cookies.`;
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<ExampleContainer>
|
|
26
|
-
<CookieBanner isClosed={false}>
|
|
27
|
-
<CookieBanner.Item>{DefaultNotice}</CookieBanner.Item>
|
|
28
|
-
<CookieBanner.Item isRow>
|
|
29
|
-
<TertiaryButton>Settings</TertiaryButton>
|
|
30
|
-
<PrimaryButton>Continue</PrimaryButton>
|
|
31
|
-
</CookieBanner.Item>
|
|
32
|
-
</CookieBanner>
|
|
33
|
-
</ExampleContainer>
|
|
34
|
-
);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
interface BannerProps {
|
|
14
|
+
interface BannerProps extends CSProps {
|
|
38
15
|
isClosed?: boolean;
|
|
39
16
|
}
|
|
40
17
|
|
|
@@ -42,20 +19,20 @@ interface ItemProps {
|
|
|
42
19
|
isRow?: boolean;
|
|
43
20
|
}
|
|
44
21
|
|
|
45
|
-
const
|
|
46
|
-
minHeight: 84,
|
|
47
|
-
margin:
|
|
22
|
+
const exampleContainerStyles = createStyles({
|
|
23
|
+
minHeight: px2rem(84),
|
|
24
|
+
margin: px2rem(12),
|
|
48
25
|
position: 'relative',
|
|
49
26
|
});
|
|
50
27
|
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
backgroundColor:
|
|
55
|
-
|
|
28
|
+
const bannerStyles = createStencil({
|
|
29
|
+
base: {
|
|
30
|
+
...system.type.subtext.md,
|
|
31
|
+
backgroundColor: system.color.surface.default,
|
|
32
|
+
borderBlockStart: `1px solid ${system.color.border.default}`,
|
|
56
33
|
display: 'flex',
|
|
57
|
-
|
|
58
|
-
padding:
|
|
34
|
+
boxShadow: system.depth[1],
|
|
35
|
+
padding: system.padding.lg,
|
|
59
36
|
alignItems: 'center',
|
|
60
37
|
justifyContent: 'space-between',
|
|
61
38
|
position: 'absolute',
|
|
@@ -68,30 +45,70 @@ const Banner = styled('div')<BannerProps & StyledType>(
|
|
|
68
45
|
flexDirection: 'column',
|
|
69
46
|
alignItems: 'stretch',
|
|
70
47
|
textAlign: 'center',
|
|
71
|
-
padding: `${
|
|
48
|
+
padding: `${system.padding.md} 0`,
|
|
72
49
|
},
|
|
73
50
|
},
|
|
74
|
-
|
|
75
|
-
|
|
51
|
+
modifiers: {
|
|
52
|
+
isClosed: {
|
|
53
|
+
true: {
|
|
54
|
+
transform: 'translateY(100%)',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
});
|
|
76
59
|
|
|
77
|
-
const
|
|
78
|
-
{
|
|
79
|
-
|
|
80
|
-
marginRight: space.s,
|
|
60
|
+
const bannerItemStyles = createStencil({
|
|
61
|
+
base: {
|
|
62
|
+
marginInline: system.gap.md,
|
|
81
63
|
'@media (max-width: 450px)': {
|
|
82
64
|
'&:not(:first-of-type)': {
|
|
83
|
-
|
|
65
|
+
marginBlockStart: system.gap.md,
|
|
84
66
|
'> *': {
|
|
85
67
|
flex: 1,
|
|
86
68
|
},
|
|
87
69
|
},
|
|
88
70
|
},
|
|
89
71
|
},
|
|
90
|
-
|
|
91
|
-
isRow
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
72
|
+
modifiers: {
|
|
73
|
+
isRow: {
|
|
74
|
+
true: {
|
|
75
|
+
display: 'flex',
|
|
76
|
+
'> *': {
|
|
77
|
+
marginInlineStart: system.gap.md,
|
|
78
|
+
},
|
|
95
79
|
},
|
|
96
|
-
}
|
|
97
|
-
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
const CookieBannerItem = createComponent('div')({
|
|
85
|
+
displayName: 'CookieBanner.Item',
|
|
86
|
+
Component: ({isRow, ...elProps}: ItemProps, ref, Element) => (
|
|
87
|
+
<Element ref={ref} {...handleCsProp(elProps, bannerItemStyles({isRow}))} />
|
|
88
|
+
),
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
const CookieBanner = createComponent('div')({
|
|
92
|
+
displayName: 'CookieBanner',
|
|
93
|
+
Component: ({isClosed, ...props}: BannerProps, ref, Element) => (
|
|
94
|
+
<Element ref={ref} {...handleCsProp(props, bannerStyles({isClosed}))} />
|
|
95
|
+
),
|
|
96
|
+
subComponents: {Item: CookieBannerItem},
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
export default () => {
|
|
100
|
+
const DefaultNotice = `We use cookies to ensure that we give you the best experience on our website.
|
|
101
|
+
If you continue without changing your settings, we'll assume that you are willing to receive cookies.`;
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<div className={exampleContainerStyles}>
|
|
105
|
+
<CookieBanner isClosed={false}>
|
|
106
|
+
<CookieBanner.Item>{DefaultNotice}</CookieBanner.Item>
|
|
107
|
+
<CookieBanner.Item isRow>
|
|
108
|
+
<TertiaryButton>Settings</TertiaryButton>
|
|
109
|
+
<PrimaryButton>Continue</PrimaryButton>
|
|
110
|
+
</CookieBanner.Item>
|
|
111
|
+
</CookieBanner>
|
|
112
|
+
</div>
|
|
113
|
+
);
|
|
114
|
+
};
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
1
|
import {DeleteButton} from '@workday/canvas-kit-react/button';
|
|
4
2
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
5
3
|
import {Heading, Text} from '@workday/canvas-kit-react/text';
|
|
6
4
|
import {Tooltip} from '@workday/canvas-kit-react/tooltip';
|
|
5
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
7
6
|
import {trashIcon} from '@workday/canvas-system-icons-web';
|
|
7
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
8
8
|
|
|
9
9
|
const files = ['Cover Letter.docx', 'Resume.docx', 'Portfolio.pptx', 'Portrait.png'];
|
|
10
10
|
|
|
11
|
-
const listStyles = {
|
|
11
|
+
const listStyles = createStyles({
|
|
12
12
|
alignItems: 'center',
|
|
13
13
|
width: '35rem',
|
|
14
|
-
};
|
|
14
|
+
});
|
|
15
15
|
|
|
16
|
-
const deleteBtnStyle = {
|
|
17
|
-
|
|
18
|
-
};
|
|
16
|
+
const deleteBtnStyle = createStyles({
|
|
17
|
+
marginInlineStart: 'auto',
|
|
18
|
+
});
|
|
19
19
|
|
|
20
20
|
export default () => {
|
|
21
21
|
return (
|
|
22
22
|
<>
|
|
23
23
|
<Heading size="medium">Uploaded Files:</Heading>
|
|
24
|
-
<Flex as="ul" gap
|
|
24
|
+
<Flex as="ul" cs={{gap: system.gap.md, flexDirection: 'column'}}>
|
|
25
25
|
{files.map(i => (
|
|
26
|
-
<Flex as="li"
|
|
26
|
+
<Flex as="li" cs={listStyles}>
|
|
27
27
|
<Text>{i}</Text>
|
|
28
28
|
<Tooltip type="description" title={i}>
|
|
29
|
-
<DeleteButton icon={trashIcon}
|
|
29
|
+
<DeleteButton icon={trashIcon} cs={deleteBtnStyle}>
|
|
30
30
|
Delete
|
|
31
31
|
</DeleteButton>
|
|
32
32
|
</Tooltip>
|
|
@@ -5,7 +5,26 @@ import {createComponent} from '@workday/canvas-kit-react/common';
|
|
|
5
5
|
import {Box, BoxProps, Flex} from '@workday/canvas-kit-react/layout';
|
|
6
6
|
import {Modal} from '@workday/canvas-kit-react/modal';
|
|
7
7
|
import {Text} from '@workday/canvas-kit-react/text';
|
|
8
|
-
import {
|
|
8
|
+
import {calc, createStencil, createStyles, handleCsProp} from '@workday/canvas-kit-styling';
|
|
9
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
10
|
+
|
|
11
|
+
const mediaImageStencil = createStencil({
|
|
12
|
+
base: {
|
|
13
|
+
backgroundColor: system.color.bg.default,
|
|
14
|
+
transition: 'opacity ease 200ms',
|
|
15
|
+
display: 'block',
|
|
16
|
+
width: '100%',
|
|
17
|
+
height: 293,
|
|
18
|
+
opacity: 0,
|
|
19
|
+
},
|
|
20
|
+
modifiers: {
|
|
21
|
+
loaded: {
|
|
22
|
+
true: {
|
|
23
|
+
opacity: 1,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
});
|
|
9
28
|
|
|
10
29
|
const MediaImage = createComponent('img')({
|
|
11
30
|
displayName: 'Media.Image',
|
|
@@ -16,33 +35,26 @@ const MediaImage = createComponent('img')({
|
|
|
16
35
|
<Box
|
|
17
36
|
as={Element}
|
|
18
37
|
ref={ref}
|
|
19
|
-
display="block"
|
|
20
|
-
backgroundColor="frenchVanilla200"
|
|
21
|
-
transition="opacity ease 200ms"
|
|
22
|
-
width="100%"
|
|
23
|
-
height={293}
|
|
24
|
-
style={{opacity: loaded ? 1 : 0}}
|
|
25
38
|
onLoad={() => setLoaded(true)}
|
|
26
|
-
{...elemProps}
|
|
39
|
+
{...handleCsProp(elemProps, mediaImageStencil({loaded}))}
|
|
27
40
|
/>
|
|
28
41
|
);
|
|
29
42
|
},
|
|
30
43
|
});
|
|
31
44
|
|
|
45
|
+
const mediaStyles = createStyles({
|
|
46
|
+
width: calc.add('100%', calc.multiply(system.size.sm, 2)),
|
|
47
|
+
marginInlineStart: calc.negate(system.gap.xl),
|
|
48
|
+
marginBlockStart: system.gap.lg,
|
|
49
|
+
marginBlockEnd: system.gap.md,
|
|
50
|
+
});
|
|
51
|
+
|
|
32
52
|
const Media = createComponent('div')({
|
|
33
53
|
displayName: 'Media',
|
|
34
54
|
subComponents: {Image: MediaImage},
|
|
35
55
|
Component: ({children, ...elemProps}: BoxProps, ref, Element) => {
|
|
36
56
|
return (
|
|
37
|
-
<Box
|
|
38
|
-
as={Element}
|
|
39
|
-
ref={ref}
|
|
40
|
-
width={`calc(100% + (${space.l} * 2))`}
|
|
41
|
-
marginLeft={`calc(-${space.l})`}
|
|
42
|
-
marginTop="m"
|
|
43
|
-
marginBottom="s"
|
|
44
|
-
{...elemProps}
|
|
45
|
-
>
|
|
57
|
+
<Box as={Element} ref={ref} {...handleCsProp(elemProps, mediaStyles)}>
|
|
46
58
|
{children}
|
|
47
59
|
</Box>
|
|
48
60
|
);
|
|
@@ -64,11 +76,11 @@ export default () => {
|
|
|
64
76
|
</Media>
|
|
65
77
|
<Modal.Heading>TED's Secret to Public Speaking</Modal.Heading>
|
|
66
78
|
<Modal.Body>
|
|
67
|
-
<Text as="p"
|
|
79
|
+
<Text as="p" cs={{marginBlockStart: 0, marginBlockEnd: system.gap.lg}}>
|
|
68
80
|
The secret to great public speaking, according to former actor Martin Danielson, is as
|
|
69
81
|
simple as one, two, three.
|
|
70
82
|
</Text>
|
|
71
|
-
<Flex gap
|
|
83
|
+
<Flex cs={{gap: system.gap.md}}>
|
|
72
84
|
<Modal.CloseButton as={PrimaryButton}>Learn More</Modal.CloseButton>
|
|
73
85
|
</Flex>
|
|
74
86
|
</Modal.Body>
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {useFormik} from 'formik';
|
|
2
|
-
import * as React from 'react';
|
|
3
2
|
|
|
4
3
|
import {PrimaryButton} from '@workday/canvas-kit-react/button';
|
|
5
4
|
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
6
5
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
7
6
|
import {Select, useSelectModel} from '@workday/canvas-kit-react/select';
|
|
7
|
+
import {px2rem} from '@workday/canvas-kit-styling';
|
|
8
8
|
import {cloudArrowUpIcon, cloudIcon, commentIcon, userIcon} from '@workday/canvas-system-icons-web';
|
|
9
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
9
10
|
|
|
10
11
|
export default [
|
|
11
12
|
{
|
|
@@ -49,8 +50,8 @@ export default () => {
|
|
|
49
50
|
|
|
50
51
|
return (
|
|
51
52
|
<form onSubmit={formik.handleSubmit} action=".">
|
|
52
|
-
<Flex gap
|
|
53
|
-
<FormField orientation="vertical" alignSelf
|
|
53
|
+
<Flex cs={{gap: system.gap.sm, flexDirection: 'column', alignItems: 'flex-start'}}>
|
|
54
|
+
<FormField orientation="vertical" cs={{alignSelf: 'stretch', alignItems: 'normal'}}>
|
|
54
55
|
<Select model={selectModel}>
|
|
55
56
|
<FormField.Label>Choose a book</FormField.Label>
|
|
56
57
|
<FormField.Input
|
|
@@ -62,7 +63,7 @@ export default () => {
|
|
|
62
63
|
/>
|
|
63
64
|
<Select.Popper>
|
|
64
65
|
<Select.Card>
|
|
65
|
-
<Select.List
|
|
66
|
+
<Select.List cs={{maxHeight: px2rem(200)}}>
|
|
66
67
|
{item => {
|
|
67
68
|
return (
|
|
68
69
|
<Select.Item data-id={item.serverId} data-text={item.label}>
|
|
@@ -2,25 +2,44 @@ import * as React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import {Box, Grid} from '@workday/canvas-kit-react/layout';
|
|
4
4
|
import {BodyText, Heading} from '@workday/canvas-kit-react/text';
|
|
5
|
+
import {createStencil, createStyles, px2rem} from '@workday/canvas-kit-styling';
|
|
6
|
+
import {base, system} from '@workday/canvas-tokens-web';
|
|
7
|
+
|
|
8
|
+
const boxStencil = createStencil({
|
|
9
|
+
vars: {
|
|
10
|
+
gridArea: '',
|
|
11
|
+
backgroundColor: '',
|
|
12
|
+
},
|
|
13
|
+
base: ({backgroundColor, gridArea}) => ({
|
|
14
|
+
height: px2rem(120),
|
|
15
|
+
backgroundColor,
|
|
16
|
+
gridArea,
|
|
17
|
+
p: {
|
|
18
|
+
color: system.color.fg.inverse,
|
|
19
|
+
fontWeight: system.fontWeight.bold,
|
|
20
|
+
textAlign: 'center',
|
|
21
|
+
},
|
|
22
|
+
}),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const headingStyles = createStyles({
|
|
26
|
+
gridTemplateColumns: '4fr 8fr',
|
|
27
|
+
gridTemplateAreas: "'header header' 'side main'",
|
|
28
|
+
gridGap: system.gap.md,
|
|
29
|
+
});
|
|
5
30
|
|
|
6
31
|
export default () => (
|
|
7
32
|
<>
|
|
8
33
|
<Heading size="medium">Area Column Positioning</Heading>
|
|
9
|
-
<Grid
|
|
10
|
-
<Box
|
|
11
|
-
<BodyText size="small"
|
|
12
|
-
"header" area
|
|
13
|
-
</BodyText>
|
|
34
|
+
<Grid cs={headingStyles}>
|
|
35
|
+
<Box cs={boxStencil({backgroundColor: base.blue500, gridArea: 'header'})}>
|
|
36
|
+
<BodyText size="small">"header" area</BodyText>
|
|
14
37
|
</Box>
|
|
15
|
-
<Box
|
|
16
|
-
<BodyText size="small"
|
|
17
|
-
"side" area
|
|
18
|
-
</BodyText>
|
|
38
|
+
<Box cs={boxStencil({backgroundColor: base.blue600, gridArea: 'side'})}>
|
|
39
|
+
<BodyText size="small">"side" area</BodyText>
|
|
19
40
|
</Box>
|
|
20
|
-
<Box
|
|
21
|
-
<BodyText size="small"
|
|
22
|
-
"main" area
|
|
23
|
-
</BodyText>
|
|
41
|
+
<Box cs={boxStencil({backgroundColor: base.blue700, gridArea: 'main'})}>
|
|
42
|
+
<BodyText size="small">"main" area</BodyText>
|
|
24
43
|
</Box>
|
|
25
44
|
</Grid>
|
|
26
45
|
</>
|
|
@@ -2,40 +2,52 @@ import * as React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import {Box, Grid} from '@workday/canvas-kit-react/layout';
|
|
4
4
|
import {BodyText, Heading} from '@workday/canvas-kit-react/text';
|
|
5
|
+
import {createStencil, createStyles} from '@workday/canvas-kit-styling';
|
|
6
|
+
import {base, system} from '@workday/canvas-tokens-web';
|
|
7
|
+
|
|
8
|
+
const boxStencil = createStencil({
|
|
9
|
+
vars: {
|
|
10
|
+
gridColumn: '',
|
|
11
|
+
backgroundColor: '',
|
|
12
|
+
},
|
|
13
|
+
base: ({backgroundColor, gridColumn}) => ({
|
|
14
|
+
height: system.size.xxl,
|
|
15
|
+
backgroundColor,
|
|
16
|
+
gridColumn,
|
|
17
|
+
p: {
|
|
18
|
+
textAlign: 'center',
|
|
19
|
+
color: system.color.fg.inverse,
|
|
20
|
+
fontWeight: system.fontWeight.bold,
|
|
21
|
+
},
|
|
22
|
+
}),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const gridStyles = createStyles({
|
|
26
|
+
gridTemplateColumns: 'repeat(12, 1fr)',
|
|
27
|
+
gridGap: system.gap.md,
|
|
28
|
+
});
|
|
5
29
|
|
|
6
30
|
export default () => (
|
|
7
31
|
<>
|
|
8
32
|
<Heading size="medium">Custom Column Positioning</Heading>
|
|
9
|
-
<Grid
|
|
10
|
-
<Box
|
|
11
|
-
<BodyText size="small"
|
|
12
|
-
4 column width
|
|
13
|
-
</BodyText>
|
|
33
|
+
<Grid cs={gridStyles}>
|
|
34
|
+
<Box cs={boxStencil({backgroundColor: base.blue500, gridColumn: 'span 4'})}>
|
|
35
|
+
<BodyText size="small">4 column width</BodyText>
|
|
14
36
|
</Box>
|
|
15
|
-
<Box
|
|
16
|
-
<BodyText size="small"
|
|
17
|
-
3 column width
|
|
18
|
-
</BodyText>
|
|
37
|
+
<Box cs={boxStencil({backgroundColor: base.blue600, gridColumn: 'span 3'})}>
|
|
38
|
+
<BodyText size="small">3 column width</BodyText>
|
|
19
39
|
</Box>
|
|
20
|
-
<Box
|
|
21
|
-
<BodyText size="small"
|
|
22
|
-
5 column width
|
|
23
|
-
</BodyText>
|
|
40
|
+
<Box cs={boxStencil({backgroundColor: base.blue700, gridColumn: 'span 5'})}>
|
|
41
|
+
<BodyText size="small">5 column width</BodyText>
|
|
24
42
|
</Box>
|
|
25
|
-
<Box
|
|
26
|
-
<BodyText size="small"
|
|
27
|
-
from 1st to 5th column position
|
|
28
|
-
</BodyText>
|
|
43
|
+
<Box cs={boxStencil({backgroundColor: base.blue800, gridColumn: '1 / 6'})}>
|
|
44
|
+
<BodyText size="small">from 1st to 5th column position</BodyText>
|
|
29
45
|
</Box>
|
|
30
|
-
<Box
|
|
31
|
-
<BodyText size="small"
|
|
32
|
-
from 7th to 11th column position
|
|
33
|
-
</BodyText>
|
|
46
|
+
<Box cs={boxStencil({backgroundColor: base.blue900, gridColumn: '7 / 12'})}>
|
|
47
|
+
<BodyText size="small">from 7th to 11th column position</BodyText>
|
|
34
48
|
</Box>
|
|
35
|
-
<Box
|
|
36
|
-
<BodyText size="small"
|
|
37
|
-
10 column width starting from 2nd column
|
|
38
|
-
</BodyText>
|
|
49
|
+
<Box cs={boxStencil({backgroundColor: base.blue950, gridColumn: '2 / span 10'})}>
|
|
50
|
+
<BodyText size="small">10 column width starting from 2nd column</BodyText>
|
|
39
51
|
</Box>
|
|
40
52
|
</Grid>
|
|
41
53
|
</>
|
|
@@ -2,25 +2,41 @@ import * as React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import {Box, Grid} from '@workday/canvas-kit-react/layout';
|
|
4
4
|
import {BodyText, Heading} from '@workday/canvas-kit-react/text';
|
|
5
|
+
import {createStencil, createStyles, px2rem} from '@workday/canvas-kit-styling';
|
|
6
|
+
import {base, system} from '@workday/canvas-tokens-web';
|
|
7
|
+
|
|
8
|
+
const boxStencil = createStencil({
|
|
9
|
+
vars: {
|
|
10
|
+
backgroundColor: '',
|
|
11
|
+
},
|
|
12
|
+
base: ({backgroundColor}) => ({
|
|
13
|
+
height: px2rem(120),
|
|
14
|
+
backgroundColor,
|
|
15
|
+
p: {
|
|
16
|
+
textAlign: 'center',
|
|
17
|
+
color: system.color.fg.inverse,
|
|
18
|
+
fontWeight: system.fontWeight.bold,
|
|
19
|
+
},
|
|
20
|
+
}),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const gridStyles = createStyles({
|
|
24
|
+
gridTemplateColumns: '4fr 2fr 6fr',
|
|
25
|
+
gridGap: system.gap.md,
|
|
26
|
+
});
|
|
5
27
|
|
|
6
28
|
export default () => (
|
|
7
29
|
<>
|
|
8
30
|
<Heading size="medium">Custom Column Width</Heading>
|
|
9
|
-
<Grid
|
|
10
|
-
<Box
|
|
11
|
-
<BodyText size="small"
|
|
12
|
-
4 column width
|
|
13
|
-
</BodyText>
|
|
31
|
+
<Grid cs={gridStyles}>
|
|
32
|
+
<Box cs={boxStencil({backgroundColor: base.blue500})}>
|
|
33
|
+
<BodyText size="small">4 column width</BodyText>
|
|
14
34
|
</Box>
|
|
15
|
-
<Box
|
|
16
|
-
<BodyText size="small"
|
|
17
|
-
2 column width
|
|
18
|
-
</BodyText>
|
|
35
|
+
<Box cs={boxStencil({backgroundColor: base.blue600})}>
|
|
36
|
+
<BodyText size="small">2 column width</BodyText>
|
|
19
37
|
</Box>
|
|
20
|
-
<Box
|
|
21
|
-
<BodyText size="small"
|
|
22
|
-
6 column width
|
|
23
|
-
</BodyText>
|
|
38
|
+
<Box cs={boxStencil({backgroundColor: base.blue700})}>
|
|
39
|
+
<BodyText size="small">6 column width</BodyText>
|
|
24
40
|
</Box>
|
|
25
41
|
</Grid>
|
|
26
42
|
</>
|
|
@@ -2,7 +2,6 @@ import * as React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import {Box, Grid} from '@workday/canvas-kit-react/layout';
|
|
4
4
|
import {BodyText, Heading} from '@workday/canvas-kit-react/text';
|
|
5
|
-
import {colors} from '@workday/canvas-kit-react/tokens';
|
|
6
5
|
import {createStencil, createStyles, px2rem} from '@workday/canvas-kit-styling';
|
|
7
6
|
import {system} from '@workday/canvas-tokens-web';
|
|
8
7
|
|
|
@@ -40,19 +39,19 @@ export default () => (
|
|
|
40
39
|
<Box cs={boxHeadingStyles({gridArea: 'Heading'})}>
|
|
41
40
|
<Heading size="medium">Full Width With 3 Columns</Heading>
|
|
42
41
|
</Box>
|
|
43
|
-
<FormSkeleton
|
|
44
|
-
<FormSkeleton
|
|
45
|
-
<FormSkeleton
|
|
42
|
+
<FormSkeleton area="FormLeft" text="Form - Left Third" />
|
|
43
|
+
<FormSkeleton area="FormCenter" text="Form - Center Third" />
|
|
44
|
+
<FormSkeleton area="FormRight" text="Form - Right Third" />
|
|
46
45
|
</Grid>
|
|
47
46
|
);
|
|
48
47
|
|
|
49
|
-
const FormSkeleton = ({
|
|
50
|
-
<Box cs={boxStyles({gridArea})}>
|
|
48
|
+
const FormSkeleton = ({area, text}) => (
|
|
49
|
+
<Box cs={boxStyles({gridArea: area})}>
|
|
51
50
|
<BodyText size="small" fontWeight="bold">
|
|
52
51
|
{text}
|
|
53
52
|
</BodyText>
|
|
54
53
|
{Array.from({length: 5}).map(() => (
|
|
55
|
-
<Grid cs={{gridGap: system.gap.sm,
|
|
54
|
+
<Grid cs={{gridGap: system.gap.sm, marginBlockEnd: px2rem(20)}}>
|
|
56
55
|
<Box
|
|
57
56
|
cs={{
|
|
58
57
|
backgroundColor: system.color.surface.default,
|