@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.
Files changed (130) hide show
  1. package/dist/es6/lib/ExampleCodeBlock.js +1 -1
  2. package/dist/es6/lib/Table.js +2 -2
  3. package/dist/es6/lib/docs.js +34 -11
  4. package/dist/es6/lib/stackblitzFiles/packageJSONFile.js +5 -5
  5. package/dist/es6/lib/stackblitzFiles/packageJSONFile.ts +5 -5
  6. package/dist/es6/lib/widgetUtils.js +1 -1
  7. package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/FilterListWithLiveStatus.js +2 -2
  8. package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/IconButtonsWithLiveBadges.d.ts.map +1 -1
  9. package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/IconButtonsWithLiveBadges.js +7 -2
  10. package/dist/es6/mdx/accessibility/examples/GlobalHeader.js +1 -1
  11. package/dist/es6/mdx/accessibility/examples/Popups/InlinePopupNoPortal.js +2 -2
  12. package/dist/es6/mdx/accessibility/examples/SidePanelWithNavigation.js +3 -3
  13. package/dist/es6/mdx/welcomePage.js +2 -2
  14. package/dist/mdx/accessibility/InlinePortals.mdx +3 -2
  15. package/dist/mdx/accessibility/PageStructure.mdx +0 -1
  16. package/dist/mdx/accessibility/Popups.mdx +1 -0
  17. package/dist/mdx/accessibility/WindowsHighContrastThemes.mdx +2 -2
  18. package/dist/mdx/preview-react/_examples/mdx/examples/TextInputWithReactHookForm.tsx +2 -2
  19. package/dist/mdx/preview-react/multi-select/examples/Controlled.tsx +56 -57
  20. package/dist/mdx/preview-react/radio/examples/Basic.tsx +1 -1
  21. package/dist/mdx/preview-react/radio/examples/Custom.tsx +1 -1
  22. package/dist/mdx/preview-react/radio/examples/StandaloneRadio.tsx +6 -4
  23. package/dist/mdx/preview-react/side-panel/examples/AlwaysOpen.tsx +1 -1
  24. package/dist/mdx/preview-react/side-panel/examples/RightOrigin.tsx +1 -1
  25. package/dist/mdx/react/_examples/mdx/ContextualHelp.mdx +28 -18
  26. package/dist/mdx/react/_examples/mdx/examples/ContextualHelp/ContextualHelpDialogFocusRedirect.tsx +8 -2
  27. package/dist/mdx/react/_examples/mdx/examples/ContextualHelp/ContextualHelpDialogFocusTrap.tsx +10 -2
  28. package/dist/mdx/react/_examples/mdx/examples/CookieBanner.tsx +75 -58
  29. package/dist/mdx/react/_examples/mdx/examples/ListOfUploadedFiles.tsx +10 -10
  30. package/dist/mdx/react/_examples/mdx/examples/MediaModal.tsx +31 -19
  31. package/dist/mdx/react/_examples/mdx/examples/SelectWithFormik.tsx +5 -4
  32. package/dist/mdx/react/_examples/mdx/examples/layout/AreaColumnPositioning.tsx +32 -13
  33. package/dist/mdx/react/_examples/mdx/examples/layout/CustomColumnPositioning.tsx +37 -25
  34. package/dist/mdx/react/_examples/mdx/examples/layout/CustomColumnWidth.tsx +29 -13
  35. package/dist/mdx/react/_examples/mdx/examples/layout/FullWidthWith3Columns.tsx +6 -7
  36. package/dist/mdx/react/_examples/mdx/examples/layout/FullWidthWith3Columns2Rows.tsx +43 -14
  37. package/dist/mdx/react/_examples/mdx/examples/layout/Masonry.tsx +33 -32
  38. package/dist/mdx/react/_examples/mdx/examples/layout/ResponsiveColumns.tsx +16 -7
  39. package/dist/mdx/react/_examples/mdx/examples/layout/Tiled2and3Columns.tsx +60 -25
  40. package/dist/mdx/react/_examples/mdx/examples/layout/Tiled4and2Columns.tsx +60 -23
  41. package/dist/mdx/react/action-bar/examples/OverflowActionBar.tsx +4 -2
  42. package/dist/mdx/react/avatar/Avatar.mdx +5 -7
  43. package/dist/mdx/react/badge/examples/CustomLimit.tsx +1 -1
  44. package/dist/mdx/react/banner/examples/RefForwarding.tsx +2 -1
  45. package/dist/mdx/react/banner/examples/Sticky.tsx +6 -5
  46. package/dist/mdx/react/banner/examples/StickyRTL.tsx +7 -7
  47. package/dist/mdx/react/breadcrumbs/examples/Overflow.tsx +5 -2
  48. package/dist/mdx/react/button/button/examples/Grow.tsx +10 -3
  49. package/dist/mdx/react/checkbox/examples/Indeterminate.tsx +1 -1
  50. package/dist/mdx/react/collection/mdx/examples/BasicGrid.tsx +25 -12
  51. package/dist/mdx/react/collection/mdx/examples/DataLoader.tsx +8 -6
  52. package/dist/mdx/react/collection/mdx/examples/MultiSelection.tsx +18 -6
  53. package/dist/mdx/react/collection/mdx/examples/OverflowVerticalList.tsx +14 -11
  54. package/dist/mdx/react/collection/mdx/examples/Selection.tsx +5 -1
  55. package/dist/mdx/react/collection/mdx/examples/WrappingGrid.tsx +25 -12
  56. package/dist/mdx/react/combobox/examples/Autocomplete.tsx +3 -4
  57. package/dist/mdx/react/common/mdx/Responsive.mdx +7 -0
  58. package/dist/mdx/react/common/mdx/examples/ResponsiveStyles.tsx +1 -0
  59. package/dist/mdx/react/common/mdx/examples/ResponsiveViewport.tsx +5 -5
  60. package/dist/mdx/react/dialog/examples/Basic.tsx +8 -2
  61. package/dist/mdx/react/dialog/examples/DialogWithFallbackPlacements.tsx +32 -8
  62. package/dist/mdx/react/dialog/examples/Focus.tsx +13 -3
  63. package/dist/mdx/react/form-field/examples/ThemedErrors.tsx +1 -1
  64. package/dist/mdx/react/layout/Box.mdx +7 -1
  65. package/dist/mdx/react/layout/Flex.mdx +6 -0
  66. package/dist/mdx/react/layout/Grid.mdx +6 -0
  67. package/dist/mdx/react/layout/examples/Flex/Basic.tsx +28 -39
  68. package/dist/mdx/react/layout/examples/Grid/GridCard.tsx +1 -1
  69. package/dist/mdx/react/layout/examples/Grid/GridLayout.tsx +46 -36
  70. package/dist/mdx/react/layout/examples/Grid/GridLayoutInteractive.tsx +34 -35
  71. package/dist/mdx/react/menu/examples/Basic.tsx +2 -1
  72. package/dist/mdx/react/menu/examples/ContextMenu.tsx +2 -1
  73. package/dist/mdx/react/menu/examples/Grouping.tsx +2 -1
  74. package/dist/mdx/react/menu/examples/Icons.tsx +2 -1
  75. package/dist/mdx/react/menu/examples/MenuWithFallbackPlacements.tsx +14 -7
  76. package/dist/mdx/react/menu/examples/Nested.tsx +2 -1
  77. package/dist/mdx/react/menu/examples/NestedDynamic.tsx +1 -1
  78. package/dist/mdx/react/menu/examples/SelectableMenu.tsx +2 -1
  79. package/dist/mdx/react/modal/examples/Basic.tsx +1 -1
  80. package/dist/mdx/react/modal/examples/BodyOverflow.tsx +4 -5
  81. package/dist/mdx/react/modal/examples/CustomFocus.tsx +4 -3
  82. package/dist/mdx/react/modal/examples/FullOverflow.tsx +5 -6
  83. package/dist/mdx/react/modal/examples/IframeTest.tsx +2 -1
  84. package/dist/mdx/react/modal/examples/ModalWithPopup.tsx +3 -2
  85. package/dist/mdx/react/modal/examples/ModalWithPopupRTL.tsx +3 -2
  86. package/dist/mdx/react/modal/examples/NoTargetRTL.tsx +1 -1
  87. package/dist/mdx/react/modal/examples/StackedModals.tsx +3 -2
  88. package/dist/mdx/react/modal/examples/WithRadioButtons.tsx +1 -0
  89. package/dist/mdx/react/modal/examples/WithTooltips.tsx +3 -2
  90. package/dist/mdx/react/modal/examples/WithoutCloseIcon.tsx +1 -1
  91. package/dist/mdx/react/popup/examples/CloseOnTargetHiddenTest.tsx +31 -17
  92. package/dist/mdx/react/popup/examples/FullScreen.tsx +6 -6
  93. package/dist/mdx/react/popup/examples/InlinePopup.tsx +2 -2
  94. package/dist/mdx/react/popup/examples/MixedPopupTypes.tsx +8 -6
  95. package/dist/mdx/react/popup/examples/NestedPopups.tsx +5 -6
  96. package/dist/mdx/react/popup/examples/PopupWithFallbackPlacements.tsx +6 -6
  97. package/dist/mdx/react/popup/examples/PopupWithNonHidablePopup.tsx +2 -1
  98. package/dist/mdx/react/popup/examples/ReturnFocusTest.tsx +20 -8
  99. package/dist/mdx/react/radio/examples/Inverse.tsx +2 -1
  100. package/dist/mdx/react/segmented-control/examples/Basic.tsx +2 -1
  101. package/dist/mdx/react/segmented-control/examples/Sizes.tsx +2 -3
  102. package/dist/mdx/react/select/examples/Controlled.tsx +2 -1
  103. package/dist/mdx/react/skeleton/examples/Basic.tsx +1 -1
  104. package/dist/mdx/react/skeleton/examples/Color.tsx +1 -1
  105. package/dist/mdx/react/skeleton/examples/Simulation.tsx +3 -3
  106. package/dist/mdx/react/table/examples/BasicWithHeading.tsx +1 -1
  107. package/dist/mdx/react/table/examples/FixedColumn.tsx +2 -2
  108. package/dist/mdx/react/tabs/examples/AlternativeTabStop.tsx +1 -1
  109. package/dist/mdx/react/tabs/examples/Basic.tsx +1 -1
  110. package/dist/mdx/react/tabs/examples/DisabledTab.tsx +1 -1
  111. package/dist/mdx/react/tabs/examples/DynamicTabs.tsx +6 -2
  112. package/dist/mdx/react/tabs/examples/HoistedModel.tsx +1 -1
  113. package/dist/mdx/react/tabs/examples/Icons.tsx +1 -1
  114. package/dist/mdx/react/tabs/examples/NamedTabs.tsx +1 -1
  115. package/dist/mdx/react/tabs/examples/OverflowTabs.tsx +7 -3
  116. package/dist/mdx/react/tabs/examples/RightToLeft.tsx +1 -1
  117. package/dist/mdx/react/tabs/examples/SinglePanel.tsx +1 -1
  118. package/dist/mdx/react/text/examples/LabelText/Disabled.tsx +1 -1
  119. package/dist/mdx/react/tokens/examples/Overview.tsx +9 -11
  120. package/dist/mdx/react/tokens/examples/Tokens.tsx +3 -2
  121. package/dist/mdx/react/tooltip/examples/DescriptionType.tsx +2 -1
  122. package/dist/mdx/react/tooltip/examples/Ellipsis.tsx +2 -2
  123. package/dist/mdx/styling/mdx/MergingStyles.mdx +1 -0
  124. package/dist/mdx/styling/mdx/examples/EmotionButton.tsx +1 -0
  125. package/dist/mdx/styling/mdx/examples/StylingOverrides.tsx +5 -5
  126. package/dist/mdx/tokens/TokenMigrationFinal.mdx +1 -1
  127. package/lib/ExampleCodeBlock.tsx +1 -1
  128. package/lib/Table.tsx +2 -2
  129. package/lib/widgetUtils.tsx +1 -1
  130. package/package.json +8 -8
