@pega/cosmos-react-work 2.0.0-dev.2.1 → 2.0.0-dev.20.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.
- package/lib/components/AppAnnouncement/AppAnnouncement.d.ts.map +1 -1
- package/lib/components/AppAnnouncement/AppAnnouncement.js +13 -17
- package/lib/components/AppAnnouncement/AppAnnouncement.js.map +1 -1
- package/lib/components/CaseHeader/CaseHeader.d.ts +5 -1
- package/lib/components/CaseHeader/CaseHeader.d.ts.map +1 -1
- package/lib/components/CaseHeader/CaseHeader.js +39 -15
- package/lib/components/CaseHeader/CaseHeader.js.map +1 -1
- package/lib/components/CasePreview/CasePreview.d.ts +5 -5
- package/lib/components/CasePreview/CasePreview.d.ts.map +1 -1
- package/lib/components/CasePreview/CasePreview.js +17 -16
- package/lib/components/CasePreview/CasePreview.js.map +1 -1
- package/lib/components/CaseSummary/CaseSummary.d.ts +20 -8
- package/lib/components/CaseSummary/CaseSummary.d.ts.map +1 -1
- package/lib/components/CaseSummary/CaseSummary.js +121 -14
- package/lib/components/CaseSummary/CaseSummary.js.map +1 -1
- package/lib/components/CaseSummaryFields/CaseSummaryFields.d.ts.map +1 -1
- package/lib/components/CaseSummaryFields/CaseSummaryFields.js +14 -12
- package/lib/components/CaseSummaryFields/CaseSummaryFields.js.map +1 -1
- package/lib/components/CaseView/CaseView.d.ts +6 -19
- package/lib/components/CaseView/CaseView.d.ts.map +1 -1
- package/lib/components/CaseView/CaseView.js +173 -189
- package/lib/components/CaseView/CaseView.js.map +1 -1
- package/lib/components/CaseView/CaseView.styles.d.ts +24 -0
- package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -0
- package/lib/components/CaseView/CaseView.styles.js +111 -0
- package/lib/components/CaseView/CaseView.styles.js.map +1 -0
- package/lib/components/CaseView/MobileCaseView.d.ts +1 -0
- package/lib/components/CaseView/MobileCaseView.d.ts.map +1 -1
- package/lib/components/CaseView/MobileCaseView.js +3 -6
- package/lib/components/CaseView/MobileCaseView.js.map +1 -1
- package/lib/components/CaseView/UtilitiesSummary.d.ts.map +1 -1
- package/lib/components/CaseView/UtilitiesSummary.js +8 -10
- package/lib/components/CaseView/UtilitiesSummary.js.map +1 -1
- package/lib/components/CaseView/index.d.ts +2 -1
- package/lib/components/CaseView/index.d.ts.map +1 -1
- package/lib/components/CaseView/index.js +1 -1
- package/lib/components/CaseView/index.js.map +1 -1
- package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts +4 -0
- package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts.map +1 -0
- package/lib/components/ConfigurableLayout/ConfigurableLayout.js +93 -0
- package/lib/components/ConfigurableLayout/ConfigurableLayout.js.map +1 -0
- package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts +43 -0
- package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts.map +1 -0
- package/lib/components/ConfigurableLayout/ConfigurableLayout.types.js +2 -0
- package/lib/components/ConfigurableLayout/ConfigurableLayout.types.js.map +1 -0
- package/lib/components/ConfigurableLayout/LayoutCell.d.ts +6 -0
- package/lib/components/ConfigurableLayout/LayoutCell.d.ts.map +1 -0
- package/lib/components/ConfigurableLayout/LayoutCell.js +64 -0
- package/lib/components/ConfigurableLayout/LayoutCell.js.map +1 -0
- package/lib/components/ConfigurableLayout/defaults.d.ts +4 -0
- package/lib/components/ConfigurableLayout/defaults.d.ts.map +1 -0
- package/lib/components/ConfigurableLayout/defaults.js +4 -0
- package/lib/components/ConfigurableLayout/defaults.js.map +1 -0
- package/lib/components/ConfigurableLayout/index.d.ts +3 -0
- package/lib/components/ConfigurableLayout/index.d.ts.map +1 -0
- package/lib/components/ConfigurableLayout/index.js +3 -0
- package/lib/components/ConfigurableLayout/index.js.map +1 -0
- package/lib/components/ConfigurableLayout/options.d.ts +10 -0
- package/lib/components/ConfigurableLayout/options.d.ts.map +1 -0
- package/lib/components/ConfigurableLayout/options.js +10 -0
- package/lib/components/ConfigurableLayout/options.js.map +1 -0
- package/lib/components/ConfigurableLayout/useTrackWrappedRegions.d.ts +7 -0
- package/lib/components/ConfigurableLayout/useTrackWrappedRegions.d.ts.map +1 -0
- package/lib/components/ConfigurableLayout/useTrackWrappedRegions.js +37 -0
- package/lib/components/ConfigurableLayout/useTrackWrappedRegions.js.map +1 -0
- package/lib/components/Confirmation/Confirmation.d.ts +19 -0
- package/lib/components/Confirmation/Confirmation.d.ts.map +1 -0
- package/lib/components/Confirmation/Confirmation.js +14 -0
- package/lib/components/Confirmation/Confirmation.js.map +1 -0
- package/lib/components/Confirmation/index.d.ts +3 -0
- package/lib/components/Confirmation/index.d.ts.map +1 -0
- package/lib/components/Confirmation/index.js +2 -0
- package/lib/components/Confirmation/index.js.map +1 -0
- package/lib/components/Details/Details.d.ts +13 -0
- package/lib/components/Details/Details.d.ts.map +1 -0
- package/lib/components/Details/Details.js +38 -0
- package/lib/components/Details/Details.js.map +1 -0
- package/lib/components/Details/index.d.ts +4 -0
- package/lib/components/Details/index.d.ts.map +1 -0
- package/lib/components/Details/index.js +3 -0
- package/lib/components/Details/index.js.map +1 -0
- package/lib/components/Glimpse/Glimpse.d.ts +2 -2
- package/lib/components/Glimpse/Glimpse.d.ts.map +1 -1
- package/lib/components/Glimpse/Glimpse.js +3 -6
- package/lib/components/Glimpse/Glimpse.js.map +1 -1
- package/lib/components/SearchResults/Filter.d.ts.map +1 -1
- package/lib/components/SearchResults/Filter.js +15 -48
- package/lib/components/SearchResults/Filter.js.map +1 -1
- package/lib/components/SearchResults/SearchResult.d.ts.map +1 -1
- package/lib/components/SearchResults/SearchResult.js +2 -8
- package/lib/components/SearchResults/SearchResult.js.map +1 -1
- package/lib/components/SearchResults/SearchResults.d.ts.map +1 -1
- package/lib/components/SearchResults/SearchResults.js +44 -101
- package/lib/components/SearchResults/SearchResults.js.map +1 -1
- package/lib/components/SearchResults/SearchResults.styles.d.ts +8 -0
- package/lib/components/SearchResults/SearchResults.styles.d.ts.map +1 -0
- package/lib/components/SearchResults/SearchResults.styles.js +67 -0
- package/lib/components/SearchResults/SearchResults.styles.js.map +1 -0
- package/lib/components/SearchResults/SearchResults.types.d.ts +14 -4
- package/lib/components/SearchResults/SearchResults.types.d.ts.map +1 -1
- package/lib/components/SearchResults/SearchResults.types.js.map +1 -1
- package/lib/components/Stages/Stages.d.ts.map +1 -1
- package/lib/components/Stages/Stages.js +31 -36
- package/lib/components/Stages/Stages.js.map +1 -1
- package/lib/components/Stages/Stages.styles.d.ts.map +1 -1
- package/lib/components/Stages/Stages.styles.js +22 -28
- package/lib/components/Stages/Stages.styles.js.map +1 -1
- package/lib/components/Stages/Steps.d.ts.map +1 -1
- package/lib/components/Stages/Steps.js +7 -7
- package/lib/components/Stages/Steps.js.map +1 -1
- package/lib/components/Stages/StepsContainer.d.ts.map +1 -1
- package/lib/components/Stages/StepsContainer.js +5 -9
- package/lib/components/Stages/StepsContainer.js.map +1 -1
- package/lib/components/Stakeholders/StakeholderForm.d.ts +7 -0
- package/lib/components/Stakeholders/StakeholderForm.d.ts.map +1 -0
- package/lib/components/Stakeholders/StakeholderForm.js +47 -0
- package/lib/components/Stakeholders/StakeholderForm.js.map +1 -0
- package/lib/components/Stakeholders/Stakeholders.d.ts +6 -0
- package/lib/components/Stakeholders/Stakeholders.d.ts.map +1 -0
- package/lib/components/Stakeholders/Stakeholders.js +215 -0
- package/lib/components/Stakeholders/Stakeholders.js.map +1 -0
- package/lib/components/Stakeholders/Stakeholders.types.d.ts +78 -0
- package/lib/components/Stakeholders/Stakeholders.types.d.ts.map +1 -0
- package/lib/components/Stakeholders/Stakeholders.types.js +2 -0
- package/lib/components/Stakeholders/Stakeholders.types.js.map +1 -0
- package/lib/components/Stakeholders/index.d.ts +3 -0
- package/lib/components/Stakeholders/index.d.ts.map +1 -0
- package/lib/components/Stakeholders/index.js +2 -0
- package/lib/components/Stakeholders/index.js.map +1 -0
- package/lib/components/Tags/Tags.d.ts +34 -0
- package/lib/components/Tags/Tags.d.ts.map +1 -0
- package/lib/components/Tags/Tags.js +227 -0
- package/lib/components/Tags/Tags.js.map +1 -0
- package/lib/components/Tags/index.d.ts +3 -0
- package/lib/components/Tags/index.d.ts.map +1 -0
- package/lib/components/Tags/index.js +2 -0
- package/lib/components/Tags/index.js.map +1 -0
- package/lib/components/Tasks/TaskList.d.ts +25 -0
- package/lib/components/Tasks/TaskList.d.ts.map +1 -0
- package/lib/components/Tasks/TaskList.js +25 -0
- package/lib/components/Tasks/TaskList.js.map +1 -0
- package/lib/components/Tasks/Tasks.d.ts +2 -14
- package/lib/components/Tasks/Tasks.d.ts.map +1 -1
- package/lib/components/Tasks/Tasks.js +17 -39
- package/lib/components/Tasks/Tasks.js.map +1 -1
- package/lib/components/Tasks/index.d.ts +3 -0
- package/lib/components/Tasks/index.d.ts.map +1 -1
- package/lib/components/Tasks/index.js +1 -0
- package/lib/components/Tasks/index.js.map +1 -1
- package/lib/components/Timeline/Timeline.d.ts.map +1 -1
- package/lib/components/Timeline/Timeline.js +13 -29
- package/lib/components/Timeline/Timeline.js.map +1 -1
- package/lib/components/Timeline/Timeline.styles.d.ts +9 -5
- package/lib/components/Timeline/Timeline.styles.d.ts.map +1 -1
- package/lib/components/Timeline/Timeline.styles.js +107 -50
- package/lib/components/Timeline/Timeline.styles.js.map +1 -1
- package/lib/components/Timeline/Timeline.types.d.ts +18 -5
- package/lib/components/Timeline/Timeline.types.d.ts.map +1 -1
- package/lib/components/Timeline/Timeline.types.js.map +1 -1
- package/lib/components/Timeline/TimelineItem.d.ts +5 -3
- package/lib/components/Timeline/TimelineItem.d.ts.map +1 -1
- package/lib/components/Timeline/TimelineItem.js +15 -32
- package/lib/components/Timeline/TimelineItem.js.map +1 -1
- package/lib/components/Timeline/utils.d.ts +11 -3
- package/lib/components/Timeline/utils.d.ts.map +1 -1
- package/lib/components/Timeline/utils.js +48 -4
- package/lib/components/Timeline/utils.js.map +1 -1
- package/lib/index.d.ts +10 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +10 -2
- package/lib/index.js.map +1 -1
- package/package.json +14 -14
- package/lib/components/CaseActions/CaseActions.d.ts +0 -12
- package/lib/components/CaseActions/CaseActions.d.ts.map +0 -1
- package/lib/components/CaseActions/CaseActions.js +0 -15
- package/lib/components/CaseActions/CaseActions.js.map +0 -1
- package/lib/components/CaseActions/index.d.ts +0 -4
- package/lib/components/CaseActions/index.d.ts.map +0 -1
- package/lib/components/CaseActions/index.js +0 -3
- package/lib/components/CaseActions/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stages.js","sourceRoot":"","sources":["../../../src/components/Stages/Stages.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAEZ,QAAQ,EACR,MAAM,EACN,SAAS,EACT,UAAU,EACV,WAAW,EACZ,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,OAAO,EACL,IAAI,EACJ,IAAI,EAEJ,UAAU,EACV,aAAa,EACb,OAAO,EACP,OAAO,EACP,MAAM,EACN,mBAAmB,EAEnB,KAAK,EACL,aAAa,EACb,aAAa,EACb,QAAQ,EACR,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAGjC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAElG,MAAM,MAAM,GAAkD,CAAC,KAAkB,EAAE,EAAE;IACnF,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IAC3D,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAEpB,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,UAAU,EAAkB,CAAC;IAC7D,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,UAAU,EAAmB,CAAC;IAClF,MAAM,CAAC,oBAAoB,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KAAK,CAAC,EAAE,CAAC,IAAI,cAAc,IAE9C,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAC/C,CACpB,CACI,CACR,CAAC,CACG;QACP,oBAAC,IAAI,IAAC,GAAG,EAAE,iBAAiB;YAC1B,oBAAC,OAAO,IACN,EAAE,EAAE,kBAAkB,EACtB,IAAI,EAAE,WAAW,IAAI,cAAc,EACnC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAC5C,EAAE,EAAC,IAAI,EACP,GAAG,EAAE,aAAa,EAClB,KAAK,QACL,SAAS,EAAC,cAAc,EACxB,SAAS,EAAE,gBAAgB,EAC3B,SAAS,EAAE;oBACT;wBACE,IAAI,EAAE,MAAM;wBACZ,OAAO,EAAE;4BACP,kBAAkB,EAAE,CAAC,YAAY,EAAE,OAAO,EAAE,MAAM,CAAC;yBACpD;qBACF;iBACF;gBAED,oBAAC,cAAc,IAAC,YAAY,EAAE,CAAC,cAAc,CAAC,GAAI;gBAClD,oBAAC,MAAM,IAAC,OAAO,EAAC,WAAW,EAAC,OAAO,EAAE,SAAS,IAC3C,CAAC,CAAC,0BAA0B,CAAC,CACvB,CACD,CACL,CACN,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import React, {\n FunctionComponent,\n useState,\n useRef,\n useEffect,\n useContext,\n useCallback\n} from 'react';\nimport { remToPx } from 'polished';\n\nimport {\n Icon,\n Flex,\n ForwardProps,\n useElement,\n useOuterEvent,\n Popover,\n useI18n,\n Button,\n ModalManagerContext,\n ModalProps,\n Modal,\n getFocusables,\n useBreakpoint,\n debounce,\n useTheme\n} from '@pega/cosmos-react-core';\n\nimport { StagesProps } from './Stages.types';\nimport StepsContainer from './StepsContainer';\nimport { StyledInnerStage, StyledStage, StyledStagePopover, StyledStages } from './Stages.styles';\n\nconst Stages: FunctionComponent<StagesProps & ForwardProps> = (props: StagesProps) => {\n const { current, stages, caseTitle, ...restProps } = props;\n const t = useI18n();\n\n const [stagesEl, setStagesEl] = useElement<HTMLDivElement>();\n const [currentStageNameEl, setCurrentStageNameEl] = useElement<HTMLSpanElement>();\n const [currentStageButtonEl, setCurrentStageButtonEl] = useElement<HTMLButtonElement>();\n\n const [activeStageIndex, setActiveStageIndex] = useState<number>(0);\n const activeStageObj = stages[activeStageIndex];\n const stagesRefs = useRef<HTMLElement[]>([]);\n const activeStageEl = stagesRefs.current[activeStageIndex];\n const { create } = useContext(ModalManagerContext);\n const [popoverEl, setPopoverRef] = useElement<HTMLElement>();\n const [showPopover, setShowPopover] = useState(false);\n const popoverContentRef = useRef(null);\n const isSmallOrAbove = useBreakpoint('sm');\n const focusableElements = getFocusables(popoverContentRef);\n\n const [compressedView, setCompressedView] = useState(false);\n const [minExpandedWidth, setMinExpandedWidth] = useState(0);\n\n const resizeObserver = new ResizeObserver(\n debounce(entries => {\n if (entries[0].contentRect.width > minExpandedWidth) setCompressedView(false);\n }, 100)\n );\n\n const theme = useTheme();\n\n const intersectionObserver = new IntersectionObserver(\n entries => {\n if (entries[0].intersectionRatio < 1) {\n if (stagesEl) setMinExpandedWidth(Math.max(minExpandedWidth, stagesEl.offsetWidth + 1));\n setCompressedView(true);\n }\n },\n { root: currentStageButtonEl, rootMargin: `0px -${remToPx(theme.base.spacing)}`, threshold: 1 }\n );\n\n useEffect(() => {\n if (stagesEl && currentStageNameEl) {\n intersectionObserver.observe(currentStageNameEl as Element);\n resizeObserver.observe(stagesEl);\n\n return () => {\n intersectionObserver.disconnect();\n resizeObserver.disconnect();\n };\n }\n }, [stagesEl, currentStageNameEl, compressedView]);\n\n useOuterEvent('mousedown', [popoverEl, activeStageEl], e => {\n if (showPopover) {\n setShowPopover(false);\n e.preventDefault();\n }\n });\n\n const onMouseDown = (ev: React.MouseEvent<HTMLElement>) => {\n if (!showPopover) ev.preventDefault();\n };\n\n const onKeyDown = useCallback(\n ({ key }: KeyboardEvent) => {\n if (key === 'Escape') {\n setShowPopover(false);\n activeStageEl?.focus();\n }\n },\n [activeStageEl]\n );\n\n const onKeyDownPopover = useCallback(\n (event: KeyboardEvent) => {\n if (event.key === 'Tab' && event.shiftKey) {\n const firstFocusable = focusableElements[0];\n\n if (document.activeElement === firstFocusable) {\n stagesRefs.current[activeStageIndex + 1]?.focus();\n setShowPopover(false);\n }\n }\n\n if (event.key === 'Tab' && !event.shiftKey) {\n const lastFocusable = focusableElements[focusableElements.length - 1];\n\n if (document.activeElement === lastFocusable) {\n activeStageEl?.focus();\n setShowPopover(false);\n }\n }\n },\n [activeStageEl, focusableElements, activeStageIndex]\n );\n\n useEffect(() => {\n document.addEventListener('keydown', onKeyDown);\n return () => {\n document.removeEventListener('keydown', onKeyDown);\n };\n }, [onKeyDown]);\n\n useEffect(() => {\n if (focusableElements.length) focusableElements[0].focus();\n }, [popoverEl]);\n\n const [requestDismiss, setRequestDismiss] = useState(false);\n\n useEffect(() => {\n if (requestDismiss) {\n setShowPopover(false);\n activeStageEl?.focus();\n setRequestDismiss(false);\n }\n }, [activeStageEl, requestDismiss]);\n\n const RenderModal = ({ heading = t('lifecycle', caseTitle || 'Case') }: Partial<ModalProps>) => {\n return (\n <Modal {...restProps} heading={heading} onRequestDismiss={() => setRequestDismiss(true)}>\n {stages.map((stage, id) => (\n <StepsContainer currentStage={[stage]} key={id.toString()} />\n ))}\n </Modal>\n );\n };\n\n const openModal = () => {\n setShowPopover(false);\n create(RenderModal);\n };\n\n const isCurrent = (stageId: string) => current === stageId;\n\n return (\n <>\n <Flex container as={StyledStages} ref={setStagesEl} {...restProps}>\n {stages.map((stage, index) => (\n <Flex\n container={{ justify: 'center', alignItems: 'center' }}\n as={StyledStage}\n item={{ grow: compressedView && !isCurrent(stage.id) ? 0 : 1, shrink: 1 }}\n aria-current={isCurrent(stage.id) ? 'step' : undefined}\n aria-label={`Stage ${stage.name}`}\n key={`stage-${stage.id}`}\n ref={(el: HTMLButtonElement) => {\n stagesRefs.current[index] = el;\n if (isCurrent(stage.id)) setCurrentStageButtonEl(el);\n }}\n onMouseDown={onMouseDown}\n onClick={() => {\n setActiveStageIndex(index);\n if (isSmallOrAbove) {\n setShowPopover(!showPopover);\n } else {\n openModal();\n }\n }}\n >\n {stage.complete && <Icon name='check' />}\n {!(stage.complete && compressedView) && (\n <StyledInnerStage\n ref={isCurrent(stage.id) ? setCurrentStageNameEl : undefined}\n ellipsis={isCurrent(stage.id) && compressedView}\n >\n {!isCurrent(stage.id) && compressedView ? index + 1 : stage.name}\n </StyledInnerStage>\n )}\n </Flex>\n ))}\n </Flex>\n <Flex ref={popoverContentRef}>\n <Popover\n as={StyledStagePopover}\n show={showPopover && isSmallOrAbove}\n target={stagesRefs.current[activeStageIndex]}\n id='id'\n ref={setPopoverRef}\n arrow\n placement='bottom-start'\n onKeyDown={onKeyDownPopover}\n modifiers={[\n {\n name: 'flip',\n options: {\n fallbackPlacements: ['bottom-end', 'right', 'left']\n }\n }\n ]}\n >\n <StepsContainer currentStage={[activeStageObj]} />\n <Button variant='secondary' onClick={openModal}>\n {t('stage_see_full_lifecycle')}\n </Button>\n </Popover>\n </Flex>\n </>\n );\n};\n\nexport default Stages;\n"]}
|
|
1
|
+
{"version":3,"file":"Stages.js","sourceRoot":"","sources":["../../../src/components/Stages/Stages.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAChG,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,OAAO,EACL,IAAI,EACJ,YAAY,EACZ,IAAI,EAEJ,UAAU,EACV,aAAa,EACb,OAAO,EACP,OAAO,EACP,MAAM,EACN,mBAAmB,EAEnB,KAAK,EACL,aAAa,EACb,aAAa,EACb,QAAQ,EACR,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAC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O,EAAE,SAAS,YAC3C,CAAC,CAAC,0BAA0B,CAAC,WACvB,YACD,WACL,YACN,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import { FunctionComponent, useState, useRef, useEffect, useContext, useCallback } from 'react';\nimport { remToPx } from 'polished';\n\nimport {\n Icon,\n registerIcon,\n Flex,\n ForwardProps,\n useElement,\n useOuterEvent,\n Popover,\n useI18n,\n Button,\n ModalManagerContext,\n ModalProps,\n Modal,\n getFocusables,\n useBreakpoint,\n debounce,\n useTheme\n} from '@pega/cosmos-react-core';\nimport * as checkIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/check.icon';\n\nimport { StagesProps } from './Stages.types';\nimport StepsContainer from './StepsContainer';\nimport { StyledInnerStage, StyledStage, StyledStagePopover, StyledStages } from './Stages.styles';\n\nregisterIcon(checkIcon);\n\nconst Stages: FunctionComponent<StagesProps & ForwardProps> = (props: StagesProps) => {\n const { current, stages, caseTitle, ...restProps } = props;\n const t = useI18n();\n\n const [stagesEl, setStagesEl] = useElement<HTMLDivElement>();\n const [currentStageNameEl, setCurrentStageNameEl] = useElement<HTMLSpanElement>();\n const [currentStageButtonEl, setCurrentStageButtonEl] = useElement<HTMLButtonElement>();\n\n const [activeStageIndex, setActiveStageIndex] = useState<number>(0);\n const activeStageObj = stages[activeStageIndex];\n const stagesRefs = useRef<HTMLElement[]>([]);\n const activeStageEl = stagesRefs.current[activeStageIndex];\n const { create } = useContext(ModalManagerContext);\n const [popoverEl, setPopoverRef] = useElement<HTMLElement>();\n const [showPopover, setShowPopover] = useState(false);\n const popoverContentRef = useRef(null);\n const isSmallOrAbove = useBreakpoint('sm');\n const focusableElements = getFocusables(popoverContentRef);\n\n const [compressedView, setCompressedView] = useState(false);\n const [minExpandedWidth, setMinExpandedWidth] = useState(0);\n\n const resizeObserver = new ResizeObserver(\n debounce((entries: ResizeObserverEntry[]) => {\n if (entries[0].contentRect.width > minExpandedWidth) setCompressedView(false);\n }, 100)\n );\n\n const theme = useTheme();\n\n const intersectionObserver = new IntersectionObserver(\n entries => {\n if (entries[0].intersectionRatio < 1) {\n if (stagesEl) setMinExpandedWidth(Math.max(minExpandedWidth, stagesEl.offsetWidth + 1));\n setCompressedView(true);\n }\n },\n { root: currentStageButtonEl, rootMargin: `0px -${remToPx(theme.base.spacing)}`, threshold: 1 }\n );\n\n useEffect(() => {\n if (stagesEl && currentStageNameEl) {\n intersectionObserver.observe(currentStageNameEl as Element);\n resizeObserver.observe(stagesEl);\n\n return () => {\n intersectionObserver.disconnect();\n resizeObserver.disconnect();\n };\n }\n }, [stagesEl, currentStageNameEl, compressedView]);\n\n useOuterEvent('mousedown', [popoverEl, activeStageEl], e => {\n if (showPopover) {\n setShowPopover(false);\n e.preventDefault();\n }\n });\n\n const onMouseDown = (ev: React.MouseEvent<HTMLElement>) => {\n if (!showPopover) ev.preventDefault();\n };\n\n const onKeyDown = useCallback(\n ({ key }: KeyboardEvent) => {\n if (key === 'Escape') {\n setShowPopover(false);\n activeStageEl?.focus();\n }\n },\n [activeStageEl]\n );\n\n const onKeyDownPopover = useCallback(\n (event: KeyboardEvent) => {\n if (event.key === 'Tab' && event.shiftKey) {\n const firstFocusable = focusableElements[0];\n\n if (document.activeElement === firstFocusable) {\n stagesRefs.current[activeStageIndex + 1]?.focus();\n setShowPopover(false);\n }\n }\n\n if (event.key === 'Tab' && !event.shiftKey) {\n const lastFocusable = focusableElements[focusableElements.length - 1];\n\n if (document.activeElement === lastFocusable) {\n activeStageEl?.focus();\n setShowPopover(false);\n }\n }\n },\n [activeStageEl, focusableElements, activeStageIndex]\n );\n\n useEffect(() => {\n document.addEventListener('keydown', onKeyDown);\n return () => {\n document.removeEventListener('keydown', onKeyDown);\n };\n }, [onKeyDown]);\n\n useEffect(() => {\n if (focusableElements.length) focusableElements[0].focus();\n }, [popoverEl]);\n\n const [requestDismiss, setRequestDismiss] = useState(false);\n\n useEffect(() => {\n if (requestDismiss) {\n setShowPopover(false);\n activeStageEl?.focus();\n setRequestDismiss(false);\n }\n }, [activeStageEl, requestDismiss]);\n\n const RenderModal = ({\n heading = t('lifecycle', [caseTitle || 'Case'])\n }: Partial<ModalProps>) => {\n return (\n <Modal {...restProps} heading={heading} onRequestDismiss={() => setRequestDismiss(true)}>\n {stages.map((stage, id) => (\n <StepsContainer currentStage={[stage]} key={id.toString()} />\n ))}\n </Modal>\n );\n };\n\n const openModal = () => {\n setShowPopover(false);\n create(RenderModal);\n };\n\n const isCurrent = (stageId: string) => current === stageId;\n\n return (\n <>\n <Flex container as={StyledStages} ref={setStagesEl} {...restProps}>\n {stages.map((stage, index) => (\n <Flex\n container={{ justify: 'center', alignItems: 'center' }}\n as={StyledStage}\n item={{ grow: compressedView && !isCurrent(stage.id) ? 0 : 1, shrink: 1 }}\n aria-current={isCurrent(stage.id) ? 'step' : undefined}\n aria-label={`Stage ${stage.name}`}\n key={`stage-${stage.id}`}\n ref={(el: HTMLButtonElement) => {\n stagesRefs.current[index] = el;\n if (isCurrent(stage.id)) setCurrentStageButtonEl(el);\n }}\n onMouseDown={onMouseDown}\n onClick={() => {\n setActiveStageIndex(index);\n if (isSmallOrAbove) {\n setShowPopover(!showPopover);\n } else {\n openModal();\n }\n }}\n >\n {stage.complete && <Icon name='check' />}\n {!(stage.complete && compressedView) && (\n <StyledInnerStage\n ref={isCurrent(stage.id) ? setCurrentStageNameEl : undefined}\n ellipsis={isCurrent(stage.id) && compressedView}\n >\n {!isCurrent(stage.id) && compressedView ? index + 1 : stage.name}\n </StyledInnerStage>\n )}\n </Flex>\n ))}\n </Flex>\n <Flex ref={popoverContentRef}>\n <Popover\n as={StyledStagePopover}\n show={showPopover && isSmallOrAbove}\n target={stagesRefs.current[activeStageIndex]}\n id='id'\n ref={setPopoverRef}\n arrow\n placement='bottom-start'\n onKeyDown={onKeyDownPopover}\n modifiers={[\n {\n name: 'flip',\n options: {\n fallbackPlacements: ['bottom-end', 'right', 'left']\n }\n }\n ]}\n >\n <StepsContainer currentStage={[activeStageObj]} />\n <Button variant='secondary' onClick={openModal}>\n {t('stage_see_full_lifecycle')}\n </Button>\n </Popover>\n </Flex>\n </>\n );\n};\n\nexport default Stages;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stages.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Stages/Stages.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Stages.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Stages/Stages.styles.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,YAAY,yGAMvB,CAAC;AAIH,eAAO,MAAM,gBAAgB;;SAW3B,CAAC;AAEH,eAAO,MAAM,WAAW,4GA4LvB,CAAC;AAIF,eAAO,MAAM,kBAAkB,yGAM7B,CAAC;AAIH,eAAO,MAAM,oBAAoB,wGAU/B,CAAC;AAIH,eAAO,MAAM,UAAU;cAAyB,OAAO;SA0BrD,CAAC;AAIH,eAAO,MAAM,WAAW,yGAGvB,CAAC;AAIF,eAAO,MAAM,eAAe;cAA2B,OAAO;SAmB5D,CAAC;AAIH,eAAO,MAAM,qBAAqB,0GAMhC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
-
import { calculateFontSize, defaultThemeProp, StyledIcon, StyledText } from '@pega/cosmos-react-core';
|
|
2
|
+
import { calculateFontSize, defaultThemeProp, StyledIcon, StyledText, useDirection } from '@pega/cosmos-react-core';
|
|
3
3
|
export const StyledStages = styled.div(props => {
|
|
4
4
|
return css `
|
|
5
5
|
background-color: ${props.theme.base.palette['primary-background']};
|
|
@@ -20,19 +20,17 @@ export const StyledInnerStage = styled.span(props => {
|
|
|
20
20
|
`}
|
|
21
21
|
`;
|
|
22
22
|
});
|
|
23
|
-
export const StyledStage = styled.button(
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const baseBorderColor = props.theme.base.palette['border-line'];
|
|
27
|
-
const borderRadius = props.theme.base['border-radius'];
|
|
23
|
+
export const StyledStage = styled.button(({ theme: { base: { spacing, palette, 'hit-area': hitArea, shadow, transparency, 'border-radius': borderRadius } } }) => {
|
|
24
|
+
const activeColor = palette.interactive;
|
|
25
|
+
const baseBorderColor = palette['border-line'];
|
|
28
26
|
const thinBorderWidth = '0.0625rem';
|
|
29
27
|
const thickBorderWidth = '0.125rem';
|
|
30
|
-
const baseTransparency =
|
|
31
|
-
const
|
|
28
|
+
const baseTransparency = transparency['transparent-2'];
|
|
29
|
+
const { rtl, start, end } = useDirection();
|
|
32
30
|
return css `
|
|
33
31
|
/* stylelint-disable no-descending-specificity */
|
|
34
32
|
background-color: inherit;
|
|
35
|
-
color: ${
|
|
33
|
+
color: ${palette['foreground-color']};
|
|
36
34
|
outline: none;
|
|
37
35
|
border-color: transparent;
|
|
38
36
|
border-width: ${thinBorderWidth} 0;
|
|
@@ -44,13 +42,13 @@ export const StyledStage = styled.button(props => {
|
|
|
44
42
|
padding-inline-end: ${spacing};
|
|
45
43
|
|
|
46
44
|
@media (pointer: coarse) {
|
|
47
|
-
height: ${
|
|
45
|
+
height: ${hitArea['finger-min']};
|
|
48
46
|
padding-inline-start: calc(2.25 * ${spacing});
|
|
49
47
|
}
|
|
50
48
|
|
|
51
49
|
${StyledIcon} {
|
|
52
50
|
margin-inline-end: 0.25rem;
|
|
53
|
-
color: ${
|
|
51
|
+
color: ${palette.success};
|
|
54
52
|
|
|
55
53
|
&:last-child {
|
|
56
54
|
margin-inline-end: 0;
|
|
@@ -62,19 +60,15 @@ export const StyledStage = styled.button(props => {
|
|
|
62
60
|
}
|
|
63
61
|
|
|
64
62
|
&:first-child {
|
|
65
|
-
border-top-
|
|
66
|
-
border-
|
|
67
|
-
border-bottom-left-radius: ${isRTL ? 0 : borderRadius};
|
|
68
|
-
border-bottom-right-radius: ${isRTL ? borderRadius : 0};
|
|
63
|
+
border-top-${start}-radius: ${borderRadius};
|
|
64
|
+
border-bottom-${start}-radius: ${borderRadius};
|
|
69
65
|
border-inline-start-width: ${thinBorderWidth};
|
|
70
66
|
padding-inline-start: calc(${spacing});
|
|
71
67
|
}
|
|
72
68
|
|
|
73
69
|
&:last-child {
|
|
74
|
-
border-top-
|
|
75
|
-
border-
|
|
76
|
-
border-bottom-left-radius: ${isRTL ? borderRadius : 0};
|
|
77
|
-
border-bottom-right-radius: ${isRTL ? 0 : borderRadius};
|
|
70
|
+
border-top-${end}-radius: ${borderRadius};
|
|
71
|
+
border-bottom-${end}-radius: ${borderRadius};
|
|
78
72
|
border-inline-end-width: ${thinBorderWidth};
|
|
79
73
|
padding-inline-end: calc(${spacing});
|
|
80
74
|
min-width: calc(6.25 * ${spacing});
|
|
@@ -93,8 +87,8 @@ export const StyledStage = styled.button(props => {
|
|
|
93
87
|
border-color: ${baseBorderColor};
|
|
94
88
|
border-inline-end-width: ${thinBorderWidth};
|
|
95
89
|
border-inline-start-width: 0;
|
|
96
|
-
border-top-width: ${
|
|
97
|
-
border-bottom-width: ${
|
|
90
|
+
border-top-width: ${rtl ? 0 : thinBorderWidth};
|
|
91
|
+
border-bottom-width: ${rtl ? thinBorderWidth : 0};
|
|
98
92
|
transform: rotateZ(45deg) skew(15deg, 15deg);
|
|
99
93
|
|
|
100
94
|
@media (pointer: coarse) {
|
|
@@ -133,8 +127,8 @@ export const StyledStage = styled.button(props => {
|
|
|
133
127
|
&:focus::before,
|
|
134
128
|
&:focus + &::before {
|
|
135
129
|
border-inline-end-width: ${thickBorderWidth};
|
|
136
|
-
border-top-width: ${
|
|
137
|
-
border-bottom-width: ${
|
|
130
|
+
border-top-width: ${rtl ? 0 : thickBorderWidth};
|
|
131
|
+
border-bottom-width: ${rtl ? thickBorderWidth : 0};
|
|
138
132
|
}
|
|
139
133
|
|
|
140
134
|
&:first-child:focus {
|
|
@@ -151,15 +145,15 @@ export const StyledStage = styled.button(props => {
|
|
|
151
145
|
border-width: ${thinBorderWidth} 0;
|
|
152
146
|
|
|
153
147
|
${StyledInnerStage} {
|
|
154
|
-
opacity: ${
|
|
148
|
+
opacity: ${transparency['transparent-3']};
|
|
155
149
|
}
|
|
156
150
|
}
|
|
157
151
|
|
|
158
152
|
&:active::before,
|
|
159
153
|
&:active + &::before {
|
|
160
154
|
border-inline-end-width: ${thinBorderWidth};
|
|
161
|
-
border-top-width: ${
|
|
162
|
-
border-bottom-width: ${
|
|
155
|
+
border-top-width: ${rtl ? 0 : thinBorderWidth};
|
|
156
|
+
border-bottom-width: ${rtl ? thinBorderWidth : 0};
|
|
163
157
|
}
|
|
164
158
|
|
|
165
159
|
&:first-child:active {
|
|
@@ -187,13 +181,13 @@ export const StyledStage = styled.button(props => {
|
|
|
187
181
|
}
|
|
188
182
|
&:active {
|
|
189
183
|
${StyledInnerStage} {
|
|
190
|
-
opacity: ${
|
|
184
|
+
opacity: ${transparency['transparent-3']};
|
|
191
185
|
}
|
|
192
186
|
}
|
|
193
187
|
}
|
|
194
188
|
|
|
195
189
|
&[aria-current] + &::before {
|
|
196
|
-
box-shadow: ${
|
|
190
|
+
box-shadow: ${shadow.low};
|
|
197
191
|
}
|
|
198
192
|
|
|
199
193
|
&[aria-current] + &:focus::before {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stages.styles.js","sourceRoot":"","sources":["../../../src/components/Stages/Stages.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACV,UAAU,EACX,MAAM,yBAAyB,CAAC;AAEjC,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;IAC7C,OAAO,GAAG,CAAA;wBACY,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC;qBACjD,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC;;GAEnD,CAAC;AACJ,CAAC,CAAC,CA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;;;;;;;MAQN,UAAU;eACD,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO;2BACd,KAAK,CAAC,IAAI,CAAC,OAAO;;;MAGvC,UAAU;iBACC,WAAW;;GAEzB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEhD,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC7D,MAAM,QAAQ,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IACtF,OAAO,GAAG,CAAA;iBACK,QAAQ,CAAC,EAAE;eACb,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC;GACpD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,qBAAqB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport {\n calculateFontSize,\n defaultThemeProp,\n StyledIcon,\n StyledText\n} from '@pega/cosmos-react-core';\n\nexport const StyledStages = styled.div(props => {\n return css`\n background-color: ${props.theme.base.palette['primary-background']};\n border-radius: ${props.theme.base['border-radius']};\n width: 100%;\n `;\n});\n\nStyledStages.defaultProps = defaultThemeProp;\n\nexport const StyledInnerStage = styled.span<{ ellipsis?: boolean }>(props => {\n return css`\n display: inline-block;\n text-align: center;\n white-space: nowrap;\n ${props.ellipsis &&\n css`\n overflow: hidden;\n text-overflow: ellipsis;\n `}\n `;\n});\n\nexport const StyledStage = styled.button(props => {\n const spacing = props.theme.base.spacing;\n const activeColor = props.theme.base.palette.interactive;\n const baseBorderColor = props.theme.base.palette['border-line'];\n const borderRadius = props.theme.base['border-radius'];\n const thinBorderWidth = '0.0625rem';\n const thickBorderWidth = '0.125rem';\n const baseTransparency = props.theme.base.transparency['transparent-2'];\n const isRTL = props.theme.base.rtl;\n\n return css`\n /* stylelint-disable no-descending-specificity */\n background-color: inherit;\n color: ${props.theme.base.palette['foreground-color']};\n outline: none;\n border-color: transparent;\n border-width: ${thinBorderWidth} 0;\n border-style: solid;\n position: relative;\n height: calc(4 * ${spacing});\n min-width: calc(5.25 * ${spacing});\n padding-inline-start: calc(2 * ${spacing});\n padding-inline-end: ${spacing};\n\n @media (pointer: coarse) {\n height: ${props.theme.base.sizes['touch-finger']};\n padding-inline-start: calc(2.25 * ${spacing});\n }\n\n ${StyledIcon} {\n margin-inline-end: 0.25rem;\n color: ${props.theme.base.palette.success};\n\n &:last-child {\n margin-inline-end: 0;\n }\n }\n\n ${StyledInnerStage} {\n opacity: ${baseTransparency};\n }\n\n &:first-child {\n border-top-left-radius: ${isRTL ? 0 : borderRadius};\n border-top-right-radius: ${isRTL ? borderRadius : 0};\n border-bottom-left-radius: ${isRTL ? 0 : borderRadius};\n border-bottom-right-radius: ${isRTL ? borderRadius : 0};\n border-inline-start-width: ${thinBorderWidth};\n padding-inline-start: calc(${spacing});\n }\n\n &:last-child {\n border-top-left-radius: ${isRTL ? borderRadius : 0};\n border-top-right-radius: ${isRTL ? 0 : borderRadius};\n border-bottom-left-radius: ${isRTL ? borderRadius : 0};\n border-bottom-right-radius: ${isRTL ? 0 : borderRadius};\n border-inline-end-width: ${thinBorderWidth};\n padding-inline-end: calc(${spacing});\n min-width: calc(6.25 * ${spacing});\n }\n\n &:not(:first-child)::before {\n content: '';\n position: absolute;\n display: block;\n width: calc(2.25 * ${spacing});\n height: calc(2.25 * ${spacing});\n left: calc(-1.125 * ${spacing});\n right: calc(-1.125 * ${spacing});\n background-color: transparent;\n border-style: solid;\n border-color: ${baseBorderColor};\n border-inline-end-width: ${thinBorderWidth};\n border-inline-start-width: 0;\n border-top-width: ${isRTL ? 0 : thinBorderWidth};\n border-bottom-width: ${isRTL ? thinBorderWidth : 0};\n transform: rotateZ(45deg) skew(15deg, 15deg);\n\n @media (pointer: coarse) {\n width: calc(2.875 * ${spacing});\n height: calc(2.875 * ${spacing});\n left: calc(-1.375 * ${spacing});\n right: calc(-1.375 * ${spacing});\n transform: rotateZ(45deg) skew(20deg, 20deg);\n }\n }\n\n &:hover,\n &:hover::before {\n border-color: ${baseBorderColor};\n }\n\n &:hover {\n ${StyledInnerStage} {\n opacity: 1;\n }\n }\n\n &:focus,\n &:active,\n &:focus::before,\n &:active::before,\n &:focus + &::before,\n &:active + &::before {\n border-color: ${activeColor};\n }\n\n &:focus {\n border-width: ${thickBorderWidth} 0;\n }\n\n &:focus::before,\n &:focus + &::before {\n border-inline-end-width: ${thickBorderWidth};\n border-top-width: ${isRTL ? 0 : thickBorderWidth};\n border-bottom-width: ${isRTL ? thickBorderWidth : 0};\n }\n\n &:first-child:focus {\n border-inline-start-width: ${thickBorderWidth};\n padding-inline-start: calc(${spacing} - ${thickBorderWidth} + ${thinBorderWidth});\n }\n\n &:last-child:focus {\n border-inline-end-width: ${thickBorderWidth};\n padding-inline-end: calc(${spacing} - ${thinBorderWidth});\n }\n\n &:active {\n border-width: ${thinBorderWidth} 0;\n\n ${StyledInnerStage} {\n opacity: ${props.theme.base.transparency['transparent-3']};\n }\n }\n\n &:active::before,\n &:active + &::before {\n border-inline-end-width: ${thinBorderWidth};\n border-top-width: ${isRTL ? 0 : thinBorderWidth};\n border-bottom-width: ${isRTL ? thinBorderWidth : 0};\n }\n\n &:first-child:active {\n border-inline-start-width: ${thinBorderWidth};\n padding-inline-start: calc(${spacing});\n }\n\n &:last-child:active {\n border-inline-end-width: ${thinBorderWidth};\n padding-inline-end: calc(${spacing});\n }\n\n &[aria-current] {\n z-index: 2;\n\n ${StyledInnerStage} {\n font-weight: bold;\n opacity: 1;\n }\n\n &:hover {\n ${StyledInnerStage} {\n opacity: ${baseTransparency};\n }\n }\n &:active {\n ${StyledInnerStage} {\n opacity: ${props.theme.base.transparency['transparent-3']};\n }\n }\n }\n\n &[aria-current] + &::before {\n box-shadow: ${props.theme.base.shadow.low};\n }\n\n &[aria-current] + &:focus::before {\n box-shadow: none;\n }\n `;\n});\n\nStyledStage.defaultProps = defaultThemeProp;\n\nexport const StyledStagePopover = styled.div(({ theme }) => {\n return css`\n padding: calc(2 * ${theme.base.spacing});\n white-space: pre-line;\n width: 18rem;\n `;\n});\n\nStyledStagePopover.defaultProps = defaultThemeProp;\n\nexport const StyledStepsContainer = styled.ol(({ theme }) => {\n return css`\n list-style-type: none;\n margin-top: calc(1.5 * ${theme.base.spacing});\n margin-bottom: calc(2.5 * ${theme.base.spacing});\n\n &:empty {\n margin-bottom: 0;\n }\n `;\n});\n\nStyledStepsContainer.defaultProps = defaultThemeProp;\n\nexport const StyledStep = styled.li<{ complete: boolean }>(({ complete, theme }) => {\n const iconColor = complete ? theme.base.palette.success : theme.base.palette['foreground-color'];\n const iconWidth = complete ? '1.125rem' : '0.3rem';\n const iconMargin = complete ? 0 : '0.3rem';\n const textOpacity = complete ? theme.base.transparency['transparent-3'] : 1;\n\n return css`\n border-radius: 0;\n margin-bottom: calc(${theme.base.spacing});\n color: ${theme.base.palette['foreground-color']};\n\n &:last-child {\n margin-bottom: 0;\n }\n\n ${StyledIcon} {\n margin-inline-end: calc(${theme.base.spacing});\n color: ${iconColor};\n width: ${iconWidth};\n margin-inline-start: ${iconMargin};\n }\n\n ${StyledText} {\n opacity: ${textOpacity};\n }\n `;\n});\n\nStyledStep.defaultProps = defaultThemeProp;\n\nexport const StyledSteps = styled.div`\n background-color: ${props => props.theme.components.card.background};\n position: relative;\n`;\n\nStyledSteps.defaultProps = defaultThemeProp;\n\nexport const StyledInnerStep = styled.span<{ complete: boolean }>(({ complete, theme }) => {\n const textOpacity = complete ? theme.base.transparency['transparent-2'] : 1;\n return css`\n display: flex;\n width: 100%;\n text-align: start;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n\n ${StyledIcon} {\n color: ${theme.base.palette.success};\n margin-inline-end: ${theme.base.spacing};\n }\n\n ${StyledText} {\n opacity: ${textOpacity};\n }\n `;\n});\n\nStyledInnerStep.defaultProps = defaultThemeProp;\n\nexport const StyledDateTimeDisplay = styled.span(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n return css`\n font-size: ${fontSize.xs};\n opacity: ${theme.base.transparency['transparent-2']};\n `;\n});\n\nStyledDateTimeDisplay.defaultProps = defaultThemeProp;\n"]}
|
|
1
|
+
{"version":3,"file":"Stages.styles.js","sourceRoot":"","sources":["../../../src/components/Stages/Stages.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,YAAY,EACb,MAAM,yBAAyB,CAAC;AAEjC,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;IAC7C,OAAO,GAAG,CAAA;wBACY,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC;qBACjD,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC;;GAEnD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,YAAY,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE7C,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAyB,KAAK,CAAC,EAAE;IAC1E,OAAO,GAAG,CAAA;;;;MAIN,KAAK,CAAC,QAAQ;QAChB,GAAG,CAAA;;;KAGF;GACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CACtC,CAAC,EACC,KAAK,EAAE,EACL,IAAI,EAAE,EACJ,OAAO,EACP,OAAO,EACP,UAAU,EAAE,OAAO,EACnB,MAAM,EACN,YAAY,EACZ,eAAe,EAAE,YAAY,EAC9B,EACF,EACF,EAAE,EAAE;IACH,MAA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AC,CAAC;IAC5E,OAAO,GAAG,CAAA;;;;;;;;MAQN,UAAU;eACD,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO;2BACd,KAAK,CAAC,IAAI,CAAC,OAAO;;;MAGvC,UAAU;iBACC,WAAW;;GAEzB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEhD,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC7D,MAAM,QAAQ,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IACtF,OAAO,GAAG,CAAA;iBACK,QAAQ,CAAC,EAAE;eACb,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC;GACpD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,qBAAqB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport {\n calculateFontSize,\n defaultThemeProp,\n StyledIcon,\n StyledText,\n useDirection\n} from '@pega/cosmos-react-core';\n\nexport const StyledStages = styled.div(props => {\n return css`\n background-color: ${props.theme.base.palette['primary-background']};\n border-radius: ${props.theme.base['border-radius']};\n width: 100%;\n `;\n});\n\nStyledStages.defaultProps = defaultThemeProp;\n\nexport const StyledInnerStage = styled.span<{ ellipsis?: boolean }>(props => {\n return css`\n display: inline-block;\n text-align: center;\n white-space: nowrap;\n ${props.ellipsis &&\n css`\n overflow: hidden;\n text-overflow: ellipsis;\n `}\n `;\n});\n\nexport const StyledStage = styled.button(\n ({\n theme: {\n base: {\n spacing,\n palette,\n 'hit-area': hitArea,\n shadow,\n transparency,\n 'border-radius': borderRadius\n }\n }\n }) => {\n const activeColor = palette.interactive;\n const baseBorderColor = palette['border-line'];\n const thinBorderWidth = '0.0625rem';\n const thickBorderWidth = '0.125rem';\n const baseTransparency = transparency['transparent-2'];\n const { rtl, start, end } = useDirection();\n\n return css`\n /* stylelint-disable no-descending-specificity */\n background-color: inherit;\n color: ${palette['foreground-color']};\n outline: none;\n border-color: transparent;\n border-width: ${thinBorderWidth} 0;\n border-style: solid;\n position: relative;\n height: calc(4 * ${spacing});\n min-width: calc(5.25 * ${spacing});\n padding-inline-start: calc(2 * ${spacing});\n padding-inline-end: ${spacing};\n\n @media (pointer: coarse) {\n height: ${hitArea['finger-min']};\n padding-inline-start: calc(2.25 * ${spacing});\n }\n\n ${StyledIcon} {\n margin-inline-end: 0.25rem;\n color: ${palette.success};\n\n &:last-child {\n margin-inline-end: 0;\n }\n }\n\n ${StyledInnerStage} {\n opacity: ${baseTransparency};\n }\n\n &:first-child {\n border-top-${start}-radius: ${borderRadius};\n border-bottom-${start}-radius: ${borderRadius};\n border-inline-start-width: ${thinBorderWidth};\n padding-inline-start: calc(${spacing});\n }\n\n &:last-child {\n border-top-${end}-radius: ${borderRadius};\n border-bottom-${end}-radius: ${borderRadius};\n border-inline-end-width: ${thinBorderWidth};\n padding-inline-end: calc(${spacing});\n min-width: calc(6.25 * ${spacing});\n }\n\n &:not(:first-child)::before {\n content: '';\n position: absolute;\n display: block;\n width: calc(2.25 * ${spacing});\n height: calc(2.25 * ${spacing});\n left: calc(-1.125 * ${spacing});\n right: calc(-1.125 * ${spacing});\n background-color: transparent;\n border-style: solid;\n border-color: ${baseBorderColor};\n border-inline-end-width: ${thinBorderWidth};\n border-inline-start-width: 0;\n border-top-width: ${rtl ? 0 : thinBorderWidth};\n border-bottom-width: ${rtl ? thinBorderWidth : 0};\n transform: rotateZ(45deg) skew(15deg, 15deg);\n\n @media (pointer: coarse) {\n width: calc(2.875 * ${spacing});\n height: calc(2.875 * ${spacing});\n left: calc(-1.375 * ${spacing});\n right: calc(-1.375 * ${spacing});\n transform: rotateZ(45deg) skew(20deg, 20deg);\n }\n }\n\n &:hover,\n &:hover::before {\n border-color: ${baseBorderColor};\n }\n\n &:hover {\n ${StyledInnerStage} {\n opacity: 1;\n }\n }\n\n &:focus,\n &:active,\n &:focus::before,\n &:active::before,\n &:focus + &::before,\n &:active + &::before {\n border-color: ${activeColor};\n }\n\n &:focus {\n border-width: ${thickBorderWidth} 0;\n }\n\n &:focus::before,\n &:focus + &::before {\n border-inline-end-width: ${thickBorderWidth};\n border-top-width: ${rtl ? 0 : thickBorderWidth};\n border-bottom-width: ${rtl ? thickBorderWidth : 0};\n }\n\n &:first-child:focus {\n border-inline-start-width: ${thickBorderWidth};\n padding-inline-start: calc(${spacing} - ${thickBorderWidth} + ${thinBorderWidth});\n }\n\n &:last-child:focus {\n border-inline-end-width: ${thickBorderWidth};\n padding-inline-end: calc(${spacing} - ${thinBorderWidth});\n }\n\n &:active {\n border-width: ${thinBorderWidth} 0;\n\n ${StyledInnerStage} {\n opacity: ${transparency['transparent-3']};\n }\n }\n\n &:active::before,\n &:active + &::before {\n border-inline-end-width: ${thinBorderWidth};\n border-top-width: ${rtl ? 0 : thinBorderWidth};\n border-bottom-width: ${rtl ? thinBorderWidth : 0};\n }\n\n &:first-child:active {\n border-inline-start-width: ${thinBorderWidth};\n padding-inline-start: calc(${spacing});\n }\n\n &:last-child:active {\n border-inline-end-width: ${thinBorderWidth};\n padding-inline-end: calc(${spacing});\n }\n\n &[aria-current] {\n z-index: 2;\n\n ${StyledInnerStage} {\n font-weight: bold;\n opacity: 1;\n }\n\n &:hover {\n ${StyledInnerStage} {\n opacity: ${baseTransparency};\n }\n }\n &:active {\n ${StyledInnerStage} {\n opacity: ${transparency['transparent-3']};\n }\n }\n }\n\n &[aria-current] + &::before {\n box-shadow: ${shadow.low};\n }\n\n &[aria-current] + &:focus::before {\n box-shadow: none;\n }\n `;\n }\n);\n\nStyledStage.defaultProps = defaultThemeProp;\n\nexport const StyledStagePopover = styled.div(({ theme }) => {\n return css`\n padding: calc(2 * ${theme.base.spacing});\n white-space: pre-line;\n width: 18rem;\n `;\n});\n\nStyledStagePopover.defaultProps = defaultThemeProp;\n\nexport const StyledStepsContainer = styled.ol(({ theme }) => {\n return css`\n list-style-type: none;\n margin-top: calc(1.5 * ${theme.base.spacing});\n margin-bottom: calc(2.5 * ${theme.base.spacing});\n\n &:empty {\n margin-bottom: 0;\n }\n `;\n});\n\nStyledStepsContainer.defaultProps = defaultThemeProp;\n\nexport const StyledStep = styled.li<{ complete: boolean }>(({ complete, theme }) => {\n const iconColor = complete ? theme.base.palette.success : theme.base.palette['foreground-color'];\n const iconWidth = complete ? '1.125rem' : '0.3rem';\n const iconMargin = complete ? 0 : '0.3rem';\n const textOpacity = complete ? theme.base.transparency['transparent-3'] : 1;\n\n return css`\n border-radius: 0;\n margin-bottom: calc(${theme.base.spacing});\n color: ${theme.base.palette['foreground-color']};\n\n &:last-child {\n margin-bottom: 0;\n }\n\n ${StyledIcon} {\n margin-inline-end: calc(${theme.base.spacing});\n color: ${iconColor};\n width: ${iconWidth};\n margin-inline-start: ${iconMargin};\n }\n\n ${StyledText} {\n opacity: ${textOpacity};\n }\n `;\n});\n\nStyledStep.defaultProps = defaultThemeProp;\n\nexport const StyledSteps = styled.div`\n background-color: ${props => props.theme.components.card.background};\n position: relative;\n`;\n\nStyledSteps.defaultProps = defaultThemeProp;\n\nexport const StyledInnerStep = styled.span<{ complete: boolean }>(({ complete, theme }) => {\n const textOpacity = complete ? theme.base.transparency['transparent-2'] : 1;\n return css`\n display: flex;\n width: 100%;\n text-align: start;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n\n ${StyledIcon} {\n color: ${theme.base.palette.success};\n margin-inline-end: ${theme.base.spacing};\n }\n\n ${StyledText} {\n opacity: ${textOpacity};\n }\n `;\n});\n\nStyledInnerStep.defaultProps = defaultThemeProp;\n\nexport const StyledDateTimeDisplay = styled.span(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n return css`\n font-size: ${fontSize.xs};\n opacity: ${theme.base.transparency['transparent-2']};\n `;\n});\n\nStyledDateTimeDisplay.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Steps.d.ts","sourceRoot":"","sources":["../../../src/components/Stages/Steps.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"Steps.d.ts","sourceRoot":"","sources":["../../../src/components/Stages/Steps.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAM3D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK3C,UAAU,UAAU;IAClB,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC;CACrB;AAED,QAAA,MAAM,KAAK,EAAE,iBAAiB,CAAC,UAAU,CAcxC,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Icon, Text, Grid } from '@pega/cosmos-react-core';
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Icon, registerIcon, Text, Grid } from '@pega/cosmos-react-core';
|
|
3
|
+
import * as checkIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/check.icon';
|
|
4
|
+
import * as circleSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/circle-solid.icon';
|
|
3
5
|
import { StyledStep, StyledStepsContainer } from './Stages.styles';
|
|
6
|
+
registerIcon(checkIcon, circleSolidIcon);
|
|
4
7
|
const Steps = ({ steps }) => {
|
|
5
|
-
return (
|
|
6
|
-
|
|
7
|
-
React.createElement(Grid, { container: { cols: '1.625rem 1fr' } },
|
|
8
|
-
React.createElement(Icon, { name: complete ? 'check' : 'circle-solid' }),
|
|
9
|
-
React.createElement(Text, null, name)))))));
|
|
8
|
+
return (_jsx(StyledStepsContainer, { children: steps &&
|
|
9
|
+
steps.map(({ id, name, complete }) => (_jsx(StyledStep, { complete: complete, children: _jsxs(Grid, { container: { cols: '1.625rem 1fr' }, children: [_jsx(Icon, { name: complete ? 'check' : 'circle-solid' }, void 0), _jsx(Text, { children: name }, void 0)] }, void 0) }, id))) }, void 0));
|
|
10
10
|
};
|
|
11
11
|
export default Steps;
|
|
12
12
|
//# sourceMappingURL=Steps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Steps.js","sourceRoot":"","sources":["../../../src/components/Stages/Steps.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Steps.js","sourceRoot":"","sources":["../../../src/components/Stages/Steps.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,KAAK,SAAS,MAAM,8DAA8D,CAAC;AAC1F,OAAO,KAAK,eAAe,MAAM,qEAAqE,CAAC;AAGvG,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEnE,YAAY,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;AAMzC,MAAM,KAAK,GAAkC,CAAC,EAAE,KAAK,EAA+B,EAAE,EAAE;IACtF,OAAO,CACL,KAAC,oBAAoB,cAClB,KAAK;YACJ,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CACpC,KAAC,UAAU,IAAU,QAAQ,EAAE,QAAQ,YACrC,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,aACvC,KAAC,IAAI,IAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,WAAI,EACnD,KAAC,IAAI,cAAE,IAAI,WAAQ,YACd,IAJQ,EAAE,CAKN,CACd,CAAC,WACiB,CACxB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC","sourcesContent":["import { PropsWithoutRef, FunctionComponent } from 'react';\n\nimport { Icon, registerIcon, Text, Grid } from '@pega/cosmos-react-core';\nimport * as checkIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/check.icon';\nimport * as circleSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/circle-solid.icon';\n\nimport { StepProps } from './Stages.types';\nimport { StyledStep, StyledStepsContainer } from './Stages.styles';\n\nregisterIcon(checkIcon, circleSolidIcon);\n\ninterface StepsProps {\n steps?: StepProps[];\n}\n\nconst Steps: FunctionComponent<StepsProps> = ({ steps }: PropsWithoutRef<StepsProps>) => {\n return (\n <StyledStepsContainer>\n {steps &&\n steps.map(({ id, name, complete }) => (\n <StyledStep key={id} complete={complete}>\n <Grid container={{ cols: '1.625rem 1fr' }}>\n <Icon name={complete ? 'check' : 'circle-solid'} />\n <Text>{name}</Text>\n </Grid>\n </StyledStep>\n ))}\n </StyledStepsContainer>\n );\n};\n\nexport default Steps;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepsContainer.d.ts","sourceRoot":"","sources":["../../../src/components/Stages/StepsContainer.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"StepsContainer.d.ts","sourceRoot":"","sources":["../../../src/components/Stages/StepsContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAmB,MAAM,OAAO,CAAC;AAM3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAK7C,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;CACrC;AAED,QAAA,MAAM,cAAc,EAAE,iBAAiB,CAAC,mBAAmB,CAqB1D,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Flex, Icon, DateTimeDisplay, Text } from '@pega/cosmos-react-core';
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Flex, Icon, registerIcon, DateTimeDisplay, Text } from '@pega/cosmos-react-core';
|
|
3
|
+
import * as checkIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/check.icon';
|
|
3
4
|
import Steps from './Steps';
|
|
4
5
|
import { StyledDateTimeDisplay, StyledInnerStep, StyledSteps } from './Stages.styles';
|
|
6
|
+
registerIcon(checkIcon);
|
|
5
7
|
const StepsContainer = ({ currentStage }) => {
|
|
6
|
-
|
|
7
|
-
return (React.createElement(Flex, { as: StyledSteps, container: { direction: 'column' }, item: { grow: 1 } },
|
|
8
|
-
React.createElement(StyledInnerStep, { complete: (_a = currentStage[0]) === null || _a === void 0 ? void 0 : _a.complete },
|
|
9
|
-
((_b = currentStage[0]) === null || _b === void 0 ? void 0 : _b.complete) && React.createElement(Icon, { name: 'check' }),
|
|
10
|
-
React.createElement(Text, { variant: 'h2' }, (_c = currentStage[0]) === null || _c === void 0 ? void 0 : _c.name)),
|
|
11
|
-
React.createElement(DateTimeDisplay, { as: StyledDateTimeDisplay, value: (_d = currentStage[0]) === null || _d === void 0 ? void 0 : _d.date, variant: 'relative', format: 'short' }),
|
|
12
|
-
React.createElement(Steps, { steps: currentStage[0].steps })));
|
|
8
|
+
return (_jsxs(Flex, { as: StyledSteps, container: { direction: 'column' }, item: { grow: 1 }, children: [_jsxs(StyledInnerStep, { complete: currentStage[0]?.complete, children: [currentStage[0]?.complete && _jsx(Icon, { name: 'check' }, void 0), _jsx(Text, { variant: 'h2', children: currentStage[0]?.name }, void 0)] }, void 0), currentStage[0]?.date && (_jsx(DateTimeDisplay, { as: StyledDateTimeDisplay, value: currentStage[0]?.date, variant: 'relative', format: 'short' }, void 0)), _jsx(Steps, { steps: currentStage[0].steps }, void 0)] }, void 0));
|
|
13
9
|
};
|
|
14
10
|
export default StepsContainer;
|
|
15
11
|
//# sourceMappingURL=StepsContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepsContainer.js","sourceRoot":"","sources":["../../../src/components/Stages/StepsContainer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StepsContainer.js","sourceRoot":"","sources":["../../../src/components/Stages/StepsContainer.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC1F,OAAO,KAAK,SAAS,MAAM,8DAA8D,CAAC;AAE1F,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEtF,YAAY,CAAC,SAAS,CAAC,CAAC;AAMxB,MAAM,cAAc,GAA2C,CAAC,EAC9D,YAAY,EACyB,EAAE,EAAE;IACzC,OAAO,CACL,MAAC,IAAI,IAAC,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,aAC1E,MAAC,eAAe,IAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,QAAQ,aACjD,YAAY,CAAC,CAAC,CAAC,EAAE,QAAQ,IAAI,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,WAAG,EACnD,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YAAE,YAAY,CAAC,CAAC,CAAC,EAAE,IAAI,WAAQ,YACjC,EACjB,YAAY,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,CACxB,KAAC,eAAe,IACd,EAAE,EAAE,qBAAqB,EACzB,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,IAAI,EAC5B,OAAO,EAAC,UAAU,EAClB,MAAM,EAAC,OAAO,WACd,CACH,EAED,KAAC,KAAK,IAAC,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK,WAAI,YAClC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { FunctionComponent, PropsWithoutRef } from 'react';\n\nimport { Flex, Icon, registerIcon, DateTimeDisplay, Text } from '@pega/cosmos-react-core';\nimport * as checkIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/check.icon';\n\nimport Steps from './Steps';\nimport { StagesProps } from './Stages.types';\nimport { StyledDateTimeDisplay, StyledInnerStep, StyledSteps } from './Stages.styles';\n\nregisterIcon(checkIcon);\n\nexport interface StepsContainerProps {\n currentStage: StagesProps['stages'];\n}\n\nconst StepsContainer: FunctionComponent<StepsContainerProps> = ({\n currentStage\n}: PropsWithoutRef<StepsContainerProps>) => {\n return (\n <Flex as={StyledSteps} container={{ direction: 'column' }} item={{ grow: 1 }}>\n <StyledInnerStep complete={currentStage[0]?.complete}>\n {currentStage[0]?.complete && <Icon name='check' />}\n <Text variant='h2'>{currentStage[0]?.name}</Text>\n </StyledInnerStep>\n {currentStage[0]?.date && (\n <DateTimeDisplay\n as={StyledDateTimeDisplay}\n value={currentStage[0]?.date}\n variant='relative'\n format='short'\n />\n )}\n\n <Steps steps={currentStage[0].steps} />\n </Flex>\n );\n};\n\nexport default StepsContainer;\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { StakeholdersProps } from './Stakeholders.types';
|
|
2
|
+
interface FormProps extends Pick<StakeholdersProps['form'], 'roles' | 'currentRole' | 'renderer'> {
|
|
3
|
+
setSelectedRoleNameRef: (selectedRoleName?: string | undefined) => void;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: ({ roles, currentRole, renderer: Renderer, setSelectedRoleNameRef }: FormProps) => JSX.Element;
|
|
6
|
+
export default _default;
|
|
7
|
+
//# sourceMappingURL=StakeholderForm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StakeholderForm.d.ts","sourceRoot":"","sources":["../../../src/components/Stakeholders/StakeholderForm.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAQ,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEpE,UAAU,SAAU,SAAQ,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,aAAa,GAAG,UAAU,CAAC;IAC/F,sBAAsB,EAAE,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;CACzE;6FAEmF,SAAS;AAA7F,wBA4EE"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { ComboBox, RadioButtonGroup, RadioButton, Flex, useI18n, Input, getFocusables } from '@pega/cosmos-react-core';
|
|
4
|
+
export default ({ roles, currentRole, renderer: Renderer, setSelectedRoleNameRef }) => {
|
|
5
|
+
const contentRef = useRef(null);
|
|
6
|
+
const t = useI18n();
|
|
7
|
+
const [selectedRoleName, setSelectedRoleName] = useState(() => {
|
|
8
|
+
if (roles) {
|
|
9
|
+
return (currentRole ? roles.find(role => role.name === currentRole.name) : roles[0])?.name;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
let control = null;
|
|
13
|
+
if (roles) {
|
|
14
|
+
const label = t('role');
|
|
15
|
+
if (roles.length > 3) {
|
|
16
|
+
const items = roles.map(role => {
|
|
17
|
+
return {
|
|
18
|
+
id: role.name,
|
|
19
|
+
primary: role.name,
|
|
20
|
+
selected: role.name === selectedRoleName
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
const selected = items.find(item => item.selected);
|
|
24
|
+
control = (_jsx(ComboBox, { label: label, selected: selected ? { items: { id: selected.id, text: selected.primary } } : undefined, menu: {
|
|
25
|
+
mode: 'single-select',
|
|
26
|
+
items,
|
|
27
|
+
onItemClick: setSelectedRoleName
|
|
28
|
+
} }, void 0));
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
control = (_jsx(RadioButtonGroup, { label: label, name: 'role', inline: true, onChange: e => {
|
|
32
|
+
setSelectedRoleName(e.target.value);
|
|
33
|
+
}, children: roles.map(role => (_jsx(RadioButton, { label: role.name, value: role.name, checked: role.name === selectedRoleName }, role.name))) }, void 0));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
else if (currentRole) {
|
|
37
|
+
_jsx(Input, { label: t('role'), value: currentRole.name, info: currentRole.description }, void 0);
|
|
38
|
+
}
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
getFocusables(contentRef)[0].focus();
|
|
41
|
+
}, []);
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
setSelectedRoleNameRef(selectedRoleName);
|
|
44
|
+
}, [selectedRoleName]);
|
|
45
|
+
return (_jsxs(Flex, { container: { direction: 'column', gap: 2 }, ref: contentRef, children: [control, _jsx(Renderer, { selectedRoleName: selectedRoleName }, void 0)] }, void 0));
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=StakeholderForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StakeholderForm.js","sourceRoot":"","sources":["../../../src/components/Stakeholders/StakeholderForm.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,WAAW,EACX,IAAI,EACJ,OAAO,EACP,KAAK,EACL,aAAa,EACd,MAAM,yBAAyB,CAAC;AAQjC,eAAe,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,sBAAsB,EAAa,EAAE,EAAE;IAC/F,MAAM,UAAU,GAAG,MAAM,CAAc,IAAI,CAAC,CAAC;IAC7C,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAEpB,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAA2B,GAAG,EAAE;QACtF,IAAI,KAA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;oBACZ,mBAAmB,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACtC,CAAC,YAEA,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CACjB,KAAC,WAAW,IAEV,KAAK,EAAE,IAAI,CAAC,IAAI,EAChB,KAAK,EAAE,IAAI,CAAC,IAAI,EAChB,OAAO,EAAE,IAAI,CAAC,IAAI,KAAK,gBAAgB,IAHlC,IAAI,CAAC,IAAI,CAId,CACH,CAAC,WACe,CACpB,CAAC;SACH;KACF;SAAM,IAAI,WAAW,EAAE;QACtB,KAAC,KAAK,IAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,CAAC,WAAW,WAAI,CAAC;KACrF;IAED,SAAS,CAAC,GAAG,EAAE;QACb,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;IACvC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,SAAS,CAAC,GAAG,EAAE;QACb,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;IAC3C,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAEvB,OAAO,CACL,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,UAAU,aAC9D,OAAO,EACR,KAAC,QAAQ,IAAC,gBAAgB,EAAE,gBAAgB,WAAI,YAC3C,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\nimport {\n ComboBox,\n RadioButtonGroup,\n RadioButton,\n Flex,\n useI18n,\n Input,\n getFocusables\n} from '@pega/cosmos-react-core';\n\nimport type { Role, StakeholdersProps } from './Stakeholders.types';\n\ninterface FormProps extends Pick<StakeholdersProps['form'], 'roles' | 'currentRole' | 'renderer'> {\n setSelectedRoleNameRef: (selectedRoleName?: string | undefined) => void;\n}\n\nexport default ({ roles, currentRole, renderer: Renderer, setSelectedRoleNameRef }: FormProps) => {\n const contentRef = useRef<HTMLElement>(null);\n const t = useI18n();\n\n const [selectedRoleName, setSelectedRoleName] = useState<Role['name'] | undefined>(() => {\n if (roles) {\n return (currentRole ? roles.find(role => role.name === currentRole.name) : roles[0])?.name;\n }\n });\n\n let control: JSX.Element | null = null;\n\n if (roles) {\n const label = t('role');\n\n if (roles.length > 3) {\n const items = roles.map(role => {\n return {\n id: role.name,\n primary: role.name,\n selected: role.name === selectedRoleName\n };\n });\n\n const selected = items.find(item => item.selected);\n\n control = (\n <ComboBox\n label={label}\n selected={selected ? { items: { id: selected.id, text: selected.primary } } : undefined}\n menu={{\n mode: 'single-select',\n items,\n onItemClick: setSelectedRoleName\n }}\n />\n );\n } else {\n control = (\n <RadioButtonGroup\n label={label}\n name='role'\n inline\n onChange={e => {\n setSelectedRoleName(e.target.value);\n }}\n >\n {roles.map(role => (\n <RadioButton\n key={role.name}\n label={role.name}\n value={role.name}\n checked={role.name === selectedRoleName}\n />\n ))}\n </RadioButtonGroup>\n );\n }\n } else if (currentRole) {\n <Input label={t('role')} value={currentRole.name} info={currentRole.description} />;\n }\n\n useEffect(() => {\n getFocusables(contentRef)[0].focus();\n }, []);\n\n useEffect(() => {\n setSelectedRoleNameRef(selectedRoleName);\n }, [selectedRoleName]);\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }} ref={contentRef}>\n {control}\n <Renderer selectedRoleName={selectedRoleName} />\n </Flex>\n );\n};\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import type { ForwardProps } from '@pega/cosmos-react-core';
|
|
3
|
+
import type { StakeholdersProps } from './Stakeholders.types';
|
|
4
|
+
declare const Stakeholders: FunctionComponent<StakeholdersProps & ForwardProps>;
|
|
5
|
+
export default Stakeholders;
|
|
6
|
+
//# sourceMappingURL=Stakeholders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stakeholders.d.ts","sourceRoot":"","sources":["../../../src/components/Stakeholders/Stakeholders.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EASlB,MAAM,OAAO,CAAC;AAoBf,OAAO,KAAK,EAAU,YAAY,EAA0B,MAAM,yBAAyB,CAAC;AAE5F,OAAO,KAAK,EAAQ,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAmBpE,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,GAAG,YAAY,CAyTrE,CAAC;AAEF,eAAe,YAAY,CAAC"}
|