@pega/cosmos-react-wss 9.0.0-build.28.3 → 9.0.0-build.28.5

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.
@@ -4,6 +4,7 @@ export interface QuickCreateAction {
4
4
  label: string;
5
5
  icon?: string;
6
6
  description?: string;
7
+ color?: string;
7
8
  onClick: MouseEventHandler;
8
9
  }
9
10
  export interface QuickCreateProps extends BaseProps, NoChildrenProp {
@@ -1 +1 @@
1
- {"version":3,"file":"QuickCreate.d.ts","sourceRoot":"","sources":["../../../src/components/QuickCreate/QuickCreate.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAqBpD,OAAO,KAAK,EACV,SAAS,EACT,+BAA+B,EAC/B,cAAc,EACf,MAAM,yBAAyB,CAAC;AAIjC,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,iBAAiB,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAiB,SAAQ,SAAS,EAAE,cAAc;IACjE,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,iBAAiB,6ZAI7B,CAAC;AAEF,eAAO,MAAM,uBAAuB;;yJAclC,CAAC;AA0BH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oMAEjC,CA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AAW,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { forwardRef } from 'react';
3
3
  import styled, { css } from 'styled-components';
4
- import { Button, Card, CardContent, CardHeader, createClassName, defaultThemeProp, Flex, Grid, StyledIcon, Icon, Text, Tooltip, useElement, useTheme, backgroundCompatibleColors, supplementalColors } from '@pega/cosmos-react-core';
4
+ import { Button, Card, CardContent, CardHeader, createClassName, defaultThemeProp, Flex, Grid, StyledIcon, Icon, Text, Tooltip, useElement, useTheme, supplementalColors, resolveSupplementalColor, isSolidColor, readableColor } from '@pega/cosmos-react-core';
5
5
  import { lineClamp } from '@pega/cosmos-react-core/lib/styles/mixins';
6
6
  import { StyledIconShape } from '@pega/cosmos-react-core/lib/components/Icon/Icon';
7
7
  export const StyledQuickCreate = styled(CardContent) `
@@ -65,16 +65,28 @@ const QuickCreate = forwardRef(function QuickCreate({ heading, actions, classNam
65
65
  const theme = useTheme();
66
66
  const [buttonEl, setButtonEl] = useElement();
67
67
  const supplementalColorsList = supplementalColors(theme);
68
- const bgCompatibleColors = backgroundCompatibleColors(supplementalColorsList, theme.base.palette['primary-background']);
69
- const compatibleColors = bgCompatibleColors.length > 0 ? bgCompatibleColors : supplementalColorsList;
68
+ const getActionColor = (actionColor, idx) => {
69
+ if (actionColor !== undefined && theme.base['case-type-colors'] !== 'ignored') {
70
+ const supplementalColor = resolveSupplementalColor(theme, actionColor);
71
+ if (supplementalColor !== undefined)
72
+ return supplementalColor;
73
+ if (isSolidColor(actionColor))
74
+ return actionColor;
75
+ }
76
+ return supplementalColorsList[idx % supplementalColorsList.length];
77
+ };
70
78
  return (_jsxs(Card, { ...restProps, ref: ref, className: createClassName('quick-create', className), children: [_jsx(CardHeader, { children: _jsx(Text, { variant: 'h2', children: heading }) }), _jsx(StyledQuickCreate, { children: _jsx(Grid, { as: 'ul', container: {
71
79
  gap: 1,
72
80
  cols: `repeat(auto-fill, minmax(min(${theme.base['content-width'].sm}, 100%), 1fr))`
73
- }, children: actions.map(({ label, icon, description, onClick }, idx) => {
81
+ }, children: actions.map(({ label, icon, description, color, onClick }, idx) => {
82
+ const iconBackground = getActionColor(color, idx);
74
83
  return (_jsxs("li", { children: [_jsx(StyledQuickCreateButton, { ref: setButtonEl, onClick: onClick, variant: 'secondary', icon: !!icon, children: _jsxs(StyledQuickCreateContainer, { container: {
75
84
  alignItems: 'center',
76
85
  direction: 'row'
77
- }, children: [_jsxs(Flex, { container: { gap: 1.5, alignItems: 'center' }, item: { grow: 1 }, children: [icon && (_jsx(StyledIconSection, { container: true, children: _jsx(Icon, { name: icon, foreground: 'white', background: compatibleColors[idx % compatibleColors.length], shape: 'square' }) })), _jsxs(StyledMiddleSection, { container: {
86
+ }, children: [_jsxs(Flex, { container: { gap: 1.5, alignItems: 'center' }, item: { grow: 1 }, children: [icon && (_jsx(StyledIconSection, { container: true, children: _jsx(Icon, { name: icon, foreground: readableColor(iconBackground, {
87
+ mode: 'light',
88
+ level: 'AANonText'
89
+ }), background: iconBackground, shape: 'square' }) })), _jsxs(StyledMiddleSection, { container: {
78
90
  gap: 0.25,
79
91
  alignItems: 'start',
80
92
  justify: description ? 'start' : 'center',
@@ -1 +1 @@
1
- {"version":3,"file":"QuickCreate.js","sourceRoot":"","sources":["../../../src/components/QuickCreate/QuickCreate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,MAAM,EACN,IAAI,EACJ,WAAW,EACX,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,UAAU,EACV,QAAQ,EACR,0BAA0B,EAC1B,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;AAMjC,OAAO,EAAE,SAAS,EAAE,MAAM,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,CACX,KAAC,OAAO,IAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,QAAC,SAAS,EAAC,MAAM,EAAC,SAAS,EAAC,MAAM,YAC/D,KAAK,GACE,CACX,KAlDM,KAAK,CAmDT,CACN,CAAC;oBACJ,CAAC,CAAC,GACG,GACW,IACf,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { Ref, MouseEventHandler } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Button,\n Card,\n CardContent,\n CardHeader,\n createClassName,\n defaultThemeProp,\n Flex,\n Grid,\n StyledIcon,\n Icon,\n Text,\n Tooltip,\n useElement,\n useTheme,\n backgroundCompatibleColors,\n supplementalColors\n} from '@pega/cosmos-react-core';\nimport type {\n BaseProps,\n ForwardRefForwardPropsComponent,\n NoChildrenProp\n} from '@pega/cosmos-react-core';\nimport { lineClamp } from '@pega/cosmos-react-core/lib/styles/mixins';\nimport { StyledIconShape } from '@pega/cosmos-react-core/lib/components/Icon/Icon';\n\nexport interface QuickCreateAction {\n label: string;\n icon?: string;\n description?: string;\n onClick: MouseEventHandler;\n}\n\nexport interface QuickCreateProps extends BaseProps, NoChildrenProp {\n heading: string;\n actions: QuickCreateAction[];\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const StyledQuickCreate = styled(CardContent)`\n ul {\n list-style: none;\n }\n`;\n\nexport const StyledQuickCreateButton = styled(Button)(({ icon, theme }) => {\n return css`\n height: 100%;\n width: 100%;\n max-height: 5.5rem;\n padding-block: calc(${theme.base.spacing} * 1.5);\n padding-inline: calc(${theme.base.spacing} * 2);\n border-radius: ${theme.base['border-radius']};\n border-color: ${theme.base.palette['border-line']};\n justify-content: ${icon ? 'start' : 'center'};\n text-align: start;\n white-space: break-spaces;\n word-break: break-word;\n `;\n});\n\nStyledQuickCreateButton.defaultProps = defaultThemeProp;\n\nconst StyledButtonText = styled.span(({ theme }) => {\n return css`\n ${lineClamp(2)}\n font-weight: ${theme.base['font-weight']['semi-bold']};\n font-size: 1em;\n color: CanvasText;\n `;\n});\n\nStyledButtonText.defaultProps = defaultThemeProp;\n\nconst StyledQuickCreateContainer = styled(Flex)`\n width: 100%;\n`;\n\nconst StyledIconSection = styled(Flex)`\n min-width: 2rem;\n stroke-width: 50%;\n`;\n\nconst StyledMiddleSection = styled(Flex)``;\n\nexport const StyledPrimaryArrowRow = styled(Flex)`\n width: 100%;\n`;\n\nexport const StyledQuickCreateSecondaryText = styled(Text)`\n ${lineClamp(2)}\n`;\n\nconst StyledArrowSection = styled(Flex)`\n min-width: 2rem;\n\n ${StyledIconShape} {\n height: 1rem;\n }\n\n ${StyledIcon} {\n fill: CanvasText;\n height: 100%;\n align-self: flex-end;\n }\n`;\n\nconst QuickCreate: ForwardRefForwardPropsComponent<QuickCreateProps> = forwardRef(\n function QuickCreate(\n { heading, actions, className, ...restProps }: QuickCreateProps,\n ref: QuickCreateProps['ref']\n ) {\n const theme = useTheme();\n const [buttonEl, setButtonEl] = useElement();\n\n const supplementalColorsList = supplementalColors(theme);\n const bgCompatibleColors = backgroundCompatibleColors(\n supplementalColorsList,\n theme.base.palette['primary-background']\n );\n const compatibleColors =\n bgCompatibleColors.length > 0 ? bgCompatibleColors : supplementalColorsList;\n\n return (\n <Card {...restProps} ref={ref} className={createClassName('quick-create', className)}>\n <CardHeader>\n <Text variant='h2'>{heading}</Text>\n </CardHeader>\n <StyledQuickCreate>\n <Grid\n as='ul'\n container={{\n gap: 1,\n cols: `repeat(auto-fill, minmax(min(${theme.base['content-width'].sm}, 100%), 1fr))`\n }}\n >\n {actions.map(({ label, icon, description, onClick }, idx) => {\n return (\n <li key={label}>\n <StyledQuickCreateButton\n ref={setButtonEl}\n onClick={onClick}\n variant='secondary'\n icon={!!icon}\n >\n <StyledQuickCreateContainer\n container={{\n alignItems: 'center',\n direction: 'row'\n }}\n >\n <Flex container={{ gap: 1.5, alignItems: 'center' }} item={{ grow: 1 }}>\n {icon && (\n <StyledIconSection container>\n <Icon\n name={icon}\n foreground='white'\n background={compatibleColors[idx % compatibleColors.length]}\n shape='square'\n />\n </StyledIconSection>\n )}\n <StyledMiddleSection\n container={{\n gap: 0.25,\n alignItems: 'start',\n justify: description ? 'start' : 'center',\n direction: 'column'\n }}\n item={{ grow: 1 }}\n >\n <StyledButtonText as='span'>{label}</StyledButtonText>\n {description && (\n <StyledQuickCreateSecondaryText variant='secondary' forwardedAs='p'>\n {description}\n </StyledQuickCreateSecondaryText>\n )}\n </StyledMiddleSection>\n </Flex>\n <StyledArrowSection container>\n <Icon name='arrow-right' size='m' background='transparent' shape='square' />\n </StyledArrowSection>\n </StyledQuickCreateContainer>\n </StyledQuickCreateButton>\n {buttonEl && (\n <Tooltip target={buttonEl} smart showDelay='none' hideDelay='none'>\n {label}\n </Tooltip>\n )}\n </li>\n );\n })}\n </Grid>\n </StyledQuickCreate>\n </Card>\n );\n }\n);\n\nexport default QuickCreate;\n"]}
1
+ {"version":3,"file":"QuickCreate.js","sourceRoot":"","sources":["../../../src/components/QuickCreate/QuickCreate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,MAAM,EACN,IAAI,EACJ,WAAW,EACX,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,UAAU,EACV,QAAQ,EACR,kBAAkB,EAClB,wBAAwB,EACxB,YAAY,EACZ,aAAa,EACd,MAAM,yBAAyB,CAAC;AAMjC,OAAO,EAAE,SAAS,EAAE,MAAM,2CAA2C,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAgBnF,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,WAAW,CAAC,CAAA;;;;C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ACjB,EACP,KAAC,kBAAkB,IAAC,SAAS,kBAC3B,KAAC,IAAI,IAAC,IAAI,EAAC,aAAa,EAAC,IAAI,EAAC,GAAG,EAAC,UAAU,EAAC,aAAa,EAAC,KAAK,EAAC,QAAQ,GAAG,GACzD,IACM,GACL,EACzB,QAAQ,IAAI,CACX,KAAC,OAAO,IAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,QAAC,SAAS,EAAC,MAAM,EAAC,SAAS,EAAC,MAAM,YAC/D,KAAK,GACE,CACX,KArDM,KAAK,CAsDT,CACN,CAAC;oBACJ,CAAC,CAAC,GACG,GACW,IACf,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { Ref, MouseEventHandler } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Button,\n Card,\n CardContent,\n CardHeader,\n createClassName,\n defaultThemeProp,\n Flex,\n Grid,\n StyledIcon,\n Icon,\n Text,\n Tooltip,\n useElement,\n useTheme,\n supplementalColors,\n resolveSupplementalColor,\n isSolidColor,\n readableColor\n} from '@pega/cosmos-react-core';\nimport type {\n BaseProps,\n ForwardRefForwardPropsComponent,\n NoChildrenProp\n} from '@pega/cosmos-react-core';\nimport { lineClamp } from '@pega/cosmos-react-core/lib/styles/mixins';\nimport { StyledIconShape } from '@pega/cosmos-react-core/lib/components/Icon/Icon';\n\nexport interface QuickCreateAction {\n label: string;\n icon?: string;\n description?: string;\n color?: string;\n onClick: MouseEventHandler;\n}\n\nexport interface QuickCreateProps extends BaseProps, NoChildrenProp {\n heading: string;\n actions: QuickCreateAction[];\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const StyledQuickCreate = styled(CardContent)`\n ul {\n list-style: none;\n }\n`;\n\nexport const StyledQuickCreateButton = styled(Button)(({ icon, theme }) => {\n return css`\n height: 100%;\n width: 100%;\n max-height: 5.5rem;\n padding-block: calc(${theme.base.spacing} * 1.5);\n padding-inline: calc(${theme.base.spacing} * 2);\n border-radius: ${theme.base['border-radius']};\n border-color: ${theme.base.palette['border-line']};\n justify-content: ${icon ? 'start' : 'center'};\n text-align: start;\n white-space: break-spaces;\n word-break: break-word;\n `;\n});\n\nStyledQuickCreateButton.defaultProps = defaultThemeProp;\n\nconst StyledButtonText = styled.span(({ theme }) => {\n return css`\n ${lineClamp(2)}\n font-weight: ${theme.base['font-weight']['semi-bold']};\n font-size: 1em;\n color: CanvasText;\n `;\n});\n\nStyledButtonText.defaultProps = defaultThemeProp;\n\nconst StyledQuickCreateContainer = styled(Flex)`\n width: 100%;\n`;\n\nconst StyledIconSection = styled(Flex)`\n min-width: 2rem;\n stroke-width: 50%;\n`;\n\nconst StyledMiddleSection = styled(Flex)``;\n\nexport const StyledPrimaryArrowRow = styled(Flex)`\n width: 100%;\n`;\n\nexport const StyledQuickCreateSecondaryText = styled(Text)`\n ${lineClamp(2)}\n`;\n\nconst StyledArrowSection = styled(Flex)`\n min-width: 2rem;\n\n ${StyledIconShape} {\n height: 1rem;\n }\n\n ${StyledIcon} {\n fill: CanvasText;\n height: 100%;\n align-self: flex-end;\n }\n`;\n\nconst QuickCreate: ForwardRefForwardPropsComponent<QuickCreateProps> = forwardRef(\n function QuickCreate(\n { heading, actions, className, ...restProps }: QuickCreateProps,\n ref: QuickCreateProps['ref']\n ) {\n const theme = useTheme();\n const [buttonEl, setButtonEl] = useElement();\n\n const supplementalColorsList = supplementalColors(theme);\n\n const getActionColor = (actionColor: string | undefined, idx: number): string => {\n if (actionColor !== undefined && theme.base['case-type-colors'] !== 'ignored') {\n const supplementalColor = resolveSupplementalColor(theme, actionColor);\n if (supplementalColor !== undefined) return supplementalColor;\n if (isSolidColor(actionColor)) return actionColor;\n }\n return supplementalColorsList[idx % supplementalColorsList.length];\n };\n\n return (\n <Card {...restProps} ref={ref} className={createClassName('quick-create', className)}>\n <CardHeader>\n <Text variant='h2'>{heading}</Text>\n </CardHeader>\n <StyledQuickCreate>\n <Grid\n as='ul'\n container={{\n gap: 1,\n cols: `repeat(auto-fill, minmax(min(${theme.base['content-width'].sm}, 100%), 1fr))`\n }}\n >\n {actions.map(({ label, icon, description, color, onClick }, idx) => {\n const iconBackground = getActionColor(color, idx);\n return (\n <li key={label}>\n <StyledQuickCreateButton\n ref={setButtonEl}\n onClick={onClick}\n variant='secondary'\n icon={!!icon}\n >\n <StyledQuickCreateContainer\n container={{\n alignItems: 'center',\n direction: 'row'\n }}\n >\n <Flex container={{ gap: 1.5, alignItems: 'center' }} item={{ grow: 1 }}>\n {icon && (\n <StyledIconSection container>\n <Icon\n name={icon}\n foreground={readableColor(iconBackground, {\n mode: 'light',\n level: 'AANonText'\n })}\n background={iconBackground}\n shape='square'\n />\n </StyledIconSection>\n )}\n <StyledMiddleSection\n container={{\n gap: 0.25,\n alignItems: 'start',\n justify: description ? 'start' : 'center',\n direction: 'column'\n }}\n item={{ grow: 1 }}\n >\n <StyledButtonText as='span'>{label}</StyledButtonText>\n {description && (\n <StyledQuickCreateSecondaryText variant='secondary' forwardedAs='p'>\n {description}\n </StyledQuickCreateSecondaryText>\n )}\n </StyledMiddleSection>\n </Flex>\n <StyledArrowSection container>\n <Icon name='arrow-right' size='m' background='transparent' shape='square' />\n </StyledArrowSection>\n </StyledQuickCreateContainer>\n </StyledQuickCreateButton>\n {buttonEl && (\n <Tooltip target={buttonEl} smart showDelay='none' hideDelay='none'>\n {label}\n </Tooltip>\n )}\n </li>\n );\n })}\n </Grid>\n </StyledQuickCreate>\n </Card>\n );\n }\n);\n\nexport default QuickCreate;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/cosmos-react-wss",
3
- "version": "9.0.0-build.28.3",
3
+ "version": "9.0.0-build.28.5",
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.0.0-build.28.3",
18
- "@pega/cosmos-react-work": "9.0.0-build.28.3",
17
+ "@pega/cosmos-react-core": "9.0.0-build.28.5",
18
+ "@pega/cosmos-react-work": "9.0.0-build.28.5",
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",