@workday/canvas-kit-docs 6.9.0-next.0 → 6.9.0-next.2
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/commonjs/index.js +13 -6
- package/dist/commonjs/lib/Specifications.d.ts.map +1 -1
- package/dist/commonjs/lib/Specifications.js +3 -1
- package/dist/commonjs/lib/docs.js +1 -0
- package/dist/commonjs/lib/specs.js +259 -6
- package/dist/es6/lib/Specifications.d.ts.map +1 -1
- package/dist/es6/lib/specs.js +259 -6
- package/dist/mdx/{4.0-MIGRATION-GUIDE.mdx → 4.0-UPGRADE-GUIDE.mdx} +1 -1
- package/dist/mdx/{5.0-MIGRATION-GUIDE.mdx → 5.0-UPGRADE-GUIDE.mdx} +3 -3
- package/dist/mdx/{6.0-MIGRATION-GUIDE.mdx → 6.0-UPGRADE-GUIDE.mdx} +4 -4
- package/dist/mdx/7.0-UPGRADE-GUIDE.mdx +1006 -0
- package/dist/mdx/COMPOUND_COMPONENTS.mdx +2 -2
- package/dist/mdx/CONTRIBUTING.mdx +2 -2
- package/dist/mdx/TESTING.mdx +1 -1
- package/dist/mdx/changelog.stories.mdx +1 -0
- package/dist/mdx/labs-react/search-form/examples/Basic.tsx +4 -2
- package/dist/mdx/labs-react/search-form/examples/CustomTheme.tsx +4 -2
- package/dist/mdx/labs-react/search-form/examples/Grow.tsx +4 -2
- package/dist/mdx/labs-react/search-form/examples/RTL.tsx +4 -2
- package/dist/mdx/labs-react/search-form/examples/Theming.tsx +4 -2
- package/dist/mdx/preview-react/_examples/SidePanelWithOverlay.mdx +8 -0
- package/dist/mdx/preview-react/_examples/examples/SidePanelWithOverlay.tsx +31 -0
- package/dist/mdx/preview-react/_examples/examples/TextInputWithFormik.tsx +3 -3
- package/dist/mdx/preview-react/form-field/examples/Custom.tsx +4 -5
- package/dist/mdx/preview-react/menu/Menu.mdx +1 -1
- package/dist/mdx/preview-react/menu/examples/ContextMenu.tsx +2 -2
- package/dist/mdx/preview-react/menu/examples/Icons.tsx +0 -1
- package/dist/mdx/preview-react/pill/Pill.mdx +241 -0
- package/dist/mdx/preview-react/pill/examples/Basic.tsx +18 -0
- package/dist/mdx/preview-react/pill/examples/WithAvatar.tsx +21 -0
- package/dist/mdx/preview-react/pill/examples/WithCount.tsx +9 -0
- package/dist/mdx/preview-react/pill/examples/WithList.tsx +31 -0
- package/dist/mdx/preview-react/pill/examples/WithReadOnly.tsx +15 -0
- package/dist/mdx/preview-react/pill/examples/WithRemovable.tsx +25 -0
- package/dist/mdx/preview-react/pill/examples/test-avatar.png +0 -0
- package/dist/mdx/preview-react/side-panel/SidePanel.mdx +5 -3
- package/dist/mdx/preview-react/side-panel/examples/AlwaysOpen.tsx +16 -22
- package/dist/mdx/preview-react/side-panel/examples/Basic.tsx +9 -14
- package/dist/mdx/preview-react/side-panel/examples/ExternalControl.tsx +9 -13
- package/dist/mdx/preview-react/side-panel/examples/HiddenName.tsx +1 -1
- package/dist/mdx/preview-react/side-panel/examples/OnExpandedChange.tsx +1 -1
- package/dist/mdx/preview-react/side-panel/examples/OnStateTransition.tsx +1 -1
- package/dist/mdx/preview-react/side-panel/examples/RightOrigin.tsx +17 -24
- package/dist/mdx/preview-react/side-panel/examples/Variant.tsx +9 -14
- package/dist/mdx/preview-react/text-area/examples/Alert.tsx +2 -1
- package/dist/mdx/preview-react/text-area/examples/HiddenLabel.tsx +6 -4
- package/dist/mdx/preview-react/text-area/examples/RefForwarding.tsx +1 -1
- package/dist/mdx/preview-react/text-input/examples/Alert.tsx +2 -1
- package/dist/mdx/preview-react/text-input/examples/HiddenLabel.tsx +6 -4
- package/dist/mdx/preview-react/text-input/examples/RefForwarding.tsx +1 -1
- package/dist/mdx/preview-react/text-input/examples/ThemedAlert.tsx +2 -1
- package/dist/mdx/react/_examples/SegmentedControlWithText.mdx +12 -0
- package/dist/mdx/react/_examples/examples/GlobalHeader.tsx +7 -6
- package/dist/mdx/react/_examples/examples/PageHeader.tsx +5 -5
- package/dist/mdx/react/_examples/examples/SegmentControlWithText.tsx +119 -0
- package/dist/mdx/react/action-bar/ActionBar.mdx +126 -23
- package/dist/mdx/react/action-bar/examples/Basic.tsx +7 -4
- package/dist/mdx/react/action-bar/examples/DeleteAction.tsx +15 -0
- package/dist/mdx/react/action-bar/examples/Icons.tsx +18 -0
- package/dist/mdx/react/action-bar/examples/OverflowActionBar.tsx +59 -0
- package/dist/mdx/react/banner/Banner.mdx +203 -19
- package/dist/mdx/react/banner/PropTables.splitprops.tsx +39 -0
- package/dist/mdx/react/banner/examples/ActionText.tsx +8 -1
- package/dist/mdx/react/banner/examples/Basic.tsx +8 -1
- package/dist/mdx/react/banner/examples/Error.tsx +8 -1
- package/dist/mdx/react/banner/examples/RefForwarding.tsx +25 -0
- package/dist/mdx/react/banner/examples/Sticky.tsx +12 -7
- package/dist/mdx/react/banner/examples/StickyAnimation.tsx +64 -0
- package/dist/mdx/react/banner/examples/StickyRTL.tsx +35 -0
- package/dist/mdx/react/banner/examples/ThemedAlert.tsx +28 -0
- package/dist/mdx/react/banner/examples/ThemedError.tsx +29 -0
- package/dist/mdx/react/button/button/Button.mdx +3 -3
- package/dist/mdx/react/button/button/Hyperlink.mdx +72 -0
- package/dist/mdx/react/button/button/examples/ExternalHyperlink.tsx +7 -0
- package/dist/mdx/react/button/button/examples/ExternalHyperlinkInverse.tsx +12 -0
- package/dist/mdx/react/button/button/examples/Hyperlink.tsx +5 -0
- package/dist/mdx/react/button/button/examples/HyperlinkInverse.tsx +12 -0
- package/dist/mdx/react/button/button/examples/Primary.tsx +11 -3
- package/dist/mdx/react/button/button/examples/PrimaryInverse.tsx +11 -3
- package/dist/mdx/react/button/button/examples/Secondary.tsx +11 -3
- package/dist/mdx/react/button/button/examples/SecondaryInverse.tsx +11 -3
- package/dist/mdx/react/button/button/examples/Tertiary.tsx +9 -4
- package/dist/mdx/react/button/button/examples/TertiaryInverse.tsx +12 -3
- package/dist/mdx/react/card/card.mdx +2 -2
- package/dist/mdx/react/card/examples/Depth.tsx +1 -1
- package/dist/mdx/react/checkbox/Checkbox.mdx +7 -0
- package/dist/mdx/react/checkbox/examples/Indeterminate.tsx +1 -1
- package/dist/mdx/react/checkbox/examples/Inverse.tsx +22 -0
- package/dist/mdx/react/checkbox/examples/RefForwarding.tsx +1 -1
- package/dist/mdx/react/collection/Collection.mdx +358 -0
- package/dist/mdx/react/collection/Collection.splitprops.tsx +19 -0
- package/dist/mdx/react/collection/examples/Basic.tsx +12 -0
- package/dist/mdx/react/collection/examples/BasicGrid.tsx +46 -0
- package/dist/mdx/react/collection/examples/BasicVirtual.tsx +24 -0
- package/dist/mdx/react/collection/examples/DynamicItems.tsx +20 -0
- package/dist/mdx/react/collection/examples/IdentifiedItems.tsx +12 -0
- package/dist/mdx/react/collection/examples/MultiSelection.tsx +56 -0
- package/dist/mdx/react/collection/examples/RovingFocus.tsx +39 -0
- package/dist/mdx/react/collection/examples/Selection.tsx +58 -0
- package/dist/mdx/react/collection/examples/WrappingGrid.tsx +48 -0
- package/dist/mdx/react/color-picker/color-input/ColorInput.mdx +2 -2
- package/dist/mdx/react/color-picker/color-preview/ColorPreview.mdx +2 -2
- package/dist/mdx/{labs-react/common → react/layout}/Box.mdx +3 -6
- package/dist/mdx/{labs-react → react}/layout/Flex.mdx +24 -27
- package/dist/mdx/{labs-react → react}/layout/Stack.mdx +98 -146
- package/dist/mdx/{labs-react/common → react/layout}/examples/As.tsx +1 -1
- package/dist/mdx/{labs-react/common → react/layout}/examples/Border.tsx +1 -1
- package/dist/mdx/{labs-react/common → react/layout}/examples/Color.tsx +1 -1
- package/dist/mdx/{labs-react/common → react/layout}/examples/Depth.tsx +9 -3
- package/dist/mdx/{labs-react → react}/layout/examples/Flex/FlexCard.tsx +2 -3
- package/dist/mdx/{labs-react → react}/layout/examples/Flex/FlexLayout.tsx +1 -1
- package/dist/mdx/{labs-react → react}/layout/examples/Flex/Usage.tsx +2 -3
- package/dist/mdx/{labs-react/common → react/layout}/examples/FlexItem.tsx +1 -2
- package/dist/mdx/{labs-react/common → react/layout}/examples/Layout.tsx +1 -1
- package/dist/mdx/{labs-react/common → react/layout}/examples/Position.tsx +1 -1
- package/dist/mdx/{labs-react → react}/layout/examples/PropTables.splitprops.tsx +1 -1
- package/dist/mdx/{labs-react/common → react/layout}/examples/Ref.tsx +1 -1
- package/dist/mdx/{labs-react/common → react/layout}/examples/Space.tsx +1 -1
- package/dist/mdx/{labs-react → react}/layout/examples/Stack/BasicStack.tsx +1 -1
- package/dist/mdx/{labs-react → react}/layout/examples/Stack/HStackCards.tsx +2 -3
- package/dist/mdx/{labs-react → react}/layout/examples/Stack/NestedStacks.tsx +1 -1
- package/dist/mdx/react/layout/examples/Stack/ShouldWrapChildren.tsx +28 -0
- package/dist/mdx/{labs-react → react}/layout/examples/Stack/StackCard.tsx +2 -2
- package/dist/mdx/{labs-react → react}/layout/examples/Stack/StackItems.tsx +1 -2
- package/dist/mdx/{labs-react → react}/layout/examples/Stack/VStackCards.tsx +2 -2
- package/dist/mdx/react/menu/Menu.mdx +123 -0
- package/dist/mdx/react/menu/examples/Basic.tsx +26 -0
- package/dist/mdx/react/menu/examples/ContextMenu.tsx +25 -0
- package/dist/mdx/react/menu/examples/Icons.tsx +41 -0
- package/dist/mdx/react/modal/Modal.mdx +34 -11
- package/dist/mdx/react/modal/examples/Basic.tsx +4 -2
- package/dist/mdx/react/modal/examples/BodyOverflow.tsx +56 -0
- package/dist/mdx/react/modal/examples/CustomFocus.tsx +4 -2
- package/dist/mdx/react/modal/examples/FullOverflow.tsx +55 -0
- package/dist/mdx/react/modal/examples/ReturnFocus.tsx +5 -3
- package/dist/mdx/react/modal/examples/WithoutCloseIcon.tsx +4 -2
- package/dist/mdx/react/pagination/PropTables.splitprops.tsx +1 -1
- package/dist/mdx/react/pagination/pagination.mdx +14 -14
- package/dist/mdx/react/popup/Popup.mdx +2 -1
- package/dist/mdx/react/popup/examples/Basic.tsx +1 -1
- package/dist/mdx/react/popup/examples/FocusRedirect.tsx +3 -2
- package/dist/mdx/react/popup/examples/FocusTrap.tsx +1 -1
- package/dist/mdx/react/popup/examples/FullScreen.tsx +1 -1
- package/dist/mdx/react/popup/examples/InitialFocus.tsx +4 -2
- package/dist/mdx/react/popup/examples/MultiplePopups.tsx +1 -1
- package/dist/mdx/react/popup/examples/NestedPopups.tsx +18 -18
- package/dist/mdx/react/popup/examples/RTL.tsx +6 -3
- package/dist/mdx/react/radio/Radio.mdx +7 -0
- package/dist/mdx/react/radio/examples/Basic.tsx +11 -2
- package/dist/mdx/react/radio/examples/Inverse.tsx +23 -0
- package/dist/mdx/react/segmented-control/SegmentedControl.mdx +2 -2
- package/dist/mdx/react/segmented-control/examples/Basic.tsx +13 -11
- package/dist/mdx/react/skeleton/examples/Basic.tsx +1 -1
- package/dist/mdx/react/skeleton/examples/Color.tsx +1 -2
- package/dist/mdx/react/skeleton/examples/Simulation.tsx +31 -30
- package/dist/mdx/react/status-indicator/StatusIndicator.mdx +12 -0
- package/dist/mdx/react/status-indicator/examples/MaxWidth.tsx +30 -0
- package/dist/mdx/react/tabs/Tabs.mdx +14 -17
- package/dist/mdx/react/tabs/TabsModel.splitprops.tsx +7 -3
- package/dist/mdx/react/tabs/examples/DynamicTabs.tsx +6 -13
- package/dist/mdx/react/tabs/examples/HoistedModel.tsx +8 -8
- package/dist/mdx/react/tabs/examples/Icons.tsx +4 -4
- package/dist/mdx/react/tabs/examples/NamedTabs.tsx +10 -10
- package/dist/mdx/react/tabs/examples/OverflowTabs.tsx +4 -8
- package/dist/mdx/react/tabs/examples/SinglePanel.tsx +3 -3
- package/dist/mdx/react/text-input/examples/Basic.tsx +3 -0
- package/dist/mdx/react/tooltip/Tooltip.mdx +2 -2
- package/dist/mdx/react/tooltip/examples/Default.tsx +2 -2
- package/dist/mdx/react/tooltip/examples/UseTooltip.tsx +2 -2
- package/package.json +9 -17
- package/dist/mdx/labs-react/common/examples/PropTables.splitprops.tsx +0 -91
- package/dist/mdx/labs-react/layout/examples/Stack/ShouldWrapChildren.tsx +0 -33
- package/dist/mdx/react/button/icon-button/IconButton.mdx +0 -103
- package/dist/mdx/react/button/icon-button/examples/Circle.tsx +0 -6
- package/dist/mdx/react/button/icon-button/examples/CircleFilled.tsx +0 -8
- package/dist/mdx/react/button/icon-button/examples/Inverse.tsx +0 -20
- package/dist/mdx/react/button/icon-button/examples/InverseFilled.tsx +0 -20
- package/dist/mdx/react/button/icon-button/examples/MirroredIcon.tsx +0 -11
- package/dist/mdx/react/button/icon-button/examples/Plain.tsx +0 -8
- package/dist/mdx/react/button/icon-button/examples/Square.tsx +0 -8
- package/dist/mdx/react/button/icon-button/examples/SquareFilled.tsx +0 -8
- package/dist/mdx/react/button/icon-button/examples/Toggleable.tsx +0 -20
- package/ts3.5/dist/commonjs/index.d.ts +0 -4
- package/ts3.5/dist/commonjs/lib/Specifications.d.ts +0 -6
- package/ts3.5/dist/commonjs/lib/docs.d.ts +0 -5
- package/ts3.5/dist/commonjs/lib/specs.d.ts +0 -16
- package/ts3.5/dist/es6/index.d.ts +0 -4
- package/ts3.5/dist/es6/lib/Specifications.d.ts +0 -6
- package/ts3.5/dist/es6/lib/docs.d.ts +0 -5
- package/ts3.5/dist/es6/lib/specs.d.ts +0 -16
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import {Box} from '@workday/canvas-kit-react/layout';
|
|
2
3
|
import {Banner} from '@workday/canvas-kit-react/banner';
|
|
3
|
-
import {
|
|
4
|
+
import {styled} from '@workday/canvas-kit-react/common';
|
|
5
|
+
|
|
6
|
+
const StyledBanner = styled(Banner)({
|
|
7
|
+
position: 'absolute',
|
|
8
|
+
right: 0,
|
|
9
|
+
});
|
|
4
10
|
|
|
5
11
|
export default () => {
|
|
6
12
|
return (
|
|
7
13
|
<Box height={64}>
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/>
|
|
14
|
+
<StyledBanner hasError={true} isSticky={true}>
|
|
15
|
+
<Banner.Icon />
|
|
16
|
+
<Banner.Label>3 Errors</Banner.Label>
|
|
17
|
+
<Banner.ActionText />
|
|
18
|
+
</StyledBanner>
|
|
14
19
|
</Box>
|
|
15
20
|
);
|
|
16
21
|
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/** @jsxRuntime classic */
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import {jsx, keyframes} from '@emotion/react';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
import {CSSProperties} from '@workday/canvas-kit-react/tokens';
|
|
7
|
+
import {Box} from '@workday/canvas-kit-react/layout';
|
|
8
|
+
import {useThemeRTL} from '@workday/canvas-kit-labs-react/common';
|
|
9
|
+
import {loopIcon} from '@workday/canvas-system-icons-web';
|
|
10
|
+
import {Banner} from '@workday/canvas-kit-react/banner';
|
|
11
|
+
|
|
12
|
+
const containerStyles: CSSProperties = {
|
|
13
|
+
position: 'absolute',
|
|
14
|
+
right: 0,
|
|
15
|
+
overflow: 'hidden',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default () => {
|
|
19
|
+
const {themeRTL, theme} = useThemeRTL();
|
|
20
|
+
const bannerRef = React.useRef<HTMLButtonElement>(null);
|
|
21
|
+
const containerRef = React.useRef<HTMLDivElement>(null);
|
|
22
|
+
const [styles, setStyles] = React.useState<CSSProperties>();
|
|
23
|
+
|
|
24
|
+
const [rerun, setRerun] = React.useState(1); // Only needed for demo purposes
|
|
25
|
+
|
|
26
|
+
React.useLayoutEffect(() => {
|
|
27
|
+
let width = bannerRef.current.offsetWidth;
|
|
28
|
+
if (theme.canvas.direction === 'rtl') {
|
|
29
|
+
width *= -1;
|
|
30
|
+
}
|
|
31
|
+
const slideInKeyframes = keyframes({
|
|
32
|
+
'0%': {
|
|
33
|
+
transform: `translateX(${width}px)`,
|
|
34
|
+
},
|
|
35
|
+
'100%': {
|
|
36
|
+
transform: `translateX(0 * ${rerun})`,
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
setStyles({
|
|
41
|
+
margin: '4px 0px 4px 4px', // Room for focus outline since container is overflow hidden
|
|
42
|
+
animation: `${slideInKeyframes} .3s ease-out forwards`,
|
|
43
|
+
});
|
|
44
|
+
}, [theme.canvas.direction, rerun]);
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<Box height={64}>
|
|
48
|
+
<div css={containerStyles} ref={containerRef}>
|
|
49
|
+
<div css={themeRTL(styles)}>
|
|
50
|
+
<Banner
|
|
51
|
+
onClick={() => setRerun(r => r + 1)}
|
|
52
|
+
hasError={true}
|
|
53
|
+
isSticky={true}
|
|
54
|
+
ref={bannerRef}
|
|
55
|
+
>
|
|
56
|
+
<Banner.Icon icon={loopIcon} />
|
|
57
|
+
<Banner.Label>Click to run animation</Banner.Label>
|
|
58
|
+
<Banner.ActionText />
|
|
59
|
+
</Banner>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</Box>
|
|
63
|
+
);
|
|
64
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import {Box} from '@workday/canvas-kit-react/layout';
|
|
4
|
+
import {
|
|
5
|
+
CanvasProvider,
|
|
6
|
+
ContentDirection,
|
|
7
|
+
PartialEmotionCanvasTheme,
|
|
8
|
+
styled,
|
|
9
|
+
} from '@workday/canvas-kit-react/common';
|
|
10
|
+
import {Banner} from '@workday/canvas-kit-react/banner';
|
|
11
|
+
|
|
12
|
+
const theme: PartialEmotionCanvasTheme = {
|
|
13
|
+
canvas: {
|
|
14
|
+
direction: ContentDirection.RTL,
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const StyledStickyBanner = styled(Banner)({
|
|
19
|
+
position: 'absolute',
|
|
20
|
+
right: 0,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export default () => {
|
|
24
|
+
return (
|
|
25
|
+
<CanvasProvider theme={theme}>
|
|
26
|
+
<Box height={64}>
|
|
27
|
+
<StyledStickyBanner isSticky={true}>
|
|
28
|
+
<Banner.Icon />
|
|
29
|
+
<Banner.Label>3 אזהרות</Banner.Label>
|
|
30
|
+
<Banner.ActionText />
|
|
31
|
+
</StyledStickyBanner>
|
|
32
|
+
</Box>
|
|
33
|
+
</CanvasProvider>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import {Banner} from '@workday/canvas-kit-react/banner';
|
|
4
|
+
import {CanvasProvider, PartialEmotionCanvasTheme} from '@workday/canvas-kit-react/common';
|
|
5
|
+
import {colors} from '@workday/canvas-kit-react/tokens';
|
|
6
|
+
|
|
7
|
+
export default () => {
|
|
8
|
+
const theme: PartialEmotionCanvasTheme = {
|
|
9
|
+
canvas: {
|
|
10
|
+
palette: {
|
|
11
|
+
alert: {
|
|
12
|
+
main: colors.kiwi200,
|
|
13
|
+
dark: colors.kiwi300,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<CanvasProvider theme={theme}>
|
|
21
|
+
<Banner>
|
|
22
|
+
<Banner.Icon />
|
|
23
|
+
<Banner.Label>3 Items</Banner.Label>
|
|
24
|
+
<Banner.ActionText />
|
|
25
|
+
</Banner>
|
|
26
|
+
</CanvasProvider>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import {Banner} from '@workday/canvas-kit-react/banner';
|
|
4
|
+
import {CanvasProvider, PartialEmotionCanvasTheme} from '@workday/canvas-kit-react/common';
|
|
5
|
+
import {colors} from '@workday/canvas-kit-react/tokens';
|
|
6
|
+
|
|
7
|
+
export default () => {
|
|
8
|
+
const theme: PartialEmotionCanvasTheme = {
|
|
9
|
+
canvas: {
|
|
10
|
+
palette: {
|
|
11
|
+
error: {
|
|
12
|
+
main: colors.islandPunch500,
|
|
13
|
+
dark: colors.islandPunch600,
|
|
14
|
+
contrast: colors.berrySmoothie100,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<CanvasProvider theme={theme}>
|
|
22
|
+
<Banner hasError={true}>
|
|
23
|
+
<Banner.Icon />
|
|
24
|
+
<Banner.Label>3 Items</Banner.Label>
|
|
25
|
+
<Banner.ActionText />
|
|
26
|
+
</Banner>
|
|
27
|
+
</CanvasProvider>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
@@ -39,7 +39,7 @@ action. Multiple primary buttons make it confusing for the user to understand wh
|
|
|
39
39
|
should take. Not all screens require a Primary Button.
|
|
40
40
|
|
|
41
41
|
Primary Buttons have four sizes: `extraSmall`, `small`, `medium`, and `large`. Icons are supported
|
|
42
|
-
for every size and can be positioned
|
|
42
|
+
for every size and can be positioned at the `start` or `end` with the `iconPosition` prop.
|
|
43
43
|
|
|
44
44
|
<ExampleCodeBlock code={Primary} />
|
|
45
45
|
|
|
@@ -62,7 +62,7 @@ Buttons can be used on most pages without restrictions and work well for multipl
|
|
|
62
62
|
weight. They can be used in conjunction with a Primary Button or independently.
|
|
63
63
|
|
|
64
64
|
Secondary Buttons have four sizes: `extraSmall`, `small`, `medium`, and `large`. Icons are supported
|
|
65
|
-
for every size and can be positioned
|
|
65
|
+
for every size and can be positioned at the `start` or `end` with the `iconPosition` prop.
|
|
66
66
|
|
|
67
67
|
<ExampleCodeBlock code={Secondary} />
|
|
68
68
|
|
|
@@ -85,7 +85,7 @@ not visible until it is interacted with. Use Tertiary Buttons for supplemental a
|
|
|
85
85
|
More”, “Read More” or “Select a File”. Tertiary Buttons are frequently used on Cards.
|
|
86
86
|
|
|
87
87
|
Tertiary Buttons have three sizes: `extraSmall`, `small`, and `medium`. Icons are supported for
|
|
88
|
-
every size and can be positioned
|
|
88
|
+
every size and can be positioned at the `start` or `end` with the `iconPosition` prop.
|
|
89
89
|
|
|
90
90
|
<ExampleCodeBlock code={Tertiary} />
|
|
91
91
|
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import {Hyperlink, ExternalHyperlink} from '@workday/canvas-kit-react/button';
|
|
2
|
+
import {Specifications} from '@workday/canvas-kit-docs';
|
|
3
|
+
|
|
4
|
+
import Link from './examples/Hyperlink';
|
|
5
|
+
import LinkInverse from './examples/HyperlinkInverse';
|
|
6
|
+
import ExternalLink from './examples/ExternalHyperlink';
|
|
7
|
+
import ExternalLinkInverse from './examples/ExternalHyperlinkInverse';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# Canvas Kit Hyperlinks
|
|
11
|
+
|
|
12
|
+
Clickable anchor elements that extend the native `<a>` element with Canvas styling.
|
|
13
|
+
|
|
14
|
+
[> Workday Design Reference](https://design.workday.com/components/buttons/buttons)
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
yarn add @workday/canvas-kit-react
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
### Hyperlink
|
|
25
|
+
|
|
26
|
+
`Hyperlink`s should be used when you want to navigate away from the current page or to an anchor on
|
|
27
|
+
the current page.
|
|
28
|
+
|
|
29
|
+
<ExampleCodeBlock code={Link} />
|
|
30
|
+
|
|
31
|
+
#### Inverse
|
|
32
|
+
|
|
33
|
+
`Hyperlink`s also have an `inverse` variant. Use this variant when you need to place a `Hyperlink` on a
|
|
34
|
+
dark or colorful background such as `blueberry400`.
|
|
35
|
+
|
|
36
|
+
<ExampleCodeBlock code={LinkInverse} />
|
|
37
|
+
|
|
38
|
+
#### Props
|
|
39
|
+
|
|
40
|
+
Undocumented props are spread to the underlying `<a>` element.
|
|
41
|
+
|
|
42
|
+
<ArgsTable of={Hyperlink} />
|
|
43
|
+
|
|
44
|
+
### ExternalHyperlink
|
|
45
|
+
|
|
46
|
+
If your link should open in a new tab or window use the `ExternalHyperlink` component. It will let
|
|
47
|
+
users know about the behavior by adding an icon, `extLinkIcon`. By default, the icon has a label of
|
|
48
|
+
"Opens link in new window". You can override `aria-label` of the icon by using the `iconLabel`
|
|
49
|
+
prop. This override will be needed for translations.
|
|
50
|
+
|
|
51
|
+
<ExampleCodeBlock code={ExternalLink} />
|
|
52
|
+
|
|
53
|
+
`ExternalHyperlink`s also have an `inverse` variant. Use this variant when you need to place the link on a dark or colorful background such as `blueberry400`.
|
|
54
|
+
|
|
55
|
+
<ExampleCodeBlock code={ExternalLinkInverse} />
|
|
56
|
+
|
|
57
|
+
#### Props
|
|
58
|
+
|
|
59
|
+
Undocumented props are spread to the underlying `<a>` element.
|
|
60
|
+
|
|
61
|
+
<ArgsTable of={ExternalHyperlink} />
|
|
62
|
+
|
|
63
|
+
### Accessible Use of the `as` Prop
|
|
64
|
+
|
|
65
|
+
Like many of our components, `Hyperlink` and `ExternalHyperlink` accept an `as` prop, which lets you change the underlying
|
|
66
|
+
semantic element - usually an `<a>`, or a `<button>`. This should be done with caution to ensure the
|
|
67
|
+
best accessibility. Generally, `<button>` elements should be used for actions, and `<a>` elements
|
|
68
|
+
should be used for navigation.
|
|
69
|
+
|
|
70
|
+
## Specifications
|
|
71
|
+
|
|
72
|
+
<Specifications file="Hyperlink.spec.ts" name="Hyperlink" />
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import {ExternalHyperlink} from '@workday/canvas-kit-react/button';
|
|
4
|
+
import {Box} from '@workday/canvas-kit-react/layout';
|
|
5
|
+
|
|
6
|
+
export default () => (
|
|
7
|
+
<Box backgroundColor="blueberry400" padding="s">
|
|
8
|
+
<ExternalHyperlink href="https://workday.com" variant="inverse">
|
|
9
|
+
Hyperlink
|
|
10
|
+
</ExternalHyperlink>
|
|
11
|
+
</Box>
|
|
12
|
+
);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import {Hyperlink} from '@workday/canvas-kit-react/button';
|
|
4
|
+
import {Box} from '@workday/canvas-kit-react/layout';
|
|
5
|
+
|
|
6
|
+
export default () => (
|
|
7
|
+
<Box backgroundColor="blueberry400" padding="s">
|
|
8
|
+
<Hyperlink href="#hyperlink" variant="inverse">
|
|
9
|
+
Hyperlink
|
|
10
|
+
</Hyperlink>
|
|
11
|
+
</Box>
|
|
12
|
+
);
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import {PrimaryButton} from '@workday/canvas-kit-react/button';
|
|
4
|
-
import {HStack} from '@workday/canvas-kit-
|
|
5
|
-
import {
|
|
4
|
+
import {HStack} from '@workday/canvas-kit-react/layout';
|
|
5
|
+
import {
|
|
6
|
+
plusIcon,
|
|
7
|
+
relatedActionsVerticalIcon,
|
|
8
|
+
caretDownIcon,
|
|
9
|
+
} from '@workday/canvas-system-icons-web';
|
|
6
10
|
|
|
7
11
|
export default () => (
|
|
8
12
|
<HStack spacing="s" padding="s">
|
|
9
13
|
<PrimaryButton>Primary</PrimaryButton>
|
|
10
|
-
<PrimaryButton icon={plusIcon} iconPosition="
|
|
14
|
+
<PrimaryButton icon={plusIcon} iconPosition="start">
|
|
11
15
|
Primary
|
|
12
16
|
</PrimaryButton>
|
|
17
|
+
<PrimaryButton icon={caretDownIcon} iconPosition="end">
|
|
18
|
+
Primary
|
|
19
|
+
</PrimaryButton>
|
|
20
|
+
<PrimaryButton icon={relatedActionsVerticalIcon} />
|
|
13
21
|
</HStack>
|
|
14
22
|
);
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import {PrimaryButton} from '@workday/canvas-kit-react/button';
|
|
4
|
-
import {HStack} from '@workday/canvas-kit-
|
|
5
|
-
import {
|
|
4
|
+
import {HStack} from '@workday/canvas-kit-react/layout';
|
|
5
|
+
import {
|
|
6
|
+
plusIcon,
|
|
7
|
+
relatedActionsVerticalIcon,
|
|
8
|
+
caretDownIcon,
|
|
9
|
+
} from '@workday/canvas-system-icons-web';
|
|
6
10
|
|
|
7
11
|
export default () => (
|
|
8
12
|
<HStack spacing="s" backgroundColor="blueberry400" padding="s">
|
|
9
13
|
<PrimaryButton variant="inverse">Primary</PrimaryButton>
|
|
10
|
-
<PrimaryButton icon={plusIcon} iconPosition="
|
|
14
|
+
<PrimaryButton icon={plusIcon} iconPosition="start" variant="inverse">
|
|
11
15
|
Primary
|
|
12
16
|
</PrimaryButton>
|
|
17
|
+
<PrimaryButton icon={caretDownIcon} iconPosition="end" variant="inverse">
|
|
18
|
+
Primary
|
|
19
|
+
</PrimaryButton>
|
|
20
|
+
<PrimaryButton icon={relatedActionsVerticalIcon} variant="inverse" />
|
|
13
21
|
</HStack>
|
|
14
22
|
);
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import {SecondaryButton} from '@workday/canvas-kit-react/button';
|
|
4
|
-
import {HStack} from '@workday/canvas-kit-
|
|
5
|
-
import {
|
|
4
|
+
import {HStack} from '@workday/canvas-kit-react/layout';
|
|
5
|
+
import {
|
|
6
|
+
plusIcon,
|
|
7
|
+
relatedActionsVerticalIcon,
|
|
8
|
+
caretDownIcon,
|
|
9
|
+
} from '@workday/canvas-system-icons-web';
|
|
6
10
|
|
|
7
11
|
export default () => (
|
|
8
12
|
<HStack spacing="s" padding="s">
|
|
9
13
|
<SecondaryButton>Secondary</SecondaryButton>
|
|
10
|
-
<SecondaryButton icon={plusIcon} iconPosition="
|
|
14
|
+
<SecondaryButton icon={plusIcon} iconPosition="start">
|
|
11
15
|
Secondary
|
|
12
16
|
</SecondaryButton>
|
|
17
|
+
<SecondaryButton icon={caretDownIcon} iconPosition="end">
|
|
18
|
+
Secondary
|
|
19
|
+
</SecondaryButton>
|
|
20
|
+
<SecondaryButton icon={relatedActionsVerticalIcon} />
|
|
13
21
|
</HStack>
|
|
14
22
|
);
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import {SecondaryButton} from '@workday/canvas-kit-react/button';
|
|
4
|
-
import {HStack} from '@workday/canvas-kit-
|
|
5
|
-
import {
|
|
4
|
+
import {HStack} from '@workday/canvas-kit-react/layout';
|
|
5
|
+
import {
|
|
6
|
+
plusIcon,
|
|
7
|
+
relatedActionsVerticalIcon,
|
|
8
|
+
caretDownIcon,
|
|
9
|
+
} from '@workday/canvas-system-icons-web';
|
|
6
10
|
|
|
7
11
|
export default () => (
|
|
8
12
|
<HStack spacing="s" backgroundColor="blueberry400" padding="s">
|
|
9
13
|
<SecondaryButton variant="inverse">Secondary</SecondaryButton>
|
|
10
|
-
<SecondaryButton icon={plusIcon}
|
|
14
|
+
<SecondaryButton icon={plusIcon} variant="inverse">
|
|
11
15
|
Secondary
|
|
12
16
|
</SecondaryButton>
|
|
17
|
+
<SecondaryButton icon={caretDownIcon} variant="inverse" iconPosition="end">
|
|
18
|
+
Secondary
|
|
19
|
+
</SecondaryButton>
|
|
20
|
+
<SecondaryButton icon={relatedActionsVerticalIcon} variant="inverse" />
|
|
13
21
|
</HStack>
|
|
14
22
|
);
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import {TertiaryButton} from '@workday/canvas-kit-react/button';
|
|
4
|
-
import {HStack} from '@workday/canvas-kit-
|
|
5
|
-
import {
|
|
4
|
+
import {HStack} from '@workday/canvas-kit-react/layout';
|
|
5
|
+
import {
|
|
6
|
+
plusIcon,
|
|
7
|
+
relatedActionsVerticalIcon,
|
|
8
|
+
caretDownIcon,
|
|
9
|
+
} from '@workday/canvas-system-icons-web';
|
|
6
10
|
|
|
7
11
|
export default () => (
|
|
8
12
|
<HStack spacing="s" padding="s">
|
|
9
13
|
<TertiaryButton>Tertiary</TertiaryButton>
|
|
10
|
-
<TertiaryButton icon={plusIcon} iconPosition="
|
|
14
|
+
<TertiaryButton icon={plusIcon} iconPosition="start">
|
|
11
15
|
Tertiary
|
|
12
16
|
</TertiaryButton>
|
|
13
|
-
<TertiaryButton icon={
|
|
17
|
+
<TertiaryButton icon={caretDownIcon} iconPosition="end">
|
|
14
18
|
Tertiary
|
|
15
19
|
</TertiaryButton>
|
|
20
|
+
<TertiaryButton icon={relatedActionsVerticalIcon} />
|
|
16
21
|
</HStack>
|
|
17
22
|
);
|
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import {TertiaryButton} from '@workday/canvas-kit-react/button';
|
|
4
|
-
import {HStack} from '@workday/canvas-kit-
|
|
5
|
-
import {
|
|
4
|
+
import {HStack} from '@workday/canvas-kit-react/layout';
|
|
5
|
+
import {
|
|
6
|
+
plusIcon,
|
|
7
|
+
relatedActionsVerticalIcon,
|
|
8
|
+
arrowRightIcon,
|
|
9
|
+
caretDownIcon,
|
|
10
|
+
} from '@workday/canvas-system-icons-web';
|
|
6
11
|
|
|
7
12
|
export default () => (
|
|
8
13
|
<HStack spacing="s" backgroundColor="blueberry400" padding="s">
|
|
9
14
|
<TertiaryButton variant="inverse">Tertiary</TertiaryButton>
|
|
10
|
-
<TertiaryButton icon={plusIcon} iconPosition="
|
|
15
|
+
<TertiaryButton icon={plusIcon} iconPosition="start" variant="inverse">
|
|
11
16
|
Tertiary
|
|
12
17
|
</TertiaryButton>
|
|
18
|
+
<TertiaryButton icon={caretDownIcon} iconPosition="end" variant="inverse">
|
|
19
|
+
Tertiary
|
|
20
|
+
</TertiaryButton>
|
|
21
|
+
<TertiaryButton icon={relatedActionsVerticalIcon} variant="inverse" />
|
|
13
22
|
</HStack>
|
|
14
23
|
);
|
|
@@ -34,9 +34,9 @@ Card includes a container `Card` component and the following subcomponents: `Car
|
|
|
34
34
|
`Card` extends from `Box` so it supports all of
|
|
35
35
|
[Box's style props](/components/layout/box/#style-props). This includes `depth`, which changes the
|
|
36
36
|
Card's perceived "height" above the page surface by adjusting its box shadow. `Card` has a default
|
|
37
|
-
depth of `
|
|
37
|
+
depth of `1`.
|
|
38
38
|
|
|
39
|
-
Here's an example of a `Card` with a
|
|
39
|
+
Here's an example of a `Card` with a increased `depth` of `2`.
|
|
40
40
|
|
|
41
41
|
<ExampleCodeBlock code={Depth} />
|
|
42
42
|
|
|
@@ -3,7 +3,7 @@ import {Card} from '@workday/canvas-kit-react/card';
|
|
|
3
3
|
|
|
4
4
|
export default () => {
|
|
5
5
|
return (
|
|
6
|
-
<Card depth={
|
|
6
|
+
<Card depth={2}>
|
|
7
7
|
<Card.Heading>Canvas Supreme</Card.Heading>
|
|
8
8
|
<Card.Body>
|
|
9
9
|
Our house special supreme pizza includes pepperoni, sausage, bell peppers, mushrooms,
|
|
@@ -4,6 +4,7 @@ import Checkbox from '@workday/canvas-kit-react/checkbox/lib/Checkbox.tsx';
|
|
|
4
4
|
|
|
5
5
|
import Alert from './examples/Alert';
|
|
6
6
|
import Basic from './examples/Basic';
|
|
7
|
+
import Inverse from './examples/Inverse';
|
|
7
8
|
import Disabled from './examples/Disabled';
|
|
8
9
|
import Error from './examples/Error';
|
|
9
10
|
import Indeterminate from './examples/Indeterminate';
|
|
@@ -35,6 +36,12 @@ element.
|
|
|
35
36
|
|
|
36
37
|
<ExampleCodeBlock code={Basic} />
|
|
37
38
|
|
|
39
|
+
### Inverse
|
|
40
|
+
|
|
41
|
+
Checkbox with inverse variation
|
|
42
|
+
|
|
43
|
+
<ExampleCodeBlock code={Inverse} />
|
|
44
|
+
|
|
38
45
|
### Disabled
|
|
39
46
|
|
|
40
47
|
Set the `disabled` prop of the Checkbox to prevent users from interacting with it.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {Checkbox} from '@workday/canvas-kit-react/checkbox';
|
|
3
|
-
import {Box} from '@workday/canvas-kit-
|
|
3
|
+
import {Box} from '@workday/canvas-kit-react/layout';
|
|
4
4
|
|
|
5
5
|
export default () => {
|
|
6
6
|
const [pizzaChecked, setPizzaChecked] = React.useState(false);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Checkbox} from '@workday/canvas-kit-react/checkbox';
|
|
3
|
+
import {HStack} from '@workday/canvas-kit-react/layout';
|
|
4
|
+
|
|
5
|
+
export default () => {
|
|
6
|
+
const [checked, setChecked] = React.useState(false);
|
|
7
|
+
|
|
8
|
+
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
9
|
+
setChecked(event.target.checked);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<HStack spacing="s" backgroundColor="blueberry400" padding="s">
|
|
14
|
+
<Checkbox
|
|
15
|
+
variant="inverse"
|
|
16
|
+
checked={checked}
|
|
17
|
+
label="I agree to the terms"
|
|
18
|
+
onChange={handleChange}
|
|
19
|
+
/>
|
|
20
|
+
</HStack>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {PrimaryButton} from '@workday/canvas-kit-react/button';
|
|
3
3
|
import {Checkbox} from '@workday/canvas-kit-react/checkbox';
|
|
4
|
-
import {Box} from '@workday/canvas-kit-
|
|
4
|
+
import {Box} from '@workday/canvas-kit-react/layout';
|
|
5
5
|
|
|
6
6
|
export default () => {
|
|
7
7
|
const [checked, setChecked] = React.useState(false);
|