@workday/canvas-kit-docs 13.0.0-alpha.1011-next.0 → 13.0.0-alpha.1016-next.0
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/docs.js +1078 -297
- package/dist/es6/mdx/welcomePage.d.ts.map +1 -1
- package/dist/es6/mdx/welcomePage.js +72 -48
- package/dist/mdx/13.0-UPGRADE-GUIDE.mdx +2 -1
- package/dist/mdx/react/_examples/Tooltips.mdx +15 -0
- package/dist/mdx/react/_examples/examples/Tooltips/ListOfUploadedFiles.tsx +38 -0
- package/dist/mdx/react/menu/examples/Icons.tsx +1 -1
- package/dist/mdx/react/tooltip/Tooltip.mdx +31 -1
- package/dist/mdx/react/tooltip/examples/DescriptionType.tsx +22 -0
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"welcomePage.d.ts","sourceRoot":"","sources":["../../../mdx/welcomePage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"welcomePage.d.ts","sourceRoot":"","sources":["../../../mdx/welcomePage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAsD1B,eAAO,MAAM,WAAW,yBAkHvB,CAAC"}
|
|
@@ -1,61 +1,85 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
// @ts-ignore: Cannot find module error
|
|
3
|
-
import headerImage from './
|
|
3
|
+
import headerImage from './CK-banner-temp.jpg';
|
|
4
4
|
import { Flex, Grid, Box } from '@workday/canvas-kit-react/layout';
|
|
5
5
|
import { InstallBlock } from './installBlock';
|
|
6
6
|
import { Text, Heading } from '@workday/canvas-kit-react/text';
|
|
7
7
|
import { Card } from '@workday/canvas-kit-react/card';
|
|
8
8
|
import { ExternalHyperlink, Hyperlink } from '@workday/canvas-kit-react/button';
|
|
9
|
-
import { colors } from '@workday/canvas-kit-react/tokens';
|
|
10
9
|
import { rocketIcon, tokensIcon, shapesIcon } from '@workday/canvas-system-icons-web';
|
|
11
10
|
import { SystemIcon } from '@workday/canvas-kit-react/icon';
|
|
12
|
-
import { system } from '@workday/canvas-tokens-web';
|
|
13
|
-
import {
|
|
11
|
+
import { system, base } from '@workday/canvas-tokens-web';
|
|
12
|
+
import { createStyles } from '@workday/canvas-kit-styling';
|
|
14
13
|
// @ts-ignore: Cannot find module error
|
|
15
14
|
import { version } from '../../../lerna.json';
|
|
15
|
+
const parentFlexStyles = createStyles({
|
|
16
|
+
display: 'flex',
|
|
17
|
+
flexDirection: 'column',
|
|
18
|
+
gap: system.space.x4,
|
|
19
|
+
marginBottom: system.space.x6,
|
|
20
|
+
});
|
|
21
|
+
const textStyles = createStyles({
|
|
22
|
+
color: system.color.text.inverse,
|
|
23
|
+
fontSize: '5vmin',
|
|
24
|
+
lineHeight: '5vmin',
|
|
25
|
+
});
|
|
26
|
+
const versionStyles = createStyles({
|
|
27
|
+
fontWeight: base.fontFamily100,
|
|
28
|
+
marginInlineStart: system.space.x4,
|
|
29
|
+
});
|
|
30
|
+
const imageStyles = createStyles({
|
|
31
|
+
width: '100%',
|
|
32
|
+
height: 'auto',
|
|
33
|
+
});
|
|
34
|
+
const borderStyles = createStyles({
|
|
35
|
+
borderBottom: `1px solid ${base.blueberry200}`,
|
|
36
|
+
marginBottom: system.space.x2,
|
|
37
|
+
});
|
|
38
|
+
const gridStyles = createStyles({
|
|
39
|
+
maxHeight: 320,
|
|
40
|
+
gridTemplateRows: '1fr 1fr 2fr 1fr',
|
|
41
|
+
display: 'grid',
|
|
42
|
+
});
|
|
43
|
+
const linkStyles = createStyles({
|
|
44
|
+
alignSelf: 'end',
|
|
45
|
+
marginTop: system.space.x3,
|
|
46
|
+
});
|
|
16
47
|
export const WelcomePage = () => {
|
|
17
|
-
return (React.createElement(
|
|
18
|
-
React.createElement(
|
|
19
|
-
React.createElement(
|
|
20
|
-
React.createElement(
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
React.createElement(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
React.createElement(
|
|
37
|
-
React.createElement(Grid
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
React.createElement(Card
|
|
44
|
-
React.createElement(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
' ',
|
|
55
|
-
"View Assets"))),
|
|
56
|
-
React.createElement(Heading, { size: "medium", borderBottom: `1px solid ${colors.blueberry200}`, paddingBottom: "xxs" }, "Installation"),
|
|
57
|
-
React.createElement(Text, null, "To get started using Canvas kit React first add or install the module to your existing React project"),
|
|
58
|
-
React.createElement(InstallBlock, { command: "yarn add", packageName: "@workday/canvas-kit-react" }),
|
|
59
|
-
"or",
|
|
60
|
-
React.createElement(InstallBlock, { command: "npm install", packageName: "@workday/canvas-kit-react" })));
|
|
48
|
+
return (React.createElement("div", { className: "sb-unstyled" },
|
|
49
|
+
React.createElement("div", { className: parentFlexStyles },
|
|
50
|
+
React.createElement(Box, { cs: { overflow: 'hidden', position: 'relative' } },
|
|
51
|
+
React.createElement(Flex, { cs: { flexDirection: 'row', position: 'absolute', top: '45%', left: '10%' } },
|
|
52
|
+
React.createElement(Text, { typeLevel: "title.medium", cs: textStyles }, "Canvas Kit"),
|
|
53
|
+
React.createElement(Text, { typeLevel: "title.medium", cs: [textStyles, versionStyles] },
|
|
54
|
+
"v",
|
|
55
|
+
version)),
|
|
56
|
+
React.createElement("img", { src: headerImage, alt: "banner with canvas kit logo and version", className: imageStyles })),
|
|
57
|
+
React.createElement(Text, { typeLevel: "body.medium" },
|
|
58
|
+
"This project provides a set of components for the Workday Canvas Design System that can be used to implement user experiences consistent with",
|
|
59
|
+
React.createElement(ExternalHyperlink, { href: "https://canvas.workdaydesign.com/", iconLabel: "Open docs in new window" }, "Workday Design Principles.")),
|
|
60
|
+
React.createElement(Heading, { size: "medium", className: borderStyles }, "Quick Links"),
|
|
61
|
+
React.createElement(Grid, { gridAutoColumns: "auto", gridTemplateColumns: "repeat(auto-fill, minmax(250px, 1fr))", gridGap: "s" },
|
|
62
|
+
React.createElement(Grid, { as: Card, className: gridStyles },
|
|
63
|
+
React.createElement(SystemIcon, { color: base.cantaloupe400, colorHover: base.cantaloupe400, icon: rocketIcon, size: 60 }),
|
|
64
|
+
React.createElement(Card.Heading, null, "Getting Started"),
|
|
65
|
+
React.createElement(Card.Body, null,
|
|
66
|
+
React.createElement(Text, null, "For all things getting started including helpful guides and docs.")),
|
|
67
|
+
React.createElement(Grid.Item, { as: Hyperlink, className: linkStyles, href: "https://workday.github.io/canvas-kit/?path=/docs/guides-getting-started--docs" }, "Getting Started Guide")),
|
|
68
|
+
React.createElement(Grid, { as: Card, className: gridStyles },
|
|
69
|
+
React.createElement(SystemIcon, { color: base.blueberry400, icon: tokensIcon, colorHover: base.blueberry400, size: 60 }),
|
|
70
|
+
React.createElement(Card.Heading, null, "Tokens"),
|
|
71
|
+
React.createElement(Card.Body, null,
|
|
72
|
+
React.createElement(Text, null, "Tokens are the smallest pieces of our Design System with the primary function of storing UI information.")),
|
|
73
|
+
React.createElement(Grid.Item, { as: Hyperlink, className: linkStyles, href: "https://workday.github.io/canvas-kit/?path=/docs/tokens--overview" }, "View Our Tokens")),
|
|
74
|
+
React.createElement(Grid, { as: Card, className: gridStyles },
|
|
75
|
+
React.createElement(SystemIcon, { color: base.greenApple400, icon: shapesIcon, size: 60, colorHover: base.greenApple400 }),
|
|
76
|
+
React.createElement(Card.Heading, null, "Assets"),
|
|
77
|
+
React.createElement(Card.Body, null,
|
|
78
|
+
React.createElement(Text, null, "Assets are graphics which help communicate meaning or highlight areas of interaction to our users.")),
|
|
79
|
+
React.createElement(Grid.Item, { as: Hyperlink, className: linkStyles, href: "https://workday.github.io/canvas-kit/?path=/docs/assets-icons--overview" }, "View Assets"))),
|
|
80
|
+
React.createElement(Heading, { size: "medium", className: borderStyles }, "Installation"),
|
|
81
|
+
React.createElement(Text, null, "To get started using Canvas Kit React first add or install the module to your existing React project"),
|
|
82
|
+
React.createElement(InstallBlock, { command: "yarn add", packageName: "@workday/canvas-kit-react" }),
|
|
83
|
+
"or",
|
|
84
|
+
React.createElement(InstallBlock, { command: "npm install", packageName: "@workday/canvas-kit-react" }))));
|
|
61
85
|
};
|
|
@@ -90,7 +90,7 @@ yarn remove @workday/canvas-kit-codemod
|
|
|
90
90
|
|
|
91
91
|
### Styling API and CSS Tokens
|
|
92
92
|
|
|
93
|
-
**PRs:** [#3101](https://github.com/Workday/canvas-kit/pull/3101), [#3088](https://github.com/Workday/canvas-kit/pull/3088)
|
|
93
|
+
**PRs:** [#3101](https://github.com/Workday/canvas-kit/pull/3101), [#3088](https://github.com/Workday/canvas-kit/pull/3088), [#3114](https://github.com/Workday/canvas-kit/pull/3114)
|
|
94
94
|
|
|
95
95
|
Several components have been refactored to use our
|
|
96
96
|
[Canvas Tokens](https://workday.github.io/canvas-tokens/?path=/docs/docs-getting-started--docs) and
|
|
@@ -104,6 +104,7 @@ The React interface **has not changed**, but CSS variables are now used for dyna
|
|
|
104
104
|
The following components are affected:
|
|
105
105
|
|
|
106
106
|
- `ExternalHyperlink`
|
|
107
|
+
- `Menu`
|
|
107
108
|
- `Skeleton`
|
|
108
109
|
|
|
109
110
|
## External Hyperlink
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {Tooltip} from '@workday/canvas-kit-react/tooltip';
|
|
2
|
+
import ListOfUploadedFiles from './examples/Tooltips/ListOfUploadedFiles';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
# Accessible Tooltip Examples
|
|
6
|
+
|
|
7
|
+
## Using descriptive tooltips for repeated text buttons
|
|
8
|
+
|
|
9
|
+
In this example, the "Delete" buttons are used repeatedly to reference the multiple files that have
|
|
10
|
+
been uploaded to the web app. The text buttons already have an accessible name (a.k.a. label)
|
|
11
|
+
derived from the button's inner text. The `describe` tooltip can be useful for providing more
|
|
12
|
+
in-context description for both low vision sighted users and screen reader users without overriding
|
|
13
|
+
the button name "Delete".
|
|
14
|
+
|
|
15
|
+
<ExampleCodeBlock code={ListOfUploadedFiles} />
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import {DeleteButton} from '@workday/canvas-kit-react/button';
|
|
4
|
+
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
5
|
+
import {Heading, Text} from '@workday/canvas-kit-react/text';
|
|
6
|
+
import {Tooltip} from '@workday/canvas-kit-react/tooltip';
|
|
7
|
+
import {trashIcon} from '@workday/canvas-system-icons-web';
|
|
8
|
+
|
|
9
|
+
const files = ['Cover Letter.docx', 'Resume.docx', 'Portfolio.pptx', 'Portrait.png'];
|
|
10
|
+
|
|
11
|
+
const listStyles = {
|
|
12
|
+
alignItems: 'center',
|
|
13
|
+
width: '35rem',
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const deleteBtnStyle = {
|
|
17
|
+
marginLeft: 'auto',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default () => {
|
|
21
|
+
return (
|
|
22
|
+
<>
|
|
23
|
+
<Heading size="medium">Uploaded Files:</Heading>
|
|
24
|
+
<Flex as="ul" gap="1rem" flexDirection="column">
|
|
25
|
+
{files.map(i => (
|
|
26
|
+
<Flex as="li" style={listStyles}>
|
|
27
|
+
<Text>{i}</Text>
|
|
28
|
+
<Tooltip type="description" title={i}>
|
|
29
|
+
<DeleteButton icon={trashIcon} style={deleteBtnStyle}>
|
|
30
|
+
Delete
|
|
31
|
+
</DeleteButton>
|
|
32
|
+
</Tooltip>
|
|
33
|
+
</Flex>
|
|
34
|
+
))}
|
|
35
|
+
</Flex>
|
|
36
|
+
</>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
@@ -31,7 +31,7 @@ export default () => {
|
|
|
31
31
|
</Menu.Item>
|
|
32
32
|
<Menu.Item data-text="User">
|
|
33
33
|
<Menu.Item.Icon icon={userIcon} />
|
|
34
|
-
<Menu.Item.Text
|
|
34
|
+
<Menu.Item.Text>User</Menu.Item.Text>
|
|
35
35
|
</Menu.Item>
|
|
36
36
|
<Menu.Divider />
|
|
37
37
|
<Menu.Item data-text="Fifth Item (with divider)">
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {ExampleCodeBlock, SymbolDoc, Specifications} from '@workday/canvas-kit-docs';
|
|
1
|
+
import {ExampleCodeBlock, SymbolDoc, Specifications} from '@workday/canvas-kit-docs';
|
|
2
|
+
import {InformationHighlight} from '@workday/canvas-kit-preview-react/information-highlight'
|
|
3
|
+
import {StatusIndicator} from '@workday/canvas-kit-preview-react/status-indicator'import Default from './examples/Default';
|
|
2
4
|
import CustomContent from './examples/CustomContent';
|
|
3
5
|
import DelayedTooltip from './examples/DelayedTooltip';
|
|
6
|
+
import DescriptionType from './examples/DescriptionType';
|
|
4
7
|
import DescribeType from './examples/DescribeType';
|
|
5
8
|
import Muted from './examples/Muted';
|
|
6
9
|
import Placements from './examples/Placements';
|
|
@@ -62,6 +65,14 @@ and focus events.
|
|
|
62
65
|
|
|
63
66
|
### Describing an Element
|
|
64
67
|
|
|
68
|
+
<InformationHighlight variant={'caution'} className='sb-unstyled'>
|
|
69
|
+
<InformationHighlight.Icon />
|
|
70
|
+
<InformationHighlight.Heading> Caution: Describe type has been deprecated </InformationHighlight.Heading>
|
|
71
|
+
<InformationHighlight.Body>
|
|
72
|
+
Assistive technology may ignore <StatusIndicator variant='gray'><StatusIndicator.Label cs={{textTransform: 'lowercase'}}>type="describe"</StatusIndicator.Label></StatusIndicator> techniques based on verbosity settings. Please use <StatusIndicator cs={{textTransform: 'lowercase'}} variant='gray'><StatusIndicator.Label cs={{textTransform: 'lowercase'}}>type="description"</StatusIndicator.Label></StatusIndicator> on Tooltips.
|
|
73
|
+
</InformationHighlight.Body>
|
|
74
|
+
</InformationHighlight>
|
|
75
|
+
|
|
65
76
|
The default mode for a tooltip is to label content via `aria-label`. If a tooltip is meant to
|
|
66
77
|
provide ancillary information, the `type` can be set to `describe`. This will add `aria-describedby`
|
|
67
78
|
to the target element. This will allow screen reader users to hear the name of the control that is
|
|
@@ -69,6 +80,25 @@ being focused and the ancillary tooltip information.
|
|
|
69
80
|
|
|
70
81
|
<ExampleCodeBlock code={DescribeType} />
|
|
71
82
|
|
|
83
|
+
### Description of an Element
|
|
84
|
+
|
|
85
|
+
The default mode for a tooltip is to assign a name to the target element with an `aria-label`
|
|
86
|
+
string. If a tooltip is meant to provide ancillary information, the `type` can be set to `description`.
|
|
87
|
+
This will add `aria-description` strings to the target element instead. This variant is useful on
|
|
88
|
+
text buttons and other components that already have a label or name. Use this type instead of `describe` to ensure proper aria attributes are added to the dom regardless if the tooltip is visible.
|
|
89
|
+
|
|
90
|
+
> **Note:** If you use `description` type and want to pass `jsx`, it **must* be inline and **not** a component to ensure the inner text is properly read by voiceover.
|
|
91
|
+
>
|
|
92
|
+
> ```jsx
|
|
93
|
+
> // The text will be understood as: You must accept terms and conditions
|
|
94
|
+
> <Tooltip type="description" title={<span>You<i>must</i> accept terms and conditions</span>}/>
|
|
95
|
+
>
|
|
96
|
+
> // This will render a string including the html and will not be properly understood by voice over.
|
|
97
|
+
> const MyComponent = () => <span>You<i>must</i> accept terms and conditions</span>
|
|
98
|
+
> <Tool
|
|
99
|
+
|
|
100
|
+
<ExampleCodeBlock code={DescriptionType} />
|
|
101
|
+
|
|
72
102
|
### Muted Tooltips
|
|
73
103
|
|
|
74
104
|
If a tooltip does not need to be visible to screen reader users, or you handle accessibility of the
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import {DeleteButton, SecondaryButton, TertiaryButton} from '@workday/canvas-kit-react/button';
|
|
4
|
+
import {Tooltip} from '@workday/canvas-kit-react/tooltip';
|
|
5
|
+
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
6
|
+
import {chartConfigIcon} from '@workday/canvas-system-icons-web';
|
|
7
|
+
|
|
8
|
+
export default () => {
|
|
9
|
+
return (
|
|
10
|
+
<Flex gap="s">
|
|
11
|
+
<Tooltip type="description" title="Search using additional criteria">
|
|
12
|
+
<TertiaryButton icon={chartConfigIcon}>Advanced Search</TertiaryButton>
|
|
13
|
+
</Tooltip>
|
|
14
|
+
<Tooltip type="description" title="Create saved search">
|
|
15
|
+
<SecondaryButton>Save</SecondaryButton>
|
|
16
|
+
</Tooltip>
|
|
17
|
+
<Tooltip type="description" title="The service will restart after this action">
|
|
18
|
+
<DeleteButton>Delete</DeleteButton>
|
|
19
|
+
</Tooltip>
|
|
20
|
+
</Flex>
|
|
21
|
+
);
|
|
22
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-docs",
|
|
3
|
-
"version": "13.0.0-alpha.
|
|
3
|
+
"version": "13.0.0-alpha.1016-next.0",
|
|
4
4
|
"description": "Documentation components of Canvas Kit components",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@emotion/styled": "^11.6.0",
|
|
46
46
|
"@storybook/csf": "0.0.1",
|
|
47
|
-
"@workday/canvas-kit-labs-react": "^13.0.0-alpha.
|
|
48
|
-
"@workday/canvas-kit-preview-react": "^13.0.0-alpha.
|
|
49
|
-
"@workday/canvas-kit-react": "^13.0.0-alpha.
|
|
50
|
-
"@workday/canvas-kit-styling": "^13.0.0-alpha.
|
|
47
|
+
"@workday/canvas-kit-labs-react": "^13.0.0-alpha.1016-next.0",
|
|
48
|
+
"@workday/canvas-kit-preview-react": "^13.0.0-alpha.1016-next.0",
|
|
49
|
+
"@workday/canvas-kit-react": "^13.0.0-alpha.1016-next.0",
|
|
50
|
+
"@workday/canvas-kit-styling": "^13.0.0-alpha.1016-next.0",
|
|
51
51
|
"@workday/canvas-system-icons-web": "^3.0.0",
|
|
52
52
|
"@workday/canvas-tokens-web": "^2.1.0",
|
|
53
53
|
"markdown-to-jsx": "^7.2.0",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"mkdirp": "^1.0.3",
|
|
61
61
|
"typescript": "5.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "adaf9ca63978245025920184f65b0019ee8e952d"
|
|
64
64
|
}
|