Skip to content

Commit 102e06e

Browse files
authored
feat(Toolbar): remove depricated visiblity (#8212)
1 parent d390c87 commit 102e06e

File tree

8 files changed

+6
-222
lines changed

8 files changed

+6
-222
lines changed

packages/react-core/src/components/Toolbar/ToolbarContent.tsx

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,6 @@ export interface ToolbarContentProps extends React.HTMLProps<HTMLDivElement> {
1717
xl?: 'hidden' | 'visible';
1818
'2xl'?: 'hidden' | 'visible';
1919
};
20-
/** @deprecated prop misspelled */
21-
visiblity?: {
22-
default?: 'hidden' | 'visible';
23-
md?: 'hidden' | 'visible';
24-
lg?: 'hidden' | 'visible';
25-
xl?: 'hidden' | 'visible';
26-
'2xl'?: 'hidden' | 'visible';
27-
};
2820
/** Alignment at various breakpoints. */
2921
alignment?: {
3022
default?: 'alignRight' | 'alignLeft';
@@ -65,29 +57,20 @@ export class ToolbarContent extends React.Component<ToolbarContentProps> {
6557
isExpanded,
6658
toolbarId,
6759
visibility,
68-
visiblity,
6960
alignment,
7061
clearAllFilters,
7162
showClearFiltersButton,
7263
clearFiltersButtonText,
7364
...props
7465
} = this.props;
7566

76-
if (visiblity !== undefined) {
77-
// eslint-disable-next-line no-console
78-
console.warn(
79-
'The ToolbarContent visiblity prop has been deprecated. ' +
80-
'Please use the correctly spelled visibility prop instead.'
81-
);
82-
}
83-
8467
return (
8568
<PageContext.Consumer>
8669
{({ width, getBreakpoint }) => (
8770
<div
8871
className={css(
8972
styles.toolbarContent,
90-
formatBreakpointMods(visibility || visiblity, styles, '', getBreakpoint(width)),
73+
formatBreakpointMods(visibility, styles, '', getBreakpoint(width)),
9174
formatBreakpointMods(alignment, styles, '', getBreakpoint(width)),
9275
className
9376
)}

packages/react-core/src/components/Toolbar/ToolbarGroup.tsx

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,6 @@ export interface ToolbarGroupProps extends Omit<React.HTMLProps<HTMLDivElement>,
2323
xl?: 'hidden' | 'visible';
2424
'2xl'?: 'hidden' | 'visible';
2525
};
26-
/** @deprecated prop misspelled */
27-
visiblity?: {
28-
default?: 'hidden' | 'visible';
29-
md?: 'hidden' | 'visible';
30-
lg?: 'hidden' | 'visible';
31-
xl?: 'hidden' | 'visible';
32-
'2xl'?: 'hidden' | 'visible';
33-
};
3426
/** Alignment at various breakpoints. */
3527
alignment?: {
3628
default?: 'alignRight' | 'alignLeft';
@@ -63,26 +55,7 @@ export interface ToolbarGroupProps extends Omit<React.HTMLProps<HTMLDivElement>,
6355

6456
class ToolbarGroupWithRef extends React.Component<ToolbarGroupProps> {
6557
render() {
66-
const {
67-
visibility,
68-
visiblity,
69-
alignment,
70-
spacer,
71-
spaceItems,
72-
className,
73-
variant,
74-
children,
75-
innerRef,
76-
...props
77-
} = this.props;
78-
79-
if (visiblity !== undefined) {
80-
// eslint-disable-next-line no-console
81-
console.warn(
82-
'The ToolbarGroup visiblity prop has been deprecated. ' +
83-
'Please use the correctly spelled visibility prop instead.'
84-
);
85-
}
58+
const { visibility, alignment, spacer, spaceItems, className, variant, children, innerRef, ...props } = this.props;
8659

8760
return (
8861
<PageContext.Consumer>
@@ -91,7 +64,7 @@ class ToolbarGroupWithRef extends React.Component<ToolbarGroupProps> {
9164
className={css(
9265
styles.toolbarGroup,
9366
variant && styles.modifiers[toCamel(variant) as 'filterGroup' | 'iconButtonGroup' | 'buttonGroup'],
94-
formatBreakpointMods(visibility || visiblity, styles, '', getBreakpoint(width)),
67+
formatBreakpointMods(visibility, styles, '', getBreakpoint(width)),
9568
formatBreakpointMods(alignment, styles, '', getBreakpoint(width)),
9669
formatBreakpointMods(spacer, styles, '', getBreakpoint(width)),
9770
formatBreakpointMods(spaceItems, styles, '', getBreakpoint(width)),

packages/react-core/src/components/Toolbar/ToolbarItem.tsx

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@ export interface ToolbarItemProps extends React.HTMLProps<HTMLDivElement> {
3939
xl?: 'hidden' | 'visible';
4040
'2xl'?: 'hidden' | 'visible';
4141
};
42-
/** @deprecated prop misspelled */
43-
visiblity?: {
44-
default?: 'hidden' | 'visible';
45-
md?: 'hidden' | 'visible';
46-
lg?: 'hidden' | 'visible';
47-
xl?: 'hidden' | 'visible';
48-
'2xl'?: 'hidden' | 'visible';
49-
};
5042
/** Alignment at various breakpoints. */
5143
alignment?: {
5244
default?: 'alignRight' | 'alignLeft';
@@ -84,7 +76,6 @@ export const ToolbarItem: React.FunctionComponent<ToolbarItemProps> = ({
8476
className,
8577
variant,
8678
visibility,
87-
visiblity,
8879
alignment,
8980
spacer,
9081
widths,
@@ -97,14 +88,6 @@ export const ToolbarItem: React.FunctionComponent<ToolbarItemProps> = ({
9788
return <Divider className={css(styles.modifiers.vertical, className)} {...props} />;
9889
}
9990

100-
if (visiblity !== undefined) {
101-
// eslint-disable-next-line no-console
102-
console.warn(
103-
'The ToolbarItem visiblity prop has been deprecated. ' +
104-
'Please use the correctly spelled visibility prop instead.'
105-
);
106-
}
107-
10891
const widthStyles: any = {};
10992
if (widths) {
11093
Object.entries(widths || {}).map(
@@ -130,7 +113,7 @@ export const ToolbarItem: React.FunctionComponent<ToolbarItemProps> = ({
130113
| 'chipGroup'
131114
],
132115
isAllExpanded && styles.modifiers.expanded,
133-
formatBreakpointMods(visibility || visiblity, styles, '', getBreakpoint(width)),
116+
formatBreakpointMods(visibility, styles, '', getBreakpoint(width)),
134117
formatBreakpointMods(alignment, styles, '', getBreakpoint(width)),
135118
formatBreakpointMods(spacer, styles, '', getBreakpoint(width)),
136119
className

packages/react-core/src/components/Toolbar/ToolbarToggleGroup.tsx

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,6 @@ export interface ToolbarToggleGroupProps extends ToolbarGroupProps {
2222
xl?: 'hidden' | 'visible';
2323
'2xl'?: 'hidden' | 'visible';
2424
};
25-
/** @deprecated prop misspelled */
26-
visiblity?: {
27-
default?: 'hidden' | 'visible';
28-
md?: 'hidden' | 'visible';
29-
lg?: 'hidden' | 'visible';
30-
xl?: 'hidden' | 'visible';
31-
'2xl'?: 'hidden' | 'visible';
32-
};
3325
/** Alignment at various breakpoints. */
3426
alignment?: {
3527
default?: 'alignRight' | 'alignLeft';
@@ -69,7 +61,6 @@ export class ToolbarToggleGroup extends React.Component<ToolbarToggleGroupProps>
6961
toggleIcon,
7062
variant,
7163
visibility,
72-
visiblity,
7364
breakpoint,
7465
alignment,
7566
spacer,
@@ -84,14 +75,6 @@ export class ToolbarToggleGroup extends React.Component<ToolbarToggleGroupProps>
8475
console.error('ToolbarToggleGroup will not be visible without a breakpoint or toggleIcon.');
8576
}
8677

87-
if (visiblity !== undefined) {
88-
// eslint-disable-next-line no-console
89-
console.warn(
90-
'The ToolbarToggleGroup visiblity prop has been deprecated. ' +
91-
'Please use the correctly spelled visibility prop instead.'
92-
);
93-
}
94-
9578
return (
9679
<PageContext.Consumer>
9780
{({ width, getBreakpoint }) => (
@@ -123,7 +106,7 @@ export class ToolbarToggleGroup extends React.Component<ToolbarToggleGroupProps>
123106
variant &&
124107
styles.modifiers[toCamel(variant) as 'filterGroup' | 'iconButtonGroup' | 'buttonGroup'],
125108
formatBreakpointMods(breakpointMod, styles, '', getBreakpoint(width)),
126-
formatBreakpointMods(visibility || visiblity, styles, '', getBreakpoint(width)),
109+
formatBreakpointMods(visibility, styles, '', getBreakpoint(width)),
127110
formatBreakpointMods(alignment, styles, '', getBreakpoint(width)),
128111
formatBreakpointMods(spacer, styles, '', getBreakpoint(width)),
129112
formatBreakpointMods(spaceItems, styles, '', getBreakpoint(width)),

packages/react-core/src/helpers/Popper/Popper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ export const Popper: React.FunctionComponent<PopperProps> = ({
181181
}
182182
}, [reference]);
183183
React.useEffect(() => {
184-
// When the popperRef is defined or the popper visiblity changes, ensure the popper element is up to date
184+
// When the popperRef is defined or the popper visibility changes, ensure the popper element is up to date
185185
if (popperRef) {
186186
if ((popperRef as React.RefObject<any>).current) {
187187
setPopperElement((popperRef as React.RefObject<any>).current);

packages/react-integration/demo-app-ts/src/Demos.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -497,11 +497,6 @@ export const Demos: DemoInterface[] = [
497497
name: 'Toolbar Visibility Demo',
498498
componentType: Examples.ToolbarVisibilityDemo
499499
},
500-
{
501-
id: 'toolbar-visiblity-demo',
502-
name: 'Toolbar Visiblity Demo (Deprecated)',
503-
componentType: Examples.ToolbarVisiblityDemo
504-
},
505500
{
506501
id: 'tooltip-demo',
507502
name: 'Tooltip Demo',

packages/react-integration/demo-app-ts/src/components/demos/ToolbarDemo/ToolbarVisiblityDemo.tsx

Lines changed: 0 additions & 132 deletions
This file was deleted.

packages/react-integration/demo-app-ts/src/components/demos/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export * from './ToolbarDemo/ToolbarDemo';
2323
export * from './DescriptionListDemo/DescriptionListDemo';
2424
export * from './DescriptionListDemo/DescriptionListBreakpointsDemo';
2525
export * from './ToolbarDemo/ToolbarVisibilityDemo';
26-
export * from './ToolbarDemo/ToolbarVisiblityDemo';
2726
export * from './DrawerDemo/DrawerDemo';
2827
export * from './DrawerDemo/DrawerResizeDemo';
2928
export * from './DropdownDemo/DropdownDemo';

0 commit comments

Comments
 (0)