@workday/canvas-kit-docs 7.3.12 → 7.4.0-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.
|
@@ -1509,6 +1509,20 @@ module.exports = {specifications: [
|
|
|
1509
1509
|
}
|
|
1510
1510
|
]
|
|
1511
1511
|
},
|
|
1512
|
+
{
|
|
1513
|
+
"type": "describe",
|
|
1514
|
+
"name": "when the tab key is pressed",
|
|
1515
|
+
"children": [
|
|
1516
|
+
{
|
|
1517
|
+
"type": "it",
|
|
1518
|
+
"name": "should have aria-expanded set to false"
|
|
1519
|
+
},
|
|
1520
|
+
{
|
|
1521
|
+
"type": "it",
|
|
1522
|
+
"name": "should not show a menu"
|
|
1523
|
+
}
|
|
1524
|
+
]
|
|
1525
|
+
},
|
|
1512
1526
|
{
|
|
1513
1527
|
"type": "describe",
|
|
1514
1528
|
"name": "when the user types a printable character \"t\"",
|
package/dist/es6/lib/specs.js
CHANGED
|
@@ -1509,6 +1509,20 @@ module.exports = {specifications: [
|
|
|
1509
1509
|
}
|
|
1510
1510
|
]
|
|
1511
1511
|
},
|
|
1512
|
+
{
|
|
1513
|
+
"type": "describe",
|
|
1514
|
+
"name": "when the tab key is pressed",
|
|
1515
|
+
"children": [
|
|
1516
|
+
{
|
|
1517
|
+
"type": "it",
|
|
1518
|
+
"name": "should have aria-expanded set to false"
|
|
1519
|
+
},
|
|
1520
|
+
{
|
|
1521
|
+
"type": "it",
|
|
1522
|
+
"name": "should not show a menu"
|
|
1523
|
+
}
|
|
1524
|
+
]
|
|
1525
|
+
},
|
|
1512
1526
|
{
|
|
1513
1527
|
"type": "describe",
|
|
1514
1528
|
"name": "when the user types a printable character \"t\"",
|
|
@@ -5,6 +5,7 @@ import Basic from './examples/Basic';
|
|
|
5
5
|
import ContextMenu from './examples/ContextMenu';
|
|
6
6
|
import CustomMenuItem from './examples/CustomMenuItem';
|
|
7
7
|
import Icons from './examples/Icons';
|
|
8
|
+
import Headers from './examples/Headers';
|
|
8
9
|
import ManyItems from './examples/ManyItems';
|
|
9
10
|
|
|
10
11
|
|
|
@@ -72,6 +73,13 @@ Below is an example:
|
|
|
72
73
|
|
|
73
74
|
<ExampleCodeBlock code={Icons} />
|
|
74
75
|
|
|
76
|
+
### Headers
|
|
77
|
+
|
|
78
|
+
You can group menu items logically by adding a `isHeader` attribute on your `<MenuItems>`. To make
|
|
79
|
+
your new items screen reader friendly add an `aria-label` around each grouped item.
|
|
80
|
+
|
|
81
|
+
<ExampleCodeBlock code={Headers} />
|
|
82
|
+
|
|
75
83
|
### Many Items
|
|
76
84
|
|
|
77
85
|
<ExampleCodeBlock code={ManyItems} />
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {checkIcon} from '@workday/canvas-system-icons-web';
|
|
3
|
+
import {Menu, MenuItem} from '@workday/canvas-kit-preview-react/menu';
|
|
4
|
+
import {styled} from '@workday/canvas-kit-react/common';
|
|
5
|
+
import {type} from '@workday/canvas-kit-react/tokens';
|
|
6
|
+
|
|
7
|
+
const Header = styled(MenuItem)({
|
|
8
|
+
fontWeight: type.properties.fontWeights.bold,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export default () => {
|
|
12
|
+
return (
|
|
13
|
+
<Menu>
|
|
14
|
+
<Header isHeader={true}>Sort By</Header>
|
|
15
|
+
<MenuItem icon={checkIcon}>
|
|
16
|
+
<span aria-label="sort by newest">Newest</span>
|
|
17
|
+
</MenuItem>
|
|
18
|
+
<MenuItem>
|
|
19
|
+
<span aria-label="sort by oldest">Oldest</span>
|
|
20
|
+
</MenuItem>
|
|
21
|
+
<Header isHeader={true} hasDivider={true}>
|
|
22
|
+
Display Density
|
|
23
|
+
</Header>
|
|
24
|
+
<MenuItem icon={checkIcon}>
|
|
25
|
+
<span aria-label="display density simple">Simple</span>
|
|
26
|
+
</MenuItem>
|
|
27
|
+
<MenuItem>
|
|
28
|
+
<span aria-label="display density detailed">Detailed</span>
|
|
29
|
+
</MenuItem>
|
|
30
|
+
</Menu>
|
|
31
|
+
);
|
|
32
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-docs",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.4.0-next.0+e138a7b2",
|
|
4
4
|
"description": "Documentation components of Canvas Kit components",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@storybook/csf": "0.0.1",
|
|
45
|
-
"@workday/canvas-kit-react": "^7.
|
|
45
|
+
"@workday/canvas-kit-react": "^7.4.0-next.0+e138a7b2"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"fs-extra": "^10.0.0",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"mkdirp": "^1.0.3",
|
|
51
51
|
"typescript": "4.1"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "e138a7b26bdec0a480cf9b5229a33fb4b33765dc"
|
|
54
54
|
}
|