@tamagui/stacks 1.0.1-beta.29 → 1.0.1-beta.32

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.
@@ -34,6 +34,7 @@ const ThemeableSizableStack = (0, import_core.styled)(import_Stacks.YStack, {
34
34
  pressable: import_variants.pressable,
35
35
  focusable: import_variants.focusable,
36
36
  circular: import_variants.circular,
37
+ pad: import_variants.pad,
37
38
  elevate: import_variants.elevate,
38
39
  bordered: import_variants.bordered,
39
40
  size: {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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, 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 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,sBAA6E;AAEtE,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,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;",
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
6
  "names": []
7
7
  }
@@ -1 +1,65 @@
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
+ 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
+ transparent: {
41
+ true: {
42
+ backgroundColor: "transparent"
43
+ }
44
+ },
45
+ chromeless: {
46
+ true: {
47
+ backgroundColor: "transparent",
48
+ borderColor: "transparent",
49
+ shadowColor: "transparent"
50
+ }
51
+ }
52
+ }
53
+ });
54
+ const Test = (0, import_core.styled)(ThemeableStack, {
55
+ variants: {
56
+ something: {
57
+ true: {}
58
+ }
59
+ }
60
+ });
61
+ // Annotate the CommonJS export names for ESM import in node:
62
+ 0 && (module.exports = {
63
+ ThemeableStack
64
+ });
1
65
  //# sourceMappingURL=ThemeableStack.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
3
+ "sources": ["../../src/ThemeableStack.tsx"],
4
+ "sourcesContent": ["import { GetProps, styled } from '@tamagui/core'\n\nimport { YStack } from './Stacks'\nimport { bordered, circular, elevate, focusable, hoverable, pad, pressable } from './variants'\n\nexport const ThemeableStack = 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 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\nconst Test = styled(ThemeableStack, {\n variants: {\n something: {\n true: {},\n },\n },\n})\n\ntype T = GetProps<typeof Test>\ntype x = T['chromeless']\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiC;AAEjC,oBAAuB;AACvB,sBAAkF;AAE3E,MAAM,iBAAiB,wBAAO,sBAAQ;AAAA,EAC3C,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,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;AAID,MAAM,OAAO,wBAAO,gBAAgB;AAAA,EAClC,UAAU;AAAA,IACR,WAAW;AAAA,MACT,MAAM,CAAC;AAAA,IACT;AAAA,EACF;AACF,CAAC;",
6
6
  "names": []
7
7
  }
