@tamagui/static 1.0.0-alpha.4 → 1.0.0-alpha.5

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.
Files changed (2) hide show
  1. package/package.json +7 -6
  2. package/types.d.ts +210 -0
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@tamagui/static",
3
- "version": "1.0.0-alpha.4",
3
+ "version": "1.0.0-alpha.5",
4
4
  "source": "src/index.ts",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
7
7
  "typings": "types.d.ts",
8
8
  "files": [
9
+ "types.d.ts",
9
10
  "dist",
10
11
  "src"
11
12
  ],
@@ -52,10 +53,10 @@
52
53
  "@dish/babel-preset": "^0.0.6",
53
54
  "@expo/match-media": "^0.1.0",
54
55
  "@tamagui/build": "^1.0.0-alpha.2",
55
- "@tamagui/core": "^1.0.0-alpha.4",
56
- "@tamagui/core-node": "^1.0.0-alpha.2",
56
+ "@tamagui/core": "^1.0.0-alpha.5",
57
+ "@tamagui/core-node": "^1.0.0-alpha.5",
57
58
  "@tamagui/fake-react-native": "^1.0.0-alpha.2",
58
- "@tamagui/helpers": "^1.0.0-alpha.2",
59
+ "@tamagui/helpers": "^1.0.0-alpha.5",
59
60
  "babel-literal-to-ast": "^2.1.0",
60
61
  "esbuild": "^0.13.12",
61
62
  "esbuild-register": "^3.1.2",
@@ -63,10 +64,10 @@
63
64
  "fs-extra": "^9.0.0",
64
65
  "invariant": "^2.2.4",
65
66
  "lodash": "^4.17.20",
66
- "tamagui": "^1.0.0-alpha.4"
67
+ "tamagui": "^1.0.0-alpha.5"
67
68
  },
68
69
  "peerDependencies": {
69
70
  "react-native-web": "*"
70
71
  },
71
- "gitHead": "3e3b5401f9daea70cf9a99782d325f58357ca681"
72
+ "gitHead": "e12f14aa087c41ea5ba3933a05f33fada0be03c0"
72
73
  }
