@pega/cosmos-react-work 9.4.0 → 9.5.0

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.
@@ -91,7 +91,7 @@ export const StyledInlineFieldValueItem = styled.div `
91
91
  }
92
92
  `;
93
93
  export const StyledDetailsList = styled(StyledFieldValueList)(({ stacked, labelLength, variant, theme }) => {
94
- const { base: { spacing, palette, 'content-width': { md } }, components: { details: { 'field-label': fieldLabelPosition }, 'field-value-list': { inline: { detached } } } } = theme;
94
+ const { base: { spacing, palette, 'content-width': { md } }, components: { details: { 'field-label': fieldLabelPosition }, 'field-value-list': { inline: { detached, 'border-style': borderStyle } } } } = theme;
95
95
  const { inFieldGroup } = useContext(DetailsContext);
96
96
  const labelTop = (stacked || fieldLabelPosition === 'stacked') && variant !== 'value-comparison';
97
97
  const isValueComparison = variant === 'value-comparison';
@@ -128,7 +128,7 @@ export const StyledDetailsList = styled(StyledFieldValueList)(({ stacked, labelL
128
128
  css `
129
129
  padding-block: calc(0.5 * ${spacing});
130
130
  &:not(:last-child) {
131
- border-bottom: 0.0625rem dashed ${palette['border-line']};
131
+ border-bottom: 0.0625rem ${borderStyle} ${palette['border-line']};
132
132
  }
133
133
  `}
134
134
 
@@ -145,7 +145,7 @@ export const StyledDetailsList = styled(StyledFieldValueList)(({ stacked, labelL
145
145
  css `
146
146
  padding-block: calc(0.5 * ${spacing});
147
147
  &:not(:last-child) {
148
- border-bottom: 0.0625rem dashed ${palette['border-line']};
148
+ border-bottom: 0.0625rem ${borderStyle} ${palette['border-line']};
149
149
  }
150
150
  `}
151
151
  }
@@ -219,7 +219,7 @@ const spacingTop = (spacing) => {
219
219
  `;
220
220
  };
221
221
  export const StyledDetails = styled.div(({ variant, columnCount, theme }) => {
222
- const { base: { spacing, 'border-radius': baseBorderRadius, palette: { 'border-line': borderColor } }, components: { 'form-control': { 'border-width': borderWidth }, button: { 'border-radius': buttonBorderRadius }, 'field-value-list': { inline: { detached } } } } = theme;
222
+ const { base: { spacing, 'border-radius': baseBorderRadius, palette: { 'border-line': borderColor } }, components: { 'form-control': { 'border-width': borderWidth }, button: { 'border-radius': buttonBorderRadius }, 'field-value-list': { inline: { detached, 'border-style': borderStyle } } } } = theme;
223
223
  return css `
224
224
  &:not(:first-child) {
225
225
  ${spacingTop(spacing)}
@@ -266,7 +266,7 @@ export const StyledDetails = styled.div(({ variant, columnCount, theme }) => {
266
266
  css `
267
267
  & + ${StyledDetailsList} {
268
268
  margin-block-start: 0;
269
- border-block-start: 0.0625rem dashed ${theme.base.palette['border-line']};
269
+ border-block-start: 0.0625rem ${borderStyle} ${theme.base.palette['border-line']};
270
270
  }
271
271
  `};
272
272
  `;
@@ -1 +1 @@
1
- {"version":3,"file":"Details.styles.js","sourceRoot":"","sources":["../../../src/components/Details/Details.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,IAAI,EACL,MAAM,yBAAyB,CAAC;AAQjC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AA6B9C,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AACvC,MAAM,CAAC,MAAM,2BAA2B,GAAG,OAAO,CAAC;AACnD,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC;AAEpD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;CAEzC,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC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AAK,YAAY;YAC9B,GAAG,CAAA;;;kBAGK,6BAA6B,UAAU,mBAAmB,MAAM,OAAO;;0CAE/C,mBAAmB,MAAM,OAAO;;WAE/D;SACF;;UAEC,WAAW,KAAK,CAAC;QACnB,GAAG,CAAA;;;;kCAIuB,aAAa;cACjC,UAAU,CAAC,OAAO,CAAC;;SAExB;;KAEJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,mBAAmB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport type { DefaultTheme } from 'styled-components';\nimport { useContext } from 'react';\nimport { transparentize } from 'polished';\n\nimport {\n calculateFontSize,\n defaultThemeProp,\n StyledFieldValue,\n StyledStackedFieldValue,\n StyledFieldValueList,\n StyledIcon,\n useDirection,\n StyledButtonLink,\n Text\n} from '@pega/cosmos-react-core';\nimport type {\n StyledFieldValueListProps,\n FontSize,\n PropsWithDefaults\n} from '@pega/cosmos-react-core';\n\nimport type { DetailsProps } from './Details';\nimport DetailsContext from './DetailsContext';\n\ninterface StyledDetailsListProps extends StyledFieldValueListProps {\n /** Whether individual list items all have labels stacks on top */\n stacked?: boolean;\n /** The character length applied to all list labels */\n labelLength?: number;\n theme: DefaultTheme;\n}\n\ninterface StyledDetailColumnsProps {\n /**\n * Number of columns in the list\n * @default 1\n */\n columnCount?: 1 | 2 | 3;\n /**\n * Arrangement of columns\n */\n arrangement?: DetailsProps['arrangement'];\n /**\n * Style variations\n */\n variant?: DetailsProps['variant'];\n theme: DefaultTheme;\n}\n\ntype StyledDetailsListPropsWithDefaults = PropsWithDefaults<StyledDetailsListProps>;\n\nconst rowGapMultiplier = 1;\nexport const columnGapMultiplier = 5.5;\nexport const oneColumnDetailsColumnWidth = '100ch';\nexport const multiColumnDetailsColumnWidth = '80ch';\n\nexport const StyledNameText = styled(Text)`\n word-break: break-word;\n`;\n\nexport const StyledFieldValueGroupLabel = styled.div(({ theme }) => {\n const {\n base: { spacing, animation, palette }\n } = theme;\n const { rtl } = useDirection();\n const {\n components: {\n 'field-value-list': {\n inline: { detached }\n }\n }\n } = theme;\n return css`\n width: 100%;\n grid-column: 1 / -1;\n margin-block-end: calc(${rowGapMultiplier} * ${spacing});\n ${detached &&\n css`\n border-bottom: 0.0625rem solid ${palette['border-line']};\n padding-bottom: calc(0.5 * ${spacing});\n `}\n\n ${StyledButtonLink} ${StyledIcon} {\n transition: transform ${animation.speed} ${animation.timing.ease};\n }\n\n ${StyledButtonLink}[aria-expanded='true'] ${StyledIcon} {\n transform: rotate(90deg);\n }\n\n ${StyledButtonLink}[aria-expanded='false'] ${StyledIcon} {\n transform: rotate(${rtl ? 180 : 0}deg);\n }\n `;\n});\n\nStyledFieldValueGroupLabel.defaultProps = defaultThemeProp;\n\nexport const StyledDetailDescription = styled.div(({ theme }) => {\n const {\n base: {\n spacing,\n 'content-width': { xl }\n }\n } = theme;\n\n return css`\n max-width: ${xl};\n margin-block-end: calc(1.5 * ${spacing});\n `;\n});\n\nStyledDetailDescription.defaultProps = defaultThemeProp;\n\nexport const StyledDetailBanner = styled.div(({ theme }) => {\n const {\n base: { spacing }\n } = theme;\n\n return css`\n margin-block-end: calc(1.5 * ${spacing});\n `;\n});\n\nStyledDetailBanner.defaultProps = defaultThemeProp;\n\nexport const StyledDetailColumn = styled.div(({ theme }) => {\n const {\n base: { spacing }\n } = theme;\n\n return css`\n display: flex;\n flex-direction: column;\n row-gap: calc(${rowGapMultiplier} * ${spacing});\n width: 100%;\n `;\n});\n\nStyledDetailColumn.defaultProps = defaultThemeProp;\n\nexport const StyledHighlightedDetailList = styled.dl(({ theme }) => {\n const {\n base: { spacing, palette }\n } = theme;\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n max-width: calc(${multiColumnDetailsColumnWidth} * 3 + ${columnGapMultiplier} * ${spacing} * 2);\n padding-block-end: calc(1.5 * ${spacing});\n\n dd {\n font-size: ${fontSize[theme.components.text.h1['font-size'] as FontSize]};\n font-weight: ${theme.components.text.h1['font-weight']};\n }\n\n + hr {\n border-top: unset;\n border-radius: unset;\n border-style: unset;\n border-bottom: 0.0625rem solid ${palette['border-line']};\n margin-block-end: calc(1.5 * ${spacing});\n }\n `;\n});\n\nStyledHighlightedDetailList.defaultProps = defaultThemeProp;\n\nexport const StyledInlineFieldValueItem = styled.div`\n > * {\n min-width: 0;\n }\n`;\n\nexport const StyledDetailsList = styled(StyledFieldValueList)<StyledDetailsListPropsWithDefaults>(({\n stacked,\n labelLength,\n variant,\n theme\n}) => {\n const {\n base: {\n spacing,\n palette,\n 'content-width': { md }\n },\n components: {\n details: { 'field-label': fieldLabelPosition },\n 'field-value-list': {\n inline: { detached }\n }\n }\n } = theme;\n\n const { inFieldGroup } = useContext(DetailsContext);\n const labelTop = (stacked || fieldLabelPosition === 'stacked') && variant !== 'value-comparison';\n const isValueComparison = variant === 'value-comparison';\n const fieldValueGapMultiplier = 2;\n\n return css`\n /* Field Grid Styles */\n display: flex;\n flex-direction: column;\n row-gap: ${detached ? 0 : `calc(${rowGapMultiplier} * ${spacing})`};\n width: 100%;\n max-width: ${oneColumnDetailsColumnWidth};\n height: fit-content;\n container-type: inline-size;\n container-name: details-list;\n\n ${StyledFieldValue} {\n word-break: break-word;\n overflow: auto;\n\n /* Negative margin to account for overflow clipping of focus indicator */\n padding: 0.3rem;\n margin: -0.3rem;\n }\n\n ${StyledInlineFieldValueItem}, ${StyledStackedFieldValue} {\n width: 100%;\n }\n\n ${StyledInlineFieldValueItem} {\n grid-template-columns: minmax(14ch, ${labelLength}ch) minmax(14ch, 1fr);\n grid-template-rows: max-content;\n column-gap: calc(${fieldValueGapMultiplier} * ${spacing});\n ${detached &&\n css`\n padding-block: calc(0.5 * ${spacing});\n &:not(:last-child) {\n border-bottom: 0.0625rem dashed ${palette['border-line']};\n }\n `}\n\n ${inFieldGroup &&\n css`\n grid-template-columns:\n minmax(calc(14ch - ${spacing}), calc(${labelLength}ch - ${spacing}))\n minmax(14ch, 1fr);\n `};\n }\n\n ${StyledStackedFieldValue} {\n ${detached &&\n css`\n padding-block: calc(0.5 * ${spacing});\n &:not(:last-child) {\n border-bottom: 0.0625rem dashed ${palette['border-line']};\n }\n `}\n }\n\n /* Stacked Label Styles */\n ${labelTop &&\n css`\n grid-template-columns: minmax(0, 1fr);\n row-gap: 0;\n\n dt {\n max-width: 100%;\n }\n\n ${!isValueComparison &&\n css`\n ${StyledStackedFieldValue}:not(:first-child) {\n margin-block-start: calc(${rowGapMultiplier} * ${spacing});\n }\n `}\n `}\n\n /* Value Comparison Styles */\n ${isValueComparison &&\n css`\n display: grid;\n grid-template-columns: auto auto;\n column-gap: 0;\n row-gap: calc(0.5 * ${spacing});\n\n > dd {\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n }\n `}\n\n /* Responsive behavior */\n ${!labelTop &&\n !isValueComparison &&\n css`\n @container details-list (width < ${md}) {\n ${StyledInlineFieldValueItem} {\n grid-template-columns: minmax(0, ${labelLength}ch) minmax(50%, 1fr);\n\n ${inFieldGroup &&\n css`\n grid-template-columns:\n minmax(0, calc(${labelLength}ch - ${spacing}))\n minmax(calc(50% + 0.5 * ${spacing}), 1fr);\n `}\n }\n\n dd {\n min-width: 50%;\n }\n }\n `}\n `;\n});\n\nStyledDetailsList.defaultProps = defaultThemeProp;\n\nconst spacingTop = (spacing: string) => {\n return css`\n > ${StyledFieldValueGroupLabel} {\n margin-block-start: calc((1.5 * ${rowGapMultiplier}) * ${spacing});\n }\n\n > ${StyledDetailDescription}:first-child {\n margin-block-start: calc(1.5 * ${spacing});\n }\n `;\n};\n\nexport const StyledDetails = styled.div<{\n variant?: DetailsProps['variant'];\n columnCount?: number;\n}>(({ variant, columnCount, theme }) => {\n const {\n base: {\n spacing,\n 'border-radius': baseBorderRadius,\n palette: { 'border-line': borderColor }\n },\n components: {\n 'form-control': { 'border-width': borderWidth },\n button: { 'border-radius': buttonBorderRadius },\n 'field-value-list': {\n inline: { detached }\n }\n }\n } = theme;\n\n return css`\n &:not(:first-child) {\n ${spacingTop(spacing)}\n }\n\n ${variant === 'field-group' &&\n css`\n & + ${StyledDetailsList} {\n margin-block-start: calc(1.5 * ${spacing});\n }\n\n ${columnCount === 1 &&\n css`\n position: relative;\n padding-inline-start: ${spacing};\n\n ${detached &&\n css`\n padding-inline-start: calc(1.25 * ${spacing});\n `}\n\n &::before {\n content: '';\n position: absolute;\n inset-block-start: calc(-1 * ${spacing});\n inset-block-end: 0;\n inset-inline-start: 0;\n width: ${borderWidth};\n background: ${borderColor};\n\n ${detached &&\n css`\n inset-block-start: 0;\n width: 0.25rem;\n background: ${transparentize(0.67, borderColor)};\n border-radius: calc(${buttonBorderRadius} * ${baseBorderRadius});\n `}\n }\n `}\n `}\n\n ${!variant &&\n detached &&\n css`\n & + ${StyledDetailsList} {\n margin-block-start: 0;\n border-block-start: 0.0625rem dashed ${theme.base.palette['border-line']};\n }\n `};\n `;\n});\n\nStyledDetails.defaultProps = defaultThemeProp;\n\nexport const StyledDetailColumns = styled.div<StyledDetailColumnsProps>(\n ({ theme, arrangement, columnCount = 1 }) => {\n const {\n base: { spacing }\n } = theme;\n\n return css`\n width: 100%;\n\n ${columnCount === 2 &&\n !arrangement &&\n css`\n flex-wrap: wrap;\n `}\n\n ${columnCount === 1 &&\n css`\n flex-direction: column;\n row-gap: calc(${rowGapMultiplier} * ${spacing});\n `};\n\n /* Column Widths */\n > ${StyledDetailColumn} {\n overflow: hidden;\n\n /* Negative margin to account for overflow clipping of focus indicator */\n padding: 0.3rem;\n margin: -0.3rem;\n\n ${columnCount === 3 &&\n css`\n width: ${multiColumnDetailsColumnWidth};\n max-width: calc(33.33% - (${columnGapMultiplier} * ${spacing} * 2) / 3);\n `}\n\n ${columnCount === 2 &&\n css`\n width: calc(50% - (${columnGapMultiplier} * ${spacing}) / 2);\n max-width: unset;\n\n &:nth-child(3) > ${StyledDetails}:first-child {\n ${spacingTop(spacing)}\n }\n `}\n\n ${columnCount !== 1 &&\n css`\n ${arrangement === 'narrowWide' &&\n css`\n &:nth-child(2) {\n width: calc(\n ${multiColumnDetailsColumnWidth} * 2 + ${columnGapMultiplier} * ${spacing}\n );\n max-width: calc(66.66% - (${columnGapMultiplier} * ${spacing}) / 3);\n }\n `}\n\n ${arrangement === 'wideNarrow' &&\n css`\n &:nth-child(1) {\n width: calc(\n ${multiColumnDetailsColumnWidth} * 2 + ${columnGapMultiplier} * ${spacing}\n );\n max-width: calc(66.66% - (${columnGapMultiplier} * ${spacing}) / 3);\n }\n `}\n `}\n\n ${columnCount === 1 &&\n css`\n width: 100%;\n max-width: 100%;\n\n &:not(:first-child) > ${StyledDetails}:first-child {\n ${spacingTop(spacing)}\n }\n `}\n }\n `;\n }\n);\n\nStyledDetailColumns.defaultProps = defaultThemeProp;\n"]}
1
+ {"version":3,"file":"Details.styles.js","sourceRoot":"","sources":["../../../src/components/Details/Details.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,IAAI,EACL,MAAM,yBAAyB,CAAC;AAQjC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AA6B9C,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AACvC,MAAM,CAAC,MAAM,2BAA2B,GAAG,OAAO,CAAC;AACnD,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC;AAEpD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;CAEzC,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAA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AAA;;;kBAGK,6BAA6B,UAAU,mBAAmB,MAAM,OAAO;;0CAE/C,mBAAmB,MAAM,OAAO;;WAE/D;;YAEC,WAAW,KAAK,YAAY;YAC9B,GAAG,CAAA;;;kBAGK,6BAA6B,UAAU,mBAAmB,MAAM,OAAO;;0CAE/C,mBAAmB,MAAM,OAAO;;WAE/D;SACF;;UAEC,WAAW,KAAK,CAAC;QACnB,GAAG,CAAA;;;;kCAIuB,aAAa;cACjC,UAAU,CAAC,OAAO,CAAC;;SAExB;;KAEJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,mBAAmB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport type { DefaultTheme } from 'styled-components';\nimport { useContext } from 'react';\nimport { transparentize } from 'polished';\n\nimport {\n calculateFontSize,\n defaultThemeProp,\n StyledFieldValue,\n StyledStackedFieldValue,\n StyledFieldValueList,\n StyledIcon,\n useDirection,\n StyledButtonLink,\n Text\n} from '@pega/cosmos-react-core';\nimport type {\n StyledFieldValueListProps,\n FontSize,\n PropsWithDefaults\n} from '@pega/cosmos-react-core';\n\nimport type { DetailsProps } from './Details';\nimport DetailsContext from './DetailsContext';\n\ninterface StyledDetailsListProps extends StyledFieldValueListProps {\n /** Whether individual list items all have labels stacks on top */\n stacked?: boolean;\n /** The character length applied to all list labels */\n labelLength?: number;\n theme: DefaultTheme;\n}\n\ninterface StyledDetailColumnsProps {\n /**\n * Number of columns in the list\n * @default 1\n */\n columnCount?: 1 | 2 | 3;\n /**\n * Arrangement of columns\n */\n arrangement?: DetailsProps['arrangement'];\n /**\n * Style variations\n */\n variant?: DetailsProps['variant'];\n theme: DefaultTheme;\n}\n\ntype StyledDetailsListPropsWithDefaults = PropsWithDefaults<StyledDetailsListProps>;\n\nconst rowGapMultiplier = 1;\nexport const columnGapMultiplier = 5.5;\nexport const oneColumnDetailsColumnWidth = '100ch';\nexport const multiColumnDetailsColumnWidth = '80ch';\n\nexport const StyledNameText = styled(Text)`\n word-break: break-word;\n`;\n\nexport const StyledFieldValueGroupLabel = styled.div(({ theme }) => {\n const {\n base: { spacing, animation, palette }\n } = theme;\n const { rtl } = useDirection();\n const {\n components: {\n 'field-value-list': {\n inline: { detached }\n }\n }\n } = theme;\n return css`\n width: 100%;\n grid-column: 1 / -1;\n margin-block-end: calc(${rowGapMultiplier} * ${spacing});\n ${detached &&\n css`\n border-bottom: 0.0625rem solid ${palette['border-line']};\n padding-bottom: calc(0.5 * ${spacing});\n `}\n\n ${StyledButtonLink} ${StyledIcon} {\n transition: transform ${animation.speed} ${animation.timing.ease};\n }\n\n ${StyledButtonLink}[aria-expanded='true'] ${StyledIcon} {\n transform: rotate(90deg);\n }\n\n ${StyledButtonLink}[aria-expanded='false'] ${StyledIcon} {\n transform: rotate(${rtl ? 180 : 0}deg);\n }\n `;\n});\n\nStyledFieldValueGroupLabel.defaultProps = defaultThemeProp;\n\nexport const StyledDetailDescription = styled.div(({ theme }) => {\n const {\n base: {\n spacing,\n 'content-width': { xl }\n }\n } = theme;\n\n return css`\n max-width: ${xl};\n margin-block-end: calc(1.5 * ${spacing});\n `;\n});\n\nStyledDetailDescription.defaultProps = defaultThemeProp;\n\nexport const StyledDetailBanner = styled.div(({ theme }) => {\n const {\n base: { spacing }\n } = theme;\n\n return css`\n margin-block-end: calc(1.5 * ${spacing});\n `;\n});\n\nStyledDetailBanner.defaultProps = defaultThemeProp;\n\nexport const StyledDetailColumn = styled.div(({ theme }) => {\n const {\n base: { spacing }\n } = theme;\n\n return css`\n display: flex;\n flex-direction: column;\n row-gap: calc(${rowGapMultiplier} * ${spacing});\n width: 100%;\n `;\n});\n\nStyledDetailColumn.defaultProps = defaultThemeProp;\n\nexport const StyledHighlightedDetailList = styled.dl(({ theme }) => {\n const {\n base: { spacing, palette }\n } = theme;\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n max-width: calc(${multiColumnDetailsColumnWidth} * 3 + ${columnGapMultiplier} * ${spacing} * 2);\n padding-block-end: calc(1.5 * ${spacing});\n\n dd {\n font-size: ${fontSize[theme.components.text.h1['font-size'] as FontSize]};\n font-weight: ${theme.components.text.h1['font-weight']};\n }\n\n + hr {\n border-top: unset;\n border-radius: unset;\n border-style: unset;\n border-bottom: 0.0625rem solid ${palette['border-line']};\n margin-block-end: calc(1.5 * ${spacing});\n }\n `;\n});\n\nStyledHighlightedDetailList.defaultProps = defaultThemeProp;\n\nexport const StyledInlineFieldValueItem = styled.div`\n > * {\n min-width: 0;\n }\n`;\n\nexport const StyledDetailsList = styled(StyledFieldValueList)<StyledDetailsListPropsWithDefaults>(({\n stacked,\n labelLength,\n variant,\n theme\n}) => {\n const {\n base: {\n spacing,\n palette,\n 'content-width': { md }\n },\n components: {\n details: { 'field-label': fieldLabelPosition },\n 'field-value-list': {\n inline: { detached, 'border-style': borderStyle }\n }\n }\n } = theme;\n\n const { inFieldGroup } = useContext(DetailsContext);\n const labelTop = (stacked || fieldLabelPosition === 'stacked') && variant !== 'value-comparison';\n const isValueComparison = variant === 'value-comparison';\n const fieldValueGapMultiplier = 2;\n\n return css`\n /* Field Grid Styles */\n display: flex;\n flex-direction: column;\n row-gap: ${detached ? 0 : `calc(${rowGapMultiplier} * ${spacing})`};\n width: 100%;\n max-width: ${oneColumnDetailsColumnWidth};\n height: fit-content;\n container-type: inline-size;\n container-name: details-list;\n\n ${StyledFieldValue} {\n word-break: break-word;\n overflow: auto;\n\n /* Negative margin to account for overflow clipping of focus indicator */\n padding: 0.3rem;\n margin: -0.3rem;\n }\n\n ${StyledInlineFieldValueItem}, ${StyledStackedFieldValue} {\n width: 100%;\n }\n\n ${StyledInlineFieldValueItem} {\n grid-template-columns: minmax(14ch, ${labelLength}ch) minmax(14ch, 1fr);\n grid-template-rows: max-content;\n column-gap: calc(${fieldValueGapMultiplier} * ${spacing});\n ${detached &&\n css`\n padding-block: calc(0.5 * ${spacing});\n &:not(:last-child) {\n border-bottom: 0.0625rem ${borderStyle} ${palette['border-line']};\n }\n `}\n\n ${inFieldGroup &&\n css`\n grid-template-columns:\n minmax(calc(14ch - ${spacing}), calc(${labelLength}ch - ${spacing}))\n minmax(14ch, 1fr);\n `};\n }\n\n ${StyledStackedFieldValue} {\n ${detached &&\n css`\n padding-block: calc(0.5 * ${spacing});\n &:not(:last-child) {\n border-bottom: 0.0625rem ${borderStyle} ${palette['border-line']};\n }\n `}\n }\n\n /* Stacked Label Styles */\n ${labelTop &&\n css`\n grid-template-columns: minmax(0, 1fr);\n row-gap: 0;\n\n dt {\n max-width: 100%;\n }\n\n ${!isValueComparison &&\n css`\n ${StyledStackedFieldValue}:not(:first-child) {\n margin-block-start: calc(${rowGapMultiplier} * ${spacing});\n }\n `}\n `}\n\n /* Value Comparison Styles */\n ${isValueComparison &&\n css`\n display: grid;\n grid-template-columns: auto auto;\n column-gap: 0;\n row-gap: calc(0.5 * ${spacing});\n\n > dd {\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n }\n `}\n\n /* Responsive behavior */\n ${!labelTop &&\n !isValueComparison &&\n css`\n @container details-list (width < ${md}) {\n ${StyledInlineFieldValueItem} {\n grid-template-columns: minmax(0, ${labelLength}ch) minmax(50%, 1fr);\n\n ${inFieldGroup &&\n css`\n grid-template-columns:\n minmax(0, calc(${labelLength}ch - ${spacing}))\n minmax(calc(50% + 0.5 * ${spacing}), 1fr);\n `}\n }\n\n dd {\n min-width: 50%;\n }\n }\n `}\n `;\n});\n\nStyledDetailsList.defaultProps = defaultThemeProp;\n\nconst spacingTop = (spacing: string) => {\n return css`\n > ${StyledFieldValueGroupLabel} {\n margin-block-start: calc((1.5 * ${rowGapMultiplier}) * ${spacing});\n }\n\n > ${StyledDetailDescription}:first-child {\n margin-block-start: calc(1.5 * ${spacing});\n }\n `;\n};\n\nexport const StyledDetails = styled.div<{\n variant?: DetailsProps['variant'];\n columnCount?: number;\n}>(({ variant, columnCount, theme }) => {\n const {\n base: {\n spacing,\n 'border-radius': baseBorderRadius,\n palette: { 'border-line': borderColor }\n },\n components: {\n 'form-control': { 'border-width': borderWidth },\n button: { 'border-radius': buttonBorderRadius },\n 'field-value-list': {\n inline: { detached, 'border-style': borderStyle }\n }\n }\n } = theme;\n\n return css`\n &:not(:first-child) {\n ${spacingTop(spacing)}\n }\n\n ${variant === 'field-group' &&\n css`\n & + ${StyledDetailsList} {\n margin-block-start: calc(1.5 * ${spacing});\n }\n\n ${columnCount === 1 &&\n css`\n position: relative;\n padding-inline-start: ${spacing};\n\n ${detached &&\n css`\n padding-inline-start: calc(1.25 * ${spacing});\n `}\n\n &::before {\n content: '';\n position: absolute;\n inset-block-start: calc(-1 * ${spacing});\n inset-block-end: 0;\n inset-inline-start: 0;\n width: ${borderWidth};\n background: ${borderColor};\n\n ${detached &&\n css`\n inset-block-start: 0;\n width: 0.25rem;\n background: ${transparentize(0.67, borderColor)};\n border-radius: calc(${buttonBorderRadius} * ${baseBorderRadius});\n `}\n }\n `}\n `}\n\n ${!variant &&\n detached &&\n css`\n & + ${StyledDetailsList} {\n margin-block-start: 0;\n border-block-start: 0.0625rem ${borderStyle} ${theme.base.palette['border-line']};\n }\n `};\n `;\n});\n\nStyledDetails.defaultProps = defaultThemeProp;\n\nexport const StyledDetailColumns = styled.div<StyledDetailColumnsProps>(\n ({ theme, arrangement, columnCount = 1 }) => {\n const {\n base: { spacing }\n } = theme;\n\n return css`\n width: 100%;\n\n ${columnCount === 2 &&\n !arrangement &&\n css`\n flex-wrap: wrap;\n `}\n\n ${columnCount === 1 &&\n css`\n flex-direction: column;\n row-gap: calc(${rowGapMultiplier} * ${spacing});\n `};\n\n /* Column Widths */\n > ${StyledDetailColumn} {\n overflow: hidden;\n\n /* Negative margin to account for overflow clipping of focus indicator */\n padding: 0.3rem;\n margin: -0.3rem;\n\n ${columnCount === 3 &&\n css`\n width: ${multiColumnDetailsColumnWidth};\n max-width: calc(33.33% - (${columnGapMultiplier} * ${spacing} * 2) / 3);\n `}\n\n ${columnCount === 2 &&\n css`\n width: calc(50% - (${columnGapMultiplier} * ${spacing}) / 2);\n max-width: unset;\n\n &:nth-child(3) > ${StyledDetails}:first-child {\n ${spacingTop(spacing)}\n }\n `}\n\n ${columnCount !== 1 &&\n css`\n ${arrangement === 'narrowWide' &&\n css`\n &:nth-child(2) {\n width: calc(\n ${multiColumnDetailsColumnWidth} * 2 + ${columnGapMultiplier} * ${spacing}\n );\n max-width: calc(66.66% - (${columnGapMultiplier} * ${spacing}) / 3);\n }\n `}\n\n ${arrangement === 'wideNarrow' &&\n css`\n &:nth-child(1) {\n width: calc(\n ${multiColumnDetailsColumnWidth} * 2 + ${columnGapMultiplier} * ${spacing}\n );\n max-width: calc(66.66% - (${columnGapMultiplier} * ${spacing}) / 3);\n }\n `}\n `}\n\n ${columnCount === 1 &&\n css`\n width: 100%;\n max-width: 100%;\n\n &:not(:first-child) > ${StyledDetails}:first-child {\n ${spacingTop(spacing)}\n }\n `}\n }\n `;\n }\n);\n\nStyledDetailColumns.defaultProps = defaultThemeProp;\n"]}
@@ -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;;;;AAkLtE,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;AAqBxD,OAAO,KAAK,EAAE,cAAc,EAAgB,MAAM,mBAAmB,CAAC;;;;AAyKtE,wBAA2D"}
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useRef, forwardRef } from 'react';
3
3
  import { parseToRgb } from 'polished';
4
- import { Card, CardContent, CardHeader, EmptyState, Flex, Text, VisuallyHiddenText, registerIcon, tryCatch, useArrows, useBreakpoint, useI18n, useTestIds, useTheme, withTestIds } from '@pega/cosmos-react-core';
4
+ import { Card, CardContent, CardHeader, EmptyState, Flex, Text, VisuallyHiddenText, registerIcon, tryCatch, useArrows, useI18n, useTestIds, useTheme, withTestIds } from '@pega/cosmos-react-core';
5
5
  import * as openNewTabIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/open.icon';
6
- import { StyledExternalIcon, StyledLabelRow, StyledShortcutsCard, StyledShortcutsCardButton, StyledShortcutsCardsContainer, StyledShortcutsCategoriesContainer, StyledShortcutsCategoryHeading, StyledShortcutsCardIcon } from './Shortcuts.styles';
6
+ import { StyledExternalIcon, StyledLabelRow, StyledShortcutsCard, StyledShortcutsCardButton, StyledShortcutsCardsContainer, StyledShortcutsCardsWrapper, StyledShortcutsCategoriesContainer, StyledShortcutsCategoryHeading, StyledShortcutsCardIcon, StyledText } from './Shortcuts.styles';
7
7
  import { getShortcutsTestIds } from './Shortcuts.test-ids';
8
8
  registerIcon(openNewTabIcon);
9
9
  const itemLinkProps = (item) => {
@@ -12,7 +12,7 @@ const itemLinkProps = (item) => {
12
12
  }
13
13
  return { onClick: item.onClick };
14
14
  };
15
- const CardItem = ({ item, iconBackground, variant }) => (_jsx(StyledShortcutsCard, { children: _jsxs(StyledShortcutsCardButton, { variant: 'link', layoutVariant: variant, ...itemLinkProps(item), children: [_jsx(StyledShortcutsCardIcon, { name: item.icon, background: iconBackground, shape: 'square', layoutVariant: variant }), _jsxs(StyledLabelRow, { children: [_jsx(Text, { as: 'span', variant: 'h3', children: item.label }), item.type === 'external' && _jsx(StyledExternalIcon, { name: 'open' })] })] }) }));
15
+ const CardItem = ({ item, iconBackground, variant }) => (_jsx(StyledShortcutsCard, { children: _jsxs(StyledShortcutsCardButton, { variant: 'link', layoutVariant: variant, ...itemLinkProps(item), children: [_jsx(StyledShortcutsCardIcon, { name: item.icon, background: iconBackground, shape: 'square', layoutVariant: variant }), _jsxs(StyledLabelRow, { children: [_jsx(StyledText, { children: item.label }), item.type === 'external' && _jsx(StyledExternalIcon, { name: 'open' })] })] }) }));
16
16
  const Shortcuts = forwardRef(function Shortcuts({ heading, items = [], categories, showHeader = true, variant = 'inline', testId, ...restProps }, ref) {
17
17
  const t = useI18n();
18
18
  const testIds = useTestIds(testId, getShortcutsTestIds);
@@ -25,17 +25,14 @@ const Shortcuts = forwardRef(function Shortcuts({ heading, items = [], categorie
25
25
  const categoriesContainerRef = useRef(null);
26
26
  useArrows(flatListRef, { dir: 'both', cycle: true });
27
27
  useArrows(categoriesContainerRef, { dir: 'both', cycle: true });
28
- const isWide = useBreakpoint('sm', {
29
- breakpointRef: categories ? categoriesContainerRef : flatListRef
30
- });
31
28
  const emptyState = _jsx(EmptyState, { message: t('no_items'), "data-testid": testIds.emptyState });
32
29
  const withCardShell = (content) => (_jsxs(Card, { ...restProps, "data-testid": testIds.root, ref: ref, children: [_jsx(CardHeader, { children: _jsx(Text, { variant: 'h2', children: heading ?? t('shortcuts') }) }), _jsx(CardContent, { children: content })] }));
33
30
  if (categories) {
34
31
  const visibleCategories = categories.filter(cat => cat.items.length > 0);
35
- const categorySections = (_jsx(StyledShortcutsCategoriesContainer, { ref: categoriesContainerRef, isSmallOrAbove: false, 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, { isSmallOrAbove: isWide, showHeader: true, role: 'list', "aria-label": cat.label, children: cat.items.map(item => (_jsx(CardItem, { item: item, iconBackground: iconBackground, variant: variant }, item.id))) })] }, cat.id))) }));
32
+ 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, children: cat.items.map(item => (_jsx(CardItem, { item: item, iconBackground: iconBackground, variant: variant }, item.id))) })] }, cat.id))) }));
36
33
  return withCardShell(visibleCategories.length === 0 ? emptyState : categorySections);
