Skip to content

Commit

Permalink
Move exports to their own folders
Browse files Browse the repository at this point in the history
  • Loading branch information
DiegoAndai committed Mar 20, 2024
1 parent 40af2ff commit e2de1a8
Show file tree
Hide file tree
Showing 87 changed files with 136 additions and 74 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PropsFor, SimpleStyleFunction, borders } from './Box';
import { PropsFor, SimpleStyleFunction, borders } from '../Box';

export const border: SimpleStyleFunction<'border'>;
export const borderTop: SimpleStyleFunction<'borderTop'>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import responsivePropType from './responsivePropType';
import style from './style';
import compose from './compose';
import { createUnaryUnit, getValue } from './spacing';
import { handleBreakpoints } from './breakpoints';
import responsivePropType from '../responsivePropType';
import style from '../style';
import compose from '../compose';
import { createUnaryUnit, getValue } from '../spacing';
import { handleBreakpoints } from '../breakpoints';

export function borderTransform(value) {
if (typeof value !== 'number') {
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions packages/mui-system/src/borders/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use client'
export { default } from './borders'
export * from './borders'
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { CSSObject } from '@mui/styled-engine';
import { Breakpoints } from './createTheme/createBreakpoints';
import type { Breakpoint } from './createTheme';
import { ResponsiveStyleValue } from './styleFunctionSx';
import { StyleFunction } from './Box';
import { Breakpoints } from '../createTheme/createBreakpoints';
import type { Breakpoint } from '../createTheme';
import { ResponsiveStyleValue } from '../styleFunctionSx';
import { StyleFunction } from '../Box';

export interface ResolveBreakpointValuesOptions<T> {
values: ResponsiveStyleValue<T>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import PropTypes from 'prop-types';
import deepmerge from '@mui/utils/deepmerge';
import merge from './merge';
import merge from '../merge';

// The breakpoint **start** at this value.
// For instance with the first breakpoint xs: [xs, sm[.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import breakpoints, {
resolveBreakpointValues,
removeUnusedBreakpoints,
} from './breakpoints';
import style from './style';
import style from '../style';

const textColor = style({
prop: 'color',
Expand Down
3 changes: 3 additions & 0 deletions packages/mui-system/src/breakpoints/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use client'
export { default } from './breakpoints'
export * from './breakpoints'
File renamed without changes.
2 changes: 2 additions & 0 deletions packages/mui-system/src/colorManipulator/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
'use client'
export * from './colorManipulator'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ComposedStyleFunction, StyleFunction } from './Box';
import { ComposedStyleFunction, StyleFunction } from '../Box';

export default function compose<T extends Array<StyleFunction<any>>>(
...args: T
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import merge from './merge';
import merge from '../merge';

function compose(...styles) {
const handlers = styles.reduce((acc, style) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from 'chai';
import compose from './compose';
import style from './style';
import style from '../style';

const textColor = style({
prop: 'color',
Expand Down
2 changes: 2 additions & 0 deletions packages/mui-system/src/compose/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
'use client'
export { default } from './compose'
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { OverridableComponent } from '@mui/types';
import { BoxTypeMap } from './Box';
import { Theme as SystemTheme } from './createTheme';
import { BoxTypeMap } from '../Box';
import { Theme as SystemTheme } from '../createTheme';

export default function createBox<
T extends object = SystemTheme,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import * as React from 'react';
import clsx from 'clsx';
import styled from '@mui/styled-engine';
import styleFunctionSx, { extendSxProp } from './styleFunctionSx';
import useTheme from './useTheme';
import styleFunctionSx, { extendSxProp } from '../styleFunctionSx';
import useTheme from '../useTheme';

export default function createBox(options = {}) {
const { themeId, defaultTheme, defaultClassName = 'MuiBox-root', generateClassName } = options;
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions packages/mui-system/src/createBox/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
'use client'
export { default } from './createBox'
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import {
CreateMUIStyled as CreateMUIStyledStyledEngine,
CSSInterpolation,
} from '@mui/styled-engine';
import styleFunctionSx, { SxProps } from './styleFunctionSx';
import { Theme as DefaultTheme } from './createTheme';
import styleFunctionSx, { SxProps } from '../styleFunctionSx';
import { Theme as DefaultTheme } from '../createTheme';

export function shouldForwardProp(propName: PropertyKey): boolean;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import styledEngineStyled, { internal_processStyles as processStyles } from '@mu
import { isPlainObject } from '@mui/utils/deepmerge';
import capitalize from '@mui/utils/capitalize';
import getDisplayName from '@mui/utils/getDisplayName';
import createTheme from './createTheme';
import styleFunctionSx from './styleFunctionSx';
import createTheme from '../createTheme';
import styleFunctionSx from '../styleFunctionSx';

function isEmpty(obj) {
return Object.keys(obj).length === 0;
Expand Down
3 changes: 3 additions & 0 deletions packages/mui-system/src/createStyled/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use client'
export { default } from './createStyled'
export * from './createStyled'
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { PropsFor, grid } from './Box';
import { PropsFor, grid } from '../Box';

export type CssGridProps = PropsFor<typeof grid>;
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import style from './style';
import compose from './compose';
import { createUnaryUnit, getValue } from './spacing';
import { handleBreakpoints } from './breakpoints';
import responsivePropType from './responsivePropType';
import style from '../style';
import compose from '../compose';
import { createUnaryUnit, getValue } from '../spacing';
import { handleBreakpoints } from '../breakpoints';
import responsivePropType from '../responsivePropType';

// false positive
// eslint-disable-next-line react/function-component-definition
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions packages/mui-system/src/cssGrid/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use client'
export { default } from './cssGrid'
export * from './cssGrid'
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { PropsFor, display } from './Box';
import { PropsFor, display } from '../Box';

export type DisplayProps = PropsFor<typeof display>;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import style from './style';
import compose from './compose';
import style from '../style';
import compose from '../compose';

export const displayPrint = style({
prop: 'displayPrint',
Expand Down
3 changes: 3 additions & 0 deletions packages/mui-system/src/display/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use client'
export { default } from './display'
export * from './display'
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { PropsFor, flexbox } from './Box';
import { PropsFor, flexbox } from '../Box';

export type FlexboxProps = PropsFor<typeof flexbox>;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import style from './style';
import compose from './compose';
import style from '../style';
import compose from '../compose';

export const flexBasis = style({
prop: 'flexBasis',
Expand Down
3 changes: 3 additions & 0 deletions packages/mui-system/src/flexbox/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use client'
export { default } from './flexbox'
export * from './flexbox'
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import borders from './borders';
import display from './display';
import flexbox from './flexbox';
import grid from './cssGrid';
import positions from './positions';
import palette from './palette';
import shadows from './shadows';
import sizing from './sizing';
import spacing from './spacing';
import typography from './typography';
import borders from '../borders';
import display from '../display';
import flexbox from '../flexbox';
import grid from '../cssGrid';
import positions from '../positions';
import palette from '../palette';
import shadows from '../shadows';
import sizing from '../sizing';
import spacing from '../spacing';
import typography from '../typography';

const filterPropsMapping = {
borders: borders.filterProps,
Expand Down
3 changes: 3 additions & 0 deletions packages/mui-system/src/getThemeValue/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use client'
export { default } from './getThemeValue'
export * from './getThemeValue'
2 changes: 2 additions & 0 deletions packages/mui-system/src/memoize/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
'use client'
export { default } from './memoize'
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions packages/mui-system/src/merge/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
'use client'
export { default } from './merge'
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions packages/mui-system/src/palette/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use client'
export { default } from './palette'
export * from './palette'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PropsFor, SimpleStyleFunction, palette } from './Box';
import { PropsFor, SimpleStyleFunction, palette } from '../Box';

export const color: SimpleStyleFunction<'color'>;
export const bgcolor: SimpleStyleFunction<'bgcolor'>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import style from './style';
import compose from './compose';
import style from '../style';
import compose from '../compose';

export function paletteTransform(value, userValue) {
if (userValue === 'grey') {
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions packages/mui-system/src/positions/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use client'
export { default } from './positions'
export * from './positions'
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { PropsFor, positions } from './Box';
import { PropsFor, positions } from '../Box';

export type PositionsProps = PropsFor<typeof positions>;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import style from './style';
import compose from './compose';
import style from '../style';
import compose from '../compose';

export const position = style({
prop: 'position',
Expand Down
2 changes: 2 additions & 0 deletions packages/mui-system/src/propsToClassKey/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
'use client'
export { default } from './propsToClassKey'
File renamed without changes.
2 changes: 2 additions & 0 deletions packages/mui-system/src/responsivePropType/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
'use client'
export { default } from './responsivePropType'
2 changes: 2 additions & 0 deletions packages/mui-system/src/shadows/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
'use client'
export { default } from './shadows'
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { PropsFor, shadows } from './Box';
import { PropsFor, shadows } from '../Box';

export type ShadowsProps = PropsFor<typeof shadows>;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import style from './style';
import style from '../style';

const boxShadow = style({
prop: 'boxShadow',
Expand Down
3 changes: 3 additions & 0 deletions packages/mui-system/src/sizing/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use client'
export { default } from './sizing'
export * from './sizing'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PropsFor, SimpleStyleFunction, sizing } from './Box';
import { PropsFor, SimpleStyleFunction, sizing } from '../Box';

export const width: SimpleStyleFunction<'width'>;
export const maxWidth: SimpleStyleFunction<'maxWidth'>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import style from './style';
import compose from './compose';
import { handleBreakpoints, values as breakpointsValues } from './breakpoints';
import style from '../style';
import compose from '../compose';
import { handleBreakpoints, values as breakpointsValues } from '../breakpoints';

export function sizingTransform(value) {
return value <= 1 && value !== 0 ? `${value * 100}%` : value;
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions packages/mui-system/src/spacing/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use client'
export { default } from './spacing'
export * from './spacing'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SimpleStyleFunction, spacing, PropsFor } from './Box';
import { SimpleStyleFunction, spacing, PropsFor } from '../Box';

export type SpacingValueType = string | number | null | undefined;
export type SpacingProps = PropsFor<typeof spacing>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import responsivePropType from './responsivePropType';
import { handleBreakpoints } from './breakpoints';
import { getPath } from './style';
import merge from './merge';
import memoize from './memoize';
import responsivePropType from '../responsivePropType';
import { handleBreakpoints } from '../breakpoints';
import { getPath } from '../style';
import merge from '../merge';
import memoize from '../memoize';

const properties = {
m: 'margin',
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions packages/mui-system/src/style/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use client'
export { default } from './style'
export * from './style'
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CSSObject } from '@mui/styled-engine';
import { StyleFunction } from './Box';
import { StyleFunction } from '../Box';

export type TransformFunction = (
cssValue: unknown,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import capitalize from '@mui/utils/capitalize';
import responsivePropType from './responsivePropType';
import { handleBreakpoints } from './breakpoints';
import responsivePropType from '../responsivePropType';
import { handleBreakpoints } from '../breakpoints';

export function getPath(obj, path, checkVars = true) {
if (!path || typeof path !== 'string') {
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions packages/mui-system/src/styled/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
'use client'
export { default } from './styled'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CreateMUIStyled } from './createStyled';
import { CreateMUIStyled } from '../createStyled';

declare const styled: CreateMUIStyled;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import createStyled from './createStyled';
import createStyled from '../createStyled';

const styled = createStyled();

Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions packages/mui-system/src/typography/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use client'
export { default } from './typography'
export * from './typography'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PropsFor, SimpleStyleFunction, typography } from './Box';
import { PropsFor, SimpleStyleFunction, typography } from '../Box';

export const typographyVariant: SimpleStyleFunction<'typography'>;
export const fontFamily: SimpleStyleFunction<'fontFamily'>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import style from './style';
import compose from './compose';
import style from '../style';
import compose from '../compose';

export const fontFamily = style({
prop: 'fontFamily',
Expand Down
3 changes: 3 additions & 0 deletions packages/mui-system/src/useTheme/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use client'
export { default } from './useTheme'
export * from './useTheme'
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { Theme } from './createTheme';
import { Theme } from '../createTheme';

export default function useTheme<T = Theme>(defaultTheme?: T): T;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import createTheme from './createTheme';
import useThemeWithoutDefault from './useThemeWithoutDefault';
import createTheme from '../createTheme';
import useThemeWithoutDefault from '../useThemeWithoutDefault';

export const systemDefaultTheme = createTheme();

Expand Down
2 changes: 2 additions & 0 deletions packages/mui-system/src/useThemeWithoutDefault/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
'use client'
export { default } from './useThemeWithoutDefault'

0 comments on commit e2de1a8

Please sign in to comment.