@tamagui/stacks 1.0.0-beta.9 → 1.0.1-beta.101

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 (53) hide show
  1. package/dist/cjs/SizableStack.js +9 -65
  2. package/dist/cjs/SizableStack.js.map +2 -2
  3. package/dist/cjs/Stacks.js +30 -25
  4. package/dist/cjs/Stacks.js.map +2 -2
  5. package/dist/cjs/ThemeableSizableStack.js +70 -0
  6. package/dist/cjs/ThemeableSizableStack.js.map +7 -0
  7. package/dist/cjs/ThemeableStack.js +61 -0
  8. package/dist/cjs/ThemeableStack.js.map +7 -0
  9. package/dist/cjs/index.js +1 -0
  10. package/dist/cjs/index.js.map +2 -2
  11. package/dist/cjs/variants.js +138 -0
  12. package/dist/cjs/variants.js.map +7 -0
  13. package/dist/esm/SizableStack.js +10 -66
  14. package/dist/esm/SizableStack.js.map +2 -2
  15. package/dist/esm/Stacks.js +29 -26
  16. package/dist/esm/Stacks.js.map +2 -2
  17. package/dist/esm/ThemeableSizableStack.js +47 -0
  18. package/dist/esm/ThemeableSizableStack.js.map +7 -0
  19. package/dist/esm/ThemeableStack.js +47 -0
  20. package/dist/esm/ThemeableStack.js.map +7 -0
  21. package/dist/esm/index.js +1 -0
  22. package/dist/esm/index.js.map +2 -2
  23. package/dist/esm/variants.js +110 -0
  24. package/dist/esm/variants.js.map +7 -0
  25. package/dist/jsx/SizableStack.js +11 -66
  26. package/dist/jsx/SizableStack.js.map +7 -0
  27. package/dist/jsx/Stacks.js +30 -26
  28. package/dist/jsx/Stacks.js.map +7 -0
  29. package/dist/jsx/ThemeableSizableStack.js +46 -0
  30. package/dist/jsx/ThemeableStack.js +47 -0
  31. package/dist/jsx/ThemeableStack.js.map +7 -0
  32. package/dist/jsx/index.js +2 -0
  33. package/dist/jsx/index.js.map +7 -0
  34. package/dist/jsx/variants.js +97 -0
  35. package/dist/jsx/variants.js.map +7 -0
  36. package/package.json +8 -5
  37. package/src/SizableStack.tsx +29 -0
  38. package/src/Stacks.tsx +91 -0
  39. package/src/ThemeableStack.tsx +53 -0
  40. package/src/index.ts +3 -0
  41. package/src/variants.tsx +98 -0
  42. package/types/SizableStack.d.ts +35 -39
  43. package/types/SizableStack.d.ts.map +1 -1
  44. package/types/Stacks.d.ts +34 -33
  45. package/types/Stacks.d.ts.map +1 -1
  46. package/types/ThemeableSizableStack.d.ts +68 -0
  47. package/types/ThemeableSizableStack.d.ts.map +1 -0
  48. package/types/ThemeableStack.d.ts +68 -0
  49. package/types/ThemeableStack.d.ts.map +1 -0
  50. package/types/index.d.ts +1 -0
  51. package/types/index.d.ts.map +1 -1
  52. package/types/variants.d.ts +268 -0
  53. package/types/variants.d.ts.map +1 -0