37
34
  }
38
- const cardGrid = (_jsx(StyledShortcutsCardsContainer, { ref: flatListRef, isSmallOrAbove: isWide, showHeader: showHeader, role: 'list', "data-testid": testIds.list, "aria-label": heading ?? t('shortcuts'), children: items.map(item => (_jsx(CardItem, { item: item, iconBackground: iconBackground, variant: variant }, item.id))) }));
35
+ const cardGrid = (_jsx(StyledShortcutsCardsWrapper, { children: _jsx(StyledShortcutsCardsContainer, { ref: flatListRef, role: 'list', "data-testid": testIds.list, "aria-label": heading ?? t('shortcuts'), children: items.map(item => (_jsx(CardItem, { item: item, iconBackground: iconBackground, variant: variant }, item.id))) }) }));
39
36
  if (!showHeader) {
40
37
  if (items.length === 0)
41
38
  return null;
@@ -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;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,OAAO,EACL,IAAI,EACJ,WAAW,EACX,UAAU,EACV,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,kBAAkB,EAClB,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,aAAa,EACb,OAAO,EACP,UAAU,EACV,QAAQ,EACR,WAAW,EACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,cAAc,MAAM,6DAA6D,CAAC;AAG9F,OAAO,EACL,kBAAkB,EACl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,GAAG,CACf,KAAC,6BAA6B,IAC5B,GAAG,EAAE,WAAW,EAChB,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,UAAU,EACtB,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,cAAc,EAAE,cAAc,EAAE,OAAO,EAAE,OAAO,IAArE,IAAI,CAAC,EAAE,CAAkE,CACzF,CAAC,GAC4B,CACjC,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 } from 'react';\nimport type { ReactNode, PropsWithoutRef } from 'react';\nimport { parseToRgb } from 'polished';\n\nimport {\n Card,\n CardContent,\n CardHeader,\n EmptyState,\n Flex,\n Text,\n VisuallyHiddenText,\n registerIcon,\n tryCatch,\n useArrows,\n useBreakpoint,\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 StyledShortcutsCategoriesContainer,\n StyledShortcutsCategoryHeading,\n StyledShortcutsCardIcon\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 = ({\n item,\n iconBackground,\n variant\n}: {\n item: ShortcutItem;\n iconBackground: string;\n variant: 'stacked' | 'inline';\n}) => (\n <StyledShortcutsCard>\n <StyledShortcutsCardButton variant='link' layoutVariant={variant} {...itemLinkProps(item)}>\n <StyledShortcutsCardIcon\n name={item.icon}\n background={iconBackground}\n shape='square'\n layoutVariant={variant}\n />\n <StyledLabelRow>\n <Text as='span' variant='h3'>\n {item.label}\n </Text>\n\n {item.type === 'external' && <StyledExternalIcon name='open' />}\n </StyledLabelRow>\n </StyledShortcutsCardButton>\n </StyledShortcutsCard>\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 const {\n base: {\n palette: { 'brand-accent': brandAccent, 'brand-primary': brandPrimary }\n }\n } = useTheme();\n\n const iconBackground =\n tryCatch(() => {\n parseToRgb(brandAccent);\n return brandAccent;\n }) ?? brandPrimary;\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 isWide = useBreakpoint('sm', {\n breakpointRef: categories ? categoriesContainerRef : flatListRef\n });\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} isSmallOrAbove={false}>\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 isSmallOrAbove={isWide}\n showHeader\n role='list'\n aria-label={cat.label}\n >\n {cat.items.map(item => (\n <CardItem\n key={item.id}\n item={item}\n iconBackground={iconBackground}\n variant={variant}\n />\n ))}\n </StyledShortcutsCardsContainer>\n </Flex>\n ))}\n </StyledShortcutsCategoriesContainer>\n );\n\n return withCardShell(visibleCategories.length === 0 ? emptyState : categorySections);\n }\n\n const cardGrid = (\n <StyledShortcutsCardsContainer\n ref={flatListRef}\n isSmallOrAbove={isWide}\n showHeader={showHeader}\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} iconBackground={iconBackground} variant={variant} />\n ))}\n </StyledShortcutsCardsContainer>\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,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,OAAO,EACL,IAAI,EACJ,WAAW,EACX,UAAU,EACV,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,kBAAkB,EAClB,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,OAAO,EACP,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,UAAU,EACX,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;AACnC,CAAC,CAAC;AAEF,MAAM,QAAQ,GAAG,CAAC,EAChB,IAAI,EACJ,cAAc,EACd,OAAO,EAKR,EAAE,EAAE,CAAC,CACJ,KAAC,mBAAmB,cAClB,MAA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forwardRef } from 'react';\nimport type { ReactNode, PropsWithoutRef } from 'react';\nimport { parseToRgb } from 'polished';\n\nimport {\n Card,\n CardContent,\n CardHeader,\n EmptyState,\n Flex,\n Text,\n VisuallyHiddenText,\n registerIcon,\n tryCatch,\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 = ({\n item,\n iconBackground,\n variant\n}: {\n item: ShortcutItem;\n iconBackground: string;\n variant: 'stacked' | 'inline';\n}) => (\n <StyledShortcutsCard>\n <StyledShortcutsCardButton variant='link' layoutVariant={variant} {...itemLinkProps(item)}>\n <StyledShortcutsCardIcon\n name={item.icon}\n background={iconBackground}\n shape='square'\n layoutVariant={variant}\n />\n <StyledLabelRow>\n <StyledText>{item.label}</StyledText>\n\n {item.type === 'external' && <StyledExternalIcon name='open' />}\n </StyledLabelRow>\n </StyledShortcutsCardButton>\n </StyledShortcutsCard>\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 const {\n base: {\n palette: { 'brand-accent': brandAccent, 'brand-primary': brandPrimary }\n }\n } = useTheme();\n\n const iconBackground =\n tryCatch(() => {\n parseToRgb(brandAccent);\n return brandAccent;\n }) ?? brandPrimary;\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\n key={item.id}\n item={item}\n iconBackground={iconBackground}\n variant={variant}\n />\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} iconBackground={iconBackground} 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,10 +1,6 @@
1
- export declare const StyledShortcutsCardsContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {
2
- isSmallOrAbove: boolean;
3
- showHeader: boolean;
4
- }>> & string;
5
- export declare const StyledShortcutsCategoriesContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
6
- isSmallOrAbove: boolean;
7
- }>> & string;
1
+ export declare const StyledShortcutsCardsWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
2
+ export declare const StyledShortcutsCardsContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, never>> & string;
3
+ export declare const StyledShortcutsCategoriesContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
8
4
  export declare const StyledShortcutsCategoryHeading: 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"> & {
