Skip to content

Commit

Permalink
fix: export all components props
Browse files Browse the repository at this point in the history
  • Loading branch information
mobily committed Apr 8, 2024
1 parent 299106a commit 2a45345
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/components/Bleed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type BoxProps = Omit<
| 'marginEnd'
>;

type Props = BoxProps & {
export type BleedProps = BoxProps & {
readonly space?: ResponsiveProp<number>;
readonly horizontal?: ResponsiveProp<number>;
readonly vertical?: ResponsiveProp<number>;
Expand All @@ -29,7 +29,7 @@ type Props = BoxProps & {
readonly end?: ResponsiveProp<number>;
};

export const Bleed = (props: Props) => {
export const Bleed = (props: BleedProps) => {
const { children, space, horizontal, vertical, start, end, top, right, bottom, left, ...rest } =
props;

Expand Down
4 changes: 2 additions & 2 deletions src/components/FloatBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import { Box } from './Box';

type BoxProps = React.ComponentProps<typeof Box>;

type Props = Omit<BoxProps, 'flex'> & {
export type FloatBoxProps = Omit<BoxProps, 'flex'> & {
readonly top?: ResponsiveProp<DimensionValue>;
readonly right?: ResponsiveProp<DimensionValue>;
readonly bottom?: ResponsiveProp<DimensionValue>;
readonly left?: ResponsiveProp<DimensionValue>;
readonly offset?: ResponsiveProp<DimensionValue>;
};

export const FloatBox = (props: Props) => {
export const FloatBox = (props: FloatBoxProps) => {
const { children, top, right, bottom, left, offset, style, ...rest } = props;

const resolveResponsiveProp = useResponsiveProp();
Expand Down
4 changes: 2 additions & 2 deletions src/components/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { makeWithIndex } from '../utils';
import { Box } from './Box';
import { FloatBox } from './FloatBox';

type Props = {
export type GridProps = {
readonly gutter?: ResponsiveProp<number>;
readonly margin?: ResponsiveProp<number>;
readonly columns?: ResponsiveProp<number>;
Expand All @@ -35,7 +35,7 @@ const calculateGridWidth = (options: Options) => {
return options.width * columns + gutterCount * options.gutter + options.margin * 2;
};

export const Grid = (props: Props) => {
export const Grid = (props: GridProps) => {
const { gutter = 2, margin = 2, opacity = 0.2, columns = 8, color = 'red' } = props;

const { multiply } = useSpacingHelpers();
Expand Down
4 changes: 2 additions & 2 deletions src/components/Hidden.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import * as React from 'react';

import type { Breakpoint } from '../types';

type Props = React.PropsWithChildren<{
export type HiddenProps = React.PropsWithChildren<{
readonly above?: Breakpoint;
readonly below?: Breakpoint;
}>;

export const Hidden = (_props: Props): JSX.Element => {
export const Hidden = (_props: HiddenProps): JSX.Element => {
throw new Error(
'[Stacks] Logical expression for the `Hidden` component could not be handled. Open a new issue and provide reproduction code.',
);
Expand Down
4 changes: 2 additions & 2 deletions src/components/Inline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type BoxProps = Omit<
'gap' | 'rowGap' | 'columnGap' | 'alignX' | 'alignY' | 'direction' | 'wrap'
>;

type Props = BoxProps & {
export type InlineProps = BoxProps & {
readonly space?: ResponsiveProp<number>;
readonly spaceX?: ResponsiveProp<number>;
readonly spaceY?: ResponsiveProp<number>;
Expand All @@ -18,7 +18,7 @@ type Props = BoxProps & {
readonly collapseBelow?: Breakpoint;
};

export const Inline = (props: Props) => {
export const Inline = (props: InlineProps) => {
const { space, children, spaceX, spaceY, alignX, alignY, collapseBelow, ...rest } = props;
const breakpoint = useBreakpointComparators();

Expand Down
4 changes: 2 additions & 2 deletions src/components/Inset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type BoxProps = Omit<
| 'paddingEnd'
>;

type Props = BoxProps & {
export type InsetProps = BoxProps & {
readonly space?: ResponsiveProp<number>;
readonly horizontal?: ResponsiveProp<number>;
readonly vertical?: ResponsiveProp<number>;
Expand All @@ -28,7 +28,7 @@ type Props = BoxProps & {
readonly end?: ResponsiveProp<number>;
};

export const Inset = (props: Props) => {
export const Inset = (props: InsetProps) => {
const { children, space, horizontal, vertical, start, end, top, right, bottom, left, ...rest } =
props;

Expand Down
4 changes: 2 additions & 2 deletions src/components/Stack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ type BoxProps = Omit<
'direction' | 'alignX' | 'alignY' | 'rowGap' | 'columnGap'
>;

type Props = BoxProps & {
export type StackProps = BoxProps & {
readonly space?: ResponsiveProp<number>;
readonly horizontal?: ResponsiveProp<boolean>;
readonly align?: ResponsiveProp<AxisX | AxisY>;
readonly divider?: React.ReactElement;
};

export const Stack = (props: Props) => {
export const Stack = (props: StackProps) => {
const { children, flex = 'content', space, horizontal, align, divider, ...rest } = props;

const resolveResponsiveProp = useResponsiveProp();
Expand Down
4 changes: 2 additions & 2 deletions src/components/Tiles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type BoxProps = Omit<
'gap' | 'rowGap' | 'columnGap' | 'direction' | 'alignX' | 'alignY'
>;

type Props = BoxProps & {
export type TilesProps = BoxProps & {
readonly columns?: ResponsiveProp<number>;
readonly space?: ResponsiveProp<number>;
readonly spaceX?: ResponsiveProp<number>;
Expand All @@ -19,7 +19,7 @@ type Props = BoxProps & {
readonly alignY?: ResponsiveProp<AxisY | Space>;
};

export const Tiles = (props: Props) => {
export const Tiles = (props: TilesProps) => {
const { children, columns = 1, space, spaceX, spaceY, fill = false, reverse, ...rest } = props;

const resolveResponsiveProp = useResponsiveProp();
Expand Down

0 comments on commit 2a45345

Please sign in to comment.