import * as ss from 'styled-system'; import { FontWeightProps, CursorProps } from '../theme/theme'; /** Definitions for all style props contained in the **'core'** set. */ export interface CoreStyleProps extends FontWeightProps, CursorProps, ss.SpaceProps, ss.WidthProps, ss.ColorProps, ss.MinWidthProps, ss.MaxWidthProps, ss.HeightProps, ss.MinHeightProps, ss.MaxHeightProps, ss.LineHeightProps, ss.LetterSpacingProps, ss.FontFamilyProps, ss.FontSizeProps, ss.TextStyleProps, ss.TextAlignProps, ss.BoxShadowProps, ss.LetterSpacingProps, ss.OpacityProps, ss.OverflowProps { verticalAlign?: 'baseline' | 'length' | 'sub' | 'super' | 'top' | 'text-top' | 'middle' | 'bottom' | 'text-bottom' | 'initial' | 'inherit'; } /** Definitions for all style props contained in the **'borders'** set. */ export interface BordersStyleProps extends ss.BorderProps, ss.BorderBottomProps, ss.BorderTopProps, ss.BorderRightProps, ss.BorderLeftProps, ss.BorderColorProps, ss.BorderRadiusProps { } /** Definitions for all style props contained in the **'layout'** set. */ export interface LayoutStyleProps extends ss.DisplayProps, ss.MinWidthProps, ss.MaxWidthProps, ss.MinHeightProps, ss.MaxHeightProps { } /** Definitions for all style props contained in the **'flexbox'** set. */ export interface FlexboxStyleProps extends ss.DisplayProps, ss.AlignItemsProps, ss.AlignContentProps, ss.JustifyContentProps, ss.FlexWrapProps, ss.FlexDirectionProps, ss.FlexProps, ss.FlexBasisProps, ss.JustifySelfProps, ss.AlignSelfProps, ss.OrderProps { } /** Definitions for all style props contained in the **'position'** set. */ export interface PositionStyleProps extends ss.PositionProps, ss.ZIndexProps, ss.TopProps, ss.RightProps, ss.LeftProps, ss.BottomProps { } /** Definitions for all style props in **every set**. */ export interface AllStyleProps extends CoreStyleProps, BordersStyleProps, LayoutStyleProps, FlexboxStyleProps, PositionStyleProps { } /** The names of all currently available style prop sets. */ declare type StylePropsSetNames = 'all' | 'core' | 'borders' | 'layout' | 'flexbox' | 'position'; interface CreateStyledComponentOptions { /** **One or many style prop sets that will be injected into this component.** * Injected sets will allow for consumers to alter style characteristics of the component from JSX. * Each set contains different characteristics depending on what is required. Each set has an * accompanying TypeScript interface that can be applied to the new system component to get auto-completion * support for the properties that are editable. * @example * ```js const Com = createSystemComponent({ editablePropSets: [ 'core', 'layout', 'position' ] }) as React.FC ``` */ editablePropSets?: string[] | StylePropsSetNames; /** **The default style properties of the component.** Each property has access to values in the underlying * theme context. These styles can be overridden by the consumer. * @example * *```js const Com = createSystemComponent({ editablePropSets: 'core' defaultProps: { bg: 'primary', m: 'lg' } }) as React.FC ``` */ defaultProps?: object; /** Some style properties are not exposed via `styled-system` to set in `defaultProps`, if you need to set * an initial value for one of these, set it a normal `styled-components` template literal. * @example * *```js const Com = createSystemComponent({ defaultCss: `overflow: hidden;` }) as React.FC ``` */ defaultCss?: string; /** **These are style props that will change depending on certain conditions.** For instance, the background * color property of a div may change when it receives `true` for some prop. * @example * *```js const Com = createSystemComponent({ editablePropSets: 'core', conditionalProps: (props) => ({ bg: props.someBooleanProp ? 'primary' : 'error' }) }) as React.FC ``` */ conditionalProps?: Function; } /** **Returns a new React component whose style properties are ready to be altered by a consumer.** Use the * various `options` parameters to define which style props are editable by the consumer. * @example * ```tsx const Com = createSystemComponent({ editablePropSets: 'core', defaultProps: { is: 'section' bg: 'primary', color: 'red', width: 'sm' }, conditionalProps: (props) => ({ borderColor: props.isSelected ? 'green' : 'yellow' }), defaultCss: `overflow-y: hidden;` }) as React.FC; // Actually using the component with a few style overrides. const tsxString = (); ``` */ export declare const createSystemComponent: ({ editablePropSets, defaultProps, conditionalProps, defaultCss, }?: CreateStyledComponentOptions) => any; export {};