@coveord/plasma-mantine 52.3.1 → 52.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +4 -5
- package/.turbo/turbo-test.log +79 -29
- package/dist/.tsbuildinfo +1 -1
- package/dist/{definitions → cjs}/components/collection/Collection.d.ts.map +1 -1
- package/dist/cjs/components/collection/Collection.js +71 -45
- package/dist/cjs/components/collection/Collection.js.map +1 -1
- package/dist/{definitions → cjs}/components/collection/Collection.styles.d.ts +1 -0
- package/dist/{definitions → cjs}/components/collection/Collection.styles.d.ts.map +1 -1
- package/dist/cjs/components/collection/Collection.styles.js +8 -2
- package/dist/cjs/components/collection/Collection.styles.js.map +1 -1
- package/dist/{definitions → cjs}/components/collection/CollectionItem.d.ts +1 -1
- package/dist/{definitions → cjs}/components/collection/CollectionItem.d.ts.map +1 -1
- package/dist/cjs/components/collection/CollectionItem.js +26 -26
- package/dist/cjs/components/collection/CollectionItem.js.map +1 -1
- package/dist/cjs/components/header/__tests__/__snapshots__/Header.spec.tsx.snap +1 -1
- package/dist/cjs/package.json +1 -0
- package/dist/esm/components/blank-slate/BlankSlate.d.ts +12 -0
- package/dist/esm/components/blank-slate/BlankSlate.d.ts.map +1 -0
- package/dist/esm/components/blank-slate/index.d.ts +2 -0
- package/dist/esm/components/blank-slate/index.d.ts.map +1 -0
- package/dist/esm/components/button/Button.d.ts +16 -0
- package/dist/esm/components/button/Button.d.ts.map +1 -0
- package/dist/esm/components/button/ButtonWithDisabledTooltip.d.ts +29 -0
- package/dist/esm/components/button/ButtonWithDisabledTooltip.d.ts.map +1 -0
- package/dist/esm/components/button/index.d.ts +3 -0
- package/dist/esm/components/button/index.d.ts.map +1 -0
- package/dist/esm/components/code-editor/CodeEditor.d.ts +53 -0
- package/dist/esm/components/code-editor/CodeEditor.d.ts.map +1 -0
- package/dist/esm/components/code-editor/index.d.ts +2 -0
- package/dist/esm/components/code-editor/index.d.ts.map +1 -0
- package/dist/esm/components/code-editor/languages/xml.d.ts +5 -0
- package/dist/esm/components/code-editor/languages/xml.d.ts.map +1 -0
- package/dist/esm/components/collection/Collection.d.ts +108 -0
- package/dist/esm/components/collection/Collection.d.ts.map +1 -0
- package/dist/esm/components/collection/Collection.js +63 -37
- package/dist/esm/components/collection/Collection.js.map +1 -1
- package/dist/esm/components/collection/Collection.styles.d.ts +14 -0
- package/dist/esm/components/collection/Collection.styles.d.ts.map +1 -0
- package/dist/esm/components/collection/Collection.styles.js +8 -2
- package/dist/esm/components/collection/Collection.styles.js.map +1 -1
- package/dist/esm/components/collection/CollectionItem.d.ts +15 -0
- package/dist/esm/components/collection/CollectionItem.d.ts.map +1 -0
- package/dist/esm/components/collection/CollectionItem.js +27 -27
- package/dist/esm/components/collection/CollectionItem.js.map +1 -1
- package/dist/esm/components/collection/index.d.ts +2 -0
- package/dist/esm/components/collection/index.d.ts.map +1 -0
- package/dist/esm/components/copyToClipboard/CopyToClipboard.d.ts +19 -0
- package/dist/esm/components/copyToClipboard/CopyToClipboard.d.ts.map +1 -0
- package/dist/esm/components/copyToClipboard/index.d.ts +2 -0
- package/dist/esm/components/copyToClipboard/index.d.ts.map +1 -0
- package/dist/esm/components/date-range-picker/DateRangePickerInlineCalendar.d.ts +38 -0
- package/dist/esm/components/date-range-picker/DateRangePickerInlineCalendar.d.ts.map +1 -0
- package/dist/esm/components/date-range-picker/DateRangePickerPopoverCalendar.d.ts +31 -0
- package/dist/esm/components/date-range-picker/DateRangePickerPopoverCalendar.d.ts.map +1 -0
- package/dist/esm/components/date-range-picker/DateRangePickerPresetSelect.d.ts +16 -0
- package/dist/esm/components/date-range-picker/DateRangePickerPresetSelect.d.ts.map +1 -0
- package/dist/esm/components/date-range-picker/EditableDateRangePicker.d.ts +19 -0
- package/dist/esm/components/date-range-picker/EditableDateRangePicker.d.ts.map +1 -0
- package/dist/esm/components/date-range-picker/index.d.ts +4 -0
- package/dist/esm/components/date-range-picker/index.d.ts.map +1 -0
- package/dist/esm/components/header/Header.d.ts +49 -0
- package/dist/esm/components/header/Header.d.ts.map +1 -0
- package/dist/esm/components/header/__tests__/__snapshots__/Header.spec.tsx.snap +1 -1
- package/dist/esm/components/header/index.d.ts +2 -0
- package/dist/esm/components/header/index.d.ts.map +1 -0
- package/dist/esm/components/index.d.ts +14 -0
- package/dist/esm/components/index.d.ts.map +1 -0
- package/dist/esm/components/inline-confirm/InlineConfirm.d.ts +12 -0
- package/dist/esm/components/inline-confirm/InlineConfirm.d.ts.map +1 -0
- package/dist/esm/components/inline-confirm/InlineConfirmButton.d.ts +8 -0
- package/dist/esm/components/inline-confirm/InlineConfirmButton.d.ts.map +1 -0
- package/dist/esm/components/inline-confirm/InlineConfirmContext.d.ts +9 -0
- package/dist/esm/components/inline-confirm/InlineConfirmContext.d.ts.map +1 -0
- package/dist/esm/components/inline-confirm/InlineConfirmMenuItem.d.ts +8 -0
- package/dist/esm/components/inline-confirm/InlineConfirmMenuItem.d.ts.map +1 -0
- package/dist/esm/components/inline-confirm/InlineConfirmPrompt.d.ts +11 -0
- package/dist/esm/components/inline-confirm/InlineConfirmPrompt.d.ts.map +1 -0
- package/dist/esm/components/inline-confirm/index.d.ts +4 -0
- package/dist/esm/components/inline-confirm/index.d.ts.map +1 -0
- package/dist/esm/components/inline-confirm/useInlineConfirm.d.ts +6 -0
- package/dist/esm/components/inline-confirm/useInlineConfirm.d.ts.map +1 -0
- package/dist/esm/components/menu/Menu.d.ts +16 -0
- package/dist/esm/components/menu/Menu.d.ts.map +1 -0
- package/dist/esm/components/menu/index.d.ts +2 -0
- package/dist/esm/components/menu/index.d.ts.map +1 -0
- package/dist/esm/components/modal-wizard/ModalWizard.d.ts +78 -0
- package/dist/esm/components/modal-wizard/ModalWizard.d.ts.map +1 -0
- package/dist/esm/components/modal-wizard/ModalWizardStep.d.ts +43 -0
- package/dist/esm/components/modal-wizard/ModalWizardStep.d.ts.map +1 -0
- package/dist/esm/components/modal-wizard/index.d.ts +3 -0
- package/dist/esm/components/modal-wizard/index.d.ts.map +1 -0
- package/dist/esm/components/prompt/Prompt.d.ts +14 -0
- package/dist/esm/components/prompt/Prompt.d.ts.map +1 -0
- package/dist/esm/components/prompt/PromptFooter.d.ts +6 -0
- package/dist/esm/components/prompt/PromptFooter.d.ts.map +1 -0
- package/dist/esm/components/prompt/index.d.ts +2 -0
- package/dist/esm/components/prompt/index.d.ts.map +1 -0
- package/dist/esm/components/sticky-footer/StickyFooter.d.ts +10 -0
- package/dist/esm/components/sticky-footer/StickyFooter.d.ts.map +1 -0
- package/dist/esm/components/sticky-footer/index.d.ts +2 -0
- package/dist/esm/components/sticky-footer/index.d.ts.map +1 -0
- package/dist/esm/components/table/Table.d.ts +3 -0
- package/dist/esm/components/table/Table.d.ts.map +1 -0
- package/dist/esm/components/table/Table.styles.d.ts +19 -0
- package/dist/esm/components/table/Table.styles.d.ts.map +1 -0
- package/dist/esm/components/table/Table.types.d.ts +185 -0
- package/dist/esm/components/table/Table.types.d.ts.map +1 -0
- package/dist/esm/components/table/TableActions.d.ts +26 -0
- package/dist/esm/components/table/TableActions.d.ts.map +1 -0
- package/dist/esm/components/table/TableCollapsibleColumn.d.ts +10 -0
- package/dist/esm/components/table/TableCollapsibleColumn.d.ts.map +1 -0
- package/dist/esm/components/table/TableConsumer.d.ts +5 -0
- package/dist/esm/components/table/TableConsumer.d.ts.map +1 -0
- package/dist/esm/components/table/TableContext.d.ts +5 -0
- package/dist/esm/components/table/TableContext.d.ts.map +1 -0
- package/dist/esm/components/table/TableDateRangePicker.d.ts +19 -0
- package/dist/esm/components/table/TableDateRangePicker.d.ts.map +1 -0
- package/dist/esm/components/table/TableFilter.d.ts +22 -0
- package/dist/esm/components/table/TableFilter.d.ts.map +1 -0
- package/dist/esm/components/table/TableFooter.d.ts +8 -0
- package/dist/esm/components/table/TableFooter.d.ts.map +1 -0
- package/dist/esm/components/table/TableHeader.d.ts +17 -0
- package/dist/esm/components/table/TableHeader.d.ts.map +1 -0
- package/dist/esm/components/table/TablePagination.d.ts +10 -0
- package/dist/esm/components/table/TablePagination.d.ts.map +1 -0
- package/dist/esm/components/table/TablePerPage.d.ts +20 -0
- package/dist/esm/components/table/TablePerPage.d.ts.map +1 -0
- package/dist/esm/components/table/TablePredicate.d.ts +21 -0
- package/dist/esm/components/table/TablePredicate.d.ts.map +1 -0
- package/dist/esm/components/table/TableSelectableColumn.d.ts +6 -0
- package/dist/esm/components/table/TableSelectableColumn.d.ts.map +1 -0
- package/dist/esm/components/table/Th.d.ts +8 -0
- package/dist/esm/components/table/Th.d.ts.map +1 -0
- package/dist/esm/components/table/index.d.ts +4 -0
- package/dist/esm/components/table/index.d.ts.map +1 -0
- package/dist/esm/components/table/useRowSelection.d.ts +10 -0
- package/dist/esm/components/table/useRowSelection.d.ts.map +1 -0
- package/dist/esm/form/FormProvider.d.ts +8 -0
- package/dist/esm/form/FormProvider.d.ts.map +1 -0
- package/dist/esm/form/index.d.ts +3 -0
- package/dist/esm/form/index.d.ts.map +1 -0
- package/dist/esm/form/useForm.d.ts +3 -0
- package/dist/esm/form/useForm.d.ts.map +1 -0
- package/dist/esm/hooks/index.d.ts +3 -0
- package/dist/esm/hooks/index.d.ts.map +1 -0
- package/dist/esm/hooks/useControlledList.d.ts +25 -0
- package/dist/esm/hooks/useControlledList.d.ts.map +1 -0
- package/dist/esm/hooks/useParentHeight.d.ts +5 -0
- package/dist/esm/hooks/useParentHeight.d.ts.map +1 -0
- package/dist/esm/index.d.ts +21 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/theme/PlasmaColors.d.ts +19 -0
- package/dist/esm/theme/PlasmaColors.d.ts.map +1 -0
- package/dist/esm/theme/Plasmantine.d.ts +3 -0
- package/dist/esm/theme/Plasmantine.d.ts.map +1 -0
- package/dist/esm/theme/Theme.d.ts +3 -0
- package/dist/esm/theme/Theme.d.ts.map +1 -0
- package/dist/esm/theme/index.d.ts +2 -0
- package/dist/esm/theme/index.d.ts.map +1 -0
- package/dist/esm/utils/createPolymorphicComponent.d.ts +3 -0
- package/dist/esm/utils/createPolymorphicComponent.d.ts.map +1 -0
- package/dist/esm/utils/index.d.ts +3 -0
- package/dist/esm/utils/index.d.ts.map +1 -0
- package/dist/esm/utils/overrideComponent.d.ts +10 -0
- package/dist/esm/utils/overrideComponent.d.ts.map +1 -0
- package/package.json +16 -9
- package/src/__tests__/VitestSetup.ts +1 -0
- package/src/components/collection/Collection.styles.ts +8 -2
- package/src/components/collection/Collection.tsx +44 -28
- package/src/components/collection/CollectionItem.tsx +26 -19
- package/src/components/header/__tests__/__snapshots__/Header.spec.tsx.snap +1 -1
- package/tsconfig.build.json +1 -1
- package/tsconfig.json +0 -1
- package/vitest.config.ts +3 -0
- package/dist/cjs/__tests__/Utils.js +0 -38
- package/dist/cjs/__tests__/Utils.js.map +0 -1
- package/dist/cjs/__tests__/VitestSetup.js +0 -35
- package/dist/cjs/__tests__/VitestSetup.js.map +0 -1
- package/dist/definitions/__tests__/Utils.d.ts +0 -8
- package/dist/definitions/__tests__/Utils.d.ts.map +0 -1
- package/dist/definitions/__tests__/VitestSetup.d.ts +0 -8
- package/dist/definitions/__tests__/VitestSetup.d.ts.map +0 -1
- package/dist/esm/__tests__/Utils.js +0 -21
- package/dist/esm/__tests__/Utils.js.map +0 -1
- package/dist/esm/__tests__/VitestSetup.js +0 -30
- package/dist/esm/__tests__/VitestSetup.js.map +0 -1
- /package/dist/{definitions → cjs}/components/blank-slate/BlankSlate.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/blank-slate/BlankSlate.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/blank-slate/index.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/blank-slate/index.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/button/Button.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/button/Button.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/button/ButtonWithDisabledTooltip.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/button/ButtonWithDisabledTooltip.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/button/index.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/button/index.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/code-editor/CodeEditor.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/code-editor/CodeEditor.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/code-editor/index.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/code-editor/index.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/code-editor/languages/xml.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/code-editor/languages/xml.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/collection/Collection.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/collection/index.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/collection/index.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/copyToClipboard/CopyToClipboard.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/copyToClipboard/CopyToClipboard.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/copyToClipboard/index.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/copyToClipboard/index.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/date-range-picker/DateRangePickerInlineCalendar.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/date-range-picker/DateRangePickerInlineCalendar.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/date-range-picker/DateRangePickerPopoverCalendar.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/date-range-picker/DateRangePickerPopoverCalendar.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/date-range-picker/DateRangePickerPresetSelect.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/date-range-picker/DateRangePickerPresetSelect.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/date-range-picker/EditableDateRangePicker.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/date-range-picker/EditableDateRangePicker.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/date-range-picker/index.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/date-range-picker/index.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/header/Header.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/header/Header.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/header/index.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/header/index.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/index.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/index.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/inline-confirm/InlineConfirm.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/inline-confirm/InlineConfirm.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/inline-confirm/InlineConfirmButton.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/inline-confirm/InlineConfirmButton.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/inline-confirm/InlineConfirmContext.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/inline-confirm/InlineConfirmContext.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/inline-confirm/InlineConfirmMenuItem.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/inline-confirm/InlineConfirmMenuItem.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/inline-confirm/InlineConfirmPrompt.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/inline-confirm/InlineConfirmPrompt.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/inline-confirm/index.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/inline-confirm/index.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/inline-confirm/useInlineConfirm.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/inline-confirm/useInlineConfirm.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/menu/Menu.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/menu/Menu.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/menu/index.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/menu/index.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/modal-wizard/ModalWizard.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/modal-wizard/ModalWizard.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/modal-wizard/ModalWizardStep.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/modal-wizard/ModalWizardStep.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/modal-wizard/index.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/modal-wizard/index.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/prompt/Prompt.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/prompt/Prompt.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/prompt/PromptFooter.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/prompt/PromptFooter.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/prompt/index.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/prompt/index.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/sticky-footer/StickyFooter.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/sticky-footer/StickyFooter.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/sticky-footer/index.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/sticky-footer/index.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/table/Table.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/table/Table.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/table/Table.styles.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/table/Table.styles.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/table/Table.types.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/table/Table.types.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/table/TableActions.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/table/TableActions.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/table/TableCollapsibleColumn.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/table/TableCollapsibleColumn.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/table/TableConsumer.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/table/TableConsumer.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/table/TableContext.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/table/TableContext.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/table/TableDateRangePicker.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/table/TableDateRangePicker.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/table/TableFilter.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/table/TableFilter.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/table/TableFooter.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/table/TableFooter.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/table/TableHeader.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/table/TableHeader.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/table/TablePagination.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/table/TablePagination.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/table/TablePerPage.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/table/TablePerPage.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/table/TablePredicate.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/table/TablePredicate.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/table/TableSelectableColumn.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/table/TableSelectableColumn.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/table/Th.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/table/Th.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/table/index.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/table/index.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/components/table/useRowSelection.d.ts +0 -0
- /package/dist/{definitions → cjs}/components/table/useRowSelection.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/form/FormProvider.d.ts +0 -0
- /package/dist/{definitions → cjs}/form/FormProvider.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/form/index.d.ts +0 -0
- /package/dist/{definitions → cjs}/form/index.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/form/useForm.d.ts +0 -0
- /package/dist/{definitions → cjs}/form/useForm.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/hooks/index.d.ts +0 -0
- /package/dist/{definitions → cjs}/hooks/index.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/hooks/useControlledList.d.ts +0 -0
- /package/dist/{definitions → cjs}/hooks/useControlledList.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/hooks/useParentHeight.d.ts +0 -0
- /package/dist/{definitions → cjs}/hooks/useParentHeight.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/index.d.ts +0 -0
- /package/dist/{definitions → cjs}/index.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/theme/PlasmaColors.d.ts +0 -0
- /package/dist/{definitions → cjs}/theme/PlasmaColors.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/theme/Plasmantine.d.ts +0 -0
- /package/dist/{definitions → cjs}/theme/Plasmantine.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/theme/Theme.d.ts +0 -0
- /package/dist/{definitions → cjs}/theme/Theme.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/theme/index.d.ts +0 -0
- /package/dist/{definitions → cjs}/theme/index.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/utils/createPolymorphicComponent.d.ts +0 -0
- /package/dist/{definitions → cjs}/utils/createPolymorphicComponent.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/utils/index.d.ts +0 -0
- /package/dist/{definitions → cjs}/utils/index.d.ts.map +0 -0
- /package/dist/{definitions → cjs}/utils/overrideComponent.d.ts +0 -0
- /package/dist/{definitions → cjs}/utils/overrideComponent.d.ts.map +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Collection.d.ts","sourceRoot":"","sources":["../../../../src/components/collection/Collection.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Collection.d.ts","sourceRoot":"","sources":["../../../../src/components/collection/Collection.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEH,YAAY,EAGZ,qBAAqB,EACrB,iBAAiB,EACjB,SAAS,EAIZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAGhC,OAAO,SAAS,MAAM,qBAAqB,CAAC;AAG5C,UAAU,eAAe,CAAC,CAAC,CACvB,SAAQ,IAAI,CAAC,qBAAqB,EAAE,gBAAgB,GAAG,mBAAmB,CAAC,EACvE,YAAY,CAAC,SAAS,CAAC,OAAO,SAAS,CAAC,CAAC;IAC7C;;OAEG;IACH,OAAO,EAAE,CAAC,CAAC;IACX;;;;;OAKG;IACH,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;IAChD;;;;OAIG;IACH,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;IACZ;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,CAAC,YAAY,EAAE,CAAC,KAAK,MAAM,CAAC;IACxC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;IAChC;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IAClD;;;;;OAKG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,OAAO,CAAC;IACpC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;OAIG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAYD,eAAO,MAAM,UAAU,+CAsItB,CAAC"}
|
|
@@ -14,10 +14,11 @@ var _object_spread_props = require("@swc/helpers/_/_object_spread_props");
|
|
|
14
14
|
var _object_without_properties = require("@swc/helpers/_/_object_without_properties");
|
|
15
15
|
var _jsxruntime = require("react/jsx-runtime");
|
|
16
16
|
var _plasmareacticons = require("@coveord/plasma-react-icons");
|
|
17
|
-
var _core = require("@
|
|
17
|
+
var _core = require("@dnd-kit/core");
|
|
18
|
+
var _modifiers = require("@dnd-kit/modifiers");
|
|
19
|
+
var _sortable = require("@dnd-kit/sortable");
|
|
20
|
+
var _core1 = require("@mantine/core");
|
|
18
21
|
var _hooks = require("@mantine/hooks");
|
|
19
|
-
var _react = require("react");
|
|
20
|
-
var _reactbeautifuldnd = require("react-beautiful-dnd");
|
|
21
22
|
var _button = require("../button");
|
|
22
23
|
var _Collectionstyles = /*#__PURE__*/ _interop_require_default._(require("./Collection.styles"));
|
|
23
24
|
var _CollectionItem = require("./CollectionItem");
|
|
@@ -27,10 +28,14 @@ var defaultProps = {
|
|
|
27
28
|
addDisabledTooltip: "There is already an empty item",
|
|
28
29
|
disabled: false,
|
|
29
30
|
spacing: "xs",
|
|
30
|
-
required: false
|
|
31
|
+
required: false,
|
|
32
|
+
getItemId: function(param) {
|
|
33
|
+
var id = param.id;
|
|
34
|
+
return id;
|
|
35
|
+
}
|
|
31
36
|
};
|
|
32
37
|
var Collection = function(props) {
|
|
33
|
-
var _useComponentDefaultProps = (0,
|
|
38
|
+
var _useComponentDefaultProps = (0, _core1.useComponentDefaultProps)("Collection", defaultProps, props), value = _useComponentDefaultProps.value, onChange = _useComponentDefaultProps.onChange, onRemoveItem = _useComponentDefaultProps.onRemoveItem, onReorderItem = _useComponentDefaultProps.onReorderItem, onInsertItem = _useComponentDefaultProps.onInsertItem, disabled = _useComponentDefaultProps.disabled, draggable = _useComponentDefaultProps.draggable, children = _useComponentDefaultProps.children, spacing = _useComponentDefaultProps.spacing, required = _useComponentDefaultProps.required, newItem = _useComponentDefaultProps.newItem, addLabel = _useComponentDefaultProps.addLabel, addDisabledTooltip = _useComponentDefaultProps.addDisabledTooltip, allowAdd = _useComponentDefaultProps.allowAdd, label = _useComponentDefaultProps.label, labelProps = _useComponentDefaultProps.labelProps, withAsterisk = _useComponentDefaultProps.withAsterisk, description = _useComponentDefaultProps.description, descriptionProps = _useComponentDefaultProps.descriptionProps, error = _useComponentDefaultProps.error, errorProps = _useComponentDefaultProps.errorProps, getItemId = _useComponentDefaultProps.getItemId, // Style props
|
|
34
39
|
classNames = _useComponentDefaultProps.classNames, className = _useComponentDefaultProps.className, styles = _useComponentDefaultProps.styles, unstyled = _useComponentDefaultProps.unstyled, others = _object_without_properties._(_useComponentDefaultProps, [
|
|
35
40
|
"value",
|
|
36
41
|
"onChange",
|
|
@@ -65,7 +70,9 @@ var Collection = function(props) {
|
|
|
65
70
|
styles: styles,
|
|
66
71
|
unstyled: unstyled
|
|
67
72
|
}), classes = _useStyles.classes, cx = _useStyles.cx;
|
|
68
|
-
var
|
|
73
|
+
var sensors = (0, _core.useSensors)((0, _core.useSensor)(_core.PointerSensor), (0, _core.useSensor)(_core.KeyboardSensor, {
|
|
74
|
+
coordinateGetter: _sortable.sortableKeyboardCoordinates
|
|
75
|
+
}));
|
|
69
76
|
var hasOnlyOneItem = value.length === 1;
|
|
70
77
|
/**
|
|
71
78
|
* Enforcing onChange when the value is modified will make sure the errors are carried through.
|
|
@@ -75,15 +82,15 @@ var Collection = function(props) {
|
|
|
75
82
|
JSON.stringify(value)
|
|
76
83
|
]);
|
|
77
84
|
var isRequired = typeof withAsterisk === "boolean" ? withAsterisk : required;
|
|
78
|
-
var _label = label ? /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
85
|
+
var _label = label ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_core1.Input.Label, _object_spread_props._(_object_spread._({
|
|
79
86
|
required: isRequired
|
|
80
87
|
}, labelProps), {
|
|
81
88
|
children: label
|
|
82
89
|
})) : null;
|
|
83
|
-
var _description = description ? /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
90
|
+
var _description = description ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_core1.Input.Description, _object_spread_props._(_object_spread._({}, descriptionProps), {
|
|
84
91
|
children: description
|
|
85
92
|
})) : null;
|
|
86
|
-
var _error = error ? /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
93
|
+
var _error = error ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_core1.Input.Error, _object_spread_props._(_object_spread._({}, errorProps), {
|
|
87
94
|
children: error
|
|
88
95
|
})) : null;
|
|
89
96
|
var _header = _label || _description ? /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
@@ -93,27 +100,33 @@ var Collection = function(props) {
|
|
|
93
100
|
]
|
|
94
101
|
}) : null;
|
|
95
102
|
var _getItemId;
|
|
96
|
-
var
|
|
103
|
+
var standardizedItems = value.map(function(item, index) {
|
|
104
|
+
return {
|
|
105
|
+
id: (_getItemId = getItemId === null || getItemId === void 0 ? void 0 : getItemId(item)) !== null && _getItemId !== void 0 ? _getItemId : String(index),
|
|
106
|
+
data: item
|
|
107
|
+
};
|
|
108
|
+
});
|
|
109
|
+
var items = standardizedItems.map(function(item, index) {
|
|
97
110
|
/*#__PURE__*/ return (0, _jsxruntime.jsx)(_CollectionItem.CollectionItem, {
|
|
111
|
+
id: item.id,
|
|
98
112
|
disabled: disabled,
|
|
99
113
|
draggable: draggable,
|
|
100
|
-
index: index,
|
|
101
114
|
onRemove: function() {
|
|
102
115
|
return onRemoveItem === null || onRemoveItem === void 0 ? void 0 : onRemoveItem(index);
|
|
103
116
|
},
|
|
104
117
|
styles: styles,
|
|
105
118
|
removable: !(required && hasOnlyOneItem),
|
|
106
|
-
children: children(item, index)
|
|
107
|
-
},
|
|
119
|
+
children: children(item.data, index)
|
|
120
|
+
}, item.id);
|
|
108
121
|
});
|
|
109
122
|
var _allowAdd;
|
|
110
123
|
var addAllowed = (_allowAdd = allowAdd === null || allowAdd === void 0 ? void 0 : allowAdd(value)) !== null && _allowAdd !== void 0 ? _allowAdd : true;
|
|
111
124
|
var _value_length;
|
|
112
|
-
var _addButton = disabled ? null : /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
113
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
125
|
+
var _addButton = disabled ? null : /*#__PURE__*/ (0, _jsxruntime.jsx)(_core1.Group, {
|
|
126
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_core1.Tooltip, {
|
|
114
127
|
label: addDisabledTooltip,
|
|
115
128
|
disabled: addAllowed,
|
|
116
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
129
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_core1.Box, {
|
|
117
130
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_button.Button, {
|
|
118
131
|
variant: "subtle",
|
|
119
132
|
leftIcon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_plasmareacticons.AddSize16Px, {
|
|
@@ -128,36 +141,49 @@ var Collection = function(props) {
|
|
|
128
141
|
})
|
|
129
142
|
})
|
|
130
143
|
});
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}), others), {
|
|
147
|
-
children: [
|
|
148
|
-
_header,
|
|
149
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_core.Stack, {
|
|
150
|
-
spacing: spacing,
|
|
151
|
-
children: [
|
|
152
|
-
items,
|
|
153
|
-
provided.placeholder,
|
|
154
|
-
_addButton,
|
|
155
|
-
_error
|
|
156
|
-
]
|
|
157
|
-
})
|
|
158
|
-
]
|
|
159
|
-
}));
|
|
144
|
+
var getIndex = function(id) {
|
|
145
|
+
return standardizedItems.findIndex(function(item) {
|
|
146
|
+
return item.id === id;
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
var handleDragEnd = function(param) {
|
|
150
|
+
var over = param.over, active = param.active;
|
|
151
|
+
if (over) {
|
|
152
|
+
var activeIndex = getIndex(String(active.id));
|
|
153
|
+
var overIndex = getIndex(String(over.id));
|
|
154
|
+
if (activeIndex !== overIndex) {
|
|
155
|
+
onReorderItem === null || onReorderItem === void 0 ? void 0 : onReorderItem({
|
|
156
|
+
from: activeIndex,
|
|
157
|
+
to: overIndex
|
|
158
|
+
});
|
|
160
159
|
}
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_core.DndContext, {
|
|
163
|
+
onDragEnd: handleDragEnd,
|
|
164
|
+
sensors: sensors,
|
|
165
|
+
modifiers: [
|
|
166
|
+
_modifiers.restrictToVerticalAxis,
|
|
167
|
+
_modifiers.restrictToParentElement
|
|
168
|
+
],
|
|
169
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_sortable.SortableContext, {
|
|
170
|
+
items: standardizedItems,
|
|
171
|
+
strategy: _sortable.verticalListSortingStrategy,
|
|
172
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_core1.Box, _object_spread_props._(_object_spread._({
|
|
173
|
+
className: cx(classes.root, className)
|
|
174
|
+
}, others), {
|
|
175
|
+
children: [
|
|
176
|
+
_header,
|
|
177
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_core1.Stack, {
|
|
178
|
+
spacing: spacing,
|
|
179
|
+
children: [
|
|
180
|
+
items,
|
|
181
|
+
_addButton,
|
|
182
|
+
_error
|
|
183
|
+
]
|
|
184
|
+
})
|
|
185
|
+
]
|
|
186
|
+
}))
|
|
161
187
|
})
|
|
162
188
|
});
|
|
163
189
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/collection/Collection.tsx"],"sourcesContent":["import {AddSize16Px} from '@coveord/plasma-react-icons';\nimport {\n Box,\n DefaultProps,\n Group,\n Input,\n InputWrapperBaseProps,\n MantineNumberSize,\n Selectors,\n Stack,\n Tooltip,\n useComponentDefaultProps,\n} from '@mantine/core';\nimport {ReorderPayload} from '@mantine/form/lib/types';\nimport {useDidUpdate} from '@mantine/hooks';\nimport {ReactNode, useId} from 'react';\nimport {DragDropContext, Droppable} from 'react-beautiful-dnd';\n\nimport {Button} from '../button';\nimport useStyles from './Collection.styles';\nimport {CollectionItem} from './CollectionItem';\n\ninterface CollectionProps<T>\n extends Omit<InputWrapperBaseProps, 'inputContainer' | 'inputWrapperOrder'>,\n DefaultProps<Selectors<typeof useStyles>> {\n /**\n * The default value each new item should have\n */\n newItem: T;\n /**\n * A render function called for each item passed in the `value` prop.\n *\n * @param item The current item's value\n * @param index The current item's index\n */\n children: (item: T, index: number) => ReactNode;\n /**\n * The list of items to display inside the collection\n *\n * @default []\n */\n value?: T[];\n /**\n * Defines how each item is uniquely identified. It is highly recommended that you specify this prop to an ID that makes sense.\n *\n * This method is required when using this component with ReactHookForm.\n *\n * @see {@link https://react-hook-form.com/api/usefieldarray/} for using a collection with ReactHookForm.\n *\n * @param originalItem The original item\n */\n getItemId?: (originalItem: T) => string;\n /**\n * Unused, has no effect\n */\n onFocus?: () => void;\n /**\n * Function called whenever the value needs to be updated\n *\n * @param value The whole list of items after the change\n */\n onChange?: (value: T[]) => void;\n /**\n * Function called after an item is removed from the collection using the remove button\n *\n * @param itemIndex The index of the item that was removed\n */\n onRemoveItem?: (itemIndex: number) => void;\n /**\n * Function that gets called whenever a collection item needs to be reordered\n *\n * @param payload The origin and destination index of the item to reorder\n */\n onReorderItem?: (payload: ReorderPayload) => void;\n /**\n * Function that gets called when a new item needs to be added to the collection\n *\n * @param value The the value of the item to insert\n * @param index The index of the new item to insert\n */\n onInsertItem?: (value: T, index: number) => void;\n /**\n * Whether the collection should have drag and drop behavior enabled\n *\n * @default false\n */\n draggable?: boolean;\n /**\n * Whether the collection is disabled, or in other words in read only mode\n *\n * @default false\n */\n disabled?: boolean;\n /**\n * Function that determines if the add item button should be enabled given the current items of the collection.\n * The button is always enabled if this props remains undefined\n *\n * @param values The current items of the collection\n */\n allowAdd?: (values: T[]) => boolean;\n /**\n * The label of the add item button\n *\n * @default \"Add item\"\n */\n addLabel?: string;\n /**\n * The tooltip text displayed when hovering over the disabled add item button\n *\n * @default 'There is already an empty item'\n */\n addDisabledTooltip?: string;\n /**\n * The spacing between the colleciton items\n *\n * @default 'xs'\n */\n spacing?: MantineNumberSize;\n /**\n * Whether the collection is required. When required is true, the collection will hide the remove button if there is only one item\n *\n * @default false\n */\n required?: boolean;\n}\n\nconst defaultProps: Partial<CollectionProps<unknown>> = {\n draggable: false,\n addLabel: 'Add item',\n addDisabledTooltip: 'There is already an empty item',\n disabled: false,\n spacing: 'xs',\n required: false,\n};\n\nexport const Collection = <T,>(props: CollectionProps<T>) => {\n const {\n value,\n onChange,\n onRemoveItem,\n onReorderItem,\n onInsertItem,\n disabled,\n draggable,\n children,\n spacing,\n required,\n newItem,\n addLabel,\n addDisabledTooltip,\n allowAdd,\n label,\n labelProps,\n withAsterisk,\n description,\n descriptionProps,\n error,\n errorProps,\n getItemId,\n\n // Style props\n classNames,\n className,\n styles,\n unstyled,\n\n ...others\n } = useComponentDefaultProps('Collection', defaultProps as CollectionProps<T>, props);\n const {classes, cx} = useStyles(null, {classNames, name: 'Collection', styles, unstyled});\n const collectionID = useId();\n\n const hasOnlyOneItem = value.length === 1;\n\n /**\n * Enforcing onChange when the value is modified will make sure the errors are carried through.\n */\n useDidUpdate(() => {\n onChange?.(value);\n }, [JSON.stringify(value)]);\n\n const isRequired = typeof withAsterisk === 'boolean' ? withAsterisk : required;\n const _label = label ? (\n <Input.Label required={isRequired} {...labelProps}>\n {label}\n </Input.Label>\n ) : null;\n\n const _description = description ? (\n <Input.Description {...descriptionProps}>{description}</Input.Description>\n ) : null;\n const _error = error ? <Input.Error {...errorProps}>{error}</Input.Error> : null;\n const _header =\n _label || _description ? (\n <>\n {_label}\n {_description}\n </>\n ) : null;\n\n const items = value.map((item, index) => (\n <CollectionItem\n key={(getItemId?.(item) ?? index) as string}\n disabled={disabled}\n draggable={draggable}\n index={index}\n onRemove={() => onRemoveItem?.(index)}\n styles={styles}\n removable={!(required && hasOnlyOneItem)}\n >\n {children(item, index)}\n </CollectionItem>\n ));\n\n const addAllowed = allowAdd?.(value) ?? true;\n\n const _addButton = disabled ? null : (\n <Group>\n <Tooltip label={addDisabledTooltip} disabled={addAllowed}>\n <Box>\n <Button\n variant=\"subtle\"\n leftIcon={<AddSize16Px height={16} />}\n onClick={() => onInsertItem(newItem, value?.length ?? 0)}\n disabled={!addAllowed}\n >\n {addLabel}\n </Button>\n </Box>\n </Tooltip>\n </Group>\n );\n\n return (\n <DragDropContext\n onDragEnd={({destination, source}) => onReorderItem({from: source.index, to: destination?.index || 0})}\n >\n <Droppable direction=\"vertical\" droppableId={collectionID}>\n {(provided) => (\n <Box\n {...provided.droppableProps}\n ref={provided.innerRef}\n className={cx(classes.root, className)}\n {...others}\n >\n {_header}\n <Stack spacing={spacing}>\n {items}\n {provided.placeholder}\n {_addButton}\n {_error}\n </Stack>\n </Box>\n )}\n </Droppable>\n </DragDropContext>\n );\n};\n"],"names":["Collection","defaultProps","draggable","addLabel","addDisabledTooltip","disabled","spacing","required","props","useComponentDefaultProps","value","onChange","onRemoveItem","onReorderItem","onInsertItem","children","newItem","allowAdd","label","labelProps","withAsterisk","description","descriptionProps","error","errorProps","getItemId","classNames","className","styles","unstyled","others","useStyles","name","classes","cx","collectionID","useId","hasOnlyOneItem","length","useDidUpdate","JSON","stringify","isRequired","_label","Input","Label","_description","Description","_error","Error","_header","items","map","item","index","CollectionItem","onRemove","removable","addAllowed","_addButton","Group","Tooltip","Box","Button","variant","leftIcon","AddSize16Px","height","onClick","DragDropContext","onDragEnd","destination","source","from","to","Droppable","direction","droppableId","provided","droppableProps","ref","innerRef","root","Stack","placeholder"],"mappings":";;;;+BAuIaA;;;eAAAA;;;;;;;;gCAvIa;oBAYnB;qBAEoB;qBACI;iCACU;sBAEpB;yEACC;8BACO;AA0G7B,IAAMC,eAAkD;IACpDC,WAAW,KAAK;IAChBC,UAAU;IACVC,oBAAoB;IACpBC,UAAU,KAAK;IACfC,SAAS;IACTC,UAAU,KAAK;AACnB;AAEO,IAAMP,aAAa,SAAKQ,OAA8B;IACzD,IA+BIC,4BAAAA,IAAAA,8BAAwB,EAAC,cAAcR,cAAoCO,QA9B3EE,QA8BAD,0BA9BAC,OACAC,WA6BAF,0BA7BAE,UACAC,eA4BAH,0BA5BAG,cACAC,gBA2BAJ,0BA3BAI,eACAC,eA0BAL,0BA1BAK,cACAT,WAyBAI,0BAzBAJ,UACAH,YAwBAO,0BAxBAP,WACAa,WAuBAN,0BAvBAM,UACAT,UAsBAG,0BAtBAH,SACAC,WAqBAE,0BArBAF,UACAS,UAoBAP,0BApBAO,SACAb,WAmBAM,0BAnBAN,UACAC,qBAkBAK,0BAlBAL,oBACAa,WAiBAR,0BAjBAQ,UACAC,QAgBAT,0BAhBAS,OACAC,aAeAV,0BAfAU,YACAC,eAcAX,0B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AAGD,QAAQiD,IAAI,EAAEvD;oBACxBG;;wBAEHoB;sCACD,sBAACiC,WAAK;4BAAC7E,SAASA;;gCACX6C;gCACA2B,SAASM,WAAW;gCACpBzB;gCACAX;;;;;;;;AAO7B"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/collection/Collection.tsx"],"sourcesContent":["import {AddSize16Px} from '@coveord/plasma-react-icons';\nimport {DndContext, DragEndEvent, KeyboardSensor, PointerSensor, useSensor, useSensors} from '@dnd-kit/core';\nimport {restrictToParentElement, restrictToVerticalAxis} from '@dnd-kit/modifiers';\nimport {SortableContext, sortableKeyboardCoordinates, verticalListSortingStrategy} from '@dnd-kit/sortable';\nimport {\n Box,\n DefaultProps,\n Group,\n Input,\n InputWrapperBaseProps,\n MantineNumberSize,\n Selectors,\n Stack,\n Tooltip,\n useComponentDefaultProps,\n} from '@mantine/core';\nimport {ReorderPayload} from '@mantine/form/lib/types';\nimport {useDidUpdate} from '@mantine/hooks';\nimport {ReactNode} from 'react';\n\nimport {Button} from '../button';\nimport useStyles from './Collection.styles';\nimport {CollectionItem} from './CollectionItem';\n\ninterface CollectionProps<T>\n extends Omit<InputWrapperBaseProps, 'inputContainer' | 'inputWrapperOrder'>,\n DefaultProps<Selectors<typeof useStyles>> {\n /**\n * The default value each new item should have\n */\n newItem: T;\n /**\n * A render function called for each item passed in the `value` prop.\n *\n * @param item The current item's value\n * @param index The current item's index\n */\n children: (item: T, index: number) => ReactNode;\n /**\n * The list of items to display inside the collection\n *\n * @default []\n */\n value?: T[];\n /**\n * Defines how each item is uniquely identified. It is highly recommended that you specify this prop to an ID that makes sense.\n *\n * This method is required when using this component with ReactHookForm.\n *\n * @see {@link https://react-hook-form.com/api/usefieldarray/} for using a collection with ReactHookForm.\n *\n * @param originalItem The original item\n */\n getItemId?: (originalItem: T) => string;\n /**\n * Unused, has no effect\n */\n onFocus?: () => void;\n /**\n * Function called whenever the value needs to be updated\n *\n * @param value The whole list of items after the change\n */\n onChange?: (value: T[]) => void;\n /**\n * Function called after an item is removed from the collection using the remove button\n *\n * @param itemIndex The index of the item that was removed\n */\n onRemoveItem?: (itemIndex: number) => void;\n /**\n * Function that gets called whenever a collection item needs to be reordered\n *\n * @param payload The origin and destination index of the item to reorder\n */\n onReorderItem?: (payload: ReorderPayload) => void;\n /**\n * Function that gets called when a new item needs to be added to the collection\n *\n * @param value The the value of the item to insert\n * @param index The index of the new item to insert\n */\n onInsertItem?: (value: T, index: number) => void;\n /**\n * Whether the collection should have drag and drop behavior enabled\n *\n * @default false\n */\n draggable?: boolean;\n /**\n * Whether the collection is disabled, or in other words in read only mode\n *\n * @default false\n */\n disabled?: boolean;\n /**\n * Function that determines if the add item button should be enabled given the current items of the collection.\n * The button is always enabled if this props remains undefined\n *\n * @param values The current items of the collection\n */\n allowAdd?: (values: T[]) => boolean;\n /**\n * The label of the add item button\n *\n * @default \"Add item\"\n */\n addLabel?: string;\n /**\n * The tooltip text displayed when hovering over the disabled add item button\n *\n * @default 'There is already an empty item'\n */\n addDisabledTooltip?: string;\n /**\n * The spacing between the colleciton items\n *\n * @default 'xs'\n */\n spacing?: MantineNumberSize;\n /**\n * Whether the collection is required. When required is true, the collection will hide the remove button if there is only one item\n *\n * @default false\n */\n required?: boolean;\n}\n\nconst defaultProps: Partial<CollectionProps<unknown>> = {\n draggable: false,\n addLabel: 'Add item',\n addDisabledTooltip: 'There is already an empty item',\n disabled: false,\n spacing: 'xs',\n required: false,\n getItemId: ({id}: any) => id,\n};\n\nexport const Collection = <T,>(props: CollectionProps<T>) => {\n const {\n value,\n onChange,\n onRemoveItem,\n onReorderItem,\n onInsertItem,\n disabled,\n draggable,\n children,\n spacing,\n required,\n newItem,\n addLabel,\n addDisabledTooltip,\n allowAdd,\n label,\n labelProps,\n withAsterisk,\n description,\n descriptionProps,\n error,\n errorProps,\n getItemId,\n\n // Style props\n classNames,\n className,\n styles,\n unstyled,\n\n ...others\n } = useComponentDefaultProps('Collection', defaultProps as CollectionProps<T>, props);\n const {classes, cx} = useStyles(null, {classNames, name: 'Collection', styles, unstyled});\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor, {\n coordinateGetter: sortableKeyboardCoordinates,\n })\n );\n\n const hasOnlyOneItem = value.length === 1;\n\n /**\n * Enforcing onChange when the value is modified will make sure the errors are carried through.\n */\n useDidUpdate(() => {\n onChange?.(value);\n }, [JSON.stringify(value)]);\n\n const isRequired = typeof withAsterisk === 'boolean' ? withAsterisk : required;\n const _label = label ? (\n <Input.Label required={isRequired} {...labelProps}>\n {label}\n </Input.Label>\n ) : null;\n\n const _description = description ? (\n <Input.Description {...descriptionProps}>{description}</Input.Description>\n ) : null;\n const _error = error ? <Input.Error {...errorProps}>{error}</Input.Error> : null;\n const _header =\n _label || _description ? (\n <>\n {_label}\n {_description}\n </>\n ) : null;\n\n const standardizedItems = value.map((item, index) => ({id: getItemId?.(item) ?? String(index), data: item}));\n\n const items = standardizedItems.map((item, index) => (\n <CollectionItem\n key={item.id}\n id={item.id}\n disabled={disabled}\n draggable={draggable}\n onRemove={() => onRemoveItem?.(index)}\n styles={styles}\n removable={!(required && hasOnlyOneItem)}\n >\n {children(item.data, index)}\n </CollectionItem>\n ));\n\n const addAllowed = allowAdd?.(value) ?? true;\n\n const _addButton = disabled ? null : (\n <Group>\n <Tooltip label={addDisabledTooltip} disabled={addAllowed}>\n <Box>\n <Button\n variant=\"subtle\"\n leftIcon={<AddSize16Px height={16} />}\n onClick={() => onInsertItem(newItem, value?.length ?? 0)}\n disabled={!addAllowed}\n >\n {addLabel}\n </Button>\n </Box>\n </Tooltip>\n </Group>\n );\n\n const getIndex = (id: string) => standardizedItems.findIndex((item) => item.id === id);\n\n const handleDragEnd = ({over, active}: DragEndEvent): void => {\n if (over) {\n const activeIndex = getIndex(String(active.id));\n const overIndex = getIndex(String(over.id));\n if (activeIndex !== overIndex) {\n onReorderItem?.({from: activeIndex, to: overIndex});\n }\n }\n };\n\n return (\n <DndContext\n onDragEnd={handleDragEnd}\n sensors={sensors}\n modifiers={[restrictToVerticalAxis, restrictToParentElement]}\n >\n <SortableContext items={standardizedItems} strategy={verticalListSortingStrategy}>\n <Box className={cx(classes.root, className)} {...others}>\n {_header}\n <Stack spacing={spacing}>\n {items}\n {_addButton}\n {_error}\n </Stack>\n </Box>\n </SortableContext>\n </DndContext>\n );\n};\n"],"names":["Collection","defaultProps","draggable","addLabel","addDisabledTooltip","disabled","spacing","required","getItemId","id","props","useComponentDefaultProps","value","onChange","onRemoveItem","onReorderItem","onInsertItem","children","newItem","allowAdd","label","labelProps","withAsterisk","description","descriptionProps","error","errorProps","classNames","className","styles","unstyled","others","useStyles","name","classes","cx","sensors","useSensors","useSensor","PointerSensor","KeyboardSensor","coordinateGetter","sortableKeyboardCoordinates","hasOnlyOneItem","length","useDidUpdate","JSON","stringify","isRequired","_label","Input","Label","_description","Description","_error","Error","_header","standardizedItems","map","item","index","String","data","items","CollectionItem","onRemove","removable","addAllowed","_addButton","Group","Tooltip","Box","Button","variant","leftIcon","AddSize16Px","height","onClick","getIndex","findIndex","handleDragEnd","over","active","activeIndex","overIndex","from","to","DndContext","onDragEnd","modifiers","restrictToVerticalAxis","restrictToParentElement","SortableContext","strategy","verticalListSortingStrategy","root","Stack"],"mappings":";;;;+BA0IaA;;;eAAAA;;;;;;;;gCA1Ia;oBACmE;yBAC/B;wBAC0B;qBAYjF;qBAEoB;sBAGN;yEACC;8BACO;AA0G7B,IAAMC,eAAkD;IACpDC,WAAW,KAAK;IAChBC,UAAU;IACVC,oBAAoB;IACpBC,UAAU,KAAK;IACfC,SAAS;IACTC,UAAU,KAAK;IACfC,WAAW;YAAEC,WAAAA;eAAaA;;AAC9B;AAEO,IAAMT,aAAa,SAAKU,OAA8B;IACzD,IA+BIC,4BAAAA,IAAAA,+BAAwB,EAAC,cAAcV,cAAoCS,QA9B3EE,QA8BAD,0BA9BAC,OACAC,WA6BAF,0BA7BAE,UACAC,eA4BAH,0BA5BAG,cACAC,gBA2BAJ,0BA3BAI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,6BAAW;wBAACC,QAAQ;;oBAC/BC,SAAS;wBAAM7D,OAAAA,aAAaE,SAASN,CAAAA,gBAAAA,kBAAAA,mBAAAA,KAAAA,IAAAA,MAAOgC,MAAM,cAAbhC,2BAAAA,gBAAiB,CAAC;;oBACvDP,UAAU,CAAC8D;8BAEVhE;;;;MAKpB;IAED,IAAM2E,WAAW,SAACrE;eAAegD,kBAAkBsB,SAAS,CAAC,SAACpB;mBAASA,KAAKlD,EAAE,KAAKA;;;IAEnF,IAAMuE,gBAAgB,gBAAwC;YAAtCC,aAAAA,MAAMC,eAAAA;QAC1B,IAAID,MAAM;YACN,IAAME,cAAcL,SAASjB,OAAOqB,OAAOzE,EAAE;YAC7C,IAAM2E,YAAYN,SAASjB,OAAOoB,KAAKxE,EAAE;YACzC,IAAI0E,gBAAgBC,WAAW;gBAC3BrE,0BAAAA,2BAAAA,KAAAA,IAAAA,cAAgB;oBAACsE,MAAMF;oBAAaG,IAAIF;gBAAS;YACrD,CAAC;QACL,CAAC;IACL;IAEA,qBACI,qBAACG,gBAAU;QACPC,WAAWR;QACX5C,SAASA;QACTqD,WAAW;YAACC,iCAAsB;YAAEC,kCAAuB;SAAC;kBAE5D,cAAA,qBAACC,yBAAe;YAAC7B,OAAON;YAAmBoC,UAAUC,qCAA2B;sBAC5E,cAAA,sBAACvB,UAAG;gBAAC3C,WAAWO,GAAGD,QAAQ6D,IAAI,EAAEnE;eAAgBG;;oBAC5CyB;kCACD,sBAACwC,YAAK;wBAAC1F,SAASA;;4BACXyD;4BACAK;4BACAd;;;;;;;AAMzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Collection.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/collection/Collection.styles.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,sBAAsB;CAAG
|
|
1
|
+
{"version":3,"file":"Collection.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/collection/Collection.styles.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,sBAAsB;CAAG;;;;;;;;;;;AAE1C,wBAeI"}
|
|
@@ -11,13 +11,19 @@ Object.defineProperty(exports, "default", {
|
|
|
11
11
|
var _core = require("@mantine/core");
|
|
12
12
|
var _default = (0, _core.createStyles)(function(theme) {
|
|
13
13
|
return {
|
|
14
|
-
root: {
|
|
14
|
+
root: {
|
|
15
|
+
position: "relative"
|
|
16
|
+
},
|
|
15
17
|
item: {
|
|
16
18
|
backgroundColor: theme.colorScheme === "light" ? theme.white : theme.black,
|
|
17
19
|
alignItems: "baseline"
|
|
18
20
|
},
|
|
19
21
|
itemDragging: {
|
|
20
|
-
boxShadow: theme.shadows.
|
|
22
|
+
boxShadow: theme.shadows.md,
|
|
23
|
+
zIndex: 2
|
|
24
|
+
},
|
|
25
|
+
dragHandle: {
|
|
26
|
+
cursor: "move"
|
|
21
27
|
}
|
|
22
28
|
};
|
|
23
29
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/collection/Collection.styles.ts"],"sourcesContent":["import {createStyles} from '@mantine/core';\n\nexport interface CollectionStylesParams {}\n\nexport default createStyles((theme) => ({\n root: {},\n item: {\n backgroundColor: theme.colorScheme === 'light' ? theme.white : theme.black,\n alignItems: 'baseline',\n },\n itemDragging: {\n boxShadow: theme.shadows.
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/collection/Collection.styles.ts"],"sourcesContent":["import {createStyles} from '@mantine/core';\n\nexport interface CollectionStylesParams {}\n\nexport default createStyles((theme) => ({\n root: {\n position: 'relative',\n },\n item: {\n backgroundColor: theme.colorScheme === 'light' ? theme.white : theme.black,\n alignItems: 'baseline',\n },\n itemDragging: {\n boxShadow: theme.shadows.md,\n zIndex: 2,\n },\n dragHandle: {\n cursor: 'move',\n },\n}));\n"],"names":["createStyles","theme","root","position","item","backgroundColor","colorScheme","white","black","alignItems","itemDragging","boxShadow","shadows","md","zIndex","dragHandle","cursor"],"mappings":";;;;+BAIA;;;eAAA;;;oBAJ2B;IAI3B,WAAeA,IAAAA,kBAAY,EAAC,SAACC;WAAW;QACpCC,MAAM;YACFC,UAAU;QACd;QACAC,MAAM;YACFC,iBAAiBJ,MAAMK,WAAW,KAAK,UAAUL,MAAMM,KAAK,GAAGN,MAAMO,KAAK;YAC1EC,YAAY;QAChB;QACAC,cAAc;YACVC,WAAWV,MAAMW,OAAO,CAACC,EAAE;YAC3BC,QAAQ;QACZ;QACAC,YAAY;YACRC,QAAQ;QACZ;IACJ"}
|
|
@@ -6,7 +6,7 @@ interface CollectionItemProps extends CollectionItemSharedProps {
|
|
|
6
6
|
disabled: boolean;
|
|
7
7
|
}
|
|
8
8
|
interface CollectionItemSharedProps extends DefaultProps<Selectors<typeof useStyles>> {
|
|
9
|
-
|
|
9
|
+
id: string;
|
|
10
10
|
onRemove?: React.MouseEventHandler<HTMLButtonElement>;
|
|
11
11
|
removable?: boolean;
|
|
12
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollectionItem.d.ts","sourceRoot":"","sources":["../../../../src/components/collection/CollectionItem.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CollectionItem.d.ts","sourceRoot":"","sources":["../../../../src/components/collection/CollectionItem.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAa,YAAY,EAAS,SAAS,EAAC,MAAM,eAAe,CAAC;AACzE,OAAO,EAAC,iBAAiB,EAAE,iBAAiB,EAAC,MAAM,OAAO,CAAC;AAE3D,OAAO,SAAS,MAAM,qBAAqB,CAAC;AAE5C,UAAU,mBAAoB,SAAQ,yBAAyB;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACrB;AAED,UAAU,yBAA0B,SAAQ,YAAY,CAAC,SAAS,CAAC,OAAO,SAAS,CAAC,CAAC;IACjF,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACtD,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAwED,eAAO,MAAM,cAAc,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAYpF,CAAC"}
|
|
@@ -15,8 +15,9 @@ var _object_spread_props = require("@swc/helpers/_/_object_spread_props");
|
|
|
15
15
|
var _object_without_properties = require("@swc/helpers/_/_object_without_properties");
|
|
16
16
|
var _jsxruntime = require("react/jsx-runtime");
|
|
17
17
|
var _plasmareacticons = require("@coveord/plasma-react-icons");
|
|
18
|
+
var _sortable = require("@dnd-kit/sortable");
|
|
19
|
+
var _utilities = require("@dnd-kit/utilities");
|
|
18
20
|
var _core = require("@mantine/core");
|
|
19
|
-
var _reactbeautifuldnd = require("react-beautiful-dnd");
|
|
20
21
|
var _Collectionstyles = /*#__PURE__*/ _interop_require_default._(require("./Collection.styles"));
|
|
21
22
|
var RemoveButton = function(param) {
|
|
22
23
|
var onClick = param.onClick;
|
|
@@ -68,7 +69,7 @@ var DisabledCollectionItem = function(param) {
|
|
|
68
69
|
});
|
|
69
70
|
};
|
|
70
71
|
var DraggableCollectionItem = function(param) {
|
|
71
|
-
var
|
|
72
|
+
var id = param.id, onRemove = param.onRemove, _param_removable = param.removable, removable = _param_removable === void 0 ? true : _param_removable, styles = param.styles, children = param.children;
|
|
72
73
|
var _useStyles = (0, _Collectionstyles.default)(null, {
|
|
73
74
|
name: "Collection",
|
|
74
75
|
styles: styles
|
|
@@ -76,30 +77,29 @@ var DraggableCollectionItem = function(param) {
|
|
|
76
77
|
var removeButton = removable && onRemove ? /*#__PURE__*/ (0, _jsxruntime.jsx)(RemoveButton, {
|
|
77
78
|
onClick: onRemove
|
|
78
79
|
}) : null;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}, index);
|
|
80
|
+
var _useSortable = (0, _sortable.useSortable)({
|
|
81
|
+
id: id
|
|
82
|
+
}), attributes = _useSortable.attributes, listeners = _useSortable.listeners, setNodeRef = _useSortable.setNodeRef, transform = _useSortable.transform, transition = _useSortable.transition, isDragging = _useSortable.isDragging, setActivatorNodeRef = _useSortable.setActivatorNodeRef;
|
|
83
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_core.Group, {
|
|
84
|
+
ref: setNodeRef,
|
|
85
|
+
className: cx(classes.item, _define_property._({}, classes.itemDragging, isDragging)),
|
|
86
|
+
sx: transform ? {
|
|
87
|
+
transform: _utilities.CSS.Transform.toString(transform),
|
|
88
|
+
transition: transition
|
|
89
|
+
} : undefined,
|
|
90
|
+
children: [
|
|
91
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("div", _object_spread_props._(_object_spread._({
|
|
92
|
+
ref: setActivatorNodeRef
|
|
93
|
+
}, listeners, attributes), {
|
|
94
|
+
className: classes.dragHandle,
|
|
95
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_plasmareacticons.DragAndDropSize24Px, {
|
|
96
|
+
height: 16
|
|
97
|
+
})
|
|
98
|
+
})),
|
|
99
|
+
children,
|
|
100
|
+
removeButton
|
|
101
|
+
]
|
|
102
|
+
});
|
|
103
103
|
};
|
|
104
104
|
var CollectionItem = function(_param) {
|
|
105
105
|
var draggable = _param.draggable, disabled = _param.disabled, otherProps = _object_without_properties._(_param, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/collection/CollectionItem.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/collection/CollectionItem.tsx"],"sourcesContent":["import {DragAndDropSize24Px, RemoveSize16Px} from '@coveord/plasma-react-icons';\nimport {useSortable} from '@dnd-kit/sortable';\nimport {CSS} from '@dnd-kit/utilities';\nimport {ActionIcon, DefaultProps, Group, Selectors} from '@mantine/core';\nimport {FunctionComponent, PropsWithChildren} from 'react';\n\nimport useStyles from './Collection.styles';\n\ninterface CollectionItemProps extends CollectionItemSharedProps {\n draggable?: boolean;\n disabled: boolean;\n}\n\ninterface CollectionItemSharedProps extends DefaultProps<Selectors<typeof useStyles>> {\n id: string;\n onRemove?: React.MouseEventHandler<HTMLButtonElement>;\n removable?: boolean;\n}\n\nconst RemoveButton: FunctionComponent<{\n onClick: React.MouseEventHandler<HTMLButtonElement>;\n}> = ({onClick}) => (\n <ActionIcon sx={{alignSelf: 'center'}} variant=\"subtle\" onClick={onClick} color=\"action\">\n <RemoveSize16Px height={16} />\n </ActionIcon>\n);\n\nconst RemoveButtonPlaceholder = () => <div style={{width: 28}} />;\n\nconst StaticCollectionItem: FunctionComponent<PropsWithChildren<CollectionItemSharedProps>> = ({\n onRemove,\n removable = true,\n styles,\n children,\n}) => {\n const {classes, cx} = useStyles(null, {name: 'Collection', styles});\n const removeButton = removable && onRemove ? <RemoveButton onClick={onRemove} /> : <RemoveButtonPlaceholder />;\n\n return (\n <Group className={cx(classes.item)}>\n {children}\n {removeButton}\n </Group>\n );\n};\n\nconst DisabledCollectionItem: FunctionComponent<PropsWithChildren<CollectionItemSharedProps>> = ({\n children,\n styles,\n}) => {\n const {classes, cx} = useStyles(null, {name: 'Collection', styles});\n return <Group className={cx(classes.item)}>{children}</Group>;\n};\n\nconst DraggableCollectionItem: FunctionComponent<PropsWithChildren<CollectionItemSharedProps>> = ({\n id,\n onRemove,\n removable = true,\n styles,\n children,\n}) => {\n const {classes, cx} = useStyles(null, {name: 'Collection', styles});\n const removeButton = removable && onRemove ? <RemoveButton onClick={onRemove} /> : null;\n const {attributes, listeners, setNodeRef, transform, transition, isDragging, setActivatorNodeRef} = useSortable({\n id,\n });\n\n return (\n <Group\n ref={setNodeRef}\n className={cx(classes.item, {[classes.itemDragging]: isDragging})}\n sx={\n transform\n ? {\n transform: CSS.Transform.toString(transform),\n transition,\n }\n : undefined\n }\n >\n <div ref={setActivatorNodeRef} {...listeners} {...attributes} className={classes.dragHandle}>\n <DragAndDropSize24Px height={16} />\n </div>\n {children}\n {removeButton}\n </Group>\n );\n};\n\nexport const CollectionItem: FunctionComponent<PropsWithChildren<CollectionItemProps>> = ({\n draggable,\n disabled,\n ...otherProps\n}) => {\n if (disabled) {\n return <DisabledCollectionItem {...otherProps} />;\n }\n if (draggable) {\n return <DraggableCollectionItem {...otherProps} />;\n }\n return <StaticCollectionItem {...otherProps} />;\n};\n"],"names":["CollectionItem","RemoveButton","onClick","ActionIcon","sx","alignSelf","variant","color","RemoveSize16Px","height","RemoveButtonPlaceholder","div","style","width","StaticCollectionItem","onRemove","removable","styles","children","useStyles","name","classes","cx","removeButton","Group","className","item","DisabledCollectionItem","DraggableCollectionItem","id","useSortable","attributes","listeners","setNodeRef","transform","transition","isDragging","setActivatorNodeRef","ref","itemDragging","CSS","Transform","toString","undefined","dragHandle","DragAndDropSize24Px","draggable","disabled","otherProps"],"mappings":";;;;+BAyFaA;;;eAAAA;;;;;;;;;gCAzFqC;wBACxB;yBACR;oBACuC;yEAGnC;AAatB,IAAMC,eAED;QAAEC,gBAAAA;yBACH,qBAACC,gBAAU;QAACC,IAAI;YAACC,WAAW;QAAQ;QAAGC,SAAQ;QAASJ,SAASA;QAASK,OAAM;kBAC5E,cAAA,qBAACC,gCAAc;YAACC,QAAQ;;;;AAIhC,IAAMC,0BAA0B;yBAAM,qBAACC;QAAIC,OAAO;YAACC,OAAO;QAAE;;;AAE5D,IAAMC,uBAAwF,gBAKxF;QAJFC,iBAAAA,mCACAC,WAAAA,0CAAY,IAAI,qBAChBC,eAAAA,QACAC,iBAAAA;IAEA,IAAsBC,aAAAA,IAAAA,yBAAS,EAAC,IAAI,EAAE;QAACC,MAAM;QAAcH,QAAAA;IAAM,IAA1DI,UAAeF,WAAfE,SAASC,KAAM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yBL,WAAeD;gBAAYN,WAAWJ,QAAQuB,UAAU;0BACvF,cAAA,qBAACC,qCAAmB;oBAACpC,QAAQ;;;YAEhCS;YACAK;;;AAGb;AAEO,IAAMvB,iBAA4E,iBAInF;QAHF8C,mBAAAA,WACAC,kBAAAA,UACGC;QAFHF;QACAC;;IAGA,IAAIA,UAAU;QACV,qBAAO,qBAACpB,6CAA2BqB;IACvC,CAAC;IACD,IAAIF,WAAW;QACX,qBAAO,qBAAClB,8CAA4BoB;IACxC,CAAC;IACD,qBAAO,qBAAClC,2CAAyBkC;AACrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FunctionComponent, PropsWithChildren } from 'react';
|
|
2
|
+
interface BlankSlateProps {
|
|
3
|
+
/**
|
|
4
|
+
* Whether the Blankslate render with a border
|
|
5
|
+
*
|
|
6
|
+
* @default true
|
|
7
|
+
*/
|
|
8
|
+
withBorder?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const BlankSlate: FunctionComponent<PropsWithChildren<BlankSlateProps>>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=BlankSlate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlankSlate.d.ts","sourceRoot":"","sources":["../../../../src/components/blank-slate/BlankSlate.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,iBAAiB,EAAE,iBAAiB,EAAC,MAAM,OAAO,CAAC;AAE3D,UAAU,eAAe;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,UAAU,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAI5E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/blank-slate/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Button as MantineButton, ButtonProps as MantineButtonProps } from '@mantine/core';
|
|
2
|
+
import { MouseEventHandler } from 'react';
|
|
3
|
+
import { ButtonWithDisabledTooltipProps } from './ButtonWithDisabledTooltip';
|
|
4
|
+
export interface ButtonProps extends MantineButtonProps, ButtonWithDisabledTooltipProps {
|
|
5
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
6
|
+
}
|
|
7
|
+
export declare const Button: (<C = "button">(props: import("@mantine/utils").PolymorphicComponentProps<C, ButtonProps>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & Omit<import("react").FunctionComponent<(ButtonProps & {
|
|
8
|
+
component?: any;
|
|
9
|
+
} & Omit<Pick<any, string | number | symbol>, "component" | keyof ButtonProps> & {
|
|
10
|
+
ref?: any;
|
|
11
|
+
}) | (ButtonProps & {
|
|
12
|
+
component: import("react").ElementType<any>;
|
|
13
|
+
})>, never> & {
|
|
14
|
+
Group: typeof MantineButton.Group;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,IAAI,aAAa,EAAE,WAAW,IAAI,kBAAkB,EAAC,MAAM,eAAe,CAAC;AACzF,OAAO,EAAyB,iBAAiB,EAAW,MAAM,OAAO,CAAC;AAG1E,OAAO,EAA4B,8BAA8B,EAAC,MAAM,6BAA6B,CAAC;AAEtG,MAAM,WAAW,WAAY,SAAQ,kBAAkB,EAAE,8BAA8B;IAEnF,OAAO,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;CAClD;AA6CD,eAAO,MAAM,MAAM;;;;;;;WAA6D,OAAO,cAAc,KAAK;CAAW,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { TooltipProps } from '@mantine/core';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export interface ButtonWithDisabledTooltipProps {
|
|
4
|
+
/**
|
|
5
|
+
* The tooltip message to display when disabled
|
|
6
|
+
*/
|
|
7
|
+
disabledTooltip?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Whether the button underneath the tooltip is disabled
|
|
10
|
+
*/
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Additional tooltip props to set on the disabled button tooltip
|
|
15
|
+
*/
|
|
16
|
+
disabledTooltipProps?: Omit<TooltipProps, 'disabled' | 'label' | 'children'>;
|
|
17
|
+
/**
|
|
18
|
+
* Sets button width to 100% of parent element
|
|
19
|
+
*/
|
|
20
|
+
fullWidth?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare const ButtonWithDisabledTooltip: (<C = "div">(props: import("@mantine/utils").PolymorphicComponentProps<C, ButtonWithDisabledTooltipProps>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & Omit<import("react").FunctionComponent<(ButtonWithDisabledTooltipProps & {
|
|
23
|
+
component?: any;
|
|
24
|
+
} & Omit<Pick<any, string | number | symbol>, "component" | keyof ButtonWithDisabledTooltipProps> & {
|
|
25
|
+
ref?: any;
|
|
26
|
+
}) | (ButtonWithDisabledTooltipProps & {
|
|
27
|
+
component: import("react").ElementType<any>;
|
|
28
|
+
})>, never> & Record<string, never>;
|
|
29
|
+
//# sourceMappingURL=ButtonWithDisabledTooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonWithDisabledTooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/button/ButtonWithDisabledTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,YAAY,EAAC,MAAM,eAAe,CAAC;AACzD,OAAO,EAAa,SAAS,EAAC,MAAM,OAAO,CAAC;AAI5C,MAAM,WAAW,8BAA8B;IAC3C;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,oBAAoB,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,OAAO,GAAG,UAAU,CAAC,CAAC;IAC7E;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAeD,eAAO,MAAM,yBAAyB;;;;;;mCAErC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/button/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,OAAO,EAAC,KAAK,8BAA8B,EAAC,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { DefaultProps, InputWrapperBaseProps, Selectors } from '@mantine/core';
|
|
2
|
+
import { FunctionComponent } from 'react';
|
|
3
|
+
declare const useStyles: (params: void, options?: import("@mantine/core").UseStylesOptions<string>) => {
|
|
4
|
+
classes: {
|
|
5
|
+
root: string;
|
|
6
|
+
editor: string;
|
|
7
|
+
};
|
|
8
|
+
cx: (...args: any) => string;
|
|
9
|
+
theme: import("@mantine/core").MantineTheme;
|
|
10
|
+
};
|
|
11
|
+
interface CodeEditorProps extends Omit<InputWrapperBaseProps, 'inputContainer' | 'inputWrapperOrder'>, DefaultProps<Selectors<typeof useStyles>> {
|
|
12
|
+
/**
|
|
13
|
+
* The language syntax of the editor
|
|
14
|
+
*
|
|
15
|
+
* @default 'plaintext'
|
|
16
|
+
*/
|
|
17
|
+
language?: 'plaintext' | 'json' | 'markdown' | 'python' | 'xml';
|
|
18
|
+
/** Default value for uncontrolled input */
|
|
19
|
+
defaultValue?: string;
|
|
20
|
+
/** Value for controlled input */
|
|
21
|
+
value?: string;
|
|
22
|
+
/** onChange value for controlled input */
|
|
23
|
+
onChange?(value: string): void;
|
|
24
|
+
/** Called whenever the code editor gets the focus */
|
|
25
|
+
onFocus?(): void;
|
|
26
|
+
/**
|
|
27
|
+
* The minimal height of the CodeEditor (label and description included)
|
|
28
|
+
*
|
|
29
|
+
* By default the CodeEditor is adjusted to fill its parent height.
|
|
30
|
+
* In the case where the parent height is too short, it will use this value as minimum.
|
|
31
|
+
*
|
|
32
|
+
* @default 300
|
|
33
|
+
*/
|
|
34
|
+
minHeight?: number;
|
|
35
|
+
/**
|
|
36
|
+
* The maximal height of the CodeEditor (label and description included)
|
|
37
|
+
*
|
|
38
|
+
* By default the CodeEditor is adjusted to fill its parent height.
|
|
39
|
+
* In the case where the parent height would be too high for your liking, you can use this prop to set a maximum.
|
|
40
|
+
*/
|
|
41
|
+
maxHeight?: number;
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Defines how the monaco editor files will be loaded.
|
|
45
|
+
* Note that using `'local'` requires [some additional configuration](https://github.com/suren-atoyan/monaco-react#use-monaco-editor-as-an-npm-package).
|
|
46
|
+
*
|
|
47
|
+
* @default 'local'
|
|
48
|
+
*/
|
|
49
|
+
monacoLoader?: 'cdn' | 'local';
|
|
50
|
+
}
|
|
51
|
+
export declare const CodeEditor: FunctionComponent<CodeEditorProps>;
|
|
52
|
+
export {};
|
|
53
|
+
//# sourceMappingURL=CodeEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeEditor.d.ts","sourceRoot":"","sources":["../../../../src/components/code-editor/CodeEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIH,YAAY,EAGZ,qBAAqB,EAGrB,SAAS,EAIZ,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAC,iBAAiB,EAAsB,MAAM,OAAO,CAAC;AAM7D,QAAA,MAAM,SAAS;;;;;;;CAQZ,CAAC;AAEJ,UAAU,eACN,SAAQ,IAAI,CAAC,qBAAqB,EAAE,gBAAgB,GAAG,mBAAmB,CAAC,EACvE,YAAY,CAAC,SAAS,CAAC,OAAO,SAAS,CAAC,CAAC;IAC7C;;;;OAIG;IACH,QAAQ,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,UAAU,GAAG,QAAQ,GAAG,KAAK,CAAC;IAChE,2CAA2C;IAC3C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,qDAAqD;IACrD,OAAO,CAAC,IAAI,IAAI,CAAC;IACjB;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;CAClC;AASD,eAAO,MAAM,UAAU,EAAE,iBAAiB,CAAC,eAAe,CAiIzD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/code-editor/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|