@@ -22,78 +22,22 @@ __export(SizableStack_exports, {
22
22
  module.exports = __toCommonJS(SizableStack_exports);
23
23
  var import_core = require("@tamagui/core");
24
24
  var import_Stacks = require("./Stacks");
25
- const SizableStack = (0, import_core.styled)(import_Stacks.XStack, {
25
+ var import_variants = require("./variants");
26
+ const SizableStack = (0, import_core.styled)(import_Stacks.YStack, {
26
27
  name: "SizableStack",
27
28
  backgroundColor: "$background",
28
29
  flexDirection: "row",
29
30
  flexShrink: 1,
30
31
  variants: {
31
32
  fontFamily: () => ({}),
32
- hoverable: {
33
- true: {
34
- hoverStyle: {
35
- backgroundColor: "$backgroundHover",
36
- borderColor: "$borderColorHover"
37
- }
38
- },
39
- false: {
40
- hoverStyle: {
41
- backgroundColor: "$background",
42
- borderColor: "$borderColor"
43
- }
44
- }
45
- },
46
- pressable: {
47
- true: {
48
- pressStyle: {
49
- backgroundColor: "$backgroundPress",
50
- borderColor: "$borderColorPress"
51
- }
52
- },
53
- false: {
54
- pressStyle: {
55
- backgroundColor: "$background",
56
- borderColor: "$borderColor"
57
- }
58
- }
59
- },
60
- focusable: {
61
- true: {
62
- focusStyle: {
63
- backgroundColor: "$backgroundFocus",
64
- borderColor: "$borderColorFocus"
65
- }
66
- }
67
- },
68
- bordered: {
69
- true: {
70
- borderWidth: 1,
71
- borderColor: "$borderColor"
72
- }
73
- },
33
+ hoverTheme: import_variants.hoverTheme,
34
+ pressTheme: import_variants.pressTheme,
35
+ focusTheme: import_variants.focusTheme,
36
+ circular: import_variants.circular,
37
+ elevate: import_variants.elevate,
38
+ bordered: import_variants.bordered,
74
39
  size: {
75
- "...size": (0, import_core.getButtonSize)()
76
- },
77
- disabled: {
78
- true: {
79
- opacity: 0.45,
80
- backgroundColor: "$background",
81
- hoverStyle: {
82
- backgroundColor: "$background"
83
- }
84
- }
85
- },
86
- transparent: {
87
- true: {
88
- backgroundColor: "transparent"
89
- }
90
- },
91
- chromeless: {
92
- true: {
93
- backgroundColor: "transparent",
94
- borderColor: "transparent",
95
- shadowColor: "transparent"
96
- }
40
+ "...size": import_core.getButtonSize
97
41
  }
98
42
  }
99
43
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/SizableStack.tsx"],
4
- "sourcesContent": ["import { GetProps, getButtonSize, styled } from '@tamagui/core'\n\nimport { XStack } from './Stacks'\n\nexport const SizableStack = styled(XStack, {\n name: 'SizableStack',\n backgroundColor: '$background',\n flexDirection: 'row',\n flexShrink: 1,\n\n variants: {\n // allows the type to come in for use in size\n fontFamily: () => ({}),\n\n hoverable: {\n true: {\n hoverStyle: {\n backgroundColor: '$backgroundHover',\n borderColor: '$borderColorHover',\n },\n },\n false: {\n hoverStyle: {\n backgroundColor: '$background',\n borderColor: '$borderColor',\n },\n },\n },\n\n pressable: {\n true: {\n pressStyle: {\n backgroundColor: '$backgroundPress',\n borderColor: '$borderColorPress',\n },\n },\n false: {\n pressStyle: {\n backgroundColor: '$background',\n borderColor: '$borderColor',\n },\n },\n },\n\n focusable: {\n true: {\n focusStyle: {\n backgroundColor: '$backgroundFocus',\n borderColor: '$borderColorFocus',\n },\n },\n },\n\n bordered: {\n true: {\n borderWidth: 1,\n borderColor: '$borderColor',\n },\n },\n\n size: {\n '...size': getButtonSize(),\n },\n\n disabled: {\n true: {\n // pointerEvents: 'none',\n opacity: 0.45,\n backgroundColor: '$background',\n hoverStyle: {\n backgroundColor: '$background',\n },\n },\n },\n\n transparent: {\n true: {\n backgroundColor: 'transparent',\n },\n },\n\n chromeless: {\n true: {\n backgroundColor: 'transparent',\n borderColor: 'transparent',\n shadowColor: 'transparent',\n // this would be a breaking change...\n // hoverStyle: {\n // backgroundColor: 'transparent',\n // },\n },\n },\n },\n})\n\nexport type SizableStackProps = GetProps<typeof SizableStack>\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAgD;AAEhD,oBAAuB;AAEhB,MAAM,eAAe,wBAAO,sBAAQ;AAAA,EACzC,MAAM;AAAA,EACN,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,YAAY;AAAA,EAEZ,UAAU;AAAA,IAER,YAAY,MAAO,EAAC;AAAA,IAEpB,WAAW;AAAA,MACT,MAAM;AAAA,QACJ,YAAY;AAAA,UACV,iBAAiB;AAAA,UACjB,aAAa;AAAA,QACf;AAAA,MACF;AAAA,MACA,OAAO;AAAA,QACL,YAAY;AAAA,UACV,iBAAiB;AAAA,UACjB,aAAa;AAAA,QACf;AAAA,MACF;AAAA,IACF;AAAA,IAEA,WAAW;AAAA,MACT,MAAM;AAAA,QACJ,YAAY;AAAA,UACV,iBAAiB;AAAA,UACjB,aAAa;AAAA,QACf;AAAA,MACF;AAAA,MACA,OAAO;AAAA,QACL,YAAY;AAAA,UACV,iBAAiB;AAAA,UACjB,aAAa;AAAA,QACf;AAAA,MACF;AAAA,IACF;AAAA,IAEA,WAAW;AAAA,MACT,MAAM;AAAA,QACJ,YAAY;AAAA,UACV,iBAAiB;AAAA,UACjB,aAAa;AAAA,QACf;AAAA,MACF;AAAA,IACF;AAAA,IAEA,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,aAAa;AAAA,QACb,aAAa;AAAA,MACf;AAAA,IACF;AAAA,IAEA,MAAM;AAAA,MACJ,WAAW,+BAAc;AAAA,IAC3B;AAAA,IAEA,UAAU;AAAA,MACR,MAAM;AAAA,QAEJ,SAAS;AAAA,QACT,iBAAiB;AAAA,QACjB,YAAY;AAAA,UACV,iBAAiB;AAAA,QACnB;AAAA,MACF;AAAA,IACF;AAAA,IAEA,aAAa;AAAA,MACX,MAAM;AAAA,QACJ,iBAAiB;AAAA,MACnB;AAAA,IACF;AAAA,IAEA,YAAY;AAAA,MACV,MAAM;AAAA,QACJ,iBAAiB;AAAA,QACjB,aAAa;AAAA,QACb,aAAa;AAAA,MAKf;AAAA,IACF;AAAA,EACF;AACF,CAAC;",
4
+ "sourcesContent": ["import { GetProps, getButtonSize, styled } from '@tamagui/core'\n\nimport { YStack } from './Stacks'\nimport { bordered, circular, elevate, focusTheme, hoverTheme, pressTheme } from './variants'\n\nexport const SizableStack = styled(YStack, {\n name: 'SizableStack',\n backgroundColor: '$background',\n flexDirection: 'row',\n flexShrink: 1,\n\n variants: {\n // allows the type to come in for use in size\n fontFamily: () => ({}),\n\n hoverTheme,\n pressTheme,\n focusTheme,\n circular,\n elevate,\n bordered,\n\n size: {\n '...size': getButtonSize,\n },\n },\n})\n\nexport type SizableStackProps = GetProps<typeof SizableStack>\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAgD;AAEhD,oBAAuB;AACvB,sBAAgF;AAEzE,MAAM,eAAe,wBAAO,sBAAQ;AAAA,EACzC,MAAM;AAAA,EACN,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,YAAY;AAAA,EAEZ,UAAU;AAAA,IAER,YAAY,MAAO,EAAC;AAAA,IAEpB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAEA,MAAM;AAAA,MACJ,WAAW;AAAA,IACb;AAAA,EACF;AACF,CAAC;",
6
6
  "names": []
7
7
  }
@@ -2,7 +2,6 @@ var __defProp = Object.defineProperty;
2
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
5
  var __export = (target, all) => {
7
6
  for (var name in all)
8
7
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -21,16 +20,19 @@ __export(Stacks_exports, {
21
20
  XStack: () => XStack,
22
21
  YStack: () => YStack,
23
22
  ZStack: () => ZStack,
23
+ getElevation: () => getElevation,
24
24
  getSizedElevation: () => getSizedElevation
25
25
  });
26
26
  module.exports = __toCommonJS(Stacks_exports);
27
27
  var import_core = require("@tamagui/core");
28
- const getElevation = /* @__PURE__ */ __name((size, extras) => {
28
+ const getElevation = (size, extras) => {
29
+ if (!size)
30
+ return;
29
31
  const { tokens } = extras;
30
32
  const token = tokens.size[size];
31
33
  const sizeNum = (0, import_core.isVariable)(token) ? +token.val : size;
32
34
  return getSizedElevation(sizeNum, extras);
33
- }, "getElevation");
35
+ };
34
36
  const fullscreenStyle = {
35
37
  position: "absolute",
36
38
  top: 0,
@@ -38,29 +40,23 @@ const fullscreenStyle = {
38
40
  right: 0,
39
41
  bottom: 0
40
42
  };
43
+ const variants = {
44
+ fullscreen: {
45
+ true: fullscreenStyle
46
+ },
47
+ elevation: {
48
+ "...size": getElevation
49
+ }
50
+ };
41
51
  const YStack = (0, import_core.styled)(import_core.Stack, {
42
52
  flexDirection: "column",
43
53
  name: "YStack",
44
- variants: {
45
- fullscreen: {
46
- true: fullscreenStyle
47
- },
48
- elevation: {
49
- "...size": getElevation
50
- }
51
- }
54
+ variants
52
55
  });
53
56
  const XStack = (0, import_core.styled)(import_core.Stack, {
54
57
  flexDirection: "row",
55
58
  name: "XStack",
56
- variants: {
57
- fullscreen: {
58
- true: fullscreenStyle
59
- },
60
- elevation: {
61
- "...size": getElevation
62
- }
63
- }
59
+ variants
64
60
  });
65
61
  const ZStack = (0, import_core.styled)(YStack, {
66
62
  name: "ZStack",
@@ -69,14 +65,22 @@ const ZStack = (0, import_core.styled)(YStack, {
69
65
  neverFlatten: true,
70
66
  isZStack: true
71
67
  });
72
- const getSizedElevation = /* @__PURE__ */ __name((val, { theme, tokens }) => {
73
- const num = val === false ? 0 : val === true ? (() => {
68
+ const getSizedElevation = (val, { theme, tokens }) => {
69
+ let num = 0;
70
+ if (val === true) {
74
71
  const val2 = (0, import_core.getVariableValue)(tokens.size["true"]);
75
72
  if (typeof val2 === "number") {
76
- return val2;
73
+ num = val2;
74
+ } else {
75
+ num = 10;
77
76
  }
78
- return 10;
79
- })() : +val;
77
+ } else {
78
+ num = +val;
79
+ }
80
+ if (process.env.NODE_ENV === "development") {
81
+ if (isNaN(num))
82
+ console.warn("NaN shadow", num, val);
83
+ }
80
84
  const [height, shadowRadius] = [Math.round(num / 4 + 1), Math.round(num / 2 + 2)];
81
85
  const shadow = {
82
86
  shadowColor: theme.shadowColor,
@@ -84,12 +88,13 @@ const getSizedElevation = /* @__PURE__ */ __name((val, { theme, tokens }) => {
84
88
  shadowOffset: { height, width: 0 }
85
89
  };
86
90
  return shadow;
87
- }, "getSizedElevation");
91
+ };
88
92
  // Annotate the CommonJS export names for ESM import in node:
89
93
  0 && (module.exports = {
90
94
  XStack,
91
95
  YStack,
92
96
  ZStack,
97
+ getElevation,
93
98
  getSizedElevation
94
99
  });
95
100
  //# sourceMappingURL=Stacks.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Stacks.tsx"],
4
- "sourcesContent": ["import {\n GetProps,\n SizeTokens,\n SizeVariantSpreadFunction,\n Stack,\n StackProps,\n VariantSpreadExtras,\n getVariableValue,\n isVariable,\n styled,\n} from '@tamagui/core'\n\nexport type YStackProps = GetProps<typeof YStack>\nexport type XStackProps = GetProps<typeof YStack>\nexport type ZStackProps = GetProps<typeof ZStack>\n\nconst getElevation: SizeVariantSpreadFunction<StackProps> = (size, extras) => {\n const { tokens } = extras\n const token = tokens.size[size]\n const sizeNum = (isVariable(token) ? +token.val : size) as number\n // TODO this could be configurable with require('tamagui').configure({ elevation: () => {} })\n return getSizedElevation(sizeNum, extras)\n}\n\nconst fullscreenStyle = {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n} as const\n\nexport const YStack = styled(Stack, {\n flexDirection: 'column',\n name: 'YStack',\n variants: {\n fullscreen: {\n true: fullscreenStyle,\n },\n elevation: {\n '...size': getElevation,\n },\n },\n})\n\nexport const XStack = styled(Stack, {\n flexDirection: 'row',\n name: 'XStack',\n variants: {\n fullscreen: {\n true: fullscreenStyle,\n },\n elevation: {\n '...size': getElevation,\n },\n },\n})\n\nexport const ZStack = styled(\n YStack,\n {\n name: 'ZStack',\n position: 'relative',\n },\n {\n neverFlatten: true,\n isZStack: true,\n }\n)\n\nexport const getSizedElevation = (\n val: SizeTokens | number | boolean,\n { theme, tokens }: VariantSpreadExtras<any>\n) => {\n const num =\n val === false\n ? 0\n : val === true\n ? // handles true\n (() => {\n const val = getVariableValue(tokens.size['true'])\n if (typeof val === 'number') {\n return val\n }\n return 10\n })()\n : +val\n const [height, shadowRadius] = [Math.round(num / 4 + 1), Math.round(num / 2 + 2)]\n const shadow = {\n shadowColor: theme.shadowColor,\n shadowRadius,\n shadowOffset: { height, width: 0 },\n }\n return shadow\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAUO;AAMP,MAAM,eAAsD,wBAAC,MAAM,WAAW;AAC5E,QAAM,EAAE,WAAW;AACnB,QAAM,QAAQ,OAAO,KAAK;AAC1B,QAAM,UAAW,4BAAW,KAAK,IAAI,CAAC,MAAM,MAAM;AAElD,SAAO,kBAAkB,SAAS,MAAM;AAC1C,GAN4D;AAQ5D,MAAM,kBAAkB;AAAA,EACtB,UAAU;AAAA,EACV,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AACV;AAEO,MAAM,SAAS,wBAAO,mBAAO;AAAA,EAClC,eAAe;AAAA,EACf,MAAM;AAAA,EACN,UAAU;AAAA,IACR,YAAY;AAAA,MACV,MAAM;AAAA,IACR;AAAA,IACA,WAAW;AAAA,MACT,WAAW;AAAA,IACb;AAAA,EACF;AACF,CAAC;AAEM,MAAM,SAAS,wBAAO,mBAAO;AAAA,EAClC,eAAe;AAAA,EACf,MAAM;AAAA,EACN,UAAU;AAAA,IACR,YAAY;AAAA,MACV,MAAM;AAAA,IACR;AAAA,IACA,WAAW;AAAA,MACT,WAAW;AAAA,IACb;AAAA,EACF;AACF,CAAC;AAEM,MAAM,SAAS,wBACpB,QACA;AAAA,EACE,MAAM;AAAA,EACN,UAAU;AACZ,GACA;AAAA,EACE,cAAc;AAAA,EACd,UAAU;AACZ,CACF;AAEO,MAAM,oBAAoB,wBAC/B,KACA,EAAE,OAAO,aACN;AACH,QAAM,MACJ,QAAQ,QACJ,IACA,QAAQ,OAEP,OAAM;AACL,UAAM,OAAM,kCAAiB,OAAO,KAAK,OAAO;AAChD,QAAI,OAAO,SAAQ,UAAU;AAC3B,aAAO;AAAA,IACT;AACA,WAAO;AAAA,EACT,GAAG,IACH,CAAC;AACP,QAAM,CAAC,QAAQ,gBAAgB,CAAC,KAAK,MAAM,MAAM,IAAI,CAAC,GAAG,KAAK,MAAM,MAAM,IAAI,CAAC,CAAC;AAChF,QAAM,SAAS;AAAA,IACb,aAAa,MAAM;AAAA,IACnB;AAAA,IACA,cAAc,EAAE,QAAQ,OAAO,EAAE;AAAA,EACnC;AACA,SAAO;AACT,GAxBiC;",
4
+ "sourcesContent": ["import {\n GetProps,\n SizeTokens,\n SizeVariantSpreadFunction,\n Stack,\n StackProps,\n VariantSpreadExtras,\n getVariableValue,\n isVariable,\n styled,\n} from '@tamagui/core'\n\nexport type YStackProps = GetProps<typeof YStack>\nexport type XStackProps = YStackProps\nexport type ZStackProps = YStackProps\n\nexport const getElevation: SizeVariantSpreadFunction<StackProps> = (size, extras) => {\n if (!size) return\n const { tokens } = extras\n const token = tokens.size[size]\n const sizeNum = (isVariable(token) ? +token.val : size) as number\n return getSizedElevation(sizeNum, extras)\n}\n\nconst fullscreenStyle = {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n} as const\n\nconst variants = {\n fullscreen: {\n true: fullscreenStyle,\n },\n elevation: {\n '...size': getElevation,\n },\n} as const\n\nexport const YStack = styled(Stack, {\n flexDirection: 'column',\n name: 'YStack',\n variants,\n})\n\nexport const XStack = styled(Stack, {\n flexDirection: 'row',\n name: 'XStack',\n variants,\n})\n\nexport const ZStack = styled(\n YStack,\n {\n name: 'ZStack',\n position: 'relative',\n },\n {\n neverFlatten: true,\n isZStack: true,\n }\n)\n\nexport const getSizedElevation = (\n val: SizeTokens | number | boolean,\n { theme, tokens }: VariantSpreadExtras<any>\n) => {\n let num = 0\n if (val === true) {\n const val = getVariableValue(tokens.size['true'])\n if (typeof val === 'number') {\n num = val\n } else {\n num = 10\n }\n } else {\n num = +val\n }\n if (process.env.NODE_ENV === 'development') {\n if (isNaN(num)) console.warn('NaN shadow', num, val)\n }\n const [height, shadowRadius] = [Math.round(num / 4 + 1), Math.round(num / 2 + 2)]\n const shadow = {\n shadowColor: theme.shadowColor,\n shadowRadius,\n shadowOffset: { height, width: 0 },\n }\n return shadow\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAUO;AAMA,MAAM,eAAsD,CAAC,MAAM,WAAW;AACnF,MAAI,CAAC;AAAM;AACX,QAAM,EAAE,WAAW;AACnB,QAAM,QAAQ,OAAO,KAAK;AAC1B,QAAM,UAAW,4BAAW,KAAK,IAAI,CAAC,MAAM,MAAM;AAClD,SAAO,kBAAkB,SAAS,MAAM;AAC1C;AAEA,MAAM,kBAAkB;AAAA,EACtB,UAAU;AAAA,EACV,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AACV;AAEA,MAAM,WAAW;AAAA,EACf,YAAY;AAAA,IACV,MAAM;AAAA,EACR;AAAA,EACA,WAAW;AAAA,IACT,WAAW;AAAA,EACb;AACF;AAEO,MAAM,SAAS,wBAAO,mBAAO;AAAA,EAClC,eAAe;AAAA,EACf,MAAM;AAAA,EACN;AACF,CAAC;AAEM,MAAM,SAAS,wBAAO,mBAAO;AAAA,EAClC,eAAe;AAAA,EACf,MAAM;AAAA,EACN;AACF,CAAC;AAEM,MAAM,SAAS,wBACpB,QACA;AAAA,EACE,MAAM;AAAA,EACN,UAAU;AACZ,GACA;AAAA,EACE,cAAc;AAAA,EACd,UAAU;AACZ,CACF;AAEO,MAAM,oBAAoB,CAC/B,KACA,EAAE,OAAO,aACN;AACH,MAAI,MAAM;AACV,MAAI,QAAQ,MAAM;AAChB,UAAM,OAAM,kCAAiB,OAAO,KAAK,OAAO;AAChD,QAAI,OAAO,SAAQ,UAAU;AAC3B,YAAM;AAAA,IACR,OAAO;AACL,YAAM;AAAA,IACR;AAAA,EACF,OAAO;AACL,UAAM,CAAC;AAAA,EACT;AACA,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,MAAM,GAAG;AAAG,cAAQ,KAAK,cAAc,KAAK,GAAG;AAAA,EACrD;AACA,QAAM,CAAC,QAAQ,gBAAgB,CAAC,KAAK,MAAM,MAAM,IAAI,CAAC,GAAG,KAAK,MAAM,MAAM,IAAI,CAAC,CAAC;AAChF,QAAM,SAAS;AAAA,IACb,aAAa,MAAM;AAAA,IACnB;AAAA,IACA,cAAc,EAAE,QAAQ,OAAO,EAAE;AAAA,EACnC;AACA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,70 @@
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 ThemeableSizableStack_exports = {};
19
+ __export(ThemeableSizableStack_exports, {
20
+ ThemeableSizableStack: () => ThemeableSizableStack
21
+ });
22
+ module.exports = __toCommonJS(ThemeableSizableStack_exports);
23
+ var import_core = require("@tamagui/core");
24
+ var import_Stacks = require("./Stacks");
25
+ var import_variants = require("./variants");
26
+ const ThemeableSizableStack = (0, import_core.styled)(import_Stacks.YStack, {
27
+ name: "SizableStack",
28
+ backgroundColor: "$background",
29
+ flexDirection: "row",
30
+ flexShrink: 1,
31
+ variants: {
32
+ fontFamily: () => ({}),
33
+ hoverable: import_variants.hoverable,
34
+ pressable: import_variants.pressable,
35
+ focusable: import_variants.focusable,
36
+ circular: import_variants.circular,
37
+ pad: import_variants.pad,
38
+ elevate: import_variants.elevate,
39
+ bordered: import_variants.bordered,
40
+ size: {
41
+ "...size": import_core.getButtonSize
42
+ },
43
+ disabled: {
44
+ true: {
45
+ opacity: 0.45,
46
+ backgroundColor: "$background",
47
+ hoverStyle: {
48
+ backgroundColor: "$background"
49
+ }
50
+ }
51
+ },
52
+ transparent: {
53
+ true: {
54
+ backgroundColor: "transparent"
55
+ }
56
+ },
57
+ chromeless: {
58
+ true: {
59
+ backgroundColor: "transparent",
60
+ borderColor: "transparent",
61
+ shadowColor: "transparent"
62
+ }
63
+ }
64
+ }
65
+ });
66
+ // Annotate the CommonJS export names for ESM import in node:
67
+ 0 && (module.exports = {
68
+ ThemeableSizableStack
69
+ });
70
+ //# sourceMappingURL=ThemeableSizableStack.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/ThemeableSizableStack.tsx"],
4
+ "sourcesContent": ["import { GetProps, getButtonSize, styled } from '@tamagui/core'\n\nimport { YStack } from './Stacks'\nimport { bordered, circular, elevate, focusable, hoverable, pad, pressable } from './variants'\n\nexport const ThemeableSizableStack = styled(YStack, {\n name: 'SizableStack',\n backgroundColor: '$background',\n flexDirection: 'row',\n flexShrink: 1,\n\n variants: {\n // allows the type to come in for use in size\n fontFamily: () => ({}),\n\n hoverable,\n pressable,\n focusable,\n circular,\n pad,\n elevate,\n bordered,\n\n size: {\n '...size': getButtonSize,\n },\n\n disabled: {\n true: {\n // pointerEvents: 'none',\n opacity: 0.45,\n backgroundColor: '$background',\n hoverStyle: {\n backgroundColor: '$background',\n },\n },\n },\n\n transparent: {\n true: {\n backgroundColor: 'transparent',\n },\n },\n\n chromeless: {\n true: {\n backgroundColor: 'transparent',\n borderColor: 'transparent',\n shadowColor: 'transparent',\n },\n },\n },\n})\n\nexport type ThemeableSizableStackProps = GetProps<typeof ThemeableSizableStack>\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAgD;AAEhD,oBAAuB;AACvB,sBAAkF;AAE3E,MAAM,wBAAwB,wBAAO,sBAAQ;AAAA,EAClD,MAAM;AAAA,EACN,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,YAAY;AAAA,EAEZ,UAAU;AAAA,IAER,YAAY,MAAO,EAAC;AAAA,IAEpB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAEA,MAAM;AAAA,MACJ,WAAW;AAAA,IACb;AAAA,IAEA,UAAU;AAAA,MACR,MAAM;AAAA,QAEJ,SAAS;AAAA,QACT,iBAAiB;AAAA,QACjB,YAAY;AAAA,UACV,iBAAiB;AAAA,QACnB;AAAA,MACF;AAAA,IACF;AAAA,IAEA,aAAa;AAAA,MACX,MAAM;AAAA,QACJ,iBAAiB;AAAA,MACnB;AAAA,IACF;AAAA,IAEA,YAAY;AAAA,MACV,MAAM;AAAA,QACJ,iBAAiB;AAAA,QACjB,aAAa;AAAA,QACb,aAAa;AAAA,MACf;AAAA,IACF;AAAA,EACF;AACF,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,61 @@
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 ThemeableStack_exports = {};
19
+ __export(ThemeableStack_exports, {
20
+ ThemeableStack: () => ThemeableStack
21
+ });
22
+ module.exports = __toCommonJS(ThemeableStack_exports);
23
+ var import_core = require("@tamagui/core");
24
+ var import_Stacks = require("./Stacks");
25
+ var import_variants = require("./variants");
26
+ const ThemeableStack = (0, import_core.styled)(import_Stacks.YStack, {
27
+ name: "SizableStack",
28
+ variants: {
29
+ fontFamily: () => ({}),
30
+ backgrounded: {
31
+ true: {
32
+ backgroundColor: "$background"
33
+ }
34
+ },
35
+ radiused: import_variants.radiused,
36
+ hoverTheme: import_variants.hoverTheme,
37
+ pressTheme: import_variants.pressTheme,
38
+ focusTheme: import_variants.focusTheme,
39
+ circular: import_variants.circular,
40
+ padded: import_variants.padded,
41
+ elevate: import_variants.elevate,
42
+ bordered: import_variants.bordered,
43
+ transparent: {
44
+ true: {
45
+ backgroundColor: "transparent"
46
+ }
47
+ },
48
+ chromeless: {
49
+ true: {
50
+ backgroundColor: "transparent",
51
+ borderColor: "transparent",
52
+ shadowColor: "transparent"
53
+ }
54
+ }
55
+ }
56
+ });
57
+ // Annotate the CommonJS export names for ESM import in node:
58
+ 0 && (module.exports = {
59
+ ThemeableStack
60
+ });
61
+ //# sourceMappingURL=ThemeableStack.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/ThemeableStack.tsx"],
4
+ "sourcesContent": ["import { GetProps, styled } from '@tamagui/core'\n\nimport { YStack } from './Stacks'\nimport {\n bordered,\n circular,\n elevate,\n focusTheme,\n hoverTheme,\n padded,\n pressTheme,\n radiused,\n} from './variants'\n\nexport const ThemeableStack = styled(YStack, {\n name: 'SizableStack',\n\n variants: {\n // allows the type to come in for use in size\n fontFamily: () => ({}),\n\n backgrounded: {\n true: {\n backgroundColor: '$background',\n },\n },\n\n radiused,\n hoverTheme,\n pressTheme,\n focusTheme,\n circular,\n padded,\n elevate,\n bordered,\n\n transparent: {\n true: {\n backgroundColor: 'transparent',\n },\n },\n\n chromeless: {\n true: {\n backgroundColor: 'transparent',\n borderColor: 'transparent',\n shadowColor: 'transparent',\n },\n },\n },\n})\n\nexport type ThemeableStackProps = GetProps<typeof ThemeableStack>\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiC;AAEjC,oBAAuB;AACvB,sBASO;AAEA,MAAM,iBAAiB,wBAAO,sBAAQ;AAAA,EAC3C,MAAM;AAAA,EAEN,UAAU;AAAA,IAER,YAAY,MAAO,EAAC;AAAA,IAEpB,cAAc;AAAA,MACZ,MAAM;AAAA,QACJ,iBAAiB;AAAA,MACnB;AAAA,IACF;AAAA,IAEA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAEA,aAAa;AAAA,MACX,MAAM;AAAA,QACJ,iBAAiB;AAAA,MACnB;AAAA,IACF;AAAA,IAEA,YAAY;AAAA,MACV,MAAM;AAAA,QACJ,iBAAiB;AAAA,QACjB,aAAa;AAAA,QACb,aAAa;AAAA,MACf;AAAA,IACF;AAAA,EACF;AACF,CAAC;",
6
+ "names": []
7
+ }
package/dist/cjs/index.js CHANGED
@@ -16,4 +16,5 @@ var src_exports = {};
16
16
  module.exports = __toCommonJS(src_exports);
17
17
  __reExport(src_exports, require("./Stacks"), module.exports);
18
18
  __reExport(src_exports, require("./SizableStack"), module.exports);
19
+ __reExport(src_exports, require("./ThemeableStack"), module.exports);
19
20
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "sourcesContent": ["export * from './Stacks'\nexport * from './SizableStack'\n"],
5
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,qBAAd;AACA,wBAAc,2BADd;",
4
+ "sourcesContent": ["export * from './Stacks'\nexport * from './SizableStack'\nexport * from './ThemeableStack'\n"],
5
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,qBAAd;AACA,wBAAc,2BADd;AAEA,wBAAc,6BAFd;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,138 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __export = (target, all) => {
20
+ for (var name in all)
21
+ __defProp(target, name, { get: all[name], enumerable: true });
22
+ };
23
+ var __copyProps = (to, from, except, desc) => {
24
+ if (from && typeof from === "object" || typeof from === "function") {
25
+ for (let key of __getOwnPropNames(from))
26
+ if (!__hasOwnProp.call(to, key) && key !== except)
27
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
28
+ }
29
+ return to;
30
+ };
31
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
+ var variants_exports = {};
33
+ __export(variants_exports, {
34
+ bordered: () => bordered,
35
+ circular: () => circular,
36
+ elevate: () => elevate,
37
+ focusTheme: () => focusTheme,
38
+ hoverTheme: () => hoverTheme,
39
+ padded: () => padded,
40
+ pressTheme: () => pressTheme,
41
+ radiused: () => radiused
42
+ });
43
+ module.exports = __toCommonJS(variants_exports);
44
+ var import_Stacks = require("./Stacks");
45
+ const elevate = {
46
+ true: (_, extras) => {
47
+ return (0, import_Stacks.getElevation)(extras.props["size"], extras);
48
+ }
49
+ };
50
+ const bordered = (val, { props }) => {
51
+ return __spreadValues(__spreadValues(__spreadValues({
52
+ borderWidth: typeof val === "number" ? val : 1,
53
+ borderColor: "$borderColor"
54
+ }, props.hoverTheme && {
55
+ hoverStyle: {
56
+ borderColor: "$borderColorHover"
57
+ }
58
+ }), props.pressTheme && {
59
+ pressStyle: {
60
+ borderColor: "$borderColorPress"
61
+ }
62
+ }), props.focusTheme && {
63
+ focusStyle: {
64
+ borderColor: "$borderColorFocus"
65
+ }
66
+ });
67
+ };
68
+ const padded = {
69
+ true: (_, extras) => {
70
+ const { tokens, props } = extras;
71
+ return {
72
+ padding: tokens.space[props.size] || tokens.space["$4"]
73
+ };
74
+ }
75
+ };
76
+ const radiused = {
77
+ true: (_, extras) => {
78
+ const { tokens, props } = extras;
79
+ return {
80
+ borderRadius: tokens.radius[props.size] || tokens.radius["$4"]
81
+ };
82
+ }
83
+ };
84
+ const circular = {
85
+ true: (_, { props, tokens }) => {
86
+ const size = tokens.size[props.size];
87
+ return {
88
+ width: size,
89
+ height: size,
90
+ maxWidth: size,
91
+ maxHeight: size,
92
+ minWidth: size,
93
+ minHeight: size,
94
+ borderRadius: 1e5,
95
+ paddingVertical: 0,
96
+ paddingHorizontal: 0
97
+ };
98
+ }
99
+ };
100
+ const hoverTheme = {
101
+ true: {
102
+ hoverStyle: {
103
+ backgroundColor: "$backgroundHover",
104
+ borderColor: "$borderColorHover"
105
+ }
106
+ },
107
+ false: {}
108
+ };
109
+ const pressTheme = {
110
+ true: {
111
+ pressStyle: {
112
+ backgroundColor: "$backgroundPress",
113
+ borderColor: "$borderColorPress"
114
+ }
115
+ },
116
+ false: {}
117
+ };
118
+ const focusTheme = {
119
+ true: {
120
+ focusStyle: {
121
+ backgroundColor: "$backgroundFocus",
122
+ borderColor: "$borderColorFocus"
123
+ }
124
+ },
125
+ false: {}
126
+ };
127
+ // Annotate the CommonJS export names for ESM import in node:
128
+ 0 && (module.exports = {
129
+ bordered,
130
+ circular,
131
+ elevate,
132
+ focusTheme,
133
+ hoverTheme,
134
+ padded,
135
+ pressTheme,
136
+ radiused
137
+ });
138
+ //# sourceMappingURL=variants.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/variants.tsx"],
4
+ "sourcesContent": ["import { getElevation } from './Stacks'\n\nexport const elevate = {\n true: (_: boolean, extras: any) => {\n return getElevation(extras.props['size'], extras)\n },\n}\n\nexport const bordered = (val: boolean | number, { props }) => {\n return {\n // TODO size it with size in '...size'\n borderWidth: typeof val === 'number' ? val : 1,\n borderColor: '$borderColor',\n\n ...(props.hoverTheme && {\n hoverStyle: {\n borderColor: '$borderColorHover',\n },\n }),\n\n ...(props.pressTheme && {\n pressStyle: {\n borderColor: '$borderColorPress',\n },\n }),\n\n ...(props.focusTheme && {\n focusStyle: {\n borderColor: '$borderColorFocus',\n },\n }),\n }\n}\n\nexport const padded = {\n true: (_, extras) => {\n const { tokens, props } = extras\n return {\n padding: tokens.space[props.size] || tokens.space['$4'],\n }\n },\n}\n\nexport const radiused = {\n true: (_, extras) => {\n const { tokens, props } = extras\n return {\n borderRadius: tokens.radius[props.size] || tokens.radius['$4'],\n }\n },\n}\n\nexport const circular = {\n true: (_, { props, tokens }) => {\n const size = tokens.size[props.size]\n return {\n width: size,\n height: size,\n maxWidth: size,\n maxHeight: size,\n minWidth: size,\n minHeight: size,\n borderRadius: 100_000,\n paddingVertical: 0,\n paddingHorizontal: 0,\n }\n },\n}\n\nexport const hoverTheme = {\n true: {\n hoverStyle: {\n backgroundColor: '$backgroundHover',\n borderColor: '$borderColorHover',\n },\n },\n false: {},\n}\n\nexport const pressTheme = {\n true: {\n pressStyle: {\n backgroundColor: '$backgroundPress',\n borderColor: '$borderColorPress',\n },\n },\n false: {},\n}\n\nexport const focusTheme = {\n true: {\n focusStyle: {\n backgroundColor: '$backgroundFocus',\n borderColor: '$borderColorFocus',\n },\n },\n false: {},\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA6B;AAEtB,MAAM,UAAU;AAAA,EACrB,MAAM,CAAC,GAAY,WAAgB;AACjC,WAAO,gCAAa,OAAO,MAAM,SAAS,MAAM;AAAA,EAClD;AACF;AAEO,MAAM,WAAW,CAAC,KAAuB,EAAE,YAAY;AAC5D,SAAO;AAAA,IAEL,aAAa,OAAO,QAAQ,WAAW,MAAM;AAAA,IAC7C,aAAa;AAAA,KAET,MAAM,cAAc;AAAA,IACtB,YAAY;AAAA,MACV,aAAa;AAAA,IACf;AAAA,EACF,IAEI,MAAM,cAAc;AAAA,IACtB,YAAY;AAAA,MACV,aAAa;AAAA,IACf;AAAA,EACF,IAEI,MAAM,cAAc;AAAA,IACtB,YAAY;AAAA,MACV,aAAa;AAAA,IACf;AAAA,EACF;AAEJ;AAEO,MAAM,SAAS;AAAA,EACpB,MAAM,CAAC,GAAG,WAAW;AACnB,UAAM,EAAE,QAAQ,UAAU;AAC1B,WAAO;AAAA,MACL,SAAS,OAAO,MAAM,MAAM,SAAS,OAAO,MAAM;AAAA,IACpD;AAAA,EACF;AACF;AAEO,MAAM,WAAW;AAAA,EACtB,MAAM,CAAC,GAAG,WAAW;AACnB,UAAM,EAAE,QAAQ,UAAU;AAC1B,WAAO;AAAA,MACL,cAAc,OAAO,OAAO,MAAM,SAAS,OAAO,OAAO;AAAA,IAC3D;AAAA,EACF;AACF;AAEO,MAAM,WAAW;AAAA,EACtB,MAAM,CAAC,GAAG,EAAE,OAAO,aAAa;AAC9B,UAAM,OAAO,OAAO,KAAK,MAAM;AAC/B,WAAO;AAAA,MACL,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,WAAW;AAAA,MACX,UAAU;AAAA,MACV,WAAW;AAAA,MACX,cAAc;AAAA,MACd,iBAAiB;AAAA,MACjB,mBAAmB;AAAA,IACrB;AAAA,EACF;AACF;AAEO,MAAM,aAAa;AAAA,EACxB,MAAM;AAAA,IACJ,YAAY;AAAA,MACV,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACf;AAAA,EACF;AAAA,EACA,OAAO,CAAC;AACV;AAEO,MAAM,aAAa;AAAA,EACxB,MAAM;AAAA,IACJ,YAAY;AAAA,MACV,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACf;AAAA,EACF;AAAA,EACA,OAAO,CAAC;AACV;AAEO,MAAM,aAAa;AAAA,EACxB,MAAM;AAAA,IACJ,YAAY;AAAA,MACV,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACf;AAAA,EACF;AAAA,EACA,OAAO,CAAC;AACV;",
6
+ "names": []
7
+ }
@@ -1,77 +1,21 @@
1
1
  import { getButtonSize, styled } from "@tamagui/core";
2
- import { XStack } from "./Stacks";
3
- const SizableStack = styled(XStack, {
2
+ import { YStack } from "./Stacks";
3
+ import { bordered, circular, elevate, focusTheme, hoverTheme, pressTheme } from "./variants";
4
+ const SizableStack = styled(YStack, {
4
5
  name: "SizableStack",
5
6
  backgroundColor: "$background",
6
7
  flexDirection: "row",
7
8
  flexShrink: 1,
8
9
  variants: {
9
10
  fontFamily: () => ({}),
10
- hoverable: {
11
- true: {
12
- hoverStyle: {
13
- backgroundColor: "$backgroundHover",
14
- borderColor: "$borderColorHover"
15
- }
16
- },
17
- false: {
18
- hoverStyle: {
19
- backgroundColor: "$background",
20
- borderColor: "$borderColor"
21
- }
22
- }
23
- },
24
- pressable: {
25
- true: {
26
- pressStyle: {
27
- backgroundColor: "$backgroundPress",
28
- borderColor: "$borderColorPress"
29
- }
30
- },
31
- false: {
32
- pressStyle: {
33
- backgroundColor: "$background",
34
- borderColor: "$borderColor"
35
- }
36
- }
37
- },
38
- focusable: {
39
- true: {
40
- focusStyle: {
41
- backgroundColor: "$backgroundFocus",
42
- borderColor: "$borderColorFocus"
43
- }
44
- }
45
- },
46
- bordered: {
47
- true: {
48
- borderWidth: 1,
49
- borderColor: "$borderColor"
50
- }
51
- },
11
+ hoverTheme,
12
+ pressTheme,
13
+ focusTheme,
14
+ circular,
15
+ elevate,
16
+ bordered,
52
17
  size: {
53
- "...size": getButtonSize()
54
- },
55
- disabled: {
56
- true: {
57
- opacity: 0.45,
58
- backgroundColor: "$background",
59
- hoverStyle: {
60
- backgroundColor: "$background"
61
- }
62
- }
63
- },
64
- transparent: {
65
- true: {
66
- backgroundColor: "transparent"
67
- }
68
- },
69
- chromeless: {
70
- true: {
71
- backgroundColor: "transparent",
72
- borderColor: "transparent",
73
- shadowColor: "transparent"
74
- }
18
+ "...size": getButtonSize
75
19
  }
76
20
  }
77
21
  });