@pega/cosmos-react-work 10.0.0-build.4.27 → 10.0.0-build.4.28
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/lib/components/Shortcuts/Shortcuts.d.ts +1 -1
- package/lib/components/Shortcuts/Shortcuts.d.ts.map +1 -1
- package/lib/components/Shortcuts/Shortcuts.js +9 -4
- package/lib/components/Shortcuts/Shortcuts.js.map +1 -1
- package/lib/components/Shortcuts/Shortcuts.test-ids.d.ts +1 -1
- package/lib/components/Shortcuts/Shortcuts.test-ids.d.ts.map +1 -1
- package/lib/components/Shortcuts/Shortcuts.test-ids.js +4 -3
- package/lib/components/Shortcuts/Shortcuts.test-ids.js.map +1 -1
- package/lib/components/Shortcuts/Shortcuts.types.d.ts +10 -0
- package/lib/components/Shortcuts/Shortcuts.types.d.ts.map +1 -1
- package/lib/components/Shortcuts/Shortcuts.types.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PropsWithoutRef } from 'react';
|
|
2
2
|
import type { ShortcutsProps } from './Shortcuts.types';
|
|
3
3
|
declare const _default: import("react").ForwardRefExoticComponent<PropsWithoutRef<ShortcutsProps> & import("react").RefAttributes<HTMLDivElement>> & {
|
|
4
|
-
getTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["list", "
|
|
4
|
+
getTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["list", "empty-state", "category-section", "category-heading", "show-more-less"]>;
|
|
5
5
|
};
|
|
6
6
|
export default _default;
|
|
7
7
|
//# sourceMappingURL=Shortcuts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Shortcuts.d.ts","sourceRoot":"","sources":["../../../src/components/Shortcuts/Shortcuts.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAa,eAAe,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Shortcuts.d.ts","sourceRoot":"","sources":["../../../src/components/Shortcuts/Shortcuts.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAa,eAAe,EAAE,MAAM,OAAO,CAAC;AA0BxD,OAAO,KAAK,EAAE,cAAc,EAAgB,MAAM,mBAAmB,CAAC;;;;AAuPtE,wBAA2D"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useRef, forwardRef, useState } from 'react';
|
|
3
|
-
import { calculateForegroundColor, Card, CardContent, CardHeader, EmptyState, Flex, Text, VisuallyHiddenText, readableColor, registerIcon, isSolidColor, useArrows, useI18n, usePrevious, useTestIds, useTheme, createClassName, withTestIds } from '@pega/cosmos-react-core';
|
|
3
|
+
import { calculateForegroundColor, Button, Card, CardContent, CardFooter, CardHeader, EmptyState, Flex, Text, VisuallyHiddenText, readableColor, registerIcon, isSolidColor, useArrows, useI18n, usePrevious, useTestIds, useTheme, createClassName, withTestIds } from '@pega/cosmos-react-core';
|
|
4
4
|
import * as openNewTabIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/open.icon';
|
|
5
5
|
import { StyledExternalIcon, StyledLabelRow, StyledShortcutsCard, StyledShortcutsCardButton, StyledShortcutsCardsContainer, StyledShortcutsCardsWrapper, StyledShortcutsCategoriesContainer, StyledShortcutsCategoryHeading, StyledShortcutsCardIcon, StyledShortcutImageContainer, StyledShortcutImg, StyledSubtitleText, StyledText, StyledTextContent, StyledCardContentWrapper } from './Shortcuts.styles';
|
|
6
6
|
import { getShortcutsTestIds } from './Shortcuts.test-ids';
|
|
@@ -36,7 +36,7 @@ const CardItem = ({ item, variant }) => {
|
|
|
36
36
|
const visual = showImage ? (_jsx(Flex, { container: { alignItems: 'center', justify: 'center' }, as: StyledShortcutImageContainer, children: _jsx(StyledShortcutImg, { src: image, alt: item.label, onError: () => setIsBrokenImage(true), onLoad: () => setIsBrokenImage(false) }) })) : (iconVisual);
|
|
37
37
|
return (_jsx(StyledShortcutsCard, { className: cardClassName, children: _jsx(StyledShortcutsCardButton, { variant: 'link', layoutVariant: variant, ...itemLinkProps(item), children: _jsxs(StyledCardContentWrapper, { layoutVariant: variant, hasDescription: !!description, children: [visual, _jsxs(Flex, { container: { direction: 'column', gap: 0.5 }, as: StyledTextContent, layoutVariant: variant, children: [_jsxs(StyledLabelRow, { children: [_jsx(StyledText, { children: item.label }), item.type === 'external' && _jsx(StyledExternalIcon, { name: 'open' })] }), description && (_jsx(StyledSubtitleText, { variant: 'secondary', forwardedAs: 'p', children: description }))] })] }) }) }));
|
|
38
38
|
};
|
|
39
|
-
const Shortcuts = forwardRef(function Shortcuts({ heading, className, items = [], categories, showHeader = true, variant = 'inline', testId, ...restProps }, ref) {
|
|
39
|
+
const Shortcuts = forwardRef(function Shortcuts({ heading, className, items = [], categories, showHeader = true, variant = 'inline', count, onExpandToggle, testId, ...restProps }, ref) {
|
|
40
40
|
const t = useI18n();
|
|
41
41
|
const testIds = useTestIds(testId, getShortcutsTestIds);
|
|
42
42
|
const rootClassName = createClassName('shortcuts', className);
|
|
@@ -44,8 +44,13 @@ const Shortcuts = forwardRef(function Shortcuts({ heading, className, items = []
|
|
|
44
44
|
const categoriesContainerRef = useRef(null);
|
|
45
45
|
useArrows(flatListRef, { dir: 'both', cycle: true });
|
|
46
46
|
useArrows(categoriesContainerRef, { dir: 'both', cycle: true });
|
|
47
|
+
const renderedItemCount = categories
|
|
48
|
+
? categories.reduce((total, cat) => total + cat.items.length, 0)
|
|
49
|
+
: items.length;
|
|
50
|
+
const hasMore = count !== undefined && count > renderedItemCount;
|
|
51
|
+
const expandToggle = onExpandToggle && count !== undefined ? (_jsx(Button, { "data-testid": testIds.showMoreLess, variant: showHeader ? 'link' : 'simple', onClick: onExpandToggle, children: t(hasMore ? 'show_more' : 'show_less') })) : null;
|
|
47
52
|
const emptyState = _jsx(EmptyState, { message: t('no_items'), "data-testid": testIds.emptyState });
|
|
48
|
-
const withCardShell = (content) => (_jsxs(Card, { ...restProps, className: rootClassName, "data-testid": testIds.root, ref: ref, children: [_jsx(CardHeader, { children: _jsx(Text, { variant: 'h2', children: heading ?? t('shortcuts') }) }), _jsx(CardContent, { children: content })] }));
|
|
53
|
+
const withCardShell = (content) => (_jsxs(Card, { ...restProps, className: rootClassName, "data-testid": testIds.root, ref: ref, children: [_jsx(CardHeader, { children: _jsx(Text, { variant: 'h2', children: heading ?? t('shortcuts') }) }), _jsx(CardContent, { children: content }), expandToggle && _jsx(CardFooter, { justify: 'center', children: expandToggle })] }));
|
|
49
54
|
if (categories) {
|
|
50
55
|
const visibleCategories = categories.filter(cat => cat.items.length > 0);
|
|
51
56
|
const categorySections = (_jsx(StyledShortcutsCategoriesContainer, { ref: categoriesContainerRef, children: visibleCategories.map(cat => (_jsxs(Flex, { container: { direction: 'column' }, "aria-labelledby": `cat-${cat.id}`, "data-testid": testIds.categorySection, as: 'section', children: [_jsx(StyledShortcutsCategoryHeading, { id: `cat-${cat.id}`, "data-testid": testIds.categoryHeading, variant: 'h3', children: cat.label }), _jsx(StyledShortcutsCardsContainer, { role: 'list', "aria-label": cat.label, itemCount: cat.items.length, children: cat.items.map(item => (_jsx(CardItem, { item: item, variant: variant }, item.id))) })] }, cat.id))) }));
|
|
@@ -55,7 +60,7 @@ const Shortcuts = forwardRef(function Shortcuts({ heading, className, items = []
|
|
|
55
60
|
if (!showHeader) {
|
|
56
61
|
if (items.length === 0)
|
|
57
62
|
return null;
|
|
58
|
-
return (_jsxs("div", { className: rootClassName, "data-testid": testIds.root, ...restProps, ref: ref, children: [_jsx(VisuallyHiddenText, { children: heading ?? t('shortcuts') }), cardGrid] }));
|
|
63
|
+
return (_jsxs("div", { className: rootClassName, "data-testid": testIds.root, ...restProps, ref: ref, children: [_jsx(VisuallyHiddenText, { children: heading ?? t('shortcuts') }), cardGrid, expandToggle && _jsx(Flex, { container: { justify: 'center' }, children: expandToggle })] }));
|
|
59
64
|
}
|
|
60
65
|
return withCardShell(items.length === 0 ? emptyState : cardGrid);
|
|
61
66
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Shortcuts.js","sourceRoot":"","sources":["../../../src/components/Shortcuts/Shortcuts.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGrD,OAAO,EACL,wBAAwB,EACxB,IAAI,EACJ,WAAW,EACX,UAAU,EACV,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,OAAO,EACP,WAAW,EACX,UAAU,EACV,QAAQ,EACR,eAAe,EACf,WAAW,EACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,cAAc,MAAM,6DAA6D,CAAC;AAG9F,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,yBAAyB,EACzB,6BAA6B,EAC7B,2BAA2B,EAC3B,kCAAkC,EAClC,8BAA8B,EAC9B,uBAAuB,EACvB,4BAA4B,EAC5B,iBAAiB,EACjB,kBAAkB,EAClB,UAAU,EACV,iBAAiB,EACjB,wBAAwB,EACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,YAAY,CAAC,cAAc,CAAC,CAAC;AAE7B,MAAM,aAAa,GAAG,CACpB,IAAkB,EAMlB,EAAE;IACF,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QAC7B,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,qBAAqB,EAAE,CAAC;IAC3E,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;A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,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC;IACvF,CAAC;IAED,MAAM,QAAQ,GAAG,CACf,KAAC,2BAA2B,cAC1B,KAAC,6BAA6B,IAC5B,GAAG,EAAE,WAAW,EAChB,IAAI,EAAC,MAAM,iBACE,OAAO,CAAC,IAAI,gBACb,OAAO,IAAI,CAAC,CAAC,WAAW,CAAC,EACrC,SAAS,EAAE,KAAK,CAAC,MAAM,YAEtB,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CACjB,KAAC,QAAQ,IAAe,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,IAArC,IAAI,CAAC,EAAE,CAAkC,CACzD,CAAC,GAC4B,GACJ,CAC/B,CAAC;IAEF,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QAEpC,OAAO,CACL,eAAK,SAAS,EAAE,aAAa,iBAAe,OAAO,CAAC,IAAI,KAAM,SAAS,EAAE,GAAG,EAAE,GAAG,aAC/E,KAAC,kBAAkB,cAAE,OAAO,IAAI,CAAC,CAAC,WAAW,CAAC,GAAsB,EACnE,QAAQ,IACL,CACP,CAAC;IACJ,CAAC;IAED,OAAO,aAAa,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;AACnE,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC","sourcesContent":["import { useRef, forwardRef, useState } from 'react';\nimport type { ReactNode, PropsWithoutRef } from 'react';\n\nimport {\n calculateForegroundColor,\n Card,\n CardContent,\n CardHeader,\n EmptyState,\n Flex,\n Text,\n VisuallyHiddenText,\n readableColor,\n registerIcon,\n isSolidColor,\n useArrows,\n useI18n,\n usePrevious,\n useTestIds,\n useTheme,\n createClassName,\n withTestIds\n} from '@pega/cosmos-react-core';\nimport * as openNewTabIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/open.icon';\n\nimport type { ShortcutsProps, ShortcutItem } from './Shortcuts.types';\nimport {\n StyledExternalIcon,\n StyledLabelRow,\n StyledShortcutsCard,\n StyledShortcutsCardButton,\n StyledShortcutsCardsContainer,\n StyledShortcutsCardsWrapper,\n StyledShortcutsCategoriesContainer,\n StyledShortcutsCategoryHeading,\n StyledShortcutsCardIcon,\n StyledShortcutImageContainer,\n StyledShortcutImg,\n StyledSubtitleText,\n StyledText,\n StyledTextContent,\n StyledCardContentWrapper\n} from './Shortcuts.styles';\nimport { getShortcutsTestIds } from './Shortcuts.test-ids';\n\nregisterIcon(openNewTabIcon);\n\nconst itemLinkProps = (\n item: ShortcutItem\n): {\n href?: string;\n target?: string;\n rel?: string;\n onClick?: () => void;\n} => {\n if (item.type === 'external') {\n return { href: item.href, target: '_blank', rel: 'noopener noreferrer' };\n }\n\n return { onClick: item.onClick };\n};\n\nconst CardItem = ({ item, variant }: { item: ShortcutItem; variant: 'stacked' | 'inline' }) => {\n const {\n components: {\n card,\n shortcuts: {\n icon: { background: configuredIconBackground, foreground: configuredIconForeground }\n }\n }\n } = useTheme();\n\n const cardClassName = createClassName('shortcuts-card', item.className);\n\n const isLink = item.type === 'external';\n const image = isLink ? item.image : undefined;\n const description = isLink ? item.description : undefined;\n\n const [isBrokenImage, setIsBrokenImage] = useState(false);\n const prevImage = usePrevious(image);\n\n const iconBackground = configuredIconBackground;\n const withIconBackground = Boolean(isSolidColor(iconBackground));\n\n const cardForeground = calculateForegroundColor(card.background, card['foreground-color']);\n let iconForeground = configuredIconForeground;\n\n if (configuredIconForeground === 'auto') {\n iconForeground = withIconBackground\n ? readableColor(iconBackground, { mode: 'light', level: 'AANonText' })\n : cardForeground;\n }\n\n const showImage = Boolean(image) && !(isBrokenImage && image === prevImage);\n\n const commonIconProps = {\n name: item.icon\n };\n\n const iconVisual = withIconBackground ? (\n <StyledShortcutsCardIcon\n {...commonIconProps}\n background={iconBackground}\n foreground={iconForeground}\n />\n ) : (\n <StyledShortcutsCardIcon {...commonIconProps} iconColor={iconForeground} size='m' />\n );\n\n const visual = showImage ? (\n <Flex container={{ alignItems: 'center', justify: 'center' }} as={StyledShortcutImageContainer}>\n <StyledShortcutImg\n src={image}\n alt={item.label}\n onError={() => setIsBrokenImage(true)}\n onLoad={() => setIsBrokenImage(false)}\n />\n </Flex>\n ) : (\n iconVisual\n );\n\n return (\n <StyledShortcutsCard className={cardClassName}>\n <StyledShortcutsCardButton variant='link' layoutVariant={variant} {...itemLinkProps(item)}>\n <StyledCardContentWrapper layoutVariant={variant} hasDescription={!!description}>\n {visual}\n <Flex\n container={{ direction: 'column', gap: 0.5 }}\n as={StyledTextContent}\n layoutVariant={variant}\n >\n <StyledLabelRow>\n <StyledText>{item.label}</StyledText>\n {item.type === 'external' && <StyledExternalIcon name='open' />}\n </StyledLabelRow>\n\n {description && (\n <StyledSubtitleText variant='secondary' forwardedAs='p'>\n {description}\n </StyledSubtitleText>\n )}\n </Flex>\n </StyledCardContentWrapper>\n </StyledShortcutsCardButton>\n </StyledShortcutsCard>\n );\n};\n\nconst Shortcuts = forwardRef(function Shortcuts(\n {\n heading,\n className,\n items = [],\n categories,\n showHeader = true,\n variant = 'inline',\n testId,\n ...restProps\n }: PropsWithoutRef<ShortcutsProps>,\n ref: ShortcutsProps['ref']\n) {\n const t = useI18n();\n const testIds = useTestIds(testId, getShortcutsTestIds);\n\n const rootClassName = createClassName('shortcuts', className);\n\n const flatListRef = useRef<HTMLUListElement>(null);\n const categoriesContainerRef = useRef<HTMLDivElement>(null);\n\n useArrows(flatListRef, { dir: 'both', cycle: true });\n useArrows(categoriesContainerRef, { dir: 'both', cycle: true });\n\n const emptyState = <EmptyState message={t('no_items')} data-testid={testIds.emptyState} />;\n\n const withCardShell = (content: ReactNode) => (\n <Card {...restProps} className={rootClassName} data-testid={testIds.root} ref={ref}>\n <CardHeader>\n <Text variant='h2'>{heading ?? t('shortcuts')}</Text>\n </CardHeader>\n <CardContent>{content}</CardContent>\n </Card>\n );\n\n if (categories) {\n const visibleCategories = categories.filter(cat => cat.items.length > 0);\n\n const categorySections = (\n <StyledShortcutsCategoriesContainer ref={categoriesContainerRef}>\n {visibleCategories.map(cat => (\n <Flex\n container={{ direction: 'column' }}\n key={cat.id}\n aria-labelledby={`cat-${cat.id}`}\n data-testid={testIds.categorySection}\n as='section'\n >\n <StyledShortcutsCategoryHeading\n id={`cat-${cat.id}`}\n data-testid={testIds.categoryHeading}\n variant='h3'\n >\n {cat.label}\n </StyledShortcutsCategoryHeading>\n\n <StyledShortcutsCardsContainer\n role='list'\n aria-label={cat.label}\n itemCount={cat.items.length}\n >\n {cat.items.map(item => (\n <CardItem key={item.id} item={item} variant={variant} />\n ))}\n </StyledShortcutsCardsContainer>\n </Flex>\n ))}\n </StyledShortcutsCategoriesContainer>\n );\n\n return withCardShell(visibleCategories.length === 0 ? emptyState : categorySections);\n }\n\n const cardGrid = (\n <StyledShortcutsCardsWrapper>\n <StyledShortcutsCardsContainer\n ref={flatListRef}\n role='list'\n data-testid={testIds.list}\n aria-label={heading ?? t('shortcuts')}\n itemCount={items.length}\n >\n {items.map(item => (\n <CardItem key={item.id} item={item} variant={variant} />\n ))}\n </StyledShortcutsCardsContainer>\n </StyledShortcutsCardsWrapper>\n );\n\n if (!showHeader) {\n if (items.length === 0) return null;\n\n return (\n <div className={rootClassName} data-testid={testIds.root} {...restProps} ref={ref}>\n <VisuallyHiddenText>{heading ?? t('shortcuts')}</VisuallyHiddenText>\n {cardGrid}\n </div>\n );\n }\n\n return withCardShell(items.length === 0 ? emptyState : cardGrid);\n});\n\nexport default withTestIds(Shortcuts, getShortcutsTestIds);\n"]}
|
|
1
|
+
{"version":3,"file":"Shortcuts.js","sourceRoot":"","sources":["../../../src/components/Shortcuts/Shortcuts.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,E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AAI,CAAC,CAAC,WAAW,CAAC,GAAsB,EACnE,QAAQ,EACR,YAAY,IAAI,KAAC,IAAI,IAAC,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAG,YAAY,GAAQ,IAC1E,CACP,CAAC;IACJ,CAAC;IAED,OAAO,aAAa,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;AACnE,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC","sourcesContent":["import { useRef, forwardRef, useState } from 'react';\nimport type { ReactNode, PropsWithoutRef } from 'react';\n\nimport {\n calculateForegroundColor,\n Button,\n Card,\n CardContent,\n CardFooter,\n CardHeader,\n EmptyState,\n Flex,\n Text,\n VisuallyHiddenText,\n readableColor,\n registerIcon,\n isSolidColor,\n useArrows,\n useI18n,\n usePrevious,\n useTestIds,\n useTheme,\n createClassName,\n withTestIds\n} from '@pega/cosmos-react-core';\nimport * as openNewTabIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/open.icon';\n\nimport type { ShortcutsProps, ShortcutItem } from './Shortcuts.types';\nimport {\n StyledExternalIcon,\n StyledLabelRow,\n StyledShortcutsCard,\n StyledShortcutsCardButton,\n StyledShortcutsCardsContainer,\n StyledShortcutsCardsWrapper,\n StyledShortcutsCategoriesContainer,\n StyledShortcutsCategoryHeading,\n StyledShortcutsCardIcon,\n StyledShortcutImageContainer,\n StyledShortcutImg,\n StyledSubtitleText,\n StyledText,\n StyledTextContent,\n StyledCardContentWrapper\n} from './Shortcuts.styles';\nimport { getShortcutsTestIds } from './Shortcuts.test-ids';\n\nregisterIcon(openNewTabIcon);\n\nconst itemLinkProps = (\n item: ShortcutItem\n): {\n href?: string;\n target?: string;\n rel?: string;\n onClick?: () => void;\n} => {\n if (item.type === 'external') {\n return { href: item.href, target: '_blank', rel: 'noopener noreferrer' };\n }\n\n return { onClick: item.onClick };\n};\n\nconst CardItem = ({ item, variant }: { item: ShortcutItem; variant: 'stacked' | 'inline' }) => {\n const {\n components: {\n card,\n shortcuts: {\n icon: { background: configuredIconBackground, foreground: configuredIconForeground }\n }\n }\n } = useTheme();\n\n const cardClassName = createClassName('shortcuts-card', item.className);\n\n const isLink = item.type === 'external';\n const image = isLink ? item.image : undefined;\n const description = isLink ? item.description : undefined;\n\n const [isBrokenImage, setIsBrokenImage] = useState(false);\n const prevImage = usePrevious(image);\n\n const iconBackground = configuredIconBackground;\n const withIconBackground = Boolean(isSolidColor(iconBackground));\n\n const cardForeground = calculateForegroundColor(card.background, card['foreground-color']);\n let iconForeground = configuredIconForeground;\n\n if (configuredIconForeground === 'auto') {\n iconForeground = withIconBackground\n ? readableColor(iconBackground, { mode: 'light', level: 'AANonText' })\n : cardForeground;\n }\n\n const showImage = Boolean(image) && !(isBrokenImage && image === prevImage);\n\n const commonIconProps = {\n name: item.icon\n };\n\n const iconVisual = withIconBackground ? (\n <StyledShortcutsCardIcon\n {...commonIconProps}\n background={iconBackground}\n foreground={iconForeground}\n />\n ) : (\n <StyledShortcutsCardIcon {...commonIconProps} iconColor={iconForeground} size='m' />\n );\n\n const visual = showImage ? (\n <Flex container={{ alignItems: 'center', justify: 'center' }} as={StyledShortcutImageContainer}>\n <StyledShortcutImg\n src={image}\n alt={item.label}\n onError={() => setIsBrokenImage(true)}\n onLoad={() => setIsBrokenImage(false)}\n />\n </Flex>\n ) : (\n iconVisual\n );\n\n return (\n <StyledShortcutsCard className={cardClassName}>\n <StyledShortcutsCardButton variant='link' layoutVariant={variant} {...itemLinkProps(item)}>\n <StyledCardContentWrapper layoutVariant={variant} hasDescription={!!description}>\n {visual}\n <Flex\n container={{ direction: 'column', gap: 0.5 }}\n as={StyledTextContent}\n layoutVariant={variant}\n >\n <StyledLabelRow>\n <StyledText>{item.label}</StyledText>\n {item.type === 'external' && <StyledExternalIcon name='open' />}\n </StyledLabelRow>\n\n {description && (\n <StyledSubtitleText variant='secondary' forwardedAs='p'>\n {description}\n </StyledSubtitleText>\n )}\n </Flex>\n </StyledCardContentWrapper>\n </StyledShortcutsCardButton>\n </StyledShortcutsCard>\n );\n};\n\nconst Shortcuts = forwardRef(function Shortcuts(\n {\n heading,\n className,\n items = [],\n categories,\n showHeader = true,\n variant = 'inline',\n count,\n onExpandToggle,\n testId,\n ...restProps\n }: PropsWithoutRef<ShortcutsProps>,\n ref: ShortcutsProps['ref']\n) {\n const t = useI18n();\n const testIds = useTestIds(testId, getShortcutsTestIds);\n\n const rootClassName = createClassName('shortcuts', className);\n\n const flatListRef = useRef<HTMLUListElement>(null);\n const categoriesContainerRef = useRef<HTMLDivElement>(null);\n\n useArrows(flatListRef, { dir: 'both', cycle: true });\n useArrows(categoriesContainerRef, { dir: 'both', cycle: true });\n\n const renderedItemCount = categories\n ? categories.reduce((total, cat) => total + cat.items.length, 0)\n : items.length;\n const hasMore = count !== undefined && count > renderedItemCount;\n\n const expandToggle =\n onExpandToggle && count !== undefined ? (\n <Button\n data-testid={testIds.showMoreLess}\n variant={showHeader ? 'link' : 'simple'}\n onClick={onExpandToggle}\n >\n {t(hasMore ? 'show_more' : 'show_less')}\n </Button>\n ) : null;\n\n const emptyState = <EmptyState message={t('no_items')} data-testid={testIds.emptyState} />;\n\n const withCardShell = (content: ReactNode) => (\n <Card {...restProps} className={rootClassName} data-testid={testIds.root} ref={ref}>\n <CardHeader>\n <Text variant='h2'>{heading ?? t('shortcuts')}</Text>\n </CardHeader>\n <CardContent>{content}</CardContent>\n {expandToggle && <CardFooter justify='center'>{expandToggle}</CardFooter>}\n </Card>\n );\n\n if (categories) {\n const visibleCategories = categories.filter(cat => cat.items.length > 0);\n\n const categorySections = (\n <StyledShortcutsCategoriesContainer ref={categoriesContainerRef}>\n {visibleCategories.map(cat => (\n <Flex\n container={{ direction: 'column' }}\n key={cat.id}\n aria-labelledby={`cat-${cat.id}`}\n data-testid={testIds.categorySection}\n as='section'\n >\n <StyledShortcutsCategoryHeading\n id={`cat-${cat.id}`}\n data-testid={testIds.categoryHeading}\n variant='h3'\n >\n {cat.label}\n </StyledShortcutsCategoryHeading>\n\n <StyledShortcutsCardsContainer\n role='list'\n aria-label={cat.label}\n itemCount={cat.items.length}\n >\n {cat.items.map(item => (\n <CardItem key={item.id} item={item} variant={variant} />\n ))}\n </StyledShortcutsCardsContainer>\n </Flex>\n ))}\n </StyledShortcutsCategoriesContainer>\n );\n\n return withCardShell(visibleCategories.length === 0 ? emptyState : categorySections);\n }\n\n const cardGrid = (\n <StyledShortcutsCardsWrapper>\n <StyledShortcutsCardsContainer\n ref={flatListRef}\n role='list'\n data-testid={testIds.list}\n aria-label={heading ?? t('shortcuts')}\n itemCount={items.length}\n >\n {items.map(item => (\n <CardItem key={item.id} item={item} variant={variant} />\n ))}\n </StyledShortcutsCardsContainer>\n </StyledShortcutsCardsWrapper>\n );\n\n if (!showHeader) {\n if (items.length === 0) return null;\n\n return (\n <div className={rootClassName} data-testid={testIds.root} {...restProps} ref={ref}>\n <VisuallyHiddenText>{heading ?? t('shortcuts')}</VisuallyHiddenText>\n {cardGrid}\n {expandToggle && <Flex container={{ justify: 'center' }}>{expandToggle}</Flex>}\n </div>\n );\n }\n\n return withCardShell(items.length === 0 ? emptyState : cardGrid);\n});\n\nexport default withTestIds(Shortcuts, getShortcutsTestIds);\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const getShortcutsTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["list", "
|
|
1
|
+
export declare const getShortcutsTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["list", "empty-state", "category-section", "category-heading", "show-more-less"]>;
|
|
2
2
|
//# sourceMappingURL=Shortcuts.test-ids.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Shortcuts.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/Shortcuts/Shortcuts.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"Shortcuts.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/Shortcuts/Shortcuts.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,sNAMrB,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { createTestIds } from '@pega/cosmos-react-core';
|
|
2
2
|
export const getShortcutsTestIds = createTestIds('shortcuts', [
|
|
3
3
|
'list',
|
|
4
|
-
'
|
|
5
|
-
'
|
|
6
|
-
'
|
|
4
|
+
'empty-state',
|
|
5
|
+
'category-section',
|
|
6
|
+
'category-heading',
|
|
7
|
+
'show-more-less'
|
|
7
8
|
]);
|
|
8
9
|
//# sourceMappingURL=Shortcuts.test-ids.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Shortcuts.test-ids.js","sourceRoot":"","sources":["../../../src/components/Shortcuts/Shortcuts.test-ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAC,WAAW,EAAE;IAC5D,MAAM;IACN,
|
|
1
|
+
{"version":3,"file":"Shortcuts.test-ids.js","sourceRoot":"","sources":["../../../src/components/Shortcuts/Shortcuts.test-ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAC,WAAW,EAAE;IAC5D,MAAM;IACN,aAAa;IACb,kBAAkB;IAClB,kBAAkB;IAClB,gBAAgB;CACR,CAAC,CAAC","sourcesContent":["import { createTestIds } from '@pega/cosmos-react-core';\n\nexport const getShortcutsTestIds = createTestIds('shortcuts', [\n 'list',\n 'empty-state',\n 'category-section',\n 'category-heading',\n 'show-more-less'\n] as const);\n"]}
|
|
@@ -62,6 +62,16 @@ interface ShortcutsBaseProps extends NoChildrenProp, TestIdProp, BaseProps {
|
|
|
62
62
|
* @default 'inline'
|
|
63
63
|
*/
|
|
64
64
|
variant?: 'stacked' | 'inline';
|
|
65
|
+
/**
|
|
66
|
+
* Total number of shortcut items available (may exceed the rendered list when collapsed).
|
|
67
|
+
* Used with `onExpandToggle` to decide Show more vs Show less.
|
|
68
|
+
*/
|
|
69
|
+
count?: number;
|
|
70
|
+
/**
|
|
71
|
+
* When set with `count`, renders a Show more / Show less control.
|
|
72
|
+
* Parent owns expand state and slicing.
|
|
73
|
+
*/
|
|
74
|
+
onExpandToggle?: () => void;
|
|
65
75
|
/** Ref for the root card element. */
|
|
66
76
|
ref?: Ref<HTMLDivElement>;
|
|
67
77
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Shortcuts.types.d.ts","sourceRoot":"","sources":["../../../src/components/Shortcuts/Shortcuts.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErF,UAAU,gBAAgB;IACxB,2CAA2C;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB;IACxD,6DAA6D;IAC7D,IAAI,EAAE,UAAU,CAAC;IACjB,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uGAAuG;IACvG,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;A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ACxE,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC/B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,qCAAqC;IACrC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAED,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAAG,CAAC,kBAAkB,GAAG,uBAAuB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Shortcuts.types.js","sourceRoot":"","sources":["../../../src/components/Shortcuts/Shortcuts.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Ref } from 'react';\n\nimport type { BaseProps, NoChildrenProp, TestIdProp } from '@pega/cosmos-react-core';\n\ninterface ShortcutItemBase {\n /** Unique identifier for this shortcut. */\n id: string;\n /** Display label shown on the shortcut. */\n label: string;\n /** Icon name from the registered icon set. */\n icon: string;\n /** Optional class name applied to the rendered shortcut card. */\n className?: string;\n}\n\nexport interface ShortcutLinkItem extends ShortcutItemBase {\n /** Discriminant — this item navigates to an external URL. */\n type: 'external';\n /** Absolute URL the link navigates to. Opens in a new tab. */\n href: string;\n /** Optional subtitle displayed below the label. */\n description?: string;\n /** Optional image URL. Renders in place of the icon; falls back to icon if the image fails to load. */\n image?: string;\n}\n\nexport interface ShortcutNavItem extends ShortcutItemBase {\n /** Discriminant — this item navigates to a portal landing page. */\n type: 'page';\n /** Callback invoked when the user activates this shortcut. */\n onClick: () => void;\n}\n\nexport type ShortcutItem = ShortcutLinkItem | ShortcutNavItem;\n\nexport interface ShortcutCategory {\n /** Unique identifier for this category. */\n id: string;\n /** Display label shown as the category heading. */\n label: string;\n /** Shortcut items belonging to this category. */\n items: ShortcutItem[];\n}\n\ninterface ShortcutsWithItems {\n /** Shortcut items to render as cards. */\n items?: ShortcutItem[];\n categories?: never;\n /**\n * Whether to render the outer card shell with a heading.\n * When `false`, only the card grid is rendered, centered within its container.\n * @default true\n */\n showHeader?: boolean;\n}\n\ninterface ShortcutsWithCategories {\n items?: never;\n /** Grouped shortcut items, each rendered as cards under a category heading. */\n categories: ShortcutCategory[];\n showHeader?: never;\n}\n\ninterface ShortcutsBaseProps extends NoChildrenProp, TestIdProp, BaseProps {\n /** Heading displayed above the shortcuts. */\n heading?: string;\n /**\n * Controls the layout variant of each shortcut card.\n * - `stacked`: large icon above the label (default card style).\n * - `inline`: small icon inline to the left of the label (list/link style).\n * @default 'inline'\n */\n variant?: 'stacked' | 'inline';\n /** Ref for the root card element. */\n ref?: Ref<HTMLDivElement>;\n}\n\nexport type ShortcutsProps = ShortcutsBaseProps & (ShortcutsWithItems | ShortcutsWithCategories);\n"]}
|
|
1
|
+
{"version":3,"file":"Shortcuts.types.js","sourceRoot":"","sources":["../../../src/components/Shortcuts/Shortcuts.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Ref } from 'react';\n\nimport type { BaseProps, NoChildrenProp, TestIdProp } from '@pega/cosmos-react-core';\n\ninterface ShortcutItemBase {\n /** Unique identifier for this shortcut. */\n id: string;\n /** Display label shown on the shortcut. */\n label: string;\n /** Icon name from the registered icon set. */\n icon: string;\n /** Optional class name applied to the rendered shortcut card. */\n className?: string;\n}\n\nexport interface ShortcutLinkItem extends ShortcutItemBase {\n /** Discriminant — this item navigates to an external URL. */\n type: 'external';\n /** Absolute URL the link navigates to. Opens in a new tab. */\n href: string;\n /** Optional subtitle displayed below the label. */\n description?: string;\n /** Optional image URL. Renders in place of the icon; falls back to icon if the image fails to load. */\n image?: string;\n}\n\nexport interface ShortcutNavItem extends ShortcutItemBase {\n /** Discriminant — this item navigates to a portal landing page. */\n type: 'page';\n /** Callback invoked when the user activates this shortcut. */\n onClick: () => void;\n}\n\nexport type ShortcutItem = ShortcutLinkItem | ShortcutNavItem;\n\nexport interface ShortcutCategory {\n /** Unique identifier for this category. */\n id: string;\n /** Display label shown as the category heading. */\n label: string;\n /** Shortcut items belonging to this category. */\n items: ShortcutItem[];\n}\n\ninterface ShortcutsWithItems {\n /** Shortcut items to render as cards. */\n items?: ShortcutItem[];\n categories?: never;\n /**\n * Whether to render the outer card shell with a heading.\n * When `false`, only the card grid is rendered, centered within its container.\n * @default true\n */\n showHeader?: boolean;\n}\n\ninterface ShortcutsWithCategories {\n items?: never;\n /** Grouped shortcut items, each rendered as cards under a category heading. */\n categories: ShortcutCategory[];\n showHeader?: never;\n}\n\ninterface ShortcutsBaseProps extends NoChildrenProp, TestIdProp, BaseProps {\n /** Heading displayed above the shortcuts. */\n heading?: string;\n /**\n * Controls the layout variant of each shortcut card.\n * - `stacked`: large icon above the label (default card style).\n * - `inline`: small icon inline to the left of the label (list/link style).\n * @default 'inline'\n */\n variant?: 'stacked' | 'inline';\n /**\n * Total number of shortcut items available (may exceed the rendered list when collapsed).\n * Used with `onExpandToggle` to decide Show more vs Show less.\n */\n count?: number;\n /**\n * When set with `count`, renders a Show more / Show less control.\n * Parent owns expand state and slicing.\n */\n onExpandToggle?: () => void;\n /** Ref for the root card element. */\n ref?: Ref<HTMLDivElement>;\n}\n\nexport type ShortcutsProps = ShortcutsBaseProps & (ShortcutsWithItems | ShortcutsWithCategories);\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/cosmos-react-work",
|
|
3
|
-
"version": "10.0.0-build.4.
|
|
3
|
+
"version": "10.0.0-build.4.28",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"author": "Pegasystems",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"build": "tsc -b tsconfig.build.json"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@pega/cosmos-react-core": "10.0.0-build.4.
|
|
18
|
-
"@pega/cosmos-react-rte": "10.0.0-build.4.
|
|
17
|
+
"@pega/cosmos-react-core": "10.0.0-build.4.28",
|
|
18
|
+
"@pega/cosmos-react-rte": "10.0.0-build.4.28",
|
|
19
19
|
"@types/react": "^17.0.62 || ^18.3.3",
|
|
20
20
|
"@types/react-dom": "^17.0.20 || ^18.3.0",
|
|
21
21
|
"polished": "^4.1.0",
|