@kaizen/components 1.79.5 → 1.79.7
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/cjs/alpha.cjs +4 -0
- package/dist/cjs/src/Button/Button/Button.cjs +5 -0
- package/dist/cjs/src/Button/IconButton/IconButton.cjs +5 -0
- package/dist/cjs/src/LikertScaleLegacy/LikertScaleLegacy.cjs +3 -0
- package/dist/cjs/src/Skirt/Skirt.cjs +3 -0
- package/dist/cjs/src/Skirt/subcomponents/SkirtCard/SkirtCard.cjs +4 -0
- package/dist/cjs/src/SplitButton/SplitButton.cjs +2 -0
- package/dist/cjs/src/TitleBlockZen/TitleBlockZen.cjs +3 -0
- package/dist/cjs/src/__alpha__/SingleSelect/SingleSelect.cjs +32 -0
- package/dist/cjs/src/__alpha__/SingleSelect/SingleSelect.module.css.cjs +6 -0
- package/dist/cjs/src/__alpha__/SingleSelect/subcomponents/List/List.cjs +24 -0
- package/dist/cjs/src/__alpha__/SingleSelect/subcomponents/List/List.module.css.cjs +6 -0
- package/dist/cjs/src/__alpha__/SingleSelect/subcomponents/ListItem/ListItem.cjs +24 -0
- package/dist/cjs/src/__alpha__/SingleSelect/subcomponents/ListItem/ListItem.module.css.cjs +6 -0
- package/dist/cjs/src/__alpha__/SingleSelect/subcomponents/ListSection/ListSection.cjs +25 -0
- package/dist/cjs/src/__alpha__/SingleSelect/subcomponents/ListSection/ListSection.module.css.cjs +6 -0
- package/dist/cjs/src/__alpha__/SingleSelect/subcomponents/Trigger/Trigger.cjs +21 -0
- package/dist/cjs/src/__alpha__/SingleSelect/subcomponents/Trigger/Trigger.module.css.cjs +6 -0
- package/dist/esm/alpha.mjs +1 -0
- package/dist/esm/src/Button/Button/Button.mjs +5 -0
- package/dist/esm/src/Button/IconButton/IconButton.mjs +5 -0
- package/dist/esm/src/LikertScaleLegacy/LikertScaleLegacy.mjs +3 -0
- package/dist/esm/src/Skirt/Skirt.mjs +3 -0
- package/dist/esm/src/Skirt/subcomponents/SkirtCard/SkirtCard.mjs +4 -0
- package/dist/esm/src/SplitButton/SplitButton.mjs +2 -0
- package/dist/esm/src/TitleBlockZen/TitleBlockZen.mjs +3 -0
- package/dist/esm/src/__alpha__/SingleSelect/SingleSelect.mjs +27 -0
- package/dist/esm/src/__alpha__/SingleSelect/SingleSelect.module.css.mjs +4 -0
- package/dist/esm/src/__alpha__/SingleSelect/subcomponents/List/List.mjs +18 -0
- package/dist/esm/src/__alpha__/SingleSelect/subcomponents/List/List.module.css.mjs +4 -0
- package/dist/esm/src/__alpha__/SingleSelect/subcomponents/ListItem/ListItem.mjs +18 -0
- package/dist/esm/src/__alpha__/SingleSelect/subcomponents/ListItem/ListItem.module.css.mjs +4 -0
- package/dist/esm/src/__alpha__/SingleSelect/subcomponents/ListSection/ListSection.mjs +19 -0
- package/dist/esm/src/__alpha__/SingleSelect/subcomponents/ListSection/ListSection.module.css.mjs +4 -0
- package/dist/esm/src/__alpha__/SingleSelect/subcomponents/Trigger/Trigger.mjs +13 -0
- package/dist/esm/src/__alpha__/SingleSelect/subcomponents/Trigger/Trigger.module.css.mjs +4 -0
- package/dist/styles.css +60 -1
- package/dist/types/Button/Button/Button.d.ts +5 -0
- package/dist/types/Button/IconButton/IconButton.d.ts +5 -0
- package/dist/types/LikertScaleLegacy/LikertScaleLegacy.d.ts +3 -0
- package/dist/types/Skirt/Skirt.d.ts +3 -0
- package/dist/types/Skirt/subcomponents/SkirtCard/SkirtCard.d.ts +3 -0
- package/dist/types/SplitButton/SplitButton.d.ts +2 -0
- package/dist/types/TitleBlockZen/TitleBlockZen.d.ts +3 -0
- package/dist/types/__alpha__/SingleSelect/SingleSelect.d.ts +23 -0
- package/dist/types/__alpha__/SingleSelect/_docs/mockData.d.ts +59 -0
- package/dist/types/__alpha__/SingleSelect/index.d.ts +1 -0
- package/dist/types/__alpha__/SingleSelect/subcomponents/List/List.d.ts +6 -0
- package/dist/types/__alpha__/SingleSelect/subcomponents/List/index.d.ts +1 -0
- package/dist/types/__alpha__/SingleSelect/subcomponents/ListItem/ListItem.d.ts +6 -0
- package/dist/types/__alpha__/SingleSelect/subcomponents/ListItem/index.d.ts +1 -0
- package/dist/types/__alpha__/SingleSelect/subcomponents/ListSection/ListSection.d.ts +8 -0
- package/dist/types/__alpha__/SingleSelect/subcomponents/ListSection/index.d.ts +1 -0
- package/dist/types/__alpha__/SingleSelect/subcomponents/Trigger/Trigger.d.ts +1 -0
- package/dist/types/__alpha__/SingleSelect/subcomponents/Trigger/index.d.ts +1 -0
- package/dist/types/__alpha__/SingleSelect/subcomponents/index.d.ts +4 -0
- package/dist/types/__alpha__/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/Button/Button/Button.tsx +5 -0
- package/src/Button/IconButton/IconButton.tsx +5 -0
- package/src/LikertScaleLegacy/LikertScaleLegacy.tsx +3 -0
- package/src/LikertScaleLegacy/_docs/LikertScaleLegacy.mdx +3 -2
- package/src/LikertScaleLegacy/_docs/LikertScaleLegacy.stickersheet.stories.tsx +1 -1
- package/src/LikertScaleLegacy/_docs/LikertScaleLegacy.stories.tsx +1 -1
- package/src/Skirt/Skirt.tsx +4 -0
- package/src/Skirt/_docs/Skirt.mdx +3 -1
- package/src/Skirt/_docs/Skirt.stories.tsx +1 -1
- package/src/Skirt/subcomponents/SkirtCard/SkirtCard.tsx +4 -0
- package/src/SplitButton/SplitButton.tsx +2 -0
- package/src/SplitButton/_docs/SplitButton.mdx +3 -1
- package/src/SplitButton/_docs/SplitButton.stickersheet.stories.tsx +1 -1
- package/src/SplitButton/_docs/SplitButton.stories.tsx +1 -1
- package/src/TitleBlockZen/TitleBlockZen.tsx +3 -0
- package/src/TitleBlockZen/_docs/TitleBlockZen.mdx +3 -2
- package/src/__alpha__/SingleSelect/SingleSelect.module.css +9 -0
- package/src/__alpha__/SingleSelect/SingleSelect.spec.tsx +26 -0
- package/src/__alpha__/SingleSelect/SingleSelect.tsx +27 -0
- package/src/__alpha__/SingleSelect/_docs/SingleSelect.mdx +27 -0
- package/src/__alpha__/SingleSelect/_docs/SingleSelect.stickersheet.stories.tsx +83 -0
- package/src/__alpha__/SingleSelect/_docs/SingleSelect.stories.tsx +23 -0
- package/src/__alpha__/SingleSelect/_docs/mockData.ts +92 -0
- package/src/__alpha__/SingleSelect/index.ts +1 -0
- package/src/__alpha__/SingleSelect/subcomponents/List/List.module.css +7 -0
- package/src/__alpha__/SingleSelect/subcomponents/List/List.tsx +17 -0
- package/src/__alpha__/SingleSelect/subcomponents/List/index.ts +1 -0
- package/src/__alpha__/SingleSelect/subcomponents/ListItem/ListItem.module.css +9 -0
- package/src/__alpha__/SingleSelect/subcomponents/ListItem/ListItem.tsx +17 -0
- package/src/__alpha__/SingleSelect/subcomponents/ListItem/index.ts +1 -0
- package/src/__alpha__/SingleSelect/subcomponents/ListSection/ListSection.module.css +9 -0
- package/src/__alpha__/SingleSelect/subcomponents/ListSection/ListSection.tsx +23 -0
- package/src/__alpha__/SingleSelect/subcomponents/ListSection/index.ts +1 -0
- package/src/__alpha__/SingleSelect/subcomponents/Trigger/Trigger.module.css +18 -0
- package/src/__alpha__/SingleSelect/subcomponents/Trigger/Trigger.tsx +13 -0
- package/src/__alpha__/SingleSelect/subcomponents/Trigger/index.ts +1 -0
- package/src/__alpha__/SingleSelect/subcomponents/index.ts +4 -0
- package/src/__alpha__/index.ts +1 -0
- package/src/__next__/Menu/_docs/Menu--migration-guide.mdx +91 -0
- package/src/__next__/Tabs/subcomponents/TabList/TabList.module.css +3 -1
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export const singleMockItems = [
|
|
2
|
+
{ label: 'Short black', value: 'short-black' },
|
|
3
|
+
{ label: 'Long black', value: 'long-black' },
|
|
4
|
+
{ label: 'Batch brew', value: 'batch-brew' },
|
|
5
|
+
{ label: 'Latte', value: 'latte' },
|
|
6
|
+
{ label: 'Flat white', value: 'flat-white' },
|
|
7
|
+
{ label: 'Mocha', value: 'mocha' },
|
|
8
|
+
{ label: 'Cappuccino', value: 'cappuccino' },
|
|
9
|
+
{ label: 'Magic', value: 'magic' },
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
export const groupedMockItems = [
|
|
13
|
+
{
|
|
14
|
+
label: 'Colours',
|
|
15
|
+
options: [
|
|
16
|
+
{ label: 'Blue', value: 'blue' },
|
|
17
|
+
{ label: 'Red', value: 'red' },
|
|
18
|
+
{ label: 'Green', value: 'green' },
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
label: 'Flavours',
|
|
23
|
+
options: [
|
|
24
|
+
{ label: 'Vanilla', value: 'vanilla' },
|
|
25
|
+
{ label: 'Chocolate', value: 'chocolate' },
|
|
26
|
+
{ label: 'Strawberry', value: 'strawberry' },
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
export const mixedMockItemsDisabled = [
|
|
32
|
+
{ label: 'Short black', value: 'short-black', disabled: true },
|
|
33
|
+
{ label: 'Long black', value: 'long-black' },
|
|
34
|
+
{ label: 'Batch brew', value: 'batch-brew', disabled: true },
|
|
35
|
+
{
|
|
36
|
+
label: 'Size',
|
|
37
|
+
options: [
|
|
38
|
+
{ label: 'Regular', value: 'regular' },
|
|
39
|
+
{ label: 'Large', value: 'large', disabled: true },
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
label: 'Syrup',
|
|
44
|
+
options: [
|
|
45
|
+
{ label: 'Vanilla', value: 'vanilla', disabled: true },
|
|
46
|
+
{ label: 'Caramel', value: 'caramel' },
|
|
47
|
+
{ label: 'Hazelnut', value: 'hazelnut' },
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
export const mixedMockItemsUngroupedFirst = [
|
|
53
|
+
{ label: 'Batch brew', value: 'batch-brew' },
|
|
54
|
+
{ label: 'Latte', value: 'latte' },
|
|
55
|
+
{ label: 'Magic', value: 'magic' },
|
|
56
|
+
{
|
|
57
|
+
label: 'Size',
|
|
58
|
+
options: [
|
|
59
|
+
{ label: 'Regular', value: 'regular' },
|
|
60
|
+
{ label: 'Large', value: 'large' },
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
label: 'Syrup',
|
|
65
|
+
options: [
|
|
66
|
+
{ label: 'Vanilla', value: 'vanilla' },
|
|
67
|
+
{ label: 'Caramel', value: 'caramel' },
|
|
68
|
+
{ label: 'Hazelnut', value: 'hazelnut' },
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
export const mixedMockItemsUnordered = [
|
|
74
|
+
{
|
|
75
|
+
label: 'Size',
|
|
76
|
+
options: [
|
|
77
|
+
{ label: 'Regular', value: 'regular' },
|
|
78
|
+
{ label: 'Large', value: 'large' },
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
{ label: 'Batch brew', value: 'batch-brew' },
|
|
82
|
+
{ label: 'Latte', value: 'latte' },
|
|
83
|
+
{ label: 'Magic', value: 'magic' },
|
|
84
|
+
{
|
|
85
|
+
label: 'Syrup',
|
|
86
|
+
options: [
|
|
87
|
+
{ label: 'Vanilla', value: 'vanilla' },
|
|
88
|
+
{ label: 'Caramel', value: 'caramel' },
|
|
89
|
+
{ label: 'Hazelnut', value: 'hazelnut' },
|
|
90
|
+
],
|
|
91
|
+
},
|
|
92
|
+
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SingleSelect'
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { type PropsWithChildren } from 'react'
|
|
2
|
+
import classNames from 'classnames'
|
|
3
|
+
import { ListBox as RACListBox, type ListBoxProps } from 'react-aria-components'
|
|
4
|
+
import styles from './List.module.css'
|
|
5
|
+
|
|
6
|
+
export const List = ({
|
|
7
|
+
children,
|
|
8
|
+
className,
|
|
9
|
+
...props
|
|
10
|
+
}: ListBoxProps<object> & PropsWithChildren): React.ReactElement => {
|
|
11
|
+
return (
|
|
12
|
+
<RACListBox className={classNames(styles.list, className)} {...props}>
|
|
13
|
+
{children}
|
|
14
|
+
</RACListBox>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
List.displayName = 'SingleSelect.List'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './List'
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
@layer kz-components {
|
|
2
|
+
.listItem {
|
|
3
|
+
font-family: var(--typography-paragraph-body-font-family);
|
|
4
|
+
font-weight: var(--typography-paragraph-body-font-weight);
|
|
5
|
+
font-size: var(--typography-paragraph-body-font-size);
|
|
6
|
+
line-height: var(--typography-paragraph-body-line-height);
|
|
7
|
+
letter-spacing: var(--typography-paragraph-body-letter-spacing);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { type PropsWithChildren } from 'react'
|
|
2
|
+
import classNames from 'classnames'
|
|
3
|
+
import { ListBoxItem as RACListBoxItem, type ListBoxItemProps } from 'react-aria-components'
|
|
4
|
+
import styles from './ListItem.module.css'
|
|
5
|
+
|
|
6
|
+
export const ListItem = ({
|
|
7
|
+
children,
|
|
8
|
+
className,
|
|
9
|
+
...props
|
|
10
|
+
}: ListBoxItemProps<object> & PropsWithChildren): React.ReactElement => {
|
|
11
|
+
return (
|
|
12
|
+
<RACListBoxItem className={classNames(styles.listItem, className)} {...props}>
|
|
13
|
+
{children}
|
|
14
|
+
</RACListBoxItem>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
ListItem.displayName = 'SingleSelect.ListItem'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ListItem'
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
@layer kz-components {
|
|
2
|
+
.listSectionHeader {
|
|
3
|
+
font-family: var(--typography-heading-5-font-family);
|
|
4
|
+
font-weight: var(--typography-heading-5-font-weight);
|
|
5
|
+
font-size: var(--typography-heading-5-font-size);
|
|
6
|
+
line-height: var(--typography-heading-5-line-height);
|
|
7
|
+
letter-spacing: var(--typography-heading-5-letter-spacing);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { type PropsWithChildren } from 'react'
|
|
2
|
+
import classNames from 'classnames'
|
|
3
|
+
import {
|
|
4
|
+
Header as RACHeader,
|
|
5
|
+
ListBoxSection as RACListBoxSection,
|
|
6
|
+
type ListBoxSectionProps,
|
|
7
|
+
} from 'react-aria-components'
|
|
8
|
+
import styles from './ListSection.module.css'
|
|
9
|
+
|
|
10
|
+
export const ListSection = ({
|
|
11
|
+
name,
|
|
12
|
+
className,
|
|
13
|
+
children,
|
|
14
|
+
...props
|
|
15
|
+
}: ListBoxSectionProps<object> & PropsWithChildren & { name: string }): React.ReactElement => {
|
|
16
|
+
return (
|
|
17
|
+
<RACListBoxSection {...props}>
|
|
18
|
+
<RACHeader className={classNames(styles.listSectionHeader, className)}>{name}</RACHeader>
|
|
19
|
+
{children}
|
|
20
|
+
</RACListBoxSection>
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
ListSection.displayName = 'SingleSelect.ListSection'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ListSection'
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
@layer kz-components {
|
|
2
|
+
.button {
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: space-between;
|
|
6
|
+
font-family: var(--typography-paragraph-body-font-family);
|
|
7
|
+
font-weight: var(--typography-paragraph-body-font-weight);
|
|
8
|
+
font-size: var(--typography-paragraph-body-font-size);
|
|
9
|
+
line-height: var(--typography-paragraph-body-line-height);
|
|
10
|
+
letter-spacing: var(--typography-paragraph-body-letter-spacing);
|
|
11
|
+
padding: var(--spacing-12);
|
|
12
|
+
min-height: var(--spacing-48);
|
|
13
|
+
min-width: var(--spacing-200);
|
|
14
|
+
background-color: var(--color-white);
|
|
15
|
+
border-radius: var(--spacing-8);
|
|
16
|
+
border: 1px solid var(--color-gray-500);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Button as RACButton, SelectValue } from 'react-aria-components'
|
|
3
|
+
import { Icon } from '~components/__next__/Icon'
|
|
4
|
+
import styles from './Trigger.module.css'
|
|
5
|
+
|
|
6
|
+
export const Trigger = (): JSX.Element => {
|
|
7
|
+
return (
|
|
8
|
+
<RACButton className={styles.button}>
|
|
9
|
+
<SelectValue />
|
|
10
|
+
<Icon name="keyboard_arrow_down" isPresentational />
|
|
11
|
+
</RACButton>
|
|
12
|
+
)
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Trigger'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SingleSelect'
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { Meta } from '@storybook/blocks'
|
|
2
|
+
|
|
3
|
+
<Meta title="Components/Menu/Migration guide" />
|
|
4
|
+
|
|
5
|
+
# Menu migration guide
|
|
6
|
+
|
|
7
|
+
## Audience
|
|
8
|
+
|
|
9
|
+
This guide is relevant for Kaizen All-In-One (KAIO) v1 consumers.
|
|
10
|
+
|
|
11
|
+
## Purpose
|
|
12
|
+
|
|
13
|
+
This guide provides instructions for migrating menu usage from the `deprecated` (`@kaizen/components`) `Menu` component to the `next` (`@kaizen/components/next`) `Menu` component.
|
|
14
|
+
|
|
15
|
+
This migration is a prerequisite for [migrating to KAIO v2](/docs/releases-upcoming-major-releases--docs).
|
|
16
|
+
|
|
17
|
+
## Key API changes
|
|
18
|
+
|
|
19
|
+
`next/Menu` separates its functionality into the following components:
|
|
20
|
+
|
|
21
|
+
- `MenuTrigger` wraps the `MenuPopover` component and its trigger element.
|
|
22
|
+
- `MenuPopover` contains a `Menu` component, and controls the popover placement and open and close interactions.
|
|
23
|
+
- `Menu` contains one or more `MenuItem` and `MenuSection` components.
|
|
24
|
+
- `MenuSection` enables menu items to be grouped into sections.
|
|
25
|
+
- `MenuHeader` provides a section's header content.
|
|
26
|
+
- `MenuItem` provides a menu item's content, and handles item selection.
|
|
27
|
+
|
|
28
|
+
Other notable changes:
|
|
29
|
+
|
|
30
|
+
- `Menu.align` prop becomes MenuPopover.placement, and values are mapped as follows:
|
|
31
|
+
- `left` becomes `start`
|
|
32
|
+
- `right` becomes `end`
|
|
33
|
+
- `Menu.autoHide` prop is retired
|
|
34
|
+
- `Menu.button` prop becomes `MenuTrigger.children`
|
|
35
|
+
- The trigger element must be a `next/Button`
|
|
36
|
+
- `Menu.dropdownWidth` prop is retired
|
|
37
|
+
- `Menu.portalSelector` prop is retired
|
|
38
|
+
- Where needed, [PortalProvider](https://react-spectrum.adobe.com/react-aria/PortalProvider.html) can be used to control portalling behaviour
|
|
39
|
+
- `MenuItem.destructive` prop is retired
|
|
40
|
+
- This change aligns with a broader move towards more judicious use of colour
|
|
41
|
+
- `MenuItem.disabled` prop becomes `MenuItem.isDisabled`
|
|
42
|
+
- `MenuItem.label` prop becomes `MenuItem.children`
|
|
43
|
+
- `MenuItem.onClick` prop becomes `MenuItem.onAction`
|
|
44
|
+
- React Aria's `Menu` does not expose native click events, e.g. `MenuItem.onAction` cannot call `e.preventDefault()`
|
|
45
|
+
- See React Aria [Menu documentation](https://react-spectrum.adobe.com/react-aria/Menu.html) for more details on working with `Menu` and `MenuItem` events
|
|
46
|
+
- `MenuList.heading` prop becomes `MenuHeader` in a `MenuSection`
|
|
47
|
+
|
|
48
|
+
## Migration example
|
|
49
|
+
|
|
50
|
+
### Before
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
<Menu button={<Button>Trigger</Button>}>
|
|
54
|
+
<MenuList>
|
|
55
|
+
<MenuList heading={<MenuHeading>Section One</MenuHeading>}>
|
|
56
|
+
<MenuItem onClick={() => alert('1')} label="Item 1" />
|
|
57
|
+
<MenuItem onClick={() => alert('2')} label="Item 2" />
|
|
58
|
+
</MenuList>
|
|
59
|
+
<MenuList heading={<MenuHeading>Section Two</MenuHeading>}>
|
|
60
|
+
<MenuItem onClick={() => alert('3')} label="Item 3" />
|
|
61
|
+
<MenuItem onClick={() => alert('4')} label="Item 4" />
|
|
62
|
+
</MenuList>
|
|
63
|
+
</MenuList>
|
|
64
|
+
</Menu>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### After
|
|
68
|
+
|
|
69
|
+
```tsx
|
|
70
|
+
<MenuTrigger>
|
|
71
|
+
<Button>Trigger</Button>
|
|
72
|
+
<MenuPopover>
|
|
73
|
+
<Menu>
|
|
74
|
+
<MenuSection>
|
|
75
|
+
<MenuHeader>Section One</MenuHeader>
|
|
76
|
+
<MenuItem onAction={() => alert('1')}>Item 1</MenuItem>
|
|
77
|
+
<MenuItem onAction={() => alert('2')}>Item 2</MenuItem>
|
|
78
|
+
</MenuSection>
|
|
79
|
+
<MenuSection>
|
|
80
|
+
<MenuHeader>Section Two</MenuHeader>
|
|
81
|
+
<MenuItem onAction={() => alert('3')}>Item 3</MenuItem>
|
|
82
|
+
<MenuItem onAction={() => alert('4')}>Item 4</MenuItem>
|
|
83
|
+
</MenuSection>
|
|
84
|
+
</Menu>
|
|
85
|
+
</MenuPopover>
|
|
86
|
+
</MenuTrigger>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## More information
|
|
90
|
+
|
|
91
|
+
More information about `next/Menu` can be found at [API Specification](/docs/components-menu-menu-next-api-specification--docs) and [Usage Guidelines](/docs/components-menu-menu-next-usage-guidelines--docs).
|