@workday/canvas-kit-docs 12.5.4 → 12.6.0-1078-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.
@@ -18,11 +18,11 @@ export const packageJSONFile = `{
18
18
  "@emotion/react": "11.11.4",
19
19
  "@types/react": "18.2.60",
20
20
  "@types/react-dom": "18.2.19",
21
- "@workday/canvas-kit-labs-react": "12.5.4",
22
- "@workday/canvas-kit-preview-react": "12.5.4",
23
- "@workday/canvas-kit-react": "12.5.4",
24
- "@workday/canvas-kit-react-fonts": "^12.5.4",
25
- "@workday/canvas-kit-styling": "12.5.4",
21
+ "@workday/canvas-kit-labs-react": "12.5.5",
22
+ "@workday/canvas-kit-preview-react": "12.5.5",
23
+ "@workday/canvas-kit-react": "12.5.5",
24
+ "@workday/canvas-kit-react-fonts": "^12.5.5",
25
+ "@workday/canvas-kit-styling": "12.5.5",
26
26
  "@workday/canvas-system-icons-web": "3.0.22",
27
27
  "@workday/canvas-tokens-web": "2.0.0"
28
28
  },
@@ -18,11 +18,11 @@ export const packageJSONFile = `{
18
18
  "@emotion/react": "11.11.4",
19
19
  "@types/react": "18.2.60",
20
20
  "@types/react-dom": "18.2.19",
21
- "@workday/canvas-kit-labs-react": "12.5.4",
22
- "@workday/canvas-kit-preview-react": "12.5.4",
23
- "@workday/canvas-kit-react": "12.5.4",
24
- "@workday/canvas-kit-react-fonts": "^12.5.4",
25
- "@workday/canvas-kit-styling": "12.5.4",
21
+ "@workday/canvas-kit-labs-react": "12.5.5",
22
+ "@workday/canvas-kit-preview-react": "12.5.5",
23
+ "@workday/canvas-kit-react": "12.5.5",
24
+ "@workday/canvas-kit-react-fonts": "^12.5.5",
25
+ "@workday/canvas-kit-styling": "12.5.5",
26
26
  "@workday/canvas-system-icons-web": "3.0.22",
27
27
  "@workday/canvas-tokens-web": "2.0.0"
28
28
  },
@@ -3,6 +3,7 @@ import Basic from './examples/Basic';
3
3
  import ContextMenu from './examples/ContextMenu';
4
4
  import Icons from './examples/Icons';
5
5
  import SelectableMenu from './examples/SelectableMenu';
6
+ import Grouping from './examples/Grouping';
6
7
 
7
8
  # Canvas Kit Menu
8
9
 
@@ -69,6 +70,17 @@ behaviors depend on many other things. To see a full example of all these behavi
69
70
 
70
71
  <ExampleCodeBlock code={SelectableMenu} />
71
72
 
73
+ ### Grouping
74
+
75
+ Grouping adds hierarchy and categorization to menu items. Group headers do not represent menu items
76
+ and are not selectable with the keyboard or mouse.
77
+
78
+ > **Note**: Grouping is not supported in virtual rendering. Menus by default have `shouldVirtualize`
79
+ > set to `false`. Setting to `true` results in unspecified behavior. We use `react-virtual` which
80
+ > doesn't support nested virtualization.
81
+
82
+ <ExampleCodeBlock code={Grouping} />
83
+
72
84
  ## Component API
73
85
 
74
86
  <SymbolDoc name="Menu" fileName="/react/" />
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+
3
+ import {Menu} from '@workday/canvas-kit-react/menu';
4
+ import {BodyText} from '@workday/canvas-kit-react/text';
5
+
6
+ export default () => {
7
+ const [selected, setSelected] = React.useState('');
8
+ return (
9
+ <>
10
+ <Menu onSelect={data => setSelected(data.id)}>
11
+ <Menu.Target>Open Menu</Menu.Target>
12
+ <Menu.Popper>
13
+ <Menu.Card>
14
+ <Menu.List>
15
+ <Menu.Group title="First Group">
16
+ <Menu.Item>First Item</Menu.Item>
17
+ <Menu.Item>Second Item</Menu.Item>
18
+ </Menu.Group>
19
+ <Menu.Group title="Second Group">
20
+ <Menu.Item>Third Item (with a really, really, really long label)</Menu.Item>
21
+ <Menu.Item aria-disabled>Fourth Item</Menu.Item>
22
+ </Menu.Group>
23
+ </Menu.List>
24
+ </Menu.Card>
25
+ </Menu.Popper>
26
+ <BodyText size="small" marginTop="s">
27
+ Selected: <span data-testid="output">{selected}</span>
28
+ </BodyText>
29
+ </Menu>
30
+ </>
31
+ );
32
+ };
@@ -22,6 +22,7 @@ export default () => {
22
22
  const [value, setValue] = React.useState('');
23
23
 
24
24
  const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
25
+ console.log('change', event.currentTarget.value);
25
26
  setValue(event.target.value);
26
27
  };
27
28
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-docs",
3
- "version": "12.5.4",
3
+ "version": "12.6.0-1078-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",
@@ -45,10 +45,10 @@
45
45
  "@emotion/styled": "^11.6.0",
46
46
  "@stackblitz/sdk": "^1.11.0",
47
47
  "@storybook/csf": "0.0.1",
48
- "@workday/canvas-kit-labs-react": "^12.5.4",
49
- "@workday/canvas-kit-preview-react": "^12.5.4",
50
- "@workday/canvas-kit-react": "^12.5.4",
51
- "@workday/canvas-kit-styling": "^12.5.4",
48
+ "@workday/canvas-kit-labs-react": "^12.6.0-1078-next.0",
49
+ "@workday/canvas-kit-preview-react": "^12.6.0-1078-next.0",
50
+ "@workday/canvas-kit-react": "^12.6.0-1078-next.0",
51
+ "@workday/canvas-kit-styling": "^12.6.0-1078-next.0",
52
52
  "@workday/canvas-system-icons-web": "^3.0.0",
53
53
  "@workday/canvas-tokens-web": "^2.1.1",
54
54
  "markdown-to-jsx": "^7.2.0",
@@ -61,5 +61,5 @@
61
61
  "mkdirp": "^1.0.3",
62
62
  "typescript": "5.0"
63
63
  },
64
- "gitHead": "d7210e5f21aa41863be8d2fb33e2b60188f3803a"
64
+ "gitHead": "9b558c0f2e5d17b8f81e2e21a20361918ca2ad57"
65
65
  }