@coveord/plasma-mantine 49.2.0 → 49.2.2
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/.turbo/turbo-build.log +3 -3
- package/.turbo/turbo-test.log +7 -7
- package/dist/.tsbuildinfo +1 -1
- package/dist/cjs/__tests__/GlobalSetup.js.map +1 -1
- package/dist/cjs/__tests__/Setup.js.map +1 -1
- package/dist/cjs/__tests__/SetupAfterEnv.js.map +1 -1
- package/dist/cjs/__tests__/Utils.js.map +1 -1
- package/dist/cjs/components/blank-slate/BlankSlate.js.map +1 -1
- package/dist/cjs/components/blank-slate/index.js.map +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/button/index.js.map +1 -1
- package/dist/cjs/components/code-editor/CodeEditor.js.map +1 -1
- package/dist/cjs/components/code-editor/__mocks__/@monaco-editor/react.js.map +1 -1
- package/dist/cjs/components/code-editor/__mocks__/monaco-editor.js.map +1 -1
- package/dist/cjs/components/code-editor/index.js.map +1 -1
- package/dist/cjs/components/code-editor/languages/xml.js.map +1 -1
- package/dist/cjs/components/collection/Collection.js.map +1 -1
- package/dist/cjs/components/collection/Collection.styles.js.map +1 -1
- package/dist/cjs/components/collection/CollectionItem.js.map +1 -1
- package/dist/cjs/components/collection/index.js.map +1 -1
- package/dist/cjs/components/date-range-picker/DateRangePickerInlineCalendar.js.map +1 -1
- package/dist/cjs/components/date-range-picker/DateRangePickerPopoverCalendar.js.map +1 -1
- package/dist/cjs/components/date-range-picker/DateRangePickerPresetSelect.js.map +1 -1
- package/dist/cjs/components/date-range-picker/EditableDateRangePicker.js.map +1 -1
- package/dist/cjs/components/date-range-picker/index.js.map +1 -1
- package/dist/cjs/components/header/Header.js.map +1 -1
- package/dist/cjs/components/header/index.js.map +1 -1
- package/dist/cjs/components/index.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/InlineConfirmContext.js.map +1 -1
- package/dist/cjs/components/inline-confirm/InlineConfirmMenuItem.js.map +1 -1
- package/dist/cjs/components/inline-confirm/InlineConfirmPrompt.js.map +1 -1
- package/dist/cjs/components/inline-confirm/index.js.map +1 -1
- package/dist/cjs/components/inline-confirm/useInlineConfirm.js.map +1 -1
- package/dist/cjs/components/menu/Menu.js.map +1 -1
- package/dist/cjs/components/menu/index.js.map +1 -1
- package/dist/cjs/components/modal/Modal.js.map +1 -1
- package/dist/cjs/components/modal/index.js.map +1 -1
- package/dist/cjs/components/modal-wizard/ModalWizard.js.map +1 -1
- package/dist/cjs/components/modal-wizard/ModalWizardStep.js.map +1 -1
- package/dist/cjs/components/modal-wizard/index.js.map +1 -1
- package/dist/cjs/components/prompt/Prompt.js.map +1 -1
- package/dist/cjs/components/prompt/PromptFooter.js.map +1 -1
- package/dist/cjs/components/prompt/index.js.map +1 -1
- package/dist/cjs/components/sticky-footer/StickyFooter.js.map +1 -1
- package/dist/cjs/components/sticky-footer/index.js.map +1 -1
- package/dist/cjs/components/table/Table.js.map +1 -1
- package/dist/cjs/components/table/TableActions.js.map +1 -1
- package/dist/cjs/components/table/TableCollapsibleColumn.js.map +1 -1
- package/dist/cjs/components/table/TableContext.js.map +1 -1
- package/dist/cjs/components/table/TableDateRangePicker.js.map +1 -1
- package/dist/cjs/components/table/TableFilter.js.map +1 -1
- package/dist/cjs/components/table/TableFooter.js.map +1 -1
- package/dist/cjs/components/table/TableHeader.js.map +1 -1
- package/dist/cjs/components/table/TablePagination.js.map +1 -1
- package/dist/cjs/components/table/TablePerPage.js.map +1 -1
- package/dist/cjs/components/table/TablePredicate.js.map +1 -1
- package/dist/cjs/components/table/TableSelectableColumn.js.map +1 -1
- package/dist/cjs/components/table/Th.js.map +1 -1
- package/dist/cjs/components/table/index.js.map +1 -1
- package/dist/cjs/components/table/useRowSelection.js.map +1 -1
- package/dist/cjs/components/table/useTable.js.map +1 -1
- package/dist/cjs/form/FormProvider.js.map +1 -1
- package/dist/cjs/form/index.js.map +1 -1
- package/dist/cjs/form/useForm.js.map +1 -1
- package/dist/cjs/hooks/index.js.map +1 -1
- package/dist/cjs/hooks/useControlledList.js.map +1 -1
- package/dist/cjs/hooks/useParentHeight.js.map +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/theme/PlasmaColors.js.map +1 -1
- package/dist/cjs/theme/Plasmantine.js.map +1 -1
- package/dist/cjs/theme/Theme.js.map +1 -1
- package/dist/cjs/theme/index.js.map +1 -1
- package/dist/cjs/utils/createPolymorphicComponent.js.map +1 -1
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/overrideComponent.js.map +1 -1
- package/dist/esm/__tests__/Utils.js.map +1 -1
- package/dist/esm/components/blank-slate/BlankSlate.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.js.map +1 -1
- package/dist/esm/components/code-editor/__mocks__/@monaco-editor/react.js.map +1 -1
- package/dist/esm/components/code-editor/languages/xml.js.map +1 -1
- package/dist/esm/components/collection/Collection.js.map +1 -1
- package/dist/esm/components/collection/CollectionItem.js.map +1 -1
- package/dist/esm/components/date-range-picker/DateRangePickerInlineCalendar.js.map +1 -1
- package/dist/esm/components/date-range-picker/DateRangePickerPopoverCalendar.js.map +1 -1
- package/dist/esm/components/date-range-picker/DateRangePickerPresetSelect.js.map +1 -1
- package/dist/esm/components/date-range-picker/EditableDateRangePicker.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/inline-confirm/InlineConfirmPrompt.js.map +1 -1
- package/dist/esm/components/menu/Menu.js.map +1 -1
- package/dist/esm/components/modal/Modal.js.map +1 -1
- package/dist/esm/components/modal-wizard/ModalWizard.js.map +1 -1
- package/dist/esm/components/prompt/Prompt.js.map +1 -1
- package/dist/esm/components/prompt/PromptFooter.js.map +1 -1
- package/dist/esm/components/sticky-footer/StickyFooter.js.map +1 -1
- package/dist/esm/components/table/Table.js.map +1 -1
- package/dist/esm/components/table/TableActions.js.map +1 -1
- package/dist/esm/components/table/TableCollapsibleColumn.js.map +1 -1
- package/dist/esm/components/table/TableDateRangePicker.js.map +1 -1
- package/dist/esm/components/table/TableFilter.js.map +1 -1
- package/dist/esm/components/table/TableFooter.js.map +1 -1
- package/dist/esm/components/table/TableHeader.js.map +1 -1
- package/dist/esm/components/table/TablePagination.js.map +1 -1
- package/dist/esm/components/table/TablePerPage.js.map +1 -1
- package/dist/esm/components/table/TablePredicate.js.map +1 -1
- package/dist/esm/components/table/TableSelectableColumn.js.map +1 -1
- package/dist/esm/components/table/Th.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/hooks/useControlledList.js.map +1 -1
- package/dist/esm/hooks/useParentHeight.js.map +1 -1
- package/dist/esm/theme/Plasmantine.js.map +1 -1
- package/dist/esm/theme/Theme.js.map +1 -1
- package/dist/esm/utils/overrideComponent.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/__tests__/GlobalSetup.ts"],"sourcesContent":["// This file is executed once, before everything else.\nexport default () => {\n // @ts-ignore\n process.env.TZ = 'UTC';\n};\n"],"names":["process","env","TZ"],"mappings":"AAAA,sDAAsD
|
|
1
|
+
{"version":3,"sources":["../../../src/__tests__/GlobalSetup.ts"],"sourcesContent":["// This file is executed once, before everything else.\nexport default () => {\n // @ts-ignore\n process.env.TZ = 'UTC';\n};\n"],"names":["process","env","TZ"],"mappings":"AAAA,sDAAsD;;;;;+BACtD;;;eAAA;;;IAAA,WAAe,WAAM;IACjB,aAAa;IACbA,QAAQC,GAAG,CAACC,EAAE,GAAG;AACrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/__tests__/Setup.ts"],"sourcesContent":["/**\n * This file is executed once per test file.\n * It is executed before executing SetupAfterEnv and before the test code itself.\n */\n"],"names":[],"mappings":"AAAA;;;CAGC
|
|
1
|
+
{"version":3,"sources":["../../../src/__tests__/Setup.ts"],"sourcesContent":["/**\n * This file is executed once per test file.\n * It is executed before executing SetupAfterEnv and before the test code itself.\n */\n"],"names":[],"mappings":"AAAA;;;CAGC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/__tests__/SetupAfterEnv.ts"],"sourcesContent":["/**\n * This file is executed once per test file.\n * It is executed after executing Setup and Jest is initialised, but before the test code itself.\n */\n\nimport '@testing-library/jest-dom';\nimport '@testing-library/jest-dom/extend-expect';\n\nElement.prototype.scrollTo = jest.fn();\nwindow.ResizeObserver =\n window.ResizeObserver ||\n jest.fn().mockImplementation(() => ({\n disconnect: jest.fn(),\n observe: jest.fn(),\n unobserve: jest.fn(),\n }));\n"],"names":["Element","prototype","scrollTo","jest","fn","window","ResizeObserver","mockImplementation","disconnect","observe","unobserve"],"mappings":"AAAA;;;CAGC
|
|
1
|
+
{"version":3,"sources":["../../../src/__tests__/SetupAfterEnv.ts"],"sourcesContent":["/**\n * This file is executed once per test file.\n * It is executed after executing Setup and Jest is initialised, but before the test code itself.\n */\n\nimport '@testing-library/jest-dom';\nimport '@testing-library/jest-dom/extend-expect';\n\nElement.prototype.scrollTo = jest.fn();\nwindow.ResizeObserver =\n window.ResizeObserver ||\n jest.fn().mockImplementation(() => ({\n disconnect: jest.fn(),\n observe: jest.fn(),\n unobserve: jest.fn(),\n }));\n"],"names":["Element","prototype","scrollTo","jest","fn","window","ResizeObserver","mockImplementation","disconnect","observe","unobserve"],"mappings":"AAAA;;;CAGC;;;;QAEM;QACA;AAEPA,QAAQC,SAAS,CAACC,QAAQ,GAAGC,KAAKC,EAAE;AACpCC,OAAOC,cAAc,GACjBD,OAAOC,cAAc,IACrBH,KAAKC,EAAE,GAAGG,kBAAkB,CAAC;WAAO;QAChCC,YAAYL,KAAKC,EAAE;QACnBK,SAASN,KAAKC,EAAE;QAChBM,WAAWP,KAAKC,EAAE;IACtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/__tests__/Utils.tsx"],"sourcesContent":["import {render, RenderOptions, RenderResult} from '@testing-library/react';\nimport userEvent from '@testing-library/user-event';\nimport {FunctionComponent, PropsWithChildren, ReactElement} from 'react';\n\nimport {Plasmantine} from '../theme';\n\nconst customRender = (ui: ReactElement, options?: Omit<RenderOptions, 'queries'>): RenderResult => {\n const TestWrapper: FunctionComponent<PropsWithChildren> = ({children}) => <Plasmantine>{children}</Plasmantine>;\n\n return render(ui, {wrapper: TestWrapper, ...options});\n};\n\nexport {userEvent};\nexport * from '@testing-library/react';\nexport {customRender as render};\n"],"names":["userEvent","render","customRender","ui","options","TestWrapper","children","Plasmantine","wrapper"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/__tests__/Utils.tsx"],"sourcesContent":["import {render, RenderOptions, RenderResult} from '@testing-library/react';\nimport userEvent from '@testing-library/user-event';\nimport {FunctionComponent, PropsWithChildren, ReactElement} from 'react';\n\nimport {Plasmantine} from '../theme';\n\nconst customRender = (ui: ReactElement, options?: Omit<RenderOptions, 'queries'>): RenderResult => {\n const TestWrapper: FunctionComponent<PropsWithChildren> = ({children}) => <Plasmantine>{children}</Plasmantine>;\n\n return render(ui, {wrapper: TestWrapper, ...options});\n};\n\nexport {userEvent};\nexport * from '@testing-library/react';\nexport {customRender as render};\n"],"names":["userEvent","render","customRender","ui","options","TestWrapper","children","Plasmantine","wrapper"],"mappings":";;;;;;;;;;;IAYQA,SAAS;eAATA,kBAAS;;IAEOC,MAAM;eAAtBC;;;;;;;iCAd0C;8DAC5B;qBAGI;AAE1B,IAAMA,eAAe,SAACC,IAAkBC,SAA2D;IAC/F,IAAMC,cAAoD;YAAEC,iBAAAA;6BAAc,qBAACC,kBAAW;sBAAED;;;IAExF,OAAOL,IAAAA,aAAM,EAACE,IAAI;QAACK,SAASH;OAAgBD;AAChD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/blank-slate/BlankSlate.tsx"],"sourcesContent":["import {Paper, Stack} from '@mantine/core';\nimport {FunctionComponent, PropsWithChildren} from 'react';\n\ninterface BlankSlateProps {\n /**\n * Whether the Blankslate render with a border\n *\n * @default true\n */\n withBorder?: boolean;\n}\n\nexport const BlankSlate: FunctionComponent<PropsWithChildren<BlankSlateProps>> = ({children, withBorder = true}) => (\n <Paper shadow={withBorder && 'xs'} p=\"xl\" withBorder={withBorder}>\n <Stack align=\"center\">{children}</Stack>\n </Paper>\n);\n"],"names":["BlankSlate","children","withBorder","Paper","shadow","p","Stack","align"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/blank-slate/BlankSlate.tsx"],"sourcesContent":["import {Paper, Stack} from '@mantine/core';\nimport {FunctionComponent, PropsWithChildren} from 'react';\n\ninterface BlankSlateProps {\n /**\n * Whether the Blankslate render with a border\n *\n * @default true\n */\n withBorder?: boolean;\n}\n\nexport const BlankSlate: FunctionComponent<PropsWithChildren<BlankSlateProps>> = ({children, withBorder = true}) => (\n <Paper shadow={withBorder && 'xs'} p=\"xl\" withBorder={withBorder}>\n <Stack align=\"center\">{children}</Stack>\n </Paper>\n);\n"],"names":["BlankSlate","children","withBorder","Paper","shadow","p","Stack","align"],"mappings":";;;;+BAYaA;;;eAAAA;;;;oBAZc;AAYpB,IAAMA,aAAoE;QAAEC,iBAAAA,oCAAUC,YAAAA,4CAAa,IAAI;yBAC1G,qBAACC,WAAK;QAACC,QAAQF,cAAc;QAAMG,GAAE;QAAKH,YAAYA;kBAClD,cAAA,qBAACI,WAAK;YAACC,OAAM;sBAAUN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/blank-slate/index.ts"],"sourcesContent":["export * from './BlankSlate';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/blank-slate/index.ts"],"sourcesContent":["export * from './BlankSlate';\n"],"names":[],"mappings":";;;;;oBAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/button/Button.tsx"],"sourcesContent":["import {Button as MantineButton, ButtonProps as MantineButtonProps} from '@mantine/core';\nimport {forwardRef} from 'react';\n\nimport {createPolymorphicComponent} from '../../utils';\nimport {ButtonWithDisabledTooltip, ButtonWithDisabledTooltipProps} from './ButtonWithDisabledTooltip';\n\nexport interface ButtonProps extends MantineButtonProps, ButtonWithDisabledTooltipProps {}\n\nconst _Button = forwardRef<HTMLButtonElement, ButtonProps>(\n ({disabledTooltip, disabled, disabledTooltipProps, ...others}, ref) => (\n <ButtonWithDisabledTooltip\n disabled={disabled}\n disabledTooltip={disabledTooltip}\n disabledTooltipProps={disabledTooltipProps}\n >\n <MantineButton ref={ref} disabled={disabled} {...others} />\n </ButtonWithDisabledTooltip>\n )\n);\n\nexport const Button = createPolymorphicComponent<'button', ButtonProps, {Group: typeof MantineButton.Group}>(_Button);\nButton.Group = MantineButton.Group;\n"],"names":["Button","_Button","forwardRef","ref","disabledTooltip","disabled","disabledTooltipProps","others","ButtonWithDisabledTooltip","MantineButton","createPolymorphicComponent","Group"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/button/Button.tsx"],"sourcesContent":["import {Button as MantineButton, ButtonProps as MantineButtonProps} from '@mantine/core';\nimport {forwardRef} from 'react';\n\nimport {createPolymorphicComponent} from '../../utils';\nimport {ButtonWithDisabledTooltip, ButtonWithDisabledTooltipProps} from './ButtonWithDisabledTooltip';\n\nexport interface ButtonProps extends MantineButtonProps, ButtonWithDisabledTooltipProps {}\n\nconst _Button = forwardRef<HTMLButtonElement, ButtonProps>(\n ({disabledTooltip, disabled, disabledTooltipProps, ...others}, ref) => (\n <ButtonWithDisabledTooltip\n disabled={disabled}\n disabledTooltip={disabledTooltip}\n disabledTooltipProps={disabledTooltipProps}\n >\n <MantineButton ref={ref} disabled={disabled} {...others} />\n </ButtonWithDisabledTooltip>\n )\n);\n\nexport const Button = createPolymorphicComponent<'button', ButtonProps, {Group: typeof MantineButton.Group}>(_Button);\nButton.Group = MantineButton.Group;\n"],"names":["Button","_Button","forwardRef","ref","disabledTooltip","disabled","disabledTooltipProps","others","ButtonWithDisabledTooltip","MantineButton","createPolymorphicComponent","Group"],"mappings":";;;;+BAoBaA;;;eAAAA;;;;;;oBApB4D;qBAChD;qBAEgB;yCAC+B;AAIxE,IAAMC,wBAAUC,IAAAA,iBAAU,EACtB,iBAA+DC,mBAC3D;QADFC,yBAAAA,iBAAiBC,kBAAAA,UAAUC,8BAAAA,sBAAyBC;QAApDH;QAAiBC;QAAUC;;WACzB,qBAACE,oDAAyB;QACtBH,UAAUA;QACVD,iBAAiBA;QACjBE,sBAAsBA;kBAEtB,cAAA,qBAACG,YAAa;YAACN,KAAKA;YAAKE,UAAUA;WAAcE;;AAC1B;AAI5B,IAAMP,SAASU,IAAAA,iCAA0B,EAA6DT;AAC7GD,OAAOW,KAAK,GAAGF,YAAa,CAACE,KAAK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/button/ButtonWithDisabledTooltip.tsx"],"sourcesContent":["import {Box, Tooltip, TooltipProps} from '@mantine/core';\nimport {forwardRef, ReactNode} from 'react';\n\nimport {createPolymorphicComponent} from '../../utils';\n\nexport interface ButtonWithDisabledTooltipProps {\n /**\n * The tooltip message to display when disabled\n */\n disabledTooltip?: string;\n /**\n * Whether the button underneath the tooltip is disabled\n */\n disabled?: boolean;\n children?: ReactNode;\n /**\n * Additional tooltip props to set on the disabled button tooltip\n */\n disabledTooltipProps?: Omit<TooltipProps, 'disabled' | 'label' | 'children'>;\n}\n\nconst _ButtonWithDisabledTooltip = forwardRef<HTMLDivElement, ButtonWithDisabledTooltipProps>(\n ({disabledTooltip, disabled, children, disabledTooltipProps, ...others}, ref) =>\n disabledTooltip ? (\n <Tooltip label={disabledTooltip} disabled={!disabled} {...disabledTooltipProps}>\n <Box ref={ref} sx={{'&:hover': {cursor: 'not-allowed'}}} {...others}>\n {children}\n </Box>\n </Tooltip>\n ) : (\n <>{children}</>\n )\n);\n\nexport const ButtonWithDisabledTooltip = createPolymorphicComponent<'div', ButtonWithDisabledTooltipProps>(\n _ButtonWithDisabledTooltip\n);\n"],"names":["ButtonWithDisabledTooltip","_ButtonWithDisabledTooltip","forwardRef","ref","disabledTooltip","disabled","children","disabledTooltipProps","others","Tooltip","label","Box","sx","cursor","createPolymorphicComponent"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/button/ButtonWithDisabledTooltip.tsx"],"sourcesContent":["import {Box, Tooltip, TooltipProps} from '@mantine/core';\nimport {forwardRef, ReactNode} from 'react';\n\nimport {createPolymorphicComponent} from '../../utils';\n\nexport interface ButtonWithDisabledTooltipProps {\n /**\n * The tooltip message to display when disabled\n */\n disabledTooltip?: string;\n /**\n * Whether the button underneath the tooltip is disabled\n */\n disabled?: boolean;\n children?: ReactNode;\n /**\n * Additional tooltip props to set on the disabled button tooltip\n */\n disabledTooltipProps?: Omit<TooltipProps, 'disabled' | 'label' | 'children'>;\n}\n\nconst _ButtonWithDisabledTooltip = forwardRef<HTMLDivElement, ButtonWithDisabledTooltipProps>(\n ({disabledTooltip, disabled, children, disabledTooltipProps, ...others}, ref) =>\n disabledTooltip ? (\n <Tooltip label={disabledTooltip} disabled={!disabled} {...disabledTooltipProps}>\n <Box ref={ref} sx={{'&:hover': {cursor: 'not-allowed'}}} {...others}>\n {children}\n </Box>\n </Tooltip>\n ) : (\n <>{children}</>\n )\n);\n\nexport const ButtonWithDisabledTooltip = createPolymorphicComponent<'div', ButtonWithDisabledTooltipProps>(\n _ButtonWithDisabledTooltip\n);\n"],"names":["ButtonWithDisabledTooltip","_ButtonWithDisabledTooltip","forwardRef","ref","disabledTooltip","disabled","children","disabledTooltipProps","others","Tooltip","label","Box","sx","cursor","createPolymorphicComponent"],"mappings":";;;;+BAkCaA;;;eAAAA;;;;;;;oBAlC4B;qBACL;qBAEK;AAkBzC,IAAMC,2CAA6BC,IAAAA,iBAAU,EACzC,iBAAyEC,KACrEC;QADFA,yBAAAA,iBAAiBC,kBAAAA,UAAUC,kBAAAA,UAAUC,8BAAAA,sBAAyBC;QAA9DJ;QAAiBC;QAAUC;QAAUC;;WACnCH,gCACI,qBAACK,aAAO;QAACC,OAAON;QAAiBC,UAAU,CAACA;OAAcE;kBACtD,cAAA,qBAACI,SAAG;YAACR,KAAKA;YAAKS,IAAI;gBAAC,WAAW;oBAACC,QAAQ;gBAAa;YAAC;WAAOL;sBACxDF;;wBAIT;kBAAGA;MACN;AAAD;AAGD,IAAMN,4BAA4Bc,IAAAA,iCAA0B,EAC/Db"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/button/index.ts"],"sourcesContent":["export * from './Button';\nexport {type ButtonWithDisabledTooltipProps} from './ButtonWithDisabledTooltip';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/button/index.ts"],"sourcesContent":["export * from './Button';\nexport {type ButtonWithDisabledTooltipProps} from './ButtonWithDisabledTooltip';\n"],"names":[],"mappings":";;;;;oBAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/code-editor/CodeEditor.tsx"],"sourcesContent":["import {CheckSize16Px, CopySize16Px} from '@coveord/plasma-react-icons';\nimport {\n ActionIcon,\n Box,\n Center,\n CopyButton,\n createStyles,\n DefaultProps,\n Group,\n Input,\n InputWrapperBaseProps,\n Loader,\n Selectors,\n Space,\n Stack,\n Tooltip,\n useComponentDefaultProps,\n} from '@mantine/core';\nimport {useUncontrolled} from '@mantine/hooks';\nimport Editor, {loader, Monaco} from '@monaco-editor/react';\nimport {FunctionComponent, useEffect, useState} from 'react';\n\nimport {useParentHeight} from '../../hooks';\nimport {XML} from './languages/xml';\n\nconst useStyles = createStyles((theme) => ({\n root: {},\n editor: {\n border: `1px solid ${theme.colors.gray[2]}`,\n borderRadius: theme.defaultRadius,\n backgroundColor: theme.colorScheme === 'light' ? theme.white : theme.black,\n height: '100%',\n },\n}));\n\ninterface CodeEditorProps\n extends Omit<InputWrapperBaseProps, 'inputContainer' | 'inputWrapperOrder'>,\n DefaultProps<Selectors<typeof useStyles>> {\n /**\n * The language syntax of the editor\n *\n * @default 'plaintext'\n */\n language?: 'plaintext' | 'json' | 'markdown' | 'python' | 'xml';\n /** Default value for uncontrolled input */\n defaultValue?: string;\n /** Value for controlled input */\n value?: string;\n /** onChange value for controlled input */\n onChange?(value: string): void;\n /** Called whenever the code editor gets the focus */\n onFocus?(): void;\n /**\n * The minimal height of the CodeEditor (label and description included)\n *\n * By default the CodeEditor is adjusted to fill its parent height.\n * In the case where the parent height is too short, it will use this value as minimum.\n *\n * @default 300\n */\n minHeight?: number;\n /**\n * The maximal height of the CodeEditor (label and description included)\n *\n * By default the CodeEditor is adjusted to fill its parent height.\n * In the case where the parent height would be too high for your liking, you can use this prop to set a maximum.\n */\n maxHeight?: number;\n disabled?: boolean;\n /**\n * Defines how the monaco editor files will be loaded.\n * Note that using `'local'` requires [some additional configuration](https://github.com/suren-atoyan/monaco-react#use-monaco-editor-as-an-npm-package).\n *\n * @default 'local'\n */\n monacoLoader?: 'cdn' | 'local';\n}\n\nconst defaultProps: Partial<CodeEditorProps> = {\n language: 'plaintext',\n monacoLoader: 'local',\n defaultValue: '',\n minHeight: 300,\n};\n\nexport const CodeEditor: FunctionComponent<CodeEditorProps> = (props) => {\n const {\n language,\n defaultValue,\n onChange,\n onFocus,\n value,\n label,\n required,\n labelProps,\n error,\n errorProps,\n description,\n descriptionProps,\n minHeight,\n maxHeight,\n disabled,\n monacoLoader,\n ...others\n } = useComponentDefaultProps('CodeEditor', defaultProps, props);\n const [loaded, setLoaded] = useState(false);\n const {classes, theme} = useStyles();\n const [_value, handleChange] = useUncontrolled<string>({\n value,\n defaultValue,\n onChange,\n finalValue: '',\n });\n const [parentHeight, ref] = useParentHeight();\n\n const loadLocalMonaco = async () => {\n const monacoInstance = await import('monaco-editor');\n loader.config({monaco: monacoInstance});\n setLoaded(true);\n };\n\n const registerLanguages = (monaco: Monaco) => {\n if (monaco && language === 'xml') {\n XML.register(monaco);\n }\n };\n\n useEffect(() => {\n if (monacoLoader === 'local') {\n loadLocalMonaco();\n } else {\n setLoaded(true);\n }\n }, []);\n\n const _label = label ? (\n <Input.Label required={required} {...labelProps}>\n {label}\n </Input.Label>\n ) : null;\n\n const _description = description ? (\n <Input.Description {...descriptionProps}>{description}</Input.Description>\n ) : null;\n\n const _error = error ? (\n <Input.Error mt=\"xs\" {...errorProps}>\n {error}\n </Input.Error>\n ) : (\n <Space h=\"xs\" />\n );\n\n const _header =\n _label || _description ? (\n <Box>\n {_label}\n {_description}\n </Box>\n ) : null;\n\n const _copyButton = (\n <Group position=\"right\">\n <CopyButton value={_value} timeout={2000}>\n {({copied, copy}) => (\n <Tooltip label={copied ? 'Copied' : 'Copy'} withArrow position=\"right\">\n <ActionIcon color={copied ? 'lime' : 'gray'} onClick={copy}>\n {copied ? <CheckSize16Px height={16} /> : <CopySize16Px height={16} />}\n </ActionIcon>\n </Tooltip>\n )}\n </CopyButton>\n </Group>\n );\n\n const _editor = loaded ? (\n <Box p=\"md\" pl=\"xs\" className={classes.editor}>\n <Editor\n defaultLanguage={language}\n theme={theme.colorScheme === 'light' ? 'light' : 'vs-dark'}\n options={{\n minimap: {enabled: false},\n wordWrap: 'on',\n wrappingStrategy: 'advanced',\n scrollBeyondLastLine: false,\n formatOnPaste: true,\n fontSize: theme.fontSizes.xs,\n readOnly: disabled,\n tabSize: 2,\n }}\n value={_value}\n onChange={handleChange}\n onMount={(editor, monaco) => {\n registerLanguages(monaco);\n editor.onDidFocusEditorText(onFocus);\n editor.onDidBlurEditorText(async () => {\n await editor.getAction('editor.action.formatDocument').run();\n });\n }}\n />\n </Box>\n ) : (\n <Center className={classes.editor}>\n <Loader />\n </Center>\n );\n\n return (\n <Stack\n justify=\"flex-start\"\n className={classes.root}\n spacing={0}\n sx={{height: Math.max(parentHeight, minHeight), maxHeight}}\n ref={ref}\n {...others}\n >\n {_header}\n {_copyButton}\n {_editor}\n {_error}\n </Stack>\n );\n};\n"],"names":["CodeEditor","useStyles","createStyles","theme","root","editor","border","colors","gray","borderRadius","defaultRadius","backgroundColor","colorScheme","white","black","height","defaultProps","language","monacoLoader","defaultValue","minHeight","props","useComponentDefaultProps","onChange","onFocus","value","label","required","labelProps","error","errorProps","description","descriptionProps","maxHeight","disabled","others","useState","loaded","setLoaded","classes","useUncontrolled","finalValue","_value","handleChange","useParentHeight","parentHeight","ref","loadLocalMonaco","monacoInstance","loader","config","monaco","registerLanguages","XML","register","useEffect","_label","Input","Label","_description","Description","_error","Error","mt","Space","h","_header","Box","_copyButton","Group","position","CopyButton","timeout","copied","copy","Tooltip","withArrow","ActionIcon","color","onClick","CheckSize16Px","CopySize16Px","_editor","p","pl","className","Editor","defaultLanguage","options","minimap","enabled","wordWrap","wrappingStrategy","scrollBeyondLastLine","formatOnPaste","fontSize","fontSizes","xs","readOnly","tabSize","onMount","onDidFocusEditorText","onDidBlurEditorText","getAction","run","Center","Loader","Stack","justify","spacing","sx","Math","max"],"mappings":"AAAA;;;;+BAqFaA;;;eAAAA;;;;;;;;;;;gCArF6B;oBAiBnC;qBACuB;2DACO;sBACgB;sBAEvB;mBACZ;AAElB,IAAMC,YAAYC,IAAAA,kBAAY,EAAC,SAACC;WAAW;QACvCC,MAAM,CAAC;QACPC,QAAQ;YACJC,QAAQ,AAAC,aAAiC,OAArBH,MAAMI,MAAM,CAACC,IAAI,CA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AAKC,WAAW9C,QAAQlC,MAAM;kBACzC,cAAA,qBAACiF,cAAM;YACHC,iBAAiBtE;YACjBd,OAAOA,MAAMS,WAAW,KAAK,UAAU,UAAU,SAAS;YAC1D4E,SAAS;gBACLC,SAAS;oBAACC,SAAS,KAAK;gBAAA;gBACxBC,UAAU;gBACVC,kBAAkB;gBAClBC,sBAAsB,KAAK;gBAC3BC,eAAe,IAAI;gBACnBC,UAAU5F,MAAM6F,SAAS,CAACC,EAAE;gBAC5BC,UAAUhE;gBACViE,SAAS;YACb;YACA1E,OAAOiB;YACPnB,UAAUoB;YACVyD,SAAS,SAAC/F,QAAQ8C,QAAW;gBACzBC,kBAAkBD;gBAClB9C,OAAOgG,oBAAoB,CAAC7E;gBAC5BnB,OAAOiG,mBAAmB,eAAC,kBAAA,WAAY;;;;gCACnC;;oCAAMjG,OAAOkG,SAAS,CAAC,gCAAgCC,GAAG;;;gCAA1D;;;;;;gBACJ;YACJ;;uBAIR,qBAACC,YAAM;QAACpB,WAAW9C,QAAQlC,MAAM;kBAC7B,cAAA,qBAACqG,YAAM;MAEd;IAED,qBACI,sBAACC,WAAK;QACFC,SAAQ;QACRvB,WAAW9C,QAAQnC,IAAI;QACvByG,SAAS;QACTC,IAAI;YAAC/F,QAAQgG,KAAKC,GAAG,CAACnE,cAAczB;YAAYa,WAAAA;QAAS;QACzDa,KAAKA;OACDX;;YAEH+B;YACAE;YACAc;YACArB;;;AAGb"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/code-editor/CodeEditor.tsx"],"sourcesContent":["import {CheckSize16Px, CopySize16Px} from '@coveord/plasma-react-icons';\nimport {\n ActionIcon,\n Box,\n Center,\n CopyButton,\n createStyles,\n DefaultProps,\n Group,\n Input,\n InputWrapperBaseProps,\n Loader,\n Selectors,\n Space,\n Stack,\n Tooltip,\n useComponentDefaultProps,\n} from '@mantine/core';\nimport {useUncontrolled} from '@mantine/hooks';\nimport Editor, {loader, Monaco} from '@monaco-editor/react';\nimport {FunctionComponent, useEffect, useState} from 'react';\n\nimport {useParentHeight} from '../../hooks';\nimport {XML} from './languages/xml';\n\nconst useStyles = createStyles((theme) => ({\n root: {},\n editor: {\n border: `1px solid ${theme.colors.gray[2]}`,\n borderRadius: theme.defaultRadius,\n backgroundColor: theme.colorScheme === 'light' ? theme.white : theme.black,\n height: '100%',\n },\n}));\n\ninterface CodeEditorProps\n extends Omit<InputWrapperBaseProps, 'inputContainer' | 'inputWrapperOrder'>,\n DefaultProps<Selectors<typeof useStyles>> {\n /**\n * The language syntax of the editor\n *\n * @default 'plaintext'\n */\n language?: 'plaintext' | 'json' | 'markdown' | 'python' | 'xml';\n /** Default value for uncontrolled input */\n defaultValue?: string;\n /** Value for controlled input */\n value?: string;\n /** onChange value for controlled input */\n onChange?(value: string): void;\n /** Called whenever the code editor gets the focus */\n onFocus?(): void;\n /**\n * The minimal height of the CodeEditor (label and description included)\n *\n * By default the CodeEditor is adjusted to fill its parent height.\n * In the case where the parent height is too short, it will use this value as minimum.\n *\n * @default 300\n */\n minHeight?: number;\n /**\n * The maximal height of the CodeEditor (label and description included)\n *\n * By default the CodeEditor is adjusted to fill its parent height.\n * In the case where the parent height would be too high for your liking, you can use this prop to set a maximum.\n */\n maxHeight?: number;\n disabled?: boolean;\n /**\n * Defines how the monaco editor files will be loaded.\n * Note that using `'local'` requires [some additional configuration](https://github.com/suren-atoyan/monaco-react#use-monaco-editor-as-an-npm-package).\n *\n * @default 'local'\n */\n monacoLoader?: 'cdn' | 'local';\n}\n\nconst defaultProps: Partial<CodeEditorProps> = {\n language: 'plaintext',\n monacoLoader: 'local',\n defaultValue: '',\n minHeight: 300,\n};\n\nexport const CodeEditor: FunctionComponent<CodeEditorProps> = (props) => {\n const {\n language,\n defaultValue,\n onChange,\n onFocus,\n value,\n label,\n required,\n labelProps,\n error,\n errorProps,\n description,\n descriptionProps,\n minHeight,\n maxHeight,\n disabled,\n monacoLoader,\n ...others\n } = useComponentDefaultProps('CodeEditor', defaultProps, props);\n const [loaded, setLoaded] = useState(false);\n const {classes, theme} = useStyles();\n const [_value, handleChange] = useUncontrolled<string>({\n value,\n defaultValue,\n onChange,\n finalValue: '',\n });\n const [parentHeight, ref] = useParentHeight();\n\n const loadLocalMonaco = async () => {\n const monacoInstance = await import('monaco-editor');\n loader.config({monaco: monacoInstance});\n setLoaded(true);\n };\n\n const registerLanguages = (monaco: Monaco) => {\n if (monaco && language === 'xml') {\n XML.register(monaco);\n }\n };\n\n useEffect(() => {\n if (monacoLoader === 'local') {\n loadLocalMonaco();\n } else {\n setLoaded(true);\n }\n }, []);\n\n const _label = label ? (\n <Input.Label required={required} {...labelProps}>\n {label}\n </Input.Label>\n ) : null;\n\n const _description = description ? (\n <Input.Description {...descriptionProps}>{description}</Input.Description>\n ) : null;\n\n const _error = error ? (\n <Input.Error mt=\"xs\" {...errorProps}>\n {error}\n </Input.Error>\n ) : (\n <Space h=\"xs\" />\n );\n\n const _header =\n _label || _description ? (\n <Box>\n {_label}\n {_description}\n </Box>\n ) : null;\n\n const _copyButton = (\n <Group position=\"right\">\n <CopyButton value={_value} timeout={2000}>\n {({copied, copy}) => (\n <Tooltip label={copied ? 'Copied' : 'Copy'} withArrow position=\"right\">\n <ActionIcon color={copied ? 'lime' : 'gray'} onClick={copy}>\n {copied ? <CheckSize16Px height={16} /> : <CopySize16Px height={16} />}\n </ActionIcon>\n </Tooltip>\n )}\n </CopyButton>\n </Group>\n );\n\n const _editor = loaded ? (\n <Box p=\"md\" pl=\"xs\" className={classes.editor}>\n <Editor\n defaultLanguage={language}\n theme={theme.colorScheme === 'light' ? 'light' : 'vs-dark'}\n options={{\n minimap: {enabled: false},\n wordWrap: 'on',\n wrappingStrategy: 'advanced',\n scrollBeyondLastLine: false,\n formatOnPaste: true,\n fontSize: theme.fontSizes.xs,\n readOnly: disabled,\n tabSize: 2,\n }}\n value={_value}\n onChange={handleChange}\n onMount={(editor, monaco) => {\n registerLanguages(monaco);\n editor.onDidFocusEditorText(onFocus);\n editor.onDidBlurEditorText(async () => {\n await editor.getAction('editor.action.formatDocument').run();\n });\n }}\n />\n </Box>\n ) : (\n <Center className={classes.editor}>\n <Loader />\n </Center>\n );\n\n return (\n <Stack\n justify=\"flex-start\"\n className={classes.root}\n spacing={0}\n sx={{height: Math.max(parentHeight, minHeight), maxHeight}}\n ref={ref}\n {...others}\n >\n {_header}\n {_copyButton}\n {_editor}\n {_error}\n </Stack>\n );\n};\n"],"names":["CodeEditor","useStyles","createStyles","theme","root","editor","border","colors","gray","borderRadius","defaultRadius","backgroundColor","colorScheme","white","black","height","defaultProps","language","monacoLoader","defaultValue","minHeight","props","useComponentDefaultProps","onChange","onFocus","value","label","required","labelProps","error","errorProps","description","descriptionProps","maxHeight","disabled","others","useState","loaded","setLoaded","classes","useUncontrolled","finalValue","_value","handleChange","useParentHeight","parentHeight","ref","loadLocalMonaco","monacoInstance","loader","config","monaco","registerLanguages","XML","register","useEffect","_label","Input","Label","_description","Description","_error","Error","mt","Space","h","_header","Box","_copyButton","Group","position","CopyButton","timeout","copied","copy","Tooltip","withArrow","ActionIcon","color","onClick","CheckSize16Px","CopySize16Px","_editor","p","pl","className","Editor","defaultLanguage","options","minimap","enabled","wordWrap","wrappingStrategy","scrollBeyondLastLine","formatOnPaste","fontSize","fontSizes","xs","readOnly","tabSize","onMount","onDidFocusEditorText","onDidBlurEditorText","getAction","run","Center","Loader","Stack","justify","spacing","sx","Math","max"],"mappings":";;;;+BAqFaA;;;eAAAA;;;;;;;;;;;gCArF6B;oBAiBnC;qBACuB;2DACO;sBACgB;sBAEvB;mBACZ;AAElB,IAAMC,YAAYC,IAAAA,kBAAY,EAAC,SAACC;WAAW;QACvCC,MAAM,CAAC;QACPC,QAAQ;YACJC,QAAQ,AAAC,aAAiC,OAArBH,MAAMI,MAAM,CAACC,IAAI,CAAC,EAAE;YACzCC,cAAcN,MAAMO,aAAa;YACjCC,iBAAiBR,MAAMS,WAAW,KAAK,UAAUT,MAAMU,KAAK,GAAGV,MAAMW,KAAK;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AAU,SAAS;YAC1D4E,SAAS;gBACLC,SAAS;oBAACC,SAAS,KAAK;gBAAA;gBACxBC,UAAU;gBACVC,kBAAkB;gBAClBC,sBAAsB,KAAK;gBAC3BC,eAAe,IAAI;gBACnBC,UAAU5F,MAAM6F,SAAS,CAACC,EAAE;gBAC5BC,UAAUhE;gBACViE,SAAS;YACb;YACA1E,OAAOiB;YACPnB,UAAUoB;YACVyD,SAAS,SAAC/F,QAAQ8C,QAAW;gBACzBC,kBAAkBD;gBAClB9C,OAAOgG,oBAAoB,CAAC7E;gBAC5BnB,OAAOiG,mBAAmB,eAAC,kBAAA,WAAY;;;;gCACnC;;oCAAMjG,OAAOkG,SAAS,CAAC,gCAAgCC,GAAG;;;gCAA1D;;;;;;gBACJ;YACJ;;uBAIR,qBAACC,YAAM;QAACpB,WAAW9C,QAAQlC,MAAM;kBAC7B,cAAA,qBAACqG,YAAM;MAEd;IAED,qBACI,sBAACC,WAAK;QACFC,SAAQ;QACRvB,WAAW9C,QAAQnC,IAAI;QACvByG,SAAS;QACTC,IAAI;YAAC/F,QAAQgG,KAAKC,GAAG,CAACnE,cAAczB;YAAYa,WAAAA;QAAS;QACzDa,KAAKA;OACDX;;YAEH+B;YACAE;YACAc;YACArB;;;AAGb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/components/code-editor/__mocks__/@monaco-editor/react.tsx"],"sourcesContent":["import {EditorProps} from '@monaco-editor/react';\nimport {FunctionComponent, useEffect} from 'react';\n\nconst editor: any = {\n onDidFocusEditorText: jest.fn(),\n onDidBlurEditorText: jest.fn(),\n};\n\nconst monaco: any = jest.fn();\n\nconst MockedEditor: FunctionComponent<EditorProps> = (props) => {\n useEffect(() => {\n props.onMount(editor, monaco);\n }, []);\n return <div data-testid=\"monaco-editor\" />;\n};\n\nexport default MockedEditor;\n\nexport const loader = {\n config: jest.fn(),\n};\n\nexport const useMonaco = () => jest.fn();\n"],"names":["loader","useMonaco","editor","onDidFocusEditorText","jest","fn","onDidBlurEditorText","monaco","MockedEditor","props","useEffect","onMount","div","data-testid","config"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/components/code-editor/__mocks__/@monaco-editor/react.tsx"],"sourcesContent":["import {EditorProps} from '@monaco-editor/react';\nimport {FunctionComponent, useEffect} from 'react';\n\nconst editor: any = {\n onDidFocusEditorText: jest.fn(),\n onDidBlurEditorText: jest.fn(),\n};\n\nconst monaco: any = jest.fn();\n\nconst MockedEditor: FunctionComponent<EditorProps> = (props) => {\n useEffect(() => {\n props.onMount(editor, monaco);\n }, []);\n return <div data-testid=\"monaco-editor\" />;\n};\n\nexport default MockedEditor;\n\nexport const loader = {\n config: jest.fn(),\n};\n\nexport const useMonaco = () => jest.fn();\n"],"names":["loader","useMonaco","editor","onDidFocusEditorText","jest","fn","onDidBlurEditorText","monaco","MockedEditor","props","useEffect","onMount","div","data-testid","config"],"mappings":";;;;;;;;;;;IAiBA,OAA4B;eAA5B;;IAEaA,MAAM;eAANA;;IAIAC,SAAS;eAATA;;;;qBAtB8B;AAE3C,IAAMC,SAAc;IAChBC,sBAAsBC,KAAKC,EAAE;IAC7BC,qBAAqBF,KAAKC,EAAE;AAChC;AAEA,IAAME,SAAcH,KAAKC,EAAE;AAE3B,IAAMG,eAA+C,SAACC,OAAU;IAC5DC,IAAAA,gBAAS,EAAC,WAAM;QACZD,MAAME,OAAO,CAACT,QAAQK;IAC1B,GAAG,EAAE;IACL,qBAAO,qBAACK;QAAIC,eAAY;;AAC5B;IAEA,WAAeL;AAER,IAAMR,SAAS;IAClBc,QAAQV,KAAKC,EAAE;AACnB;AAEO,IAAMJ,YAAY;WAAMG,KAAKC,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/code-editor/__mocks__/monaco-editor.ts"],"sourcesContent":["const editor = {\n create: () => ({\n dispose: (): void => null,\n }),\n};\n\nexport const monaco = {\n editor,\n};\n"],"names":["monaco","editor","create","dispose"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/code-editor/__mocks__/monaco-editor.ts"],"sourcesContent":["const editor = {\n create: () => ({\n dispose: (): void => null,\n }),\n};\n\nexport const monaco = {\n editor,\n};\n"],"names":["monaco","editor","create","dispose"],"mappings":";;;;+BAMaA;;;eAAAA;;;AANb,IAAMC,SAAS;IACXC,QAAQ;eAAO;YACXC,SAAS;uBAAY,IAAI;;QAC7B;;AACJ;AAEO,IAAMH,SAAS;IAClBC,QAAAA;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/code-editor/index.ts"],"sourcesContent":["export * from './CodeEditor';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/code-editor/index.ts"],"sourcesContent":["export * from './CodeEditor';\n"],"names":[],"mappings":";;;;;oBAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/code-editor/languages/xml.ts"],"sourcesContent":["import {Monaco} from '@monaco-editor/react';\n\nconst format = (xml: string): string => {\n // https://stackoverflow.com/questions/57039218/doesnt-monaco-editor-support-xml-language-by-default\n const PADDING = ' '.repeat(2);\n const reg = /(>)(<)(\\/*)/g;\n let pad = 0;\n\n xml = xml.replace(reg, '$1\\r\\n$2$3');\n\n return xml\n .split('\\r\\n')\n .map((node) => {\n let indent = 0;\n if (node.match(/.+<\\/\\w[^>]*>$/)) {\n indent = 0;\n } else if (node.match(/^<\\/\\w/) && pad > 0) {\n pad -= 1;\n } else if (node.match(/^<\\w[^>]*[^/]>.*$/)) {\n indent = 1;\n } else {\n indent = 0;\n }\n\n pad += indent;\n\n return PADDING.repeat(pad - indent) + node;\n })\n .join('\\r\\n');\n};\n\nconst register = (monaco: Monaco): void => {\n monaco.languages.registerDocumentFormattingEditProvider('xml', {\n provideDocumentFormattingEdits: async (model) => [\n {\n range: model.getFullModelRange(),\n text: format(model.getValue()),\n },\n ],\n });\n};\n\nexport const XML = {register};\n"],"names":["XML","format","xml","PADDING","repeat","reg","pad","replace","split","map","node","indent","match","join","register","monaco","languages","registerDocumentFormattingEditProvider","provideDocumentFormattingEdits","model","range","getFullModelRange","text","getValue"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/code-editor/languages/xml.ts"],"sourcesContent":["import {Monaco} from '@monaco-editor/react';\n\nconst format = (xml: string): string => {\n // https://stackoverflow.com/questions/57039218/doesnt-monaco-editor-support-xml-language-by-default\n const PADDING = ' '.repeat(2);\n const reg = /(>)(<)(\\/*)/g;\n let pad = 0;\n\n xml = xml.replace(reg, '$1\\r\\n$2$3');\n\n return xml\n .split('\\r\\n')\n .map((node) => {\n let indent = 0;\n if (node.match(/.+<\\/\\w[^>]*>$/)) {\n indent = 0;\n } else if (node.match(/^<\\/\\w/) && pad > 0) {\n pad -= 1;\n } else if (node.match(/^<\\w[^>]*[^/]>.*$/)) {\n indent = 1;\n } else {\n indent = 0;\n }\n\n pad += indent;\n\n return PADDING.repeat(pad - indent) + node;\n })\n .join('\\r\\n');\n};\n\nconst register = (monaco: Monaco): void => {\n monaco.languages.registerDocumentFormattingEditProvider('xml', {\n provideDocumentFormattingEdits: async (model) => [\n {\n range: model.getFullModelRange(),\n text: format(model.getValue()),\n },\n ],\n });\n};\n\nexport const XML = {register};\n"],"names":["XML","format","xml","PADDING","repeat","reg","pad","replace","split","map","node","indent","match","join","register","monaco","languages","registerDocumentFormattingEditProvider","provideDocumentFormattingEdits","model","range","getFullModelRange","text","getValue"],"mappings":";;;;+BA0CaA;;;eAAAA;;;;;AAxCb,IAAMC,SAAS,SAACC,KAAwB;IACpC,oGAAoG;IACpG,IAAMC,UAAU,IAAIC,MAAM,CAAC;IAC3B,IAAMC,MAAM;IACZ,IAAIC,MAAM;IAEVJ,MAAMA,IAAIK,OAAO,CAACF,KAAK;IAEvB,OAAOH,IACFM,KAAK,CAAC,QACNC,GAAG,CAAC,SAACC,MAAS;QACX,IAAIC,SAAS;QACb,IAAID,KAAKE,KAAK,CAAC,mBAAmB;YAC9BD,SAAS;QACb,OAAO,IAAID,KAAKE,KAAK,CAAC,aAAaN,MAAM,GAAG;YACxCA,OAAO;QACX,OAAO,IAAII,KAAKE,KAAK,CAAC,sBAAsB;YACxCD,SAAS;QACb,OAAO;YACHA,SAAS;QACb,CAAC;QAEDL,OAAOK;QAEP,OAAOR,QAAQC,MAAM,CAACE,MAAMK,UAAUD;IAC1C,GACCG,IAAI,CAAC;AACd;AAEA,IAAMC,WAAW,SAACC,QAAyB;IACvCA,OAAOC,SAAS,CAACC,sCAAsC,CAAC,OAAO;QAC3DC,8BAA8B;uBAAE,kBAAA,SAAOC;;oBAAU;;;4BAC7C;gCACIC,OAAOD,MAAME,iBAAiB;gCAC9BC,MAAMrB,OAAOkB,MAAMI,QAAQ;4BAC/B;;;;;4BAJmCJ;;;;IAM3C;AACJ;AAEO,IAAMnB,MAAM;IAACc,UAAAA;AAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/collection/Collection.tsx"],"sourcesContent":["import {AddSize16Px} from '@coveord/plasma-react-icons';\nimport {\n Box,\n DefaultProps,\n Group,\n Input,\n InputWrapperBaseProps,\n MantineNumberSize,\n Selectors,\n Stack,\n Tooltip,\n useComponentDefaultProps,\n} from '@mantine/core';\nimport {ReorderPayload} from '@mantine/form/lib/types';\nimport {useDidUpdate, useId} from '@mantine/hooks';\nimport {ReactNode} from 'react';\nimport {DragDropContext, Droppable} from 'react-beautiful-dnd';\n\nimport {Button} from '../button';\nimport useStyles from './Collection.styles';\nimport {CollectionItem} from './CollectionItem';\n\ninterface CollectionProps<T>\n extends Omit<InputWrapperBaseProps, 'inputContainer' | 'inputWrapperOrder'>,\n DefaultProps<Selectors<typeof useStyles>> {\n /**\n * The default value each new item should have\n */\n newItem: T;\n /**\n * A render function called for each item passed in the `value` prop.\n *\n * @param item The current item's value\n * @param index The current item's index\n */\n children: (item: T, index: number) => ReactNode;\n /**\n * The list of items to display inside the collection\n *\n * @default []\n */\n value?: T[];\n /**\n * Unused, has no effect\n */\n onFocus?: () => void;\n /**\n * Function called whenever the value needs to be updated\n *\n * @param value The whole list of items after the change\n */\n onChange?: (value: T[]) => void;\n /**\n * Function called after an item is removed from the collection using the remove button\n *\n * @param itemIndex The index of the item that was removed\n */\n onRemoveItem?: (itemIndex: number) => void;\n /**\n * Function that gets called whenever a collection item needs to be reordered\n *\n * @param payload The origin and destination index of the item to reorder\n */\n onReorderItem?: (payload: ReorderPayload) => void;\n /**\n * Function that gets called when a new item needs to be added to the collection\n *\n * @param value The the value of the item to insert\n * @param index The index of the new item to insert\n */\n onInsertItem?: (value: T, index: number) => void;\n /**\n * Whether the collection should have drag and drop behavior enabled\n *\n * @default false\n */\n draggable?: boolean;\n /**\n * Whether the collection is disabled, or in other words in read only mode\n *\n * @default false\n */\n disabled?: boolean;\n /**\n * Function that determines if the add item button should be enabled given the current items of the collection.\n * The button is always enabled if this props remains undefined\n *\n * @param values The current items of the collection\n */\n allowAdd?: (values: T[]) => boolean;\n /**\n * The label of the add item button\n *\n * @default \"Add item\"\n */\n addLabel?: string;\n /**\n * The tooltip text displayed when hovering over the disabled add item button\n *\n * @default 'There is already an empty item'\n */\n addDisabledTooltip?: string;\n /**\n * The spacing between the colleciton items\n *\n * @default 'xs'\n */\n spacing?: MantineNumberSize;\n /**\n * Whether the collection is required. When required is true, the collection will hide the remove button if there is only one item\n *\n * @default false\n */\n required?: boolean;\n}\n\nconst defaultProps: Partial<CollectionProps<unknown>> = {\n draggable: false,\n addLabel: 'Add item',\n addDisabledTooltip: 'There is already an empty item',\n disabled: false,\n spacing: 'xs',\n required: false,\n};\n\nexport const Collection = <T,>(props: CollectionProps<T>) => {\n const {\n value,\n onChange,\n onRemoveItem,\n onReorderItem,\n onInsertItem,\n disabled,\n draggable,\n children,\n spacing,\n required,\n newItem,\n addLabel,\n addDisabledTooltip,\n allowAdd,\n label,\n labelProps,\n withAsterisk,\n description,\n descriptionProps,\n error,\n errorProps,\n\n // Style props\n classNames,\n className,\n styles,\n unstyled,\n\n ...others\n } = useComponentDefaultProps('Collection', defaultProps as CollectionProps<T>, props);\n const {classes, cx} = useStyles(null, {classNames, name: 'Collection', styles, unstyled});\n const collectionID = useId('dnd-droppable');\n\n const hasOnlyOneItem = value.length === 1;\n\n /**\n * Enforcing onChange when the value is modified will make sure the errors are carried through.\n */\n useDidUpdate(() => {\n onChange?.(value);\n }, [JSON.stringify(value)]);\n\n const isRequired = typeof withAsterisk === 'boolean' ? withAsterisk : required;\n const _label = label ? (\n <Input.Label required={isRequired} {...labelProps}>\n {label}\n </Input.Label>\n ) : null;\n\n const _description = description ? (\n <Input.Description {...descriptionProps}>{description}</Input.Description>\n ) : null;\n const _error = error ? <Input.Error {...errorProps}>{error}</Input.Error> : null;\n const _header =\n _label || _description ? (\n <>\n {_label}\n {_description}\n </>\n ) : null;\n\n const items = value.map((item, index) => (\n <CollectionItem\n key={index}\n disabled={disabled}\n draggable={draggable}\n index={index}\n onRemove={() => onRemoveItem?.(index)}\n styles={styles}\n removable={!(required && hasOnlyOneItem)}\n >\n {children(item, index)}\n </CollectionItem>\n ));\n\n const addAllowed = allowAdd?.(value) ?? true;\n\n const _addButton = disabled ? null : (\n <Group>\n <Tooltip label={addDisabledTooltip} disabled={addAllowed}>\n <Box>\n <Button\n variant=\"subtle\"\n leftIcon={<AddSize16Px height={16} />}\n onClick={() => onInsertItem(newItem, value?.length ?? 0)}\n disabled={!addAllowed}\n >\n {addLabel}\n </Button>\n </Box>\n </Tooltip>\n </Group>\n );\n\n return (\n <DragDropContext\n onDragEnd={({destination, source}) => onReorderItem({from: source.index, to: destination?.index || 0})}\n >\n <Droppable direction=\"vertical\" droppableId={collectionID}>\n {(provided) => (\n <Box\n {...provided.droppableProps}\n ref={provided.innerRef}\n className={cx(classes.root, className)}\n {...others}\n >\n {_header}\n <Stack spacing={spacing}>\n {items}\n {provided.placeholder}\n {_addButton}\n {_error}\n </Stack>\n </Box>\n )}\n </Droppable>\n </DragDropContext>\n );\n};\n"],"names":["Collection","defaultProps","draggable","addLabel","addDisabledTooltip","disabled","spacing","required","props","useComponentDefaultProps","value","onChange","onRemoveItem","onReorderItem","onInsertItem","children","newItem","allowAdd","label","labelProps","withAsterisk","description","descriptionProps","error","errorProps","classNames","className","styles","unstyled","others","useStyles","name","classes","cx","collectionID","useId","hasOnlyOneItem","length","useDidUpdate","JSON","stringify","isRequired","_label","Input","Label","_description","Description","_error","Error","_header","items","map","item","index","CollectionItem","onRemove","removable","addAllowed","_addButton","Group","Tooltip","Box","Button","variant","leftIcon","AddSize16Px","height","onClick","DragDropContext","onDragEnd","destination","source","from","to","Droppable","direction","droppableId","provided","droppableProps","ref","innerRef","root","Stack","placeholder"],"mappings":"AAAA;;;;+BA6HaA;;;eAAAA;;;;;;;;gCA7Ha;oBAYnB;qBAE2B;iCAEO;sBAEpB;qEACC;8BACO;AAgG7B,IAAMC,eAAkD;IACpDC,WAAW,KAAK;IAChBC,UAAU;IACVC,oBAAoB;IACpBC,UAAU,KAAK;IACfC,SAAS;IACTC,UAAU,KAAK;AACnB;AAEO,IAAMP,aAAa,SAAKQ,OAA8B;IACzD,IA8BIC,4BAAAA,IAAAA,8BAAwB,EAAC,cAAcR,cAAoCO,QA7B3EE,QA6BAD,0BA7BAC,OACAC,WA4BAF,0BA5BAE,UACAC,eA2BAH,0BA3BAG,cACAC,gBA0BAJ,0BA1BAI,eACAC,eAyBAL,0BAzBAK,cACAT,WAwBAI,0BAxBAJ,UACAH,YAuBAO,0BAvBAP,WACAa,WAsBAN,0BAtBAM,UACAT,UAqBAG,0BArBAH,SACAC,WAoBAE,0BApBAF,UACAS,UAmBAP,0BAnBAO,SACAb,WAkBAM,0BAlBAN,UACAC,qBAiBAK,0BAjBAL,oBACAa,WAgBAR,0BAhBAQ,UACAC,QAeAT,0BAfAS,OACAC,aAcAV,0BAdAU,YACAC,eAaAX,0BAbAW,cACAC,cAYAZ,0BAZAY,aACAC,m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|
+
{"version":3,"sources":["../../../../src/components/collection/Collection.tsx"],"sourcesContent":["import {AddSize16Px} from '@coveord/plasma-react-icons';\nimport {\n Box,\n DefaultProps,\n Group,\n Input,\n InputWrapperBaseProps,\n MantineNumberSize,\n Selectors,\n Stack,\n Tooltip,\n useComponentDefaultProps,\n} from '@mantine/core';\nimport {ReorderPayload} from '@mantine/form/lib/types';\nimport {useDidUpdate, useId} from '@mantine/hooks';\nimport {ReactNode} from 'react';\nimport {DragDropContext, Droppable} from 'react-beautiful-dnd';\n\nimport {Button} from '../button';\nimport useStyles from './Collection.styles';\nimport {CollectionItem} from './CollectionItem';\n\ninterface CollectionProps<T>\n extends Omit<InputWrapperBaseProps, 'inputContainer' | 'inputWrapperOrder'>,\n DefaultProps<Selectors<typeof useStyles>> {\n /**\n * The default value each new item should have\n */\n newItem: T;\n /**\n * A render function called for each item passed in the `value` prop.\n *\n * @param item The current item's value\n * @param index The current item's index\n */\n children: (item: T, index: number) => ReactNode;\n /**\n * The list of items to display inside the collection\n *\n * @default []\n */\n value?: T[];\n /**\n * Unused, has no effect\n */\n onFocus?: () => void;\n /**\n * Function called whenever the value needs to be updated\n *\n * @param value The whole list of items after the change\n */\n onChange?: (value: T[]) => void;\n /**\n * Function called after an item is removed from the collection using the remove button\n *\n * @param itemIndex The index of the item that was removed\n */\n onRemoveItem?: (itemIndex: number) => void;\n /**\n * Function that gets called whenever a collection item needs to be reordered\n *\n * @param payload The origin and destination index of the item to reorder\n */\n onReorderItem?: (payload: ReorderPayload) => void;\n /**\n * Function that gets called when a new item needs to be added to the collection\n *\n * @param value The the value of the item to insert\n * @param index The index of the new item to insert\n */\n onInsertItem?: (value: T, index: number) => void;\n /**\n * Whether the collection should have drag and drop behavior enabled\n *\n * @default false\n */\n draggable?: boolean;\n /**\n * Whether the collection is disabled, or in other words in read only mode\n *\n * @default false\n */\n disabled?: boolean;\n /**\n * Function that determines if the add item button should be enabled given the current items of the collection.\n * The button is always enabled if this props remains undefined\n *\n * @param values The current items of the collection\n */\n allowAdd?: (values: T[]) => boolean;\n /**\n * The label of the add item button\n *\n * @default \"Add item\"\n */\n addLabel?: string;\n /**\n * The tooltip text displayed when hovering over the disabled add item button\n *\n * @default 'There is already an empty item'\n */\n addDisabledTooltip?: string;\n /**\n * The spacing between the colleciton items\n *\n * @default 'xs'\n */\n spacing?: MantineNumberSize;\n /**\n * Whether the collection is required. When required is true, the collection will hide the remove button if there is only one item\n *\n * @default false\n */\n required?: boolean;\n}\n\nconst defaultProps: Partial<CollectionProps<unknown>> = {\n draggable: false,\n addLabel: 'Add item',\n addDisabledTooltip: 'There is already an empty item',\n disabled: false,\n spacing: 'xs',\n required: false,\n};\n\nexport const Collection = <T,>(props: CollectionProps<T>) => {\n const {\n value,\n onChange,\n onRemoveItem,\n onReorderItem,\n onInsertItem,\n disabled,\n draggable,\n children,\n spacing,\n required,\n newItem,\n addLabel,\n addDisabledTooltip,\n allowAdd,\n label,\n labelProps,\n withAsterisk,\n description,\n descriptionProps,\n error,\n errorProps,\n\n // Style props\n classNames,\n className,\n styles,\n unstyled,\n\n ...others\n } = useComponentDefaultProps('Collection', defaultProps as CollectionProps<T>, props);\n const {classes, cx} = useStyles(null, {classNames, name: 'Collection', styles, unstyled});\n const collectionID = useId('dnd-droppable');\n\n const hasOnlyOneItem = value.length === 1;\n\n /**\n * Enforcing onChange when the value is modified will make sure the errors are carried through.\n */\n useDidUpdate(() => {\n onChange?.(value);\n }, [JSON.stringify(value)]);\n\n const isRequired = typeof withAsterisk === 'boolean' ? withAsterisk : required;\n const _label = label ? (\n <Input.Label required={isRequired} {...labelProps}>\n {label}\n </Input.Label>\n ) : null;\n\n const _description = description ? (\n <Input.Description {...descriptionProps}>{description}</Input.Description>\n ) : null;\n const _error = error ? <Input.Error {...errorProps}>{error}</Input.Error> : null;\n const _header =\n _label || _description ? (\n <>\n {_label}\n {_description}\n </>\n ) : null;\n\n const items = value.map((item, index) => (\n <CollectionItem\n key={index}\n disabled={disabled}\n draggable={draggable}\n index={index}\n onRemove={() => onRemoveItem?.(index)}\n styles={styles}\n removable={!(required && hasOnlyOneItem)}\n >\n {children(item, index)}\n </CollectionItem>\n ));\n\n const addAllowed = allowAdd?.(value) ?? true;\n\n const _addButton = disabled ? null : (\n <Group>\n <Tooltip label={addDisabledTooltip} disabled={addAllowed}>\n <Box>\n <Button\n variant=\"subtle\"\n leftIcon={<AddSize16Px height={16} />}\n onClick={() => onInsertItem(newItem, value?.length ?? 0)}\n disabled={!addAllowed}\n >\n {addLabel}\n </Button>\n </Box>\n </Tooltip>\n </Group>\n );\n\n return (\n <DragDropContext\n onDragEnd={({destination, source}) => onReorderItem({from: source.index, to: destination?.index || 0})}\n >\n <Droppable direction=\"vertical\" droppableId={collectionID}>\n {(provided) => (\n <Box\n {...provided.droppableProps}\n ref={provided.innerRef}\n className={cx(classes.root, className)}\n {...others}\n >\n {_header}\n <Stack spacing={spacing}>\n {items}\n {provided.placeholder}\n {_addButton}\n {_error}\n </Stack>\n </Box>\n )}\n </Droppable>\n </DragDropContext>\n );\n};\n"],"names":["Collection","defaultProps","draggable","addLabel","addDisabledTooltip","disabled","spacing","required","props","useComponentDefaultProps","value","onChange","onRemoveItem","onReorderItem","onInsertItem","children","newItem","allowAdd","label","labelProps","withAsterisk","description","descriptionProps","error","errorProps","classNames","className","styles","unstyled","others","useStyles","name","classes","cx","collectionID","useId","hasOnlyOneItem","length","useDidUpdate","JSON","stringify","isRequired","_label","Input","Label","_description","Description","_error","Error","_header","items","map","item","index","CollectionItem","onRemove","removable","addAllowed","_addButton","Group","Tooltip","Box","Button","variant","leftIcon","AddSize16Px","height","onClick","DragDropContext","onDragEnd","destination","source","from","to","Droppable","direction","droppableId","provided","droppableProps","ref","innerRef","root","Stack","placeholder"],"mappings":";;;;+BA6HaA;;;eAAAA;;;;;;;;gCA7Ha;oBAYnB;qBAE2B;iCAEO;sBAEpB;qEACC;8BACO;AAgG7B,IAAMC,eAAkD;IACpDC,WAAW,KAAK;IAChBC,UAA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AM,cAAb3B,2BAAAA,gBAAiB,CAAC;;oBACvDL,UAAU,CAACoD;8BAEVtD;;;;MAKpB;IAED,qBACI,qBAACiE,kCAAe;QACZC,WAAW;gBAAEC,oBAAAA,aAAaC,eAAAA;YAAY1D,OAAAA,cAAc;gBAAC2D,MAAMD,OAAOlB,KAAK;gBAAEoB,IAAIH,CAAAA,wBAAAA,yBAAAA,KAAAA,IAAAA,YAAajB,KAAK,AAAD,KAAK;YAAC;;kBAEpG,cAAA,qBAACqB,4BAAS;YAACC,WAAU;YAAWC,aAAa1C;sBACxC,SAAC2C;qCACE,sBAAChB,SAAG,wEACIgB,SAASC,cAAc;oBAC3BC,KAAKF,SAASG,QAAQ;oBACtBtD,WAAWO,GAAGD,QAAQiD,IAAI,EAAEvD;oBACxBG;;wBAEHoB;sCACD,sBAACiC,WAAK;4BAAC5E,SAASA;;gCACX4C;gCACA2B,SAASM,WAAW;gCACpBzB;gCACAX;;;;;;;;AAO7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/collection/Collection.styles.ts"],"sourcesContent":["import {createStyles} from '@mantine/core';\n\nexport interface CollectionStylesParams {}\n\nexport default createStyles((theme) => ({\n root: {},\n item: {\n backgroundColor: theme.colorScheme === 'light' ? theme.white : theme.black,\n alignItems: 'baseline',\n },\n itemDragging: {\n boxShadow: theme.shadows.sm,\n },\n}));\n"],"names":["createStyles","theme","root","item","backgroundColor","colorScheme","white","black","alignItems","itemDragging","boxShadow","shadows","sm"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/collection/Collection.styles.ts"],"sourcesContent":["import {createStyles} from '@mantine/core';\n\nexport interface CollectionStylesParams {}\n\nexport default createStyles((theme) => ({\n root: {},\n item: {\n backgroundColor: theme.colorScheme === 'light' ? theme.white : theme.black,\n alignItems: 'baseline',\n },\n itemDragging: {\n boxShadow: theme.shadows.sm,\n },\n}));\n"],"names":["createStyles","theme","root","item","backgroundColor","colorScheme","white","black","alignItems","itemDragging","boxShadow","shadows","sm"],"mappings":";;;;+BAIA;;;eAAA;;;oBAJ2B;IAI3B,WAAeA,IAAAA,kBAAY,EAAC,SAACC;WAAW;QACpCC,MAAM,CAAC;QACPC,MAAM;YACFC,iBAAiBH,MAAMI,WAAW,KAAK,UAAUJ,MAAMK,KAAK,GAAGL,MAAMM,KAAK;YAC1EC,YAAY;QAChB;QACAC,cAAc;YACVC,WAAWT,MAAMU,OAAO,CAACC,EAAE;QAC/B;IACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/collection/CollectionItem.tsx"],"sourcesContent":["import {DragAndDropSize16Px, RemoveSize16Px} from '@coveord/plasma-react-icons';\nimport {ActionIcon, DefaultProps, Group, Selectors} from '@mantine/core';\nimport {FunctionComponent, PropsWithChildren} from 'react';\nimport {Draggable} from 'react-beautiful-dnd';\n\nimport useStyles from './Collection.styles';\n\ninterface CollectionItemProps extends CollectionItemSharedProps {\n draggable?: boolean;\n disabled: boolean;\n}\n\ninterface CollectionItemSharedProps extends DefaultProps<Selectors<typeof useStyles>> {\n index: number;\n onRemove?: React.MouseEventHandler<HTMLButtonElement>;\n removable?: boolean;\n}\n\nconst RemoveButton: FunctionComponent<{\n onClick: React.MouseEventHandler<HTMLButtonElement>;\n}> = ({onClick}) => (\n <ActionIcon variant=\"subtle\" onClick={onClick} color=\"action\">\n <RemoveSize16Px height={16} />\n </ActionIcon>\n);\n\nconst RemoveButtonPlaceholder = () => <div style={{width: 28}} />;\n\nconst StaticCollectionItem: FunctionComponent<PropsWithChildren<CollectionItemSharedProps>> = ({\n onRemove,\n removable = true,\n styles,\n children,\n}) => {\n const {classes, cx} = useStyles(null, {name: 'Collection', styles});\n const removeButton = removable && onRemove ? <RemoveButton onClick={onRemove} /> : <RemoveButtonPlaceholder />;\n\n return (\n <Group className={cx(classes.item)}>\n {children}\n {removeButton}\n </Group>\n );\n};\n\nconst DisabledCollectionItem: FunctionComponent<PropsWithChildren<CollectionItemSharedProps>> = ({\n children,\n styles,\n}) => {\n const {classes, cx} = useStyles(null, {name: 'Collection', styles});\n return <Group className={cx(classes.item)}>{children}</Group>;\n};\n\nconst DraggableCollectionItem: FunctionComponent<PropsWithChildren<CollectionItemSharedProps>> = ({\n index,\n onRemove,\n removable = true,\n styles,\n children,\n}) => {\n const {classes, cx} = useStyles(null, {name: 'Collection', styles});\n const removeButton = removable && onRemove ? <RemoveButton onClick={onRemove} /> : null;\n\n return (\n <Draggable index={index} draggableId={index.toString()}>\n {(provided, {isDragging}) => (\n <Group\n ref={provided.innerRef}\n {...provided.draggableProps}\n className={cx(classes.item, {[classes.itemDragging]: isDragging})}\n >\n <div {...provided.dragHandleProps}>\n <DragAndDropSize16Px height={16} />\n </div>\n {children}\n {removeButton}\n </Group>\n )}\n </Draggable>\n );\n};\n\nexport const CollectionItem: FunctionComponent<PropsWithChildren<CollectionItemProps>> = ({\n draggable,\n disabled,\n ...otherProps\n}) => {\n if (disabled) {\n return <DisabledCollectionItem {...otherProps} />;\n }\n if (draggable) {\n return <DraggableCollectionItem {...otherProps} />;\n }\n return <StaticCollectionItem {...otherProps} />;\n};\n"],"names":["CollectionItem","RemoveButton","onClick","ActionIcon","variant","color","RemoveSize16Px","height","RemoveButtonPlaceholder","div","style","width","StaticCollectionItem","onRemove","removable","styles","children","useStyles","name","classes","cx","removeButton","Group","className","item","DisabledCollectionItem","DraggableCollectionItem","index","Draggable","draggableId","toString","provided","isDragging","ref","innerRef","draggableProps","itemDragging","dragHandleProps","DragAndDropSize16Px","draggable","disabled","otherProps"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/collection/CollectionItem.tsx"],"sourcesContent":["import {DragAndDropSize16Px, RemoveSize16Px} from '@coveord/plasma-react-icons';\nimport {ActionIcon, DefaultProps, Group, Selectors} from '@mantine/core';\nimport {FunctionComponent, PropsWithChildren} from 'react';\nimport {Draggable} from 'react-beautiful-dnd';\n\nimport useStyles from './Collection.styles';\n\ninterface CollectionItemProps extends CollectionItemSharedProps {\n draggable?: boolean;\n disabled: boolean;\n}\n\ninterface CollectionItemSharedProps extends DefaultProps<Selectors<typeof useStyles>> {\n index: number;\n onRemove?: React.MouseEventHandler<HTMLButtonElement>;\n removable?: boolean;\n}\n\nconst RemoveButton: FunctionComponent<{\n onClick: React.MouseEventHandler<HTMLButtonElement>;\n}> = ({onClick}) => (\n <ActionIcon variant=\"subtle\" onClick={onClick} color=\"action\">\n <RemoveSize16Px height={16} />\n </ActionIcon>\n);\n\nconst RemoveButtonPlaceholder = () => <div style={{width: 28}} />;\n\nconst StaticCollectionItem: FunctionComponent<PropsWithChildren<CollectionItemSharedProps>> = ({\n onRemove,\n removable = true,\n styles,\n children,\n}) => {\n const {classes, cx} = useStyles(null, {name: 'Collection', styles});\n const removeButton = removable && onRemove ? <RemoveButton onClick={onRemove} /> : <RemoveButtonPlaceholder />;\n\n return (\n <Group className={cx(classes.item)}>\n {children}\n {removeButton}\n </Group>\n );\n};\n\nconst DisabledCollectionItem: FunctionComponent<PropsWithChildren<CollectionItemSharedProps>> = ({\n children,\n styles,\n}) => {\n const {classes, cx} = useStyles(null, {name: 'Collection', styles});\n return <Group className={cx(classes.item)}>{children}</Group>;\n};\n\nconst DraggableCollectionItem: FunctionComponent<PropsWithChildren<CollectionItemSharedProps>> = ({\n index,\n onRemove,\n removable = true,\n styles,\n children,\n}) => {\n const {classes, cx} = useStyles(null, {name: 'Collection', styles});\n const removeButton = removable && onRemove ? <RemoveButton onClick={onRemove} /> : null;\n\n return (\n <Draggable index={index} draggableId={index.toString()}>\n {(provided, {isDragging}) => (\n <Group\n ref={provided.innerRef}\n {...provided.draggableProps}\n className={cx(classes.item, {[classes.itemDragging]: isDragging})}\n >\n <div {...provided.dragHandleProps}>\n <DragAndDropSize16Px height={16} />\n </div>\n {children}\n {removeButton}\n </Group>\n )}\n </Draggable>\n );\n};\n\nexport const CollectionItem: FunctionComponent<PropsWithChildren<CollectionItemProps>> = ({\n draggable,\n disabled,\n ...otherProps\n}) => {\n if (disabled) {\n return <DisabledCollectionItem {...otherProps} />;\n }\n if (draggable) {\n return <DraggableCollectionItem {...otherProps} />;\n }\n return <StaticCollectionItem {...otherProps} />;\n};\n"],"names":["CollectionItem","RemoveButton","onClick","ActionIcon","variant","color","RemoveSize16Px","height","RemoveButtonPlaceholder","div","style","width","StaticCollectionItem","onRemove","removable","styles","children","useStyles","name","classes","cx","removeButton","Group","className","item","DisabledCollectionItem","DraggableCollectionItem","index","Draggable","draggableId","toString","provided","isDragging","ref","innerRef","draggableProps","itemDragging","dragHandleProps","DragAndDropSize16Px","draggable","disabled","otherProps"],"mappings":";;;;+BAkFaA;;;eAAAA;;;;;;;;;gCAlFqC;oBACO;iCAEjC;qEAEF;AAatB,IAAMC,eAED;QAAEC,gBAAAA;yBACH,qBAACC,gBAAU;QAACC,SAAQ;QAASF,SAASA;QAASG,OAAM;kBACjD,cAAA,qBAACC,gCAAc;YAACC,QAAQ;;;;AAIhC,IAAMC,0BAA0B;yBAAM,qBAACC;QAAIC,OAAO;YAACC,OAAO;QAAE;;;AAE5D,IAAMC,uBAAwF,gBAKxF;QAJFC,iBAAAA,mCACAC,WAAAA,0CAAY,IAAI,qBAChBC,eAAAA,QACAC,iBAAAA;IAEA,IAAsBC,aAAAA,IAAAA,yBAAS,EAAC,IAAI,EAAE;QAACC,MAAM;QAAcH,QAAAA;IAAM,IAA1DI,UAAeF,WAAfE,SAASC,KAAMH,WAANG;IAChB,IAAMC,eAAeP,aAAaD,yBAAW,qBAACZ;QAAaC,SAASW;uBAAe,qBAACL,4BAA0B;IAE9G,qBACI,sBAACc,WAAK;QAACC,WAAWH,GAAGD,QAAQK,IAAI;;YAC5BR;YACAK;;;AAGb;AAEA,IAAMI,yBAA0F,gBAG1F;QAFFT,iBAAAA,UACAD,eAAAA;IAEA,IAAsBE,aAAAA,IAAAA,yBAAS,EAAC,IAAI,EAAE;QAACC,MAAM;QAAcH,QAAAA;IAAM,IAA1DI,UAAeF,WAAfE,SAASC,KAAMH,WAANG;IAChB,qBAAO,qBAACE,WAAK;QAACC,WAAWH,GAAGD,QAAQK,IAAI;kBAAIR;;AAChD;AAEA,IAAMU,0BAA2F,gBAM3F;QALFC,cAAAA,OACAd,iBAAAA,mCACAC,WAAAA,0CAAY,IAAI,qBAChBC,eAAAA,QACAC,iBAAAA;IAEA,IAAsBC,aAAAA,IAAAA,yBAAS,EAAC,IAAI,EAAE;QAACC,MAAM;QAAcH,QAAAA;IAAM,IAA1DI,UAAeF,WAAfE,SAASC,KAAMH,WAANG;IAChB,IAAMC,eAAeP,aAAaD,yBAAW,qBAACZ;QAAaC,SAASW;SAAe,IAAI;IAEvF,qBACI,qBAACe,4BAAS;QAACD,OAAOA;QAAOE,aAAaF,MAAMG,QAAQ;kBAC/C,SAACC;gBAAWC,mBAAAA;iCACT,sBAACV,WAAK;gBACFW,KAAKF,SAASG,QAAQ;eAClBH,SAASI,cAAc;gBAC3BZ,WAAWH,GAAGD,QAAQK,IAAI,EAAG,oBAACL,QAAQiB,YAAY,EAAGJ;;kCAErD,qBAACvB,4CAAQsB,SAASM,eAAe;kCAC7B,cAAA,qBAACC,qCAAmB;4BAAC/B,QAAQ;;;oBAEhCS;oBACAK;;;;;AAKrB;AAEO,IAAMrB,iBAA4E,iBAInF;QAHFuC,mBAAAA,WACAC,kBAAAA,UACGC;QAFHF;QACAC;;IAGA,IAAIA,UAAU;QACV,qBAAO,qBAACf,0CAA2BgB;IACvC,CAAC;IACD,IAAIF,WAAW;QACX,qBAAO,qBAACb,2CAA4Be;IACxC,CAAC;IACD,qBAAO,qBAAC7B,wCAAyB6B;AACrC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/collection/index.ts"],"sourcesContent":["export * from './Collection';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/collection/index.ts"],"sourcesContent":["export * from './Collection';\n"],"names":[],"mappings":";;;;;oBAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/date-range-picker/DateRangePickerInlineCalendar.tsx"],"sourcesContent":["import {Center, Group, Space} from '@mantine/core';\nimport {DateRangePickerValue, RangeCalendar, RangeCalendarProps} from '@mantine/dates';\nimport {useForm} from '@mantine/form';\n\nimport {Button} from '../button';\nimport {DateRangePickerPreset, DateRangePickerPresetSelect} from './DateRangePickerPresetSelect';\nimport {EditableDateRangePicker, EditableDateRangePickerProps} from './EditableDateRangePicker';\n\nexport interface DateRangePickerInlineCalendarProps\n extends Pick<EditableDateRangePickerProps, 'startProps' | 'endProps'> {\n /**\n * Initial selected range\n */\n initialRange: DateRangePickerValue;\n /**\n * Function called when the user applies the new date range\n *\n * @param range the newly selected dates\n */\n onApply: (range: DateRangePickerValue) => void;\n /**\n * Function called when the user click on the cancel button\n */\n onCancel: () => void;\n /**\n * The presets to display\n *\n * @default {}\n * @example\n * {\n * january: {label: 'January', range: [new Date(2022, 0, 1), new Date(2022, 0, 31)]},\n * february: {label: 'February', range: [new Date(2022, 1, 1), new Date(2022, 1, 28)]}\n * }\n */\n presets?: Record<string, DateRangePickerPreset>;\n /**\n * Props for RangeCalendar displayed in the popover\n */\n rangeCalendarProps?: Omit<RangeCalendarProps, 'value' | 'onChange'>;\n}\n\nexport const DateRangePickerInlineCalendar = ({\n initialRange,\n onApply,\n onCancel,\n presets,\n startProps,\n endProps,\n rangeCalendarProps,\n}: DateRangePickerInlineCalendarProps) => {\n const form = useForm({\n initialValues: {\n dates: initialRange,\n },\n });\n const calendarInputProps = form.getInputProps('dates');\n\n const onCalendarApply = () => {\n if (!form.values.dates[1]) {\n form.values.dates[1] = form.values.dates[0]; // when date range is the same day\n }\n onApply(form.values.dates);\n };\n\n return (\n <>\n <Group\n align=\"center\"\n spacing=\"xs\"\n grow\n px=\"md\"\n py=\"sm\"\n sx={(theme) => ({\n borderBottom: `1px solid ${theme.colors.gray[2]}`,\n })}\n >\n <EditableDateRangePicker {...calendarInputProps} startProps={startProps} endProps={endProps} />\n {presets ? (\n <>\n <Space w=\"sm\" />\n <DateRangePickerPresetSelect presets={presets} {...calendarInputProps} />\n </>\n ) : null}\n </Group>\n\n <Center py=\"sm\" px=\"md\">\n <RangeCalendar\n amountOfMonths={2}\n styles={{cell: {textAlign: 'center'}}}\n firstDayOfWeek=\"sunday\"\n allowSingleDateInRange\n {...rangeCalendarProps}\n {...calendarInputProps}\n />\n </Center>\n\n <Group\n position=\"right\"\n spacing=\"xs\"\n px=\"md\"\n py=\"sm\"\n sx={(theme) => ({\n borderTop: `1px solid ${theme.colors.gray[2]}`,\n })}\n >\n <Button size=\"xs\" onClick={onCalendarApply}>\n Apply\n </Button>\n <Button variant=\"outline\" size=\"xs\" onClick={onCancel}>\n Cancel\n </Button>\n </Group>\n </>\n );\n};\n"],"names":["DateRangePickerInlineCalendar","initialRange","onApply","onCancel","presets","startProps","endProps","rangeCalendarProps","form","useForm","initialValues","dates","calendarInputProps","getInputProps","onCalendarApply","values","Group","align","spacing","grow","px","py","sx","theme","borderBottom","colors","gray","EditableDateRangePicker","Space","w","DateRangePickerPresetSelect","Center","RangeCalendar","amountOfMonths","styles","cell","textAlign","firstDayOfWeek","allowSingleDateInRange","position","borderTop","Button","size","onClick","variant"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/date-range-picker/DateRangePickerInlineCalendar.tsx"],"sourcesContent":["import {Center, Group, Space} from '@mantine/core';\nimport {DateRangePickerValue, RangeCalendar, RangeCalendarProps} from '@mantine/dates';\nimport {useForm} from '@mantine/form';\n\nimport {Button} from '../button';\nimport {DateRangePickerPreset, DateRangePickerPresetSelect} from './DateRangePickerPresetSelect';\nimport {EditableDateRangePicker, EditableDateRangePickerProps} from './EditableDateRangePicker';\n\nexport interface DateRangePickerInlineCalendarProps\n extends Pick<EditableDateRangePickerProps, 'startProps' | 'endProps'> {\n /**\n * Initial selected range\n */\n initialRange: DateRangePickerValue;\n /**\n * Function called when the user applies the new date range\n *\n * @param range the newly selected dates\n */\n onApply: (range: DateRangePickerValue) => void;\n /**\n * Function called when the user click on the cancel button\n */\n onCancel: () => void;\n /**\n * The presets to display\n *\n * @default {}\n * @example\n * {\n * january: {label: 'January', range: [new Date(2022, 0, 1), new Date(2022, 0, 31)]},\n * february: {label: 'February', range: [new Date(2022, 1, 1), new Date(2022, 1, 28)]}\n * }\n */\n presets?: Record<string, DateRangePickerPreset>;\n /**\n * Props for RangeCalendar displayed in the popover\n */\n rangeCalendarProps?: Omit<RangeCalendarProps, 'value' | 'onChange'>;\n}\n\nexport const DateRangePickerInlineCalendar = ({\n initialRange,\n onApply,\n onCancel,\n presets,\n startProps,\n endProps,\n rangeCalendarProps,\n}: DateRangePickerInlineCalendarProps) => {\n const form = useForm({\n initialValues: {\n dates: initialRange,\n },\n });\n const calendarInputProps = form.getInputProps('dates');\n\n const onCalendarApply = () => {\n if (!form.values.dates[1]) {\n form.values.dates[1] = form.values.dates[0]; // when date range is the same day\n }\n onApply(form.values.dates);\n };\n\n return (\n <>\n <Group\n align=\"center\"\n spacing=\"xs\"\n grow\n px=\"md\"\n py=\"sm\"\n sx={(theme) => ({\n borderBottom: `1px solid ${theme.colors.gray[2]}`,\n })}\n >\n <EditableDateRangePicker {...calendarInputProps} startProps={startProps} endProps={endProps} />\n {presets ? (\n <>\n <Space w=\"sm\" />\n <DateRangePickerPresetSelect presets={presets} {...calendarInputProps} />\n </>\n ) : null}\n </Group>\n\n <Center py=\"sm\" px=\"md\">\n <RangeCalendar\n amountOfMonths={2}\n styles={{cell: {textAlign: 'center'}}}\n firstDayOfWeek=\"sunday\"\n allowSingleDateInRange\n {...rangeCalendarProps}\n {...calendarInputProps}\n />\n </Center>\n\n <Group\n position=\"right\"\n spacing=\"xs\"\n px=\"md\"\n py=\"sm\"\n sx={(theme) => ({\n borderTop: `1px solid ${theme.colors.gray[2]}`,\n })}\n >\n <Button size=\"xs\" onClick={onCalendarApply}>\n Apply\n </Button>\n <Button variant=\"outline\" size=\"xs\" onClick={onCancel}>\n Cancel\n </Button>\n </Group>\n </>\n );\n};\n"],"names":["DateRangePickerInlineCalendar","initialRange","onApply","onCancel","presets","startProps","endProps","rangeCalendarProps","form","useForm","initialValues","dates","calendarInputProps","getInputProps","onCalendarApply","values","Group","align","spacing","grow","px","py","sx","theme","borderBottom","colors","gray","EditableDateRangePicker","Space","w","DateRangePickerPresetSelect","Center","RangeCalendar","amountOfMonths","styles","cell","textAlign","firstDayOfWeek","allowSingleDateInRange","position","borderTop","Button","size","onClick","variant"],"mappings":";;;;+BAyCaA;;;eAAAA;;;;;;oBAzCsB;qBACmC;oBAChD;sBAED;2CAC4C;uCACG;AAmC7D,IAAMA,gCAAgC,gBAQH;QAPtCC,qBAAAA,cACAC,gBAAAA,SACAC,iBAAAA,UACAC,gBAAAA,SACAC,mBAAAA,YACAC,iBAAAA,UACAC,2BAAAA;IAEA,IAAMC,OAAOC,IAAAA,aAAO,EAAC;QACjBC,eAAe;YACXC,OAAOV;QACX;IACJ;IACA,IAAMW,qBAAqBJ,KAAKK,aAAa,CAAC;IAE9C,IAAMC,kBAAkB,WAAM;QAC1B,IAAI,CAACN,KAAKO,MAAM,CAACJ,KAAK,CAAC,EAAE,EAAE;YACvBH,KAAKO,MAAM,CAACJ,KAAK,CAAC,EAAE,GAAGH,KAAKO,MAAM,CAACJ,KAAK,CAAC,EAAE,EAAE,kCAAkC;QACnF,CAAC;QACDT,QAAQM,KAAKO,MAAM,CAACJ,KAAK;IAC7B;IAEA,qBACI;;0BACI,sBAACK,WAAK;gBACFC,OAAM;gBACNC,SAAQ;gBACRC,IAAI;gBACJC,IAAG;gBACHC,IAAG;gBACHC,IAAI,SAACC;2BAAW;wBACZC,cAAc,AAAC,aAAiC,OAArBD,MAAME,MAAM,CAACC,IAAI,CAAC,EAAE;oBACnD;;;kCAEA,qBAACC,gDAAuB,uCAAKf;wBAAoBP,YAAYA;wBAAYC,UAAUA;;oBAClFF,wBACG;;0CACI,qBAACwB,WAAK;gCAACC,GAAE;;0CACT,qBAACC,wDAA2B;gCAAC1B,SAASA;+BAAaQ;;yBAEvD,IAAI;;;0BAGZ,qBAACmB,YAAM;gBAACV,IAAG;gBAAKD,IAAG;0BACf,cAAA,qBAACY,oBAAa;oBACVC,gBAAgB;oBAChBC,QAAQ;wBAACC,MAAM;4BAACC,WAAW;wBAAQ;oBAAC;oBACpCC,gBAAe;oBACfC,sBAAsB;mBAClB/B,oBACAK;;0BAIZ,sBAACI,WAAK;gBACFuB,UAAS;gBACTrB,SAAQ;gBACRE,IAAG;gBACHC,IAAG;gBACHC,IAAI,SAACC;2BAAW;wBACZiB,WAAW,AAAC,aAAiC,OAArBjB,MAAME,MAAM,CAACC,IAAI,CAAC,EAAE;oBAChD;;;kCAEA,qBAACe,cAAM;wBAACC,MAAK;wBAAKC,SAAS7B;kCAAiB;;kCAG5C,qBAAC2B,cAAM;wBAACG,SAAQ;wBAAUF,MAAK;wBAAKC,SAASxC;kCAAU;;;;;;AAMvE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/date-range-picker/DateRangePickerPopoverCalendar.tsx"],"sourcesContent":["import {DateRangePickerValue, RangeCalendar, RangeCalendarProps} from '@mantine/dates';\nimport {Group, Popover, Space} from '@mantine/core';\nimport {useClickOutside, useUncontrolled} from '@mantine/hooks';\nimport {useState} from 'react';\n\nimport {EditableDateRangePicker, EditableDateRangePickerProps} from './EditableDateRangePicker';\nimport {DateRangePickerPresetSelect, DateRangePickerPreset} from './DateRangePickerPresetSelect';\n\ninterface DateRangePickerPopoverCalendarProps<T> extends Pick<EditableDateRangePickerProps, 'startProps' | 'endProps'> {\n /** Default value for uncontrolled input */\n defaultValue?: DateRangePickerValue;\n /** Value for controlled input */\n value?: DateRangePickerValue;\n /** onChange value for controlled input */\n onChange?(value: DateRangePickerValue): void;\n /**\n * The presets to display\n *\n * @default {}\n * @example\n * {\n * january: {label: 'January', range: [new Date(2022, 0, 1), new Date(2022, 0, 31)]},\n * february: {label: 'February', range: [new Date(2022, 1, 1), new Date(2022, 1, 28)]}\n * }\n */\n presets?: Record<string, DateRangePickerPreset>;\n\n /**\n * Props for RangeCalendar\n */\n rangeCalendarProps?: Omit<RangeCalendarProps, 'value' | 'onChange'>;\n}\n\nexport const DateRangePickerPopoverCalendar = <T extends unknown>({\n presets,\n value,\n defaultValue,\n onChange,\n startProps,\n endProps,\n rangeCalendarProps,\n}: DateRangePickerPopoverCalendarProps<T>) => {\n const [opened, setOpened] = useState(false);\n const ref = useClickOutside(() => setOpened(false));\n\n const [_value, handleChange] = useUncontrolled<DateRangePickerValue>({\n value,\n defaultValue,\n onChange,\n finalValue: [null, null],\n });\n\n const onCalendarChange = (dates: DateRangePickerValue) => {\n handleChange?.(dates);\n if (dates[1] !== null) {\n setOpened(false);\n }\n };\n\n return (\n <>\n <Group align=\"center\">\n <EditableDateRangePicker\n value={_value}\n onChange={handleChange}\n onFocus={() => setOpened(true)}\n startProps={startProps}\n endProps={endProps}\n />\n {presets ? (\n <>\n <Space w=\"sm\" />\n <DateRangePickerPresetSelect presets={presets} value={_value} onChange={handleChange} />\n </>\n ) : null}\n </Group>\n\n <Popover opened={opened} onChange={setOpened} trapFocus>\n <Popover.Dropdown>\n <RangeCalendar\n ref={ref}\n styles={{cell: {textAlign: 'center'}}}\n amountOfMonths={2}\n firstDayOfWeek=\"sunday\"\n allowSingleDateInRange\n value={_value}\n onChange={onCalendarChange}\n {...rangeCalendarProps}\n />\n </Popover.Dropdown>\n </Popover>\n </>\n );\n};\n"],"names":["DateRangePickerPopoverCalendar","presets","value","defaultValue","onChange","startProps","endProps","rangeCalendarProps","useState","opened","setOpened","ref","useClickOutside","useUncontrolled","finalValue","_value","handleChange","onCalendarChange","dates","Group","align","EditableDateRangePicker","onFocus","Space","w","DateRangePickerPresetSelect","Popover","trapFocus","Dropdown","RangeCalendar","styles","cell","textAlign","amountOfMonths","firstDayOfWeek","allowSingleDateInRange"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/date-range-picker/DateRangePickerPopoverCalendar.tsx"],"sourcesContent":["import {DateRangePickerValue, RangeCalendar, RangeCalendarProps} from '@mantine/dates';\nimport {Group, Popover, Space} from '@mantine/core';\nimport {useClickOutside, useUncontrolled} from '@mantine/hooks';\nimport {useState} from 'react';\n\nimport {EditableDateRangePicker, EditableDateRangePickerProps} from './EditableDateRangePicker';\nimport {DateRangePickerPresetSelect, DateRangePickerPreset} from './DateRangePickerPresetSelect';\n\ninterface DateRangePickerPopoverCalendarProps<T> extends Pick<EditableDateRangePickerProps, 'startProps' | 'endProps'> {\n /** Default value for uncontrolled input */\n defaultValue?: DateRangePickerValue;\n /** Value for controlled input */\n value?: DateRangePickerValue;\n /** onChange value for controlled input */\n onChange?(value: DateRangePickerValue): void;\n /**\n * The presets to display\n *\n * @default {}\n * @example\n * {\n * january: {label: 'January', range: [new Date(2022, 0, 1), new Date(2022, 0, 31)]},\n * february: {label: 'February', range: [new Date(2022, 1, 1), new Date(2022, 1, 28)]}\n * }\n */\n presets?: Record<string, DateRangePickerPreset>;\n\n /**\n * Props for RangeCalendar\n */\n rangeCalendarProps?: Omit<RangeCalendarProps, 'value' | 'onChange'>;\n}\n\nexport const DateRangePickerPopoverCalendar = <T extends unknown>({\n presets,\n value,\n defaultValue,\n onChange,\n startProps,\n endProps,\n rangeCalendarProps,\n}: DateRangePickerPopoverCalendarProps<T>) => {\n const [opened, setOpened] = useState(false);\n const ref = useClickOutside(() => setOpened(false));\n\n const [_value, handleChange] = useUncontrolled<DateRangePickerValue>({\n value,\n defaultValue,\n onChange,\n finalValue: [null, null],\n });\n\n const onCalendarChange = (dates: DateRangePickerValue) => {\n handleChange?.(dates);\n if (dates[1] !== null) {\n setOpened(false);\n }\n };\n\n return (\n <>\n <Group align=\"center\">\n <EditableDateRangePicker\n value={_value}\n onChange={handleChange}\n onFocus={() => setOpened(true)}\n startProps={startProps}\n endProps={endProps}\n />\n {presets ? (\n <>\n <Space w=\"sm\" />\n <DateRangePickerPresetSelect presets={presets} value={_value} onChange={handleChange} />\n </>\n ) : null}\n </Group>\n\n <Popover opened={opened} onChange={setOpened} trapFocus>\n <Popover.Dropdown>\n <RangeCalendar\n ref={ref}\n styles={{cell: {textAlign: 'center'}}}\n amountOfMonths={2}\n firstDayOfWeek=\"sunday\"\n allowSingleDateInRange\n value={_value}\n onChange={onCalendarChange}\n {...rangeCalendarProps}\n />\n </Popover.Dropdown>\n </Popover>\n </>\n );\n};\n"],"names":["DateRangePickerPopoverCalendar","presets","value","defaultValue","onChange","startProps","endProps","rangeCalendarProps","useState","opened","setOpened","ref","useClickOutside","useUncontrolled","finalValue","_value","handleChange","onCalendarChange","dates","Group","align","EditableDateRangePicker","onFocus","Space","w","DateRangePickerPresetSelect","Popover","trapFocus","Dropdown","RangeCalendar","styles","cell","textAlign","amountOfMonths","firstDayOfWeek","allowSingleDateInRange"],"mappings":";;;;+BAiCaA;;;eAAAA;;;;;;qBAjCyD;oBAClC;qBACW;qBACxB;uCAE6C;2CACH;AA2B1D,IAAMA,iCAAiC,gBAQA;QAP1CC,gBAAAA,SACAC,cAAAA,OACAC,qBAAAA,cACAC,iBAAAA,UACAC,mBAAAA,YACAC,iBAAAA,UACAC,2BAAAA;IAEA,IAA4BC,2BAAAA,IAAAA,eAAQ,EAAC,KAAK,OAAnCC,SAAqBD,cAAbE,YAAaF;IAC5B,IAAMG,MAAMC,IAAAA,sBAAe,EAAC;eAAMF,UAAU,KAAK;;IAEjD,IAA+BG,kCAAAA,IAAAA,sBAAe,EAAuB;QACjEX,OAAAA;QACAC,cAAAA;QACAC,UAAAA;QACAU,YAAY;YAAC,IAAI;YAAE,IAAI;SAAC;IAC5B,QALOC,SAAwBF,qBAAhBG,eAAgBH;IAO/B,IAAMI,mBAAmB,SAACC,OAAgC;QACtDF,yBAAAA,0BAAAA,KAAAA,IAAAA,aAAeE;QACf,IAAIA,KAAK,CAAC,EAAE,KAAK,IAAI,EAAE;YACnBR,UAAU,KAAK;QACnB,CAAC;IACL;IAEA,qBACI;;0BACI,sBAACS,WAAK;gBAACC,OAAM;;kCACT,qBAACC,gDAAuB;wBACpBnB,OAAOa;wBACPX,UAAUY;wBACVM,SAAS;mCAAMZ,UAAU,IAAI;;wBAC7BL,YAAYA;wBACZC,UAAUA;;oBAEbL,wBACG;;0CACI,qBAACsB,WAAK;gCAACC,GAAE;;0CACT,qBAACC,wDAA2B;gCAACxB,SAASA;gCAASC,OAAOa;gCAAQX,UAAUY;;;yBAE5E,IAAI;;;0BAGZ,qBAACU,aAAO;gBAACjB,QAAQA;gBAAQL,UAAUM;gBAAWiB,SAAS;0BACnD,cAAA,qBAACD,aAAO,CAACE,QAAQ;8BACb,cAAA,qBAACC,oBAAa;wBACVlB,KAAKA;wBACLmB,QAAQ;4BAACC,MAAM;gCAACC,WAAW;4BAAQ;wBAAC;wBACpCC,gBAAgB;wBAChBC,gBAAe;wBACfC,sBAAsB;wBACtBjC,OAAOa;wBACPX,UAAUa;uBACNV;;;;;AAM5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/date-range-picker/DateRangePickerPresetSelect.tsx"],"sourcesContent":["import {DateRangePickerValue, isSameDate} from '@mantine/dates';\nimport {Select, SelectItem, SelectProps} from '@mantine/core';\nimport {useState, useEffect} from 'react';\nimport dayjs from 'dayjs';\n\nexport interface DateRangePickerPreset {\n label: string;\n range: DateRangePickerValue;\n}\n\ninterface DateRangePickerPresetsSelectProps<T> {\n presets: Record<string, DateRangePickerPreset>;\n value: DateRangePickerValue;\n onChange?(value: DateRangePickerValue): void;\n selectProps?: Partial<Omit<SelectProps, 'data' | 'value' | 'onChange'>>;\n}\n\nexport const DateRangePickerPresetSelect = <T extends unknown>({\n presets,\n value,\n onChange,\n selectProps = {},\n}: DateRangePickerPresetsSelectProps<T>) => {\n const selectData: SelectItem[] = Object.entries(presets).map(([val, {label}]) => ({value: val, label}));\n\n const getSelectedPreset = () => {\n if (value[0] !== null && value[1] !== null && dayjs(value[0]).unix() !== dayjs(value[1]).unix()) {\n const selected = Object.entries(presets).find(\n ([id, {range}]) => dayjs(range[0]!).isSame(value[0]) && isSameDate(range[1]!, value[1]!)\n );\n if (selected) {\n return selected[0];\n }\n }\n return null;\n };\n\n const [selectedPreset, setSelectedPreset] = useState<string | null>(getSelectedPreset());\n\n useEffect(() => {\n const newPreset = getSelectedPreset();\n if (newPreset !== selectedPreset) {\n setSelectedPreset(newPreset);\n }\n }, [value]);\n\n const onChangePreset = (presetId: keyof typeof presets) => {\n const range = presets[presetId].range as any;\n onChange?.(range);\n };\n\n return (\n <Select\n label=\"Date range\"\n placeholder=\"Select a date range\"\n {...selectProps}\n value={selectedPreset}\n onChange={onChangePreset}\n data={selectData}\n />\n );\n};\n"],"names":["DateRangePickerPresetSelect","presets","value","onChange","selectProps","selectData","Object","entries","map","val","label","getSelectedPreset","dayjs","unix","selected","find","id","range","isSame","isSameDate","useState","selectedPreset","setSelectedPreset","useEffect","newPreset","onChangePreset","presetId","Select","placeholder","data"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/date-range-picker/DateRangePickerPresetSelect.tsx"],"sourcesContent":["import {DateRangePickerValue, isSameDate} from '@mantine/dates';\nimport {Select, SelectItem, SelectProps} from '@mantine/core';\nimport {useState, useEffect} from 'react';\nimport dayjs from 'dayjs';\n\nexport interface DateRangePickerPreset {\n label: string;\n range: DateRangePickerValue;\n}\n\ninterface DateRangePickerPresetsSelectProps<T> {\n presets: Record<string, DateRangePickerPreset>;\n value: DateRangePickerValue;\n onChange?(value: DateRangePickerValue): void;\n selectProps?: Partial<Omit<SelectProps, 'data' | 'value' | 'onChange'>>;\n}\n\nexport const DateRangePickerPresetSelect = <T extends unknown>({\n presets,\n value,\n onChange,\n selectProps = {},\n}: DateRangePickerPresetsSelectProps<T>) => {\n const selectData: SelectItem[] = Object.entries(presets).map(([val, {label}]) => ({value: val, label}));\n\n const getSelectedPreset = () => {\n if (value[0] !== null && value[1] !== null && dayjs(value[0]).unix() !== dayjs(value[1]).unix()) {\n const selected = Object.entries(presets).find(\n ([id, {range}]) => dayjs(range[0]!).isSame(value[0]) && isSameDate(range[1]!, value[1]!)\n );\n if (selected) {\n return selected[0];\n }\n }\n return null;\n };\n\n const [selectedPreset, setSelectedPreset] = useState<string | null>(getSelectedPreset());\n\n useEffect(() => {\n const newPreset = getSelectedPreset();\n if (newPreset !== selectedPreset) {\n setSelectedPreset(newPreset);\n }\n }, [value]);\n\n const onChangePreset = (presetId: keyof typeof presets) => {\n const range = presets[presetId].range as any;\n onChange?.(range);\n };\n\n return (\n <Select\n label=\"Date range\"\n placeholder=\"Select a date range\"\n {...selectProps}\n value={selectedPreset}\n onChange={onChangePreset}\n data={selectData}\n />\n );\n};\n"],"names":["DateRangePickerPresetSelect","presets","value","onChange","selectProps","selectData","Object","entries","map","val","label","getSelectedPreset","dayjs","unix","selected","find","id","range","isSame","isSameDate","useState","selectedPreset","setSelectedPreset","useEffect","newPreset","onChangePreset","presetId","Select","placeholder","data"],"mappings":";;;;+BAiBaA;;;eAAAA;;;;;;;;qBAjBkC;oBACD;qBACZ;0DAChB;AAcX,IAAMA,8BAA8B,gBAKC;QAJxCC,gBAAAA,SACAC,cAAAA,OACAC,iBAAAA,qCACAC,aAAAA,8CAAc,CAAC;IAEf,IAAMC,aAA2BC,OAAOC,OAAO,CAACN,SAASO,GAAG,CAAC;+CAAEC,iBAAK,AAACC,kBAAAA;eAAa;YAACR,OAAOO;YAAKC,OAAAA;QAAK;;IAEpG,IAAMC,oBAAoB,WAAM;QAC5B,IAAIT,KAAK,CAAC,EAAE,KAAK,IAAI,IAAIA,KAAK,CAAC,EAAE,KAAK,IAAI,IAAIU,IAAAA,cAAK,EAACV,KAAK,CAAC,EAAE,EAAEW,IAAI,OAAOD,IAAAA,cAAK,EAACV,KAAK,CAAC,EAAE,EAAEW,IAAI,IAAI;YAC7F,IAAMC,WAAWR,OAAOC,OAAO,CAACN,SAASc,IAAI,CACzC;uDAAEC,gBAAI,AAACC,kBAAAA;uBAAYL,IAAAA,cAAK,EAACK,KAAK,CAAC,EAAE,EAAGC,MAAM,CAAChB,KAAK,CAAC,EAAE,KAAKiB,IAAAA,iBAAU,EAACF,KAAK,CAAC,EAAE,EAAGf,KAAK,CAAC,EAAE;;YAE1F,IAAIY,UAAU;gBACV,OAAOA,QAAQ,CAAC,EAAE;YACtB,CAAC;QACL,CAAC;QACD,OAAO,IAAI;IACf;IAEA,IAA4CM,2BAAAA,IAAAA,eAAQ,EAAgBT,0BAA7DU,iBAAqCD,cAArBE,oBAAqBF;IAE5CG,IAAAA,gBAAS,EAAC,WAAM;QACZ,IAAMC,YAAYb;QAClB,IAAIa,cAAcH,gBAAgB;YAC9BC,kBAAkBE;QACtB,CAAC;IACL,GAAG;QAACtB;KAAM;IAEV,IAAMuB,iBAAiB,SAACC,UAAmC;QACvD,IAAMT,QAAQhB,OAAO,CAACyB,SAAS,CAACT,KAAK;QACrCd,qBAAAA,sBAAAA,KAAAA,IAAAA,SAAWc;IACf;IAEA,qBACI,qBAACU,YAAM;QACHjB,OAAM;QACNkB,aAAY;OACRxB;QACJF,OAAOmB;QACPlB,UAAUsB;QACVI,MAAMxB;;AAGlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/date-range-picker/EditableDateRangePicker.tsx"],"sourcesContent":["import {DatePicker, DatePickerProps, DateRangePickerValue} from '@mantine/dates';\nimport dayjs from 'dayjs';\nimport {ReactNode} from 'react';\n\nexport interface EditableDateRangePickerProps {\n value: DateRangePickerValue;\n onChange?(value: DateRangePickerValue): void;\n onFocus?: () => void;\n separator?: ReactNode;\n /**\n * Props for the start input\n */\n startProps?: Omit<Partial<DatePickerProps>, 'value' | 'onChange' | 'onFocus'>;\n /**\n * Props for the end input\n */\n endProps?: Omit<Partial<DatePickerProps>, 'value' | 'onChange' | 'onFocus'>;\n}\n\nexport const EditableDateRangePicker = ({\n value,\n onChange,\n onFocus,\n separator = 'to',\n startProps = {},\n endProps = {},\n}: EditableDateRangePickerProps) => {\n const onChangeStart = (date: Date) => {\n onChange?.([dayjs(date).startOf('day').toDate(), value?.[1]]);\n };\n const onChangeEnd = (date: Date) => {\n onChange?.([value?.[0], dayjs(date).endOf('day').toDate()]);\n };\n\n return (\n <>\n <DatePicker\n allowFreeInput\n clearable={false}\n label=\"Start\"\n {...startProps}\n value={value?.[0]}\n onChange={onChangeStart}\n onFocus={onFocus}\n styles={{...startProps.styles, dropdown: {display: 'none'}}}\n />\n {separator}\n <DatePicker\n allowFreeInput\n clearable={false}\n label=\"End\"\n {...endProps}\n value={value?.[1]}\n onChange={onChangeEnd}\n onFocus={onFocus}\n styles={{...endProps.styles, dropdown: {display: 'none'}}}\n />\n </>\n );\n};\n"],"names":["EditableDateRangePicker","value","onChange","onFocus","separator","startProps","endProps","onChangeStart","date","dayjs","startOf","toDate","onChangeEnd","endOf","DatePicker","allowFreeInput","clearable","label","styles","dropdown","display"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/date-range-picker/EditableDateRangePicker.tsx"],"sourcesContent":["import {DatePicker, DatePickerProps, DateRangePickerValue} from '@mantine/dates';\nimport dayjs from 'dayjs';\nimport {ReactNode} from 'react';\n\nexport interface EditableDateRangePickerProps {\n value: DateRangePickerValue;\n onChange?(value: DateRangePickerValue): void;\n onFocus?: () => void;\n separator?: ReactNode;\n /**\n * Props for the start input\n */\n startProps?: Omit<Partial<DatePickerProps>, 'value' | 'onChange' | 'onFocus'>;\n /**\n * Props for the end input\n */\n endProps?: Omit<Partial<DatePickerProps>, 'value' | 'onChange' | 'onFocus'>;\n}\n\nexport const EditableDateRangePicker = ({\n value,\n onChange,\n onFocus,\n separator = 'to',\n startProps = {},\n endProps = {},\n}: EditableDateRangePickerProps) => {\n const onChangeStart = (date: Date) => {\n onChange?.([dayjs(date).startOf('day').toDate(), value?.[1]]);\n };\n const onChangeEnd = (date: Date) => {\n onChange?.([value?.[0], dayjs(date).endOf('day').toDate()]);\n };\n\n return (\n <>\n <DatePicker\n allowFreeInput\n clearable={false}\n label=\"Start\"\n {...startProps}\n value={value?.[0]}\n onChange={onChangeStart}\n onFocus={onFocus}\n styles={{...startProps.styles, dropdown: {display: 'none'}}}\n />\n {separator}\n <DatePicker\n allowFreeInput\n clearable={false}\n label=\"End\"\n {...endProps}\n value={value?.[1]}\n onChange={onChangeEnd}\n onFocus={onFocus}\n styles={{...endProps.styles, dropdown: {display: 'none'}}}\n />\n </>\n );\n};\n"],"names":["EditableDateRangePicker","value","onChange","onFocus","separator","startProps","endProps","onChangeStart","date","dayjs","startOf","toDate","onChangeEnd","endOf","DatePicker","allowFreeInput","clearable","label","styles","dropdown","display"],"mappings":";;;;+BAmBaA;;;eAAAA;;;;;;;qBAnBmD;0DAC9C;AAkBX,IAAMA,0BAA0B,gBAOH;QANhCC,cAAAA,OACAC,iBAAAA,UACAC,gBAAAA,kCACAC,WAAAA,0CAAY,mDACZC,YAAAA,4CAAa,CAAC,+CACdC,UAAAA,wCAAW,CAAC;IAEZ,IAAMC,gBAAgB,SAACC,MAAe;QAClCN,qBAAAA,sBAAAA,KAAAA,IAAAA,SAAW;YAACO,IAAAA,cAAK,EAACD,MAAME,OAAO,CAAC,OAAOC,MAAM;YAAIV,kBAAAA,mBAAAA,KAAAA,IAAAA,KAAO,CAAC,EAAE;SAAC;IAChE;IACA,IAAMW,cAAc,SAACJ,MAAe;QAChCN,qBAAAA,sBAAAA,KAAAA,IAAAA,SAAW;YAACD,kBAAAA,mBAAAA,KAAAA,IAAAA,KAAO,CAAC,EAAE;YAAEQ,IAAAA,cAAK,EAACD,MAAMK,KAAK,CAAC,OAAOF,MAAM;SAAG;IAC9D;IAEA,qBACI;;0BACI,qBAACG,iBAAU;gBACPC,cAAc;gBACdC,WAAW,KAAK;gBAChBC,OAAM;eACFZ;gBACJJ,OAAOA,kBAAAA,mBAAAA,KAAAA,IAAAA,KAAO,CAAC,EAAE;gBACjBC,UAAUK;gBACVJ,SAASA;gBACTe,QAAQ,qCAAIb,WAAWa,MAAM;oBAAEC,UAAU;wBAACC,SAAS;oBAAM;;;YAE5DhB;0BACD,qBAACU,iBAAU;gBACPC,cAAc;gBACdC,WAAW,KAAK;gBAChBC,OAAM;eACFX;gBACJL,OAAOA,kBAAAA,mBAAAA,KAAAA,IAAAA,KAAO,CAAC,EAAE;gBACjBC,UAAUU;gBACVT,SAASA;gBACTe,QAAQ,qCAAIZ,SAASY,MAAM;oBAAEC,UAAU;wBAACC,SAAS;oBAAM;;;;;AAIvE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/date-range-picker/index.tsx"],"sourcesContent":["export * from './DateRangePickerInlineCalendar';\nexport * from './DateRangePickerPopoverCalendar';\nexport * from './DateRangePickerPresetSelect';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/date-range-picker/index.tsx"],"sourcesContent":["export * from './DateRangePickerInlineCalendar';\nexport * from './DateRangePickerPopoverCalendar';\nexport * from './DateRangePickerPresetSelect';\n"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/header/Header.tsx"],"sourcesContent":["import {QuestionSize24Px} from '@coveord/plasma-react-icons';\nimport {Anchor, Breadcrumbs, DefaultProps, Divider, Group, Stack, Text, Title, Tooltip} from '@mantine/core';\nimport {FunctionComponent, ReactNode} from 'react';\n\nexport interface HeaderProps extends DefaultProps {\n /**\n * The description text displayed inside the header underneath the title\n */\n description?: ReactNode;\n /**\n * Action buttons that can be displayed on the right of the header\n */\n actions?: ReactNode;\n /**\n * Whether the header should have a border on the bottom\n */\n borderBottom?: boolean;\n /**\n * A href pointing to documentation related to the current panel.\n * When provided, an info icon is rendered next to the title as link to this documentation\n */\n docLink?: string;\n /**\n * The tooltip text shown when hovering over the doc link icon\n */\n docLinkTooltipLabel?: string;\n /**\n * The title of the header.\n * If more than one children are provided, each of them act as parts of a breadcrumb\n */\n children: ReactNode;\n}\n\nexport const Header: FunctionComponent<HeaderProps> = ({\n description,\n actions,\n borderBottom,\n docLink,\n docLinkTooltipLabel,\n children,\n ...others\n}) => (\n <>\n <Group position=\"apart\" py=\"md\" px=\"xl\" {...others}>\n <Stack spacing=\"xs\">\n <Title order={4}>\n <Group spacing={0}>\n <Breadcrumbs>{children}</Breadcrumbs>\n {docLink ? (\n <Tooltip label={docLinkTooltipLabel} disabled={!docLinkTooltipLabel} position=\"bottom\">\n <Anchor inline href={docLink} target=\"_blank\" ml=\"xs\">\n <QuestionSize24Px height={24} />\n </Anchor>\n </Tooltip>\n ) : null}\n </Group>\n </Title>\n <Text size=\"sm\">{description}</Text>\n </Stack>\n <Group spacing=\"xs\">{actions}</Group>\n </Group>\n {borderBottom ? <Divider size=\"xs\" /> : null}\n </>\n);\n"],"names":["Header","description","actions","borderBottom","docLink","docLinkTooltipLabel","children","others","Group","position","py","px","Stack","spacing","Title","order","Breadcrumbs","Tooltip","label","disabled","Anchor","inline","href","target","ml","QuestionSize24Px","height","Text","size","Divider"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/header/Header.tsx"],"sourcesContent":["import {QuestionSize24Px} from '@coveord/plasma-react-icons';\nimport {Anchor, Breadcrumbs, DefaultProps, Divider, Group, Stack, Text, Title, Tooltip} from '@mantine/core';\nimport {FunctionComponent, ReactNode} from 'react';\n\nexport interface HeaderProps extends DefaultProps {\n /**\n * The description text displayed inside the header underneath the title\n */\n description?: ReactNode;\n /**\n * Action buttons that can be displayed on the right of the header\n */\n actions?: ReactNode;\n /**\n * Whether the header should have a border on the bottom\n */\n borderBottom?: boolean;\n /**\n * A href pointing to documentation related to the current panel.\n * When provided, an info icon is rendered next to the title as link to this documentation\n */\n docLink?: string;\n /**\n * The tooltip text shown when hovering over the doc link icon\n */\n docLinkTooltipLabel?: string;\n /**\n * The title of the header.\n * If more than one children are provided, each of them act as parts of a breadcrumb\n */\n children: ReactNode;\n}\n\nexport const Header: FunctionComponent<HeaderProps> = ({\n description,\n actions,\n borderBottom,\n docLink,\n docLinkTooltipLabel,\n children,\n ...others\n}) => (\n <>\n <Group position=\"apart\" py=\"md\" px=\"xl\" {...others}>\n <Stack spacing=\"xs\">\n <Title order={4}>\n <Group spacing={0}>\n <Breadcrumbs>{children}</Breadcrumbs>\n {docLink ? (\n <Tooltip label={docLinkTooltipLabel} disabled={!docLinkTooltipLabel} position=\"bottom\">\n <Anchor inline href={docLink} target=\"_blank\" ml=\"xs\">\n <QuestionSize24Px height={24} />\n </Anchor>\n </Tooltip>\n ) : null}\n </Group>\n </Title>\n <Text size=\"sm\">{description}</Text>\n </Stack>\n <Group spacing=\"xs\">{actions}</Group>\n </Group>\n {borderBottom ? <Divider size=\"xs\" /> : null}\n </>\n);\n"],"names":["Header","description","actions","borderBottom","docLink","docLinkTooltipLabel","children","others","Group","position","py","px","Stack","spacing","Title","order","Breadcrumbs","Tooltip","label","disabled","Anchor","inline","href","target","ml","QuestionSize24Px","height","Text","size","Divider"],"mappings":";;;;+BAiCaA;;;eAAAA;;;;;;;gCAjCkB;oBAC8D;AAgCtF,IAAMA,SAAyC,+BASlD;QARAC,qBAAAA,aACAC,iBAAAA,SACAC,sBAAAA,cACAC,iBAAAA,SACAC,6BAAAA,qBACAC,kBAAAA,UACGC;QANHN;QACAC;QACAC;QACAC;QACAC;QACAC;;WAGA;;0BACI,sBAACE,WAAK;gBAACC,UAAS;gBAAQC,IAAG;gBAAKC,IAAG;eAASJ;;kCACxC,sBAACK,WAAK;wBAACC,SAAQ;;0CACX,qBAACC,WAAK;gCAACC,OAAO;0CACV,cAAA,sBAACP,WAAK;oCAACK,SAAS;;sDACZ,qBAACG,iBAAW;sDAAEV;;wCACbF,wBACG,qBAACa,aAAO;4CAACC,OAAOb;4CAAqBc,UAAU,CAACd;4CAAqBI,UAAS;sDAC1E,cAAA,qBAACW,YAAM;gDAACC,MAAM;gDAACC,MAAMlB;gDAASmB,QAAO;gDAASC,IAAG;0DAC7C,cAAA,qBAACC,kCAAgB;oDAACC,QAAQ;;;6CAGlC,IAAI;;;;0CAGhB,qBAACC,UAAI;gCAACC,MAAK;0CAAM3B;;;;kCAErB,qBAACO,WAAK;wBAACK,SAAQ;kCAAMX;;;;YAExBC,6BAAe,qBAAC0B,aAAO;gBAACD,MAAK;iBAAU,IAAI;;;AAC9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/header/index.ts"],"sourcesContent":["export * from './Header';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/header/index.ts"],"sourcesContent":["export * from './Header';\n"],"names":[],"mappings":";;;;;oBAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/index.ts"],"sourcesContent":["export * from './blank-slate';\nexport * from './code-editor';\nexport * from './collection';\nexport * from './date-range-picker';\nexport * from './sticky-footer';\nexport * from './header';\nexport * from './inline-confirm';\nexport * from './table';\nexport * from './prompt';\nexport * from './modal';\nexport * from './modal-wizard';\nexport * from './button';\nexport * from './menu';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/index.ts"],"sourcesContent":["export * from './blank-slate';\nexport * from './code-editor';\nexport * from './collection';\nexport * from './date-range-picker';\nexport * from './sticky-footer';\nexport * from './header';\nexport * from './inline-confirm';\nexport * from './table';\nexport * from './prompt';\nexport * from './modal';\nexport * from './modal-wizard';\nexport * from './button';\nexport * from './menu';\n"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/inline-confirm/InlineConfirm.tsx"],"sourcesContent":["import {Children, FunctionComponent, PropsWithChildren, ReactElement, useState} from 'react';\n\nimport {InlineConfirmButton} from './InlineConfirmButton';\nimport {InlineConfirmContext} from './InlineConfirmContext';\nimport {InlineConfirmMenuItem} from './InlineConfirmMenuItem';\nimport {InlineConfirmPrompt} from './InlineConfirmPrompt';\n\ntype InlineConfirmType = FunctionComponent<PropsWithChildren> & {\n Prompt: typeof InlineConfirmPrompt;\n Button: typeof InlineConfirmButton;\n MenuItem: typeof InlineConfirmMenuItem;\n};\n\nexport const InlineConfirm: InlineConfirmType = ({children}) => {\n const [confirmingId, setConfirmingId] = useState<string | null>(null);\n\n const convertedChildren = Children.toArray(children) as ReactElement[];\n const prompt = convertedChildren.find(\n (child) => child.type === InlineConfirmPrompt && child.props.id === confirmingId\n );\n const clearConfirm = () => setConfirmingId(null);\n\n return (\n <InlineConfirmContext.Provider value={{confirmingId, setConfirmingId, clearConfirm}}>\n {prompt ?? children}\n </InlineConfirmContext.Provider>\n );\n};\n\nInlineConfirm.Prompt = InlineConfirmPrompt;\nInlineConfirm.Button = InlineConfirmButton;\nInlineConfirm.MenuItem = InlineConfirmMenuItem;\n"],"names":["InlineConfirm","children","useState","confirmingId","setConfirmingId","convertedChildren","Children","toArray","prompt","find","child","type","InlineConfirmPrompt","props","id","clearConfirm","InlineConfirmContext","Provider","value","Prompt","Button","InlineConfirmButton","MenuItem","InlineConfirmMenuItem"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/inline-confirm/InlineConfirm.tsx"],"sourcesContent":["import {Children, FunctionComponent, PropsWithChildren, ReactElement, useState} from 'react';\n\nimport {InlineConfirmButton} from './InlineConfirmButton';\nimport {InlineConfirmContext} from './InlineConfirmContext';\nimport {InlineConfirmMenuItem} from './InlineConfirmMenuItem';\nimport {InlineConfirmPrompt} from './InlineConfirmPrompt';\n\ntype InlineConfirmType = FunctionComponent<PropsWithChildren> & {\n Prompt: typeof InlineConfirmPrompt;\n Button: typeof InlineConfirmButton;\n MenuItem: typeof InlineConfirmMenuItem;\n};\n\nexport const InlineConfirm: InlineConfirmType = ({children}) => {\n const [confirmingId, setConfirmingId] = useState<string | null>(null);\n\n const convertedChildren = Children.toArray(children) as ReactElement[];\n const prompt = convertedChildren.find(\n (child) => child.type === InlineConfirmPrompt && child.props.id === confirmingId\n );\n const clearConfirm = () => setConfirmingId(null);\n\n return (\n <InlineConfirmContext.Provider value={{confirmingId, setConfirmingId, clearConfirm}}>\n {prompt ?? children}\n </InlineConfirmContext.Provider>\n );\n};\n\nInlineConfirm.Prompt = InlineConfirmPrompt;\nInlineConfirm.Button = InlineConfirmButton;\nInlineConfirm.MenuItem = InlineConfirmMenuItem;\n"],"names":["InlineConfirm","children","useState","confirmingId","setConfirmingId","convertedChildren","Children","toArray","prompt","find","child","type","InlineConfirmPrompt","props","id","clearConfirm","InlineConfirmContext","Provider","value","Prompt","Button","InlineConfirmButton","MenuItem","InlineConfirmMenuItem"],"mappings":";;;;+BAaaA;;;eAAAA;;;;;qBAbwE;mCAEnD;oCACC;qCACC;mCACF;AAQ3B,IAAMA,gBAAmC,gBAAgB;QAAdC,iBAAAA;IAC9C,IAAwCC,2BAAAA,IAAAA,eAAQ,EAAgB,IAAI,OAA7DC,eAAiCD,cAAnBE,kBAAmBF;IAExC,IAAMG,oBAAoBC,eAAQ,CAACC,OAAO,CAACN;IAC3C,IAAMO,SAASH,kBAAkBI,IAAI,CACjC,SAACC;eAAUA,MAAMC,IAAI,KAAKC,wCAAmB,IAAIF,MAAMG,KAAK,CAACC,EAAE,KAAKX;;IAExE,IAAMY,eAAe;eAAMX,gBAAgB,IAAI;;IAE/C,qBACI,qBAACY,0CAAoB,CAACC,QAAQ;QAACC,OAAO;YAACf,cAAAA;YAAcC,iBAAAA;YAAiBW,cAAAA;QAAY;kBAC7EP,mBAAAA,oBAAAA,SAAUP,QAAQ;;AAG/B;AAEAD,cAAcmB,MAAM,GAAGP,wCAAmB;AAC1CZ,cAAcoB,MAAM,GAAGC,wCAAmB;AAC1CrB,cAAcsB,QAAQ,GAAGC,4CAAqB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/inline-confirm/InlineConfirmButton.tsx"],"sourcesContent":["import {Button} from '@mantine/core';\nimport {forwardRef, MouseEventHandler} from 'react';\n\nimport {ButtonProps} from '../button';\nimport {useInlineConfirm} from './useInlineConfirm';\n\nexport interface InlineConfirmButtonProps extends ButtonProps {\n id: string;\n onClick?: MouseEventHandler<HTMLButtonElement>;\n}\n\nexport const InlineConfirmButton = forwardRef<HTMLButtonElement, InlineConfirmButtonProps>(\n ({onClick, id, ...others}, ref) => {\n const {setConfirmingId} = useInlineConfirm();\n const handleOnClick: MouseEventHandler<HTMLButtonElement> = (e) => {\n setConfirmingId(id);\n onClick?.(e);\n };\n\n return <Button ref={ref} onClick={handleOnClick} {...others} />;\n }\n);\n"],"names":["InlineConfirmButton","forwardRef","ref","onClick","id","others","setConfirmingId","useInlineConfirm","handleOnClick","e","Button"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/inline-confirm/InlineConfirmButton.tsx"],"sourcesContent":["import {Button} from '@mantine/core';\nimport {forwardRef, MouseEventHandler} from 'react';\n\nimport {ButtonProps} from '../button';\nimport {useInlineConfirm} from './useInlineConfirm';\n\nexport interface InlineConfirmButtonProps extends ButtonProps {\n id: string;\n onClick?: MouseEventHandler<HTMLButtonElement>;\n}\n\nexport const InlineConfirmButton = forwardRef<HTMLButtonElement, InlineConfirmButtonProps>(\n ({onClick, id, ...others}, ref) => {\n const {setConfirmingId} = useInlineConfirm();\n const handleOnClick: MouseEventHandler<HTMLButtonElement> = (e) => {\n setConfirmingId(id);\n onClick?.(e);\n };\n\n return <Button ref={ref} onClick={handleOnClick} {...others} />;\n }\n);\n"],"names":["InlineConfirmButton","forwardRef","ref","onClick","id","others","setConfirmingId","useInlineConfirm","handleOnClick","e","Button"],"mappings":";;;;+BAWaA;;;eAAAA;;;;;;oBAXQ;qBACuB;gCAGb;AAOxB,IAAMA,oCAAsBC,IAAAA,iBAAU,EACzC,iBAA2BC,KAAQ;QAAjCC,iBAAAA,SAASC,YAAAA,IAAOC;QAAhBF;QAASC;;IACP,IAAM,AAACE,kBAAmBC,IAAAA,kCAAgB,IAAnCD;IACP,IAAME,gBAAsD,SAACC,GAAM;QAC/DH,gBAAgBF;QAChBD,oBAAAA,qBAAAA,KAAAA,IAAAA,QAAUM;IACd;IAEA,qBAAO,qBAACC,YAAM;QAACR,KAAKA;QAAKC,SAASK;OAAmBH;AACzD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/inline-confirm/InlineConfirmContext.ts"],"sourcesContent":["import {createContext} from 'react';\n\ntype InlineConfirmContextType = {\n confirmingId: string;\n setConfirmingId: (id: string) => void;\n clearConfirm: () => void;\n};\n\nexport const InlineConfirmContext = createContext<InlineConfirmContextType | null>(null);\n"],"names":["InlineConfirmContext","createContext"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/inline-confirm/InlineConfirmContext.ts"],"sourcesContent":["import {createContext} from 'react';\n\ntype InlineConfirmContextType = {\n confirmingId: string;\n setConfirmingId: (id: string) => void;\n clearConfirm: () => void;\n};\n\nexport const InlineConfirmContext = createContext<InlineConfirmContextType | null>(null);\n"],"names":["InlineConfirmContext","createContext"],"mappings":";;;;+BAQaA;;;eAAAA;;;qBARe;AAQrB,IAAMA,uBAAuBC,IAAAA,oBAAa,EAAkC,IAAI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/inline-confirm/InlineConfirmMenuItem.tsx"],"sourcesContent":["import {forwardRef, MouseEventHandler} from 'react';\n\nimport {Menu, MenuItemProps} from '../menu';\nimport {useInlineConfirm} from './useInlineConfirm';\n\nexport interface InlineConfirmMenuItemProps extends MenuItemProps {\n id: string;\n onClick?: MouseEventHandler<HTMLButtonElement>;\n}\n\nexport const InlineConfirmMenuItem = forwardRef<HTMLButtonElement, InlineConfirmMenuItemProps>(\n ({onClick, id, ...others}, ref) => {\n const {setConfirmingId} = useInlineConfirm();\n const handleOnClick: MouseEventHandler<HTMLButtonElement> = (e) => {\n setConfirmingId(id);\n onClick?.(e);\n };\n\n return <Menu.Item ref={ref} onClick={handleOnClick} {...others} />;\n }\n);\n"],"names":["InlineConfirmMenuItem","forwardRef","ref","onClick","id","others","setConfirmingId","useInlineConfirm","handleOnClick","e","Menu","Item"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/inline-confirm/InlineConfirmMenuItem.tsx"],"sourcesContent":["import {forwardRef, MouseEventHandler} from 'react';\n\nimport {Menu, MenuItemProps} from '../menu';\nimport {useInlineConfirm} from './useInlineConfirm';\n\nexport interface InlineConfirmMenuItemProps extends MenuItemProps {\n id: string;\n onClick?: MouseEventHandler<HTMLButtonElement>;\n}\n\nexport const InlineConfirmMenuItem = forwardRef<HTMLButtonElement, InlineConfirmMenuItemProps>(\n ({onClick, id, ...others}, ref) => {\n const {setConfirmingId} = useInlineConfirm();\n const handleOnClick: MouseEventHandler<HTMLButtonElement> = (e) => {\n setConfirmingId(id);\n onClick?.(e);\n };\n\n return <Menu.Item ref={ref} onClick={handleOnClick} {...others} />;\n }\n);\n"],"names":["InlineConfirmMenuItem","forwardRef","ref","onClick","id","others","setConfirmingId","useInlineConfirm","handleOnClick","e","Menu","Item"],"mappings":";;;;+BAUaA;;;eAAAA;;;;;;qBAV+B;oBAEV;gCACH;AAOxB,IAAMA,sCAAwBC,IAAAA,iBAAU,EAC3C,iBAA2BC,KAAQ;QAAjCC,iBAAAA,SAASC,YAAAA,IAAOC;QAAhBF;QAASC;;IACP,IAAM,AAACE,kBAAmBC,IAAAA,kCAAgB,IAAnCD;IACP,IAAME,gBAAsD,SAACC,GAAM;QAC/DH,gBAAgBF;QAChBD,oBAAAA,qBAAAA,KAAAA,IAAAA,QAAUM;IACd;IAEA,qBAAO,qBAACC,UAAI,CAACC,IAAI;QAACT,KAAKA;QAAKC,SAASK;OAAmBH;AAC5D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/inline-confirm/InlineConfirmPrompt.tsx"],"sourcesContent":["import {Group} from '@mantine/core';\nimport {FunctionComponent, ReactNode, useEffect} from 'react';\n\nimport {Button} from '../button';\nimport {useInlineConfirm} from './useInlineConfirm';\n\ninterface InlineConfirmPromptProps {\n id: string;\n label: ReactNode;\n onConfirm: () => void;\n confirmLabel?: ReactNode;\n cancelLabel?: ReactNode;\n}\n\nexport const InlineConfirmPrompt: FunctionComponent<InlineConfirmPromptProps> = ({\n id,\n label,\n confirmLabel = 'Delete',\n cancelLabel = 'Cancel',\n onConfirm,\n}) => {\n const {confirmingId, clearConfirm} = useInlineConfirm();\n\n const onClickConfirm = () => {\n onConfirm();\n clearConfirm();\n };\n\n useEffect(() => {\n if (confirmingId !== id) {\n clearConfirm();\n }\n }, []);\n\n if (confirmingId === id) {\n return (\n <Group spacing=\"xs\">\n {label}\n <Button onClick={onClickConfirm} color=\"red\">\n {confirmLabel}\n </Button>\n <Button onClick={clearConfirm} variant=\"outline\">\n {cancelLabel}\n </Button>\n </Group>\n );\n }\n return null;\n};\n"],"names":["InlineConfirmPrompt","id","label","confirmLabel","cancelLabel","onConfirm","useInlineConfirm","confirmingId","clearConfirm","onClickConfirm","useEffect","Group","spacing","Button","onClick","color","variant"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/inline-confirm/InlineConfirmPrompt.tsx"],"sourcesContent":["import {Group} from '@mantine/core';\nimport {FunctionComponent, ReactNode, useEffect} from 'react';\n\nimport {Button} from '../button';\nimport {useInlineConfirm} from './useInlineConfirm';\n\ninterface InlineConfirmPromptProps {\n id: string;\n label: ReactNode;\n onConfirm: () => void;\n confirmLabel?: ReactNode;\n cancelLabel?: ReactNode;\n}\n\nexport const InlineConfirmPrompt: FunctionComponent<InlineConfirmPromptProps> = ({\n id,\n label,\n confirmLabel = 'Delete',\n cancelLabel = 'Cancel',\n onConfirm,\n}) => {\n const {confirmingId, clearConfirm} = useInlineConfirm();\n\n const onClickConfirm = () => {\n onConfirm();\n clearConfirm();\n };\n\n useEffect(() => {\n if (confirmingId !== id) {\n clearConfirm();\n }\n }, []);\n\n if (confirmingId === id) {\n return (\n <Group spacing=\"xs\">\n {label}\n <Button onClick={onClickConfirm} color=\"red\">\n {confirmLabel}\n </Button>\n <Button onClick={clearConfirm} variant=\"outline\">\n {cancelLabel}\n </Button>\n </Group>\n );\n }\n return null;\n};\n"],"names":["InlineConfirmPrompt","id","label","confirmLabel","cancelLabel","onConfirm","useInlineConfirm","confirmingId","clearConfirm","onClickConfirm","useEffect","Group","spacing","Button","onClick","color","variant"],"mappings":";;;;+BAcaA;;;eAAAA;;;;oBAdO;qBACkC;sBAEjC;gCACU;AAUxB,IAAMA,sBAAmE,gBAM1E;QALFC,WAAAA,IACAC,cAAAA,mCACAC,cAAAA,gDAAe,2DACfC,aAAAA,8CAAc,+BACdC,kBAAAA;IAEA,IAAqCC,qBAAAA,IAAAA,kCAAgB,KAA9CC,eAA8BD,mBAA9BC,cAAcC,eAAgBF,mBAAhBE;IAErB,IAAMC,iBAAiB,WAAM;QACzBJ;QACAG;IACJ;IAEAE,IAAAA,gBAAS,EAAC,WAAM;QACZ,IAAIH,iBAAiBN,IAAI;YACrBO;QACJ,CAAC;IACL,GAAG,EAAE;IAEL,IAAID,iBAAiBN,IAAI;QACrB,qBACI,sBAACU,WAAK;YAACC,SAAQ;;gBACVV;8BACD,qBAACW,cAAM;oBAACC,SAASL;oBAAgBM,OAAM;8BAClCZ;;8BAEL,qBAACU,cAAM;oBAACC,SAASN;oBAAcQ,SAAQ;8BAClCZ;;;;IAIjB,CAAC;IACD,OAAO,IAAI;AACf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/inline-confirm/index.ts"],"sourcesContent":["export * from './InlineConfirm';\nexport * from './useInlineConfirm';\nexport * from './InlineConfirmContext';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/inline-confirm/index.ts"],"sourcesContent":["export * from './InlineConfirm';\nexport * from './useInlineConfirm';\nexport * from './InlineConfirmContext';\n"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/inline-confirm/useInlineConfirm.ts"],"sourcesContent":["import {useContext} from 'react';\nimport {InlineConfirmContext} from './InlineConfirmContext';\n\nexport const useInlineConfirm = () => {\n const ctx = useContext(InlineConfirmContext);\n\n if (ctx === null) {\n throw new Error('useConfirm must be used inside of a InlineConfirmContext.Provider');\n }\n\n return ctx;\n};\n"],"names":["useInlineConfirm","ctx","useContext","InlineConfirmContext","Error"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/inline-confirm/useInlineConfirm.ts"],"sourcesContent":["import {useContext} from 'react';\nimport {InlineConfirmContext} from './InlineConfirmContext';\n\nexport const useInlineConfirm = () => {\n const ctx = useContext(InlineConfirmContext);\n\n if (ctx === null) {\n throw new Error('useConfirm must be used inside of a InlineConfirmContext.Provider');\n }\n\n return ctx;\n};\n"],"names":["useInlineConfirm","ctx","useContext","InlineConfirmContext","Error"],"mappings":";;;;+BAGaA;;;eAAAA;;;qBAHY;oCACU;AAE5B,IAAMA,mBAAmB,WAAM;IAClC,IAAMC,MAAMC,IAAAA,iBAAU,EAACC,0CAAoB;IAE3C,IAAIF,QAAQ,IAAI,EAAE;QACd,MAAM,IAAIG,MAAM,qEAAqE;IACzF,CAAC;IAED,OAAOH;AACX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/menu/Menu.tsx"],"sourcesContent":["import {Menu as MantineMenu, MenuItemProps as MantineMenuItemProps} from '@mantine/core';\nimport {forwardRef} from 'react';\n\nimport {createPolymorphicComponent, overrideComponent} from '../../utils';\nimport {ButtonWithDisabledTooltipProps} from '../button';\nimport {ButtonWithDisabledTooltip} from '../button/ButtonWithDisabledTooltip';\n\nexport interface MenuItemProps extends MantineMenuItemProps, ButtonWithDisabledTooltipProps {}\n\nconst _MenuItem = forwardRef<HTMLButtonElement, MenuItemProps>(\n ({disabledTooltip, disabled, disabledTooltipProps, ...others}, ref) => (\n <ButtonWithDisabledTooltip\n disabled={disabled}\n disabledTooltip={disabledTooltip}\n disabledTooltipProps={disabledTooltipProps}\n >\n <MantineMenu.Item ref={ref} disabled={disabled} {...others} />\n </ButtonWithDisabledTooltip>\n )\n);\n\nconst MenuItem = createPolymorphicComponent<'button', MenuItemProps>(_MenuItem);\n\nexport const Menu = overrideComponent(MantineMenu, {\n displayName: '@coveord/plasma-mantine/Menu',\n Item: MenuItem,\n});\n"],"names":["Menu","_MenuItem","forwardRef","ref","disabledTooltip","disabled","disabledTooltipProps","others","ButtonWithDisabledTooltip","MantineMenu","Item","MenuItem","createPolymorphicComponent","overrideComponent","displayName"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/menu/Menu.tsx"],"sourcesContent":["import {Menu as MantineMenu, MenuItemProps as MantineMenuItemProps} from '@mantine/core';\nimport {forwardRef} from 'react';\n\nimport {createPolymorphicComponent, overrideComponent} from '../../utils';\nimport {ButtonWithDisabledTooltipProps} from '../button';\nimport {ButtonWithDisabledTooltip} from '../button/ButtonWithDisabledTooltip';\n\nexport interface MenuItemProps extends MantineMenuItemProps, ButtonWithDisabledTooltipProps {}\n\nconst _MenuItem = forwardRef<HTMLButtonElement, MenuItemProps>(\n ({disabledTooltip, disabled, disabledTooltipProps, ...others}, ref) => (\n <ButtonWithDisabledTooltip\n disabled={disabled}\n disabledTooltip={disabledTooltip}\n disabledTooltipProps={disabledTooltipProps}\n >\n <MantineMenu.Item ref={ref} disabled={disabled} {...others} />\n </ButtonWithDisabledTooltip>\n )\n);\n\nconst MenuItem = createPolymorphicComponent<'button', MenuItemProps>(_MenuItem);\n\nexport const Menu = overrideComponent(MantineMenu, {\n displayName: '@coveord/plasma-mantine/Menu',\n Item: MenuItem,\n});\n"],"names":["Menu","_MenuItem","forwardRef","ref","disabledTooltip","disabled","disabledTooltipProps","others","ButtonWithDisabledTooltip","MantineMenu","Item","MenuItem","createPolymorphicComponent","overrideComponent","displayName"],"mappings":";;;;+BAuBaA;;;eAAAA;;;;;;oBAvB4D;qBAChD;qBAEmC;yCAEpB;AAIxC,IAAMC,0BAAYC,IAAAA,iBAAU,EACxB,iBAA+DC,mBAC3D;QADFC,yBAAAA,iBAAiBC,kBAAAA,UAAUC,8BAAAA,sBAAyBC;QAApDH;QAAiBC;QAAUC;;WACzB,qBAACE,oDAAyB;QACtBH,UAAUA;QACVD,iBAAiBA;QACjBE,sBAAsBA;kBAEtB,cAAA,qBAACG,UAAW,CAACC,IAAI;YAACP,KAAKA;YAAKE,UAAUA;WAAcE;;AAC7B;AAInC,IAAMI,WAAWC,IAAAA,iCAA0B,EAA0BX;AAE9D,IAAMD,OAAOa,IAAAA,wBAAiB,EAACJ,UAAW,EAAE;IAC/CK,aAAa;IACbJ,MAAMC;AACV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/menu/index.ts"],"sourcesContent":["export * from './Menu';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/menu/index.ts"],"sourcesContent":["export * from './Menu';\n"],"names":[],"mappings":";;;;;oBAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/modal/Modal.tsx"],"sourcesContent":["import {Modal as MantineModal, ModalProps} from '@mantine/core';\nimport {FunctionComponent, ReactNode} from 'react';\nimport {Header, HeaderProps} from '../header';\n\nexport interface CustomModalProps extends Omit<ModalProps, 'title'> {\n /**\n * Header component props (layout/Header)\n */\n header?: Omit<HeaderProps, 'children' | 'description'>;\n /**\n * The title text displayed on top of the modal\n */\n title: ReactNode;\n /**\n * The description text displayed inside the header underneath the title\n */\n description?: HeaderProps['description'];\n}\n\nexport const Modal: FunctionComponent<CustomModalProps> = ({children, title, header, description, ...otherProps}) => (\n <MantineModal\n {...otherProps}\n styles={{title: {width: '100%'}}}\n title={\n <Header py={0} px={0} description={description} {...header}>\n {title}\n </Header>\n }\n >\n {children}\n </MantineModal>\n);\n"],"names":["Modal","children","title","header","description","otherProps","MantineModal","styles","width","Header","py","px"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/modal/Modal.tsx"],"sourcesContent":["import {Modal as MantineModal, ModalProps} from '@mantine/core';\nimport {FunctionComponent, ReactNode} from 'react';\nimport {Header, HeaderProps} from '../header';\n\nexport interface CustomModalProps extends Omit<ModalProps, 'title'> {\n /**\n * Header component props (layout/Header)\n */\n header?: Omit<HeaderProps, 'children' | 'description'>;\n /**\n * The title text displayed on top of the modal\n */\n title: ReactNode;\n /**\n * The description text displayed inside the header underneath the title\n */\n description?: HeaderProps['description'];\n}\n\nexport const Modal: FunctionComponent<CustomModalProps> = ({children, title, header, description, ...otherProps}) => (\n <MantineModal\n {...otherProps}\n styles={{title: {width: '100%'}}}\n title={\n <Header py={0} px={0} description={description} {...header}>\n {title}\n </Header>\n }\n >\n {children}\n </MantineModal>\n);\n"],"names":["Modal","children","title","header","description","otherProps","MantineModal","styles","width","Header","py","px"],"mappings":";;;;+BAmBaA;;;eAAAA;;;;;;;oBAnBmC;sBAEd;AAiB3B,IAAMA,QAA6C,+BACtD;QADwDC,kBAAAA,UAAUC,eAAAA,OAAOC,gBAAAA,QAAQC,qBAAAA,aAAgBC;QAAzCJ;QAAUC;QAAOC;QAAQC;;WACjF,qBAACE,WAAY,uCACLD;QACJE,QAAQ;YAACL,OAAO;gBAACM,OAAO;YAAM;QAAC;QAC/BN,qBACI,qBAACO,cAAM;YAACC,IAAI;YAAGC,IAAI;YAAGP,aAAaA;WAAiBD;sBAC/CD;;kBAIRD;;AACS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/modal/index.ts"],"sourcesContent":["export * from './Modal';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/modal/index.ts"],"sourcesContent":["export * from './Modal';\n"],"names":[],"mappings":";;;;;oBAAc"}
|