@pega/cosmos-react-build 4.0.0-dev.18.1 → 4.0.0-dev.18.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Step.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/Step.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,iBAAiB,EAA2C,MAAM,OAAO,CAAC;AAI7F,OAAO,EAGL,SAAS,EACT,YAAY,EACZ,IAAI,
|
|
1
|
+
{"version":3,"file":"Step.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/Step.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,iBAAiB,EAA2C,MAAM,OAAO,CAAC;AAI7F,OAAO,EAGL,SAAS,EACT,YAAY,EACZ,IAAI,EASL,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAY,SAAS,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EACL,aAAa,EACb,aAAa,EACb,cAAc,EACd,iBAAiB,EAEjB,SAAS,EACV,MAAM,mBAAmB,CAAC;AAG3B,UAAU,kBAAmB,SAAQ,SAAS,EAAE,SAAS;IACvD,8BAA8B;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,wBAAwB;IACxB,EAAE,EAAE,MAAM,CAAC;IACX;;oDAEgD;IAChD,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,SAAS,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,sDAAsD;IACtD,KAAK,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChC,iGAAiG;IACjG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,IAAI,EAAE,aAAa,CAAC;IACpB,SAAS,EAAE,cAAc,CAAC;IAC1B,QAAQ,EAAE,aAAa,CAAC;IACxB,YAAY,EAAE,iBAAiB,CAAC;CACjC;AAED,eAAO,MAAM,cAAc,yIAkB1B,CAAC;AAIF,eAAO,MAAM,eAAe,yGAa1B,CAAC;AAIH,eAAO,MAAM,iBAAiB;cAClB,OAAO;cACP,OAAO;SAuBjB,CAAC;AAIH,eAAO,MAAM,UAAU,yGAUrB,CAAC;AAYH,eAAO,MAAM,gBAAgB,4GAkB3B,CAAC;AAIH,eAAO,MAAM,cAAc,EAAE,OAAO,IASlC,CAAC;AAIH,QAAA,MAAM,IAAI,EAAE,iBAAiB,CAAC,kBAAkB,GAAG,YAAY,CA6H9D,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState, useContext } from 'react';
|
|
3
3
|
import styled, { css } from 'styled-components';
|
|
4
4
|
import { readableColor } from 'polished';
|
|
5
|
-
import { Flex, defaultThemeProp, Icon, Status, Actions, useI18n, Avatar, useUID } from '@pega/cosmos-react-core';
|
|
5
|
+
import { Flex, defaultThemeProp, Icon, Status, Actions, useI18n, Avatar, useUID, Tooltip, useElement } from '@pega/cosmos-react-core';
|
|
6
6
|
import { colorMap } from '../../utils';
|
|
7
7
|
import LifeCycleContext from './LifeCycleContext';
|
|
8
8
|
export const StyledStepType = styled.div(({ visual, theme }) => {
|
|
@@ -159,11 +159,12 @@ const Step = ({ value, id, visual, actions, badge, error, categoryItem, item, st
|
|
|
159
159
|
};
|
|
160
160
|
onClick?.(actionParam, e);
|
|
161
161
|
};
|
|
162
|
-
|
|
162
|
+
const [stepLabelEl, setStepLabelEl] = useElement(null);
|
|
163
|
+
return (_jsxs(Flex, { as: StyledStepWrapper, id: `${id}-stepWrapper`, container: { inline: true, alignItems: 'center' }, "aria-current": selectedItemId === id ? 'step' : undefined, hasFocus: stepHasFocus && selectedItemId !== id, selected: selectedItemId === id, children: [error && _jsx(StyledWarnIcon, { name: 'warn-solid' }), _jsxs(Flex, { as: StyledStep, container: { inline: true }, id: id, item: { grow: 1 }, onClick: onStepClick, children: [_jsxs(StyledStepType, { visual: visual, children: [visual.imgurl.length > 0 && (_jsx(Avatar, { name: visual.title, imageSrc: visual?.imgurl, shape: 'squircle', size: 'm' })), !visual.imgurl && _jsx(Icon, { name: visual.icon })] }), _jsxs(Flex, { as: StyledStepButtonWrapper, item: { grow: 1 }, container: { inline: true, alignItems: 'center', justify: 'between' }, id: buttonDescriptionId, children: [_jsxs(StyledStepButton, { ...restProps, onFocus: () => {
|
|
163
164
|
setStepHasFocus(true);
|
|
164
165
|
}, onBlur: () => {
|
|
165
166
|
setStepHasFocus(false);
|
|
166
|
-
}, "aria-label": t(error ? 'step_name_error' : 'step_name', [value]), children: value }), badge?.type && (_jsx(Flex, { as: StyledStepBadge, container: { inline: true, alignItems: 'center' }, children: _jsx(Status, { variant: badge?.type || 'success', children: badge?.label }) }))] }), actionsClone && _jsx(Actions, { items: actionsClone, menuAt: 2, iconOnly: true })] })] }));
|
|
167
|
+
}, "aria-label": t(error ? 'step_name_error' : 'step_name', [value]), ref: setStepLabelEl, children: [value, _jsx(Tooltip, { smart: true, target: stepLabelEl, showDelay: 'none', hideDelay: 'none', children: value })] }), badge?.type && (_jsx(Flex, { as: StyledStepBadge, container: { inline: true, alignItems: 'center' }, children: _jsx(Status, { variant: badge?.type || 'success', children: badge?.label }) }))] }), actionsClone && _jsx(Actions, { items: actionsClone, menuAt: 2, iconOnly: true })] })] }));
|
|
167
168
|
};
|
|
168
169
|
export default Step;
|
|
169
170
|
//# sourceMappingURL=Step.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Step.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/Step.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAkD,UAAU,EAAE,MAAM,OAAO,CAAC;AAC7F,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,a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AM,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,YAC1E,KAAC,MAAM,IAAC,OAAO,EAAE,KAAK,EAAE,IAAI,IAAI,SAAS,YAAG,KAAK,EAAE,KAAK,GAAU,GAC7D,CACR,IACI,EACN,YAAY,IAAI,KAAC,OAAO,IAAC,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,SAAG,IAChE,IACF,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import { useState, FunctionComponent, PropsWithoutRef, MouseEvent, useContext } from 'react';\nimport styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport {\n Flex,\n defaultThemeProp,\n BaseProps,\n ForwardProps,\n Icon,\n Status,\n Actions,\n useI18n,\n Avatar,\n Action,\n useUID\n} from '@pega/cosmos-react-core';\n\nimport { colorMap, ColorName } from '../../utils';\n\nimport {\n TaskItemProps,\n StepItemProps,\n StageItemProps,\n CategoryItemProps,\n LifeCycleActionParam,\n StepProps\n} from './LifeCycle.types';\nimport LifeCycleContext from './LifeCycleContext';\n\ninterface StepComponentProps extends BaseProps, StepProps {\n /** Pass text for the step. */\n value: string;\n /** unique id of step */\n id: string;\n /** Determines the visual for icon, color and label to render.\n * This color is passed as a variant and accessible colors are used to display.\n * Icon and label are passed as normal string */\n visual: {\n imgurl: string;\n color: ColorName;\n icon: string;\n title: string;\n };\n /** Determines the variant and label for the badges */\n badge?: StepItemProps['status'];\n /** The status is used to show the input error status and the info on tooltip in case of error */\n error?: string;\n /** Data of the steps which can be used to send the full info back */\n item: StepItemProps;\n stageItem: StageItemProps;\n taskItem: TaskItemProps;\n categoryItem: CategoryItemProps;\n}\n\nexport const StyledStepType = styled.div<Pick<StepComponentProps, 'visual'>>(\n ({ visual, theme }) => {\n const bgColor = colorMap[visual.color];\n const contrastColor = readableColor(bgColor);\n return visual.imgurl\n ? css`\n height: 2rem;\n padding-inline-end: calc(0.25 * ${theme.base.spacing});\n `\n : css`\n background: ${bgColor};\n margin: calc(0.5 * ${theme.base.spacing});\n padding: 0 calc(0.5 * ${theme.base.spacing});\n color: ${contrastColor};\n text-align: center;\n border-radius: calc(0.25 * ${theme.base['border-radius']});\n `;\n }\n);\n\nStyledStepType.defaultProps = defaultThemeProp;\n\nexport const StyledStepBadge = styled.div(({ theme }) => {\n return css`\n padding: 0 calc(0.5 * ${theme.base.spacing});\n justify-content: flex-end;\n width: auto;\n max-width: calc(50% - ${theme.base.spacing});\n\n > span {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n `;\n});\n\nStyledStepBadge.defaultProps = defaultThemeProp;\n\nexport const StyledStepWrapper = styled.div<{\n hasFocus: boolean;\n selected: boolean;\n}>(({ hasFocus, theme, selected }) => {\n return css`\n width: 100%;\n margin: 0 0 calc(0.5 * ${theme.base.spacing});\n border: 0.125rem solid transparent;\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n\n ${hasFocus &&\n css`\n box-shadow: ${theme.base.shadow.focus};\n `}\n\n &:hover {\n cursor: pointer;\n }\n ${selected &&\n css`\n &[aria-current='step'] {\n border-color: ${theme.base.palette.interactive};\n }\n `}\n `;\n});\n\nStyledStepWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledStep = styled.div(({ theme }) => {\n return css`\n background: ${theme.base.palette['secondary-background']};\n border: 0.125rem solid transparent;\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n\n &:hover {\n cursor: pointer;\n }\n `;\n});\n\nStyledStep.defaultProps = defaultThemeProp;\n\nconst StyledStepButtonWrapper = styled.div<{ error: string }>(({ theme }) => {\n return css`\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n `;\n});\n\nStyledStepButtonWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledStepButton = styled.button(({ theme }) => {\n return css`\n border: none;\n height: ${theme.components.button.height};\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: start;\n background: ${theme.base.palette['secondary-background']};\n\n &:hover {\n cursor: pointer;\n }\n\n &:focus {\n outline: none;\n }\n `;\n});\n\nStyledStepButton.defaultProps = defaultThemeProp;\n\nexport const StyledWarnIcon: typeof Icon = styled(Icon)(({ theme }) => {\n return css`\n color: ${theme.base.palette.urgent};\n margin-inline: ${theme.base.spacing};\n\n &:hover {\n cursor: pointer;\n }\n `;\n});\n\nStyledWarnIcon.defaultProps = defaultThemeProp;\n\nconst Step: FunctionComponent<StepComponentProps & ForwardProps> = ({\n value,\n id,\n visual,\n actions,\n badge,\n error,\n categoryItem,\n item,\n stageItem,\n taskItem,\n onClick,\n ...restProps\n}: PropsWithoutRef<StepComponentProps>) => {\n const t = useI18n();\n const { selectedItemId } = useContext(LifeCycleContext);\n const [stepHasFocus, setStepHasFocus] = useState(false);\n\n // Need to check the value with statusProps\n\n const onActionItemClick = (\n actionId: string,\n e: MouseEvent<HTMLInputElement | HTMLAnchorElement | HTMLButtonElement>\n ) => {\n e.stopPropagation();\n const param: LifeCycleActionParam = {\n task: taskItem,\n stage: stageItem,\n step: item,\n category: categoryItem\n };\n actions?.forEach(actionItem => {\n if (actionItem.id === actionId) {\n actionItem.onClick(param, e);\n }\n });\n };\n // Deep copy of actions is required to provide consistent callback objects on actions\n const actionsClone: Action[] = [];\n const buttonDescriptionId: string = useUID();\n\n if (actions) {\n actions.forEach(actionItem => {\n const actionCloneItem = {} as Action;\n Object.keys(actionItem).forEach((key: string) => {\n actionCloneItem[key] = actionItem[key];\n });\n actionCloneItem.onClick = onActionItemClick;\n if (error) actionsClone.push(actionCloneItem);\n else actionsClone.push({ ...actionCloneItem, 'aria-describedby': buttonDescriptionId });\n return actionItem;\n });\n }\n\n const onStepClick = (e: MouseEvent) => {\n e.stopPropagation();\n const actionParam: LifeCycleActionParam = {\n value,\n step: item,\n task: taskItem,\n category: categoryItem,\n stage: stageItem,\n type: 'Step'\n };\n onClick?.(actionParam, e);\n };\n\n return (\n <Flex\n as={StyledStepWrapper}\n id={`${id}-stepWrapper`}\n container={{ inline: true, alignItems: 'center' }}\n aria-current={selectedItemId === id ? 'step' : undefined}\n hasFocus={stepHasFocus && selectedItemId !== id}\n selected={selectedItemId === id}\n >\n {error && <StyledWarnIcon name='warn-solid' />}\n <Flex\n as={StyledStep}\n container={{ inline: true }}\n id={id}\n item={{ grow: 1 }}\n onClick={onStepClick}\n >\n <StyledStepType visual={visual}>\n {visual.imgurl.length > 0 && (\n <Avatar name={visual.title} imageSrc={visual?.imgurl} shape='squircle' size='m' />\n )}\n {!visual.imgurl && <Icon name={visual.icon} />}\n </StyledStepType>\n\n <Flex\n as={StyledStepButtonWrapper}\n item={{ grow: 1 }}\n container={{ inline: true, alignItems: 'center', justify: 'between' }}\n id={buttonDescriptionId}\n >\n <StyledStepButton\n {...restProps}\n onFocus={() => {\n setStepHasFocus(true);\n }}\n onBlur={() => {\n setStepHasFocus(false);\n }}\n aria-label={t(error ? 'step_name_error' : 'step_name', [value])}\n >\n {value}\n </StyledStepButton>\n {badge?.type && (\n <Flex as={StyledStepBadge} container={{ inline: true, alignItems: 'center' }}>\n <Status variant={badge?.type || 'success'}>{badge?.label}</Status>\n </Flex>\n )}\n </Flex>\n {actionsClone && <Actions items={actionsClone} menuAt={2} iconOnly />}\n </Flex>\n </Flex>\n );\n};\n\nexport default Step;\n"]}
|
|
1
|
+
{"version":3,"file":"Step.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/Step.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAkD,UAAU,EAAE,MAAM,OAAO,CAAC;AAC7F,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EACL,IAAI,EACJ,gBAAgB,EAGhB,IAAI,EACJ,MAAM,EACN,OAAO,EACP,OAAO,EACP,MAAM,EAEN,MAAM,EACN,OAAO,EACP,UAAU,EACX,MAAM,yBAAyB,CAAC;AAEjC,OAAO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C,EAAE,EAAE,eAAe,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,YAC1E,KAAC,MAAM,IAAC,OAAO,EAAE,KAAK,EAAE,IAAI,IAAI,SAAS,YAAG,KAAK,EAAE,KAAK,GAAU,GAC7D,CACR,IACI,EACN,YAAY,IAAI,KAAC,OAAO,IAAC,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,SAAG,IAChE,IACF,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import { useState, FunctionComponent, PropsWithoutRef, MouseEvent, useContext } from 'react';\nimport styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport {\n Flex,\n defaultThemeProp,\n BaseProps,\n ForwardProps,\n Icon,\n Status,\n Actions,\n useI18n,\n Avatar,\n Action,\n useUID,\n Tooltip,\n useElement\n} from '@pega/cosmos-react-core';\n\nimport { colorMap, ColorName } from '../../utils';\n\nimport {\n TaskItemProps,\n StepItemProps,\n StageItemProps,\n CategoryItemProps,\n LifeCycleActionParam,\n StepProps\n} from './LifeCycle.types';\nimport LifeCycleContext from './LifeCycleContext';\n\ninterface StepComponentProps extends BaseProps, StepProps {\n /** Pass text for the step. */\n value: string;\n /** unique id of step */\n id: string;\n /** Determines the visual for icon, color and label to render.\n * This color is passed as a variant and accessible colors are used to display.\n * Icon and label are passed as normal string */\n visual: {\n imgurl: string;\n color: ColorName;\n icon: string;\n title: string;\n };\n /** Determines the variant and label for the badges */\n badge?: StepItemProps['status'];\n /** The status is used to show the input error status and the info on tooltip in case of error */\n error?: string;\n /** Data of the steps which can be used to send the full info back */\n item: StepItemProps;\n stageItem: StageItemProps;\n taskItem: TaskItemProps;\n categoryItem: CategoryItemProps;\n}\n\nexport const StyledStepType = styled.div<Pick<StepComponentProps, 'visual'>>(\n ({ visual, theme }) => {\n const bgColor = colorMap[visual.color];\n const contrastColor = readableColor(bgColor);\n return visual.imgurl\n ? css`\n height: 2rem;\n padding-inline-end: calc(0.25 * ${theme.base.spacing});\n `\n : css`\n background: ${bgColor};\n margin: calc(0.5 * ${theme.base.spacing});\n padding: 0 calc(0.5 * ${theme.base.spacing});\n color: ${contrastColor};\n text-align: center;\n border-radius: calc(0.25 * ${theme.base['border-radius']});\n `;\n }\n);\n\nStyledStepType.defaultProps = defaultThemeProp;\n\nexport const StyledStepBadge = styled.div(({ theme }) => {\n return css`\n padding: 0 calc(0.5 * ${theme.base.spacing});\n justify-content: flex-end;\n width: auto;\n max-width: calc(50% - ${theme.base.spacing});\n\n > span {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n `;\n});\n\nStyledStepBadge.defaultProps = defaultThemeProp;\n\nexport const StyledStepWrapper = styled.div<{\n hasFocus: boolean;\n selected: boolean;\n}>(({ hasFocus, theme, selected }) => {\n return css`\n width: 100%;\n margin: 0 0 calc(0.5 * ${theme.base.spacing});\n border: 0.125rem solid transparent;\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n\n ${hasFocus &&\n css`\n box-shadow: ${theme.base.shadow.focus};\n `}\n\n &:hover {\n cursor: pointer;\n }\n ${selected &&\n css`\n &[aria-current='step'] {\n border-color: ${theme.base.palette.interactive};\n }\n `}\n `;\n});\n\nStyledStepWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledStep = styled.div(({ theme }) => {\n return css`\n background: ${theme.base.palette['secondary-background']};\n border: 0.125rem solid transparent;\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n\n &:hover {\n cursor: pointer;\n }\n `;\n});\n\nStyledStep.defaultProps = defaultThemeProp;\n\nconst StyledStepButtonWrapper = styled.div<{ error: string }>(({ theme }) => {\n return css`\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n `;\n});\n\nStyledStepButtonWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledStepButton = styled.button(({ theme }) => {\n return css`\n border: none;\n height: ${theme.components.button.height};\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: start;\n background: ${theme.base.palette['secondary-background']};\n\n &:hover {\n cursor: pointer;\n }\n\n &:focus {\n outline: none;\n }\n `;\n});\n\nStyledStepButton.defaultProps = defaultThemeProp;\n\nexport const StyledWarnIcon: typeof Icon = styled(Icon)(({ theme }) => {\n return css`\n color: ${theme.base.palette.urgent};\n margin-inline: ${theme.base.spacing};\n\n &:hover {\n cursor: pointer;\n }\n `;\n});\n\nStyledWarnIcon.defaultProps = defaultThemeProp;\n\nconst Step: FunctionComponent<StepComponentProps & ForwardProps> = ({\n value,\n id,\n visual,\n actions,\n badge,\n error,\n categoryItem,\n item,\n stageItem,\n taskItem,\n onClick,\n ...restProps\n}: PropsWithoutRef<StepComponentProps>) => {\n const t = useI18n();\n const { selectedItemId } = useContext(LifeCycleContext);\n const [stepHasFocus, setStepHasFocus] = useState(false);\n\n // Need to check the value with statusProps\n\n const onActionItemClick = (\n actionId: string,\n e: MouseEvent<HTMLInputElement | HTMLAnchorElement | HTMLButtonElement>\n ) => {\n e.stopPropagation();\n const param: LifeCycleActionParam = {\n task: taskItem,\n stage: stageItem,\n step: item,\n category: categoryItem\n };\n actions?.forEach(actionItem => {\n if (actionItem.id === actionId) {\n actionItem.onClick(param, e);\n }\n });\n };\n // Deep copy of actions is required to provide consistent callback objects on actions\n const actionsClone: Action[] = [];\n const buttonDescriptionId: string = useUID();\n\n if (actions) {\n actions.forEach(actionItem => {\n const actionCloneItem = {} as Action;\n Object.keys(actionItem).forEach((key: string) => {\n actionCloneItem[key] = actionItem[key];\n });\n actionCloneItem.onClick = onActionItemClick;\n if (error) actionsClone.push(actionCloneItem);\n else actionsClone.push({ ...actionCloneItem, 'aria-describedby': buttonDescriptionId });\n return actionItem;\n });\n }\n\n const onStepClick = (e: MouseEvent) => {\n e.stopPropagation();\n const actionParam: LifeCycleActionParam = {\n value,\n step: item,\n task: taskItem,\n category: categoryItem,\n stage: stageItem,\n type: 'Step'\n };\n onClick?.(actionParam, e);\n };\n\n const [stepLabelEl, setStepLabelEl] = useElement<HTMLSpanElement>(null);\n\n return (\n <Flex\n as={StyledStepWrapper}\n id={`${id}-stepWrapper`}\n container={{ inline: true, alignItems: 'center' }}\n aria-current={selectedItemId === id ? 'step' : undefined}\n hasFocus={stepHasFocus && selectedItemId !== id}\n selected={selectedItemId === id}\n >\n {error && <StyledWarnIcon name='warn-solid' />}\n <Flex\n as={StyledStep}\n container={{ inline: true }}\n id={id}\n item={{ grow: 1 }}\n onClick={onStepClick}\n >\n <StyledStepType visual={visual}>\n {visual.imgurl.length > 0 && (\n <Avatar name={visual.title} imageSrc={visual?.imgurl} shape='squircle' size='m' />\n )}\n {!visual.imgurl && <Icon name={visual.icon} />}\n </StyledStepType>\n\n <Flex\n as={StyledStepButtonWrapper}\n item={{ grow: 1 }}\n container={{ inline: true, alignItems: 'center', justify: 'between' }}\n id={buttonDescriptionId}\n >\n <StyledStepButton\n {...restProps}\n onFocus={() => {\n setStepHasFocus(true);\n }}\n onBlur={() => {\n setStepHasFocus(false);\n }}\n aria-label={t(error ? 'step_name_error' : 'step_name', [value])}\n ref={setStepLabelEl}\n >\n {value}\n <Tooltip smart target={stepLabelEl} showDelay='none' hideDelay='none'>\n {value}\n </Tooltip>\n </StyledStepButton>\n {badge?.type && (\n <Flex as={StyledStepBadge} container={{ inline: true, alignItems: 'center' }}>\n <Status variant={badge?.type || 'success'}>{badge?.label}</Status>\n </Flex>\n )}\n </Flex>\n {actionsClone && <Actions items={actionsClone} menuAt={2} iconOnly />}\n </Flex>\n </Flex>\n );\n};\n\nexport default Step;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/cosmos-react-build",
|
|
3
|
-
"version": "4.0.0-dev.18.
|
|
3
|
+
"version": "4.0.0-dev.18.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/pegasystems/cosmos-react.git",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"build": "tsc -b"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@pega/cosmos-react-core": "4.0.0-dev.18.
|
|
24
|
-
"@pega/cosmos-react-dnd": "4.0.0-dev.18.
|
|
23
|
+
"@pega/cosmos-react-core": "4.0.0-dev.18.3",
|
|
24
|
+
"@pega/cosmos-react-dnd": "4.0.0-dev.18.3",
|
|
25
25
|
"@types/codemirror": "^5.60.7",
|
|
26
26
|
"@types/dagre": "^0.7.46",
|
|
27
27
|
"@types/react": "^16.14.24 || ^17.0.38",
|