@patternfly/react-core 5.0.0-alpha.2 → 5.0.0-alpha.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/react-core",
3
- "version": "5.0.0-alpha.2",
3
+ "version": "5.0.0-alpha.3",
4
4
  "description": "This library provides a set of common React components for use with the PatternFly reference implementation.",
5
5
  "main": "dist/js/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -71,5 +71,5 @@
71
71
  "react": "^16.8 || ^17 || ^18",
72
72
  "react-dom": "^16.8 || ^17 || ^18"
73
73
  },
74
- "gitHead": "5c5e79f8ab23e8c173df7524ad2f1f59a9ba4300"
74
+ "gitHead": "095f5b13df51b2fa9ffe73bee9e01e8613d54f06"
75
75
  }
@@ -61,10 +61,8 @@ export interface TabsProps extends Omit<React.HTMLProps<HTMLElement | HTMLDivEle
61
61
  isBox?: boolean;
62
62
  /** Enables vertical tab styling */
63
63
  isVertical?: boolean;
64
- /** Enables border bottom tab styling on tabs. Defaults to true. To remove the bottom border, set this prop to false. */
65
- hasBorderBottom?: boolean;
66
- /** Enables border bottom styling for secondary tabs */
67
- hasSecondaryBorderBottom?: boolean;
64
+ /** Disables border bottom tab styling on tabs. Defaults to false. To remove the bottom border, set this prop to true. */
65
+ hasNoBorderBottom?: boolean;
68
66
  /** Aria-label for the left scroll button */
69
67
  leftScrollAriaLabel?: string;
70
68
  /** Aria-label for the right scroll button */
@@ -177,7 +175,7 @@ export class Tabs extends React.Component<TabsProps, TabsState> {
177
175
  isSecondary: false,
178
176
  isVertical: false,
179
177
  isBox: false,
180
- hasBorderBottom: true,
178
+ hasNoBorderBottom: false,
181
179
  leftScrollAriaLabel: 'Scroll left',
182
180
  rightScrollAriaLabel: 'Scroll right',
183
181
  component: TabsComponent.div,
@@ -375,9 +373,7 @@ export class Tabs extends React.Component<TabsProps, TabsState> {
375
373
  isSecondary,
376
374
  isVertical,
377
375
  isBox,
378
- hasBorderBottom,
379
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
380
- hasSecondaryBorderBottom,
376
+ hasNoBorderBottom,
381
377
  leftScrollAriaLabel,
382
378
  rightScrollAriaLabel,
383
379
  'aria-label': ariaLabel,
@@ -460,7 +456,7 @@ export class Tabs extends React.Component<TabsProps, TabsState> {
460
456
  isBox && styles.modifiers.box,
461
457
  showScrollButtons && styles.modifiers.scrollable,
462
458
  usePageInsets && styles.modifiers.pageInsets,
463
- !hasBorderBottom && styles.modifiers.noBorderBottom,
459
+ hasNoBorderBottom && styles.modifiers.noBorderBottom,
464
460
  formatBreakpointMods(inset, styles),
465
461
  variantStyle[variant],
466
462
  hasOverflowTab && styles.modifiers.overflow,
@@ -357,7 +357,7 @@ test('should render box tabs of light variant', () => {
357
357
 
358
358
  test('should render tabs with no bottom border', () => {
359
359
  const { asFragment } = render(
360
- <Tabs id="noBottomBorderTabs" hasBorderBottom={false}>
360
+ <Tabs id="noBottomBorderTabs" hasNoBorderBottom>
361
361
  <Tab id="tab1" eventKey={0} title={<TabTitleText>"Tab item 1"</TabTitleText>}>
362
362
  Tab 1 section
363
363
  </Tab>
@@ -372,9 +372,9 @@ test('should render tabs with no bottom border', () => {
372
372
  expect(asFragment()).toMatchSnapshot();
373
373
  });
374
374
 
375
- test('should not render tabs with secondary border bottom when not passed hasSecondaryBorderBottom', () => {
375
+ test('should render secondary tabs with no bottom border when passed hasNoBorderBottom', () => {
376
376
  render(
377
- <Tabs id="noBottomBorderTabs" aria-label="Secondary bottom border">
377
+ <Tabs isSecondary hasNoBorderBottom id="noBottomBorderTabs" aria-label="Secondary bottom border">
378
378
  <Tab id="tab1" eventKey={0} title={<TabTitleText>"Tab item 1"</TabTitleText>}>
379
379
  Tab 1 section
380
380
  </Tab>
@@ -389,28 +389,28 @@ test('should not render tabs with secondary border bottom when not passed hasSec
389
389
 
390
390
  const tabsContainer = screen.queryByLabelText('Secondary bottom border');
391
391
 
392
- expect(tabsContainer).not.toHaveClass('pf-m-border-bottom');
392
+ expect(tabsContainer).toHaveClass('pf-m-no-border-bottom');
393
393
  });
394
394
 
395
- // test('should render tabs with secondary border bottom when passed hasSecondaryBorderBottom', () => {
396
- // render(
397
- // <Tabs id="noBottomBorderTabs" aria-label="Secondary bottom border" hasSecondaryBorderBottom>
398
- // <Tab id="tab1" eventKey={0} title={<TabTitleText>"Tab item 1"</TabTitleText>}>
399
- // Tab 1 section
400
- // </Tab>
401
- // <Tab id="tab2" eventKey={1} title={<TabTitleText>"Tab item 2"</TabTitleText>}>
402
- // Tab 2 section
403
- // </Tab>
404
- // <Tab id="tab3" eventKey={2} title={<TabTitleText>"Tab item 3"</TabTitleText>}>
405
- // Tab 3 section
406
- // </Tab>
407
- // </Tabs>
408
- // );
409
- //
410
- // const tabsContainer = screen.queryByLabelText('Secondary bottom border');
411
- //
412
- // expect(tabsContainer).toHaveClass('pf-m-border-bottom');
413
- // });
395
+ test('should render secondary tabs with border bottom', () => {
396
+ render(
397
+ <Tabs isSecondary id="bottomBorderTabs" aria-label="Secondary bottom border">
398
+ <Tab id="tab1" eventKey={0} title={<TabTitleText>"Tab item 1"</TabTitleText>}>
399
+ Tab 1 section
400
+ </Tab>
401
+ <Tab id="tab2" eventKey={1} title={<TabTitleText>"Tab item 2"</TabTitleText>}>
402
+ Tab 2 section
403
+ </Tab>
404
+ <Tab id="tab3" eventKey={2} title={<TabTitleText>"Tab item 3"</TabTitleText>}>
405
+ Tab 3 section
406
+ </Tab>
407
+ </Tabs>
408
+ );
409
+
410
+ const tabsContainer = screen.queryByLabelText('Secondary bottom border');
411
+
412
+ expect(tabsContainer).not.toHaveClass('pf-m-no-border-bottom');
413
+ });
414
414
 
415
415
  test('should not render scroll buttons by default', () => {
416
416
  render(
package/src/demos/Tabs.md CHANGED
@@ -383,7 +383,6 @@ TabsOpenWithSecondaryTabsDemo = () => {
383
383
  <TabContentBody>
384
384
  <Tabs
385
385
  isSecondary
386
- hasSecondaryBorderBottom
387
386
  activeKey={activeTabKeySecondary}
388
387
  onSelect={handleTabClickSecondary}
389
388
  usePageInsets