Skip to content

Commit 9ed0058

Browse files
authored
[LG-5285] feat(split-button): export MenuItem and MenuItemProps (#3331)
* chore(split-button): export MenuItem and MenuItemProps * docs(split-button): README * chore(split-button): changeset
1 parent a59da7e commit 9ed0058

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

.changeset/new-points-relate.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@leafygreen-ui/split-button': minor
3+
---
4+
5+
[LG-5285](https://jira.mongodb.org/browse/LG-5285): pass through and export `MenuItem` and `MenuItemProps` to fix cross-dependency issues with `@leafygreen-ui/menu`

packages/split-button/README.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,20 @@ npm install @leafygreen-ui/split-button
2727
## Example
2828

2929
```js
30-
31-
import { SplitButton } from `@leafygreen-ui/split-button`;
32-
import { MenuItem } from '@leafygreen-ui/menu';
30+
import { MenuItem, SplitButton } from '@leafygreen-ui/split-button';
3331

3432
<SplitButton
3533
label="label"
36-
menuItems={
37-
[
38-
<MenuItem key='0'>Menu Item</MenuItem>,
39-
<MenuItem key='1' disabled>Disabled Menu Item</MenuItem>,
40-
<MenuItem key='2' description="I am also a description">
41-
Menu Item With Description
42-
</MenuItem>
43-
]
44-
}
45-
/>
34+
menuItems={[
35+
<MenuItem key="0">Menu Item</MenuItem>,
36+
<MenuItem key="1" disabled>
37+
Disabled Menu Item
38+
</MenuItem>,
39+
<MenuItem key="2" description="I am also a description">
40+
Menu Item With Description
41+
</MenuItem>,
42+
]}
43+
/>;
4644
```
4745

4846
## Properties

packages/split-button/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ export {
88
Variant,
99
} from './SplitButton';
1010
export { DEFAULT_LGID_ROOT, getLgIds, type GetLgIdsReturnType } from './utils';
11+
export { MenuItem, type MenuItemProps } from '@leafygreen-ui/menu';

0 commit comments

Comments
 (0)