import * as CSS from 'csstype'; import type { ThemeUIConfig } from "./options.js"; export type { CSSObject } from '@emotion/react'; type StandardCSSProperties = CSS.Properties; /** * Style properties with value of undefined, null or false are ignored. */ export type ThemeUIEmpty = undefined | null | false; /** * The `css` function accepts arrays as values for mobile-first responsive styles. * Note that this extends to non-theme values also. For example `display=['none', 'block']` * will also works. * * For more information see: https://styled-system.com/responsive-styles */ export type ResponsiveStyleValue = T | ThemeUIEmpty | Array; /** * All non-vendor-prefixed CSS properties. (Allow `number` to support CSS-in-JS libs, * since they are converted to pixels) */ export interface CSSProperties extends CSS.StandardProperties, CSS.SvgProperties, CSS.VendorProperties { } /** * Map of all CSS pseudo selectors (`:hover`, `:focus`, ...) */ export type CSSPseudoSelectorProps = { [K in CSS.Pseudos]?: ThemeUIStyleObject; }; interface AliasesCSSProperties { /** * The **`background-color`** CSS property sets the background color of an element. * * **Initial value**: `transparent` * * | Chrome | Firefox | Safari | Edge | IE | * | :----: | :-----: | :----: | :----: | :---: | * | **1** | **1** | **1** | **12** | **4** | * * @see https://developer.mozilla.org/docs/Web/CSS/background-color */ bg?: StandardCSSProperties['backgroundColor']; /** * The **`margin`** CSS property sets the margin area on all four sides of an element. It is a shorthand for `margin-top`, `margin-right`, `margin-bottom`, and `margin-left`. * * | Chrome | Firefox | Safari | Edge | IE | * | :----: | :-----: | :----: | :----: | :---: | * | **1** | **1** | **1** | **12** | **3** | * * @see https://developer.mozilla.org/docs/Web/CSS/margin */ m?: StandardCSSProperties['margin']; /** * The **`margin-top`** CSS property sets the margin area on the top of an element. A positive value places it farther from its neighbors, while a negative value places it closer. * * **Initial value**: `0` * * | Chrome | Firefox | Safari | Edge | IE | * | :----: | :-----: | :----: | :----: | :---: | * | **1** | **1** | **1** | **12** | **3** | * * @see https://developer.mozilla.org/docs/Web/CSS/margin-top */ mt?: StandardCSSProperties['marginTop']; /** * The **`margin-right`** CSS property sets the margin area on the right side of an element. A positive value places it farther from its neighbors, while a negative value places it closer. * * **Initial value**: `0` * * | Chrome | Firefox | Safari | Edge | IE | * | :----: | :-----: | :----: | :----: | :---: | * | **1** | **1** | **1** | **12** | **3** | * * @see https://developer.mozilla.org/docs/Web/CSS/margin-right */ mr?: StandardCSSProperties['marginRight']; /** * The **`margin-bottom`** CSS property sets the margin area on the bottom of an element. A positive value places it farther from its neighbors, while a negative value places it closer. * * **Initial value**: `0` * * | Chrome | Firefox | Safari | Edge | IE | * | :----: | :-----: | :----: | :----: | :---: | * | **1** | **1** | **1** | **12** | **3** | * * @see https://developer.mozilla.org/docs/Web/CSS/margin-bottom */ mb?: StandardCSSProperties['marginBottom']; /** * The **`margin-left`** CSS property sets the margin area on the left side of an element. A positive value places it farther from its neighbors, while a negative value places it closer. * * **Initial value**: `0` * * | Chrome | Firefox | Safari | Edge | IE | * | :----: | :-----: | :----: | :----: | :---: | * | **1** | **1** | **1** | **12** | **3** | * * @see https://developer.mozilla.org/docs/Web/CSS/margin-left */ ml?: StandardCSSProperties['marginLeft']; /** * The **`mx`** is shorthand for using both **`margin-left`** and **`margin-right`** CSS properties. They set the margin area on the left and right side of an element. A positive value placesit * farther from its neighbors, while a negative value places it closer. * * **Initial value**: `0` * * | Chrome | Firefox | Safari | Edge | IE | * | :----: | :-----: | :----: | :----: | :---: | * | **1** | **1** | **1** | **12** | **3** | * * @see https://styled-system.com/#margin-props * @see https://developer.mozilla.org/docs/Web/CSS/margin-left * @see https://developer.mozilla.org/docs/Web/CSS/margin-right */ mx?: StandardCSSProperties['marginLeft']; /** * The **`marginX`** is shorthand for using both **`margin-left`** and **`margin-right`** CSS properties. They set the margin area on the left and right side of an element. A positive value * places it farther from its neighbors, while a negative value places it closer. * * **Initial value**: `0` * * | Chrome | Firefox | Safari | Edge | IE | * | :----: | :-----: | :----: | :----: | :---: | * | **1** | **1** | **1** | **12** | **3** | * * @see https://styled-system.com/#margin-props * @see https://developer.mozilla.org/docs/Web/CSS/margin-left * @see https://developer.mozilla.org/docs/Web/CSS/margin-right */ marginX?: StandardCSSProperties['marginLeft']; /** * The **`my`** is shorthard for using both **`margin-top`** and **`margin-bottom`** CSS properties. They set the margin area on the top and bottom of an element. A positive value places it * farther from its neighbors, while a negative value places it closer. * * **Initial value**: `0` * * | Chrome | Firefox | Safari | Edge | IE | * | :----: | :-----: | :----: | :----: | :---: | * | **1** | **1** | **1** | **12** | **3** | * * @see https://styled-system.com/#margin-props * @see https://developer.mozilla.org/docs/Web/CSS/margin-top * @see https://developer.mozilla.org/docs/Web/CSS/margin-bottom */ my?: StandardCSSProperties['marginTop']; /** * The **`marginY`** is shorthard for using both **`margin-top`** and **`margin-bottom`** CSS properties. They set the margin area on the top and bottom of an element. A positive value places * it farther from its neighbors, while a negative value places it closer. * * **Initial value**: `0` * * | Chrome | Firefox | Safari | Edge | IE | * | :----: | :-----: | :----: | :----: | :---: | * | **1** | **1** | **1** | **12** | **3** | * * @see https://styled-system.com/#margin-props * @see https://developer.mozilla.org/docs/Web/CSS/margin-top * @see https://developer.mozilla.org/docs/Web/CSS/margin-bottom */ marginY?: StandardCSSProperties['marginTop']; /** * The **`padding`** CSS property sets the padding area on all four sides of an element. It is a shorthand for `padding-top`, `padding-right`, `padding-bottom`, and `padding-left`. * * | Chrome | Firefox | Safari | Edge | IE | * | :----: | :-----: | :----: | :----: | :---: | * | **1** | **1** | **1** | **12** | **4** | * * @see https://developer.mozilla.org/docs/Web/CSS/padding */ p?: StandardCSSProperties['padding']; /** * The **`padding-top`** padding area on the top of an element. * * **Initial value**: `0` * * | Chrome | Firefox | Safari | Edge | IE | * | :----: | :-----: | :----: | :----: | :---: | * | **1** | **1** | **1** | **12** | **4** | * * @see https://developer.mozilla.org/docs/Web/CSS/padding-top */ pt?: StandardCSSProperties['paddingTop']; /** * The **`padding-right`** CSS property sets the width of the padding area on the right side of an element. * * **Initial value**: `0` * * | Chrome | Firefox | Safari | Edge | IE | * | :----: | :-----: | :----: | :----: | :---: | * | **1** | **1** | **1** | **12** | **4** | * * @see https://developer.mozilla.org/docs/Web/CSS/padding-right */ pr?: StandardCSSProperties['paddingRight']; /** * The **`padding-bottom`** CSS property sets the height of the padding area on the bottom of an element. * * **Initial value**: `0` * * | Chrome | Firefox | Safari | Edge | IE | * | :----: | :-----: | :----: | :----: | :---: | * | **1** | **1** | **1** | **12** | **4** | * * @see https://developer.mozilla.org/docs/Web/CSS/padding-bottom */ pb?: StandardCSSProperties['paddingBottom']; /** * The **`padding-left`** CSS property sets the width of the padding area on the left side of an element. * * **Initial value**: `0` * * | Chrome | Firefox | Safari | Edge | IE | * | :----: | :-----: | :----: | :----: | :---: | * | **1** | **1** | **1** | **12** | **4** | * * @see https://developer.mozilla.org/docs/Web/CSS/padding-left */ pl?: StandardCSSProperties['paddingLeft']; /** * The **`px`** is shorthand property for CSS properties **`padding-left`** and **`padding-right`**. They set the width of the padding area on the left and right side of an element. * * **Initial value**: `0` * * | Chrome | Firefox | Safari | Edge | IE | * | :----: | :-----: | :----: | :----: | :---: | * | **1** | **1** | **1** | **12** | **4** | * * @see https://styled-system.com/#padding-props * @see https://developer.mozilla.org/docs/Web/CSS/padding-left * @see https://developer.mozilla.org/docs/Web/CSS/padding-right */ px?: StandardCSSProperties['paddingLeft']; /** * The **`paddingX`** is shorthand property for CSS properties **`padding-left`** and **`padding-right`**. They set the width of the padding area on the left and right side of an element. * * **Initial value**: `0` * * | Chrome | Firefox | Safari | Edge | IE | * | :----: | :-----: | :----: | :----: | :---: | * | **1** | **1** | **1** | **12** | **4** | * * @see https://styled-system.com/#padding-props * @see https://developer.mozilla.org/docs/Web/CSS/padding-left * @see https://developer.mozilla.org/docs/Web/CSS/padding-right */ paddingX?: StandardCSSProperties['paddingLeft']; /** * The **`py`** is shorthand property for CSS properties **`padding-top`** and **`padding-bottom`**. They set the width of the padding area on the top and bottom of an element. * * **Initial value**: `0` * * | Chrome | Firefox | Safari | Edge | IE | * | :----: | :-----: | :----: | :----: | :---: | * | **1** | **1** | **1** | **12** | **4** | * * @see https://styled-system.com/#padding-props * @see https://developer.mozilla.org/docs/Web/CSS/padding-top * @see https://developer.mozilla.org/docs/Web/CSS/padding-bottom */ py?: StandardCSSProperties['paddingTop']; /** * The **`paddingY`** is shorthand property for CSS properties **`padding-top`** and **`padding-bottom`**. They set the width of the padding area on the top and bottom of an element. * * **Initial value**: `0` * * | Chrome | Firefox | Safari | Edge | IE | * | :----: | :-----: | :----: | :----: | :---: | * | **1** | **1** | **1** | **12** | **4** | * * @see https://styled-system.com/#padding-props * @see https://developer.mozilla.org/docs/Web/CSS/padding-top * @see https://developer.mozilla.org/docs/Web/CSS/padding-bottom */ paddingY?: StandardCSSProperties['paddingTop']; /** * The **`size`** is a shorthand property for CSS properties **`width`** and **`height`**. * * @see https://theme-ui.com/sx-prop#theme-aware-properties * @see https://developer.mozilla.org/docs/Web/CSS/width * @see https://developer.mozilla.org/docs/Web/CSS/height */ /** * The **`scrollMarginX`** is shorthand property for CSS properties **`scroll-margin-left`** and **`scroll-margin-right`**. They set the margin of the scroll snap area that is used for snapping the element to the snapport. * * @see https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-margin-left * @see https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-margin-right */ scrollMarginX?: StandardCSSProperties['scrollMarginLeft']; /** * The **`scrollMarginY`** is shorthand property for CSS properties **`scroll-margin-top`** and **`scroll-margin-bottom`**. They set the margin of the scroll snap area that is used for snapping the element to the snapport. * * @see https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-margin-top * @see https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-margin-bottom */ scrollMarginY?: StandardCSSProperties['scrollMarginTop']; /** * The **`scrollPaddingX`** is shorthand property for CSS properties **`scroll-padding-left`** and **`scroll-padding-right`**. They set the width of the scroll padding area on the left and right side of an element. * * @see https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-padding-left * @see https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-padding-right */ scrollPaddingX?: StandardCSSProperties['scrollPaddingLeft']; /** * The **`scrollPaddingY`** is shorthand property for CSS properties **`scroll-padding-top`** and **`scroll-padding-bottom`**. They set the width of the scroll padding area on the top and bottom side of an element. * * @see https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-padding-top * @see https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-padding-bottom */ scrollPaddingY?: StandardCSSProperties['scrollPaddingTop']; size?: StandardCSSProperties['width']; } interface OverwriteCSSProperties { /** * The **`box-shadow`** CSS property adds shadow effects around an element's frame. You can set multiple effects separated by commas. A box shadow is described by X and Y offsets relative to the * element, blur and spread radii, and color. * * **Initial value**: `none` * * | Chrome | Firefox | Safari | Edge | IE | * | :-----: | :-----: | :-----: | :----: | :---: | * | **10** | **4** | **5.1** | **12** | **9** | * | 1 _-x-_ | | 3 _-x-_ | | | * * @see https://developer.mozilla.org/docs/Web/CSS/box-shadow */ boxShadow?: CSS.Property.BoxShadow | number; /** * The **`font-weight`** CSS property specifies the weight (or boldness) of the font. The font weights available to you will depend on the `font-family` you are using. Some fonts are only * available in `normal` and `bold`. * * **Initial value**: `normal` * * | Chrome | Firefox | Safari | Edge | IE | * | :----: | :-----: | :----: | :----: | :---: | * | **2** | **1** | **1** | **12** | **3** | * * @see https://developer.mozilla.org/docs/Web/CSS/font-weight */ fontWeight?: CSS.Property.FontWeight | string; /** * The **`border-top-style`** CSS property sets the line style of an element's top `border`. * * **Initial value**: `none` * * | Chrome | Firefox | Safari | Edge | IE | * | :----: | :-----: | :----: | :----: | :-----: | * | **1** | **1** | **1** | **12** | **5.5** | * * @see https://developer.mozilla.org/docs/Web/CSS/border-top-style */ borderTopStyle?: CSS.Property.BorderTopStyle | string; /** * The **`border-bottom-style`** CSS property sets the line style of an element's bottom `border`. * * **Initial value**: `none` * * | Chrome | Firefox | Safari | Edge | IE | * | :----: | :-----: | :----: | :----: | :-----: | * | **1** | **1** | **1** | **12** | **5.5** | * * @see https://developer.mozilla.org/docs/Web/CSS/border-bottom-style */ borderBottomStyle?: CSS.Property.BorderBottomStyle | string; /** * The **`border-right-style`** CSS property sets the line style of an element's right `border`. * * **Initial value**: `none` * * | Chrome | Firefox | Safari | Edge | IE | * | :----: | :-----: | :----: | :----: | :-----: | * | **1** | **1** | **1** | **12** | **5.5** | * * @see https://developer.mozilla.org/docs/Web/CSS/border-right-style */ borderRightStyle?: CSS.Property.BorderRightStyle | string; /** * The **`border-left-style`** CSS property sets the line style of an element's left `border`. * * **Initial value**: `none` * * | Chrome | Firefox | Safari | Edge | IE | * | :----: | :-----: | :----: | :----: | :-----: | * | **1** | **1** | **1** | **12** | **5.5** | * * @see https://developer.mozilla.org/docs/Web/CSS/border-left-style */ borderLeftStyle?: CSS.Property.BorderLeftStyle | string; /** * The **`border-radius`** CSS property rounds the corners of an element's outer border edge. You can set a single radius to make circular corners, or two radii to make elliptical corners. * * | Chrome | Firefox | Safari | Edge | IE | * | :-----: | :-----: | :-----: | :----: | :---: | * | **4** | **4** | **5** | **12** | **9** | * | 1 _-x-_ | | 3 _-x-_ | | | * * @see https://developer.mozilla.org/docs/Web/CSS/border-radius */ borderRadius?: CSS.Property.BorderRadius; /** * The **`z-index`** CSS property sets the z-order of a positioned element and its descendants or flex items. Overlapping elements with a larger z-index cover those with a smaller one. * * **Initial value**: `auto` * * | Chrome | Firefox | Safari | Edge | IE | * | :----: | :-----: | :----: | :----: | :---: | * | **1** | **1** | **1** | **12** | **4** | * * @see https://developer.mozilla.org/docs/Web/CSS/z-index */ zIndex?: CSS.Property.ZIndex | string; } /** * Map of all available CSS properties (including aliases and overwrites) * and their raw value. */ export interface ThemeUIExtendedCSSProperties extends Omit, AliasesCSSProperties, OverwriteCSSProperties { } type ThemeUIStyleValue = ResponsiveStyleValue | T[]>; export type StylePropertyValue = ThemeUIStyleValue> | ((theme: TTheme) => ThemeUIStyleValue> | undefined) | ThemeUIStyleObject | ThemeUIEmpty; export type ThemeUICSSProperties = { [K in keyof ThemeUIExtendedCSSProperties]: StylePropertyValue; }; export interface VariantProperty { /** * **`Variants`** can be useful for applying complex styles to a component based on a single prop. * * @example * const theme = { * buttons: { * primary: { * p: 3, * fontWeight: 'bold', * color: 'white', * bg: 'primary', * borderRadius: 2, * }, * }, * } * const result = css({ * variant: 'buttons.primary', * })(theme) * * @see https://styled-system.com/variants */ variant?: string; } export interface ThemeDerivedStyles { (theme: TTheme): ThemeUICSSObject; } export interface Label { /** * String appended to generated class name. * @see https://emotion.sh/docs/labels * * You can style HTML