@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.
- 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/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
|
@@ -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 {
|
|
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
|
-
|
|
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
|
|
29
|
-
<BodyText size="small" fontWeight
|
|
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
|
|
34
|
-
<Box
|
|
35
|
-
<Box
|
|
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 {
|
|
5
|
+
import {createStyles, px2rem} from '@workday/canvas-kit-styling';
|
|
6
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
7
7
|
|
|
8
|
-
const
|
|
8
|
+
const containerStyles = createStyles({
|
|
9
9
|
columnCount: 3,
|
|
10
|
-
columnGap:
|
|
10
|
+
columnGap: system.gap.md,
|
|
11
11
|
});
|
|
12
12
|
|
|
13
|
-
const
|
|
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
|
-
<
|
|
38
|
+
<Box cs={containerStyles}>
|
|
21
39
|
{Array.from({length: 8}).map((_, ind) => (
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
|
40
|
-
<Box
|
|
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
|
-
</
|
|
51
|
+
</Box>
|
|
51
52
|
))}
|
|
52
|
-
</
|
|
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"
|
|
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
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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 {
|
|
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
|
-
|
|
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
|
|
22
|
-
<FormSkeleton
|
|
23
|
-
<FormSkeleton
|
|
24
|
-
<FormSkeleton
|
|
25
|
-
<FormSkeleton
|
|
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
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
|
36
|
-
<Box
|
|
37
|
-
<Box
|
|
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 {
|
|
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
|
-
|
|
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
|
|
23
|
-
<FormSkeleton
|
|
24
|
-
<FormSkeleton
|
|
25
|
-
<FormSkeleton
|
|
26
|
-
<FormSkeleton
|
|
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
|
|
31
|
-
|
|
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
|
|
37
|
-
<Box
|
|
38
|
-
<Box
|
|
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
|
|
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
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
13
|
-
<
|
|
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
|
-
</
|
|
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
|
|
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
|
|
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
|
|
16
|
-
<
|
|
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
|
-
</
|
|
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,
|
|
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
|
|
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
|
|
19
|
+
<Flex cs={baseStyles}>
|
|
13
20
|
<PrimaryButton size="small" grow={true}>
|
|
14
21
|
Primary
|
|
15
22
|
</PrimaryButton>
|