Skip to content

Commit 252b442

Browse files
siddharthkpcolebemis
authored andcommitted
Prefix component with types exported from ActionList2 and ActionMenu2 (#1883)
* prefix component name to types * add changeset * Update .changeset/actionlist2-actionmenu2-prefix-types.md Co-authored-by: Cole Bemis <colebemis@github.com> Co-authored-by: Cole Bemis <colebemis@github.com>
1 parent 9555747 commit 252b442

File tree

3 files changed

+31
-7
lines changed

3 files changed

+31
-7
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
'@primer/react': major
3+
---
4+
5+
`ActionList2` exported types are now prefixed with `ActionList`:
6+
7+
```
8+
ListProps → ActionListProps
9+
GroupProps → ActionListGroupProps
10+
ItemProps → ActionListItemProps
11+
DescriptionProps → ActionListDescriptionProps
12+
LeadingVisualProps → ActionListLeadingVisualProps,
13+
TrailingVisualProps → ActionListTrailingVisualProps
14+
```
15+
16+
`ActionMenu2` exported types are now prefixed with `ActionMenu`:
17+
18+
```
19+
MenuButtonProps → ActionMenuButtonProps
20+
MenuAnchorProps → ActionMenuAnchorProps
21+
```

src/ActionList2/index.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ import {Description} from './Description'
77
import {LeadingVisual, TrailingVisual} from './Visuals'
88

99
export type {ListProps as ActionListProps} from './List'
10-
export type {GroupProps} from './Group'
11-
export type {ItemProps} from './Item'
12-
export type {DescriptionProps} from './Description'
13-
export type {LeadingVisualProps, TrailingVisualProps} from './Visuals'
10+
export type {GroupProps as ActionListGroupProps} from './Group'
11+
export type {ItemProps as ActionListItemProps} from './Item'
12+
export type {DescriptionProps as ActionListDescriptionProps} from './Description'
13+
export type {
14+
LeadingVisualProps as ActionListLeadingVisualProps,
15+
TrailingVisualProps as ActionListTrailingVisualProps
16+
} from './Visuals'
1417

1518
/**
1619
* Collection of list-related components.

src/ActionMenu2.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ const Menu: React.FC<ActionMenuProps> = ({
6464
)
6565
}
6666

67-
export type MenuAnchorProps = {children: React.ReactElement}
68-
const Anchor = React.forwardRef<AnchoredOverlayProps['anchorRef'], MenuAnchorProps>(
67+
export type ActionMenuAnchorProps = {children: React.ReactElement}
68+
const Anchor = React.forwardRef<AnchoredOverlayProps['anchorRef'], ActionMenuAnchorProps>(
6969
({children, ...anchorProps}, anchorRef) => {
7070
return React.cloneElement(children, {...anchorProps, ref: anchorRef})
7171
}
7272
)
7373

7474
/** this component is syntactical sugar 🍭 */
75-
export type MenuButtonProps = ButtonProps
75+
export type ActionMenuButtonProps = ButtonProps
7676
const MenuButton = React.forwardRef<AnchoredOverlayProps['anchorRef'], ButtonProps>((props, anchorRef) => {
7777
return (
7878
<Anchor ref={anchorRef}>

0 commit comments

Comments
 (0)