package/types.d.ts ADDED
@@ -0,0 +1,210 @@
1
+ // Generated by dts-bundle-generator v5.9.0
2
+
3
+ /// <reference types="babel__traverse" />
4
+ /// <reference types="node" />
5
+
6
+ import * as t from '@babel/types';
7
+
8
+ export interface TamaguiOptions {
9
+ components: string[];
10
+ config?: string;
11
+ evaluateVars?: boolean;
12
+ importsWhitelist?: string[];
13
+ disableExtraction?: boolean;
14
+ exclude?: RegExp;
15
+ logTimings?: boolean;
16
+ cssPath?: string;
17
+ cssData?: any;
18
+ deoptProps?: Set<string>;
19
+ excludeProps?: string[];
20
+ }
21
+ export declare type ExtractedAttrAttr = {
22
+ type: "attr";
23
+ value: t.JSXAttribute | t.JSXSpreadAttribute;
24
+ };
25
+ export declare type ExtractedAttrStyle = {
26
+ type: "style";
27
+ value: Object;
28
+ };
29
+ export declare type ExtractedAttr = ExtractedAttrAttr | {
30
+ type: "ternary";
31
+ value: Ternary;
32
+ } | ExtractedAttrStyle;
33
+ export declare type ExtractTagProps = {
34
+ attrs: ExtractedAttr[];
35
+ node: t.JSXOpeningElement;
36
+ attemptEval: (exprNode: t.Node, evalFn?: ((node: t.Node) => any) | undefined) => any;
37
+ jsxPath: NodePath<t.JSXElement>;
38
+ programPath: NodePath<t.Program>;
39
+ originalNodeName: string;
40
+ lineNumbers: string;
41
+ filePath: string;
42
+ isFlattened: boolean;
43
+ };
44
+ export declare type ExtractorParseProps = TamaguiOptions & {
45
+ sourcePath?: string;
46
+ shouldPrintDebug?: boolean;
47
+ onExtractTag: (props: ExtractTagProps) => void;
48
+ getFlattenedNode: (props: {
49
+ isTextView: boolean;
50
+ tag: string;
51
+ }) => string;
52
+ onDidFlatten?: () => void;
53
+ };
54
+ export interface Ternary {
55
+ test: t.Expression;
56
+ inlineMediaQuery?: string;
57
+ remove: Function;
58
+ consequent: Object | null;
59
+ alternate: Object | null;
60
+ }
61
+ declare class Variable {
62
+ name: string;
63
+ val: string | number;
64
+ variable: string | number;
65
+ constructor({ val, name }: VariableIn);
66
+ }
67
+ export declare type VariableIn = {
68
+ val: string | number;
69
+ name: string;
70
+ };
71
+ export declare type ThemeProviderProps = {
72
+ themes: any;
73
+ defaultTheme: string;
74
+ disableRootThemeClass?: boolean;
75
+ children?: any;
76
+ };
77
+ export interface CreateTokens<Val extends number | string | Variable = number | string | Variable> {
78
+ font: {
79
+ [key: string]: GenericFont;
80
+ };
81
+ color: {
82
+ [key: string]: Val;
83
+ };
84
+ space: {
85
+ [key: string]: Val;
86
+ };
87
+ size: {
88
+ [key: string]: Val;
89
+ };
90
+ radius: {
91
+ [key: string]: Val;
92
+ };
93
+ zIndex: {
94
+ [key: string]: Val;
95
+ };
96
+ }
97
+ export declare type GenericTokens = CreateTokens;
98
+ export declare type GenericThemes = {
99
+ [key: string]: {
100
+ bg: string | Variable;
101
+ bg2: string | Variable;
102
+ bg3: string | Variable;
103
+ bg4: string | Variable;
104
+ color: string | Variable;
105
+ color2: string | Variable;
106
+ color3: string | Variable;
107
+ color4: string | Variable;
108
+ borderColor: string | Variable;
109
+ borderColor2: string | Variable;
110
+ shadowColor: string | Variable;
111
+ shadowColor2: string | Variable;
112
+ };
113
+ };
114
+ export declare type GenericShorthands = {};
115
+ export declare type GenericMedia<K extends string = string> = {
116
+ [key in K]: {
117
+ [key: string]: number | string;
118
+ };
119
+ };
120
+ export declare type CreateTamaguiConfig<A extends GenericTokens, B extends GenericThemes, C extends GenericShorthands, D extends GenericMedia> = Partial<Pick<ThemeProviderProps, "defaultTheme" | "disableRootThemeClass">> & {
121
+ tokens: A;
122
+ themes: B;
123
+ shorthands: C;
124
+ media: D;
125
+ };
126
+ export declare type TamaguiInternalConfig<A extends GenericTokens = GenericTokens, B extends GenericThemes = GenericThemes, C extends GenericShorthands = GenericShorthands, D extends GenericMedia = GenericMedia> = CreateTamaguiConfig<A, B, C, D> & {
127
+ Provider: (props: TamaguiProviderProps) => any;
128
+ themeParsed: {
129
+ [key: string]: Variable;
130
+ };
131
+ tokensParsed: CreateTokens<Variable>;
132
+ themeConfig: any;
133
+ getCSS: () => string;
134
+ };
135
+ export declare type GenericFont = {
136
+ size: {
137
+ [key: string | number]: number | Variable;
138
+ };
139
+ lineHeight: {
140
+ [key: string | number]: number | Variable;
141
+ };
142
+ letterSpacing: {
143
+ [key: string | number]: number | Variable;
144
+ };
145
+ weight: {
146
+ [key: string | number]: string | Variable;
147
+ };
148
+ family: string | Variable;
149
+ };
150
+ export declare type TamaguiProviderProps = Partial<Omit<ThemeProviderProps, "children">> & {
151
+ initialWindowMetrics?: any;
152
+ fallback?: any;
153
+ children?: any;
154
+ };
155
+ export declare type Extractor = ReturnType<typeof createExtractor>;
156
+ export declare function createExtractor(): {
157
+ getTamaguiConfig(): TamaguiInternalConfig<import("@tamagui/core").CreateTokens<string | number | import("@tamagui/core").Variable>, {
158
+ [key: string]: {
159
+ bg: string | import("@tamagui/core").Variable;
160
+ bg2: string | import("@tamagui/core").Variable;
161
+ bg3: string | import("@tamagui/core").Variable;
162
+ bg4: string | import("@tamagui/core").Variable;
163
+ color: string | import("@tamagui/core").Variable;
164
+ color2: string | import("@tamagui/core").Variable;
165
+ color3: string | import("@tamagui/core").Variable;
166
+ color4: string | import("@tamagui/core").Variable;
167
+ borderColor: string | import("@tamagui/core").Variable;
168
+ borderColor2: string | import("@tamagui/core").Variable;
169
+ shadowColor: string | import("@tamagui/core").Variable;
170
+ shadowColor2: string | import("@tamagui/core").Variable;
171
+ };
172
+ }, {}, {
173
+ [x: string]: {
174
+ [key: string]: string | number;
175
+ };
176
+ }>;
177
+ parse: (fileOrPath: NodePath<t.Program> | t.File, { config, importsWhitelist, evaluateVars, shouldPrintDebug, sourcePath, onExtractTag, getFlattenedNode, onDidFlatten, ...props }: ExtractorParseProps) => null | undefined;
178
+ };
179
+ export declare function literalToAst(literal: any): t.Expression;
180
+ export declare const CSS_FILE_NAME = "__snack.css";
181
+ export declare const MEDIA_SEP = "_";
182
+ export declare const cacheDir: any;
183
+ export declare const CONCAT_CLASSNAME_IMPORT = "concatClassName";
184
+ export declare function extractToClassNames({ loader, extractor, source, sourcePath, options, shouldPrintDebug, threaded, cssPath, }: {
185
+ loader: any;
186
+ extractor: Extractor;
187
+ source: string | Buffer;
188
+ sourcePath: string;
189
+ options: TamaguiOptions;
190
+ shouldPrintDebug: boolean;
191
+ cssPath: string;
192
+ threaded?: boolean;
193
+ }): null | {
194
+ js: string | Buffer;
195
+ styles: string;
196
+ stylesPath?: string;
197
+ ast: t.File;
198
+ map: any;
199
+ };
200
+ export declare function isPresent<T extends Object>(input: null | void | undefined | T): input is T;
201
+ export declare function isSimpleSpread(node: t.JSXSpreadAttribute): boolean;
202
+ export declare const attrStr: (attr: ExtractedAttr) => string | t.JSXIdentifier;
203
+ export declare const objToStr: (obj: any) => any;
204
+ export declare const ternaryStr: (x: Ternary) => string;
205
+ export declare function findComponentName(scope: any): string | undefined;
206
+ export declare function isValidThemeHook(jsxPath: NodePath<t.JSXElement>, n: t.MemberExpression, sourcePath: string): boolean;
207
+ export declare const isInsideTamagui: (srcName: string) => boolean;
208
+ export declare function patchReactNativeWeb(): void;
209
+
210
+ export {};