@workday/canvas-kit-docs 15.0.4 → 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 (129) 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/Popups.mdx +1 -0
  16. package/dist/mdx/accessibility/WindowsHighContrastThemes.mdx +2 -2
  17. package/dist/mdx/preview-react/_examples/mdx/examples/TextInputWithReactHookForm.tsx +2 -2
  18. package/dist/mdx/preview-react/multi-select/examples/Controlled.tsx +56 -57
  19. package/dist/mdx/preview-react/radio/examples/Basic.tsx +1 -1
  20. package/dist/mdx/preview-react/radio/examples/Custom.tsx +1 -1
  21. package/dist/mdx/preview-react/radio/examples/StandaloneRadio.tsx +6 -4
  22. package/dist/mdx/preview-react/side-panel/examples/AlwaysOpen.tsx +1 -1
  23. package/dist/mdx/preview-react/side-panel/examples/RightOrigin.tsx +1 -1
  24. package/dist/mdx/react/_examples/mdx/ContextualHelp.mdx +28 -18
  25. package/dist/mdx/react/_examples/mdx/examples/ContextualHelp/ContextualHelpDialogFocusRedirect.tsx +8 -2
  26. package/dist/mdx/react/_examples/mdx/examples/ContextualHelp/ContextualHelpDialogFocusTrap.tsx +10 -2
  27. package/dist/mdx/react/_examples/mdx/examples/CookieBanner.tsx +75 -58
  28. package/dist/mdx/react/_examples/mdx/examples/ListOfUploadedFiles.tsx +10 -10
  29. package/dist/mdx/react/_examples/mdx/examples/MediaModal.tsx +31 -19
  30. package/dist/mdx/react/_examples/mdx/examples/SelectWithFormik.tsx +5 -4
  31. package/dist/mdx/react/_examples/mdx/examples/layout/AreaColumnPositioning.tsx +32 -13
  32. package/dist/mdx/react/_examples/mdx/examples/layout/CustomColumnPositioning.tsx +37 -25
  33. package/dist/mdx/react/_examples/mdx/examples/layout/CustomColumnWidth.tsx +29 -13
  34. package/dist/mdx/react/_examples/mdx/examples/layout/FullWidthWith3Columns.tsx +6 -7
  35. package/dist/mdx/react/_examples/mdx/examples/layout/FullWidthWith3Columns2Rows.tsx +43 -14
  36. package/dist/mdx/react/_examples/mdx/examples/layout/Masonry.tsx +33 -32
  37. package/dist/mdx/react/_examples/mdx/examples/layout/ResponsiveColumns.tsx +16 -7
  38. package/dist/mdx/react/_examples/mdx/examples/layout/Tiled2and3Columns.tsx +60 -25
  39. package/dist/mdx/react/_examples/mdx/examples/layout/Tiled4and2Columns.tsx +60 -23
  40. package/dist/mdx/react/action-bar/examples/OverflowActionBar.tsx +4 -2
  41. package/dist/mdx/react/avatar/Avatar.mdx +5 -7
  42. package/dist/mdx/react/badge/examples/CustomLimit.tsx +1 -1
  43. package/dist/mdx/react/banner/examples/RefForwarding.tsx +2 -1
  44. package/dist/mdx/react/banner/examples/Sticky.tsx +6 -5
  45. package/dist/mdx/react/banner/examples/StickyRTL.tsx +7 -7
  46. package/dist/mdx/react/breadcrumbs/examples/Overflow.tsx +5 -2
  47. package/dist/mdx/react/button/button/examples/Grow.tsx +10 -3
  48. package/dist/mdx/react/checkbox/examples/Indeterminate.tsx +1 -1
  49. package/dist/mdx/react/collection/mdx/examples/BasicGrid.tsx +25 -12
  50. package/dist/mdx/react/collection/mdx/examples/DataLoader.tsx +8 -6
  51. package/dist/mdx/react/collection/mdx/examples/MultiSelection.tsx +18 -6
  52. package/dist/mdx/react/collection/mdx/examples/OverflowVerticalList.tsx +14 -11
  53. package/dist/mdx/react/collection/mdx/examples/Selection.tsx +5 -1
  54. package/dist/mdx/react/collection/mdx/examples/WrappingGrid.tsx +25 -12
  55. package/dist/mdx/react/combobox/examples/Autocomplete.tsx +3 -4
  56. package/dist/mdx/react/common/mdx/Responsive.mdx +7 -0
  57. package/dist/mdx/react/common/mdx/examples/ResponsiveStyles.tsx +1 -0
  58. package/dist/mdx/react/common/mdx/examples/ResponsiveViewport.tsx +5 -5
  59. package/dist/mdx/react/dialog/examples/Basic.tsx +8 -2
  60. package/dist/mdx/react/dialog/examples/DialogWithFallbackPlacements.tsx +32 -8
  61. package/dist/mdx/react/dialog/examples/Focus.tsx +13 -3
  62. package/dist/mdx/react/form-field/examples/ThemedErrors.tsx +1 -1
  63. package/dist/mdx/react/layout/Box.mdx +7 -1
  64. package/dist/mdx/react/layout/Flex.mdx +6 -0
  65. package/dist/mdx/react/layout/Grid.mdx +6 -0
  66. package/dist/mdx/react/layout/examples/Flex/Basic.tsx +28 -39
  67. package/dist/mdx/react/layout/examples/Grid/GridCard.tsx +1 -1
  68. package/dist/mdx/react/layout/examples/Grid/GridLayout.tsx +46 -36
  69. package/dist/mdx/react/layout/examples/Grid/GridLayoutInteractive.tsx +34 -35
  70. package/dist/mdx/react/menu/examples/Basic.tsx +2 -1
  71. package/dist/mdx/react/menu/examples/ContextMenu.tsx +2 -1
  72. package/dist/mdx/react/menu/examples/Grouping.tsx +2 -1
  73. package/dist/mdx/react/menu/examples/Icons.tsx +2 -1
  74. package/dist/mdx/react/menu/examples/MenuWithFallbackPlacements.tsx +14 -7
  75. package/dist/mdx/react/menu/examples/Nested.tsx +2 -1
  76. package/dist/mdx/react/menu/examples/NestedDynamic.tsx +1 -1
  77. package/dist/mdx/react/menu/examples/SelectableMenu.tsx +2 -1
  78. package/dist/mdx/react/modal/examples/Basic.tsx +1 -1
  79. package/dist/mdx/react/modal/examples/BodyOverflow.tsx +4 -5
  80. package/dist/mdx/react/modal/examples/CustomFocus.tsx +4 -3
  81. package/dist/mdx/react/modal/examples/FullOverflow.tsx +5 -6
  82. package/dist/mdx/react/modal/examples/IframeTest.tsx +2 -1
  83. package/dist/mdx/react/modal/examples/ModalWithPopup.tsx +3 -2
  84. package/dist/mdx/react/modal/examples/ModalWithPopupRTL.tsx +3 -2
  85. package/dist/mdx/react/modal/examples/NoTargetRTL.tsx +1 -1
  86. package/dist/mdx/react/modal/examples/StackedModals.tsx +3 -2
  87. package/dist/mdx/react/modal/examples/WithRadioButtons.tsx +1 -0
  88. package/dist/mdx/react/modal/examples/WithTooltips.tsx +3 -2
  89. package/dist/mdx/react/modal/examples/WithoutCloseIcon.tsx +1 -1
  90. package/dist/mdx/react/popup/examples/CloseOnTargetHiddenTest.tsx +31 -17
  91. package/dist/mdx/react/popup/examples/FullScreen.tsx +6 -6
  92. package/dist/mdx/react/popup/examples/InlinePopup.tsx +2 -2
  93. package/dist/mdx/react/popup/examples/MixedPopupTypes.tsx +8 -6
  94. package/dist/mdx/react/popup/examples/NestedPopups.tsx +5 -6
  95. package/dist/mdx/react/popup/examples/PopupWithFallbackPlacements.tsx +6 -6
  96. package/dist/mdx/react/popup/examples/PopupWithNonHidablePopup.tsx +2 -1
  97. package/dist/mdx/react/popup/examples/ReturnFocusTest.tsx +20 -8
  98. package/dist/mdx/react/radio/examples/Inverse.tsx +2 -1
  99. package/dist/mdx/react/segmented-control/examples/Basic.tsx +2 -1
  100. package/dist/mdx/react/segmented-control/examples/Sizes.tsx +2 -3
  101. package/dist/mdx/react/select/examples/Controlled.tsx +2 -1
  102. package/dist/mdx/react/skeleton/examples/Basic.tsx +1 -1
  103. package/dist/mdx/react/skeleton/examples/Color.tsx +1 -1
  104. package/dist/mdx/react/skeleton/examples/Simulation.tsx +3 -3
  105. package/dist/mdx/react/table/examples/BasicWithHeading.tsx +1 -1
  106. package/dist/mdx/react/table/examples/FixedColumn.tsx +2 -2
  107. package/dist/mdx/react/tabs/examples/AlternativeTabStop.tsx +1 -1
  108. package/dist/mdx/react/tabs/examples/Basic.tsx +1 -1
  109. package/dist/mdx/react/tabs/examples/DisabledTab.tsx +1 -1
  110. package/dist/mdx/react/tabs/examples/DynamicTabs.tsx +6 -2
  111. package/dist/mdx/react/tabs/examples/HoistedModel.tsx +1 -1
  112. package/dist/mdx/react/tabs/examples/Icons.tsx +1 -1
  113. package/dist/mdx/react/tabs/examples/NamedTabs.tsx +1 -1
  114. package/dist/mdx/react/tabs/examples/OverflowTabs.tsx +7 -3
  115. package/dist/mdx/react/tabs/examples/RightToLeft.tsx +1 -1
  116. package/dist/mdx/react/tabs/examples/SinglePanel.tsx +1 -1
  117. package/dist/mdx/react/text/examples/LabelText/Disabled.tsx +1 -1
  118. package/dist/mdx/react/tokens/examples/Overview.tsx +9 -11
  119. package/dist/mdx/react/tokens/examples/Tokens.tsx +3 -2
  120. package/dist/mdx/react/tooltip/examples/DescriptionType.tsx +2 -1
  121. package/dist/mdx/react/tooltip/examples/Ellipsis.tsx +2 -2
  122. package/dist/mdx/styling/mdx/MergingStyles.mdx +1 -0
  123. package/dist/mdx/styling/mdx/examples/EmotionButton.tsx +1 -0
  124. package/dist/mdx/styling/mdx/examples/StylingOverrides.tsx +5 -5
  125. package/dist/mdx/tokens/TokenMigrationFinal.mdx +1 -1
  126. package/lib/ExampleCodeBlock.tsx +1 -1
  127. package/lib/Table.tsx +2 -2
  128. package/lib/widgetUtils.tsx +1 -1
  129. package/package.json +8 -8
