1 | import { E as EmotionCache, I as Interpolation, C as CSSInterpolation, S as SerializedStyles, K as Keyframes, a as ComponentSelector, b as StorybookTheme, T as Typography, c as Color, B as Background, d as ThemeVars, F as FunctionInterpolation } from './create-e8afafc2.js';
|
2 | export { A as Animation, l as Brand, e as CSSObject, j as Easing, k as TextSize, i as ThemeVarsColors, h as ThemeVarsPartial, g as background, f as color, n as create, m as themes, t as typography } from './create-e8afafc2.js';
|
3 | import * as React$1 from 'react';
|
4 | import { Provider, ReactElement, createElement, ReactNode } from 'react';
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | interface StylisElement {
|
11 | type: string
|
12 | value: string
|
13 | props: Array<string> | string
|
14 | root: StylisElement | null
|
15 | parent: StylisElement | null
|
16 | children: Array<StylisElement> | string
|
17 | line: number
|
18 | column: number
|
19 | length: number
|
20 | return: string
|
21 | }
|
22 | type StylisPluginCallback = (
|
23 | element: StylisElement,
|
24 | index: number,
|
25 | children: Array<StylisElement>,
|
26 | callback: StylisPluginCallback
|
27 | ) => string | void
|
28 |
|
29 | type StylisPlugin = (
|
30 | element: StylisElement,
|
31 | index: number,
|
32 | children: Array<StylisElement>,
|
33 | callback: StylisPluginCallback
|
34 | ) => string | void
|
35 |
|
36 | interface Options {
|
37 | nonce?: string
|
38 | stylisPlugins?: Array<StylisPlugin>
|
39 | key: string
|
40 | container?: Node
|
41 | speedy?: boolean
|
42 |
|
43 | prepend?: boolean
|
44 | insertionPoint?: HTMLElement
|
45 | }
|
46 |
|
47 | declare function createCache(options: Options): EmotionCache
|
48 |
|
49 | type WithConditionalCSSProp<P> = 'className' extends keyof P
|
50 | ? string extends P['className' & keyof P]
|
51 | ? { css?: Interpolation<Theme> }
|
52 | : {}
|
53 | : {}
|
54 |
|
55 |
|
56 | type ReactJSXElement = JSX.Element
|
57 | type ReactJSXElementClass = JSX.ElementClass
|
58 | type ReactJSXElementAttributesProperty = JSX.ElementAttributesProperty
|
59 | type ReactJSXElementChildrenAttribute = JSX.ElementChildrenAttribute
|
60 | type ReactJSXLibraryManagedAttributes<C, P> = JSX.LibraryManagedAttributes<C, P>
|
61 | type ReactJSXIntrinsicAttributes = JSX.IntrinsicAttributes
|
62 | type ReactJSXIntrinsicClassAttributes<T> = JSX.IntrinsicClassAttributes<T>
|
63 | type ReactJSXIntrinsicElements = JSX.IntrinsicElements
|
64 |
|
65 |
|
66 |
|
67 | type ReactJSXElementType = string | React.JSXElementConstructor<any>
|
68 |
|
69 | declare namespace EmotionJSX {
|
70 | type ElementType = ReactJSXElementType
|
71 | interface Element extends ReactJSXElement {}
|
72 | interface ElementClass extends ReactJSXElementClass {}
|
73 | interface ElementAttributesProperty
|
74 | extends ReactJSXElementAttributesProperty {}
|
75 | interface ElementChildrenAttribute extends ReactJSXElementChildrenAttribute {}
|
76 |
|
77 | type LibraryManagedAttributes<C, P> = WithConditionalCSSProp<P> &
|
78 | ReactJSXLibraryManagedAttributes<C, P>
|
79 |
|
80 | interface IntrinsicAttributes extends ReactJSXIntrinsicAttributes {}
|
81 | interface IntrinsicClassAttributes<T>
|
82 | extends ReactJSXIntrinsicClassAttributes<T> {}
|
83 |
|
84 | type IntrinsicElements = {
|
85 | [K in keyof ReactJSXIntrinsicElements]: ReactJSXIntrinsicElements[K] & {
|
86 | css?: Interpolation<Theme>
|
87 | }
|
88 | }
|
89 | }
|
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 | type PropsOf<
|
96 | C extends keyof JSX.IntrinsicElements | React$1.JSXElementConstructor<any>
|
97 | > = JSX.LibraryManagedAttributes<C, React$1.ComponentProps<C>>
|
98 |
|
99 |
|
100 | type DistributiveOmit<T, U> = T extends any
|
101 | ? Pick<T, Exclude<keyof T, U>>
|
102 | : never
|
103 |
|
104 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 | interface ThemeProviderProps {
|
110 | theme: Partial<Theme> | ((outerTheme: Theme) => Theme)
|
111 | children: React$1.ReactNode
|
112 | }
|
113 |
|
114 | declare function useTheme(): Theme
|
115 |
|
116 | interface ThemeProvider {
|
117 | (props: ThemeProviderProps): React$1.ReactElement
|
118 | }
|
119 |
|
120 | declare const ThemeProvider: ThemeProvider
|
121 |
|
122 | type withTheme = <
|
123 | C extends React$1.ComponentType<React$1.ComponentProps<C>>
|
124 | >(
|
125 | component: C
|
126 | ) => React$1.FC<DistributiveOmit<PropsOf<C>, 'theme'> & { theme?: Theme }>
|
127 |
|
128 | declare const withTheme: withTheme
|
129 |
|
130 |
|
131 |
|
132 |
|
133 |
|
134 |
|
135 |
|
136 | interface Theme {}
|
137 | declare const CacheProvider: Provider<EmotionCache>
|
138 |
|
139 | declare function css(
|
140 | template: TemplateStringsArray,
|
141 | ...args: Array<CSSInterpolation>
|
142 | ): SerializedStyles
|
143 | declare function css(...args: Array<CSSInterpolation>): SerializedStyles
|
144 |
|
145 | interface GlobalProps {
|
146 | styles: Interpolation<Theme>
|
147 | }
|
148 |
|
149 | /**
|
150 | * @desc
|
151 | * JSX generic are supported only after TS@2.9
|
152 | */
|
153 | declare function Global(props: GlobalProps): ReactElement
|
154 |
|
155 | declare function keyframes(
|
156 | template: TemplateStringsArray,
|
157 | ...args: Array<CSSInterpolation>
|
158 | ): Keyframes
|
159 | declare function keyframes(...args: Array<CSSInterpolation>): Keyframes
|
160 |
|
161 | interface ArrayClassNamesArg extends Array<ClassNamesArg> {}
|
162 | type ClassNamesArg =
|
163 | | undefined
|
164 | | null
|
165 | | string
|
166 | | boolean
|
167 | | { [className: string]: boolean | null | undefined }
|
168 | | ArrayClassNamesArg
|
169 |
|
170 | interface ClassNamesContent {
|
171 | css(template: TemplateStringsArray, ...args: Array<CSSInterpolation>): string
|
172 | css(...args: Array<CSSInterpolation>): string
|
173 | cx(...args: Array<ClassNamesArg>): string
|
174 | theme: Theme
|
175 | }
|
176 | interface ClassNamesProps {
|
177 | children(content: ClassNamesContent): ReactNode
|
178 | }
|
179 |
|
180 |
|
181 |
|
182 |
|
183 | declare function ClassNames(props: ClassNamesProps): ReactElement
|
184 |
|
185 | declare const jsx: typeof createElement
|
186 | declare namespace jsx {
|
187 | namespace JSX {
|
188 | type ElementType = EmotionJSX.ElementType
|
189 | interface Element extends EmotionJSX.Element {}
|
190 | interface ElementClass extends EmotionJSX.ElementClass {}
|
191 | interface ElementAttributesProperty
|
192 | extends EmotionJSX.ElementAttributesProperty {}
|
193 | interface ElementChildrenAttribute
|
194 | extends EmotionJSX.ElementChildrenAttribute {}
|
195 | type LibraryManagedAttributes<C, P> = EmotionJSX.LibraryManagedAttributes<
|
196 | C,
|
197 | P
|
198 | >
|
199 | interface IntrinsicAttributes extends EmotionJSX.IntrinsicAttributes {}
|
200 | interface IntrinsicClassAttributes<T>
|
201 | extends EmotionJSX.IntrinsicClassAttributes<T> {}
|
202 | type IntrinsicElements = EmotionJSX.IntrinsicElements
|
203 | }
|
204 | }
|
205 |
|
206 |
|
207 |
|
208 |
|
209 |
|
210 |
|
211 |
|
212 | interface FilteringStyledOptions<
|
213 | Props = Record<string, any>,
|
214 | ForwardedProps extends keyof Props & string = keyof Props & string
|
215 | > {
|
216 | label?: string
|
217 | shouldForwardProp?: (propName: string) => propName is ForwardedProps
|
218 | target?: string
|
219 | }
|
220 |
|
221 | interface StyledOptions<Props = Record<string, any>> {
|
222 | label?: string
|
223 | shouldForwardProp?: (propName: string) => boolean
|
224 | target?: string
|
225 | }
|
226 |
|
227 |
|
228 |
|
229 |
|
230 |
|
231 | interface StyledComponent<
|
232 | ComponentProps extends {},
|
233 | SpecificComponentProps extends {} = {},
|
234 | JSXProps extends {} = {}
|
235 | > extends React$1.FC<ComponentProps & SpecificComponentProps & JSXProps>,
|
236 | ComponentSelector {
|
237 | withComponent<C extends React$1.ComponentClass<React$1.ComponentProps<C>>>(
|
238 | component: C
|
239 | ): StyledComponent<
|
240 | ComponentProps & PropsOf<C>,
|
241 | {},
|
242 | { ref?: React$1.Ref<InstanceType<C>> }
|
243 | >
|
244 | withComponent<C extends React$1.ComponentType<React$1.ComponentProps<C>>>(
|
245 | component: C
|
246 | ): StyledComponent<ComponentProps & PropsOf<C>>
|
247 | withComponent<Tag extends keyof JSX.IntrinsicElements>(
|
248 | tag: Tag
|
249 | ): StyledComponent<ComponentProps, JSX.IntrinsicElements[Tag]>
|
250 | }
|
251 |
|
252 |
|
253 |
|
254 |
|
255 |
|
256 | interface CreateStyledComponent<
|
257 | ComponentProps extends {},
|
258 | SpecificComponentProps extends {} = {},
|
259 | JSXProps extends {} = {}
|
260 | > {
|
261 | |
262 |
|
263 |
|
264 | <AdditionalProps extends {} = {}>(
|
265 | ...styles: Array<
|
266 | Interpolation<
|
267 | ComponentProps &
|
268 | SpecificComponentProps &
|
269 | AdditionalProps & { theme: Theme }
|
270 | >
|
271 | >
|
272 | ): StyledComponent<
|
273 | ComponentProps & AdditionalProps,
|
274 | SpecificComponentProps,
|
275 | JSXProps
|
276 | >
|
277 |
|
278 | (
|
279 | template: TemplateStringsArray,
|
280 | ...styles: Array<
|
281 | Interpolation<ComponentProps & SpecificComponentProps & { theme: Theme }>
|
282 | >
|
283 | ): StyledComponent<ComponentProps, SpecificComponentProps, JSXProps>
|
284 |
|
285 | |
286 |
|
287 |
|
288 | <AdditionalProps extends {}>(
|
289 | template: TemplateStringsArray,
|
290 | ...styles: Array<
|
291 | Interpolation<
|
292 | ComponentProps &
|
293 | SpecificComponentProps &
|
294 | AdditionalProps & { theme: Theme }
|
295 | >
|
296 | >
|
297 | ): StyledComponent<
|
298 | ComponentProps & AdditionalProps,
|
299 | SpecificComponentProps,
|
300 | JSXProps
|
301 | >
|
302 | }
|
303 |
|
304 |
|
305 |
|
306 |
|
307 |
|
308 |
|
309 |
|
310 |
|
311 |
|
312 |
|
313 | interface CreateStyled$1 {
|
314 | <
|
315 | C extends React$1.ComponentClass<React$1.ComponentProps<C>>,
|
316 | ForwardedProps extends keyof React$1.ComponentProps<C> &
|
317 | string = keyof React$1.ComponentProps<C> & string
|
318 | >(
|
319 | component: C,
|
320 | options: FilteringStyledOptions<React$1.ComponentProps<C>, ForwardedProps>
|
321 | ): CreateStyledComponent<
|
322 | Pick<PropsOf<C>, ForwardedProps> & {
|
323 | theme?: Theme
|
324 | },
|
325 | {},
|
326 | {
|
327 | ref?: React$1.Ref<InstanceType<C>>
|
328 | }
|
329 | >
|
330 |
|
331 | <C extends React$1.ComponentClass<React$1.ComponentProps<C>>>(
|
332 | component: C,
|
333 | options?: StyledOptions<React$1.ComponentProps<C>>
|
334 | ): CreateStyledComponent<
|
335 | PropsOf<C> & {
|
336 | theme?: Theme
|
337 | },
|
338 | {},
|
339 | {
|
340 | ref?: React$1.Ref<InstanceType<C>>
|
341 | }
|
342 | >
|
343 |
|
344 | <
|
345 | C extends React$1.ComponentType<React$1.ComponentProps<C>>,
|
346 | ForwardedProps extends keyof React$1.ComponentProps<C> &
|
347 | string = keyof React$1.ComponentProps<C> & string
|
348 | >(
|
349 | component: C,
|
350 | options: FilteringStyledOptions<React$1.ComponentProps<C>, ForwardedProps>
|
351 | ): CreateStyledComponent<
|
352 | Pick<PropsOf<C>, ForwardedProps> & {
|
353 | theme?: Theme
|
354 | }
|
355 | >
|
356 |
|
357 | <C extends React$1.ComponentType<React$1.ComponentProps<C>>>(
|
358 | component: C,
|
359 | options?: StyledOptions<React$1.ComponentProps<C>>
|
360 | ): CreateStyledComponent<
|
361 | PropsOf<C> & {
|
362 | theme?: Theme
|
363 | }
|
364 | >
|
365 |
|
366 | <
|
367 | Tag extends keyof JSX.IntrinsicElements,
|
368 | ForwardedProps extends keyof JSX.IntrinsicElements[Tag] &
|
369 | string = keyof JSX.IntrinsicElements[Tag] & string
|
370 | >(
|
371 | tag: Tag,
|
372 | options: FilteringStyledOptions<JSX.IntrinsicElements[Tag], ForwardedProps>
|
373 | ): CreateStyledComponent<
|
374 | { theme?: Theme; as?: React$1.ElementType },
|
375 | Pick<JSX.IntrinsicElements[Tag], ForwardedProps>
|
376 | >
|
377 |
|
378 | <Tag extends keyof JSX.IntrinsicElements>(
|
379 | tag: Tag,
|
380 | options?: StyledOptions<JSX.IntrinsicElements[Tag]>
|
381 | ): CreateStyledComponent<
|
382 | { theme?: Theme; as?: React$1.ElementType },
|
383 | JSX.IntrinsicElements[Tag]
|
384 | >
|
385 | }
|
386 |
|
387 |
|
388 |
|
389 |
|
390 |
|
391 |
|
392 | type StyledTags = {
|
393 | [Tag in keyof JSX.IntrinsicElements]: CreateStyledComponent<
|
394 | {
|
395 | theme?: Theme
|
396 | as?: React.ElementType
|
397 | },
|
398 | JSX.IntrinsicElements[Tag]
|
399 | >
|
400 | }
|
401 |
|
402 | interface CreateStyled extends CreateStyled$1, StyledTags {}
|
403 |
|
404 | declare const styled: CreateStyled
|
405 |
|
406 | declare module '@emotion/react' {
|
407 | type StorybookTheme = StorybookTheme;
|
408 | export interface Theme extends StorybookTheme {}
|
409 | }
|
410 |
|
411 |
|
412 |
|
413 |
|
414 | declare function isPropValid(prop: string): boolean
|
415 |
|
416 | type Value = string | number;
|
417 | interface Return {
|
418 | [key: string]: {
|
419 | [key: string]: Value;
|
420 | };
|
421 | }
|
422 | declare const createReset: ({ typography }: {
|
423 | typography: Typography;
|
424 | }) => Return;
|
425 | declare const createGlobal: ({ color, background, typography, }: {
|
426 | color: Color;
|
427 | background: Background;
|
428 | typography: Typography;
|
429 | }) => Return;
|
430 |
|
431 | declare const convert: (inherit?: ThemeVars) => StorybookTheme;
|
432 |
|
433 | declare const ensure: (input: ThemeVars) => StorybookTheme;
|
434 |
|
435 | declare const lightenColor: (color: string) => string;
|
436 | declare const darkenColor: (color: string) => string;
|
437 |
|
438 | type FunctionInterpolationEnhanced<T = {}> = FunctionInterpolation<T & {
|
439 | theme: StorybookTheme;
|
440 | }>;
|
441 | type InterpolationEnhanced<T = {}> = Interpolation<T & {
|
442 | theme: StorybookTheme;
|
443 | }>;
|
444 |
|
445 | declare const ignoreSsrWarning = "/* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */";
|
446 |
|
447 | export { Background, CacheProvider, ClassNames, Color, FunctionInterpolationEnhanced as FunctionInterpolation, Global, InterpolationEnhanced as Interpolation, Keyframes, StorybookTheme, StyledComponent, ThemeProvider, ThemeVars, Typography, convert, createCache, createGlobal, createReset, css, darkenColor as darken, ensure, ignoreSsrWarning, isPropValid, jsx, keyframes, lightenColor as lighten, styled, useTheme, withTheme };
|
448 |
|
449 | interface Theme extends StorybookTheme {}
|
450 | export type { Theme }; |
\ | No newline at end of file |