@coveord/plasma-mantine 52.12.1 → 52.13.1
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/.eslintrc.js +1 -1
- package/.turbo/turbo-build.log +3 -3
- package/.turbo/turbo-test.log +32 -32
- package/__mocks__/@monaco-editor/react.tsx +2 -2
- package/dist/.tsbuildinfo +1 -1
- package/dist/cjs/components/button/Button.js.map +1 -1
- package/dist/cjs/components/button/ButtonWithDisabledTooltip.js.map +1 -1
- package/dist/cjs/components/code-editor/CodeEditor.d.ts +4 -0
- package/dist/cjs/components/code-editor/CodeEditor.d.ts.map +1 -1
- package/dist/cjs/components/code-editor/CodeEditor.js +10 -2
- package/dist/cjs/components/code-editor/CodeEditor.js.map +1 -1
- package/dist/cjs/components/collection/Collection.js.map +1 -1
- package/dist/cjs/components/date-range-picker/DateRangePickerPresetSelect.js.map +1 -1
- package/dist/cjs/components/header/Header.js.map +1 -1
- package/dist/cjs/components/inline-confirm/InlineConfirm.js.map +1 -1
- package/dist/cjs/components/inline-confirm/InlineConfirmButton.js.map +1 -1
- package/dist/cjs/components/inline-confirm/InlineConfirmMenuItem.js.map +1 -1
- package/dist/cjs/components/menu/Menu.js.map +1 -1
- package/dist/cjs/components/modal-wizard/ModalWizard.js.map +1 -1
- package/dist/cjs/components/table/layouts/RowLayout.d.ts.map +1 -1
- package/dist/cjs/components/table/layouts/RowLayout.js +2 -1
- package/dist/cjs/components/table/layouts/RowLayout.js.map +1 -1
- package/dist/cjs/components/table/useRowSelection.js.map +1 -1
- package/dist/cjs/form/FormProvider.js.map +1 -1
- package/dist/cjs/form/useForm.js.map +1 -1
- package/dist/cjs/theme/Theme.d.ts.map +1 -1
- package/dist/cjs/theme/Theme.js +21 -2
- package/dist/cjs/theme/Theme.js.map +1 -1
- package/dist/cjs/utils/overrideComponent.js.map +1 -1
- package/dist/esm/components/button/Button.js.map +1 -1
- package/dist/esm/components/button/ButtonWithDisabledTooltip.js.map +1 -1
- package/dist/esm/components/code-editor/CodeEditor.d.ts +4 -0
- package/dist/esm/components/code-editor/CodeEditor.d.ts.map +1 -1
- package/dist/esm/components/code-editor/CodeEditor.js +10 -2
- package/dist/esm/components/code-editor/CodeEditor.js.map +1 -1
- package/dist/esm/components/collection/Collection.js.map +1 -1
- package/dist/esm/components/date-range-picker/DateRangePickerPresetSelect.js.map +1 -1
- package/dist/esm/components/header/Header.js.map +1 -1
- package/dist/esm/components/inline-confirm/InlineConfirm.js.map +1 -1
- package/dist/esm/components/inline-confirm/InlineConfirmButton.js.map +1 -1
- package/dist/esm/components/inline-confirm/InlineConfirmMenuItem.js.map +1 -1
- package/dist/esm/components/menu/Menu.js.map +1 -1
- package/dist/esm/components/modal-wizard/ModalWizard.js.map +1 -1
- package/dist/esm/components/table/layouts/RowLayout.d.ts.map +1 -1
- package/dist/esm/components/table/layouts/RowLayout.js +2 -1
- package/dist/esm/components/table/layouts/RowLayout.js.map +1 -1
- package/dist/esm/components/table/useRowSelection.js.map +1 -1
- package/dist/esm/form/FormProvider.js.map +1 -1
- package/dist/esm/form/useForm.js.map +1 -1
- package/dist/esm/theme/Theme.d.ts.map +1 -1
- package/dist/esm/theme/Theme.js +22 -3
- package/dist/esm/theme/Theme.js.map +1 -1
- package/dist/esm/utils/overrideComponent.js.map +1 -1
- package/package.json +7 -5
- package/src/components/button/Button.tsx +1 -1
- package/src/components/button/ButtonWithDisabledTooltip.tsx +2 -2
- package/src/components/button/__tests__/Button.spec.tsx +6 -6
- package/src/components/button/__tests__/ButtonWithDisabledTooltip.spec.tsx +3 -3
- package/src/components/code-editor/CodeEditor.tsx +8 -1
- package/src/components/code-editor/__tests__/CodeEditor.spec.tsx +17 -0
- package/src/components/collection/Collection.tsx +1 -1
- package/src/components/date-range-picker/DateRangePickerPresetSelect.tsx +1 -1
- package/src/components/date-range-picker/__tests__/DateRangePickerInlineCalendar.spec.tsx +8 -4
- package/src/components/date-range-picker/__tests__/DateRangePickerPresetSelect.spec.tsx +4 -4
- package/src/components/header/Header.tsx +1 -1
- package/src/components/header/__tests__/Header.spec.tsx +4 -4
- package/src/components/inline-confirm/InlineConfirm.tsx +1 -1
- package/src/components/inline-confirm/InlineConfirmButton.tsx +1 -1
- package/src/components/inline-confirm/InlineConfirmMenuItem.tsx +1 -1
- package/src/components/inline-confirm/__tests__/InlineConfirm.spec.tsx +5 -5
- package/src/components/menu/Menu.tsx +1 -1
- package/src/components/modal-wizard/ModalWizard.tsx +3 -3
- package/src/components/modal-wizard/__tests__/ModalWizard.spec.tsx +21 -21
- package/src/components/prompt/__tests__/Prompt.spec.tsx +2 -2
- package/src/components/sticky-footer/__tests__/StickyFooter.spec.tsx +1 -1
- package/src/components/table/__tests__/Table.spec.tsx +15 -15
- package/src/components/table/__tests__/TableActions.spec.tsx +3 -3
- package/src/components/table/__tests__/TableDateRangePicker.spec.tsx +2 -2
- package/src/components/table/__tests__/TableFilter.spec.tsx +7 -7
- package/src/components/table/__tests__/TableLastUpdated.spec.tsx +2 -2
- package/src/components/table/__tests__/TablePagination.spec.tsx +6 -6
- package/src/components/table/__tests__/TablePerPage.spec.tsx +10 -10
- package/src/components/table/__tests__/TablePredicate.spec.tsx +2 -2
- package/src/components/table/layouts/RowLayout.tsx +1 -0
- package/src/components/table/layouts/__tests__/RowLayout.spec.tsx +16 -16
- package/src/components/table/useRowSelection.ts +4 -4
- package/src/form/FormProvider.tsx +2 -2
- package/src/form/useForm.ts +1 -1
- package/src/theme/Theme.tsx +20 -0
- package/src/utils/overrideComponent.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/modal-wizard/ModalWizard.tsx"],"sourcesContent":["import {Box, CloseButton, createStyles, DefaultProps, Modal, ModalProps, Progress, Selectors} from '@mantine/core';\nimport {Children, ReactElement, useEffect, useMemo, useState} from 'react';\n\nimport {Button} from '../button';\nimport {Header} from '../header';\nimport {StickyFooter} from '../sticky-footer';\nimport {ModalWizardStep, ModalWizardStepProps, ResolveStep} from './ModalWizardStep';\n\nconst useStyles = createStyles(() => ({\n content: {\n display: 'flex',\n flexDirection: 'column',\n },\n body: {\n flex: 1,\n display: 'flex',\n flexDirection: 'column',\n },\n}));\n\ntype ModalWizardStylesNames = Selectors<typeof useStyles>;\n\nexport interface ModalWizardProps\n extends Omit<DefaultProps<ModalWizardStylesNames>, 'classNames' | 'styles'>,\n Omit<ModalProps, 'centered' | 'title'> {\n /**\n * The label of the cancel button\n *\n * @default \"Cancel\"\n */\n cancelButtonLabel?: string;\n\n /**\n * The label of the next button\n *\n * @default \"Next\"\n */\n nextButtonLabel?: string;\n\n /**\n * The label of the previous button\n *\n * @default \"Previous\"\n */\n previousButtonLabel?: string;\n\n /**\n * The label of the finish button\n *\n * @default \"Finish\"\n */\n finishButtonLabel?: string;\n\n /**\n * A callback function that is executed when the user clicks on the next button\n */\n onNext?: (newStep: number, setCurrentStep?: React.Dispatch<number>) => unknown;\n\n /**\n * A callback function that is executed when the user clicks on the previous button\n */\n onPrevious?: (newStep: number) => unknown;\n\n /**\n * A function that is executed when user completes all the steps.\n *\n * @param close A function that closes the modal when called.\n */\n onFinish?: () => unknown;\n\n /**\n * Determine if user interacted with any steps in the modal wizard\n */\n isDirty?: () => boolean;\n\n /**\n * A function to confirm close if the state is dirty before closing\n */\n handleDirtyState?: () => boolean;\n\n /**\n * Children to display in modal wizard\n * */\n children?: Array<ReturnType<typeof ModalWizardStep>>;\n\n /**\n * Indicates if step validation should be performed when clicking on to the next step\n * If true, the next step will always be enabled\n *\n * @default false\n */\n isStepValidatedOnNext?: boolean;\n}\n\ninterface ModalWizardType {\n (props: ModalWizardProps): ReactElement;\n\n Step: typeof ModalWizardStep;\n}\n\nexport const ModalWizard: ModalWizardType = ({\n cancelButtonLabel = 'Cancel',\n nextButtonLabel = 'Next',\n previousButtonLabel = 'Previous',\n finishButtonLabel = 'Finish',\n opened,\n onNext,\n onPrevious,\n onClose,\n onFinish,\n isDirty,\n handleDirtyState,\n classNames,\n styles,\n unstyled,\n children,\n isStepValidatedOnNext,\n ...modalProps\n}) => {\n const {\n classes: {content, body},\n cx,\n } = useStyles(null, {\n name: 'ModalWizard',\n classNames,\n styles,\n unstyled,\n });\n\n const [currentStepIndex, setCurrentStepIndex] = useState(0);\n const modalSteps = (Children.toArray(children) as ReactElement[]).filter((child) => child.type === ModalWizardStep);\n\n const numberOfSteps = modalSteps.length;\n const isFirstStep = currentStepIndex === 0;\n const isLastStep = currentStepIndex === numberOfSteps - 1;\n const currentStep = modalSteps.filter((step: ReactElement, index: number) => index === currentStepIndex)[0];\n\n const {isValid} = isStepValidatedOnNext\n ? {isValid: true}\n : currentStep?.props?.validateStep?.(currentStepIndex, numberOfSteps) ?? {isValid: true};\n\n useEffect(() => {\n if (opened) {\n setCurrentStepIndex(0);\n }\n }, [opened]);\n\n const handleClose = (confirmDirty: boolean) => {\n if (confirmDirty) {\n const isModalDirty = isDirty?.() ?? false;\n if (isModalDirty) {\n const discardChanges = handleDirtyState?.() ?? true;\n if (!discardChanges) {\n return;\n }\n }\n }\n onClose?.();\n };\n\n const resolveStepDependentProp = <P extends keyof ModalWizardStepProps>(\n prop: P\n ): ResolveStep<ModalWizardStepProps[P]> =>\n typeof currentStep.props[prop] === 'function'\n ? currentStep.props[prop](currentStepIndex + 1, numberOfSteps)\n : currentStep.props[prop];\n\n const getProgress = useMemo(\n () => (currStepIndex: number) => {\n const totalNumberOfSteps = modalSteps.filter((step) => step.props.countsAsProgress).length;\n const numberOfCompletedSteps = modalSteps.filter(\n (step, index) => step.props.countsAsProgress && index <= currStepIndex\n ).length;\n return (numberOfCompletedSteps / totalNumberOfSteps) * 100;\n },\n []\n );\n\n return (\n <Modal\n opened={opened}\n classNames={{content: cx(content, classNames?.content), body: cx(body, classNames?.body)}}\n centered\n onClose={() => handleClose(true)}\n withCloseButton={false}\n padding={0}\n {...modalProps}\n >\n <Header\n p=\"lg\"\n pr=\"md\"\n variant=\"modal\"\n description={resolveStepDependentProp('description')}\n borderBottom={!currentStep.props.showProgressBar}\n >\n {resolveStepDependentProp('title')}\n {resolveStepDependentProp('docLink') ? (\n <Header.DocAnchor\n href={resolveStepDependentProp('docLink')}\n label={resolveStepDependentProp('docLinkTooltipLabel')}\n />\n ) : null}\n <Header.Actions>\n <CloseButton aria-label={'close-modal'} onClick={() => handleClose(true)} />\n </Header.Actions>\n </Header>\n {currentStep.props.showProgressBar && (\n <Progress color=\"navy.5\" size=\"sm\" radius={0} value={getProgress(currentStepIndex)} />\n )}\n <Box p=\"lg\">{currentStep}</Box>\n <Box\n sx={{\n marginTop: 'auto',\n }}\n >\n <StickyFooter borderTop>\n <Button\n name={isFirstStep ? cancelButtonLabel : previousButtonLabel}\n variant=\"outline\"\n onClick={() => {\n if (isFirstStep) {\n handleClose(true);\n } else {\n onPrevious?.(currentStepIndex - 1);\n setCurrentStepIndex(currentStepIndex - 1);\n }\n }}\n >\n {isFirstStep ? cancelButtonLabel : previousButtonLabel}\n </Button>\n\n <Button\n disabled={!isValid}\n onClick={() => {\n if (isLastStep) {\n onFinish?.() ?? handleClose(false);\n } else {\n onNext?.(currentStepIndex + 1, setCurrentStepIndex);\n\n if (!isStepValidatedOnNext) {\n setCurrentStepIndex(currentStepIndex + 1);\n }\n }\n }}\n >\n {isLastStep ? finishButtonLabel : nextButtonLabel}\n </Button>\n </StickyFooter>\n </Box>\n </Modal>\n );\n};\n\nModalWizard.Step = ModalWizardStep;\n"],"names":["Box","CloseButton","createStyles","Modal","Progress","Children","useEffect","useMemo","useState","Button","Header","StickyFooter","ModalWizardStep","useStyles","content","display","flexDirection","body","flex","ModalWizard","cancelButtonLabel","nextButtonLabel","previousButtonLabel","finishButtonLabel","opened","onNext","onPrevious","onClose","onFinish","isDirty","handleDirtyState","classNames","styles","unstyled","children","isStepValidatedOnNext","modalProps","currentStep","name","classes","cx","currentStepIndex","setCurrentStepIndex","modalSteps","toArray","filter","child","type","numberOfSteps","length","isFirstStep","isLastStep","step","index","isValid","props","validateStep","handleClose","confirmDirty","isModalDirty","discardChanges","resolveStepDependentProp","prop","getProgress","currStepIndex","totalNumberOfSteps","countsAsProgress","numberOfCompletedSteps","centered","withCloseButton","padding","p","pr","variant","description","borderBottom","showProgressBar","DocAnchor","href","label","Actions","aria-label","onClick","color","size","radius","value","sx","marginTop","borderTop","disabled","Step"],"mappings":";;;;;AAAA,SAAQA,GAAG,EAAEC,WAAW,EAAEC,YAAY,EAAgBC,KAAK,EAAcC,QAAQ,QAAkB,gBAAgB;AACnH,SAAQC,QAAQ,EAAgBC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAO,QAAQ;AAE3E,SAAQC,MAAM,QAAO,YAAY;AACjC,SAAQC,MAAM,QAAO,YAAY;AACjC,SAAQC,YAAY,QAAO,mBAAmB;AAC9C,SAAQC,eAAe,QAA0C,oBAAoB;AAErF,IAAMC,YAAYX,aAAa;WAAO;QAClCY,SAAS;YACLC,SAAS;YACTC,eAAe;QACnB;QACAC,MAAM;YACFC,MAAM;YACNH,SAAS;YACTC,eAAe;QACnB;IACJ;;AAkFA,OAAO,IAAMG,cAA+B;0CACxCC,mBAAAA,0DAAoB,qEACpBC,iBAAAA,sDAAkB,qEAClBC,qBAAAA,8DAAsB,2EACtBC,mBAAAA,0DAAoB,qCACpBC,gBAAAA,QACAC,gBAAAA,QACAC,oBAAAA,YACAC,iBAAAA,SACAC,kBAAAA,UACAC,iBAAAA,SACAC,0BAAAA,kBACAC,oBAAAA,YACAC,gBAAAA,QACAC,kBAAAA,UACAC,kBAAAA,UACAC,+BAAAA,uBACGC;QAhBHhB;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;;QAuBME,iCAAAA,oBAAAA,cA0CoCN,aAAqCA;IA9D/E,IAGIlB,aAAAA,UAAU,MAAM;QAChByB,MAAM;QACNP,YAAAA;QACAC,QAAAA;QACAC,UAAAA;IACJ,yBALIpB,WAFA0B,SAAUzB,6BAAAA,SAAS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GuF,IAAI;oBACAC,WAAW;gBACf;0BAEA,cAAA,MAAC7E;oBAAa8E,SAAS;;sCACnB,KAAChF;4BACG6B,MAAMY,cAAc9B,oBAAoBE;4BACxCmD,SAAQ;4BACRS,SAAS;gCACL,IAAIhC,aAAa;oCACbO,YAAY;gCAChB,OAAO;wCACH/B;qCAAAA,cAAAA,wBAAAA,kCAAAA,YAAae,mBAAmB;oCAChCC,oBAAoBD,mBAAmB;gCAC3C;4BACJ;sCAECS,cAAc9B,oBAAoBE;;sCAGvC,KAACb;4BACGiF,UAAU,CAACpC;4BACX4B,SAAS;gCACL,IAAI/B,YAAY;wCACZvB;wCAAAA;oCAAAA,CAAAA,cAAAA,YAAAA,sBAAAA,gCAAAA,yBAAAA,wBAAAA,aAAgB6B,YAAY;gCAChC,OAAO;wCACHhC;qCAAAA,UAAAA,oBAAAA,8BAAAA,QAASgB,mBAAmB,GAAGC;oCAE/B,IAAI,CAACP,uBAAuB;wCACxBO,oBAAoBD,mBAAmB;oCAC3C;gCACJ;4BACJ;sCAECU,aAAa5B,oBAAoBF;;;;;;;AAM1D,EAAE;AAEFF,YAAYwE,IAAI,GAAG/E"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/modal-wizard/ModalWizard.tsx"],"sourcesContent":["import {Box, CloseButton, createStyles, DefaultProps, Modal, ModalProps, Progress, Selectors} from '@mantine/core';\nimport {Children, ReactElement, useEffect, useMemo, useState} from 'react';\n\nimport {Button} from '../button';\nimport {Header} from '../header';\nimport {StickyFooter} from '../sticky-footer';\nimport {ModalWizardStep, ModalWizardStepProps, ResolveStep} from './ModalWizardStep';\n\nconst useStyles = createStyles(() => ({\n content: {\n display: 'flex',\n flexDirection: 'column',\n },\n body: {\n flex: 1,\n display: 'flex',\n flexDirection: 'column',\n },\n}));\n\ntype ModalWizardStylesNames = Selectors<typeof useStyles>;\n\nexport interface ModalWizardProps\n extends Omit<DefaultProps<ModalWizardStylesNames>, 'classNames' | 'styles'>,\n Omit<ModalProps, 'centered' | 'title'> {\n /**\n * The label of the cancel button\n *\n * @default \"Cancel\"\n */\n cancelButtonLabel?: string;\n\n /**\n * The label of the next button\n *\n * @default \"Next\"\n */\n nextButtonLabel?: string;\n\n /**\n * The label of the previous button\n *\n * @default \"Previous\"\n */\n previousButtonLabel?: string;\n\n /**\n * The label of the finish button\n *\n * @default \"Finish\"\n */\n finishButtonLabel?: string;\n\n /**\n * A callback function that is executed when the user clicks on the next button\n */\n onNext?: (newStep: number, setCurrentStep?: React.Dispatch<number>) => unknown;\n\n /**\n * A callback function that is executed when the user clicks on the previous button\n */\n onPrevious?: (newStep: number) => unknown;\n\n /**\n * A function that is executed when user completes all the steps.\n *\n * @param close A function that closes the modal when called.\n */\n onFinish?: () => unknown;\n\n /**\n * Determine if user interacted with any steps in the modal wizard\n */\n isDirty?: () => boolean;\n\n /**\n * A function to confirm close if the state is dirty before closing\n */\n handleDirtyState?: () => boolean;\n\n /**\n * Children to display in modal wizard\n * */\n children?: Array<ReturnType<typeof ModalWizardStep>>;\n\n /**\n * Indicates if step validation should be performed when clicking on to the next step\n * If true, the next step will always be enabled\n *\n * @default false\n */\n isStepValidatedOnNext?: boolean;\n}\n\ninterface ModalWizardType {\n (props: ModalWizardProps): ReactElement;\n\n Step: typeof ModalWizardStep;\n}\n\nexport const ModalWizard: ModalWizardType = ({\n cancelButtonLabel = 'Cancel',\n nextButtonLabel = 'Next',\n previousButtonLabel = 'Previous',\n finishButtonLabel = 'Finish',\n opened,\n onNext,\n onPrevious,\n onClose,\n onFinish,\n isDirty,\n handleDirtyState,\n classNames,\n styles,\n unstyled,\n children,\n isStepValidatedOnNext,\n ...modalProps\n}) => {\n const {\n classes: {content, body},\n cx,\n } = useStyles(null, {\n name: 'ModalWizard',\n classNames,\n styles,\n unstyled,\n });\n\n const [currentStepIndex, setCurrentStepIndex] = useState(0);\n const modalSteps = (Children.toArray(children) as ReactElement[]).filter((child) => child.type === ModalWizardStep);\n\n const numberOfSteps = modalSteps.length;\n const isFirstStep = currentStepIndex === 0;\n const isLastStep = currentStepIndex === numberOfSteps - 1;\n const currentStep = modalSteps.filter((step: ReactElement, index: number) => index === currentStepIndex)[0];\n\n const {isValid} = isStepValidatedOnNext\n ? {isValid: true}\n : currentStep?.props?.validateStep?.(currentStepIndex, numberOfSteps) ?? {isValid: true};\n\n useEffect(() => {\n if (opened) {\n setCurrentStepIndex(0);\n }\n }, [opened]);\n\n const handleClose = (confirmDirty: boolean) => {\n if (confirmDirty) {\n const isModalDirty = isDirty?.() ?? false;\n if (isModalDirty) {\n const discardChanges = handleDirtyState?.() ?? true;\n if (!discardChanges) {\n return;\n }\n }\n }\n onClose?.();\n };\n\n const resolveStepDependentProp = <P extends keyof ModalWizardStepProps>(\n prop: P,\n ): ResolveStep<ModalWizardStepProps[P]> =>\n typeof currentStep.props[prop] === 'function'\n ? currentStep.props[prop](currentStepIndex + 1, numberOfSteps)\n : currentStep.props[prop];\n\n const getProgress = useMemo(\n () => (currStepIndex: number) => {\n const totalNumberOfSteps = modalSteps.filter((step) => step.props.countsAsProgress).length;\n const numberOfCompletedSteps = modalSteps.filter(\n (step, index) => step.props.countsAsProgress && index <= currStepIndex,\n ).length;\n return (numberOfCompletedSteps / totalNumberOfSteps) * 100;\n },\n [],\n );\n\n return (\n <Modal\n opened={opened}\n classNames={{content: cx(content, classNames?.content), body: cx(body, classNames?.body)}}\n centered\n onClose={() => handleClose(true)}\n withCloseButton={false}\n padding={0}\n {...modalProps}\n >\n <Header\n p=\"lg\"\n pr=\"md\"\n variant=\"modal\"\n description={resolveStepDependentProp('description')}\n borderBottom={!currentStep.props.showProgressBar}\n >\n {resolveStepDependentProp('title')}\n {resolveStepDependentProp('docLink') ? (\n <Header.DocAnchor\n href={resolveStepDependentProp('docLink')}\n label={resolveStepDependentProp('docLinkTooltipLabel')}\n />\n ) : null}\n <Header.Actions>\n <CloseButton aria-label={'close-modal'} onClick={() => handleClose(true)} />\n </Header.Actions>\n </Header>\n {currentStep.props.showProgressBar && (\n <Progress color=\"navy.5\" size=\"sm\" radius={0} value={getProgress(currentStepIndex)} />\n )}\n <Box p=\"lg\">{currentStep}</Box>\n <Box\n sx={{\n marginTop: 'auto',\n }}\n >\n <StickyFooter borderTop>\n <Button\n name={isFirstStep ? cancelButtonLabel : previousButtonLabel}\n variant=\"outline\"\n onClick={() => {\n if (isFirstStep) {\n handleClose(true);\n } else {\n onPrevious?.(currentStepIndex - 1);\n setCurrentStepIndex(currentStepIndex - 1);\n }\n }}\n >\n {isFirstStep ? cancelButtonLabel : previousButtonLabel}\n </Button>\n\n <Button\n disabled={!isValid}\n onClick={() => {\n if (isLastStep) {\n onFinish?.() ?? handleClose(false);\n } else {\n onNext?.(currentStepIndex + 1, setCurrentStepIndex);\n\n if (!isStepValidatedOnNext) {\n setCurrentStepIndex(currentStepIndex + 1);\n }\n }\n }}\n >\n {isLastStep ? finishButtonLabel : nextButtonLabel}\n </Button>\n </StickyFooter>\n </Box>\n </Modal>\n );\n};\n\nModalWizard.Step = ModalWizardStep;\n"],"names":["Box","CloseButton","createStyles","Modal","Progress","Children","useEffect","useMemo","useState","Button","Header","StickyFooter","ModalWizardStep","useStyles","content","display","flexDirection","body","flex","ModalWizard","cancelButtonLabel","nextButtonLabel","previousButtonLabel","finishButtonLabel","opened","onNext","onPrevious","onClose","onFinish","isDirty","handleDirtyState","classNames","styles","unstyled","children","isStepValidatedOnNext","modalProps","currentStep","name","classes","cx","currentStepIndex","setCurrentStepIndex","modalSteps","toArray","filter","child","type","numberOfSteps","length","isFirstStep","isLastStep","step","index","isValid","props","validateStep","handleClose","confirmDirty","isModalDirty","discardChanges","resolveStepDependentProp","prop","getProgress","currStepIndex","totalNumberOfSteps","countsAsProgress","numberOfCompletedSteps","centered","withCloseButton","padding","p","pr","variant","description","borderBottom","showProgressBar","DocAnchor","href","label","Actions","aria-label","onClick","color","size","radius","value","sx","marginTop","borderTop","disabled","Step"],"mappings":";;;;;AAAA,SAAQA,GAAG,EAAEC,WAAW,EAAEC,YAA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CAChCC,oBAAoBD,mBAAmB;gCAC3C;4BACJ;sCAECS,cAAc9B,oBAAoBE;;sCAGvC,KAACb;4BACGiF,UAAU,CAACpC;4BACX4B,SAAS;gCACL,IAAI/B,YAAY;wCACZvB;wCAAAA;oCAAAA,CAAAA,cAAAA,YAAAA,sBAAAA,gCAAAA,yBAAAA,wBAAAA,aAAgB6B,YAAY;gCAChC,OAAO;wCACHhC;qCAAAA,UAAAA,oBAAAA,8BAAAA,QAASgB,mBAAmB,GAAGC;oCAE/B,IAAI,CAACP,uBAAuB;wCACxBO,oBAAoBD,mBAAmB;oCAC3C;gCACJ;4BACJ;sCAECU,aAAa5B,oBAAoBF;;;;;;;AAM1D,EAAE;AAEFF,YAAYwE,IAAI,GAAG/E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RowLayout.d.ts","sourceRoot":"","sources":["../../../../../src/components/table/layouts/RowLayout.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAC,WAAW,EAAmB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"RowLayout.d.ts","sourceRoot":"","sources":["../../../../../src/components/table/layouts/RowLayout.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAC,WAAW,EAAmB,MAAM,gBAAgB,CAAC;AAgM7D,eAAO,MAAM,SAAS,EAAE,WAKvB,CAAC"}
|
|
@@ -146,7 +146,8 @@ var RowLayoutBody = function(param) {
|
|
|
146
146
|
style: {
|
|
147
147
|
width: (_columnSizing_size = columnSizing.size) !== null && _columnSizing_size !== void 0 ? _columnSizing_size : "auto",
|
|
148
148
|
minWidth: columnSizing.minSize,
|
|
149
|
-
maxWidth: columnSizing.maxSize
|
|
149
|
+
maxWidth: columnSizing.maxSize,
|
|
150
|
+
overflowWrap: "break-word"
|
|
150
151
|
},
|
|
151
152
|
className: cx(classes.cell, _define_property({}, classes.rowCollapsibleButtonCell, cell.column.id === TableCollapsibleColumn.id)),
|
|
152
153
|
onClick: onCollapsibleCellClick,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/table/layouts/RowLayout.tsx"],"sourcesContent":["import {ListSize16Px} from '@coveord/plasma-react-icons';\nimport {Box, Collapse, createStyles, rem} from '@mantine/core';\nimport {flexRender} from '@tanstack/react-table';\nimport {defaultColumnSizing} from '@tanstack/table-core';\nimport {Fragment, type MouseEvent} from 'react';\nimport {TableLayout, TableLayoutProps} from '../Table.types';\nimport {TableCollapsibleColumn} from '../TableCollapsibleColumn';\nimport {useTable} from '../TableContext';\nimport {TableLoading} from '../TableLoading';\nimport {TableSelectableColumn} from '../TableSelectableColumn';\nimport {Th} from '../Th';\n\ninterface TableStylesParams {\n multiRowSelectionEnabled: boolean;\n disableRowSelection: boolean;\n}\n\nconst useStyles = createStyles<string, TableStylesParams>((theme, {multiRowSelectionEnabled, disableRowSelection}) => {\n const rowBackgroundColor =\n theme.colorScheme === 'dark' ? theme.fn.rgba(theme.colors[theme.primaryColor][7], 0.2) : theme.colors.gray[1];\n const border = `${rem(1)} solid ${theme.colorScheme === 'dark' ? theme.colors.dark[4] : theme.colors.gray[3]}`;\n return {\n headerColumns: {\n '& th:first-of-type > *': {\n paddingLeft: '40px',\n },\n\n '& input[type=checkbox]': {\n backgroundColor: disableRowSelection ? `${theme.colors.gray[2]}` : undefined,\n borderColor: disableRowSelection ? `${theme.colors.gray[3]}` : `${theme.colors.gray[4]}`,\n pointerEvents: disableRowSelection ? 'none' : 'auto',\n cursor: disableRowSelection ? 'not-allowed' : 'default',\n\n '& + svg': {\n color: disableRowSelection ? `${theme.colors.gray[5]}` : 'inherit',\n },\n },\n },\n\n rowSelected: {\n backgroundColor: multiRowSelectionEnabled ? undefined : rowBackgroundColor,\n },\n\n rowUnselectable: {\n '& input[type=checkbox]': {\n backgroundColor: `${theme.colors.gray[2]}`,\n borderColor: `${theme.colors.gray[3]}`,\n pointerEvents: 'none',\n cursor: 'not-allowed',\n\n '&:checked + svg': {\n color: `${theme.colors.gray[5]}`,\n },\n },\n },\n\n rowCollapsibleButtonCell: {\n textAlign: 'right',\n padding: `calc(${theme.spacing.xs}/2) ${theme.spacing.sm} !important`,\n },\n\n row: {\n '& td:first-of-type': {\n paddingLeft: '40px',\n },\n '&:hover': {\n backgroundColor: rowBackgroundColor,\n },\n },\n\n cell: {\n verticalAlign: 'middle',\n // We must use height instead of minHeight here, otherwise it doesn't apply\n height: '56px',\n padding: `${theme.spacing.xs} ${theme.spacing.sm}`,\n borderBottom: border,\n },\n\n collapsible: {\n backgroundColor: rowBackgroundColor,\n borderBottom: border,\n },\n };\n});\n\nconst RowLayoutHeader = <T,>({table}: TableLayoutProps<T>) => {\n const {multiRowSelectionEnabled, disableRowSelection} = useTable();\n const {classes} = useStyles({disableRowSelection, multiRowSelectionEnabled});\n const headers = table.getHeaderGroups().map((headerGroup) => (\n <tr key={headerGroup.id} className={classes.headerColumns}>\n {headerGroup.headers.map((columnHeader) => (\n <Th key={columnHeader.id} header={columnHeader} />\n ))}\n </tr>\n ));\n return <>{headers}</>;\n};\n\nconst RowLayoutBody = <T,>({\n table,\n doubleClickAction,\n getExpandChildren,\n loading,\n keepSelection,\n}: TableLayoutProps<T>) => {\n const {multiRowSelectionEnabled, disableRowSelection} = useTable();\n const {classes, cx} = useStyles({disableRowSelection, multiRowSelectionEnabled});\n\n const toggleCollapsible = (el: HTMLTableRowElement) => {\n const cell = el.children[el.children.length - 1] as HTMLTableCellElement;\n cell.querySelector('button').click();\n };\n\n const rows = table.getRowModel().rows.map((row) => {\n const rowChildren = getExpandChildren?.(row.original) ?? null;\n const isSelected = !!row.getIsSelected();\n const shouldKeepSelection = keepSelection && isSelected;\n const onClick = (event: MouseEvent<HTMLTableRowElement>) => {\n if (rowChildren) {\n toggleCollapsible(event.currentTarget);\n }\n if (!disableRowSelection && !multiRowSelectionEnabled && !shouldKeepSelection) {\n row.toggleSelected();\n }\n };\n\n return (\n <Fragment key={row.id}>\n <tr\n onClick={onClick}\n onDoubleClick={() => doubleClickAction?.(row.original)}\n className={cx(classes.row, {\n [classes.rowSelected]: isSelected,\n [classes.rowUnselectable]: disableRowSelection,\n })}\n aria-selected={isSelected}\n data-testid={row.id}\n >\n {row.getVisibleCells().map((cell) => {\n const columnSizing = {\n ...defaultColumnSizing,\n size: cell.column.columnDef.size,\n minSize: cell.column.columnDef.minSize,\n maxSize: cell.column.columnDef.maxSize,\n };\n\n const onCollapsibleCellClick = (event: MouseEvent<HTMLTableCellElement>) => {\n if (cell.column.id === TableSelectableColumn.id && !disableRowSelection) {\n event.stopPropagation();\n row.getToggleSelectedHandler();\n }\n };\n return (\n <td\n key={cell.id}\n data-testid={cell.id}\n style={{\n width: columnSizing.size ?? 'auto',\n minWidth: columnSizing.minSize,\n maxWidth: columnSizing.maxSize,\n }}\n className={cx(classes.cell, {\n [classes.rowCollapsibleButtonCell]: cell.column.id === TableCollapsibleColumn.id,\n })}\n onClick={onCollapsibleCellClick}\n >\n <TableLoading visible={loading}>\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n </TableLoading>\n </td>\n );\n })}\n </tr>\n {rowChildren ? (\n <tr>\n <td\n colSpan={table.getAllColumns().length}\n style={{\n padding: 0,\n }}\n >\n <Collapse in={row.getIsExpanded()}>\n <Box className={classes.collapsible} px=\"sm\" py=\"xs\">\n {rowChildren}\n </Box>\n </Collapse>\n </td>\n </tr>\n ) : null}\n </Fragment>\n );\n });\n\n return <>{rows}</>;\n};\n\nexport const RowLayout: TableLayout = {\n name: 'Rows',\n icon: ListSize16Px,\n Header: RowLayoutHeader,\n Body: RowLayoutBody,\n};\n"],"names":["ListSize16Px","Box","Collapse","createStyles","rem","flexRender","defaultColumnSizing","Fragment","TableCollapsibleColumn","useTable","TableLoading","TableSelectableColumn","Th","useStyles","theme","multiRowSelectionEnabled","disableRowSelection","rowBackgroundColor","colorScheme","fn","rgba","colors","primaryColor","gray","border","dark","headerColumns","paddingLeft","backgroundColor","undefined","borderColor","pointerEvents","cursor","color","rowSelected","rowUnselectable","rowCollapsibleButtonCell","textAlign","padding","spacing","xs","sm","row","cell","verticalAlign","height","borderBottom","collapsible","RowLayoutHeader","table","classes","headers","getHeaderGroups","map","headerGroup","tr","className","columnHeader","header","id","RowLayoutBody","doubleClickAction","getExpandChildren","loading","keepSelection","cx","toggleCollapsible","el","children","length","querySelector","click","rows","getRowModel","rowChildren","original","isSelected","getIsSelected","shouldKeepSelection","onClick","event","currentTarget","toggleSelected","onDoubleClick","aria-selected","data-testid","getVisibleCells","columnSizing","size","column","columnDef","minSize","maxSize","onCollapsibleCellClick","stopPropagation","getToggleSelectedHandler","td","style","width","minWidth","maxWidth","visible","getContext","colSpan","getAllColumns","in","getIsExpanded","px","py","RowLayout","name","icon","Header","Body"],"mappings":";;;;AAAA,SAAQA,YAAY,QAAO,8BAA8B;AACzD,SAAQC,GAAG,EAAEC,QAAQ,EAAEC,YAAY,EAAEC,GAAG,QAAO,gBAAgB;AAC/D,SAAQC,UAAU,QAAO,wBAAwB;AACjD,SAAQC,mBAAmB,QAAO,uBAAuB;AACzD,SAAQC,QAAQ,QAAwB,QAAQ;AAEhD,SAAQC,sBAAsB,QAAO,4BAA4B;AACjE,SAAQC,QAAQ,QAAO,kBAAkB;AACzC,SAAQC,YAAY,QAAO,kBAAkB;AAC7C,SAAQC,qBAAqB,QAAO,2BAA2B;AAC/D,SAAQC,EAAE,QAAO,QAAQ;AAOzB,IAAMC,YAAYV,aAAwC,SAACW;QAAQC,iCAAAA,0BAA0BC,4BAAAA;IACzF,IAAMC,qBACFH,MAAMI,WAAW,KAAK,SAASJ,MAAMK,EAAE,CAACC,IAAI,CAACN,MAAMO,MAAM,CAACP,MAAMQ,YAAY,CAAC,CAAC,EAAE,EAAE,OAAOR,MAAMO,MAAM,CAACE,IAAI,CAAC,EAAE;IACjH,IAAMC,SAAS,AAAC,GAAkBV,OAAhBV,IAAI,IAAG,WAAoF,OAA3EU,MAAMI,WAAW,KAAK,SAASJ,MAAMO,MAAM,CAACI,IAAI,CAAC,EAAE,GA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AAO;gCAC9BS,UAAUb,aAAaK,OAAO;4BAClC;4BACApC,WAAWS,GAAGf,QAAQP,IAAI,EACtB,qBAACO,QAAQd,wBAAwB,EAAGO,KAAK8C,MAAM,CAAC9B,EAAE,KAAKnD,uBAAuBmD,EAAE;4BAEpFoB,SAASc;sCAET,cAAA,KAACnF;gCAAa2F,SAAStC;0CAClB1D,WAAWsC,KAAK8C,MAAM,CAACC,SAAS,CAAC/C,IAAI,EAAEA,KAAK2D,UAAU;;2BAbtD3D,KAAKgB,EAAE;oBAiBxB;;gBAEHe,4BACG,KAACnB;8BACG,cAAA,KAACyC;wBACGO,SAAStD,MAAMuD,aAAa,GAAGnC,MAAM;wBACrC4B,OAAO;4BACH3D,SAAS;wBACb;kCAEA,cAAA,KAACpC;4BAASuG,IAAI/D,IAAIgE,aAAa;sCAC3B,cAAA,KAACzG;gCAAIuD,WAAWN,QAAQH,WAAW;gCAAE4D,IAAG;gCAAKC,IAAG;0CAC3ClC;;;;qBAKjB;;WA7DOhC,IAAIiB,EAAE;IAgE7B;IAEA,qBAAO;kBAAGa;;AACd;AAEA,OAAO,IAAMqC,YAAyB;IAClCC,MAAM;IACNC,MAAM/G;IACNgH,QAAQhE;IACRiE,MAAMrD;AACV,EAAE"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/table/layouts/RowLayout.tsx"],"sourcesContent":["import {ListSize16Px} from '@coveord/plasma-react-icons';\nimport {Box, Collapse, createStyles, rem} from '@mantine/core';\nimport {flexRender} from '@tanstack/react-table';\nimport {defaultColumnSizing} from '@tanstack/table-core';\nimport {Fragment, type MouseEvent} from 'react';\nimport {TableLayout, TableLayoutProps} from '../Table.types';\nimport {TableCollapsibleColumn} from '../TableCollapsibleColumn';\nimport {useTable} from '../TableContext';\nimport {TableLoading} from '../TableLoading';\nimport {TableSelectableColumn} from '../TableSelectableColumn';\nimport {Th} from '../Th';\n\ninterface TableStylesParams {\n multiRowSelectionEnabled: boolean;\n disableRowSelection: boolean;\n}\n\nconst useStyles = createStyles<string, TableStylesParams>((theme, {multiRowSelectionEnabled, disableRowSelection}) => {\n const rowBackgroundColor =\n theme.colorScheme === 'dark' ? theme.fn.rgba(theme.colors[theme.primaryColor][7], 0.2) : theme.colors.gray[1];\n const border = `${rem(1)} solid ${theme.colorScheme === 'dark' ? theme.colors.dark[4] : theme.colors.gray[3]}`;\n return {\n headerColumns: {\n '& th:first-of-type > *': {\n paddingLeft: '40px',\n },\n\n '& input[type=checkbox]': {\n backgroundColor: disableRowSelection ? `${theme.colors.gray[2]}` : undefined,\n borderColor: disableRowSelection ? `${theme.colors.gray[3]}` : `${theme.colors.gray[4]}`,\n pointerEvents: disableRowSelection ? 'none' : 'auto',\n cursor: disableRowSelection ? 'not-allowed' : 'default',\n\n '& + svg': {\n color: disableRowSelection ? `${theme.colors.gray[5]}` : 'inherit',\n },\n },\n },\n\n rowSelected: {\n backgroundColor: multiRowSelectionEnabled ? undefined : rowBackgroundColor,\n },\n\n rowUnselectable: {\n '& input[type=checkbox]': {\n backgroundColor: `${theme.colors.gray[2]}`,\n borderColor: `${theme.colors.gray[3]}`,\n pointerEvents: 'none',\n cursor: 'not-allowed',\n\n '&:checked + svg': {\n color: `${theme.colors.gray[5]}`,\n },\n },\n },\n\n rowCollapsibleButtonCell: {\n textAlign: 'right',\n padding: `calc(${theme.spacing.xs}/2) ${theme.spacing.sm} !important`,\n },\n\n row: {\n '& td:first-of-type': {\n paddingLeft: '40px',\n },\n '&:hover': {\n backgroundColor: rowBackgroundColor,\n },\n },\n\n cell: {\n verticalAlign: 'middle',\n // We must use height instead of minHeight here, otherwise it doesn't apply\n height: '56px',\n padding: `${theme.spacing.xs} ${theme.spacing.sm}`,\n borderBottom: border,\n },\n\n collapsible: {\n backgroundColor: rowBackgroundColor,\n borderBottom: border,\n },\n };\n});\n\nconst RowLayoutHeader = <T,>({table}: TableLayoutProps<T>) => {\n const {multiRowSelectionEnabled, disableRowSelection} = useTable();\n const {classes} = useStyles({disableRowSelection, multiRowSelectionEnabled});\n const headers = table.getHeaderGroups().map((headerGroup) => (\n <tr key={headerGroup.id} className={classes.headerColumns}>\n {headerGroup.headers.map((columnHeader) => (\n <Th key={columnHeader.id} header={columnHeader} />\n ))}\n </tr>\n ));\n return <>{headers}</>;\n};\n\nconst RowLayoutBody = <T,>({\n table,\n doubleClickAction,\n getExpandChildren,\n loading,\n keepSelection,\n}: TableLayoutProps<T>) => {\n const {multiRowSelectionEnabled, disableRowSelection} = useTable();\n const {classes, cx} = useStyles({disableRowSelection, multiRowSelectionEnabled});\n\n const toggleCollapsible = (el: HTMLTableRowElement) => {\n const cell = el.children[el.children.length - 1] as HTMLTableCellElement;\n cell.querySelector('button').click();\n };\n\n const rows = table.getRowModel().rows.map((row) => {\n const rowChildren = getExpandChildren?.(row.original) ?? null;\n const isSelected = !!row.getIsSelected();\n const shouldKeepSelection = keepSelection && isSelected;\n const onClick = (event: MouseEvent<HTMLTableRowElement>) => {\n if (rowChildren) {\n toggleCollapsible(event.currentTarget);\n }\n if (!disableRowSelection && !multiRowSelectionEnabled && !shouldKeepSelection) {\n row.toggleSelected();\n }\n };\n\n return (\n <Fragment key={row.id}>\n <tr\n onClick={onClick}\n onDoubleClick={() => doubleClickAction?.(row.original)}\n className={cx(classes.row, {\n [classes.rowSelected]: isSelected,\n [classes.rowUnselectable]: disableRowSelection,\n })}\n aria-selected={isSelected}\n data-testid={row.id}\n >\n {row.getVisibleCells().map((cell) => {\n const columnSizing = {\n ...defaultColumnSizing,\n size: cell.column.columnDef.size,\n minSize: cell.column.columnDef.minSize,\n maxSize: cell.column.columnDef.maxSize,\n };\n\n const onCollapsibleCellClick = (event: MouseEvent<HTMLTableCellElement>) => {\n if (cell.column.id === TableSelectableColumn.id && !disableRowSelection) {\n event.stopPropagation();\n row.getToggleSelectedHandler();\n }\n };\n return (\n <td\n key={cell.id}\n data-testid={cell.id}\n style={{\n width: columnSizing.size ?? 'auto',\n minWidth: columnSizing.minSize,\n maxWidth: columnSizing.maxSize,\n overflowWrap: 'break-word',\n }}\n className={cx(classes.cell, {\n [classes.rowCollapsibleButtonCell]: cell.column.id === TableCollapsibleColumn.id,\n })}\n onClick={onCollapsibleCellClick}\n >\n <TableLoading visible={loading}>\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n </TableLoading>\n </td>\n );\n })}\n </tr>\n {rowChildren ? (\n <tr>\n <td\n colSpan={table.getAllColumns().length}\n style={{\n padding: 0,\n }}\n >\n <Collapse in={row.getIsExpanded()}>\n <Box className={classes.collapsible} px=\"sm\" py=\"xs\">\n {rowChildren}\n </Box>\n </Collapse>\n </td>\n </tr>\n ) : null}\n </Fragment>\n );\n });\n\n return <>{rows}</>;\n};\n\nexport const RowLayout: TableLayout = {\n name: 'Rows',\n icon: ListSize16Px,\n Header: RowLayoutHeader,\n Body: RowLayoutBody,\n};\n"],"names":["ListSize16Px","Box","Collapse","createStyles","rem","flexRender","defaultColumnSizing","Fragment","TableCollapsibleColumn","useTable","TableLoading","TableSelectableColumn","Th","useStyles","theme","multiRowSelectionEnabled","disableRowSelection","rowBackgroundColor","colorScheme","fn","rgba","colors","primaryColor","gray","border","dark","headerColumns","paddingLeft","backgroundColor","undefined","borderColor","pointerEvents","cursor","color","rowSelected","rowUnselectable","rowCollapsibleButtonCell","textAlign","padding","spacing","xs","sm","row","cell","verticalAlign","height","borderBottom","collapsible","RowLayoutHeader","table","classes","headers","getHeaderGroups","map","headerGroup","tr","className","columnHeader","header","id","RowLayoutBody","doubleClickAction","getExpandChildren","loading","keepSelection","cx","toggleCollapsible","el","children","length","querySelector","click","rows","getRowModel","rowChildren","original","isSelected","getIsSelected","shouldKeepSelection","onClick","event","currentTarget","toggleSelected","onDoubleClick","aria-selected","data-testid","getVisibleCells","columnSizing","size","column","columnDef","minSize","maxSize","onCollapsibleCellClick","stopPropagation","getToggleSelectedHandler","td","style","width","minWidth","maxWidth","overflowWrap","visible","getContext","colSpan","getAllColumns","in","getIsExpanded","px","py","RowLayout","name","icon","Header","Body"],"mappings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OAAO;4BACH3D,SAAS;wBACb;kCAEA,cAAA,KAACpC;4BAASwG,IAAIhE,IAAIiE,aAAa;sCAC3B,cAAA,KAAC1G;gCAAIuD,WAAWN,QAAQH,WAAW;gCAAE6D,IAAG;gCAAKC,IAAG;0CAC3CnC;;;;qBAKjB;;WA9DOhC,IAAIiB,EAAE;IAiE7B;IAEA,qBAAO;kBAAGa;;AACd;AAEA,OAAO,IAAMsC,YAAyB;IAClCC,MAAM;IACNC,MAAMhH;IACNiH,QAAQjE;IACRkE,MAAMtD;AACV,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/table/useRowSelection.ts"],"sourcesContent":["import {useClickOutside, useDidUpdate} from '@mantine/hooks';\nimport {functionalUpdate, RowSelectionState, Table} from '@tanstack/table-core';\nimport isEqual from 'fast-deep-equal';\n\nimport {useRef} from 'react';\nimport {RowSelectionWithData, TableProps, TableState} from './Table.types';\n\nexport const useRowSelection = <T>(\n table: Table<T>,\n {\n onRowSelectionChange,\n multiRowSelectionEnabled,\n additionalRootNodes = [],\n }: Pick<TableProps<T>, 'onRowSelectionChange' | 'multiRowSelectionEnabled' | 'additionalRootNodes'
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/table/useRowSelection.ts"],"sourcesContent":["import {useClickOutside, useDidUpdate} from '@mantine/hooks';\nimport {functionalUpdate, RowSelectionState, Table} from '@tanstack/table-core';\nimport isEqual from 'fast-deep-equal';\n\nimport {useRef} from 'react';\nimport {RowSelectionWithData, TableProps, TableState} from './Table.types';\n\nexport const useRowSelection = <T>(\n table: Table<T>,\n {\n onRowSelectionChange,\n multiRowSelectionEnabled,\n additionalRootNodes = [],\n }: Pick<TableProps<T>, 'onRowSelectionChange' | 'multiRowSelectionEnabled' | 'additionalRootNodes'>,\n) => {\n const outsideClickRef = useRef<HTMLDivElement>();\n useClickOutside(\n () => {\n if (!multiRowSelectionEnabled) {\n clearSelection();\n }\n },\n null,\n [outsideClickRef.current, ...additionalRootNodes],\n );\n\n // Need to call this outside of the onRowSelectionChange of the table to avoid rendering conflicts if the callback queues an update in a parent component.\n // See this warning introduced in React v.16.13.0: https://legacy.reactjs.org/blog/2020/02/26/react-v16.13.0.html#warnings-for-some-updates-during-render\n useDidUpdate(() => {\n onRowSelectionChange?.(getSelectedRows());\n }, [table.getState().rowSelection]);\n\n table.setOptions((prev) => ({\n ...prev,\n onRowSelectionChange: (rowSelectionUpdater) => {\n table.setState((old) => {\n const newRowSelection = functionalUpdate(\n rowSelectionUpdater,\n old['rowSelection'],\n ) as RowSelectionWithData<T>;\n\n if (isEqual(old['rowSelection'], newRowSelection)) {\n return old;\n }\n\n const rows = table.getRowModel().rowsById;\n\n Object.keys(newRowSelection).forEach((rowId) => {\n if (newRowSelection[rowId] === true) {\n if (!rows[rowId]) {\n console.error(\n 'The table was not initialized properly, the rowSelection state should contain an object of type Record<string, TData>.',\n );\n }\n newRowSelection[rowId] = rows[rowId]?.original ?? (true as T);\n }\n });\n\n return {\n ...old,\n rowSelection: newRowSelection as RowSelectionState,\n };\n });\n },\n }));\n\n const clearSelection = () => {\n table.resetRowSelection(true);\n };\n\n const getSelectedRows = () => Object.values((table.getState() as TableState<T>).rowSelection);\n\n const getSelectedRow = () => getSelectedRows()[0] ?? null;\n\n return {clearSelection, getSelectedRow, getSelectedRows, outsideClickRef};\n};\n"],"names":["useClickOutside","useDidUpdate","functionalUpdate","isEqual","useRef","useRowSelection","table","onRowSelectionChange","multiRowSelectionEnabled","additionalRootNodes","outsideClickRef","clearSelection","current","getSelectedRows","getState","rowSelection","setOptions","prev","rowSelectionUpdater","setState","old","newRowSelection","rows","getRowModel","rowsById","Object","keys","forEach","rowId","console","error","original","resetRowSelection","values","getSelectedRow"],"mappings":";;;AAAA,SAAQA,eAAe,EAAEC,YAAY,QAAO,iBAAiB;AAC7D,SAAQC,gBAAgB,QAAiC,uBAAuB;AAChF,OAAOC,aAAa,kBAAkB;AAEtC,SAAQC,MAAM,QAAO,QAAQ;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/DF;IAA7B,IAAMqB,iBAAiB;eAAMrB,CAAAA,oBAAAA,iBAAiB,CAAC,EAAE,cAApBA,+BAAAA,oBAAwB;;IAErD,OAAO;QAACF,gBAAAA;QAAgBuB,gBAAAA;QAAgBrB,iBAAAA;QAAiBH,iBAAAA;IAAe;AAC5E,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/form/FormProvider.tsx"],"sourcesContent":["/* eslint-disable prefer-arrow/prefer-arrow-functions */\nimport {_TransformValues, UseForm, UseFormReturnType} from '@mantine/form/lib/types';\nimport React, {createContext, useContext} from 'react';\n\nimport {useForm} from './useForm';\n\nexport interface FormProviderProps<Form> {\n form: Form;\n children: React.ReactNode;\n}\n\nexport function createFormContext<\n Values,\n TransformValues extends _TransformValues<Values> = (values: Values) => Values
|
|
1
|
+
{"version":3,"sources":["../../../src/form/FormProvider.tsx"],"sourcesContent":["/* eslint-disable prefer-arrow/prefer-arrow-functions */\nimport {_TransformValues, UseForm, UseFormReturnType} from '@mantine/form/lib/types';\nimport React, {createContext, useContext} from 'react';\n\nimport {useForm} from './useForm';\n\nexport interface FormProviderProps<Form> {\n form: Form;\n children: React.ReactNode;\n}\n\nexport function createFormContext<\n Values,\n TransformValues extends _TransformValues<Values> = (values: Values) => Values,\n>() {\n type Form = UseFormReturnType<Values, TransformValues>;\n\n const FormContext = createContext<Form>(null);\n\n function FormProvider({form, children}: FormProviderProps<Form>) {\n return <FormContext.Provider value={form}>{children}</FormContext.Provider>;\n }\n\n function useFormContext() {\n const ctx = useContext(FormContext);\n if (!ctx) {\n throw new Error('useFormContext was called outside of FormProvider context');\n }\n\n return ctx;\n }\n\n return [FormProvider, useFormContext, useForm] as [\n React.FC<FormProviderProps<Form>>,\n () => Form,\n UseForm<Values, TransformValues>,\n ];\n}\n"],"names":["React","createContext","useContext","useForm","createFormContext","FormProvider","form","children","FormContext","Provider","value","useFormContext","ctx","Error"],"mappings":"AAAA,sDAAsD;AAEtD,OAAOA,SAAQC,aAAa,EAAEC,UAAU,QAAO,QAAQ;AAEvD,SAAQC,OAAO,QAAO,YAAY;AAOlC,OAAO,SAASC;QAQHC,eAAT,SAASA,aAAa,KAAyC;YAAxCC,OAAD,MAACA,MAAMC,WAAP,MAAOA;QACzB,qBAAO,KAACC,YAAYC,QAAQ;YAACC,OAAOJ;sBAAOC;;IAC/C;QAESI,iBAAT,SAASA;QACL,IAAMC,MAAMV,WAAWM;QACvB,IAAI,CAACI,KAAK;YACN,MAAM,IAAIC,MAAM;QACpB;QAEA,OAAOD;IACX;IAbA,IAAMJ,4BAAcP,cAAoB;IAexC,OAAO;QAACI;QAAcM;QAAgBR;KAAQ;AAKlD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/form/useForm.ts"],"sourcesContent":["import {useForm as useMantineForm} from '@mantine/form';\nimport {GetInputProps} from '@mantine/form/lib/types';\n\nexport const useForm: typeof useMantineForm = (options) => {\n const form = useMantineForm(options);\n\n const getInputProps: GetInputProps<Record<string, unknown>> = (\n path,\n {type = 'input', withError = type === 'input', withFocus = true} = {}
|
|
1
|
+
{"version":3,"sources":["../../../src/form/useForm.ts"],"sourcesContent":["import {useForm as useMantineForm} from '@mantine/form';\nimport {GetInputProps} from '@mantine/form/lib/types';\n\nexport const useForm: typeof useMantineForm = (options) => {\n const form = useMantineForm(options);\n\n const getInputProps: GetInputProps<Record<string, unknown>> = (\n path,\n {type = 'input', withError = type === 'input', withFocus = true} = {},\n ) => {\n const originalPayload = form.getInputProps(path, {type, withError, withFocus});\n if (Array.isArray(originalPayload.value)) {\n return {\n ...originalPayload,\n onReorderItem: (payload: Record<'from' | 'to', number>) => form.reorderListItem(path, payload),\n onRemoveItem: (index: number) => form.removeListItem(path, index),\n onInsertItem: (valueToInsert: unknown, index: number) =>\n form.insertListItem(path, valueToInsert, index),\n };\n }\n\n return originalPayload;\n };\n\n return {...form, getInputProps};\n};\n"],"names":["useForm","useMantineForm","options","form","getInputProps","path","type","withError","withFocus","originalPayload","Array","isArray","value","onReorderItem","payload","reorderListItem","onRemoveItem","index","removeListItem","onInsertItem","valueToInsert","insertListItem"],"mappings":";;AAAA,SAAQA,WAAWC,cAAc,QAAO,gBAAgB;AAGxD,OAAO,IAAMD,UAAiC,SAACE;IAC3C,IAAMC,OAAOF,eAAeC;IAE5B,IAAME,gBAAwD,SAC1DC;oFACmE,CAAC,oBAAnEC,MAAAA,8BAAO,2CAASC,WAAAA,wCAAYD,SAAS,gDAASE,WAAAA,wCAAY;QAE3D,IAAMC,kBAAkBN,KAAKC,aAAa,CAACC,MAAM;YAACC,MAAAA;YAAMC,WAAAA;YAAWC,WAAAA;QAAS;QAC5E,IAAIE,MAAMC,OAAO,CAACF,gBAAgBG,KAAK,GAAG;YACtC,OAAO,wCACAH;gBACHI,eAAe,SAACC;2BAA2CX,KAAKY,eAAe,CAACV,MAAMS;;gBACtFE,cAAc,SAACC;2BAAkBd,KAAKe,cAAc,CAACb,MAAMY;;gBAC3DE,cAAc,SAACC,eAAwBH;2BACnCd,KAAKkB,cAAc,CAAChB,MAAMe,eAAeH;;;QAErD;QAEA,OAAOR;IACX;IAEA,OAAO,wCAAIN;QAAMC,eAAAA;;AACrB,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Theme.d.ts","sourceRoot":"","sources":["../../../src/theme/Theme.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGH,KAAK,oBAAoB,
|
|
1
|
+
{"version":3,"file":"Theme.d.ts","sourceRoot":"","sources":["../../../src/theme/Theme.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGH,KAAK,oBAAoB,EAK5B,MAAM,eAAe,CAAC;AAIvB,eAAO,MAAM,WAAW,EAAE,oBA4XzB,CAAC"}
|
package/dist/esm/theme/Theme.js
CHANGED
|
@@ -4,7 +4,7 @@ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
5
|
import { CheckSize16Px, InfoSize24Px } from "@coveord/plasma-react-icons";
|
|
6
6
|
import { color } from "@coveord/plasma-tokens";
|
|
7
|
-
import { getSize, rem } from "@mantine/core";
|
|
7
|
+
import { getSize, rem, getStylesRef } from "@mantine/core";
|
|
8
8
|
import { PlasmaColors } from "./PlasmaColors";
|
|
9
9
|
export var plasmaTheme = {
|
|
10
10
|
// These are overrides over https://github.com/mantinedev/mantine/blob/master/src/mantine-styles/src/theme/default-theme.ts
|
|
@@ -177,14 +177,16 @@ export var plasmaTheme = {
|
|
|
177
177
|
description: {
|
|
178
178
|
fontSize: theme.fontSizes.sm,
|
|
179
179
|
color: theme.colors.gray[7],
|
|
180
|
-
marginBottom: theme.spacing.xs
|
|
180
|
+
marginBottom: theme.spacing.xs,
|
|
181
|
+
lineHeight: theme.lineHeight
|
|
181
182
|
},
|
|
182
183
|
invalid: {
|
|
183
184
|
color: theme.colors.red[9],
|
|
184
185
|
borderColor: theme.colors.red[6]
|
|
185
186
|
},
|
|
186
187
|
error: {
|
|
187
|
-
color: theme.colors.red[9]
|
|
188
|
+
color: theme.colors.red[9],
|
|
189
|
+
lineHeight: theme.lineHeight
|
|
188
190
|
}
|
|
189
191
|
};
|
|
190
192
|
}
|
|
@@ -434,6 +436,23 @@ export var plasmaTheme = {
|
|
|
434
436
|
}
|
|
435
437
|
};
|
|
436
438
|
}
|
|
439
|
+
},
|
|
440
|
+
NavLink: {
|
|
441
|
+
styles: function(theme) {
|
|
442
|
+
return {
|
|
443
|
+
root: {
|
|
444
|
+
color: theme.colors.gray[6],
|
|
445
|
+
borderRadius: "".concat(theme.defaultRadius, "px 0px 0px ").concat(theme.defaultRadius, "px")
|
|
446
|
+
},
|
|
447
|
+
label: {
|
|
448
|
+
ref: getStylesRef("label"),
|
|
449
|
+
fontWeight: 500
|
|
450
|
+
},
|
|
451
|
+
children: _define_property({}, ".".concat(getStylesRef("label")), {
|
|
452
|
+
fontWeight: 300
|
|
453
|
+
})
|
|
454
|
+
};
|
|
455
|
+
}
|
|
437
456
|
}
|
|
438
457
|
}
|
|
439
458
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/theme/Theme.tsx"],"sourcesContent":["import {CheckSize16Px, InfoSize24Px} from '@coveord/plasma-react-icons';\nimport {color} from '@coveord/plasma-tokens';\nimport {\n getSize,\n rem,\n type MantineThemeOverride,\n type NotificationProps,\n type StepperStylesParams,\n type TabsStylesParams,\n} from '@mantine/core';\n\nimport {PlasmaColors} from './PlasmaColors';\n\nexport const plasmaTheme: MantineThemeOverride = {\n // These are overrides over https://github.com/mantinedev/mantine/blob/master/src/mantine-styles/src/theme/default-theme.ts\n colorScheme: 'light',\n fontFamily: 'canada-type-gibson, sans-serif',\n black: color.primary.gray[9],\n defaultRadius: 8,\n lineHeight: 1.5,\n spacing: {\n xs: '8px',\n sm: '16px',\n md: '24px',\n lg: '32px',\n xl: '40px',\n },\n primaryColor: 'action',\n headings: {\n fontFamily: 'canada-type-gibson, sans-serif',\n fontWeight: 500,\n sizes: {\n h1: {fontSize: '48px', lineHeight: undefined, fontWeight: 300},\n h2: {fontSize: '32px', lineHeight: undefined, fontWeight: 500},\n h3: {fontSize: '24px', lineHeight: undefined, fontWeight: 500},\n h4: {fontSize: '18px', lineHeight: undefined, fontWeight: 300},\n h5: {fontSize: '14px', lineHeight: undefined, fontWeight: 500},\n h6: {fontSize: '12px', lineHeight: undefined, fontWeight: 500},\n },\n },\n shadows: {\n xs: '0px 1px 0px rgba(4, 8, 31, 0.08)',\n sm: '0px 2px 4px rgba(4, 8, 31, 0.12)',\n md: '0px 4px 8px rgba(4, 8, 31, 0.08)',\n lg: '0px 8px 16px rgba(7, 12, 41, 0.06)',\n xl: '0px 16px 24px rgba(4, 8, 31, 0.06)',\n },\n colors: PlasmaColors,\n components: {\n Alert: {\n defaultProps: {\n icon: <InfoSize24Px height={24} />,\n color: 'navy',\n },\n styles: {\n title: {\n fontWeight: 500,\n },\n },\n },\n Title: {\n styles: {\n root: {\n '&:is(h1,h2,h3,h4,h5,h6)': {letterSpacing: '0.011em'},\n },\n },\n },\n Text: {\n defaultProps: {\n weight: 300,\n },\n styles: (theme, {}, {size}) => ({\n root: {\n fontSize: getSize({size: size ?? 'sm', sizes: theme.fontSizes}),\n },\n }),\n },\n Button: {\n styles: () => ({\n root: {\n fontWeight: 400,\n },\n }),\n variants: {\n outline: () => ({\n root: {\n backgroundColor: 'white',\n },\n }),\n },\n },\n Modal: {\n styles: (theme, {fullScreen, padding}, {size, variant}) => ({\n content: {\n flex: fullScreen\n ? '0 0 100%'\n : `0 0 ${getSize({\n size,\n sizes: {\n xs: rem(432),\n sm: rem(664),\n md: rem(896),\n lg: rem(1120),\n xl: rem('88%'),\n },\n })}`,\n overflow: 'auto',\n },\n title: {\n width: '100%',\n fontSize: theme.headings.sizes.h3.fontSize,\n lineHeight: theme.headings.sizes.h3.lineHeight,\n fontWeight: 500,\n },\n header: {\n borderBottom: variant !== 'prompt' ? `1px solid ${color.primary.gray[3]}` : null,\n },\n body: {\n '&:not(:only-child)': {\n paddingTop: variant === 'prompt' ? 0 : getSize({size: padding, sizes: plasmaTheme.spacing}),\n },\n },\n }),\n },\n ModalOverlay: {\n defaultProps: {\n color: color.primary.navy[9],\n opacity: 0.9,\n },\n },\n InputWrapper: {\n defaultProps: {\n withAsterisk: false,\n },\n styles: (theme) => ({\n label: {\n marginBottom: theme.spacing.xs,\n },\n description: {\n fontSize: theme.fontSizes.sm,\n color: theme.colors.gray[7],\n marginBottom: theme.spacing.xs,\n },\n invalid: {\n color: theme.colors.red[9],\n borderColor: theme.colors.red[6],\n },\n error: {\n color: theme.colors.red[9],\n },\n }),\n },\n TextInput: {\n defaultProps: {\n radius: 8,\n },\n },\n Tooltip: {\n defaultProps: {\n color: 'navy',\n withArrow: true,\n withinPortal: true,\n multiline: true,\n zIndex: 10000,\n },\n },\n Loader: {\n defaultProps: {\n variant: 'dots',\n color: 'action',\n },\n },\n DateRangePicker: {\n styles: {\n cell: {\n textAlign: 'center',\n },\n },\n },\n Anchor: {\n defaultProps: {\n color: 'action.6',\n },\n styles: (theme) => ({\n root: {\n ...theme.fn.hover({\n textDecoration: 'underline',\n color: theme.colors.action[8],\n }),\n },\n }),\n },\n Checkbox: {\n defaultProps: {\n radius: 'sm',\n },\n styles: (theme) => ({\n label: {\n fontSize: theme.fontSizes.sm,\n fontWeight: 300,\n },\n }),\n },\n List: {\n styles: () => ({\n root: {\n listStyleType: 'disc',\n },\n }),\n },\n Radio: {\n styles: {\n labelWrapper: {\n display: 'flex',\n alignItems: 'flex-start',\n },\n },\n },\n Popover: {\n defaultProps: {\n shadow: 'md',\n withArrow: true,\n },\n },\n Badge: {\n styles: {\n root: {\n textTransform: 'none',\n padding: '4px 8px',\n fontWeight: 500,\n },\n },\n },\n ColorSwatch: {\n defaultProps: {\n size: 8,\n withShadow: false,\n },\n },\n MenuItem: {\n defaultProps: {\n fw: 300,\n },\n },\n Notification: {\n styles: (theme, {color: notificationType}: NotificationProps) => ({\n root: {\n borderColor: theme.colors.gray[3],\n backgroundColor: theme.colors.gray[0],\n boxShadow: theme.shadows.lg,\n padding: theme.spacing.sm,\n '&[data-with-icon]': {\n paddingLeft: theme.spacing.sm,\n },\n },\n icon: {\n backgroundColor: 'transparent',\n marginRight: theme.spacing.sm,\n color: theme.colors?.[notificationType][6],\n },\n closeButton: {\n margin: theme.spacing.xs,\n color: theme.colors.gray[5],\n },\n }),\n defaultProps: {\n icon: <InfoSize24Px height={24} />,\n color: 'info',\n },\n },\n Skeleton: {\n styles: {\n visible: {\n '&::before': {zIndex: 'unset'},\n '&::after': {zIndex: 'unset'},\n },\n },\n },\n SegmentedControl: {\n styles: (theme) => ({\n root: {\n backgroundColor: theme.colors.gray[2],\n },\n }),\n },\n Stepper: {\n defaultProps: {\n size: 'xs',\n completedIcon: <CheckSize16Px />,\n },\n styles: (theme, {}: StepperStylesParams, {size}) => ({\n step: {\n '&[disabled]': {\n color: theme.colors.gray[5],\n '& .mantine-Stepper-stepDescription': {\n color: theme.colors.gray[5],\n },\n '& .mantine-Stepper-stepIcon': {\n borderColor: theme.colors.gray[1],\n },\n },\n },\n stepIcon: {\n fontWeight: 500,\n backgroundColor: theme.colors.gray[1],\n color: 'inherit',\n border: `${rem(1)} solid ${theme.colors.gray[3]}`,\n '&[data-progress]': {\n backgroundColor: theme.white,\n },\n\n '&[data-completed]': {\n backgroundColor: theme.white,\n borderColor: theme.colors.lime[6],\n color: theme.colors.lime[6],\n },\n },\n stepCompletedIcon: {\n color: theme.colors.lime[6],\n fontSize: rem(16),\n },\n stepDescription: {\n color: theme.colors.gray[7],\n fontSize: getSize({size, sizes: theme.fontSizes}),\n },\n separator: {\n height: rem(1),\n backgroundColor: theme.colors.gray[3],\n },\n separatorActive: {\n backgroundColor: theme.colors.gray[3],\n },\n verticalSeparator: {\n borderLeft: `${rem(1)} solid ${theme.colors.gray[3]}`,\n },\n verticalSeparatorActive: {\n borderColor: theme.colors.gray[3],\n },\n }),\n },\n Tabs: {\n styles: (theme, {orientation}: TabsStylesParams) => ({\n tabsList: {\n [orientation === 'horizontal' ? 'borderBottom' : 'borderRight']: `${rem(1)} solid ${\n theme.colors.gray[3]\n }`,\n },\n tab: {\n [orientation === 'horizontal' ? 'borderBottom' : 'borderRight']: `${rem(1)} solid transparent`,\n [orientation === 'horizontal' ? 'marginBottom' : 'marginRight']: rem(-1),\n },\n }),\n },\n Select: {\n styles: (theme) => ({\n input: {\n color: theme.colorScheme === 'dark' ? theme.colors.dark[0] : theme.colors.gray[7],\n },\n item: {\n color: theme.colorScheme === 'dark' ? theme.colors.dark[0] : theme.colors.gray[7],\n\n '&[data-hovered]': {\n backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[4] : theme.colors.gray[1],\n },\n\n '&[data-selected]': {\n backgroundColor: theme.fn.variant({variant: 'light'}).background,\n color: theme.fn.variant({variant: 'light'}).color,\n ...theme.fn.hover({backgroundColor: theme.fn.variant({variant: 'light'}).hover}),\n },\n },\n }),\n },\n },\n};\n"],"names":["CheckSize16Px","InfoSize24Px","color","getSize","rem","PlasmaColors","plasmaTheme","colorScheme","fontFamily","black","primary","gray","defaultRadius","lineHeight","spacing","xs","sm","md","lg","xl","primaryColor","headings","fontWeight","sizes","h1","fontSize","undefined","h2","h3","h4","h5","h6","shadows","colors","components","Alert","defaultProps","icon","height","styles","title","Title","root","letterSpacing","Text","weight","theme","size","fontSizes","Button","variants","outline","backgroundColor","Modal","fullScreen","padding","variant","content","flex","overflow","width","header","borderBottom","body","paddingTop","ModalOverlay","navy","opacity","InputWrapper","withAsterisk","label","marginBottom","description","invalid","red","borderColor","error","TextInput","radius","Tooltip","withArrow","withinPortal","multiline","zIndex","Loader","DateRangePicker","cell","textAlign","Anchor","fn","hover","textDecoration","action","Checkbox","List","listStyleType","Radio","labelWrapper","display","alignItems","Popover","shadow","Badge","textTransform","ColorSwatch","withShadow","MenuItem","fw","Notification","notificationType","boxShadow","paddingLeft","marginRight","closeButton","margin","Skeleton","visible","SegmentedControl","Stepper","completedIcon","step","stepIcon","border","white","lime","stepCompletedIcon","stepDescription","separator","separatorActive","verticalSeparator","borderLeft","verticalSeparatorActive","Tabs","orientation","tabsList","tab","Select","input","dark","item","background"],"mappings":";;;;AAAA,SAAQA,aAAa,EAAEC,YAAY,QAAO,8BAA8B;AACxE,SAAQC,KAAK,QAAO,yBAAyB;AAC7C,SACIC,OAAO,EACPC,GAAG,QAKA,gBAAgB;AAEvB,SAAQC,YAAY,QAAO,iBAAiB;AAE5C,OAAO,IAAMC,cAAoC;IAC7C,2HAA2H;IAC3HC,aAAa;IACbC,YAAY;IACZC,OAAOP,MAAMQ,OAAO,CAACC,IAAI,CAAC,EAAE;IAC5BC,eAAe;IACfC,YAAY;IACZC,SAAS;QACLC,IAAI;QACJC,IAAI;QACJC,IAAI;QACJC,IAAI;QACJC,IAAI;IACR;IACAC,cAAc;IACdC,UAAU;QACNb,YAAY;QACZc,YAAY;QACZC,OAAO;YACHC,IA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C,iBAAiBN,MAAM2C,EAAE,CAACjC,OAAO,CAAC;gCAACA,SAAS;4BAAO,GAAGkC,KAAK;wBAAA;oBAEtF;gBACJ;;QACJ;IACJ;AACJ,EAAE"}
|
|
1
|
+
{"version":3,"sources":["../../../src/theme/Theme.tsx"],"sourcesContent":["import {CheckSize16Px, InfoSize24Px} from '@coveord/plasma-react-icons';\nimport {color} from '@coveord/plasma-tokens';\nimport {\n getSize,\n rem,\n type MantineThemeOverride,\n type NotificationProps,\n type StepperStylesParams,\n type TabsStylesParams,\n getStylesRef,\n} from '@mantine/core';\n\nimport {PlasmaColors} from './PlasmaColors';\n\nexport const plasmaTheme: MantineThemeOverride = {\n // These are overrides over https://github.com/mantinedev/mantine/blob/master/src/mantine-styles/src/theme/default-theme.ts\n colorScheme: 'light',\n fontFamily: 'canada-type-gibson, sans-serif',\n black: color.primary.gray[9],\n defaultRadius: 8,\n lineHeight: 1.5,\n spacing: {\n xs: '8px',\n sm: '16px',\n md: '24px',\n lg: '32px',\n xl: '40px',\n },\n primaryColor: 'action',\n headings: {\n fontFamily: 'canada-type-gibson, sans-serif',\n fontWeight: 500,\n sizes: {\n h1: {fontSize: '48px', lineHeight: undefined, fontWeight: 300},\n h2: {fontSize: '32px', lineHeight: undefined, fontWeight: 500},\n h3: {fontSize: '24px', lineHeight: undefined, fontWeight: 500},\n h4: {fontSize: '18px', lineHeight: undefined, fontWeight: 300},\n h5: {fontSize: '14px', lineHeight: undefined, fontWeight: 500},\n h6: {fontSize: '12px', lineHeight: undefined, fontWeight: 500},\n },\n },\n shadows: {\n xs: '0px 1px 0px rgba(4, 8, 31, 0.08)',\n sm: '0px 2px 4px rgba(4, 8, 31, 0.12)',\n md: '0px 4px 8px rgba(4, 8, 31, 0.08)',\n lg: '0px 8px 16px rgba(7, 12, 41, 0.06)',\n xl: '0px 16px 24px rgba(4, 8, 31, 0.06)',\n },\n colors: PlasmaColors,\n components: {\n Alert: {\n defaultProps: {\n icon: <InfoSize24Px height={24} />,\n color: 'navy',\n },\n styles: {\n title: {\n fontWeight: 500,\n },\n },\n },\n Title: {\n styles: {\n root: {\n '&:is(h1,h2,h3,h4,h5,h6)': {letterSpacing: '0.011em'},\n },\n },\n },\n Text: {\n defaultProps: {\n weight: 300,\n },\n styles: (theme, {}, {size}) => ({\n root: {\n fontSize: getSize({size: size ?? 'sm', sizes: theme.fontSizes}),\n },\n }),\n },\n Button: {\n styles: () => ({\n root: {\n fontWeight: 400,\n },\n }),\n variants: {\n outline: () => ({\n root: {\n backgroundColor: 'white',\n },\n }),\n },\n },\n Modal: {\n styles: (theme, {fullScreen, padding}, {size, variant}) => ({\n content: {\n flex: fullScreen\n ? '0 0 100%'\n : `0 0 ${getSize({\n size,\n sizes: {\n xs: rem(432),\n sm: rem(664),\n md: rem(896),\n lg: rem(1120),\n xl: rem('88%'),\n },\n })}`,\n overflow: 'auto',\n },\n title: {\n width: '100%',\n fontSize: theme.headings.sizes.h3.fontSize,\n lineHeight: theme.headings.sizes.h3.lineHeight,\n fontWeight: 500,\n },\n header: {\n borderBottom: variant !== 'prompt' ? `1px solid ${color.primary.gray[3]}` : null,\n },\n body: {\n '&:not(:only-child)': {\n paddingTop: variant === 'prompt' ? 0 : getSize({size: padding, sizes: plasmaTheme.spacing}),\n },\n },\n }),\n },\n ModalOverlay: {\n defaultProps: {\n color: color.primary.navy[9],\n opacity: 0.9,\n },\n },\n InputWrapper: {\n defaultProps: {\n withAsterisk: false,\n },\n styles: (theme) => ({\n label: {\n marginBottom: theme.spacing.xs,\n },\n description: {\n fontSize: theme.fontSizes.sm,\n color: theme.colors.gray[7],\n marginBottom: theme.spacing.xs,\n lineHeight: theme.lineHeight,\n },\n invalid: {\n color: theme.colors.red[9],\n borderColor: theme.colors.red[6],\n },\n error: {\n color: theme.colors.red[9],\n lineHeight: theme.lineHeight,\n },\n }),\n },\n TextInput: {\n defaultProps: {\n radius: 8,\n },\n },\n Tooltip: {\n defaultProps: {\n color: 'navy',\n withArrow: true,\n withinPortal: true,\n multiline: true,\n zIndex: 10000,\n },\n },\n Loader: {\n defaultProps: {\n variant: 'dots',\n color: 'action',\n },\n },\n DateRangePicker: {\n styles: {\n cell: {\n textAlign: 'center',\n },\n },\n },\n Anchor: {\n defaultProps: {\n color: 'action.6',\n },\n styles: (theme) => ({\n root: {\n ...theme.fn.hover({\n textDecoration: 'underline',\n color: theme.colors.action[8],\n }),\n },\n }),\n },\n Checkbox: {\n defaultProps: {\n radius: 'sm',\n },\n styles: (theme) => ({\n label: {\n fontSize: theme.fontSizes.sm,\n fontWeight: 300,\n },\n }),\n },\n List: {\n styles: () => ({\n root: {\n listStyleType: 'disc',\n },\n }),\n },\n Radio: {\n styles: {\n labelWrapper: {\n display: 'flex',\n alignItems: 'flex-start',\n },\n },\n },\n Popover: {\n defaultProps: {\n shadow: 'md',\n withArrow: true,\n },\n },\n Badge: {\n styles: {\n root: {\n textTransform: 'none',\n padding: '4px 8px',\n fontWeight: 500,\n },\n },\n },\n ColorSwatch: {\n defaultProps: {\n size: 8,\n withShadow: false,\n },\n },\n MenuItem: {\n defaultProps: {\n fw: 300,\n },\n },\n Notification: {\n styles: (theme, {color: notificationType}: NotificationProps) => ({\n root: {\n borderColor: theme.colors.gray[3],\n backgroundColor: theme.colors.gray[0],\n boxShadow: theme.shadows.lg,\n padding: theme.spacing.sm,\n '&[data-with-icon]': {\n paddingLeft: theme.spacing.sm,\n },\n },\n icon: {\n backgroundColor: 'transparent',\n marginRight: theme.spacing.sm,\n color: theme.colors?.[notificationType][6],\n },\n closeButton: {\n margin: theme.spacing.xs,\n color: theme.colors.gray[5],\n },\n }),\n defaultProps: {\n icon: <InfoSize24Px height={24} />,\n color: 'info',\n },\n },\n Skeleton: {\n styles: {\n visible: {\n '&::before': {zIndex: 'unset'},\n '&::after': {zIndex: 'unset'},\n },\n },\n },\n SegmentedControl: {\n styles: (theme) => ({\n root: {\n backgroundColor: theme.colors.gray[2],\n },\n }),\n },\n Stepper: {\n defaultProps: {\n size: 'xs',\n completedIcon: <CheckSize16Px />,\n },\n styles: (theme, {}: StepperStylesParams, {size}) => ({\n step: {\n '&[disabled]': {\n color: theme.colors.gray[5],\n '& .mantine-Stepper-stepDescription': {\n color: theme.colors.gray[5],\n },\n '& .mantine-Stepper-stepIcon': {\n borderColor: theme.colors.gray[1],\n },\n },\n },\n stepIcon: {\n fontWeight: 500,\n backgroundColor: theme.colors.gray[1],\n color: 'inherit',\n border: `${rem(1)} solid ${theme.colors.gray[3]}`,\n '&[data-progress]': {\n backgroundColor: theme.white,\n },\n\n '&[data-completed]': {\n backgroundColor: theme.white,\n borderColor: theme.colors.lime[6],\n color: theme.colors.lime[6],\n },\n },\n stepCompletedIcon: {\n color: theme.colors.lime[6],\n fontSize: rem(16),\n },\n stepDescription: {\n color: theme.colors.gray[7],\n fontSize: getSize({size, sizes: theme.fontSizes}),\n },\n separator: {\n height: rem(1),\n backgroundColor: theme.colors.gray[3],\n },\n separatorActive: {\n backgroundColor: theme.colors.gray[3],\n },\n verticalSeparator: {\n borderLeft: `${rem(1)} solid ${theme.colors.gray[3]}`,\n },\n verticalSeparatorActive: {\n borderColor: theme.colors.gray[3],\n },\n }),\n },\n Tabs: {\n styles: (theme, {orientation}: TabsStylesParams) => ({\n tabsList: {\n [orientation === 'horizontal' ? 'borderBottom' : 'borderRight']: `${rem(1)} solid ${\n theme.colors.gray[3]\n }`,\n },\n tab: {\n [orientation === 'horizontal' ? 'borderBottom' : 'borderRight']: `${rem(1)} solid transparent`,\n [orientation === 'horizontal' ? 'marginBottom' : 'marginRight']: rem(-1),\n },\n }),\n },\n Select: {\n styles: (theme) => ({\n input: {\n color: theme.colorScheme === 'dark' ? theme.colors.dark[0] : theme.colors.gray[7],\n },\n item: {\n color: theme.colorScheme === 'dark' ? theme.colors.dark[0] : theme.colors.gray[7],\n\n '&[data-hovered]': {\n backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[4] : theme.colors.gray[1],\n },\n\n '&[data-selected]': {\n backgroundColor: theme.fn.variant({variant: 'light'}).background,\n color: theme.fn.variant({variant: 'light'}).color,\n ...theme.fn.hover({backgroundColor: theme.fn.variant({variant: 'light'}).hover}),\n },\n },\n }),\n },\n NavLink: {\n styles: (theme) => ({\n root: {\n color: theme.colors.gray[6],\n borderRadius: `${theme.defaultRadius}px 0px 0px ${theme.defaultRadius}px`,\n },\n label: {\n ref: getStylesRef('label'),\n fontWeight: 500,\n },\n children: {\n [`.${getStylesRef('label')}`]: {\n fontWeight: 300,\n },\n },\n }),\n },\n },\n};\n"],"names":["CheckSize16Px","InfoSize24Px","color","getSize","rem","getStylesRef","PlasmaColors","plasmaTheme","colorScheme","fontFamily","black","primary","gray","defaultRadius","lineHeight","spacing","xs","sm","md","lg","xl","primaryColor","headings","fontWeight","sizes","h1","fontSize","undefined","h2","h3","h4","h5","h6","shadows","colors","components","Alert","defaultProps","icon","height","styles","title","Title","root","letterSpacing","Text","weight","theme","size","fontSizes","Button","variants","outline","backgroundColor","Modal","fullScreen","padding","variant","content","flex","overflow","width","header","borderBottom","body","paddingTop","ModalOverlay","navy","opacity","InputWrapper","withAsterisk","label","marginBottom","description","invalid","red","borderColor","error","TextInput","radius","Tooltip","withArrow","withinPortal","multiline","zIndex","Loader","DateRangePicker","cell","textAlign","Anchor","fn","hover","textDecoration","action","Checkbox","List","listStyleType","Radio","labelWrapper","display","alignItems","Popover","shadow","Badge","textTransform","ColorSwatch","withShadow","MenuItem","fw","Notification","notificationType","boxShadow","paddingLeft","marginRight","closeButton","margin","Skeleton","visible","SegmentedControl","Stepper","completedIcon","step","stepIcon","border","white","lime","stepCompletedIcon","stepDescription","separator","separatorActive","verticalSeparator","borderLeft","verticalSeparatorActive","Tabs","orientation","tabsList","tab","Select","input","dark","item","background","NavLink","borderRadius","ref","children"],"mappings":";;;;AAAA,SAAQA,aAAa,EAAEC,YAAY,QAAO,8BAA8B;AACxE,SAAQC,KAAK,QAAO,yBAAyB;AAC7C,SACIC,OAAO,EACPC,GAAG,EAKHC,YAAY,QAC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,EAAE;wBAEjF,mBAAmB;4BACfyC,iBAAiBN,MAAMvC,WAAW,KAAK,SAASuC,MAAMb,MAAM,CAACyG,IAAI,CAAC,EAAE,GAAG5F,MAAMb,MAAM,CAACtB,IAAI,CAAC,EAAE;wBAC/F;wBAEA,oBAAoB;4BAChByC,iBAAiBN,MAAM2C,EAAE,CAACjC,OAAO,CAAC;gCAACA,SAAS;4BAAO,GAAGoF,UAAU;4BAChE3I,OAAO6C,MAAM2C,EAAE,CAACjC,OAAO,CAAC;gCAACA,SAAS;4BAAO,GAAGvD,KAAK;2BAC9C6C,MAAM2C,EAAE,CAACC,KAAK,CAAC;4BAACtC,iBAAiBN,MAAM2C,EAAE,CAACjC,OAAO,CAAC;gCAACA,SAAS;4BAAO,GAAGkC,KAAK;wBAAA;oBAEtF;gBACJ;;QACJ;QACAmD,SAAS;YACLtG,QAAQ,SAACO;uBAAW;oBAChBJ,MAAM;wBACFzC,OAAO6C,MAAMb,MAAM,CAACtB,IAAI,CAAC,EAAE;wBAC3BmI,cAAc,AAAC,GAAmChG,OAAjCA,MAAMlC,aAAa,EAAC,eAAiC,OAApBkC,MAAMlC,aAAa,EAAC;oBAC1E;oBACA0D,OAAO;wBACHyE,KAAK3I,aAAa;wBAClBkB,YAAY;oBAChB;oBACA0H,UACI,qBAAC,AAAC,IAAyB,OAAtB5I,aAAa,WAAa;wBAC3BkB,YAAY;oBAChB;gBAER;;QACJ;IACJ;AACJ,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/overrideComponent.ts"],"sourcesContent":["/**\n * Allows to override static properties from a component function\n *\n * @param component The component which holds the static properties\n * @param properties The new static properties to assign on the component\n * @returns A new component with the specified properties. It doesn't change the original component\n * @example const Menu = overrideComponent(MantineMenu, {Item: MyMenuItem}); // Menu.Item will equal MyMenuItem\n */\nexport const overrideComponent = <\n Component extends (...args: Parameters<Component>) => ReturnType<Component>,\n StaticProperties = Record<keyof Component, never
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/overrideComponent.ts"],"sourcesContent":["/**\n * Allows to override static properties from a component function\n *\n * @param component The component which holds the static properties\n * @param properties The new static properties to assign on the component\n * @returns A new component with the specified properties. It doesn't change the original component\n * @example const Menu = overrideComponent(MantineMenu, {Item: MyMenuItem}); // Menu.Item will equal MyMenuItem\n */\nexport const overrideComponent = <\n Component extends (...args: Parameters<Component>) => ReturnType<Component>,\n StaticProperties = Record<keyof Component, never>,\n>(\n component: Component,\n properties: StaticProperties,\n): ((...args: Parameters<Component>) => ReturnType<Component>) & Component & StaticProperties => {\n const componentClone = (...args: Parameters<Component>) => component(...args);\n return Object.assign(componentClone, component, properties);\n};\n"],"names":["overrideComponent","component","properties","componentClone","args","Object","assign"],"mappings":"AAAA;;;;;;;CAOC;AACD,OAAO,IAAMA,oBAAoB,SAI7BC,WACAC;IAEA,IAAMC,iBAAiB;yCAAIC;YAAAA;;eAAgCH,UAAAA,MAAAA,KAAAA,GAAU,qBAAGG;;IACxE,OAAOC,OAAOC,MAAM,CAACH,gBAAgBF,WAAWC;AACpD,EAAE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coveord/plasma-mantine",
|
|
3
|
-
"version": "52.
|
|
3
|
+
"version": "52.13.1",
|
|
4
4
|
"description": "A Plasma flavoured Mantine theme",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"plasma",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"lodash.debounce": "4.0.8",
|
|
42
42
|
"lodash.defaultsdeep": "4.6.1",
|
|
43
43
|
"monaco-editor": "0.40.0",
|
|
44
|
-
"@coveord/plasma-react-icons": "52.
|
|
45
|
-
"@coveord/plasma-tokens": "52.
|
|
44
|
+
"@coveord/plasma-react-icons": "52.13.1",
|
|
45
|
+
"@coveord/plasma-tokens": "52.13.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@emotion/react": "11.11.1",
|
|
@@ -78,10 +78,11 @@
|
|
|
78
78
|
"publint": "0.1.16",
|
|
79
79
|
"react": "18.2.0",
|
|
80
80
|
"react-dom": "18.2.0",
|
|
81
|
-
"rimraf": "
|
|
81
|
+
"rimraf": "5.0.1",
|
|
82
82
|
"tslib": "2.6.0",
|
|
83
83
|
"typescript": "5.1.6",
|
|
84
|
-
"vitest": "0.33.0"
|
|
84
|
+
"vitest": "0.33.0",
|
|
85
|
+
"eslint-config-plasma": "52.13.1"
|
|
85
86
|
},
|
|
86
87
|
"peerDependencies": {
|
|
87
88
|
"@emotion/react": "^11.10.0",
|
|
@@ -98,6 +99,7 @@
|
|
|
98
99
|
"scripts": {
|
|
99
100
|
"build": "node ../../scripts/build",
|
|
100
101
|
"clean": "rimraf dist",
|
|
102
|
+
"lintfix": "../../node_modules/.bin/prettier --write \"**/*.{scss,ts,tsx,js,jsx,json,md,yml,html}\" && ../../node_modules/.bin/eslint -c ./.eslintrc.js \"src/**/*.{ts,tsx}\" --fix",
|
|
101
103
|
"start": "node ../../scripts/start",
|
|
102
104
|
"test": "TZ=UTC vitest run",
|
|
103
105
|
"test:watch": "TZ=UTC vitest"
|
|
@@ -33,9 +33,9 @@ const _ButtonWithDisabledTooltip = forwardRef<HTMLDivElement, ButtonWithDisabled
|
|
|
33
33
|
</Tooltip>
|
|
34
34
|
) : (
|
|
35
35
|
<>{children}</>
|
|
36
|
-
)
|
|
36
|
+
),
|
|
37
37
|
);
|
|
38
38
|
|
|
39
39
|
export const ButtonWithDisabledTooltip = createPolymorphicComponent<'div', ButtonWithDisabledTooltipProps>(
|
|
40
|
-
_ButtonWithDisabledTooltip
|
|
40
|
+
_ButtonWithDisabledTooltip,
|
|
41
41
|
);
|
|
@@ -16,11 +16,11 @@ describe('Button', () => {
|
|
|
16
16
|
<>
|
|
17
17
|
<Button loading={true}>I am loading</Button>
|
|
18
18
|
<Button loading={false}>I am not loading</Button>
|
|
19
|
-
|
|
19
|
+
</>,
|
|
20
20
|
);
|
|
21
21
|
expect(within(screen.getByRole('button', {name: /I am loading/i})).getByRole('presentation')).toBeVisible();
|
|
22
22
|
expect(
|
|
23
|
-
within(screen.queryByRole('button', {name: /I am not loading/i})).queryByRole('presentation')
|
|
23
|
+
within(screen.queryByRole('button', {name: /I am not loading/i})).queryByRole('presentation'),
|
|
24
24
|
).not.toBeInTheDocument();
|
|
25
25
|
});
|
|
26
26
|
|
|
@@ -40,7 +40,7 @@ describe('Button', () => {
|
|
|
40
40
|
userEvent.click(screen.getByRole('button', {name: /promise handler/i}));
|
|
41
41
|
|
|
42
42
|
expect(
|
|
43
|
-
await within(screen.getByRole('button', {name: /promise handler/i})).findByRole('presentation')
|
|
43
|
+
await within(screen.getByRole('button', {name: /promise handler/i})).findByRole('presentation'),
|
|
44
44
|
).toBeVisible();
|
|
45
45
|
|
|
46
46
|
resolve();
|
|
@@ -50,7 +50,7 @@ describe('Button', () => {
|
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
expect(
|
|
53
|
-
within(screen.queryByRole('button', {name: /promise handler/i})).queryByRole('presentation')
|
|
53
|
+
within(screen.queryByRole('button', {name: /promise handler/i})).queryByRole('presentation'),
|
|
54
54
|
).not.toBeInTheDocument();
|
|
55
55
|
});
|
|
56
56
|
|
|
@@ -70,7 +70,7 @@ describe('Button', () => {
|
|
|
70
70
|
userEvent.click(screen.getByRole('button', {name: /promise handler/i}));
|
|
71
71
|
|
|
72
72
|
expect(
|
|
73
|
-
await within(screen.getByRole('button', {name: /promise handler/i})).findByRole('presentation')
|
|
73
|
+
await within(screen.getByRole('button', {name: /promise handler/i})).findByRole('presentation'),
|
|
74
74
|
).toBeVisible();
|
|
75
75
|
|
|
76
76
|
reject();
|
|
@@ -80,7 +80,7 @@ describe('Button', () => {
|
|
|
80
80
|
});
|
|
81
81
|
|
|
82
82
|
expect(
|
|
83
|
-
within(screen.queryByRole('button', {name: /promise handler/i})).queryByRole('presentation')
|
|
83
|
+
within(screen.queryByRole('button', {name: /promise handler/i})).queryByRole('presentation'),
|
|
84
84
|
).not.toBeInTheDocument();
|
|
85
85
|
});
|
|
86
86
|
});
|
|
@@ -7,7 +7,7 @@ describe('ButtonWithDisabledTooltip', () => {
|
|
|
7
7
|
render(
|
|
8
8
|
<ButtonWithDisabledTooltip disabled disabledTooltip="tooltip message">
|
|
9
9
|
<button disabled>save</button>
|
|
10
|
-
</ButtonWithDisabledTooltip
|
|
10
|
+
</ButtonWithDisabledTooltip>,
|
|
11
11
|
);
|
|
12
12
|
const button = screen.getByRole('button', {name: /save/i});
|
|
13
13
|
expect(button).toBeDisabled();
|
|
@@ -21,7 +21,7 @@ describe('ButtonWithDisabledTooltip', () => {
|
|
|
21
21
|
render(
|
|
22
22
|
<ButtonWithDisabledTooltip disabledTooltip="tooltip message">
|
|
23
23
|
<button>save</button>
|
|
24
|
-
</ButtonWithDisabledTooltip
|
|
24
|
+
</ButtonWithDisabledTooltip>,
|
|
25
25
|
);
|
|
26
26
|
const button = screen.getByRole('button', {name: /save/i});
|
|
27
27
|
expect(screen.queryByRole('tooltip', {name: /tooltip message/i})).not.toBeInTheDocument();
|
|
@@ -33,7 +33,7 @@ describe('ButtonWithDisabledTooltip', () => {
|
|
|
33
33
|
const {container} = render(
|
|
34
34
|
<ButtonWithDisabledTooltip>
|
|
35
35
|
<button>save</button>
|
|
36
|
-
</ButtonWithDisabledTooltip
|
|
36
|
+
</ButtonWithDisabledTooltip>,
|
|
37
37
|
);
|
|
38
38
|
expect(container).toMatchInlineSnapshot(`
|
|
39
39
|
<div>
|
|
@@ -47,6 +47,10 @@ interface CodeEditorProps
|
|
|
47
47
|
value?: string;
|
|
48
48
|
/** onChange value for controlled input */
|
|
49
49
|
onChange?(value: string): void;
|
|
50
|
+
/** Called whenever the search icon is clicked */
|
|
51
|
+
onSearch?(): void;
|
|
52
|
+
/** Called whenever the copy icon is clicked */
|
|
53
|
+
onCopy?(): void;
|
|
50
54
|
/** Called whenever the code editor gets the focus */
|
|
51
55
|
onFocus?(): void;
|
|
52
56
|
/**
|
|
@@ -87,6 +91,8 @@ export const CodeEditor: FunctionComponent<CodeEditorProps> = (props) => {
|
|
|
87
91
|
language,
|
|
88
92
|
defaultValue,
|
|
89
93
|
onChange,
|
|
94
|
+
onCopy,
|
|
95
|
+
onSearch,
|
|
90
96
|
onFocus,
|
|
91
97
|
value,
|
|
92
98
|
label,
|
|
@@ -129,6 +135,7 @@ export const CodeEditor: FunctionComponent<CodeEditorProps> = (props) => {
|
|
|
129
135
|
if (editorRef.current) {
|
|
130
136
|
editorRef.current.focus();
|
|
131
137
|
editorRef.current.trigger('editor', 'actions.find', '');
|
|
138
|
+
onSearch?.();
|
|
132
139
|
}
|
|
133
140
|
};
|
|
134
141
|
|
|
@@ -169,7 +176,7 @@ export const CodeEditor: FunctionComponent<CodeEditorProps> = (props) => {
|
|
|
169
176
|
const _buttons = (
|
|
170
177
|
<Group position="right" spacing={0}>
|
|
171
178
|
<Search handleSearch={handleSearch} />
|
|
172
|
-
<CopyToClipboard value={_value} />
|
|
179
|
+
<CopyToClipboard value={_value} onCopy={() => onCopy?.()} />
|
|
173
180
|
</Group>
|
|
174
181
|
);
|
|
175
182
|
|
|
@@ -70,4 +70,21 @@ describe('CodeEditor', () => {
|
|
|
70
70
|
expect(screen.getByTestId('monaco-editor')).toHaveAttribute('focus');
|
|
71
71
|
expect(screen.getByTestId('monaco-editor')).toHaveAttribute('trigger');
|
|
72
72
|
});
|
|
73
|
+
|
|
74
|
+
it('calls the onCopy callback when clicking on the copy button', async () => {
|
|
75
|
+
const user = userEvent.setup();
|
|
76
|
+
const onCopySpy = vi.fn();
|
|
77
|
+
render(<CodeEditor onCopy={onCopySpy} />);
|
|
78
|
+
await user.click(screen.getByRole('button', {name: /copy/i}));
|
|
79
|
+
|
|
80
|
+
expect(onCopySpy).toHaveBeenCalledTimes(1);
|
|
81
|
+
});
|
|
82
|
+
it('calls the onSearch callback when clicking on the search button', async () => {
|
|
83
|
+
const user = userEvent.setup();
|
|
84
|
+
const onSearchSpy = vi.fn();
|
|
85
|
+
render(<CodeEditor onSearch={onSearchSpy} />);
|
|
86
|
+
await user.click(screen.getByRole('button', {name: /search/i}));
|
|
87
|
+
|
|
88
|
+
expect(onSearchSpy).toHaveBeenCalledTimes(1);
|
|
89
|
+
});
|
|
73
90
|
});
|