@patternfly/react-core 4.191.1 → 4.191.2
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/umd/react-core.min.css +34 -34
- package/package.json +5 -5
- package/src/demos/Tabs.md +7 -0
- package/src/demos/examples/Tabs/ModalTabs.tsx +142 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 4.191.2 (2022-01-19)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @patternfly/react-core
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## 4.191.1 (2022-01-19)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @patternfly/react-core
|
|
@@ -1305,6 +1305,40 @@ textarea.pf-c-form-control {
|
|
|
1305
1305
|
display: block;
|
|
1306
1306
|
}
|
|
1307
1307
|
|
|
1308
|
+
.pf-c-badge {
|
|
1309
|
+
--pf-c-badge--BorderRadius: var(--pf-global--BorderRadius--lg);
|
|
1310
|
+
--pf-c-badge--FontSize: var(--pf-global--FontSize--xs);
|
|
1311
|
+
--pf-c-badge--FontWeight: var(--pf-global--FontWeight--bold);
|
|
1312
|
+
--pf-c-badge--PaddingRight: var(--pf-global--spacer--sm);
|
|
1313
|
+
--pf-c-badge--PaddingLeft: var(--pf-global--spacer--sm);
|
|
1314
|
+
--pf-c-badge--Color: var(--pf-global--Color--dark-100);
|
|
1315
|
+
--pf-c-badge--MinWidth: var(--pf-global--spacer--xl);
|
|
1316
|
+
--pf-c-badge--m-read--BackgroundColor: var(--pf-global--BackgroundColor--200);
|
|
1317
|
+
--pf-c-badge--m-read--Color: var(--pf-global--Color--dark-100);
|
|
1318
|
+
--pf-c-badge--m-unread--BackgroundColor: var(--pf-global--primary-color--100);
|
|
1319
|
+
--pf-c-badge--m-unread--Color: var(--pf-global--Color--light-100);
|
|
1320
|
+
display: inline-block;
|
|
1321
|
+
min-width: var(--pf-c-badge--MinWidth);
|
|
1322
|
+
padding-right: var(--pf-c-badge--PaddingRight);
|
|
1323
|
+
padding-left: var(--pf-c-badge--PaddingLeft);
|
|
1324
|
+
font-size: var(--pf-c-badge--FontSize);
|
|
1325
|
+
font-weight: var(--pf-c-badge--FontWeight);
|
|
1326
|
+
color: var(--pf-c-badge--Color);
|
|
1327
|
+
text-align: center;
|
|
1328
|
+
background-color: var(--pf-c-badge--BackgroundColor);
|
|
1329
|
+
border-radius: var(--pf-c-badge--BorderRadius);
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
.pf-c-badge.pf-m-read {
|
|
1333
|
+
--pf-c-badge--Color: var(--pf-c-badge--m-read--Color);
|
|
1334
|
+
--pf-c-badge--BackgroundColor: var(--pf-c-badge--m-read--BackgroundColor);
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
.pf-c-badge.pf-m-unread {
|
|
1338
|
+
--pf-c-badge--Color: var(--pf-c-badge--m-unread--Color);
|
|
1339
|
+
--pf-c-badge--BackgroundColor: var(--pf-c-badge--m-unread--BackgroundColor);
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1308
1342
|
.pf-c-banner.pf-m-warning, .pf-c-banner.pf-m-info {
|
|
1309
1343
|
--pf-global--Color--100: var(--pf-global--Color--dark-100);
|
|
1310
1344
|
--pf-global--Color--200: var(--pf-global--Color--dark-200);
|
|
@@ -1446,40 +1480,6 @@ textarea.pf-c-form-control {
|
|
|
1446
1480
|
cursor: not-allowed;
|
|
1447
1481
|
}
|
|
1448
1482
|
|
|
1449
|
-
.pf-c-badge {
|
|
1450
|
-
--pf-c-badge--BorderRadius: var(--pf-global--BorderRadius--lg);
|
|
1451
|
-
--pf-c-badge--FontSize: var(--pf-global--FontSize--xs);
|
|
1452
|
-
--pf-c-badge--FontWeight: var(--pf-global--FontWeight--bold);
|
|
1453
|
-
--pf-c-badge--PaddingRight: var(--pf-global--spacer--sm);
|
|
1454
|
-
--pf-c-badge--PaddingLeft: var(--pf-global--spacer--sm);
|
|
1455
|
-
--pf-c-badge--Color: var(--pf-global--Color--dark-100);
|
|
1456
|
-
--pf-c-badge--MinWidth: var(--pf-global--spacer--xl);
|
|
1457
|
-
--pf-c-badge--m-read--BackgroundColor: var(--pf-global--BackgroundColor--200);
|
|
1458
|
-
--pf-c-badge--m-read--Color: var(--pf-global--Color--dark-100);
|
|
1459
|
-
--pf-c-badge--m-unread--BackgroundColor: var(--pf-global--primary-color--100);
|
|
1460
|
-
--pf-c-badge--m-unread--Color: var(--pf-global--Color--light-100);
|
|
1461
|
-
display: inline-block;
|
|
1462
|
-
min-width: var(--pf-c-badge--MinWidth);
|
|
1463
|
-
padding-right: var(--pf-c-badge--PaddingRight);
|
|
1464
|
-
padding-left: var(--pf-c-badge--PaddingLeft);
|
|
1465
|
-
font-size: var(--pf-c-badge--FontSize);
|
|
1466
|
-
font-weight: var(--pf-c-badge--FontWeight);
|
|
1467
|
-
color: var(--pf-c-badge--Color);
|
|
1468
|
-
text-align: center;
|
|
1469
|
-
background-color: var(--pf-c-badge--BackgroundColor);
|
|
1470
|
-
border-radius: var(--pf-c-badge--BorderRadius);
|
|
1471
|
-
}
|
|
1472
|
-
|
|
1473
|
-
.pf-c-badge.pf-m-read {
|
|
1474
|
-
--pf-c-badge--Color: var(--pf-c-badge--m-read--Color);
|
|
1475
|
-
--pf-c-badge--BackgroundColor: var(--pf-c-badge--m-read--BackgroundColor);
|
|
1476
|
-
}
|
|
1477
|
-
|
|
1478
|
-
.pf-c-badge.pf-m-unread {
|
|
1479
|
-
--pf-c-badge--Color: var(--pf-c-badge--m-unread--Color);
|
|
1480
|
-
--pf-c-badge--BackgroundColor: var(--pf-c-badge--m-unread--BackgroundColor);
|
|
1481
|
-
}
|
|
1482
|
-
|
|
1483
1483
|
.pf-c-breadcrumb {
|
|
1484
1484
|
--pf-c-breadcrumb__item--FontSize: var(--pf-global--FontSize--sm);
|
|
1485
1485
|
--pf-c-breadcrumb__item--LineHeight: var(--pf-global--LineHeight--sm);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.191.
|
|
3
|
+
"version": "4.191.2",
|
|
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",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"generate": "node scripts/copyStyles.js"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@patternfly/react-icons": "^4.42.
|
|
38
|
-
"@patternfly/react-styles": "^4.41.
|
|
39
|
-
"@patternfly/react-tokens": "^4.43.
|
|
37
|
+
"@patternfly/react-icons": "^4.42.2",
|
|
38
|
+
"@patternfly/react-styles": "^4.41.2",
|
|
39
|
+
"@patternfly/react-tokens": "^4.43.2",
|
|
40
40
|
"focus-trap": "6.2.2",
|
|
41
41
|
"react-dropzone": "9.0.0",
|
|
42
42
|
"tippy.js": "5.1.2",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"react": "^16.8.0 || ^17.0.0",
|
|
61
61
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "346e73d12c36bf0c75c1208656efc85b4ceaac9a"
|
|
64
64
|
}
|
package/src/demos/Tabs.md
CHANGED
|
@@ -444,9 +444,16 @@ TabsOpenWithSecondaryTabsDemo = () => {
|
|
|
444
444
|
```
|
|
445
445
|
|
|
446
446
|
### Nested tabs
|
|
447
|
+
|
|
447
448
|
```js isFullscreen file="./Tabs/NestedTabsDemo.js"
|
|
448
449
|
```
|
|
449
450
|
|
|
450
451
|
### Tables and tabs
|
|
452
|
+
|
|
451
453
|
```js isFullscreen file="./examples/Tabs/TabsAndTable.tsx"
|
|
452
454
|
```
|
|
455
|
+
|
|
456
|
+
### Modal tabs
|
|
457
|
+
|
|
458
|
+
```js isFullscreen file="./examples/Tabs/ModalTabs.tsx"
|
|
459
|
+
```
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import DashboardWrapper from '../DashboardWrapper';
|
|
3
|
+
import {
|
|
4
|
+
PageSection,
|
|
5
|
+
TextContent,
|
|
6
|
+
Text,
|
|
7
|
+
Gallery,
|
|
8
|
+
Card,
|
|
9
|
+
CardBody,
|
|
10
|
+
CardTitle,
|
|
11
|
+
PageSectionVariants,
|
|
12
|
+
Modal,
|
|
13
|
+
ModalVariant,
|
|
14
|
+
Tab,
|
|
15
|
+
Tabs,
|
|
16
|
+
TabTitleText,
|
|
17
|
+
List,
|
|
18
|
+
ListItem,
|
|
19
|
+
Grid,
|
|
20
|
+
GridItem,
|
|
21
|
+
TabContent
|
|
22
|
+
} from '@patternfly/react-core';
|
|
23
|
+
|
|
24
|
+
interface Product {
|
|
25
|
+
id: number;
|
|
26
|
+
name: string;
|
|
27
|
+
description: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const products: Product[] = [
|
|
31
|
+
{
|
|
32
|
+
id: 0,
|
|
33
|
+
name: 'PatternFly',
|
|
34
|
+
description: 'PatternFly is a community project that promotes design commonality and improves user experience.'
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: 1,
|
|
38
|
+
name: 'ActiveMQ',
|
|
39
|
+
description:
|
|
40
|
+
'The ActiveMQ component allows messages to be sent to a JMS Queue or Topic; or messages to be consumed from a JMS Queue or Topic using Apache ActiveMQ.'
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: 2,
|
|
44
|
+
name: 'Apache Spark',
|
|
45
|
+
description: 'This documentation page covers the Apache Spark component for the Apache Camel.'
|
|
46
|
+
}
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
export const ModalTabs: React.FunctionComponent = () => {
|
|
50
|
+
const [isModalOpen, setIsModalOpen] = React.useState(false);
|
|
51
|
+
const [selectedProduct, setSelectedProduct] = React.useState<Product>();
|
|
52
|
+
const [activeTabKey, setActiveTabKey] = React.useState<string | number>(0);
|
|
53
|
+
|
|
54
|
+
const onCardClick = React.useCallback(
|
|
55
|
+
(product: Product) => () => {
|
|
56
|
+
setSelectedProduct(product);
|
|
57
|
+
setIsModalOpen(true);
|
|
58
|
+
},
|
|
59
|
+
[]
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
const onCardKeyPress = React.useCallback(
|
|
63
|
+
(product: Product) => (event: React.KeyboardEvent<HTMLElement>) => {
|
|
64
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
65
|
+
onCardClick(product)();
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
[]
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
const closeModal = React.useCallback(() => {
|
|
72
|
+
setSelectedProduct(undefined);
|
|
73
|
+
setIsModalOpen(false);
|
|
74
|
+
setActiveTabKey(0);
|
|
75
|
+
}, []);
|
|
76
|
+
|
|
77
|
+
const onTabSelect = React.useCallback(
|
|
78
|
+
(_event: React.MouseEvent<HTMLElement, MouseEvent>, tabIndex: string | number) => setActiveTabKey(tabIndex),
|
|
79
|
+
[]
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<React.Fragment>
|
|
84
|
+
<DashboardWrapper mainContainerId="main-content-card-view-default-nav" breadcrumb={null}>
|
|
85
|
+
<PageSection variant={PageSectionVariants.light}>
|
|
86
|
+
<TextContent>
|
|
87
|
+
<Text component="h1">Projects</Text>
|
|
88
|
+
<Text component="p">Click any project card to view Tabs within Modals.</Text>
|
|
89
|
+
</TextContent>
|
|
90
|
+
</PageSection>
|
|
91
|
+
<PageSection isFilled>
|
|
92
|
+
<Gallery hasGutter>
|
|
93
|
+
{products.map(product => (
|
|
94
|
+
<Card
|
|
95
|
+
isSelectable
|
|
96
|
+
isSelectableRaised
|
|
97
|
+
isCompact
|
|
98
|
+
key={product.id}
|
|
99
|
+
onClick={onCardClick(product)}
|
|
100
|
+
onKeyPress={onCardKeyPress(product)}
|
|
101
|
+
>
|
|
102
|
+
<CardTitle>{product.name}</CardTitle>
|
|
103
|
+
<CardBody>{product.description}</CardBody>
|
|
104
|
+
</Card>
|
|
105
|
+
))}
|
|
106
|
+
</Gallery>
|
|
107
|
+
</PageSection>
|
|
108
|
+
</DashboardWrapper>
|
|
109
|
+
|
|
110
|
+
{selectedProduct && (
|
|
111
|
+
<Modal variant={ModalVariant.small} title={selectedProduct.name} isOpen={isModalOpen} onClose={closeModal}>
|
|
112
|
+
<Grid hasGutter>
|
|
113
|
+
<GridItem>
|
|
114
|
+
<Tabs activeKey={activeTabKey} onSelect={onTabSelect} isSecondary>
|
|
115
|
+
<Tab eventKey={0} tabContentId="details-tab" title={<TabTitleText>Details</TabTitleText>} />
|
|
116
|
+
<Tab eventKey={1} tabContentId="doc-tab" title={<TabTitleText>Documentation</TabTitleText>} />
|
|
117
|
+
</Tabs>
|
|
118
|
+
</GridItem>
|
|
119
|
+
<GridItem>
|
|
120
|
+
<TabContent eventKey={0} id="details-tab" hidden={activeTabKey !== 0}>
|
|
121
|
+
{selectedProduct.description}
|
|
122
|
+
</TabContent>
|
|
123
|
+
<TabContent eventKey={1} id="doc-tab" hidden={activeTabKey !== 1}>
|
|
124
|
+
<List>
|
|
125
|
+
<ListItem>
|
|
126
|
+
<a>Doc link 1</a>
|
|
127
|
+
</ListItem>
|
|
128
|
+
<ListItem>
|
|
129
|
+
<a>Doc link 2</a>
|
|
130
|
+
</ListItem>
|
|
131
|
+
<ListItem>
|
|
132
|
+
<a>Doc link 3</a>
|
|
133
|
+
</ListItem>
|
|
134
|
+
</List>
|
|
135
|
+
</TabContent>
|
|
136
|
+
</GridItem>
|
|
137
|
+
</Grid>
|
|
138
|
+
</Modal>
|
|
139
|
+
)}
|
|
140
|
+
</React.Fragment>
|
|
141
|
+
);
|
|
142
|
+
};
|