@pega/cosmos-react-work 9.5.5-2 → 9.5.5-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.
@@ -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;AAsBxD,OAAO,KAAK,EAAE,cAAc,EAAgB,MAAM,mBAAmB,CAAC;;;;AAgLtE,wBAA2D"}
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;AAuBxD,OAAO,KAAK,EAAE,cAAc,EAAgB,MAAM,mBAAmB,CAAC;;;;AAyNtE,wBAA2D"}
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useRef, forwardRef } from 'react';
3
- import { calculateForegroundColor, Card, CardContent, CardHeader, EmptyState, Flex, Text, VisuallyHiddenText, readableColor, registerIcon, isSolidColor, useArrows, useI18n, useTestIds, useTheme, withTestIds } from '@pega/cosmos-react-core';
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, withTestIds } from '@pega/cosmos-react-core';
4
4
  import * as openNewTabIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/open.icon';
5
- import { StyledExternalIcon, StyledLabelRow, StyledShortcutsCard, StyledShortcutsCardButton, StyledShortcutsCardsContainer, StyledShortcutsCardsWrapper, StyledShortcutsCategoriesContainer, StyledShortcutsCategoryHeading, StyledShortcutsCardIcon, StyledText } from './Shortcuts.styles';
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';
7
7
  registerIcon(openNewTabIcon);
8
8
  const itemLinkProps = (item) => {
@@ -13,6 +13,11 @@ const itemLinkProps = (item) => {
13
13
  };
14
14
  const CardItem = ({ item, variant }) => {
15
15
  const { components: { card, shortcuts: { icon: { background: configuredIconBackground, foreground: configuredIconForeground } } } } = useTheme();
16
+ const isLink = item.type === 'external';
17
+ const image = isLink ? item.image : undefined;
18
+ const description = isLink ? item.description : undefined;
19
+ const [isBrokenImage, setIsBrokenImage] = useState(false);
20
+ const prevImage = usePrevious(image);
16
21
  const iconBackground = configuredIconBackground;
17
22
  const withIconBackground = Boolean(isSolidColor(iconBackground));
18
23
  const cardForeground = calculateForegroundColor(card.background, card['foreground-color']);
@@ -22,11 +27,13 @@ const CardItem = ({ item, variant }) => {
22
27
  ? readableColor(iconBackground, { mode: 'light', level: 'AANonText' })
23
28
  : cardForeground;
24
29
  }
30
+ const showImage = Boolean(image) && !(isBrokenImage && image === prevImage);
25
31
  const commonIconProps = {
26
- name: item.icon,
27
- layoutVariant: variant
32
+ name: item.icon
28
33
  };
29
- return (_jsx(StyledShortcutsCard, { children: _jsxs(StyledShortcutsCardButton, { variant: 'link', layoutVariant: variant, ...itemLinkProps(item), children: [withIconBackground ? (_jsx(StyledShortcutsCardIcon, { ...commonIconProps, background: iconBackground, foreground: iconForeground })) : (_jsx(StyledShortcutsCardIcon, { ...commonIconProps, iconColor: iconForeground })), _jsxs(StyledLabelRow, { children: [_jsx(StyledText, { children: item.label }), item.type === 'external' && _jsx(StyledExternalIcon, { name: 'open' })] })] }) }));
34
+ const iconVisual = withIconBackground ? (_jsx(StyledShortcutsCardIcon, { ...commonIconProps, background: iconBackground, foreground: iconForeground })) : (_jsx(StyledShortcutsCardIcon, { ...commonIconProps, iconColor: iconForeground, size: 'm' }));
35
+ 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);
36
+ return (_jsx(StyledShortcutsCard, { 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 }))] })] }) }) }));
30
37
  };