@@ -1,48 +1,37 @@
1
- import * as React from 'react';
2
-
3
1
  import {Flex} from '@workday/canvas-kit-react/layout';
2
+ import {createStencil} from '@workday/canvas-kit-styling';
3
+ import {base, system} from '@workday/canvas-tokens-web';
4
4
 
5
- const baseStyles = {
6
- color: 'blackPepper500',
7
- minHeight: 'xl',
8
- minWidth: '2rem',
9
- padding: 'xs',
10
- };
5
+ const baseStyles = createStencil({
6
+ vars: {
7
+ backgroundColor: '',
8
+ },
9
+ base: ({backgroundColor}) => ({
10
+ color: system.color.fg.default,
11
+ minHeight: system.size.xl,
12
+ minWidth: system.size.sm,
13
+ padding: system.padding.sm,
14
+ textAlign: 'center',
15
+ backgroundColor,
16
+ }),
17
+ });
11
18
 
12
19
  export default () => (
13
- <Flex columnGap="xs">
14
- <Flex flexDirection="column" rowGap="xs" flex={1}>
15
- <Flex.Item backgroundColor="cinnamon300" textAlign="center" {...baseStyles}>
16
- 1
17
- </Flex.Item>
18
- <Flex.Item backgroundColor="sourLemon300" textAlign="center" {...baseStyles}>
19
- 1
20
- </Flex.Item>
21
- <Flex.Item backgroundColor="blueberry300" textAlign="center" {...baseStyles}>
22
- 1
23
- </Flex.Item>
20
+ <Flex cs={{columnGap: system.gap.sm}}>
21
+ <Flex cs={{flexDirection: 'column', rowGap: system.gap.md, flex: 1}}>
22
+ <Flex.Item cs={baseStyles({backgroundColor: base.amber400})}>1</Flex.Item>
23
+ <Flex.Item cs={baseStyles({backgroundColor: base.green400})}>1</Flex.Item>
24
+ <Flex.Item cs={baseStyles({backgroundColor: base.indigo400})}>1</Flex.Item>
24
25
  </Flex>
25
- <Flex flexDirection="column" rowGap="xs" flex={2}>
26
- <Flex.Item backgroundColor="cinnamon300" textAlign="center" {...baseStyles}>
27
- 2
28
- </Flex.Item>
29
- <Flex.Item backgroundColor="sourLemon300" textAlign="center" {...baseStyles}>
30
- 2
31
- </Flex.Item>
32
- <Flex.Item backgroundColor="blueberry300" textAlign="center" {...baseStyles}>
33
- 2
34
- </Flex.Item>
26
+ <Flex cs={{flexDirection: 'column', rowGap: system.gap.md, flex: 2}}>
27
+ <Flex.Item cs={baseStyles({backgroundColor: base.amber400})}>2</Flex.Item>
28
+ <Flex.Item cs={baseStyles({backgroundColor: base.green400})}>2</Flex.Item>
29
+ <Flex.Item cs={baseStyles({backgroundColor: base.indigo400})}>2</Flex.Item>
35
30
  </Flex>
36
- <Flex flexDirection="column" rowGap="xs" flex={1}>
37
- <Flex.Item backgroundColor="cinnamon300" textAlign="center" {...baseStyles}>
38
- 1
39
- </Flex.Item>
40
- <Flex.Item backgroundColor="sourLemon300" textAlign="center" {...baseStyles}>
41
- 1
42
- </Flex.Item>
43
- <Flex.Item backgroundColor="blueberry300" textAlign="center" {...baseStyles}>
44
- 1
45
- </Flex.Item>
31
+ <Flex cs={{flexDirection: 'column', rowGap: system.gap.md, flex: 1}}>
32
+ <Flex.Item cs={baseStyles({backgroundColor: base.amber400})}>1</Flex.Item>
33
+ <Flex.Item cs={baseStyles({backgroundColor: base.green400})}>1</Flex.Item>
34
+ <Flex.Item cs={baseStyles({backgroundColor: base.indigo400})}>1</Flex.Item>
46
35
  </Flex>
47
36
  </Flex>
48
37
  );
