@tamagui/stacks 2.0.0-rc.3 → 2.0.0-rc.31

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 (43) hide show
  1. package/dist/esm/index.js +5 -5
  2. package/dist/esm/index.js.map +1 -6
  3. package/dist/jsx/index.js +5 -5
  4. package/dist/jsx/index.js.map +1 -6
  5. package/package.json +8 -11
  6. package/dist/cjs/NestingContext.js +0 -30
  7. package/dist/cjs/NestingContext.js.map +0 -6
  8. package/dist/cjs/SizableStack.js +0 -40
  9. package/dist/cjs/SizableStack.js.map +0 -6
  10. package/dist/cjs/Stacks.js +0 -56
  11. package/dist/cjs/Stacks.js.map +0 -6
  12. package/dist/cjs/ThemeableStack.js +0 -52
  13. package/dist/cjs/ThemeableStack.js.map +0 -6
  14. package/dist/cjs/getElevation.js +0 -45
  15. package/dist/cjs/getElevation.js.map +0 -6
  16. package/dist/cjs/index.js +0 -19
  17. package/dist/cjs/index.js.map +0 -6
  18. package/dist/cjs/variants.js +0 -48
  19. package/dist/cjs/variants.js.map +0 -6
  20. package/dist/esm/NestingContext.js +0 -6
  21. package/dist/esm/NestingContext.js.map +0 -6
  22. package/dist/esm/SizableStack.js +0 -27
  23. package/dist/esm/SizableStack.js.map +0 -6
  24. package/dist/esm/Stacks.js +0 -41
  25. package/dist/esm/Stacks.js.map +0 -6
  26. package/dist/esm/ThemeableStack.js +0 -38
  27. package/dist/esm/ThemeableStack.js.map +0 -6
  28. package/dist/esm/getElevation.js +0 -29
  29. package/dist/esm/getElevation.js.map +0 -6
  30. package/dist/esm/variants.js +0 -32
  31. package/dist/esm/variants.js.map +0 -6
  32. package/dist/jsx/NestingContext.js +0 -6
  33. package/dist/jsx/NestingContext.js.map +0 -6
  34. package/dist/jsx/SizableStack.js +0 -27
  35. package/dist/jsx/SizableStack.js.map +0 -6
  36. package/dist/jsx/Stacks.js +0 -41
  37. package/dist/jsx/Stacks.js.map +0 -6
  38. package/dist/jsx/ThemeableStack.js +0 -38
  39. package/dist/jsx/ThemeableStack.js.map +0 -6
  40. package/dist/jsx/getElevation.js +0 -29
  41. package/dist/jsx/getElevation.js.map +0 -6
  42. package/dist/jsx/variants.js +0 -32
  43. package/dist/jsx/variants.js.map +0 -6
package/dist/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
- export * from "./Stacks";
2
- export * from "./ThemeableStack";
3
- export * from "./SizableStack";
4
- export * from "./NestingContext";
5
- export * from "./getElevation";
1
+ export * from "./Stacks.mjs";
2
+ export * from "./ThemeableStack.mjs";
3
+ export * from "./SizableStack.mjs";
4
+ export * from "./NestingContext.mjs";
5
+ export * from "./getElevation.mjs";
6
6
  //# sourceMappingURL=index.js.map
