Skip to content

Commit

Permalink
fix(Toolbar): update align prop type to alignEnd, alignStart (#10366)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolethoen authored May 15, 2024
1 parent cd60d82 commit 83db357
Show file tree
Hide file tree
Showing 23 changed files with 36 additions and 36 deletions.
10 changes: 5 additions & 5 deletions packages/react-core/src/components/Toolbar/ToolbarGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ export interface ToolbarGroupProps extends Omit<React.HTMLProps<HTMLDivElement>,
};
/** Applies to a child of a flex layout, and aligns that child (and any adjacent children on the other side of it) to one side of the main axis */
align?: {
default?: 'alignRight' | 'alignLeft';
md?: 'alignRight' | 'alignLeft';
lg?: 'alignRight' | 'alignLeft';
xl?: 'alignRight' | 'alignLeft';
'2xl'?: 'alignRight' | 'alignLeft';
default?: 'alignEnd' | 'alignStart';
md?: 'alignEnd' | 'alignStart';
lg?: 'alignEnd' | 'alignStart';
xl?: 'alignEnd' | 'alignStart';
'2xl'?: 'alignEnd' | 'alignStart';
};
/** Vertical alignment of children */
alignItems?: 'start' | 'center' | 'baseline' | 'default';
Expand Down
10 changes: 5 additions & 5 deletions packages/react-core/src/components/Toolbar/ToolbarItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ export interface ToolbarItemProps extends React.HTMLProps<HTMLDivElement> {
};
/** Applies to a child of a flex layout, and aligns that child (and any adjacent children on the other side of it) to one side of the main axis */
align?: {
default?: 'alignRight' | 'alignLeft';
md?: 'alignRight' | 'alignLeft';
lg?: 'alignRight' | 'alignLeft';
xl?: 'alignRight' | 'alignLeft';
'2xl'?: 'alignRight' | 'alignLeft';
default?: 'alignEnd' | 'alignStart';
md?: 'alignEnd' | 'alignStart';
lg?: 'alignEnd' | 'alignStart';
xl?: 'alignEnd' | 'alignStart';
'2xl'?: 'alignEnd' | 'alignStart';
};
/** Vertical alignment of children */
alignItems?: 'start' | 'center' | 'baseline' | 'default';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ export interface ToolbarToggleGroupProps extends ToolbarGroupProps {
};
/** Alignment at various breakpoints. */
alignment?: {
default?: 'alignRight' | 'alignLeft';
md?: 'alignRight' | 'alignLeft';
lg?: 'alignRight' | 'alignLeft';
xl?: 'alignRight' | 'alignLeft';
'2xl'?: 'alignRight' | 'alignLeft';
default?: 'alignEnd' | 'alignStart';
md?: 'alignEnd' | 'alignStart';
lg?: 'alignEnd' | 'alignStart';
xl?: 'alignEnd' | 'alignStart';
'2xl'?: 'alignEnd' | 'alignStart';
};
/** Spacers at various breakpoints. */
spacer?: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ export const ToolbarStacked: React.FunctionComponent = () => {
<DropdownList>{splitButtonDropdownItems}</DropdownList>
</Dropdown>
</ToolbarItem>
<ToolbarItem variant="pagination" align={{ default: 'alignRight' }}>
<ToolbarItem variant="pagination" align={{ default: 'alignEnd' }}>
<Pagination
itemCount={37}
perPage={perPage}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ export const CardViewBasic: React.FunctionComponent = () => {
</OverflowMenuControl>
</OverflowMenu>
</ToolbarItem>
<ToolbarItem variant="pagination" align={{ default: 'alignRight' }}>
<ToolbarItem variant="pagination" align={{ default: 'alignEnd' }}>
{renderPagination()}
</ToolbarItem>
</React.Fragment>
Expand Down
2 changes: 1 addition & 1 deletion packages/react-core/src/demos/DashboardHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export const DashboardHeader: React.FC<DashboardHeaderProps> = ({ notificationBa
<ToolbarContent>
<ToolbarGroup
variant="icon-button-group"
align={{ default: 'alignRight' }}
align={{ default: 'alignEnd' }}
spacer={{ default: 'spacerNone', md: 'spacerMd' }}
>
{notificationBadge ?? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const DataListBasic: React.FunctionComponent = () => {
</OverflowMenuControl>
</OverflowMenu>
</ToolbarItem>
<ToolbarItem variant="pagination" align={{ default: 'alignRight' }}>
<ToolbarItem variant="pagination" align={{ default: 'alignEnd' }}>
{renderPagination()}
</ToolbarItem>
</React.Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export const NotificationDrawerBasic: React.FunctionComponent = () => {
const headerToolbar = (
<Toolbar isFullHeight>
<ToolbarContent>
<ToolbarGroup spaceItems={{ default: 'spaceItemsNone' }} align={{ default: 'alignRight' }}>
<ToolbarGroup spaceItems={{ default: 'spaceItemsNone' }} align={{ default: 'alignEnd' }}>
<ToolbarGroup variant="icon-button-group">
<ToolbarItem visibility={{ default: 'visible' }} selected={isDrawerExpanded}>
<NotificationBadge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export const NotificationDrawerGrouped: React.FunctionComponent = () => {
const headerToolbar = (
<Toolbar isFullHeight>
<ToolbarContent>
<ToolbarGroup spaceItems={{ default: 'spaceItemsNone' }} align={{ default: 'alignRight' }}>
<ToolbarGroup spaceItems={{ default: 'spaceItemsNone' }} align={{ default: 'alignEnd' }}>
<ToolbarGroup variant="icon-button-group">
<ToolbarItem visibility={{ default: 'visible' }} selected={isDrawerExpanded}>
<NotificationBadge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ export const PaginatedTableAction = () => {
<ToolbarContent>
<ToolbarGroup
variant="icon-button-group"
align={{ default: 'alignRight' }}
align={{ default: 'alignEnd' }}
spacer={{ default: 'spacerNone', md: 'spacerMd' }}
>
<ToolbarGroup variant="icon-button-group" visibility={{ default: 'hidden', lg: 'visible' }}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ export const PaginatedTableAction: React.FunctionComponent = () => {
<ToolbarContent>
<ToolbarGroup
variant="icon-button-group"
align={{ default: 'alignRight' }}
align={{ default: 'alignEnd' }}
spacer={{ default: 'spacerNone', md: 'spacerMd' }}
>
<ToolbarGroup variant="icon-button-group" visibility={{ default: 'hidden', lg: 'visible' }}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ export const MastheadWithUtilitiesAndUserDropdownMenu: React.FunctionComponent =
<ToolbarContent>
<ToolbarGroup
variant="icon-button-group"
align={{ default: 'alignRight' }}
align={{ default: 'alignEnd' }}
spacer={{ default: 'spacerNone', md: 'spacerMd' }}
>
<ToolbarItem>
Expand Down
2 changes: 1 addition & 1 deletion packages/react-core/src/demos/examples/Nav/NavFlyout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export const NavFlyout: React.FunctionComponent = () => {
<ToolbarContent>
<ToolbarGroup
variant="icon-button-group"
align={{ default: 'alignRight' }}
align={{ default: 'alignEnd' }}
spacer={{ default: 'spacerNone', md: 'spacerMd' }}
>
<ToolbarItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export const NavHorizontal: React.FunctionComponent = () => {
<ToolbarItem isOverflowContainer>{PageNav}</ToolbarItem>
<ToolbarGroup
variant="icon-button-group"
align={{ default: 'alignRight' }}
align={{ default: 'alignEnd' }}
spacer={{ default: 'spacerNone', md: 'spacerMd' }}
>
<ToolbarItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export const NavHorizontalWithSubnav: React.FunctionComponent = () => {
<ToolbarItem isOverflowContainer>{PageNav}</ToolbarItem>
<ToolbarGroup
variant="icon-button-group"
align={{ default: 'alignRight' }}
align={{ default: 'alignEnd' }}
spacer={{ default: 'spacerNone', md: 'spacerMd' }}
>
<ToolbarItem>
Expand Down
2 changes: 1 addition & 1 deletion packages/react-core/src/demos/examples/Nav/NavManual.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const NavManual: React.FunctionComponent = () => {
<ToolbarContent>
<ToolbarGroup
variant="icon-button-group"
align={{ default: 'alignRight' }}
align={{ default: 'alignEnd' }}
spacer={{ default: 'spacerNone', md: 'spacerMd' }}
>
<ToolbarItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export const PageStickySectionBreadcrumb: React.FunctionComponent = () => {
<ToolbarContent>
<ToolbarGroup
variant="icon-button-group"
align={{ default: 'alignRight' }}
align={{ default: 'alignEnd' }}
spacer={{ default: 'spacerNone', md: 'spacerMd' }}
>
<ToolbarItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export const PageStickySectionGroup: React.FunctionComponent = () => {
<ToolbarContent>
<ToolbarGroup
variant="icon-button-group"
align={{ default: 'alignRight' }}
align={{ default: 'alignEnd' }}
spacer={{ default: 'spacerNone', md: 'spacerMd' }}
>
<ToolbarItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export const PageStickySectionGroupAlternate: React.FunctionComponent = () => {
<ToolbarContent>
<ToolbarGroup
variant="icon-button-group"
align={{ default: 'alignRight' }}
align={{ default: 'alignEnd' }}
spacer={{ default: 'spacerNone', md: 'spacerMd' }}
>
<ToolbarItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ export const PrimaryDetailCardView: React.FunctionComponent = () => {
<DropdownList>{toolbarKebabDropdownItems}</DropdownList>
</Dropdown>
</ToolbarItem>
<ToolbarItem variant="pagination" align={{ default: 'alignRight' }}>
<ToolbarItem variant="pagination" align={{ default: 'alignEnd' }}>
{renderPagination()}
</ToolbarItem>
</React.Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,8 @@ export const ConsoleLogViewerToolbar: React.FC = () => {

const items = (
<React.Fragment>
<ToolbarGroup align={{ default: 'alignLeft' }}>{leftAlignedItems}</ToolbarGroup>
<ToolbarGroup align={{ default: 'alignRight' }}>{rightAlignedItems}</ToolbarGroup>
<ToolbarGroup align={{ default: 'alignStart' }}>{leftAlignedItems}</ToolbarGroup>
<ToolbarGroup align={{ default: 'alignEnd' }}>{rightAlignedItems}</ToolbarGroup>
</React.Fragment>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export class MastheadDemo extends React.Component {
))}
</ContextSelector>
</ToolbarItem>
<ToolbarGroup align={{ default: 'alignRight' }}>
<ToolbarGroup align={{ default: 'alignEnd' }}>
<ToolbarItem visibility={{ default: 'hidden', lg: 'visible' }}>
<Dropdown
onSelect={this.onDropdownSelect}
Expand Down
2 changes: 1 addition & 1 deletion packages/react-table/src/demos/DashboardHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export const DashboardHeader: React.FC<DashboardHeaderProps> = ({ notificationBa
<ToolbarContent>
<ToolbarGroup
variant="icon-button-group"
align={{ default: 'alignRight' }}
align={{ default: 'alignEnd' }}
spacer={{ default: 'spacerNone', md: 'spacerMd' }}
>
{notificationBadge ?? (
Expand Down

0 comments on commit 83db357

Please sign in to comment.