package/dist/cjs/index.js CHANGED
@@ -23,7 +23,7 @@ __export(src_exports, {
23
23
  module.exports = __toCommonJS(src_exports);
24
24
  __reExport(src_exports, require("./Stacks"), module.exports);
25
25
  __reExport(src_exports, require("./SizableStack"), module.exports);
26
- __reExport(src_exports, require("./ThemeableSizableStack"), module.exports);
26
+ __reExport(src_exports, require("./ThemeableStack"), module.exports);
27
27
  var import_variants = require("./variants");
28
28
  // Annotate the CommonJS export names for ESM import in node:
29
29
  0 && (module.exports = {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "sourcesContent": ["export * from './Stacks'\nexport * from './SizableStack'\nexport * from './ThemeableSizableStack'\nexport { getCircleSize } from './variants'\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAc,qBAAd;AACA,wBAAc,2BADd;AAEA,wBAAc,oCAFd;AAGA,sBAA8B;",
4
+ "sourcesContent": ["export * from './Stacks'\nexport * from './SizableStack'\nexport * from './ThemeableStack'\nexport { getCircleSize } from './variants'\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAc,qBAAd;AACA,wBAAc,2BADd;AAEA,wBAAc,6BAFd;AAGA,sBAA8B;",
6
6
  "names": []
7
7
  }
@@ -38,6 +38,7 @@ __export(variants_exports, {
38
38
  focusable: () => focusable,
39
39
  getCircleSize: () => getCircleSize,
40
40
  hoverable: () => hoverable,
41
+ pad: () => pad,
41
42
  pressable: () => pressable
42
43
  });
43
44
  module.exports = __toCommonJS(variants_exports);
@@ -72,6 +73,14 @@ const bordered = /* @__PURE__ */ __name((val, { props }) => {
72
73
  }
73
74
  });
74
75
  }, "bordered");
76
+ const pad = {
77
+ true: (_, extras) => {
78
+ const { tokens, props } = extras;
79
+ return {
80
+ padding: tokens.size[props.size] || tokens.size["$4"]
81
+ };
82
+ }
83
+ };
75
84
  const circular = {
76
85
  true: (_, extras) => {
77
86
  const { props } = extras;
@@ -139,6 +148,7 @@ const focusable = {
139
148
  focusable,
140
149
  getCircleSize,
141
150
  hoverable,
151
+ pad,
142
152
  pressable
143
153
  });
144
154
  //# sourceMappingURL=variants.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/variants.tsx"],
4
- "sourcesContent": ["import { ScaleVariantExtras, SizeTokens, buttonScaling, getSizeScaledToFont } from '@tamagui/core'\n\nimport { getElevation } from './Stacks'\n\nexport function getCircleSize(size: SizeTokens, extras: ScaleVariantExtras) {\n const sizeVal = size ?? '$4'\n const scale = getSizeScaledToFont(sizeVal, buttonScaling, extras)\n return scale.minHeight\n}\n\nexport const elevate = {\n true: (_, extras) => {\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.hoverable && {\n hoverStyle: {\n borderColor: '$borderColorHover',\n },\n }),\n\n ...(props.pressable && {\n pressStyle: {\n borderColor: '$borderColorPress',\n },\n }),\n\n ...(props.focusable && {\n focusStyle: {\n borderColor: '$borderColorFocus',\n },\n }),\n }\n}\n\nexport const circular = {\n true: (_, extras) => {\n const { props } = extras\n const size = getCircleSize(props.size, extras)\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 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\nexport const 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\nexport const focusable = {\n true: {\n focusStyle: {\n backgroundColor: '$backgroundFocus',\n borderColor: '$borderColorFocus',\n },\n },\n false: {\n focusStyle: {\n backgroundColor: '$background',\n borderColor: '$borderColor',\n },\n },\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmF;AAEnF,oBAA6B;AAEtB,uBAAuB,MAAkB,QAA4B;AAC1E,QAAM,UAAU,QAAQ;AACxB,QAAM,QAAQ,qCAAoB,SAAS,2BAAe,MAAM;AAChE,SAAO,MAAM;AACf;AAJgB;AAMT,MAAM,UAAU;AAAA,EACrB,MAAM,CAAC,GAAG,WAAW;AACnB,WAAO,gCAAa,OAAO,MAAM,SAAS,MAAM;AAAA,EAClD;AACF;AAEO,MAAM,WAAW,wBAAC,KAAuB,EAAE,YAAY;AAC5D,SAAO;AAAA,IAEL,aAAa,OAAO,QAAQ,WAAW,MAAM;AAAA,IAC7C,aAAa;AAAA,KAET,MAAM,aAAa;AAAA,IACrB,YAAY;AAAA,MACV,aAAa;AAAA,IACf;AAAA,EACF,IAEI,MAAM,aAAa;AAAA,IACrB,YAAY;AAAA,MACV,aAAa;AAAA,IACf;AAAA,EACF,IAEI,MAAM,aAAa;AAAA,IACrB,YAAY;AAAA,MACV,aAAa;AAAA,IACf;AAAA,EACF;AAEJ,GAxBwB;AA0BjB,MAAM,WAAW;AAAA,EACtB,MAAM,CAAC,GAAG,WAAW;AACnB,UAAM,EAAE,UAAU;AAClB,UAAM,OAAO,cAAc,MAAM,MAAM,MAAM;AAC7C,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,YAAY;AAAA,EACvB,MAAM;AAAA,IACJ,YAAY;AAAA,MACV,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACf;AAAA,EACF;AAAA,EACA,OAAO;AAAA,IACL,YAAY;AAAA,MACV,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACf;AAAA,EACF;AACF;AAEO,MAAM,YAAY;AAAA,EACvB,MAAM;AAAA,IACJ,YAAY;AAAA,MACV,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACf;AAAA,EACF;AAAA,EACA,OAAO;AAAA,IACL,YAAY;AAAA,MACV,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACf;AAAA,EACF;AACF;AAEO,MAAM,YAAY;AAAA,EACvB,MAAM;AAAA,IACJ,YAAY;AAAA,MACV,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACf;AAAA,EACF;AAAA,EACA,OAAO;AAAA,IACL,YAAY;AAAA,MACV,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACf;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import { ScaleVariantExtras, SizeTokens, buttonScaling, getSizeScaledToFont } from '@tamagui/core'\n\nimport { getElevation } from './Stacks'\n\nexport function getCircleSize(size: SizeTokens, extras: ScaleVariantExtras) {\n const sizeVal = size ?? '$4'\n const scale = getSizeScaledToFont(sizeVal, buttonScaling, extras)\n return scale.minHeight\n}\n\nexport const elevate = {\n true: (_, extras) => {\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.hoverable && {\n hoverStyle: {\n borderColor: '$borderColorHover',\n },\n }),\n\n ...(props.pressable && {\n pressStyle: {\n borderColor: '$borderColorPress',\n },\n }),\n\n ...(props.focusable && {\n focusStyle: {\n borderColor: '$borderColorFocus',\n },\n }),\n }\n}\n\nexport const pad = {\n true: (_, extras) => {\n const { tokens, props } = extras\n return {\n padding: tokens.size[props.size] || tokens.size['$4'],\n }\n },\n}\n\nexport const circular = {\n true: (_, extras) => {\n const { props } = extras\n const size = getCircleSize(props.size, extras)\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 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\nexport const 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\nexport const focusable = {\n true: {\n focusStyle: {\n backgroundColor: '$backgroundFocus',\n borderColor: '$borderColorFocus',\n },\n },\n false: {\n focusStyle: {\n backgroundColor: '$background',\n borderColor: '$borderColor',\n },\n },\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmF;AAEnF,oBAA6B;AAEtB,uBAAuB,MAAkB,QAA4B;AAC1E,QAAM,UAAU,QAAQ;AACxB,QAAM,QAAQ,qCAAoB,SAAS,2BAAe,MAAM;AAChE,SAAO,MAAM;AACf;AAJgB;AAMT,MAAM,UAAU;AAAA,EACrB,MAAM,CAAC,GAAG,WAAW;AACnB,WAAO,gCAAa,OAAO,MAAM,SAAS,MAAM;AAAA,EAClD;AACF;AAEO,MAAM,WAAW,wBAAC,KAAuB,EAAE,YAAY;AAC5D,SAAO;AAAA,IAEL,aAAa,OAAO,QAAQ,WAAW,MAAM;AAAA,IAC7C,aAAa;AAAA,KAET,MAAM,aAAa;AAAA,IACrB,YAAY;AAAA,MACV,aAAa;AAAA,IACf;AAAA,EACF,IAEI,MAAM,aAAa;AAAA,IACrB,YAAY;AAAA,MACV,aAAa;AAAA,IACf;AAAA,EACF,IAEI,MAAM,aAAa;AAAA,IACrB,YAAY;AAAA,MACV,aAAa;AAAA,IACf;AAAA,EACF;AAEJ,GAxBwB;AA0BjB,MAAM,MAAM;AAAA,EACjB,MAAM,CAAC,GAAG,WAAW;AACnB,UAAM,EAAE,QAAQ,UAAU;AAC1B,WAAO;AAAA,MACL,SAAS,OAAO,KAAK,MAAM,SAAS,OAAO,KAAK;AAAA,IAClD;AAAA,EACF;AACF;AAEO,MAAM,WAAW;AAAA,EACtB,MAAM,CAAC,GAAG,WAAW;AACnB,UAAM,EAAE,UAAU;AAClB,UAAM,OAAO,cAAc,MAAM,MAAM,MAAM;AAC7C,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,YAAY;AAAA,EACvB,MAAM;AAAA,IACJ,YAAY;AAAA,MACV,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACf;AAAA,EACF;AAAA,EACA,OAAO;AAAA,IACL,YAAY;AAAA,MACV,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACf;AAAA,EACF;AACF;AAEO,MAAM,YAAY;AAAA,EACvB,MAAM;AAAA,IACJ,YAAY;AAAA,MACV,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACf;AAAA,EACF;AAAA,EACA,OAAO;AAAA,IACL,YAAY;AAAA,MACV,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACf;AAAA,EACF;AACF;AAEO,MAAM,YAAY;AAAA,EACvB,MAAM;AAAA,IACJ,YAAY;AAAA,MACV,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACf;AAAA,EACF;AAAA,EACA,OAAO;AAAA,IACL,YAAY;AAAA,MACV,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACf;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import { getButtonSize, styled } from "@tamagui/core";
2
2
  import { YStack } from "./Stacks";
3
- import { bordered, circular, elevate, focusable, hoverable, pressable } from "./variants";
3
+ import { bordered, circular, elevate, focusable, hoverable, pad, pressable } from "./variants";
4
4
  const ThemeableSizableStack = styled(YStack, {
5
5
  name: "SizableStack",
6
6
  backgroundColor: "$background",
@@ -12,6 +12,7 @@ const ThemeableSizableStack = styled(YStack, {
12
12
  pressable,
13
13
  focusable,
14
14
  circular,
15
+ pad,
15
16
  elevate,
16
17
  bordered,
17
18
  size: {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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, 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 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;AAEA;AACA;AAEO,MAAM,wBAAwB,OAAO,QAAQ;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,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;",
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;AAEA;AACA;AAEO,MAAM,wBAAwB,OAAO,QAAQ;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
6
  "names": []
7
7
  }
@@ -1 +1,42 @@
1
+ import { styled } from "@tamagui/core";
2
+ import { YStack } from "./Stacks";
3
+ import { bordered, circular, elevate, focusable, hoverable, pad, pressable } from "./variants";
4
+ const ThemeableStack = styled(YStack, {
5
+ name: "SizableStack",
6
+ backgroundColor: "$background",
7
+ flexDirection: "row",
8
+ flexShrink: 1,
9
+ variants: {
10
+ fontFamily: () => ({}),
11
+ hoverable,
12
+ pressable,
13
+ focusable,
14
+ circular,
15
+ pad,
16
+ elevate,
17
+ bordered,
18
+ transparent: {
19
+ true: {
20
+ backgroundColor: "transparent"
21
+ }
22
+ },
23
+ chromeless: {
24
+ true: {
25
+ backgroundColor: "transparent",
26
+ borderColor: "transparent",
27
+ shadowColor: "transparent"
28
+ }
29
+ }
30
+ }
31
+ });
32
+ const Test = styled(ThemeableStack, {
33
+ variants: {
34
+ something: {
35
+ true: {}
36
+ }
37
+ }
38
+ });
39
+ export {
40
+ ThemeableStack
41
+ };
1
42
  //# sourceMappingURL=ThemeableStack.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
3
+ "sources": ["../../src/ThemeableStack.tsx"],
4
+ "sourcesContent": ["import { GetProps, styled } from '@tamagui/core'\n\nimport { YStack } from './Stacks'\nimport { bordered, circular, elevate, focusable, hoverable, pad, pressable } from './variants'\n\nexport const ThemeableStack = 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 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\nconst Test = styled(ThemeableStack, {\n variants: {\n something: {\n true: {},\n },\n },\n})\n\ntype T = GetProps<typeof Test>\ntype x = T['chromeless']\n"],
5
+ "mappings": "AAAA;AAEA;AACA;AAEO,MAAM,iBAAiB,OAAO,QAAQ;AAAA,EAC3C,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,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;AAID,MAAM,OAAO,OAAO,gBAAgB;AAAA,EAClC,UAAU;AAAA,IACR,WAAW;AAAA,MACT,MAAM,CAAC;AAAA,IACT;AAAA,EACF;AACF,CAAC;",
6
6
  "names": []
7
7
  }
package/dist/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export * from "./Stacks";
2
2
  export * from "./SizableStack";
3
- export * from "./ThemeableSizableStack";
3
+ export * from "./ThemeableStack";
4
4
  import { getCircleSize } from "./variants";
5
5
  export {
6
6
  getCircleSize
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "sourcesContent": ["export * from './Stacks'\nexport * from './SizableStack'\nexport * from './ThemeableSizableStack'\nexport { getCircleSize } from './variants'\n"],
4
+ "sourcesContent": ["export * from './Stacks'\nexport * from './SizableStack'\nexport * from './ThemeableStack'\nexport { getCircleSize } from './variants'\n"],
5
5
  "mappings": "AAAA;AACA;AACA;AACA;",
6
6
  "names": []
7
7
  }
@@ -34,6 +34,14 @@ const bordered = /* @__PURE__ */ __name((val, { props }) => {
34
34
  }
35
35
  };
36
36
  }, "bordered");
37
+ const pad = {
38
+ true: (_, extras) => {
39
+ const { tokens, props } = extras;
40
+ return {
41
+ padding: tokens.size[props.size] || tokens.size["$4"]
42
+ };
43
+ }
44
+ };
37
45
  const circular = {
38
46
  true: (_, extras) => {
39
47
  const { props } = extras;
@@ -100,6 +108,7 @@ export {
100
108
  focusable,
101
109
  getCircleSize,
102
110
  hoverable,
111
+ pad,
103
112
  pressable
104
113
  };
105
114
  //# sourceMappingURL=variants.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/variants.tsx"],
4
- "sourcesContent": ["import { ScaleVariantExtras, SizeTokens, buttonScaling, getSizeScaledToFont } from '@tamagui/core'\n\nimport { getElevation } from './Stacks'\n\nexport function getCircleSize(size: SizeTokens, extras: ScaleVariantExtras) {\n const sizeVal = size ?? '$4'\n const scale = getSizeScaledToFont(sizeVal, buttonScaling, extras)\n return scale.minHeight\n}\n\nexport const elevate = {\n true: (_, extras) => {\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.hoverable && {\n hoverStyle: {\n borderColor: '$borderColorHover',\n },\n }),\n\n ...(props.pressable && {\n pressStyle: {\n borderColor: '$borderColorPress',\n },\n }),\n\n ...(props.focusable && {\n focusStyle: {\n borderColor: '$borderColorFocus',\n },\n }),\n }\n}\n\nexport const circular = {\n true: (_, extras) => {\n const { props } = extras\n const size = getCircleSize(props.size, extras)\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 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\nexport const 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\nexport const focusable = {\n true: {\n focusStyle: {\n backgroundColor: '$backgroundFocus',\n borderColor: '$borderColorFocus',\n },\n },\n false: {\n focusStyle: {\n backgroundColor: '$background',\n borderColor: '$borderColor',\n },\n },\n}\n"],
5
- "mappings": ";;AAAA;AAEA;AAEO,uBAAuB,MAAkB,QAA4B;AAC1E,QAAM,UAAU,sBAAQ;AACxB,QAAM,QAAQ,oBAAoB,SAAS,eAAe,MAAM;AAChE,SAAO,MAAM;AACf;AAJgB;AAMT,MAAM,UAAU;AAAA,EACrB,MAAM,CAAC,GAAG,WAAW;AACnB,WAAO,aAAa,OAAO,MAAM,SAAS,MAAM;AAAA,EAClD;AACF;AAEO,MAAM,WAAW,wBAAC,KAAuB,EAAE,YAAY;AAC5D,SAAO;AAAA,IAEL,aAAa,OAAO,QAAQ,WAAW,MAAM;AAAA,IAC7C,aAAa;AAAA,OAET,MAAM,aAAa;AAAA,MACrB,YAAY;AAAA,QACV,aAAa;AAAA,MACf;AAAA,IACF;AAAA,OAEI,MAAM,aAAa;AAAA,MACrB,YAAY;AAAA,QACV,aAAa;AAAA,MACf;AAAA,IACF;AAAA,OAEI,MAAM,aAAa;AAAA,MACrB,YAAY;AAAA,QACV,aAAa;AAAA,MACf;AAAA,IACF;AAAA,EACF;AACF,GAxBwB;AA0BjB,MAAM,WAAW;AAAA,EACtB,MAAM,CAAC,GAAG,WAAW;AACnB,UAAM,EAAE,UAAU;AAClB,UAAM,OAAO,cAAc,MAAM,MAAM,MAAM;AAC7C,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,YAAY;AAAA,EACvB,MAAM;AAAA,IACJ,YAAY;AAAA,MACV,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACf;AAAA,EACF;AAAA,EACA,OAAO;AAAA,IACL,YAAY;AAAA,MACV,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACf;AAAA,EACF;AACF;AAEO,MAAM,YAAY;AAAA,EACvB,MAAM;AAAA,IACJ,YAAY;AAAA,MACV,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACf;AAAA,EACF;AAAA,EACA,OAAO;AAAA,IACL,YAAY;AAAA,MACV,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACf;AAAA,EACF;AACF;AAEO,MAAM,YAAY;AAAA,EACvB,MAAM;AAAA,IACJ,YAAY;AAAA,MACV,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACf;AAAA,EACF;AAAA,EACA,OAAO;AAAA,IACL,YAAY;AAAA,MACV,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACf;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import { ScaleVariantExtras, SizeTokens, buttonScaling, getSizeScaledToFont } from '@tamagui/core'\n\nimport { getElevation } from './Stacks'\n\nexport function getCircleSize(size: SizeTokens, extras: ScaleVariantExtras) {\n const sizeVal = size ?? '$4'\n const scale = getSizeScaledToFont(sizeVal, buttonScaling, extras)\n return scale.minHeight\n}\n\nexport const elevate = {\n true: (_, extras) => {\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.hoverable && {\n hoverStyle: {\n borderColor: '$borderColorHover',\n },\n }),\n\n ...(props.pressable && {\n pressStyle: {\n borderColor: '$borderColorPress',\n },\n }),\n\n ...(props.focusable && {\n focusStyle: {\n borderColor: '$borderColorFocus',\n },\n }),\n }\n}\n\nexport const pad = {\n true: (_, extras) => {\n const { tokens, props } = extras\n return {\n padding: tokens.size[props.size] || tokens.size['$4'],\n }\n },\n}\n\nexport const circular = {\n true: (_, extras) => {\n const { props } = extras\n const size = getCircleSize(props.size, extras)\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 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\nexport const 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\nexport const focusable = {\n true: {\n focusStyle: {\n backgroundColor: '$backgroundFocus',\n borderColor: '$borderColorFocus',\n },\n },\n false: {\n focusStyle: {\n backgroundColor: '$background',\n borderColor: '$borderColor',\n },\n },\n}\n"],
5
+ "mappings": ";;AAAA;AAEA;AAEO,uBAAuB,MAAkB,QAA4B;AAC1E,QAAM,UAAU,sBAAQ;AACxB,QAAM,QAAQ,oBAAoB,SAAS,eAAe,MAAM;AAChE,SAAO,MAAM;AACf;AAJgB;AAMT,MAAM,UAAU;AAAA,EACrB,MAAM,CAAC,GAAG,WAAW;AACnB,WAAO,aAAa,OAAO,MAAM,SAAS,MAAM;AAAA,EAClD;AACF;AAEO,MAAM,WAAW,wBAAC,KAAuB,EAAE,YAAY;AAC5D,SAAO;AAAA,IAEL,aAAa,OAAO,QAAQ,WAAW,MAAM;AAAA,IAC7C,aAAa;AAAA,OAET,MAAM,aAAa;AAAA,MACrB,YAAY;AAAA,QACV,aAAa;AAAA,MACf;AAAA,IACF;AAAA,OAEI,MAAM,aAAa;AAAA,MACrB,YAAY;AAAA,QACV,aAAa;AAAA,MACf;AAAA,IACF;AAAA,OAEI,MAAM,aAAa;AAAA,MACrB,YAAY;AAAA,QACV,aAAa;AAAA,MACf;AAAA,IACF;AAAA,EACF;AACF,GAxBwB;AA0BjB,MAAM,MAAM;AAAA,EACjB,MAAM,CAAC,GAAG,WAAW;AACnB,UAAM,EAAE,QAAQ,UAAU;AAC1B,WAAO;AAAA,MACL,SAAS,OAAO,KAAK,MAAM,SAAS,OAAO,KAAK;AAAA,IAClD;AAAA,EACF;AACF;AAEO,MAAM,WAAW;AAAA,EACtB,MAAM,CAAC,GAAG,WAAW;AACnB,UAAM,EAAE,UAAU;AAClB,UAAM,OAAO,cAAc,MAAM,MAAM,MAAM;AAC7C,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,YAAY;AAAA,EACvB,MAAM;AAAA,IACJ,YAAY;AAAA,MACV,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACf;AAAA,EACF;AAAA,EACA,OAAO;AAAA,IACL,YAAY;AAAA,MACV,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACf;AAAA,EACF;AACF;AAEO,MAAM,YAAY;AAAA,EACvB,MAAM;AAAA,IACJ,YAAY;AAAA,MACV,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACf;AAAA,EACF;AAAA,EACA,OAAO;AAAA,IACL,YAAY;AAAA,MACV,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACf;AAAA,EACF;AACF;AAEO,MAAM,YAAY;AAAA,EACvB,MAAM;AAAA,IACJ,YAAY;AAAA,MACV,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACf;AAAA,EACF;AAAA,EACA,OAAO;AAAA,IACL,YAAY;AAAA,MACV,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACf;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import { getButtonSize, styled } from "@tamagui/core";
2
2
  import { YStack } from "./Stacks";
3
- import { bordered, circular, elevate, focusable, hoverable, pressable } from "./variants";
3
+ import { bordered, circular, elevate, focusable, hoverable, pad, pressable } from "./variants";
4
4
  const ThemeableSizableStack = styled(YStack, {
5
5
  name: "SizableStack",
6
6
  backgroundColor: "$background",
@@ -12,6 +12,7 @@ const ThemeableSizableStack = styled(YStack, {
12
12
  pressable,
13
13
  focusable,
14
14
  circular,
15
+ pad,
15
16
  elevate,
16
17
  bordered,
17
18
  size: {
@@ -0,0 +1,41 @@
1
+ import { styled } from "@tamagui/core";
2
+ import { YStack } from "./Stacks";
3
+ import { bordered, circular, elevate, focusable, hoverable, pad, pressable } from "./variants";
4
+ const ThemeableStack = styled(YStack, {
5
+ name: "SizableStack",
6
+ backgroundColor: "$background",
7
+ flexDirection: "row",
8
+ flexShrink: 1,
9
+ variants: {
10
+ fontFamily: () => ({}),
11
+ hoverable,
12
+ pressable,
13
+ focusable,
14
+ circular,
15
+ pad,
16
+ elevate,
17
+ bordered,
18
+ transparent: {
19
+ true: {
20
+ backgroundColor: "transparent"
21
+ }
22
+ },
23
+ chromeless: {
24
+ true: {
25
+ backgroundColor: "transparent",
26
+ borderColor: "transparent",
27
+ shadowColor: "transparent"
28
+ }
29
+ }
30
+ }
31
+ });
32
+ const Test = styled(ThemeableStack, {
33
+ variants: {
34
+ something: {
35
+ true: {}
36
+ }
37
+ }
38
+ });
39
+ export {
40
+ ThemeableStack
41
+ };
package/dist/jsx/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export * from "./Stacks";
2
2
  export * from "./SizableStack";
3
- export * from "./ThemeableSizableStack";
3
+ export * from "./ThemeableStack";
4
4
  import { getCircleSize } from "./variants";
5
5
  export {
6
6
  getCircleSize
@@ -34,6 +34,14 @@ const bordered = /* @__PURE__ */ __name((val, { props }) => {
34
34
  }
35
35
  };
36
36
  }, "bordered");
37
+ const pad = {
38
+ true: (_, extras) => {
39
+ const { tokens, props } = extras;
40
+ return {
41
+ padding: tokens.size[props.size] || tokens.size["$4"]
42
+ };
43
+ }
44
+ };
37
45
  const circular = {
38
46
  true: (_, extras) => {
39
47
  const { props } = extras;
@@ -100,5 +108,6 @@ export {
100
108
  focusable,
101
109
  getCircleSize,
102
110
  hoverable,
111
+ pad,
103
112
  pressable
104
113
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/stacks",
3
- "version": "1.0.1-beta.29",
3
+ "version": "1.0.1-beta.32",
4
4
  "sideEffects": false,
5
5
  "source": "src/index.ts",
6
6
  "types": "./types/index.d.ts",
@@ -16,14 +16,14 @@
16
16
  "watch": "tamagui-build --watch"
17
17
  },
18
18
  "dependencies": {
19
- "@tamagui/core": "^1.0.1-beta.29"
19
+ "@tamagui/core": "^1.0.1-beta.32"
20
20
  },
21
21
  "peerDependencies": {
22
22
  "react": "*",
23
23
  "react-dom": "*"
24
24
  },
25
25
  "devDependencies": {
26
- "@tamagui/build": "^1.0.1-beta.29",
26
+ "@tamagui/build": "^1.0.1-beta.32",
27
27
  "react": "*",
28
28
  "react-dom": "*"
29
29
  },
@@ -2,12 +2,13 @@ import { GetProps } from '@tamagui/core';
2
2
  export declare const ThemeableSizableStack: 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
3
  fullscreen?: boolean | undefined;
4
4
  elevation?: import("@tamagui/core").SizeTokens | undefined;
5
- }, "focusable" | "fontFamily" | "disabled" | "size" | "hoverable" | "pressable" | "circular" | "elevate" | "bordered" | "transparent" | "chromeless"> & {
5
+ }, "focusable" | "fontFamily" | "disabled" | "size" | "hoverable" | "pressable" | "circular" | "elevate" | "bordered" | "transparent" | "pad" | "chromeless"> & {
6
6
  fontFamily?: unknown;
7
7
  hoverable?: boolean | undefined;
8
8
  pressable?: boolean | undefined;
9
9
  focusable?: boolean | undefined;
10
10
  circular?: boolean | undefined;
11
+ pad?: boolean | undefined;
11
12
  elevate?: boolean | undefined;
12
13
  bordered?: number | boolean | undefined;
13
14
  size?: import("@tamagui/core").SizeTokens | undefined;
@@ -17,12 +18,13 @@ export declare const ThemeableSizableStack: import("@tamagui/core").TamaguiCompo
17
18
  } & 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<{
18
19
  fullscreen?: boolean | undefined;
19
20
  elevation?: import("@tamagui/core").SizeTokens | undefined;
20
- }, "focusable" | "fontFamily" | "disabled" | "size" | "hoverable" | "pressable" | "circular" | "elevate" | "bordered" | "transparent" | "chromeless"> & {
21
+ }, "focusable" | "fontFamily" | "disabled" | "size" | "hoverable" | "pressable" | "circular" | "elevate" | "bordered" | "transparent" | "pad" | "chromeless"> & {
21
22
  fontFamily?: unknown;
22
23
  hoverable?: boolean | undefined;
23
24
  pressable?: boolean | undefined;
24
25
  focusable?: boolean | undefined;
25
26
  circular?: boolean | undefined;
27
+ pad?: boolean | undefined;
26
28
  elevate?: boolean | undefined;
27
29
  bordered?: number | boolean | undefined;
28
30
  size?: import("@tamagui/core").SizeTokens | undefined;
@@ -32,12 +34,13 @@ export declare const ThemeableSizableStack: import("@tamagui/core").TamaguiCompo
32
34
  }>> & 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<{
33
35
  fullscreen?: boolean | undefined;
34
36
  elevation?: import("@tamagui/core").SizeTokens | undefined;
35
- }, "focusable" | "fontFamily" | "disabled" | "size" | "hoverable" | "pressable" | "circular" | "elevate" | "bordered" | "transparent" | "chromeless"> & {
37
+ }, "focusable" | "fontFamily" | "disabled" | "size" | "hoverable" | "pressable" | "circular" | "elevate" | "bordered" | "transparent" | "pad" | "chromeless"> & {
36
38
  fontFamily?: unknown;
37
39
  hoverable?: boolean | undefined;
38
40
  pressable?: boolean | undefined;
39
41
  focusable?: boolean | undefined;
40
42
  circular?: boolean | undefined;
43
+ pad?: boolean | undefined;
41
44
  elevate?: boolean | undefined;
42
45
  bordered?: number | boolean | undefined;
43
46
  size?: import("@tamagui/core").SizeTokens | undefined;
@@ -53,6 +56,7 @@ export declare const ThemeableSizableStack: import("@tamagui/core").TamaguiCompo
53
56
  pressable?: boolean | undefined;
54
57
  focusable?: boolean | undefined;
55
58
  circular?: boolean | undefined;
59
+ pad?: boolean | undefined;
56
60
  elevate?: boolean | undefined;
57
61
  bordered?: number | boolean | undefined;
58
62
  size?: import("@tamagui/core").SizeTokens | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeableSizableStack.d.ts","sourceRoot":"","sources":["../src/ThemeableSizableStack.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAyB,MAAM,eAAe,CAAA;AAK/D,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8ChC,CAAA;AAEF,oBAAY,0BAA0B,GAAG,QAAQ,CAAC,OAAO,qBAAqB,CAAC,CAAA"}
1
+ {"version":3,"file":"ThemeableSizableStack.d.ts","sourceRoot":"","sources":["../src/ThemeableSizableStack.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAyB,MAAM,eAAe,CAAA;AAK/D,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+ChC,CAAA;AAEF,oBAAY,0BAA0B,GAAG,QAAQ,CAAC,OAAO,qBAAqB,CAAC,CAAA"}
@@ -1 +1,60 @@
1
+ import { GetProps } from '@tamagui/core';
2
+ export declare const ThemeableStack: 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
+ fullscreen?: boolean | undefined;
4
+ elevation?: import("@tamagui/core").SizeTokens | undefined;
5
+ }, "focusable" | "fontFamily" | "hoverable" | "pressable" | "circular" | "elevate" | "bordered" | "transparent" | "pad" | "chromeless"> & {
6
+ fontFamily?: unknown;
7
+ hoverable?: boolean | undefined;
8
+ pressable?: boolean | undefined;
9
+ focusable?: boolean | undefined;
10
+ circular?: boolean | undefined;
11
+ pad?: boolean | undefined;
12
+ elevate?: boolean | undefined;
13
+ bordered?: number | boolean | undefined;
14
+ transparent?: boolean | undefined;
15
+ chromeless?: boolean | 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
+ fullscreen?: boolean | undefined;
18
+ elevation?: import("@tamagui/core").SizeTokens | undefined;
19
+ }, "focusable" | "fontFamily" | "hoverable" | "pressable" | "circular" | "elevate" | "bordered" | "transparent" | "pad" | "chromeless"> & {
20
+ fontFamily?: unknown;
21
+ hoverable?: boolean | undefined;
22
+ pressable?: boolean | undefined;
23
+ focusable?: boolean | undefined;
24
+ circular?: boolean | undefined;
25
+ pad?: boolean | undefined;
26
+ elevate?: boolean | undefined;
27
+ bordered?: number | boolean | undefined;
28
+ transparent?: boolean | undefined;
29
+ chromeless?: boolean | 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
+ fullscreen?: boolean | undefined;
32
+ elevation?: import("@tamagui/core").SizeTokens | undefined;
33
+ }, "focusable" | "fontFamily" | "hoverable" | "pressable" | "circular" | "elevate" | "bordered" | "transparent" | "pad" | "chromeless"> & {
34
+ fontFamily?: unknown;
35
+ hoverable?: boolean | undefined;
36
+ pressable?: boolean | undefined;
37
+ focusable?: boolean | undefined;
38
+ circular?: boolean | undefined;
39
+ pad?: boolean | undefined;
40
+ elevate?: boolean | undefined;
41
+ bordered?: number | boolean | undefined;
42
+ transparent?: boolean | undefined;
43
+ chromeless?: boolean | undefined;
44
+ }>>, any, import("@tamagui/core").StackPropsBase, {
45
+ fullscreen?: boolean | undefined;
46
+ 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
+ pad?: boolean | undefined;
54
+ elevate?: boolean | undefined;
55
+ bordered?: number | boolean | undefined;
56
+ transparent?: boolean | undefined;
57
+ chromeless?: boolean | undefined;
58
+ }>;
59
+ export declare type ThemeableStackProps = GetProps<typeof ThemeableStack>;
1
60
  //# sourceMappingURL=ThemeableStack.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeableStack.d.ts","sourceRoot":"","sources":["../src/ThemeableStack.tsx"],"names":[],"mappings":""}
1
+ {"version":3,"file":"ThemeableStack.d.ts","sourceRoot":"","sources":["../src/ThemeableStack.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAU,MAAM,eAAe,CAAA;AAKhD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgCzB,CAAA;AAEF,oBAAY,mBAAmB,GAAG,QAAQ,CAAC,OAAO,cAAc,CAAC,CAAA"}
package/types/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from './Stacks';
2
2
  export * from './SizableStack';
3
- export * from './ThemeableSizableStack';
3
+ export * from './ThemeableStack';
4
4
  export { getCircleSize } from './variants';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,yBAAyB,CAAA;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA"}
@@ -94,6 +94,7 @@ export declare const elevate: {
94
94
  id?: string | import("@tamagui/core").Variable | undefined;
95
95
  tag?: string | import("@tamagui/core").Variable | undefined;
96
96
  theme?: import("@tamagui/core").Variable | import("@tamagui/core").ThemeName | null | undefined;
97
+ componentName?: string | import("@tamagui/core").Variable | undefined;
97
98
  onHoverIn?: import("@tamagui/core").Variable | ((e: MouseEvent) => any) | undefined;
98
99
  onHoverOut?: import("@tamagui/core").Variable | ((e: MouseEvent) => any) | undefined;
99
100
  onPress?: ((e: import("react-native").GestureResponderEvent) => any) | import("@tamagui/core").Variable | undefined;
@@ -211,6 +212,11 @@ export declare const elevate: {
211
212
  export declare const bordered: (val: boolean | number, { props }: {
212
213
  props: any;
213
214
  }) => any;
215
+ export declare const pad: {
216
+ true: (_: any, extras: any) => {
217
+ padding: any;
218
+ };
219
+ };
214
220
  export declare const circular: {
215
221
  true: (_: any, extras: any) => {
216
222
  width: number;
@@ -1 +1 @@
1
- {"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../src/variants.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAsC,MAAM,eAAe,CAAA;AAIlG,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,kBAAkB,UAIzE;AAED,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAInB,CAAA;AAED,eAAO,MAAM,QAAQ,QAAS,OAAO,GAAG,MAAM;;SAwB7C,CAAA;AAED,eAAO,MAAM,QAAQ;;;;;;;;;;;;CAgBpB,CAAA;AAED,eAAO,MAAM,SAAS;;;;;;;;;;;;;CAarB,CAAA;AAED,eAAO,MAAM,SAAS;;;;;;;;;;;;;CAarB,CAAA;AAED,eAAO,MAAM,SAAS;;;;;;;;;;;;;CAarB,CAAA"}
1
+ {"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../src/variants.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAsC,MAAM,eAAe,CAAA;AAIlG,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,kBAAkB,UAIzE;AAED,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAInB,CAAA;AAED,eAAO,MAAM,QAAQ,QAAS,OAAO,GAAG,MAAM;;SAwB7C,CAAA;AAED,eAAO,MAAM,GAAG;;;;CAOf,CAAA;AAED,eAAO,MAAM,QAAQ;;;;;;;;;;;;CAgBpB,CAAA;AAED,eAAO,MAAM,SAAS;;;;;;;;;;;;;CAarB,CAAA;AAED,eAAO,MAAM,SAAS;;;;;;;;;;;;;CAarB,CAAA;AAED,eAAO,MAAM,SAAS;;;;;;;;;;;;;CAarB,CAAA"}