@@ -44,7 +44,7 @@ export default () => {
44
44
  <Body>Complete this task when you have a functional understanding of Grid.</Body>
45
45
  </Box>
46
46
  <Grid cs={{gridTemplate: 'auto / 1fr auto', justifyItems: 'end'}}>
47
- <Box cs={{marginRight: system.gap.sm}}>
47
+ <Box cs={{marginInlineEnd: system.gap.sm}}>
48
48
  <PrimaryButton onClick={() => setIsComplete(true)}>Complete</PrimaryButton>
49
49
  </Box>
50
50
  <SecondaryButton onClick={() => setIsComplete(false)}>Cancel</SecondaryButton>
@@ -1,57 +1,67 @@
1
1
  import * as React from 'react';
2
2
 
3
3
  import {Box, Grid} from '@workday/canvas-kit-react/layout';
4
+ import {createStyles, px2rem} from '@workday/canvas-kit-styling';
5
+ import {base, system} from '@workday/canvas-tokens-web';
6
+
7
+ const baseStyles = createStyles({
8
+ alignContent: 'center',
9
+ padding: system.padding.sm,
10
+ justifyContent: 'center',
11
+ backgroundColor: system.color.surface.alt.default,
12
+ color: system.color.fg.default,
13
+ borderRadius: system.shape.md,
14
+ });
4
15
 
5
16
  const Cell = (props: {children: React.ReactNode}) => {
6
- return (
7
- <Grid
8
- alignContent="center"
9
- padding="xs"
10
- justifyContent="center"
11
- backgroundColor="soap500"
12
- color="blackPepper500"
13
- borderRadius="m"
14
- >
15
- {props.children}
16
- </Grid>
17
- );
17
+ return <Grid cs={baseStyles}>{props.children}</Grid>;
18
18
  };
19
19
 
20
+ const cellItemStyles = createStyles({
21
+ alignContent: 'center',
22
+ gridAutoColumns: 'max-content',
23
+ height: '100%',
24
+ gridAutoFlow: 'column',
25
+ padding: system.padding.sm,
26
+ justifyContent: 'center',
27
+ backgroundColor: system.color.surface.alt.default,
28
+ color: system.color.fg.default,
29
+ borderRadius: system.shape.md,
30
+ });
31
+
20
32
  const CellItem = (props: {children: React.ReactNode}) => {
21
- return (
22
- <Grid
23
- alignContent="center"
24
- gridAutoColumns="max-content"
25
- height="100%"
26
- gridAutoFlow="column"
27
- padding="xs"
28
- justifyContent="center"
29
- backgroundColor="peach300"
30
- color="blackPepper500"
31
- borderRadius="m"
32
- >
33
- {props.children}
34
- </Grid>
35
- );
33
+ return <Grid cs={cellItemStyles}>{props.children}</Grid>;
36
34
  };
37
35
 
38
36
  export default () => {
39
37
  return (
40
- <Box padding="xs">
38
+ <Box cs={{padding: system.padding.sm}}>
41
39
  <Grid
42
- gridTemplateColumns="repeat(auto-fit, minmax(300px, 1fr))"
43
- padding="xxs"
44
- border="5px solid #c860d1"
45
- gridGap="xs"
40
+ cs={{
41
+ gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))',
42
+ gridGap: system.gap.sm,
43
+ border: `${px2rem(5)} solid ${base.magenta600}`,
44
+ padding: system.padding.sm,
45
+ }}
46
46
  >
47
- <Grid.Item gridRowStart="2">
48
- <Grid gridTemplateColumns="repeat(auto-fit, minmax(300px, 1fr))" gridGap="xxs">
47
+ <Grid.Item cs={{gridRowStart: '2'}}>
48
+ <Grid
49
+ cs={{
50
+ gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))',
51
+ gridGap: system.gap.sm,
52
+ }}
53
+ >
49
54
  <Cell>1</Cell>