9
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;
10
6
  }, never>> & string & Omit<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").TextProps>, keyof import("react").Component<any, {}, any>>;
@@ -18,5 +14,6 @@ export declare const StyledShortcutsCardIcon: import("styled-components/dist/typ
18
14
  layoutVariant: "stacked" | "inline";
19
15
  }>> & string & Omit<import("react").ForwardRefExoticComponent<import("@pega/cosmos-react-core").IconProps>, keyof import("react").Component<any, {}, any>>;
20
16
  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;
17
+ 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;
21
18
  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>>;
22
19
  //# 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,6BAA6B;oBACxB,OAAO;gBACX,OAAO;YAqBnB,CAAC;AAIH,eAAO,MAAM,kCAAkC;oBAAgC,OAAO;YAqBrF,CAAC;AAIF,eAAO,MAAM,8BAA8B;;yLAIzC,CAAC;AAIH,eAAO,MAAM,mBAAmB,6NAG/B,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;mBAAmC,SAAS,GAAG,QAAQ;oLAyC3F,CAAC;AAIH,eAAO,MAAM,uBAAuB;mBAAiC,SAAS,GAAG,QAAQ;0JAUxF,CAAC;AAIF,eAAO,MAAM,cAAc,+NAM1B,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":"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;mBAAiC,SAAS,GAAG,QAAQ;0JAUxF,CAAC;AAIF,eAAO,MAAM,cAAc,+NAM1B,CAAC;AAIF,eAAO,MAAM,UAAU,+NAMtB,CAAC;AAIF,eAAO,MAAM,kBAAkB,kaAE9B,CAAC"}
