UNPKG

1.97 kBPlain TextView Raw
1import { jsx as coreJsx } from '@theme-ui/core'
2import type { ThemeUIJSX, ThemeUIStyleObject } from '@theme-ui/core'
3import type { Theme } from '@theme-ui/core'
4
5export {
6 __ThemeUIContext,
7 merge,
8 useThemeUI,
9 createElement,
10} from '@theme-ui/core'
11export type {
12 ThemeUIContextValue,
13 SxProp,
14 ColorMode,
15 ColorModesScale,
16 CSSObject,
17 CSSProperties,
18 CSSPseudoSelectorProps,
19 ResponsiveStyleValue,
20 ThemeUICSSProperties,
21 ThemeUIStyleObject,
22 ThemeUICSSObject,
23 ThemeStyles,
24 TLengthStyledSystem,
25 StylePropertyValue,
26} from '@theme-ui/core'
27export type { Theme } from '@theme-ui/core'
28
29export { useColorMode, InitializeColorMode } from '@theme-ui/color-modes'
30export { ThemeUIProvider, ThemeProvider } from '@theme-ui/theme-provider'
31export { default as Global } from '@theme-ui/global'
32export * from '@theme-ui/components'
33export { css, get } from '@theme-ui/css'
34
35export const BaseStyles = (
36 props: Record<string, unknown> & { sx?: ThemeUIStyleObject<Theme> }
37): JSX.Element =>
38 jsx('div', {
39 ...props,
40 sx: {
41 fontFamily: 'body',
42 lineHeight: 'body',
43 fontWeight: 'body',
44 variant: 'styles',
45 ...props.sx,
46 },
47 })
48
49export const jsx = coreJsx
50
51export declare namespace jsx {
52 export namespace JSX {
53 export interface Element extends ThemeUIJSX.Element {}
54 export interface ElementClass extends ThemeUIJSX.ElementClass {}
55 export interface ElementAttributesProperty
56 extends ThemeUIJSX.ElementAttributesProperty {}
57 export interface ElementChildrenAttribute
58 extends ThemeUIJSX.ElementChildrenAttribute {}
59 export type LibraryManagedAttributes<C, P> =
60 ThemeUIJSX.LibraryManagedAttributes<C, P>
61 export interface IntrinsicAttributes
62 extends ThemeUIJSX.IntrinsicAttributes {}
63 export interface IntrinsicClassAttributes<T>
64 extends ThemeUIJSX.IntrinsicClassAttributes<T> {}
65 export interface IntrinsicElements extends ThemeUIJSX.IntrinsicElements {}
66 }
67}