50
55
  <Cell>2</Cell>
51
56
  </Grid>
52
57
  </Grid.Item>
53
- <Grid.Item gridRowStart="1">
54
- <Grid gridTemplateColumns="repeat(auto-fit, minmax(100px, 1fr))" gridGap="xxs">
58
+ <Grid.Item cs={{gridRowStart: '1'}}>
59
+ <Grid
60
+ cs={{
61
+ gridTemplateColumns: 'repeat(auto-fit, minmax(100px, 1fr))',
62
+ gridGap: system.gap.sm,
63
+ }}
64
+ >
55
65
  <CellItem>3</CellItem>
56
66
  <CellItem>4</CellItem>
57
67
  <CellItem>5</CellItem>
@@ -2,45 +2,42 @@ import React, {useEffect, useRef, useState} from 'react';
2
2
 
3
3
  import {PrimaryButton} from '@workday/canvas-kit-react/button';
4
4
  import {Grid} from '@workday/canvas-kit-react/layout';
5
+ import {createStyles, px2rem} from '@workday/canvas-kit-styling';
5
6
  import {
6
7
  arrowDownIcon,
7
8
  arrowLeftIcon,
8
9
  arrowRightIcon,
9
10
  arrowUpIcon,
10
11
  } from '@workday/canvas-system-icons-web';
