@coveord/plasma-mantine 47.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/.eslintrc.js +27 -0
- package/.turbo/turbo-build.log +8 -0
- package/.turbo/turbo-test.log +29 -0
- package/LICENSE +15 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/cjs/__tests__/GlobalSetup.js +17 -0
- package/dist/cjs/__tests__/GlobalSetup.js.map +1 -0
- package/dist/cjs/__tests__/Setup.js +6 -0
- package/dist/cjs/__tests__/Setup.js.map +1 -0
- package/dist/cjs/__tests__/SetupAfterEnv.js +19 -0
- package/dist/cjs/__tests__/SetupAfterEnv.js.map +1 -0
- package/dist/cjs/__tests__/Utils.js +38 -0
- package/dist/cjs/__tests__/Utils.js.map +1 -0
- package/dist/cjs/components/blank-slate/BlankSlate.js +26 -0
- package/dist/cjs/components/blank-slate/BlankSlate.js.map +1 -0
- package/dist/cjs/components/blank-slate/index.js +8 -0
- package/dist/cjs/components/blank-slate/index.js.map +1 -0
- package/dist/cjs/components/code-editor/CodeEditor.example.js +41 -0
- package/dist/cjs/components/code-editor/CodeEditor.example.js.map +1 -0
- package/dist/cjs/components/code-editor/CodeEditor.js +176 -0
- package/dist/cjs/components/code-editor/CodeEditor.js.map +1 -0
- package/dist/cjs/components/code-editor/__mocks__/@monaco-editor/react.js +30 -0
- package/dist/cjs/components/code-editor/__mocks__/@monaco-editor/react.js.map +1 -0
- package/dist/cjs/components/code-editor/index.js +8 -0
- package/dist/cjs/components/code-editor/index.js.map +1 -0
- package/dist/cjs/components/collection/Collection.example.js +64 -0
- package/dist/cjs/components/collection/Collection.example.js.map +1 -0
- package/dist/cjs/components/collection/Collection.js +130 -0
- package/dist/cjs/components/collection/Collection.js.map +1 -0
- package/dist/cjs/components/collection/CollectionItem.js +109 -0
- package/dist/cjs/components/collection/CollectionItem.js.map +1 -0
- package/dist/cjs/components/collection/Colllection.styles.js +24 -0
- package/dist/cjs/components/collection/Colllection.styles.js.map +1 -0
- package/dist/cjs/components/collection/index.js +8 -0
- package/dist/cjs/components/collection/index.js.map +1 -0
- package/dist/cjs/components/date-range-picker/DateRangePickerInlineCalendar.js +102 -0
- package/dist/cjs/components/date-range-picker/DateRangePickerInlineCalendar.js.map +1 -0
- package/dist/cjs/components/date-range-picker/DateRangePickerPopoverCalendar.js +93 -0
- package/dist/cjs/components/date-range-picker/DateRangePickerPopoverCalendar.js.map +1 -0
- package/dist/cjs/components/date-range-picker/DateRangePickerPresetSelect.js +64 -0
- package/dist/cjs/components/date-range-picker/DateRangePickerPresetSelect.js.map +1 -0
- package/dist/cjs/components/date-range-picker/EditableDateRangePicker.js +66 -0
- package/dist/cjs/components/date-range-picker/EditableDateRangePicker.js.map +1 -0
- package/dist/cjs/components/date-range-picker/index.js +9 -0
- package/dist/cjs/components/date-range-picker/index.js.map +1 -0
- package/dist/cjs/components/header/Header.js +78 -0
- package/dist/cjs/components/header/Header.js.map +1 -0
- package/dist/cjs/components/header/index.js +8 -0
- package/dist/cjs/components/header/index.js.map +1 -0
- package/dist/cjs/components/index.js +16 -0
- package/dist/cjs/components/index.js.map +1 -0
- package/dist/cjs/components/inline-confirm/InlineConfirm.js +39 -0
- package/dist/cjs/components/inline-confirm/InlineConfirm.js.map +1 -0
- package/dist/cjs/components/inline-confirm/InlineConfirmButton.js +28 -0
- package/dist/cjs/components/inline-confirm/InlineConfirmButton.js.map +1 -0
- package/dist/cjs/components/inline-confirm/InlineConfirmContext.js +14 -0
- package/dist/cjs/components/inline-confirm/InlineConfirmContext.js.map +1 -0
- package/dist/cjs/components/inline-confirm/InlineConfirmPrompt.js +48 -0
- package/dist/cjs/components/inline-confirm/InlineConfirmPrompt.js.map +1 -0
- package/dist/cjs/components/inline-confirm/index.js +10 -0
- package/dist/cjs/components/inline-confirm/index.js.map +1 -0
- package/dist/cjs/components/inline-confirm/useInlineConfirm.js +21 -0
- package/dist/cjs/components/inline-confirm/useInlineConfirm.js.map +1 -0
- package/dist/cjs/components/modal-wizard/ModalWizard.js +132 -0
- package/dist/cjs/components/modal-wizard/ModalWizard.js.map +1 -0
- package/dist/cjs/components/modal-wizard/ModalWizardStep.js +23 -0
- package/dist/cjs/components/modal-wizard/ModalWizardStep.js.map +1 -0
- package/dist/cjs/components/modal-wizard/index.js +8 -0
- package/dist/cjs/components/modal-wizard/index.js.map +1 -0
- package/dist/cjs/components/sticky-footer/StickyFooter.js +50 -0
- package/dist/cjs/components/sticky-footer/StickyFooter.js.map +1 -0
- package/dist/cjs/components/sticky-footer/index.js +8 -0
- package/dist/cjs/components/sticky-footer/index.js.map +1 -0
- package/dist/cjs/components/table/Table.js +259 -0
- package/dist/cjs/components/table/Table.js.map +1 -0
- package/dist/cjs/components/table/TableActions.js +25 -0
- package/dist/cjs/components/table/TableActions.js.map +1 -0
- package/dist/cjs/components/table/TableCollapsibleColumn.js +33 -0
- package/dist/cjs/components/table/TableCollapsibleColumn.js.map +1 -0
- package/dist/cjs/components/table/TableContext.js +14 -0
- package/dist/cjs/components/table/TableContext.js.map +1 -0
- package/dist/cjs/components/table/TableDateRangePicker.js +84 -0
- package/dist/cjs/components/table/TableDateRangePicker.js.map +1 -0
- package/dist/cjs/components/table/TableFilter.js +53 -0
- package/dist/cjs/components/table/TableFilter.js.map +1 -0
- package/dist/cjs/components/table/TableFooter.js +23 -0
- package/dist/cjs/components/table/TableFooter.js.map +1 -0
- package/dist/cjs/components/table/TableHeader.js +37 -0
- package/dist/cjs/components/table/TableHeader.js.map +1 -0
- package/dist/cjs/components/table/TablePagination.js +47 -0
- package/dist/cjs/components/table/TablePagination.js.map +1 -0
- package/dist/cjs/components/table/TablePerPage.js +52 -0
- package/dist/cjs/components/table/TablePerPage.js.map +1 -0
- package/dist/cjs/components/table/TablePredicate.js +45 -0
- package/dist/cjs/components/table/TablePredicate.js.map +1 -0
- package/dist/cjs/components/table/Th.js +98 -0
- package/dist/cjs/components/table/Th.js.map +1 -0
- package/dist/cjs/components/table/index.js +9 -0
- package/dist/cjs/components/table/index.js.map +1 -0
- package/dist/cjs/components/table/useTable.js +21 -0
- package/dist/cjs/components/table/useTable.js.map +1 -0
- package/dist/cjs/hooks/index.js +9 -0
- package/dist/cjs/hooks/index.js.map +1 -0
- package/dist/cjs/hooks/useControlledList.js +52 -0
- package/dist/cjs/hooks/useControlledList.js.map +1 -0
- package/dist/cjs/hooks/useParentHeight.js +36 -0
- package/dist/cjs/hooks/useParentHeight.js.map +1 -0
- package/dist/cjs/index.js +33 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/theme/PlasmaColors.js +54 -0
- package/dist/cjs/theme/PlasmaColors.js.map +1 -0
- package/dist/cjs/theme/Plasmantine.js +24 -0
- package/dist/cjs/theme/Plasmantine.js.map +1 -0
- package/dist/cjs/theme/Theme.js +223 -0
- package/dist/cjs/theme/Theme.js.map +1 -0
- package/dist/cjs/theme/index.js +8 -0
- package/dist/cjs/theme/index.js.map +1 -0
- package/dist/definitions/__tests__/GlobalSetup.d.ts +3 -0
- package/dist/definitions/__tests__/GlobalSetup.d.ts.map +1 -0
- package/dist/definitions/__tests__/Setup.d.ts +5 -0
- package/dist/definitions/__tests__/Setup.d.ts.map +1 -0
- package/dist/definitions/__tests__/SetupAfterEnv.d.ts +7 -0
- package/dist/definitions/__tests__/SetupAfterEnv.d.ts.map +1 -0
- package/dist/definitions/__tests__/Utils.d.ts +8 -0
- package/dist/definitions/__tests__/Utils.d.ts.map +1 -0
- package/dist/definitions/components/blank-slate/BlankSlate.d.ts +12 -0
- package/dist/definitions/components/blank-slate/BlankSlate.d.ts.map +1 -0
- package/dist/definitions/components/blank-slate/index.d.ts +2 -0
- package/dist/definitions/components/blank-slate/index.d.ts.map +1 -0
- package/dist/definitions/components/code-editor/CodeEditor.d.ts +43 -0
- package/dist/definitions/components/code-editor/CodeEditor.d.ts.map +1 -0
- package/dist/definitions/components/code-editor/CodeEditor.example.d.ts +4 -0
- package/dist/definitions/components/code-editor/CodeEditor.example.d.ts.map +1 -0
- package/dist/definitions/components/code-editor/__mocks__/@monaco-editor/react.d.ts +9 -0
- package/dist/definitions/components/code-editor/__mocks__/@monaco-editor/react.d.ts.map +1 -0
- package/dist/definitions/components/code-editor/index.d.ts +2 -0
- package/dist/definitions/components/code-editor/index.d.ts.map +1 -0
- package/dist/definitions/components/collection/Collection.d.ts +20 -0
- package/dist/definitions/components/collection/Collection.d.ts.map +1 -0
- package/dist/definitions/components/collection/Collection.example.d.ts +4 -0
- package/dist/definitions/components/collection/Collection.example.d.ts.map +1 -0
- package/dist/definitions/components/collection/CollectionItem.d.ts +15 -0
- package/dist/definitions/components/collection/CollectionItem.d.ts.map +1 -0
- package/dist/definitions/components/collection/Colllection.styles.d.ts +9 -0
- package/dist/definitions/components/collection/Colllection.styles.d.ts.map +1 -0
- package/dist/definitions/components/collection/index.d.ts +2 -0
- package/dist/definitions/components/collection/index.d.ts.map +1 -0
- package/dist/definitions/components/date-range-picker/DateRangePickerInlineCalendar.d.ts +37 -0
- package/dist/definitions/components/date-range-picker/DateRangePickerInlineCalendar.d.ts.map +1 -0
- package/dist/definitions/components/date-range-picker/DateRangePickerPopoverCalendar.d.ts +30 -0
- package/dist/definitions/components/date-range-picker/DateRangePickerPopoverCalendar.d.ts.map +1 -0
- package/dist/definitions/components/date-range-picker/DateRangePickerPresetSelect.d.ts +16 -0
- package/dist/definitions/components/date-range-picker/DateRangePickerPresetSelect.d.ts.map +1 -0
- package/dist/definitions/components/date-range-picker/EditableDateRangePicker.d.ts +18 -0
- package/dist/definitions/components/date-range-picker/EditableDateRangePicker.d.ts.map +1 -0
- package/dist/definitions/components/date-range-picker/index.d.ts +3 -0
- package/dist/definitions/components/date-range-picker/index.d.ts.map +1 -0
- package/dist/definitions/components/header/Header.d.ts +12 -0
- package/dist/definitions/components/header/Header.d.ts.map +1 -0
- package/dist/definitions/components/header/index.d.ts +2 -0
- package/dist/definitions/components/header/index.d.ts.map +1 -0
- package/dist/definitions/components/index.d.ts +10 -0
- package/dist/definitions/components/index.d.ts.map +1 -0
- package/dist/definitions/components/inline-confirm/InlineConfirm.d.ts +10 -0
- package/dist/definitions/components/inline-confirm/InlineConfirm.d.ts.map +1 -0
- package/dist/definitions/components/inline-confirm/InlineConfirmButton.d.ts +8 -0
- package/dist/definitions/components/inline-confirm/InlineConfirmButton.d.ts.map +1 -0
- package/dist/definitions/components/inline-confirm/InlineConfirmContext.d.ts +9 -0
- package/dist/definitions/components/inline-confirm/InlineConfirmContext.d.ts.map +1 -0
- package/dist/definitions/components/inline-confirm/InlineConfirmPrompt.d.ts +11 -0
- package/dist/definitions/components/inline-confirm/InlineConfirmPrompt.d.ts.map +1 -0
- package/dist/definitions/components/inline-confirm/index.d.ts +4 -0
- package/dist/definitions/components/inline-confirm/index.d.ts.map +1 -0
- package/dist/definitions/components/inline-confirm/useInlineConfirm.d.ts +6 -0
- package/dist/definitions/components/inline-confirm/useInlineConfirm.d.ts.map +1 -0
- package/dist/definitions/components/modal-wizard/ModalWizard.d.ts +73 -0
- package/dist/definitions/components/modal-wizard/ModalWizard.d.ts.map +1 -0
- package/dist/definitions/components/modal-wizard/ModalWizardStep.d.ts +42 -0
- package/dist/definitions/components/modal-wizard/ModalWizardStep.d.ts.map +1 -0
- package/dist/definitions/components/modal-wizard/index.d.ts +2 -0
- package/dist/definitions/components/modal-wizard/index.d.ts.map +1 -0
- package/dist/definitions/components/sticky-footer/StickyFooter.d.ts +11 -0
- package/dist/definitions/components/sticky-footer/StickyFooter.d.ts.map +1 -0
- package/dist/definitions/components/sticky-footer/index.d.ts +2 -0
- package/dist/definitions/components/sticky-footer/index.d.ts.map +1 -0
- package/dist/definitions/components/table/Table.d.ts +84 -0
- package/dist/definitions/components/table/Table.d.ts.map +1 -0
- package/dist/definitions/components/table/TableActions.d.ts +26 -0
- package/dist/definitions/components/table/TableActions.d.ts.map +1 -0
- package/dist/definitions/components/table/TableCollapsibleColumn.d.ts +6 -0
- package/dist/definitions/components/table/TableCollapsibleColumn.d.ts.map +1 -0
- package/dist/definitions/components/table/TableContext.d.ts +54 -0
- package/dist/definitions/components/table/TableContext.d.ts.map +1 -0
- package/dist/definitions/components/table/TableDateRangePicker.d.ts +20 -0
- package/dist/definitions/components/table/TableDateRangePicker.d.ts.map +1 -0
- package/dist/definitions/components/table/TableFilter.d.ts +12 -0
- package/dist/definitions/components/table/TableFilter.d.ts.map +1 -0
- package/dist/definitions/components/table/TableFooter.d.ts +3 -0
- package/dist/definitions/components/table/TableFooter.d.ts.map +1 -0
- package/dist/definitions/components/table/TableHeader.d.ts +3 -0
- package/dist/definitions/components/table/TableHeader.d.ts.map +1 -0
- package/dist/definitions/components/table/TablePagination.d.ts +10 -0
- package/dist/definitions/components/table/TablePagination.d.ts.map +1 -0
- package/dist/definitions/components/table/TablePerPage.d.ts +20 -0
- package/dist/definitions/components/table/TablePerPage.d.ts.map +1 -0
- package/dist/definitions/components/table/TablePredicate.d.ts +21 -0
- package/dist/definitions/components/table/TablePredicate.d.ts.map +1 -0
- package/dist/definitions/components/table/Th.d.ts +8 -0
- package/dist/definitions/components/table/Th.d.ts.map +1 -0
- package/dist/definitions/components/table/index.d.ts +4 -0
- package/dist/definitions/components/table/index.d.ts.map +1 -0
- package/dist/definitions/components/table/useTable.d.ts +11 -0
- package/dist/definitions/components/table/useTable.d.ts.map +1 -0
- package/dist/definitions/hooks/index.d.ts +3 -0
- package/dist/definitions/hooks/index.d.ts.map +1 -0
- package/dist/definitions/hooks/useControlledList.d.ts +25 -0
- package/dist/definitions/hooks/useControlledList.d.ts.map +1 -0
- package/dist/definitions/hooks/useParentHeight.d.ts +5 -0
- package/dist/definitions/hooks/useParentHeight.d.ts.map +1 -0
- package/dist/definitions/index.d.ts +16 -0
- package/dist/definitions/index.d.ts.map +1 -0
- package/dist/definitions/theme/PlasmaColors.d.ts +14 -0
- package/dist/definitions/theme/PlasmaColors.d.ts.map +1 -0
- package/dist/definitions/theme/Plasmantine.d.ts +3 -0
- package/dist/definitions/theme/Plasmantine.d.ts.map +1 -0
- package/dist/definitions/theme/Theme.d.ts +3 -0
- package/dist/definitions/theme/Theme.d.ts.map +1 -0
- package/dist/definitions/theme/index.d.ts +2 -0
- package/dist/definitions/theme/index.d.ts.map +1 -0
- package/dist/esm/__tests__/GlobalSetup.js +7 -0
- package/dist/esm/__tests__/GlobalSetup.js.map +1 -0
- package/dist/esm/__tests__/Setup.js +5 -0
- package/dist/esm/__tests__/Setup.js.map +1 -0
- package/dist/esm/__tests__/SetupAfterEnv.js +15 -0
- package/dist/esm/__tests__/SetupAfterEnv.js.map +1 -0
- package/dist/esm/__tests__/Utils.js +21 -0
- package/dist/esm/__tests__/Utils.js.map +1 -0
- package/dist/esm/components/blank-slate/BlankSlate.js +16 -0
- package/dist/esm/components/blank-slate/BlankSlate.js.map +1 -0
- package/dist/esm/components/blank-slate/index.js +3 -0
- package/dist/esm/components/blank-slate/index.js.map +1 -0
- package/dist/esm/components/code-editor/CodeEditor.example.js +31 -0
- package/dist/esm/components/code-editor/CodeEditor.example.js.map +1 -0
- package/dist/esm/components/code-editor/CodeEditor.js +165 -0
- package/dist/esm/components/code-editor/CodeEditor.js.map +1 -0
- package/dist/esm/components/code-editor/__mocks__/@monaco-editor/react.js +12 -0
- package/dist/esm/components/code-editor/__mocks__/@monaco-editor/react.js.map +1 -0
- package/dist/esm/components/code-editor/index.js +3 -0
- package/dist/esm/components/code-editor/index.js.map +1 -0
- package/dist/esm/components/collection/Collection.example.js +54 -0
- package/dist/esm/components/collection/Collection.example.js.map +1 -0
- package/dist/esm/components/collection/Collection.js +119 -0
- package/dist/esm/components/collection/Collection.js.map +1 -0
- package/dist/esm/components/collection/CollectionItem.js +98 -0
- package/dist/esm/components/collection/CollectionItem.js.map +1 -0
- package/dist/esm/components/collection/Colllection.styles.js +14 -0
- package/dist/esm/components/collection/Colllection.styles.js.map +1 -0
- package/dist/esm/components/collection/index.js +3 -0
- package/dist/esm/components/collection/index.js.map +1 -0
- package/dist/esm/components/date-range-picker/DateRangePickerInlineCalendar.js +92 -0
- package/dist/esm/components/date-range-picker/DateRangePickerInlineCalendar.js.map +1 -0
- package/dist/esm/components/date-range-picker/DateRangePickerPopoverCalendar.js +83 -0
- package/dist/esm/components/date-range-picker/DateRangePickerPopoverCalendar.js.map +1 -0
- package/dist/esm/components/date-range-picker/DateRangePickerPresetSelect.js +53 -0
- package/dist/esm/components/date-range-picker/DateRangePickerPresetSelect.js.map +1 -0
- package/dist/esm/components/date-range-picker/EditableDateRangePicker.js +56 -0
- package/dist/esm/components/date-range-picker/EditableDateRangePicker.js.map +1 -0
- package/dist/esm/components/date-range-picker/index.js +4 -0
- package/dist/esm/components/date-range-picker/index.js.map +1 -0
- package/dist/esm/components/header/Header.js +68 -0
- package/dist/esm/components/header/Header.js.map +1 -0
- package/dist/esm/components/header/index.js +3 -0
- package/dist/esm/components/header/index.js.map +1 -0
- package/dist/esm/components/index.js +11 -0
- package/dist/esm/components/index.js.map +1 -0
- package/dist/esm/components/inline-confirm/InlineConfirm.js +29 -0
- package/dist/esm/components/inline-confirm/InlineConfirm.js.map +1 -0
- package/dist/esm/components/inline-confirm/InlineConfirmButton.js +18 -0
- package/dist/esm/components/inline-confirm/InlineConfirmButton.js.map +1 -0
- package/dist/esm/components/inline-confirm/InlineConfirmContext.js +4 -0
- package/dist/esm/components/inline-confirm/InlineConfirmContext.js.map +1 -0
- package/dist/esm/components/inline-confirm/InlineConfirmPrompt.js +38 -0
- package/dist/esm/components/inline-confirm/InlineConfirmPrompt.js.map +1 -0
- package/dist/esm/components/inline-confirm/index.js +5 -0
- package/dist/esm/components/inline-confirm/index.js.map +1 -0
- package/dist/esm/components/inline-confirm/useInlineConfirm.js +11 -0
- package/dist/esm/components/inline-confirm/useInlineConfirm.js.map +1 -0
- package/dist/esm/components/modal-wizard/ModalWizard.js +122 -0
- package/dist/esm/components/modal-wizard/ModalWizard.js.map +1 -0
- package/dist/esm/components/modal-wizard/ModalWizardStep.js +14 -0
- package/dist/esm/components/modal-wizard/ModalWizardStep.js.map +1 -0
- package/dist/esm/components/modal-wizard/index.js +3 -0
- package/dist/esm/components/modal-wizard/index.js.map +1 -0
- package/dist/esm/components/sticky-footer/StickyFooter.js +40 -0
- package/dist/esm/components/sticky-footer/StickyFooter.js.map +1 -0
- package/dist/esm/components/sticky-footer/index.js +3 -0
- package/dist/esm/components/sticky-footer/index.js.map +1 -0
- package/dist/esm/components/table/Table.js +248 -0
- package/dist/esm/components/table/Table.js.map +1 -0
- package/dist/esm/components/table/TableActions.js +15 -0
- package/dist/esm/components/table/TableActions.js.map +1 -0
- package/dist/esm/components/table/TableCollapsibleColumn.js +25 -0
- package/dist/esm/components/table/TableCollapsibleColumn.js.map +1 -0
- package/dist/esm/components/table/TableContext.js +4 -0
- package/dist/esm/components/table/TableContext.js.map +1 -0
- package/dist/esm/components/table/TableDateRangePicker.js +73 -0
- package/dist/esm/components/table/TableDateRangePicker.js.map +1 -0
- package/dist/esm/components/table/TableFilter.js +43 -0
- package/dist/esm/components/table/TableFilter.js.map +1 -0
- package/dist/esm/components/table/TableFooter.js +13 -0
- package/dist/esm/components/table/TableFooter.js.map +1 -0
- package/dist/esm/components/table/TableHeader.js +27 -0
- package/dist/esm/components/table/TableHeader.js.map +1 -0
- package/dist/esm/components/table/TablePagination.js +37 -0
- package/dist/esm/components/table/TablePagination.js.map +1 -0
- package/dist/esm/components/table/TablePerPage.js +42 -0
- package/dist/esm/components/table/TablePerPage.js.map +1 -0
- package/dist/esm/components/table/TablePredicate.js +35 -0
- package/dist/esm/components/table/TablePredicate.js.map +1 -0
- package/dist/esm/components/table/Th.js +88 -0
- package/dist/esm/components/table/Th.js.map +1 -0
- package/dist/esm/components/table/index.js +4 -0
- package/dist/esm/components/table/index.js.map +1 -0
- package/dist/esm/components/table/useTable.js +11 -0
- package/dist/esm/components/table/useTable.js.map +1 -0
- package/dist/esm/hooks/index.js +4 -0
- package/dist/esm/hooks/index.js.map +1 -0
- package/dist/esm/hooks/useControlledList.js +44 -0
- package/dist/esm/hooks/useControlledList.js.map +1 -0
- package/dist/esm/hooks/useParentHeight.js +28 -0
- package/dist/esm/hooks/useParentHeight.js.map +1 -0
- package/dist/esm/index.js +10 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/theme/PlasmaColors.js +44 -0
- package/dist/esm/theme/PlasmaColors.js.map +1 -0
- package/dist/esm/theme/Plasmantine.js +14 -0
- package/dist/esm/theme/Plasmantine.js.map +1 -0
- package/dist/esm/theme/Theme.js +213 -0
- package/dist/esm/theme/Theme.js.map +1 -0
- package/dist/esm/theme/index.js +3 -0
- package/dist/esm/theme/index.js.map +1 -0
- package/jest.config.js +26 -0
- package/package.json +85 -0
- package/src/__tests__/GlobalSetup.ts +5 -0
- package/src/__tests__/Setup.ts +4 -0
- package/src/__tests__/SetupAfterEnv.ts +16 -0
- package/src/__tests__/Utils.tsx +15 -0
- package/src/components/blank-slate/BlankSlate.tsx +17 -0
- package/src/components/blank-slate/__tests__/BlankSlate.spec.tsx +11 -0
- package/src/components/blank-slate/index.ts +1 -0
- package/src/components/code-editor/CodeEditor.example.tsx +32 -0
- package/src/components/code-editor/CodeEditor.tsx +187 -0
- package/src/components/code-editor/__mocks__/@monaco-editor/react.tsx +10 -0
- package/src/components/code-editor/__tests__/CodeEditor.spec.tsx +37 -0
- package/src/components/code-editor/index.ts +1 -0
- package/src/components/collection/Collection.example.tsx +37 -0
- package/src/components/collection/Collection.tsx +128 -0
- package/src/components/collection/CollectionItem.tsx +88 -0
- package/src/components/collection/Colllection.styles.ts +13 -0
- package/src/components/collection/__tests__/Collection.spec.tsx +243 -0
- package/src/components/collection/index.ts +1 -0
- package/src/components/date-range-picker/DateRangePickerInlineCalendar.tsx +111 -0
- package/src/components/date-range-picker/DateRangePickerPopoverCalendar.tsx +94 -0
- package/src/components/date-range-picker/DateRangePickerPresetSelect.tsx +62 -0
- package/src/components/date-range-picker/EditableDateRangePicker.tsx +59 -0
- package/src/components/date-range-picker/__tests__/DateRangePickerInlineCalendar.spec.tsx +91 -0
- package/src/components/date-range-picker/__tests__/DateRangePickerPopoverCalendar.spec.tsx +101 -0
- package/src/components/date-range-picker/__tests__/DateRangePickerPresetSelect.spec.tsx +53 -0
- package/src/components/date-range-picker/__tests__/EditableDateRangePicker.spec.tsx +47 -0
- package/src/components/date-range-picker/index.tsx +2 -0
- package/src/components/header/Header.tsx +43 -0
- package/src/components/header/__tests__/Header.spec.tsx +79 -0
- package/src/components/header/index.ts +1 -0
- package/src/components/index.ts +9 -0
- package/src/components/inline-confirm/InlineConfirm.tsx +29 -0
- package/src/components/inline-confirm/InlineConfirmButton.tsx +17 -0
- package/src/components/inline-confirm/InlineConfirmContext.ts +9 -0
- package/src/components/inline-confirm/InlineConfirmPrompt.tsx +48 -0
- package/src/components/inline-confirm/__tests__/InlineConfirm.spec.tsx +94 -0
- package/src/components/inline-confirm/index.ts +3 -0
- package/src/components/inline-confirm/useInlineConfirm.ts +12 -0
- package/src/components/modal-wizard/ModalWizard.tsx +211 -0
- package/src/components/modal-wizard/ModalWizardStep.tsx +53 -0
- package/src/components/modal-wizard/__tests__/ModalWizard.spec.tsx +345 -0
- package/src/components/modal-wizard/index.ts +1 -0
- package/src/components/sticky-footer/StickyFooter.tsx +31 -0
- package/src/components/sticky-footer/__tests__/StickyFooter.spec.tsx +20 -0
- package/src/components/sticky-footer/index.ts +1 -0
- package/src/components/table/Table.tsx +293 -0
- package/src/components/table/TableActions.tsx +36 -0
- package/src/components/table/TableCollapsibleColumn.tsx +26 -0
- package/src/components/table/TableContext.tsx +56 -0
- package/src/components/table/TableDateRangePicker.tsx +71 -0
- package/src/components/table/TableFilter.tsx +44 -0
- package/src/components/table/TableFooter.tsx +8 -0
- package/src/components/table/TableHeader.tsx +21 -0
- package/src/components/table/TablePagination.tsx +41 -0
- package/src/components/table/TablePerPage.tsx +49 -0
- package/src/components/table/TablePredicate.tsx +43 -0
- package/src/components/table/Th.tsx +75 -0
- package/src/components/table/__tests__/Table.spec.tsx +128 -0
- package/src/components/table/__tests__/TableActions.spec.tsx +36 -0
- package/src/components/table/__tests__/TableDateRangePicker.spec.tsx +87 -0
- package/src/components/table/__tests__/TableFilter.spec.tsx +39 -0
- package/src/components/table/__tests__/TablePagination.spec.tsx +50 -0
- package/src/components/table/__tests__/TablePerPage.spec.tsx +81 -0
- package/src/components/table/__tests__/TablePredicate.spec.tsx +120 -0
- package/src/components/table/__tests__/Th.spec.tsx +63 -0
- package/src/components/table/index.ts +3 -0
- package/src/components/table/useTable.tsx +11 -0
- package/src/hooks/__tests__/useControlledList.spec.tsx +41 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useControlledList.ts +53 -0
- package/src/hooks/useParentHeight.ts +25 -0
- package/src/index.ts +23 -0
- package/src/theme/PlasmaColors.ts +44 -0
- package/src/theme/Plasmantine.tsx +10 -0
- package/src/theme/Theme.tsx +161 -0
- package/src/theme/index.ts +1 -0
- package/tsconfig.build.json +4 -0
- package/tsconfig.json +11 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
interface UseControlledList<T> {
|
|
2
|
+
/** Initial value for uncontrolled state */
|
|
3
|
+
defaultValue?: T[];
|
|
4
|
+
/** Value for controlled state */
|
|
5
|
+
value?: T[];
|
|
6
|
+
/** Controlled state onChange handler */
|
|
7
|
+
onChange?: (values: T[]) => void;
|
|
8
|
+
}
|
|
9
|
+
interface ListHandlers<T> {
|
|
10
|
+
/** Appends the item at the end of the list */
|
|
11
|
+
append: (item: T) => void;
|
|
12
|
+
/** Removes the item at the index from the list */
|
|
13
|
+
remove: (index: number) => void;
|
|
14
|
+
/** Moves the item at the "from" position to another position within the list */
|
|
15
|
+
reorder: ({ from, to }: {
|
|
16
|
+
from: number;
|
|
17
|
+
to: number;
|
|
18
|
+
}) => void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Manage a list of items in a controlled fashion, to be used with inputs
|
|
22
|
+
*/
|
|
23
|
+
export declare const useControlledList: <T>({ defaultValue, value, onChange }: UseControlledList<T>) => [T[], ListHandlers<T>];
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=useControlledList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useControlledList.d.ts","sourceRoot":"","sources":["../../../src/hooks/useControlledList.ts"],"names":[],"mappings":"AAEA,UAAU,iBAAiB,CAAC,CAAC;IACzB,2CAA2C;IAC3C,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC;IACnB,iCAAiC;IACjC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;IACZ,wCAAwC;IACxC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;CACpC;AAED,UAAU,YAAY,CAAC,CAAC;IACpB,8CAA8C;IAC9C,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;IAC1B,kDAAkD;IAClD,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,iFAAiF;IACjF,OAAO,EAAE,CAAC,EAAC,IAAI,EAAE,EAAE,EAAC,EAAE;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAC,KAAK,IAAI,CAAC;CAC7D;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,wFA6B7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useParentHeight.d.ts","sourceRoot":"","sources":["../../../src/hooks/useParentHeight.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,eAAO,MAAM,eAAe,QAAO,CAAC,MAAM,EAAE,MAAM,gBAAgB,CAAC,cAAc,CAAC,CAWjF,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Tuple } from '@mantine/core';
|
|
2
|
+
import { PlasmaColors } from './theme/PlasmaColors';
|
|
3
|
+
export { ColumnDef, createColumnHelper } from '@tanstack/table-core';
|
|
4
|
+
export * from '@mantine/core';
|
|
5
|
+
export * from '@mantine/form';
|
|
6
|
+
export type { FormValidateInput } from '@mantine/form/lib/types';
|
|
7
|
+
export * from '@mantine/hooks';
|
|
8
|
+
export * from './components';
|
|
9
|
+
export * from './theme';
|
|
10
|
+
export { Header, Table } from './components';
|
|
11
|
+
declare module '@mantine/core' {
|
|
12
|
+
interface MantineThemeColorsOverride {
|
|
13
|
+
colors: Record<keyof typeof PlasmaColors | (string & {}), Tuple<string, 10>>;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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,OAAO,EAAC,SAAS,EAAE,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAEnE,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,YAAY,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAC/D,cAAc,gBAAgB,CAAC;AAE/B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAC,MAAM,EAAE,KAAK,EAAC,MAAM,cAAc,CAAC;AAE3C,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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const PlasmaColors: {
|
|
2
|
+
gray: [string, string, string, string, string, string, string, string, string, string];
|
|
3
|
+
action: [string, string, string, string, string, string, string, string, string, string];
|
|
4
|
+
navy: [string, string, string, string, string, string, string, string, string, string];
|
|
5
|
+
blue: [string, string, string, string, string, string, string, string, string, string];
|
|
6
|
+
red: [string, string, string, string, string, string, string, string, string, string];
|
|
7
|
+
teal: [string, string, string, string, string, string, string, string, string, string];
|
|
8
|
+
yellow: [string, string, string, string, string, string, string, string, string, string];
|
|
9
|
+
green: [string, string, string, string, string, string, string, string, string, string];
|
|
10
|
+
indigo: [string, string, string, string, string, string, string, string, string, string];
|
|
11
|
+
lime: [string, string, string, string, string, string, string, string, string, string];
|
|
12
|
+
purple: [string, string, string, string, string, string, string, string, string, string];
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=PlasmaColors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlasmaColors.d.ts","sourceRoot":"","sources":["../../../src/theme/PlasmaColors.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY;;;;;;;;;;;;CAqCxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Plasmantine.d.ts","sourceRoot":"","sources":["../../../src/theme/Plasmantine.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,iBAAiB,EAAC,MAAM,OAAO,CAAC;AAIxC,eAAO,MAAM,WAAW,EAAE,iBAIzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Theme.d.ts","sourceRoot":"","sources":["../../../src/theme/Theme.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAqB,oBAAoB,EAAoB,MAAM,eAAe,CAAC;AAI1F,eAAO,MAAM,WAAW,EAAE,oBA0JzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/__tests__/GlobalSetup.ts"],"sourcesContent":["// This file is executed once, before everything else.\nexport default () => {\n // @ts-ignore\n process.env.TZ = 'UTC';\n};\n"],"names":["process","env","TZ"],"mappings":"AAAA,sDAAsD;AACtD,eAAe,WAAM;IACjB,aAAa;IACbA,OAAO,CAACC,GAAG,CAACC,EAAE,GAAG,KAAK,CAAC;AAC3B,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/__tests__/Setup.ts"],"sourcesContent":["/**\n * This file is executed once per test file.\n * It is executed before executing SetupAfterEnv and before the test code itself.\n */\n"],"names":[],"mappings":"AAAA;;;CAGC,GAHD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is executed once per test file.
|
|
3
|
+
* It is executed after executing Setup and Jest is initialised, but before the test code itself.
|
|
4
|
+
*/ import "@testing-library/jest-dom";
|
|
5
|
+
import "@testing-library/jest-dom/extend-expect";
|
|
6
|
+
Element.prototype.scrollTo = jest.fn();
|
|
7
|
+
window.ResizeObserver = window.ResizeObserver || jest.fn().mockImplementation(function() {
|
|
8
|
+
return {
|
|
9
|
+
disconnect: jest.fn(),
|
|
10
|
+
observe: jest.fn(),
|
|
11
|
+
unobserve: jest.fn()
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=SetupAfterEnv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/__tests__/SetupAfterEnv.ts"],"sourcesContent":["/**\n * This file is executed once per test file.\n * It is executed after executing Setup and Jest is initialised, but before the test code itself.\n */\n\nimport '@testing-library/jest-dom';\nimport '@testing-library/jest-dom/extend-expect';\n\nElement.prototype.scrollTo = jest.fn();\nwindow.ResizeObserver =\n window.ResizeObserver ||\n jest.fn().mockImplementation(() => ({\n disconnect: jest.fn(),\n observe: jest.fn(),\n unobserve: jest.fn(),\n }));\n"],"names":["Element","prototype","scrollTo","jest","fn","window","ResizeObserver","mockImplementation","disconnect","observe","unobserve"],"mappings":"AAAA;;;CAGC,GAED,OAAO,2BAA2B,CAAC;AACnC,OAAO,yCAAyC,CAAC;AAEjDA,OAAO,CAACC,SAAS,CAACC,QAAQ,GAAGC,IAAI,CAACC,EAAE,EAAE,CAAC;AACvCC,MAAM,CAACC,cAAc,GACjBD,MAAM,CAACC,cAAc,IACrBH,IAAI,CAACC,EAAE,EAAE,CAACG,kBAAkB,CAAC;WAAO;QAChCC,UAAU,EAAEL,IAAI,CAACC,EAAE,EAAE;QACrBK,OAAO,EAAEN,IAAI,CAACC,EAAE,EAAE;QAClBM,SAAS,EAAEP,IAAI,CAACC,EAAE,EAAE;KACvB;CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import _object_spread from "@swc/helpers/src/_object_spread.mjs";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { render } from "@testing-library/react";
|
|
4
|
+
import userEvent from "@testing-library/user-event";
|
|
5
|
+
import { Plasmantine } from "../theme";
|
|
6
|
+
var customRender = function(ui, options) {
|
|
7
|
+
var TestWrapper = function(param) {
|
|
8
|
+
var children = param.children;
|
|
9
|
+
return /*#__PURE__*/ _jsx(Plasmantine, {
|
|
10
|
+
children: children
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
return render(ui, _object_spread({
|
|
14
|
+
wrapper: TestWrapper
|
|
15
|
+
}, options));
|
|
16
|
+
};
|
|
17
|
+
export { userEvent };
|
|
18
|
+
export * from "@testing-library/react";
|
|
19
|
+
export { customRender as render };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=Utils.js.map
|
|
@@ -0,0 +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, ReactElement} from 'react';\n\nimport {Plasmantine} from '../theme';\n\nconst customRender = (ui: ReactElement, options?: Omit<RenderOptions, 'queries'>): RenderResult => {\n const TestWrapper: FunctionComponent = ({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;;AAAA,SAAQA,MAAM,QAAoC,wBAAwB,CAAC;AAC3E,OAAOC,SAAS,MAAM,6BAA6B,CAAC;AAGpD,SAAQC,WAAW,QAAO,UAAU,CAAC;AAErC,IAAMC,YAAY,GAAG,SAACC,EAAgB,EAAEC,OAAwC,EAAmB;IAC/F,IAAMC,WAAW,GAAsB;YAAEC,QAAQ,SAARA,QAAQ;6BAAM,KAACL,WAAW;sBAAEK,QAAQ;UAAe;KAAA,AAAC;IAE7F,OAAOP,MAAM,CAACI,EAAE,EAAE;QAACI,OAAO,EAAEF,WAAW;OAAKD,OAAO,CAAC,CAAC,CAAC;AAC1D,CAAC,AAAC;AAEF,SAAQJ,SAAS,GAAE;AACnB,cAAc,wBAAwB,CAAC;AACvC,SAAQE,YAAY,IAAIH,MAAM,GAAE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Paper, Stack } from "@mantine/core";
|
|
3
|
+
export var BlankSlate = function(param) {
|
|
4
|
+
var children = param.children, _withBorder = param.withBorder, withBorder = _withBorder === void 0 ? true : _withBorder;
|
|
5
|
+
return /*#__PURE__*/ _jsx(Paper, {
|
|
6
|
+
shadow: withBorder && "xs",
|
|
7
|
+
p: "xl",
|
|
8
|
+
withBorder: withBorder,
|
|
9
|
+
children: /*#__PURE__*/ _jsx(Stack, {
|
|
10
|
+
align: "center",
|
|
11
|
+
children: children
|
|
12
|
+
})
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=BlankSlate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/blank-slate/BlankSlate.tsx"],"sourcesContent":["import {Paper, Stack} from '@mantine/core';\nimport {FunctionComponent} 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<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;AAAA,SAAQA,KAAK,EAAEC,KAAK,QAAO,eAAe,CAAC;AAY3C,OAAO,IAAMC,UAAU,GAAuC;QAAEC,QAAQ,SAARA,QAAQ,sBAAEC,UAAU,EAAVA,UAAU,4BAAG,IAAI,cAAA;yBACvF,KAACJ,KAAK;QAACK,MAAM,EAAED,UAAU,IAAI,IAAI;QAAEE,CAAC,EAAC,IAAI;QAACF,UAAU,EAAEA,UAAU;kBAC5D,cAAA,KAACH,KAAK;YAACM,KAAK,EAAC,QAAQ;sBAAEJ,QAAQ;UAAS;MACpC;CACX,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/blank-slate/index.ts"],"sourcesContent":["export * from './BlankSlate';\n"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import _object_spread from "@swc/helpers/src/_object_spread.mjs";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useForm } from "@mantine/form";
|
|
4
|
+
import { CodeEditor } from "./CodeEditor";
|
|
5
|
+
export default function() {
|
|
6
|
+
var form = useForm({
|
|
7
|
+
initialValues: {
|
|
8
|
+
config: '{"key":"value"}'
|
|
9
|
+
},
|
|
10
|
+
validate: {
|
|
11
|
+
config: function(jsonValue) {
|
|
12
|
+
try {
|
|
13
|
+
var config = JSON.parse(jsonValue);
|
|
14
|
+
if (!config.key) {
|
|
15
|
+
return "The key must have a value";
|
|
16
|
+
}
|
|
17
|
+
} catch (e) {
|
|
18
|
+
return "Invalid JSON";
|
|
19
|
+
}
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
return /*#__PURE__*/ _jsx(CodeEditor, _object_spread({
|
|
25
|
+
language: "json",
|
|
26
|
+
label: "Configuration",
|
|
27
|
+
description: "This JSON configuration is very important"
|
|
28
|
+
}, form.getInputProps("config")));
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=CodeEditor.example.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/code-editor/CodeEditor.example.tsx"],"sourcesContent":["import {useForm} from '@mantine/form';\nimport {CodeEditor} from './CodeEditor';\n\nexport default () => {\n const form = useForm({\n initialValues: {\n config: '{\"key\":\"value\"}',\n },\n validate: {\n config: (jsonValue) => {\n try {\n const config = JSON.parse(jsonValue);\n if (!config.key) {\n return 'The key must have a value';\n }\n } catch {\n return 'Invalid JSON';\n }\n return null;\n },\n },\n });\n\n return (\n <CodeEditor\n language=\"json\"\n label=\"Configuration\"\n description=\"This JSON configuration is very important\"\n {...form.getInputProps('config')}\n />\n );\n};\n"],"names":["useForm","CodeEditor","form","initialValues","config","validate","jsonValue","JSON","parse","key","language","label","description","getInputProps"],"mappings":"AAAA;;AAAA,SAAQA,OAAO,QAAO,eAAe,CAAC;AACtC,SAAQC,UAAU,QAAO,cAAc,CAAC;AAExC,eAAe,WAAM;IACjB,IAAMC,IAAI,GAAGF,OAAO,CAAC;QACjBG,aAAa,EAAE;YACXC,MAAM,EAAE,iBAAiB;SAC5B;QACDC,QAAQ,EAAE;YACND,MAAM,EAAE,SAACE,SAAS,EAAK;gBACnB,IAAI;oBACA,IAAMF,MAAM,GAAGG,IAAI,CAACC,KAAK,CAACF,SAAS,CAAC,AAAC;oBACrC,IAAI,CAACF,MAAM,CAACK,GAAG,EAAE;wBACb,OAAO,2BAA2B,CAAC;oBACvC,CAAC;gBACL,EAAE,UAAM;oBACJ,OAAO,cAAc,CAAC;gBAC1B,CAAC;gBACD,OAAO,IAAI,CAAC;YAChB,CAAC;SACJ;KACJ,CAAC,AAAC;IAEH,qBACI,KAACR,UAAU;QACPS,QAAQ,EAAC,MAAM;QACfC,KAAK,EAAC,eAAe;QACrBC,WAAW,EAAC,2CAA2C;OACnDV,IAAI,CAACW,aAAa,CAAC,QAAQ,CAAC,EAClC,CACJ;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
|
|
2
|
+
import _object_spread from "@swc/helpers/src/_object_spread.mjs";
|
|
3
|
+
import _object_spread_props from "@swc/helpers/src/_object_spread_props.mjs";
|
|
4
|
+
import _object_without_properties from "@swc/helpers/src/_object_without_properties.mjs";
|
|
5
|
+
import _sliced_to_array from "@swc/helpers/src/_sliced_to_array.mjs";
|
|
6
|
+
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { CheckSize16Px, CopySize16Px } from "@coveord/plasma-react-icons";
|
|
9
|
+
import { ActionIcon, Box, CopyButton, createStyles, Group, Input, Stack, Tooltip, useComponentDefaultProps } from "@mantine/core";
|
|
10
|
+
import { useUncontrolled } from "@mantine/hooks";
|
|
11
|
+
import Editor, { loader } from "@monaco-editor/react";
|
|
12
|
+
import * as monaco from "monaco-editor";
|
|
13
|
+
import { useParentHeight } from "../../hooks";
|
|
14
|
+
loader.config({
|
|
15
|
+
monaco: monaco
|
|
16
|
+
});
|
|
17
|
+
var useStyles = createStyles(function(theme) {
|
|
18
|
+
return {
|
|
19
|
+
root: {},
|
|
20
|
+
editor: {
|
|
21
|
+
border: "1px solid ".concat(theme.colors.gray[2]),
|
|
22
|
+
borderRadius: theme.defaultRadius,
|
|
23
|
+
backgroundColor: theme.colorScheme === "light" ? theme.white : theme.black,
|
|
24
|
+
height: "100%"
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
var defaultProps = {
|
|
29
|
+
language: "plaintext",
|
|
30
|
+
defaultValue: "",
|
|
31
|
+
minHeight: 300
|
|
32
|
+
};
|
|
33
|
+
export var CodeEditor = function(props) {
|
|
34
|
+
var _ref = useComponentDefaultProps("CodeEditor", defaultProps, props), language = _ref.language, defaultValue = _ref.defaultValue, onChange = _ref.onChange, onFocus = _ref.onFocus, value = _ref.value, label = _ref.label, required = _ref.required, labelProps = _ref.labelProps, error = _ref.error, errorProps = _ref.errorProps, description = _ref.description, descriptionProps = _ref.descriptionProps, minHeight = _ref.minHeight, maxHeight = _ref.maxHeight, disabled = _ref.disabled, others = _object_without_properties(_ref, [
|
|
35
|
+
"language",
|
|
36
|
+
"defaultValue",
|
|
37
|
+
"onChange",
|
|
38
|
+
"onFocus",
|
|
39
|
+
"value",
|
|
40
|
+
"label",
|
|
41
|
+
"required",
|
|
42
|
+
"labelProps",
|
|
43
|
+
"error",
|
|
44
|
+
"errorProps",
|
|
45
|
+
"description",
|
|
46
|
+
"descriptionProps",
|
|
47
|
+
"minHeight",
|
|
48
|
+
"maxHeight",
|
|
49
|
+
"disabled"
|
|
50
|
+
]);
|
|
51
|
+
var ref = useStyles(), classes = ref.classes, theme = ref.theme;
|
|
52
|
+
var ref1 = _sliced_to_array(useUncontrolled({
|
|
53
|
+
value: value,
|
|
54
|
+
defaultValue: defaultValue,
|
|
55
|
+
onChange: onChange,
|
|
56
|
+
finalValue: ""
|
|
57
|
+
}), 2), _value = ref1[0], handleChange = ref1[1];
|
|
58
|
+
var ref2 = _sliced_to_array(useParentHeight(), 2), parentHeight = ref2[0], ref3 = ref2[1];
|
|
59
|
+
var _label = label ? /*#__PURE__*/ _jsx(Input.Label, _object_spread_props(_object_spread({
|
|
60
|
+
required: required
|
|
61
|
+
}, labelProps), {
|
|
62
|
+
children: label
|
|
63
|
+
})) : null;
|
|
64
|
+
var _description = description ? /*#__PURE__*/ _jsx(Input.Description, _object_spread_props(_object_spread({
|
|
65
|
+
mt: "xs"
|
|
66
|
+
}, descriptionProps), {
|
|
67
|
+
children: description
|
|
68
|
+
})) : null;
|
|
69
|
+
var _error = error ? /*#__PURE__*/ _jsx(Input.Error, _object_spread_props(_object_spread({
|
|
70
|
+
mt: "xs"
|
|
71
|
+
}, errorProps), {
|
|
72
|
+
children: error
|
|
73
|
+
})) : null;
|
|
74
|
+
var _header = _label || _description ? /*#__PURE__*/ _jsxs(Box, {
|
|
75
|
+
children: [
|
|
76
|
+
_label,
|
|
77
|
+
_description
|
|
78
|
+
]
|
|
79
|
+
}) : null;
|
|
80
|
+
var _copyButton = /*#__PURE__*/ _jsx(Group, {
|
|
81
|
+
position: "right",
|
|
82
|
+
children: /*#__PURE__*/ _jsx(CopyButton, {
|
|
83
|
+
value: _value,
|
|
84
|
+
timeout: 2000,
|
|
85
|
+
children: function(param) {
|
|
86
|
+
var copied = param.copied, copy = param.copy;
|
|
87
|
+
return /*#__PURE__*/ _jsx(Tooltip, {
|
|
88
|
+
label: copied ? "Copied" : "Copy",
|
|
89
|
+
withArrow: true,
|
|
90
|
+
position: "right",
|
|
91
|
+
children: /*#__PURE__*/ _jsx(ActionIcon, {
|
|
92
|
+
color: copied ? "lime" : "gray",
|
|
93
|
+
onClick: copy,
|
|
94
|
+
children: copied ? /*#__PURE__*/ _jsx(CheckSize16Px, {
|
|
95
|
+
height: 16
|
|
96
|
+
}) : /*#__PURE__*/ _jsx(CopySize16Px, {
|
|
97
|
+
height: 16
|
|
98
|
+
})
|
|
99
|
+
})
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
})
|
|
103
|
+
});
|
|
104
|
+
var _editor = /*#__PURE__*/ _jsx(Box, {
|
|
105
|
+
p: "md",
|
|
106
|
+
pl: "xs",
|
|
107
|
+
className: classes.editor,
|
|
108
|
+
children: /*#__PURE__*/ _jsx(Editor, {
|
|
109
|
+
defaultLanguage: language,
|
|
110
|
+
theme: theme.colorScheme === "light" ? "light" : "vs-dark",
|
|
111
|
+
options: {
|
|
112
|
+
minimap: {
|
|
113
|
+
enabled: false
|
|
114
|
+
},
|
|
115
|
+
wordWrap: "on",
|
|
116
|
+
wrappingStrategy: "advanced",
|
|
117
|
+
scrollBeyondLastLine: false,
|
|
118
|
+
formatOnPaste: true,
|
|
119
|
+
fontSize: theme.fontSizes.xs,
|
|
120
|
+
readOnly: disabled,
|
|
121
|
+
tabSize: 2
|
|
122
|
+
},
|
|
123
|
+
value: _value,
|
|
124
|
+
onChange: handleChange,
|
|
125
|
+
onMount: function(editor) {
|
|
126
|
+
editor.onDidFocusEditorText(onFocus);
|
|
127
|
+
editor.onDidBlurEditorText(/*#__PURE__*/ _async_to_generator(function() {
|
|
128
|
+
return _ts_generator(this, function(_state) {
|
|
129
|
+
switch(_state.label){
|
|
130
|
+
case 0:
|
|
131
|
+
return [
|
|
132
|
+
4,
|
|
133
|
+
editor.getAction("editor.action.formatDocument").run()
|
|
134
|
+
];
|
|
135
|
+
case 1:
|
|
136
|
+
_state.sent();
|
|
137
|
+
return [
|
|
138
|
+
2
|
|
139
|
+
];
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
}));
|
|
143
|
+
}
|
|
144
|
+
})
|
|
145
|
+
});
|
|
146
|
+
return /*#__PURE__*/ _jsxs(Stack, _object_spread_props(_object_spread({
|
|
147
|
+
justify: "flex-start",
|
|
148
|
+
className: classes.root,
|
|
149
|
+
spacing: 0,
|
|
150
|
+
sx: {
|
|
151
|
+
height: Math.max(parentHeight, minHeight),
|
|
152
|
+
maxHeight: maxHeight
|
|
153
|
+
},
|
|
154
|
+
ref: ref3
|
|
155
|
+
}, others), {
|
|
156
|
+
children: [
|
|
157
|
+
_header,
|
|
158
|
+
_copyButton,
|
|
159
|
+
_editor,
|
|
160
|
+
_error
|
|
161
|
+
]
|
|
162
|
+
}));
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
//# sourceMappingURL=CodeEditor.js.map
|
|
@@ -0,0 +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 CopyButton,\n createStyles,\n DefaultProps,\n Group,\n Input,\n InputWrapperBaseProps,\n Selectors,\n Stack,\n Tooltip,\n useComponentDefaultProps,\n} from '@mantine/core';\nimport {useUncontrolled} from '@mantine/hooks';\nimport Editor, {loader} from '@monaco-editor/react';\nimport * as monaco from 'monaco-editor';\nimport {FunctionComponent} from 'react';\n\nimport {useParentHeight} from '../../hooks';\n\nloader.config({monaco});\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';\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\nconst defaultProps: Partial<CodeEditorProps> = {\n language: 'plaintext',\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 ...others\n } = useComponentDefaultProps('CodeEditor', defaultProps, props);\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 _label = label ? (\n <Input.Label required={required} {...labelProps}>\n {label}\n </Input.Label>\n ) : null;\n\n const _description = description ? (\n <Input.Description mt=\"xs\" {...descriptionProps}>\n {description}\n </Input.Description>\n ) : null;\n\n const _error = error ? (\n <Input.Error mt=\"xs\" {...errorProps}>\n {error}\n </Input.Error>\n ) : null;\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 = (\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) => {\n editor.onDidFocusEditorText(onFocus);\n editor.onDidBlurEditorText(async () => {\n await editor.getAction('editor.action.formatDocument').run();\n });\n }}\n />\n </Box>\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","CopyButton","createStyles","Group","Input","Stack","Tooltip","useComponentDefaultProps","useUncontrolled","Editor","loader","monaco","useParentHeight","config","useStyles","theme","root","editor","border","colors","gray","borderRadius","defaultRadius","backgroundColor","colorScheme","white","black","height","defaultProps","language","defaultValue","minHeight","CodeEditor","props","onChange","onFocus","value","label","required","labelProps","error","errorProps","description","descriptionProps","maxHeight","disabled","others","classes","finalValue","_value","handleChange","parentHeight","ref","_label","Label","_description","Description","mt","_error","Error","_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":"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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
var MockedEditor = function(props) {
|
|
3
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
4
|
+
"data-testid": "monaco-editor"
|
|
5
|
+
});
|
|
6
|
+
};
|
|
7
|
+
export default MockedEditor;
|
|
8
|
+
export var loader = {
|
|
9
|
+
config: jest.fn()
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=react.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/components/code-editor/__mocks__/@monaco-editor/react.tsx"],"sourcesContent":["import {type EditorProps} from '@monaco-editor/react';\nimport {FunctionComponent} from 'react';\n\nconst MockedEditor: FunctionComponent<EditorProps> = (props) => <div data-testid=\"monaco-editor\" />;\n\nexport default MockedEditor;\n\nexport const loader = {\n config: jest.fn(),\n};\n"],"names":["MockedEditor","props","div","data-testid","loader","config","jest","fn"],"mappings":"AAAA;AAGA,IAAMA,YAAY,GAAmC,SAACC,KAAK;yBAAK,KAACC,KAAG;QAACC,aAAW,EAAC,eAAe;MAAG;CAAA,AAAC;AAEpG,eAAeH,YAAY,CAAC;AAE5B,OAAO,IAAMI,MAAM,GAAG;IAClBC,MAAM,EAAEC,IAAI,CAACC,EAAE,EAAE;CACpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/code-editor/index.ts"],"sourcesContent":["export * from './CodeEditor';\n"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import _object_spread from "@swc/helpers/src/_object_spread.mjs";
|
|
2
|
+
import _object_spread_props from "@swc/helpers/src/_object_spread_props.mjs";
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
4
|
+
import { Checkbox, TextInput } from "@mantine/core";
|
|
5
|
+
import { useForm } from "@mantine/form";
|
|
6
|
+
import { Collection } from "./Collection";
|
|
7
|
+
export default function() {
|
|
8
|
+
var form = useForm({
|
|
9
|
+
initialValues: {
|
|
10
|
+
todoList: [
|
|
11
|
+
{
|
|
12
|
+
name: "wash the dishes",
|
|
13
|
+
done: true
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: "take out the trash",
|
|
17
|
+
done: false
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "vacuum the floors",
|
|
21
|
+
done: true
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
return /*#__PURE__*/ _jsx(Collection, _object_spread_props(_object_spread({
|
|
27
|
+
draggable: true,
|
|
28
|
+
addLabel: "Add task",
|
|
29
|
+
newItem: {
|
|
30
|
+
name: "",
|
|
31
|
+
done: false
|
|
32
|
+
}
|
|
33
|
+
}, form.getInputProps("todoList")), {
|
|
34
|
+
children: function(task, index) {
|
|
35
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
36
|
+
children: [
|
|
37
|
+
/*#__PURE__*/ _jsx(TextInput, _object_spread_props(_object_spread({
|
|
38
|
+
autoFocus: true,
|
|
39
|
+
placeholder: "Do something ..."
|
|
40
|
+
}, form.getInputProps("todoList.".concat(index, ".name"))), {
|
|
41
|
+
styles: {
|
|
42
|
+
flex: 1
|
|
43
|
+
}
|
|
44
|
+
})),
|
|
45
|
+
/*#__PURE__*/ _jsx(Checkbox, _object_spread({}, form.getInputProps("todoList.".concat(index, ".done"), {
|
|
46
|
+
type: "checkbox"
|
|
47
|
+
})))
|
|
48
|
+
]
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}));
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=Collection.example.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/collection/Collection.example.tsx"],"sourcesContent":["import {Checkbox, TextInput} from '@mantine/core';\nimport {useForm} from '@mantine/form';\n\nimport {Collection} from './Collection';\n\nexport default () => {\n const form = useForm({\n initialValues: {\n todoList: [\n {name: 'wash the dishes', done: true},\n {name: 'take out the trash', done: false},\n {name: 'vacuum the floors', done: true},\n ],\n },\n });\n\n return (\n <Collection<{name: string; done: boolean}>\n draggable\n addLabel=\"Add task\"\n newItem={{name: '', done: false}}\n {...form.getInputProps('todoList')}\n >\n {(task, index) => (\n <>\n <TextInput\n autoFocus\n placeholder=\"Do something ...\"\n {...form.getInputProps(`todoList.${index}.name`)}\n styles={{flex: 1}}\n />\n <Checkbox {...form.getInputProps(`todoList.${index}.done`, {type: 'checkbox'})} />\n </>\n )}\n </Collection>\n );\n};\n"],"names":["Checkbox","TextInput","useForm","Collection","form","initialValues","todoList","name","done","draggable","addLabel","newItem","getInputProps","task","index","autoFocus","placeholder","styles","flex","type"],"mappings":"AAAA;;;AAAA,SAAQA,QAAQ,EAAEC,SAAS,QAAO,eAAe,CAAC;AAClD,SAAQC,OAAO,QAAO,eAAe,CAAC;AAEtC,SAAQC,UAAU,QAAO,cAAc,CAAC;AAExC,eAAe,WAAM;IACjB,IAAMC,IAAI,GAAGF,OAAO,CAAC;QACjBG,aAAa,EAAE;YACXC,QAAQ,EAAE;gBACN;oBAACC,IAAI,EAAE,iBAAiB;oBAAEC,IAAI,EAAE,IAAI;iBAAC;gBACrC;oBAACD,IAAI,EAAE,oBAAoB;oBAAEC,IAAI,EAAE,KAAK;iBAAC;gBACzC;oBAACD,IAAI,EAAE,mBAAmB;oBAAEC,IAAI,EAAE,IAAI;iBAAC;aAC1C;SACJ;KACJ,CAAC,AAAC;IAEH,qBACI,KAACL,UAAU;QACPM,SAAS;QACTC,QAAQ,EAAC,UAAU;QACnBC,OAAO,EAAE;YAACJ,IAAI,EAAE,EAAE;YAAEC,IAAI,EAAE,KAAK;SAAC;OAC5BJ,IAAI,CAACQ,aAAa,CAAC,UAAU,CAAC;kBAEjC,SAACC,IAAI,EAAEC,KAAK;iCACT;;kCACI,KAACb,SAAS;wBACNc,SAAS;wBACTC,WAAW,EAAC,kBAAkB;uBAC1BZ,IAAI,CAACQ,aAAa,CAAC,AAAC,WAAS,CAAQ,MAAK,CAAXE,KAAK,EAAC,OAAK,CAAC,CAAC;wBAChDG,MAAM,EAAE;4BAACC,IAAI,EAAE,CAAC;yBAAC;uBACnB;kCACF,KAAClB,QAAQ,qBAAKI,IAAI,CAACQ,aAAa,CAAC,AAAC,WAAS,CAAQ,MAAK,CAAXE,KAAK,EAAC,OAAK,CAAC,EAAE;wBAACK,IAAI,EAAE,UAAU;qBAAC,CAAC,EAAI;;cACnF;SACN;OACQ,CACf;AACN,CAAC,CAAC"}
|