Skip to content

Commit

Permalink
[@mantine/core] Box: Add display system props (#2943)
Browse files Browse the repository at this point in the history
* [@mantine/core] Box: Add display system props

* [@mantine/core] Loader: add exclude display  props
  • Loading branch information
auronsan1st committed Nov 12, 2022
1 parent fdc0786 commit 4f46576
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions scripts/docgen/docgen-parser.ts
Expand Up @@ -32,6 +32,7 @@ const EXCLUDE_PROPS = [
'bgsz',
'bottom',
'c',
'display',
'ff',
'fs',
'fw',
Expand Down
1 change: 1 addition & 0 deletions src/mantine-core/src/Box/Box.story.tsx
Expand Up @@ -16,6 +16,7 @@ export function SystemProps() {
pt="xl"
w={400}
h={560}
display="flex"
>
Some box
</Box>
Expand Down
Expand Up @@ -46,6 +46,7 @@ export function extractSystemStyles<T extends Record<string, any>>(
bottom,
right,
inset,
display,
...rest
} = others;
const systemStyles = filterProps({
Expand Down Expand Up @@ -91,6 +92,7 @@ export function extractSystemStyles<T extends Record<string, any>>(
bottom,
right,
inset,
display,
});

return { systemStyles, rest: rest as unknown as T };
Expand Down
Expand Up @@ -55,4 +55,6 @@ export const SYSTEM_PROPS: Record<string, SystemPropData> = {
bottom: { type: 'default', property: 'bottom' },
right: { type: 'default', property: 'right' },
inset: { type: 'default', property: 'inset' },

display: { type: 'default', property: 'display' },
};
2 changes: 1 addition & 1 deletion src/mantine-core/src/Loader/Loader.tsx
Expand Up @@ -28,7 +28,7 @@ const sizes = {

export interface LoaderProps
extends DefaultProps,
Omit<React.ComponentPropsWithoutRef<'svg'>, 'opacity'> {
Omit<React.ComponentPropsWithoutRef<'svg'>, 'display' | 'opacity'> {
/** Defines width of loader */
size?: MantineNumberSize;

Expand Down
2 changes: 2 additions & 0 deletions src/mantine-styles/src/theme/types/MantineStyleSystem.ts
Expand Up @@ -55,6 +55,8 @@ export interface MantineStyleSystemProps {
bottom?: SystemProp<CSSProperties['bottom']>;
right?: SystemProp<CSSProperties['right']>;
inset?: SystemProp<CSSProperties['inset']>;

display?: SystemProp<CSSProperties['display']>;
}

export type MantineStyleSystemSize = keyof MantineStyleSystemProps;

0 comments on commit 4f46576

Please sign in to comment.