UNPKG

@crossed/ui

Version:

A universal & performant styling library for React Native, Next.js & React

54 lines 1.65 kB
/** * Copyright (c) Paymium. * * This source code is licensed under the MIT license found in the * LICENSE file in the root of this projects source tree. */ import { PressableProps, View, type ViewProps } from 'react-native'; import { type CrossedMethods } from '@crossed/styled'; import { PropsWithChildren } from 'react'; import { gapStyles } from '../styles/gap'; import { justifyContentStyle } from '../styles/justifyContent'; import { alignItemsStyle, alignSelfStyle } from '../styles/alignItems'; type Base = { /** * extends style */ style?: CrossedMethods<any>; /** * Gap between children * if null, disable gap */ space?: null | keyof typeof gapStyles; /** * Center content * @default false */ center?: boolean; /** * Set justify-content style */ justifyContent?: keyof typeof justifyContentStyle; /** * Set align-items style */ alignItems?: keyof typeof alignItemsStyle; /** * Set align-self style */ alignSelf?: keyof typeof alignSelfStyle; }; export type BoxPressableProps = PropsWithChildren<{ pressable: true; }> & Base & Omit<PressableProps, 'style' | 'children'> & React.RefAttributes<View>; export type BoxViewProps = { pressable?: never | false; } & Base & Omit<ViewProps, 'style'> & React.RefAttributes<View>; /** * Represents the properties for a Box component. */ export type BoxProps = BoxViewProps | BoxPressableProps; type BoxComponent = React.ForwardRefExoticComponent<BoxViewProps | BoxPressableProps>; export declare const Box: BoxComponent; export {}; //# sourceMappingURL=Box.d.ts.map