@@ -2,17 +2,26 @@ 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';
5
+ import {createStyles, px2rem} from '@workday/canvas-kit-styling';
6
+ import {system} from '@workday/canvas-tokens-web';
7
+
8
+ const gridStyles = createStyles({
9
+ gridTemplateAreas: "'Heading Heading Heading'",
10
+ gridTemplateColumns: 'repeat(3, 1fr)',
11
+ gridAutoRows: 'min-content',
12
+ gridRowGap: system.gap.sm,
13
+ gridColumnGap: system.gap.xl,
14
+ });
15
+
16
+ const headingStyles = createStyles({
17
+ gridArea: 'Heading',
18
+ paddingInline: system.padding.sm,
19
+ border: `${px2rem(1)} solid ${system.color.brand.border.primary}`,
20
+ });
6
21
 
7
22
  export default () => (
8
- <Grid
9
- gridTemplateAreas="'Heading Heading Heading'"
10
- gridColumn="repeat(3, 1fr)"
11
- gridAutoRows="min-content"
12
- gridRowGap="s"
13
- gridColumnGap="xxxl"
14
- >
15
- <Box gridArea="Heading" paddingX="s" border={`1px solid ${colors.blueberry400}`}>
23
+ <Grid cs={gridStyles}>
24
+ <Box cs={headingStyles}>
16
25
  <Heading size="medium">Full Width With 3 Columns and 2 Rows</Heading>
17
26
  </Box>
18
27
  <FormSkeleton />
@@ -24,15 +33,35 @@ export default () => (
24
33
  </Grid>
25
34
  );
26
35
 
36
+ const boxStyles = createStyles({
37
+ border: `${px2rem(1)} dashed ${system.color.brand.border.primary}`,
38
+ paddingInline: system.padding.md,
39
+ });
40
+
41
+ const itemStyles = createStyles({
42
+ gridGap: system.gap.md,
43
+ marginBlockEnd: system.gap.lg,
44
+ '> *:first-child': {
45
+ width: px2rem(120),
46
+ height: system.size.xxs,
47
+ backgroundColor: system.color.surface.alt.default,
48
+ },
49
+ '> *:last-child': {
50
+ border: `${px2rem(1)} solid ${system.color.border.default}`,
51
+ width: '100%',
52
+ height: system.size.xxs,
53
+ },
54
+ });
55
+
27
56
  const FormSkeleton = props => (
28
- <Box border={`1px dashed ${colors.blueberry400}`} paddingX="m" {...props}>
29
- <BodyText size="small" fontWeight="bold">
57
+ <Box cs={boxStyles} {...props}>
58
+ <BodyText size="small" cs={{fontWeight: system.fontWeight.bold}}>
30
59
  Form Block
31
60
  </BodyText>
32
61
  {Array.from({length: 3}).map(() => (
33
- <Grid gridGap="s" marginBottom="xl">
34
- <Box backgroundColor="soap500" width="120px" height="s" />
35
- <Box borderWidth="1px" borderStyle="solid" borderColor="soap500" width="100%" height="xl" />
62
+ <Grid cs={itemStyles}>
63
+ <Box />
64
+ <Box />
36
65
  </Grid>
37
66
  ))}
38
67
  </Box>
@@ -1,54 +1,55 @@
1
1
  import * as React from 'react';
2
2
 
3
- import {styled} from '@workday/canvas-kit-react/common';
4
3
  import {Box, Grid} from '@workday/canvas-kit-react/layout';
5
4
  import {Heading} from '@workday/canvas-kit-react/text';
6
- import {colors} from '@workday/canvas-kit-react/tokens';
5
+ import {createStyles, px2rem} from '@workday/canvas-kit-styling';
6
+ import {system} from '@workday/canvas-tokens-web';
7
7
 
8
- const Container = styled(Box)({
8
+ const containerStyles = createStyles({
9
9
  columnCount: 3,
10
- columnGap: '12px',
10
+ columnGap: system.gap.md,
11
11
  });
12
12
 
13
- const StyledCard = styled(Box)({
13
+ const cardStyles = createStyles({
14
14
  breakInside: 'avoid',
15
+ border: `${px2rem(2)} dashed ${system.color.brand.border.primary}`,
16
+ marginBlockEnd: system.gap.sm,
17
+ padding: system.padding.md,
18
+ });
19
+
20
+ const gridStyles = createStyles({
21
+ gridGap: system.gap.md,
22
+ marginBlockEnd: system.gap.xl,
23
+ '> *:first-child': {
24
+ width: px2rem(120),
25
+ height: system.size.xxs,
26
+ backgroundColor: system.color.surface.alt.default,
27
+ },
28
+ '> *:last-child': {
29
+ border: `${px2rem(1)} solid ${system.color.border.default}`,
30
+ width: '100%',
31
+ height: system.size.xxs,
32
+ },
15
33
  });
16
34
 
17
35
  export default () => (
18
36
  <>
19
37
  <Heading size="medium">Masonry Layout</Heading>
20
- <Container>
38
+ <Box cs={containerStyles}>
21
39
  {Array.from({length: 8}).map((_, ind) => (
22
- <StyledCard
23
- key={ind}
24
- border={`2px dashed ${colors.blueberry400}`}
25
- marginBottom="xs"
26
- padding="s"
27
- >
28
- <Grid gridGap="s" marginBottom="xl">
29
- <Box backgroundColor="soap500" width="120px" height="s" />
30
- <Box
31
- borderWidth="1px"
32
- borderStyle="solid"
33
- borderColor="soap500"
34
- width="100%"
35
- height="xl"
36
- />
40
+ <Box key={ind} cs={cardStyles}>
41
+ <Grid cs={gridStyles}>
42
+ <Box />
43
+ <Box />
37
44
  </Grid>
38
45
  {ind % 2 === 0 && (
39
- <Grid gridGap="s" marginBottom="xl">
40
- <Box backgroundColor="soap500" width="120px" height="s" />
41
- <Box
42
- borderWidth="1px"
43
- borderStyle="solid"
44
- borderColor="soap500"
45
- width="100%"
46
- height="xl"
47
- />
46
+ <Grid cs={gridStyles}>
47
+ <Box />
48
+ <Box />
48
49
  </Grid>
49
50
  )}
50
- </StyledCard>
51
+ </Box>
51
52
  ))}
52
- </Container>
53
+ </Box>
53
54
  </>
54
55
  );
@@ -3,6 +3,8 @@ import * as React from 'react';
3
3
  import {Box, Grid} from '@workday/canvas-kit-react/layout';
4
4
  import {SegmentedControl} from '@workday/canvas-kit-react/segmented-control';
5
5
  import {BodyText, Heading} from '@workday/canvas-kit-react/text';
6
+ import {px2rem} from '@workday/canvas-kit-styling';
7
+ import {base, system} from '@workday/canvas-tokens-web';
6
8
 
7
9
  export default () => {
8
10
  const [screen, setScreen] = React.useState('100%');
@@ -12,19 +14,26 @@ export default () => {
12
14
  <Heading size="medium">Responsive Columns</Heading>
13
15
  <BodyText size="small">Choose screen size to see changes</BodyText>
14
16
  <SegmentedControl initialValue={screen} onSelect={data => setScreen(data.id)}>
15
- <SegmentedControl.List aria-label="screen-size" marginBottom="l">
17
+ <SegmentedControl.List aria-label="screen-size" cs={{marginBlockEnd: system.gap.lg}}>
16
18
  <SegmentedControl.Item data-id="100%">100%</SegmentedControl.Item>
17
19
  <SegmentedControl.Item data-id="75%">75%</SegmentedControl.Item>
18
20
  <SegmentedControl.Item data-id="50%">50%</SegmentedControl.Item>
19
21
  <SegmentedControl.Item data-id="25%">25%</SegmentedControl.Item>
20
22
  </SegmentedControl.List>
21
23
  </SegmentedControl>
22
- <Box maxWidth={screen} border="2px solid black" padding="s">
23
- <Grid gridTemplateColumns="repeat(auto-fit, minmax(200px, 1fr))" gridGap="m">
24
- <Box height="120px" backgroundColor="blueberry300" />
25
- <Box height="120px" backgroundColor="blueberry400" />
26
- <Box height="120px" backgroundColor="blueberry500" />
27
- <Box height="120px" backgroundColor="blueberry600" />
24
+ <Box
25
+ cs={{
26
+ maxWidth: screen,
27
+ padding: system.padding.md,
28
+ border: `${px2rem(2)} solid ${system.color.border.default}`,
29
+ }}
30
+ >
31
+ <Grid
32
+ cs={{gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))', gridGap: system.gap.md}}
33
+ >
34
+ <Box cs={{height: px2rem(120), backgroundColor: base.blue400}} />
35
+ <Box cs={{height: px2rem(120), backgroundColor: base.blue500}} />
36
+ <Box cs={{height: px2rem(120), backgroundColor: base.blue600}} />
28
37
  </Grid>
29
38
  </Box>
30
39
  </>
@@ -2,39 +2,74 @@ 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';
5
+ import {createStencil, createStyles, px2rem} from '@workday/canvas-kit-styling';
6
+ import {system} from '@workday/canvas-tokens-web';
7
+
8
+ const gridStyles = createStyles({
9
+ gridTemplateAreas: `
10
+ 'Heading Heading Heading Heading Heading Heading'
11
+ 'FormThirdLeft FormThirdLeft FormThirdCenter FormThirdCenter FormThirdRight FormThirdRight'
12
+ 'FormHalfRight FormHalfRight FormHalfRight FormHalfLeft FormHalfLeft FormHalfLeft'
13
+ `,
14
+ gridAutoRows: 'min-content',
15
+ gridRowGap: system.gap.sm,
16
+ gridColumnGap: system.gap.xxl,
17
+ '> *:first-child': {
18
+ paddingInline: system.padding.sm,
19
+ border: `${px2rem(1)} solid ${system.color.brand.border.primary}`,
20
+ gridArea: 'Heading',
21
+ },
22
+ });
6
23
 
7
24
  export default () => (
8
- <Grid
9
- gridTemplateAreas={`
10
- 'Heading Heading Heading Heading Heading Heading'
11
- 'FormThirdLeft FormThirdLeft FormThirdCenter FormThirdCenter FormThirdRight FormThirdRight'
12
- 'FormHalfRight FormHalfRight FormHalfRight FormHalfLeft FormHalfLeft FormHalfLeft'
13
- `}
14
- gridAutoRows="min-content"
15
- gridRowGap="s"
16
- gridColumnGap="xxxl"
17
- >
18
- <Box gridArea="Heading" paddingX="s" border={`1px solid ${colors.blueberry400}`}>
25
+ <Grid cs={gridStyles}>
26
+ <Box>
19
27
  <Heading size="medium">3 and 2 Column Tiled View</Heading>
20
28
  </Box>
21
- <FormSkeleton gridArea="FormThirdLeft" text="Form - Left Third" />
22
- <FormSkeleton gridArea="FormThirdCenter" text="Form - Center Third" />
23
- <FormSkeleton gridArea="FormThirdRight" text="Form - Right Third" />
24
- <FormSkeleton gridArea="FormHalfRight" text="Form - Left Half" />
25
- <FormSkeleton gridArea="FormHalfLeft" text="Form - Right Half" />
29
+ <FormSkeleton area="FormThirdLeft" text="Form - Left Third" />
30
+ <FormSkeleton area="FormThirdCenter" text="Form - Center Third" />
31
+ <FormSkeleton area="FormThirdRight" text="Form - Right Third" />
32
+ <FormSkeleton area="FormHalfRight" text="Form - Left Half" />
33
+ <FormSkeleton area="FormHalfLeft" text="Form - Right Half" />
26
34
  </Grid>
27
35
  );
28
36
 
29
- const FormSkeleton = ({gridArea, text}) => (
30
- <Box border={`1px dashed ${colors.blueberry400}`} paddingX="m" gridArea={gridArea}>
31
- <BodyText size="small" fontWeight="bold">
32
- {text}
33
- </BodyText>
37
+ const boxStencil = createStencil({
38
+ vars: {
39
+ area: '',
40
+ },
41
+ base: ({area}) => ({
42
+ paddingInline: system.padding.md,
43
+ border: `${px2rem(1)} dashed ${system.color.brand.border.primary}`,
44
+ gridArea: area,
45
+ p: {
46
+ fontWeight: system.fontWeight.bold,
47
+ },
48
+ }),
49
+ });
50
+
51
+ const innerGridStyles = createStyles({
52
+ gridGap: system.gap.sm,
53
+ marginBlockEnd: system.gap.xl,
54
+ '> *:first-child': {
55
+ width: px2rem(120),
56
+ height: system.size.xxs,
57
+ backgroundColor: system.color.surface.alt.default,
58
+ },
59
+ '> *:last-child': {
60
+ border: `${px2rem(1)} solid ${system.color.border.default}`,
61
+ width: '100%',
62
+ height: system.size.xxs,
63
+ },
64
+ });
65
+
66
+ const FormSkeleton = ({area, text}) => (
67
+ <Box cs={boxStencil({area})}>
68
+ <BodyText size="small">{text}</BodyText>
34
69
  {Array.from({length: 3}).map(() => (
35
- <Grid gridGap="s" marginBottom="xl">
36
- <Box backgroundColor="soap500" width="120px" height="s" />
37
- <Box borderWidth="1px" borderStyle="solid" borderColor="soap500" width="100%" height="xl" />
70
+ <Grid cs={innerGridStyles}>
71
+ <Box />
72
+ <Box />
38
73
  </Grid>
39
74
  ))}
40
75
  </Box>
@@ -2,40 +2,77 @@ 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';
5
+ import {createStencil, createStyles, px2rem} from '@workday/canvas-kit-styling';
6
+ import {system} from '@workday/canvas-tokens-web';
7
+
8
+ const gridStyles = createStyles({
9
+ gridTemplateAreas: `
10
+ 'Heading Heading Heading Heading'
11
+ 'FormTopHalfLeft FormTopHalfLeft FormQuarterLeft FormQuarterRight'
12
+ 'FormHalfLeft FormHalfLeft FormHalfRight FormHalfRight '
13
+ `,
14
+ gridTemplateColumns: 'repeat(4, 1fr)',
15
+ gridAutoRows: 'min-content',
16
+ gridRowGap: system.gap.sm,
17
+ gridColumnGap: system.gap.xxl,
18
+ '> *:first-child': {
19
+ paddingInline: system.padding.sm,
20
+ border: `${px2rem(1)} solid ${system.color.brand.border.primary}`,
21
+ gridArea: 'Heading',
22
+ },
23
+ });
6
24
 
7
25
  export default () => (
8
- <Grid
9
- gridTemplateAreas={`
10
- 'Heading Heading Heading Heading'
11
- 'FormTopHalfLeft FormTopHalfLeft FormQuarterLeft FormQuarterRight'
12
- 'FormHalfLeft FormHalfLeft FormHalfRight FormHalfRight '
13
- `}
14
- gridTemplateColumns="repeat(4, 1fr)"
15
- gridAutoRows="min-content"
16
- gridRowGap="s"
17
- gridColumnGap="xxxl"
18
- >
19
- <Box gridArea="Heading" paddingX="s" border={`1px solid ${colors.blueberry400}`}>
26
+ <Grid cs={gridStyles}>
27
+ <Box>
20
28
  <Heading size="medium">4 and 2 Column Tiled View</Heading>
21
29
  </Box>
22
- <FormSkeleton gridArea="FormTopHalfLeft" text="Form - Top Left Half" />
23
- <FormSkeleton gridArea="FormQuarterLeft" text="Form - Left Quarter" />
24
- <FormSkeleton gridArea="FormQuarterRight" text="Form - Right Quarter" />
25
- <FormSkeleton gridArea="FormHalfLeft" text="Form - Left Half" />
26
- <FormSkeleton gridArea="FormHalfRight" text="Form - Right Half" />
30
+ <FormSkeleton area="FormTopHalfLeft" text="Form - Top Left Half" />
31
+ <FormSkeleton area="FormQuarterLeft" text="Form - Left Quarter" />
32
+ <FormSkeleton area="FormQuarterRight" text="Form - Right Quarter" />
33
+ <FormSkeleton area="FormHalfLeft" text="Form - Left Half" />
34
+ <FormSkeleton area="FormHalfRight" text="Form - Right Half" />
27
35
  </Grid>
28
36
  );
29
37
 
30
- const FormSkeleton = ({gridArea, text}) => (
31
- <Box border={`1px dashed ${colors.blueberry400}`} paddingX="m" gridArea={gridArea}>
38
+ const boxStencil = createStencil({
39
+ vars: {
40
+ area: '',
41
+ },
42
+ base: ({area}) => ({
43
+ paddingInline: system.padding.md,
44
+ border: `${px2rem(1)} dashed ${system.color.brand.border.primary}`,
45
+ gridArea: area,
46
+ p: {
47
+ fontWeight: system.fontWeight.bold,
48
+ },
49
+ }),
50
+ });
51
+
52
+ const innerGridStyles = createStyles({
53
+ gridGap: system.gap.sm,
54
+ marginBlockEnd: system.gap.xl,
55
+ '> *:first-child': {
56
+ width: px2rem(120),
57
+ height: system.size.xxs,
58
+ backgroundColor: system.color.surface.alt.default,
59
+ },
60
+ '> *:last-child': {
61
+ border: `${px2rem(1)} solid ${system.color.border.default}`,
62
+ width: '100%',
63
+ height: system.size.xxs,
64
+ },
65
+ });
66
+
67
+ const FormSkeleton = ({area, text}) => (
68
+ <Box cs={boxStencil({area})}>
32
69
  <BodyText size="small" fontWeight="bold">
33
70
  {text}
34
71
  </BodyText>
35
72
  {Array.from({length: 3}).map(() => (
36
- <Grid gridGap="s" marginBottom="xl">
37
- <Box backgroundColor="soap500" width="120px" height="s" />
38
- <Box borderWidth="1px" borderStyle="solid" borderColor="soap500" width="100%" height="xl" />
73
+ <Grid cs={innerGridStyles}>
74
+ <Box />
75
+ <Box />
39
76
  </Grid>
40
77
  ))}
41
78
  </Box>
@@ -5,6 +5,8 @@ import {PrimaryButton} from '@workday/canvas-kit-react/button';
5
5
  import {breakpoints} from '@workday/canvas-kit-react/common';
6
6
  import {Box} from '@workday/canvas-kit-react/layout';
7
7
  import {SegmentedControl} from '@workday/canvas-kit-react/segmented-control';
8
+ import {px2rem} from '@workday/canvas-kit-styling';
9
+ import {system} from '@workday/canvas-tokens-web';
8
10
 
9
11
  type MyActionItem = {
10
12
  id: string;
@@ -25,7 +27,7 @@ export default () => {
25
27
 
26
28
  return (
27
29
  <div>
28
- <Box maxWidth={containerWidth} marginBottom="xl">
30
+ <Box cs={{maxWidth: containerWidth, marginBlockEnd: system.gap.xxl}}>
29
31
  <ActionBar model={model}>
30
32
  <ActionBar.List
31
33
  position="relative"
@@ -43,7 +45,7 @@ export default () => {
43
45
  )}
44
46
  </ActionBar.List>
45
47
  <ActionBar.Menu.Popper>
46
- <ActionBar.Menu.Card maxWidth={300} maxHeight={200}>
48
+ <ActionBar.Menu.Card cs={{maxWidth: px2rem(300), maxHeight: px2rem(200)}}>
47
49
  <ActionBar.Menu.List>
48
50
  {(item: MyActionItem) => (
49
51
  <ActionBar.Menu.Item onClick={() => console.log(item.id)}>
@@ -1,13 +1,11 @@
1
1
  import {
2
- ExampleCodeBlock,
3
- Specifications,
4
- StorybookStatusIndicator,
5
- SymbolDoc,
2
+ ExampleCodeBlock,
3
+ Specifications,
4
+ StorybookStatusIndicator,
5
+ SymbolDoc,
6
6
  } from '@workday/canvas-kit-docs';
7
7
 
8
-
9
-
10
- import { Avatar } from '@workday/canvas-kit-react/avatar';
8
+ import {Avatar} from '@workday/canvas-kit-react/avatar';
11
9
 
12
10
  import Basic from './examples/Basic';
13
11
  import Custom from './examples/Custom';
@@ -14,7 +14,7 @@ const columnStyles = createStyles({
14
14
 
15
15
  const controls = createStyles({
16
16
  boxSizing: 'border-box',
17
- borderBottom: `solid 1px ${system.color.border.divider}`,
17
+ borderBlockEnd: `solid 1px ${system.color.border.strong}`,
18
18
  display: 'flex',
19
19
  gap: system.gap.xs,
20
20
  padding: system.padding.xxs,
@@ -4,6 +4,7 @@ import {Banner} from '@workday/canvas-kit-react/banner';
4
4
  import {SecondaryButton} from '@workday/canvas-kit-react/button';
5
5
  import {changeFocus} from '@workday/canvas-kit-react/common';
6
6
  import {Flex} from '@workday/canvas-kit-react/layout';
7
+ import {px2rem} from '@workday/canvas-kit-styling';
7
8
 
8
9
  export default () => {
9
10
  const bannerRef = React.useRef<HTMLButtonElement>(null);
@@ -13,7 +14,7 @@ export default () => {
13
14
  };
14
15
 
15
16
  return (
16
- <Flex flexDirection="column" gap="xs" alignItems="flex-start">
17
+ <Flex cs={{gap: px2rem(12), alignItems: 'flex-start', flexDirection: 'column'}}>
17
18
  <Banner ref={bannerRef}>
18
19
  <Banner.Icon />
19
20
  <Banner.Label>3 Warnings</Banner.Label>
@@ -1,20 +1,21 @@
1
1
  import {Banner} from '@workday/canvas-kit-react/banner';
2
- import {styled} from '@workday/canvas-kit-react/common';
3
2
  import {Box} from '@workday/canvas-kit-react/layout';
3
+ import {createStyles} from '@workday/canvas-kit-styling';
4
+ import {system} from '@workday/canvas-tokens-web';
4
5
 
5
- const StyledBanner = styled(Banner)({
6
+ const containerStyles = createStyles({
6
7
  position: 'absolute',
7
8
  right: 0,
8
9
  });
9
10
 
10
11
  export default () => {
11
12
  return (
12
- <Box height={64}>
13
- <StyledBanner hasError={true} isSticky={true}>
13
+ <Box cs={{height: system.size.xxl}}>
14
+ <Banner hasError={true} isSticky={true} cs={containerStyles}>
14
15
  <Banner.Icon />
15
16
  <Banner.Label>3 Errors</Banner.Label>
16
17
  <Banner.ActionText />
17
- </StyledBanner>
18
+ </Banner>
18
19
  </Box>
19
20
  );
20
21
  };
@@ -1,10 +1,10 @@
1
- import React from 'react';
2
-
3
1
  import {Banner} from '@workday/canvas-kit-react/banner';
4
- import {CanvasProvider, styled} from '@workday/canvas-kit-react/common';
2
+ import {CanvasProvider} from '@workday/canvas-kit-react/common';
5
3
  import {Box} from '@workday/canvas-kit-react/layout';
4
+ import {createStyles} from '@workday/canvas-kit-styling';
5
+ import {system} from '@workday/canvas-tokens-web';
6
6
 
7
- const StyledStickyBanner = styled(Banner)({
7
+ const containerStyles = createStyles({
8
8
  position: 'absolute',
9
9
  right: 0,
10
10
  });
@@ -12,12 +12,12 @@ const StyledStickyBanner = styled(Banner)({
12
12
  export default () => {
13
13
  return (
14
14
  <CanvasProvider dir="rtl">
15
- <Box height={64}>
16
- <StyledStickyBanner isSticky={true}>
15
+ <Box cs={{height: system.size.xxl}}>
16
+ <Banner isSticky={true} cs={containerStyles}>
17
17
  <Banner.Icon />
18
18
  <Banner.Label>3 אזהרות</Banner.Label>
19
19
  <Banner.ActionText />
20
- </StyledStickyBanner>
20
+ </Banner>
21
21
  </Box>
22
22
  </CanvasProvider>
23
23
  );
@@ -27,7 +27,7 @@ export default ({width = '100%'}) => {
27
27
  const [containerWidth, setContainerWidth] = React.useState(width);
28
28
  return (
29
29
  <div>
30
- <Box cs={{width: containerWidth, marginBottom: system.gap.lg}}>
30
+ <Box cs={{width: containerWidth, marginBlockEnd: system.gap.lg}}>
31
31
  <div style={{display: 'flex', flexDirection: 'column'}}>
32
32
  <span>Current Container Width: {containerWidth}</span>
33
33
  <span>Overflow visibility: {model.menu.state.visibility}</span>
@@ -64,7 +64,10 @@ export default ({width = '100%'}) => {
64
64
  setContainerWidth(data.id);
65
65
  }}
66
66
  >
67
- <SegmentedControl.List aria-label="container width control" marginBottom="m">
67
+ <SegmentedControl.List
68
+ aria-label="container width control"
69
+ cs={{marginBlockEnd: system.gap.lg}}
70
+ >
68
71
  <SegmentedControl.Item data-id="100%">100%</SegmentedControl.Item>
69
72
  <SegmentedControl.Item data-id="480px">480px</SegmentedControl.Item>
70
73
  <SegmentedControl.Item data-id="250px">250px</SegmentedControl.Item>
@@ -1,5 +1,3 @@
1
- import React from 'react';
2
-
3
1
  import {
4
2
  DeleteButton,
5
3
  PrimaryButton,
@@ -7,9 +5,18 @@ import {
7
5
  TertiaryButton,
8
6
  } from '@workday/canvas-kit-react/button';
9
7
  import {Flex} from '@workday/canvas-kit-react/layout';
8
+ import {px2rem} from '@workday/canvas-kit-styling';
9
+ import {system} from '@workday/canvas-tokens-web';
10
+
11
+ const baseStyles = {
12
+ gap: system.gap.md,
13
+ padding: system.padding.md,
14
+ flexDirection: 'column',
15
+ maxWidth: px2rem(300),
16
+ };
10
17
 
11
18
  export default () => (
12
- <Flex gap="s" padding="s" flexDirection="column" maxWidth={300}>
19
+ <Flex cs={baseStyles}>
13
20
  <PrimaryButton size="small" grow={true}>
14
21
  Primary
15
22
  </PrimaryButton>
@@ -7,7 +7,7 @@ import {system} from '@workday/canvas-tokens-web';
7
7
 
8
8
  const styleOverrides = createStyles({
9
9
  marginInlineStart: system.gap.xl,
10
- marginTop: system.gap.sm,
10
+ marginBlockStart: system.gap.sm,
11
11
  });
12
12
 
13
13
  export default () => {