styled-components 5.3.4 → 6.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/base.d.ts +17 -0
- package/dist/constants.d.ts +8 -0
- package/dist/constructors/constructWithOptions.d.ts +19 -0
- package/dist/constructors/createGlobalStyle.d.ts +3 -0
- package/dist/constructors/css.d.ts +4 -0
- package/dist/constructors/keyframes.d.ts +3 -0
- package/dist/constructors/styled.d.ts +185 -0
- package/dist/hoc/withTheme.d.ts +3 -0
- package/dist/hoc/withTheme.spec.d.ts +1 -0
- package/dist/hooks/useTheme.d.ts +3 -0
- package/dist/index-standalone.d.ts +2 -0
- package/dist/index.d.ts +3 -0
- package/dist/macro/index.d.ts +2 -0
- package/dist/models/ComponentStyle.d.ts +15 -0
- package/dist/models/GlobalStyle.d.ts +11 -0
- package/dist/models/InlineStyle.d.ts +6 -0
- package/dist/models/Keyframes.d.ts +11 -0
- package/dist/models/ServerStyleSheet.d.ts +15 -0
- package/dist/models/StyleSheetManager.d.ts +21 -0
- package/dist/models/StyledComponent.d.ts +3 -0
- package/dist/models/StyledNativeComponent.d.ts +3 -0
- package/dist/models/ThemeProvider.d.ts +17 -0
- package/dist/native/index.d.ts +64 -0
- package/dist/primitives/index.d.ts +22 -0
- package/dist/secretInternals.d.ts +5 -0
- package/dist/sheet/GroupIDAllocator.d.ts +4 -0
- package/dist/sheet/GroupedTag.d.ts +11 -0
- package/dist/sheet/Rehydration.d.ts +3 -0
- package/dist/sheet/Sheet.d.ts +40 -0
- package/dist/sheet/Tag.d.ts +54 -0
- package/dist/sheet/dom.d.ts +4 -0
- package/dist/sheet/index.d.ts +1 -0
- package/dist/sheet/types.d.ts +34 -0
- package/dist/styled-components-macro.cjs.js +1 -1
- package/dist/styled-components-macro.cjs.js.map +1 -1
- package/dist/styled-components-macro.esm.js +1 -1
- package/dist/styled-components-macro.esm.js.map +1 -1
- package/dist/styled-components.browser.cjs.js +1 -1
- package/dist/styled-components.browser.cjs.js.map +1 -1
- package/dist/styled-components.browser.esm.js +1 -1
- package/dist/styled-components.browser.esm.js.map +1 -1
- package/dist/styled-components.cjs.js +1 -1
- package/dist/styled-components.cjs.js.map +1 -1
- package/dist/styled-components.esm.js +1 -1
- package/dist/styled-components.esm.js.map +1 -1
- package/dist/styled-components.js +1 -1
- package/dist/styled-components.js.map +1 -1
- package/dist/styled-components.min.js +1 -1
- package/dist/styled-components.min.js.map +1 -1
- package/dist/test/globals.d.ts +2 -0
- package/dist/test/utils.d.ts +191 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types.d.ts +120 -0
- package/dist/utils/addUnitIfNeeded.d.ts +1 -0
- package/dist/utils/checkDynamicCreation.d.ts +1 -0
- package/dist/utils/createWarnTooManyClasses.d.ts +3 -0
- package/dist/utils/determineTheme.d.ts +2 -0
- package/dist/utils/domElements.d.ts +2 -0
- package/dist/utils/empties.d.ts +3 -0
- package/dist/utils/error.d.ts +5 -0
- package/dist/utils/errors.d.ts +20 -0
- package/dist/utils/escape.d.ts +5 -0
- package/dist/utils/flatten.d.ts +4 -0
- package/dist/utils/generateAlphabeticName.d.ts +1 -0
- package/dist/utils/generateComponentId.d.ts +1 -0
- package/dist/utils/generateDisplayName.d.ts +2 -0
- package/dist/utils/getComponentName.d.ts +2 -0
- package/dist/utils/hash.d.ts +3 -0
- package/dist/utils/hoist.d.ts +51 -0
- package/dist/utils/hyphenateStyleName.d.ts +14 -0
- package/dist/utils/interleave.d.ts +2 -0
- package/dist/utils/isFunction.d.ts +1 -0
- package/dist/utils/isPlainObject.d.ts +1 -0
- package/dist/utils/isStatelessFunction.d.ts +1 -0
- package/dist/utils/isStaticRules.d.ts +2 -0
- package/dist/utils/isStyledComponent.d.ts +2 -0
- package/dist/utils/isTag.d.ts +2 -0
- package/dist/utils/joinStrings.d.ts +4 -0
- package/dist/utils/mixinDeep.d.ts +7 -0
- package/dist/utils/nonce.d.ts +1 -0
- package/dist/utils/stylis.d.ts +9 -0
- package/macro/package.json +2 -1
- package/native/dist/styled-components.native.cjs.js +1157 -6115
- package/native/dist/styled-components.native.cjs.js.map +1 -1
- package/native/dist/styled-components.native.esm.js +1153 -6115
- package/native/dist/styled-components.native.esm.js.map +1 -1
- package/native/package.json +2 -1
- package/package.json +72 -44
- package/primitives/dist/styled-components-primitives.cjs.js +1107 -6115
- package/primitives/dist/styled-components-primitives.cjs.js.map +1 -1
- package/primitives/dist/styled-components-primitives.esm.js +1101 -6114
- package/primitives/dist/styled-components-primitives.esm.js.map +1 -1
- package/primitives/package.json +2 -1
- package/test-utils/{index.js → index.ts} +10 -13
- package/test-utils/{setupTestFramework.js → setupTestFramework.ts} +2 -5
- package/scripts/generateErrorMap.js +0 -22
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2016-present Glen Maddern and Maximilian Stoiber
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/base.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SC_VERSION } from './constants';
|
|
2
|
+
import createGlobalStyle from './constructors/createGlobalStyle';
|
|
3
|
+
import css from './constructors/css';
|
|
4
|
+
import keyframes from './constructors/keyframes';
|
|
5
|
+
import withTheme from './hoc/withTheme';
|
|
6
|
+
import useTheme from './hooks/useTheme';
|
|
7
|
+
import ServerStyleSheet from './models/ServerStyleSheet';
|
|
8
|
+
import StyleSheetManager, { StyleSheetConsumer, StyleSheetContext } from './models/StyleSheetManager';
|
|
9
|
+
import ThemeProvider, { ThemeConsumer, ThemeContext } from './models/ThemeProvider';
|
|
10
|
+
import isStyledComponent from './utils/isStyledComponent';
|
|
11
|
+
declare global {
|
|
12
|
+
interface Window {
|
|
13
|
+
'__styled-components-init__'?: number;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export * from './secretInternals';
|
|
17
|
+
export { createGlobalStyle, css, isStyledComponent, keyframes, ServerStyleSheet, StyleSheetConsumer, StyleSheetContext, StyleSheetManager, ThemeConsumer, ThemeContext, ThemeProvider, useTheme, SC_VERSION as version, withTheme, };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const SC_ATTR: string;
|
|
2
|
+
export declare const SC_ATTR_ACTIVE = "active";
|
|
3
|
+
export declare const SC_ATTR_VERSION = "data-styled-version";
|
|
4
|
+
export declare const SC_VERSION: string;
|
|
5
|
+
export declare const SPLITTER = "/*!sc*/\n";
|
|
6
|
+
export declare const IS_BROWSER: boolean;
|
|
7
|
+
export declare const DISABLE_SPEEDY: boolean;
|
|
8
|
+
export declare const STATIC_EXECUTION_CONTEXT: {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Attrs, Interpolation, IStyledComponent, IStyledComponentFactory, IStyledNativeComponent, IStyledNativeComponentFactory, NativeTarget, StyledNativeOptions, StyledOptions, StyledTarget, Styles, WebTarget } from '../types';
|
|
2
|
+
export interface NativeStyled<Target extends NativeTarget, OuterProps = unknown, OuterStatics = unknown> {
|
|
3
|
+
<Props = unknown, Statics = unknown>(initialStyles: Styles<OuterProps & Props>, ...interpolations: Exclude<Interpolation<OuterProps & Props>, IStyledComponent<any>>[]): IStyledNativeComponent<Target, OuterProps & Props> & OuterStatics & Statics;
|
|
4
|
+
attrs(attrs: Attrs<OuterProps>): NativeStyled<Target, OuterProps, OuterStatics>;
|
|
5
|
+
withConfig(config: StyledNativeOptions<OuterProps>): NativeStyled<Target, OuterProps, OuterStatics>;
|
|
6
|
+
}
|
|
7
|
+
export interface WebStyled<Target extends WebTarget, OuterProps = unknown, OuterStatics = unknown> {
|
|
8
|
+
<Props = unknown, Statics = unknown>(initialStyles: Styles<OuterProps & Props>, ...interpolations: Interpolation<OuterProps & Props>[]): IStyledComponent<Target, OuterProps & Props> & OuterStatics & Statics;
|
|
9
|
+
attrs(attrs: Attrs<OuterProps>): WebStyled<Target, OuterProps, OuterStatics>;
|
|
10
|
+
withConfig(config: StyledOptions<OuterProps>): WebStyled<Target, OuterProps, OuterStatics>;
|
|
11
|
+
}
|
|
12
|
+
export default function constructWithOptions<Environment extends 'web' | 'native', Target extends StyledTarget, OuterProps = unknown, // used for styled<{}>().attrs() so attrs() gets the generic prop context
|
|
13
|
+
OuterStatics = unknown>(componentConstructor: Environment extends 'web' ? IStyledComponentFactory<any, any, any> : IStyledNativeComponentFactory<any, any, any>, tag: Target, options?: Environment extends 'web' ? StyledOptions<OuterProps> : StyledNativeOptions<OuterProps>): {
|
|
14
|
+
<Props = unknown, Statics = unknown>(initialStyles: Styles<OuterProps & Props>, ...interpolations: Interpolation<OuterProps & Props>[]): ReturnType<Environment extends "web" ? IStyledComponentFactory<Target, OuterProps & Props, OuterStatics & Statics> : IStyledNativeComponentFactory<Target, OuterProps & Props, OuterStatics & Statics>>;
|
|
15
|
+
attrs(attrs: Attrs<OuterProps>): any;
|
|
16
|
+
/**
|
|
17
|
+
* If config methods are called, wrap up a new template function and merge options */
|
|
18
|
+
withConfig(config: Environment extends 'web' ? StyledOptions<OuterProps> : StyledNativeOptions<OuterProps>): any;
|
|
19
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ExtensibleObject, Interpolation, Styles } from '../types';
|
|
3
|
+
export default function createGlobalStyle<Props = unknown>(strings: Styles<Props>, ...interpolations: Array<Interpolation<Props>>): React.NamedExoticComponent<ExtensibleObject>;
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { WebTarget } from '../types';
|
|
3
|
+
import { WebStyled } from './constructWithOptions';
|
|
4
|
+
declare const styled: (<Target extends WebTarget>(tag: Target) => {
|
|
5
|
+
<Props = unknown, Statics = unknown>(initialStyles: import("../types").Styles<Props>, ...interpolations: import("../types").Interpolation<Props>[]): import("../types").IStyledComponent<Target, Props> & Statics;
|
|
6
|
+
attrs(attrs: import("../types").Attrs<unknown>): any;
|
|
7
|
+
withConfig(config: import("../types").StyledOptions<unknown>): any;
|
|
8
|
+
}) & {
|
|
9
|
+
a: WebStyled<"a", import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, unknown>;
|
|
10
|
+
abbr: WebStyled<"abbr", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
11
|
+
address: WebStyled<"address", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
12
|
+
area: WebStyled<"area", import("react").DetailedHTMLProps<import("react").AreaHTMLAttributes<HTMLAreaElement>, HTMLAreaElement>, unknown>;
|
|
13
|
+
article: WebStyled<"article", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
14
|
+
aside: WebStyled<"aside", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
15
|
+
audio: WebStyled<"audio", import("react").DetailedHTMLProps<import("react").AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, unknown>;
|
|
16
|
+
b: WebStyled<"b", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
17
|
+
base: WebStyled<"base", import("react").DetailedHTMLProps<import("react").BaseHTMLAttributes<HTMLBaseElement>, HTMLBaseElement>, unknown>;
|
|
18
|
+
bdi: WebStyled<"bdi", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
19
|
+
bdo: WebStyled<"bdo", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
20
|
+
big: WebStyled<"big", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
21
|
+
blockquote: WebStyled<"blockquote", import("react").DetailedHTMLProps<import("react").BlockquoteHTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
22
|
+
body: WebStyled<"body", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLBodyElement>, HTMLBodyElement>, unknown>;
|
|
23
|
+
br: WebStyled<"br", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLBRElement>, HTMLBRElement>, unknown>;
|
|
24
|
+
button: WebStyled<"button", import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, unknown>;
|
|
25
|
+
canvas: WebStyled<"canvas", import("react").DetailedHTMLProps<import("react").CanvasHTMLAttributes<HTMLCanvasElement>, HTMLCanvasElement>, unknown>;
|
|
26
|
+
caption: WebStyled<"caption", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
27
|
+
cite: WebStyled<"cite", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
28
|
+
code: WebStyled<"code", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
29
|
+
col: WebStyled<"col", import("react").DetailedHTMLProps<import("react").ColHTMLAttributes<HTMLTableColElement>, HTMLTableColElement>, unknown>;
|
|
30
|
+
colgroup: WebStyled<"colgroup", import("react").DetailedHTMLProps<import("react").ColgroupHTMLAttributes<HTMLTableColElement>, HTMLTableColElement>, unknown>;
|
|
31
|
+
data: WebStyled<"data", import("react").DetailedHTMLProps<import("react").DataHTMLAttributes<HTMLDataElement>, HTMLDataElement>, unknown>;
|
|
32
|
+
datalist: WebStyled<"datalist", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDataListElement>, HTMLDataListElement>, unknown>;
|
|
33
|
+
dd: WebStyled<"dd", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
34
|
+
del: WebStyled<"del", import("react").DetailedHTMLProps<import("react").DelHTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
35
|
+
details: WebStyled<"details", import("react").DetailedHTMLProps<import("react").DetailsHTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
36
|
+
dfn: WebStyled<"dfn", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
37
|
+
dialog: WebStyled<"dialog", import("react").DetailedHTMLProps<import("react").DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement>, unknown>;
|
|
38
|
+
div: WebStyled<"div", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, unknown>;
|
|
39
|
+
dl: WebStyled<"dl", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDListElement>, HTMLDListElement>, unknown>;
|
|
40
|
+
dt: WebStyled<"dt", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
41
|
+
em: WebStyled<"em", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
42
|
+
embed: WebStyled<"embed", import("react").DetailedHTMLProps<import("react").EmbedHTMLAttributes<HTMLEmbedElement>, HTMLEmbedElement>, unknown>;
|
|
43
|
+
fieldset: WebStyled<"fieldset", import("react").DetailedHTMLProps<import("react").FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>, unknown>;
|
|
44
|
+
figcaption: WebStyled<"figcaption", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
45
|
+
figure: WebStyled<"figure", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
46
|
+
footer: WebStyled<"footer", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
47
|
+
form: WebStyled<"form", import("react").DetailedHTMLProps<import("react").FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, unknown>;
|
|
48
|
+
h1: WebStyled<"h1", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, unknown>;
|
|
49
|
+
h2: WebStyled<"h2", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, unknown>;
|
|
50
|
+
h3: WebStyled<"h3", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, unknown>;
|
|
51
|
+
h4: WebStyled<"h4", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, unknown>;
|
|
52
|
+
h5: WebStyled<"h5", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, unknown>;
|
|
53
|
+
h6: WebStyled<"h6", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, unknown>;
|
|
54
|
+
head: WebStyled<"head", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadElement>, HTMLHeadElement>, unknown>;
|
|
55
|
+
header: WebStyled<"header", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
56
|
+
hgroup: WebStyled<"hgroup", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
57
|
+
hr: WebStyled<"hr", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHRElement>, HTMLHRElement>, unknown>;
|
|
58
|
+
html: WebStyled<"html", import("react").DetailedHTMLProps<import("react").HtmlHTMLAttributes<HTMLHtmlElement>, HTMLHtmlElement>, unknown>;
|
|
59
|
+
i: WebStyled<"i", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
60
|
+
iframe: WebStyled<"iframe", import("react").DetailedHTMLProps<import("react").IframeHTMLAttributes<HTMLIFrameElement>, HTMLIFrameElement>, unknown>;
|
|
61
|
+
img: WebStyled<"img", import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, unknown>;
|
|
62
|
+
input: WebStyled<"input", import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, unknown>;
|
|
63
|
+
ins: WebStyled<"ins", import("react").DetailedHTMLProps<import("react").InsHTMLAttributes<HTMLModElement>, HTMLModElement>, unknown>;
|
|
64
|
+
kbd: WebStyled<"kbd", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
65
|
+
keygen: WebStyled<"keygen", import("react").DetailedHTMLProps<import("react").KeygenHTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
66
|
+
label: WebStyled<"label", import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, unknown>;
|
|
67
|
+
legend: WebStyled<"legend", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLLegendElement>, HTMLLegendElement>, unknown>;
|
|
68
|
+
li: WebStyled<"li", import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, unknown>;
|
|
69
|
+
link: WebStyled<"link", import("react").DetailedHTMLProps<import("react").LinkHTMLAttributes<HTMLLinkElement>, HTMLLinkElement>, unknown>;
|
|
70
|
+
main: WebStyled<"main", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
71
|
+
map: WebStyled<"map", import("react").DetailedHTMLProps<import("react").MapHTMLAttributes<HTMLMapElement>, HTMLMapElement>, unknown>;
|
|
72
|
+
mark: WebStyled<"mark", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
73
|
+
menu: WebStyled<"menu", import("react").DetailedHTMLProps<import("react").MenuHTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
74
|
+
menuitem: WebStyled<"menuitem", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
75
|
+
meta: WebStyled<"meta", import("react").DetailedHTMLProps<import("react").MetaHTMLAttributes<HTMLMetaElement>, HTMLMetaElement>, unknown>;
|
|
76
|
+
meter: WebStyled<"meter", import("react").DetailedHTMLProps<import("react").MeterHTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
77
|
+
nav: WebStyled<"nav", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
78
|
+
noindex: WebStyled<"noindex", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
79
|
+
noscript: WebStyled<"noscript", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
80
|
+
object: WebStyled<"object", import("react").DetailedHTMLProps<import("react").ObjectHTMLAttributes<HTMLObjectElement>, HTMLObjectElement>, unknown>;
|
|
81
|
+
ol: WebStyled<"ol", import("react").DetailedHTMLProps<import("react").OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, unknown>;
|
|
82
|
+
optgroup: WebStyled<"optgroup", import("react").DetailedHTMLProps<import("react").OptgroupHTMLAttributes<HTMLOptGroupElement>, HTMLOptGroupElement>, unknown>;
|
|
83
|
+
option: WebStyled<"option", import("react").DetailedHTMLProps<import("react").OptionHTMLAttributes<HTMLOptionElement>, HTMLOptionElement>, unknown>;
|
|
84
|
+
output: WebStyled<"output", import("react").DetailedHTMLProps<import("react").OutputHTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
85
|
+
p: WebStyled<"p", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, unknown>;
|
|
86
|
+
param: WebStyled<"param", import("react").DetailedHTMLProps<import("react").ParamHTMLAttributes<HTMLParamElement>, HTMLParamElement>, unknown>;
|
|
87
|
+
picture: WebStyled<"picture", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
88
|
+
pre: WebStyled<"pre", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLPreElement>, HTMLPreElement>, unknown>;
|
|
89
|
+
progress: WebStyled<"progress", import("react").DetailedHTMLProps<import("react").ProgressHTMLAttributes<HTMLProgressElement>, HTMLProgressElement>, unknown>;
|
|
90
|
+
q: WebStyled<"q", import("react").DetailedHTMLProps<import("react").QuoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>, unknown>;
|
|
91
|
+
rp: WebStyled<"rp", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
92
|
+
rt: WebStyled<"rt", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
93
|
+
ruby: WebStyled<"ruby", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
94
|
+
s: WebStyled<"s", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
95
|
+
samp: WebStyled<"samp", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
96
|
+
slot: WebStyled<"slot", import("react").DetailedHTMLProps<import("react").SlotHTMLAttributes<HTMLSlotElement>, HTMLSlotElement>, unknown>;
|
|
97
|
+
script: WebStyled<"script", import("react").DetailedHTMLProps<import("react").ScriptHTMLAttributes<HTMLScriptElement>, HTMLScriptElement>, unknown>;
|
|
98
|
+
section: WebStyled<"section", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
99
|
+
select: WebStyled<"select", import("react").DetailedHTMLProps<import("react").SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, unknown>;
|
|
100
|
+
small: WebStyled<"small", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
101
|
+
source: WebStyled<"source", import("react").DetailedHTMLProps<import("react").SourceHTMLAttributes<HTMLSourceElement>, HTMLSourceElement>, unknown>;
|
|
102
|
+
span: WebStyled<"span", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, unknown>;
|
|
103
|
+
strong: WebStyled<"strong", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
104
|
+
style: WebStyled<"style", import("react").DetailedHTMLProps<import("react").StyleHTMLAttributes<HTMLStyleElement>, HTMLStyleElement>, unknown>;
|
|
105
|
+
sub: WebStyled<"sub", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
106
|
+
summary: WebStyled<"summary", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
107
|
+
sup: WebStyled<"sup", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
108
|
+
table: WebStyled<"table", import("react").DetailedHTMLProps<import("react").TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, unknown>;
|
|
109
|
+
template: WebStyled<"template", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTemplateElement>, HTMLTemplateElement>, unknown>;
|
|
110
|
+
tbody: WebStyled<"tbody", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, unknown>;
|
|
111
|
+
td: WebStyled<"td", import("react").DetailedHTMLProps<import("react").TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, unknown>;
|
|
112
|
+
textarea: WebStyled<"textarea", import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, unknown>;
|
|
113
|
+
tfoot: WebStyled<"tfoot", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, unknown>;
|
|
114
|
+
th: WebStyled<"th", import("react").DetailedHTMLProps<import("react").ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>, unknown>;
|
|
115
|
+
thead: WebStyled<"thead", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, unknown>;
|
|
116
|
+
time: WebStyled<"time", import("react").DetailedHTMLProps<import("react").TimeHTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
117
|
+
title: WebStyled<"title", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTitleElement>, HTMLTitleElement>, unknown>;
|
|
118
|
+
tr: WebStyled<"tr", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, unknown>;
|
|
119
|
+
track: WebStyled<"track", import("react").DetailedHTMLProps<import("react").TrackHTMLAttributes<HTMLTrackElement>, HTMLTrackElement>, unknown>;
|
|
120
|
+
u: WebStyled<"u", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
121
|
+
ul: WebStyled<"ul", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, unknown>;
|
|
122
|
+
var: WebStyled<"var", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
123
|
+
video: WebStyled<"video", import("react").DetailedHTMLProps<import("react").VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>, unknown>;
|
|
124
|
+
wbr: WebStyled<"wbr", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, unknown>;
|
|
125
|
+
webview: WebStyled<"webview", import("react").DetailedHTMLProps<import("react").WebViewHTMLAttributes<HTMLWebViewElement>, HTMLWebViewElement>, unknown>;
|
|
126
|
+
svg: WebStyled<"svg", import("react").SVGProps<SVGSVGElement>, unknown>;
|
|
127
|
+
animate: WebStyled<"animate", import("react").SVGProps<SVGElement>, unknown>;
|
|
128
|
+
animateMotion: WebStyled<"animateMotion", import("react").SVGProps<SVGElement>, unknown>;
|
|
129
|
+
animateTransform: WebStyled<"animateTransform", import("react").SVGProps<SVGElement>, unknown>;
|
|
130
|
+
circle: WebStyled<"circle", import("react").SVGProps<SVGCircleElement>, unknown>;
|
|
131
|
+
clipPath: WebStyled<"clipPath", import("react").SVGProps<SVGClipPathElement>, unknown>;
|
|
132
|
+
defs: WebStyled<"defs", import("react").SVGProps<SVGDefsElement>, unknown>;
|
|
133
|
+
desc: WebStyled<"desc", import("react").SVGProps<SVGDescElement>, unknown>;
|
|
134
|
+
ellipse: WebStyled<"ellipse", import("react").SVGProps<SVGEllipseElement>, unknown>;
|
|
135
|
+
feBlend: WebStyled<"feBlend", import("react").SVGProps<SVGFEBlendElement>, unknown>;
|
|
136
|
+
feColorMatrix: WebStyled<"feColorMatrix", import("react").SVGProps<SVGFEColorMatrixElement>, unknown>;
|
|
137
|
+
feComponentTransfer: WebStyled<"feComponentTransfer", import("react").SVGProps<SVGFEComponentTransferElement>, unknown>;
|
|
138
|
+
feComposite: WebStyled<"feComposite", import("react").SVGProps<SVGFECompositeElement>, unknown>;
|
|
139
|
+
feConvolveMatrix: WebStyled<"feConvolveMatrix", import("react").SVGProps<SVGFEConvolveMatrixElement>, unknown>;
|
|
140
|
+
feDiffuseLighting: WebStyled<"feDiffuseLighting", import("react").SVGProps<SVGFEDiffuseLightingElement>, unknown>;
|
|
141
|
+
feDisplacementMap: WebStyled<"feDisplacementMap", import("react").SVGProps<SVGFEDisplacementMapElement>, unknown>;
|
|
142
|
+
feDistantLight: WebStyled<"feDistantLight", import("react").SVGProps<SVGFEDistantLightElement>, unknown>;
|
|
143
|
+
feDropShadow: WebStyled<"feDropShadow", import("react").SVGProps<SVGFEDropShadowElement>, unknown>;
|
|
144
|
+
feFlood: WebStyled<"feFlood", import("react").SVGProps<SVGFEFloodElement>, unknown>;
|
|
145
|
+
feFuncA: WebStyled<"feFuncA", import("react").SVGProps<SVGFEFuncAElement>, unknown>;
|
|
146
|
+
feFuncB: WebStyled<"feFuncB", import("react").SVGProps<SVGFEFuncBElement>, unknown>;
|
|
147
|
+
feFuncG: WebStyled<"feFuncG", import("react").SVGProps<SVGFEFuncGElement>, unknown>;
|
|
148
|
+
feFuncR: WebStyled<"feFuncR", import("react").SVGProps<SVGFEFuncRElement>, unknown>;
|
|
149
|
+
feGaussianBlur: WebStyled<"feGaussianBlur", import("react").SVGProps<SVGFEGaussianBlurElement>, unknown>;
|
|
150
|
+
feImage: WebStyled<"feImage", import("react").SVGProps<SVGFEImageElement>, unknown>;
|
|
151
|
+
feMerge: WebStyled<"feMerge", import("react").SVGProps<SVGFEMergeElement>, unknown>;
|
|
152
|
+
feMergeNode: WebStyled<"feMergeNode", import("react").SVGProps<SVGFEMergeNodeElement>, unknown>;
|
|
153
|
+
feMorphology: WebStyled<"feMorphology", import("react").SVGProps<SVGFEMorphologyElement>, unknown>;
|
|
154
|
+
feOffset: WebStyled<"feOffset", import("react").SVGProps<SVGFEOffsetElement>, unknown>;
|
|
155
|
+
fePointLight: WebStyled<"fePointLight", import("react").SVGProps<SVGFEPointLightElement>, unknown>;
|
|
156
|
+
feSpecularLighting: WebStyled<"feSpecularLighting", import("react").SVGProps<SVGFESpecularLightingElement>, unknown>;
|
|
157
|
+
feSpotLight: WebStyled<"feSpotLight", import("react").SVGProps<SVGFESpotLightElement>, unknown>;
|
|
158
|
+
feTile: WebStyled<"feTile", import("react").SVGProps<SVGFETileElement>, unknown>;
|
|
159
|
+
feTurbulence: WebStyled<"feTurbulence", import("react").SVGProps<SVGFETurbulenceElement>, unknown>;
|
|
160
|
+
filter: WebStyled<"filter", import("react").SVGProps<SVGFilterElement>, unknown>;
|
|
161
|
+
foreignObject: WebStyled<"foreignObject", import("react").SVGProps<SVGForeignObjectElement>, unknown>;
|
|
162
|
+
g: WebStyled<"g", import("react").SVGProps<SVGGElement>, unknown>;
|
|
163
|
+
image: WebStyled<"image", import("react").SVGProps<SVGImageElement>, unknown>;
|
|
164
|
+
line: WebStyled<"line", import("react").SVGProps<SVGLineElement>, unknown>;
|
|
165
|
+
linearGradient: WebStyled<"linearGradient", import("react").SVGProps<SVGLinearGradientElement>, unknown>;
|
|
166
|
+
marker: WebStyled<"marker", import("react").SVGProps<SVGMarkerElement>, unknown>;
|
|
167
|
+
mask: WebStyled<"mask", import("react").SVGProps<SVGMaskElement>, unknown>;
|
|
168
|
+
metadata: WebStyled<"metadata", import("react").SVGProps<SVGMetadataElement>, unknown>;
|
|
169
|
+
mpath: WebStyled<"mpath", import("react").SVGProps<SVGElement>, unknown>;
|
|
170
|
+
path: WebStyled<"path", import("react").SVGProps<SVGPathElement>, unknown>;
|
|
171
|
+
pattern: WebStyled<"pattern", import("react").SVGProps<SVGPatternElement>, unknown>;
|
|
172
|
+
polygon: WebStyled<"polygon", import("react").SVGProps<SVGPolygonElement>, unknown>;
|
|
173
|
+
polyline: WebStyled<"polyline", import("react").SVGProps<SVGPolylineElement>, unknown>;
|
|
174
|
+
radialGradient: WebStyled<"radialGradient", import("react").SVGProps<SVGRadialGradientElement>, unknown>;
|
|
175
|
+
rect: WebStyled<"rect", import("react").SVGProps<SVGRectElement>, unknown>;
|
|
176
|
+
stop: WebStyled<"stop", import("react").SVGProps<SVGStopElement>, unknown>;
|
|
177
|
+
switch: WebStyled<"switch", import("react").SVGProps<SVGSwitchElement>, unknown>;
|
|
178
|
+
symbol: WebStyled<"symbol", import("react").SVGProps<SVGSymbolElement>, unknown>;
|
|
179
|
+
text: WebStyled<"text", import("react").SVGProps<SVGTextElement>, unknown>;
|
|
180
|
+
textPath: WebStyled<"textPath", import("react").SVGProps<SVGTextPathElement>, unknown>;
|
|
181
|
+
tspan: WebStyled<"tspan", import("react").SVGProps<SVGTSpanElement>, unknown>;
|
|
182
|
+
use: WebStyled<"use", import("react").SVGProps<SVGUseElement>, unknown>;
|
|
183
|
+
view: WebStyled<"view", import("react").SVGProps<SVGViewElement>, unknown>;
|
|
184
|
+
};
|
|
185
|
+
export default styled;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AnyComponent, ExecutionContext } from '../types';
|
|
3
|
+
export default function withTheme<T extends AnyComponent>(Component: T): React.ForwardRefExoticComponent<React.PropsWithoutRef<JSX.LibraryManagedAttributes<T, ExecutionContext>> & React.RefAttributes<T>> & { [key in Exclude<keyof T, T extends React.MemoExoticComponent<any> ? "propTypes" | "type" | "defaultProps" | "displayName" | "$$typeof" | "compare" : T extends React.ForwardRefExoticComponent<any> ? "propTypes" | "defaultProps" | "displayName" | "$$typeof" | "render" : "length" | "propTypes" | "type" | "contextType" | "contextTypes" | "childContextTypes" | "defaultProps" | "displayName" | "getDerivedStateFromProps" | "getDerivedStateFromError" | "getDefaultProps" | "mixins" | "name" | "prototype" | "caller" | "callee" | "arguments" | "arity">]: T[key]; };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import StyleSheet from '../sheet';
|
|
2
|
+
import { RuleSet, Stringifier } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* ComponentStyle is all the CSS-specific stuff, not the React-specific stuff.
|
|
5
|
+
*/
|
|
6
|
+
export default class ComponentStyle {
|
|
7
|
+
baseHash: number;
|
|
8
|
+
baseStyle: ComponentStyle | null | undefined;
|
|
9
|
+
componentId: string;
|
|
10
|
+
isStatic: boolean;
|
|
11
|
+
rules: RuleSet<any>;
|
|
12
|
+
staticRulesId: string;
|
|
13
|
+
constructor(rules: RuleSet<any>, componentId: string, baseStyle?: ComponentStyle);
|
|
14
|
+
generateAndInjectStyles(executionContext: Object, styleSheet: StyleSheet, stylis: Stringifier): string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import StyleSheet from '../sheet';
|
|
2
|
+
import { ExecutionContext, FlattenerResult, RuleSet, Stringifier } from '../types';
|
|
3
|
+
export default class GlobalStyle<Props = unknown> {
|
|
4
|
+
componentId: string;
|
|
5
|
+
isStatic: boolean;
|
|
6
|
+
rules: FlattenerResult<Props>;
|
|
7
|
+
constructor(rules: RuleSet<Props>, componentId: string);
|
|
8
|
+
createStyles(instance: number, executionContext: ExecutionContext & Props, styleSheet: StyleSheet, stylis: Stringifier): void;
|
|
9
|
+
removeStyles(instance: number, styleSheet: StyleSheet): void;
|
|
10
|
+
renderStyles(instance: number, executionContext: ExecutionContext & Props, styleSheet: StyleSheet, stylis: Stringifier): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IInlineStyleConstructor, StyleSheet } from '../types';
|
|
2
|
+
export declare const resetStyleCache: () => void;
|
|
3
|
+
/**
|
|
4
|
+
* InlineStyle takes arbitrary CSS and generates a flat object
|
|
5
|
+
*/
|
|
6
|
+
export default function makeInlineStyleClass<Props = unknown>(styleSheet: StyleSheet): IInlineStyleConstructor<Props>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import StyleSheet from '../sheet';
|
|
2
|
+
import { Keyframes as KeyframesType, Stringifier } from '../types';
|
|
3
|
+
export default class Keyframes implements KeyframesType {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
rules: string;
|
|
7
|
+
constructor(name: string, rules: string);
|
|
8
|
+
inject: (styleSheet: StyleSheet, stylisInstance?: Stringifier) => void;
|
|
9
|
+
toString: () => void;
|
|
10
|
+
getName(stylisInstance?: Stringifier): string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type * as streamInternal from 'stream';
|
|
3
|
+
import { Readable } from 'stream';
|
|
4
|
+
import StyleSheet from '../sheet';
|
|
5
|
+
export default class ServerStyleSheet {
|
|
6
|
+
instance: StyleSheet;
|
|
7
|
+
sealed: boolean;
|
|
8
|
+
constructor();
|
|
9
|
+
_emitSheetCSS: () => string;
|
|
10
|
+
collectStyles(children: any): JSX.Element;
|
|
11
|
+
getStyleTags: () => string;
|
|
12
|
+
getStyleElement: () => JSX.Element[];
|
|
13
|
+
interleaveWithNodeStream(input: Readable): streamInternal.Transform;
|
|
14
|
+
seal: () => void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import StyleSheet from '../sheet';
|
|
3
|
+
import { Stringifier } from '../types';
|
|
4
|
+
declare type Props = {
|
|
5
|
+
children?: React.ReactChild;
|
|
6
|
+
disableCSSOMInjection?: boolean;
|
|
7
|
+
disableVendorPrefixes?: boolean;
|
|
8
|
+
sheet?: StyleSheet;
|
|
9
|
+
stylisPlugins?: stylis.Middleware[];
|
|
10
|
+
target?: HTMLElement;
|
|
11
|
+
};
|
|
12
|
+
export declare const StyleSheetContext: React.Context<void | StyleSheet>;
|
|
13
|
+
export declare const StyleSheetConsumer: React.Consumer<void | StyleSheet>;
|
|
14
|
+
export declare const StylisContext: React.Context<void | Stringifier>;
|
|
15
|
+
export declare const StylisConsumer: React.Consumer<void | Stringifier>;
|
|
16
|
+
export declare const mainSheet: StyleSheet;
|
|
17
|
+
export declare const mainStylis: Stringifier;
|
|
18
|
+
export declare function useStyleSheet(): StyleSheet;
|
|
19
|
+
export declare function useStylis(): Stringifier;
|
|
20
|
+
export default function StyleSheetManager(props: Props): JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { IStyledComponentFactory, RuleSet, StyledOptions, WebTarget } from '../types';
|
|
2
|
+
declare function createStyledComponent<Target extends WebTarget, OuterProps = unknown, Statics = unknown>(target: Target, options: StyledOptions<OuterProps>, rules: RuleSet<OuterProps>): ReturnType<IStyledComponentFactory<Target, OuterProps, Statics>>;
|
|
3
|
+
export default createStyledComponent;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ExtensibleObject, IInlineStyleConstructor, IStyledNativeComponent, IStyledNativeComponentFactory, NativeTarget, RuleSet, StyledNativeOptions } from '../types';
|
|
2
|
+
declare const _default: (InlineStyle: IInlineStyleConstructor<any>) => <Target extends NativeTarget, OuterProps extends ExtensibleObject, Statics = unknown>(target: Target, options: StyledNativeOptions<OuterProps>, rules: RuleSet<OuterProps>) => IStyledNativeComponent<Target, OuterProps> & Statics;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface DefaultTheme {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
declare type ThemeFn = (outerTheme?: DefaultTheme) => DefaultTheme;
|
|
6
|
+
declare type ThemeArgument = DefaultTheme | ThemeFn;
|
|
7
|
+
declare type Props = {
|
|
8
|
+
children?: React.ReactChild;
|
|
9
|
+
theme: ThemeArgument;
|
|
10
|
+
};
|
|
11
|
+
export declare const ThemeContext: React.Context<DefaultTheme | undefined>;
|
|
12
|
+
export declare const ThemeConsumer: React.Consumer<DefaultTheme | undefined>;
|
|
13
|
+
/**
|
|
14
|
+
* Provide a theme to an entire react component tree via context
|
|
15
|
+
*/
|
|
16
|
+
export default function ThemeProvider(props: Props): JSX.Element | null;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { NativeStyled } from '../constructors/constructWithOptions';
|
|
2
|
+
import css from '../constructors/css';
|
|
3
|
+
import withTheme from '../hoc/withTheme';
|
|
4
|
+
import useTheme from '../hooks/useTheme';
|
|
5
|
+
import ThemeProvider, { ThemeConsumer, ThemeContext } from '../models/ThemeProvider';
|
|
6
|
+
import { NativeTarget } from '../types';
|
|
7
|
+
import isStyledComponent from '../utils/isStyledComponent';
|
|
8
|
+
declare const styled: (<Target extends NativeTarget>(tag: Target) => {
|
|
9
|
+
<Props = unknown, Statics = unknown>(initialStyles: import("../types").Styles<Props>, ...interpolations: import("../types").Interpolation<Props>[]): import("../types").IStyledNativeComponent<Target, Props> & Statics;
|
|
10
|
+
attrs(attrs: import("../types").Attrs<unknown>): any;
|
|
11
|
+
withConfig(config: import("../types").StyledNativeOptions<unknown>): any;
|
|
12
|
+
}) & {
|
|
13
|
+
ActivityIndicator: NativeStyled<typeof import("react-native").ActivityIndicator, import("react-native").ActivityIndicatorProps, unknown>;
|
|
14
|
+
ActivityIndicatorIOS: NativeStyled<unknown, {}, unknown>;
|
|
15
|
+
ART: NativeStyled<unknown, {}, unknown>;
|
|
16
|
+
Button: NativeStyled<typeof import("react-native").Button, import("react-native").ButtonProps, unknown>;
|
|
17
|
+
DatePickerIOS: NativeStyled<typeof import("react-native").DatePickerIOS, import("react-native").DatePickerIOSProps, unknown>;
|
|
18
|
+
DrawerLayoutAndroid: NativeStyled<typeof import("react-native").DrawerLayoutAndroid, import("react-native").DrawerLayoutAndroidProps, unknown>;
|
|
19
|
+
FlatList: NativeStyled<typeof import("react-native").FlatList, import("react-native").FlatListProps<unknown>, unknown>;
|
|
20
|
+
Image: NativeStyled<typeof import("react-native").Image, import("react-native").ImageProps, unknown>;
|
|
21
|
+
ImageBackground: NativeStyled<typeof import("react-native").ImageBackground, import("react-native").ImageBackgroundProps, unknown>;
|
|
22
|
+
ImageEditor: NativeStyled<never, never, unknown>;
|
|
23
|
+
ImageStore: NativeStyled<never, never, unknown>;
|
|
24
|
+
KeyboardAvoidingView: NativeStyled<typeof import("react-native").KeyboardAvoidingView, import("react-native").KeyboardAvoidingViewProps, unknown>;
|
|
25
|
+
ListView: NativeStyled<typeof import("react-native").ListView, import("react-native").ListViewProps, unknown>;
|
|
26
|
+
MapView: NativeStyled<unknown, {}, unknown>;
|
|
27
|
+
Modal: NativeStyled<typeof import("react-native").Modal, import("react-native").ModalProps, unknown>;
|
|
28
|
+
NavigatorIOS: NativeStyled<typeof import("react-native").NavigatorIOS, import("react-native").NavigatorIOSProps, unknown>;
|
|
29
|
+
Picker: NativeStyled<typeof import("react-native").Picker, import("react-native").PickerProps, unknown>;
|
|
30
|
+
PickerIOS: NativeStyled<typeof import("react-native").PickerIOS, import("react-native").PickerIOSProps, unknown>;
|
|
31
|
+
Pressable: NativeStyled<import("react").ForwardRefExoticComponent<import("react-native").PressableProps & import("react").RefAttributes<import("react-native").View>>, import("react-native").PressableProps & import("react").RefAttributes<import("react-native").View>, unknown>;
|
|
32
|
+
ProgressBarAndroid: NativeStyled<typeof import("react-native").ProgressBarAndroid, import("react-native").ProgressBarAndroidProps, unknown>;
|
|
33
|
+
ProgressViewIOS: NativeStyled<typeof import("react-native").ProgressViewIOS, import("react-native").ProgressViewIOSProps, unknown>;
|
|
34
|
+
RecyclerViewBackedScrollView: NativeStyled<typeof import("react-native").RecyclerViewBackedScrollView, import("react-native").RecyclerViewBackedScrollViewProps, unknown>;
|
|
35
|
+
RefreshControl: NativeStyled<typeof import("react-native").RefreshControl, import("react-native").RefreshControlProps, unknown>;
|
|
36
|
+
SafeAreaView: NativeStyled<typeof import("react-native").SafeAreaView, import("react-native").ViewProps, unknown>;
|
|
37
|
+
ScrollView: NativeStyled<typeof import("react-native").ScrollView, import("react-native").ScrollViewProps, unknown>;
|
|
38
|
+
SectionList: NativeStyled<typeof import("react-native").SectionList, import("react-native").SectionListProps<unknown, unknown>, unknown>;
|
|
39
|
+
SegmentedControlIOS: NativeStyled<typeof import("react-native").SegmentedControlIOS, import("react-native").SegmentedControlIOSProps, unknown>;
|
|
40
|
+
Slider: NativeStyled<typeof import("react-native").Slider, import("react-native").SliderProps, unknown>;
|
|
41
|
+
SliderIOS: NativeStyled<unknown, {}, unknown>;
|
|
42
|
+
SnapshotViewIOS: NativeStyled<typeof import("react-native").SnapshotViewIOS, import("react-native").SnapshotViewIOSProps, unknown>;
|
|
43
|
+
StatusBar: NativeStyled<typeof import("react-native").StatusBar, import("react-native").StatusBarProps, unknown>;
|
|
44
|
+
SwipeableListView: NativeStyled<typeof import("react-native").SwipeableListView, import("react-native").SwipeableListViewProps, unknown>;
|
|
45
|
+
Switch: NativeStyled<typeof import("react-native").Switch, import("react-native").SwitchProps, unknown>;
|
|
46
|
+
SwitchAndroid: NativeStyled<unknown, {}, unknown>;
|
|
47
|
+
SwitchIOS: NativeStyled<typeof import("react-native").SwitchIOS, import("react-native").SwitchIOSProps, unknown>;
|
|
48
|
+
TabBarIOS: NativeStyled<typeof import("react-native").TabBarIOS, import("react-native").TabBarIOSProps, unknown>;
|
|
49
|
+
Text: NativeStyled<typeof import("react-native").Text, import("react-native").TextProps, unknown>;
|
|
50
|
+
TextInput: NativeStyled<typeof import("react-native").TextInput, import("react-native").TextInputProps, unknown>;
|
|
51
|
+
ToastAndroid: NativeStyled<never, never, unknown>;
|
|
52
|
+
ToolbarAndroid: NativeStyled<typeof import("react-native").ToolbarAndroid, import("react-native").ToolbarAndroidProps, unknown>;
|
|
53
|
+
Touchable: NativeStyled<never, never, unknown>;
|
|
54
|
+
TouchableHighlight: NativeStyled<typeof import("react-native").TouchableHighlight, import("react-native").TouchableHighlightProps, unknown>;
|
|
55
|
+
TouchableNativeFeedback: NativeStyled<typeof import("react-native").TouchableNativeFeedback, import("react-native").TouchableNativeFeedbackProps, unknown>;
|
|
56
|
+
TouchableOpacity: NativeStyled<typeof import("react-native").TouchableOpacity, import("react-native").TouchableOpacityProps, unknown>;
|
|
57
|
+
TouchableWithoutFeedback: NativeStyled<typeof import("react-native").TouchableWithoutFeedback, import("react-native").TouchableWithoutFeedbackProps, unknown>;
|
|
58
|
+
View: NativeStyled<typeof import("react-native").View, import("react-native").ViewProps, unknown>;
|
|
59
|
+
ViewPagerAndroid: NativeStyled<typeof import("react-native").ViewPagerAndroid, import("react-native").ViewPagerAndroidProps, unknown>;
|
|
60
|
+
VirtualizedList: NativeStyled<typeof import("react-native").VirtualizedList, import("react-native").VirtualizedListProps<unknown>, unknown>;
|
|
61
|
+
WebView: NativeStyled<unknown, {}, unknown>;
|
|
62
|
+
};
|
|
63
|
+
export { css, isStyledComponent, ThemeProvider, ThemeConsumer, ThemeContext, withTheme, useTheme };
|
|
64
|
+
export default styled;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import reactPrimitives from 'react-primitives';
|
|
2
|
+
import { NativeStyled } from '../constructors/constructWithOptions';
|
|
3
|
+
import css from '../constructors/css';
|
|
4
|
+
import withTheme from '../hoc/withTheme';
|
|
5
|
+
import useTheme from '../hooks/useTheme';
|
|
6
|
+
import ThemeProvider, { ThemeConsumer, ThemeContext } from '../models/ThemeProvider';
|
|
7
|
+
import { NativeTarget } from '../types';
|
|
8
|
+
import isStyledComponent from '../utils/isStyledComponent';
|
|
9
|
+
declare const styled: (<Target extends NativeTarget>(tag: Target) => {
|
|
10
|
+
<Props = unknown, Statics = unknown>(initialStyles: import("../types").Styles<Props>, ...interpolations: import("../types").Interpolation<Props>[]): import("../types").IStyledNativeComponent<Target, Props> & Statics;
|
|
11
|
+
attrs(attrs: import("../types").Attrs<unknown>): any;
|
|
12
|
+
withConfig(config: import("../types").StyledNativeOptions<unknown>): any;
|
|
13
|
+
}) & {
|
|
14
|
+
Image: NativeStyled<typeof reactPrimitives.Image, import("react-native").ImageProps, unknown>;
|
|
15
|
+
Text: NativeStyled<typeof reactPrimitives.Text, import("react-native").TextProps, unknown>;
|
|
16
|
+
Touchable: NativeStyled<import("react").ComponentType<import("react-native").TouchableOpacityProps>, import("react-native").TouchableOpacityProps | (import("react-native").TouchableOpacityProps & {
|
|
17
|
+
children?: import("react").ReactNode;
|
|
18
|
+
}), unknown>;
|
|
19
|
+
View: NativeStyled<typeof reactPrimitives.View, import("react-native").ViewProps, unknown>;
|
|
20
|
+
};
|
|
21
|
+
export { css, isStyledComponent, ThemeProvider, ThemeConsumer, ThemeContext, withTheme, useTheme };
|
|
22
|
+
export default styled;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Tag } from './types';
|
|
2
|
+
/** Create a GroupedTag with an underlying Tag implementation */
|
|
3
|
+
export declare const makeGroupedTag: (tag: Tag) => {
|
|
4
|
+
groupSizes: Uint32Array;
|
|
5
|
+
length: number;
|
|
6
|
+
tag: Tag;
|
|
7
|
+
indexOfGroup(group: number): number;
|
|
8
|
+
insertRules(group: number, rules: string | string[]): void;
|
|
9
|
+
clearGroup(group: number): void;
|
|
10
|
+
getGroup(group: number): string;
|
|
11
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { GroupedTag, Sheet, SheetOptions } from './types';
|
|
2
|
+
declare type SheetConstructorArgs = {
|
|
3
|
+
isServer?: boolean;
|
|
4
|
+
useCSSOMInjection?: boolean;
|
|
5
|
+
target?: HTMLElement;
|
|
6
|
+
};
|
|
7
|
+
declare type GlobalStylesAllocationMap = {
|
|
8
|
+
[key: string]: number;
|
|
9
|
+
};
|
|
10
|
+
declare type NamesAllocationMap = Map<string, Set<string>>;
|
|
11
|
+
/** Contains the main stylesheet logic for stringification and caching */
|
|
12
|
+
export default class StyleSheet implements Sheet {
|
|
13
|
+
gs: GlobalStylesAllocationMap;
|
|
14
|
+
names: NamesAllocationMap;
|
|
15
|
+
options: SheetOptions;
|
|
16
|
+
server: boolean;
|
|
17
|
+
tag?: GroupedTag;
|
|
18
|
+
/** Register a group ID to give it an index */
|
|
19
|
+
static registerId(id: string): number;
|
|
20
|
+
constructor(options?: SheetConstructorArgs, globalStyles?: GlobalStylesAllocationMap, names?: NamesAllocationMap);
|
|
21
|
+
reconstructWithOptions(options: SheetConstructorArgs, withNames?: boolean): StyleSheet;
|
|
22
|
+
allocateGSInstance(id: string): number;
|
|
23
|
+
/** Lazily initialises a GroupedTag for when it's actually needed */
|
|
24
|
+
getTag(): GroupedTag;
|
|
25
|
+
/** Check whether a name is known for caching */
|
|
26
|
+
hasNameForId(id: string, name: string): boolean;
|
|
27
|
+
/** Mark a group's name as known for caching */
|
|
28
|
+
registerName(id: string, name: string): void;
|
|
29
|
+
/** Insert new rules which also marks the name as known */
|
|
30
|
+
insertRules(id: string, name: string, rules: string | string[]): void;
|
|
31
|
+
/** Clears all cached names for a given group ID */
|
|
32
|
+
clearNames(id: string): void;
|
|
33
|
+
/** Clears all rules for a given group ID */
|
|
34
|
+
clearRules(id: string): void;
|
|
35
|
+
/** Clears the entire tag which deletes all rules but not its names */
|
|
36
|
+
clearTag(): void;
|
|
37
|
+
/** Outputs the current sheet as a CSS string with markers for SSR */
|
|
38
|
+
toString(): string;
|
|
39
|
+
}
|
|
40
|
+
export {};
|