@@ -1,48 +1,40 @@
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
- export const StyledShortcutsCardsContainer = styled.ul(({ theme: { base }, isSmallOrAbove, showHeader }) => {
4
+ export const StyledShortcutsCardsWrapper = styled.div `
5
+ container-type: inline-size;
6
+ `;
7
+ export const StyledShortcutsCardsContainer = styled.ul(({ theme: { base } }) => {
5
8
  return css `
6
9
  display: grid;
7
- grid-template-columns: minmax(0, 1fr);
10
+ grid-template-columns: repeat(auto-fill, minmax(min(calc(${base.spacing} * 30), 100%), 1fr));
8
11
  gap: ${base.spacing};
9
12
  list-style: none;
10
13
  padding: ${base.spacing} 0;
11
14
  margin: 0;
12
15
 
13
- ${isSmallOrAbove &&
14
- css `
16
+ @container (min-width: ${parseFloat(base.breakpoints.sm)}rem) {
17
+ grid-template-columns: repeat(2, minmax(0, 1fr));
15
18
  grid-auto-rows: 1fr;
16
- grid-template-columns: ${showHeader
17
- ? 'repeat(auto-fill, minmax(14rem, 1fr))'
18
- : 'repeat(auto-fit, minmax(14rem, 14rem))'};
19
- justify-content: ${showHeader ? 'start' : 'center'};
19
+ justify-content: start;
20
20
  align-items: stretch;
21
21
  width: 100%;
22
- `}
22
+ }
23
+
24
+ @container (min-width: ${parseFloat(base.breakpoints.md)}rem) {
25
+ grid-template-columns: repeat(4, minmax(0, 1fr));
26
+ }
23
27
  `;
24
28
  });
25
29
  StyledShortcutsCardsContainer.defaultProps = defaultThemeProp;
26
- export const StyledShortcutsCategoriesContainer = styled.div(({ theme: { base }, isSmallOrAbove }) => {
27
- return css `
28
- display: grid;
29
- grid-template-columns: minmax(0, 1fr);
30
- gap: calc(${base.spacing} * 2);
31
- width: 100%;
32
-
33
- ${isSmallOrAbove &&
34
- css `
35
- grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
36
- align-items: start;
37
- `}
38
-
39
- ${!isSmallOrAbove &&
40
- css `
41
- padding-inline: calc(${base.spacing} * 0.5);
42
- padding-block: ${base.spacing};
43
- `}
44
- `;
45
- });
30
+ export const StyledShortcutsCategoriesContainer = styled.div(({ theme: { base } }) => css `
31
+ display: grid;
32
+ grid-template-columns: minmax(0, 1fr);
33
+ gap: calc(${base.spacing} * 2);
34
+ width: 100%;
35
+ padding-block-start: ${base.spacing};
36
+ container-type: inline-size;
37
+ `);
46
38
  StyledShortcutsCategoriesContainer.defaultProps = defaultThemeProp;
47
39
  export const StyledShortcutsCategoryHeading = styled(Text)(({ theme: { base } }) => {
48
40
  return css `
@@ -66,6 +58,7 @@ export const StyledShortcutsCardButton = styled(Button)(({ theme: { base, compon
66
58
  border-radius: ${base['border-radius']};
67
59
  background: ${base.palette['primary-background']};
68
60
  padding-inline: calc(${base.spacing} * 2);
61
+ padding-block: calc(${base.spacing} * 1.5);
69
62
 
70
63
  &:hover {
71
64
  background: ${hoverBackgroundColor};
@@ -74,9 +67,8 @@ export const StyledShortcutsCardButton = styled(Button)(({ theme: { base, compon
74
67
  ${layoutVariant === 'stacked' &&
75
68
  css `
76
69
  flex-direction: column;
70
+ justify-content: center;
77
71
  gap: calc(${base.spacing} * 2);
78
- padding-block-start: calc(${base.spacing} * 4);
79
- padding-block-end: calc(${base.spacing} * 3);
80
72
  text-align: center;
81
73
  min-height: 8rem;
82
74
  `}
@@ -85,7 +77,6 @@ export const StyledShortcutsCardButton = styled(Button)(({ theme: { base, compon
85
77
  css `
86
78
  flex-direction: row;
87
79
  gap: calc(${base.spacing} * 1.5);
88
- padding-block: calc(${base.spacing} * 1.5);
89
80
  text-align: start;
90
81
  `}
91
82
  `;
@@ -107,6 +98,12 @@ export const StyledLabelRow = styled.span(({ theme: { base } }) => css `
107
98
  gap: calc(${base.spacing} * 0.5);
108
99
  `);
109
100
  StyledLabelRow.defaultProps = defaultThemeProp;
101
+ export const StyledText = styled.span(({ theme: { base } }) => css `
102
+ font-weight: ${base['font-weight']['semi-bold']};
103
+ font-size: 1em;
104
+ color: CanvasText;
105
+ `);
106
+ StyledText.defaultProps = defaultThemeProp;
110
107
  export const StyledExternalIcon = styled(Icon) `
111
108
  flex-shrink: 0;
112
109
  `;
@@ -1 +1 @@
1
- {"version":3,"file":"Shortcuts.styles.js","sourceRoot":"","sources":["../../../src/components/Shortcuts/Shortcuts.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EA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;AAEF,uBAAuB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAExD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CACvC,CAAC,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,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 StyledShortcutsCardsContainer = styled.ul<{\n isSmallOrAbove: boolean;\n showHeader: boolean;\n}>(({ theme: { base }, isSmallOrAbove, showHeader }) => {\n return css`\n display: grid;\n grid-template-columns: minmax(0, 1fr);\n gap: ${base.spacing};\n list-style: none;\n padding: ${base.spacing} 0;\n margin: 0;\n\n ${isSmallOrAbove &&\n css`\n grid-auto-rows: 1fr;\n grid-template-columns: ${showHeader\n ? 'repeat(auto-fill, minmax(14rem, 1fr))'\n : 'repeat(auto-fit, minmax(14rem, 14rem))'};\n justify-content: ${showHeader ? 'start' : 'center'};\n align-items: stretch;\n width: 100%;\n `}\n `;\n});\n\nStyledShortcutsCardsContainer.defaultProps = defaultThemeProp;\n\nexport const StyledShortcutsCategoriesContainer = styled.div<{ isSmallOrAbove: boolean }>(\n ({ theme: { base }, isSmallOrAbove }) => {\n return css`\n display: grid;\n grid-template-columns: minmax(0, 1fr);\n gap: calc(${base.spacing} * 2);\n width: 100%;\n\n ${isSmallOrAbove &&\n css`\n grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));\n align-items: start;\n `}\n\n ${!isSmallOrAbove &&\n css`\n padding-inline: calc(${base.spacing} * 0.5);\n padding-block: ${base.spacing};\n `}\n `;\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\n &:hover {\n background: ${hoverBackgroundColor};\n }\n\n ${layoutVariant === 'stacked' &&\n css`\n flex-direction: column;\n gap: calc(${base.spacing} * 2);\n padding-block-start: calc(${base.spacing} * 4);\n padding-block-end: calc(${base.spacing} * 3);\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 padding-block: calc(${base.spacing} * 1.5);\n text-align: start;\n `}\n `;\n});\n\nStyledShortcutsCardButton.defaultProps = defaultThemeProp;\n\nexport const StyledShortcutsCardIcon = styled(Icon)<{ layoutVariant: 'stacked' | 'inline' }>(\n ({ layoutVariant }) => css`\n flex-shrink: 0;\n\n ${layoutVariant === 'stacked' &&\n css`\n width: 3rem;\n height: 3rem;\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"]}
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;AAEzF,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,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;;;gBAGd,IAAI,CAAC,OAAO;;2BAED,IAAI,CAAC,OAAO;;GAEpC,CACF,CAAC;AAEF,kCAAkC,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEnE,MAAM,CAAC,MAAM,8BAA8B,G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;;MAGtB,aAAa,KAAK,SAAS;IAC7B,GAAG,CAAA;;;KAGF;GACF,CACF,CAAC;AAEF,uBAAuB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAExD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CACvC,CAAC,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)<{ layoutVariant: 'stacked' | 'inline' }>(\n ({ layoutVariant }) => css`\n flex-shrink: 0;\n\n ${layoutVariant === 'stacked' &&\n css`\n width: 3rem;\n height: 3rem;\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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/cosmos-react-work",
3
- "version": "9.4.0",
3
+ "version": "9.5.0",
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.4.0",
18
- "@pega/cosmos-react-rte": "9.4.0",
17
+ "@pega/cosmos-react-core": "9.5.0",
18
+ "@pega/cosmos-react-rte": "9.5.0",
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",