12
+ import {base, system} from '@workday/canvas-tokens-web';
13
+
14
+ const baseStyles = createStyles({
15
+ padding: system.padding.sm,
16
+ backgroundColor: system.color.surface.alt.default,
17
+ color: system.color.fg.default,
18
+ borderRadius: system.shape.md,
19
+ alignContent: 'center',
20
+ justifyContent: 'center',
21
+ });
11
22
 
12
23
  const Cell = (props: {children: React.ReactNode}) => {
13
- return (
14
- <Grid
15
- alignContent="center"
16
- padding="xs"
17
- justifyContent="center"
18
- backgroundColor="soap500"
19
- color="blackPepper500"
20
- borderRadius="m"
21
- >
22
- {props.children}
23
- </Grid>
24
- );
24
+ return <Grid cs={baseStyles}>{props.children}</Grid>;
25
25
  };
26
26
 
27
+ const cellItemStyles = createStyles({
28
+ alignContent: 'center',
29
+ gridAutoColumns: 'max-content',
30
+ height: '100%',
31
+ gridAutoFlow: 'column',
32
+ padding: system.padding.sm,
33
+ justifyContent: 'center',
34
+ backgroundColor: system.color.surface.alt.default,
35
+ color: system.color.fg.default,
36
+ borderRadius: system.shape.md,
37
+ });
38
+
27
39
  const CellItem = (props: {children: React.ReactNode}) => {
28
- return (
29
- <Grid
30
- alignContent="center"
31
- gridAutoColumns="max-content"
32
- gridGap="xs"
33
- height="100%"
34
- gridAutoFlow="column"
35
- padding="xs"
36
- justifyContent="center"
37
- backgroundColor="peach300"
38
- color="frenchVanilla100"
39
- borderRadius="m"
40
- >
41
- {props.children}
42
- </Grid>
43
- );
40
+ return <Grid cs={cellItemStyles}>{props.children}</Grid>;
44
41
  };
45
42
 
