@coveord/plasma-mantine 49.1.3 → 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 +9 -9
- 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 +7 -5
- 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 +48 -15
- 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 +3 -2
- 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 +4 -4
- 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/definitions/components/table/Table.d.ts +5 -3
- package/dist/definitions/components/table/Table.d.ts.map +1 -1
- package/dist/definitions/components/table/TableCollapsibleColumn.d.ts +4 -0
- package/dist/definitions/components/table/TableCollapsibleColumn.d.ts.map +1 -1
- package/dist/definitions/components/table/TableContext.d.ts +4 -0
- package/dist/definitions/components/table/TableContext.d.ts.map +1 -1
- package/dist/definitions/components/table/TablePagination.d.ts +2 -2
- package/dist/definitions/components/table/TablePagination.d.ts.map +1 -1
- package/dist/definitions/components/table/useTable.d.ts +1 -0
- package/dist/definitions/components/table/useTable.d.ts.map +1 -1
- package/dist/definitions/index.d.ts +3 -2
- package/dist/definitions/index.d.ts.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 +8 -6
- 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 +41 -14
- package/dist/esm/components/table/TableCollapsibleColumn.js.map +1 -1
- package/dist/esm/components/table/TableContext.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 +3 -2
- 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/index.js +2 -1
- package/dist/esm/index.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 +5 -5
- package/src/components/table/Table.tsx +20 -4
- package/src/components/table/TableCollapsibleColumn.tsx +41 -15
- package/src/components/table/TableContext.tsx +5 -0
- package/src/components/table/TablePagination.tsx +6 -4
- package/src/components/table/__tests__/Table.spec.tsx +40 -0
- package/src/components/table/__tests__/TablePagination.spec.tsx +48 -2
- package/src/index.ts +13 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/table/TableSelectableColumn.tsx"],"sourcesContent":["import {Checkbox, Tooltip} from '@mantine/core';\nimport {ColumnDef} from '@tanstack/table-core';\n\n/**\n * Generic column to use when your table needs multi selection of rows\n */\nexport const TableSelectableColumn: ColumnDef<unknown> = {\n id: 'select',\n enableSorting: false,\n header: ({table}) => {\n const label = table.getIsAllRowsSelected() ? 'Unselect all from this page' : 'Select all from this page';\n return (\n <Tooltip label={label}>\n <Checkbox\n checked={table.getIsAllPageRowsSelected()}\n indeterminate={table.getIsSomePageRowsSelected()}\n onChange={table.getToggleAllPageRowsSelectedHandler()}\n sx={{display: 'flex'}}\n aria-label={label}\n />\n </Tooltip>\n );\n },\n cell: ({row}) => (\n <Checkbox\n checked={row.getIsSelected()}\n indeterminate={row.getIsSomeSelected()}\n onChange={row.getToggleSelectedHandler()}\n sx={{display: 'flex'}}\n aria-label=\"Select row\"\n />\n ),\n};\n"],"names":["TableSelectableColumn","id","enableSorting","header","table","label","getIsAllRowsSelected","Tooltip","Checkbox","checked","getIsAllPageRowsSelected","indeterminate","getIsSomePageRowsSelected","onChange","getToggleAllPageRowsSelectedHandler","sx","display","aria-label","cell","row","getIsSelected","getIsSomeSelected","getToggleSelectedHandler"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/table/TableSelectableColumn.tsx"],"sourcesContent":["import {Checkbox, Tooltip} from '@mantine/core';\nimport {ColumnDef} from '@tanstack/table-core';\n\n/**\n * Generic column to use when your table needs multi selection of rows\n */\nexport const TableSelectableColumn: ColumnDef<unknown> = {\n id: 'select',\n enableSorting: false,\n header: ({table}) => {\n const label = table.getIsAllRowsSelected() ? 'Unselect all from this page' : 'Select all from this page';\n return (\n <Tooltip label={label}>\n <Checkbox\n checked={table.getIsAllPageRowsSelected()}\n indeterminate={table.getIsSomePageRowsSelected()}\n onChange={table.getToggleAllPageRowsSelectedHandler()}\n sx={{display: 'flex'}}\n aria-label={label}\n />\n </Tooltip>\n );\n },\n cell: ({row}) => (\n <Checkbox\n checked={row.getIsSelected()}\n indeterminate={row.getIsSomeSelected()}\n onChange={row.getToggleSelectedHandler()}\n sx={{display: 'flex'}}\n aria-label=\"Select row\"\n />\n ),\n};\n"],"names":["TableSelectableColumn","id","enableSorting","header","table","label","getIsAllRowsSelected","Tooltip","Checkbox","checked","getIsAllPageRowsSelected","indeterminate","getIsSomePageRowsSelected","onChange","getToggleAllPageRowsSelectedHandler","sx","display","aria-label","cell","row","getIsSelected","getIsSomeSelected","getToggleSelectedHandler"],"mappings":";;;;+BAMaA;;;eAAAA;;;;oBANmB;AAMzB,IAAMA,wBAA4C;IACrDC,IAAI;IACJC,eAAe,KAAK;IACpBC,QAAQ,gBAAa;YAAXC,cAAAA;QACN,IAAMC,QAAQD,MAAME,oBAAoB,KAAK,gCAAgC,2BAA2B;QACxG,qBACI,qBAACC,aAAO;YAACF,OAAOA;sBACZ,cAAA,qBAACG,cAAQ;gBACLC,SAASL,MAAMM,wBAAwB;gBACvCC,eAAeP,MAAMQ,yBAAyB;gBAC9CC,UAAUT,MAAMU,mCAAmC;gBACnDC,IAAI;oBAACC,SAAS;gBAAM;gBACpBC,cAAYZ;;;IAI5B;IACAa,MAAM;YAAEC,YAAAA;6BACJ,qBAACX,cAAQ;YACLC,SAASU,IAAIC,aAAa;YAC1BT,eAAeQ,IAAIE,iBAAiB;YACpCR,UAAUM,IAAIG,wBAAwB;YACtCP,IAAI;gBAACC,SAAS;YAAM;YACpBC,cAAW;;;AAGvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/table/Th.tsx"],"sourcesContent":["import {ArrowHeadDownSize16Px, ArrowHeadUpSize16Px} from '@coveord/plasma-react-icons';\nimport {Center, createStyles, Group, Text, UnstyledButton} from '@mantine/core';\nimport {defaultColumnSizing, flexRender, Header} from '@tanstack/react-table';\n\nconst useStyles = createStyles((theme) => ({\n th: {\n fontWeight: '400 !important' as any,\n padding: '0 !important',\n color: theme.black + '!important',\n verticalAlign: 'middle',\n },\n\n control: {\n width: '100%',\n padding: `${theme.spacing.xs}px ${theme.spacing.sm}px`,\n whiteSpace: 'nowrap',\n\n '&:hover': {\n backgroundColor: theme.colorScheme === 'dark' ? theme.colors.gray[6] : theme.colors.gray[2],\n },\n },\n}));\n\ninterface ThProps<T> {\n header: Header<T, unknown>;\n}\n\nconst SortingIcons = {\n asc: ArrowHeadDownSize16Px,\n desc: ArrowHeadUpSize16Px,\n};\n\nconst SortingLabels = {\n asc: 'ascending',\n desc: 'descending',\n} as const;\n\nexport const Th = <T,>({header}: ThProps<T>) => {\n const {classes} = useStyles();\n const size = header.column.getSize();\n const width = size !== defaultColumnSizing.size ? size : undefined;\n\n if (header.isPlaceholder) {\n return null;\n }\n\n if (!header.column.getCanSort()) {\n return (\n <th className={classes.th} style={{width}}>\n <Text size=\"xs\" py=\"xs\" px=\"sm\">\n {flexRender(header.column.columnDef.header, header.getContext())}\n </Text>\n </th>\n );\n }\n\n const onSort = header.column.getToggleSortingHandler();\n const sortingOrder = header.column.getIsSorted();\n const Icon = SortingIcons[sortingOrder || header.column.getFirstSortDir()];\n\n return (\n <th className={classes.th} style={{width}} aria-sort={sortingOrder ? SortingLabels[sortingOrder] : 'none'}>\n <UnstyledButton onClick={onSort} className={classes.control}>\n <Group position=\"apart\" noWrap>\n <Text size=\"xs\">{flexRender(header.column.columnDef.header, header.getContext())}</Text>\n <Center sx={(theme) => ({color: sortingOrder ? theme.colors.action[8] : undefined})}>\n <Icon height={14} />\n </Center>\n </Group>\n </UnstyledButton>\n </th>\n );\n};\n"],"names":["Th","useStyles","createStyles","theme","th","fontWeight","padding","color","black","verticalAlign","control","width","spacing","xs","sm","whiteSpace","backgroundColor","colorScheme","colors","gray","SortingIcons","asc","ArrowHeadDownSize16Px","desc","ArrowHeadUpSize16Px","SortingLabels","header","classes","size","column","getSize","defaultColumnSizing","undefined","isPlaceholder","getCanSort","className","style","Text","py","px","flexRender","columnDef","getContext","onSort","getToggleSortingHandler","sortingOrder","getIsSorted","Icon","getFirstSortDir","aria-sort","UnstyledButton","onClick","Group","position","noWrap","Center","sx","action","height"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/table/Th.tsx"],"sourcesContent":["import {ArrowHeadDownSize16Px, ArrowHeadUpSize16Px} from '@coveord/plasma-react-icons';\nimport {Center, createStyles, Group, Text, UnstyledButton} from '@mantine/core';\nimport {defaultColumnSizing, flexRender, Header} from '@tanstack/react-table';\n\nconst useStyles = createStyles((theme) => ({\n th: {\n fontWeight: '400 !important' as any,\n padding: '0 !important',\n color: theme.black + '!important',\n verticalAlign: 'middle',\n },\n\n control: {\n width: '100%',\n padding: `${theme.spacing.xs}px ${theme.spacing.sm}px`,\n whiteSpace: 'nowrap',\n\n '&:hover': {\n backgroundColor: theme.colorScheme === 'dark' ? theme.colors.gray[6] : theme.colors.gray[2],\n },\n },\n}));\n\ninterface ThProps<T> {\n header: Header<T, unknown>;\n}\n\nconst SortingIcons = {\n asc: ArrowHeadDownSize16Px,\n desc: ArrowHeadUpSize16Px,\n};\n\nconst SortingLabels = {\n asc: 'ascending',\n desc: 'descending',\n} as const;\n\nexport const Th = <T,>({header}: ThProps<T>) => {\n const {classes} = useStyles();\n const size = header.column.getSize();\n const width = size !== defaultColumnSizing.size ? size : undefined;\n\n if (header.isPlaceholder) {\n return null;\n }\n\n if (!header.column.getCanSort()) {\n return (\n <th className={classes.th} style={{width}}>\n <Text size=\"xs\" py=\"xs\" px=\"sm\">\n {flexRender(header.column.columnDef.header, header.getContext())}\n </Text>\n </th>\n );\n }\n\n const onSort = header.column.getToggleSortingHandler();\n const sortingOrder = header.column.getIsSorted();\n const Icon = SortingIcons[sortingOrder || header.column.getFirstSortDir()];\n\n return (\n <th className={classes.th} style={{width}} aria-sort={sortingOrder ? SortingLabels[sortingOrder] : 'none'}>\n <UnstyledButton onClick={onSort} className={classes.control}>\n <Group position=\"apart\" noWrap>\n <Text size=\"xs\">{flexRender(header.column.columnDef.header, header.getContext())}</Text>\n <Center sx={(theme) => ({color: sortingOrder ? theme.colors.action[8] : undefined})}>\n <Icon height={14} />\n </Center>\n </Group>\n </UnstyledButton>\n </th>\n );\n};\n"],"names":["Th","useStyles","createStyles","theme","th","fontWeight","padding","color","black","verticalAlign","control","width","spacing","xs","sm","whiteSpace","backgroundColor","colorScheme","colors","gray","SortingIcons","asc","ArrowHeadDownSize16Px","desc","ArrowHeadUpSize16Px","SortingLabels","header","classes","size","column","getSize","defaultColumnSizing","undefined","isPlaceholder","getCanSort","className","style","Text","py","px","flexRender","columnDef","getContext","onSort","getToggleSortingHandler","sortingOrder","getIsSorted","Icon","getFirstSortDir","aria-sort","UnstyledButton","onClick","Group","position","noWrap","Center","sx","action","height"],"mappings":";;;;+BAqCaA;;;eAAAA;;;;gCArC4C;oBACO;0BACV;AAEtD,IAAMC,YAAYC,IAAAA,kBAAY,EAAC,SAACC;WAAW;QACvCC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AOG,MAAM,CAACmB,eAAe,GAAG;IAE1E,qBACI,qBAAC5C;QAAG+B,WAAWR,QAAQvB,EAAE;QAAEgC,OAAO;YAACzB,OAAAA;QAAK;QAAGsC,aAAWJ,eAAepB,aAAa,CAACoB,aAAa,GAAG,MAAM;kBACrG,cAAA,qBAACK,oBAAc;YAACC,SAASR;YAAQR,WAAWR,QAAQjB,OAAO;sBACvD,cAAA,sBAAC0C,WAAK;gBAACC,UAAS;gBAAQC,MAAM;;kCAC1B,qBAACjB,UAAI;wBAACT,MAAK;kCAAMY,IAAAA,sBAAU,EAACd,OAAOG,MAAM,CAACY,SAAS,CAACf,MAAM,EAAEA,OAAOgB,UAAU;;kCAC7E,qBAACa,YAAM;wBAACC,IAAI,SAACrD;mCAAW;gCAACI,OAAOsC,eAAe1C,MAAMe,MAAM,CAACuC,MAAM,CAAC,EAAE,GAAGzB,SAAS;4BAAA;;kCAC7E,cAAA,qBAACe;4BAAKW,QAAQ;;;;;;;AAMtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/table/index.ts"],"sourcesContent":["export * from './Table';\nexport {type onTableChangeEvent} from './TableContext';\nexport * from './useTable';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/table/index.ts"],"sourcesContent":["export * from './Table';\nexport {type onTableChangeEvent} from './TableContext';\nexport * from './useTable';\n"],"names":[],"mappings":";;;;;oBAAc;oBAEA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/table/useRowSelection.ts"],"sourcesContent":["import {functionalUpdate, Table} from '@tanstack/table-core';\nimport {useState} from 'react';\n\nexport const useRowSelection = <T>(table: Table<T>) => {\n const [rowSelection, setRowSelection] = useState<Record<string, T>>({});\n\n table.setOptions((prev) => ({\n ...prev,\n onRowSelectionChange: (rowSelectionUpdater) => {\n table.setState((old) => {\n const selectedRowsIds = functionalUpdate(rowSelectionUpdater, old['rowSelection']);\n setRowSelection((current) => {\n const currentRowsById = table.getRowModel().rowsById;\n return Object.keys(selectedRowsIds).reduce((memo, rowId) => {\n if (current[rowId]) {\n memo[rowId] = current[rowId];\n } else {\n memo[rowId] = currentRowsById[rowId].original;\n }\n return memo;\n }, {} as Record<string, T>);\n });\n\n return {\n ...old,\n rowSelection: selectedRowsIds,\n };\n });\n },\n }));\n\n const clearSelection = () => {\n table.resetRowSelection(true);\n };\n\n const getSelectedRows = () => Object.values(rowSelection);\n\n const getSelectedRow = () => getSelectedRows()[0] ?? null;\n\n return {\n clearSelection,\n getSelectedRow,\n getSelectedRows,\n };\n};\n"],"names":["useRowSelection","table","useState","rowSelection","setRowSelection","setOptions","prev","onRowSelectionChange","rowSelectionUpdater","setState","old","selectedRowsIds","functionalUpdate","current","currentRowsById","getRowModel","rowsById","Object","keys","reduce","memo","rowId","original","clearSelection","resetRowSelection","getSelectedRows","values","getSelectedRow"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/table/useRowSelection.ts"],"sourcesContent":["import {functionalUpdate, Table} from '@tanstack/table-core';\nimport {useState} from 'react';\n\nexport const useRowSelection = <T>(table: Table<T>) => {\n const [rowSelection, setRowSelection] = useState<Record<string, T>>({});\n\n table.setOptions((prev) => ({\n ...prev,\n onRowSelectionChange: (rowSelectionUpdater) => {\n table.setState((old) => {\n const selectedRowsIds = functionalUpdate(rowSelectionUpdater, old['rowSelection']);\n setRowSelection((current) => {\n const currentRowsById = table.getRowModel().rowsById;\n return Object.keys(selectedRowsIds).reduce((memo, rowId) => {\n if (current[rowId]) {\n memo[rowId] = current[rowId];\n } else {\n memo[rowId] = currentRowsById[rowId].original;\n }\n return memo;\n }, {} as Record<string, T>);\n });\n\n return {\n ...old,\n rowSelection: selectedRowsIds,\n };\n });\n },\n }));\n\n const clearSelection = () => {\n table.resetRowSelection(true);\n };\n\n const getSelectedRows = () => Object.values(rowSelection);\n\n const getSelectedRow = () => getSelectedRows()[0] ?? null;\n\n return {\n clearSelection,\n getSelectedRow,\n getSelectedRows,\n };\n};\n"],"names":["useRowSelection","table","useState","rowSelection","setRowSelection","setOptions","prev","onRowSelectionChange","rowSelectionUpdater","setState","old","selectedRowsIds","functionalUpdate","current","currentRowsById","getRowModel","rowsById","Object","keys","reduce","memo","rowId","original","clearSelection","resetRowSelection","getSelectedRows","values","getSelectedRow"],"mappings":";;;;+BAGaA;;;eAAAA;;;;;;yBAHyB;qBACf;AAEhB,IAAMA,kBAAkB,SAAIC,OAAoB;IACnD,IAAwCC,2BAAAA,IAAAA,eAAQ,EAAoB,CAAC,QAA9DC,eAAiCD,cAAnBE,kBAAmBF;IAExCD,MAAMI,UAAU,CAAC,SAACC;eAAU,qCACrBA;YACHC,sBAAsB,SAACC,qBAAwB;gBAC3CP,MAAMQ,QAAQ,CAAC,SAACC,KAAQ;oBACpB,IAAMC,kBAAkBC,IAAAA,2BAAgB,EAACJ,qBAAqBE,GAAG,CAAC,eAAe;oBACjFN,gBAAgB,SAACS,SAAY;wBACzB,IAAMC,kBAAkBb,MAAMc,WAAW,GAAGC,QAAQ;wBACpD,OAAOC,OAAOC,IAAI,CAACP,iBAAiBQ,MAAM,CAAC,SAACC,MAAMC,OAAU;4BACxD,IAAIR,OAAO,CAACQ,MAAM,EAAE;gCAChBD,IAAI,CAACC,MAAM,GAAGR,OAAO,CAACQ,MAAM;4BAChC,OAAO;gCACHD,IAAI,CAACC,MAAM,GAAGP,eAAe,CAACO,MAAM,CAACC,QAAQ;4BACjD,CAAC;4BACD,OAAOF;wBACX,GAAG,CAAC;oBACR;oBAEA,OAAO,qCACAV;wBACHP,cAAcQ;;gBAEtB;YACJ;;;IAGJ,IAAMY,iBAAiB,WAAM;QACzBtB,MAAMuB,iBAAiB,CAAC,IAAI;IAChC;IAEA,IAAMC,kBAAkB;eAAMR,OAAOS,MAAM,CAACvB;;QAEfsB;IAA7B,IAAME,iBAAiB;eAAMF,CAAAA,oBAAAA,iBAAiB,CAAC,EAAE,cAApBA,+BAAAA,oBAAwB,IAAI;;IAEzD,OAAO;QACHF,gBAAAA;QACAI,gBAAAA;QACAF,iBAAAA;IACJ;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/table/useTable.tsx"],"sourcesContent":["import {useContext} from 'react';\nimport {TableContext} from './TableContext';\n\nexport const useTable = () => {\n const ctx = useContext(TableContext);\n if (ctx === null) {\n throw new Error('useTable must be used inside of a TableContext.Provider');\n }\n\n return ctx;\n};\n"],"names":["useTable","ctx","useContext","TableContext","Error"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/table/useTable.tsx"],"sourcesContent":["import {useContext} from 'react';\nimport {TableContext} from './TableContext';\n\nexport const useTable = () => {\n const ctx = useContext(TableContext);\n if (ctx === null) {\n throw new Error('useTable must be used inside of a TableContext.Provider');\n }\n\n return ctx;\n};\n"],"names":["useTable","ctx","useContext","TableContext","Error"],"mappings":";;;;+BAGaA;;;eAAAA;;;qBAHY;4BACE;AAEpB,IAAMA,WAAW,WAAM;IAC1B,IAAMC,MAAMC,IAAAA,iBAAU,EAACC,0BAAY;IACnC,IAAIF,QAAQ,IAAI,EAAE;QACd,MAAM,IAAIG,MAAM,2DAA2D;IAC/E,CAAC;IAED,OAAOH;AACX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/form/FormProvider.tsx"],"sourcesContent":["/* eslint-disable prefer-arrow/prefer-arrow-functions */\nimport {_TransformValues, UseForm, UseFormReturnType} from '@mantine/form/lib/types';\nimport React, {createContext, useContext} from 'react';\n\nimport {useForm} from './useForm';\n\nexport interface FormProviderProps<Form> {\n form: Form;\n children: React.ReactNode;\n}\n\nexport function createFormContext<\n Values,\n TransformValues extends _TransformValues<Values> = (values: Values) => Values\n>() {\n type Form = UseFormReturnType<Values, TransformValues>;\n\n const FormContext = createContext<Form>(null);\n\n function FormProvider({form, children}: FormProviderProps<Form>) {\n return <FormContext.Provider value={form}>{children}</FormContext.Provider>;\n }\n\n function useFormContext() {\n const ctx = useContext(FormContext);\n if (!ctx) {\n throw new Error('useFormContext was called outside of FormProvider context');\n }\n\n return ctx;\n }\n\n return [FormProvider, useFormContext, useForm] as [\n React.FC<FormProviderProps<Form>>,\n () => Form,\n UseForm<Values, TransformValues>\n ];\n}\n"],"names":["createFormContext","FormProvider","form","children","FormContext","Provider","value","useFormContext","ctx","useContext","Error","createContext","useForm"],"mappings":"AAAA,sDAAsD
|
|
1
|
+
{"version":3,"sources":["../../../src/form/FormProvider.tsx"],"sourcesContent":["/* eslint-disable prefer-arrow/prefer-arrow-functions */\nimport {_TransformValues, UseForm, UseFormReturnType} from '@mantine/form/lib/types';\nimport React, {createContext, useContext} from 'react';\n\nimport {useForm} from './useForm';\n\nexport interface FormProviderProps<Form> {\n form: Form;\n children: React.ReactNode;\n}\n\nexport function createFormContext<\n Values,\n TransformValues extends _TransformValues<Values> = (values: Values) => Values\n>() {\n type Form = UseFormReturnType<Values, TransformValues>;\n\n const FormContext = createContext<Form>(null);\n\n function FormProvider({form, children}: FormProviderProps<Form>) {\n return <FormContext.Provider value={form}>{children}</FormContext.Provider>;\n }\n\n function useFormContext() {\n const ctx = useContext(FormContext);\n if (!ctx) {\n throw new Error('useFormContext was called outside of FormProvider context');\n }\n\n return ctx;\n }\n\n return [FormProvider, useFormContext, useForm] as [\n React.FC<FormProviderProps<Form>>,\n () => Form,\n UseForm<Values, TransformValues>\n ];\n}\n"],"names":["createFormContext","FormProvider","form","children","FormContext","Provider","value","useFormContext","ctx","useContext","Error","createContext","useForm"],"mappings":"AAAA,sDAAsD;;;;+BAWtCA;;;eAAAA;;;;;2DAT+B;uBAEzB;AAOf,SAASA,oBAGZ;QAKSC,eAAT,SAASA,aAAa,KAAyC,EAAE;YAA1CC,OAAD,MAACA,MAAMC,WAAP,MAAOA;QACzB,qBAAO,qBAACC,YAAYC,QAAQ;YAACC,OAAOJ;sBAAOC;;IAC/C;QAESI,iBAAT,SAASA,iBAAiB;QACtB,IAAMC,MAAMC,IAAAA,iBAAU,EAACL;QACvB,IAAI,CAACI,KAAK;YACN,MAAM,IAAIE,MAAM,6DAA6D;QACjF,CAAC;QAED,OAAOF;IACX;IAbA,IAAMJ,4BAAcO,IAAAA,oBAAa,EAAO,IAAI;IAe5C,OAAO;QAACV;QAAcM;QAAgBK,gBAAO;KAAC;AAKlD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/form/index.ts"],"sourcesContent":["export * from './useForm';\nexport * from './FormProvider';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/form/index.ts"],"sourcesContent":["export * from './useForm';\nexport * from './FormProvider';\n"],"names":[],"mappings":";;;;;oBAAc;oBACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/form/useForm.ts"],"sourcesContent":["import {useForm as useMantineForm} from '@mantine/form';\nimport {GetInputProps} from '@mantine/form/lib/types';\n\nexport const useForm: typeof useMantineForm = (options) => {\n const form = useMantineForm(options);\n\n const getInputProps: GetInputProps<Record<string, unknown>> = (\n path,\n {type = 'input', withError = type === 'input', withFocus = true} = {}\n ) => {\n const originalPayload = form.getInputProps(path, {type, withError, withFocus});\n if (Array.isArray(originalPayload.value)) {\n return {\n ...originalPayload,\n onReorderItem: (payload: Record<'from' | 'to', number>) => form.reorderListItem(path, payload),\n onRemoveItem: (index: number) => form.removeListItem(path, index),\n onInsertItem: (valueToInsert: unknown, index: number) =>\n form.insertListItem(path, valueToInsert, index),\n };\n }\n\n return originalPayload;\n };\n\n return {...form, getInputProps};\n};\n"],"names":["useForm","options","form","useMantineForm","getInputProps","path","type","withError","withFocus","originalPayload","Array","isArray","value","onReorderItem","payload","reorderListItem","onRemoveItem","index","removeListItem","onInsertItem","valueToInsert","insertListItem"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/form/useForm.ts"],"sourcesContent":["import {useForm as useMantineForm} from '@mantine/form';\nimport {GetInputProps} from '@mantine/form/lib/types';\n\nexport const useForm: typeof useMantineForm = (options) => {\n const form = useMantineForm(options);\n\n const getInputProps: GetInputProps<Record<string, unknown>> = (\n path,\n {type = 'input', withError = type === 'input', withFocus = true} = {}\n ) => {\n const originalPayload = form.getInputProps(path, {type, withError, withFocus});\n if (Array.isArray(originalPayload.value)) {\n return {\n ...originalPayload,\n onReorderItem: (payload: Record<'from' | 'to', number>) => form.reorderListItem(path, payload),\n onRemoveItem: (index: number) => form.removeListItem(path, index),\n onInsertItem: (valueToInsert: unknown, index: number) =>\n form.insertListItem(path, valueToInsert, index),\n };\n }\n\n return originalPayload;\n };\n\n return {...form, getInputProps};\n};\n"],"names":["useForm","options","form","useMantineForm","getInputProps","path","type","withError","withFocus","originalPayload","Array","isArray","value","onReorderItem","payload","reorderListItem","onRemoveItem","index","removeListItem","onInsertItem","valueToInsert","insertListItem"],"mappings":";;;;+BAGaA;;;eAAAA;;;;;oBAH2B;AAGjC,IAAMA,UAAiC,SAACC,SAAY;IACvD,IAAMC,OAAOC,IAAAA,aAAc,EAACF;IAE5B,IAAMG,gBAAwD,SAC1DC,MAEC;oFADkE,CAAC,oBAAnEC,MAAAA,8BAAO,2CAASC,WAAAA,wCAAYD,SAAS,gDAASE,WAAAA,wCAAY,IAAI;QAE/D,IAAMC,kBAAkBP,KAAKE,aAAa,CAACC,MAAM;YAACC,MAAAA;YAAMC,WAAAA;YAAWC,WAAAA;QAAS;QAC5E,IAAIE,MAAMC,OAAO,CAACF,gBAAgBG,KAAK,GAAG;YACtC,OAAO,qCACAH;gBACHI,eAAe,SAACC;2BAA2CZ,KAAKa,eAAe,CAACV,MAAMS;;gBACtFE,cAAc,SAACC;2BAAkBf,KAAKgB,cAAc,CAACb,MAAMY;;gBAC3DE,cAAc,SAACC,eAAwBH;2BACnCf,KAAKmB,cAAc,CAAChB,MAAMe,eAAeH;;;QAErD,CAAC;QAED,OAAOR;IACX;IAEA,OAAO,qCAAIP;QAAME,eAAAA;;AACrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/hooks/index.ts"],"sourcesContent":["export * from './useParentHeight';\nexport * from './useControlledList';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/hooks/index.ts"],"sourcesContent":["export * from './useParentHeight';\nexport * from './useControlledList';\n"],"names":[],"mappings":";;;;;oBAAc;oBACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/hooks/useControlledList.ts"],"sourcesContent":["import {useUncontrolled} from '@mantine/hooks';\n\ninterface UseControlledList<T> {\n /** Initial value for uncontrolled state */\n defaultValue?: T[];\n /** Value for controlled state */\n value?: T[];\n /** Controlled state onChange handler */\n onChange?: (values: T[]) => void;\n}\n\ninterface ListHandlers<T> {\n /** Appends the item at the end of the list */\n append: (item: T) => void;\n /** Removes the item at the index from the list */\n remove: (index: number) => void;\n /** Moves the item at the \"from\" position to another position within the list */\n reorder: ({from, to}: {from: number; to: number}) => void;\n}\n\n/**\n * Manage a list of items in a controlled fashion, to be used with inputs\n */\nexport const useControlledList = <T>({defaultValue, value, onChange}: UseControlledList<T>): [T[], ListHandlers<T>] => {\n const [values, handleChange] = useUncontrolled({\n value,\n defaultValue,\n finalValue: [],\n onChange,\n });\n\n const remove = (index: number) => {\n const newValues = values.filter((_, i) => i !== index);\n handleChange?.(newValues);\n };\n\n const append = (item: T) => {\n const newValues = [...values, item];\n handleChange?.(newValues);\n };\n\n const reorder = ({from, to}: {from: number; to: number}) => {\n const newValues = [...values];\n const item = values[from];\n\n newValues.splice(from, 1);\n newValues.splice(to, 0, item);\n\n handleChange?.(newValues);\n };\n\n return [values, {remove, append, reorder}];\n};\n"],"names":["useControlledList","defaultValue","value","onChange","useUncontrolled","finalValue","values","handleChange","remove","index","newValues","filter","_","i","append","item","reorder","from","to","splice"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/hooks/useControlledList.ts"],"sourcesContent":["import {useUncontrolled} from '@mantine/hooks';\n\ninterface UseControlledList<T> {\n /** Initial value for uncontrolled state */\n defaultValue?: T[];\n /** Value for controlled state */\n value?: T[];\n /** Controlled state onChange handler */\n onChange?: (values: T[]) => void;\n}\n\ninterface ListHandlers<T> {\n /** Appends the item at the end of the list */\n append: (item: T) => void;\n /** Removes the item at the index from the list */\n remove: (index: number) => void;\n /** Moves the item at the \"from\" position to another position within the list */\n reorder: ({from, to}: {from: number; to: number}) => void;\n}\n\n/**\n * Manage a list of items in a controlled fashion, to be used with inputs\n */\nexport const useControlledList = <T>({defaultValue, value, onChange}: UseControlledList<T>): [T[], ListHandlers<T>] => {\n const [values, handleChange] = useUncontrolled({\n value,\n defaultValue,\n finalValue: [],\n onChange,\n });\n\n const remove = (index: number) => {\n const newValues = values.filter((_, i) => i !== index);\n handleChange?.(newValues);\n };\n\n const append = (item: T) => {\n const newValues = [...values, item];\n handleChange?.(newValues);\n };\n\n const reorder = ({from, to}: {from: number; to: number}) => {\n const newValues = [...values];\n const item = values[from];\n\n newValues.splice(from, 1);\n newValues.splice(to, 0, item);\n\n handleChange?.(newValues);\n };\n\n return [values, {remove, append, reorder}];\n};\n"],"names":["useControlledList","defaultValue","value","onChange","useUncontrolled","finalValue","values","handleChange","remove","index","newValues","filter","_","i","append","item","reorder","from","to","splice"],"mappings":";;;;+BAuBaA;;;eAAAA;;;;;qBAvBiB;AAuBvB,IAAMA,oBAAoB,gBAAsF;QAAjFC,qBAAAA,cAAcC,cAAAA,OAAOC,iBAAAA;IACvD,IAA+BC,kCAAAA,IAAAA,sBAAe,EAAC;QAC3CF,OAAAA;QACAD,cAAAA;QACAI,YAAY,EAAE;QACdF,UAAAA;IACJ,QALOG,SAAwBF,qBAAhBG,eAAgBH;IAO/B,IAAMI,SAAS,SAACC,OAAkB;QAC9B,IAAMC,YAAYJ,OAAOK,MAAM,CAAC,SAACC,GAAGC;mBAAMA,MAAMJ;;QAChDF,yBAAAA,0BAAAA,KAAAA,IAAAA,aAAeG;IACnB;IAEA,IAAMI,SAAS,SAACC,MAAY;QACxB,IAAML,YAAY,AAAC,mBAAGJ,eAAJ;YAAYS;SAAK;QACnCR,yBAAAA,0BAAAA,KAAAA,IAAAA,aAAeG;IACnB;IAEA,IAAMM,UAAU,gBAA4C;YAA1CC,aAAAA,MAAMC,WAAAA;QACpB,IAAMR,YAAa,mBAAGJ;QACtB,IAAMS,OAAOT,MAAM,CAACW,KAAK;QAEzBP,UAAUS,MAAM,CAACF,MAAM;QACvBP,UAAUS,MAAM,CAACD,IAAI,GAAGH;QAExBR,yBAAAA,0BAAAA,KAAAA,IAAAA,aAAeG;IACnB;IAEA,OAAO;QAACJ;QAAQ;YAACE,QAAAA;YAAQM,QAAAA;YAAQE,SAAAA;QAAO;KAAE;AAC9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/hooks/useParentHeight.ts"],"sourcesContent":["import {useEffect, useRef, useState} from 'react';\n\nconst getElementInnerHeight = (el: HTMLElement): number => {\n const fullHeight = el.getBoundingClientRect().height;\n const cs = getComputedStyle(el);\n const padding = parseFloat(cs.paddingTop) + parseFloat(cs.paddingBottom);\n const border = parseFloat(cs.borderTopWidth) + parseFloat(cs.borderBottomWidth);\n return fullHeight - padding - border;\n};\n\n/**\n * Computes the available height of the parent element on mount\n */\nexport const useParentHeight = (): [number, React.MutableRefObject<HTMLDivElement>] => {\n const [height, setHeight] = useState(-1);\n const ref = useRef<HTMLDivElement>();\n\n useEffect(() => {\n if (ref.current) {\n setHeight(getElementInnerHeight(ref.current.parentElement));\n }\n }, [ref.current]);\n\n return [height, ref];\n};\n"],"names":["useParentHeight","getElementInnerHeight","el","fullHeight","getBoundingClientRect","height","cs","getComputedStyle","padding","parseFloat","paddingTop","paddingBottom","border","borderTopWidth","borderBottomWidth","useState","setHeight","ref","useRef","useEffect","current","parentElement"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/hooks/useParentHeight.ts"],"sourcesContent":["import {useEffect, useRef, useState} from 'react';\n\nconst getElementInnerHeight = (el: HTMLElement): number => {\n const fullHeight = el.getBoundingClientRect().height;\n const cs = getComputedStyle(el);\n const padding = parseFloat(cs.paddingTop) + parseFloat(cs.paddingBottom);\n const border = parseFloat(cs.borderTopWidth) + parseFloat(cs.borderBottomWidth);\n return fullHeight - padding - border;\n};\n\n/**\n * Computes the available height of the parent element on mount\n */\nexport const useParentHeight = (): [number, React.MutableRefObject<HTMLDivElement>] => {\n const [height, setHeight] = useState(-1);\n const ref = useRef<HTMLDivElement>();\n\n useEffect(() => {\n if (ref.current) {\n setHeight(getElementInnerHeight(ref.current.parentElement));\n }\n }, [ref.current]);\n\n return [height, ref];\n};\n"],"names":["useParentHeight","getElementInnerHeight","el","fullHeight","getBoundingClientRect","height","cs","getComputedStyle","padding","parseFloat","paddingTop","paddingBottom","border","borderTopWidth","borderBottomWidth","useState","setHeight","ref","useRef","useEffect","current","parentElement"],"mappings":";;;;+BAaaA;;;eAAAA;;;;qBAb6B;AAE1C,IAAMC,wBAAwB,SAACC,IAA4B;IACvD,IAAMC,aAAaD,GAAGE,qBAAqB,GAAGC,MAAM;IACpD,IAAMC,KAAKC,iBAAiBL;IAC5B,IAAMM,UAAUC,WAAWH,GAAGI,UAAU,IAAID,WAAWH,GAAGK,aAAa;IACvE,IAAMC,SAASH,WAAWH,GAAGO,cAAc,IAAIJ,WAAWH,GAAGQ,iBAAiB;IAC9E,OAAOX,aAAaK,UAAUI;AAClC;AAKO,IAAMZ,kBAAkB,WAAwD;IACnF,IAA4Be,2BAAAA,IAAAA,eAAQ,EAAC,CAAC,QAA/BV,SAAqBU,cAAbC,YAAaD;IAC5B,IAAME,MAAMC,IAAAA,aAAM;IAElBC,IAAAA,gBAAS,EAAC,WAAM;QACZ,IAAIF,IAAIG,OAAO,EAAE;YACbJ,UAAUf,sBAAsBgB,IAAIG,OAAO,CAACC,aAAa;QAC7D,CAAC;IACL,GAAG;QAACJ,IAAIG,OAAO;KAAC;IAEhB,OAAO;QAACf;QAAQY;KAAI;AACxB"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -9,8 +9,8 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
|
|
13
|
-
return
|
|
12
|
+
Pagination: function() {
|
|
13
|
+
return _core.Pagination;
|
|
14
14
|
},
|
|
15
15
|
Header: function() {
|
|
16
16
|
return _components.Header;
|
|
@@ -36,9 +36,9 @@ _export(exports, {
|
|
|
36
36
|
});
|
|
37
37
|
var _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
38
38
|
_exportStar(require("@mantine/carousel"), exports);
|
|
39
|
-
_exportStar(require("@mantine/core"), exports);
|
|
39
|
+
var _core = _exportStar(require("@mantine/core"), exports);
|
|
40
40
|
_exportStar(require("@mantine/hooks"), exports);
|
|
41
|
-
|
|
41
|
+
_exportStar(require("@tanstack/table-core"), exports);
|
|
42
42
|
var _components = _exportStar(require("./components"), exports);
|
|
43
43
|
_exportStar(require("@mantine/form"), exports);
|
|
44
44
|
var _form = require("./form");
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["import {Tuple} from '@mantine/core';\n\nimport {PlasmaColors} from './theme/PlasmaColors';\n\nexport * from '@mantine/carousel';\nexport * from '@mantine/core';\nexport type {FormValidateInput} from '@mantine/form/lib/types';\nexport * from '@mantine/hooks';\nexport
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["import {Tuple} from '@mantine/core';\n\nimport {PlasmaColors} from './theme/PlasmaColors';\n\nexport * from '@mantine/carousel';\nexport * from '@mantine/core';\nexport type {FormValidateInput} from '@mantine/form/lib/types';\nexport * from '@mantine/hooks';\nexport * from '@tanstack/table-core';\nexport * from './components';\nexport * from '@mantine/form';\nexport {Pagination} from '@mantine/core';\n// explicitly overriding mantine components\nexport {\n Header,\n Table,\n type TableProps,\n type HeaderProps,\n Modal,\n Button,\n type ButtonProps,\n Menu,\n type MenuItemProps,\n} from './components';\nexport {useForm, createFormContext} from './form';\n\nexport * from './theme';\n\ndeclare module '@mantine/core' {\n export interface MantineThemeColorsOverride {\n // eslint-disable-next-line @typescript-eslint/ban-types\n colors: Record<keyof typeof PlasmaColors | (string & {}), Tuple<string, 10>>;\n }\n}\n"],"names":["Pagination","Header","Table","Modal","Button","Menu","useForm","createFormContext"],"mappings":";;;;;;;;;;;IAWQA,UAAU;eAAVA,gBAAU;;IAGdC,MAAM;eAANA,kBAAM;;IACNC,KAAK;eAALA,iBAAK;;IAGLC,KAAK;eAALA,iBAAK;;IACLC,MAAM;eAANA,kBAAM;;IAENC,IAAI;eAAJA,gBAAI;;IAGAC,OAAO;eAAPA,aAAO;;IAAEC,iBAAiB;eAAjBA,uBAAiB;;;;oBApBpB;gCACA;oBAEA;oBACA;sCACA;oBACA;oBAc2B;oBAE3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/theme/PlasmaColors.ts"],"sourcesContent":["import {color} from '@coveord/plasma-tokens';\nimport {Tuple} from '@mantine/core';\n\nconst toMantineColor = (plasmaColor: Record<string, string>): Tuple<string, 10> =>\n Object.values(plasmaColor) as Tuple<string, 10>;\n\nconst navy = toMantineColor(color.primary.navy);\nconst red = toMantineColor(color.accent.red);\nconst yellow = toMantineColor(color.accent.yellow);\nconst teal = toMantineColor(color.accent.teal);\nconst lime = [\n color.secondary.lime[0],\n color.secondary.lime[0],\n color.secondary.lime[0],\n color.secondary.lime[0],\n color.secondary.lime[6],\n color.secondary.lime[6],\n color.secondary.lime[6],\n color.secondary.lime[9],\n color.secondary.lime[9],\n color.secondary.lime[9],\n] as Tuple<string, 10>;\n\nexport const PlasmaColors = {\n // Primary\n gray: toMantineColor(color.primary.gray),\n action: [\n color.primary.action[1],\n color.primary.action[1],\n color.primary.action[2],\n color.primary.action[3],\n color.primary.action[4],\n color.primary.action[6],\n color.primary.action[6],\n color.primary.action[8],\n color.primary.action[8],\n color.primary.action[9],\n ] as Tuple<string, 10>,\n navy,\n info: navy,\n // Accent\n blue: toMantineColor(color.accent.blue),\n red,\n critical: red,\n teal,\n new: teal,\n yellow,\n warning: yellow,\n // Secondary\n green: toMantineColor(color.secondary.green),\n indigo: toMantineColor(color.secondary.indigo),\n lime,\n success: lime,\n purple: toMantineColor(color.secondary.purple),\n};\n"],"names":["PlasmaColors","toMantineColor","plasmaColor","Object","values","navy","color","primary","red","accent","yellow","teal","lime","secondary","gray","action","info","blue","critical","new","warning","green","indigo","success","purple"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/theme/PlasmaColors.ts"],"sourcesContent":["import {color} from '@coveord/plasma-tokens';\nimport {Tuple} from '@mantine/core';\n\nconst toMantineColor = (plasmaColor: Record<string, string>): Tuple<string, 10> =>\n Object.values(plasmaColor) as Tuple<string, 10>;\n\nconst navy = toMantineColor(color.primary.navy);\nconst red = toMantineColor(color.accent.red);\nconst yellow = toMantineColor(color.accent.yellow);\nconst teal = toMantineColor(color.accent.teal);\nconst lime = [\n color.secondary.lime[0],\n color.secondary.lime[0],\n color.secondary.lime[0],\n color.secondary.lime[0],\n color.secondary.lime[6],\n color.secondary.lime[6],\n color.secondary.lime[6],\n color.secondary.lime[9],\n color.secondary.lime[9],\n color.secondary.lime[9],\n] as Tuple<string, 10>;\n\nexport const PlasmaColors = {\n // Primary\n gray: toMantineColor(color.primary.gray),\n action: [\n color.primary.action[1],\n color.primary.action[1],\n color.primary.action[2],\n color.primary.action[3],\n color.primary.action[4],\n color.primary.action[6],\n color.primary.action[6],\n color.primary.action[8],\n color.primary.action[8],\n color.primary.action[9],\n ] as Tuple<string, 10>,\n navy,\n info: navy,\n // Accent\n blue: toMantineColor(color.accent.blue),\n red,\n critical: red,\n teal,\n new: teal,\n yellow,\n warning: yellow,\n // Secondary\n green: toMantineColor(color.secondary.green),\n indigo: toMantineColor(color.secondary.indigo),\n lime,\n success: lime,\n purple: toMantineColor(color.secondary.purple),\n};\n"],"names":["PlasmaColors","toMantineColor","plasmaColor","Object","values","navy","color","primary","red","accent","yellow","teal","lime","secondary","gray","action","info","blue","critical","new","warning","green","indigo","success","purple"],"mappings":";;;;+BAuBaA;;;eAAAA;;;4BAvBO;AAGpB,IAAMC,iBAAiB,SAACC;WACpBC,OAAOC,MAAM,CAACF;;AAElB,IAAMG,OAAOJ,eAAeK,mBAAK,CAACC,OAAO,CAACF,IAAI;AAC9C,IAAMG,MAAMP,eAAeK,mBAAK,CAACG,MAAM,CAACD,GAAG;AAC3C,IAAME,SAAST,eAAeK,mBAAK,CAACG,MAAM,CAACC,MAAM;AACjD,IAAMC,OAAOV,eAAeK,mBAAK,CAACG,MAAM,CAACE,IAAI;AAC7C,IAAMC,OAAO;IACTN,mBAAK,CAACO,SAAS,CAACD,IAAI,CAAC,EAAE;IACvBN,mBAAK,CAACO,SAAS,CAACD,IAAI,CAAC,EAAE;IACvBN,mBAAK,CAACO,SAAS,CAACD,IAAI,CAAC,EAAE;IACvBN,mBAAK,CAACO,SAAS,CAACD,IAAI,CAAC,EAAE;IACvBN,mBAAK,CAACO,SAAS,CAACD,IAAI,CAAC,EAAE;IACvBN,mBAAK,CAACO,SAAS,CAACD,IAAI,CAAC,EAAE;IACvBN,mBAAK,CAACO,SAAS,CAACD,IAAI,CAAC,EAAE;IACvBN,mBAAK,CAACO,SAAS,CAACD,IAAI,CAAC,EAAE;IACvBN,mBAAK,CAACO,SAAS,CAACD,IAAI,CAAC,EAAE;IACvBN,mBAAK,CAACO,SAAS,CAACD,IAAI,CAAC,EAAE;CAC1B;AAEM,IAAMZ,eAAe;IACxB,UAAU;IACVc,MAAMb,eAAeK,mBAAK,CAACC,OAAO,CAACO,IAAI;IACvCC,QAAQ;QACJT,mBAAK,CAACC,OAAO,CAACQ,MAAM,CAAC,EAAE;QACvBT,mBAAK,CAACC,OAAO,CAACQ,MAAM,CAAC,EAAE;QACvBT,mBAAK,CAACC,OAAO,CAACQ,MAAM,CAAC,EAAE;QACvBT,mBAAK,CAACC,OAAO,CAACQ,MAAM,CAAC,EAAE;QACvBT,mBAAK,CAACC,OAAO,CAACQ,MAAM,CAAC,EAAE;QACvBT,mBAAK,CAACC,OAAO,CAACQ,MAAM,CAAC,EAAE;QACvBT,mBAAK,CAACC,OAAO,CAACQ,MAAM,CAAC,EAAE;QACvBT,mBAAK,CAACC,OAAO,CAACQ,MAAM,CAAC,EAAE;QACvBT,mBAAK,CAACC,OAAO,CAACQ,MAAM,CAAC,EAAE;QACvBT,mBAAK,CAACC,OAAO,CAACQ,MAAM,CAAC,EAAE;KAC1B;IACDV,MAAAA;IACAW,MAAMX;IACN,SAAS;IACTY,MAAMhB,eAAeK,mBAAK,CAACG,MAAM,CAACQ,IAAI;IACtCT,KAAAA;IACAU,UAAUV;IACVG,MAAAA;IACAQ,KAAKR;IACLD,QAAAA;IACAU,SAASV;IACT,YAAY;IACZW,OAAOpB,eAAeK,mBAAK,CAACO,SAAS,CAACQ,KAAK;IAC3CC,QAAQrB,eAAeK,mBAAK,CAACO,SAAS,CAACS,MAAM;IAC7CV,MAAAA;IACAW,SAASX;IACTY,QAAQvB,eAAeK,mBAAK,CAACO,SAAS,CAACW,MAAM;AACjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/theme/Plasmantine.tsx"],"sourcesContent":["import {MantineProvider} from '@mantine/core';\nimport {FunctionComponent, PropsWithChildren} from 'react';\n\nimport {plasmaTheme} from './Theme';\n\nexport const Plasmantine: FunctionComponent<PropsWithChildren> = ({children}) => (\n <MantineProvider withGlobalStyles withNormalizeCSS theme={plasmaTheme}>\n {children}\n </MantineProvider>\n);\n"],"names":["Plasmantine","children","MantineProvider","withGlobalStyles","withNormalizeCSS","theme","plasmaTheme"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/theme/Plasmantine.tsx"],"sourcesContent":["import {MantineProvider} from '@mantine/core';\nimport {FunctionComponent, PropsWithChildren} from 'react';\n\nimport {plasmaTheme} from './Theme';\n\nexport const Plasmantine: FunctionComponent<PropsWithChildren> = ({children}) => (\n <MantineProvider withGlobalStyles withNormalizeCSS theme={plasmaTheme}>\n {children}\n </MantineProvider>\n);\n"],"names":["Plasmantine","children","MantineProvider","withGlobalStyles","withNormalizeCSS","theme","plasmaTheme"],"mappings":";;;;+BAKaA;;;eAAAA;;;;oBALiB;qBAGJ;AAEnB,IAAMA,cAAoD;QAAEC,iBAAAA;yBAC/D,qBAACC,qBAAe;QAACC,gBAAgB;QAACC,gBAAgB;QAACC,OAAOC,kBAAW;kBAChEL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/theme/Theme.tsx"],"sourcesContent":["import {ArrowHeadRightSize24Px, InfoSize24Px} from '@coveord/plasma-react-icons';\nimport {color} from '@coveord/plasma-tokens';\nimport {ButtonStylesParams, MantineThemeOverride, ModalStylesParams} from '@mantine/core';\n\nimport {PlasmaColors} from './PlasmaColors';\n\nexport const plasmaTheme: MantineThemeOverride = {\n // These are overrides over https://github.com/mantinedev/mantine/blob/master/src/mantine-styles/src/theme/default-theme.ts\n colorScheme: 'light',\n fontFamily: 'canada-type-gibson, sans-serif',\n black: color.primary.gray[9],\n defaultRadius: 8,\n spacing: {\n xs: 8,\n sm: 16,\n md: 24,\n lg: 32,\n xl: 40,\n },\n primaryColor: 'action',\n headings: {\n fontFamily: 'canada-type-gibson, sans-serif',\n fontWeight: 500,\n sizes: {\n h1: {fontSize: 48, lineHeight: '56px', fontWeight: undefined},\n h2: {fontSize: 32, lineHeight: '40px', fontWeight: undefined},\n h3: {fontSize: 28, lineHeight: '40px', fontWeight: undefined},\n h4: {fontSize: 24, lineHeight: '32px', fontWeight: undefined},\n h5: {fontSize: 18, lineHeight: '28px', fontWeight: undefined},\n h6: {fontSize: 16, lineHeight: '24px', fontWeight: undefined},\n },\n },\n shadows: {\n xs: '0px 1px 0px rgba(4, 8, 31, 0.08)',\n sm: '0px 2px 4px rgba(4, 8, 31, 0.12)',\n md: '0px 4px 8px rgba(4, 8, 31, 0.08)',\n lg: '0px 8px 16px rgba(7, 12, 41, 0.06)',\n xl: '0px 16px 24px rgba(4, 8, 31, 0.06)',\n },\n colors: PlasmaColors,\n components: {\n Alert: {\n defaultProps: {\n icon: <InfoSize24Px height={24} />,\n color: 'navy',\n },\n styles: {\n title: {\n fontWeight: 500,\n },\n },\n },\n Title: {\n styles: (theme) => ({\n root: {\n '&:is(h1,h2,h3,h4,h5,h6)': {letterSpacing: '0.011em', color: theme.colors.gray[9]},\n },\n }),\n },\n Button: {\n styles: (theme, params: ButtonStylesParams) => ({\n root: {\n fontWeight: 400,\n backgroundColor: params.variant === 'outline' ? 'white' : undefined,\n },\n }),\n },\n Modal: {\n styles: (theme, {size, fullScreen}: ModalStylesParams) => ({\n modal: {\n width: fullScreen\n ? undefined\n : theme.fn.size({size, sizes: {xs: 440, sm: 550, md: 800, lg: 1334, xl: '85%'}}),\n },\n }),\n defaultProps: {\n overlayColor: color.primary.navy[9],\n overlayOpacity: 0.9,\n },\n },\n InputWrapper: {\n defaultProps: {\n withAsterisk: false,\n },\n styles: (theme) => ({\n label: {\n marginBottom: theme.spacing.xs,\n lineHeight: '20px',\n },\n description: {\n lineHeight: '20px',\n fontSize: theme.fontSizes.sm,\n color: theme.colors.gray[7],\n marginBottom: theme.spacing.xs,\n },\n invalid: {\n color: theme.colors.red[9],\n borderColor: theme.colors.red[6],\n },\n error: {\n color: theme.colors.red[9],\n },\n }),\n },\n TextInput: {\n defaultProps: {\n radius: 8,\n },\n },\n Tooltip: {\n defaultProps: {\n color: 'navy',\n withArrow: true,\n withinPortal: true,\n multiline: true,\n },\n },\n Breadcrumbs: {\n defaultProps: {\n separator: <ArrowHeadRightSize24Px height={24} />,\n },\n },\n Loader: {\n defaultProps: {\n variant: 'dots',\n color: 'action',\n },\n },\n DateRangePicker: {\n styles: {\n cell: {\n textAlign: 'center',\n },\n },\n },\n Anchor: {\n defaultProps: {\n color: 'action',\n },\n styles: (theme) => ({\n root: {\n ...theme.fn.hover({\n textDecoration: 'underline',\n color: theme.colors.action[8],\n }),\n },\n }),\n },\n Checkbox: {\n defaultProps: {\n radius: 'sm',\n },\n },\n List: {\n styles: () => ({\n root: {\n listStyleType: 'disc',\n },\n }),\n },\n Radio: {\n styles: {\n labelWrapper: {\n display: 'flex',\n alignItems: 'flex-start',\n },\n },\n },\n Popover: {\n defaultProps: {\n shadow: 'md',\n withArrow: true,\n },\n },\n Badge: {\n styles: {\n root: {\n textTransform: 'none',\n padding: '4px 8px',\n fontWeight: 500,\n },\n },\n },\n ColorSwatch: {\n defaultProps: {\n size: 8,\n withShadow: false,\n },\n },\n MenuItem: {\n defaultProps: {\n fw: 300,\n },\n },\n },\n};\n"],"names":["plasmaTheme","colorScheme","fontFamily","black","color","primary","gray","defaultRadius","spacing","xs","sm","md","lg","xl","primaryColor","headings","fontWeight","sizes","h1","fontSize","lineHeight","undefined","h2","h3","h4","h5","h6","shadows","colors","PlasmaColors","components","Alert","defaultProps","icon","InfoSize24Px","height","styles","title","Title","theme","root","letterSpacing","Button","params","backgroundColor","variant","Modal","size","fullScreen","modal","width","fn","overlayColor","navy","overlayOpacity","InputWrapper","withAsterisk","label","marginBottom","description","fontSizes","invalid","red","borderColor","error","TextInput","radius","Tooltip","withArrow","withinPortal","multiline","Breadcrumbs","separator","ArrowHeadRightSize24Px","Loader","DateRangePicker","cell","textAlign","Anchor","hover","textDecoration","action","Checkbox","List","listStyleType","Radio","labelWrapper","display","alignItems","Popover","shadow","Badge","textTransform","padding","ColorSwatch","withShadow","MenuItem","fw"],"mappings":"AAAA;;;;+BAMaA;;;eAAAA;;;;;gCANsC;4BAC/B;4BAGO;AAEpB,IAAMA,cAAoC;IAC7C,2HAA2H;IAC3HC,aAAa;IACbC,YAAY;IACZC,OAAOC,mBAAK,CAACC,OAAO,CAACC,IAAI,CAAC,EAAE;IAC5BC,eAAe;IACfC,SAAS;QACLC,IAAI;QACJC,IAAI;QACJC,IAAI;QACJC,IAAI;QACJC,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,QAAQ,SAACG;uBAAW;oBAChBC,MAAM,kBACCD,MAAMY,EAAE,CAAC4B,KAAK,CAAC;wBACdC,gBAAgB;wBAChB5E,OAAOmC,MAAMX,MAAM,CAACqD,MAAM,CAAC,EAAE;oBACjC;gBAER;;QACJ;QACAC,UAAU;YACNlD,cAAc;gBACVkC,QAAQ;YACZ;QACJ;QACAiB,MAAM;YACF/C,QAAQ;uBAAO;oBACXI,MAAM;wBACF4C,eAAe;oBACnB;gBACJ;;QACJ;QACAC,OAAO;YACHjD,QAAQ;gBACJkD,cAAc;oBACVC,SAAS;oBACTC,YAAY;gBAChB;YACJ;QACJ;QACAC,SAAS;YACLzD,cAAc;gBACV0D,QAAQ;gBACRtB,WAAW,IAAI;YACnB;QACJ;QACAuB,OAAO;YACHvD,QAAQ;gBACJI,MAAM;oBACFoD,eAAe;oBACfC,SAAS;oBACT7E,YAAY;gBAChB;YACJ;QACJ;QACA8E,aAAa;YACT9D,cAAc;gBACVe,MAAM;gBACNgD,YAAY,KAAK;YACrB;QACJ;QACAC,UAAU;YACNhE,cAAc;gBACViE,IAAI;YACR;QACJ;IACJ;AACJ"}
|
|
1
|
+
{"version":3,"sources":["../../../src/theme/Theme.tsx"],"sourcesContent":["import {ArrowHeadRightSize24Px, InfoSize24Px} from '@coveord/plasma-react-icons';\nimport {color} from '@coveord/plasma-tokens';\nimport {ButtonStylesParams, MantineThemeOverride, ModalStylesParams} from '@mantine/core';\n\nimport {PlasmaColors} from './PlasmaColors';\n\nexport const plasmaTheme: MantineThemeOverride = {\n // These are overrides over https://github.com/mantinedev/mantine/blob/master/src/mantine-styles/src/theme/default-theme.ts\n colorScheme: 'light',\n fontFamily: 'canada-type-gibson, sans-serif',\n black: color.primary.gray[9],\n defaultRadius: 8,\n spacing: {\n xs: 8,\n sm: 16,\n md: 24,\n lg: 32,\n xl: 40,\n },\n primaryColor: 'action',\n headings: {\n fontFamily: 'canada-type-gibson, sans-serif',\n fontWeight: 500,\n sizes: {\n h1: {fontSize: 48, lineHeight: '56px', fontWeight: undefined},\n h2: {fontSize: 32, lineHeight: '40px', fontWeight: undefined},\n h3: {fontSize: 28, lineHeight: '40px', fontWeight: undefined},\n h4: {fontSize: 24, lineHeight: '32px', fontWeight: undefined},\n h5: {fontSize: 18, lineHeight: '28px', fontWeight: undefined},\n h6: {fontSize: 16, lineHeight: '24px', fontWeight: undefined},\n },\n },\n shadows: {\n xs: '0px 1px 0px rgba(4, 8, 31, 0.08)',\n sm: '0px 2px 4px rgba(4, 8, 31, 0.12)',\n md: '0px 4px 8px rgba(4, 8, 31, 0.08)',\n lg: '0px 8px 16px rgba(7, 12, 41, 0.06)',\n xl: '0px 16px 24px rgba(4, 8, 31, 0.06)',\n },\n colors: PlasmaColors,\n components: {\n Alert: {\n defaultProps: {\n icon: <InfoSize24Px height={24} />,\n color: 'navy',\n },\n styles: {\n title: {\n fontWeight: 500,\n },\n },\n },\n Title: {\n styles: (theme) => ({\n root: {\n '&:is(h1,h2,h3,h4,h5,h6)': {letterSpacing: '0.011em', color: theme.colors.gray[9]},\n },\n }),\n },\n Button: {\n styles: (theme, params: ButtonStylesParams) => ({\n root: {\n fontWeight: 400,\n backgroundColor: params.variant === 'outline' ? 'white' : undefined,\n },\n }),\n },\n Modal: {\n styles: (theme, {size, fullScreen}: ModalStylesParams) => ({\n modal: {\n width: fullScreen\n ? undefined\n : theme.fn.size({size, sizes: {xs: 440, sm: 550, md: 800, lg: 1334, xl: '85%'}}),\n },\n }),\n defaultProps: {\n overlayColor: color.primary.navy[9],\n overlayOpacity: 0.9,\n },\n },\n InputWrapper: {\n defaultProps: {\n withAsterisk: false,\n },\n styles: (theme) => ({\n label: {\n marginBottom: theme.spacing.xs,\n lineHeight: '20px',\n },\n description: {\n lineHeight: '20px',\n fontSize: theme.fontSizes.sm,\n color: theme.colors.gray[7],\n marginBottom: theme.spacing.xs,\n },\n invalid: {\n color: theme.colors.red[9],\n borderColor: theme.colors.red[6],\n },\n error: {\n color: theme.colors.red[9],\n },\n }),\n },\n TextInput: {\n defaultProps: {\n radius: 8,\n },\n },\n Tooltip: {\n defaultProps: {\n color: 'navy',\n withArrow: true,\n withinPortal: true,\n multiline: true,\n },\n },\n Breadcrumbs: {\n defaultProps: {\n separator: <ArrowHeadRightSize24Px height={24} />,\n },\n },\n Loader: {\n defaultProps: {\n variant: 'dots',\n color: 'action',\n },\n },\n DateRangePicker: {\n styles: {\n cell: {\n textAlign: 'center',\n },\n },\n },\n Anchor: {\n defaultProps: {\n color: 'action',\n },\n styles: (theme) => ({\n root: {\n ...theme.fn.hover({\n textDecoration: 'underline',\n color: theme.colors.action[8],\n }),\n },\n }),\n },\n Checkbox: {\n defaultProps: {\n radius: 'sm',\n },\n },\n List: {\n styles: () => ({\n root: {\n listStyleType: 'disc',\n },\n }),\n },\n Radio: {\n styles: {\n labelWrapper: {\n display: 'flex',\n alignItems: 'flex-start',\n },\n },\n },\n Popover: {\n defaultProps: {\n shadow: 'md',\n withArrow: true,\n },\n },\n Badge: {\n styles: {\n root: {\n textTransform: 'none',\n padding: '4px 8px',\n fontWeight: 500,\n },\n },\n },\n ColorSwatch: {\n defaultProps: {\n size: 8,\n withShadow: false,\n },\n },\n MenuItem: {\n defaultProps: {\n fw: 300,\n },\n },\n },\n};\n"],"names":["plasmaTheme","colorScheme","fontFamily","black","color","primary","gray","defaultRadius","spacing","xs","sm","md","lg","xl","primaryColor","headings","fontWeight","sizes","h1","fontSize","lineHeight","undefined","h2","h3","h4","h5","h6","shadows","colors","PlasmaColors","components","Alert","defaultProps","icon","InfoSize24Px","height","styles","title","Title","theme","root","letterSpacing","Button","params","backgroundColor","variant","Modal","size","fullScreen","modal","width","fn","overlayColor","navy","overlayOpacity","InputWrapper","withAsterisk","label","marginBottom","description","fontSizes","invalid","red","borderColor","error","TextInput","radius","Tooltip","withArrow","withinPortal","multiline","Breadcrumbs","separator","ArrowHeadRightSize24Px","Loader","DateRangePicker","cell","textAlign","Anchor","hover","textDecoration","action","Checkbox","List","listStyleType","Radio","labelWrapper","display","alignItems","Popover","shadow","Badge","textTransform","padding","ColorSwatch","withShadow","MenuItem","fw"],"mappings":";;;;+BAMaA;;;eAAAA;;;;;gCANsC;4BAC/B;4BAGO;AAEpB,IAAMA,cAAoC;IAC7C,2HAA2H;IAC3HC,aAAa;IACbC,YAAY;IACZC,OAAOC,mBAAK,CAACC,OAAO,CAACC,IAAI,CAAC,EAAE;IAC5BC,eAAe;IACfC,SAAS;QACLC,IAAI;QACJC,IAAI;QACJC,IAAI;QACJC,IAAI;QACJC,IAAI;IACR;IACAC,cAAc;IACdC,UAAU;QACNb,YAAY;QACZc,YAAY;QACZC,OAAO;YACHC,IAAI;gBAACC,UAAU;gBAAIC,YAAY;gBAAQJ,YAAYK;YAAS;YAC5DC,IAAI;gBAACH,UAAU;gBAAIC,YAAY;gBAAQJ,YAAYK;YAAS;YAC5DE,IAAI;gBAACJ,UAAU;gBAAIC,YAAY;gBAAQJ,YAAYK;YAAS;YAC5DG,IAAI;gBAACL,UAAU;gBAAIC,YAAY;gBAAQJ,YAAYK;YAAS;YAC5DI,IAAI;gBAACN,UAAU;gBAAIC,YAAY;gBAAQJ,YAAYK;YAAS;YAC5DK,IAAI;gBAACP,UAAU;gBAAIC,YAAY;gBAAQJ,YAAYK;YAAS;QAChE;IACJ;IACAM,SAAS;QACLlB,IAAI;QACJC,IAAI;QACJC,IAAI;QACJC,IAAI;QACJC,IAAI;IACR;IACAe,QAAQC,0BAAY;IACpBC,YAAY;QACRC,OAAO;YACHC,cAAc;gBACVC,oBAAM,qBAACC,8BAAY;oBAACC,QAAQ;;gBAC5B/B,OAAO;YACX;YACAgC,QAAQ;gBACJC,OAAO;oBACHrB,YAAY;gBAChB;YACJ;QACJ;QACAsB,OAAO;YACHF,QAAQ,SAACG;uBAAW;oBAChBC,MAAM;wBACF,2BAA2B;4BAACC,eAAe;4BAAWrC,OAAOmC,MAAMX,MAAM,CAACtB,IAAI,CAAC,EAAE;wBAAA;oBACrF;gBACJ;;QACJ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fC,cAAc,IAAI;gBAClBC,WAAW,IAAI;YACnB;QACJ;QACAC,aAAa;YACTvC,cAAc;gBACVwC,yBAAW,qBAACC,wCAAsB;oBAACtC,QAAQ;;YAC/C;QACJ;QACAuC,QAAQ;YACJ1C,cAAc;gBACVa,SAAS;gBACTzC,OAAO;YACX;QACJ;QACAuE,iBAAiB;YACbvC,QAAQ;gBACJwC,MAAM;oBACFC,WAAW;gBACf;YACJ;QACJ;QACAC,QAAQ;YACJ9C,cAAc;gBACV5B,OAAO;YACX;YACAgC,QAAQ,SAACG;uBAAW;oBAChBC,MAAM,kBACCD,MAAMY,EAAE,CAAC4B,KAAK,CAAC;wBACdC,gBAAgB;wBAChB5E,OAAOmC,MAAMX,MAAM,CAACqD,MAAM,CAAC,EAAE;oBACjC;gBAER;;QACJ;QACAC,UAAU;YACNlD,cAAc;gBACVkC,QAAQ;YACZ;QACJ;QACAiB,MAAM;YACF/C,QAAQ;uBAAO;oBACXI,MAAM;wBACF4C,eAAe;oBACnB;gBACJ;;QACJ;QACAC,OAAO;YACHjD,QAAQ;gBACJkD,cAAc;oBACVC,SAAS;oBACTC,YAAY;gBAChB;YACJ;QACJ;QACAC,SAAS;YACLzD,cAAc;gBACV0D,QAAQ;gBACRtB,WAAW,IAAI;YACnB;QACJ;QACAuB,OAAO;YACHvD,QAAQ;gBACJI,MAAM;oBACFoD,eAAe;oBACfC,SAAS;oBACT7E,YAAY;gBAChB;YACJ;QACJ;QACA8E,aAAa;YACT9D,cAAc;gBACVe,MAAM;gBACNgD,YAAY,KAAK;YACrB;QACJ;QACAC,UAAU;YACNhE,cAAc;gBACViE,IAAI;YACR;QACJ;IACJ;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/theme/index.ts"],"sourcesContent":["export * from './Plasmantine';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/theme/index.ts"],"sourcesContent":["export * from './Plasmantine';\n"],"names":[],"mappings":";;;;;oBAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/createPolymorphicComponent.ts"],"sourcesContent":["import {createPolymorphicComponent as mantineCreatePolymorphicComponent} from '@mantine/utils';\n\n/*\n * createPolymorphicComponent is already exported from @mantine/core, but there is an issue when using pnpm + typescript\n * that forces us to use it directly from @mantine/utils (see https://github.com/microsoft/TypeScript/issues/47663)\n * We are simply rexporting it here to avoid having to deal with this issue everywhere\n */\nexport const createPolymorphicComponent = mantineCreatePolymorphicComponent;\n"],"names":["createPolymorphicComponent","mantineCreatePolymorphicComponent"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/createPolymorphicComponent.ts"],"sourcesContent":["import {createPolymorphicComponent as mantineCreatePolymorphicComponent} from '@mantine/utils';\n\n/*\n * createPolymorphicComponent is already exported from @mantine/core, but there is an issue when using pnpm + typescript\n * that forces us to use it directly from @mantine/utils (see https://github.com/microsoft/TypeScript/issues/47663)\n * We are simply rexporting it here to avoid having to deal with this issue everywhere\n */\nexport const createPolymorphicComponent = mantineCreatePolymorphicComponent;\n"],"names":["createPolymorphicComponent","mantineCreatePolymorphicComponent"],"mappings":";;;;+BAOaA;;;eAAAA;;;qBAPiE;AAOvE,IAAMA,6BAA6BC,iCAAiC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/index.ts"],"sourcesContent":["export * from './createPolymorphicComponent';\nexport * from './overrideComponent';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/index.ts"],"sourcesContent":["export * from './createPolymorphicComponent';\nexport * from './overrideComponent';\n"],"names":[],"mappings":";;;;;oBAAc;oBACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/overrideComponent.ts"],"sourcesContent":["/**\n * Allows to override static properties from a component function\n *\n * @param component The component which holds the static properties\n * @param properties The new static properties to assign on the component\n * @returns A new component with the specified properties. It doesn't change the original component\n * @example const Menu = overrideComponent(MantineMenu, {Item: MyMenuItem}); // Menu.Item will equal MyMenuItem\n */\nexport const overrideComponent = <\n Component extends (...args: Parameters<Component>) => ReturnType<Component>,\n StaticProperties = Record<keyof Component, never>\n>(\n component: Component,\n properties: StaticProperties\n): ((...args: Parameters<Component>) => ReturnType<Component>) & Component & StaticProperties => {\n const componentClone = (...args: Parameters<Component>) => component(...args);\n return Object.assign(componentClone, component, properties);\n};\n"],"names":["overrideComponent","component","properties","componentClone","args","Object","assign"],"mappings":"AAAA;;;;;;;CAOC
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/overrideComponent.ts"],"sourcesContent":["/**\n * Allows to override static properties from a component function\n *\n * @param component The component which holds the static properties\n * @param properties The new static properties to assign on the component\n * @returns A new component with the specified properties. It doesn't change the original component\n * @example const Menu = overrideComponent(MantineMenu, {Item: MyMenuItem}); // Menu.Item will equal MyMenuItem\n */\nexport const overrideComponent = <\n Component extends (...args: Parameters<Component>) => ReturnType<Component>,\n StaticProperties = Record<keyof Component, never>\n>(\n component: Component,\n properties: StaticProperties\n): ((...args: Parameters<Component>) => ReturnType<Component>) & Component & StaticProperties => {\n const componentClone = (...args: Parameters<Component>) => component(...args);\n return Object.assign(componentClone, component, properties);\n};\n"],"names":["overrideComponent","component","properties","componentClone","args","Object","assign"],"mappings":"AAAA;;;;;;;CAOC;;;;+BACYA;;;eAAAA;;;;AAAN,IAAMA,oBAAoB,SAI7BC,WACAC,YAC6F;IAC7F,IAAMC,iBAAiB;yCAAIC;YAAAA;;eAAgCH,UAAAA,MAAAA,KAAAA,GAAU,mBAAGG;;IACxE,OAAOC,OAAOC,MAAM,CAACH,gBAAgBF,WAAWC;AACpD"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ColumnDef } from '@tanstack/react-table';
|
|
2
|
-
import { CoreOptions, InitialTableState } from '@tanstack/table-core';
|
|
2
|
+
import { CoreOptions, InitialTableState, TableOptions } from '@tanstack/table-core';
|
|
3
3
|
import { ReactElement, ReactNode } from 'react';
|
|
4
4
|
import { TableActions } from './TableActions';
|
|
5
|
-
import { TableCollapsibleColumn } from './TableCollapsibleColumn';
|
|
5
|
+
import { TableCollapsibleColumn, TableAccordionColumn } from './TableCollapsibleColumn';
|
|
6
6
|
import { onTableChangeEvent, TableFormType } from './TableContext';
|
|
7
7
|
import { TableDateRangePicker } from './TableDateRangePicker';
|
|
8
8
|
import { TableFilter } from './TableFilter';
|
|
@@ -11,7 +11,7 @@ import { TableHeader } from './TableHeader';
|
|
|
11
11
|
import { TablePagination } from './TablePagination';
|
|
12
12
|
import { TablePerPage } from './TablePerPage';
|
|
13
13
|
import { TablePredicate } from './TablePredicate';
|
|
14
|
-
interface TableProps<T> {
|
|
14
|
+
export interface TableProps<T> {
|
|
15
15
|
/**
|
|
16
16
|
* Data to display in the table
|
|
17
17
|
*/
|
|
@@ -80,6 +80,7 @@ interface TableProps<T> {
|
|
|
80
80
|
* @default false
|
|
81
81
|
*/
|
|
82
82
|
multiRowSelectionEnabled?: boolean;
|
|
83
|
+
options?: Omit<Partial<TableOptions<T>>, 'initialState' | 'data' | 'columns' | 'manualPagination' | 'enableMultiRowSelection' | 'getRowId' | 'getRowCanExpand'>;
|
|
83
84
|
}
|
|
84
85
|
interface TableType {
|
|
85
86
|
<T>(props: TableProps<T>): ReactElement;
|
|
@@ -92,6 +93,7 @@ interface TableType {
|
|
|
92
93
|
Predicate: typeof TablePredicate;
|
|
93
94
|
DateRangePicker: typeof TableDateRangePicker;
|
|
94
95
|
CollapsibleColumn: typeof TableCollapsibleColumn;
|
|
96
|
+
AccordionColumn: typeof TableAccordionColumn;
|
|
95
97
|
}
|
|
96
98
|
export declare const Table: TableType;
|
|
97
99
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../../src/components/table/Table.tsx"],"names":[],"mappings":"AAGA,OAAO,EACH,SAAS,EAOZ,MAAM,uBAAuB,CAAC;AAC/B,OA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
* Generic column to use when your table needs collapsible rows
|
|
4
4
|
*/
|
|
5
5
|
export declare const TableCollapsibleColumn: ColumnDef<unknown>;
|
|
6
|
+
/**
|
|
7
|
+
* Generic column to use when your table needs an accordion (collapsible rows, but only one open at the time)
|
|
8
|
+
*/
|
|
9
|
+
export declare const TableAccordionColumn: ColumnDef<unknown>;
|
|
6
10
|
//# sourceMappingURL=TableCollapsibleColumn.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableCollapsibleColumn.d.ts","sourceRoot":"","sources":["../../../../src/components/table/TableCollapsibleColumn.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"TableCollapsibleColumn.d.ts","sourceRoot":"","sources":["../../../../src/components/table/TableCollapsibleColumn.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAU5D;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,SAAS,CAAC,OAAO,CAGrD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,CAAC,OAAO,CAYnD,CAAC"}
|
|
@@ -57,6 +57,10 @@ type TableContextType = {
|
|
|
57
57
|
*/
|
|
58
58
|
containerRef: RefObject<HTMLDivElement>;
|
|
59
59
|
multiRowSelectionEnabled: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Function that returns the number of pages
|
|
62
|
+
*/
|
|
63
|
+
getPageCount: () => number;
|
|
60
64
|
};
|
|
61
65
|
export declare const TableContext: import("react").Context<TableContextType>;
|
|
62
66
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableContext.d.ts","sourceRoot":"","sources":["../../../../src/components/table/TableContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,oBAAoB,EAAC,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAChD,OAAO,EAAC,UAAU,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AEzD,MAAM,MAAM,kBAAkB,GAAG,CAAC,MAAM,EAAE,UAAU,GAAG,aAAa,KAAK,IAAI,CAAC;AAE9E,MAAM,MAAM,aAAa,GAAG;IACxB;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC;;;;OAIG;IACH,SAAS,EAAE,oBAAoB,CAAC;CACnC,CAAC;AAEF,KAAK,gBAAgB,GAAG;IACpB;;OAEG;IACH,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB;;;;OAIG;IACH,KAAK,EAAE,UAAU,CAAC;IAClB;;OAEG;IACH,QAAQ,EAAE,QAAQ,CAAC,CAAC,SAAS,EAAE,UAAU,KAAK,UAAU,CAAC,CAAC;IAC1D;;OAEG;IACH,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB;;OAEG;IACH,cAAc,EAAE,MAAM,GAAG,GAAG,IAAI,CAAC;IACjC;;OAEG;IACH,eAAe,EAAE,MAAM,GAAG,EAAE,CAAC;IAC7B;;OAEG;IACH,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B;;OAEG;IACH,IAAI,EAAE,iBAAiB,CAAC,aAAa,CAAC,CAAC;IACvC;;OAEG;IACH,YAAY,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IACxC,wBAAwB,EAAE,OAAO,CAAC;IAElC;;OAEG;IACH,YAAY,EAAE,MAAM,MAAM,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,YAAY,2CAA+C,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { FunctionComponent } from 'react';
|
|
2
2
|
interface TablePaginationProps {
|
|
3
3
|
/**
|
|
4
|
-
* The total number of page
|
|
4
|
+
* The total number of page. Use null only if your table is paginated client side
|
|
5
5
|
*/
|
|
6
|
-
totalPages: number;
|
|
6
|
+
totalPages: number | null;
|
|
7
7
|
}
|
|
8
8
|
export declare const TablePagination: FunctionComponent<TablePaginationProps>;
|
|
9
9
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TablePagination.d.ts","sourceRoot":"","sources":["../../../../src/components/table/TablePagination.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAC,iBAAiB,EAAC,MAAM,OAAO,CAAC;AAGxC,UAAU,oBAAoB;IAC1B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"TablePagination.d.ts","sourceRoot":"","sources":["../../../../src/components/table/TablePagination.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAC,iBAAiB,EAAC,MAAM,OAAO,CAAC;AAGxC,UAAU,oBAAoB;IAC1B;;OAEG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,eAAO,MAAM,eAAe,EAAE,iBAAiB,CAAC,oBAAoB,CA+BnE,CAAC"}
|
|
@@ -10,5 +10,6 @@ export declare const useTable: () => {
|
|
|
10
10
|
form: import("@mantine/form").UseFormReturnType<import("./TableContext").TableFormType, (values: import("./TableContext").TableFormType) => import("./TableContext").TableFormType>;
|
|
11
11
|
containerRef: import("react").RefObject<HTMLDivElement>;
|
|
12
12
|
multiRowSelectionEnabled: boolean;
|
|
13
|
+
getPageCount: () => number;
|
|
13
14
|
};
|
|
14
15
|
//# sourceMappingURL=useTable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTable.d.ts","sourceRoot":"","sources":["../../../../src/components/table/useTable.tsx"],"names":[],"mappings":";AAGA,eAAO,MAAM,QAAQ
|
|
1
|
+
{"version":3,"file":"useTable.d.ts","sourceRoot":"","sources":["../../../../src/components/table/useTable.tsx"],"names":[],"mappings":";AAGA,eAAO,MAAM,QAAQ;;;;;;;;;;;;CAOpB,CAAC"}
|
|
@@ -4,10 +4,11 @@ export * from '@mantine/carousel';
|
|
|
4
4
|
export * from '@mantine/core';
|
|
5
5
|
export type { FormValidateInput } from '@mantine/form/lib/types';
|
|
6
6
|
export * from '@mantine/hooks';
|
|
7
|
-
export
|
|
7
|
+
export * from '@tanstack/table-core';
|
|
8
8
|
export * from './components';
|
|
9
9
|
export * from '@mantine/form';
|
|
10
|
-
export {
|
|
10
|
+
export { Pagination } from '@mantine/core';
|
|
11
|
+
export { Header, Table, type TableProps, type HeaderProps, Modal, Button, type ButtonProps, Menu, type MenuItemProps, } from './components';
|
|
11
12
|
export { useForm, createFormContext } from './form';
|
|
12
13
|
export * from './theme';
|
|
13
14
|
declare module '@mantine/core' {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,eAAe,CAAC;AAEpC,OAAO,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAElD,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,YAAY,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAC/D,cAAc,gBAAgB,CAAC;AAC/B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,eAAe,CAAC;AAEpC,OAAO,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAElD,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,YAAY,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAC/D,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC,OAAO,EACH,MAAM,EACN,KAAK,EACL,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,EACL,MAAM,EACN,KAAK,WAAW,EAChB,IAAI,EACJ,KAAK,aAAa,GACrB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAC,OAAO,EAAE,iBAAiB,EAAC,MAAM,QAAQ,CAAC;AAElD,cAAc,SAAS,CAAC;AAExB,OAAO,QAAQ,eAAe,CAAC;IAC3B,UAAiB,0BAA0B;QAEvC,MAAM,EAAE,MAAM,CAAC,MAAM,OAAO,YAAY,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;KAChF;CACJ"}
|
|
@@ -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":["render","userEvent","Plasmantine","customRender","ui","options","TestWrapper","children","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":["render","userEvent","Plasmantine","customRender","ui","options","TestWrapper","children","wrapper"],"mappings":";;AAAA,SAAQA,MAAM,QAAoC,yBAAyB;AAC3E,OAAOC,eAAe,8BAA8B;AAGpD,SAAQC,WAAW,QAAO,WAAW;AAErC,IAAMC,eAAe,SAACC,IAAkBC,SAA2D;IAC/F,IAAMC,cAAoD;YAAEC,iBAAAA;6BAAc,KAACL;sBAAaK;;;IAExF,OAAOP,OAAOI,IAAI;QAACI,SAASF;OAAgBD;AAChD;AAEA,SAAQJ,SAAS,GAAE;AACnB,cAAc,yBAAyB;AACvC,SAAQE,gBAAgBH,MAAM,GAAE"}
|
|
@@ -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":["Paper","Stack","BlankSlate","children","withBorder","shadow","p","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":["Paper","Stack","BlankSlate","children","withBorder","shadow","p","align"],"mappings":";AAAA,SAAQA,KAAK,EAAEC,KAAK,QAAO,gBAAgB;AAY3C,OAAO,IAAMC,aAAoE;QAAEC,iBAAAA,oCAAUC,YAAAA,4CAAa,IAAI;yBAC1G,KAACJ;QAAMK,QAAQD,cAAc;QAAME,GAAE;QAAKF,YAAYA;kBAClD,cAAA,KAACH;YAAMM,OAAM;sBAAUJ;;;EAE7B"}
|
|
@@ -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","MantineButton","forwardRef","createPolymorphicComponent","ButtonWithDisabledTooltip","_Button","ref","disabledTooltip","disabled","disabledTooltipProps","others","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","MantineButton","forwardRef","createPolymorphicComponent","ButtonWithDisabledTooltip","_Button","ref","disabledTooltip","disabled","disabledTooltipProps","others","Group"],"mappings":";;;AAAA,SAAQA,UAAUC,aAAa,QAA0C,gBAAgB;AACzF,SAAQC,UAAU,QAAO,QAAQ;AAEjC,SAAQC,0BAA0B,QAAO,cAAc;AACvD,SAAQC,yBAAyB,QAAuC,8BAA8B;AAItG,IAAMC,wBAAUH,WACZ,iBAA+DI,mBAC3D;QADFC,yBAAAA,iBAAiBC,kBAAAA,UAAUC,8BAAAA,sBAAyBC;QAApDH;QAAiBC;QAAUC;;WACzB,KAACL;QACGI,UAAUA;QACVD,iBAAiBA;QACjBE,sBAAsBA;kBAEtB,cAAA,KAACR;YAAcK,KAAKA;YAAKE,UAAUA;WAAcE;;AAC1B;AAInC,OAAO,IAAMV,SAASG,2BAAuFE,SAAS;AACtHL,OAAOW,KAAK,GAAGV,cAAcU,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":["Box","Tooltip","forwardRef","createPolymorphicComponent","_ButtonWithDisabledTooltip","ref","disabledTooltip","disabled","children","disabledTooltipProps","others","label","sx","cursor","ButtonWithDisabledTooltip"],"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":["Box","Tooltip","forwardRef","createPolymorphicComponent","_ButtonWithDisabledTooltip","ref","disabledTooltip","disabled","children","disabledTooltipProps","others","label","sx","cursor","ButtonWithDisabledTooltip"],"mappings":";;;;AAAA,SAAQA,GAAG,EAAEC,OAAO,QAAqB,gBAAgB;AACzD,SAAQC,UAAU,QAAkB,QAAQ;AAE5C,SAAQC,0BAA0B,QAAO,cAAc;AAkBvD,IAAMC,2CAA6BF,WAC/B,iBAAyEG,KACrEC;QADFA,yBAAAA,iBAAiBC,kBAAAA,UAAUC,kBAAAA,UAAUC,8BAAAA,sBAAyBC;QAA9DJ;QAAiBC;QAAUC;QAAUC;;WACnCH,gCACI,KAACL;QAAQU,OAAOL;QAAiBC,UAAU,CAACA;OAAcE;kBACtD,cAAA,KAACT;YAAIK,KAAKA;YAAKO,IAAI;gBAAC,WAAW;oBAACC,QAAQ;gBAAa;YAAC;WAAOH;sBACxDF;;wBAIT;kBAAGA;MACN;AAAD;AAGR,OAAO,IAAMM,4BAA4BX,2BACrCC,4BACF"}
|
|
@@ -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":["CheckSize16Px","CopySize16Px","ActionIcon","Box","Center","CopyButton","createStyles","Group","Input","Loader","Space","Stack","Tooltip","useComponentDefaultProps","useUncontrolled","Editor","loader","useEffect","useState","useParentHeight","XML","useStyles","theme","root","editor","border","colors","gray","borderRadius","defaultRadius","backgroundColor","colorScheme","white","black","height","defaultProps","language","monacoLoader","defaultValue","minHeight","CodeEditor","props","onChange","onFocus","value","label","required","labelProps","error","errorProps","description","descriptionProps","maxHeight","disabled","others","loaded","setLoaded","classes","finalValue","_value","handleChange","parentHeight","ref","loadLocalMonaco","monacoInstance","config","monaco","registerLanguages","register","_label","Label","_description","Description","_error","Error","mt","h","_header","_copyButton","position","timeout","copied","copy","withArrow","color","onClick","_editor","p","pl","className","defaultLanguage","options","minimap","enabled","wordWrap","wrappingStrategy","scrollBeyondLastLine","formatOnPaste","fontSize","fontSizes","xs","readOnly","tabSize","onMount","onDidFocusEditorText","onDidBlurEditorText","getAction","run","justify","spacing","sx","Math","max"],"mappings":"AAAA;;;;;;;AAAA,SAAQA,aAAa,EAAEC,YAAY,QAAO,8BAA8B;AACxE,SACIC,UAAU,EACVC,GAAG,EACHC,MAAM,EACNC,UAAU,EACVC,YAAY,EAEZC,KAAK,EACLC,KAAK,EAELC,MAAM,EAENC,KAAK,EACLC,KAAK,EACLC,OAAO,EACPC,wBAAwB,QACrB,gBAAgB;AACvB,SAAQC,eAAe,QAAO,iBAAiB;AAC/C,OAAOC,UAASC,MAAM,QAAe,uBAAuB;AAC5D,SAA2BC,SAAS,EAAEC,QAAQ,QAAO,QAAQ;AAE7D,SAAQC,eAAe,QAAO,cAAc;AAC5C,SAAQC,GAAG,QAAO,kBAAkB;AAEpC,IAAMC,YAAYf,aAAa,SAACgB;WAAW;QACvCC,MAAM,CAAC;QACPC,QAAQ;YACJC,QAAQ,AAAC,aAAiC,OAArBH,MAAMI,MAAM,CAACC,IAAI,CAAC,EAAE;YACzCC,cAAcN,MAAMO,a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AS;gBACLC,SAAS;oBAACC,SAAS,KAAK;gBAAA;gBACxBC,UAAU;gBACVC,kBAAkB;gBAClBC,sBAAsB,KAAK;gBAC3BC,eAAe,IAAI;gBACnBC,UAAU5E,MAAM6E,SAAS,CAACC,EAAE;gBAC5BC,UAAUhD;gBACViD,SAAS;YACb;YACA1D,OAAOe;YACPjB,UAAUkB;YACV2C,SAAS,SAAC/E,QAAQ0C,QAAW;gBACzBC,kBAAkBD;gBAClB1C,OAAOgF,oBAAoB,CAAC7D;gBAC5BnB,OAAOiF,mBAAmB,eAAC,oBAAA,WAAY;;;;gCACnC;;oCAAMjF,OAAOkF,SAAS,CAAC,gCAAgCC,GAAG;;;gCAA1D;;;;;;gBACJ;YACJ;;uBAIR,KAACvG;QAAOqF,WAAWhC,QAAQjC,MAAM;kBAC7B,cAAA,KAACf;MAER;IAED,qBACI,MAACE;QACGiG,SAAQ;QACRnB,WAAWhC,QAAQlC,IAAI;QACvBsF,SAAS;QACTC,IAAI;YAAC5E,QAAQ6E,KAAKC,GAAG,CAACnD,cAActB;YAAYa,WAAAA;QAAS;QACzDU,KAAKA;OACDR;;YAEHuB;YACAC;YACAQ;YACAb;;;AAGb,EAAE"}
|
|
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":["CheckSize16Px","CopySize16Px","ActionIcon","Box","Center","CopyButton","createStyles","Group","Input","Loader","Space","Stack","Tooltip","useComponentDefaultProps","useUncontrolled","Editor","loader","useEffect","useState","useParentHeight","XML","useStyles","theme","root","editor","border","colors","gray","borderRadius","defaultRadius","backgroundColor","colorScheme","white","black","height","defaultProps","language","monacoLoader","defaultValue","minHeight","CodeEditor","props","onChange","onFocus","value","label","required","labelProps","error","errorProps","description","descriptionProps","maxHeight","disabled","others","loaded","setLoaded","classes","finalValue","_value","handleChange","parentHeight","ref","loadLocalMonaco","monacoInstance","config","monaco","registerLanguages","register","_label","Label","_description","Description","_error","Error","mt","h","_header","_copyButton","position","timeout","copied","copy","withArrow","color","onClick","_editor","p","pl","className","defaultLanguage","options","minimap","enabled","wordWrap","wrappingStrategy","scrollBeyondLastLine","formatOnPaste","fontSize","fontSizes","xs","readOnly","tabSize","onMount","onDidFocusEditorText","onDidBlurEditorText","getAction","run","justify","spacing","sx","Math","max"],"mappings":";;;;;;;AAAA,SAAQA,aAAa,EAAEC,YAAY,QAAO,8BAA8B;AACxE,SACIC,UAAU,EACVC,GAAG,EACHC,MAAM,EACNC,UAAU,EACVC,YAAY,EAEZC,KAAK,EACLC,KAAK,EAELC,MAAM,EAENC,KAAK,EACLC,KAAK,EACLC,OAAO,EACPC,wBAAwB,QACrB,gBAAgB;AACvB,SAAQC,eAAe,QAAO,iBAAiB;AAC/C,OAAOC,UAASC,MAAM,QAAe,uBAAuB;AAC5D,SAA2BC,SAAS,EAAEC,QAAQ,QAAO,QAAQ;AAE7D,SAAQC,eAAe,QAAO,cAAc;AAC5C,SAAQC,GAAG,QAAO,kBAAkB;AAEpC,IAAMC,YAAYf,aAAa,SAACgB;WAAW;QACvCC,MAAM,CAAC;QACPC,QAAQ;YACJC,QAAQ,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ACG2E,iBAAiBtD;YACjBd,OAAOA,MAAMS,WAAW,KAAK,UAAU,UAAU,SAAS;YAC1D4D,SAAS;gBACLC,SAAS;oBAACC,SAAS,KAAK;gBAAA;gBACxBC,UAAU;gBACVC,kBAAkB;gBAClBC,sBAAsB,KAAK;gBAC3BC,eAAe,IAAI;gBACnBC,UAAU5E,MAAM6E,SAAS,CAACC,EAAE;gBAC5BC,UAAUhD;gBACViD,SAAS;YACb;YACA1D,OAAOe;YACPjB,UAAUkB;YACV2C,SAAS,SAAC/E,QAAQ0C,QAAW;gBACzBC,kBAAkBD;gBAClB1C,OAAOgF,oBAAoB,CAAC7D;gBAC5BnB,OAAOiF,mBAAmB,eAAC,oBAAA,WAAY;;;;gCACnC;;oCAAMjF,OAAOkF,SAAS,CAAC,gCAAgCC,GAAG;;;gCAA1D;;;;;;gBACJ;YACJ;;uBAIR,KAACvG;QAAOqF,WAAWhC,QAAQjC,MAAM;kBAC7B,cAAA,KAACf;MAER;IAED,qBACI,MAACE;QACGiG,SAAQ;QACRnB,WAAWhC,QAAQlC,IAAI;QACvBsF,SAAS;QACTC,IAAI;YAAC5E,QAAQ6E,KAAKC,GAAG,CAACnD,cAActB;YAAYa,WAAAA;QAAS;QACzDU,KAAKA;OACDR;;YAEHuB;YACAC;YACAQ;YACAb;;;AAGb,EAAE"}
|
|
@@ -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":["useEffect","editor","onDidFocusEditorText","jest","fn","onDidBlurEditorText","monaco","MockedEditor","props","onMount","div","data-testid","loader","config","useMonaco"],"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":["useEffect","editor","onDidFocusEditorText","jest","fn","onDidBlurEditorText","monaco","MockedEditor","props","onMount","div","data-testid","loader","config","useMonaco"],"mappings":";AACA,SAA2BA,SAAS,QAAO,QAAQ;AAEnD,IAAMC,SAAc;IAChBC,sBAAsBC,KAAKC,EAAE;IAC7BC,qBAAqBF,KAAKC,EAAE;AAChC;AAEA,IAAME,SAAcH,KAAKC,EAAE;AAE3B,IAAMG,eAA+C,SAACC,OAAU;IAC5DR,UAAU,WAAM;QACZQ,MAAMC,OAAO,CAACR,QAAQK;IAC1B,GAAG,EAAE;IACL,qBAAO,KAACI;QAAIC,eAAY;;AAC5B;AAEA,eAAeJ,aAAa;AAE5B,OAAO,IAAMK,SAAS;IAClBC,QAAQV,KAAKC,EAAE;AACnB,EAAE;AAEF,OAAO,IAAMU,YAAY;WAAMX,KAAKC,EAAE;EAAG"}
|