tamagui 1.30.7 → 1.30.8

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.
@@ -20,9 +20,11 @@ var Input_exports = {};
20
20
  __export(Input_exports, {
21
21
  Input: () => Input,
22
22
  InputFrame: () => InputFrame,
23
- defaultStyles: () => defaultStyles
23
+ defaultStyles: () => defaultStyles,
24
+ useInputProps: () => useInputProps
24
25
  });
25
26
  module.exports = __toCommonJS(Input_exports);
27
+ var import_jsx_runtime = require("react/jsx-runtime");
26
28
  var import_core = require("@tamagui/core");
27
29
  var import_focusable = require("@tamagui/focusable");
28
30
  var import_react_native = require("react-native");
@@ -39,7 +41,6 @@ const defaultStyles = {
39
41
  focusable: true,
40
42
  borderColor: "$borderColor",
41
43
  backgroundColor: "$background",
42
- placeholderTextColor: "$placeholderColor",
43
44
  // this fixes a flex bug where it overflows container
44
45
  minWidth: 0,
45
46
  hoverStyle: {
@@ -52,7 +53,7 @@ const defaultStyles = {
52
53
  borderColor: "$borderColorFocus"
53
54
  }
54
55
  };
55
- const InputFramePreTyped = (0, import_core.styled)(
56
+ const InputFrame = (0, import_core.styled)(
56
57
  import_react_native.TextInput,
57
58
  {
58
59
  name: "Input",
@@ -72,12 +73,31 @@ const InputFramePreTyped = (0, import_core.styled)(
72
73
  isInput: true
73
74
  }
74
75
  );
75
- const InputFrame = InputFramePreTyped;
76
- const Input = (0, import_focusable.focusableInputHOC)(InputFrame);
76
+ const Input = InputFrame.styleable((propsIn, ref) => {
77
+ const props = useInputProps(propsIn, ref);
78
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InputFrame, { ...props });
79
+ });
80
+ function useInputProps(props, ref) {
81
+ var _a, _b;
82
+ const theme = (0, import_core.useTheme)();
83
+ const { onChangeText, ref: combinedRef } = (0, import_focusable.useFocusable)({
84
+ props,
85
+ ref,
86
+ isInput: true
87
+ });
88
+ const placeholderTextColor = typeof props.placeholderTextColor !== "string" ? props.placeholderTextColor : ((_a = theme[props.placeholderTextColor]) == null ? void 0 : _a.get()) || props.placeholderTextColor || (props.unstyled ? null : (_b = theme["$placeholderColor"]) == null ? void 0 : _b.get());
89
+ return {
90
+ ref: combinedRef,
91
+ ...props,
92
+ placeholderTextColor,
93
+ onChangeText
94
+ };
95
+ }
77
96
  // Annotate the CommonJS export names for ESM import in node:
78
97
  0 && (module.exports = {
79
98
  Input,
80
99
  InputFrame,
81
- defaultStyles
100
+ defaultStyles,
101
+ useInputProps
82
102
  });
83
103
  //# sourceMappingURL=Input.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/views/Input.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAMO;AACP,uBAAkC;AAClC,0BAAsC;AAEtC,0BAAiC;AAAA,IAEjC,8BAAiB;AAAA,EACf;AACF,CAAC;AAEM,MAAM,gBAAgB;AAAA,EAC3B,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,cAAc;AAAA,EACd,OAAO;AAAA,EACP,WAAW;AAAA,EACX,aAAa;AAAA,EACb,iBAAiB;AAAA,EACjB,sBAAsB;AAAA;AAAA,EAGtB,UAAU;AAAA,EAEV,YAAY;AAAA,IACV,aAAa;AAAA,EACf;AAAA,EAEA,YAAY;AAAA,IACV,cAAc;AAAA,IACd,cAAc;AAAA,IACd,cAAc;AAAA,IACd,aAAa;AAAA,EACf;AACF;AAEA,MAAM,yBAAqB;AAAA,EACzB;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IAEN,UAAU;AAAA,MACR,UAAU;AAAA,QACR,OAAO;AAAA,MACT;AAAA,MAEA,MAAM;AAAA,QACJ,WAAW;AAAA,MACb;AAAA,IACF;AAAA,IAEA,iBAAiB;AAAA,MACf,UAAU;AAAA,IACZ;AAAA,EACF;AAAA,EACA;AAAA,IACE,SAAS;AAAA,EACX;AACF;AASO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M,oBAAoB,MAAhC,mBAAmC,UACnC,MAAM,yBACL,MAAM,WAAW,QAAO,WAAM,mBAAmB,MAAzB,mBAA4B;AAE3D,SAAO;AAAA,IACL,KAAK;AAAA,IACL,GAAG;AAAA,IACH;AAAA,IACA;AAAA,EACF;AACF;",
5
5
  "names": []
6
6
  }
@@ -22,8 +22,8 @@ __export(TextArea_exports, {
22
22
  TextAreaFrame: () => TextAreaFrame
23
23
  });
24
24
  module.exports = __toCommonJS(TextArea_exports);
25
+ var import_jsx_runtime = require("react/jsx-runtime");
25
26
  var import_core = require("@tamagui/core");
26
- var import_focusable = require("@tamagui/focusable");
27
27
  var import_inputHelpers = require("../helpers/inputHelpers");
28
28
  var import_Input = require("./Input");
29
29
  const TextAreaFrame = (0, import_core.styled)(import_Input.InputFrame, {
@@ -45,7 +45,10 @@ const TextAreaFrame = (0, import_core.styled)(import_Input.InputFrame, {
45
45
  unstyled: false
46
46
  }
47
47
  });
48
- const TextArea = (0, import_focusable.focusableInputHOC)(TextAreaFrame);
48
+ const TextArea = import_Input.InputFrame.styleable((propsIn, ref) => {
49
+ const props = (0, import_Input.useInputProps)(propsIn, ref);
50
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Input.InputFrame, { ...props });
51
+ });
49
52
  // Annotate the CommonJS export names for ESM import in node:
50
53
  0 && (module.exports = {
51
54
  TextArea,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/views/TextArea.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiC;AACjC,uBAAkC;AAElC,0BAAoC;AACpC,mBAA0C;AAEnC,MAAM,oBAAgB,oBAAO,yBAAY;AAAA,EAC9C,MAAM;AAAA,EACN,WAAW;AAAA,EAEX,UAAU;AAAA,IACR,UAAU;AAAA,MACR,OAAO;AAAA,QACL,GAAG;AAAA,QACH,QAAQ;AAAA,QACR,eAAe;AAAA,MACjB;AAAA,IACF;AAAA,IAEA,MAAM;AAAA,MACJ,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EAEA,iBAAiB;AAAA,IACf,UAAU;AAAA,EACZ;AACF,CAAC;AAIM,MAAM,eAAW,oCAAkB,aAAa;",
4
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoCS;AApCT,kBAAuB;AAEvB,0BAAoC;AACpC,mBAAqE;AAM9D,MAAM,oBAAgB,oBAAO,yBAAY;AAAA,EAC9C,MAAM;AAAA,EACN,WAAW;AAAA,EAEX,UAAU;AAAA,IACR,UAAU;AAAA,MACR,OAAO;AAAA,QACL,GAAG;AAAA,QACH,QAAQ;AAAA,QACR,eAAe;AAAA,MACjB;AAAA,IACF;AAAA,IAEA,MAAM;AAAA,MACJ,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EAEA,iBAAiB;AAAA,IACf,UAAU;AAAA,EACZ;AACF,CAAC;AAIM,MAAM,WAAW,wBAAW,UAAsB,CAAC,SAAS,QAAQ;AACzE,QAAM,YAAQ,4BAAc,SAAS,GAAG;AACxC,SAAO,4CAAC,2BAAY,GAAG,OAAO;AAChC,CAAC;",
5
5
  "names": []
6
6
  }
@@ -1,8 +1,10 @@
1
+ import { jsx } from "react/jsx-runtime";
1
2
  import {
2
3
  setupReactNative,
3
- styled
4
+ styled,
5
+ useTheme
4
6
  } from "@tamagui/core";
5
- import { focusableInputHOC } from "@tamagui/focusable";
7
+ import { useFocusable } from "@tamagui/focusable";
6
8
  import { TextInput } from "react-native";
7
9
  import { inputSizeVariant } from "../helpers/inputHelpers";
8
10
  setupReactNative({
@@ -17,7 +19,6 @@ const defaultStyles = {
17
19
  focusable: true,
18
20
  borderColor: "$borderColor",
19
21
  backgroundColor: "$background",
20
- placeholderTextColor: "$placeholderColor",
21
22
  // this fixes a flex bug where it overflows container
22
23
  minWidth: 0,
23
24
  hoverStyle: {
@@ -30,7 +31,7 @@ const defaultStyles = {
30
31
  borderColor: "$borderColorFocus"
31
32
  }
32
33
  };
33
- const InputFramePreTyped = styled(
34
+ const InputFrame = styled(
34
35
  TextInput,
35
36
  {
36
37
  name: "Input",
@@ -50,11 +51,30 @@ const InputFramePreTyped = styled(
50
51
  isInput: true
51
52
  }
52
53
  );
53
- const InputFrame = InputFramePreTyped;
54
- const Input = focusableInputHOC(InputFrame);
54
+ const Input = InputFrame.styleable((propsIn, ref) => {
55
+ const props = useInputProps(propsIn, ref);
56
+ return /* @__PURE__ */ jsx(InputFrame, { ...props });
57
+ });
58
+ function useInputProps(props, ref) {
59
+ var _a, _b;
60
+ const theme = useTheme();
61
+ const { onChangeText, ref: combinedRef } = useFocusable({
62
+ props,
63
+ ref,
64
+ isInput: true
65
+ });
66
+ const placeholderTextColor = typeof props.placeholderTextColor !== "string" ? props.placeholderTextColor : ((_a = theme[props.placeholderTextColor]) == null ? void 0 : _a.get()) || props.placeholderTextColor || (props.unstyled ? null : (_b = theme["$placeholderColor"]) == null ? void 0 : _b.get());
67
+ return {
68
+ ref: combinedRef,
69
+ ...props,
70
+ placeholderTextColor,
71
+ onChangeText
72
+ };
73
+ }
55
74
  export {
56
75
  Input,
57
76
  InputFrame,
58
- defaultStyles
77
+ defaultStyles,
78
+ useInputProps
59
79
  };
60
80
  //# sourceMappingURL=Input.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/views/Input.tsx"],
4
- "mappings": "AAAA;AAAA,EAIE;AAAA,EACA;AAAA,OACK;AACP,SAAS,yBAAyB;AAClC,SAAqB,iBAAiB;AAEtC,SAAS,wBAAwB;AAEjC,iBAAiB;AAAA,EACf;AACF,CAAC;AAEM,MAAM,gBAAgB;AAAA,EAC3B,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,cAAc;AAAA,EACd,OAAO;AAAA,EACP,WAAW;AAAA,EACX,aAAa;AAAA,EACb,iBAAiB;AAAA,EACjB,sBAAsB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,IACZ;AAAA,EACF;AAAA,EACA;AAAA,IACE,SAAS;AAAA,EACX;AACF;AAMO,MAAM,QAAQ,WAAW,UAAsB,CAAC,SAAS,QAAQ;AACtE,QAAM,QAAQ,cAAc,SAAS,GAAG;AACxC,SAAO,oBAAC,cAAY,GAAG,OAAO;AAChC,CAAC;AAEM,SAAS,cAAc,OAAmB,KAAU;AA1E3D;AA2EE,QAAM,QAAQ,SAAS;AACvB,QAAM,EAAE,cAAc,KAAK,YAAY,IAAI,aAAa;AAAA,IACtD;AAAA,IACA;AAAA,IACA,SAAS;AAAA,EACX,CAAC;AAED,QAAM,uBACJ,OAAO,MAAM,yBAAyB,WAClC,MAAM,yBACN,WAAM,MAAM,oBAAoB,MAAhC,mBAAmC,UACnC,MAAM,yBACL,MAAM,WAAW,QAAO,WAAM,mBAAmB,MAAzB,mBAA4B;AAE3D,SAAO;AAAA,IACL,KAAK;AAAA,IACL,GAAG;AAAA,IACH;AAAA,IACA;AAAA,EACF;AACF;",
5
5
  "names": []
6
6
  }
@@ -1,7 +1,7 @@
1
+ import { jsx } from "react/jsx-runtime";
1
2
  import { styled } from "@tamagui/core";
2
- import { focusableInputHOC } from "@tamagui/focusable";
3
3
  import { textAreaSizeVariant } from "../helpers/inputHelpers";
4
- import { InputFrame, defaultStyles } from "./Input";
4
+ import { InputFrame, defaultStyles, useInputProps } from "./Input";
5
5
  const TextAreaFrame = styled(InputFrame, {
6
6
  name: "TextArea",
7
7
  multiline: true,
@@ -21,7 +21,10 @@ const TextAreaFrame = styled(InputFrame, {
21
21
  unstyled: false
22
22
  }
23
23
  });
24
- const TextArea = focusableInputHOC(TextAreaFrame);
24
+ const TextArea = InputFrame.styleable((propsIn, ref) => {
25
+ const props = useInputProps(propsIn, ref);
26
+ return /* @__PURE__ */ jsx(InputFrame, { ...props });
27
+ });
25
28
  export {
26
29
  TextArea,
27
30
  TextAreaFrame
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/views/TextArea.tsx"],
4
- "mappings": "AAAA,SAAmB,cAAc;AACjC,SAAS,yBAAyB;AAElC,SAAS,2BAA2B;AACpC,SAAS,YAAY,qBAAqB;AAEnC,MAAM,gBAAgB,OAAO,YAAY;AAAA,EAC9C,MAAM;AAAA,EACN,WAAW;AAAA,EAEX,UAAU;AAAA,IACR,UAAU;AAAA,MACR,OAAO;AAAA,QACL,GAAG;AAAA,QACH,QAAQ;AAAA,QACR,eAAe;AAAA,MACjB;AAAA,IACF;AAAA,IAEA,MAAM;AAAA,MACJ,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EAEA,iBAAiB;AAAA,IACf,UAAU;AAAA,EACZ;AACF,CAAC;AAIM,MAAM,WAAW,kBAAkB,aAAa;",
4
+ "mappings": "AAoCS;AApCT,SAAS,cAAc;AAEvB,SAAS,2BAA2B;AACpC,SAAS,YAAwB,eAAe,qBAAqB;AAM9D,MAAM,gBAAgB,OAAO,YAAY;AAAA,EAC9C,MAAM;AAAA,EACN,WAAW;AAAA,EAEX,UAAU;AAAA,IACR,UAAU;AAAA,MACR,OAAO;AAAA,QACL,GAAG;AAAA,QACH,QAAQ;AAAA,QACR,eAAe;AAAA,MACjB;AAAA,IACF;AAAA,IAEA,MAAM;AAAA,MACJ,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EAEA,iBAAiB;AAAA,IACf,UAAU;AAAA,EACZ;AACF,CAAC;AAIM,MAAM,WAAW,WAAW,UAAsB,CAAC,SAAS,QAAQ;AACzE,QAAM,QAAQ,cAAc,SAAS,GAAG;AACxC,SAAO,oBAAC,cAAY,GAAG,OAAO;AAChC,CAAC;",
5
5
  "names": []
6
6
  }
@@ -1,8 +1,9 @@
1
1
  import {
2
2
  setupReactNative,
3
- styled
3
+ styled,
4
+ useTheme
4
5
  } from "@tamagui/core";
5
- import { focusableInputHOC } from "@tamagui/focusable";
6
+ import { useFocusable } from "@tamagui/focusable";
6
7
  import { TextInput } from "react-native";
7
8
  import { inputSizeVariant } from "../helpers/inputHelpers";
8
9
  setupReactNative({
@@ -17,7 +18,6 @@ const defaultStyles = {
17
18
  focusable: true,
18
19
  borderColor: "$borderColor",
19
20
  backgroundColor: "$background",
20
- placeholderTextColor: "$placeholderColor",
21
21
  // this fixes a flex bug where it overflows container
22
22
  minWidth: 0,
23
23
  hoverStyle: {
@@ -30,7 +30,7 @@ const defaultStyles = {
30
30
  borderColor: "$borderColorFocus"
31
31
  }
32
32
  };
33
- const InputFramePreTyped = styled(
33
+ const InputFrame = styled(
34
34
  TextInput,
35
35
  {
36
36
  name: "Input",
@@ -50,11 +50,29 @@ const InputFramePreTyped = styled(
50
50
  isInput: true
51
51
  }
52
52
  );
53
- const InputFrame = InputFramePreTyped;
54
- const Input = focusableInputHOC(InputFrame);
53
+ const Input = InputFrame.styleable((propsIn, ref) => {
54
+ const props = useInputProps(propsIn, ref);
55
+ return <InputFrame {...props} />;
56
+ });
57
+ function useInputProps(props, ref) {
58
+ const theme = useTheme();
59
+ const { onChangeText, ref: combinedRef } = useFocusable({
60
+ props,
61
+ ref,
62
+ isInput: true
63
+ });
64
+ const placeholderTextColor = typeof props.placeholderTextColor !== "string" ? props.placeholderTextColor : theme[props.placeholderTextColor]?.get() || props.placeholderTextColor || (props.unstyled ? null : theme["$placeholderColor"]?.get());
65
+ return {
66
+ ref: combinedRef,
67
+ ...props,
68
+ placeholderTextColor,
69
+ onChangeText
70
+ };
71
+ }
55
72
  export {
56
73
  Input,
57
74
  InputFrame,
58
- defaultStyles
75
+ defaultStyles,
76
+ useInputProps
59
77
  };
60
78
  //# sourceMappingURL=Input.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/views/Input.tsx"],
4
- "mappings": "AAAA;AAAA,EAIE;AAAA,EACA;AAAA,OACK;AACP,SAAS,yBAAyB;AAClC,SAAqB,iBAAiB;AAEtC,SAAS,wBAAwB;AAEjC,iBAAiB;AAAA,EACf;AACF,CAAC;AAEM,MAAM,gBAAgB;A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N,UAAU;AAAA,MACR,UAAU;AAAA,QACR,OAAO;AAAA,MACT;AAAA,MAEA,MAAM;AAAA,QACJ,WAAW;AAAA,MACb;AAAA,IACF;AAAA,IAEA,iBAAiB;AAAA,MACf,UAAU;AAAA,IACZ;AAAA,EACF;AAAA,EACA;AAAA,IACE,SAAS;AAAA,EACX;AACF;AAMO,MAAM,QAAQ,WAAW,UAAsB,CAAC,SAAS,QAAQ;AACtE,QAAM,QAAQ,cAAc,SAAS,GAAG;AACxC,SAAO,CAAC,eAAe,OAAO;AAChC,CAAC;AAEM,SAAS,cAAc,OAAmB,KAAU;AACzD,QAAM,QAAQ,SAAS;AACvB,QAAM,EAAE,cAAc,KAAK,YAAY,IAAI,aAAa;AAAA,IACtD;AAAA,IACA;AAAA,IACA,SAAS;AAAA,EACX,CAAC;AAED,QAAM,uBACJ,OAAO,MAAM,yBAAyB,WAClC,MAAM,uBACN,MAAM,MAAM,oBAAoB,GAAG,IAAI,KACvC,MAAM,yBACL,MAAM,WAAW,OAAO,MAAM,mBAAmB,GAAG,IAAI;AAE/D,SAAO;AAAA,IACL,KAAK;AAAA,IACL,GAAG;AAAA,IACH;AAAA,IACA;AAAA,EACF;AACF;",
5
5
  "names": []
6
6
  }
@@ -1,8 +1,9 @@
1
1
  import {
2
2
  setupReactNative,
3
- styled
3
+ styled,
4
+ useTheme
4
5
  } from "@tamagui/core";
5
- import { focusableInputHOC } from "@tamagui/focusable";
6
+ import { useFocusable } from "@tamagui/focusable";
6
7
  import { TextInput } from "react-native";
7
8
  import { inputSizeVariant } from "../helpers/inputHelpers";
8
9
  setupReactNative({
@@ -17,7 +18,6 @@ const defaultStyles = {
17
18
  focusable: true,
18
19
  borderColor: "$borderColor",
19
20
  backgroundColor: "$background",
20
- placeholderTextColor: "$placeholderColor",
21
21
  // this fixes a flex bug where it overflows container
22
22
  minWidth: 0,
23
23
  hoverStyle: {
@@ -30,7 +30,7 @@ const defaultStyles = {
30
30
  borderColor: "$borderColorFocus"
31
31
  }
32
32
  };
33
- const InputFramePreTyped = styled(
33
+ const InputFrame = styled(
34
34
  TextInput,
35
35
  {
36
36
  name: "Input",
@@ -50,11 +50,29 @@ const InputFramePreTyped = styled(
50
50
  isInput: true
51
51
  }
52
52
  );
53
- const InputFrame = InputFramePreTyped;
54
- const Input = focusableInputHOC(InputFrame);
53
+ const Input = InputFrame.styleable((propsIn, ref) => {
54
+ const props = useInputProps(propsIn, ref);
55
+ return <InputFrame {...props} />;
56
+ });
57
+ function useInputProps(props, ref) {
58
+ const theme = useTheme();
59
+ const { onChangeText, ref: combinedRef } = useFocusable({
60
+ props,
61
+ ref,
62
+ isInput: true
63
+ });
64
+ const placeholderTextColor = typeof props.placeholderTextColor !== "string" ? props.placeholderTextColor : theme[props.placeholderTextColor]?.get() || props.placeholderTextColor || (props.unstyled ? null : theme["$placeholderColor"]?.get());
65
+ return {
66
+ ref: combinedRef,
67
+ ...props,
68
+ placeholderTextColor,
69
+ onChangeText
70
+ };
71
+ }
55
72
  export {
56
73
  Input,
57
74
  InputFrame,
58
- defaultStyles
75
+ defaultStyles,
76
+ useInputProps
59
77
  };
60
78
  //# sourceMappingURL=Input.mjs.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/views/Input.tsx"],
4
- "mappings": "AAAA;AAAA,EAIE;AAAA,EACA;AAAA,OACK;AACP,SAAS,yBAAyB;AAClC,SAAqB,iBAAiB;AAEtC,SAAS,wBAAwB;AAEjC,iBAAiB;AAAA,EACf;AACF,CAAC;AAEM,MAAM,gBAAgB;AAAA,EAC3B,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,cAAc;AAAA,EACd,OAAO;AAAA,EACP,WAAW;AAAA,EACX,aAAa;AAAA,EACb,iBAAiB;AAAA,EACjB,sBAAsB;AAAA;AAAA,EAGtB,UAAU;AAAA,EAEV,YAAY;AAAA,IACV,aAAa;AAAA,EACf;AAAA,EAEA,YAAY;AAAA,IACV,c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AQ;AACtE,QAAM,QAAQ,cAAc,SAAS,GAAG;AACxC,SAAO,CAAC,eAAe,OAAO;AAChC,CAAC;AAEM,SAAS,cAAc,OAAmB,KAAU;AACzD,QAAM,QAAQ,SAAS;AACvB,QAAM,EAAE,cAAc,KAAK,YAAY,IAAI,aAAa;AAAA,IACtD;AAAA,IACA;AAAA,IACA,SAAS;AAAA,EACX,CAAC;AAED,QAAM,uBACJ,OAAO,MAAM,yBAAyB,WAClC,MAAM,uBACN,MAAM,MAAM,oBAAoB,GAAG,IAAI,KACvC,MAAM,yBACL,MAAM,WAAW,OAAO,MAAM,mBAAmB,GAAG,IAAI;AAE/D,SAAO;AAAA,IACL,KAAK;AAAA,IACL,GAAG;AAAA,IACH;AAAA,IACA;AAAA,EACF;AACF;",
5
5
  "names": []
6
6
  }
@@ -1,7 +1,6 @@
1
1
  import { styled } from "@tamagui/core";
2
- import { focusableInputHOC } from "@tamagui/focusable";
3
2
  import { textAreaSizeVariant } from "../helpers/inputHelpers";
4
- import { InputFrame, defaultStyles } from "./Input";
3
+ import { InputFrame, defaultStyles, useInputProps } from "./Input";
5
4
  const TextAreaFrame = styled(InputFrame, {
6
5
  name: "TextArea",
7
6
  multiline: true,
@@ -21,7 +20,10 @@ const TextAreaFrame = styled(InputFrame, {
21
20
  unstyled: false
22
21
  }
23
22
  });
24
- const TextArea = focusableInputHOC(TextAreaFrame);
23
+ const TextArea = InputFrame.styleable((propsIn, ref) => {
24
+ const props = useInputProps(propsIn, ref);
25
+ return <InputFrame {...props} />;
26
+ });
25
27
  export {
26
28
  TextArea,
27
29
  TextAreaFrame
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/views/TextArea.tsx"],
4
- "mappings": "AAAA,SAAmB,cAAc;AACjC,SAAS,yBAAyB;AAElC,SAAS,2BAA2B;AACpC,SAAS,YAAY,qBAAqB;AAEnC,MAAM,gBAAgB,OAAO,YAAY;AAAA,EAC9C,MAAM;AAAA,EACN,WAAW;AAAA,EAEX,UAAU;AAAA,IACR,UAAU;AAAA,MACR,OAAO;AAAA,QACL,GAAG;AAAA,QACH,QAAQ;AAAA,QACR,eAAe;AAAA,MACjB;AAAA,IACF;AAAA,IAEA,MAAM;AAAA,MACJ,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EAEA,iBAAiB;AAAA,IACf,UAAU;AAAA,EACZ;AACF,CAAC;AAIM,MAAM,WAAW,kBAAkB,aAAa;",
4
+ "mappings": "AAAA,SAAS,cAAc;AAEvB,SAAS,2BAA2B;AACpC,SAAS,YAAwB,eAAe,qBAAqB;AAM9D,MAAM,gBAAgB,OAAO,YAAY;AAAA,EAC9C,MAAM;AAAA,EACN,WAAW;AAAA,EAEX,UAAU;AAAA,IACR,UAAU;AAAA,MACR,OAAO;AAAA,QACL,GAAG;AAAA,QACH,QAAQ;AAAA,QACR,eAAe;AAAA,MACjB;AAAA,IACF;AAAA,IAEA,MAAM;AAAA,MACJ,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EAEA,iBAAiB;AAAA,IACf,UAAU;AAAA,EACZ;AACF,CAAC;AAIM,MAAM,WAAW,WAAW,UAAsB,CAAC,SAAS,QAAQ;AACzE,QAAM,QAAQ,cAAc,SAAS,GAAG;AACxC,SAAO,CAAC,eAAe,OAAO;AAChC,CAAC;",
5
5
  "names": []
6
6
  }
@@ -1,7 +1,6 @@
1
1
  import { styled } from "@tamagui/core";
2
- import { focusableInputHOC } from "@tamagui/focusable";
3
2
  import { textAreaSizeVariant } from "../helpers/inputHelpers";
4
- import { InputFrame, defaultStyles } from "./Input";
3
+ import { InputFrame, defaultStyles, useInputProps } from "./Input";
5
4
  const TextAreaFrame = styled(InputFrame, {
6
5
  name: "TextArea",
7
6
  multiline: true,
@@ -21,7 +20,10 @@ const TextAreaFrame = styled(InputFrame, {
21
20
  unstyled: false
22
21
  }
23
22
  });
24
- const TextArea = focusableInputHOC(TextAreaFrame);
23
+ const TextArea = InputFrame.styleable((propsIn, ref) => {
24
+ const props = useInputProps(propsIn, ref);
25
+ return <InputFrame {...props} />;
26
+ });
25
27
  export {
26
28
  TextArea,
27
29
  TextAreaFrame
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/views/TextArea.tsx"],
4
- "mappings": "AAAA,SAAmB,cAAc;AACjC,SAAS,yBAAyB;AAElC,SAAS,2BAA2B;AACpC,SAAS,YAAY,qBAAqB;AAEnC,MAAM,gBAAgB,OAAO,YAAY;AAAA,EAC9C,MAAM;AAAA,EACN,WAAW;AAAA,EAEX,UAAU;AAAA,IACR,UAAU;AAAA,MACR,OAAO;AAAA,QACL,GAAG;AAAA,QACH,QAAQ;AAAA,QACR,eAAe;AAAA,MACjB;AAAA,IACF;AAAA,IAEA,MAAM;AAAA,MACJ,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EAEA,iBAAiB;AAAA,IACf,UAAU;AAAA,EACZ;AACF,CAAC;AAIM,MAAM,WAAW,kBAAkB,aAAa;",
4
+ "mappings": "AAAA,SAAS,cAAc;AAEvB,SAAS,2BAA2B;AACpC,SAAS,YAAwB,eAAe,qBAAqB;AAM9D,MAAM,gBAAgB,OAAO,YAAY;AAAA,EAC9C,MAAM;AAAA,EACN,WAAW;AAAA,EAEX,UAAU;AAAA,IACR,UAAU;AAAA,MACR,OAAO;AAAA,QACL,GAAG;AAAA,QACH,QAAQ;AAAA,QACR,eAAe;AAAA,MACjB;AAAA,IACF;AAAA,IAEA,MAAM;AAAA,MACJ,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EAEA,iBAAiB;AAAA,IACf,UAAU;AAAA,EACZ;AACF,CAAC;AAIM,MAAM,WAAW,WAAW,UAAsB,CAAC,SAAS,QAAQ;AACzE,QAAM,QAAQ,cAAc,SAAS,GAAG;AACxC,SAAO,CAAC,eAAe,OAAO;AAChC,CAAC;",
5
5
  "names": []
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tamagui",
3
- "version": "1.30.7",
3
+ "version": "1.30.8",
4
4
  "sideEffects": [
5
5
  "*.css",
6
6
  "setup.js"
@@ -40,55 +40,55 @@
40
40
  }
41
41
  },
42
42
  "dependencies": {
43
- "@tamagui/adapt": "1.30.7",
44
- "@tamagui/alert-dialog": "1.30.7",
45
- "@tamagui/animate-presence": "1.30.7",
46
- "@tamagui/avatar": "1.30.7",
47
- "@tamagui/button": "1.30.7",
48
- "@tamagui/card": "1.30.7",
49
- "@tamagui/checkbox": "1.30.7",
50
- "@tamagui/compose-refs": "1.30.7",
51
- "@tamagui/core": "1.30.7",
52
- "@tamagui/create-context": "1.30.7",
53
- "@tamagui/dialog": "1.30.7",
54
- "@tamagui/fake-react-native": "1.30.7",
55
- "@tamagui/focusable": "1.30.7",
56
- "@tamagui/font-size": "1.30.7",
57
- "@tamagui/form": "1.30.7",
58
- "@tamagui/get-button-sized": "1.30.7",
59
- "@tamagui/get-font-sized": "1.30.7",
60
- "@tamagui/get-token": "1.30.7",
61
- "@tamagui/helpers": "1.30.7",
62
- "@tamagui/helpers-tamagui": "1.30.7",
63
- "@tamagui/image": "1.30.7",
64
- "@tamagui/label": "1.30.7",
65
- "@tamagui/linear-gradient": "1.30.7",
66
- "@tamagui/list-item": "1.30.7",
67
- "@tamagui/popover": "1.30.7",
68
- "@tamagui/popper": "1.30.7",
69
- "@tamagui/portal": "1.30.7",
70
- "@tamagui/progress": "1.30.7",
71
- "@tamagui/radio-group": "1.30.7",
72
- "@tamagui/react-native-media-driver": "1.30.7",
73
- "@tamagui/scroll-view": "1.30.7",
74
- "@tamagui/select": "1.30.7",
75
- "@tamagui/separator": "1.30.7",
76
- "@tamagui/shapes": "1.30.7",
77
- "@tamagui/sheet": "1.30.7",
78
- "@tamagui/slider": "1.30.7",
79
- "@tamagui/stacks": "1.30.7",
80
- "@tamagui/switch": "1.30.7",
81
- "@tamagui/tabs": "1.30.7",
82
- "@tamagui/text": "1.30.7",
83
- "@tamagui/theme": "1.30.7",
84
- "@tamagui/toggle-group": "1.30.7",
85
- "@tamagui/tooltip": "1.30.7",
86
- "@tamagui/use-controllable-state": "1.30.7",
87
- "@tamagui/use-debounce": "1.30.7",
88
- "@tamagui/use-event": "1.30.7",
89
- "@tamagui/use-force-update": "1.30.7",
90
- "@tamagui/use-window-dimensions": "1.30.7",
91
- "@tamagui/visually-hidden": "1.30.7",
43
+ "@tamagui/adapt": "1.30.8",
44
+ "@tamagui/alert-dialog": "1.30.8",
45
+ "@tamagui/animate-presence": "1.30.8",
46
+ "@tamagui/avatar": "1.30.8",
47
+ "@tamagui/button": "1.30.8",
48
+ "@tamagui/card": "1.30.8",
49
+ "@tamagui/checkbox": "1.30.8",
50
+ "@tamagui/compose-refs": "1.30.8",
51
+ "@tamagui/core": "1.30.8",
52
+ "@tamagui/create-context": "1.30.8",
53
+ "@tamagui/dialog": "1.30.8",
54
+ "@tamagui/fake-react-native": "1.30.8",
55
+ "@tamagui/focusable": "1.30.8",
56
+ "@tamagui/font-size": "1.30.8",
57
+ "@tamagui/form": "1.30.8",
58
+ "@tamagui/get-button-sized": "1.30.8",
59
+ "@tamagui/get-font-sized": "1.30.8",
60
+ "@tamagui/get-token": "1.30.8",
61
+ "@tamagui/helpers": "1.30.8",
62
+ "@tamagui/helpers-tamagui": "1.30.8",
63
+ "@tamagui/image": "1.30.8",
64
+ "@tamagui/label": "1.30.8",
65
+ "@tamagui/linear-gradient": "1.30.8",
66
+ "@tamagui/list-item": "1.30.8",
67
+ "@tamagui/popover": "1.30.8",
68
+ "@tamagui/popper": "1.30.8",
69
+ "@tamagui/portal": "1.30.8",
70
+ "@tamagui/progress": "1.30.8",
71
+ "@tamagui/radio-group": "1.30.8",
72
+ "@tamagui/react-native-media-driver": "1.30.8",
73
+ "@tamagui/scroll-view": "1.30.8",
74
+ "@tamagui/select": "1.30.8",
75
+ "@tamagui/separator": "1.30.8",
76
+ "@tamagui/shapes": "1.30.8",
77
+ "@tamagui/sheet": "1.30.8",
78
+ "@tamagui/slider": "1.30.8",
79
+ "@tamagui/stacks": "1.30.8",
80
+ "@tamagui/switch": "1.30.8",
81
+ "@tamagui/tabs": "1.30.8",
82
+ "@tamagui/text": "1.30.8",
83
+ "@tamagui/theme": "1.30.8",
84
+ "@tamagui/toggle-group": "1.30.8",
85
+ "@tamagui/tooltip": "1.30.8",
86
+ "@tamagui/use-controllable-state": "1.30.8",
87
+ "@tamagui/use-debounce": "1.30.8",
88
+ "@tamagui/use-event": "1.30.8",
89
+ "@tamagui/use-force-update": "1.30.8",
90
+ "@tamagui/use-window-dimensions": "1.30.8",
91
+ "@tamagui/visually-hidden": "1.30.8",
92
92
  "reforest": "^0.12.1"
93
93
  },
94
94
  "peerDependencies": {
@@ -96,7 +96,7 @@
96
96
  "react-native-web": "*"
97
97
  },
98
98
  "devDependencies": {
99
- "@tamagui/build": "1.30.7",
99
+ "@tamagui/build": "1.30.8",
100
100
  "@types/node": "^16.11.9",
101
101
  "@types/react": "^18.0.15",
102
102
  "react": "^18.2.0",
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  ColorStyleProp,
3
3
  GetProps,
4
- ModifyTamaguiComponentStyleProps,
5
4
  setupReactNative,
6
5
  styled,
6
+ useTheme,
7
7
  } from '@tamagui/core'
8
- import { focusableInputHOC } from '@tamagui/focusable'
9
- import { ColorValue, TextInput } from 'react-native'
8
+ import { useFocusable } from '@tamagui/focusable'
9
+ import { TextInput } from 'react-native'
10
10
 
11
11
  import { inputSizeVariant } from '../helpers/inputHelpers'
12
12
 
@@ -23,7 +23,6 @@ export const defaultStyles = {
23
23
  focusable: true,
24
24
  borderColor: '$borderColor',
25
25
  backgroundColor: '$background',
26
- placeholderTextColor: '$placeholderColor',
27
26
 
28
27
  // this fixes a flex bug where it overflows container
29
28
  minWidth: 0,
@@ -40,7 +39,7 @@ export const defaultStyles = {
40
39
  },
41
40
  } as const
42
41
 
43
- const InputFramePreTyped = styled(
42
+ export const InputFrame = styled(
44
43
  TextInput,
45
44
  {
46
45
  name: 'Input',
@@ -64,15 +63,34 @@ const InputFramePreTyped = styled(
64
63
  }
65
64
  )
66
65
 
67
- type InputFrameType = ModifyTamaguiComponentStyleProps<
68
- typeof InputFramePreTyped,
69
- {
70
- placeholderTextColor?: ColorStyleProp | ColorValue
71
- }
72
- >
66
+ export type InputProps = Omit<GetProps<typeof InputFrame>, 'placeholderTextColor'> & {
67
+ placeholderTextColor?: ColorStyleProp
68
+ }
69
+
70
+ export const Input = InputFrame.styleable<InputProps>((propsIn, ref) => {
71
+ const props = useInputProps(propsIn, ref)
72
+ return <InputFrame {...props} />
73
+ })
73
74
 
74
- export const InputFrame = InputFramePreTyped as InputFrameType
75
+ export function useInputProps(props: InputProps, ref: any) {
76
+ const theme = useTheme()
77
+ const { onChangeText, ref: combinedRef } = useFocusable({
78
+ props,
79
+ ref,
80
+ isInput: true,
81
+ })
75
82
 
76
- export type InputProps = GetProps<InputFrameType>
83
+ const placeholderTextColor =
84
+ typeof props.placeholderTextColor !== 'string'
85
+ ? props.placeholderTextColor
86
+ : theme[props.placeholderTextColor]?.get() ||
87
+ props.placeholderTextColor ||
88
+ (props.unstyled ? null : theme['$placeholderColor']?.get())
77
89
 
78
- export const Input = focusableInputHOC(InputFrame)
90
+ return {
91
+ ref: combinedRef,
92
+ ...props,
93
+ placeholderTextColor,
94
+ onChangeText,
95
+ }
96
+ }