@patternfly/react-core 5.0.0-alpha.2 → 5.0.0-alpha.4
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/CHANGELOG.md +8 -0
- package/dist/esm/components/Tabs/Tabs.d.ts +2 -4
- package/dist/esm/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/esm/components/Tabs/Tabs.js +3 -5
- package/dist/esm/components/Tabs/Tabs.js.map +1 -1
- package/dist/js/components/Tabs/Tabs.d.ts +2 -4
- package/dist/js/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/js/components/Tabs/Tabs.js +3 -5
- package/dist/js/components/Tabs/Tabs.js.map +1 -1
- package/dist/umd/react-core.min.js +5 -5
- package/package.json +7 -7
- package/src/components/Tabs/Tabs.tsx +5 -9
- package/src/components/Tabs/__tests__/Tabs.test.tsx +23 -23
- package/src/demos/Tabs.md +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.4",
|
|
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",
|
|
@@ -55,21 +55,21 @@
|
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@patternfly/patternfly": "5.0.0-alpha.3",
|
|
58
|
-
"@rollup/plugin-commonjs": "^
|
|
58
|
+
"@rollup/plugin-commonjs": "^24.0.0",
|
|
59
59
|
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
60
|
-
"@rollup/plugin-replace": "^
|
|
60
|
+
"@rollup/plugin-replace": "^5.0.2",
|
|
61
61
|
"css": "^2.2.3",
|
|
62
62
|
"fs-extra": "^6.0.1",
|
|
63
63
|
"glob": "^7.1.2",
|
|
64
64
|
"rimraf": "^3.0.2",
|
|
65
|
-
"rollup": "^
|
|
66
|
-
"rollup-plugin-scss": "^
|
|
67
|
-
"rollup-plugin-terser": "^7.0.
|
|
65
|
+
"rollup": "^3.10.0",
|
|
66
|
+
"rollup-plugin-scss": "^4.0.0",
|
|
67
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
68
68
|
"typescript": "^4.7.4"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"react": "^16.8 || ^17 || ^18",
|
|
72
72
|
"react-dom": "^16.8 || ^17 || ^18"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "e10574726614bbe29582d3212d04f2d3d28be6ca"
|
|
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
|
-
/**
|
|
65
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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"
|
|
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
|
|
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).
|
|
392
|
+
expect(tabsContainer).toHaveClass('pf-m-no-border-bottom');
|
|
393
393
|
});
|
|
394
394
|
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
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(
|