@patternfly/quickstarts 2.3.1 → 2.3.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/dist/ConsoleShared/src/components/status/NotStartedIcon.d.ts +0 -1
- package/dist/index.es.js +145 -123
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +145 -123
- package/dist/index.js.map +1 -1
- package/dist/patternfly-global.css +890 -419
- package/dist/patternfly-nested.css +12276 -7322
- package/dist/quickstarts-base.css +866 -667
- package/dist/quickstarts-full.es.js +3915 -2179
- package/dist/quickstarts-full.es.js.map +1 -1
- package/dist/quickstarts-standalone.css +848 -622
- package/dist/quickstarts-standalone.min.css +2 -2
- package/dist/quickstarts-vendor.css +84 -55
- package/dist/quickstarts.css +949 -722
- package/dist/quickstarts.min.css +1 -1
- package/dist/utils/quick-start-context.d.ts +1 -1
- package/dist/utils/quick-start-types.d.ts +0 -1
- package/package.json +10 -10
- package/src/ConsoleInternal/components/catalog/_catalog.scss +7 -5
- package/src/ConsoleShared/src/components/markdown-extensions/admonition-extension.tsx +3 -2
- package/src/QuickStartPanelContent.tsx +15 -2
- package/src/catalog/QuickStartTile.tsx +7 -0
- package/src/catalog/QuickStartTileHeader.tsx +2 -1
- package/src/controller/QuickStartTaskHeader.tsx +8 -1
- package/src/styles/legacy-bootstrap/_code.scss +4 -2
- package/src/styles/legacy-bootstrap/_type.scss +8 -6
- package/src/styles/patternfly-nested.scss +9 -9
- package/src/utils/quick-start-context.tsx +2 -2
package/dist/index.js
CHANGED
|
@@ -13,6 +13,7 @@ var server = require('react-dom/server');
|
|
|
13
13
|
var CopyIcon = require('@patternfly/react-icons/dist/js/icons/copy-icon');
|
|
14
14
|
var LightbulbIcon = require('@patternfly/react-icons/dist/js/icons/lightbulb-icon');
|
|
15
15
|
var FireIcon = require('@patternfly/react-icons/dist/js/icons/fire-icon');
|
|
16
|
+
var showdown = require('showdown');
|
|
16
17
|
var SyncAltIcon = require('@patternfly/react-icons/dist/js/icons/sync-alt-icon');
|
|
17
18
|
var CheckCircleIcon = require('@patternfly/react-icons/dist/js/icons/check-circle-icon');
|
|
18
19
|
var ExclamationCircleIcon = require('@patternfly/react-icons/dist/js/icons/exclamation-circle-icon');
|
|
@@ -20,7 +21,6 @@ var InfoCircleIcon = require('@patternfly/react-icons/dist/js/icons/info-circle-
|
|
|
20
21
|
require('@patternfly/react-tokens/dist/js/global_danger_color_100');
|
|
21
22
|
require('@patternfly/react-tokens/dist/js/global_palette_blue_300');
|
|
22
23
|
var global_palette_green_500 = require('@patternfly/react-tokens/dist/js/global_palette_green_500');
|
|
23
|
-
var showdown = require('showdown');
|
|
24
24
|
var ExternalLinkAltIcon = require('@patternfly/react-icons/dist/js/icons/external-link-alt-icon');
|
|
25
25
|
var OutlinedClockIcon = require('@patternfly/react-icons/dist/js/icons/outlined-clock-icon');
|
|
26
26
|
var ArrowRightIcon = require('@patternfly/react-icons/dist/js/icons/arrow-right-icon');
|
|
@@ -614,7 +614,7 @@ const QuickStartContextDefaults = {
|
|
|
614
614
|
activeQuickStartState: {},
|
|
615
615
|
setAllQuickStarts: () => { },
|
|
616
616
|
resourceBundle: en,
|
|
617
|
-
getResource: () =>
|
|
617
|
+
getResource: (resource) => resource,
|
|
618
618
|
language: 'en',
|
|
619
619
|
useQueryParams: true,
|
|
620
620
|
filter: {
|
|
@@ -640,7 +640,7 @@ const getResource = (resource, options, resourceBundle, lng) => {
|
|
|
640
640
|
return resourceBundle[`${resource}_${suffix}`];
|
|
641
641
|
}
|
|
642
642
|
}
|
|
643
|
-
return (resourceBundle && resourceBundle[resource]) ||
|
|
643
|
+
return (resourceBundle && resourceBundle[resource]) || resource;
|
|
644
644
|
};
|
|
645
645
|
const useValuesForQuickStartContext = (value = {}) => {
|
|
646
646
|
var _a, _b;
|
|
@@ -914,7 +914,7 @@ class CatalogTile extends React__namespace.Component {
|
|
|
914
914
|
const _a = this.props, { id, className, featured, onClick, href, icon, iconImg, iconAlt, iconClass, badges, title, vendor, description, footer,
|
|
915
915
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
916
916
|
ref, children } = _a, props = tslib.__rest(_a, ["id", "className", "featured", "onClick", "href", "icon", "iconImg", "iconAlt", "iconClass", "badges", "title", "vendor", "description", "footer", "ref", "children"]);
|
|
917
|
-
return (React__namespace.createElement(reactCore.Card, Object.assign({ component: href || onClick ? 'a' : 'div', id: id, href: href || '#', className: reactStyles.css('catalog-tile-pf', { featured }, className), onClick: e => this.handleClick(e),
|
|
917
|
+
return (React__namespace.createElement(reactCore.Card, Object.assign({ component: href || onClick ? 'a' : 'div', id: id, href: href || '#', className: reactStyles.css('catalog-tile-pf', { featured }, className), onClick: e => this.handleClick(e), isSelectable: true }, props),
|
|
918
918
|
(badges.length > 0 || iconImg || iconClass || icon) && (React__namespace.createElement(reactCore.CardHeader, null,
|
|
919
919
|
iconImg && React__namespace.createElement("img", { className: "catalog-tile-pf-icon", src: iconImg, alt: iconAlt }),
|
|
920
920
|
!iconImg && (iconClass || icon) && React__namespace.createElement("span", { className: `catalog-tile-pf-icon ${iconClass}` }, icon),
|
|
@@ -1325,118 +1325,6 @@ const useMultilineCopyClipboardShowdownExtension = () => {
|
|
|
1325
1325
|
}), [getResource]);
|
|
1326
1326
|
};
|
|
1327
1327
|
|
|
1328
|
-
var AdmonitionType;
|
|
1329
|
-
(function (AdmonitionType) {
|
|
1330
|
-
AdmonitionType["TIP"] = "TIP";
|
|
1331
|
-
AdmonitionType["NOTE"] = "NOTE";
|
|
1332
|
-
AdmonitionType["IMPORTANT"] = "IMPORTANT";
|
|
1333
|
-
AdmonitionType["WARNING"] = "WARNING";
|
|
1334
|
-
AdmonitionType["CAUTION"] = "CAUTION";
|
|
1335
|
-
})(AdmonitionType || (AdmonitionType = {}));
|
|
1336
|
-
const admonitionToAlertVariantMap = {
|
|
1337
|
-
[AdmonitionType.NOTE]: { variant: 'info' },
|
|
1338
|
-
[AdmonitionType.TIP]: { variant: 'default', customIcon: React__namespace.createElement(LightbulbIcon__default['default'], null) },
|
|
1339
|
-
[AdmonitionType.IMPORTANT]: { variant: 'danger' },
|
|
1340
|
-
[AdmonitionType.CAUTION]: { variant: 'warning', customIcon: React__namespace.createElement(FireIcon__default['default'], null) },
|
|
1341
|
-
[AdmonitionType.WARNING]: { variant: 'warning' },
|
|
1342
|
-
};
|
|
1343
|
-
const useAdmonitionShowdownExtension = () => {
|
|
1344
|
-
// const { getResource } = React.useContext<QuickStartContextValues>(QuickStartContext);
|
|
1345
|
-
return React__namespace.useMemo(() => ({
|
|
1346
|
-
type: 'lang',
|
|
1347
|
-
regex: /\[(.+)]{{(admonition) ([\w-]+)}}/g,
|
|
1348
|
-
replace: (text, content, admonitionLabel, admonitionType, groupId) => {
|
|
1349
|
-
if (!content || !admonitionLabel || !admonitionType || !groupId) {
|
|
1350
|
-
return text;
|
|
1351
|
-
}
|
|
1352
|
-
admonitionType = admonitionType.toUpperCase();
|
|
1353
|
-
const { variant, customIcon } = admonitionToAlertVariantMap[admonitionType];
|
|
1354
|
-
const style = admonitionType === AdmonitionType.CAUTION ? { backgroundColor: '#ec7a0915' } : {};
|
|
1355
|
-
const pfAlert = (React__namespace.createElement(reactCore.Alert, { variant: variant, customIcon: customIcon && customIcon, isInline: true, title: admonitionType, className: "pfext-markdown-admonition", style: style }, content));
|
|
1356
|
-
return removeTemplateWhitespace(server.renderToStaticMarkup(pfAlert));
|
|
1357
|
-
},
|
|
1358
|
-
}), []);
|
|
1359
|
-
};
|
|
1360
|
-
|
|
1361
|
-
const useCodeShowdownExtension = () => {
|
|
1362
|
-
return React__namespace.useMemo(() => ({
|
|
1363
|
-
type: 'output',
|
|
1364
|
-
regex: /<pre><code>(.*?)\n?<\/code><\/pre>/g,
|
|
1365
|
-
replace: (text, content) => {
|
|
1366
|
-
if (!content) {
|
|
1367
|
-
return text;
|
|
1368
|
-
}
|
|
1369
|
-
const pfCodeBlock = React__namespace.createElement(reactCore.CodeBlock, null, content);
|
|
1370
|
-
return removeTemplateWhitespace(server.renderToStaticMarkup(pfCodeBlock));
|
|
1371
|
-
},
|
|
1372
|
-
}), []);
|
|
1373
|
-
};
|
|
1374
|
-
|
|
1375
|
-
const FallbackImg = ({ src, alt, className, fallback }) => {
|
|
1376
|
-
const [isSrcValid, setIsSrcValid] = React__namespace.useState(true);
|
|
1377
|
-
if (src && isSrcValid) {
|
|
1378
|
-
return React__namespace.createElement("img", { className: className, src: src, alt: alt, onError: () => setIsSrcValid(false) });
|
|
1379
|
-
}
|
|
1380
|
-
return React__namespace.createElement(React__namespace.Fragment, null, fallback);
|
|
1381
|
-
};
|
|
1382
|
-
|
|
1383
|
-
const DASH = '-';
|
|
1384
|
-
|
|
1385
|
-
const PopoverStatus = ({ hideHeader, children, isVisible = null, shouldClose = null, statusBody, title, onHide, onShow, }) => {
|
|
1386
|
-
return (React__namespace.createElement(reactCore.Popover, { position: reactCore.PopoverPosition.right, headerContent: hideHeader ? null : title, bodyContent: children, "aria-label": title, onHide: onHide, onShow: onShow, isVisible: isVisible, shouldClose: shouldClose },
|
|
1387
|
-
React__namespace.createElement(reactCore.Button, { variant: "link", isInline: true }, statusBody)));
|
|
1388
|
-
};
|
|
1389
|
-
|
|
1390
|
-
const StatusIconAndText = ({ icon, title, spin, iconOnly, noTooltip, className, }) => {
|
|
1391
|
-
if (!title) {
|
|
1392
|
-
return React__namespace.createElement(React__namespace.Fragment, null, DASH);
|
|
1393
|
-
}
|
|
1394
|
-
return (React__namespace.createElement("span", { className: reactStyles.css('pfext-icon-and-text', className), title: iconOnly && !noTooltip ? title : undefined },
|
|
1395
|
-
icon &&
|
|
1396
|
-
React__namespace.cloneElement(icon, {
|
|
1397
|
-
className: reactStyles.css(spin && 'fa-spin', icon.props.className, !iconOnly && 'pfext-icon-and-text__icon pfext-icon-flex-child'),
|
|
1398
|
-
}),
|
|
1399
|
-
!iconOnly && React__namespace.createElement(CamelCaseWrap, { value: title, dataTest: "status-text" })));
|
|
1400
|
-
};
|
|
1401
|
-
|
|
1402
|
-
const GenericStatus = (props) => {
|
|
1403
|
-
const { Icon, children, popoverTitle, title, noTooltip, iconOnly } = props, restProps = tslib.__rest(props, ["Icon", "children", "popoverTitle", "title", "noTooltip", "iconOnly"]);
|
|
1404
|
-
const renderIcon = iconOnly && !noTooltip ? React__namespace.createElement(Icon, { title: title }) : React__namespace.createElement(Icon, null);
|
|
1405
|
-
const statusBody = (React__namespace.createElement(StatusIconAndText, Object.assign({}, restProps, { noTooltip: noTooltip, title: title, iconOnly: iconOnly, icon: renderIcon })));
|
|
1406
|
-
return React__namespace.Children.toArray(children).length ? (React__namespace.createElement(PopoverStatus, Object.assign({ title: popoverTitle || title }, restProps, { statusBody: statusBody }), children)) : (statusBody);
|
|
1407
|
-
};
|
|
1408
|
-
|
|
1409
|
-
// import { global_warning_color_100 as warningColor } from '@patternfly/react-tokens/dist/js/global_warning_color_100';
|
|
1410
|
-
const GreenCheckCircleIcon = ({ className, title, size }) => (React__namespace.createElement(CheckCircleIcon__default['default'], { "data-test": "success-icon", size: size, color: global_palette_green_500.global_palette_green_500.value, className: className, title: title }));
|
|
1411
|
-
|
|
1412
|
-
// export const PendingStatus: React.FC<StatusComponentProps> = (props) => (
|
|
1413
|
-
// <GenericStatus {...props} Icon={HourglassHalfIcon} title={props.title || 'Pending'} />
|
|
1414
|
-
// );
|
|
1415
|
-
// PendingStatus.displayName = 'PendingStatus';
|
|
1416
|
-
// export const ProgressStatus: React.FC<StatusComponentProps> = (props) => (
|
|
1417
|
-
// <GenericStatus {...props} Icon={InProgressIcon} title={props.title || 'In progress'} />
|
|
1418
|
-
// );
|
|
1419
|
-
// ProgressStatus.displayName = 'ProgressStatus';
|
|
1420
|
-
const SuccessStatus = (props) => (React__namespace.createElement(GenericStatus, Object.assign({}, props, { Icon: GreenCheckCircleIcon, title: props.title || 'Healthy' })));
|
|
1421
|
-
SuccessStatus.displayName = 'SuccessStatus';
|
|
1422
|
-
// export const WarningStatus: React.FC<StatusComponentProps> = (props) => (
|
|
1423
|
-
// <GenericStatus {...props} Icon={YellowExclamationTriangleIcon} title={props.title || 'Warning'} />
|
|
1424
|
-
// );
|
|
1425
|
-
// WarningStatus.displayName = 'WarningStatus';
|
|
1426
|
-
|
|
1427
|
-
const Status = ({ status, title, iconOnly, noTooltip, className, }) => {
|
|
1428
|
-
const statusProps = { title: title || status, iconOnly, noTooltip, className };
|
|
1429
|
-
switch (status) {
|
|
1430
|
-
case 'In Progress':
|
|
1431
|
-
return React__namespace.createElement(StatusIconAndText, Object.assign({}, statusProps, { icon: React__namespace.createElement(SyncAltIcon__default['default'], null) }));
|
|
1432
|
-
case 'Complete':
|
|
1433
|
-
return React__namespace.createElement(SuccessStatus, Object.assign({}, statusProps));
|
|
1434
|
-
default:
|
|
1435
|
-
return React__namespace.createElement(React__namespace.Fragment, null, status || DASH);
|
|
1436
|
-
}
|
|
1437
|
-
};
|
|
1438
|
-
const StatusIcon = ({ status }) => (React__namespace.createElement(Status, { status: status, iconOnly: true }));
|
|
1439
|
-
|
|
1440
1328
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
1441
1329
|
const DOMPurify = require('dompurify');
|
|
1442
1330
|
const markdownConvert = (markdown, extensions) => {
|
|
@@ -1645,6 +1533,119 @@ const QuickStartMarkdownView = ({ content, exactHeight, className, }) => {
|
|
|
1645
1533
|
markdown.renderExtension(docContext, rootSelector))), className: className }));
|
|
1646
1534
|
};
|
|
1647
1535
|
|
|
1536
|
+
var AdmonitionType;
|
|
1537
|
+
(function (AdmonitionType) {
|
|
1538
|
+
AdmonitionType["TIP"] = "TIP";
|
|
1539
|
+
AdmonitionType["NOTE"] = "NOTE";
|
|
1540
|
+
AdmonitionType["IMPORTANT"] = "IMPORTANT";
|
|
1541
|
+
AdmonitionType["WARNING"] = "WARNING";
|
|
1542
|
+
AdmonitionType["CAUTION"] = "CAUTION";
|
|
1543
|
+
})(AdmonitionType || (AdmonitionType = {}));
|
|
1544
|
+
const admonitionToAlertVariantMap = {
|
|
1545
|
+
[AdmonitionType.NOTE]: { variant: 'info' },
|
|
1546
|
+
[AdmonitionType.TIP]: { variant: 'default', customIcon: React__namespace.createElement(LightbulbIcon__default['default'], null) },
|
|
1547
|
+
[AdmonitionType.IMPORTANT]: { variant: 'danger' },
|
|
1548
|
+
[AdmonitionType.CAUTION]: { variant: 'warning', customIcon: React__namespace.createElement(FireIcon__default['default'], null) },
|
|
1549
|
+
[AdmonitionType.WARNING]: { variant: 'warning' },
|
|
1550
|
+
};
|
|
1551
|
+
const useAdmonitionShowdownExtension = () => {
|
|
1552
|
+
// const { getResource } = React.useContext<QuickStartContextValues>(QuickStartContext);
|
|
1553
|
+
return React__namespace.useMemo(() => ({
|
|
1554
|
+
type: 'lang',
|
|
1555
|
+
regex: /\[(.+)]{{(admonition) ([\w-]+)}}/g,
|
|
1556
|
+
replace: (text, content, admonitionLabel, admonitionType, groupId) => {
|
|
1557
|
+
if (!content || !admonitionLabel || !admonitionType || !groupId) {
|
|
1558
|
+
return text;
|
|
1559
|
+
}
|
|
1560
|
+
admonitionType = admonitionType.toUpperCase();
|
|
1561
|
+
const { variant, customIcon } = admonitionToAlertVariantMap[admonitionType];
|
|
1562
|
+
const style = admonitionType === AdmonitionType.CAUTION ? { backgroundColor: '#ec7a0915' } : {};
|
|
1563
|
+
const mdContent = React__namespace.createElement(QuickStartMarkdownView, { content: content });
|
|
1564
|
+
const pfAlert = (React__namespace.createElement(reactCore.Alert, { variant: variant, customIcon: customIcon && customIcon, isInline: true, title: admonitionType, className: "pfext-markdown-admonition", style: style }, mdContent));
|
|
1565
|
+
return removeTemplateWhitespace(server.renderToStaticMarkup(pfAlert));
|
|
1566
|
+
},
|
|
1567
|
+
}), []);
|
|
1568
|
+
};
|
|
1569
|
+
|
|
1570
|
+
const useCodeShowdownExtension = () => {
|
|
1571
|
+
return React__namespace.useMemo(() => ({
|
|
1572
|
+
type: 'output',
|
|
1573
|
+
regex: /<pre><code>(.*?)\n?<\/code><\/pre>/g,
|
|
1574
|
+
replace: (text, content) => {
|
|
1575
|
+
if (!content) {
|
|
1576
|
+
return text;
|
|
1577
|
+
}
|
|
1578
|
+
const pfCodeBlock = React__namespace.createElement(reactCore.CodeBlock, null, content);
|
|
1579
|
+
return removeTemplateWhitespace(server.renderToStaticMarkup(pfCodeBlock));
|
|
1580
|
+
},
|
|
1581
|
+
}), []);
|
|
1582
|
+
};
|
|
1583
|
+
|
|
1584
|
+
const FallbackImg = ({ src, alt, className, fallback }) => {
|
|
1585
|
+
const [isSrcValid, setIsSrcValid] = React__namespace.useState(true);
|
|
1586
|
+
if (src && isSrcValid) {
|
|
1587
|
+
return React__namespace.createElement("img", { className: className, src: src, alt: alt, onError: () => setIsSrcValid(false) });
|
|
1588
|
+
}
|
|
1589
|
+
return React__namespace.createElement(React__namespace.Fragment, null, fallback);
|
|
1590
|
+
};
|
|
1591
|
+
|
|
1592
|
+
const DASH = '-';
|
|
1593
|
+
|
|
1594
|
+
const PopoverStatus = ({ hideHeader, children, isVisible = null, shouldClose = null, statusBody, title, onHide, onShow, }) => {
|
|
1595
|
+
return (React__namespace.createElement(reactCore.Popover, { position: reactCore.PopoverPosition.right, headerContent: hideHeader ? null : title, bodyContent: children, "aria-label": title, onHide: onHide, onShow: onShow, isVisible: isVisible, shouldClose: shouldClose },
|
|
1596
|
+
React__namespace.createElement(reactCore.Button, { variant: "link", isInline: true }, statusBody)));
|
|
1597
|
+
};
|
|
1598
|
+
|
|
1599
|
+
const StatusIconAndText = ({ icon, title, spin, iconOnly, noTooltip, className, }) => {
|
|
1600
|
+
if (!title) {
|
|
1601
|
+
return React__namespace.createElement(React__namespace.Fragment, null, DASH);
|
|
1602
|
+
}
|
|
1603
|
+
return (React__namespace.createElement("span", { className: reactStyles.css('pfext-icon-and-text', className), title: iconOnly && !noTooltip ? title : undefined },
|
|
1604
|
+
icon &&
|
|
1605
|
+
React__namespace.cloneElement(icon, {
|
|
1606
|
+
className: reactStyles.css(spin && 'fa-spin', icon.props.className, !iconOnly && 'pfext-icon-and-text__icon pfext-icon-flex-child'),
|
|
1607
|
+
}),
|
|
1608
|
+
!iconOnly && React__namespace.createElement(CamelCaseWrap, { value: title, dataTest: "status-text" })));
|
|
1609
|
+
};
|
|
1610
|
+
|
|
1611
|
+
const GenericStatus = (props) => {
|
|
1612
|
+
const { Icon, children, popoverTitle, title, noTooltip, iconOnly } = props, restProps = tslib.__rest(props, ["Icon", "children", "popoverTitle", "title", "noTooltip", "iconOnly"]);
|
|
1613
|
+
const renderIcon = iconOnly && !noTooltip ? React__namespace.createElement(Icon, { title: title }) : React__namespace.createElement(Icon, null);
|
|
1614
|
+
const statusBody = (React__namespace.createElement(StatusIconAndText, Object.assign({}, restProps, { noTooltip: noTooltip, title: title, iconOnly: iconOnly, icon: renderIcon })));
|
|
1615
|
+
return React__namespace.Children.toArray(children).length ? (React__namespace.createElement(PopoverStatus, Object.assign({ title: popoverTitle || title }, restProps, { statusBody: statusBody }), children)) : (statusBody);
|
|
1616
|
+
};
|
|
1617
|
+
|
|
1618
|
+
// import { global_warning_color_100 as warningColor } from '@patternfly/react-tokens/dist/js/global_warning_color_100';
|
|
1619
|
+
const GreenCheckCircleIcon = ({ className, title, size }) => (React__namespace.createElement(CheckCircleIcon__default['default'], { "data-test": "success-icon", size: size, color: global_palette_green_500.global_palette_green_500.value, className: className, title: title }));
|
|
1620
|
+
|
|
1621
|
+
// export const PendingStatus: React.FC<StatusComponentProps> = (props) => (
|
|
1622
|
+
// <GenericStatus {...props} Icon={HourglassHalfIcon} title={props.title || 'Pending'} />
|
|
1623
|
+
// );
|
|
1624
|
+
// PendingStatus.displayName = 'PendingStatus';
|
|
1625
|
+
// export const ProgressStatus: React.FC<StatusComponentProps> = (props) => (
|
|
1626
|
+
// <GenericStatus {...props} Icon={InProgressIcon} title={props.title || 'In progress'} />
|
|
1627
|
+
// );
|
|
1628
|
+
// ProgressStatus.displayName = 'ProgressStatus';
|
|
1629
|
+
const SuccessStatus = (props) => (React__namespace.createElement(GenericStatus, Object.assign({}, props, { Icon: GreenCheckCircleIcon, title: props.title || 'Healthy' })));
|
|
1630
|
+
SuccessStatus.displayName = 'SuccessStatus';
|
|
1631
|
+
// export const WarningStatus: React.FC<StatusComponentProps> = (props) => (
|
|
1632
|
+
// <GenericStatus {...props} Icon={YellowExclamationTriangleIcon} title={props.title || 'Warning'} />
|
|
1633
|
+
// );
|
|
1634
|
+
// WarningStatus.displayName = 'WarningStatus';
|
|
1635
|
+
|
|
1636
|
+
const Status = ({ status, title, iconOnly, noTooltip, className, }) => {
|
|
1637
|
+
const statusProps = { title: title || status, iconOnly, noTooltip, className };
|
|
1638
|
+
switch (status) {
|
|
1639
|
+
case 'In Progress':
|
|
1640
|
+
return React__namespace.createElement(StatusIconAndText, Object.assign({}, statusProps, { icon: React__namespace.createElement(SyncAltIcon__default['default'], null) }));
|
|
1641
|
+
case 'Complete':
|
|
1642
|
+
return React__namespace.createElement(SuccessStatus, Object.assign({}, statusProps));
|
|
1643
|
+
default:
|
|
1644
|
+
return React__namespace.createElement(React__namespace.Fragment, null, status || DASH);
|
|
1645
|
+
}
|
|
1646
|
+
};
|
|
1647
|
+
const StatusIcon = ({ status }) => (React__namespace.createElement(Status, { status: status, iconOnly: true }));
|
|
1648
|
+
|
|
1648
1649
|
const QuickStartTileDescription = ({ description, prerequisites, }) => {
|
|
1649
1650
|
const { getResource } = React__namespace.useContext(QuickStartContext);
|
|
1650
1651
|
const prereqs = prerequisites === null || prerequisites === void 0 ? void 0 : prerequisites.filter((p) => p);
|
|
@@ -1710,7 +1711,8 @@ const QuickStartTileHeader = ({ status, duration, name, type, quickStartId, }) =
|
|
|
1710
1711
|
[exports.QuickStartStatus.NOT_STARTED]: getResource('Not started'),
|
|
1711
1712
|
};
|
|
1712
1713
|
return (React__namespace.createElement("div", { className: "pfext-quick-start-tile-header" },
|
|
1713
|
-
React__namespace.createElement(reactCore.Title, { headingLevel: "h3", "data-test": "title", id: quickStartId },
|
|
1714
|
+
React__namespace.createElement(reactCore.Title, { headingLevel: "h3", "data-test": "title", id: quickStartId },
|
|
1715
|
+
React__namespace.createElement(QuickStartMarkdownView, { content: name })),
|
|
1714
1716
|
React__namespace.createElement("div", { className: "pfext-quick-start-tile-header__status" },
|
|
1715
1717
|
type && (React__namespace.createElement(reactCore.Label, { className: "pfext-quick-start-tile-header--margin", color: type.color }, type.text)),
|
|
1716
1718
|
duration && (React__namespace.createElement(reactCore.Label, { variant: "outline", "data-test": "duration", icon: React__namespace.createElement(OutlinedClockIcon__default['default'], null), className: "pfext-quick-start-tile-header--margin" }, getResource('{{duration, number}} minutes', duration).replace('{{duration, number}}', duration))),
|
|
@@ -1748,9 +1750,14 @@ const QuickStartTile = ({ quickStart, status, isActive, onClick = () => { }, })
|
|
|
1748
1750
|
// @ts-ignore
|
|
1749
1751
|
component: "div", style: {
|
|
1750
1752
|
cursor: 'pointer',
|
|
1751
|
-
}, icon: quickStartIcon, className: "pfext-quick-start-tile", "data-testid": `qs-card-${camelize(displayName)}`, featured: isActive, title: React__namespace.createElement(QuickStartTileHeader, { name: displayName, status: status, duration: durationMinutes, type: type, quickStartId: id }), onClick: handleClick,
|
|
1753
|
+
}, icon: quickStartIcon, className: "pfext-quick-start-tile", "data-testid": `qs-card-${camelize(displayName)}`, featured: isActive, title: React__namespace.createElement(QuickStartTileHeader, { name: displayName, status: status, duration: durationMinutes, type: type, quickStartId: id }), onClick: handleClick, onKeyDown: (event) => {
|
|
1754
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
1755
|
+
setActiveQuickStart(id, tasks === null || tasks === void 0 ? void 0 : tasks.length);
|
|
1756
|
+
onClick();
|
|
1757
|
+
}
|
|
1758
|
+
},
|
|
1752
1759
|
// https://github.com/patternfly/patternfly-react/issues/7039
|
|
1753
|
-
href: "#", "data-test": `tile ${id}`, description: React__namespace.createElement(QuickStartTileDescription, { description: description, prerequisites: prerequisites }), footer: footerComponent })));
|
|
1760
|
+
href: "#", "data-test": `tile ${id}`, description: React__namespace.createElement(QuickStartTileDescription, { description: description, prerequisites: prerequisites }), footer: footerComponent, tabIndex: 0 })));
|
|
1754
1761
|
};
|
|
1755
1762
|
|
|
1756
1763
|
const QuickStartCatalog = ({ quickStarts }) => {
|
|
@@ -1993,6 +2000,13 @@ const TaskIcon = ({ taskIndex, taskStatus }) => {
|
|
|
1993
2000
|
return React__namespace.createElement("span", { className: classNames }, content);
|
|
1994
2001
|
};
|
|
1995
2002
|
const QuickStartTaskHeader = ({ title, taskIndex, subtitle, taskStatus, size, isActiveTask, onTaskSelect, children, }) => {
|
|
2003
|
+
const titleRef = React__namespace.useRef(null);
|
|
2004
|
+
React__namespace.useEffect(() => {
|
|
2005
|
+
if (isActiveTask) {
|
|
2006
|
+
// Focus the WizardNavItem button element that contains the title
|
|
2007
|
+
titleRef.current.parentNode.focus();
|
|
2008
|
+
}
|
|
2009
|
+
}, [isActiveTask]);
|
|
1996
2010
|
const classNames = reactStyles.css('pfext-quick-start-task-header__title', {
|
|
1997
2011
|
'pfext-quick-start-task-header__title-success': taskStatus === exports.QuickStartTaskStatus.SUCCESS,
|
|
1998
2012
|
'pfext-quick-start-task-header__title-failed': taskStatus === (exports.QuickStartTaskStatus.FAILED || exports.QuickStartTaskStatus.VISITED),
|
|
@@ -2005,7 +2019,7 @@ const QuickStartTaskHeader = ({ title, taskIndex, subtitle, taskStatus, size, is
|
|
|
2005
2019
|
const tryAgain = failedReview && (React__namespace.createElement(React__namespace.Fragment, null,
|
|
2006
2020
|
React__namespace.createElement("div", null),
|
|
2007
2021
|
React__namespace.createElement("div", { className: "pfext-quick-start-task-header__tryagain" }, "Try the steps again.")));
|
|
2008
|
-
const content = (React__namespace.createElement("div", { className: "pfext-quick-start-task-header" },
|
|
2022
|
+
const content = (React__namespace.createElement("div", { className: "pfext-quick-start-task-header", ref: titleRef },
|
|
2009
2023
|
React__namespace.createElement(TaskIcon, { taskIndex: taskIndex, taskStatus: taskStatus }),
|
|
2010
2024
|
React__namespace.createElement(reactCore.Title, { headingLevel: "h3", size: size, className: classNames },
|
|
2011
2025
|
React__namespace.createElement("span", { dangerouslySetInnerHTML: { __html: removeParagraphWrap(markdownConvert(title)) } }),
|
|
@@ -2212,6 +2226,7 @@ const useScrollTopOnTaskNumberChange = (node, taskNumber) => {
|
|
|
2212
2226
|
};
|
|
2213
2227
|
const QuickStartPanelContent = (_a) => {
|
|
2214
2228
|
var { quickStarts = [], handleClose, activeQuickStartID, appendTo, isResizable = true, showClose = true, headerVariant = '' } = _a, props = tslib.__rest(_a, ["quickStarts", "handleClose", "activeQuickStartID", "appendTo", "isResizable", "showClose", "headerVariant"]);
|
|
2229
|
+
const titleRef = React__namespace.useRef(null);
|
|
2215
2230
|
const { getResource, activeQuickStartState } = React__namespace.useContext(QuickStartContext);
|
|
2216
2231
|
const [contentRef, setContentRef] = React__namespace.useState();
|
|
2217
2232
|
const shadows = useScrollShadows(contentRef);
|
|
@@ -2236,12 +2251,19 @@ const QuickStartPanelContent = (_a) => {
|
|
|
2236
2251
|
}
|
|
2237
2252
|
return Number.parseInt(taskNumber, 10) + 1;
|
|
2238
2253
|
};
|
|
2254
|
+
React__namespace.useEffect(() => {
|
|
2255
|
+
if (quickStart) {
|
|
2256
|
+
titleRef.current.focus();
|
|
2257
|
+
}
|
|
2258
|
+
}, [quickStart]);
|
|
2239
2259
|
const content = quickStart ? (React__namespace.createElement(reactCore.DrawerPanelContent, Object.assign({ isResizable: isResizable, className: "pfext-quick-start__base", "data-testid": `qs-drawer-${camelize(quickStart.spec.displayName)}`, "data-qs": `qs-step-${getStep()}`, "data-test": "quickstart drawer" }, props),
|
|
2240
2260
|
React__namespace.createElement("div", { className: headerClasses },
|
|
2241
2261
|
React__namespace.createElement(reactCore.DrawerHead, null,
|
|
2242
|
-
React__namespace.createElement("div", { className: "pfext-quick-start-panel-content__title" },
|
|
2243
|
-
React__namespace.createElement(reactCore.Title, { headingLevel: "h1", size: "xl", className: "pfext-quick-start-panel-content__name", style: { marginRight: 'var(--pf-global--spacer--md)' } },
|
|
2244
|
-
|
|
2262
|
+
React__namespace.createElement("div", { className: "pfext-quick-start-panel-content__title", tabIndex: -1, ref: titleRef },
|
|
2263
|
+
React__namespace.createElement(reactCore.Title, { headingLevel: "h1", size: "xl", className: "pfext-quick-start-panel-content__name", style: { marginRight: 'var(--pf-global--spacer--md)' } },
|
|
2264
|
+
React__namespace.createElement("span", { dangerouslySetInnerHTML: {
|
|
2265
|
+
__html: removeParagraphWrap(markdownConvert(quickStart === null || quickStart === void 0 ? void 0 : quickStart.spec.displayName)),
|
|
2266
|
+
} }),
|
|
2245
2267
|
' ',
|
|
2246
2268
|
React__namespace.createElement("small", { className: "pfext-quick-start-panel-content__duration" }, (quickStart === null || quickStart === void 0 ? void 0 : quickStart.spec.durationMinutes) ? getResource('{{type}} • {{duration, number}} minutes', quickStart === null || quickStart === void 0 ? void 0 : quickStart.spec.durationMinutes)
|
|
2247
2269
|
.replace('{{duration, number}}', quickStart === null || quickStart === void 0 ? void 0 : quickStart.spec.durationMinutes)
|