@patternfly/quickstarts 5.2.0-prerelease.1 → 5.2.0-prerelease.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/catalog/QuickStartTile.d.ts +3 -0
- package/dist/catalog/QuickStartTileHeader.d.ts +12 -0
- package/dist/catalog/index.d.ts +1 -1
- package/dist/index.es.js +12 -7
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +13 -7
- package/dist/index.js.map +1 -1
- package/dist/quickstarts-base.css +40 -40
- package/dist/quickstarts-full.es.js +27 -7
- package/dist/quickstarts-full.es.js.map +1 -1
- package/dist/quickstarts.css +40 -40
- package/dist/quickstarts.min.css +1 -1
- package/package.json +1 -1
- package/src/catalog/QuickStartTile.tsx +8 -4
- package/src/catalog/QuickStartTileHeader.tsx +29 -4
- package/src/catalog/index.ts +1 -1
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { QuickStart, QuickStartStatus } from '../utils/quick-start-types';
|
|
3
|
+
import { QuickstartAction } from './QuickStartTileHeader';
|
|
3
4
|
import './QuickStartTile.scss';
|
|
4
5
|
interface QuickStartTileProps {
|
|
5
6
|
quickStart: QuickStart;
|
|
6
7
|
status: QuickStartStatus;
|
|
7
8
|
isActive: boolean;
|
|
8
9
|
onClick?: () => void;
|
|
10
|
+
/** Action config for button rendered next to title */
|
|
11
|
+
action?: QuickstartAction;
|
|
9
12
|
}
|
|
10
13
|
declare const QuickStartTile: React.FC<QuickStartTileProps>;
|
|
11
14
|
export default QuickStartTile;
|
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
import './QuickStartTileHeader.scss';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import { ButtonProps } from '@patternfly/react-core';
|
|
3
4
|
import { QuickStartType } from '../utils/quick-start-types';
|
|
5
|
+
export interface QuickstartAction {
|
|
6
|
+
/** Screen reader aria label. */
|
|
7
|
+
'aria-label': string;
|
|
8
|
+
/** Icon to be rendered as a plain button, by default Bookmark outlined will be used. */
|
|
9
|
+
icon?: React.ComponentType<unknown>;
|
|
10
|
+
/** Callback with synthetic event parameter. */
|
|
11
|
+
onClick?: (e: React.SyntheticEvent) => void;
|
|
12
|
+
/** Additional button props to be rendered as extra props. */
|
|
13
|
+
buttonProps?: ButtonProps;
|
|
14
|
+
}
|
|
4
15
|
interface QuickStartTileHeaderProps {
|
|
5
16
|
status: string;
|
|
6
17
|
duration: number;
|
|
7
18
|
name: string;
|
|
8
19
|
type?: QuickStartType;
|
|
9
20
|
quickStartId?: string;
|
|
21
|
+
action?: QuickstartAction;
|
|
10
22
|
}
|
|
11
23
|
declare const QuickStartTileHeader: React.FC<QuickStartTileHeaderProps>;
|
|
12
24
|
export default QuickStartTileHeader;
|
package/dist/catalog/index.d.ts
CHANGED
|
@@ -4,6 +4,6 @@ export { default as QuickStartTile } from './QuickStartTile';
|
|
|
4
4
|
export { default as QuickStartTileDescription } from './QuickStartTileDescription';
|
|
5
5
|
export { default as QuickStartTileFooter } from './QuickStartTileFooter';
|
|
6
6
|
export { default as QuickStartTileFooterExternal } from './QuickStartTileFooterExternal';
|
|
7
|
-
export { default as QuickStartTileHeader } from './QuickStartTileHeader';
|
|
7
|
+
export { default as QuickStartTileHeader, QuickstartAction } from './QuickStartTileHeader';
|
|
8
8
|
export * from './Toolbar/QuickStartCatalogFilterItems';
|
|
9
9
|
export * from './Catalog';
|
package/dist/index.es.js
CHANGED
|
@@ -21,6 +21,7 @@ import '@patternfly/react-tokens/dist/esm/global_palette_blue_300';
|
|
|
21
21
|
import okColor from '@patternfly/react-tokens/dist/esm/global_palette_green_500';
|
|
22
22
|
import ExternalLinkAltIcon from '@patternfly/react-icons/dist/js/icons/external-link-alt-icon';
|
|
23
23
|
import OutlinedClockIcon from '@patternfly/react-icons/dist/js/icons/outlined-clock-icon';
|
|
24
|
+
import OutlinedBookmarkIcon from '@patternfly/react-icons/dist/js/icons/outlined-bookmark-icon';
|
|
24
25
|
import ArrowRightIcon from '@patternfly/react-icons/dist/js/icons/arrow-right-icon';
|
|
25
26
|
import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
|
|
26
27
|
|
|
@@ -1667,24 +1668,28 @@ const statusColorMap = {
|
|
|
1667
1668
|
[QuickStartStatus.IN_PROGRESS]: 'purple',
|
|
1668
1669
|
[QuickStartStatus.NOT_STARTED]: 'grey',
|
|
1669
1670
|
};
|
|
1670
|
-
const QuickStartTileHeader = ({ status, duration, name, type, quickStartId, }) => {
|
|
1671
|
+
const QuickStartTileHeader = ({ status, duration, name, type, quickStartId, action, }) => {
|
|
1671
1672
|
const { getResource } = React.useContext(QuickStartContext);
|
|
1672
1673
|
const statusLocaleMap = {
|
|
1673
1674
|
[QuickStartStatus.COMPLETE]: getResource('Complete'),
|
|
1674
1675
|
[QuickStartStatus.IN_PROGRESS]: getResource('In progress'),
|
|
1675
1676
|
[QuickStartStatus.NOT_STARTED]: getResource('Not started'),
|
|
1676
1677
|
};
|
|
1678
|
+
const ActionIcon = (action === null || action === void 0 ? void 0 : action.icon) || OutlinedBookmarkIcon;
|
|
1677
1679
|
return (React.createElement("div", { className: "pfext-quick-start-tile-header" },
|
|
1678
|
-
React.createElement(
|
|
1679
|
-
React.createElement(
|
|
1680
|
+
React.createElement(Flex, { justifyContent: { default: 'justifyContentCenter' }, flexWrap: { default: 'nowrap' } },
|
|
1681
|
+
React.createElement(Title, { headingLevel: "h3", "data-test": "title", id: quickStartId },
|
|
1682
|
+
React.createElement(QuickStartMarkdownView, { content: name })),
|
|
1683
|
+
action && React.createElement(Button, Object.assign({ "aria-label": action['aria-label'], icon: React.createElement(ActionIcon, null), variant: 'plain', onClick: action.onClick }, action.buttonProps))),
|
|
1680
1684
|
React.createElement("div", { className: "pfext-quick-start-tile-header__status" },
|
|
1681
1685
|
type && (React.createElement(Label, { className: "pfext-quick-start-tile-header--margin", color: type.color }, type.text)),
|
|
1682
1686
|
duration && (React.createElement(Label, { variant: "outline", "data-test": "duration", icon: React.createElement(OutlinedClockIcon, null), className: "pfext-quick-start-tile-header--margin" }, getResource('{{duration, number}} minutes', duration).replace('{{duration, number}}', duration))),
|
|
1683
1687
|
status !== QuickStartStatus.NOT_STARTED && (React.createElement(Label, { variant: "outline", color: statusColorMap[status], icon: React.createElement(StatusIcon, { status: status }), "data-test": "status" }, statusLocaleMap[status])))));
|
|
1684
1688
|
};
|
|
1685
1689
|
|
|
1686
|
-
const QuickStartTile = ({ quickStart, status, isActive, onClick = () => { }, }) => {
|
|
1687
|
-
const { metadata: { name
|
|
1690
|
+
const QuickStartTile = ({ quickStart, status, isActive, onClick = () => { }, action, }) => {
|
|
1691
|
+
const { metadata: { name, id: metaId }, spec: { icon, tasks, displayName, description, durationMinutes, prerequisites, link, type }, } = quickStart;
|
|
1692
|
+
const id = metaId || name;
|
|
1688
1693
|
const { setActiveQuickStart, footer } = React.useContext(QuickStartContext);
|
|
1689
1694
|
const ref = React.useRef(null);
|
|
1690
1695
|
let quickStartIcon;
|
|
@@ -1715,10 +1720,10 @@ const QuickStartTile = ({ quickStart, status, isActive, onClick = () => { }, })
|
|
|
1715
1720
|
onClick();
|
|
1716
1721
|
}
|
|
1717
1722
|
};
|
|
1718
|
-
return (React.createElement("div", { ref: ref },
|
|
1723
|
+
return (React.createElement("div", { ref: ref, onClick: handleClick },
|
|
1719
1724
|
React.createElement(CatalogTile, { id: id + '-catalog-tile', style: {
|
|
1720
1725
|
cursor: 'pointer',
|
|
1721
|
-
}, icon: quickStartIcon, className: "pfext-quick-start-tile", "data-testid": `qs-card-${camelize(displayName)}`, featured: isActive, title: React.createElement(QuickStartTileHeader, { name: displayName, status: status, duration: durationMinutes, type: type, quickStartId: id
|
|
1726
|
+
}, icon: quickStartIcon, className: "pfext-quick-start-tile", "data-testid": `qs-card-${camelize(displayName)}`, featured: isActive, title: React.createElement(QuickStartTileHeader, { name: displayName, status: status, duration: durationMinutes, type: type, quickStartId: id, action: action }), onKeyDown: (event) => {
|
|
1722
1727
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
1723
1728
|
setActiveQuickStart(id, tasks === null || tasks === void 0 ? void 0 : tasks.length);
|
|
1724
1729
|
onClick();
|