31
38
  const Shortcuts = forwardRef(function Shortcuts({ heading, items = [], categories, showHeader = true, variant = 'inline', testId, ...restProps }, ref) {
32
39
  const t = useI18n();
@@ -1 +1 @@
1
- {"version":3,"file":"Shortcuts.js","sourceRoot":"","sources":["../../../src/components/Shortcuts/Shortcuts.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAG3C,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,UAAU,EACV,QAAQ,EACR,WAAW,EACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,cAAc,MAAM,6DAA6D,CAAC;AAG9F,OAAO,EACL,kBAAkB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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 useTestIds,\n useTheme,\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 StyledText\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 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 commonIconProps = {\n name: item.icon,\n layoutVariant: variant\n };\n\n return (\n <StyledShortcutsCard>\n <StyledShortcutsCardButton variant='link' layoutVariant={variant} {...itemLinkProps(item)}>\n {withIconBackground ? (\n <StyledShortcutsCardIcon\n {...commonIconProps}\n background={iconBackground}\n foreground={iconForeground}\n />\n ) : (\n <StyledShortcutsCardIcon {...commonIconProps} iconColor={iconForeground} />\n )}\n <StyledLabelRow>\n <StyledText>{item.label}</StyledText>\n\n {item.type === 'external' && <StyledExternalIcon name='open' />}\n </StyledLabelRow>\n </StyledShortcutsCardButton>\n </StyledShortcutsCard>\n );\n};\n\nconst Shortcuts = forwardRef(function Shortcuts(\n {\n heading,\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 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} 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 role='list' aria-label={cat.label}>\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 >\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 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,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,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,YAA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,CAAC,GACiC,CACtC,CAAC;QAEF,OAAO,aAAa,CAAC,iBAAiB,CAAC,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,YAEpC,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,8BAAkB,OAAO,CAAC,IAAI,KAAM,SAAS,EAAE,GAAG,EAAE,GAAG,aACrD,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 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 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>\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 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 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} 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 role='list' aria-label={cat.label}>\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 >\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 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"]}
@@ -5,16 +5,27 @@ export declare const StyledShortcutsCategoryHeading: import("styled-components/d
5
5
  ref?: ((instance: HTMLHeadingElement | HTMLSpanElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLHeadingElement | HTMLSpanElement> | null | undefined;
6
6
  }, never>> & string & Omit<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").TextProps>, keyof import("react").Component<any, {}, any>>;
7
7
  export declare const StyledShortcutsCard: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, never>> & string;
8
+ export declare const StyledTextContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
9
+ layoutVariant: "stacked" | "inline";
10
+ }>> & string;
11
+ export declare const StyledText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
12
+ export declare const StyledSubtitleText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<import("@pega/cosmos-react-core").TextProps, "ref"> & import("react").RefAttributes<HTMLHeadingElement | HTMLSpanElement> & import("@pega/cosmos-react-core").ForwardProps, "ref"> & {
13
+ ref?: ((instance: HTMLHeadingElement | HTMLSpanElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLHeadingElement | HTMLSpanElement> | null | undefined;
14
+ }, never>> & string & Omit<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").TextProps>, keyof import("react").Component<any, {}, any>>;
8
15
  export declare const StyledShortcutsCardButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<Omit<import("@pega/cosmos-react-core").ButtonProps, "ref"> & import("react").RefAttributes<HTMLAnchorElement | HTMLButtonElement> & import("@pega/cosmos-react-core").ForwardProps, "ref"> & {
9
16
  ref?: ((instance: HTMLAnchorElement | HTMLButtonElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLAnchorElement | HTMLButtonElement> | null | undefined;
10
17
  }, {
11
18
  layoutVariant: "stacked" | "inline";
12
19
  }>> & string & Omit<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").ButtonProps>, keyof import("react").Component<any, {}, any>>;
13
20
  export declare const StyledShortcutsCardIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("@pega/cosmos-react-core").IconProps & import("styled-components/dist/types").BaseObject, {
14
- layoutVariant: "stacked" | "inline";
15
21
  iconColor?: string;
16
22
  }>> & string & Omit<import("react").ForwardRefExoticComponent<import("@pega/cosmos-react-core").IconProps>, keyof import("react").Component<any, {}, any>>;
17
23
  export declare const StyledLabelRow: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
18
- export declare const StyledText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
19
24
  export declare const StyledExternalIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("@pega/cosmos-react-core").IconProps & import("styled-components/dist/types").BaseObject, import("styled-components/dist/types").BaseObject>> & string & Omit<import("react").ForwardRefExoticComponent<import("@pega/cosmos-react-core").IconProps>, keyof import("react").Component<any, {}, any>>;
25
+ export declare const StyledShortcutImageContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
26
+ export declare const StyledShortcutImg: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, never>> & string;
27
+ export declare const StyledCardContentWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
28
+ layoutVariant: "stacked" | "inline";
29
+ hasDescription: boolean;
30
+ }>> & string;
20
31
  //# sourceMappingURL=Shortcuts.styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Shortcuts.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Shortcuts/Shortcuts.styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,2BAA2B,6NAEvC,CAAC;AAEF,eAAO,MAAM,6BAA6B,iOAqBxC,CAAC;AAIH,eAAO,MAAM,kCAAkC,6NAS9C,CAAC;AAIF,eAAO,MAAM,8BAA8B;;yLAIzC,CAAC;AAIH,eAAO,MAAM,mBAAmB,6NAG/B,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;mBAAmC,SAAS,GAAG,QAAQ;oLAwC3F,CAAC;AAIH,eAAO,MAAM,uBAAuB;mBACnB,SAAS,GAAG,QAAQ;gBACvB,MAAM;0JAgBnB,CAAC;AAIF,eAAO,MAAM,cAAc,+NAM1B,CAAC;AAIF,eAAO,MAAM,UAAU,+NAMtB,CAAC;AAIF,eAAO,MAAM,kBAAkB,kaAE9B,CAAC"}
1
+ {"version":3,"file":"Shortcuts.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Shortcuts/Shortcuts.styles.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,2BAA2B,6NAEvC,CAAC;AAEF,eAAO,MAAM,6BAA6B,iOAqBxC,CAAC;AAIH,eAAO,MAAM,kCAAkC,6NAS9C,CAAC;AAIF,eAAO,MAAM,8BAA8B;;yLAIzC,CAAC;AAIH,eAAO,MAAM,mBAAmB,6NAG/B,CAAC;AAEF,eAAO,MAAM,iBAAiB;mBAA+B,SAAS,GAAG,QAAQ;YAehF,CAAC;AAIF,eAAO,MAAM,UAAU,+NAOtB,CAAC;AAIF,eAAO,MAAM,kBAAkB;;yLAK9B,CAAC;AAIF,eAAO,MAAM,yBAAyB;;;mBACrB,SAAS,GAAG,QAAQ;oLA4BnC,CAAC;AAIH,eAAO,MAAM,uBAAuB;gBACtB,MAAM;0JAUnB,CAAC;AAIF,eAAO,MAAM,cAAc,+NAM1B,CAAC;AAIF,eAAO,MAAM,kBAAkB,kaAE9B,CAAC;AAIF,eAAO,MAAM,4BAA4B,+NAaxC,CAAC;AAIF,eAAO,MAAM,iBAAiB,oOAK7B,CAAC;AAIF,eAAO,MAAM,wBAAwB;mBACpB,SAAS,GAAG,QAAQ;oBACnB,OAAO;YAsBxB,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import styled, { css } from 'styled-components';
2
2
  import { mix } from 'polished';
3
3
  import { Button, defaultThemeProp, Icon, Text, tryCatch } from '@pega/cosmos-react-core';
4
+ import { lineClamp } from '@pega/cosmos-react-core/lib/styles/mixins';
4
5
  export const StyledShortcutsCardsWrapper = styled.div `
5
6
  container-type: inline-size;
6
7
  `;
@@ -46,12 +47,40 @@ export const StyledShortcutsCard = styled.li `
46
47
  display: flex;
47
48
  flex-direction: column;
48
49
  `;
50
+ export const StyledTextContent = styled.div(({ layoutVariant }) => css `
51
+ ${layoutVariant === 'inline' &&
52
+ css `
53
+ flex: 1;
54
+ min-width: 0;
55
+ align-items: flex-start;
56
+ `}
57
+
58
+ ${layoutVariant === 'stacked' &&
59
+ css `
60
+ align-items: center;
61
+ width: 100%;
62
+ `}
63
+ `);
64
+ StyledTextContent.defaultProps = defaultThemeProp;
65
+ export const StyledText = styled.span(({ theme: { base } }) => css `
66
+ font-weight: ${base['font-weight']['semi-bold']};
67
+ font-size: 1em;
68
+ color: CanvasText;
69
+ ${lineClamp(3)}
70
+ `);
71
+ StyledText.defaultProps = defaultThemeProp;
72
+ export const StyledSubtitleText = styled(Text)(() => css `
73
+ ${lineClamp(3)}
74
+ text-align: inherit;
75
+ `);
76
+ StyledSubtitleText.defaultProps = defaultThemeProp;
49
77
  export const StyledShortcutsCardButton = styled(Button)(({ theme: { base, components }, layoutVariant }) => {
50
78
  const hoverBackgroundColor = tryCatch(() => mix(0.9, base.palette['primary-background'], components.button['secondary-color']));
51
79
  return css `
52
80
  display: flex;
53
81
  align-items: center;
54
82
  justify-content: flex-start;
83
+ text-align: ${layoutVariant === 'stacked' ? 'center' : 'start'};
55
84
  flex: 1;
56
85
  width: 100%;
57
86
  border: 0.0625rem solid ${base.palette['border-line']};
@@ -62,35 +91,18 @@ export const StyledShortcutsCardButton = styled(Button)(({ theme: { base, compon
62
91
 
63
92
  &:hover {
64
93
  background: ${hoverBackgroundColor};
65
- }
66
-
67
- ${layoutVariant === 'stacked' &&
68
- css `
69
- flex-direction: column;
70
- justify-content: center;
71
- gap: calc(${base.spacing} * 2);
72
- text-align: center;
73
- min-height: 8rem;
74
- `}
94
+ text-decoration: none;
75
95
 
76
- ${layoutVariant === 'inline' &&
77
- css `
78
- flex-direction: row;
79
- gap: calc(${base.spacing} * 1.5);
80
- text-align: start;
81
- `}
96
+ ${StyledText} {
97
+ text-decoration: underline;
98
+ }
99
+ }
82
100
  `;
83
101
  });
84
102
  StyledShortcutsCardButton.defaultProps = defaultThemeProp;
85
- export const StyledShortcutsCardIcon = styled(Icon)(({ layoutVariant, iconColor }) => css `
103
+ export const StyledShortcutsCardIcon = styled(Icon)(({ iconColor }) => css `
86
104
  flex-shrink: 0;
87
105
 
88
- ${layoutVariant === 'stacked' &&
89
- css `
90
- width: 3rem;
91
- height: 3rem;
92
- `}
93
-
94
106
  ${iconColor &&
95
107
  css `
96
108
  color: ${iconColor};
@@ -103,14 +115,44 @@ export const StyledLabelRow = styled.span(({ theme: { base } }) => css `
103
115
  gap: calc(${base.spacing} * 0.5);
104
116
  `);
105
117
  StyledLabelRow.defaultProps = defaultThemeProp;
106
- export const StyledText = styled.span(({ theme: { base } }) => css `
107
- font-weight: ${base['font-weight']['semi-bold']};
108
- font-size: 1em;
109
- color: CanvasText;
110
- `);
111
- StyledText.defaultProps = defaultThemeProp;
112
118
  export const StyledExternalIcon = styled(Icon) `
113
119
  flex-shrink: 0;
114
120
  `;
115
121
  StyledExternalIcon.defaultProps = defaultThemeProp;
122
+ export const StyledShortcutImageContainer = styled.span(({ theme: { base, components: { icon } } }) => css `
123
+ flex-shrink: 0;
124
+ overflow: hidden;
125
+ border-radius: calc(${base['border-radius']} / 2);
126
+ width: ${icon.size.m};
127
+ height: ${icon.size.m};
128
+ `);
129
+ StyledShortcutImageContainer.defaultProps = defaultThemeProp;
130
+ export const StyledShortcutImg = styled.img `
131
+ width: 100%;
132
+ height: 100%;
133
+ object-fit: contain;
134
+ display: block;
135
+ `;
136
+ StyledShortcutImg.defaultProps = defaultThemeProp;
137
+ export const StyledCardContentWrapper = styled.div(({ layoutVariant, hasDescription, theme: { base } }) => css `
138
+ display: flex;
139
+ flex: 1;
140
+ min-width: 0;
141
+
142
+ ${layoutVariant === 'inline' &&
143
+ css `
144
+ flex-direction: row;
145
+ gap: calc(${base.spacing} * 1.5);
146
+ align-items: ${hasDescription ? 'flex-start' : 'center'};
147
+ `}
148
+
149
+ ${layoutVariant === 'stacked' &&
150
+ css `
151
+ flex-direction: column;
152
+ gap: calc(${base.spacing} * 2);
153
+ align-items: center;
154
+ justify-content: center;
155
+ `}
156
+ `);
157
+ StyledCardContentWrapper.defaultProps = defaultThemeProp;
116
158
  //# sourceMappingURL=Shortcuts.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Shortcuts.styles.js","sourceRoot":"","sources":["../../../src/components/Shortcuts/Shortcuts.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GA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AAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;;;gBAGd,IAAI,CAAC,OAAO;GACzB,CACF,CAAC;AAEF,cAAc,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE/C,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CACnC,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;mBACX,IAAI,CAAC,aAAa,CAAC,CAAC,WAAW,CAAC;;;GAGhD,CACF,CAAC;AAEF,UAAU,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE3C,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;CAE7C,CAAC;AAEF,kBAAkB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { mix } from 'polished';\n\nimport { Button, defaultThemeProp, Icon, Text, tryCatch } from '@pega/cosmos-react-core';\n\nexport const StyledShortcutsCardsWrapper = styled.div`\n container-type: inline-size;\n`;\n\nexport const StyledShortcutsCardsContainer = styled.ul(({ theme: { base } }) => {\n return css`\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(min(calc(${base.spacing} * 30), 100%), 1fr));\n gap: ${base.spacing};\n list-style: none;\n padding: ${base.spacing} 0;\n margin: 0;\n\n @container (min-width: ${parseFloat(base.breakpoints.sm)}rem) {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n grid-auto-rows: 1fr;\n justify-content: start;\n align-items: stretch;\n width: 100%;\n }\n\n @container (min-width: ${parseFloat(base.breakpoints.md)}rem) {\n grid-template-columns: repeat(4, minmax(0, 1fr));\n }\n `;\n});\n\nStyledShortcutsCardsContainer.defaultProps = defaultThemeProp;\n\nexport const StyledShortcutsCategoriesContainer = styled.div(\n ({ theme: { base } }) => css`\n display: grid;\n grid-template-columns: minmax(0, 1fr);\n gap: calc(${base.spacing} * 2);\n width: 100%;\n padding-block-start: ${base.spacing};\n container-type: inline-size;\n `\n);\n\nStyledShortcutsCategoriesContainer.defaultProps = defaultThemeProp;\n\nexport const StyledShortcutsCategoryHeading = styled(Text)(({ theme: { base } }) => {\n return css`\n margin-block-end: ${base.spacing};\n `;\n});\n\nStyledShortcutsCategoryHeading.defaultProps = defaultThemeProp;\n\nexport const StyledShortcutsCard = styled.li`\n display: flex;\n flex-direction: column;\n`;\n\nexport const StyledShortcutsCardButton = styled(Button)<{ layoutVariant: 'stacked' | 'inline' }>(({\n theme: { base, components },\n layoutVariant\n}) => {\n const hoverBackgroundColor = tryCatch(() =>\n mix(0.9, base.palette['primary-background'], components.button['secondary-color'])\n );\n\n return css`\n display: flex;\n align-items: center;\n justify-content: flex-start;\n flex: 1;\n width: 100%;\n border: 0.0625rem solid ${base.palette['border-line']};\n border-radius: ${base['border-radius']};\n background: ${base.palette['primary-background']};\n padding-inline: calc(${base.spacing} * 2);\n padding-block: calc(${base.spacing} * 1.5);\n\n &:hover {\n background: ${hoverBackgroundColor};\n }\n\n ${layoutVariant === 'stacked' &&\n css`\n flex-direction: column;\n justify-content: center;\n gap: calc(${base.spacing} * 2);\n text-align: center;\n min-height: 8rem;\n `}\n\n ${layoutVariant === 'inline' &&\n css`\n flex-direction: row;\n gap: calc(${base.spacing} * 1.5);\n text-align: start;\n `}\n `;\n});\n\nStyledShortcutsCardButton.defaultProps = defaultThemeProp;\n\nexport const StyledShortcutsCardIcon = styled(Icon)<{\n layoutVariant: 'stacked' | 'inline';\n iconColor?: string;\n}>(\n ({ layoutVariant, iconColor }) => css`\n flex-shrink: 0;\n\n ${layoutVariant === 'stacked' &&\n css`\n width: 3rem;\n height: 3rem;\n `}\n\n ${iconColor &&\n css`\n color: ${iconColor};\n `}\n `\n);\n\nStyledShortcutsCardIcon.defaultProps = defaultThemeProp;\n\nexport const StyledLabelRow = styled.span(\n ({ theme: { base } }) => css`\n display: flex;\n align-items: center;\n gap: calc(${base.spacing} * 0.5);\n `\n);\n\nStyledLabelRow.defaultProps = defaultThemeProp;\n\nexport const StyledText = styled.span(\n ({ theme: { base } }) => css`\n font-weight: ${base['font-weight']['semi-bold']};\n font-size: 1em;\n color: CanvasText;\n `\n);\n\nStyledText.defaultProps = defaultThemeProp;\n\nexport const StyledExternalIcon = styled(Icon)`\n flex-shrink: 0;\n`;\n\nStyledExternalIcon.defaultProps = defaultThemeProp;\n"]}
1
+ {"version":3,"file":"Shortcuts.styles.js","sourceRoot":"","sources":["../../../src/components/Shortcuts/Shortcuts.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACzF,OAAO,EAAE,SAAS,EAAE,MAAM,2CAA2C,CAAC;AAEtE,MAAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC,GAAG,CAAA;;CAEpD,CAAC;AAEF,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE;IAC7E,OAAO,GAAG,CAAA;;+DAEmD,IAAI,CAAC,OAAO;WAChE,IAAI,CAAC,OAAO;;eAER,IAAI,CAAC,OAAO;;;6BAGE,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;;;;;;;;6BAQ/B,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;;;GAGzD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,6BAA6B,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE9D,MAAM,CAAC,MAAM,kCAAkC,GAAG,MAAM,CAAC,GAAG,CAC1D,CAAC,EAAE,KAAK,EA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,gBAAgB,CAAC;AAE/C,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;CAE7C,CAAC;AAEF,kBAAkB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEnD,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC,IAAI,CACrD,CAAC,EACC,KAAK,EAAE,EACL,IAAI,EACJ,UAAU,EAAE,EAAE,IAAI,EAAE,EACrB,EACF,EAAE,EAAE,CAAC,GAAG,CAAA;;;0BAGe,IAAI,CAAC,eAAe,CAAC;aAClC,IAAI,CAAC,IAAI,CAAC,CAAC;cACV,IAAI,CAAC,IAAI,CAAC,CAAC;GACtB,CACF,CAAC;AAEF,4BAA4B,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE7D,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;CAK1C,CAAC;AAEF,iBAAiB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAElD,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,GAAG,CAIhD,CAAC,EAAE,aAAa,EAAE,cAAc,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;;;;;MAKvD,aAAa,KAAK,QAAQ;IAC5B,GAAG,CAAA;;kBAEW,IAAI,CAAC,OAAO;qBACT,cAAc,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ;KACxD;;MAEC,aAAa,KAAK,SAAS;IAC7B,GAAG,CAAA;;kBAEW,IAAI,CAAC,OAAO;;;KAGzB;GACF,CACF,CAAC;AAEF,wBAAwB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { mix } from 'polished';\n\nimport { Button, defaultThemeProp, Icon, Text, tryCatch } from '@pega/cosmos-react-core';\nimport { lineClamp } from '@pega/cosmos-react-core/lib/styles/mixins';\n\nexport const StyledShortcutsCardsWrapper = styled.div`\n container-type: inline-size;\n`;\n\nexport const StyledShortcutsCardsContainer = styled.ul(({ theme: { base } }) => {\n return css`\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(min(calc(${base.spacing} * 30), 100%), 1fr));\n gap: ${base.spacing};\n list-style: none;\n padding: ${base.spacing} 0;\n margin: 0;\n\n @container (min-width: ${parseFloat(base.breakpoints.sm)}rem) {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n grid-auto-rows: 1fr;\n justify-content: start;\n align-items: stretch;\n width: 100%;\n }\n\n @container (min-width: ${parseFloat(base.breakpoints.md)}rem) {\n grid-template-columns: repeat(4, minmax(0, 1fr));\n }\n `;\n});\n\nStyledShortcutsCardsContainer.defaultProps = defaultThemeProp;\n\nexport const StyledShortcutsCategoriesContainer = styled.div(\n ({ theme: { base } }) => css`\n display: grid;\n grid-template-columns: minmax(0, 1fr);\n gap: calc(${base.spacing} * 2);\n width: 100%;\n padding-block-start: ${base.spacing};\n container-type: inline-size;\n `\n);\n\nStyledShortcutsCategoriesContainer.defaultProps = defaultThemeProp;\n\nexport const StyledShortcutsCategoryHeading = styled(Text)(({ theme: { base } }) => {\n return css`\n margin-block-end: ${base.spacing};\n `;\n});\n\nStyledShortcutsCategoryHeading.defaultProps = defaultThemeProp;\n\nexport const StyledShortcutsCard = styled.li`\n display: flex;\n flex-direction: column;\n`;\n\nexport const StyledTextContent = styled.div<{ layoutVariant: 'stacked' | 'inline' }>(\n ({ layoutVariant }) => css`\n ${layoutVariant === 'inline' &&\n css`\n flex: 1;\n min-width: 0;\n align-items: flex-start;\n `}\n\n ${layoutVariant === 'stacked' &&\n css`\n align-items: center;\n width: 100%;\n `}\n `\n);\n\nStyledTextContent.defaultProps = defaultThemeProp;\n\nexport const StyledText = styled.span(\n ({ theme: { base } }) => css`\n font-weight: ${base['font-weight']['semi-bold']};\n font-size: 1em;\n color: CanvasText;\n ${lineClamp(3)}\n `\n);\n\nStyledText.defaultProps = defaultThemeProp;\n\nexport const StyledSubtitleText = styled(Text)(\n () => css`\n ${lineClamp(3)}\n text-align: inherit;\n `\n);\n\nStyledSubtitleText.defaultProps = defaultThemeProp;\n\nexport const StyledShortcutsCardButton = styled(Button)<{\n layoutVariant: 'stacked' | 'inline';\n}>(({ theme: { base, components }, layoutVariant }) => {\n const hoverBackgroundColor = tryCatch(() =>\n mix(0.9, base.palette['primary-background'], components.button['secondary-color'])\n );\n\n return css`\n display: flex;\n align-items: center;\n justify-content: flex-start;\n text-align: ${layoutVariant === 'stacked' ? 'center' : 'start'};\n flex: 1;\n width: 100%;\n border: 0.0625rem solid ${base.palette['border-line']};\n border-radius: ${base['border-radius']};\n background: ${base.palette['primary-background']};\n padding-inline: calc(${base.spacing} * 2);\n padding-block: calc(${base.spacing} * 1.5);\n\n &:hover {\n background: ${hoverBackgroundColor};\n text-decoration: none;\n\n ${StyledText} {\n text-decoration: underline;\n }\n }\n `;\n});\n\nStyledShortcutsCardButton.defaultProps = defaultThemeProp;\n\nexport const StyledShortcutsCardIcon = styled(Icon)<{\n iconColor?: string;\n}>(\n ({ iconColor }) => css`\n flex-shrink: 0;\n\n ${iconColor &&\n css`\n color: ${iconColor};\n `}\n `\n);\n\nStyledShortcutsCardIcon.defaultProps = defaultThemeProp;\n\nexport const StyledLabelRow = styled.span(\n ({ theme: { base } }) => css`\n display: flex;\n align-items: center;\n gap: calc(${base.spacing} * 0.5);\n `\n);\n\nStyledLabelRow.defaultProps = defaultThemeProp;\n\nexport const StyledExternalIcon = styled(Icon)`\n flex-shrink: 0;\n`;\n\nStyledExternalIcon.defaultProps = defaultThemeProp;\n\nexport const StyledShortcutImageContainer = styled.span(\n ({\n theme: {\n base,\n components: { icon }\n }\n }) => css`\n flex-shrink: 0;\n overflow: hidden;\n border-radius: calc(${base['border-radius']} / 2);\n width: ${icon.size.m};\n height: ${icon.size.m};\n `\n);\n\nStyledShortcutImageContainer.defaultProps = defaultThemeProp;\n\nexport const StyledShortcutImg = styled.img`\n width: 100%;\n height: 100%;\n object-fit: contain;\n display: block;\n`;\n\nStyledShortcutImg.defaultProps = defaultThemeProp;\n\nexport const StyledCardContentWrapper = styled.div<{\n layoutVariant: 'stacked' | 'inline';\n hasDescription: boolean;\n}>(\n ({ layoutVariant, hasDescription, theme: { base } }) => css`\n display: flex;\n flex: 1;\n min-width: 0;\n\n ${layoutVariant === 'inline' &&\n css`\n flex-direction: row;\n gap: calc(${base.spacing} * 1.5);\n align-items: ${hasDescription ? 'flex-start' : 'center'};\n `}\n\n ${layoutVariant === 'stacked' &&\n css`\n flex-direction: column;\n gap: calc(${base.spacing} * 2);\n align-items: center;\n justify-content: center;\n `}\n `\n);\n\nStyledCardContentWrapper.defaultProps = defaultThemeProp;\n"]}
@@ -13,6 +13,10 @@ export interface ShortcutLinkItem extends ShortcutItemBase {
13
13
  type: 'external';
14
14
  /** Absolute URL the link navigates to. Opens in a new tab. */
15
15
  href: string;
16
+ /** Optional subtitle displayed below the label. */
17
+ description?: string;
18
+ /** Optional image URL. Renders in place of the icon; falls back to icon if the image fails to load. */
19
+ image?: string;
16
20
  }
17
21
  export interface ShortcutNavItem extends ShortcutItemBase {
18
22
  /** Discriminant — this item navigates to a portal landing page. */
@@ -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,cAAc,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1E,UAAU,gBAAgB;IACxB,2CAA2C;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB;IACxD,6DAA6D;IAC7D,IAAI,EAAE,UAAU,CAAC;IACjB,8DA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C;IACjB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC/B,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 { 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}\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}\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 {\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 { 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}\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 {\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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/cosmos-react-work",
3
- "version": "9.5.5-2",
3
+ "version": "9.5.5-4",
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": "9.5.5-2",
18
- "@pega/cosmos-react-rte": "9.5.5-2",
17
+ "@pega/cosmos-react-core": "9.5.5-4",
18
+ "@pega/cosmos-react-rte": "9.5.5-4",
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",