46
43
  export default () => {
@@ -70,15 +67,17 @@ export default () => {
70
67
  };
71
68
 
72
69
  return (
73
- <Grid gridAutoFlow="row" padding="xs">
70
+ <Grid cs={{gridAutoFlow: 'row', padding: system.padding.sm}}>
74
71
  <Grid
75
- gridTemplateColumns="repeat(3, 1fr)"
76
- gridTemplateRows="repeat(3, 1fr)"
77
- gridGap="xs"
78
- padding="xs"
79
- border="5px solid #c860d1"
72
+ cs={{
73
+ gridTemplateColumns: 'repeat(3, 1fr)',
74
+ gridTemplateRows: 'repeat(3, 1fr)',
75
+ gridGap: system.gap.sm,
76
+ padding: system.padding.sm,
77
+ border: `${px2rem(5)} solid ${base.magenta600}`,
78
+ }}
80
79
  >
81
- <Grid.Item gridRowStart={rowCount} gridColumnStart={colCount}>
80
+ <Grid.Item cs={{gridRowStart: rowCount, gridColumnStart: colCount}}>
82
81
  <CellItem>
83
82
  <PrimaryButton
84
83
  size="extraSmall"
@@ -2,6 +2,7 @@ import React from 'react';
2
2
 
3
3
  import {Menu} from '@workday/canvas-kit-react/menu';
4
4
  import {BodyText} from '@workday/canvas-kit-react/text';
5
+ import {system} from '@workday/canvas-tokens-web';
5
6
 
6
7
  export default () => {
7
8
  const [selected, setSelected] = React.useState('');
@@ -19,7 +20,7 @@ export default () => {
19
20
  </Menu.List>
20
21
  </Menu.Card>
21
22
  </Menu.Popper>
22
- <BodyText size="small" marginTop="s">
23
+ <BodyText size="small" cs={{marginBlockStart: system.gap.md}}>
23
24
  Selected: <span data-testid="output">{selected}</span>
24
25
  </BodyText>
25
26
  </Menu>
@@ -2,6 +2,7 @@ import React from 'react';
2
2
 
3
3
  import {Menu} from '@workday/canvas-kit-react/menu';
4
4
  import {BodyText} from '@workday/canvas-kit-react/text';
5
+ import {system} from '@workday/canvas-tokens-web';
5
6
 
6
7
  export default () => {
7
8
  const [selected, setSelected] = React.useState('');
@@ -18,7 +19,7 @@ export default () => {
18
19
  </Menu.List>
19
20
  </Menu.Card>
20
21
  </Menu.Popper>
21
- <BodyText size="small" marginTop="s">
22
+ <BodyText size="small" cs={{marginBlockStart: system.gap.md}}>
22
23
  Selected: <span data-testid="output">{selected}</span>
23
24
  </BodyText>
24
25
  </Menu>
@@ -2,6 +2,7 @@ import React from 'react';
2
2
 
3
3
  import {Menu} from '@workday/canvas-kit-react/menu';
4
4
  import {BodyText} from '@workday/canvas-kit-react/text';
5
+ import {system} from '@workday/canvas-tokens-web';
5
6
 
6
7
  export default () => {
7
8
  const [selected, setSelected] = React.useState('');
@@ -23,7 +24,7 @@ export default () => {
23
24
  </Menu.List>
24
25
  </Menu.Card>
25
26
  </Menu.Popper>
26
- <BodyText size="small" marginTop="s">
27
+ <BodyText size="small" cs={{marginBlockStart: system.gap.md}}>
27
28
  Selected: <span data-testid="output">{selected}</span>
28
29
  </BodyText>
29
30
  </Menu>
@@ -8,6 +8,7 @@ import {
8
8
  configureIcon,
9
9
  userIcon,
10
10
  } from '@workday/canvas-system-icons-web';
11
+ import {system} from '@workday/canvas-tokens-web';
11
12
 
12
13
  export default () => {
13
14
  const [selected, setSelected] = React.useState('');
@@ -42,7 +43,7 @@ export default () => {
42
43
  </Menu.List>
43
44
  </Menu.Card>
44
45
  </Menu.Popper>
45
- <BodyText size="small" marginTop="s">
46
+ <BodyText size="small" cs={{marginBlockStart: system.gap.md}}>
46
47
  Selected: <span data-testid="output">{selected}</span>
47
48
  </BodyText>
48
49
  </Menu>
@@ -4,6 +4,8 @@ import {Flex} from '@workday/canvas-kit-react/layout';
4
4
  import {Menu} from '@workday/canvas-kit-react/menu';
5
5
  import {Placement} from '@workday/canvas-kit-react/popup';
6
6
  import {BodyText} from '@workday/canvas-kit-react/text';
7
+ import {px2rem} from '@workday/canvas-kit-styling';
8
+ import {system} from '@workday/canvas-tokens-web';
7
9
 
8
10
  import {PopperController} from '../../../../../utils/storybook';
9
11
 
@@ -36,14 +38,16 @@ export default () => {
36
38
  onSetMarginRightBtn={handleMarginRightBtn}
37
39
  >
38
40
  <Flex
39
- width="100%"
40
- marginTop={240}
41
- justifyContent="center"
42
- alignItems="center"
43
- flexDirection="column"
41
+ cs={{
42
+ width: '100%',
43
+ marginBlockStart: px2rem(240),
44
+ justifyContent: 'center',
45
+ alignItems: 'center',
46
+ flexDirection: 'column',
47
+ }}
44
48
  >
45
49
  <Menu onSelect={data => setSelected(data.id)}>
46
- <Menu.Target style={{marginLeft: marginLeftBtn, marginRight: marginRightBtn}}>
50
+ <Menu.Target cs={{marginInlineStart: marginLeftBtn, marginInlineEnd: marginRightBtn}}>
47
51
  Open Menu
48
52
  </Menu.Target>
49
53
  <Menu.Popper placement={placement}>
@@ -57,7 +61,10 @@ export default () => {
57
61
  </Menu.List>
58
62
  </Menu.Card>
59
63
  </Menu.Popper>
60
- <BodyText size="small" marginTop="s" marginLeft={20}>
64
+ <BodyText
65
+ size="small"
66
+ cs={{marginBlockStart: system.gap.md, marginInlineStart: px2rem(20)}}
67
+ >
61
68
  Selected: <span data-testid="output">{selected}</span>
62
69
  </BodyText>
63
70
  </Menu>
@@ -2,6 +2,7 @@ import React from 'react';
2
2
 
3
3
  import {Menu} from '@workday/canvas-kit-react/menu';
4
4
  import {BodyText} from '@workday/canvas-kit-react/text';
5
+ import {system} from '@workday/canvas-tokens-web';
5
6
 
6
7
  export default () => {
7
8
  const [selected, setSelected] = React.useState('');
@@ -40,7 +41,7 @@ export default () => {
40
41
  </Menu.List>
41
42
  </Menu.Card>
42
43
  </Menu.Popper>
43
- <BodyText size="small" marginTop="s">
44
+ <BodyText size="small" cs={{marginBlockStart: system.gap.md}}>
44
45
  Selected: <span data-testid="output">{selected}</span>
45
46
  </BodyText>
46
47
  </Menu>
@@ -97,7 +97,7 @@ export default () => {
97
97
  <Menu.List>{renderItem}</Menu.List>
98
98
  </Menu.Card>
99
99
  </Menu.Popper>
100
- <BodyText size="small" cs={{marginTop: system.gap.md}}>
100
+ <BodyText size="small" cs={{marginBlockStart: system.gap.md}}>
101
101
  Selected: <span data-testid="output">{selected}</span>
102
102
  </BodyText>
103
103
  </Menu>
@@ -2,6 +2,7 @@ import React from 'react';
2
2
 
3
3
  import {Menu} from '@workday/canvas-kit-react/menu';
4
4
  import {BodyText} from '@workday/canvas-kit-react/text';
5
+ import {system} from '@workday/canvas-tokens-web';
5
6
 
6
7
  /**
7
8
  * The `Menu.Item` renders a `role=menuitem` element, and `aria-selected` is not a valid attribute for
@@ -30,7 +31,7 @@ export default () => {
30
31
  </Menu.List>
31
32
  </Menu.Card>
32
33
  </Menu.Popper>
33
- <BodyText size="small" marginTop="s">
34
+ <BodyText size="small" cs={{marginBlockStart: system.gap.md}}>
34
35
  Selected: <span data-testid="output">{selected}</span>
35
36
  </BodyText>
36
37
  </Menu>
@@ -25,7 +25,7 @@ export default () => {
25
25
  software and associated documentation files (the "Software").
26
26
  </Box>
27
27
  </Modal.Body>
28
- <Flex cs={{gap: system.gap.sm, paddingBlock: system.padding.xxs}}>
28
+ <Flex cs={{gap: system.gap.md, paddingBlock: system.padding.xs}}>
29
29
  <Modal.CloseButton as={PrimaryButton} onClick={handleAcknowledge}>
30
30
  Acknowledge
31
31
  </Modal.CloseButton>
@@ -1,8 +1,7 @@
1
- import React from 'react';
2
-
3
1
  import {PrimaryButton} from '@workday/canvas-kit-react/button';
4
2
  import {Flex} from '@workday/canvas-kit-react/layout';
5
3
  import {Modal} from '@workday/canvas-kit-react/modal';
4
+ import {system} from '@workday/canvas-tokens-web';
6
5
 
7
6
  export default () => {
8
7
  const handleAcknowledge = () => {
@@ -21,7 +20,7 @@ export default () => {
21
20
  <Modal.CloseIcon aria-label="Close" />
22
21
  <Modal.Heading>MIT License</Modal.Heading>
23
22
  <Modal.Body tabIndex={0}>
24
- <p style={{marginTop: 0}}>
23
+ <p style={{marginBlockStart: 0}}>
25
24
  Permission is hereby granted, free of charge, to any person obtaining a copy of this
26
25
  software and associated documentation files (the "Software"), to deal in the Software
27
26
  without restriction, including without limitation the rights to use, copy, modify,
@@ -67,7 +66,7 @@ export default () => {
67
66
  suspendisse interdum consectetur libero id faucibus. Morbi tincidunt augue interdum
68
67
  velit. Nullam non nisi est sit amet.
69
68
  </p>
70
- <p style={{marginBottom: 0}}>
69
+ <p style={{marginBlockEnd: 0}}>
71
70
  Aliquet enim tortor at auctor urna nunc id cursus metus. Leo urna molestie at
72
71
  elementum eu facilisis. Consectetur purus ut faucibus pulvinar elementum integer.
73
72
  Volutpat est velit egestas dui id ornare arcu odio. At consectetur lorem donec massa
@@ -81,7 +80,7 @@ export default () => {
81
80
  ut aliquam purus sit.
82
81
  </p>
83
82
  </Modal.Body>
84
- <Flex gap="s" padding="xxs">
83
+ <Flex cs={{gap: system.gap.md, paddingBlock: system.padding.xs}}>
85
84
  <Modal.CloseButton as={PrimaryButton} onClick={handleAcknowledge}>
86
85
  Acknowledge
87
86
  </Modal.CloseButton>
@@ -6,6 +6,7 @@ import {FormField} from '@workday/canvas-kit-react/form-field';
6
6
  import {Box, Flex} from '@workday/canvas-kit-react/layout';
7
7
  import {Modal, useModalModel} from '@workday/canvas-kit-react/modal';
8
8
  import {TextInput} from '@workday/canvas-kit-react/text-input';
9
+ import {system} from '@workday/canvas-tokens-web';
9
10
 
10
11
  export default () => {
11
12
  const longDescID = useUniqueId();
@@ -27,10 +28,10 @@ export default () => {
27
28
  <Modal.CloseIcon aria-label="Close" />
28
29
  <Modal.Heading>Acknowledge License</Modal.Heading>
29
30
  <Modal.Body>
30
- <Box as="p" id={longDescID} marginTop={0} marginBottom="m">
31
+ <Box as="p" id={longDescID} cs={{marginBlockStart: 0, marginBlockEnd: system.gap.md}}>
31
32
  Enter your initials to acknowledge the license.
32
33
  </Box>
33
- <FormField cs={{marginBottom: 0}}>
34
+ <FormField cs={{marginBlockEnd: 0}}>
34
35
  <FormField.Label>Initials</FormField.Label>
35
36
  <FormField.Input
36
37
  as={TextInput}
@@ -40,7 +41,7 @@ export default () => {
40
41
  />
41
42
  </FormField>
42
43
  </Modal.Body>
43
- <Flex gap="s" padding="xxs">
44
+ <Flex cs={{gap: system.gap.md, paddingBlock: system.padding.xs}}>
44
45
  <Modal.CloseButton as={PrimaryButton} onClick={handleAcknowledge}>
45
46
  Acknowledge
46
47
  </Modal.CloseButton>
@@ -1,8 +1,7 @@
1
- import React from 'react';
2
-
3
1
  import {PrimaryButton} from '@workday/canvas-kit-react/button';
4
2
  import {Flex} from '@workday/canvas-kit-react/layout';
5
3
  import {Modal} from '@workday/canvas-kit-react/modal';
4
+ import {system} from '@workday/canvas-tokens-web';
6
5
 
7
6
  export default () => {
8
7
  const handleAcknowledge = () => {
@@ -17,11 +16,11 @@ export default () => {
17
16
  <Modal>
18
17
  <Modal.Target as={PrimaryButton}>Open License</Modal.Target>
19
18
  <Modal.OverflowOverlay>
20
- <Modal.Card maxHeight="inherit" height="inherit">
19
+ <Modal.Card cs={{maxHeight: 'inherit', height: 'inherit'}}>
21
20
  <Modal.CloseIcon aria-label="Close" />
22
21
  <Modal.Heading>MIT License</Modal.Heading>
23
22
  <Modal.Body tabIndex={0}>
24
- <p style={{marginTop: 0}}>
23
+ <p style={{marginBlockStart: 0}}>
25
24
  Permission is hereby granted, free of charge, to any person obtaining a copy of this
26
25
  software and associated documentation files (the "Software"), to deal in the Software
27
26
  without restriction, including without limitation the rights to use, copy, modify,
@@ -67,7 +66,7 @@ export default () => {
67
66
  suspendisse interdum consectetur libero id faucibus. Morbi tincidunt augue interdum
68
67
  velit. Nullam non nisi est sit amet.
69
68
  </p>
70
- <p style={{marginBottom: 0}}>
69
+ <p style={{marginBlockEnd: 0}}>
71
70
  Aliquet enim tortor at auctor urna nunc id cursus metus. Leo urna molestie at
72
71
  elementum eu facilisis. Consectetur purus ut faucibus pulvinar elementum integer.
73
72
  Volutpat est velit egestas dui id ornare arcu odio. At consectetur lorem donec massa
@@ -81,7 +80,7 @@ export default () => {
81
80
  ut aliquam purus sit.
82
81
  </p>
83
82
  </Modal.Body>
84
- <Flex gap="s" padding="xxs">
83
+ <Flex cs={{gap: system.gap.md, paddingBlock: system.padding.xs}}>
85
84
  <Modal.CloseButton as={PrimaryButton} onClick={handleAcknowledge}>
86
85
  Acknowledge
87
86
  </Modal.CloseButton>
@@ -1,6 +1,7 @@
1
1
  import {DeleteButton} from '@workday/canvas-kit-react/button';
2
2
  import {Flex} from '@workday/canvas-kit-react/layout';
3
3
  import {Modal} from '@workday/canvas-kit-react/modal';
4
+ import {system} from '@workday/canvas-tokens-web';
4
5
 
5
6
  export default () => {
6
7
  return (
@@ -12,7 +13,7 @@ export default () => {
12
13
  <Modal.Heading>Delete Item</Modal.Heading>
13
14
  <Modal.Body>
14
15
  <p>Are you sure you want to delete the item?</p>
15
- <Flex gap="s">
16
+ <Flex cs={{gap: system.gap.md}}>
16
17
  <Modal.CloseButton as={DeleteButton}>Delete</Modal.CloseButton>
17
18
  <Modal.CloseButton>Cancel</Modal.CloseButton>
18
19
  </Flex>
@@ -7,6 +7,7 @@ import {
7
7
  useCloseOnOutsideClick,
8
8
  usePopupModel,
9
9
  } from '@workday/canvas-kit-react/popup';
10
+ import {system} from '@workday/canvas-tokens-web';
10
11
 
11
12
  export default () => {
12
13
  const modal = useModalModel();
@@ -30,7 +31,7 @@ export default () => {
30
31
  <Modal.Body>
31
32
  <p>Are you sure you want to delete the item?</p>
32
33
  <Popup model={popup}>
33
- <Flex gap="s">
34
+ <Flex cs={{gap: system.gap.md}}>
34
35
  <Popup.Target as={DeleteButton}>Yes, Delete</Popup.Target>
35
36
  <Popup.CloseButton>Cancel</Popup.CloseButton>
36
37
  </Flex>
@@ -40,7 +41,7 @@ export default () => {
40
41
  <Popup.Heading>Really Delete Item</Popup.Heading>
41
42
  <Popup.Body>
42
43
  <p>Are you sure you'd like to delete the item titled 'My Item'?</p>
43
- <Flex gap="s">
44
+ <Flex cs={{gap: system.gap.md}}>
44
45
  <Popup.CloseButton
45
46
  as={DeleteButton}
46
47
  onClick={event => {
@@ -8,6 +8,7 @@ import {
8
8
  useCloseOnOutsideClick,
9
9
  usePopupModel,
10
10
  } from '@workday/canvas-kit-react/popup';
11
+ import {system} from '@workday/canvas-tokens-web';
11
12
 
12
13
  export default () => {
13
14
  const modal = useModalModel();
@@ -31,7 +32,7 @@ export default () => {
31
32
  <Modal.Body>
32
33
  <p>Are you sure you want to delete the item?</p>
33
34
  <Popup model={popup}>
34
- <Flex gap="s">
35
+ <Flex cs={{gap: system.gap.md}}>
35
36
  <Popup.Target as={DeleteButton}>Yes, Delete</Popup.Target>
36
37
  <Popup.CloseButton>Cancel</Popup.CloseButton>
37
38
  </Flex>
@@ -41,7 +42,7 @@ export default () => {
41
42
  <Popup.Heading>Really Delete Item</Popup.Heading>
42
43
  <Popup.Body>
43
44
  <p>Are you sure you'd like to delete the item titled 'My Item'?</p>
44
- <Flex gap="s">
45
+ <Flex cs={{gap: system.gap.md}}>
45
46
  <Popup.CloseButton
46
47
  as={DeleteButton}
47
48
  onClick={event => {
@@ -29,7 +29,7 @@ export default () => {
29
29
  ("התוכנה").
30
30
  </Box>
31
31
  </Modal.Body>
32
- <Flex cs={{gap: system.gap.sm, paddingBlock: system.padding.xxs}}>
32
+ <Flex cs={{gap: system.gap.md, paddingBlock: system.padding.xs}}>
33
33
  <Modal.CloseButton
34
34
  as={PrimaryButton}
35
35
  onClick={handleAcknowledge}