@tamagui/input 1.144.2 → 1.144.3

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 (74) hide show
  1. package/dist/cjs/v1/Input.cjs +190 -0
  2. package/dist/cjs/v1/Input.js +171 -0
  3. package/dist/cjs/v1/Input.js.map +6 -0
  4. package/dist/cjs/v1/Input.native.js +138 -0
  5. package/dist/cjs/v1/Input.native.js.map +1 -0
  6. package/dist/cjs/v1/TextArea.cjs +50 -0
  7. package/dist/cjs/v1/TextArea.js +43 -0
  8. package/dist/cjs/v1/TextArea.js.map +6 -0
  9. package/dist/cjs/v1/TextArea.native.js +53 -0
  10. package/dist/cjs/v1/TextArea.native.js.map +1 -0
  11. package/dist/cjs/v1/index.cjs +19 -0
  12. package/dist/cjs/v1/index.js +16 -0
  13. package/dist/cjs/v1/index.js.map +6 -0
  14. package/dist/cjs/v1/index.native.js +22 -0
  15. package/dist/cjs/v1/index.native.js.map +1 -0
  16. package/dist/cjs/v1/types.cjs +16 -0
  17. package/dist/cjs/v1/types.js +14 -0
  18. package/dist/cjs/v1/types.js.map +6 -0
  19. package/dist/cjs/v1/types.native.js +19 -0
  20. package/dist/cjs/v1/types.native.js.map +1 -0
  21. package/dist/esm/v1/Input.js +151 -0
  22. package/dist/esm/v1/Input.js.map +6 -0
  23. package/dist/esm/v1/Input.mjs +156 -0
  24. package/dist/esm/v1/Input.mjs.map +1 -0
  25. package/dist/esm/v1/Input.native.js +101 -0
  26. package/dist/esm/v1/Input.native.js.map +1 -0
  27. package/dist/esm/v1/TextArea.js +29 -0
  28. package/dist/esm/v1/TextArea.js.map +6 -0
  29. package/dist/esm/v1/TextArea.mjs +27 -0
  30. package/dist/esm/v1/TextArea.mjs.map +1 -0
  31. package/dist/esm/v1/TextArea.native.js +27 -0
  32. package/dist/esm/v1/TextArea.native.js.map +1 -0
  33. package/dist/esm/v1/index.js +3 -0
  34. package/dist/esm/v1/index.js.map +6 -0
  35. package/dist/esm/v1/index.mjs +3 -0
  36. package/dist/esm/v1/index.mjs.map +1 -0
  37. package/dist/esm/v1/index.native.js +3 -0
  38. package/dist/esm/v1/index.native.js.map +1 -0
  39. package/dist/esm/v1/types.js +1 -0
  40. package/dist/esm/v1/types.js.map +6 -0
  41. package/dist/esm/v1/types.mjs +2 -0
  42. package/dist/esm/v1/types.mjs.map +1 -0
  43. package/dist/esm/v1/types.native.js +2 -0
  44. package/dist/esm/v1/types.native.js.map +1 -0
  45. package/dist/jsx/v1/Input.js +151 -0
  46. package/dist/jsx/v1/Input.js.map +6 -0
  47. package/dist/jsx/v1/Input.mjs +156 -0
  48. package/dist/jsx/v1/Input.mjs.map +1 -0
  49. package/dist/jsx/v1/Input.native.js +138 -0
  50. package/dist/jsx/v1/Input.native.js.map +1 -0
  51. package/dist/jsx/v1/TextArea.js +29 -0
  52. package/dist/jsx/v1/TextArea.js.map +6 -0
  53. package/dist/jsx/v1/TextArea.mjs +27 -0
  54. package/dist/jsx/v1/TextArea.mjs.map +1 -0
  55. package/dist/jsx/v1/TextArea.native.js +53 -0
  56. package/dist/jsx/v1/TextArea.native.js.map +1 -0
  57. package/dist/jsx/v1/index.js +3 -0
  58. package/dist/jsx/v1/index.js.map +6 -0
  59. package/dist/jsx/v1/index.mjs +3 -0
  60. package/dist/jsx/v1/index.mjs.map +1 -0
  61. package/dist/jsx/v1/index.native.js +22 -0
  62. package/dist/jsx/v1/index.native.js.map +1 -0
  63. package/dist/jsx/v1/types.js +1 -0
  64. package/dist/jsx/v1/types.js.map +6 -0
  65. package/dist/jsx/v1/types.mjs +2 -0
  66. package/dist/jsx/v1/types.mjs.map +1 -0
  67. package/dist/jsx/v1/types.native.js +19 -0
  68. package/dist/jsx/v1/types.native.js.map +1 -0
  69. package/package.json +13 -13
  70. package/types/v1/Input.d.ts.map +1 -0
  71. package/types/v1/Input.native.d.ts.map +1 -0
  72. package/types/v1/TextArea.d.ts.map +1 -0
  73. package/types/v1/index.d.ts.map +1 -0
  74. package/types/v1/types.d.ts.map +1 -0
