@coveord/plasma-mantine 54.0.2 → 54.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +3 -3
- package/.turbo/turbo-test.log +41 -41
- package/dist/.tsbuildinfo +1 -1
- package/dist/cjs/components/action-icon/ActionIcon.d.ts +5 -5
- package/dist/cjs/components/action-icon/ActionIcon.d.ts.map +1 -1
- package/dist/cjs/components/action-icon/ActionIcon.js.map +1 -1
- package/dist/cjs/components/action-icon/index.js.map +1 -1
- package/dist/cjs/components/blank-slate/BlankSlate.js.map +1 -1
- package/dist/cjs/components/blank-slate/index.js.map +1 -1
- package/dist/cjs/components/browser-preview/BrowserPreview.d.ts.map +1 -1
- package/dist/cjs/components/browser-preview/BrowserPreview.js.map +1 -1
- package/dist/cjs/components/browser-preview/index.js.map +1 -1
- package/dist/cjs/components/button/Button.d.ts +5 -5
- package/dist/cjs/components/button/Button.d.ts.map +1 -1
- package/dist/cjs/components/button/Button.js.map +1 -1
- package/dist/cjs/components/button/ButtonWithDisabledTooltip.d.ts +2 -2
- package/dist/cjs/components/button/ButtonWithDisabledTooltip.js.map +1 -1
- package/dist/cjs/components/button/index.js.map +1 -1
- package/dist/cjs/components/code-editor/CodeEditor.js.map +1 -1
- package/dist/cjs/components/code-editor/index.js.map +1 -1
- package/dist/cjs/components/code-editor/languages/xml.js.map +1 -1
- package/dist/cjs/components/code-editor/search/Search.d.ts +0 -1
- package/dist/cjs/components/code-editor/search/Search.d.ts.map +1 -1
- package/dist/cjs/components/code-editor/search/Search.js.map +1 -1
- package/dist/cjs/components/code-editor/search/index.js.map +1 -1
- package/dist/cjs/components/collection/Collection.d.ts.map +1 -1
- package/dist/cjs/components/collection/Collection.js.map +1 -1
- package/dist/cjs/components/collection/CollectionContext.d.ts +2 -3
- package/dist/cjs/components/collection/CollectionContext.d.ts.map +1 -1
- package/dist/cjs/components/collection/CollectionContext.js.map +1 -1
- package/dist/cjs/components/collection/CollectionItem.js.map +1 -1
- package/dist/cjs/components/collection/enhanceWithCollectionProps.d.ts +1 -1
- package/dist/cjs/components/collection/enhanceWithCollectionProps.d.ts.map +1 -1
- package/dist/cjs/components/collection/enhanceWithCollectionProps.js.map +1 -1
- package/dist/cjs/components/collection/index.js.map +1 -1
- package/dist/cjs/components/copyToClipboard/CopyToClipboard.d.ts +0 -1
- package/dist/cjs/components/copyToClipboard/CopyToClipboard.d.ts.map +1 -1
- package/dist/cjs/components/copyToClipboard/CopyToClipboard.js.map +1 -1
- package/dist/cjs/components/copyToClipboard/index.js.map +1 -1
- package/dist/cjs/components/date-range-picker/DateRangePickerInlineCalendar.js.map +1 -1
- package/dist/cjs/components/date-range-picker/DateRangePickerPopoverCalendar.d.ts.map +1 -1
- package/dist/cjs/components/date-range-picker/DateRangePickerPopoverCalendar.js.map +1 -1
- package/dist/cjs/components/date-range-picker/DateRangePickerPresetSelect.d.ts.map +1 -1
- package/dist/cjs/components/date-range-picker/DateRangePickerPresetSelect.js.map +1 -1
- package/dist/cjs/components/date-range-picker/EditableDateRangePicker.js.map +1 -1
- package/dist/cjs/components/date-range-picker/index.js.map +1 -1
- package/dist/cjs/components/header/Header.context.d.ts +2 -3
- package/dist/cjs/components/header/Header.context.d.ts.map +1 -1
- package/dist/cjs/components/header/Header.context.js.map +1 -1
- package/dist/cjs/components/header/Header.d.ts.map +1 -1
- package/dist/cjs/components/header/Header.js.map +1 -1
- package/dist/cjs/components/header/HeaderActions/HeaderActions.js.map +1 -1
- package/dist/cjs/components/header/HeaderBreadcrumbs/HeaderBreadcrumbs.js.map +1 -1
- package/dist/cjs/components/header/HeaderDocAnchor/HeaderDocAnchor.js.map +1 -1
- package/dist/cjs/components/header/index.js.map +1 -1
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/components/inline-confirm/InlineConfirm.d.ts +1 -8
- package/dist/cjs/components/inline-confirm/InlineConfirm.d.ts.map +1 -1
- package/dist/cjs/components/inline-confirm/InlineConfirm.js.map +1 -1
- package/dist/cjs/components/inline-confirm/InlineConfirmContext.d.ts +2 -3
- package/dist/cjs/components/inline-confirm/InlineConfirmContext.d.ts.map +1 -1
- package/dist/cjs/components/inline-confirm/InlineConfirmContext.js.map +1 -1
- package/dist/cjs/components/inline-confirm/InlineConfirmPrompt.js.map +1 -1
- package/dist/cjs/components/inline-confirm/InlineConfirmTarget.d.ts +9 -24
- package/dist/cjs/components/inline-confirm/InlineConfirmTarget.d.ts.map +1 -1
- package/dist/cjs/components/inline-confirm/InlineConfirmTarget.js.map +1 -1
- package/dist/cjs/components/inline-confirm/index.js.map +1 -1
- package/dist/cjs/components/menu/Menu.d.ts +3 -4
- package/dist/cjs/components/menu/Menu.d.ts.map +1 -1
- package/dist/cjs/components/menu/Menu.js.map +1 -1
- package/dist/cjs/components/menu/index.js.map +1 -1
- package/dist/cjs/components/prompt/Prompt.js.map +1 -1
- package/dist/cjs/components/prompt/PromptFooter.js.map +1 -1
- package/dist/cjs/components/prompt/index.js.map +1 -1
- package/dist/cjs/components/sticky-footer/StickyFooter.js.map +1 -1
- package/dist/cjs/components/sticky-footer/index.js.map +1 -1
- package/dist/cjs/components/table/Table.d.ts +7 -7
- package/dist/cjs/components/table/Table.d.ts.map +1 -1
- package/dist/cjs/components/table/Table.js +2 -2
- package/dist/cjs/components/table/Table.js.map +1 -1
- package/dist/cjs/components/table/Table.types.js.map +1 -1
- package/dist/cjs/components/table/TableContext.d.ts.map +1 -1
- package/dist/cjs/components/table/TableContext.js.map +1 -1
- package/dist/cjs/components/table/index.js.map +1 -1
- package/dist/cjs/components/table/layouts/TableLayoutControl.js.map +1 -1
- package/dist/cjs/components/table/layouts/TableLayouts.js.map +1 -1
- package/dist/cjs/components/table/layouts/row-layout/RowLayout.js.map +1 -1
- package/dist/cjs/components/table/layouts/row-layout/RowLayoutBody.d.ts.map +1 -1
- package/dist/cjs/components/table/layouts/row-layout/RowLayoutBody.js.map +1 -1
- package/dist/cjs/components/table/layouts/row-layout/RowLayoutContext.d.ts +2 -3
- package/dist/cjs/components/table/layouts/row-layout/RowLayoutContext.d.ts.map +1 -1
- package/dist/cjs/components/table/layouts/row-layout/RowLayoutContext.js.map +1 -1
- package/dist/cjs/components/table/layouts/row-layout/RowLayoutHeader.d.ts.map +1 -1
- package/dist/cjs/components/table/layouts/row-layout/RowLayoutHeader.js.map +1 -1
- package/dist/cjs/components/table/layouts/row-layout/RowLayoutIcon.js.map +1 -1
- package/dist/cjs/components/table/table-actions/TableActionContext.d.ts +2 -3
- package/dist/cjs/components/table/table-actions/TableActionContext.d.ts.map +1 -1
- package/dist/cjs/components/table/table-actions/TableActionContext.js.map +1 -1
- package/dist/cjs/components/table/table-actions/TableActionItem.d.ts +5 -5
- package/dist/cjs/components/table/table-actions/TableActionItem.d.ts.map +1 -1
- package/dist/cjs/components/table/table-actions/TableActionItem.js.map +1 -1
- package/dist/cjs/components/table/table-actions/TableActionsList.d.ts +1 -1
- package/dist/cjs/components/table/table-actions/TableActionsList.d.ts.map +1 -1
- package/dist/cjs/components/table/table-actions/TableActionsList.js.map +1 -1
- package/dist/cjs/components/table/table-actions/TableHeaderActions.js.map +1 -1
- package/dist/cjs/components/table/table-actions/index.js.map +1 -1
- package/dist/cjs/components/table/table-column/TableActionsColumn.js.map +1 -1
- package/dist/cjs/components/table/table-column/TableCollapsibleColumn.js.map +1 -1
- package/dist/cjs/components/table/table-column/TableSelectableColumn.js.map +1 -1
- package/dist/cjs/components/table/table-columns-selector/TableColumnsSelector.js.map +1 -1
- package/dist/cjs/components/table/table-date-range-picker/TableDateRangePicker.js.map +1 -1
- package/dist/cjs/components/table/table-filter/TableFilter.js.map +1 -1
- package/dist/cjs/components/table/table-footer/TableFooter.js.map +1 -1
- package/dist/cjs/components/table/table-header/TableHeader.js.map +1 -1
- package/dist/cjs/components/table/table-header/Th.d.ts.map +1 -1
- package/dist/cjs/components/table/table-header/Th.js.map +1 -1
- package/dist/cjs/components/table/table-last-updated/TableLastUpdated.js.map +1 -1
- package/dist/cjs/components/table/table-loading/TableLoading.js.map +1 -1
- package/dist/cjs/components/table/table-no-data/TableNoData.js.map +1 -1
- package/dist/cjs/components/table/table-pagination/TablePagination.js.map +1 -1
- package/dist/cjs/components/table/table-pagination/TablePagination.types.js.map +1 -1
- package/dist/cjs/components/table/table-per-page/TablePerPage.js.map +1 -1
- package/dist/cjs/components/table/table-per-page/TablePerPage.types.js.map +1 -1
- package/dist/cjs/components/table/table-predicate/TablePredicate.js.map +1 -1
- package/dist/cjs/components/table/use-table.d.ts +0 -1
- package/dist/cjs/components/table/use-table.d.ts.map +1 -1
- package/dist/cjs/components/table/use-table.js.map +1 -1
- package/dist/cjs/hooks/index.js.map +1 -1
- package/dist/cjs/hooks/useClickWithLoading.d.ts.map +1 -1
- package/dist/cjs/hooks/useClickWithLoading.js.map +1 -1
- package/dist/cjs/hooks/useControlledList.d.ts.map +1 -1
- package/dist/cjs/hooks/useControlledList.js.map +1 -1
- package/dist/cjs/hooks/useParentHeight.d.ts.map +1 -1
- package/dist/cjs/hooks/useParentHeight.js.map +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/theme/PlasmaColors.d.ts.map +1 -1
- package/dist/cjs/theme/PlasmaColors.js.map +1 -1
- package/dist/cjs/theme/Plasmantine.js.map +1 -1
- package/dist/cjs/theme/Theme.js.map +1 -1
- package/dist/cjs/theme/index.js.map +1 -1
- package/dist/cjs/theme/mergeCSSVariablesResolvers.js.map +1 -1
- package/dist/cjs/theme/plasmaCSSVariablesResolver.js.map +1 -1
- package/dist/cjs/types/css/index.d.js.map +1 -1
- package/dist/cjs/utils/createFactoryComponent.d.ts.map +1 -1
- package/dist/cjs/utils/createFactoryComponent.js.map +1 -1
- package/dist/cjs/utils/createPolymorphicComponent.js.map +1 -1
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/overrideComponent.d.ts.map +1 -1
- package/dist/cjs/utils/overrideComponent.js.map +1 -1
- package/dist/cjs/vars/Notification.vars.js.map +1 -1
- package/dist/cjs/vars/Text.vars.js.map +1 -1
- package/dist/esm/components/action-icon/ActionIcon.d.ts +5 -5
- package/dist/esm/components/action-icon/ActionIcon.d.ts.map +1 -1
- package/dist/esm/components/action-icon/ActionIcon.js.map +1 -1
- package/dist/esm/components/action-icon/index.js.map +1 -1
- package/dist/esm/components/blank-slate/BlankSlate.js.map +1 -1
- package/dist/esm/components/blank-slate/index.js.map +1 -1
- package/dist/esm/components/browser-preview/BrowserPreview.d.ts.map +1 -1
- package/dist/esm/components/browser-preview/BrowserPreview.js.map +1 -1
- package/dist/esm/components/browser-preview/index.js.map +1 -1
- package/dist/esm/components/button/Button.d.ts +5 -5
- package/dist/esm/components/button/Button.d.ts.map +1 -1
- package/dist/esm/components/button/Button.js.map +1 -1
- package/dist/esm/components/button/ButtonWithDisabledTooltip.d.ts +2 -2
- package/dist/esm/components/button/ButtonWithDisabledTooltip.js.map +1 -1
- package/dist/esm/components/button/index.js.map +1 -1
- package/dist/esm/components/code-editor/CodeEditor.js.map +1 -1
- package/dist/esm/components/code-editor/index.js.map +1 -1
- package/dist/esm/components/code-editor/languages/xml.js.map +1 -1
- package/dist/esm/components/code-editor/search/Search.d.ts +0 -1
- package/dist/esm/components/code-editor/search/Search.d.ts.map +1 -1
- package/dist/esm/components/code-editor/search/Search.js.map +1 -1
- package/dist/esm/components/code-editor/search/index.js.map +1 -1
- package/dist/esm/components/collection/Collection.d.ts.map +1 -1
- package/dist/esm/components/collection/Collection.js.map +1 -1
- package/dist/esm/components/collection/CollectionContext.d.ts +2 -3
- package/dist/esm/components/collection/CollectionContext.d.ts.map +1 -1
- package/dist/esm/components/collection/CollectionContext.js.map +1 -1
- package/dist/esm/components/collection/CollectionItem.js.map +1 -1
- package/dist/esm/components/collection/enhanceWithCollectionProps.d.ts +1 -1
- package/dist/esm/components/collection/enhanceWithCollectionProps.d.ts.map +1 -1
- package/dist/esm/components/collection/enhanceWithCollectionProps.js.map +1 -1
- package/dist/esm/components/collection/index.js.map +1 -1
- package/dist/esm/components/copyToClipboard/CopyToClipboard.d.ts +0 -1
- package/dist/esm/components/copyToClipboard/CopyToClipboard.d.ts.map +1 -1
- package/dist/esm/components/copyToClipboard/CopyToClipboard.js.map +1 -1
- package/dist/esm/components/copyToClipboard/index.js.map +1 -1
- package/dist/esm/components/date-range-picker/DateRangePickerInlineCalendar.js.map +1 -1
- package/dist/esm/components/date-range-picker/DateRangePickerPopoverCalendar.d.ts.map +1 -1
- package/dist/esm/components/date-range-picker/DateRangePickerPopoverCalendar.js.map +1 -1
- package/dist/esm/components/date-range-picker/DateRangePickerPresetSelect.d.ts.map +1 -1
- package/dist/esm/components/date-range-picker/DateRangePickerPresetSelect.js.map +1 -1
- package/dist/esm/components/date-range-picker/EditableDateRangePicker.js.map +1 -1
- package/dist/esm/components/date-range-picker/index.js.map +1 -1
- package/dist/esm/components/header/Header.context.d.ts +2 -3
- package/dist/esm/components/header/Header.context.d.ts.map +1 -1
- package/dist/esm/components/header/Header.context.js.map +1 -1
- package/dist/esm/components/header/Header.d.ts.map +1 -1
- package/dist/esm/components/header/Header.js.map +1 -1
- package/dist/esm/components/header/HeaderActions/HeaderActions.js.map +1 -1
- package/dist/esm/components/header/HeaderBreadcrumbs/HeaderBreadcrumbs.js.map +1 -1
- package/dist/esm/components/header/HeaderDocAnchor/HeaderDocAnchor.js.map +1 -1
- package/dist/esm/components/header/index.js.map +1 -1
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/components/inline-confirm/InlineConfirm.d.ts +1 -8
- package/dist/esm/components/inline-confirm/InlineConfirm.d.ts.map +1 -1
- package/dist/esm/components/inline-confirm/InlineConfirm.js.map +1 -1
- package/dist/esm/components/inline-confirm/InlineConfirmContext.d.ts +2 -3
- package/dist/esm/components/inline-confirm/InlineConfirmContext.d.ts.map +1 -1
- package/dist/esm/components/inline-confirm/InlineConfirmContext.js.map +1 -1
- package/dist/esm/components/inline-confirm/InlineConfirmPrompt.js.map +1 -1
- package/dist/esm/components/inline-confirm/InlineConfirmTarget.d.ts +9 -24
- package/dist/esm/components/inline-confirm/InlineConfirmTarget.d.ts.map +1 -1
- package/dist/esm/components/inline-confirm/InlineConfirmTarget.js.map +1 -1
- package/dist/esm/components/inline-confirm/index.js.map +1 -1
- package/dist/esm/components/menu/Menu.d.ts +3 -4
- package/dist/esm/components/menu/Menu.d.ts.map +1 -1
- package/dist/esm/components/menu/Menu.js.map +1 -1
- package/dist/esm/components/menu/index.js.map +1 -1
- package/dist/esm/components/prompt/Prompt.js.map +1 -1
- package/dist/esm/components/prompt/PromptFooter.js.map +1 -1
- package/dist/esm/components/prompt/index.js.map +1 -1
- package/dist/esm/components/sticky-footer/StickyFooter.js.map +1 -1
- package/dist/esm/components/sticky-footer/index.js.map +1 -1
- package/dist/esm/components/table/Table.d.ts +7 -7
- package/dist/esm/components/table/Table.d.ts.map +1 -1
- package/dist/esm/components/table/Table.js +1 -1
- package/dist/esm/components/table/Table.js.map +1 -1
- package/dist/esm/components/table/Table.types.js.map +1 -1
- package/dist/esm/components/table/TableContext.d.ts.map +1 -1
- package/dist/esm/components/table/TableContext.js.map +1 -1
- package/dist/esm/components/table/index.js.map +1 -1
- package/dist/esm/components/table/layouts/TableLayoutControl.js.map +1 -1
- package/dist/esm/components/table/layouts/TableLayouts.js.map +1 -1
- package/dist/esm/components/table/layouts/row-layout/RowLayout.js.map +1 -1
- package/dist/esm/components/table/layouts/row-layout/RowLayoutBody.d.ts.map +1 -1
- package/dist/esm/components/table/layouts/row-layout/RowLayoutBody.js.map +1 -1
- package/dist/esm/components/table/layouts/row-layout/RowLayoutContext.d.ts +2 -3
- package/dist/esm/components/table/layouts/row-layout/RowLayoutContext.d.ts.map +1 -1
- package/dist/esm/components/table/layouts/row-layout/RowLayoutContext.js.map +1 -1
- package/dist/esm/components/table/layouts/row-layout/RowLayoutHeader.d.ts.map +1 -1
- package/dist/esm/components/table/layouts/row-layout/RowLayoutHeader.js.map +1 -1
- package/dist/esm/components/table/layouts/row-layout/RowLayoutIcon.js.map +1 -1
- package/dist/esm/components/table/table-actions/TableActionContext.d.ts +2 -3
- package/dist/esm/components/table/table-actions/TableActionContext.d.ts.map +1 -1
- package/dist/esm/components/table/table-actions/TableActionContext.js.map +1 -1
- package/dist/esm/components/table/table-actions/TableActionItem.d.ts +5 -5
- package/dist/esm/components/table/table-actions/TableActionItem.d.ts.map +1 -1
- package/dist/esm/components/table/table-actions/TableActionItem.js.map +1 -1
- package/dist/esm/components/table/table-actions/TableActionsList.d.ts +1 -1
- package/dist/esm/components/table/table-actions/TableActionsList.d.ts.map +1 -1
- package/dist/esm/components/table/table-actions/TableActionsList.js.map +1 -1
- package/dist/esm/components/table/table-actions/TableHeaderActions.js.map +1 -1
- package/dist/esm/components/table/table-actions/index.js.map +1 -1
- package/dist/esm/components/table/table-column/TableActionsColumn.js.map +1 -1
- package/dist/esm/components/table/table-column/TableCollapsibleColumn.js.map +1 -1
- package/dist/esm/components/table/table-column/TableSelectableColumn.js.map +1 -1
- package/dist/esm/components/table/table-columns-selector/TableColumnsSelector.js.map +1 -1
- package/dist/esm/components/table/table-date-range-picker/TableDateRangePicker.js.map +1 -1
- package/dist/esm/components/table/table-filter/TableFilter.js.map +1 -1
- package/dist/esm/components/table/table-footer/TableFooter.js.map +1 -1
- package/dist/esm/components/table/table-header/TableHeader.js.map +1 -1
- package/dist/esm/components/table/table-header/Th.d.ts.map +1 -1
- package/dist/esm/components/table/table-header/Th.js.map +1 -1
- package/dist/esm/components/table/table-last-updated/TableLastUpdated.js.map +1 -1
- package/dist/esm/components/table/table-loading/TableLoading.js.map +1 -1
- package/dist/esm/components/table/table-no-data/TableNoData.js.map +1 -1
- package/dist/esm/components/table/table-pagination/TablePagination.js.map +1 -1
- package/dist/esm/components/table/table-pagination/TablePagination.types.js.map +1 -1
- package/dist/esm/components/table/table-per-page/TablePerPage.js.map +1 -1
- package/dist/esm/components/table/table-per-page/TablePerPage.types.js.map +1 -1
- package/dist/esm/components/table/table-predicate/TablePredicate.js.map +1 -1
- package/dist/esm/components/table/use-table.d.ts +0 -1
- package/dist/esm/components/table/use-table.d.ts.map +1 -1
- package/dist/esm/components/table/use-table.js.map +1 -1
- package/dist/esm/hooks/index.js.map +1 -1
- package/dist/esm/hooks/useClickWithLoading.d.ts.map +1 -1
- package/dist/esm/hooks/useClickWithLoading.js.map +1 -1
- package/dist/esm/hooks/useControlledList.d.ts.map +1 -1
- package/dist/esm/hooks/useControlledList.js.map +1 -1
- package/dist/esm/hooks/useParentHeight.d.ts.map +1 -1
- package/dist/esm/hooks/useParentHeight.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/theme/PlasmaColors.d.ts.map +1 -1
- package/dist/esm/theme/PlasmaColors.js.map +1 -1
- package/dist/esm/theme/Plasmantine.js.map +1 -1
- package/dist/esm/theme/Theme.js.map +1 -1
- package/dist/esm/theme/index.js.map +1 -1
- package/dist/esm/theme/mergeCSSVariablesResolvers.js.map +1 -1
- package/dist/esm/theme/plasmaCSSVariablesResolver.js.map +1 -1
- package/dist/esm/types/css/index.d.js.map +1 -1
- package/dist/esm/utils/createFactoryComponent.d.ts.map +1 -1
- package/dist/esm/utils/createFactoryComponent.js.map +1 -1
- package/dist/esm/utils/createPolymorphicComponent.js.map +1 -1
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/utils/overrideComponent.d.ts.map +1 -1
- package/dist/esm/utils/overrideComponent.js.map +1 -1
- package/dist/esm/vars/Notification.vars.js.map +1 -1
- package/dist/esm/vars/Text.vars.js.map +1 -1
- package/package.json +19 -19
- package/src/components/table/Table.tsx +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/code-editor/search/Search.tsx"],"sourcesContent":["import {SearchSize16Px} from '@coveord/plasma-react-icons';\nimport {ActionIcon} from '@mantine/core';\n\nexport interface SearchProps {\n handleSearch: () => void;\n}\n\nconst SearchButton: React.FunctionComponent<SearchProps> = ({handleSearch}) => (\n <ActionIcon onClick={handleSearch} variant=\"subtle\" color=\"gray\">\n <SearchSize16Px height={16}></SearchSize16Px>\n </ActionIcon>\n);\n\nexport const Search: React.FunctionComponent<SearchProps> = ({...params}) => <SearchButton {...params} />;\n"],"names":["SearchSize16Px","ActionIcon","SearchButton","handleSearch","onClick","variant","color","height","Search","params"],"
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/code-editor/search/Search.tsx"],"sourcesContent":["import {SearchSize16Px} from '@coveord/plasma-react-icons';\nimport {ActionIcon} from '@mantine/core';\n\nexport interface SearchProps {\n handleSearch: () => void;\n}\n\nconst SearchButton: React.FunctionComponent<SearchProps> = ({handleSearch}) => (\n <ActionIcon onClick={handleSearch} variant=\"subtle\" color=\"gray\">\n <SearchSize16Px height={16}></SearchSize16Px>\n </ActionIcon>\n);\n\nexport const Search: React.FunctionComponent<SearchProps> = ({...params}) => <SearchButton {...params} />;\n"],"names":["SearchSize16Px","ActionIcon","SearchButton","handleSearch","onClick","variant","color","height","Search","params"],"mappings":";AAAA,SAAQA,cAAc,QAAO,8BAA8B;AAC3D,SAAQC,UAAU,QAAO,gBAAgB;AAMzC,MAAMC,eAAqD,CAAC,EAACC,YAAY,EAAC,iBACtE,KAACF;QAAWG,SAASD;QAAcE,SAAQ;QAASC,OAAM;kBACtD,cAAA,KAACN;YAAeO,QAAQ;;;AAIhC,OAAO,MAAMC,SAA+C,CAAC,EAAC,GAAGC,QAAO,iBAAK,KAACP;QAAc,GAAGO,MAAM;OAAK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/code-editor/search/index.ts"],"sourcesContent":["export * from './Search';\n"],"names":[],"
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/code-editor/search/index.ts"],"sourcesContent":["export * from './Search';\n"],"names":[],"mappings":"AAAA,cAAc,WAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Collection.d.ts","sourceRoot":"","sources":["../../../../src/components/collection/Collection.tsx"],"names":[],"mappings":"AAI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pF,eAAe,CAAC,OAAO,CAAC;aAC1B,cAAc;qBACN,qBAAqB;;CA+JrC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
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 BoxProps,\n Factory,\n Group,\n Input,\n MantineSpacing,\n Stack,\n StylesApiProps,\n Tooltip,\n __InputWrapperProps,\n useProps,\n useStyles,\n} from '@mantine/core';\nimport {ReorderPayload} from '@mantine/form/lib/types';\nimport {useDidUpdate} from '@mantine/hooks';\nimport {ForwardedRef, ReactNode} from 'react';\n\nimport {CustomComponentThemeExtend, identity} from '../../utils';\nimport {Button} from '../button';\nimport classes from './Collection.module.css';\nimport {CollectionProvider} from './CollectionContext';\nimport {CollectionItem} from './CollectionItem';\n\nexport interface CollectionProps<T> extends __InputWrapperProps, BoxProps, StylesApiProps<CollectionFactory> {\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 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 gap between the colleciton items\n *\n * @default 'xs'\n */\n gap?: MantineSpacing;\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\nexport type CollectionStylesNames = 'root' | 'item' | 'itemDragging' | 'dragHandle';\n\nexport type CollectionFactory = Factory<{\n props: CollectionProps<unknown>;\n ref: HTMLDivElement;\n stylesNames: CollectionStylesNames;\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 gap: 'xs',\n required: false,\n getItemId: ({id}: any) => id,\n};\n\nexport const Collection = <T,>(props: CollectionProps<T> & {ref?: ForwardedRef<HTMLDivElement>}) => {\n const {\n value,\n onChange,\n onRemoveItem,\n onReorderItem,\n onInsertItem,\n disabled,\n draggable,\n children,\n gap,\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 ref,\n\n // Style props\n style,\n className,\n classNames,\n styles,\n unstyled,\n ...others\n } = useProps('Collection', defaultProps as CollectionProps<T>, props);\n\n const getStyles = useStyles<CollectionFactory>({\n name: 'Collection',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n });\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 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 leftSection={<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 <CollectionProvider value={{getStyles}}>\n <DndContext\n onDragEnd={handleDragEnd}\n sensors={sensors}\n modifiers={[restrictToVerticalAxis, restrictToParentElement]}\n >\n <SortableContext items={standardizedItems} strategy={verticalListSortingStrategy}>\n <Box ref={ref} {...others} {...getStyles('root')}>\n {_header}\n <Stack gap={gap}>\n {items}\n {_addButton}\n {_error}\n </Stack>\n </Box>\n </SortableContext>\n </DndContext>\n </CollectionProvider>\n );\n};\n\nCollection.extend = identity as CustomComponentThemeExtend<CollectionFactory>;\n"],"names":["AddSize16Px","DndContext","KeyboardSensor","PointerSensor","useSensor","useSensors","restrictToParentElement","restrictToVerticalAxis","SortableContext","sortableKeyboardCoordinates","verticalListSortingStrategy","Box","Group","Input","Stack","Tooltip","useProps","useStyles","useDidUpdate","identity","Button","classes","CollectionProvider","CollectionItem","defaultProps","draggable","addLabel","addDisabledTooltip","disabled","gap","required","getItemId","id","Collection","props","value","onChange","onRemoveItem","onReorderItem","onInsertItem","children","newItem","allowAdd","label","labelProps","withAsterisk","description","descriptionProps","error","errorProps","ref","style","className","classNames","styles","unstyled","others","getStyles","name","sensors","coordinateGetter","hasOnlyOneItem","length","JSON","stringify","isRequired","_label","Label","_description","Description","_error","Error","_header","standardizedItems","map","item","index","String","data","items","onRemove","removable","addAllowed","_addButton","variant","leftSection","height","onClick","getIndex","findIndex","handleDragEnd","over","active","activeIndex","overIndex","from","to","onDragEnd","modifiers","strategy","extend"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,S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sF,QAAQ;;oBAClCC,SAAS,IAAMhD,aAAaE,SAASN,OAAO2B,UAAU;oBACtDlC,UAAU,CAACsD;8BAEVxD;;;;;IAOrB,MAAM8D,WAAW,CAACxD,KAAeyC,kBAAkBgB,SAAS,CAAC,CAACd,OAASA,KAAK3C,EAAE,KAAKA;IAEnF,MAAM0D,gBAAgB,CAAC,EAACC,IAAI,EAAEC,MAAM,EAAe;QAC/C,IAAID,MAAM;YACN,MAAME,cAAcL,SAASX,OAAOe,OAAO5D,EAAE;YAC7C,MAAM8D,YAAYN,SAASX,OAAOc,KAAK3D,EAAE;YACzC,IAAI6D,gBAAgBC,WAAW;gBAC3BxD,gBAAgB;oBAACyD,MAAMF;oBAAaG,IAAIF;gBAAS;YACrD;QACJ;IACJ;IAEA,qBACI,KAACxE;QAAmBa,OAAO;YAACsB;QAAS;kBACjC,cAAA,KAACxD;YACGgG,WAAWP;YACX/B,SAASA;YACTuC,WAAW;gBAAC3F;gBAAwBD;aAAwB;sBAE5D,cAAA,KAACE;gBAAgBuE,OAAON;gBAAmB0B,UAAUzF;0BACjD,cAAA,MAACC;oBAAIuC,KAAKA;oBAAM,GAAGM,MAAM;oBAAG,GAAGC,UAAU,OAAO;;wBAC3Ce;sCACD,MAAC1D;4BAAMe,KAAKA;;gCACPkD;gCACAI;gCACAb;;;;;;;;AAO7B,EAAE;AAEFrC,WAAWmE,MAAM,GAAGjF"}
|
|
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 BoxProps,\n Factory,\n Group,\n Input,\n MantineSpacing,\n Stack,\n StylesApiProps,\n Tooltip,\n __InputWrapperProps,\n useProps,\n useStyles,\n} from '@mantine/core';\nimport {ReorderPayload} from '@mantine/form/lib/types';\nimport {useDidUpdate} from '@mantine/hooks';\nimport {ForwardedRef, ReactNode} from 'react';\n\nimport {CustomComponentThemeExtend, identity} from '../../utils';\nimport {Button} from '../button';\nimport classes from './Collection.module.css';\nimport {CollectionProvider} from './CollectionContext';\nimport {CollectionItem} from './CollectionItem';\n\nexport interface CollectionProps<T> extends __InputWrapperProps, BoxProps, StylesApiProps<CollectionFactory> {\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 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 gap between the colleciton items\n *\n * @default 'xs'\n */\n gap?: MantineSpacing;\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\nexport type CollectionStylesNames = 'root' | 'item' | 'itemDragging' | 'dragHandle';\n\nexport type CollectionFactory = Factory<{\n props: CollectionProps<unknown>;\n ref: HTMLDivElement;\n stylesNames: CollectionStylesNames;\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 gap: 'xs',\n required: false,\n getItemId: ({id}: any) => id,\n};\n\nexport const Collection = <T,>(props: CollectionProps<T> & {ref?: ForwardedRef<HTMLDivElement>}) => {\n const {\n value,\n onChange,\n onRemoveItem,\n onReorderItem,\n onInsertItem,\n disabled,\n draggable,\n children,\n gap,\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 ref,\n\n // Style props\n style,\n className,\n classNames,\n styles,\n unstyled,\n ...others\n } = useProps('Collection', defaultProps as CollectionProps<T>, props);\n\n const getStyles = useStyles<CollectionFactory>({\n name: 'Collection',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n });\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 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 leftSection={<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 <CollectionProvider value={{getStyles}}>\n <DndContext\n onDragEnd={handleDragEnd}\n sensors={sensors}\n modifiers={[restrictToVerticalAxis, restrictToParentElement]}\n >\n <SortableContext items={standardizedItems} strategy={verticalListSortingStrategy}>\n <Box ref={ref} {...others} {...getStyles('root')}>\n {_header}\n <Stack gap={gap}>\n {items}\n {_addButton}\n {_error}\n </Stack>\n </Box>\n </SortableContext>\n </DndContext>\n </CollectionProvider>\n );\n};\n\nCollection.extend = identity as CustomComponentThemeExtend<CollectionFactory>;\n"],"names":["AddSize16Px","DndContext","KeyboardSensor","PointerSensor","useSensor","useSensors","restrictToParentElement","restrictToVerticalAxis","SortableContext","sortableKeyboardCoordinates","verticalListSortingStrategy","Box","Group","Input","Stack","Tooltip","useProps","useStyles","useDidUpdate","identity","Button","classes","CollectionProvider","CollectionItem","defaultProps","draggable","addLabel","addDisabledTooltip","disabled","gap","required","getItemId","id","Collection","props","value","onChange","onRemoveItem","onReorderItem","onInsertItem","children","newItem","allowAdd","label","labelProps","withAsterisk","description","descriptionProps","error","errorProps","ref","style","className","classNames","styles","unstyled","others","getStyles","name","sensors","coordinateGetter","hasOnlyOneItem","length","JSON","stringify","isRequired","_label","Label","_description","Description","_error","Error","_header","standardizedItems","map","item","index","String","data","items","onRemove","removable","addAllowed","_addButton","variant","leftSection","height","onClick","getIndex","findIndex","handleDragEnd","over","active","activeIndex","overIndex","from","to","onDragEnd","modifiers","strategy","extend"],"mappings":";AAAA,SAAQA,WAAW,QAAO,8BAA8B;AACxD,SAAQC,UAAU,EAAgBC,cAAc,EAAEC,aAAa,EAAEC,SAAS,EAAEC,UAAU,QAAO,gBAAgB;AAC7G,SAAQC,uBAAuB,EAAEC,sBAAsB,QAAO,qBAAqB;AACnF,SAAQC,eAAe,EAAEC,2BAA2B,EAAEC,2BAA2B,QAAO,oBAAoB;AAC5G,SACIC,GAAG,EAGHC,KAAK,EACLC,KAAK,EAELC,KAAK,EAELC,OAAO,EAEPC,QAAQ,EACRC,SAAS,QACN,gBAAgB;AAEvB,SAAQC,YAAY,QAAO,iBAAiB;AAG5C,SAAoCC,QAAQ,QAAO,cAAc;AACjE,SAAQC,MAAM,QAAO,YAAY;AACjC,OAAOC,aAAa,0BAA0B;AAC9C,SAAQC,kBAAkB,QAAO,sBAAsB;AACvD,SAAQC,cAAc,QAAO,mBAAmB;AAgHhD,MAAMC,eAAkD;IACpDC,WAAW;IACXC,UAAU;IACVC,oBAAoB;IACpBC,UAAU;IACVC,KAAK;IACLC,U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AgBuE,OAAON;gBAAmB0B,UAAUzF;0BACjD,cAAA,MAACC;oBAAIuC,KAAKA;oBAAM,GAAGM,MAAM;oBAAG,GAAGC,UAAU,OAAO;;wBAC3Ce;sCACD,MAAC1D;4BAAMe,KAAKA;;gCACPkD;gCACAI;gCACAb;;;;;;;;AAO7B,EAAE;AAEFrC,WAAWmE,MAAM,GAAGjF"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { type GetStylesApi } from '@mantine/core';
|
|
3
2
|
import type { CollectionFactory } from './Collection';
|
|
4
3
|
interface CollectionContextType {
|
|
@@ -6,7 +5,7 @@ interface CollectionContextType {
|
|
|
6
5
|
}
|
|
7
6
|
export declare const CollectionProvider: ({ children, value }: {
|
|
8
7
|
value: CollectionContextType;
|
|
9
|
-
children:
|
|
10
|
-
}) => import("react/jsx-runtime").JSX.Element, useCollectionContext: () => CollectionContextType;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element, useCollectionContext: () => CollectionContextType & ({} | undefined);
|
|
11
10
|
export {};
|
|
12
11
|
//# sourceMappingURL=CollectionContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollectionContext.d.ts","sourceRoot":"","sources":["../../../../src/components/collection/CollectionContext.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CollectionContext.d.ts","sourceRoot":"","sources":["../../../../src/components/collection/CollectionContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,YAAY,EAAC,MAAM,eAAe,CAAC;AACnE,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAEpD,UAAU,qBAAqB;IAC3B,SAAS,EAAE,YAAY,CAAC,iBAAiB,CAAC,CAAC;CAC9C;AAED,eAAO,MAAO,kBAAkB;;cAJH,MACzB,SAAO;aAAe,mBAAmB,eAGX,oBAAoB,gDAErD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/collection/CollectionContext.ts"],"sourcesContent":["import {createSafeContext, type GetStylesApi} from '@mantine/core';\nimport type {CollectionFactory} from './Collection';\n\ninterface CollectionContextType {\n getStyles: GetStylesApi<CollectionFactory>;\n}\n\nexport const [CollectionProvider, useCollectionContext] = createSafeContext<CollectionContextType>(\n 'Collection component was not found in tree',\n);\n"],"names":["createSafeContext","CollectionProvider","useCollectionContext"],"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/collection/CollectionContext.ts"],"sourcesContent":["import {createSafeContext, type GetStylesApi} from '@mantine/core';\nimport type {CollectionFactory} from './Collection';\n\ninterface CollectionContextType {\n getStyles: GetStylesApi<CollectionFactory>;\n}\n\nexport const [CollectionProvider, useCollectionContext] = createSafeContext<CollectionContextType>(\n 'Collection component was not found in tree',\n);\n"],"names":["createSafeContext","CollectionProvider","useCollectionContext"],"mappings":"AAAA,SAAQA,iBAAiB,QAA0B,gBAAgB;AAOnE,OAAO,MAAM,CAACC,oBAAoBC,qBAAqB,GAAGF,kBACtD,8CACF"}
|
|
@@ -1 +1 @@
|
|
|
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, Group, GroupProps} from '@mantine/core';\nimport {FunctionComponent, PropsWithChildren} from 'react';\n\nimport {useCollectionContext} from './CollectionContext';\n\ninterface CollectionItemProps extends CollectionItemSharedProps {\n draggable?: boolean;\n disabled: boolean;\n}\n\ninterface CollectionItemSharedProps extends GroupProps {\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 style={{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 children,\n}) => {\n const ctx = useCollectionContext();\n const removeButton = removable && onRemove ? <RemoveButton onClick={onRemove} /> : <RemoveButtonPlaceholder />;\n\n return (\n <Group {...ctx.getStyles('item')}>\n {children}\n {removeButton}\n </Group>\n );\n};\n\nconst DisabledCollectionItem: FunctionComponent<PropsWithChildren<CollectionItemSharedProps>> = ({children}) => {\n const ctx = useCollectionContext();\n return <Group {...ctx.getStyles('item')}>{children}</Group>;\n};\n\nconst DraggableCollectionItem: FunctionComponent<PropsWithChildren<CollectionItemSharedProps>> = ({\n id,\n onRemove,\n removable = true,\n children,\n}) => {\n const ctx = useCollectionContext();\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 {...ctx.getStyles('item', {\n style: transform\n ? {\n transform: CSS.Transform.toString(transform),\n transition,\n }\n : undefined,\n })}\n data-isdragging={isDragging}\n >\n <div ref={setActivatorNodeRef} {...listeners} {...attributes} {...ctx.getStyles('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":["DragAndDropSize24Px","RemoveSize16Px","useSortable","CSS","ActionIcon","Group","useCollectionContext","RemoveButton","onClick","style","alignSelf","variant","color","height","RemoveButtonPlaceholder","div","width","StaticCollectionItem","onRemove","removable","children","ctx","removeButton","getStyles","DisabledCollectionItem","DraggableCollectionItem","id","attributes","listeners","setNodeRef","transform","transition","isDragging","setActivatorNodeRef","ref","Transform","toString","undefined","data-isdragging","CollectionItem","draggable","disabled","otherProps"],"
|
|
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, Group, GroupProps} from '@mantine/core';\nimport {FunctionComponent, PropsWithChildren} from 'react';\n\nimport {useCollectionContext} from './CollectionContext';\n\ninterface CollectionItemProps extends CollectionItemSharedProps {\n draggable?: boolean;\n disabled: boolean;\n}\n\ninterface CollectionItemSharedProps extends GroupProps {\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 style={{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 children,\n}) => {\n const ctx = useCollectionContext();\n const removeButton = removable && onRemove ? <RemoveButton onClick={onRemove} /> : <RemoveButtonPlaceholder />;\n\n return (\n <Group {...ctx.getStyles('item')}>\n {children}\n {removeButton}\n </Group>\n );\n};\n\nconst DisabledCollectionItem: FunctionComponent<PropsWithChildren<CollectionItemSharedProps>> = ({children}) => {\n const ctx = useCollectionContext();\n return <Group {...ctx.getStyles('item')}>{children}</Group>;\n};\n\nconst DraggableCollectionItem: FunctionComponent<PropsWithChildren<CollectionItemSharedProps>> = ({\n id,\n onRemove,\n removable = true,\n children,\n}) => {\n const ctx = useCollectionContext();\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 {...ctx.getStyles('item', {\n style: transform\n ? {\n transform: CSS.Transform.toString(transform),\n transition,\n }\n : undefined,\n })}\n data-isdragging={isDragging}\n >\n <div ref={setActivatorNodeRef} {...listeners} {...attributes} {...ctx.getStyles('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":["DragAndDropSize24Px","RemoveSize16Px","useSortable","CSS","ActionIcon","Group","useCollectionContext","RemoveButton","onClick","style","alignSelf","variant","color","height","RemoveButtonPlaceholder","div","width","StaticCollectionItem","onRemove","removable","children","ctx","removeButton","getStyles","DisabledCollectionItem","DraggableCollectionItem","id","attributes","listeners","setNodeRef","transform","transition","isDragging","setActivatorNodeRef","ref","Transform","toString","undefined","data-isdragging","CollectionItem","draggable","disabled","otherProps"],"mappings":";AAAA,SAAQA,mBAAmB,EAAEC,cAAc,QAAO,8BAA8B;AAChF,SAAQC,WAAW,QAAO,oBAAoB;AAC9C,SAAQC,GAAG,QAAO,qBAAqB;AACvC,SAAQC,UAAU,EAAEC,KAAK,QAAmB,gBAAgB;AAG5D,SAAQC,oBAAoB,QAAO,sBAAsB;AAazD,MAAMC,eAED,CAAC,EAACC,OAAO,EAAC,iBACX,KAACJ;QAAWK,OAAO;YAACC,WAAW;QAAQ;QAAGC,SAAQ;QAASH,SAASA;QAASI,OAAM;kB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ACTC,QAAQ,EACR,GAAGC,YACN;IACG,IAAID,UAAU;QACV,qBAAO,KAACjB;YAAwB,GAAGkB,UAAU;;IACjD;IACA,IAAIF,WAAW;QACX,qBAAO,KAACf;YAAyB,GAAGiB,UAAU;;IAClD;IACA,qBAAO,KAACzB;QAAsB,GAAGyB,UAAU;;AAC/C,EAAE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { UseFormInput } from '@mantine/form';
|
|
2
2
|
import { CollectionProps } from './Collection';
|
|
3
|
-
export declare const enhanceWithCollectionProps: <FormValues>(payload: Parameters<UseFormInput<FormValues>[
|
|
3
|
+
export declare const enhanceWithCollectionProps: <FormValues>(payload: Parameters<UseFormInput<FormValues>["enhanceGetInputProps"]>[0], field: (typeof payload)["field"]) => Pick<CollectionProps<unknown>, "onReorderItem" | "onInsertItem" | "onRemoveItem">;
|
|
4
4
|
//# sourceMappingURL=enhanceWithCollectionProps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enhanceWithCollectionProps.d.ts","sourceRoot":"","sources":["../../../../src/components/collection/enhanceWithCollectionProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAE7C,eAAO,MAAM,0BAA0B,
|
|
1
|
+
{"version":3,"file":"enhanceWithCollectionProps.d.ts","sourceRoot":"","sources":["../../../../src/components/collection/enhanceWithCollectionProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAE7C,eAAO,MAAM,0BAA0B,GAAI,UAAU,WACxC,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,SACjE,CAAC,OAAO,OAAO,EAAE,OAAO,CAAC,KACjC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,cAAc,GAAG,cAAc,CAYlF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/collection/enhanceWithCollectionProps.ts"],"sourcesContent":["import {UseFormInput} from '@mantine/form';\nimport {CollectionProps} from './Collection';\n\nexport const enhanceWithCollectionProps = <FormValues>(\n payload: Parameters<UseFormInput<FormValues>['enhanceGetInputProps']>[0],\n field: (typeof payload)['field'],\n): Pick<CollectionProps<unknown>, 'onReorderItem' | 'onInsertItem' | 'onRemoveItem'> => {\n if (payload.field === field) {\n return {\n onReorderItem: (reorderPayload: Record<'from' | 'to', number>) =>\n payload.form.reorderListItem(field, reorderPayload),\n onRemoveItem: (index: number) => payload.form.removeListItem(field, index),\n onInsertItem: (valueToInsert: unknown, index: number) =>\n payload.form.insertListItem(field, valueToInsert, index),\n };\n }\n\n return {};\n};\n"],"names":["enhanceWithCollectionProps","payload","field","onReorderItem","reorderPayload","form","reorderListItem","onRemoveItem","index","removeListItem","onInsertItem","valueToInsert","insertListItem"],"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/collection/enhanceWithCollectionProps.ts"],"sourcesContent":["import {UseFormInput} from '@mantine/form';\nimport {CollectionProps} from './Collection';\n\nexport const enhanceWithCollectionProps = <FormValues>(\n payload: Parameters<UseFormInput<FormValues>['enhanceGetInputProps']>[0],\n field: (typeof payload)['field'],\n): Pick<CollectionProps<unknown>, 'onReorderItem' | 'onInsertItem' | 'onRemoveItem'> => {\n if (payload.field === field) {\n return {\n onReorderItem: (reorderPayload: Record<'from' | 'to', number>) =>\n payload.form.reorderListItem(field, reorderPayload),\n onRemoveItem: (index: number) => payload.form.removeListItem(field, index),\n onInsertItem: (valueToInsert: unknown, index: number) =>\n payload.form.insertListItem(field, valueToInsert, index),\n };\n }\n\n return {};\n};\n"],"names":["enhanceWithCollectionProps","payload","field","onReorderItem","reorderPayload","form","reorderListItem","onRemoveItem","index","removeListItem","onInsertItem","valueToInsert","insertListItem"],"mappings":"AAGA,OAAO,MAAMA,6BAA6B,CACtCC,SACAC;IAEA,IAAID,QAAQC,KAAK,KAAKA,OAAO;QACzB,OAAO;YACHC,eAAe,CAACC,iBACZH,QAAQI,IAAI,CAACC,eAAe,CAACJ,OAAOE;YACxCG,cAAc,CAACC,QAAkBP,QAAQI,IAAI,CAACI,cAAc,CAACP,OAAOM;YACpEE,cAAc,CAACC,eAAwBH,QACnCP,QAAQI,IAAI,CAACO,cAAc,CAACV,OAAOS,eAAeH;QAC1D;IACJ;IAEA,OAAO,CAAC;AACZ,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/collection/index.ts"],"sourcesContent":["export * from './Collection';\nexport {enhanceWithCollectionProps} from './enhanceWithCollectionProps';\n"],"names":["enhanceWithCollectionProps"],"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/collection/index.ts"],"sourcesContent":["export * from './Collection';\nexport {enhanceWithCollectionProps} from './enhanceWithCollectionProps';\n"],"names":["enhanceWithCollectionProps"],"mappings":"AAAA,cAAc,eAAe;AAC7B,SAAQA,0BAA0B,QAAO,+BAA+B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CopyToClipboard.d.ts","sourceRoot":"","sources":["../../../../src/components/copyToClipboard/CopyToClipboard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CopyToClipboard.d.ts","sourceRoot":"","sources":["../../../../src/components/copyToClipboard/CopyToClipboard.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,oBAAoB;IACjC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAqBD,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,iBAAiB,CAAC,oBAAoB,CAWrE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/copyToClipboard/CopyToClipboard.tsx"],"sourcesContent":["import {CheckSize16Px, CopySize16Px} from '@coveord/plasma-react-icons';\nimport {ActionIcon, CopyButton, TextInput, Tooltip} from '@mantine/core';\n\nexport interface CopyToClipboardProps {\n /**\n * The value to be copied to the clipboard.\n */\n value: string;\n /**\n * Whether to display the string to be copied alongside the button.\n *\n * @default false\n */\n withLabel?: boolean;\n /**\n * Called each time the value is copied to the clipboard\n */\n onCopy?: () => void;\n}\n\nconst CopyToClipboardButton: React.FunctionComponent<Omit<CopyToClipboardProps, 'withLabel'>> = ({value, onCopy}) => (\n <CopyButton value={value} timeout={2000}>\n {({copied, copy}) => (\n <Tooltip label={copied ? 'Copied' : 'Copy'}>\n <ActionIcon\n variant=\"subtle\"\n color={copied ? 'success' : 'gray'}\n onClick={() => {\n copy();\n onCopy?.();\n }}\n >\n {copied ? <CheckSize16Px height={16} /> : <CopySize16Px height={16} />}\n </ActionIcon>\n </Tooltip>\n )}\n </CopyButton>\n);\n\nexport const CopyToClipboard: React.FunctionComponent<CopyToClipboardProps> = ({withLabel, ...others}) =>\n withLabel ? (\n <TextInput\n classNames={{input: 'var(--mantine-color-gray-7)'}}\n value={others.value}\n readOnly\n autoComplete=\"off\"\n rightSection={<CopyToClipboardButton {...others} />}\n />\n ) : (\n <CopyToClipboardButton {...others} />\n );\n"],"names":["CheckSize16Px","CopySize16Px","ActionIcon","CopyButton","TextInput","Tooltip","CopyToClipboardButton","value","onCopy","timeout","copied","copy","label","variant","color","onClick","height","CopyToClipboard","withLabel","others","classNames","input","readOnly","autoComplete","rightSection"],"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/copyToClipboard/CopyToClipboard.tsx"],"sourcesContent":["import {CheckSize16Px, CopySize16Px} from '@coveord/plasma-react-icons';\nimport {ActionIcon, CopyButton, TextInput, Tooltip} from '@mantine/core';\n\nexport interface CopyToClipboardProps {\n /**\n * The value to be copied to the clipboard.\n */\n value: string;\n /**\n * Whether to display the string to be copied alongside the button.\n *\n * @default false\n */\n withLabel?: boolean;\n /**\n * Called each time the value is copied to the clipboard\n */\n onCopy?: () => void;\n}\n\nconst CopyToClipboardButton: React.FunctionComponent<Omit<CopyToClipboardProps, 'withLabel'>> = ({value, onCopy}) => (\n <CopyButton value={value} timeout={2000}>\n {({copied, copy}) => (\n <Tooltip label={copied ? 'Copied' : 'Copy'}>\n <ActionIcon\n variant=\"subtle\"\n color={copied ? 'success' : 'gray'}\n onClick={() => {\n copy();\n onCopy?.();\n }}\n >\n {copied ? <CheckSize16Px height={16} /> : <CopySize16Px height={16} />}\n </ActionIcon>\n </Tooltip>\n )}\n </CopyButton>\n);\n\nexport const CopyToClipboard: React.FunctionComponent<CopyToClipboardProps> = ({withLabel, ...others}) =>\n withLabel ? (\n <TextInput\n classNames={{input: 'var(--mantine-color-gray-7)'}}\n value={others.value}\n readOnly\n autoComplete=\"off\"\n rightSection={<CopyToClipboardButton {...others} />}\n />\n ) : (\n <CopyToClipboardButton {...others} />\n );\n"],"names":["CheckSize16Px","CopySize16Px","ActionIcon","CopyButton","TextInput","Tooltip","CopyToClipboardButton","value","onCopy","timeout","copied","copy","label","variant","color","onClick","height","CopyToClipboard","withLabel","others","classNames","input","readOnly","autoComplete","rightSection"],"mappings":";AAAA,SAAQA,aAAa,EAAEC,YAAY,QAAO,8BAA8B;AACxE,SAAQC,UAAU,EAAEC,UAAU,EAAEC,SAAS,EAAEC,OAAO,QAAO,gBAAgB;AAmBzE,MAAMC,wBAA0F,CAAC,EAACC,KAAK,EAAEC,MAAM,EAAC,iBAC5G,KAACL;QAAWI,OAAOA;QAAOE,SAAS;kBAC9B,CAAC,EAACC,MAAM,EAAEC,IAAI,EAAC,iBACZ,KAACN;gBAAQO,OAAOF,SAAS,WAAW;0BAChC,cAAA,KAACR;oBACGW,SAAQ;oBACRC,OAAOJ,SAAS,YAAY;oBAC5BK,SAAS;wBACLJ;wBACAH;oBACJ;8BAECE,uBAAS,KAACV;wBAAcgB,QAAQ;uCAAS,KAACf;wBAAae,QAAQ;;;;;AAOpF,OAAO,MAAMC,kBAAiE,CAAC,EAACC,SAAS,EAAE,GAAGC,QAAO,GACjGD,0BACI,KAACd;QACGgB,YAAY;YAACC,OAAO;QAA6B;QACjDd,OAAOY,OAAOZ,KAAK;QACnBe,QAAQ;QACRC,cAAa;QACbC,4BAAc,KAAClB;YAAuB,GAAGa,MAAM;;uBAGnD,KAACb;QAAuB,GAAGa,MAAM;OACnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/copyToClipboard/index.ts"],"sourcesContent":["export * from './CopyToClipboard';\n"],"names":[],"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/copyToClipboard/index.ts"],"sourcesContent":["export * from './CopyToClipboard';\n"],"names":[],"mappings":"AAAA,cAAc,oBAAoB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/date-range-picker/DateRangePickerInlineCalendar.tsx"],"sourcesContent":["import {Center, Group, Space} from '@mantine/core';\nimport {DatePicker, DatePickerBaseProps} from '@mantine/dates';\nimport {useForm} from '@mantine/form';\n\nimport {Button} from '../button';\nimport DateRangeClasses from './DateRange.module.css';\nimport {DateRangePickerPreset, DateRangePickerPresetSelect} from './DateRangePickerPresetSelect';\nimport {EditableDateRangePicker, EditableDateRangePickerProps} from './EditableDateRangePicker';\n\nexport type DateRangePickerValue = [Date | null, Date | null];\nexport interface DateRangePickerInlineCalendarProps\n extends Pick<EditableDateRangePickerProps, 'startProps' | 'endProps'> {\n /**\n * Initial selected range\n */\n initialRange: DateRangePickerValue;\n /**\n * Function called when the user applies the new date range\n *\n * @param range the newly selected dates\n */\n onApply: (range: DateRangePickerValue) => void;\n /**\n * Function called when the user click on the cancel button\n */\n onCancel: () => void;\n /**\n * The presets to display\n *\n * @default {}\n * @example\n * {\n * january: {label: 'January', range: [new Date(2022, 0, 1), new Date(2022, 0, 31)]},\n * february: {label: 'February', range: [new Date(2022, 1, 1), new Date(2022, 1, 28)]}\n * }\n */\n presets?: Record<string, DateRangePickerPreset>;\n /**\n * Props for RangeCalendar displayed in the popover\n */\n rangeCalendarProps?: Omit<\n DatePickerBaseProps,\n 'value' | 'onChange' | 'isDateInRange' | 'isDateFirstInRange' | 'isDateLastInRange'\n >;\n}\n\nexport const DateRangePickerInlineCalendar = ({\n initialRange,\n onApply,\n onCancel,\n presets,\n startProps,\n endProps,\n rangeCalendarProps,\n}: DateRangePickerInlineCalendarProps) => {\n const form = useForm({\n initialValues: {\n dates: initialRange,\n },\n });\n const calendarInputProps = form.getInputProps('dates');\n\n const onCalendarApply = () => {\n if (!form.values.dates[1]) {\n form.values.dates[1] = form.values.dates[0]; // when date range is the same day\n }\n onApply(form.values.dates);\n };\n\n return (\n <>\n <Group align=\"center\" gap=\"xs\" grow px=\"md\" py=\"sm\" className={DateRangeClasses.picker}>\n <EditableDateRangePicker\n value={calendarInputProps.value}\n {...calendarInputProps}\n startProps={startProps}\n endProps={endProps}\n />\n {presets ? (\n <>\n <Space w=\"sm\" />\n <DateRangePickerPresetSelect\n value={calendarInputProps.value}\n presets={presets}\n {...calendarInputProps}\n selectProps={{comboboxProps: {withinPortal: false}}}\n />\n </>\n ) : null}\n </Group>\n\n <Center py=\"sm\" px=\"md\">\n <DatePicker\n numberOfColumns={2}\n type=\"range\"\n styles={{day: {textAlign: 'center'}}}\n firstDayOfWeek={0}\n allowSingleDateInRange\n {...rangeCalendarProps}\n {...calendarInputProps}\n />\n </Center>\n\n <Group justify=\"right\" gap=\"xs\" px=\"md\" py=\"sm\" className={DateRangeClasses.save}>\n <Button variant=\"outline\" size=\"xs\" onClick={onCancel}>\n Cancel\n </Button>\n <Button size=\"xs\" onClick={onCalendarApply}>\n Apply\n </Button>\n </Group>\n </>\n );\n};\n"],"names":["Center","Group","Space","DatePicker","useForm","Button","DateRangeClasses","DateRangePickerPresetSelect","EditableDateRangePicker","DateRangePickerInlineCalendar","initialRange","onApply","onCancel","presets","startProps","endProps","rangeCalendarProps","form","initialValues","dates","calendarInputProps","getInputProps","onCalendarApply","values","align","gap","grow","px","py","className","picker","value","w","selectProps","comboboxProps","withinPortal","numberOfColumns","type","styles","day","textAlign","firstDayOfWeek","allowSingleDateInRange","justify","save","variant","size","onClick"],"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/date-range-picker/DateRangePickerInlineCalendar.tsx"],"sourcesContent":["import {Center, Group, Space} from '@mantine/core';\nimport {DatePicker, DatePickerBaseProps} from '@mantine/dates';\nimport {useForm} from '@mantine/form';\n\nimport {Button} from '../button';\nimport DateRangeClasses from './DateRange.module.css';\nimport {DateRangePickerPreset, DateRangePickerPresetSelect} from './DateRangePickerPresetSelect';\nimport {EditableDateRangePicker, EditableDateRangePickerProps} from './EditableDateRangePicker';\n\nexport type DateRangePickerValue = [Date | null, Date | null];\nexport interface DateRangePickerInlineCalendarProps\n extends Pick<EditableDateRangePickerProps, 'startProps' | 'endProps'> {\n /**\n * Initial selected range\n */\n initialRange: DateRangePickerValue;\n /**\n * Function called when the user applies the new date range\n *\n * @param range the newly selected dates\n */\n onApply: (range: DateRangePickerValue) => void;\n /**\n * Function called when the user click on the cancel button\n */\n onCancel: () => void;\n /**\n * The presets to display\n *\n * @default {}\n * @example\n * {\n * january: {label: 'January', range: [new Date(2022, 0, 1), new Date(2022, 0, 31)]},\n * february: {label: 'February', range: [new Date(2022, 1, 1), new Date(2022, 1, 28)]}\n * }\n */\n presets?: Record<string, DateRangePickerPreset>;\n /**\n * Props for RangeCalendar displayed in the popover\n */\n rangeCalendarProps?: Omit<\n DatePickerBaseProps,\n 'value' | 'onChange' | 'isDateInRange' | 'isDateFirstInRange' | 'isDateLastInRange'\n >;\n}\n\nexport const DateRangePickerInlineCalendar = ({\n initialRange,\n onApply,\n onCancel,\n presets,\n startProps,\n endProps,\n rangeCalendarProps,\n}: DateRangePickerInlineCalendarProps) => {\n const form = useForm({\n initialValues: {\n dates: initialRange,\n },\n });\n const calendarInputProps = form.getInputProps('dates');\n\n const onCalendarApply = () => {\n if (!form.values.dates[1]) {\n form.values.dates[1] = form.values.dates[0]; // when date range is the same day\n }\n onApply(form.values.dates);\n };\n\n return (\n <>\n <Group align=\"center\" gap=\"xs\" grow px=\"md\" py=\"sm\" className={DateRangeClasses.picker}>\n <EditableDateRangePicker\n value={calendarInputProps.value}\n {...calendarInputProps}\n startProps={startProps}\n endProps={endProps}\n />\n {presets ? (\n <>\n <Space w=\"sm\" />\n <DateRangePickerPresetSelect\n value={calendarInputProps.value}\n presets={presets}\n {...calendarInputProps}\n selectProps={{comboboxProps: {withinPortal: false}}}\n />\n </>\n ) : null}\n </Group>\n\n <Center py=\"sm\" px=\"md\">\n <DatePicker\n numberOfColumns={2}\n type=\"range\"\n styles={{day: {textAlign: 'center'}}}\n firstDayOfWeek={0}\n allowSingleDateInRange\n {...rangeCalendarProps}\n {...calendarInputProps}\n />\n </Center>\n\n <Group justify=\"right\" gap=\"xs\" px=\"md\" py=\"sm\" className={DateRangeClasses.save}>\n <Button variant=\"outline\" size=\"xs\" onClick={onCancel}>\n Cancel\n </Button>\n <Button size=\"xs\" onClick={onCalendarApply}>\n Apply\n </Button>\n </Group>\n </>\n );\n};\n"],"names":["Center","Group","Space","DatePicker","useForm","Button","DateRangeClasses","DateRangePickerPresetSelect","EditableDateRangePicker","DateRangePickerInlineCalendar","initialRange","onApply","onCancel","presets","startProps","endProps","rangeCalendarProps","form","initialValues","dates","calendarInputProps","getInputProps","onCalendarApply","values","align","gap","grow","px","py","className","picker","value","w","selectProps","comboboxProps","withinPortal","numberOfColumns","type","styles","day","textAlign","firstDayOfWeek","allowSingleDateInRange","justify","save","variant","size","onClick"],"mappings":";AAAA,SAAQA,MAAM,EAAEC,KAAK,EAAEC,KAAK,QAAO,gBAAgB;AACnD,SAAQC,UAAU,QAA4B,iBAAiB;AAC/D,SAAQC,OAAO,QAAO,gBAAgB;AAEtC,SAAQC,MAA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BAAkB;oBACrB,GAAGI,kBAAkB;;;0BAI9B,MAACnB;gBAAM0C,SAAQ;gBAAQlB,KAAI;gBAAKE,IAAG;gBAAKC,IAAG;gBAAKC,WAAWvB,iBAAiBsC,IAAI;;kCAC5E,KAACvC;wBAAOwC,SAAQ;wBAAUC,MAAK;wBAAKC,SAASnC;kCAAU;;kCAGvD,KAACP;wBAAOyC,MAAK;wBAAKC,SAASzB;kCAAiB;;;;;;AAM5D,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateRangePickerPopoverCalendar.d.ts","sourceRoot":"","sources":["../../../../src/components/date-range-picker/DateRangePickerPopoverCalendar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,iBAAiB,EAAa,MAAM,gBAAgB,CAAC;AAI7D,OAAO,EAAC,oBAAoB,EAAC,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAC,qBAAqB,EAA8B,MAAM,+BAA+B,CAAC;AACjG,OAAO,EAA0B,4BAA4B,EAAC,MAAM,2BAA2B,CAAC;AAEhG,UAAU,mCAAmC,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,4BAA4B,EAAE,YAAY,GAAG,UAAU,CAAC;IAClH,2CAA2C;IAC3C,YAAY,CAAC,EAAE,oBAAoB,CAAC;IACpC,iCAAiC;IACjC,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAC7B,0CAA0C;IAC1C,QAAQ,CAAC,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC7C;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAEhD;;OAEG;IACH,kBAAkB,CAAC,EAAE,IAAI,CACrB,iBAAiB,EACjB,OAAO,GAAG,UAAU,GAAG,eAAe,GAAG,oBAAoB,GAAG,mBAAmB,CACtF,CAAC;CACL;AAED,eAAO,MAAM,8BAA8B,
|
|
1
|
+
{"version":3,"file":"DateRangePickerPopoverCalendar.d.ts","sourceRoot":"","sources":["../../../../src/components/date-range-picker/DateRangePickerPopoverCalendar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,iBAAiB,EAAa,MAAM,gBAAgB,CAAC;AAI7D,OAAO,EAAC,oBAAoB,EAAC,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAC,qBAAqB,EAA8B,MAAM,+BAA+B,CAAC;AACjG,OAAO,EAA0B,4BAA4B,EAAC,MAAM,2BAA2B,CAAC;AAEhG,UAAU,mCAAmC,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,4BAA4B,EAAE,YAAY,GAAG,UAAU,CAAC;IAClH,2CAA2C;IAC3C,YAAY,CAAC,EAAE,oBAAoB,CAAC;IACpC,iCAAiC;IACjC,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAC7B,0CAA0C;IAC1C,QAAQ,CAAC,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC7C;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAEhD;;OAEG;IACH,kBAAkB,CAAC,EAAE,IAAI,CACrB,iBAAiB,EACjB,OAAO,GAAG,UAAU,GAAG,eAAe,GAAG,oBAAoB,GAAG,mBAAmB,CACtF,CAAC;CACL;AAED,eAAO,MAAM,8BAA8B,GAAI,CAAC,SAAS,OAAO,yFAQ7D,mCAAmC,CAAC,CAAC,CAAC,4CAqDxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/date-range-picker/DateRangePickerPopoverCalendar.tsx"],"sourcesContent":["import {Group, Popover, Space} from '@mantine/core';\nimport {CalendarBaseProps, DatePicker} from '@mantine/dates';\nimport {useClickOutside, useUncontrolled} from '@mantine/hooks';\nimport {useState} from 'react';\n\nimport {DateRangePickerValue} from './DateRangePickerInlineCalendar';\nimport {DateRangePickerPreset, DateRangePickerPresetSelect} from './DateRangePickerPresetSelect';\nimport {EditableDateRangePicker, EditableDateRangePickerProps} from './EditableDateRangePicker';\n\ninterface DateRangePickerPopoverCalendarProps<T> extends Pick<EditableDateRangePickerProps, 'startProps' | 'endProps'> {\n /** Default value for uncontrolled input */\n defaultValue?: DateRangePickerValue;\n /** Value for controlled input */\n value?: DateRangePickerValue;\n /** onChange value for controlled input */\n onChange?(value: DateRangePickerValue): void;\n /**\n * The presets to display\n *\n * @default {}\n * @example\n * {\n * january: {label: 'January', range: [new Date(2022, 0, 1), new Date(2022, 0, 31)]},\n * february: {label: 'February', range: [new Date(2022, 1, 1), new Date(2022, 1, 28)]}\n * }\n */\n presets?: Record<string, DateRangePickerPreset>;\n\n /**\n * Props for RangeCalendar\n */\n rangeCalendarProps?: Omit<\n CalendarBaseProps,\n 'value' | 'onChange' | 'isDateInRange' | 'isDateFirstInRange' | 'isDateLastInRange'\n >;\n}\n\nexport const DateRangePickerPopoverCalendar = <T extends unknown>({\n presets,\n value,\n defaultValue,\n onChange,\n startProps,\n endProps,\n rangeCalendarProps,\n}: DateRangePickerPopoverCalendarProps<T>) => {\n const [opened, setOpened] = useState(false);\n const ref = useClickOutside(() => setOpened(false));\n\n const [_value, handleChange] = useUncontrolled<DateRangePickerValue>({\n value,\n defaultValue,\n onChange,\n finalValue: [null, null],\n });\n\n const onCalendarChange = (dates: DateRangePickerValue) => {\n handleChange?.(dates);\n if (dates[1] !== null) {\n setOpened(false);\n }\n };\n\n return (\n <>\n <Group align=\"center\">\n <EditableDateRangePicker\n value={_value}\n onChange={handleChange}\n onFocus={() => setOpened(true)}\n startProps={startProps}\n endProps={endProps}\n />\n {presets ? (\n <>\n <Space w=\"sm\" />\n <DateRangePickerPresetSelect presets={presets} value={_value} onChange={handleChange} />\n </>\n ) : null}\n </Group>\n\n <Popover opened={opened} onChange={setOpened} trapFocus>\n <Popover.Dropdown>\n <DatePicker\n ref={ref}\n type=\"range\"\n styles={{day: {textAlign: 'center'}}}\n numberOfColumns={2}\n firstDayOfWeek={0}\n allowSingleDateInRange\n value={_value}\n onChange={onCalendarChange}\n {...rangeCalendarProps}\n />\n </Popover.Dropdown>\n </Popover>\n </>\n );\n};\n"],"names":["Group","Popover","Space","DatePicker","useClickOutside","useUncontrolled","useState","DateRangePickerPresetSelect","EditableDateRangePicker","DateRangePickerPopoverCalendar","presets","value","defaultValue","onChange","startProps","endProps","rangeCalendarProps","opened","setOpened","ref","_value","handleChange","finalValue","onCalendarChange","dates","align","onFocus","w","trapFocus","Dropdown","type","styles","day","textAlign","numberOfColumns","firstDayOfWeek","allowSingleDateInRange"],"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/date-range-picker/DateRangePickerPopoverCalendar.tsx"],"sourcesContent":["import {Group, Popover, Space} from '@mantine/core';\nimport {CalendarBaseProps, DatePicker} from '@mantine/dates';\nimport {useClickOutside, useUncontrolled} from '@mantine/hooks';\nimport {useState} from 'react';\n\nimport {DateRangePickerValue} from './DateRangePickerInlineCalendar';\nimport {DateRangePickerPreset, DateRangePickerPresetSelect} from './DateRangePickerPresetSelect';\nimport {EditableDateRangePicker, EditableDateRangePickerProps} from './EditableDateRangePicker';\n\ninterface DateRangePickerPopoverCalendarProps<T> extends Pick<EditableDateRangePickerProps, 'startProps' | 'endProps'> {\n /** Default value for uncontrolled input */\n defaultValue?: DateRangePickerValue;\n /** Value for controlled input */\n value?: DateRangePickerValue;\n /** onChange value for controlled input */\n onChange?(value: DateRangePickerValue): void;\n /**\n * The presets to display\n *\n * @default {}\n * @example\n * {\n * january: {label: 'January', range: [new Date(2022, 0, 1), new Date(2022, 0, 31)]},\n * february: {label: 'February', range: [new Date(2022, 1, 1), new Date(2022, 1, 28)]}\n * }\n */\n presets?: Record<string, DateRangePickerPreset>;\n\n /**\n * Props for RangeCalendar\n */\n rangeCalendarProps?: Omit<\n CalendarBaseProps,\n 'value' | 'onChange' | 'isDateInRange' | 'isDateFirstInRange' | 'isDateLastInRange'\n >;\n}\n\nexport const DateRangePickerPopoverCalendar = <T extends unknown>({\n presets,\n value,\n defaultValue,\n onChange,\n startProps,\n endProps,\n rangeCalendarProps,\n}: DateRangePickerPopoverCalendarProps<T>) => {\n const [opened, setOpened] = useState(false);\n const ref = useClickOutside(() => setOpened(false));\n\n const [_value, handleChange] = useUncontrolled<DateRangePickerValue>({\n value,\n defaultValue,\n onChange,\n finalValue: [null, null],\n });\n\n const onCalendarChange = (dates: DateRangePickerValue) => {\n handleChange?.(dates);\n if (dates[1] !== null) {\n setOpened(false);\n }\n };\n\n return (\n <>\n <Group align=\"center\">\n <EditableDateRangePicker\n value={_value}\n onChange={handleChange}\n onFocus={() => setOpened(true)}\n startProps={startProps}\n endProps={endProps}\n />\n {presets ? (\n <>\n <Space w=\"sm\" />\n <DateRangePickerPresetSelect presets={presets} value={_value} onChange={handleChange} />\n </>\n ) : null}\n </Group>\n\n <Popover opened={opened} onChange={setOpened} trapFocus>\n <Popover.Dropdown>\n <DatePicker\n ref={ref}\n type=\"range\"\n styles={{day: {textAlign: 'center'}}}\n numberOfColumns={2}\n firstDayOfWeek={0}\n allowSingleDateInRange\n value={_value}\n onChange={onCalendarChange}\n {...rangeCalendarProps}\n />\n </Popover.Dropdown>\n </Popover>\n </>\n );\n};\n"],"names":["Group","Popover","Space","DatePicker","useClickOutside","useUncontrolled","useState","DateRangePickerPresetSelect","EditableDateRangePicker","DateRangePickerPopoverCalendar","presets","value","defaultValue","onChange","startProps","endProps","rangeCalendarProps","opened","setOpened","ref","_value","handleChange","finalValue","onCalendarChange","dates","align","onFocus","w","trapFocus","Dropdown","type","styles","day","textAlign","numberOfColumns","firstDayOfWeek","allowSingleDateInRange"],"mappings":";AAAA,SAAQA,KAAK,EAAEC,OAAO,EAAEC,KAAK,QAAO,gBAAgB;AACpD,SAA2BC,UAAU,QAAO,iBAAiB;AAC7D,SAAQC,eAAe,EAAEC,eAAe,QAAO,iBAAiB;AAChE,SAAQC,QAAQ,QAAO,QAAQ;AAG/B,SAA+BC,2BAA2B,QAAO,gCAAgC;AACjG,SAAQC,uBAAuB,QAAqC,4BAA4B;AA8BhG,OAAO,MAAMC,iCAAiC,CAAoB,EAC9DC,OAAO,EACPC,KAAK,EACLC,YAAY,EACZC,QAAQ,EACRC,UAAU,EACVC,QAAQ,EACRC,kBAAkB,EACmB;IACrC,MAAM,CAACC,QAAQC,UAAU,GAAGZ,SAAS;IACrC,MAAMa,MAAMf,gBAAgB,IAAMc,UAAU;IAE5C,MAAM,CAACE,QAAQC,aAAa,GAAGhB,gBAAsC;QACjEM;QACAC;QACAC;QACAS,YAAY;YAAC;YAAM;SAAK;IAC5B;IAEA,MAAMC,mBAAmB,CAACC;QACtBH,eAAeG;QACf,IAAIA,KAAK,CAAC,EAAE,KAAK,MAAM;YACnBN,UAAU;QACd;IACJ;IAEA,qBACI;;0BACI,MAAClB;gBAAMyB,OAAM;;kCACT,KAACjB;wBACGG,OAAOS;wBACPP,UAAUQ;wBACVK,SAAS,IAAMR,UAAU;wBACzBJ,YAAYA;wBACZC,UAAUA;;oBAEbL,wBACG;;0CACI,KAACR;gCAAMyB,GAAE;;0CACT,KAACpB;gCAA4BG,SAASA;gCAASC,OAAOS;gCAAQP,UAAUQ;;;yBAE5E;;;0BAGR,KAACpB;gBAAQgB,QAAQA;gBAAQJ,UAAUK;gBAAWU,SAAS;0BACnD,cAAA,KAAC3B,QAAQ4B,QAAQ;8BACb,cAAA,KAAC1B;wBACGgB,KAAKA;wBACLW,MAAK;wBACLC,QAAQ;4BAACC,KAAK;gCAACC,WAAW;4BAAQ;wBAAC;wBACnCC,iBAAiB;wBACjBC,gBAAgB;wBAChBC,sBAAsB;wBACtBzB,OAAOS;wBACPP,UAAUU;wBACT,GAAGP,kBAAkB;;;;;;AAM9C,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateRangePickerPresetSelect.d.ts","sourceRoot":"","sources":["../../../../src/components/date-range-picker/DateRangePickerPresetSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,WAAW,EAAC,MAAM,eAAe,CAAC;AAGhE,OAAO,EAAC,oBAAoB,EAAC,MAAM,iCAAiC,CAAC;AAErE,MAAM,WAAW,qBAAqB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,oBAAoB,CAAC;CAC/B;AAED,UAAU,iCAAiC,CAAC,CAAC;IACzC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAC/C,KAAK,EAAE,oBAAoB,CAAC;IAC5B,QAAQ,CAAC,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC7C,WAAW,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC;CAC3E;AAED,eAAO,MAAM,2BAA2B,
|
|
1
|
+
{"version":3,"file":"DateRangePickerPresetSelect.d.ts","sourceRoot":"","sources":["../../../../src/components/date-range-picker/DateRangePickerPresetSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,WAAW,EAAC,MAAM,eAAe,CAAC;AAGhE,OAAO,EAAC,oBAAoB,EAAC,MAAM,iCAAiC,CAAC;AAErE,MAAM,WAAW,qBAAqB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,oBAAoB,CAAC;CAC/B;AAED,UAAU,iCAAiC,CAAC,CAAC;IACzC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAC/C,KAAK,EAAE,oBAAoB,CAAC;IAC5B,QAAQ,CAAC,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC7C,WAAW,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC;CAC3E;AAED,eAAO,MAAM,2BAA2B,GAAI,CAAC,SAAS,OAAO,8CAK1D,iCAAiC,CAAC,CAAC,CAAC,4CAwCtC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/date-range-picker/DateRangePickerPresetSelect.tsx"],"sourcesContent":["import {ComboboxItem, Select, SelectProps} from '@mantine/core';\nimport dayjs from 'dayjs';\nimport {useEffect, useState} from 'react';\nimport {DateRangePickerValue} from './DateRangePickerInlineCalendar';\n\nexport interface DateRangePickerPreset {\n label: string;\n range: DateRangePickerValue;\n}\n\ninterface DateRangePickerPresetsSelectProps<T> {\n presets: Record<string, DateRangePickerPreset>;\n value: DateRangePickerValue;\n onChange?(value: DateRangePickerValue): void;\n selectProps?: Partial<Omit<SelectProps, 'data' | 'value' | 'onChange'>>;\n}\n\nexport const DateRangePickerPresetSelect = <T extends unknown>({\n presets,\n value,\n onChange,\n selectProps = {},\n}: DateRangePickerPresetsSelectProps<T>) => {\n const selectData: ComboboxItem[] = Object.entries(presets).map(([val, {label}]) => ({value: val, label}));\n\n const getSelectedPreset = () => {\n if (value[0] !== null && value[1] !== null && dayjs(value[0]).unix() !== dayjs(value[1]).unix()) {\n const selected = Object.entries(presets).find(\n ([id, {range}]) => dayjs(range[0]!).isSame(value[0]) && dayjs(value[1]!).isSame(value[1]!),\n );\n if (selected) {\n return selected[0];\n }\n }\n return null;\n };\n\n const [selectedPreset, setSelectedPreset] = useState<string | null>(getSelectedPreset());\n\n useEffect(() => {\n const newPreset = getSelectedPreset();\n if (newPreset !== selectedPreset) {\n setSelectedPreset(newPreset);\n }\n }, [value]);\n\n const onChangePreset = (presetId: keyof typeof presets) => {\n const range = presets[presetId].range as any;\n onChange?.(range);\n };\n\n return (\n <Select\n label=\"Date range\"\n placeholder=\"Select a date range\"\n {...selectProps}\n value={selectedPreset}\n onChange={onChangePreset}\n data={selectData}\n maxDropdownHeight={240}\n />\n );\n};\n"],"names":["Select","dayjs","useEffect","useState","DateRangePickerPresetSelect","presets","value","onChange","selectProps","selectData","Object","entries","map","val","label","getSelectedPreset","unix","selected","find","id","range","isSame","selectedPreset","setSelectedPreset","newPreset","onChangePreset","presetId","placeholder","data","maxDropdownHeight"],"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/date-range-picker/DateRangePickerPresetSelect.tsx"],"sourcesContent":["import {ComboboxItem, Select, SelectProps} from '@mantine/core';\nimport dayjs from 'dayjs';\nimport {useEffect, useState} from 'react';\nimport {DateRangePickerValue} from './DateRangePickerInlineCalendar';\n\nexport interface DateRangePickerPreset {\n label: string;\n range: DateRangePickerValue;\n}\n\ninterface DateRangePickerPresetsSelectProps<T> {\n presets: Record<string, DateRangePickerPreset>;\n value: DateRangePickerValue;\n onChange?(value: DateRangePickerValue): void;\n selectProps?: Partial<Omit<SelectProps, 'data' | 'value' | 'onChange'>>;\n}\n\nexport const DateRangePickerPresetSelect = <T extends unknown>({\n presets,\n value,\n onChange,\n selectProps = {},\n}: DateRangePickerPresetsSelectProps<T>) => {\n const selectData: ComboboxItem[] = Object.entries(presets).map(([val, {label}]) => ({value: val, label}));\n\n const getSelectedPreset = () => {\n if (value[0] !== null && value[1] !== null && dayjs(value[0]).unix() !== dayjs(value[1]).unix()) {\n const selected = Object.entries(presets).find(\n ([id, {range}]) => dayjs(range[0]!).isSame(value[0]) && dayjs(value[1]!).isSame(value[1]!),\n );\n if (selected) {\n return selected[0];\n }\n }\n return null;\n };\n\n const [selectedPreset, setSelectedPreset] = useState<string | null>(getSelectedPreset());\n\n useEffect(() => {\n const newPreset = getSelectedPreset();\n if (newPreset !== selectedPreset) {\n setSelectedPreset(newPreset);\n }\n }, [value]);\n\n const onChangePreset = (presetId: keyof typeof presets) => {\n const range = presets[presetId].range as any;\n onChange?.(range);\n };\n\n return (\n <Select\n label=\"Date range\"\n placeholder=\"Select a date range\"\n {...selectProps}\n value={selectedPreset}\n onChange={onChangePreset}\n data={selectData}\n maxDropdownHeight={240}\n />\n );\n};\n"],"names":["Select","dayjs","useEffect","useState","DateRangePickerPresetSelect","presets","value","onChange","selectProps","selectData","Object","entries","map","val","label","getSelectedPreset","unix","selected","find","id","range","isSame","selectedPre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;QACNa,aAAY;QACX,GAAGnB,WAAW;QACfF,OAAOgB;QACPf,UAAUkB;QACVG,MAAMnB;QACNoB,mBAAmB;;AAG/B,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/date-range-picker/EditableDateRangePicker.tsx"],"sourcesContent":["import {DateInput, DatePickerProps} from '@mantine/dates';\nimport dayjs from 'dayjs';\nimport {DateRangePickerValue} from './DateRangePickerInlineCalendar';\n\nexport interface EditableDateRangePickerProps {\n value: DateRangePickerValue;\n onChange?(value: DateRangePickerValue): void;\n onFocus?: () => void;\n /**\n * Props for the start input\n */\n startProps?: Omit<Partial<DatePickerProps>, 'value' | 'onChange' | 'onFocus'>;\n /**\n * Props for the end input\n */\n endProps?: Omit<Partial<DatePickerProps>, 'value' | 'onChange' | 'onFocus'>;\n}\n\nexport const EditableDateRangePicker = ({\n value,\n onChange,\n onFocus,\n startProps = {},\n endProps = {},\n}: EditableDateRangePickerProps) => {\n const onChangeStart = (date: Date) => {\n onChange?.([dayjs(date).startOf('day').toDate(), value?.[1]]);\n };\n const onChangeEnd = (date: Date) => {\n onChange?.([value?.[0], dayjs(date).endOf('day').toDate()]);\n };\n\n return (\n <>\n <DateInput\n clearable={false}\n label=\"Start\"\n value={value?.[0]}\n onChange={onChangeStart}\n onFocus={onFocus}\n popoverProps={{styles: {dropdown: {display: 'none'}}}}\n styles={{...startProps.styles}}\n />\n <DateInput\n clearable={false}\n label=\"End\"\n value={value?.[1]}\n onChange={onChangeEnd}\n onFocus={onFocus}\n popoverProps={{styles: {dropdown: {display: 'none'}}}}\n styles={{...endProps.styles}}\n />\n </>\n );\n};\n"],"names":["DateInput","dayjs","EditableDateRangePicker","value","onChange","onFocus","startProps","endProps","onChangeStart","date","startOf","toDate","onChangeEnd","endOf","clearable","label","popoverProps","styles","dropdown","display"],"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/date-range-picker/EditableDateRangePicker.tsx"],"sourcesContent":["import {DateInput, DatePickerProps} from '@mantine/dates';\nimport dayjs from 'dayjs';\nimport {DateRangePickerValue} from './DateRangePickerInlineCalendar';\n\nexport interface EditableDateRangePickerProps {\n value: DateRangePickerValue;\n onChange?(value: DateRangePickerValue): void;\n onFocus?: () => void;\n /**\n * Props for the start input\n */\n startProps?: Omit<Partial<DatePickerProps>, 'value' | 'onChange' | 'onFocus'>;\n /**\n * Props for the end input\n */\n endProps?: Omit<Partial<DatePickerProps>, 'value' | 'onChange' | 'onFocus'>;\n}\n\nexport const EditableDateRangePicker = ({\n value,\n onChange,\n onFocus,\n startProps = {},\n endProps = {},\n}: EditableDateRangePickerProps) => {\n const onChangeStart = (date: Date) => {\n onChange?.([dayjs(date).startOf('day').toDate(), value?.[1]]);\n };\n const onChangeEnd = (date: Date) => {\n onChange?.([value?.[0], dayjs(date).endOf('day').toDate()]);\n };\n\n return (\n <>\n <DateInput\n clearable={false}\n label=\"Start\"\n value={value?.[0]}\n onChange={onChangeStart}\n onFocus={onFocus}\n popoverProps={{styles: {dropdown: {display: 'none'}}}}\n styles={{...startProps.styles}}\n />\n <DateInput\n clearable={false}\n label=\"End\"\n value={value?.[1]}\n onChange={onChangeEnd}\n onFocus={onFocus}\n popoverProps={{styles: {dropdown: {display: 'none'}}}}\n styles={{...endProps.styles}}\n />\n </>\n );\n};\n"],"names":["DateInput","dayjs","EditableDateRangePicker","value","onChange","onFocus","startProps","endProps","onChangeStart","date","startOf","toDate","onChangeEnd","endOf","clearable","label","popoverProps","styles","dropdown","display"],"mappings":";AAAA,SAAQA,SAAS,QAAwB,iBAAiB;AAC1D,OAAOC,WAAW,QAAQ;AAiB1B,OAAO,MAAMC,0BAA0B,CAAC,EACpCC,KAAK,EACLC,QAAQ,EACRC,OAAO,EACPC,aAAa,CAAC,CAAC,EACfC,WAAW,CAAC,CAAC,EACc;IAC3B,MAAMC,gBAAgB,CAACC;QACnBL,WAAW;YAACH,MAAMQ,MAAMC,OAAO,CAAC,OAAOC,MAAM;YAAIR,OAAO,CAAC,EAAE;SAAC;IAChE;IACA,MAAMS,cAAc,CAACH;QACjBL,WAAW;YAACD,OAAO,CAAC,EAAE;YAAEF,MAAMQ,MAAMI,KAAK,CAAC,OAAOF,MAAM;SAAG;IAC9D;IAEA,qBACI;;0BACI,KAACX;gBACGc,WAAW;gBACXC,OAAM;gBACNZ,OAAOA,OAAO,CAAC,EAAE;gBACjBC,UAAUI;gBACVH,SAASA;gBACTW,cAAc;oBAACC,QAAQ;wBAACC,UAAU;4BAACC,SAAS;wBAAM;oBAAC;gBAAC;gBACpDF,QAAQ;oBAAC,GAAGX,WAAWW,MAAM;gBAAA;;0BAEjC,KAACjB;gBACGc,WAAW;gBACXC,OAAM;gBACNZ,OAAOA,OAAO,CAAC,EAAE;gBACjBC,UAAUQ;gBACVP,SAASA;gBACTW,cAAc;oBAACC,QAAQ;wBAACC,UAAU;4BAACC,SAAS;wBAAM;oBAAC;gBAAC;gBACpDF,QAAQ;oBAAC,GAAGV,SAASU,MAAM;gBAAA;;;;AAI3C,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/date-range-picker/index.tsx"],"sourcesContent":["export * from './DateRangePickerInlineCalendar';\nexport * from './DateRangePickerPopoverCalendar';\nexport * from './DateRangePickerPresetSelect';\n"],"names":[],"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/date-range-picker/index.tsx"],"sourcesContent":["export * from './DateRangePickerInlineCalendar';\nexport * from './DateRangePickerPopoverCalendar';\nexport * from './DateRangePickerPresetSelect';\n"],"names":[],"mappings":"AAAA,cAAc,kCAAkC;AAChD,cAAc,mCAAmC;AACjD,cAAc,gCAAgC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { GetStylesApi } from '@mantine/core';
|
|
3
2
|
import type { HeaderFactory } from './Header';
|
|
4
3
|
export interface HeaderContextValue {
|
|
@@ -6,6 +5,6 @@ export interface HeaderContextValue {
|
|
|
6
5
|
}
|
|
7
6
|
export declare const HeaderProvider: ({ children, value }: {
|
|
8
7
|
value: HeaderContextValue;
|
|
9
|
-
children:
|
|
10
|
-
}) => import("react/jsx-runtime").JSX.Element, useHeaderContext: () => HeaderContextValue;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element, useHeaderContext: () => HeaderContextValue & ({} | undefined);
|
|
11
10
|
//# sourceMappingURL=Header.context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.context.d.ts","sourceRoot":"","sources":["../../../../src/components/header/Header.context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Header.context.d.ts","sourceRoot":"","sources":["../../../../src/components/header/Header.context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAoB,MAAM,eAAe,CAAC;AAC9D,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AAE5C,MAAM,WAAW,kBAAkB;IAC/B,SAAS,EAAE,YAAY,CAAC,aAAa,CAAC,CAAC;CAC1C;AAED,eAAO,MAAO,cAAc;;cAHxB,MAAO,SAAS;aAAe,mBAG5B,eAAuB,gBAAgB,6CAE7C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/header/Header.context.ts"],"sourcesContent":["import {GetStylesApi, createSafeContext} from '@mantine/core';\nimport type {HeaderFactory} from './Header';\n\nexport interface HeaderContextValue {\n getStyles: GetStylesApi<HeaderFactory>;\n}\n\nexport const [HeaderProvider, useHeaderContext] = createSafeContext<HeaderContextValue>(\n 'Header component was not found in tree',\n);\n"],"names":["createSafeContext","HeaderProvider","useHeaderContext"],"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/header/Header.context.ts"],"sourcesContent":["import {GetStylesApi, createSafeContext} from '@mantine/core';\nimport type {HeaderFactory} from './Header';\n\nexport interface HeaderContextValue {\n getStyles: GetStylesApi<HeaderFactory>;\n}\n\nexport const [HeaderProvider, useHeaderContext] = createSafeContext<HeaderContextValue>(\n 'Header component was not found in tree',\n);\n"],"names":["createSafeContext","HeaderProvider","useHeaderContext"],"mappings":"AAAA,SAAsBA,iBAAiB,QAAO,gBAAgB;AAO9D,OAAO,MAAM,CAACC,gBAAgBC,iBAAiB,GAAGF,kBAC9C,0CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../../src/components/header/Header.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEH,OAAO,EAEP,UAAU,EAEV,cAAc,EAMjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAyB,SAAS,EAAC,MAAM,OAAO,CAAC;AAGxD,OAAO,EAAC,aAAa,EAAE,uBAAuB,EAAC,MAAM,+BAA+B,CAAC;AACrF,OAAO,EAAC,iBAAiB,EAAE,2BAA2B,EAAC,MAAM,uCAAuC,CAAC;AACrG,OAAO,EAAC,eAAe,EAAE,yBAAyB,EAAC,MAAM,mCAAmC,CAAC;AAE7F,YAAY,EAAC,kBAAkB,EAAC,MAAM,+BAA+B,CAAC;AACtE,YAAY,EAAC,sBAAsB,EAAC,MAAM,uCAAuC,CAAC;AAClF,YAAY,EAAC,oBAAoB,EAAC,MAAM,mCAAmC,CAAC;AAE5E,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,CAAC;AACpD,MAAM,MAAM,gBAAgB,GACtB,MAAM,GACN,OAAO,GACP,aAAa,GACb,SAAS,GACT,yBAAyB,GACzB,2BAA2B,GAC3B,uBAAuB,CAAC;AAE9B,MAAM,WAAW,WAAY,SAAQ,cAAc,CAAC,aAAa,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,YAAY,GAAG,QAAQ,GAAG,MAAM,CAAC;IAClH;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;OAIG;IACH,OAAO,CAA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BAAuB,CAAC;AAE9B,MAAM,WAAW,WAAY,SAAQ,cAAc,CAAC,aAAa,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,YAAY,GAAG,QAAQ,GAAG,MAAM,CAAC;IAClH;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;OAIG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IAClC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACvB;AAED,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC;IAChC,KAAK,EAAE,WAAW,CAAC;IACnB,GAAG,EAAE,cAAc,CAAC;IACpB,OAAO,EAAE,aAAa,CAAC;IACvB,WAAW,EAAE,gBAAgB,CAAC;IAC9B,gBAAgB,EAAE;QACd,WAAW,EAAE,OAAO,iBAAiB,CAAC;QACtC,OAAO,EAAE,OAAO,aAAa,CAAC;QAC9B,SAAS,EAAE,OAAO,eAAe,CAAC;KACrC,CAAC;CACL,CAAC,CAAC;AAQH,eAAO,MAAM,MAAM;WAjBR,WAAW;SACb,cAAc;aACV,aAAa;iBACT,gBAAgB;sBACX;QACd,WAAW,EAAE,OAAO,iBAAiB,CAAC;QACtC,OAAO,EAAE,OAAO,aAAa,CAAC;QAC9B,SAAS,EAAE,OAAO,eAAe,CAAC;KACrC;EAkEH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/header/Header.tsx"],"sourcesContent":["import {\n Divider,\n Factory,\n Group,\n GroupProps,\n Stack,\n StylesApiProps,\n Text,\n Title,\n factory,\n useProps,\n useStyles,\n} from '@mantine/core';\nimport {Children, ReactElement, ReactNode} from 'react';\nimport {HeaderProvider} from './Header.context';\nimport classes from './Header.module.css';\nimport {HeaderActions, HeaderActionsStyleNames} from './HeaderActions/HeaderActions';\nimport {HeaderBreadcrumbs, HeaderBreadcrumbsStyleNames} from './HeaderBreadcrumbs/HeaderBreadcrumbs';\nimport {HeaderDocAnchor, HeaderDocAnchorStyleNames} from './HeaderDocAnchor/HeaderDocAnchor';\n\nexport type {HeaderActionsProps} from './HeaderActions/HeaderActions';\nexport type {HeaderBreadcrumbsProps} from './HeaderBreadcrumbs/HeaderBreadcrumbs';\nexport type {HeaderDocAnchorProps} from './HeaderDocAnchor/HeaderDocAnchor';\n\nexport type HeaderVariant = 'primary' | 'secondary';\nexport type HeaderStyleNames =\n | 'root'\n | 'title'\n | 'description'\n | 'divider'\n | HeaderDocAnchorStyleNames\n | HeaderBreadcrumbsStyleNames\n | HeaderActionsStyleNames;\n\nexport interface HeaderProps extends StylesApiProps<HeaderFactory>, Omit<GroupProps, 'classNames' | 'styles' | 'vars'> {\n /**\n * The description text displayed inside the header underneath the title\n */\n description?: ReactNode;\n /**\n * Whether the header should have a border on the bottom\n */\n borderBottom?: boolean;\n /**\n * Use the primary variant for page header and secondary variant elsewhere\n *\n * @default 'primary'\n */\n variant?: 'primary' | 'secondary';\n /**\n * The title of the header.\n */\n children: ReactNode;\n}\n\nexport type HeaderFactory = Factory<{\n props: HeaderProps;\n ref: HTMLDivElement;\n variant: HeaderVariant;\n stylesNames: HeaderStyleNames;\n staticComponents: {\n Breadcrumbs: typeof HeaderBreadcrumbs;\n Actions: typeof HeaderActions;\n DocAnchor: typeof HeaderDocAnchor;\n };\n}>;\n\nconst defaultProps: Partial<HeaderProps> = {\n variant: 'primary',\n justify: 'space-between',\n wrap: 'nowrap',\n};\n\nexport const Header = factory<HeaderFactory>((_props, ref) => {\n const props = useProps('PlasmaHeader', defaultProps, _props);\n const {\n className,\n description,\n borderBottom,\n variant,\n children,\n style,\n classNames,\n unstyled,\n vars,\n styles,\n ...others\n } = props;\n const getStyles = useStyles<HeaderFactory>({\n name: 'PlasmaHeader',\n props,\n classes,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n });\n const stylesApiProps = {classNames, styles};\n\n const convertedChildren = Children.toArray(children) as ReactElement[];\n const breadcrumbs = convertedChildren.find((child) => child.type === HeaderBreadcrumbs);\n const actions = convertedChildren.find((child) => child.type === HeaderActions);\n const docAnchor = convertedChildren.find((child) => child.type === HeaderDocAnchor);\n const otherChildren = convertedChildren.filter(\n (child) => child.type !== HeaderBreadcrumbs && child.type !== HeaderActions && child.type !== HeaderDocAnchor,\n );\n return (\n <HeaderProvider value={{getStyles}}>\n <Group ref={ref} variant={variant} {...getStyles('root')} {...others}>\n <Stack gap={0}>\n {breadcrumbs}\n <Title\n variant={variant}\n order={variant === 'primary' ? 1 : 3}\n {...getStyles('title', stylesApiProps)}\n >\n {otherChildren}\n {docAnchor}\n </Title>\n <Text {...getStyles('description', stylesApiProps)} size={variant === 'primary' ? 'md' : 'sm'}>\n {description}\n </Text>\n </Stack>\n {actions}\n </Group>\n {borderBottom ? <Divider {...getStyles('divider', stylesApiProps)} size=\"xs\" /> : null}\n </HeaderProvider>\n );\n});\n\nHeader.Breadcrumbs = HeaderBreadcrumbs;\nHeader.Actions = HeaderActions;\nHeader.DocAnchor = HeaderDocAnchor;\n"],"names":["Divider","Group","Stack","Text","Title","factory","useProps","useStyles","Children","HeaderProvider","classes","HeaderActions","HeaderBreadcrumbs","HeaderDocAnchor","defaultProps","variant","justify","wrap","Header","_props","ref","props","className","description","borderBottom","children","style","classNames","unstyled","vars","styles","others","getStyles","name","stylesApiProps","convertedChildren","toArray","breadcrumbs","find","child","type","actions","docAnchor","otherChildren","filter","value","gap","order","size","Breadcrumbs","Actions","DocAnchor"],"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/header/Header.tsx"],"sourcesContent":["import {\n Divider,\n Factory,\n Group,\n GroupProps,\n Stack,\n StylesApiProps,\n Text,\n Title,\n factory,\n useProps,\n useStyles,\n} from '@mantine/core';\nimport {Children, ReactElement, ReactNode} from 'react';\nimport {HeaderProvider} from './Header.context';\nimport classes from './Header.module.css';\nimport {HeaderActions, HeaderActionsStyleNames} from './HeaderActions/HeaderActions';\nimport {HeaderBreadcrumbs, HeaderBreadcrumbsStyleNames} from './HeaderBreadcrumbs/HeaderBreadcrumbs';\nimport {HeaderDocAnchor, HeaderDocAnchorStyleNames} from './HeaderDocAnchor/HeaderDocAnchor';\n\nexport type {HeaderActionsProps} from './HeaderActions/HeaderActions';\nexport type {HeaderBreadcrumbsProps} from './HeaderBreadcrumbs/HeaderBreadcrumbs';\nexport type {HeaderDocAnchorProps} from './HeaderDocAnchor/HeaderDocAnchor';\n\nexport type HeaderVariant = 'primary' | 'secondary';\nexport type HeaderStyleNames =\n | 'root'\n | 'title'\n | 'description'\n | 'divider'\n | HeaderDocAnchorStyleNames\n | HeaderBreadcrumbsStyleNames\n | HeaderActionsStyleNames;\n\nexport interface HeaderProps extends StylesApiProps<HeaderFactory>, Omit<GroupProps, 'classNames' | 'styles' | 'vars'> {\n /**\n * The description text displayed inside the header underneath the title\n */\n description?: ReactNode;\n /**\n * Whether the header should have a border on the bottom\n */\n borderBottom?: boolean;\n /**\n * Use the primary variant for page header and secondary variant elsewhere\n *\n * @default 'primary'\n */\n variant?: 'primary' | 'secondary';\n /**\n * The title of the header.\n */\n children: ReactNode;\n}\n\nexport type HeaderFactory = Factory<{\n props: HeaderProps;\n ref: HTMLDivElement;\n variant: HeaderVariant;\n stylesNames: HeaderStyleNames;\n staticComponents: {\n Breadcrumbs: typeof HeaderBreadcrumbs;\n Actions: typeof HeaderActions;\n DocAnchor: typeof HeaderDocAnchor;\n };\n}>;\n\nconst defaultProps: Partial<HeaderProps> = {\n variant: 'primary',\n justify: 'space-between',\n wrap: 'nowrap',\n};\n\nexport const Header = factory<HeaderFactory>((_props, ref) => {\n const props = useProps('PlasmaHeader', defaultProps, _props);\n const {\n className,\n description,\n borderBottom,\n variant,\n children,\n style,\n classNames,\n unstyled,\n vars,\n styles,\n ...others\n } = props;\n const getStyles = useStyles<HeaderFactory>({\n name: 'PlasmaHeader',\n props,\n classes,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n });\n const stylesApiProps = {classNames, styles};\n\n const convertedChildren = Children.toArray(children) as ReactElement[];\n const breadcrumbs = convertedChildren.find((child) => child.type === HeaderBreadcrumbs);\n const actions = convertedChildren.find((child) => child.type === HeaderActions);\n const docAnchor = convertedChildren.find((child) => child.type === HeaderDocAnchor);\n const otherChildren = convertedChildren.filter(\n (child) => child.type !== HeaderBreadcrumbs && child.type !== HeaderActions && child.type !== HeaderDocAnchor,\n );\n return (\n <HeaderProvider value={{getStyles}}>\n <Group ref={ref} variant={variant} {...getStyles('root')} {...others}>\n <Stack gap={0}>\n {breadcrumbs}\n <Title\n variant={variant}\n order={variant === 'primary' ? 1 : 3}\n {...getStyles('title', stylesApiProps)}\n >\n {otherChildren}\n {docAnchor}\n </Title>\n <Text {...getStyles('description', stylesApiProps)} size={variant === 'primary' ? 'md' : 'sm'}>\n {description}\n </Text>\n </Stack>\n {actions}\n </Group>\n {borderBottom ? <Divider {...getStyles('divider', stylesApiProps)} size=\"xs\" /> : null}\n </HeaderProvider>\n );\n});\n\nHeader.Breadcrumbs = HeaderBreadcrumbs;\nHeader.Actions = HeaderActions;\nHeader.DocAnchor = HeaderDocAnchor;\n"],"names":["Divider","Group","Stack","Text","Title","factory","useProps","useStyles","Children","HeaderProvider","classes","HeaderActions","HeaderBreadcrumbs","HeaderDocAnchor","defaultProps","variant","justify","wrap","Header","_props","ref","props","className","description","borderBottom","children","style","classNames","unstyled","vars","styles","others","getStyles","name","stylesApiProps","convertedChildren","toArray","breadcrumbs","find","child","type","actions","docAnchor","otherChildren","filter","value","gap","order","size","Breadcrumbs","Actions","DocAnchor"],"mappings":";AAAA,SACIA,OAAO,EAEPC,KAAK,EAELC,KAAK,EAELC,IAAI,EACJC,KAAK,EACLC,OAAO,EACPC,QAAQ,EACRC,SAAS,QACN,gBAAgB;AACvB,SAAQC,QAAQ,QAAgC,QAAQ;AACxD,SAAQC,cAAc,QAAO,mBAAmB;AAChD,OAAOC,aAAa,sBAAsB;AAC1C,SAAQC,aAAa,QAAg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ASE,eAAe;;oCAErCS;oCACAD;;;0CAEL,KAACvC;gCAAM,GAAG6B,UAAU,eAAeE,eAAe;gCAAEc,MAAMjC,YAAY,YAAY,OAAO;0CACpFQ;;;;oBAGRkB;;;YAEJjB,6BAAe,KAACxB;gBAAS,GAAGgC,UAAU,WAAWE,eAAe;gBAAEc,MAAK;iBAAU;;;AAG9F,GAAG;AAEH9B,OAAO+B,WAAW,GAAGrC;AACrBM,OAAOgC,OAAO,GAAGvC;AACjBO,OAAOiC,SAAS,GAAGtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/header/HeaderActions/HeaderActions.tsx"],"sourcesContent":["import {CompoundStylesApiProps, Factory, Group, GroupProps, factory, useProps} from '@mantine/core';\nimport {ReactNode} from 'react';\nimport {useHeaderContext} from '../Header.context';\n\nexport type HeaderActionsStyleNames = 'actions';\n\nexport interface HeaderActionsProps\n extends Omit<GroupProps, 'classNames' | 'styles' | 'vars' | 'children'>,\n CompoundStylesApiProps<HeaderActionsFactory> {\n children: ReactNode;\n}\n\nexport type HeaderActionsFactory = Factory<{\n props: HeaderActionsProps;\n ref: HTMLDivElement;\n stylesNames: HeaderActionsStyleNames;\n compound: true;\n}>;\n\nconst defaultProps: Partial<HeaderActionsProps> = {\n gap: 'sm',\n};\n\nexport const HeaderActions = factory<HeaderActionsFactory>((_props, ref) => {\n const props = useProps('HeaderActions', defaultProps, _props);\n const {gap, className, classNames, styles, style, children, vars, ...others} = props;\n const ctx = useHeaderContext();\n\n return (\n <Group\n ref={ref}\n gap={gap}\n {...ctx.getStyles('actions', {className, style, classNames, styles, props})}\n {...others}\n >\n {children}\n </Group>\n );\n});\n"],"names":["Group","factory","useProps","useHeaderContext","defaultProps","gap","HeaderActions","_props","ref","props","className","classNames","styles","style","children","vars","others","ctx","getStyles"],"
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/header/HeaderActions/HeaderActions.tsx"],"sourcesContent":["import {CompoundStylesApiProps, Factory, Group, GroupProps, factory, useProps} from '@mantine/core';\nimport {ReactNode} from 'react';\nimport {useHeaderContext} from '../Header.context';\n\nexport type HeaderActionsStyleNames = 'actions';\n\nexport interface HeaderActionsProps\n extends Omit<GroupProps, 'classNames' | 'styles' | 'vars' | 'children'>,\n CompoundStylesApiProps<HeaderActionsFactory> {\n children: ReactNode;\n}\n\nexport type HeaderActionsFactory = Factory<{\n props: HeaderActionsProps;\n ref: HTMLDivElement;\n stylesNames: HeaderActionsStyleNames;\n compound: true;\n}>;\n\nconst defaultProps: Partial<HeaderActionsProps> = {\n gap: 'sm',\n};\n\nexport const HeaderActions = factory<HeaderActionsFactory>((_props, ref) => {\n const props = useProps('HeaderActions', defaultProps, _props);\n const {gap, className, classNames, styles, style, children, vars, ...others} = props;\n const ctx = useHeaderContext();\n\n return (\n <Group\n ref={ref}\n gap={gap}\n {...ctx.getStyles('actions', {className, style, classNames, styles, props})}\n {...others}\n >\n {children}\n </Group>\n );\n});\n"],"names":["Group","factory","useProps","useHeaderContext","defaultProps","gap","HeaderActions","_props","ref","props","className","classNames","styles","style","children","vars","others","ctx","getStyles"],"mappings":";AAAA,SAAyCA,KAAK,EAAcC,OAAO,EAAEC,QAAQ,QAAO,gBAAgB;AAEpG,SAAQC,gBAAgB,QAAO,oBAAoB;AAiBnD,MAAMC,eAA4C;IAC9CC,KAAK;AACT;AAEA,OAAO,MAAMC,gBAAgBL,QAA8B,CAACM,QAAQC;IAChE,MAAMC,QAAQP,SAAS,iBAAiBE,cAAcG;IACtD,MAAM,EAACF,GAAG,EAAEK,SAAS,EAAEC,UAAU,EAAEC,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,IAAI,EAAE,GAAGC,QAAO,GAAGP;IAC/E,MAAMQ,MAAMd;IAEZ,qBACI,KAACH;QACGQ,KAAKA;QACLH,KAAKA;QACJ,GAAGY,IAAIC,SAAS,CAAC,WAAW;YAACR;YAAWG;YAAOF;YAAYC;YAAQH;QAAK,EAAE;QAC1E,GAAGO,MAAM;kBAETF;;AAGb,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/header/HeaderBreadcrumbs/HeaderBreadcrumbs.tsx"],"sourcesContent":["import {Breadcrumbs, BreadcrumbsProps, CompoundStylesApiProps, Factory, factory} from '@mantine/core';\nimport {useHeaderContext} from '../Header.context';\n\nexport type HeaderBreadcrumbsStyleNames = 'breadcrumbsRoot' | 'breadcrumbsSeparator';\nexport interface HeaderBreadcrumbsProps\n extends Omit<BreadcrumbsProps, 'classNames' | 'styles' | 'vars'>,\n CompoundStylesApiProps<HeaderBreadcrumbsFactory> {}\n\nexport type HeaderBreadcrumbsFactory = Factory<{\n props: BreadcrumbsProps;\n ref: HTMLDivElement;\n stylesNames: HeaderBreadcrumbsStyleNames;\n compound: true;\n}>;\n\nexport const HeaderBreadcrumbs = factory<HeaderBreadcrumbsFactory>((props, ref) => {\n const {children, className, classNames, styles, style, ...others} = props;\n const ctx = useHeaderContext();\n\n return (\n <Breadcrumbs\n ref={ref}\n classNames={{\n breadcrumb: ctx.getStyles('breadcrumbsRoot', {className, classNames, styles, style, props}).className,\n separator: ctx.getStyles('breadcrumbsSeparator', {classNames, styles, props}).className,\n }}\n {...others}\n >\n {children}\n </Breadcrumbs>\n );\n});\n"],"names":["Breadcrumbs","factory","useHeaderContext","HeaderBreadcrumbs","props","ref","children","className","classNames","styles","style","others","ctx","breadcrumb","getStyles","separator"],"
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/header/HeaderBreadcrumbs/HeaderBreadcrumbs.tsx"],"sourcesContent":["import {Breadcrumbs, BreadcrumbsProps, CompoundStylesApiProps, Factory, factory} from '@mantine/core';\nimport {useHeaderContext} from '../Header.context';\n\nexport type HeaderBreadcrumbsStyleNames = 'breadcrumbsRoot' | 'breadcrumbsSeparator';\nexport interface HeaderBreadcrumbsProps\n extends Omit<BreadcrumbsProps, 'classNames' | 'styles' | 'vars'>,\n CompoundStylesApiProps<HeaderBreadcrumbsFactory> {}\n\nexport type HeaderBreadcrumbsFactory = Factory<{\n props: BreadcrumbsProps;\n ref: HTMLDivElement;\n stylesNames: HeaderBreadcrumbsStyleNames;\n compound: true;\n}>;\n\nexport const HeaderBreadcrumbs = factory<HeaderBreadcrumbsFactory>((props, ref) => {\n const {children, className, classNames, styles, style, ...others} = props;\n const ctx = useHeaderContext();\n\n return (\n <Breadcrumbs\n ref={ref}\n classNames={{\n breadcrumb: ctx.getStyles('breadcrumbsRoot', {className, classNames, styles, style, props}).className,\n separator: ctx.getStyles('breadcrumbsSeparator', {classNames, styles, props}).className,\n }}\n {...others}\n >\n {children}\n </Breadcrumbs>\n );\n});\n"],"names":["Breadcrumbs","factory","useHeaderContext","HeaderBreadcrumbs","props","ref","children","className","classNames","styles","style","others","ctx","breadcrumb","getStyles","separator"],"mappings":";AAAA,SAAQA,WAAW,EAAqDC,OAAO,QAAO,gBAAgB;AACtG,SAAQC,gBAAgB,QAAO,oBAAoB;AAcnD,OAAO,MAAMC,oBAAoBF,QAAkC,CAACG,OAAOC;IACvE,MAAM,EAACC,QAAQ,EAAEC,SAAS,EAAEC,UAAU,EAAEC,MAAM,EAAEC,KAAK,EAAE,GAAGC,QAAO,GAAGP;IACpE,MAAMQ,MAAMV;IAEZ,qBACI,KAACF;QACGK,KAAKA;QACLG,YAAY;YACRK,YAAYD,IAAIE,SAAS,CAAC,mBAAmB;gBAACP;gBAAWC;gBAAYC;gBAAQC;gBAAON;YAAK,GAAGG,SAAS;YACrGQ,WAAWH,IAAIE,SAAS,CAAC,wBAAwB;gBAACN;gBAAYC;gBAAQL;YAAK,GAAGG,SAAS;QAC3F;QACC,GAAGI,MAAM;kBAETL;;AAGb,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/header/HeaderDocAnchor/HeaderDocAnchor.tsx"],"sourcesContent":["import {QuestionSize16Px} from '@coveord/plasma-react-icons';\nimport {\n Anchor,\n AnchorProps,\n CompoundStylesApiProps,\n Factory,\n Tooltip,\n TooltipProps,\n factory,\n useProps,\n} from '@mantine/core';\nimport {ReactNode} from 'react';\nimport {useHeaderContext} from '../Header.context';\n\nexport type HeaderDocAnchorStyleNames = 'docAnchorTooltip' | 'docAnchor';\n\nexport interface HeaderDocAnchorProps\n extends Pick<TooltipProps, 'position'>,\n CompoundStylesApiProps<HeaderDocAnchorFactory>,\n Omit<AnchorProps, 'classNames' | 'styles' | 'variant' | 'vars'> {\n /**\n * A href pointing to documentation related to the current panel.\n * When provided, an info icon is rendered next to the title as link to this documentation\n */\n href: string;\n /**\n * The tooltip text shown when hovering over the doc link icon\n */\n label?: ReactNode;\n /**\n * React component to add the tooltip and anchor on\n */\n children?: ReactNode;\n}\n\nexport type HeaderDocAnchorFactory = Factory<{\n props: HeaderDocAnchorProps;\n ref: HTMLAnchorElement;\n stylesNames: HeaderDocAnchorStyleNames;\n compound: true;\n}>;\n\nconst defaultProps: Partial<HeaderDocAnchorProps> = {\n position: 'right',\n children: <QuestionSize16Px height={16} />,\n};\n\nexport const HeaderDocAnchor = factory<HeaderDocAnchorFactory>((_props, ref) => {\n const props = useProps('PlasmaHeaderActions', defaultProps, _props);\n const {className, classNames, styles, style, children, label, position, vars, ...others} = props;\n\n const ctx = useHeaderContext();\n\n return (\n <Tooltip\n label={label}\n disabled={!label}\n position={position}\n classNames={{tooltip: ctx.getStyles('docAnchorTooltip', {classNames, styles, props}).className}}\n >\n <Anchor\n ref={ref}\n inline\n target=\"_blank\"\n {...ctx.getStyles('docAnchor', {classNames, styles, props, style, className})}\n {...others}\n >\n {children}\n </Anchor>\n </Tooltip>\n );\n});\n"],"names":["QuestionSize16Px","Anchor","Tooltip","factory","useProps","useHeaderContext","defaultProps","position","children","height","HeaderDocAnchor","_props","ref","props","className","classNames","styles","style","label","vars","others","ctx","disabled","tooltip","getStyles","inline","target"],"
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/header/HeaderDocAnchor/HeaderDocAnchor.tsx"],"sourcesContent":["import {QuestionSize16Px} from '@coveord/plasma-react-icons';\nimport {\n Anchor,\n AnchorProps,\n CompoundStylesApiProps,\n Factory,\n Tooltip,\n TooltipProps,\n factory,\n useProps,\n} from '@mantine/core';\nimport {ReactNode} from 'react';\nimport {useHeaderContext} from '../Header.context';\n\nexport type HeaderDocAnchorStyleNames = 'docAnchorTooltip' | 'docAnchor';\n\nexport interface HeaderDocAnchorProps\n extends Pick<TooltipProps, 'position'>,\n CompoundStylesApiProps<HeaderDocAnchorFactory>,\n Omit<AnchorProps, 'classNames' | 'styles' | 'variant' | 'vars'> {\n /**\n * A href pointing to documentation related to the current panel.\n * When provided, an info icon is rendered next to the title as link to this documentation\n */\n href: string;\n /**\n * The tooltip text shown when hovering over the doc link icon\n */\n label?: ReactNode;\n /**\n * React component to add the tooltip and anchor on\n */\n children?: ReactNode;\n}\n\nexport type HeaderDocAnchorFactory = Factory<{\n props: HeaderDocAnchorProps;\n ref: HTMLAnchorElement;\n stylesNames: HeaderDocAnchorStyleNames;\n compound: true;\n}>;\n\nconst defaultProps: Partial<HeaderDocAnchorProps> = {\n position: 'right',\n children: <QuestionSize16Px height={16} />,\n};\n\nexport const HeaderDocAnchor = factory<HeaderDocAnchorFactory>((_props, ref) => {\n const props = useProps('PlasmaHeaderActions', defaultProps, _props);\n const {className, classNames, styles, style, children, label, position, vars, ...others} = props;\n\n const ctx = useHeaderContext();\n\n return (\n <Tooltip\n label={label}\n disabled={!label}\n position={position}\n classNames={{tooltip: ctx.getStyles('docAnchorTooltip', {classNames, styles, props}).className}}\n >\n <Anchor\n ref={ref}\n inline\n target=\"_blank\"\n {...ctx.getStyles('docAnchor', {classNames, styles, props, style, className})}\n {...others}\n >\n {children}\n </Anchor>\n </Tooltip>\n );\n});\n"],"names":["QuestionSize16Px","Anchor","Tooltip","factory","useProps","useHeaderContext","defaultProps","position","children","height","HeaderDocAnchor","_props","ref","props","className","classNames","styles","style","label","vars","others","ctx","disabled","tooltip","getStyles","inline","target"],"mappings":";AAAA,SAAQA,gBAAgB,QAAO,8BAA8B;AAC7D,SACIC,MAAM,EAINC,OAAO,EAEPC,OAAO,EACPC,QAAQ,QACL,gBAAgB;AAEvB,SAAQC,gBAAgB,QAAO,oBAAoB;AA8BnD,MAAMC,eAA8C;IAChDC,UAAU;IACVC,wBAAU,KAACR;QAAiBS,QAAQ;;AACxC;AAEA,OAAO,MAAMC,kBAAkBP,QAAgC,CAACQ,QAAQC;IACpE,MAAMC,QAAQT,SAAS,uBAAuBE,cAAcK;IAC5D,MAAM,EAACG,SAAS,EAAEC,UAAU,EAAEC,MAAM,EAAEC,KAAK,EAAET,QAAQ,EAAEU,KAAK,EAAEX,QAAQ,EAAEY,IAAI,EAAE,GAAGC,QAAO,GAAGP;IAE3F,MAAMQ,MAAMhB;IAEZ,qBACI,KAACH;QACGgB,OAAOA;QACPI,UAAU,CAACJ;QACXX,UAAUA;QACVQ,YAAY;YAACQ,SAASF,IAAIG,SAAS,CAAC,oBAAoB;gBAACT;gBAAYC;gBAAQH;YAAK,GAAGC,SAAS;QAAA;kBAE9F,cAAA,KAACb;YACGW,KAAKA;YACLa,MAAM;YACNC,QAAO;YACN,GAAGL,IAAIG,SAAS,CAAC,aAAa;gBAACT;gBAAYC;gBAAQH;gBAAOI;gBAAOH;YAAS,EAAE;YAC5E,GAAGM,MAAM;sBAETZ;;;AAIjB,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/header/index.ts"],"sourcesContent":["export * from './Header';\n"],"names":[],"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/header/index.ts"],"sourcesContent":["export * from './Header';\n"],"names":[],"mappings":"AAAA,cAAc,WAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/index.ts"],"sourcesContent":["export * from './blank-slate';\nexport * from './browser-preview';\nexport * from './code-editor';\nexport * from './collection';\nexport * from './date-range-picker';\nexport * from './sticky-footer';\nexport * from './header';\nexport * from './inline-confirm';\nexport * from './table';\nexport * from './prompt';\nexport * from './button';\nexport * from './action-icon';\nexport * from './menu';\nexport * from './copyToClipboard';\n"],"names":[],"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/index.ts"],"sourcesContent":["export * from './blank-slate';\nexport * from './browser-preview';\nexport * from './code-editor';\nexport * from './collection';\nexport * from './date-range-picker';\nexport * from './sticky-footer';\nexport * from './header';\nexport * from './inline-confirm';\nexport * from './table';\nexport * from './prompt';\nexport * from './button';\nexport * from './action-icon';\nexport * from './menu';\nexport * from './copyToClipboard';\n"],"names":[],"mappings":"AAAA,cAAc,gBAAgB;AAC9B,cAAc,oBAAoB;AAClC,cAAc,gBAAgB;AAC9B,cAAc,eAAe;AAC7B,cAAc,sBAAsB;AACpC,cAAc,kBAAkB;AAChC,cAAc,WAAW;AACzB,cAAc,mBAAmB;AACjC,cAAc,UAAU;AACxB,cAAc,WAAW;AACzB,cAAc,WAAW;AACzB,cAAc,gBAAgB;AAC9B,cAAc,SAAS;AACvB,cAAc,oBAAoB"}
|
|
@@ -25,12 +25,5 @@ export type InlineConfirmFactory = Factory<{
|
|
|
25
25
|
Target: typeof InlineConfirmTarget;
|
|
26
26
|
};
|
|
27
27
|
}>;
|
|
28
|
-
export declare const InlineConfirm: MantineComponent<
|
|
29
|
-
props: InlineConfirmProps;
|
|
30
|
-
ref: never;
|
|
31
|
-
staticComponents: {
|
|
32
|
-
Prompt: typeof InlineConfirmPrompt;
|
|
33
|
-
Target: typeof InlineConfirmTarget;
|
|
34
|
-
};
|
|
35
|
-
}>;
|
|
28
|
+
export declare const InlineConfirm: MantineComponent<InlineConfirmFactory>;
|
|
36
29
|
//# sourceMappingURL=InlineConfirm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlineConfirm.d.ts","sourceRoot":"","sources":["../../../../src/components/inline-confirm/InlineConfirm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,gBAAgB,EAAE,c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kBAAkB,CAAC;IAC1B,GAAG,EAAE,KAAK,CAAC;IACX,gBAAgB,EAAE;QACd,MAAM,EAAE,OAAO,mBAAmB,CAAC;QACnC,MAAM,EAAE,OAAO,mBAAmB,CAAC;KACtC,CAAC;CACL,CAAC,CAAC;AAIH,eAAO,MAAM,aAAa,EAcpB,gBAAgB,CAAC,oBAAoB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/inline-confirm/InlineConfirm.tsx"],"sourcesContent":["import {Factory, MantineComponent, StylesApiProps, useProps} from '@mantine/core';\nimport {Children, ReactElement, ReactNode, useState} from 'react';\nimport {InlineConfirmProvider} from './InlineConfirmContext';\nimport {InlineConfirmPrompt} from './InlineConfirmPrompt';\n\nimport {InlineConfirmTarget} from './InlineConfirmTarget';\n\n/**\n * Direct children of InlineConfirm that wraps an InlineConfirm.Prompt need this prop\n */\nexport interface InlineConfirmComponentsProps {\n /**\n * Unique id to map the prompt to the target\n */\n inlineConfirmId: string;\n}\n\nexport interface InlineConfirmProps extends StylesApiProps<InlineConfirmFactory> {\n /**\n * The content of the component. Should contain at least one `InlineConfirm.Target` and one `InlineConfirm.Prompt` with matching ids\n */\n children: ReactNode;\n}\n\nexport type InlineConfirmFactory = Factory<{\n props: InlineConfirmProps;\n ref: never;\n staticComponents: {\n Prompt: typeof InlineConfirmPrompt;\n Target: typeof InlineConfirmTarget;\n };\n}>;\n\nconst defaultProps: Partial<InlineConfirmProps> = {};\n\nexport const InlineConfirm = ((_props) => {\n const {children} = useProps('InlineConfirm', defaultProps, _props);\n const [confirmingId, setConfirmingId] = useState<string | null>(null);\n\n const convertedChildren = Children.toArray(children) as ReactElement[];\n const prompt = convertedChildren.find(\n (child) => child.type !== InlineConfirmTarget && child.props?.inlineConfirmId === confirmingId,\n );\n const clearConfirm = () => setConfirmingId(null);\n return (\n <InlineConfirmProvider value={{confirmingId, setConfirmingId, clearConfirm}}>\n {prompt ?? children}\n </InlineConfirmProvider>\n );\n}) as MantineComponent<InlineConfirmFactory>;\n\nInlineConfirm.Prompt = InlineConfirmPrompt;\nInlineConfirm.Target = InlineConfirmTarget;\n"],"names":["useProps","Children","useState","InlineConfirmProvider","InlineConfirmPrompt","InlineConfirmTarget","defaultProps","InlineConfirm","_props","children","confirmingId","setConfirmingId","convertedChildren","toArray","prompt","find","child","type","props","inlineConfirmId","clearConfirm","value","Prompt","Target"],"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/inline-confirm/InlineConfirm.tsx"],"sourcesContent":["import {Factory, MantineComponent, StylesApiProps, useProps} from '@mantine/core';\nimport {Children, ReactElement, ReactNode, useState} from 'react';\nimport {InlineConfirmProvider} from './InlineConfirmContext';\nimport {InlineConfirmPrompt} from './InlineConfirmPrompt';\n\nimport {InlineConfirmTarget} from './InlineConfirmTarget';\n\n/**\n * Direct children of InlineConfirm that wraps an InlineConfirm.Prompt need this prop\n */\nexport interface InlineConfirmComponentsProps {\n /**\n * Unique id to map the prompt to the target\n */\n inlineConfirmId: string;\n}\n\nexport interface InlineConfirmProps extends StylesApiProps<InlineConfirmFactory> {\n /**\n * The content of the component. Should contain at least one `InlineConfirm.Target` and one `InlineConfirm.Prompt` with matching ids\n */\n children: ReactNode;\n}\n\nexport type InlineConfirmFactory = Factory<{\n props: InlineConfirmProps;\n ref: never;\n staticComponents: {\n Prompt: typeof InlineConfirmPrompt;\n Target: typeof InlineConfirmTarget;\n };\n}>;\n\nconst defaultProps: Partial<InlineConfirmProps> = {};\n\nexport const InlineConfirm = ((_props) => {\n const {children} = useProps('InlineConfirm', defaultProps, _props);\n const [confirmingId, setConfirmingId] = useState<string | null>(null);\n\n const convertedChildren = Children.toArray(children) as ReactElement[];\n const prompt = convertedChildren.find(\n (child) => child.type !== InlineConfirmTarget && child.props?.inlineConfirmId === confirmingId,\n );\n const clearConfirm = () => setConfirmingId(null);\n return (\n <InlineConfirmProvider value={{confirmingId, setConfirmingId, clearConfirm}}>\n {prompt ?? children}\n </InlineConfirmProvider>\n );\n}) as MantineComponent<InlineConfirmFactory>;\n\nInlineConfirm.Prompt = InlineConfirmPrompt;\nInlineConfirm.Target = InlineConfirmTarget;\n"],"names":["useProps","Children","useState","InlineConfirmProvider","InlineConfirmPrompt","InlineConfirmTarget","defaultProps","InlineConfirm","_props","children","confirmingId","setConfirmingId","convertedChildren","toArray","prompt","find","child","type","props","inlineConfirmId","clearConfirm","value","Prompt","Target"],"mappings":";AAAA,SAAmDA,QAAQ,QAAO,gBAAgB;AAClF,SAAQC,QAAQ,EAA2BC,QAAQ,QAAO,QAAQ;AAClE,SAAQC,qBAAqB,QAAO,yBAAyB;AAC7D,SAAQC,mBAAmB,QAAO,wBAAwB;AAE1D,SAAQC,mBAAmB,QAAO,wBAAwB;AA4B1D,MAAMC,eAA4C,CAAC;AAEnD,OAAO,MAAMC,gBAAiB,CAACC;IAC3B,MAAM,EAACC,QAAQ,EAAC,GAAGT,SAAS,iBAAiBM,cAAcE;IAC3D,MAAM,CAACE,cAAcC,gBAAgB,GAAGT,SAAwB;IAEhE,MAAMU,oBAAoBX,SAASY,OAAO,CAACJ;IAC3C,MAAMK,SAASF,kBAAkBG,IAAI,CACjC,CAACC,QAAUA,MAAMC,IAAI,KAAKZ,uBAAuBW,MAAME,KAAK,EAAEC,oBAAoBT;IAEtF,MAAMU,eAAe,IAAMT,gBAAgB;IAC3C,qBACI,KAACR;QAAsBkB,OAAO;YAACX;YAAcC;YAAiBS;QAAY;kBACrEN,UAAUL;;AAGvB,EAA6C;AAE7CF,cAAce,MAAM,GAAGlB;AACvBG,cAAcgB,MAAM,GAAGlB"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
type InlineConfirmContextType = {
|
|
3
2
|
confirmingId: string;
|
|
4
3
|
setConfirmingId: (id: string) => void;
|
|
@@ -6,7 +5,7 @@ type InlineConfirmContextType = {
|
|
|
6
5
|
};
|
|
7
6
|
export declare const InlineConfirmProvider: ({ children, value }: {
|
|
8
7
|
value: InlineConfirmContextType;
|
|
9
|
-
children:
|
|
10
|
-
}) => import("react/jsx-runtime").JSX.Element, useInlineConfirm: () => InlineConfirmContextType;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element, useInlineConfirm: () => InlineConfirmContextType & ({} | undefined);
|
|
11
10
|
export {};
|
|
12
11
|
//# sourceMappingURL=InlineConfirmContext.d.ts.map
|