@tamagui/image 1.0.1-beta.47

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.
@@ -0,0 +1,33 @@
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: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var Circle_exports = {};
19
+ __export(Circle_exports, {
20
+ Circle: () => Circle
21
+ });
22
+ module.exports = __toCommonJS(Circle_exports);
23
+ var import_core = require("@tamagui/core");
24
+ var import_Square = require("./Square");
25
+ const Circle = (0, import_core.styled)(import_Square.Square, {
26
+ name: "Circle",
27
+ circular: true
28
+ });
29
+ // Annotate the CommonJS export names for ESM import in node:
30
+ 0 && (module.exports = {
31
+ Circle
32
+ });
33
+ //# sourceMappingURL=Circle.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/Circle.tsx"],
4
+ "sourcesContent": ["import { GetProps, styled } from '@tamagui/core'\n\nimport { Square } from './Square'\n\nexport const Circle = styled(Square, {\n name: 'Circle',\n circular: true,\n})\n\nexport type CircleProps = GetProps<typeof Circle>\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiC;AAEjC,oBAAuB;AAEhB,MAAM,SAAS,wBAAO,sBAAQ;AAAA,EACnC,MAAM;AAAA,EACN,UAAU;AACZ,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,80 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
+ var __spreadValues = (a, b) => {
11
+ for (var prop in b || (b = {}))
12
+ if (__hasOwnProp.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ if (__getOwnPropSymbols)
15
+ for (var prop of __getOwnPropSymbols(b)) {
16
+ if (__propIsEnum.call(b, prop))
17
+ __defNormalProp(a, prop, b[prop]);
18
+ }
19
+ return a;
20
+ };
21
+ var __objRest = (source, exclude) => {
22
+ var target = {};
23
+ for (var prop in source)
24
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
25
+ target[prop] = source[prop];
26
+ if (source != null && __getOwnPropSymbols)
27
+ for (var prop of __getOwnPropSymbols(source)) {
28
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
29
+ target[prop] = source[prop];
30
+ }
31
+ return target;
32
+ };
33
+ var __export = (target, all) => {
34
+ for (var name in all)
35
+ __defProp(target, name, { get: all[name], enumerable: true });
36
+ };
37
+ var __copyProps = (to, from, except, desc) => {
38
+ if (from && typeof from === "object" || typeof from === "function") {
39
+ for (let key of __getOwnPropNames(from))
40
+ if (!__hasOwnProp.call(to, key) && key !== except)
41
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
42
+ }
43
+ return to;
44
+ };
45
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
46
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
47
+ var Image_exports = {};
48
+ __export(Image_exports, {
49
+ Image: () => Image
50
+ });
51
+ module.exports = __toCommonJS(Image_exports);
52
+ var import_core = require("@tamagui/core");
53
+ var import_react = __toESM(require("react"));
54
+ var import_react_native = require("react-native");
55
+ import_react.default["createElement"];
56
+ const StyledImage = (0, import_core.styled)(import_react_native.Image, {
57
+ name: "Image",
58
+ position: "relative",
59
+ source: { uri: "" }
60
+ }, {
61
+ inlineProps: /* @__PURE__ */ new Set(["src", "width", "height"])
62
+ });
63
+ const Image = StyledImage.extractable((inProps) => {
64
+ const props = (0, import_core.getExpandedShorthands)(inProps);
65
+ const _a = props, { src, width = 100, height = 100 } = _a, rest = __objRest(_a, ["src", "width", "height"]);
66
+ const source = typeof src === "string" ? { uri: src, width, height } : src;
67
+ const defaultSource = Array.isArray(source) ? source[0] : source;
68
+ if (!defaultSource) {
69
+ return null;
70
+ }
71
+ return /* @__PURE__ */ import_react.default.createElement(StyledImage, __spreadValues({
72
+ defaultSource,
73
+ source
74
+ }, rest));
75
+ });
76
+ // Annotate the CommonJS export names for ESM import in node:
77
+ 0 && (module.exports = {
78
+ Image
79
+ });
80
+ //# sourceMappingURL=Image.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/Image.tsx"],
4
+ "sourcesContent": ["import { GetProps, StackProps, getExpandedShorthands, styled } from '@tamagui/core'\nimport React from 'react'\nimport { Image as RNImage } from 'react-native'\n\nReact['createElement']\n\nconst StyledImage = styled(\n RNImage,\n {\n name: 'Image',\n position: 'relative',\n source: { uri: '' },\n },\n {\n inlineProps: new Set(['src', 'width', 'height']),\n }\n)\n\ntype StyledImageProps = GetProps<typeof StyledImage>\n\ntype BaseProps = Omit<StyledImageProps, 'source' | 'width' | 'height' | 'style' | 'onLayout'> & {\n width: number\n height: number\n src: string | StyledImageProps['source']\n}\n\nexport type ImageProps = BaseProps & Omit<StackProps, keyof BaseProps>\n\nexport const Image: React.FC<ImageProps> = StyledImage.extractable((inProps) => {\n const props = getExpandedShorthands(inProps)\n const { src, width = 100, height = 100, ...rest } = props\n const source = typeof src === 'string' ? { uri: src, width, height } : src\n const defaultSource = Array.isArray(source) ? source[0] : source\n\n if (!defaultSource) {\n // placeholder with customizability\n return null\n }\n\n // must set defaultSource to allow SSR, default it to the same as src\n // @ts-ignore we pass all react-native-web props down\n return <StyledImage defaultSource={defaultSource} source={source} {...rest} />\n})\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAoE;AACpE,mBAAkB;AAClB,0BAAiC;AAEjC,qBAAM;AAEN,MAAM,cAAc,wBAClB,2BACA;AAAA,EACE,MAAM;AAAA,EACN,UAAU;AAAA,EACV,QAAQ,EAAE,KAAK,GAAG;AACpB,GACA;AAAA,EACE,aAAa,oBAAI,IAAI,CAAC,OAAO,SAAS,QAAQ,CAAC;AACjD,CACF;AAYO,MAAM,QAA8B,YAAY,YAAY,CAAC,YAAY;AAC9E,QAAM,QAAQ,uCAAsB,OAAO;AAC3C,QAAoD,YAA5C,OAAK,QAAQ,KAAK,SAAS,QAAiB,IAAT,iBAAS,IAAT,CAAnC,OAAK,SAAa;AAC1B,QAAM,SAAS,OAAO,QAAQ,WAAW,EAAE,KAAK,KAAK,OAAO,OAAO,IAAI;AACvE,QAAM,gBAAgB,MAAM,QAAQ,MAAM,IAAI,OAAO,KAAK;AAE1D,MAAI,CAAC,eAAe;AAElB,WAAO;AAAA,EACT;AAIA,SAAO,mDAAC;AAAA,IAAY;AAAA,IAA8B;AAAA,KAAoB,KAAM;AAC9E,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,41 @@
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: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var Square_exports = {};
19
+ __export(Square_exports, {
20
+ Square: () => Square
21
+ });
22
+ module.exports = __toCommonJS(Square_exports);
23
+ var import_core = require("@tamagui/core");
24
+ var import_stacks = require("@tamagui/stacks");
25
+ var import_getShapeSize = require("./getShapeSize");
26
+ const Square = (0, import_core.styled)(import_stacks.SizableStack, {
27
+ name: "Square",
28
+ alignItems: "center",
29
+ justifyContent: "center",
30
+ overflow: "hidden",
31
+ variants: {
32
+ size: {
33
+ "...size": import_getShapeSize.getShapeSize
34
+ }
35
+ }
36
+ });
37
+ // Annotate the CommonJS export names for ESM import in node:
38
+ 0 && (module.exports = {
39
+ Square
40
+ });
41
+ //# sourceMappingURL=Square.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/Square.tsx"],
4
+ "sourcesContent": ["import { GetProps, styled } from '@tamagui/core'\nimport { SizableStack } from '@tamagui/stacks'\n\nimport { getShapeSize } from './getShapeSize'\n\nexport const Square = styled(SizableStack, {\n name: 'Square',\n alignItems: 'center',\n justifyContent: 'center',\n overflow: 'hidden',\n\n variants: {\n size: {\n '...size': getShapeSize,\n },\n },\n})\n\nexport type SquareProps = GetProps<typeof Square>\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiC;AACjC,oBAA6B;AAE7B,0BAA6B;AAEtB,MAAM,SAAS,wBAAO,4BAAc;AAAA,EACzC,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,gBAAgB;AAAA,EAChB,UAAU;AAAA,EAEV,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,WAAW;AAAA,IACb;AAAA,EACF;AACF,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,40 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var getShapeSize_exports = {};
20
+ __export(getShapeSize_exports, {
21
+ getShapeSize: () => getShapeSize
22
+ });
23
+ module.exports = __toCommonJS(getShapeSize_exports);
24
+ const getShapeSize = /* @__PURE__ */ __name((size, { tokens }) => {
25
+ const width = tokens.size[size] ?? size;
26
+ const height = tokens.size[size] ?? size;
27
+ return {
28
+ width,
29
+ height,
30
+ minWidth: width,
31
+ maxWidth: width,
32
+ maxHeight: height,
33
+ minHeight: height
34
+ };
35
+ }, "getShapeSize");
36
+ // Annotate the CommonJS export names for ESM import in node:
37
+ 0 && (module.exports = {
38
+ getShapeSize
39
+ });
40
+ //# sourceMappingURL=getShapeSize.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/getShapeSize.tsx"],
4
+ "sourcesContent": ["import { SizeVariantSpreadFunction } from '@tamagui/core'\nimport { SizableStackProps } from '@tamagui/stacks'\n\nexport const getShapeSize: SizeVariantSpreadFunction<SizableStackProps> = (size, { tokens }) => {\n const width = tokens.size[size] ?? size\n const height = tokens.size[size] ?? size\n return {\n width,\n height,\n minWidth: width,\n maxWidth: width,\n maxHeight: height,\n minHeight: height,\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,eAA6D,wBAAC,MAAM,EAAE,aAAa;AAC9F,QAAM,QAAQ,OAAO,KAAK,SAAS;AACnC,QAAM,SAAS,OAAO,KAAK,SAAS;AACpC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV,UAAU;AAAA,IACV,WAAW;AAAA,IACX,WAAW;AAAA,EACb;AACF,GAX0E;",
6
+ "names": []
7
+ }
@@ -0,0 +1,18 @@
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
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var src_exports = {};
16
+ module.exports = __toCommonJS(src_exports);
17
+ __reExport(src_exports, require("./Image"), module.exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts"],
4
+ "sourcesContent": ["export * from './Image'\n"],
5
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,oBAAd;",
6
+ "names": []
7
+ }
@@ -0,0 +1,10 @@
1
+ import { styled } from "@tamagui/core";
2
+ import { Square } from "./Square";
3
+ const Circle = styled(Square, {
4
+ name: "Circle",
5
+ circular: true
6
+ });
7
+ export {
8
+ Circle
9
+ };
10
+ //# sourceMappingURL=Circle.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/Circle.tsx"],
4
+ "sourcesContent": ["import { GetProps, styled } from '@tamagui/core'\n\nimport { Square } from './Square'\n\nexport const Circle = styled(Square, {\n name: 'Circle',\n circular: true,\n})\n\nexport type CircleProps = GetProps<typeof Circle>\n"],
5
+ "mappings": "AAAA;AAEA;AAEO,MAAM,SAAS,OAAO,QAAQ;AAAA,EACnC,MAAM;AAAA,EACN,UAAU;AACZ,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,29 @@
1
+ import { getExpandedShorthands, styled } from "@tamagui/core";
2
+ import React from "react";
3
+ import { Image as RNImage } from "react-native";
4
+ React["createElement"];
5
+ const StyledImage = styled(RNImage, {
6
+ name: "Image",
7
+ position: "relative",
8
+ source: { uri: "" }
9
+ }, {
10
+ inlineProps: /* @__PURE__ */ new Set(["src", "width", "height"])
11
+ });
12
+ const Image = StyledImage.extractable((inProps) => {
13
+ const props = getExpandedShorthands(inProps);
14
+ const { src, width = 100, height = 100, ...rest } = props;
15
+ const source = typeof src === "string" ? { uri: src, width, height } : src;
16
+ const defaultSource = Array.isArray(source) ? source[0] : source;
17
+ if (!defaultSource) {
18
+ return null;
19
+ }
20
+ return /* @__PURE__ */ React.createElement(StyledImage, {
21
+ defaultSource,
22
+ source,
23
+ ...rest
24
+ });
25
+ });
26
+ export {
27
+ Image
28
+ };
29
+ //# sourceMappingURL=Image.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/Image.tsx"],
4
+ "sourcesContent": ["import { GetProps, StackProps, getExpandedShorthands, styled } from '@tamagui/core'\nimport React from 'react'\nimport { Image as RNImage } from 'react-native'\n\nReact['createElement']\n\nconst StyledImage = styled(\n RNImage,\n {\n name: 'Image',\n position: 'relative',\n source: { uri: '' },\n },\n {\n inlineProps: new Set(['src', 'width', 'height']),\n }\n)\n\ntype StyledImageProps = GetProps<typeof StyledImage>\n\ntype BaseProps = Omit<StyledImageProps, 'source' | 'width' | 'height' | 'style' | 'onLayout'> & {\n width: number\n height: number\n src: string | StyledImageProps['source']\n}\n\nexport type ImageProps = BaseProps & Omit<StackProps, keyof BaseProps>\n\nexport const Image: React.FC<ImageProps> = StyledImage.extractable((inProps) => {\n const props = getExpandedShorthands(inProps)\n const { src, width = 100, height = 100, ...rest } = props\n const source = typeof src === 'string' ? { uri: src, width, height } : src\n const defaultSource = Array.isArray(source) ? source[0] : source\n\n if (!defaultSource) {\n // placeholder with customizability\n return null\n }\n\n // must set defaultSource to allow SSR, default it to the same as src\n // @ts-ignore we pass all react-native-web props down\n return <StyledImage defaultSource={defaultSource} source={source} {...rest} />\n})\n"],
5
+ "mappings": "AAAA;AACA;AACA;AAEA,MAAM;AAEN,MAAM,cAAc,OAClB,SACA;AAAA,EACE,MAAM;AAAA,EACN,UAAU;AAAA,EACV,QAAQ,EAAE,KAAK,GAAG;AACpB,GACA;AAAA,EACE,aAAa,oBAAI,IAAI,CAAC,OAAO,SAAS,QAAQ,CAAC;AACjD,CACF;AAYO,MAAM,QAA8B,YAAY,YAAY,CAAC,YAAY;AAC9E,QAAM,QAAQ,sBAAsB,OAAO;AAC3C,QAAM,EAAE,KAAK,QAAQ,KAAK,SAAS,QAAQ,SAAS;AACpD,QAAM,SAAS,OAAO,QAAQ,WAAW,EAAE,KAAK,KAAK,OAAO,OAAO,IAAI;AACvE,QAAM,gBAAgB,MAAM,QAAQ,MAAM,IAAI,OAAO,KAAK;AAE1D,MAAI,CAAC,eAAe;AAElB,WAAO;AAAA,EACT;AAIA,SAAO,oCAAC;AAAA,IAAY;AAAA,IAA8B;AAAA,IAAiB,GAAG;AAAA,GAAM;AAC9E,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,18 @@
1
+ import { styled } from "@tamagui/core";
2
+ import { SizableStack } from "@tamagui/stacks";
3
+ import { getShapeSize } from "./getShapeSize";
4
+ const Square = styled(SizableStack, {
5
+ name: "Square",
6
+ alignItems: "center",
7
+ justifyContent: "center",
8
+ overflow: "hidden",
9
+ variants: {
10
+ size: {
11
+ "...size": getShapeSize
12
+ }
13
+ }
14
+ });
15
+ export {
16
+ Square
17
+ };
18
+ //# sourceMappingURL=Square.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/Square.tsx"],
4
+ "sourcesContent": ["import { GetProps, styled } from '@tamagui/core'\nimport { SizableStack } from '@tamagui/stacks'\n\nimport { getShapeSize } from './getShapeSize'\n\nexport const Square = styled(SizableStack, {\n name: 'Square',\n alignItems: 'center',\n justifyContent: 'center',\n overflow: 'hidden',\n\n variants: {\n size: {\n '...size': getShapeSize,\n },\n },\n})\n\nexport type SquareProps = GetProps<typeof Square>\n"],
5
+ "mappings": "AAAA;AACA;AAEA;AAEO,MAAM,SAAS,OAAO,cAAc;AAAA,EACzC,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,gBAAgB;AAAA,EAChB,UAAU;AAAA,EAEV,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,WAAW;AAAA,IACb;AAAA,EACF;AACF,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,19 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ const getShapeSize = /* @__PURE__ */ __name((size, { tokens }) => {
4
+ var _a, _b;
5
+ const width = (_a = tokens.size[size]) != null ? _a : size;
6
+ const height = (_b = tokens.size[size]) != null ? _b : size;
7
+ return {
8
+ width,
9
+ height,
10
+ minWidth: width,
11
+ maxWidth: width,
12
+ maxHeight: height,
13
+ minHeight: height
14
+ };
15
+ }, "getShapeSize");
16
+ export {
17
+ getShapeSize
18
+ };
19
+ //# sourceMappingURL=getShapeSize.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/getShapeSize.tsx"],
4
+ "sourcesContent": ["import { SizeVariantSpreadFunction } from '@tamagui/core'\nimport { SizableStackProps } from '@tamagui/stacks'\n\nexport const getShapeSize: SizeVariantSpreadFunction<SizableStackProps> = (size, { tokens }) => {\n const width = tokens.size[size] ?? size\n const height = tokens.size[size] ?? size\n return {\n width,\n height,\n minWidth: width,\n maxWidth: width,\n maxHeight: height,\n minHeight: height,\n }\n}\n"],
5
+ "mappings": ";;AAGO,MAAM,eAA6D,wBAAC,MAAM,EAAE,aAAa;AAHhG;AAIE,QAAM,QAAQ,aAAO,KAAK,UAAZ,YAAqB;AACnC,QAAM,SAAS,aAAO,KAAK,UAAZ,YAAqB;AACpC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV,UAAU;AAAA,IACV,WAAW;AAAA,IACX,WAAW;AAAA,EACb;AACF,GAX0E;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./Image";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts"],
4
+ "sourcesContent": ["export * from './Image'\n"],
5
+ "mappings": "AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,9 @@
1
+ import { styled } from "@tamagui/core";
2
+ import { Square } from "./Square";
3
+ const Circle = styled(Square, {
4
+ name: "Circle",
5
+ circular: true
6
+ });
7
+ export {
8
+ Circle
9
+ };
@@ -0,0 +1,24 @@
1
+ import { getExpandedShorthands, styled } from "@tamagui/core";
2
+ import React from "react";
3
+ import { Image as RNImage } from "react-native";
4
+ React["createElement"];
5
+ const StyledImage = styled(RNImage, {
6
+ name: "Image",
7
+ position: "relative",
8
+ source: { uri: "" }
9
+ }, {
10
+ inlineProps: /* @__PURE__ */ new Set(["src", "width", "height"])
11
+ });
12
+ const Image = StyledImage.extractable((inProps) => {
13
+ const props = getExpandedShorthands(inProps);
14
+ const { src, width = 100, height = 100, ...rest } = props;
15
+ const source = typeof src === "string" ? { uri: src, width, height } : src;
16
+ const defaultSource = Array.isArray(source) ? source[0] : source;
17
+ if (!defaultSource) {
18
+ return null;
19
+ }
20
+ return <StyledImage defaultSource={defaultSource} source={source} {...rest} />;
21
+ });
22
+ export {
23
+ Image
24
+ };
@@ -0,0 +1,17 @@
1
+ import { styled } from "@tamagui/core";
2
+ import { SizableStack } from "@tamagui/stacks";
3
+ import { getShapeSize } from "./getShapeSize";
4
+ const Square = styled(SizableStack, {
5
+ name: "Square",
6
+ alignItems: "center",
7
+ justifyContent: "center",
8
+ overflow: "hidden",
9
+ variants: {
10
+ size: {
11
+ "...size": getShapeSize
12
+ }
13
+ }
14
+ });
15
+ export {
16
+ Square
17
+ };
@@ -0,0 +1,18 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ const getShapeSize = /* @__PURE__ */ __name((size, { tokens }) => {
4
+ var _a, _b;
5
+ const width = (_a = tokens.size[size]) != null ? _a : size;
6
+ const height = (_b = tokens.size[size]) != null ? _b : size;
7
+ return {
8
+ width,
9
+ height,
10
+ minWidth: width,
11
+ maxWidth: width,
12
+ maxHeight: height,
13
+ minHeight: height
14
+ };
15
+ }, "getShapeSize");
16
+ export {
17
+ getShapeSize
18
+ };
@@ -0,0 +1 @@
1
+ export * from "./Image";
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@tamagui/image",
3
+ "version": "1.0.1-beta.47",
4
+ "sideEffects": true,
5
+ "source": "src/index.ts",
6
+ "types": "./types/index.d.ts",
7
+ "main": "dist/cjs",
8
+ "module": "dist/esm",
9
+ "module:jsx": "dist/jsx",
10
+ "files": [
11
+ "types",
12
+ "dist"
13
+ ],
14
+ "scripts": {
15
+ "build": "tamagui-build",
16
+ "watch": "tamagui-build --watch",
17
+ "clean": "tamagui-build clean",
18
+ "clean:build": "tamagui-build clean:build"
19
+ },
20
+ "dependencies": {
21
+ "@tamagui/core": "^1.0.1-beta.47"
22
+ },
23
+ "peerDependencies": {
24
+ "react": "*",
25
+ "react-native": "*"
26
+ },
27
+ "devDependencies": {
28
+ "@tamagui/build": "^1.0.1-beta.47",
29
+ "react": "*",
30
+ "react-native": "*"
31
+ },
32
+ "publishConfig": {
33
+ "access": "public"
34
+ }
35
+ }
@@ -0,0 +1,110 @@
1
+ import { GetProps } from '@tamagui/core';
2
+ export declare const Circle: import("@tamagui/core").TamaguiComponent<(Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
3
+ readonly fullscreen?: boolean | undefined;
4
+ readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
5
+ } & {
6
+ fontFamily?: unknown;
7
+ hoverable?: boolean | undefined;
8
+ pressable?: boolean | undefined;
9
+ focusable?: boolean | undefined;
10
+ circular?: boolean | undefined;
11
+ elevate?: boolean | undefined;
12
+ bordered?: number | boolean | undefined;
13
+ size?: import("@tamagui/core").SizeTokens | undefined;
14
+ }, "size"> & {
15
+ size?: import("@tamagui/core").SizeTokens | undefined;
16
+ } & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
17
+ readonly fullscreen?: boolean | undefined;
18
+ readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
19
+ } & {
20
+ fontFamily?: unknown;
21
+ hoverable?: boolean | undefined;
22
+ pressable?: boolean | undefined;
23
+ focusable?: boolean | undefined;
24
+ circular?: boolean | undefined;
25
+ elevate?: boolean | undefined;
26
+ bordered?: number | boolean | undefined;
27
+ size?: import("@tamagui/core").SizeTokens | undefined;
28
+ }, "size"> & {
29
+ size?: import("@tamagui/core").SizeTokens | undefined;
30
+ }>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
31
+ readonly fullscreen?: boolean | undefined;
32
+ readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
33
+ } & {
34
+ fontFamily?: unknown;
35
+ hoverable?: boolean | undefined;
36
+ pressable?: boolean | undefined;
37
+ focusable?: boolean | undefined;
38
+ circular?: boolean | undefined;
39
+ elevate?: boolean | undefined;
40
+ bordered?: number | boolean | undefined;
41
+ size?: import("@tamagui/core").SizeTokens | undefined;
42
+ }, "size"> & {
43
+ size?: import("@tamagui/core").SizeTokens | undefined;
44
+ }>>) | (Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
45
+ readonly fullscreen?: boolean | undefined;
46
+ readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
47
+ } & {
48
+ fontFamily?: unknown;
49
+ hoverable?: boolean | undefined;
50
+ pressable?: boolean | undefined;
51
+ focusable?: boolean | undefined;
52
+ circular?: boolean | undefined;
53
+ elevate?: boolean | undefined;
54
+ bordered?: number | boolean | undefined;
55
+ size?: import("@tamagui/core").SizeTokens | undefined;
56
+ } & {
57
+ size?: import("@tamagui/core").SizeTokens | undefined;
58
+ }, string | number> & {
59
+ [x: string]: undefined;
60
+ } & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
61
+ readonly fullscreen?: boolean | undefined;
62
+ readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
63
+ } & {
64
+ fontFamily?: unknown;
65
+ hoverable?: boolean | undefined;
66
+ pressable?: boolean | undefined;
67
+ focusable?: boolean | undefined;
68
+ circular?: boolean | undefined;
69
+ elevate?: boolean | undefined;
70
+ bordered?: number | boolean | undefined;
71
+ size?: import("@tamagui/core").SizeTokens | undefined;
72
+ } & {
73
+ size?: import("@tamagui/core").SizeTokens | undefined;
74
+ }, string | number> & {
75
+ [x: string]: undefined;
76
+ }>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
77
+ readonly fullscreen?: boolean | undefined;
78
+ readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
79
+ } & {
80
+ fontFamily?: unknown;
81
+ hoverable?: boolean | undefined;
82
+ pressable?: boolean | undefined;
83
+ focusable?: boolean | undefined;
84
+ circular?: boolean | undefined;
85
+ elevate?: boolean | undefined;
86
+ bordered?: number | boolean | undefined;
87
+ size?: import("@tamagui/core").SizeTokens | undefined;
88
+ } & {
89
+ size?: import("@tamagui/core").SizeTokens | undefined;
90
+ }, string | number> & {
91
+ [x: string]: undefined;
92
+ }>>), any, import("@tamagui/core").StackPropsBase, {
93
+ readonly fullscreen?: boolean | undefined;
94
+ readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
95
+ } & {
96
+ fontFamily?: unknown;
97
+ hoverable?: boolean | undefined;
98
+ pressable?: boolean | undefined;
99
+ focusable?: boolean | undefined;
100
+ circular?: boolean | undefined;
101
+ elevate?: boolean | undefined;
102
+ bordered?: number | boolean | undefined;
103
+ size?: import("@tamagui/core").SizeTokens | undefined;
104
+ } & {
105
+ size?: import("@tamagui/core").SizeTokens | undefined;
106
+ } & ({} | {
107
+ [x: string]: undefined;
108
+ })>;
109
+ export declare type CircleProps = GetProps<typeof Circle>;
110
+ //# sourceMappingURL=Circle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Circle.d.ts","sourceRoot":"","sources":["../src/Circle.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAU,MAAM,eAAe,CAAA;AAIhD,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAGjB,CAAA;AAEF,oBAAY,WAAW,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAA"}
@@ -0,0 +1,21 @@
1
+ import { GetProps, StackProps } from '@tamagui/core';
2
+ import React from 'react';
3
+ declare const StyledImage: import("@tamagui/core").TamaguiComponent<(import("react-native").ImageProps & Omit<StackProps, keyof import("react-native").ImageProps>) | (import("react-native").ImageProps & Omit<StackProps, keyof import("react-native").ImageProps> & Omit<{}, string | number> & {
4
+ [x: string]: undefined;
5
+ } & import("@tamagui/core").MediaProps<Partial<import("react-native").ImageProps & Omit<StackProps, keyof import("react-native").ImageProps> & Omit<{}, string | number> & {
6
+ [x: string]: undefined;
7
+ }>> & import("@tamagui/core").PseudoProps<Partial<import("react-native").ImageProps & Omit<StackProps, keyof import("react-native").ImageProps> & Omit<{}, string | number> & {
8
+ [x: string]: undefined;
9
+ }>>), any, import("react-native").ImageProps & Omit<StackProps, keyof import("react-native").ImageProps>, {} | {
10
+ [x: string]: undefined;
11
+ }>;
12
+ declare type StyledImageProps = GetProps<typeof StyledImage>;
13
+ declare type BaseProps = Omit<StyledImageProps, 'source' | 'width' | 'height' | 'style' | 'onLayout'> & {
14
+ width: number;
15
+ height: number;
16
+ src: string | StyledImageProps['source'];
17
+ };
18
+ export declare type ImageProps = BaseProps & Omit<StackProps, keyof BaseProps>;
19
+ export declare const Image: React.FC<ImageProps>;
20
+ export {};
21
+ //# sourceMappingURL=Image.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../src/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAiC,MAAM,eAAe,CAAA;AACnF,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,QAAA,MAAM,WAAW;;;;;;;;EAUhB,CAAA;AAED,aAAK,gBAAgB,GAAG,QAAQ,CAAC,OAAO,WAAW,CAAC,CAAA;AAEpD,aAAK,SAAS,GAAG,IAAI,CAAC,gBAAgB,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,CAAC,GAAG;IAC9F,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAA;CACzC,CAAA;AAED,oBAAY,UAAU,GAAG,SAAS,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,SAAS,CAAC,CAAA;AAEtE,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAcrC,CAAA"}
@@ -0,0 +1,60 @@
1
+ import { GetProps } from '@tamagui/core';
2
+ export declare const Square: import("@tamagui/core").TamaguiComponent<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
3
+ readonly fullscreen?: boolean | undefined;
4
+ readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
5
+ } & {
6
+ fontFamily?: unknown;
7
+ hoverable?: boolean | undefined;
8
+ pressable?: boolean | undefined;
9
+ focusable?: boolean | undefined;
10
+ circular?: boolean | undefined;
11
+ elevate?: boolean | undefined;
12
+ bordered?: number | boolean | undefined;
13
+ size?: import("@tamagui/core").SizeTokens | undefined;
14
+ }, "size"> & {
15
+ size?: import("@tamagui/core").SizeTokens | undefined;
16
+ } & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
17
+ readonly fullscreen?: boolean | undefined;
18
+ readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
19
+ } & {
20
+ fontFamily?: unknown;
21
+ hoverable?: boolean | undefined;
22
+ pressable?: boolean | undefined;
23
+ focusable?: boolean | undefined;
24
+ circular?: boolean | undefined;
25
+ elevate?: boolean | undefined;
26
+ bordered?: number | boolean | undefined;
27
+ size?: import("@tamagui/core").SizeTokens | undefined;
28
+ }, "size"> & {
29
+ size?: import("@tamagui/core").SizeTokens | undefined;
30
+ }>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
31
+ readonly fullscreen?: boolean | undefined;
32
+ readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
33
+ } & {
34
+ fontFamily?: unknown;
35
+ hoverable?: boolean | undefined;
36
+ pressable?: boolean | undefined;
37
+ focusable?: boolean | undefined;
38
+ circular?: boolean | undefined;
39
+ elevate?: boolean | undefined;
40
+ bordered?: number | boolean | undefined;
41
+ size?: import("@tamagui/core").SizeTokens | undefined;
42
+ }, "size"> & {
43
+ size?: import("@tamagui/core").SizeTokens | undefined;
44
+ }>>, any, import("@tamagui/core").StackPropsBase, {
45
+ readonly fullscreen?: boolean | undefined;
46
+ readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
47
+ } & {
48
+ fontFamily?: unknown;
49
+ hoverable?: boolean | undefined;
50
+ pressable?: boolean | undefined;
51
+ focusable?: boolean | undefined;
52
+ circular?: boolean | undefined;
53
+ elevate?: boolean | undefined;
54
+ bordered?: number | boolean | undefined;
55
+ size?: import("@tamagui/core").SizeTokens | undefined;
56
+ } & {
57
+ size?: import("@tamagui/core").SizeTokens | undefined;
58
+ }>;
59
+ export declare type SquareProps = GetProps<typeof Square>;
60
+ //# sourceMappingURL=Square.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Square.d.ts","sourceRoot":"","sources":["../src/Square.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAU,MAAM,eAAe,CAAA;AAKhD,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWjB,CAAA;AAEF,oBAAY,WAAW,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { SizeVariantSpreadFunction } from '@tamagui/core';
2
+ import { SizableStackProps } from '@tamagui/stacks';
3
+ export declare const getShapeSize: SizeVariantSpreadFunction<SizableStackProps>;
4
+ //# sourceMappingURL=getShapeSize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getShapeSize.d.ts","sourceRoot":"","sources":["../src/getShapeSize.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAEnD,eAAO,MAAM,YAAY,EAAE,yBAAyB,CAAC,iBAAiB,CAWrE,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './Image';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA"}