tamagui 1.2.9 → 1.2.11
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/dist/esm/createTamagui.mjs +62 -0
- package/dist/esm/createTamagui.mjs.map +7 -0
- package/dist/esm/helpers/inputHelpers.mjs +40 -0
- package/dist/esm/helpers/inputHelpers.mjs.map +7 -0
- package/dist/esm/index.mjs +165 -0
- package/dist/esm/index.mjs.map +7 -0
- package/dist/esm/lib/linear-gradient.native.mjs +2 -0
- package/dist/esm/lib/linear-gradient.native.mjs.map +7 -0
- package/dist/esm/linear-gradient.mjs +2 -0
- package/dist/esm/linear-gradient.mjs.map +7 -0
- package/dist/esm/setup.mjs +24 -0
- package/dist/esm/setup.mjs.map +7 -0
- package/dist/esm/viewTypes.mjs +1 -0
- package/dist/esm/viewTypes.mjs.map +7 -0
- package/dist/esm/views/Anchor.mjs +37 -0
- package/dist/esm/views/Anchor.mjs.map +7 -0
- package/dist/esm/views/EnsureFlexed.mjs +18 -0
- package/dist/esm/views/EnsureFlexed.mjs.map +7 -0
- package/dist/esm/views/Fieldset.mjs +18 -0
- package/dist/esm/views/Fieldset.mjs.map +7 -0
- package/dist/esm/views/Form.mjs +9 -0
- package/dist/esm/views/Form.mjs.map +7 -0
- package/dist/esm/views/Grid.mjs +43 -0
- package/dist/esm/views/Grid.mjs.map +7 -0
- package/dist/esm/views/Group.mjs +137 -0
- package/dist/esm/views/Group.mjs.map +7 -0
- package/dist/esm/views/Input.mjs +48 -0
- package/dist/esm/views/Input.mjs.map +7 -0
- package/dist/esm/views/Layouts.mjs +51 -0
- package/dist/esm/views/Layouts.mjs.map +7 -0
- package/dist/esm/views/Skeleton.mjs +39 -0
- package/dist/esm/views/Skeleton.mjs.map +7 -0
- package/dist/esm/views/Spinner.mjs +29 -0
- package/dist/esm/views/Spinner.mjs.map +7 -0
- package/dist/esm/views/TamaguiProvider.mjs +10 -0
- package/dist/esm/views/TamaguiProvider.mjs.map +7 -0
- package/dist/esm/views/TamaguiProvider.server.mjs +6 -0
- package/dist/esm/views/TamaguiProvider.server.mjs.map +7 -0
- package/dist/esm/views/TextArea.mjs +24 -0
- package/dist/esm/views/TextArea.mjs.map +7 -0
- package/dist/esm/views/VisuallyHidden.mjs +37 -0
- package/dist/esm/views/VisuallyHidden.mjs.map +7 -0
- package/dist/jsx/createTamagui.mjs +62 -0
- package/dist/jsx/createTamagui.mjs.map +7 -0
- package/dist/jsx/helpers/inputHelpers.mjs +40 -0
- package/dist/jsx/helpers/inputHelpers.mjs.map +7 -0
- package/dist/jsx/index.mjs +165 -0
- package/dist/jsx/index.mjs.map +7 -0
- package/dist/jsx/lib/linear-gradient.native.mjs +2 -0
- package/dist/jsx/lib/linear-gradient.native.mjs.map +7 -0
- package/dist/jsx/linear-gradient.mjs +2 -0
- package/dist/jsx/linear-gradient.mjs.map +7 -0
- package/dist/jsx/setup.mjs +24 -0
- package/dist/jsx/setup.mjs.map +7 -0
- package/dist/jsx/viewTypes.mjs +1 -0
- package/dist/jsx/viewTypes.mjs.map +7 -0
- package/dist/jsx/views/Anchor.mjs +32 -0
- package/dist/jsx/views/Anchor.mjs.map +7 -0
- package/dist/jsx/views/EnsureFlexed.mjs +18 -0
- package/dist/jsx/views/EnsureFlexed.mjs.map +7 -0
- package/dist/jsx/views/Fieldset.mjs +18 -0
- package/dist/jsx/views/Fieldset.mjs.map +7 -0
- package/dist/jsx/views/Form.mjs +9 -0
- package/dist/jsx/views/Form.mjs.map +7 -0
- package/dist/jsx/views/Grid.mjs +34 -0
- package/dist/jsx/views/Grid.mjs.map +7 -0
- package/dist/jsx/views/Group.mjs +128 -0
- package/dist/jsx/views/Group.mjs.map +7 -0
- package/dist/jsx/views/Input.mjs +48 -0
- package/dist/jsx/views/Input.mjs.map +7 -0
- package/dist/jsx/views/Layouts.mjs +51 -0
- package/dist/jsx/views/Layouts.mjs.map +7 -0
- package/dist/jsx/views/Skeleton.mjs +35 -0
- package/dist/jsx/views/Skeleton.mjs.map +7 -0
- package/dist/jsx/views/Spinner.mjs +28 -0
- package/dist/jsx/views/Spinner.mjs.map +7 -0
- package/dist/jsx/views/TamaguiProvider.mjs +9 -0
- package/dist/jsx/views/TamaguiProvider.mjs.map +7 -0
- package/dist/jsx/views/TamaguiProvider.server.mjs +6 -0
- package/dist/jsx/views/TamaguiProvider.server.mjs.map +7 -0
- package/dist/jsx/views/TextArea.mjs +24 -0
- package/dist/jsx/views/TextArea.mjs.map +7 -0
- package/dist/jsx/views/VisuallyHidden.mjs +37 -0
- package/dist/jsx/views/VisuallyHidden.mjs.map +7 -0
- package/package.json +46 -46
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { createTamagui as createTamaguiCore } from "@tamagui/core";
|
|
2
|
+
const createTamagui = process.env.NODE_ENV !== "development" ? createTamaguiCore : (conf) => {
|
|
3
|
+
const sizeTokenKeys = [
|
|
4
|
+
"$0",
|
|
5
|
+
"$1",
|
|
6
|
+
"$2",
|
|
7
|
+
"$3",
|
|
8
|
+
"$4",
|
|
9
|
+
"$5",
|
|
10
|
+
"$6",
|
|
11
|
+
"$7",
|
|
12
|
+
"$8",
|
|
13
|
+
"$9",
|
|
14
|
+
"$10",
|
|
15
|
+
"$true"
|
|
16
|
+
];
|
|
17
|
+
const hasKeys = (expectedKeys, obj) => {
|
|
18
|
+
return expectedKeys.every((k) => typeof obj[k] !== "undefined");
|
|
19
|
+
};
|
|
20
|
+
const tamaguiConfig = createTamaguiCore(conf);
|
|
21
|
+
for (const name of ["size", "space"]) {
|
|
22
|
+
const tokenSet = tamaguiConfig.tokensParsed[name];
|
|
23
|
+
if (!tokenSet) {
|
|
24
|
+
throw new Error(
|
|
25
|
+
`Expected tokens for "${name}" in ${Object.keys(
|
|
26
|
+
tamaguiConfig.tokensParsed
|
|
27
|
+
).join(", ")}`
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
if (!hasKeys(sizeTokenKeys, tokenSet)) {
|
|
31
|
+
throw new Error(`
|
|
32
|
+
createTamagui() missing definition for expected tokens.${name}:
|
|
33
|
+
|
|
34
|
+
Received: ${Object.keys(tokenSet).join(", ")}
|
|
35
|
+
|
|
36
|
+
Expected: ${sizeTokenKeys.join(", ")}
|
|
37
|
+
|
|
38
|
+
`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const expected = Object.keys(tamaguiConfig.tokensParsed.size);
|
|
42
|
+
for (const name of ["radius", "zIndex"]) {
|
|
43
|
+
const tokenSet = tamaguiConfig.tokensParsed[name];
|
|
44
|
+
const received = Object.keys(tokenSet);
|
|
45
|
+
const hasSomeOverlap = received.some((rk) => expected.includes(rk));
|
|
46
|
+
if (!hasSomeOverlap) {
|
|
47
|
+
throw new Error(`
|
|
48
|
+
createTamagui() invalid tokens.${name}:
|
|
49
|
+
|
|
50
|
+
Received: ${received.join(", ")}
|
|
51
|
+
|
|
52
|
+
Expected a subset of: ${expected.join(", ")}
|
|
53
|
+
|
|
54
|
+
`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return tamaguiConfig;
|
|
58
|
+
};
|
|
59
|
+
export {
|
|
60
|
+
createTamagui
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=createTamagui.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/createTamagui.ts"],
|
|
4
|
+
"sourcesContent": ["import { createTamagui as createTamaguiCore } from '@tamagui/core'\n\n/**\n * Adds some helpful validation at dev time only for `tamagui` specifically\n **/\n\nexport const createTamagui: typeof createTamaguiCore =\n process.env.NODE_ENV !== 'development'\n ? createTamaguiCore\n : (conf) => {\n const sizeTokenKeys = [\n '$0',\n '$1',\n '$2',\n '$3',\n '$4',\n '$5',\n '$6',\n '$7',\n '$8',\n '$9',\n '$10',\n '$true',\n ]\n\n const hasKeys = (expectedKeys: string[], obj: Record<any, any>) => {\n return expectedKeys.every((k) => typeof obj[k] !== 'undefined')\n }\n\n const tamaguiConfig = createTamaguiCore(conf)\n\n // size and space should be fully defined\n for (const name of ['size', 'space'] as const) {\n const tokenSet = tamaguiConfig.tokensParsed[name]\n if (!tokenSet) {\n throw new Error(\n `Expected tokens for \"${name}\" in ${Object.keys(\n tamaguiConfig.tokensParsed,\n ).join(', ')}`,\n )\n }\n if (!hasKeys(sizeTokenKeys, tokenSet)) {\n throw new Error(`\ncreateTamagui() missing definition for expected tokens.${name}:\n\nReceived: ${Object.keys(tokenSet).join(', ')}\n\nExpected: ${sizeTokenKeys.join(', ')}\n\n`)\n }\n }\n\n // others must define subset of size tokens\n const expected = Object.keys(tamaguiConfig.tokensParsed.size)\n for (const name of ['radius', 'zIndex'] as const) {\n const tokenSet = tamaguiConfig.tokensParsed[name]\n const received = Object.keys(tokenSet)\n const hasSomeOverlap = received.some((rk) => expected.includes(rk))\n if (!hasSomeOverlap) {\n throw new Error(`\ncreateTamagui() invalid tokens.${name}:\n\nReceived: ${received.join(', ')}\n\nExpected a subset of: ${expected.join(', ')}\n\n`)\n }\n }\n\n return tamaguiConfig\n }\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,iBAAiB,yBAAyB;AAM5C,MAAM,gBACX,QAAQ,IAAI,aAAa,gBACrB,oBACA,CAAC,SAAS;AACR,QAAM,gBAAgB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,UAAU,CAAC,cAAwB,QAA0B;AACjE,WAAO,aAAa,MAAM,CAAC,MAAM,OAAO,IAAI,CAAC,MAAM,WAAW;AAAA,EAChE;AAEA,QAAM,gBAAgB,kBAAkB,IAAI;AAG5C,aAAW,QAAQ,CAAC,QAAQ,OAAO,GAAY;AAC7C,UAAM,WAAW,cAAc,aAAa,IAAI;AAChD,QAAI,CAAC,UAAU;AACb,YAAM,IAAI;AAAA,QACR,wBAAwB,YAAY,OAAO;AAAA,UACzC,cAAc;AAAA,QAChB,EAAE,KAAK,IAAI;AAAA,MACb;AAAA,IACF;AACA,QAAI,CAAC,QAAQ,eAAe,QAAQ,GAAG;AACrC,YAAM,IAAI,MAAM;AAAA,yDAC6B;AAAA;AAAA,YAE7C,OAAO,KAAK,QAAQ,EAAE,KAAK,IAAI;AAAA;AAAA,YAE/B,cAAc,KAAK,IAAI;AAAA;AAAA,CAElC;AAAA,IACS;AAAA,EACF;AAGA,QAAM,WAAW,OAAO,KAAK,cAAc,aAAa,IAAI;AAC5D,aAAW,QAAQ,CAAC,UAAU,QAAQ,GAAY;AAChD,UAAM,WAAW,cAAc,aAAa,IAAI;AAChD,UAAM,WAAW,OAAO,KAAK,QAAQ;AACrC,UAAM,iBAAiB,SAAS,KAAK,CAAC,OAAO,SAAS,SAAS,EAAE,CAAC;AAClE,QAAI,CAAC,gBAAgB;AACnB,YAAM,IAAI,MAAM;AAAA,iCACK;AAAA;AAAA,YAErB,SAAS,KAAK,IAAI;AAAA;AAAA,wBAEN,SAAS,KAAK,IAAI;AAAA;AAAA,CAEzC;AAAA,IACS;AAAA,EACF;AAEA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { getVariableValue, isWeb } from "@tamagui/core";
|
|
2
|
+
import { getButtonSized } from "@tamagui/get-button-sized";
|
|
3
|
+
import { getFontSized } from "@tamagui/get-font-sized";
|
|
4
|
+
import { stepTokenUpOrDown } from "@tamagui/get-size";
|
|
5
|
+
const inputSizeVariant = (val = "$true", extras) => {
|
|
6
|
+
if (extras.props.multiline || extras.props.numberOfLines > 1) {
|
|
7
|
+
return textAreaSizeVariant(val, extras);
|
|
8
|
+
}
|
|
9
|
+
const buttonStyles = getButtonSized(val, extras);
|
|
10
|
+
const paddingHorizontal = stepTokenUpOrDown("space", val, -1, [2]);
|
|
11
|
+
const fontStyle = getFontSized(val, extras);
|
|
12
|
+
if (!isWeb && fontStyle) {
|
|
13
|
+
delete fontStyle["lineHeight"];
|
|
14
|
+
}
|
|
15
|
+
return {
|
|
16
|
+
...fontStyle,
|
|
17
|
+
...buttonStyles,
|
|
18
|
+
paddingHorizontal
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
const textAreaSizeVariant = (val = "$true", extras) => {
|
|
22
|
+
const { props } = extras;
|
|
23
|
+
const buttonStyles = getButtonSized(val, extras);
|
|
24
|
+
const fontStyle = getFontSized(val, extras);
|
|
25
|
+
const height = props.numberOfLines ? (props.numberOfLines || 1) * getVariableValue(fontStyle.lineHeight) : "auto";
|
|
26
|
+
const paddingVertical = stepTokenUpOrDown("space", val, -2, [2]);
|
|
27
|
+
const paddingHorizontal = stepTokenUpOrDown("space", val, -1, [2]);
|
|
28
|
+
return {
|
|
29
|
+
...buttonStyles,
|
|
30
|
+
...fontStyle,
|
|
31
|
+
paddingVertical,
|
|
32
|
+
paddingHorizontal,
|
|
33
|
+
height
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
inputSizeVariant,
|
|
38
|
+
textAreaSizeVariant
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=inputHelpers.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/helpers/inputHelpers.tsx"],
|
|
4
|
+
"sourcesContent": ["import { SizeVariantSpreadFunction, getVariableValue, isWeb } from '@tamagui/core'\nimport { getButtonSized } from '@tamagui/get-button-sized'\nimport { getFontSized } from '@tamagui/get-font-sized'\nimport { stepTokenUpOrDown } from '@tamagui/get-size'\n\nexport const inputSizeVariant: SizeVariantSpreadFunction<any> = (\n val = '$true',\n extras\n) => {\n if (extras.props.multiline || extras.props.numberOfLines > 1) {\n return textAreaSizeVariant(val, extras)\n }\n const buttonStyles = getButtonSized(val, extras)\n const paddingHorizontal = stepTokenUpOrDown('space', val, -1, [2])\n const fontStyle = getFontSized(val, extras)\n // lineHeight messes up input on native\n if (!isWeb && fontStyle) {\n delete fontStyle['lineHeight']\n }\n return {\n ...fontStyle,\n ...buttonStyles,\n paddingHorizontal,\n }\n}\n\nexport const textAreaSizeVariant: SizeVariantSpreadFunction<any> = (\n val = '$true',\n extras\n) => {\n const { props } = extras\n const buttonStyles = getButtonSized(val, extras)\n const fontStyle = getFontSized(val, extras)!\n const height = props.numberOfLines\n ? (props.numberOfLines || 1) * getVariableValue(fontStyle.lineHeight)\n : 'auto'\n const paddingVertical = stepTokenUpOrDown('space', val, -2, [2])\n const paddingHorizontal = stepTokenUpOrDown('space', val, -1, [2])\n return {\n ...buttonStyles,\n ...fontStyle,\n paddingVertical,\n paddingHorizontal,\n height,\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAoC,kBAAkB,aAAa;AACnE,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB;AAC7B,SAAS,yBAAyB;AAE3B,MAAM,mBAAmD,CAC9D,MAAM,SACN,WACG;AACH,MAAI,OAAO,MAAM,aAAa,OAAO,MAAM,gBAAgB,GAAG;AAC5D,WAAO,oBAAoB,KAAK,MAAM;AAAA,EACxC;AACA,QAAM,eAAe,eAAe,KAAK,MAAM;AAC/C,QAAM,oBAAoB,kBAAkB,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC;AACjE,QAAM,YAAY,aAAa,KAAK,MAAM;AAE1C,MAAI,CAAC,SAAS,WAAW;AACvB,WAAO,UAAU,YAAY;AAAA,EAC/B;AACA,SAAO;AAAA,IACL,GAAG;AAAA,IACH,GAAG;AAAA,IACH;AAAA,EACF;AACF;AAEO,MAAM,sBAAsD,CACjE,MAAM,SACN,WACG;AACH,QAAM,EAAE,MAAM,IAAI;AAClB,QAAM,eAAe,eAAe,KAAK,MAAM;AAC/C,QAAM,YAAY,aAAa,KAAK,MAAM;AAC1C,QAAM,SAAS,MAAM,iBAChB,MAAM,iBAAiB,KAAK,iBAAiB,UAAU,UAAU,IAClE;AACJ,QAAM,kBAAkB,kBAAkB,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC;AAC/D,QAAM,oBAAoB,kBAAkB,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC;AACjE,SAAO;AAAA,IACL,GAAG;AAAA,IACH,GAAG;AAAA,IACH;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
export * from "./setup";
|
|
2
|
+
export * from "@tamagui/adapt";
|
|
3
|
+
export * from "@tamagui/alert-dialog";
|
|
4
|
+
export * from "@tamagui/animate-presence";
|
|
5
|
+
export * from "@tamagui/avatar";
|
|
6
|
+
export * from "@tamagui/button";
|
|
7
|
+
export * from "@tamagui/card";
|
|
8
|
+
export * from "@tamagui/compose-refs";
|
|
9
|
+
export * from "@tamagui/create-context";
|
|
10
|
+
export * from "@tamagui/dialog";
|
|
11
|
+
export * from "@tamagui/font-size";
|
|
12
|
+
export * from "@tamagui/helpers-tamagui";
|
|
13
|
+
export * from "@tamagui/image";
|
|
14
|
+
export * from "@tamagui/label";
|
|
15
|
+
export * from "@tamagui/list-item";
|
|
16
|
+
export * from "@tamagui/popover";
|
|
17
|
+
export * from "@tamagui/popper";
|
|
18
|
+
export * from "@tamagui/portal";
|
|
19
|
+
export * from "@tamagui/progress";
|
|
20
|
+
export * from "@tamagui/scroll-view";
|
|
21
|
+
export * from "@tamagui/select";
|
|
22
|
+
export * from "@tamagui/separator";
|
|
23
|
+
export * from "@tamagui/shapes";
|
|
24
|
+
export * from "@tamagui/sheet";
|
|
25
|
+
export * from "@tamagui/slider";
|
|
26
|
+
export * from "@tamagui/stacks";
|
|
27
|
+
export * from "@tamagui/switch";
|
|
28
|
+
export * from "@tamagui/text";
|
|
29
|
+
export * from "@tamagui/tooltip";
|
|
30
|
+
export * from "@tamagui/use-controllable-state";
|
|
31
|
+
export * from "@tamagui/use-debounce";
|
|
32
|
+
export * from "@tamagui/use-force-update";
|
|
33
|
+
export * from "@tamagui/use-window-dimensions";
|
|
34
|
+
export * from "@tamagui/visually-hidden";
|
|
35
|
+
export * from "./createTamagui";
|
|
36
|
+
export * from "./views/TamaguiProvider";
|
|
37
|
+
export * from "./viewTypes";
|
|
38
|
+
export * from "./views/Anchor";
|
|
39
|
+
export * from "./views/EnsureFlexed";
|
|
40
|
+
export * from "./views/Fieldset";
|
|
41
|
+
export * from "./views/Form";
|
|
42
|
+
export * from "./views/Grid";
|
|
43
|
+
export * from "./views/Input";
|
|
44
|
+
export * from "./views/Group";
|
|
45
|
+
export * from "./views/Layouts";
|
|
46
|
+
export * from "./views/Spinner";
|
|
47
|
+
export * from "./views/TextArea";
|
|
48
|
+
import {
|
|
49
|
+
Spacer,
|
|
50
|
+
Stack,
|
|
51
|
+
Text,
|
|
52
|
+
Theme,
|
|
53
|
+
FontLanguage,
|
|
54
|
+
Unspaced,
|
|
55
|
+
TextAncestorContext,
|
|
56
|
+
isChrome,
|
|
57
|
+
isClient,
|
|
58
|
+
isServer,
|
|
59
|
+
isTouchable,
|
|
60
|
+
isWeb,
|
|
61
|
+
isWebTouchable,
|
|
62
|
+
mediaQueryConfig,
|
|
63
|
+
createComponent,
|
|
64
|
+
createFont,
|
|
65
|
+
createShorthands,
|
|
66
|
+
createTheme,
|
|
67
|
+
addTheme,
|
|
68
|
+
updateTheme,
|
|
69
|
+
createTokens,
|
|
70
|
+
createVariable,
|
|
71
|
+
getConfig,
|
|
72
|
+
getAnimationDriver,
|
|
73
|
+
getMedia,
|
|
74
|
+
getStylesAtomic,
|
|
75
|
+
getThemes,
|
|
76
|
+
getTokens,
|
|
77
|
+
getVariable,
|
|
78
|
+
variableToString,
|
|
79
|
+
getVariableValue,
|
|
80
|
+
getVariableName,
|
|
81
|
+
insertFont,
|
|
82
|
+
isTamaguiElement,
|
|
83
|
+
isTamaguiComponent,
|
|
84
|
+
isVariable,
|
|
85
|
+
matchMedia,
|
|
86
|
+
mediaObjectToString,
|
|
87
|
+
mediaState,
|
|
88
|
+
spacedChildren,
|
|
89
|
+
styled,
|
|
90
|
+
themeable,
|
|
91
|
+
useStyle,
|
|
92
|
+
withStaticProperties,
|
|
93
|
+
useGet,
|
|
94
|
+
useEvent,
|
|
95
|
+
useDidFinishSSR,
|
|
96
|
+
useIsomorphicLayoutEffect,
|
|
97
|
+
useIsTouchDevice,
|
|
98
|
+
useMedia,
|
|
99
|
+
useTheme,
|
|
100
|
+
useThemeName,
|
|
101
|
+
useSafeRef
|
|
102
|
+
} from "@tamagui/core";
|
|
103
|
+
function LinearGradient(props) {
|
|
104
|
+
if (process.env.NODE_ENV === "development") {
|
|
105
|
+
console.warn(`LinearGradient has been moved to tamagui/linear-gradient as of 1.1`);
|
|
106
|
+
}
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
export {
|
|
110
|
+
FontLanguage,
|
|
111
|
+
LinearGradient,
|
|
112
|
+
Spacer,
|
|
113
|
+
Stack,
|
|
114
|
+
Text,
|
|
115
|
+
TextAncestorContext,
|
|
116
|
+
Theme,
|
|
117
|
+
Unspaced,
|
|
118
|
+
addTheme,
|
|
119
|
+
createComponent,
|
|
120
|
+
createFont,
|
|
121
|
+
createShorthands,
|
|
122
|
+
createTheme,
|
|
123
|
+
createTokens,
|
|
124
|
+
createVariable,
|
|
125
|
+
getAnimationDriver,
|
|
126
|
+
getConfig,
|
|
127
|
+
getMedia,
|
|
128
|
+
getStylesAtomic,
|
|
129
|
+
getThemes,
|
|
130
|
+
getTokens,
|
|
131
|
+
getVariable,
|
|
132
|
+
getVariableName,
|
|
133
|
+
getVariableValue,
|
|
134
|
+
insertFont,
|
|
135
|
+
isChrome,
|
|
136
|
+
isClient,
|
|
137
|
+
isServer,
|
|
138
|
+
isTamaguiComponent,
|
|
139
|
+
isTamaguiElement,
|
|
140
|
+
isTouchable,
|
|
141
|
+
isVariable,
|
|
142
|
+
isWeb,
|
|
143
|
+
isWebTouchable,
|
|
144
|
+
matchMedia,
|
|
145
|
+
mediaObjectToString,
|
|
146
|
+
mediaQueryConfig,
|
|
147
|
+
mediaState,
|
|
148
|
+
spacedChildren,
|
|
149
|
+
styled,
|
|
150
|
+
themeable,
|
|
151
|
+
updateTheme,
|
|
152
|
+
useDidFinishSSR,
|
|
153
|
+
useEvent,
|
|
154
|
+
useGet,
|
|
155
|
+
useIsTouchDevice,
|
|
156
|
+
useIsomorphicLayoutEffect,
|
|
157
|
+
useMedia,
|
|
158
|
+
useSafeRef,
|
|
159
|
+
useStyle,
|
|
160
|
+
useTheme,
|
|
161
|
+
useThemeName,
|
|
162
|
+
variableToString,
|
|
163
|
+
withStaticProperties
|
|
164
|
+
};
|
|
165
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["export * from './setup'\n\nexport * from '@tamagui/adapt'\nexport * from '@tamagui/alert-dialog'\nexport * from '@tamagui/animate-presence'\nexport * from '@tamagui/avatar'\nexport * from '@tamagui/button'\nexport * from '@tamagui/card'\nexport * from '@tamagui/compose-refs'\nexport * from '@tamagui/create-context'\nexport * from '@tamagui/dialog'\nexport * from '@tamagui/font-size'\nexport * from '@tamagui/helpers-tamagui'\nexport * from '@tamagui/image'\nexport * from '@tamagui/label'\nexport * from '@tamagui/list-item'\nexport * from '@tamagui/popover'\nexport * from '@tamagui/popper'\nexport * from '@tamagui/portal'\nexport * from '@tamagui/progress'\nexport * from '@tamagui/scroll-view'\nexport * from '@tamagui/select'\nexport * from '@tamagui/separator'\nexport * from '@tamagui/shapes'\nexport * from '@tamagui/sheet'\nexport * from '@tamagui/slider'\nexport * from '@tamagui/stacks'\nexport * from '@tamagui/switch'\nexport * from '@tamagui/text'\nexport * from '@tamagui/tooltip'\nexport * from '@tamagui/use-controllable-state'\nexport * from '@tamagui/use-debounce'\nexport * from '@tamagui/use-force-update'\nexport * from '@tamagui/use-window-dimensions'\nexport * from '@tamagui/visually-hidden'\n\nexport * from './createTamagui'\n\nexport * from './views/TamaguiProvider'\nexport * from './viewTypes'\n\nexport * from './views/Anchor'\nexport * from './views/EnsureFlexed'\nexport * from './views/Fieldset'\nexport * from './views/Form'\nexport * from './views/Grid'\nexport * from './views/Input'\nexport * from './views/Group'\nexport * from './views/Layouts'\n// export * from './views/Skeleton'\nexport * from './views/Spinner'\nexport * from './views/TextArea'\n\n// since we overlap with StackProps and potentially others\n// lets be explicit on what gets exported\nexport type {\n AnimationKeys,\n ColorTokens,\n CreateTamaguiConfig,\n CreateTamaguiProps,\n FontColorTokens,\n FontLetterSpacingTokens,\n FontLineHeightTokens,\n FontSizeTokens,\n FontStyleTokens,\n FontTokens,\n FontTransformTokens,\n FontWeightTokens,\n GenericFont,\n GenericTamaguiConfig,\n GetAnimationKeys,\n GetProps,\n GetVariantProps,\n GenericTextVariants,\n GenericStackVariants,\n Media,\n MediaPropKeys,\n MediaQueries,\n MediaQueryState,\n Shorthands,\n SizeTokens,\n SpaceTokens,\n SpacerProps,\n StackPropsBase,\n TamaguiElement,\n StackNonStyleProps,\n StaticConfig,\n StaticConfigParsed,\n TamaguiBaseTheme,\n TamaguiComponent,\n TamaguiComponentPropsBase,\n TamaguiConfig,\n FontLanguages,\n TamaguiCustomConfig,\n TamaguiInternalConfig,\n TamaguiProviderProps,\n TextProps,\n TextPropsBase,\n TextNonStyleProps,\n ThemeKeys,\n ThemeName,\n ThemeParsed,\n ThemeProps,\n Themes,\n ThemeValueFallback,\n Tokens,\n TransformStyleProps,\n VariantSpreadExtras,\n VariantSpreadFunction,\n ZIndexTokens,\n} from '@tamagui/core'\n\nexport {\n // components\n Spacer,\n Stack,\n Text,\n Theme,\n FontLanguage,\n Unspaced,\n // context,\n TextAncestorContext,\n // constants\n isChrome,\n isClient,\n isServer,\n isTouchable,\n isWeb,\n isWebTouchable,\n mediaQueryConfig,\n createComponent,\n createFont,\n createShorthands,\n createTheme,\n addTheme,\n updateTheme,\n createTokens,\n createVariable,\n getConfig,\n getAnimationDriver,\n getMedia,\n getStylesAtomic,\n getThemes,\n getTokens,\n getVariable,\n variableToString,\n getVariableValue,\n getVariableName,\n insertFont,\n isTamaguiElement,\n isTamaguiComponent,\n isVariable,\n matchMedia,\n mediaObjectToString,\n mediaState,\n spacedChildren,\n styled,\n themeable,\n useStyle,\n withStaticProperties,\n // hooks\n useGet,\n useEvent,\n useDidFinishSSR,\n useIsomorphicLayoutEffect,\n useIsTouchDevice,\n useMedia,\n useTheme,\n useThemeName,\n useSafeRef,\n} from '@tamagui/core'\n\nexport function LinearGradient(props: never) {\n if (process.env.NODE_ENV === 'development') {\n console.warn(`LinearGradient has been moved to tamagui/linear-gradient as of 1.1`)\n }\n return null\n}\n"],
|
|
5
|
+
"mappings": "AAAA,cAAc;AAEd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AAEd,cAAc;AACd,cAAc;AAEd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AACd,cAAc;AA6Dd;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEA,SAAS,eAAe,OAAc;AAC3C,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,YAAQ,KAAK,oEAAoE;AAAA,EACnF;AACA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { setupReactNative } from "@tamagui/core";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Text, View } from "react-native";
|
|
4
|
+
globalThis.React = React;
|
|
5
|
+
setupReactNative({
|
|
6
|
+
View,
|
|
7
|
+
Text
|
|
8
|
+
});
|
|
9
|
+
if (typeof requestAnimationFrame === "undefined") {
|
|
10
|
+
globalThis["requestAnimationFrame"] = setImmediate;
|
|
11
|
+
}
|
|
12
|
+
const cancelAnimationFrame = globalThis.cancelAnimationFrame;
|
|
13
|
+
global.cancelAnimationFrame = (x) => {
|
|
14
|
+
try {
|
|
15
|
+
cancelAnimationFrame(x);
|
|
16
|
+
} catch {
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
const idFn = () => {
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
idFn
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=setup.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/setup.ts"],
|
|
4
|
+
"sourcesContent": ["import { setupReactNative } from '@tamagui/core'\nimport * as React from 'react'\nimport { Text, View } from 'react-native'\n\nglobalThis.React = React\n\nsetupReactNative({\n View,\n Text,\n})\n\n// for SSR\nif (typeof requestAnimationFrame === 'undefined') {\n globalThis['requestAnimationFrame'] = setImmediate\n}\n\nconst cancelAnimationFrame = globalThis.cancelAnimationFrame\n\n// for vite / Animated.spring()\nglobal.cancelAnimationFrame = (x: number) => {\n try {\n cancelAnimationFrame(x)\n } catch {\n // illegal invocation :/\n }\n}\n\n// need to export something, afraid of tree shaking even with `sideEffects`\nexport const idFn = () => {}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,wBAAwB;AACjC,YAAY,WAAW;AACvB,SAAS,MAAM,YAAY;AAE3B,WAAW,QAAQ;AAEnB,iBAAiB;AAAA,EACf;AAAA,EACA;AACF,CAAC;AAGD,IAAI,OAAO,0BAA0B,aAAa;AAChD,aAAW,uBAAuB,IAAI;AACxC;AAEA,MAAM,uBAAuB,WAAW;AAGxC,OAAO,uBAAuB,CAAC,MAAc;AAC3C,MAAI;AACF,yBAAqB,CAAC;AAAA,EACxB,QAAE;AAAA,EAEF;AACF;AAGO,MAAM,OAAO,MAAM;AAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=viewTypes.mjs.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { isWeb, styled } from "@tamagui/core";
|
|
3
|
+
import { SizableText } from "@tamagui/text";
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
import { Linking } from "react-native";
|
|
6
|
+
const AnchorFrame = styled(SizableText, {
|
|
7
|
+
name: "Anchor",
|
|
8
|
+
tag: "a",
|
|
9
|
+
accessibilityRole: "link"
|
|
10
|
+
});
|
|
11
|
+
const Anchor = AnchorFrame.extractable(
|
|
12
|
+
forwardRef(({ href, target, ...props }, ref) => {
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
AnchorFrame,
|
|
15
|
+
{
|
|
16
|
+
...props,
|
|
17
|
+
...isWeb ? {
|
|
18
|
+
href,
|
|
19
|
+
target
|
|
20
|
+
} : {
|
|
21
|
+
onPress: (event) => {
|
|
22
|
+
var _a;
|
|
23
|
+
(_a = props.onPress) == null ? void 0 : _a.call(props, event);
|
|
24
|
+
if (href !== void 0) {
|
|
25
|
+
Linking.openURL(href);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
ref
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
})
|
|
33
|
+
);
|
|
34
|
+
export {
|
|
35
|
+
Anchor
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=Anchor.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/views/Anchor.tsx"],
|
|
4
|
+
"sourcesContent": ["import { ReactComponentWithRef, isWeb, styled } from '@tamagui/core'\nimport { SizableText, SizableTextProps } from '@tamagui/text'\nimport React, { forwardRef } from 'react'\nimport { Linking, View } from 'react-native'\n\nexport type AnchorProps = SizableTextProps & {\n href?: string\n target?: string\n rel?: string\n}\n\nconst AnchorFrame = styled(SizableText, {\n name: 'Anchor',\n tag: 'a',\n accessibilityRole: 'link',\n})\n\nexport const Anchor: ReactComponentWithRef<AnchorProps, HTMLAnchorElement | View> =\n AnchorFrame.extractable(\n forwardRef(({ href, target, ...props }, ref) => {\n return (\n <AnchorFrame\n {...props}\n {...(isWeb\n ? {\n href,\n target,\n }\n : {\n onPress: (event) => {\n props.onPress?.(event)\n if (href !== undefined) {\n Linking.openURL(href)\n }\n },\n })}\n ref={ref as any}\n />\n )\n }),\n )\n"],
|
|
5
|
+
"mappings": "AAqBQ;AArBR,SAAgC,OAAO,cAAc;AACrD,SAAS,mBAAqC;AAC9C,SAAgB,kBAAkB;AAClC,SAAS,eAAqB;AAQ9B,MAAM,cAAc,OAAO,aAAa;AAAA,EACtC,MAAM;AAAA,EACN,KAAK;AAAA,EACL,mBAAmB;AACrB,CAAC;AAEM,MAAM,SACX,YAAY;AAAA,EACV,WAAW,CAAC,EAAE,MAAM,QAAQ,GAAG,MAAM,GAAG,QAAQ;AAC9C,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACH,GAAI,QACD;AAAA,UACE;AAAA,UACA;AAAA,QACF,IACA;AAAA,UACE,SAAS,CAAC,UAAU;AA7BpC;AA8BkB,wBAAM,YAAN,+BAAgB;AAChB,gBAAI,SAAS,QAAW;AACtB,sBAAQ,QAAQ,IAAI;AAAA,YACtB;AAAA,UACF;AAAA,QACF;AAAA,QACJ;AAAA;AAAA,IACF;AAAA,EAEJ,CAAC;AACH;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Text, styled } from "@tamagui/core";
|
|
2
|
+
const EnsureFlexed = styled(Text, {
|
|
3
|
+
opacity: 0,
|
|
4
|
+
lineHeight: 0,
|
|
5
|
+
height: 0,
|
|
6
|
+
display: "flex",
|
|
7
|
+
fontSize: 200,
|
|
8
|
+
children: "wwwwwwwwwwwwwwwwwww",
|
|
9
|
+
hoverStyle: {
|
|
10
|
+
backgroundColor: "red"
|
|
11
|
+
},
|
|
12
|
+
pointerEvents: "none"
|
|
13
|
+
});
|
|
14
|
+
EnsureFlexed["isVisuallyHidden"] = true;
|
|
15
|
+
export {
|
|
16
|
+
EnsureFlexed
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=EnsureFlexed.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/views/EnsureFlexed.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Text, styled } from '@tamagui/core'\n\n// expands flex elements when they should push a far as they \"want\" naturally\n\nexport const EnsureFlexed = styled(Text, {\n opacity: 0,\n lineHeight: 0,\n height: 0,\n display: 'flex',\n fontSize: 200,\n children: 'wwwwwwwwwwwwwwwwwww',\n\n hoverStyle: {\n backgroundColor: 'red',\n },\n\n pointerEvents: 'none',\n})\n\n// @tamgui/core checks for this in spacing\nEnsureFlexed['isVisuallyHidden'] = true\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,MAAM,cAAc;AAItB,MAAM,eAAe,OAAO,MAAM;AAAA,EACvC,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,UAAU;AAAA,EACV,UAAU;AAAA,EAEV,YAAY;AAAA,IACV,iBAAiB;AAAA,EACnB;AAAA,EAEA,eAAe;AACjB,CAAC;AAGD,aAAa,kBAAkB,IAAI;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { styled } from "@tamagui/core";
|
|
2
|
+
import { YStack } from "@tamagui/stacks";
|
|
3
|
+
const Fieldset = styled(YStack, {
|
|
4
|
+
name: "Fieldset",
|
|
5
|
+
tag: "fieldset",
|
|
6
|
+
variants: {
|
|
7
|
+
horizontal: {
|
|
8
|
+
true: {
|
|
9
|
+
flexDirection: "row",
|
|
10
|
+
alignItems: "center"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export {
|
|
16
|
+
Fieldset
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=Fieldset.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/views/Fieldset.tsx"],
|
|
4
|
+
"sourcesContent": ["import { GetProps, styled } from '@tamagui/core'\nimport { YStack } from '@tamagui/stacks'\n\nexport const Fieldset = styled(YStack, {\n name: 'Fieldset',\n tag: 'fieldset',\n\n variants: {\n horizontal: {\n true: {\n flexDirection: 'row',\n alignItems: 'center',\n },\n },\n } as const,\n})\n\nexport type FieldsetProps = GetProps<typeof Fieldset>\n"],
|
|
5
|
+
"mappings": "AAAA,SAAmB,cAAc;AACjC,SAAS,cAAc;AAEhB,MAAM,WAAW,OAAO,QAAQ;AAAA,EACrC,MAAM;AAAA,EACN,KAAK;AAAA,EAEL,UAAU;AAAA,IACR,YAAY;AAAA,MACV,MAAM;AAAA,QACJ,eAAe;AAAA,QACf,YAAY;AAAA,MACd;AAAA,IACF;AAAA,EACF;AACF,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/views/Form.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Stack, styled } from '@tamagui/core'\n\nexport const Form = styled(Stack, {\n name: 'Form',\n tag: 'form',\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,OAAO,cAAc;AAEvB,MAAM,OAAO,OAAO,OAAO;AAAA,EAChC,MAAM;AAAA,EACN,KAAK;AACP,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { isWeb } from "@tamagui/core";
|
|
3
|
+
import { XStack } from "@tamagui/stacks";
|
|
4
|
+
import React from "react";
|
|
5
|
+
function Grid({ children, columns, itemMinWidth = 200, gap }) {
|
|
6
|
+
if (isWeb) {
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
"div",
|
|
9
|
+
{
|
|
10
|
+
style: {
|
|
11
|
+
gap,
|
|
12
|
+
display: "grid",
|
|
13
|
+
justifyContent: "stretch",
|
|
14
|
+
// gridTemplateRows: 'repeat(4, 1fr)',
|
|
15
|
+
gridTemplateColumns: `repeat( auto-fit, minmax(${itemMinWidth}px, 1fr) )`
|
|
16
|
+
// gridTemplateColumns: '1fr 1fr',
|
|
17
|
+
},
|
|
18
|
+
children
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
const childrenList = React.Children.toArray(children);
|
|
23
|
+
return /* @__PURE__ */ jsx(XStack, { alignItems: "center", justifyContent: "center", flexWrap: "wrap", children: childrenList.map((child, i) => {
|
|
24
|
+
if (!child) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
return /* @__PURE__ */ jsx(
|
|
28
|
+
XStack,
|
|
29
|
+
{
|
|
30
|
+
flex: 1,
|
|
31
|
+
minWidth: itemMinWidth,
|
|
32
|
+
marginRight: gap,
|
|
33
|
+
marginBottom: gap,
|
|
34
|
+
children: child
|
|
35
|
+
},
|
|
36
|
+
i
|
|
37
|
+
);
|
|
38
|
+
}) });
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
Grid
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=Grid.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/views/Grid.tsx"],
|
|
4
|
+
"sourcesContent": ["import { isWeb } from '@tamagui/core'\nimport { XStack } from '@tamagui/stacks'\nimport React from 'react'\n\nexport type GridProps = {\n children?: any\n itemMinWidth?: number\n gap?: any\n columns?: number\n}\n\nexport function Grid({ children, columns, itemMinWidth = 200, gap }: GridProps) {\n if (isWeb) {\n return (\n <div\n style={{\n gap,\n display: 'grid',\n justifyContent: 'stretch',\n // gridTemplateRows: 'repeat(4, 1fr)',\n gridTemplateColumns: `repeat( auto-fit, minmax(${itemMinWidth}px, 1fr) )`,\n // gridTemplateColumns: '1fr 1fr',\n }}\n >\n {children}\n </div>\n )\n }\n\n const childrenList = React.Children.toArray(children)\n\n return (\n <XStack alignItems=\"center\" justifyContent=\"center\" flexWrap=\"wrap\">\n {childrenList.map((child, i) => {\n if (!child) {\n return null\n }\n\n // index key bad\n return (\n <XStack\n key={i}\n flex={1}\n minWidth={itemMinWidth}\n marginRight={gap}\n marginBottom={gap}\n >\n {child}\n </XStack>\n )\n })}\n </XStack>\n )\n}\n"],
|
|
5
|
+
"mappings": "AAcM;AAdN,SAAS,aAAa;AACtB,SAAS,cAAc;AACvB,OAAO,WAAW;AASX,SAAS,KAAK,EAAE,UAAU,SAAS,eAAe,KAAK,IAAI,GAAc;AAC9E,MAAI,OAAO;AACT,WACE;AAAA,MAAC;AAAA;AAAA,QACC,OAAO;AAAA,UACL;AAAA,UACA,SAAS;AAAA,UACT,gBAAgB;AAAA;AAAA,UAEhB,qBAAqB,4BAA4B;AAAA;AAAA,QAEnD;AAAA,QAEC;AAAA;AAAA,IACH;AAAA,EAEJ;AAEA,QAAM,eAAe,MAAM,SAAS,QAAQ,QAAQ;AAEpD,SACE,oBAAC,UAAO,YAAW,UAAS,gBAAe,UAAS,UAAS,QAC1D,uBAAa,IAAI,CAAC,OAAO,MAAM;AAC9B,QAAI,CAAC,OAAO;AACV,aAAO;AAAA,IACT;AAGA,WACE;AAAA,MAAC;AAAA;AAAA,QAEC,MAAM;AAAA,QACN,UAAU;AAAA,QACV,aAAa;AAAA,QACb,cAAc;AAAA,QAEb;AAAA;AAAA,MANI;AAAA,IAOP;AAAA,EAEJ,CAAC,GACH;AAEJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|