@@ -0,0 +1,190 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf,
6
+ __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: !0
11
+ });
12
+ },
13
+ __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
15
+ get: () => from[key],
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
26
+ value: mod,
27
+ enumerable: !0
28
+ }) : target, mod)),
29
+ __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
30
+ value: !0
31
+ }), mod);
32
+ var Input_exports = {};
33
+ __export(Input_exports, {
34
+ Input: () => Input
35
+ });
36
+ module.exports = __toCommonJS(Input_exports);
37
+ var import_core = require("@tamagui/core"),
38
+ import_focusable = require("@tamagui/focusable"),
39
+ import_react = __toESM(require("react"), 1),
40
+ import_shared = require("../shared.cjs"),
41
+ import_jsx_runtime = require("react/jsx-runtime");
42
+ const StyledInput = (0, import_core.styled)(import_core.View, import_shared.styledBody[0], import_shared.styledBody[1]),
43
+ Input = StyledInput.styleable((inProps, forwardedRef) => {
44
+ const {
45
+ // some of destructed props are just to avoid passing them to ...rest because they are not in web.
46
+ allowFontScaling,
47
+ selectTextOnFocus,
48
+ showSoftInputOnFocus,
49
+ textContentType,
50
+ passwordRules,
51
+ textBreakStrategy,
52
+ underlineColorAndroid,
53
+ selection,
54
+ lineBreakStrategyIOS,
55
+ returnKeyLabel,
56
+ disabled,
57
+ onSubmitEditing,
58
+ caretHidden,
59
+ clearButtonMode,
60
+ clearTextOnFocus,
61
+ contextMenuHidden,
62
+ dataDetectorTypes,
63
+ id,
64
+ enablesReturnKeyAutomatically,
65
+ importantForAutofill,
66
+ inlineImageLeft,
67
+ inlineImagePadding,
68
+ inputAccessoryViewID,
69
+ keyboardAppearance,
70
+ keyboardType,
71
+ cursorColor,
72
+ disableFullscreenUI,
73
+ editable,
74
+ maxFontSizeMultiplier,
75
+ multiline,
76
+ numberOfLines,
77
+ onChangeText,
78
+ onContentSizeChange,
79
+ onEndEditing,
80
+ onScroll,
81
+ onSelectionChange,
82
+ // @ts-ignore
83
+ caretColor,
84
+ placeholderTextColor,
85
+ blurOnSubmit,
86
+ enterKeyHint,
87
+ returnKeyType,
88
+ rejectResponderTermination,
89
+ scrollEnabled,
90
+ secureTextEntry,
91
+ selectionColor,
92
+ inputMode,
93
+ ...rest
94
+ } = inProps,
95
+ ref = import_react.default.useRef(null),
96
+ theme = (0, import_core.useTheme)(),
97
+ composedRefs = (0, import_core.useComposedRefs)(forwardedRef, ref),
98
+ _onSelectionChange = (0, import_core.useEvent)(() => {
99
+ const start = ref.current?.selectionStart ?? 0,
100
+ end = ref.current?.selectionEnd ?? 0;
101
+ onSelectionChange?.({
102
+ nativeEvent: {
103
+ selection: {
104
+ end,
105
+ start
106
+ }
107
+ }
108
+ });
109
+ });
110
+ import_react.default.useEffect(() => {
111
+ if (onSelectionChange) return ref.current?.addEventListener("selectionchange", _onSelectionChange), () => {
112
+ ref.current?.removeEventListener("selectionchange", _onSelectionChange);
113
+ };
114
+ }, []), import_react.default.useEffect(() => {
115
+ selection && ref.current?.setSelectionRange(selection.start || null, selection.end || null);
116
+ }, [selection?.start, selection?.end]);
117
+ const finalProps = {
118
+ ...rest,
119
+ disabled,
120
+ caretColor,
121
+ id,
122
+ enterKeyHint,
123
+ type: (() => {
124
+ if (rest?.type) return rest.type;
125
+ if (secureTextEntry) return "password";
126
+ switch (keyboardType) {
127
+ case "number-pad":
128
+ case "numeric":
129
+ return "number";
130
+ case "email-address":
131
+ return "email";
132
+ case "phone-pad":
133
+ return "tel";
134
+ case "url":
135
+ return "url";
136
+ default:
137
+ return "text";
138
+ }
139
+ })(),
140
+ inputMode: (() => {
141
+ switch (keyboardType) {
142
+ case "number-pad":
143
+ case "numeric":
144
+ return "numeric";
145
+ case "decimal-pad":
146
+ return "decimal";
147
+ case "email-address":
148
+ return "email";
149
+ case "phone-pad":
150
+ return "tel";
151
+ case "url":
152
+ return "url";
153
+ default:
154
+ return;
155
+ }
156
+ })(),
157
+ style: {
158
+ ...rest.style,
159
+ ...(placeholderTextColor && {
160
+ "--placeholderColor": theme[placeholderTextColor]?.variable || placeholderTextColor
161
+ }),
162
+ ...(selectionColor && {
163
+ "--selectionColor": theme[selectionColor]?.variable || selectionColor
164
+ })
165
+ }
166
+ };
167
+ return import_react.default.useEffect(() => {
168
+ if (id && !disabled) return (0, import_focusable.registerFocusable)(id, {
169
+ focusAndSelect: () => {
170
+ ref.current?.focus();
171
+ },
172
+ focus: () => {}
173
+ });
174
+ }, [id, disabled]), /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
175
+ children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)("style", {
176
+ children: `
177
+ input::selection, textarea::selection {
178
+ background-color: var(--selectionBackground) !important;
179
+ }
180
+
181
+ input::placeholder, textarea::placeholder {
182
+ color: var(--placeholderColor) !important;
183
+ }
184
+ `
185
+ }), /* @__PURE__ */(0, import_jsx_runtime.jsx)(StyledInput, {
186
+ ref: composedRefs,
187
+ ...finalProps
188
+ })]
189
+ });
190
+ });
@@ -0,0 +1,171 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: !0 });
9
+ }, __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from == "object" || typeof from == "function")
11
+ for (let key of __getOwnPropNames(from))
12
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ return to;
14
+ };
15
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
16
+ // If the importer is in node compatibility mode or this is not an ESM
17
+ // file that has been converted to a CommonJS file using a Babel-
18
+ // compatible transform (i.e. "__esModule" has not been set), then set
19
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
21
+ mod
22
+ )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
23
+ var Input_exports = {};
24
+ __export(Input_exports, {
25
+ Input: () => Input
26
+ });
27
+ module.exports = __toCommonJS(Input_exports);
28
+ var import_core = require("@tamagui/core"), import_focusable = require("@tamagui/focusable"), import_react = __toESM(require("react"), 1), import_shared = require("../shared"), import_jsx_runtime = require("react/jsx-runtime");
29
+ const StyledInput = (0, import_core.styled)(import_core.View, import_shared.styledBody[0], import_shared.styledBody[1]), Input = StyledInput.styleable((inProps, forwardedRef) => {
30
+ const {
31
+ // some of destructed props are just to avoid passing them to ...rest because they are not in web.
32
+ allowFontScaling,
33
+ selectTextOnFocus,
34
+ showSoftInputOnFocus,
35
+ textContentType,
36
+ passwordRules,
37
+ textBreakStrategy,
38
+ underlineColorAndroid,
39
+ selection,
40
+ lineBreakStrategyIOS,
41
+ returnKeyLabel,
42
+ disabled,
43
+ onSubmitEditing,
44
+ caretHidden,
45
+ clearButtonMode,
46
+ clearTextOnFocus,
47
+ contextMenuHidden,
48
+ dataDetectorTypes,
49
+ id,
50
+ enablesReturnKeyAutomatically,
51
+ importantForAutofill,
52
+ inlineImageLeft,
53
+ inlineImagePadding,
54
+ inputAccessoryViewID,
55
+ keyboardAppearance,
56
+ keyboardType,
57
+ cursorColor,
58
+ disableFullscreenUI,
59
+ editable,
60
+ maxFontSizeMultiplier,
61
+ multiline,
62
+ numberOfLines,
63
+ onChangeText,
64
+ onContentSizeChange,
65
+ onEndEditing,
66
+ onScroll,
67
+ onSelectionChange,
68
+ // @ts-ignore
69
+ caretColor,
70
+ placeholderTextColor,
71
+ blurOnSubmit,
72
+ enterKeyHint,
73
+ returnKeyType,
74
+ rejectResponderTermination,
75
+ scrollEnabled,
76
+ secureTextEntry,
77
+ selectionColor,
78
+ inputMode,
79
+ ...rest
80
+ } = inProps, ref = import_react.default.useRef(null), theme = (0, import_core.useTheme)(), composedRefs = (0, import_core.useComposedRefs)(forwardedRef, ref), _onSelectionChange = (0, import_core.useEvent)(() => {
81
+ const start = ref.current?.selectionStart ?? 0, end = ref.current?.selectionEnd ?? 0;
82
+ onSelectionChange?.({
83
+ nativeEvent: {
84
+ selection: {
85
+ end,
86
+ start
87
+ }
88
+ }
89
+ });
90
+ });
91
+ import_react.default.useEffect(() => {
92
+ if (onSelectionChange)
93
+ return ref.current?.addEventListener("selectionchange", _onSelectionChange), () => {
94
+ ref.current?.removeEventListener("selectionchange", _onSelectionChange);
95
+ };
96
+ }, []), import_react.default.useEffect(() => {
97
+ selection && ref.current?.setSelectionRange(selection.start || null, selection.end || null);
98
+ }, [selection?.start, selection?.end]);
99
+ const finalProps = {
100
+ ...rest,
101
+ disabled,
102
+ caretColor,
103
+ id,
104
+ enterKeyHint,
105
+ type: (() => {
106
+ if (rest?.type) return rest.type;
107
+ if (secureTextEntry) return "password";
108
+ switch (keyboardType) {
109
+ case "number-pad":
110
+ case "numeric":
111
+ return "number";
112
+ case "email-address":
113
+ return "email";
114
+ case "phone-pad":
115
+ return "tel";
116
+ case "url":
117
+ return "url";
118
+ default:
119
+ return "text";
120
+ }
121
+ })(),
122
+ inputMode: (() => {
123
+ switch (keyboardType) {
124
+ case "number-pad":
125
+ case "numeric":
126
+ return "numeric";
127
+ case "decimal-pad":
128
+ return "decimal";
129
+ case "email-address":
130
+ return "email";
131
+ case "phone-pad":
132
+ return "tel";
133
+ case "url":
134
+ return "url";
135
+ default:
136
+ return;
137
+ }
138
+ })(),
139
+ style: {
140
+ ...rest.style,
141
+ ...placeholderTextColor && {
142
+ "--placeholderColor": theme[placeholderTextColor]?.variable || placeholderTextColor
143
+ },
144
+ ...selectionColor && {
145
+ "--selectionColor": theme[selectionColor]?.variable || selectionColor
146
+ }
147
+ }
148
+ };
149
+ return import_react.default.useEffect(() => {
150
+ if (id && !disabled)
151
+ return (0, import_focusable.registerFocusable)(id, {
152
+ focusAndSelect: () => {
153
+ ref.current?.focus();
154
+ },
155
+ focus: () => {
156
+ }
157
+ });
158
+ }, [id, disabled]), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
159
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { children: `
160
+ input::selection, textarea::selection {
161
+ background-color: var(--selectionBackground) !important;
162
+ }
163
+
164
+ input::placeholder, textarea::placeholder {
165
+ color: var(--placeholderColor) !important;
166
+ }
167
+ ` }),
168
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledInput, { ref: composedRefs, ...finalProps })
169
+ ] });
170
+ });
171
+ //# sourceMappingURL=Input.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/v1/Input.tsx"],
4
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;A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B,CAAC;AAAA,EACH,GAAG,CAAC,IAAI,QAAQ,CAAC,GAGf,4EAEI;AAAA,gDAAC,WACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SASH;AAAA,IAGF,4CAAC,eAAY,KAAK,cAAe,GAAG,YAAY;AAAA,KAClD;AAEJ,CAAC;",
5
+ "names": ["React"]
6
+ }
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf,
8
+ __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all) __defProp(target, name, {
11
+ get: all[name],
12
+ enumerable: !0
13
+ });
14
+ },
15
+ __copyProps = (to, from, except, desc) => {
16
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
17
+ get: () => from[key],
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
+ // If the importer is in node compatibility mode or this is not an ESM
24
+ // file that has been converted to a CommonJS file using a Babel-
25
+ // compatible transform (i.e. "__esModule" has not been set), then set
26
+ // "default" to the CommonJS "module.exports" for node compatibility.
27
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
+ value: mod,
29
+ enumerable: !0
30
+ }) : target, mod)),
31
+ __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
+ value: !0
33
+ }), mod);
34
+ var Input_native_exports = {};
35
+ __export(Input_native_exports, {
36
+ Input: () => Input
37
+ });
38
+ module.exports = __toCommonJS(Input_native_exports);
39
+ var import_jsx_runtime = require("react/jsx-runtime"),
40
+ import_react = __toESM(require("react"), 1),
41
+ import_core = require("@tamagui/core"),
42
+ import_focusable = require("@tamagui/focusable"),
43
+ import_react_native = require("react-native"),
44
+ import_shared = require("../shared.native.js"),
45
+ StyledInput = (0, import_core.styled)(import_react_native.TextInput, import_shared.styledBody[0], import_shared.styledBody[1]),
46
+ Input = StyledInput.styleable(function (inProps, forwardedRef) {
47
+ var {
48
+ // some of destructed props are just to avoid passing them to ...rest because they are not in native.
49
+ type,
50
+ //@ts-ignore
51
+ dirname,
52
+ max,
53
+ min,
54
+ minLength,
55
+ multiple,
56
+ name,
57
+ required,
58
+ step,
59
+ disabled,
60
+ id,
61
+ // @ts-ignore
62
+ caretColor,
63
+ onChange,
64
+ onInput,
65
+ rows,
66
+ enterKeyHint,
67
+ returnKeyType,
68
+ onKeyDown,
69
+ inputMode,
70
+ render,
71
+ ...rest
72
+ } = inProps,
73
+ ref = import_react.default.useRef(null),
74
+ composedRefs = (0, import_core.useComposedRefs)(forwardedRef, ref),
75
+ secureTextEntry = !1,
76
+ cursorColor = caretColor,
77
+ _returnKeyType = returnKeyType,
78
+ _enterKeyHint = enterKeyHint;
79
+ enterKeyHint === "go" && (_returnKeyType = "go", _enterKeyHint = void 0);
80
+ var _inputMode = inputMode;
81
+ type === "email" ? _inputMode = "email" : type === "tel" ? _inputMode = "tel" : type === "search" ? _inputMode = "search" : type === "url" ? _inputMode = "url" : type === "password" ? (secureTextEntry = !0, _inputMode = "text") : type === "number" ? _inputMode = "numeric" : _inputMode = "text";
82
+ var showSoftInputOnFocus = !0;
83
+ inputMode === "none" && (showSoftInputOnFocus = !1);
84
+ var finalProps = {
85
+ ...rest,
86
+ inputMode: _inputMode,
87
+ showSoftInputOnFocus,
88
+ disabled,
89
+ id,
90
+ cursorColor,
91
+ enterKeyHint: _enterKeyHint,
92
+ returnKeyType: _returnKeyType,
93
+ secureTextEntry,
94
+ numberOfLines: rows || rest.numberOfLines
95
+ };
96
+ return render === "textarea" && (finalProps.multiline = !0), onKeyDown && (finalProps.onKeyPress = function (e) {
97
+ var {
98
+ key
99
+ } = e.nativeEvent;
100
+ (key === "Backspace" || render === "textarea" && key === "Enter" || key.length === 1) && onKeyDown({
101
+ key,
102
+ type: "keydown"
103
+ });
104
+ }, finalProps.onSubmitEditing = function (e) {
105
+ onKeyDown({
106
+ key: "Enter",
107
+ type: "keydown"
108
+ });
109
+ }), (onChange || onInput) && (finalProps.onChange = function (e) {
110
+ var {
111
+ text
112
+ } = e.nativeEvent;
113
+ onChange && onChange({
114
+ target: {
115
+ value: text
116
+ },
117
+ type: "change"
118
+ }), onInput?.({
119
+ target: {
120
+ value: text
121
+ },
122
+ type: "input"
123
+ });
124
+ }), import_react.default.useEffect(function () {
125
+ if (id && !disabled) return (0, import_focusable.registerFocusable)(id, {
126
+ focusAndSelect: function () {
127
+ var _ref_current;
128
+ (_ref_current = ref.current) === null || _ref_current === void 0 || _ref_current.focus();
129
+ },
130
+ focus: function () {}
131
+ });
132
+ }, [id, disabled]), /* @__PURE__ */(0, import_jsx_runtime.jsx)(StyledInput, {
133
+ onChange: function (e) {},
134
+ ref: composedRefs,
135
+ ...finalProps
136
+ });
137
+ });
138
+ //# sourceMappingURL=Input.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Input_native_exports","__export","Input","module","exports","__toCommonJS","import_jsx_runtime","require","import_react","__toESM","import_core","import_focusable","import_react_native","import_shared","StyledInput","styled","TextInput","styledBody","styleable","inProps","forwardedRef","type","dirname","max","min","minLength","multiple","name","required","step","disabled","id","caretColor","onChange","onInput","rows","enterKeyHint","returnKeyType","onKeyDown","inputMode","render","rest","ref","default","useRef","composedRefs","useComposedRefs","secureTextEntry","cursorColor","_returnKeyType","_enterKeyHint","_inputMode","showSoftInputOnFocus","finalProps","numberOfLines","multiline","onKeyPress","e","key","nativeEvent","length","onSubmitEditing","text","target","value","useEffect","registerFocusable","focusAndSelect","_ref_current","current","focus","jsx"],"sources":["../../../src/v1/Input.native.tsx"],"sourcesContent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AAA,IACAA,QAAA,CAAS;QACL8B,MAAA,EAAQ;UACJC,KAAA,EAAOF;QACX;QACAzC,IAAA,EAAM;MACV,CAAC,GAGDa,OAAA,GAAQ;QACJ6B,MAAA,EAAQ;UACJC,KAAA,EAAOF;QACX;QACAzC,IAAA,EAAM;MACV,CAAC;IAET,IAEJb,YAAA,CAAAmC,OAAA,CAAMsB,SAAA,CAAU,YAAW;MACvB,IAAKlC,EAAA,IACD,CAAAD,QAAA,EACJ,WAAOnB,gBAAA,CAAAuD,iBAAA,EAAkBnC,EAAA,EAAI;QACzBoC,cAAA,EAAgB,SAAAA,CAAA,EAAW;UACvB,IAAIC,YAAA;UACJ,CAACA,YAAA,GAAe1B,GAAA,CAAI2B,OAAA,MAAa,QAAQD,YAAA,KAAiB,UAAkBA,YAAA,CAAaE,KAAA,CAAM;QACnG;QACAA,KAAA,EAAO,SAAAA,CAAA,EAAW,CAAC;MACvB,CAAC;IACL,GAAG,CACCvC,EAAA,EACAD,QAAA,CACH,GACoB,mBAAAxB,kBAAA,CAAAiE,GAAA,EAAKzD,WAAA,EAAa;MACnCmB,QAAA,EAAU,SAAAA,CAASwB,CAAA,EAAG,CAAC;MACvBf,GAAA,EAAKG,YAAA;MACL,GAAGQ;IACP,CAAC;EACL,CAAC","ignoreList":[]}
@@ -0,0 +1,50 @@
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) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: !0
9
+ });
10
+ },
11
+ __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
+ get: () => from[key],
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ return to;
17
+ };
18
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
+ value: !0
20
+ }), mod);
21
+ var TextArea_exports = {};
22
+ __export(TextArea_exports, {
23
+ TextArea: () => TextArea
24
+ });
25
+ module.exports = __toCommonJS(TextArea_exports);
26
+ var import_web = require("@tamagui/web"),
27
+ import_Input = require("./Input.cjs"),
28
+ import_shared = require("../shared.cjs");
29
+ const TextArea = (0, import_web.styled)(import_Input.Input, {
30
+ name: "TextArea",
31
+ render: "textarea",
32
+ // this attribute fixes firefox newline issue
33
+ // @ts-ignore
34
+ whiteSpace: "pre-wrap",
35
+ variants: {
36
+ unstyled: {
37
+ false: {
38
+ height: "auto",
39
+ ...import_shared.defaultStyles,
40
+ numberOfLines: 3
41
+ }
42
+ },
43
+ size: {
44
+ "...size": import_shared.textAreaSizeVariant
45
+ }
46
+ },
47
+ defaultVariants: {
48
+ unstyled: process.env.TAMAGUI_HEADLESS === "1"
49
+ }
50
+ });
@@ -0,0 +1,43 @@
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: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
10
+ for (let key of __getOwnPropNames(from))
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
+ var TextArea_exports = {};
16
+ __export(TextArea_exports, {
17
+ TextArea: () => TextArea
18
+ });
19
+ module.exports = __toCommonJS(TextArea_exports);
20
+ var import_web = require("@tamagui/web"), import_Input = require("./Input"), import_shared = require("../shared");
21
+ const TextArea = (0, import_web.styled)(import_Input.Input, {
22
+ name: "TextArea",
23
+ render: "textarea",
24
+ // this attribute fixes firefox newline issue
25
+ // @ts-ignore
26
+ whiteSpace: "pre-wrap",
27
+ variants: {
28
+ unstyled: {
29
+ false: {
30
+ height: "auto",
31
+ ...import_shared.defaultStyles,
32
+ numberOfLines: 3
33
+ }
34
+ },
35
+ size: {
36
+ "...size": import_shared.textAreaSizeVariant
37
+ }
38
+ },
39
+ defaultVariants: {
40
+ unstyled: process.env.TAMAGUI_HEADLESS === "1"
41
+ }
42
+ });
43
+ //# sourceMappingURL=TextArea.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/v1/TextArea.tsx"],
4
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAuB,yBACvB,eAAsB,oBACtB,gBAAmD;AAO5C,MAAM,eAAW,mBAAO,oBAAO;AAAA,EACpC,MAAM;AAAA,EACN,QAAQ;AAAA;AAAA;AAAA,EAIR,YAAY;AAAA,EAEZ,UAAU;AAAA,IACR,UAAU;AAAA,MACR,OAAO;AAAA,QACL,QAAQ;AAAA,QACR,GAAG;AAAA,QACH,eAAe;AAAA,MACjB;AAAA,IACF;AAAA,IAEA,MAAM;AAAA,MACJ,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EAEA,iBAAiB;AAAA,IACf,UAAU,QAAQ,IAAI,qBAAqB;AAAA,EAC7C;AACF,CAAC;",
5
+ "names": []
6
+ }
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: !0
11
+ });
12
+ },
13
+ __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
15
+ get: () => from[key],
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ return to;
19
+ };
20
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
+ value: !0
22
+ }), mod);
23
+ var TextArea_exports = {};
24
+ __export(TextArea_exports, {
25
+ TextArea: () => TextArea
26
+ });
27
+ module.exports = __toCommonJS(TextArea_exports);
28
+ var import_web = require("@tamagui/web"),
29
+ import_Input = require("./Input.native.js"),
30
+ import_shared = require("../shared.native.js"),
31
+ TextArea = (0, import_web.styled)(import_Input.Input, {
32
+ name: "TextArea",
33
+ render: "textarea",
34
+ // this attribute fixes firefox newline issue
35
+ // @ts-ignore
36
+ whiteSpace: "pre-wrap",
37
+ variants: {
38
+ unstyled: {
39
+ false: {
40
+ height: "auto",
41
+ ...import_shared.defaultStyles,
42
+ numberOfLines: 3
43
+ }
44
+ },
45
+ size: {
46
+ "...size": import_shared.textAreaSizeVariant
47
+ }
48
+ },
49
+ defaultVariants: {
50
+ unstyled: process.env.TAMAGUI_HEADLESS === "1"
51
+ }
52
+ });
53
+ //# sourceMappingURL=TextArea.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","TextArea_exports","__export","TextArea","module","exports","import_web","require","import_Input","import_shared","styled","Input","name","render","whiteSpace","variants","unstyled","false","height","defaultStyles","numberOfLines","size","textAreaSizeVariant","defaultVariants","process","env","TAMAGUI_HEADLESS"],"sources":["../../../src/v1/TextArea.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,gBAAA;AAAAC,QAAA,CAAAD,gBAAA;EAAAE,QAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAuBT,YAAA,CAAAK,gBACvB;AAQO,IAAAK,UAAM,GAAAC,OAAW,gBAAO;EAAAC,YAAA,GAAAD,OAAO;EAAAE,aAAA,GAAAF,OAAA;EAAAJ,QAAA,OAAAG,UAAA,CAAAI,MAAA,EAAAF,YAAA,CAAAG,KAAA;IACpCC,IAAA,EAAM;IACNC,MAAA,EAAQ;IAAA;IAAA;IAIRC,UAAA,EAAY;IAEZC,QAAA,EAAU;MACRC,QAAA,EAAU;QACRC,KAAA,EAAO;UACLC,MAAA,EAAQ;UACR,GAAGT,aAAA,CAAAU,aAAA;UACHC,aAAA,EAAe;QACjB;MACF;MAEAC,IAAA,EAAM;QACJ,WAAWZ,aAAA,CAAAa;MACb;IACF;IAEAC,eAAA,EAAiB;MACfP,QAAA,EAAUQ,OAAA,CAAQC,GAAA,CAAIC,gBAAA,KAAqB;IAC7C;EACF,CAAC","ignoreList":[]}