@@ -1,6 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.ts"],
4
- "mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
5
- "names": []
6
- }
1
+ {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc","ignoreList":[]}
package/dist/jsx/index.js CHANGED
@@ -1,6 +1,6 @@
1
- export * from "./Stacks";
2
- export * from "./ThemeableStack";
3
- export * from "./SizableStack";
4
- export * from "./NestingContext";
5
- export * from "./getElevation";
1
+ export * from "./Stacks.mjs";
2
+ export * from "./ThemeableStack.mjs";
3
+ export * from "./SizableStack.mjs";
4
+ export * from "./NestingContext.mjs";
5
+ export * from "./getElevation.mjs";
6
6
  //# sourceMappingURL=index.js.map
@@ -1,6 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.ts"],
4
- "mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
5
- "names": []
6
- }
1
+ {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/stacks",
3
- "version": "2.0.0-rc.3",
3
+ "version": "2.0.0-rc.31",
4
4
  "gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
5
5
  "source": "src/index.ts",
6
6
  "files": [
@@ -19,15 +19,12 @@
19
19
  "./package.json": "./package.json",
20
20
  ".": {
21
21
  "types": "./types/index.d.ts",
22
- "react-native": {
23
- "module": "./dist/esm/index.native.js",
24
- "import": "./dist/esm/index.native.js",
25
- "require": "./dist/cjs/index.native.js"
26
- },
22
+ "react-native": "./dist/esm/index.native.js",
23
+ "browser": "./dist/esm/index.mjs",
27
24
  "module": "./dist/esm/index.mjs",
28
25
  "import": "./dist/esm/index.mjs",
29
26
  "require": "./dist/cjs/index.cjs",
30
- "default": "./dist/cjs/index.native.js"
27
+ "default": "./dist/esm/index.mjs"
31
28
  }
32
29
  },
33
30
  "publishConfig": {
@@ -40,12 +37,12 @@
40
37
  "clean:build": "tamagui-build clean:build"
41
38
  },
42
39
  "dependencies": {
43
- "@tamagui/core": "2.0.0-rc.3",
44
- "@tamagui/get-button-sized": "2.0.0-rc.3",
45
- "@tamagui/web": "2.0.0-rc.3"
40
+ "@tamagui/core": "2.0.0-rc.31",
41
+ "@tamagui/get-button-sized": "2.0.0-rc.31",
42
+ "@tamagui/web": "2.0.0-rc.31"
46
43
  },
47
44
  "devDependencies": {
48
- "@tamagui/build": "2.0.0-rc.3",
45
+ "@tamagui/build": "2.0.0-rc.31",
49
46
  "react": ">=19"
50
47
  },
51
48
  "peerDependencies": {
@@ -1,30 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: !0 });
9
- }, __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from == "object" || typeof from == "function")
11
- for (let key of __getOwnPropNames(from))
12
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- return to;
14
- };
15
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
16
- // If the importer is in node compatibility mode or this is not an ESM
17
- // file that has been converted to a CommonJS file using a Babel-
18
- // compatible transform (i.e. "__esModule" has not been set), then set
19
- // "default" to the CommonJS "module.exports" for node compatibility.
20
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
21
- mod
22
- )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
23
- var NestingContext_exports = {};
24
- __export(NestingContext_exports, {
25
- ButtonNestingContext: () => ButtonNestingContext
26
- });
27
- module.exports = __toCommonJS(NestingContext_exports);
28
- var import_react = __toESM(require("react"), 1);
29
- const ButtonNestingContext = import_react.default.createContext(!1);
30
- //# sourceMappingURL=NestingContext.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/NestingContext.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAEX,MAAM,uBAAuB,aAAAA,QAAM,cAAc,EAAK;",
5
- "names": ["React"]
6
- }
@@ -1,40 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: !0 });
8
- }, __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from == "object" || typeof from == "function")
10
- for (let key of __getOwnPropNames(from))
11
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
- var SizableStack_exports = {};
16
- __export(SizableStack_exports, {
17
- SizableStack: () => SizableStack
18
- });
19
- module.exports = __toCommonJS(SizableStack_exports);
20
- var import_core = require("@tamagui/core"), import_get_button_sized = require("@tamagui/get-button-sized"), import_ThemeableStack = require("./ThemeableStack"), import_variants = require("./variants");
21
- const SizableStack = (0, import_core.styled)(import_ThemeableStack.ThemeableStack, {
22
- name: "SizableStack",
23
- variants: {
24
- unstyled: {
25
- true: {
26
- elevate: !1,
27
- bordered: !1
28
- }
29
- },
30
- circular: import_variants.circular,
31
- elevate: import_variants.elevate,
32
- bordered: {
33
- true: import_variants.bordered
34
- },
35
- size: {
36
- "...size": (val, extras) => (0, import_get_button_sized.getButtonSized)(val, extras)
37
- }
38
- }
39
- });
40
- //# sourceMappingURL=SizableStack.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/SizableStack.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAuB,0BACvB,0BAA+B,sCAE/B,wBAA+B,6BAC/B,kBAA4C;AAErC,MAAM,mBAAe,oBAAO,sCAAgB;AAAA,EACjD,MAAM;AAAA,EAEN,UAAU;AAAA,IACR,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IAEA;AAAA,IACA;AAAA,IAEA,UAAU;AAAA,MACR,MAAM;AAAA,IACR;AAAA,IAEA,MAAM;AAAA,MACJ,WAAW,CAAC,KAAK,eACR,wCAAe,KAAK,MAAM;AAAA,IAErC;AAAA,EACF;AACF,CAAC;",
5
- "names": []
6
- }
@@ -1,56 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: !0 });
8
- }, __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from == "object" || typeof from == "function")
10
- for (let key of __getOwnPropNames(from))
11
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
- var Stacks_exports = {};
16
- __export(Stacks_exports, {
17
- XStack: () => XStack,
18
- YStack: () => YStack,
19
- ZStack: () => ZStack,
20
- fullscreenStyle: () => fullscreenStyle
21
- });
22
- module.exports = __toCommonJS(Stacks_exports);
23
- var import_core = require("@tamagui/core"), import_getElevation = require("./getElevation");
24
- const fullscreenStyle = {
25
- position: "absolute",
26
- inset: 0
27
- }, variants = {
28
- fullscreen: {
29
- true: fullscreenStyle
30
- },
31
- elevation: {
32
- "...size": import_getElevation.getElevation,
33
- ":number": import_getElevation.getElevation
34
- }
35
- }, YStack = (0, import_core.styled)(import_core.View, {
36
- flexDirection: "column",
37
- variants
38
- });
39
- YStack.displayName = "YStack";
40
- const XStack = (0, import_core.styled)(import_core.View, {
41
- flexDirection: "row",
42
- variants
43
- });
44
- XStack.displayName = "XStack";
45
- const ZStack = (0, import_core.styled)(
46
- YStack,
47
- {
48
- position: "relative"
49
- },
50
- {
51
- neverFlatten: !0,
52
- isZStack: !0
53
- }
54
- );
55
- ZStack.displayName = "ZStack";
56
- //# sourceMappingURL=Stacks.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/Stacks.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAA6B,0BAE7B,sBAA6B;AAiBtB,MAAM,kBAAkB;AAAA,EAC7B,UAAU;AAAA,EACV,OAAO;AACT,GAEM,WAAW;AAAA,EACf,YAAY;AAAA,IACV,MAAM;AAAA,EACR;AAAA,EAEA,WAAW;AAAA,IACT,WAAW;AAAA,IACX,WAAW;AAAA,EACb;AACF,GAMa,aAAS,oBAAO,kBAAM;AAAA,EACjC,eAAe;AAAA,EACf;AACF,CAAC;AAED,OAAO,cAAiB;AAMjB,MAAM,aAAS,oBAAO,kBAAM;AAAA,EACjC,eAAe;AAAA,EACf;AACF,CAAC;AAED,OAAO,cAAiB;AAMjB,MAAM,aAAS;AAAA,EACpB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,EACZ;AAAA,EACA;AAAA,IACE,cAAc;AAAA,IACd,UAAU;AAAA,EACZ;AACF;AAEA,OAAO,cAAiB;",
5
- "names": []
6
- }
@@ -1,52 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: !0 });
8
- }, __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from == "object" || typeof from == "function")
10
- for (let key of __getOwnPropNames(from))
11
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
- var ThemeableStack_exports = {};
16
- __export(ThemeableStack_exports, {
17
- ThemeableStack: () => ThemeableStack,
18
- themeableVariants: () => themeableVariants
19
- });
20
- module.exports = __toCommonJS(ThemeableStack_exports);
21
- var import_core = require("@tamagui/core"), import_Stacks = require("./Stacks"), import_variants = require("./variants");
22
- const chromelessStyle = {
23
- backgroundColor: "transparent",
24
- borderColor: "transparent",
25
- shadowColor: "transparent",
26
- hoverStyle: {
27
- borderColor: "transparent"
28
- }
29
- }, themeableVariants = {
30
- circular: import_variants.circular,
31
- elevate: import_variants.elevate,
32
- bordered: {
33
- true: import_variants.bordered
34
- },
35
- transparent: {
36
- true: {
37
- backgroundColor: "transparent"
38
- }
39
- },
40
- chromeless: {
41
- true: chromelessStyle,
42
- all: {
43
- ...chromelessStyle,
44
- hoverStyle: chromelessStyle,
45
- pressStyle: chromelessStyle,
46
- focusStyle: chromelessStyle
47
- }
48
- }
49
- }, ThemeableStack = (0, import_core.styled)(import_Stacks.YStack, {
50
- variants: themeableVariants
51
- });
52
- //# sourceMappingURL=ThemeableStack.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/ThemeableStack.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAAuB,0BAEvB,gBAAuB,qBAEvB,kBAA4C;AAE5C,MAAM,kBAAkB;AAAA,EACtB,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,aAAa;AAAA,EAEb,YAAY;AAAA,IACV,aAAa;AAAA,EACf;AACF,GAEa,oBAAoB;AAAA,EAC/B;AAAA,EACA;AAAA,EAEA,UAAU;AAAA,IACR,MAAM;AAAA,EACR;AAAA,EAEA,aAAa;AAAA,IACX,MAAM;AAAA,MACJ,iBAAiB;AAAA,IACnB;AAAA,EACF;AAAA,EAEA,YAAY;AAAA,IACV,MAAM;AAAA,IACN,KAAK;AAAA,MACH,GAAG;AAAA,MACH,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,YAAY;AAAA,IACd;AAAA,EACF;AACF,GAEa,qBAAiB,oBAAO,sBAAQ;AAAA,EAC3C,UAAU;AACZ,CAAC;",
5
- "names": []
6
- }
@@ -1,45 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: !0 });
8
- }, __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from == "object" || typeof from == "function")
10
- for (let key of __getOwnPropNames(from))
11
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
- var getElevation_exports = {};
16
- __export(getElevation_exports, {
17
- getElevation: () => getElevation,
18
- getSizedElevation: () => getSizedElevation
19
- });
20
- module.exports = __toCommonJS(getElevation_exports);
21
- var import_core = require("@tamagui/core");
22
- const getElevation = (size, extras) => {
23
- if (!size) return;
24
- const { tokens } = extras, token = tokens.size[size], sizeNum = (0, import_core.isVariable)(token) ? +token.val : size;
25
- return getSizedElevation(sizeNum, extras);
26
- }, getSizedElevation = (val, { theme, tokens }) => {
27
- let num = 0;
28
- if (val === !0) {
29
- const val2 = (0, import_core.getVariableValue)(tokens.size.true);
30
- typeof val2 == "number" ? num = val2 : num = 10;
31
- } else
32
- num = +val;
33
- if (num === 0)
34
- return;
35
- const [height, shadowRadius] = [Math.round(num / 4 + 1), Math.round(num / 2 + 2)];
36
- return {
37
- shadowColor: theme.shadowColor,
38
- shadowRadius,
39
- shadowOffset: { height, width: 0 },
40
- ...import_core.isAndroid ? {
41
- elevationAndroid: 2 * height
42
- } : {}
43
- };
44
- };
45
- //# sourceMappingURL=getElevation.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/getElevation.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,kBAAwD;AAEjD,MAAM,eAAqD,CAAC,MAAM,WAAW;AAClF,MAAI,CAAC,KAAM;AACX,QAAM,EAAE,OAAO,IAAI,QACb,QAAQ,OAAO,KAAK,IAAI,GACxB,cAAW,wBAAW,KAAK,IAAI,CAAC,MAAM,MAAM;AAClD,SAAO,kBAAkB,SAAS,MAAM;AAC1C,GAEa,oBAAoB,CAC/B,KACA,EAAE,OAAO,OAAO,MACb;AACH,MAAI,MAAM;AACV,MAAI,QAAQ,IAAM;AAChB,UAAMA,WAAM,8BAAiB,OAAO,KAAK,IAAO;AAChD,IAAI,OAAOA,QAAQ,WACjB,MAAMA,OAEN,MAAM;AAAA,EAEV;AACE,UAAM,CAAC;AAET,MAAI,QAAQ;AACV;AAEF,QAAM,CAAC,QAAQ,YAAY,IAAI,CAAC,KAAK,MAAM,MAAM,IAAI,CAAC,GAAG,KAAK,MAAM,MAAM,IAAI,CAAC,CAAC;AAWhF,SAVe;AAAA,IACb,aAAa,MAAM;AAAA,IACnB;AAAA,IACA,cAAc,EAAE,QAAQ,OAAO,EAAE;AAAA,IACjC,GAAI,wBACA;AAAA,MACE,kBAAkB,IAAI;AAAA,IACxB,IACA,CAAC;AAAA,EACP;AAEF;",
5
- "names": ["val"]
6
- }
package/dist/cjs/index.js DELETED
@@ -1,19 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from == "object" || typeof from == "function")
7
- for (let key of __getOwnPropNames(from))
8
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
- return to;
10
- }, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
11
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
12
- var index_exports = {};
13
- module.exports = __toCommonJS(index_exports);
14
- __reExport(index_exports, require("./Stacks"), module.exports);
15
- __reExport(index_exports, require("./ThemeableStack"), module.exports);
16
- __reExport(index_exports, require("./SizableStack"), module.exports);
17
- __reExport(index_exports, require("./NestingContext"), module.exports);
18
- __reExport(index_exports, require("./getElevation"), module.exports);
19
- //# sourceMappingURL=index.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.ts"],
4
- "mappings": ";;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,qBAAd;AACA,0BAAc,6BADd;AAEA,0BAAc,2BAFd;AAGA,0BAAc,6BAHd;AAIA,0BAAc,2BAJd;",
5
- "names": []
6
- }
@@ -1,48 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: !0 });
8
- }, __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from == "object" || typeof from == "function")
10
- for (let key of __getOwnPropNames(from))
11
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
- var variants_exports = {};
16
- __export(variants_exports, {
17
- bordered: () => bordered,
18
- circular: () => circular,
19
- elevate: () => elevate
20
- });
21
- module.exports = __toCommonJS(variants_exports);
22
- var import_getElevation = require("./getElevation");
23
- const elevate = {
24
- true: (_, extras) => (0, import_getElevation.getElevation)(extras.props.size, extras)
25
- }, bordered = (val, { props }) => ({
26
- // TODO size it with size in '...size'
27
- borderWidth: typeof val == "number" ? val : 1,
28
- borderColor: "$borderColor"
29
- }), circularStyle = {
30
- borderRadius: 1e5,
31
- padding: 0
32
- }, circular = {
33
- true: (_, { props, tokens }) => {
34
- if (!("size" in props))
35
- return circularStyle;
36
- const size = typeof props.size == "number" ? props.size : tokens.size[props.size];
37
- return {
38
- ...circularStyle,
39
- width: size,
40
- height: size,
41
- maxWidth: size,
42
- maxHeight: size,
43
- minWidth: size,
44
- minHeight: size
45
- };
46
- }
47
- };
48
- //# sourceMappingURL=variants.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/variants.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA6B;AAEtB,MAAM,UAAU;AAAA,EACrB,MAAM,CAAC,GAAY,eACV,kCAAa,OAAO,MAAM,MAAS,MAAM;AAEpD,GAEa,WAAW,CAAC,KAAuB,EAAE,MAAM,OAC/C;AAAA;AAAA,EAEL,aAAa,OAAO,OAAQ,WAAW,MAAM;AAAA,EAC7C,aAAa;AACf,IAGI,gBAAgB;AAAA,EACpB,cAAc;AAAA,EACd,SAAS;AACX,GAEa,WAAW;AAAA,EACtB,MAAM,CAAC,GAAG,EAAE,OAAO,OAAO,MAAM;AAC9B,QAAI,EAAE,UAAU;AACd,aAAO;AAET,UAAM,OAAO,OAAO,MAAM,QAAS,WAAW,MAAM,OAAO,OAAO,KAAK,MAAM,IAAI;AACjF,WAAO;AAAA,MACL,GAAG;AAAA,MACH,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,WAAW;AAAA,MACX,UAAU;AAAA,MACV,WAAW;AAAA,IACb;AAAA,EACF;AACF;",
5
- "names": []
6
- }
@@ -1,6 +0,0 @@
1
- import React from "react";
2
- const ButtonNestingContext = React.createContext(!1);
3
- export {
4
- ButtonNestingContext
5
- };
6
- //# sourceMappingURL=NestingContext.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/NestingContext.tsx"],
4
- "mappings": "AAAA,OAAO,WAAW;AAEX,MAAM,uBAAuB,MAAM,cAAc,EAAK;",
5
- "names": []
6
- }
@@ -1,27 +0,0 @@
1
- import { styled } from "@tamagui/core";
2
- import { getButtonSized } from "@tamagui/get-button-sized";
3
- import { ThemeableStack } from "./ThemeableStack";
4
- import { bordered, circular, elevate } from "./variants";
5
- const SizableStack = styled(ThemeableStack, {
6
- name: "SizableStack",
7
- variants: {
8
- unstyled: {
9
- true: {
10
- elevate: !1,
11
- bordered: !1
12
- }
13
- },
14
- circular,
15
- elevate,
16
- bordered: {
17
- true: bordered
18
- },
19
- size: {
20
- "...size": (val, extras) => getButtonSized(val, extras)
21
- }
22
- }
23
- });
24
- export {
25
- SizableStack
26
- };
27
- //# sourceMappingURL=SizableStack.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/SizableStack.tsx"],
4
- "mappings": "AAAA,SAAS,cAAc;AACvB,SAAS,sBAAsB;AAE/B,SAAS,sBAAsB;AAC/B,SAAS,UAAU,UAAU,eAAe;AAErC,MAAM,eAAe,OAAO,gBAAgB;AAAA,EACjD,MAAM;AAAA,EAEN,UAAU;AAAA,IACR,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IAEA;AAAA,IACA;AAAA,IAEA,UAAU;AAAA,MACR,MAAM;AAAA,IACR;AAAA,IAEA,MAAM;AAAA,MACJ,WAAW,CAAC,KAAK,WACR,eAAe,KAAK,MAAM;AAAA,IAErC;AAAA,EACF;AACF,CAAC;",
5
- "names": []
6
- }
@@ -1,41 +0,0 @@
1
- import { View, styled } from "@tamagui/core";
2
- import { getElevation } from "./getElevation";
3
- const fullscreenStyle = {
4
- position: "absolute",
5
- inset: 0
6
- }, variants = {
7
- fullscreen: {
8
- true: fullscreenStyle
9
- },
10
- elevation: {
11
- "...size": getElevation,
12
- ":number": getElevation
13
- }
14
- }, YStack = styled(View, {
15
- flexDirection: "column",
16
- variants
17
- });
18
- YStack.displayName = "YStack";
19
- const XStack = styled(View, {
20
- flexDirection: "row",
21
- variants
22
- });
23
- XStack.displayName = "XStack";
24
- const ZStack = styled(
25
- YStack,
26
- {
27
- position: "relative"
28
- },
29
- {
30
- neverFlatten: !0,
31
- isZStack: !0
32
- }
33
- );
34
- ZStack.displayName = "ZStack";
35
- export {
36
- XStack,
37
- YStack,
38
- ZStack,
39
- fullscreenStyle
40
- };
41
- //# sourceMappingURL=Stacks.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/Stacks.tsx"],
4
- "mappings": "AACA,SAAS,MAAM,cAAc;AAE7B,SAAS,oBAAoB;AAiBtB,MAAM,kBAAkB;AAAA,EAC7B,UAAU;AAAA,EACV,OAAO;AACT,GAEM,WAAW;AAAA,EACf,YAAY;AAAA,IACV,MAAM;AAAA,EACR;AAAA,EAEA,WAAW;AAAA,IACT,WAAW;AAAA,IACX,WAAW;AAAA,EACb;AACF,GAMa,SAAS,OAAO,MAAM;AAAA,EACjC,eAAe;AAAA,EACf;AACF,CAAC;AAED,OAAO,cAAiB;AAMjB,MAAM,SAAS,OAAO,MAAM;AAAA,EACjC,eAAe;AAAA,EACf;AACF,CAAC;AAED,OAAO,cAAiB;AAMjB,MAAM,SAAS;AAAA,EACpB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,EACZ;AAAA,EACA;AAAA,IACE,cAAc;AAAA,IACd,UAAU;AAAA,EACZ;AACF;AAEA,OAAO,cAAiB;",
5
- "names": []
6
- }
@@ -1,38 +0,0 @@
1
- import { styled } from "@tamagui/core";
2
- import { YStack } from "./Stacks";
3
- import { bordered, circular, elevate } from "./variants";
4
- const chromelessStyle = {
5
- backgroundColor: "transparent",
6
- borderColor: "transparent",
7
- shadowColor: "transparent",
8
- hoverStyle: {
9
- borderColor: "transparent"
10
- }
11
- }, themeableVariants = {
12
- circular,
13
- elevate,
14
- bordered: {
15
- true: bordered
16
- },
17
- transparent: {
18
- true: {
19
- backgroundColor: "transparent"
20
- }
21
- },
22
- chromeless: {
23
- true: chromelessStyle,
24
- all: {
25
- ...chromelessStyle,
26
- hoverStyle: chromelessStyle,
27
- pressStyle: chromelessStyle,
28
- focusStyle: chromelessStyle
29
- }
30
- }
31
- }, ThemeableStack = styled(YStack, {
32
- variants: themeableVariants
33
- });
34
- export {
35
- ThemeableStack,
36
- themeableVariants
37
- };
38
- //# sourceMappingURL=ThemeableStack.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/ThemeableStack.tsx"],
4
- "mappings": "AACA,SAAS,cAAc;AAEvB,SAAS,cAAc;AAEvB,SAAS,UAAU,UAAU,eAAe;AAE5C,MAAM,kBAAkB;AAAA,EACtB,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,aAAa;AAAA,EAEb,YAAY;AAAA,IACV,aAAa;AAAA,EACf;AACF,GAEa,oBAAoB;AAAA,EAC/B;AAAA,EACA;AAAA,EAEA,UAAU;AAAA,IACR,MAAM;AAAA,EACR;AAAA,EAEA,aAAa;AAAA,IACX,MAAM;AAAA,MACJ,iBAAiB;AAAA,IACnB;AAAA,EACF;AAAA,EAEA,YAAY;AAAA,IACV,MAAM;AAAA,IACN,KAAK;AAAA,MACH,GAAG;AAAA,MACH,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,YAAY;AAAA,IACd;AAAA,EACF;AACF,GAEa,iBAAiB,OAAO,QAAQ;AAAA,EAC3C,UAAU;AACZ,CAAC;",
5
- "names": []
6
- }
@@ -1,29 +0,0 @@
1
- import { getVariableValue, isAndroid, isVariable } from "@tamagui/core";
2
- const getElevation = (size, extras) => {
3
- if (!size) return;
4
- const { tokens } = extras, token = tokens.size[size], sizeNum = isVariable(token) ? +token.val : size;
5
- return getSizedElevation(sizeNum, extras);
6
- }, getSizedElevation = (val, { theme, tokens }) => {
7
- let num = 0;
8
- if (val === !0) {
9
- const val2 = getVariableValue(tokens.size.true);
10
- typeof val2 == "number" ? num = val2 : num = 10;
11
- } else
12
- num = +val;
13
- if (num === 0)
14
- return;
15
- const [height, shadowRadius] = [Math.round(num / 4 + 1), Math.round(num / 2 + 2)];
16
- return {
17
- shadowColor: theme.shadowColor,
18
- shadowRadius,
19
- shadowOffset: { height, width: 0 },
20
- ...isAndroid ? {
21
- elevationAndroid: 2 * height
22
- } : {}
23
- };
24
- };
25
- export {
26
- getElevation,
27
- getSizedElevation
28
- };
29
- //# sourceMappingURL=getElevation.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/getElevation.tsx"],
4
- "mappings": "AAMA,SAAS,kBAAkB,WAAW,kBAAkB;AAEjD,MAAM,eAAqD,CAAC,MAAM,WAAW;AAClF,MAAI,CAAC,KAAM;AACX,QAAM,EAAE,OAAO,IAAI,QACb,QAAQ,OAAO,KAAK,IAAI,GACxB,UAAW,WAAW,KAAK,IAAI,CAAC,MAAM,MAAM;AAClD,SAAO,kBAAkB,SAAS,MAAM;AAC1C,GAEa,oBAAoB,CAC/B,KACA,EAAE,OAAO,OAAO,MACb;AACH,MAAI,MAAM;AACV,MAAI,QAAQ,IAAM;AAChB,UAAMA,OAAM,iBAAiB,OAAO,KAAK,IAAO;AAChD,IAAI,OAAOA,QAAQ,WACjB,MAAMA,OAEN,MAAM;AAAA,EAEV;AACE,UAAM,CAAC;AAET,MAAI,QAAQ;AACV;AAEF,QAAM,CAAC,QAAQ,YAAY,IAAI,CAAC,KAAK,MAAM,MAAM,IAAI,CAAC,GAAG,KAAK,MAAM,MAAM,IAAI,CAAC,CAAC;AAWhF,SAVe;AAAA,IACb,aAAa,MAAM;AAAA,IACnB;AAAA,IACA,cAAc,EAAE,QAAQ,OAAO,EAAE;AAAA,IACjC,GAAI,YACA;AAAA,MACE,kBAAkB,IAAI;AAAA,IACxB,IACA,CAAC;AAAA,EACP;AAEF;",
5
- "names": ["val"]
6
- }
@@ -1,32 +0,0 @@
1
- import { getElevation } from "./getElevation";
2
- const elevate = {
3
- true: (_, extras) => getElevation(extras.props.size, extras)
4
- }, bordered = (val, { props }) => ({
5
- // TODO size it with size in '...size'
6
- borderWidth: typeof val == "number" ? val : 1,
7
- borderColor: "$borderColor"
8
- }), circularStyle = {
9
- borderRadius: 1e5,
10
- padding: 0
11
- }, circular = {
12
- true: (_, { props, tokens }) => {
13
- if (!("size" in props))
14
- return circularStyle;
15
- const size = typeof props.size == "number" ? props.size : tokens.size[props.size];
16
- return {
17
- ...circularStyle,
18
- width: size,
19
- height: size,
20
- maxWidth: size,
21
- maxHeight: size,
22
- minWidth: size,
23
- minHeight: size
24
- };
25
- }
26
- };
27
- export {
28
- bordered,
29
- circular,
30
- elevate
31
- };
32
- //# sourceMappingURL=variants.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/variants.tsx"],
4
- "mappings": "AAAA,SAAS,oBAAoB;AAEtB,MAAM,UAAU;AAAA,EACrB,MAAM,CAAC,GAAY,WACV,aAAa,OAAO,MAAM,MAAS,MAAM;AAEpD,GAEa,WAAW,CAAC,KAAuB,EAAE,MAAM,OAC/C;AAAA;AAAA,EAEL,aAAa,OAAO,OAAQ,WAAW,MAAM;AAAA,EAC7C,aAAa;AACf,IAGI,gBAAgB;AAAA,EACpB,cAAc;AAAA,EACd,SAAS;AACX,GAEa,WAAW;AAAA,EACtB,MAAM,CAAC,GAAG,EAAE,OAAO,OAAO,MAAM;AAC9B,QAAI,EAAE,UAAU;AACd,aAAO;AAET,UAAM,OAAO,OAAO,MAAM,QAAS,WAAW,MAAM,OAAO,OAAO,KAAK,MAAM,IAAI;AACjF,WAAO;AAAA,MACL,GAAG;AAAA,MACH,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,WAAW;AAAA,MACX,UAAU;AAAA,MACV,WAAW;AAAA,IACb;AAAA,EACF;AACF;",
5
- "names": []
6
- }
@@ -1,6 +0,0 @@
1
- import React from "react";
2
- const ButtonNestingContext = React.createContext(!1);
3
- export {
4
- ButtonNestingContext
5
- };
6
- //# sourceMappingURL=NestingContext.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/NestingContext.tsx"],
4
- "mappings": "AAAA,OAAO,WAAW;AAEX,MAAM,uBAAuB,MAAM,cAAc,EAAK;",
5
- "names": []
6
- }
@@ -1,27 +0,0 @@
1
- import { styled } from "@tamagui/core";
2
- import { getButtonSized } from "@tamagui/get-button-sized";
3
- import { ThemeableStack } from "./ThemeableStack";
4
- import { bordered, circular, elevate } from "./variants";
5
- const SizableStack = styled(ThemeableStack, {
6
- name: "SizableStack",
7
- variants: {
8
- unstyled: {
9
- true: {
10
- elevate: !1,
11
- bordered: !1
12
- }
13
- },
14
- circular,
15
- elevate,
16
- bordered: {
17
- true: bordered
18
- },
19
- size: {
20
- "...size": (val, extras) => getButtonSized(val, extras)
21
- }
22
- }
23
- });
24
- export {
25
- SizableStack
26
- };
27
- //# sourceMappingURL=SizableStack.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/SizableStack.tsx"],
4
- "mappings": "AAAA,SAAS,cAAc;AACvB,SAAS,sBAAsB;AAE/B,SAAS,sBAAsB;AAC/B,SAAS,UAAU,UAAU,eAAe;AAErC,MAAM,eAAe,OAAO,gBAAgB;AAAA,EACjD,MAAM;AAAA,EAEN,UAAU;AAAA,IACR,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IAEA;AAAA,IACA;AAAA,IAEA,UAAU;AAAA,MACR,MAAM;AAAA,IACR;AAAA,IAEA,MAAM;AAAA,MACJ,WAAW,CAAC,KAAK,WACR,eAAe,KAAK,MAAM;AAAA,IAErC;AAAA,EACF;AACF,CAAC;",
5
- "names": []
6
- }
@@ -1,41 +0,0 @@
1
- import { View, styled } from "@tamagui/core";
2
- import { getElevation } from "./getElevation";
3
- const fullscreenStyle = {
4
- position: "absolute",
5
- inset: 0
6
- }, variants = {
7
- fullscreen: {
8
- true: fullscreenStyle
9
- },
10
- elevation: {
11
- "...size": getElevation,
12
- ":number": getElevation
13
- }
14
- }, YStack = styled(View, {
15
- flexDirection: "column",
16
- variants
17
- });
18
- YStack.displayName = "YStack";
19
- const XStack = styled(View, {
20
- flexDirection: "row",
21
- variants
22
- });
23
- XStack.displayName = "XStack";
24
- const ZStack = styled(
25
- YStack,
26
- {
27
- position: "relative"
28
- },
29
- {
30
- neverFlatten: !0,
31
- isZStack: !0
32
- }
33
- );
34
- ZStack.displayName = "ZStack";
35
- export {
36
- XStack,
37
- YStack,
38
- ZStack,
39
- fullscreenStyle
40
- };
41
- //# sourceMappingURL=Stacks.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/Stacks.tsx"],
4
- "mappings": "AACA,SAAS,MAAM,cAAc;AAE7B,SAAS,oBAAoB;AAiBtB,MAAM,kBAAkB;AAAA,EAC7B,UAAU;AAAA,EACV,OAAO;AACT,GAEM,WAAW;AAAA,EACf,YAAY;AAAA,IACV,MAAM;AAAA,EACR;AAAA,EAEA,WAAW;AAAA,IACT,WAAW;AAAA,IACX,WAAW;AAAA,EACb;AACF,GAMa,SAAS,OAAO,MAAM;AAAA,EACjC,eAAe;AAAA,EACf;AACF,CAAC;AAED,OAAO,cAAiB;AAMjB,MAAM,SAAS,OAAO,MAAM;AAAA,EACjC,eAAe;AAAA,EACf;AACF,CAAC;AAED,OAAO,cAAiB;AAMjB,MAAM,SAAS;AAAA,EACpB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,EACZ;AAAA,EACA;AAAA,IACE,cAAc;AAAA,IACd,UAAU;AAAA,EACZ;AACF;AAEA,OAAO,cAAiB;",
5
- "names": []
6
- }
@@ -1,38 +0,0 @@
1
- import { styled } from "@tamagui/core";
2
- import { YStack } from "./Stacks";
3
- import { bordered, circular, elevate } from "./variants";
4
- const chromelessStyle = {
5
- backgroundColor: "transparent",
6
- borderColor: "transparent",
7
- shadowColor: "transparent",
8
- hoverStyle: {
9
- borderColor: "transparent"
10
- }
11
- }, themeableVariants = {
12
- circular,
13
- elevate,
14
- bordered: {
15
- true: bordered
16
- },
17
- transparent: {
18
- true: {
19
- backgroundColor: "transparent"
20
- }
21
- },
22
- chromeless: {
23
- true: chromelessStyle,
24
- all: {
25
- ...chromelessStyle,
26
- hoverStyle: chromelessStyle,
27
- pressStyle: chromelessStyle,
28
- focusStyle: chromelessStyle
29
- }
30
- }
31
- }, ThemeableStack = styled(YStack, {
32
- variants: themeableVariants
33
- });
34
- export {
35
- ThemeableStack,
36
- themeableVariants
37
- };
38
- //# sourceMappingURL=ThemeableStack.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/ThemeableStack.tsx"],
4
- "mappings": "AACA,SAAS,cAAc;AAEvB,SAAS,cAAc;AAEvB,SAAS,UAAU,UAAU,eAAe;AAE5C,MAAM,kBAAkB;AAAA,EACtB,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,aAAa;AAAA,EAEb,YAAY;AAAA,IACV,aAAa;AAAA,EACf;AACF,GAEa,oBAAoB;AAAA,EAC/B;AAAA,EACA;AAAA,EAEA,UAAU;AAAA,IACR,MAAM;AAAA,EACR;AAAA,EAEA,aAAa;AAAA,IACX,MAAM;AAAA,MACJ,iBAAiB;AAAA,IACnB;AAAA,EACF;AAAA,EAEA,YAAY;AAAA,IACV,MAAM;AAAA,IACN,KAAK;AAAA,MACH,GAAG;AAAA,MACH,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,YAAY;AAAA,IACd;AAAA,EACF;AACF,GAEa,iBAAiB,OAAO,QAAQ;AAAA,EAC3C,UAAU;AACZ,CAAC;",
5
- "names": []
6
- }
@@ -1,29 +0,0 @@
1
- import { getVariableValue, isAndroid, isVariable } from "@tamagui/core";
2
- const getElevation = (size, extras) => {
3
- if (!size) return;
4
- const { tokens } = extras, token = tokens.size[size], sizeNum = isVariable(token) ? +token.val : size;
5
- return getSizedElevation(sizeNum, extras);
6
- }, getSizedElevation = (val, { theme, tokens }) => {
7
- let num = 0;
8
- if (val === !0) {
9
- const val2 = getVariableValue(tokens.size.true);
10
- typeof val2 == "number" ? num = val2 : num = 10;
11
- } else
12
- num = +val;
13
- if (num === 0)
14
- return;
15
- const [height, shadowRadius] = [Math.round(num / 4 + 1), Math.round(num / 2 + 2)];
16
- return {
17
- shadowColor: theme.shadowColor,
18
- shadowRadius,
19
- shadowOffset: { height, width: 0 },
20
- ...isAndroid ? {
21
- elevationAndroid: 2 * height
22
- } : {}
23
- };
24
- };
25
- export {
26
- getElevation,
27
- getSizedElevation
28
- };
29
- //# sourceMappingURL=getElevation.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/getElevation.tsx"],
4
- "mappings": "AAMA,SAAS,kBAAkB,WAAW,kBAAkB;AAEjD,MAAM,eAAqD,CAAC,MAAM,WAAW;AAClF,MAAI,CAAC,KAAM;AACX,QAAM,EAAE,OAAO,IAAI,QACb,QAAQ,OAAO,KAAK,IAAI,GACxB,UAAW,WAAW,KAAK,IAAI,CAAC,MAAM,MAAM;AAClD,SAAO,kBAAkB,SAAS,MAAM;AAC1C,GAEa,oBAAoB,CAC/B,KACA,EAAE,OAAO,OAAO,MACb;AACH,MAAI,MAAM;AACV,MAAI,QAAQ,IAAM;AAChB,UAAMA,OAAM,iBAAiB,OAAO,KAAK,IAAO;AAChD,IAAI,OAAOA,QAAQ,WACjB,MAAMA,OAEN,MAAM;AAAA,EAEV;AACE,UAAM,CAAC;AAET,MAAI,QAAQ;AACV;AAEF,QAAM,CAAC,QAAQ,YAAY,IAAI,CAAC,KAAK,MAAM,MAAM,IAAI,CAAC,GAAG,KAAK,MAAM,MAAM,IAAI,CAAC,CAAC;AAWhF,SAVe;AAAA,IACb,aAAa,MAAM;AAAA,IACnB;AAAA,IACA,cAAc,EAAE,QAAQ,OAAO,EAAE;AAAA,IACjC,GAAI,YACA;AAAA,MACE,kBAAkB,IAAI;AAAA,IACxB,IACA,CAAC;AAAA,EACP;AAEF;",
5
- "names": ["val"]
6
- }
@@ -1,32 +0,0 @@
1
- import { getElevation } from "./getElevation";
2
- const elevate = {
3
- true: (_, extras) => getElevation(extras.props.size, extras)
4
- }, bordered = (val, { props }) => ({
5
- // TODO size it with size in '...size'
6
- borderWidth: typeof val == "number" ? val : 1,
7
- borderColor: "$borderColor"
8
- }), circularStyle = {
9
- borderRadius: 1e5,
10
- padding: 0
11
- }, circular = {
12
- true: (_, { props, tokens }) => {
13
- if (!("size" in props))
14
- return circularStyle;
15
- const size = typeof props.size == "number" ? props.size : tokens.size[props.size];
16
- return {
17
- ...circularStyle,
18
- width: size,
19
- height: size,
20
- maxWidth: size,
21
- maxHeight: size,
22
- minWidth: size,
23
- minHeight: size
24
- };
25
- }
26
- };
27
- export {
28
- bordered,
29
- circular,
30
- elevate
31
- };
32
- //# sourceMappingURL=variants.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/variants.tsx"],
4
- "mappings": "AAAA,SAAS,oBAAoB;AAEtB,MAAM,UAAU;AAAA,EACrB,MAAM,CAAC,GAAY,WACV,aAAa,OAAO,MAAM,MAAS,MAAM;AAEpD,GAEa,WAAW,CAAC,KAAuB,EAAE,MAAM,OAC/C;AAAA;AAAA,EAEL,aAAa,OAAO,OAAQ,WAAW,MAAM;AAAA,EAC7C,aAAa;AACf,IAGI,gBAAgB;AAAA,EACpB,cAAc;AAAA,EACd,SAAS;AACX,GAEa,WAAW;AAAA,EACtB,MAAM,CAAC,GAAG,EAAE,OAAO,OAAO,MAAM;AAC9B,QAAI,EAAE,UAAU;AACd,aAAO;AAET,UAAM,OAAO,OAAO,MAAM,QAAS,WAAW,MAAM,OAAO,OAAO,KAAK,MAAM,IAAI;AACjF,WAAO;AAAA,MACL,GAAG;AAAA,MACH,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,WAAW;AAAA,MACX,UAAU;AAAA,MACV,WAAW;AAAA,IACb;AAAA,EACF;AACF;",
5
- "names": []
6
- }