Skip to content

Commit

Permalink
fix(mantine): cleared up some changes in v7 and fix them (#3601)
Browse files Browse the repository at this point in the history
* chore(mantine): bump to mantine v7, first commit
rebasing

* chore(mantine): lots of css modules, preparing theme and components
rebasing

* chore(mantine)!: more breaking stuff

* chore(mantine)!: more module, less v6, build working

* chore(mantine)!: trying to style my branch so it looks 1:1 with master

* chore(mantine)!: apply some visual fixes to look like prod

* chore(mantine)!: fixed table style and rows

* chore(mantine)!: fixed all the rest style expect table gutter grid

* chore(mantine)!: fix interfaces and remove comments
  • Loading branch information
FelixBlaisThon authored and GermainBergeron committed Feb 19, 2024
1 parent 813cf0c commit f00b29b
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/mantine/src/components/code-editor/CodeEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export const CodeEditor: FunctionComponent<CodeEditorProps> = (props) => {
<Stack
justify="flex-start"
gap={0}
style={{height: Math.max(parentHeight, minHeight), maxHeight}} // wat
style={{height: Math.max(parentHeight, minHeight), maxHeight}}
ref={ref}
{...others}
>
Expand Down
22 changes: 18 additions & 4 deletions packages/mantine/src/components/collection/Collection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@ import {AddSize16Px} from '@coveord/plasma-react-icons';
import {DndContext, DragEndEvent, KeyboardSensor, PointerSensor, useSensor, useSensors} from '@dnd-kit/core';
import {restrictToParentElement, restrictToVerticalAxis} from '@dnd-kit/modifiers';
import {SortableContext, sortableKeyboardCoordinates, verticalListSortingStrategy} from '@dnd-kit/sortable';
import {Box, Group, Input, InputWrapperProps, MantineSpacing, Stack, Tooltip, useProps} from '@mantine/core';
import {
Box,
Group,
GroupProps,
Input,
InputWrapperProps,
MantineSpacing,
Stack,
Tooltip,
useProps,
} from '@mantine/core';
import {ReorderPayload} from '@mantine/form/lib/types';
import {useDidUpdate} from '@mantine/hooks';
import {ReactNode} from 'react';
Expand All @@ -13,7 +23,11 @@ import CollectionClasses from './Collection.module.css';
import {CollectionItem} from './CollectionItem';

interface CollectionProps<T>
extends Omit<InputWrapperProps, 'children' | 'inputContainer' | 'inputWrapperOrder' | 'onChange'> {
extends Omit<
InputWrapperProps,
'children' | 'inputContainer' | 'inputWrapperOrder' | 'onChange' | 'classNames' | 'vars' | 'styles'
>,
Omit<GroupProps, 'children' | 'onChange'> {
/**
* The default value each new item should have
*/
Expand Down Expand Up @@ -66,7 +80,7 @@ interface CollectionProps<T>
/**
* Function that gets called when a new item needs to be added to the collection
*
* @param value The the value of the item to insert
* @param value The value of the item to insert
* @param index The index of the new item to insert
*/
onInsertItem?: (value: T, index: number) => void;
Expand Down Expand Up @@ -200,7 +214,7 @@ export const Collection = <T,>(props: CollectionProps<T>) => {
disabled={disabled}
draggable={draggable}
onRemove={() => onRemoveItem?.(index)}
// classNames={classNames} what
classNames={classNames}
removable={!(required && hasOnlyOneItem)}
>
{children(item.data, index)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const DraggableCollectionItem: FunctionComponent<PropsWithChildren<CollectionIte
transition,
},
}
: undefined // what
: undefined
}
>
<div ref={setActivatorNodeRef} {...listeners} {...attributes} className={CollectionClasses.dragHandle}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ export const DateRangePickerInlineCalendar = ({
{presets ? (
<>
<Space w="sm" />
<DateRangePickerPresetSelect presets={presets} {...calendarInputProps} />
<DateRangePickerPresetSelect
presets={presets}
{...calendarInputProps}
selectProps={{comboboxProps: {withinPortal: false}}}
/>
</>
) : null}
</Group>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Select, SelectProps} from '@mantine/core';
import {ComboboxItem, Select, SelectProps} from '@mantine/core';
import dayjs from 'dayjs';
import {useEffect, useState} from 'react';
import {DateRangePickerValue} from './DateRangePickerInlineCalendar';
Expand All @@ -21,7 +21,7 @@ export const DateRangePickerPresetSelect = <T extends unknown>({
onChange,
selectProps = {},
}: DateRangePickerPresetsSelectProps<T>) => {
const selectData: any[] = Object.entries(presets).map(([val, {label}]) => ({value: val, label})); // what
const selectData: ComboboxItem[] = Object.entries(presets).map(([val, {label}]) => ({value: val, label}));

const getSelectedPreset = () => {
if (value[0] !== null && value[1] !== null && dayjs(value[0]).unix() !== dayjs(value[1]).unix()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const TablePredicate: FunctionComponent<TablePredicateProps> = ({id, data
<Group gap="xs" classNames={{root: TablePredicateClasses.wrapper}}>
{label ? <Text classNames={{root: TablePredicateClasses.label}}>{label}:</Text> : null}
<Select
// withinPortal what
comboboxProps={{withinPortal: true}}
value={form.values.predicates[id]}
onChange={handleChange}
data={data}
Expand Down

0 comments on commit f00b29b

Please sign in to comment.