@kaizen/components 0.0.0-canary-rollup-plugin-node-externals-v7-20240206233319 → 0.0.0-canary-remove-tailwind-from-kaio-20240305223928
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/dist/cjs/Modal/GenericModal/GenericModal.cjs +10 -1
- package/dist/cjs/Modal/GenericModal/GenericModal.cjs.map +1 -1
- package/dist/cjs/Slider/Slider.cjs +1 -1
- package/dist/cjs/Slider/Slider.cjs.map +1 -1
- package/dist/cjs/Slider/Slider.module.scss.cjs +1 -0
- package/dist/cjs/Slider/Slider.module.scss.cjs.map +1 -1
- package/dist/cjs/Tile/MultiActionTile/MultiActionTile.cjs +1 -1
- package/dist/cjs/Tile/MultiActionTile/MultiActionTile.cjs.map +1 -1
- package/dist/cjs/Tile/MultiActionTile/MultiActionTile.module.scss.cjs +2 -1
- package/dist/cjs/Tile/MultiActionTile/MultiActionTile.module.scss.cjs.map +1 -1
- package/dist/cjs/Tile/subcomponents/GenericTile/GenericTile.cjs +1 -1
- package/dist/cjs/Tile/subcomponents/GenericTile/GenericTile.cjs.map +1 -1
- package/dist/cjs/Tile/subcomponents/GenericTile/GenericTile.module.scss.cjs +1 -0
- package/dist/cjs/Tile/subcomponents/GenericTile/GenericTile.module.scss.cjs.map +1 -1
- package/dist/cjs/Workflow/subcomponents/Footer/components/ProgressStepper/ProgressStepper.cjs +2 -3
- package/dist/cjs/Workflow/subcomponents/Footer/components/ProgressStepper/ProgressStepper.cjs.map +1 -1
- package/dist/cjs/Workflow/subcomponents/Header/components/Titles/Titles.cjs +2 -3
- package/dist/cjs/Workflow/subcomponents/Header/components/Titles/Titles.cjs.map +1 -1
- package/dist/cjs/__future__/Workflow/subcomponents/Footer/components/ProgressStepper/ProgressStepper.cjs +2 -3
- package/dist/cjs/__future__/Workflow/subcomponents/Footer/components/ProgressStepper/ProgressStepper.cjs.map +1 -1
- package/dist/cjs/__future__/Workflow/subcomponents/Header/components/Titles/Titles.cjs +2 -3
- package/dist/cjs/__future__/Workflow/subcomponents/Header/components/Titles/Titles.cjs.map +1 -1
- package/dist/cjs/index.css +6 -6
- package/dist/esm/Modal/GenericModal/GenericModal.mjs +11 -2
- package/dist/esm/Modal/GenericModal/GenericModal.mjs.map +1 -1
- package/dist/esm/Slider/Slider.mjs +1 -1
- package/dist/esm/Slider/Slider.mjs.map +1 -1
- package/dist/esm/Slider/Slider.module.scss.mjs +1 -0
- package/dist/esm/Slider/Slider.module.scss.mjs.map +1 -1
- package/dist/esm/Tile/MultiActionTile/MultiActionTile.mjs +1 -1
- package/dist/esm/Tile/MultiActionTile/MultiActionTile.mjs.map +1 -1
- package/dist/esm/Tile/MultiActionTile/MultiActionTile.module.scss.mjs +2 -1
- package/dist/esm/Tile/MultiActionTile/MultiActionTile.module.scss.mjs.map +1 -1
- package/dist/esm/Tile/subcomponents/GenericTile/GenericTile.mjs +1 -1
- package/dist/esm/Tile/subcomponents/GenericTile/GenericTile.mjs.map +1 -1
- package/dist/esm/Tile/subcomponents/GenericTile/GenericTile.module.scss.mjs +1 -0
- package/dist/esm/Tile/subcomponents/GenericTile/GenericTile.module.scss.mjs.map +1 -1
- package/dist/esm/Workflow/subcomponents/Footer/components/ProgressStepper/ProgressStepper.mjs +2 -3
- package/dist/esm/Workflow/subcomponents/Footer/components/ProgressStepper/ProgressStepper.mjs.map +1 -1
- package/dist/esm/Workflow/subcomponents/Header/components/Titles/Titles.mjs +2 -3
- package/dist/esm/Workflow/subcomponents/Header/components/Titles/Titles.mjs.map +1 -1
- package/dist/esm/__future__/Workflow/subcomponents/Footer/components/ProgressStepper/ProgressStepper.mjs +2 -3
- package/dist/esm/__future__/Workflow/subcomponents/Footer/components/ProgressStepper/ProgressStepper.mjs.map +1 -1
- package/dist/esm/__future__/Workflow/subcomponents/Header/components/Titles/Titles.mjs +2 -3
- package/dist/esm/__future__/Workflow/subcomponents/Header/components/Titles/Titles.mjs.map +1 -1
- package/dist/esm/index.css +6 -6
- package/dist/styles.css +1 -1
- package/locales/cy.json +2 -2
- package/package.json +37 -37
- package/src/BrandMoment/_docs/ExampleHeaders.scss +1 -0
- package/src/BrandMoment/_docs/ExampleHeaders.tsx +6 -8
- package/src/Filter/FilterMultiSelect/_docs/FilterMultiSelect.mdx +35 -0
- package/src/Illustration/Scene/_docs/Scene.mdx +1 -0
- package/src/Modal/GenericModal/GenericModal.tsx +8 -2
- package/src/MultiSelect/_docs/MultiSelect.mdx +1 -3
- package/src/Slider/Slider.module.scss +4 -0
- package/src/Slider/Slider.tsx +1 -1
- package/src/Tile/MultiActionTile/MultiActionTile.module.scss +6 -0
- package/src/Tile/MultiActionTile/MultiActionTile.tsx +1 -1
- package/src/Tile/subcomponents/GenericTile/GenericTile.module.scss +4 -0
- package/src/Tile/subcomponents/GenericTile/GenericTile.tsx +1 -1
- package/src/Workflow/subcomponents/Footer/components/ProgressStepper/ProgressStepper.tsx +3 -2
- package/src/Workflow/subcomponents/Header/components/Titles/Titles.tsx +2 -1
- package/src/__future__/Workflow/subcomponents/Footer/components/ProgressStepper/ProgressStepper.tsx +3 -2
- package/src/__future__/Workflow/subcomponents/Header/components/Titles/Titles.tsx +2 -1
|
@@ -81,11 +81,20 @@ const GenericModal = /*#__PURE__*/function () {
|
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
83
|
};
|
|
84
|
-
var
|
|
84
|
+
var cleanUpAfterClose = function () {
|
|
85
85
|
document.documentElement.classList.remove(GenericModal_module.unscrollable, GenericModal_module.pseudoScrollbar);
|
|
86
86
|
if (onEscapeKeyup) {
|
|
87
87
|
document.removeEventListener("keyup", onEscapeKeyup);
|
|
88
88
|
}
|
|
89
|
+
};
|
|
90
|
+
/* Ensure sure add-on styles (e.g. unscrollable) and key event is cleaned up when the modal is unmounted*/
|
|
91
|
+
React.useEffect(function () {
|
|
92
|
+
return function () {
|
|
93
|
+
return cleanUpAfterClose();
|
|
94
|
+
};
|
|
95
|
+
}, []);
|
|
96
|
+
var onAfterLeaveHandler = function () {
|
|
97
|
+
cleanUpAfterClose();
|
|
89
98
|
propsOnAfterLeave === null || propsOnAfterLeave === void 0 ? void 0 : propsOnAfterLeave();
|
|
90
99
|
};
|
|
91
100
|
return ReactDOM.createPortal(React.createElement(react.Transition, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenericModal.cjs","sources":["../../../../src/Modal/GenericModal/GenericModal.tsx"],"sourcesContent":["import React, { useId, useState } from \"react\"\nimport { createPortal } from \"react-dom\"\nimport { Transition } from \"@headlessui/react\"\nimport FocusLock from \"react-focus-lock\"\nimport { warn } from \"../util/console\"\nimport { ModalContext } from \"./context/ModalContext\"\nimport styles from \"./GenericModal.module.scss\"\n\nexport type GenericModalProps = {\n id?: string\n isOpen: boolean\n children: React.ReactNode\n focusLockDisabled?: boolean\n onEscapeKeyup?: (event: KeyboardEvent) => void\n onOutsideModalClick?: (event: React.MouseEvent) => void\n onAfterLeave?: () => void\n}\n\nexport const GenericModal = ({\n id: propsId,\n children,\n isOpen = true,\n focusLockDisabled,\n onEscapeKeyup,\n onOutsideModalClick,\n onAfterLeave: propsOnAfterLeave,\n}: GenericModalProps): JSX.Element => {\n const reactId = useId()\n const id = propsId ?? reactId\n\n const labelledByID = useId()\n const describedByID = useId()\n\n const [scrollLayer, setScrollLayer] = useState<HTMLDivElement | null>(null)\n const [modalLayer, setModalLayer] = useState<HTMLDivElement | null>(null)\n\n const scrollModalToTop = (): void => {\n // If we have a really long modal, the autofocus could land on an element down below\n // causing the modal to scroll down and skipping over the content near the modal's top.\n // Ensure that when the modal opens, we are at the top of its content.\n requestAnimationFrame(() => {\n if (!scrollLayer) return\n scrollLayer.scrollTop = 0\n })\n }\n\n const outsideModalClickHandler = (event: React.MouseEvent): void => {\n if (event.target === scrollLayer || event.target === modalLayer) {\n onOutsideModalClick?.(event)\n }\n }\n\n const focusAccessibleLabel = (): void => {\n if (modalLayer) {\n const labelElement: HTMLElement | null =\n document.getElementById(labelledByID)\n if (labelElement) {\n labelElement.focus()\n }\n }\n }\n\n const a11yWarn = (): void => {\n if (!modalLayer) return\n // Ensure that consumers have provided an element that labels the modal\n // to meet ARIA accessibility guidelines.\n if (!document.getElementById(labelledByID)) {\n warn(\n `When using the Modal component, you must provide a label for the modal.\n Make sure you have a <ModalAccessibleLabel /> component with content that labels the modal.`\n )\n }\n }\n\n const preventBodyScroll = (): void => {\n const hasScrollbar =\n window.innerWidth > document.documentElement.clientWidth\n const scrollStyles = [styles.unscrollable]\n\n if (hasScrollbar) {\n scrollStyles.push(styles.pseudoScrollbar)\n }\n\n document.documentElement.classList.add(...scrollStyles)\n }\n\n const onAfterEnterHandler = (): void => {\n scrollModalToTop()\n focusAccessibleLabel()\n a11yWarn()\n }\n\n const onBeforeEnterHandler = (): void => {\n preventBodyScroll()\n\n if (onEscapeKeyup) {\n document.addEventListener(\"keyup\", event => {\n if (event.key === \"Escape\") {\n onEscapeKeyup?.(event)\n }\n })\n }\n }\n\n const onAfterLeaveHandler = (): void => {\n document.documentElement.classList.remove(\n styles.unscrollable,\n styles.pseudoScrollbar\n )\n\n if (onEscapeKeyup) {\n document.removeEventListener(\"keyup\", onEscapeKeyup)\n }\n\n propsOnAfterLeave?.()\n }\n\n return createPortal(\n <Transition\n appear={true}\n show={isOpen}\n enter={styles.animatingEnter}\n leave={styles.animatingLeave}\n beforeEnter={onBeforeEnterHandler}\n afterEnter={onAfterEnterHandler}\n afterLeave={onAfterLeaveHandler}\n data-generic-modal-transition-wrapper\n onClick={(e: React.MouseEvent): void => e.stopPropagation()}\n >\n <FocusLock\n disabled={focusLockDisabled}\n returnFocus={true}\n // Disabling false positive\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={false}\n >\n <div className={styles.backdropLayer} />\n {/* Disabling these because we don't want this to be keyboard focusable. Users can use Esc to achieve this with a keyboard.\n */}\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}\n <div\n className={styles.scrollLayer}\n ref={(scrollLayerRef): void => {\n setScrollLayer(scrollLayerRef)\n }}\n onClick={outsideModalClickHandler}\n data-testid={`${id}-scrollLayer`}\n >\n <ModalContext.Provider\n value={{\n labelledByID,\n describedByID,\n }}\n >\n <div\n role=\"dialog\"\n className={styles.modalLayer}\n aria-labelledby={labelledByID}\n aria-describedby={describedByID}\n ref={(modalLayerRef): void => setModalLayer(modalLayerRef)}\n data-testid={id}\n >\n {children}\n </div>\n </ModalContext.Provider>\n </div>\n </FocusLock>\n </Transition>,\n document.body\n )\n}\n\nGenericModal.displayName = \"GenericModal\"\n"],"names":["GenericModal","_a","propsId","id","children","_b","isOpen","focusLockDisabled","onEscapeKeyup","onOutsideModalClick","propsOnAfterLeave","onAfterLeave","reactId","useId","labelledByID","describedByID","_c","useState","scrollLayer","setScrollLayer","_d","modalLayer","setModalLayer","scrollModalToTop","requestAnimationFrame","scrollTop","outsideModalClickHandler","event","target","focusAccessibleLabel","labelElement","document","getElementById","focus","a11yWarn","warn","preventBodyScroll","hasScrollbar","window","innerWidth","documentElement","clientWidth","scrollStyles","styles","unscrollable","push","pseudoScrollbar","classList","add","apply","onAfterEnterHandler","onBeforeEnterHandler","addEventListener","key","onAfterLeaveHandler","remove","removeEventListener","createPortal","React","createElement","Transition","appear","show","enter","animatingEnter","leave","animatingLeave","beforeEnter","afterEnter","afterLeave","onClick","e","stopPropagation","FocusLock","disabled","returnFocus","autoFocus","className","backdropLayer","ref","scrollLayerRef","concat","ModalContext","Provider","value","role","modalLayerRef","body","displayName"],"mappings":";;;;;;;;;MAkBaA,YAAY;EAAA,MAAZA,YAAY,GAAG,SAAAA,CAACC,EAQT,EAAA;QAPdC,OAAO,GAAAD,EAAA,CAAAE,EAAA;MACXC,QAAQ,GAAAH,EAAA,CAAAG,QAAA;MACRC,EAAa,GAAAJ,EAAA,CAAAK,MAAA;MAAbA,MAAM,GAAAD,EAAA,KAAA,KAAA,CAAA,GAAG,IAAI,GAAAA,EAAA;MACbE,iBAAiB,GAAAN,EAAA,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c,CAAC;MAChC,CAAC;MACDV,OAAO,EAAE5C,wBAAwB;MACpB,aAAA,EAAA,EAAA,CAAAuD,MAAA,CAAG9E,EAAE,EAAc,cAAA;IAAA,CAAA,EAEhCuD,KAAA,CAAAC,aAAA,CAACuB,YAAAA,CAAAA,YAAY,CAACC,QAAQ,EAAA;MACpBC,KAAK,EAAE;QACLtE,YAAY,EAAAA,YAAA;QACZC,aAAa,EAAAA;MACd;IAAA,CAAA,EAED2C,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;MACE0B,IAAI,EAAC,QAAQ;MACbR,SAAS,EAAElC,mBAAM,CAACtB,UAAU;MACX,iBAAA,EAAAP,YAAY;0BACXC,aAAa;MAC/BgE,GAAG,EAAE,SAAAA,CAACO,aAAa,EAAW;QAAA,OAAAhE,aAAa,CAACgE,aAAa,CAAC;MAAA,CAAA;MAC7C,aAAA,EAAAnF;OAEZC,QAAQ,CACL,CACgB,CACpB,CACI,CACD,EACb2B,QAAQ,CAACwD,IAAI,CACd;EACH,CAAC;EAEDvF,YAAY,CAACwF,WAAW,GAAG,cAAc;EAAA,OA1J5BxF,YAAY;AAAA;"}
|
|
1
|
+
{"version":3,"file":"GenericModal.cjs","sources":["../../../../src/Modal/GenericModal/GenericModal.tsx"],"sourcesContent":["import React, { useEffect, useId, useState } from \"react\"\nimport { createPortal } from \"react-dom\"\nimport { Transition } from \"@headlessui/react\"\nimport FocusLock from \"react-focus-lock\"\nimport { warn } from \"../util/console\"\nimport { ModalContext } from \"./context/ModalContext\"\nimport styles from \"./GenericModal.module.scss\"\n\nexport type GenericModalProps = {\n id?: string\n isOpen: boolean\n children: React.ReactNode\n focusLockDisabled?: boolean\n onEscapeKeyup?: (event: KeyboardEvent) => void\n onOutsideModalClick?: (event: React.MouseEvent) => void\n onAfterLeave?: () => void\n}\n\nexport const GenericModal = ({\n id: propsId,\n children,\n isOpen = true,\n focusLockDisabled,\n onEscapeKeyup,\n onOutsideModalClick,\n onAfterLeave: propsOnAfterLeave,\n}: GenericModalProps): JSX.Element => {\n const reactId = useId()\n const id = propsId ?? reactId\n\n const labelledByID = useId()\n const describedByID = useId()\n\n const [scrollLayer, setScrollLayer] = useState<HTMLDivElement | null>(null)\n const [modalLayer, setModalLayer] = useState<HTMLDivElement | null>(null)\n\n const scrollModalToTop = (): void => {\n // If we have a really long modal, the autofocus could land on an element down below\n // causing the modal to scroll down and skipping over the content near the modal's top.\n // Ensure that when the modal opens, we are at the top of its content.\n requestAnimationFrame(() => {\n if (!scrollLayer) return\n scrollLayer.scrollTop = 0\n })\n }\n\n const outsideModalClickHandler = (event: React.MouseEvent): void => {\n if (event.target === scrollLayer || event.target === modalLayer) {\n onOutsideModalClick?.(event)\n }\n }\n\n const focusAccessibleLabel = (): void => {\n if (modalLayer) {\n const labelElement: HTMLElement | null =\n document.getElementById(labelledByID)\n if (labelElement) {\n labelElement.focus()\n }\n }\n }\n\n const a11yWarn = (): void => {\n if (!modalLayer) return\n // Ensure that consumers have provided an element that labels the modal\n // to meet ARIA accessibility guidelines.\n if (!document.getElementById(labelledByID)) {\n warn(\n `When using the Modal component, you must provide a label for the modal.\n Make sure you have a <ModalAccessibleLabel /> component with content that labels the modal.`\n )\n }\n }\n\n const preventBodyScroll = (): void => {\n const hasScrollbar =\n window.innerWidth > document.documentElement.clientWidth\n const scrollStyles = [styles.unscrollable]\n\n if (hasScrollbar) {\n scrollStyles.push(styles.pseudoScrollbar)\n }\n\n document.documentElement.classList.add(...scrollStyles)\n }\n\n const onAfterEnterHandler = (): void => {\n scrollModalToTop()\n focusAccessibleLabel()\n a11yWarn()\n }\n\n const onBeforeEnterHandler = (): void => {\n preventBodyScroll()\n\n if (onEscapeKeyup) {\n document.addEventListener(\"keyup\", event => {\n if (event.key === \"Escape\") {\n onEscapeKeyup?.(event)\n }\n })\n }\n }\n\n const cleanUpAfterClose = (): void => {\n document.documentElement.classList.remove(\n styles.unscrollable,\n styles.pseudoScrollbar\n )\n\n if (onEscapeKeyup) {\n document.removeEventListener(\"keyup\", onEscapeKeyup)\n }\n }\n\n /* Ensure sure add-on styles (e.g. unscrollable) and key event is cleaned up when the modal is unmounted*/\n useEffect(() => () => cleanUpAfterClose(), [])\n\n const onAfterLeaveHandler = (): void => {\n cleanUpAfterClose()\n propsOnAfterLeave?.()\n }\n\n return createPortal(\n <Transition\n appear={true}\n show={isOpen}\n enter={styles.animatingEnter}\n leave={styles.animatingLeave}\n beforeEnter={onBeforeEnterHandler}\n afterEnter={onAfterEnterHandler}\n afterLeave={onAfterLeaveHandler}\n data-generic-modal-transition-wrapper\n onClick={(e: React.MouseEvent): void => e.stopPropagation()}\n >\n <FocusLock\n disabled={focusLockDisabled}\n returnFocus={true}\n // Disabling false positive\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={false}\n >\n <div className={styles.backdropLayer} />\n {/* Disabling these because we don't want this to be keyboard focusable. Users can use Esc to achieve this with a keyboard.\n */}\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}\n <div\n className={styles.scrollLayer}\n ref={(scrollLayerRef): void => {\n setScrollLayer(scrollLayerRef)\n }}\n onClick={outsideModalClickHandler}\n data-testid={`${id}-scrollLayer`}\n >\n <ModalContext.Provider\n value={{\n labelledByID,\n describedByID,\n }}\n >\n <div\n role=\"dialog\"\n className={styles.modalLayer}\n aria-labelledby={labelledByID}\n aria-describedby={describedByID}\n ref={(modalLayerRef): void => setModalLayer(modalLayerRef)}\n data-testid={id}\n >\n {children}\n </div>\n </ModalContext.Provider>\n </div>\n </FocusLock>\n </Transition>,\n document.body\n )\n}\n\nGenericModal.displayName = \"GenericModal\"\n"],"names":["GenericModal","_a","propsId","id","children","_b","isOpen","focusLockDisabled","onEscapeKeyup","onOutsideModalClick","propsOnAfterLeave","onAfterLeave","reactId","useId","labelledByID","describedByID","_c","useState","scrollLayer","setScrollLayer","_d","modalLayer","setModalLayer","scrollModalToTop","requestAnimationFrame","scrollTop","outsideModalClickHandler","event","target","focusAccessibleLabel","labelElement","document","getElementById","focus","a11yWarn","warn","preventBodyScroll","hasScrollbar","window","innerWidth","documentElement","clientWidth","scrollStyles","styles","unscrollable","push","pseudoScrollbar","classList","add","apply","onAfterEnterHandler","onBeforeEnterHandler","addEventListener","key","cleanUpAfterClose","remove","removeEventListener","useEffect","onAfterLeaveHandler","createPortal","React","createElement","Transition","appear","show","enter","animatingEnter","leave","animatingLeave","beforeEnter","afterEnter","afterLeave","onClick","e","stopPropagation","FocusLock","disabled","returnFocus","autoFocus","className","backdropLayer","ref","scrollLayerRef","concat","ModalContext","Provider","value","role","modalLayerRef","body","displayName"],"mappings":";;;;;;;;;MAkBaA,YAAY;EAAA,MAAZA,YAAY,GAAG,SAAAA,CAACC,EAQT,EAAA;QAPdC,OAAO,GAAAD,EAAA,CAAAE,EAAA;MACXC,QAAQ,GAAAH,EAAA,CAAAG,QAAA;MACRC,EAAa,GAAAJ,EAAA,CAAAK,MAAA;MAAbA,MAAM,GAAAD,EAAA,KAAA,KAAA,CAAA,GAAG,IAAI,GAAAA,EAAA;MACbE,iBAAiB,GAAAN,EAAA,CAAAM,iBAAA;MACjBC,aAAa,GAAAP,EAAA,CAAAO,aAAA;MACbC,mBAAmB,GAAAR,EAAA,CAAAQ,mBAAA;MACLC,iBAAiB,GAAAT,EAAA,CAAAU,YAAA;IAE/B,IAAMC,OAAO,GAAGC,KAAAA,CAAAA,KAAK,EAAE;IACvB,IAAMV,EAAE,GAAGD,OAAO,KAAA,IAAA,IAAPA,OAAO,KAAP,KAAA,CAAA,GAAAA,OAAO,GAAIU,OAAO;IAE7B,IAAME,YAAY,GAAGD,KAAAA,CAAAA,KAAK,EAAE;IAC5B,IAAME,aAAa,GAAGF,KAAAA,CAAAA,KAAK,EAAE;IAEvB,IAAAG,EAAA,GAAgCC,KAAAA,CAAAA,QAAQ,CAAwB,IAAI,CAAC;MAApEC,WAAW,GAAAF,EAAA,CAAA,CAAA,CAAA;MAAEG,cAAc,GAAAH,EAAA,CAAA,CA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AAQ;MACbR,SAAS,EAAEpC,mBAAM,CAACtB,UAAU;MACX,iBAAA,EAAAP,YAAY;0BACXC,aAAa;MAC/BkE,GAAG,EAAE,SAAAA,CAACO,aAAa,EAAW;QAAA,OAAAlE,aAAa,CAACkE,aAAa,CAAC;MAAA,CAAA;MAC7C,aAAA,EAAArF;OAEZC,QAAQ,CACL,CACgB,CACpB,CACI,CACD,EACb2B,QAAQ,CAAC0D,IAAI,CACd;EACH,CAAC;EAEDzF,YAAY,CAAC0F,WAAW,GAAG,cAAc;EAAA,OAhK5B1F,YAAY;AAAA;"}
|
|
@@ -34,7 +34,7 @@ const Slider = /*#__PURE__*/function () {
|
|
|
34
34
|
}, React.createElement("div", {
|
|
35
35
|
className: Slider_module.labelWrapper
|
|
36
36
|
}, React.createElement("div", {
|
|
37
|
-
className:
|
|
37
|
+
className: Slider_module.label
|
|
38
38
|
}, React.createElement(Label.Label, {
|
|
39
39
|
htmlFor: id,
|
|
40
40
|
labelText: labelText,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.cjs","sources":["../../../src/Slider/Slider.tsx"],"sourcesContent":["import React, { ReactNode, useId } from \"react\"\nimport classnames from \"classnames\"\nimport { FieldGroup } from \"~components/FieldGroup\"\nimport { InputRange, InputRangeProps } from \"~components/Input/InputRange\"\nimport { Label } from \"~components/Label\"\nimport { Text } from \"~components/Text\"\nimport styles from \"./Slider.module.scss\"\n\nexport type SliderFieldProps = {\n id?: string\n labelText: ReactNode\n description?: ReactNode\n labelPosition?: \"inline\" | \"block\"\n variant?: \"default\" | \"prominent\"\n disabled?: boolean\n readOnlyMessage?: ReactNode\n} & Omit<InputRangeProps, \"id\">\n\n/**\n * {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3081896335/Slider Guidance} |\n * {@link https://cultureamp.design/?path=/docs/components-slider--docs Storybook}\n */\nexport const Slider = ({\n id: propsId,\n labelText,\n description,\n labelPosition = \"inline\",\n variant = \"default\",\n disabled,\n readOnlyMessage,\n ...restProps\n}: SliderFieldProps): JSX.Element => {\n const id = propsId ?? useId()\n const descriptionId = `${id}-description`\n\n return (\n <FieldGroup inline>\n <div\n className={classnames(\n styles.wrapper,\n labelPosition === \"inline\" && styles.labelInline\n )}\n >\n <div className={styles.labelWrapper}>\n <div className
|
|
1
|
+
{"version":3,"file":"Slider.cjs","sources":["../../../src/Slider/Slider.tsx"],"sourcesContent":["import React, { ReactNode, useId } from \"react\"\nimport classnames from \"classnames\"\nimport { FieldGroup } from \"~components/FieldGroup\"\nimport { InputRange, InputRangeProps } from \"~components/Input/InputRange\"\nimport { Label } from \"~components/Label\"\nimport { Text } from \"~components/Text\"\nimport styles from \"./Slider.module.scss\"\n\nexport type SliderFieldProps = {\n id?: string\n labelText: ReactNode\n description?: ReactNode\n labelPosition?: \"inline\" | \"block\"\n variant?: \"default\" | \"prominent\"\n disabled?: boolean\n readOnlyMessage?: ReactNode\n} & Omit<InputRangeProps, \"id\">\n\n/**\n * {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3081896335/Slider Guidance} |\n * {@link https://cultureamp.design/?path=/docs/components-slider--docs Storybook}\n */\nexport const Slider = ({\n id: propsId,\n labelText,\n description,\n labelPosition = \"inline\",\n variant = \"default\",\n disabled,\n readOnlyMessage,\n ...restProps\n}: SliderFieldProps): JSX.Element => {\n const id = propsId ?? useId()\n const descriptionId = `${id}-description`\n\n return (\n <FieldGroup inline>\n <div\n className={classnames(\n styles.wrapper,\n labelPosition === \"inline\" && styles.labelInline\n )}\n >\n <div className={styles.labelWrapper}>\n <div className={styles.label}>\n <Label\n htmlFor={id}\n labelText={labelText}\n variant={variant}\n disabled={disabled}\n />\n </div>\n {description && (\n <Text\n variant=\"small\"\n id={descriptionId}\n classNameOverride={\n disabled ? styles.descriptionDisabled : undefined\n }\n >\n {description}\n </Text>\n )}\n </div>\n <div className={styles.inputWrapper}>\n <InputRange\n id={id}\n aria-describedby={descriptionId}\n disabled={disabled}\n {...restProps}\n />\n {readOnlyMessage && (\n <div className={styles.readOnlyMessage}>{readOnlyMessage}</div>\n )}\n </div>\n </div>\n </FieldGroup>\n )\n}\n\nSlider.displayName = \"Slider\"\n"],"names":["Slider","_a","propsId","id","labelText","description","_b","labelPosition","_c","variant","disabled","readOnlyMessage","restProps","__rest","useId","descriptionId","concat","React","createElement","FieldGroup","inline","className","classnames","styles","wrapper","labelInline","labelWrapper","label","Label","htmlFor","Text","classNameOverride","descriptionDisabled","undefined","inputWrapper","InputRange","__assign","displayName"],"mappings":";;;;;;;;;;;AAkBA;;;AAGG;AAHH,MAIaA,MAAM;EAAA,MAANA,MAAM,GAAG,SAAAA,CAACC,EASJ,EAAA;IARjB,IAAIC,OAAO,GAAAD,EAAA,CAAAE,EAAA;MACXC,SAAS,eAAA;MACTC,WAAW,GAAAJ,EAAA,CAAAI,WAAA;MACXC,EAAwB,GAAAL,EAAA,CAAAM,aAAA;MAAxBA,aAAa,GAAAD,EAAA,KAAA,KAAA,CAAA,GAAG,QAAQ,GAAAA,EAAA;MACxBE,EAAmB,GAAAP,EAAA,CAAAQ,OAAA;MAAnBA,OAAO,GAAAD,EAAA,KAAA,KAAA,CAAA,GAAG,SAAS,GAAAA,EAAA;MACnBE,QAAQ,GAAAT,EAAA,CAAAS,QAAA;MACRC,eAAe,GAAAV,EAAA,CAAAU,eAAA;MACZC,SAAS,GAAAC,KAAAA,CAAAA,MAAA,CAAAZ,EAAA,EARS,6FAStB,CADa;IAEZ,IAAME,EAAE,GAAGD,OAAO,KAAP,IAAA,IAAAA,OAAO,cAAPA,OAAO,GAAIY,KAAAA,CAAAA,KAAK,EAAE;IAC7B,IAAMC,aAAa,GAAG,EAAG,CAAAC,MAAA,CAAAb,EAAE,iBAAc;IAEzC,OACEc,KAAA,CAAAC,aAAA,CAACC,UAAU,CAAAA,UAAA,EAAA;MAACC,MAAM,EAAA;IAAA,CAAA,EAChBH,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;MACEG,SAAS,EAA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"wrapper": "Slider-module_wrapper__zVX6g",
|
|
5
5
|
"labelWrapper": "Slider-module_labelWrapper__WuUIw",
|
|
6
|
+
"label": "Slider-module_label__CfIjh",
|
|
6
7
|
"labelInline": "Slider-module_labelInline__zjINd",
|
|
7
8
|
"inputWrapper": "Slider-module_inputWrapper__n16yj",
|
|
8
9
|
"descriptionDisabled": "Slider-module_descriptionDisabled__8GwiS",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.module.scss.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Slider.module.scss.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
|
@@ -9,7 +9,7 @@ var renderActions = function (primaryAction, secondaryAction) {
|
|
|
9
9
|
return React.createElement("div", {
|
|
10
10
|
className: MultiActionTile_module.actions
|
|
11
11
|
}, secondaryAction && React.createElement("div", {
|
|
12
|
-
className:
|
|
12
|
+
className: MultiActionTile_module.secondaryAction
|
|
13
13
|
}, React.createElement(Action, {
|
|
14
14
|
action: secondaryAction,
|
|
15
15
|
secondary: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiActionTile.cjs","sources":["../../../../src/Tile/MultiActionTile/MultiActionTile.tsx"],"sourcesContent":["import React from \"react\"\nimport {\n GenericTile,\n GenericTileProps,\n TileAction,\n} from \"../subcomponents/GenericTile\"\nimport Action from \"../subcomponents/GenericTile/Action\"\nimport styles from \"./MultiActionTile.module.scss\"\n\nexport type MultiActionTileProps = {\n primaryAction: TileAction\n secondaryAction?: TileAction\n} & Omit<GenericTileProps, \"footer\">\n\nconst renderActions = (\n primaryAction: TileAction,\n secondaryAction?: TileAction\n): JSX.Element => (\n <div className={styles.actions}>\n {secondaryAction && (\n <div className
|
|
1
|
+
{"version":3,"file":"MultiActionTile.cjs","sources":["../../../../src/Tile/MultiActionTile/MultiActionTile.tsx"],"sourcesContent":["import React from \"react\"\nimport {\n GenericTile,\n GenericTileProps,\n TileAction,\n} from \"../subcomponents/GenericTile\"\nimport Action from \"../subcomponents/GenericTile/Action\"\nimport styles from \"./MultiActionTile.module.scss\"\n\nexport type MultiActionTileProps = {\n primaryAction: TileAction\n secondaryAction?: TileAction\n} & Omit<GenericTileProps, \"footer\">\n\nconst renderActions = (\n primaryAction: TileAction,\n secondaryAction?: TileAction\n): JSX.Element => (\n <div className={styles.actions}>\n {secondaryAction && (\n <div className={styles.secondaryAction}>\n <Action action={secondaryAction} secondary />\n </div>\n )}\n <Action action={primaryAction} />\n </div>\n)\n\n/**\n * {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3079077889/Tile#MultiActionTile.1 Guidance} |\n * {@link https://cultureamp.design/?path=/docs/components-tiles-multiactiontile--docs Storybook}\n */\nexport const MultiActionTile = ({\n children,\n primaryAction,\n secondaryAction,\n ...restProps\n}: MultiActionTileProps): JSX.Element => (\n <GenericTile\n footer={renderActions(primaryAction, secondaryAction)}\n {...restProps}\n >\n {children}\n </GenericTile>\n)\n\nMultiActionTile.displayName = \"MultiActionTile\"\n"],"names":["renderActions","primaryAction","secondaryAction","React","createElement","className","styles","actions","Action","action","secondary","MultiActionTile","_a","children","restProps","__rest","GenericTile","footer","displayName"],"mappings":";;;;;;;AAcA,IAAMA,aAAa,GAAG,SAAAA,CACpBC,aAAyB,EACzBC,eAA4B,EAAA;EACZ,OAChBC,KAAK,CAAAC,aAAA,CAAA,KAAA,EAAA;IAAAC,SAAS,EAAEC,sBAAM,CAACC;EAAO,CAAA,EAC3BL,eAAe,IACdC,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;IAAKC,SAAS,EAAEC,sBAAM,CAACJ;EAAe,CAAA,EACpCC,KAAC,CAAAC,aAAA,CAAAI,MAAM;IAACC,MAAM,EAAEP,eAAe;IAAEQ,SAAS,EAAG;EAAA,CAAA,CAAA,CAEhD,EACDP,KAAC,CAAAC,aAAA,CAAAI,MAAM,EAAC;IAAAC,MAAM,EAAER;IAAiB,CAC7B;CACP;AAED;;;AAGG;AAHH,MAIaU,eAAe;EAAA,MAAfA,eAAe,GAAG,SAAAA,CAACC,EAKT,EAAA;IAJrB,IAAAC,QAAQ,GAAAD,EAAA,CAAAC,QAAA;MACRZ,aAAa,GAAAW,EAAA,CAAAX,aAAA;MACbC,eAAe,GAAAU,EAAA,CAAAV,eAAA;MACZY,SAAS,GAJkBC,KAAAA,CAAAA,MAAA,CAAAH,EAAA,EAAA,CAAA,UAAA,EAAA,eAAA,EAAA,iBAAA,CAK/B,CADa;IAC2B,OACvCT,KAAC,CAAAC,aAAA,CAAAY,uBAAW;MACVC,MAAM,EAAEjB,aAAa,CAACC,aAAa,EAAEC,eAAe;IAAC,CACjD,EAAAY,SAAS,GAEZD,QAAQ,CACG;GACf;EAEDF,eAAe,CAACO,WAAW,GAAG,iBAAiB;EAAA,OAdlCP,eAAe;AAAA;"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var styles = {
|
|
4
|
-
"actions": "MultiActionTile-module_actions__mntsC"
|
|
4
|
+
"actions": "MultiActionTile-module_actions__mntsC",
|
|
5
|
+
"secondaryAction": "MultiActionTile-module_secondaryAction__DuXdD"
|
|
5
6
|
};
|
|
6
7
|
module.exports = styles;
|
|
7
8
|
//# sourceMappingURL=MultiActionTile.module.scss.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiActionTile.module.scss.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MultiActionTile.module.scss.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -34,7 +34,7 @@ const GenericTile = /*#__PURE__*/function () {
|
|
|
34
34
|
variant: "heading-3",
|
|
35
35
|
tag: titleTag
|
|
36
36
|
}, title), metadata && React.createElement("div", {
|
|
37
|
-
className:
|
|
37
|
+
className: GenericTile_module.titleMeta
|
|
38
38
|
}, React.createElement(Text.Text, {
|
|
39
39
|
variant: "small",
|
|
40
40
|
color: "dark-reduced-opacity"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenericTile.cjs","sources":["../../../../../src/Tile/subcomponents/GenericTile/GenericTile.tsx"],"sourcesContent":["import React, { HTMLAttributes, useState } from \"react\"\nimport classnames from \"classnames\"\nimport { IconButton } from \"~components/Button\"\nimport { GenericButtonProps } from \"~components/Button/GenericButton\"\nimport { AllowedHeadingTags, Heading } from \"~components/Heading\"\nimport { ArrowBackwardIcon, InformationIcon } from \"~components/Icon\"\nimport { Text } from \"~components/Text\"\nimport { OverrideClassName } from \"~types/OverrideClassName\"\nimport Action from \"./Action\"\nimport { Moods } from \"./types\"\nimport styles from \"./GenericTile.module.scss\"\n\nexport type TileAction = {\n label: string\n onClick?: GenericButtonProps[\"onClick\"]\n href?: string\n icon?: JSX.Element\n /**\n * @deprecated use data-testid instead\n */\n automationId?: string\n newTabAndIUnderstandTheAccessibilityImplications?: boolean\n} & HTMLAttributes<HTMLButtonElement>\n\nexport type TileInformation = {\n text: string\n primaryAction?: TileAction\n secondaryAction?: TileAction\n}\n\nexport type GenericTileProps = {\n children?: React.ReactNode\n title: React.ReactNode\n titleTag?: AllowedHeadingTags\n metadata?: string\n information?: TileInformation | React.ReactNode\n mood?: Moods\n footer: React.ReactNode\n} & OverrideClassName<Omit<HTMLAttributes<HTMLDivElement>, \"title\">>\n\nexport const GenericTile = ({\n children,\n title,\n titleTag = \"h3\",\n metadata,\n information,\n mood,\n footer,\n classNameOverride,\n ...restProps\n}: GenericTileProps): JSX.Element => {\n const [isFlipped, setIsFlipped] = useState<boolean>(false)\n\n const renderTitle = (): JSX.Element => (\n <div className={styles.title}>\n <Heading variant=\"heading-3\" tag={titleTag}>\n {title}\n </Heading>\n {metadata && (\n <div className=\"pt-4\">\n <Text variant=\"small\" color=\"dark-reduced-opacity\">\n {metadata}\n </Text>\n </div>\n )}\n </div>\n )\n\n const renderActions = (\n primaryAction?: TileAction,\n secondaryAction?: TileAction,\n disabled?: boolean\n ): JSX.Element => (\n <div className={styles.actions}>\n {secondaryAction && (\n <Action action={secondaryAction} secondary disabled={disabled} />\n )}\n {primaryAction && <Action action={primaryAction} disabled={disabled} />}\n </div>\n )\n\n const renderFront = (): JSX.Element => (\n <div\n className={classnames(\n styles.face,\n styles.faceFront,\n mood === \"positive\" && styles.faceMoodPositive,\n mood === \"informative\" && styles.faceMoodInformative,\n mood === \"cautionary\" && styles.faceMoodCautionary,\n mood === \"assertive\" && styles.faceMoodAssertive,\n mood === \"negative\" && styles.faceMoodNegative,\n mood === \"prominent\" && styles.faceMoodProminent\n )}\n >\n {information && (\n <div className={styles.informationBtn}>\n <IconButton\n label=\"Information\"\n icon={<InformationIcon role=\"presentation\" />}\n onClick={(): void => setIsFlipped(true)}\n disabled={isFlipped}\n aria-hidden={isFlipped}\n />\n </div>\n )}\n {renderTitle()}\n <div className={styles.children}>{children && children}</div>\n {footer && <div className={styles.footer}>{footer}</div>}\n </div>\n )\n\n const renderInformation = (\n informationProp: GenericTileProps[\"information\"] | undefined\n ): JSX.Element | React.ReactNode => {\n if (\n informationProp &&\n typeof informationProp === \"object\" &&\n \"text\" in informationProp\n ) {\n return (\n <>\n <Text variant=\"body\">{informationProp.text}</Text>\n {(informationProp.primaryAction ||\n informationProp.secondaryAction) && (\n <div className={styles.footer}>\n {renderActions(\n informationProp.primaryAction,\n informationProp.secondaryAction,\n !isFlipped\n )}\n </div>\n )}\n </>\n )\n }\n\n return informationProp\n }\n\n const renderBack = (): JSX.Element | void => {\n if (!information) return\n\n return (\n <div className={classnames(styles.face, styles.faceBack)}>\n <div className={styles.informationBtn}>\n <IconButton\n label=\"Information\"\n icon={<ArrowBackwardIcon role=\"presentation\" />}\n onClick={(): void => setIsFlipped(false)}\n disabled={!isFlipped}\n aria-hidden={!isFlipped}\n />\n </div>\n <div className={styles.information}>\n {renderInformation(information)}\n </div>\n </div>\n )\n }\n\n return (\n <div className={classnames(styles.root, classNameOverride)} {...restProps}>\n <div className={classnames(styles.tile, isFlipped && styles.isFlipped)}>\n <>\n {renderFront()}\n {renderBack()}\n </>\n </div>\n </div>\n )\n}\n\nGenericTile.displayName = \"GenericTile\"\n"],"names":["GenericTile","_a","children","title","_b","titleTag","metadata","information","mood","footer","classNameOverride","restProps","__rest","_c","useState","isFlipped","setIsFlipped","renderTitle","React","className","styles","createElement","Heading","variant","tag","Text","color","renderActions","primaryAction","secondaryAction","disabled","actions","Action","action","secondary","renderFront","classnames","face","faceFront","faceMoodPositive","faceMoodInformative","faceMoodCautionary","faceMoodAssertive","faceMoodNegative","faceMoodProminent","informationBtn","IconButton","label","icon","InformationIcon","role","onClick","renderInformation","informationProp","Fragment","text","renderBack","faceBack","ArrowBackwardIcon","__assign","root","tile","displayName"],"mappings":";;;;;;;;;;;;;;MAwCaA,WAAW;EAAA,MAAXA,WAAW,GAAG,SAAAA,CAACC,EAUT,EAAA;IATjB,IAAAC,QAAQ,GAAAD,EAAA,CAAAC,QAAA;MACRC,KAAK,GAAAF,EAAA,CAAAE,KAAA;MACLC,EAAe,GAAAH,EAAA,CAAAI,QAAA;MAAfA,QAAQ,GAAAD,EAAA,KAAA,KAAA,CAAA,GAAG,IAAI,GAAAA,EAAA;MACfE,QAAQ,GAAAL,EAAA,CAAAK,QAAA;MACRC,WAAW,GAAAN,EAAA,CAAAM,WAAA;MACXC,IAAI,GAAAP,EAAA,CAAAO,IAAA;MACJC,MAAM,GAAAR,EAAA,CAAAQ,MAAA;MACNC,iBAAiB,GAAAT,EAAA,CAAAS,iBAAA;MACdC,SAAS,GAAAC,KAAA,CAAAA,MAAA,CAAAX,EAAA,EATc,mGAU3B,CADa;IAEN,IAAAY,EAAA,GAA4BC,KAAAA,CAAAA,QAAQ,CAAU,KAAK,CAAC;MAAnDC,SAAS,GAAAF,EAAA,CAAA,CAAA,CAAA;MAAEG,YAAY,GAAAH,EAAA,CAAA,CAAA,CAA4B;IAE1D,IAAMI,WAAW,G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;IAAC,GAAMC,SAAS,CAAA,EACvEO,KAAA,CAAAG,aAAA,CAAA,KAAA,EAAA;MAAKF,SAAS,EAAEiB,UAAU,CAAChB,kBAAM,CAACyC,IAAI,EAAE9C,SAAS,IAAIK,kBAAM,CAACL,SAAS;IAAC,CAAA,EACpEG,KAAA,CAAAG,aAAA,CAAAH,KAAA,CAAAoC,QAAA,EAAA,IAAA,EACGnB,WAAW,CAAE,CAAA,EACbqB,UAAU,CAAA,CAAE,CACZ,CACC,CACF;EAEV,CAAC;EAEDxD,WAAW,CAAC8D,WAAW,GAAG,aAAa;EAAA,OApI1B9D,WAAW;AAAA;"}
|
|
1
|
+
{"version":3,"file":"GenericTile.cjs","sources":["../../../../../src/Tile/subcomponents/GenericTile/GenericTile.tsx"],"sourcesContent":["import React, { HTMLAttributes, useState } from \"react\"\nimport classnames from \"classnames\"\nimport { IconButton } from \"~components/Button\"\nimport { GenericButtonProps } from \"~components/Button/GenericButton\"\nimport { AllowedHeadingTags, Heading } from \"~components/Heading\"\nimport { ArrowBackwardIcon, InformationIcon } from \"~components/Icon\"\nimport { Text } from \"~components/Text\"\nimport { OverrideClassName } from \"~types/OverrideClassName\"\nimport Action from \"./Action\"\nimport { Moods } from \"./types\"\nimport styles from \"./GenericTile.module.scss\"\n\nexport type TileAction = {\n label: string\n onClick?: GenericButtonProps[\"onClick\"]\n href?: string\n icon?: JSX.Element\n /**\n * @deprecated use data-testid instead\n */\n automationId?: string\n newTabAndIUnderstandTheAccessibilityImplications?: boolean\n} & HTMLAttributes<HTMLButtonElement>\n\nexport type TileInformation = {\n text: string\n primaryAction?: TileAction\n secondaryAction?: TileAction\n}\n\nexport type GenericTileProps = {\n children?: React.ReactNode\n title: React.ReactNode\n titleTag?: AllowedHeadingTags\n metadata?: string\n information?: TileInformation | React.ReactNode\n mood?: Moods\n footer: React.ReactNode\n} & OverrideClassName<Omit<HTMLAttributes<HTMLDivElement>, \"title\">>\n\nexport const GenericTile = ({\n children,\n title,\n titleTag = \"h3\",\n metadata,\n information,\n mood,\n footer,\n classNameOverride,\n ...restProps\n}: GenericTileProps): JSX.Element => {\n const [isFlipped, setIsFlipped] = useState<boolean>(false)\n\n const renderTitle = (): JSX.Element => (\n <div className={styles.title}>\n <Heading variant=\"heading-3\" tag={titleTag}>\n {title}\n </Heading>\n {metadata && (\n <div className={styles.titleMeta}>\n <Text variant=\"small\" color=\"dark-reduced-opacity\">\n {metadata}\n </Text>\n </div>\n )}\n </div>\n )\n\n const renderActions = (\n primaryAction?: TileAction,\n secondaryAction?: TileAction,\n disabled?: boolean\n ): JSX.Element => (\n <div className={styles.actions}>\n {secondaryAction && (\n <Action action={secondaryAction} secondary disabled={disabled} />\n )}\n {primaryAction && <Action action={primaryAction} disabled={disabled} />}\n </div>\n )\n\n const renderFront = (): JSX.Element => (\n <div\n className={classnames(\n styles.face,\n styles.faceFront,\n mood === \"positive\" && styles.faceMoodPositive,\n mood === \"informative\" && styles.faceMoodInformative,\n mood === \"cautionary\" && styles.faceMoodCautionary,\n mood === \"assertive\" && styles.faceMoodAssertive,\n mood === \"negative\" && styles.faceMoodNegative,\n mood === \"prominent\" && styles.faceMoodProminent\n )}\n >\n {information && (\n <div className={styles.informationBtn}>\n <IconButton\n label=\"Information\"\n icon={<InformationIcon role=\"presentation\" />}\n onClick={(): void => setIsFlipped(true)}\n disabled={isFlipped}\n aria-hidden={isFlipped}\n />\n </div>\n )}\n {renderTitle()}\n <div className={styles.children}>{children && children}</div>\n {footer && <div className={styles.footer}>{footer}</div>}\n </div>\n )\n\n const renderInformation = (\n informationProp: GenericTileProps[\"information\"] | undefined\n ): JSX.Element | React.ReactNode => {\n if (\n informationProp &&\n typeof informationProp === \"object\" &&\n \"text\" in informationProp\n ) {\n return (\n <>\n <Text variant=\"body\">{informationProp.text}</Text>\n {(informationProp.primaryAction ||\n informationProp.secondaryAction) && (\n <div className={styles.footer}>\n {renderActions(\n informationProp.primaryAction,\n informationProp.secondaryAction,\n !isFlipped\n )}\n </div>\n )}\n </>\n )\n }\n\n return informationProp\n }\n\n const renderBack = (): JSX.Element | void => {\n if (!information) return\n\n return (\n <div className={classnames(styles.face, styles.faceBack)}>\n <div className={styles.informationBtn}>\n <IconButton\n label=\"Information\"\n icon={<ArrowBackwardIcon role=\"presentation\" />}\n onClick={(): void => setIsFlipped(false)}\n disabled={!isFlipped}\n aria-hidden={!isFlipped}\n />\n </div>\n <div className={styles.information}>\n {renderInformation(information)}\n </div>\n </div>\n )\n }\n\n return (\n <div className={classnames(styles.root, classNameOverride)} {...restProps}>\n <div className={classnames(styles.tile, isFlipped && styles.isFlipped)}>\n <>\n {renderFront()}\n {renderBack()}\n </>\n </div>\n </div>\n )\n}\n\nGenericTile.displayName = \"GenericTile\"\n"],"names":["GenericTile","_a","children","title","_b","titleTag","metadata","information","mood","footer","classNameOverride","restProps","__rest","_c","useState","isFlipped","setIsFlipped","renderTitle","React","className","styles","createElement","Heading","variant","tag","titleMeta","Text","color","renderActions","primaryAction","secondaryAction","disabled","actions","Action","action","secondary","renderFront","classnames","face","faceFront","faceMoodPositive","faceMoodInformative","faceMoodCautionary","faceMoodAssertive","faceMoodNegative","faceMoodProminent","informationBtn","IconButton","label","icon","InformationIcon","role","onClick","renderInformation","informationProp","Fragment","text","renderBack","faceBack","ArrowBackwardIcon","__assign","root","tile","displayName"],"mappings":";;;;;;;;;;;;;;MAwCaA,WAAW;EAAA,MAAXA,WAAW,GAAG,SAAAA,CAACC,EAUT,EAAA;IATjB,IAAAC,QAAQ,GAAAD,EAAA,CAAAC,QAAA;MACRC,KAAK,GAAAF,EAAA,CAAAE,KAAA;MACLC,EAAe,GAAAH,EAAA,CAAAI,QAAA;MAAfA,QAAQ,GAAAD,EAAA,KAAA,KAAA,CAAA,GAAG,IAAI,GAAAA,EAAA;MACfE,QAAQ,GAAAL,EAAA,CAAAK,QAAA;MACRC,WAAW,GAAAN,EAAA,CAAAM,WAAA;MACXC,IAAI,GAAAP,EAAA,CAAAO,IAAA;MACJC,MAAM,GA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SAAS;QAAA,aAAA,EACP,CAACA;QACd,CACE,EACNG,KAAA,CAAAG,aAAA,CAAA,KAAA,EAAA;QAAKF,SAAS,EAAEC,kBAAM,CAACb;MAAW,CAAA,EAC/B8C,iBAAiB,CAAC9C,WAAW,CAAC,CAC3B,CACF;IAEV,CAAC;IAED,OACEW,KAAA,CAAAG,aAAA,CAAA,KAAA,EAAAuC,KAAA,CAAAA,QAAA,CAAA;MAAKzC,SAAS,EAAEkB,UAAU,CAACjB,kBAAM,CAACyC,IAAI,EAAEnD,iBAAiB;IAAC,GAAMC,SAAS,CAAA,EACvEO,KAAA,CAAAG,aAAA,CAAA,KAAA,EAAA;MAAKF,SAAS,EAAEkB,UAAU,CAACjB,kBAAM,CAAC0C,IAAI,EAAE/C,SAAS,IAAIK,kBAAM,CAACL,SAAS;IAAC,CAAA,EACpEG,KAAA,CAAAG,aAAA,CAAAH,KAAA,CAAAqC,QAAA,EAAA,IAAA,EACGnB,WAAW,CAAE,CAAA,EACbqB,UAAU,CAAA,CAAE,CACZ,CACC,CACF;EAEV,CAAC;EAEDzD,WAAW,CAAC+D,WAAW,GAAG,aAAa;EAAA,OApI1B/D,WAAW;AAAA;"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var styles = {
|
|
4
4
|
"root": "GenericTile-module_root__9ZHdH",
|
|
5
5
|
"tile": "GenericTile-module_tile__mgFhk",
|
|
6
|
+
"titleMeta": "GenericTile-module_titleMeta__EREc9",
|
|
6
7
|
"face": "GenericTile-module_face__-KLVi",
|
|
7
8
|
"faceFront": "GenericTile-module_faceFront__HywHi",
|
|
8
9
|
"faceBack": "GenericTile-module_faceBack__NDCQ8",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenericTile.module.scss.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GenericTile.module.scss.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/cjs/Workflow/subcomponents/Footer/components/ProgressStepper/ProgressStepper.cjs
CHANGED
|
@@ -8,6 +8,7 @@ var IndicatorActiveIcon = require('../../../../../Icon/IndicatorActiveIcon.cjs')
|
|
|
8
8
|
var IndicatorInactiveIcon = require('../../../../../Icon/IndicatorInactiveIcon.cjs');
|
|
9
9
|
var SuccessIcon = require('../../../../../Icon/SuccessIcon.cjs');
|
|
10
10
|
var Text = require('../../../../../Text/Text.cjs');
|
|
11
|
+
var VisuallyHidden = require('../../../../../VisuallyHidden/VisuallyHidden.cjs');
|
|
11
12
|
var ProgressStepper_module = require('./ProgressStepper.module.scss.cjs');
|
|
12
13
|
var getStepStatus = function (isComplete, isCurrentStep, step, index) {
|
|
13
14
|
if (isComplete) {
|
|
@@ -68,9 +69,7 @@ const ProgressStepper = /*#__PURE__*/function () {
|
|
|
68
69
|
"aria-current": isCurrentStep
|
|
69
70
|
}, React.createElement("div", {
|
|
70
71
|
className: ProgressStepper_module.stepContent
|
|
71
|
-
}, React.createElement(
|
|
72
|
-
className: "sr-only"
|
|
73
|
-
}, accessibleName), React.createElement(Text.Text, {
|
|
72
|
+
}, React.createElement(VisuallyHidden.VisuallyHidden, null, accessibleName), React.createElement(Text.Text, {
|
|
74
73
|
classNameOverride: ProgressStepper_module.stepName,
|
|
75
74
|
variant: "small",
|
|
76
75
|
color: "white",
|
package/dist/cjs/Workflow/subcomponents/Footer/components/ProgressStepper/ProgressStepper.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressStepper.cjs","sources":["../../../../../../../src/Workflow/subcomponents/Footer/components/ProgressStepper/ProgressStepper.tsx"],"sourcesContent":["import React from \"react\"\nimport classnames from \"classnames\"\nimport {\n IndicatorActiveIcon,\n IndicatorInactiveIcon,\n SuccessIcon,\n} from \"~components/Icon\"\nimport { Text } from \"~components/Text\"\nimport styles from \"./ProgressStepper.module.scss\"\n\nexport type ProgressStepperProps = {\n stepName: string\n steps: [string, ...string[]]\n isComplete?: boolean\n}\n\nconst getStepStatus = (\n isComplete: boolean,\n isCurrentStep: boolean,\n step: string,\n index: number\n): {\n icon: JSX.Element\n accessibleName: string\n} => {\n if (isComplete) {\n return {\n icon: (\n <SuccessIcon\n key={index}\n inheritSize\n role=\"presentation\"\n classNameOverride=\"success\"\n />\n ),\n accessibleName: `Completed: ${step}`,\n }\n }\n if (isCurrentStep) {\n return {\n icon: (\n <IndicatorActiveIcon\n key={index}\n inheritSize\n role=\"presentation\"\n classNameOverride=\"active\"\n />\n ),\n accessibleName: `Current: ${step}`,\n }\n }\n return {\n icon: (\n <IndicatorInactiveIcon\n key={index}\n inheritSize\n classNameOverride=\"incomplete\"\n role=\"presentation\"\n />\n ),\n accessibleName: `Not started: ${step}`,\n }\n}\n\nexport const ProgressStepper = ({\n stepName,\n steps,\n isComplete = false,\n ...restprops\n}: ProgressStepperProps): JSX.Element => {\n const currentStepIndex = steps.indexOf(stepName)\n\n return (\n <div className={styles.stepsContainer}>\n <ol\n className={styles.stepList}\n {...restprops}\n aria-labelledby=\"stepper-description\"\n >\n {steps.map((step: string, index: number) => {\n const isCurrentStep = currentStepIndex === index\n const isCompletedStep = index < currentStepIndex || isComplete\n const { accessibleName, icon: Icon } = getStepStatus(\n isCompletedStep,\n isCurrentStep,\n step,\n index\n )\n return (\n <li\n className={styles.step}\n key={`${index}-${step}`}\n aria-current={isCurrentStep}\n >\n <div className={styles.stepContent}>\n <
|
|
1
|
+
{"version":3,"file":"ProgressStepper.cjs","sources":["../../../../../../../src/Workflow/subcomponents/Footer/components/ProgressStepper/ProgressStepper.tsx"],"sourcesContent":["import React from \"react\"\nimport classnames from \"classnames\"\nimport {\n IndicatorActiveIcon,\n IndicatorInactiveIcon,\n SuccessIcon,\n} from \"~components/Icon\"\nimport { Text } from \"~components/Text\"\nimport { VisuallyHidden } from \"~components/VisuallyHidden\"\nimport styles from \"./ProgressStepper.module.scss\"\n\nexport type ProgressStepperProps = {\n stepName: string\n steps: [string, ...string[]]\n isComplete?: boolean\n}\n\nconst getStepStatus = (\n isComplete: boolean,\n isCurrentStep: boolean,\n step: string,\n index: number\n): {\n icon: JSX.Element\n accessibleName: string\n} => {\n if (isComplete) {\n return {\n icon: (\n <SuccessIcon\n key={index}\n inheritSize\n role=\"presentation\"\n classNameOverride=\"success\"\n />\n ),\n accessibleName: `Completed: ${step}`,\n }\n }\n if (isCurrentStep) {\n return {\n icon: (\n <IndicatorActiveIcon\n key={index}\n inheritSize\n role=\"presentation\"\n classNameOverride=\"active\"\n />\n ),\n accessibleName: `Current: ${step}`,\n }\n }\n return {\n icon: (\n <IndicatorInactiveIcon\n key={index}\n inheritSize\n classNameOverride=\"incomplete\"\n role=\"presentation\"\n />\n ),\n accessibleName: `Not started: ${step}`,\n }\n}\n\nexport const ProgressStepper = ({\n stepName,\n steps,\n isComplete = false,\n ...restprops\n}: ProgressStepperProps): JSX.Element => {\n const currentStepIndex = steps.indexOf(stepName)\n\n return (\n <div className={styles.stepsContainer}>\n <ol\n className={styles.stepList}\n {...restprops}\n aria-labelledby=\"stepper-description\"\n >\n {steps.map((step: string, index: number) => {\n const isCurrentStep = currentStepIndex === index\n const isCompletedStep = index < currentStepIndex || isComplete\n const { accessibleName, icon: Icon } = getStepStatus(\n isCompletedStep,\n isCurrentStep,\n step,\n index\n )\n return (\n <li\n className={styles.step}\n key={`${index}-${step}`}\n aria-current={isCurrentStep}\n >\n <div className={styles.stepContent}>\n <VisuallyHidden>\n {/* will need to be translated */}\n {accessibleName}\n </VisuallyHidden>\n <Text\n classNameOverride={styles.stepName}\n variant=\"small\"\n color=\"white\"\n aria-hidden\n >\n {step}\n </Text>\n <div className={styles.stepIndicator}>\n <span className={styles.stepIcon}>{Icon}</span>\n </div>\n {index < steps.length - 1 && (\n <div\n className={classnames([\n styles.stepDivider,\n isCompletedStep && styles.completedStep,\n ])}\n />\n )}\n </div>\n </li>\n )\n })}\n </ol>\n <Text\n classNameOverride={styles.stepperDescription}\n variant=\"small\"\n color=\"white\"\n id=\"stepper-description\"\n >\n Step {currentStepIndex + 1} of {steps.length}\n </Text>\n </div>\n )\n}\n\nProgressStepper.displayName = \"Workflow.ProgressStepper\"\n"],"names":["getStepStatus","isComplete","isCurrentStep","step","index","icon","React","createElement","SuccessIcon","key","inheritSize","role","classNameOverride","accessibleName","concat","IndicatorActiveIcon","IndicatorInactiveIcon","ProgressStepper","_a","stepName","steps","_b","restprops","__rest","currentStepIndex","indexOf","className","styles","stepsContainer","__assign","stepList","map","isCompletedStep","Icon","stepContent","VisuallyHidden","Text","variant","color","stepIndicator","stepIcon","length","classnames","stepDivider","completedStep","stepperDescription","id","displayName"],"mappings":";;;;;;;;;;;;AAiBA,IAAMA,aAAa,GAAG,SAAAA,CACpBC,UAAmB,EACnBC,aAAsB,EACtBC,IAAY,EACZC,KAAa,EAAA;EAKb,IAAIH,UAAU,EAAE;IACd,OAAO;MACLI,IAAI,EACFC,KAAA,CAAAC,aAAA,CAACC,WAAAA,CAAAA,WAAW,EACV;QAAAC,GAAG,EAAEL,KAAK;QACVM,WAAW,EACX,IAAA;QAAAC,IAAI,EAAC,cAAc;QACnBC,iBAAiB,EAAC;QAErB;MACDC,cAAc,EAAE,aAAc,CAAAC,MAAA,CAAAX,IAAI;KACnC;EACF;EACD,IAAID,aAAa,EAAE;IACjB,OAAO;MACLG,IAAI,EACFC,KAAA,CAAAC,aAAA,CAACQ,mBAAAA,CAAAA,mBAAmB,EAClB;QAAAN,GAAG,EAAEL,KAAK;QACVM,WAAW,EACX,IAAA;QAAAC,IAAI,EAAC,cAAc;QACnBC,iBAAiB,EAAC;QAErB;MACDC,cAAc,EAAE,WAAY,CAAAC,MAAA,CAAAX,IAAI;KACjC;EACF;EACD,OAAO;IACLE,IAAI,EACFC,KAAA,CAAAC,aAAA,CAACS,qBAAAA,CAAAA,qBAAqB,EACpB;MAAAP,GAAG,EAAEL,KAAK;MACVM,WAAW,EACX,IAAA;MAAAE,iBAAiB,EAAC,YAAY;MAC9BD,IAA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tslib');
|
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var Heading = require('../../../../../Heading/Heading.cjs');
|
|
6
6
|
var Tag = require('../../../../../Tag/Tag.cjs');
|
|
7
|
+
var VisuallyHidden = require('../../../../../VisuallyHidden/VisuallyHidden.cjs');
|
|
7
8
|
var Titles_module = require('./Titles.module.scss.cjs');
|
|
8
9
|
const Titles = /*#__PURE__*/function () {
|
|
9
10
|
const Titles = function (_a) {
|
|
@@ -23,9 +24,7 @@ const Titles = /*#__PURE__*/function () {
|
|
|
23
24
|
variant: "heading-6",
|
|
24
25
|
tag: "span",
|
|
25
26
|
color: "dark-reduced-opacity"
|
|
26
|
-
}, workflowName, React.createElement("span",
|
|
27
|
-
className: "sr-only"
|
|
28
|
-
}, ":")), React.createElement("span", null, stepName)), status &&
|
|
27
|
+
}, workflowName, React.createElement(VisuallyHidden.VisuallyHidden, null, ":")), React.createElement("span", null, stepName)), status &&
|
|
29
28
|
// status may need to be update by a fetch
|
|
30
29
|
React.createElement("div", {
|
|
31
30
|
className: Titles_module.status
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Titles.cjs","sources":["../../../../../../../src/Workflow/subcomponents/Header/components/Titles/Titles.tsx"],"sourcesContent":["import React, { HTMLAttributes } from \"react\"\nimport { Heading } from \"~components/Heading\"\nimport { Tag, DefaultTagProps } from \"~components/Tag\"\nimport { OverrideClassName } from \"~types/OverrideClassName\"\nimport styles from \"./Titles.module.scss\"\n\nexport type WorkflowStatus = {\n /** @default: \"statusDraft\" */\n variant?: DefaultTagProps[\"variant\"]\n content?: string\n}\n\nexport type WorkflowTitlesProps = {\n workflowName: string\n stepName: string\n status?: WorkflowStatus\n} & OverrideClassName<HTMLAttributes<HTMLDivElement>>\n\nexport const Titles = ({\n workflowName,\n stepName,\n status,\n ...restProps\n}: WorkflowTitlesProps): JSX.Element => (\n <div className={styles.titles} {...restProps}>\n <Heading\n variant=\"heading-1\"\n tag=\"h1\"\n color=\"dark\"\n classNameOverride={styles.pageTitle}\n >\n <Heading\n classNameOverride={styles.prefix}\n variant=\"heading-6\"\n tag=\"span\"\n color=\"dark-reduced-opacity\"\n >\n {workflowName}\n <
|
|
1
|
+
{"version":3,"file":"Titles.cjs","sources":["../../../../../../../src/Workflow/subcomponents/Header/components/Titles/Titles.tsx"],"sourcesContent":["import React, { HTMLAttributes } from \"react\"\nimport { Heading } from \"~components/Heading\"\nimport { Tag, DefaultTagProps } from \"~components/Tag\"\nimport { VisuallyHidden } from \"~components/VisuallyHidden\"\nimport { OverrideClassName } from \"~types/OverrideClassName\"\nimport styles from \"./Titles.module.scss\"\n\nexport type WorkflowStatus = {\n /** @default: \"statusDraft\" */\n variant?: DefaultTagProps[\"variant\"]\n content?: string\n}\n\nexport type WorkflowTitlesProps = {\n workflowName: string\n stepName: string\n status?: WorkflowStatus\n} & OverrideClassName<HTMLAttributes<HTMLDivElement>>\n\nexport const Titles = ({\n workflowName,\n stepName,\n status,\n ...restProps\n}: WorkflowTitlesProps): JSX.Element => (\n <div className={styles.titles} {...restProps}>\n <Heading\n variant=\"heading-1\"\n tag=\"h1\"\n color=\"dark\"\n classNameOverride={styles.pageTitle}\n >\n <Heading\n classNameOverride={styles.prefix}\n variant=\"heading-6\"\n tag=\"span\"\n color=\"dark-reduced-opacity\"\n >\n {workflowName}\n <VisuallyHidden>:</VisuallyHidden>\n </Heading>\n <span>{stepName}</span>\n </Heading>\n {status && (\n // status may need to be update by a fetch\n <div className={styles.status}>\n <Tag inline variant={status?.variant || \"statusDraft\"}>\n {status?.content}\n </Tag>\n </div>\n )}\n </div>\n)\n\nTitles.displayName = \"Workflow.Titles\"\n"],"names":["Titles","_a","workflowName","stepName","status","restProps","__rest","React","className","styles","titles","createElement","Heading","variant","tag","color","classNameOverride","pageTitle","prefix","VisuallyHidden","Tag","inline","content","displayName"],"mappings":";;;;;;;;MAmBaA,MAAM;EAAA,MAANA,MAAM,GAAG,SAAAA,CAACC,EAKD,EAAA;IAJpB,IAAAC,YA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,CAET,CACG;GACP;EAEDtB,MAAM,CAACuB,WAAW,GAAG,iBAAiB;EAAA,OAnCzBvB,MAAM;AAAA;"}
|
|
@@ -8,6 +8,7 @@ var IndicatorActiveIcon = require('../../../../../../Icon/IndicatorActiveIcon.cj
|
|
|
8
8
|
var IndicatorInactiveIcon = require('../../../../../../Icon/IndicatorInactiveIcon.cjs');
|
|
9
9
|
var SuccessIcon = require('../../../../../../Icon/SuccessIcon.cjs');
|
|
10
10
|
var Text = require('../../../../../../Text/Text.cjs');
|
|
11
|
+
var VisuallyHidden = require('../../../../../../VisuallyHidden/VisuallyHidden.cjs');
|
|
11
12
|
var ProgressStepper_module = require('./ProgressStepper.module.scss.cjs');
|
|
12
13
|
var getStepStatus = function (isComplete, isCurrentStep, step, index) {
|
|
13
14
|
if (isComplete) {
|
|
@@ -70,9 +71,7 @@ const ProgressStepper = /*#__PURE__*/function () {
|
|
|
70
71
|
"aria-current": isCurrentStep
|
|
71
72
|
}, React.createElement("div", {
|
|
72
73
|
className: ProgressStepper_module.stepContent
|
|
73
|
-
}, React.createElement(
|
|
74
|
-
className: "sr-only"
|
|
75
|
-
}, accessibleName), React.createElement(Text.Text, {
|
|
74
|
+
}, React.createElement(VisuallyHidden.VisuallyHidden, null, accessibleName), React.createElement(Text.Text, {
|
|
76
75
|
classNameOverride: ProgressStepper_module.stepName,
|
|
77
76
|
variant: "small",
|
|
78
77
|
color: "white",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressStepper.cjs","sources":["../../../../../../../../src/__future__/Workflow/subcomponents/Footer/components/ProgressStepper/ProgressStepper.tsx"],"sourcesContent":["import React from \"react\"\nimport classnames from \"classnames\"\nimport {\n IndicatorActiveIcon,\n IndicatorInactiveIcon,\n SuccessIcon,\n} from \"~components/Icon\"\nimport { Text } from \"~components/Text\"\nimport styles from \"./ProgressStepper.module.scss\"\n\nexport type Step = {\n id: string\n label: string\n}\n\nexport type Steps = [Step, ...Step[]]\n\nexport type ProgressStepperProps = {\n /** The id reference to within a Step object */\n currentStepId: Step[\"id\"]\n /** A non-empty array of Steps */\n steps: Steps\n isComplete?: boolean\n}\n\nconst getStepStatus = (\n isComplete: boolean,\n isCurrentStep: boolean,\n step: Step,\n index: number\n): {\n icon: JSX.Element\n accessibleName: string\n} => {\n if (isComplete) {\n return {\n icon: (\n <SuccessIcon\n key={index}\n inheritSize\n role=\"presentation\"\n classNameOverride=\"success\"\n />\n ),\n accessibleName: `Completed: ${step.label}`,\n }\n }\n if (isCurrentStep) {\n return {\n icon: (\n <IndicatorActiveIcon\n key={index}\n inheritSize\n role=\"presentation\"\n classNameOverride=\"active\"\n />\n ),\n accessibleName: `Current: ${step.label}`,\n }\n }\n return {\n icon: (\n <IndicatorInactiveIcon\n key={index}\n inheritSize\n classNameOverride=\"incomplete\"\n role=\"presentation\"\n />\n ),\n accessibleName: `Not started: ${step.label}`,\n }\n}\n\nexport const ProgressStepper = ({\n currentStepId,\n steps,\n isComplete = false,\n ...restprops\n}: ProgressStepperProps): JSX.Element => {\n const currentStepIndex = steps.findIndex(\n stepItem => stepItem.id === currentStepId\n )\n\n return (\n <div className={styles.stepsContainer}>\n <ol\n className={styles.stepList}\n {...restprops}\n aria-labelledby=\"stepper-description\"\n >\n {steps.map((step, index: number) => {\n const isCurrentStep = currentStepIndex === index\n const isCompletedStep = index < currentStepIndex || isComplete\n const { accessibleName, icon: Icon } = getStepStatus(\n isCompletedStep,\n isCurrentStep,\n step,\n index\n )\n return (\n <li\n className={styles.step}\n key={`${step.id}`}\n aria-current={isCurrentStep}\n >\n <div className={styles.stepContent}>\n <
|
|
1
|
+
{"version":3,"file":"ProgressStepper.cjs","sources":["../../../../../../../../src/__future__/Workflow/subcomponents/Footer/components/ProgressStepper/ProgressStepper.tsx"],"sourcesContent":["import React from \"react\"\nimport classnames from \"classnames\"\nimport {\n IndicatorActiveIcon,\n IndicatorInactiveIcon,\n SuccessIcon,\n} from \"~components/Icon\"\nimport { Text } from \"~components/Text\"\nimport { VisuallyHidden } from \"~components/VisuallyHidden\"\nimport styles from \"./ProgressStepper.module.scss\"\n\nexport type Step = {\n id: string\n label: string\n}\n\nexport type Steps = [Step, ...Step[]]\n\nexport type ProgressStepperProps = {\n /** The id reference to within a Step object */\n currentStepId: Step[\"id\"]\n /** A non-empty array of Steps */\n steps: Steps\n isComplete?: boolean\n}\n\nconst getStepStatus = (\n isComplete: boolean,\n isCurrentStep: boolean,\n step: Step,\n index: number\n): {\n icon: JSX.Element\n accessibleName: string\n} => {\n if (isComplete) {\n return {\n icon: (\n <SuccessIcon\n key={index}\n inheritSize\n role=\"presentation\"\n classNameOverride=\"success\"\n />\n ),\n accessibleName: `Completed: ${step.label}`,\n }\n }\n if (isCurrentStep) {\n return {\n icon: (\n <IndicatorActiveIcon\n key={index}\n inheritSize\n role=\"presentation\"\n classNameOverride=\"active\"\n />\n ),\n accessibleName: `Current: ${step.label}`,\n }\n }\n return {\n icon: (\n <IndicatorInactiveIcon\n key={index}\n inheritSize\n classNameOverride=\"incomplete\"\n role=\"presentation\"\n />\n ),\n accessibleName: `Not started: ${step.label}`,\n }\n}\n\nexport const ProgressStepper = ({\n currentStepId,\n steps,\n isComplete = false,\n ...restprops\n}: ProgressStepperProps): JSX.Element => {\n const currentStepIndex = steps.findIndex(\n stepItem => stepItem.id === currentStepId\n )\n\n return (\n <div className={styles.stepsContainer}>\n <ol\n className={styles.stepList}\n {...restprops}\n aria-labelledby=\"stepper-description\"\n >\n {steps.map((step, index: number) => {\n const isCurrentStep = currentStepIndex === index\n const isCompletedStep = index < currentStepIndex || isComplete\n const { accessibleName, icon: Icon } = getStepStatus(\n isCompletedStep,\n isCurrentStep,\n step,\n index\n )\n return (\n <li\n className={styles.step}\n key={`${step.id}`}\n aria-current={isCurrentStep}\n >\n <div className={styles.stepContent}>\n <VisuallyHidden>\n {/* will need to be translated */}\n {accessibleName}\n </VisuallyHidden>\n <Text\n classNameOverride={styles.stepName}\n variant=\"small\"\n color=\"white\"\n aria-hidden\n >\n {step.label}\n </Text>\n <div className={styles.stepIndicator}>\n <span className={styles.stepIcon}>{Icon}</span>\n </div>\n {index < steps.length - 1 && (\n <div\n className={classnames([\n styles.stepDivider,\n isCompletedStep && styles.completedStep,\n ])}\n />\n )}\n </div>\n </li>\n )\n })}\n </ol>\n <Text\n classNameOverride={styles.stepperDescription}\n variant=\"small\"\n color=\"white\"\n id=\"stepper-description\"\n >\n Step {currentStepIndex + 1} of {steps.length}\n </Text>\n </div>\n )\n}\n\nProgressStepper.displayName = \"Workflow.ProgressStepper\"\n"],"names":["getStepStatus","isComplete","isCurrentStep","step","index","icon","React","createElement","SuccessIcon","key","inheritSize","role","classNameOverride","accessibleName","concat","label","IndicatorActiveIcon","IndicatorInactiveIcon","ProgressStepper","_a","currentStepId","steps","_b","restprops","__rest","currentStepIndex","findIndex","stepItem","id","className","styles","stepsContainer","__assign","stepList","map","isCompletedStep","Icon","stepContent","VisuallyHidden","Text","stepName","variant","color","stepIndicator","stepIcon","length","classnames","stepDivider","completedStep","stepperDescription","displayName"],"mappings":";;;;;;;;;;;;AA0BA,IAAMA,aAAa,GAAG,SAAAA,CACpBC,UAAmB,EACnBC,aAAsB,EACtBC,IAAU,EACVC,KAAa,EAAA;EAKb,IAAIH,UAAU,EAAE;IACd,OAAO;MACLI,IAAI,EACFC,KAAA,CAAAC,aAAA,CAACC,WAAAA,CAAAA,WAAW,EACV;QAAAC,GAAG,EAAEL,KAAK;QACVM,WAAW,EACX,IAAA;QAAAC,IAAI,EAAC,cAAc;QACnBC,iBAAiB,EAAC;QAErB;MACDC,cAAc,EAAE,aAAA,CAAAC,MAAA,CAAcX,IAAI,CAACY,KAAK;KACzC;EACF;EACD,IAAIb,aAAa,EAAE;IACjB,OAAO;MACLG,IAAI,EACFC,KAAA,CAAAC,aAAA,CAACS,mBAAAA,CAAAA,mBAAmB,EAClB;QAAAP,GAAG,EAAEL,KAAK;QACVM,WAAW,EACX,IAAA;QAAAC,IAAI,EAAC,cAAc;QAC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B,iBAAiB,EAAEkB,sBAAM,CAACmB,kBAAkB;MAC5CR,OAAO,EAAC,OAAO;MACfC,KAAK,EAAC,OAAO;MACbd,EAAE,EAAC;IAAqB,CAAA,WAElBH,gBAAgB,GAAG,CAAC,UAAMJ,KAAK,CAACwB,MAAM,CACvC,CACH;EAEV,CAAC;EAED3B,eAAe,CAACgC,WAAW,GAAG,0BAA0B;EAAA,OAzE3ChC,eAAe;AAAA;"}
|
|
@@ -4,6 +4,7 @@ var tslib = require('tslib');
|
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var Heading = require('../../../../../../Heading/Heading.cjs');
|
|
6
6
|
var Tag = require('../../../../../../Tag/Tag.cjs');
|
|
7
|
+
var VisuallyHidden = require('../../../../../../VisuallyHidden/VisuallyHidden.cjs');
|
|
7
8
|
var Titles_module = require('./Titles.module.scss.cjs');
|
|
8
9
|
const Titles = /*#__PURE__*/function () {
|
|
9
10
|
const Titles = function (_a) {
|
|
@@ -23,9 +24,7 @@ const Titles = /*#__PURE__*/function () {
|
|
|
23
24
|
variant: "heading-6",
|
|
24
25
|
tag: "span",
|
|
25
26
|
color: "dark-reduced-opacity"
|
|
26
|
-
}, workflowName, React.createElement("span",
|
|
27
|
-
className: "sr-only"
|
|
28
|
-
}, ":")), React.createElement("span", null, stepName)), status &&
|
|
27
|
+
}, workflowName, React.createElement(VisuallyHidden.VisuallyHidden, null, ":")), React.createElement("span", null, stepName)), status &&
|
|
29
28
|
// status may need to be update by a fetch
|
|
30
29
|
React.createElement("div", {
|
|
31
30
|
className: Titles_module.status
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Titles.cjs","sources":["../../../../../../../../src/__future__/Workflow/subcomponents/Header/components/Titles/Titles.tsx"],"sourcesContent":["import React, { HTMLAttributes } from \"react\"\nimport { Heading } from \"~components/Heading\"\nimport { Tag, DefaultTagProps } from \"~components/Tag\"\nimport { OverrideClassName } from \"~types/OverrideClassName\"\nimport styles from \"./Titles.module.scss\"\n\nexport type WorkflowStatus = {\n /** @default: \"statusDraft\" */\n variant?: DefaultTagProps[\"variant\"]\n content?: string\n}\n\nexport type WorkflowTitlesProps = {\n workflowName: string\n stepName: string\n status?: WorkflowStatus\n} & OverrideClassName<HTMLAttributes<HTMLDivElement>>\n\nexport const Titles = ({\n workflowName,\n stepName,\n status,\n ...restProps\n}: WorkflowTitlesProps): JSX.Element => (\n <div className={styles.titles} {...restProps}>\n <Heading\n variant=\"heading-1\"\n tag=\"h1\"\n color=\"dark\"\n classNameOverride={styles.pageTitle}\n >\n <Heading\n classNameOverride={styles.prefix}\n variant=\"heading-6\"\n tag=\"span\"\n color=\"dark-reduced-opacity\"\n >\n {workflowName}\n <
|
|
1
|
+
{"version":3,"file":"Titles.cjs","sources":["../../../../../../../../src/__future__/Workflow/subcomponents/Header/components/Titles/Titles.tsx"],"sourcesContent":["import React, { HTMLAttributes } from \"react\"\nimport { Heading } from \"~components/Heading\"\nimport { Tag, DefaultTagProps } from \"~components/Tag\"\nimport { VisuallyHidden } from \"~components/VisuallyHidden\"\nimport { OverrideClassName } from \"~types/OverrideClassName\"\nimport styles from \"./Titles.module.scss\"\n\nexport type WorkflowStatus = {\n /** @default: \"statusDraft\" */\n variant?: DefaultTagProps[\"variant\"]\n content?: string\n}\n\nexport type WorkflowTitlesProps = {\n workflowName: string\n stepName: string\n status?: WorkflowStatus\n} & OverrideClassName<HTMLAttributes<HTMLDivElement>>\n\nexport const Titles = ({\n workflowName,\n stepName,\n status,\n ...restProps\n}: WorkflowTitlesProps): JSX.Element => (\n <div className={styles.titles} {...restProps}>\n <Heading\n variant=\"heading-1\"\n tag=\"h1\"\n color=\"dark\"\n classNameOverride={styles.pageTitle}\n >\n <Heading\n classNameOverride={styles.prefix}\n variant=\"heading-6\"\n tag=\"span\"\n color=\"dark-reduced-opacity\"\n >\n {workflowName}\n <VisuallyHidden>:</VisuallyHidden>\n </Heading>\n <span>{stepName}</span>\n </Heading>\n {status && (\n // status may need to be update by a fetch\n <div className={styles.status}>\n <Tag inline variant={status?.variant || \"statusDraft\"}>\n {status?.content}\n </Tag>\n </div>\n )}\n </div>\n)\n\nTitles.displayName = \"Workflow.Titles\"\n"],"names":["Titles","_a","workflowName","stepName","status","restProps","__rest","React","className","styles","titles","createElement","Heading","variant","tag","color","classNameOverride","pageTitle","prefix","VisuallyHidden","Tag","inline","content","displayName"],"mappings":";;;;;;;;MAmBaA,MAAM;EAAA,MAANA,MAAM,GAAG,SAAAA,CAACC,EAKD,EAAA;IAJpB,IAAAC,YAAY,GAAAD,EAAA,CAAAC,YAAA;MACZC,QAAQ,GAAAF,EAAA,CAAAE,QAAA;MACRC,MAAM,GAAAH,EAAA,CAAAG,MAAA;MACHC,SAAS,GAJSC,KAAAA,CAAAA,MAAA,CAAAL,EAAA,EAAA,CAAA,cAAA,EAAA,UAAA,EAAA,QAAA,CAKtB,CADa;IAC0B,OACtCM;MAAKC,SAAS,EAAEC,aAAM,CAACC;OAAYL,SAAS,CAAA,EAC1CE,KAAA,CAAAI,aAAA,CAACC,OAAAA,CAAAA,OAAO,EACN;MAAAC,OAAO,EAAC,WAAW;MACnBC,GAAG,EAAC,IAAI;MACRC,KAAK,EAAC,MAAM;MACZC,iBAAiB,EAAEP,aAAM,CAACQ;IAAS,CAAA,EAEnCV,KAAA,CAAAI,aAAA,CAACC,OAAAA,CAAAA,OAAO,EACN;MAAAI,iBAAiB,EAAEP,aAAM,CAACS,MAAM;MAChCL,OAAO,EAAC,WAAW;MACnBC,GAAG,EAAC,MAAM;MACVC,KAAK,EAAC;IAAsB,CAAA,EAE3Bb,YAAY,EACbK,KAAC,CAAAI,aAAA,CAAAQ,cAAAA,CAAAA,cAAc,YAAmB,CAC1B,EACVZ,KAAO,CAAAI,aAAA,CAAA,MAAA,EAAA,IAAA,EAAAR,QAAQ,CAAQ,CACf,EACTC,MAAM;;IAELG,KAAA,CAAAI,aAAA,CAAA,KAAA,EAAA;MAAKH,SAAS,EAAEC,aAAM,CAACL;IAAM,CAAA,EA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