@tamagui/input 2.7.7 → 3.0.0-beta.643.1

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 (168) hide show
  1. package/dist/cjs/Input.cjs +78 -162
  2. package/dist/cjs/Input.native.cjs +209 -0
  3. package/dist/cjs/Input.native.js +186 -282
  4. package/dist/cjs/Input.native.js.map +1 -1
  5. package/dist/cjs/InputNativeProps.cjs +10 -11
  6. package/dist/cjs/InputNativeProps.native.cjs +19 -0
  7. package/dist/cjs/InputNativeProps.native.js +10 -10
  8. package/dist/cjs/InputNativeProps.native.js.map +1 -1
  9. package/dist/cjs/TextArea.cjs +25 -38
  10. package/dist/cjs/TextArea.native.cjs +41 -0
  11. package/dist/cjs/TextArea.native.js +25 -37
  12. package/dist/cjs/TextArea.native.js.map +1 -1
  13. package/dist/cjs/index.cjs +16 -17
  14. package/dist/cjs/index.native.cjs +33 -0
  15. package/dist/cjs/index.native.js +16 -16
  16. package/dist/cjs/index.native.js.map +1 -1
  17. package/dist/cjs/shared.cjs +115 -122
  18. package/dist/cjs/shared.native.cjs +144 -0
  19. package/dist/cjs/shared.native.js +120 -126
  20. package/dist/cjs/shared.native.js.map +1 -1
  21. package/dist/cjs/types.cjs +10 -11
  22. package/dist/cjs/types.native.cjs +19 -0
  23. package/dist/cjs/types.native.js +10 -10
  24. package/dist/cjs/types.native.js.map +1 -1
  25. package/dist/esm/Input.mjs +63 -137
  26. package/dist/esm/Input.mjs.map +1 -1
  27. package/dist/esm/Input.native.js +172 -259
  28. package/dist/esm/Input.native.js.map +1 -1
  29. package/dist/esm/InputNativeProps.mjs +0 -2
  30. package/dist/esm/InputNativeProps.native.js +0 -2
  31. package/dist/esm/TextArea.mjs +12 -20
  32. package/dist/esm/TextArea.mjs.map +1 -1
  33. package/dist/esm/TextArea.native.js +12 -20
  34. package/dist/esm/TextArea.native.js.map +1 -1
  35. package/dist/esm/index.js +6 -4
  36. package/dist/esm/index.mjs +6 -4
  37. package/dist/esm/index.native.js +6 -4
  38. package/dist/esm/shared.mjs +99 -104
  39. package/dist/esm/shared.mjs.map +1 -1
  40. package/dist/esm/shared.native.js +104 -109
  41. package/dist/esm/shared.native.js.map +1 -1
  42. package/dist/esm/types.mjs +0 -2
  43. package/dist/esm/types.native.js +0 -2
  44. package/dist/jsx/Input.mjs +63 -137
  45. package/dist/jsx/Input.mjs.map +1 -1
  46. package/dist/jsx/Input.native.cjs +209 -0
  47. package/dist/jsx/Input.native.js +186 -282
  48. package/dist/jsx/Input.native.js.map +1 -1
  49. package/dist/jsx/InputNativeProps.mjs +0 -2
  50. package/dist/jsx/InputNativeProps.native.cjs +19 -0
  51. package/dist/jsx/InputNativeProps.native.js +10 -10
  52. package/dist/jsx/InputNativeProps.native.js.map +1 -1
  53. package/dist/jsx/TextArea.mjs +12 -20
  54. package/dist/jsx/TextArea.mjs.map +1 -1
  55. package/dist/jsx/TextArea.native.cjs +41 -0
  56. package/dist/jsx/TextArea.native.js +25 -37
  57. package/dist/jsx/TextArea.native.js.map +1 -1
  58. package/dist/jsx/index.js +6 -4
  59. package/dist/jsx/index.mjs +6 -4
  60. package/dist/jsx/index.native.cjs +33 -0
  61. package/dist/jsx/index.native.js +16 -16
  62. package/dist/jsx/index.native.js.map +1 -1
  63. package/dist/jsx/shared.mjs +99 -104
  64. package/dist/jsx/shared.mjs.map +1 -1
  65. package/dist/jsx/shared.native.cjs +144 -0
  66. package/dist/jsx/shared.native.js +120 -126
  67. package/dist/jsx/shared.native.js.map +1 -1
  68. package/dist/jsx/types.mjs +0 -2
  69. package/dist/jsx/types.native.cjs +19 -0
  70. package/dist/jsx/types.native.js +10 -10
  71. package/dist/jsx/types.native.js.map +1 -1
  72. package/package.json +13 -15
  73. package/src/Input.native.tsx +263 -240
  74. package/src/Input.tsx +162 -152
  75. package/src/TextArea.tsx +6 -14
  76. package/src/shared.tsx +65 -70
  77. package/src/types.ts +1 -1
  78. package/types/Input.d.ts +57 -41
  79. package/types/Input.d.ts.map +1 -1
  80. package/types/Input.native.d.ts +57 -41
  81. package/types/Input.native.d.ts.map +1 -1
  82. package/types/TextArea.d.ts +172 -24
  83. package/types/TextArea.d.ts.map +1 -1
  84. package/types/shared.d.ts +14 -99
  85. package/types/shared.d.ts.map +1 -1
  86. package/types/types.d.ts +1 -1
  87. package/dist/cjs/inputTypes.test-d.cjs +0 -128
  88. package/dist/cjs/inputTypes.test-d.native.js +0 -131
  89. package/dist/cjs/inputTypes.test-d.native.js.map +0 -1
  90. package/dist/cjs/v1/Input.cjs +0 -200
  91. package/dist/cjs/v1/Input.native.js +0 -183
  92. package/dist/cjs/v1/Input.native.js.map +0 -1
  93. package/dist/cjs/v1/TextArea.cjs +0 -52
  94. package/dist/cjs/v1/TextArea.native.js +0 -55
  95. package/dist/cjs/v1/TextArea.native.js.map +0 -1
  96. package/dist/cjs/v1/index.cjs +0 -21
  97. package/dist/cjs/v1/index.native.js +0 -24
  98. package/dist/cjs/v1/index.native.js.map +0 -1
  99. package/dist/cjs/v1/types.cjs +0 -18
  100. package/dist/cjs/v1/types.native.js +0 -21
  101. package/dist/cjs/v1/types.native.js.map +0 -1
  102. package/dist/esm/InputNativeProps.mjs.map +0 -1
  103. package/dist/esm/InputNativeProps.native.js.map +0 -1
  104. package/dist/esm/index.js.map +0 -1
  105. package/dist/esm/index.mjs.map +0 -1
  106. package/dist/esm/index.native.js.map +0 -1
  107. package/dist/esm/inputTypes.test-d.mjs +0 -129
  108. package/dist/esm/inputTypes.test-d.mjs.map +0 -1
  109. package/dist/esm/inputTypes.test-d.native.js +0 -129
  110. package/dist/esm/inputTypes.test-d.native.js.map +0 -1
  111. package/dist/esm/types.mjs.map +0 -1
  112. package/dist/esm/types.native.js.map +0 -1
  113. package/dist/esm/v1/Input.mjs +0 -164
  114. package/dist/esm/v1/Input.mjs.map +0 -1
  115. package/dist/esm/v1/Input.native.js +0 -144
  116. package/dist/esm/v1/Input.native.js.map +0 -1
  117. package/dist/esm/v1/TextArea.mjs +0 -27
  118. package/dist/esm/v1/TextArea.mjs.map +0 -1
  119. package/dist/esm/v1/TextArea.native.js +0 -27
  120. package/dist/esm/v1/TextArea.native.js.map +0 -1
  121. package/dist/esm/v1/index.mjs +0 -3
  122. package/dist/esm/v1/index.mjs.map +0 -1
  123. package/dist/esm/v1/index.native.js +0 -3
  124. package/dist/esm/v1/index.native.js.map +0 -1
  125. package/dist/esm/v1/types.mjs +0 -2
  126. package/dist/esm/v1/types.mjs.map +0 -1
  127. package/dist/esm/v1/types.native.js +0 -2
  128. package/dist/esm/v1/types.native.js.map +0 -1
  129. package/dist/jsx/InputNativeProps.mjs.map +0 -1
  130. package/dist/jsx/index.js.map +0 -1
  131. package/dist/jsx/index.mjs.map +0 -1
  132. package/dist/jsx/inputTypes.test-d.mjs +0 -129
  133. package/dist/jsx/inputTypes.test-d.mjs.map +0 -1
  134. package/dist/jsx/inputTypes.test-d.native.js +0 -131
  135. package/dist/jsx/inputTypes.test-d.native.js.map +0 -1
  136. package/dist/jsx/types.mjs.map +0 -1
  137. package/dist/jsx/v1/Input.mjs +0 -164
  138. package/dist/jsx/v1/Input.mjs.map +0 -1
  139. package/dist/jsx/v1/Input.native.js +0 -183
  140. package/dist/jsx/v1/Input.native.js.map +0 -1
  141. package/dist/jsx/v1/TextArea.mjs +0 -27
  142. package/dist/jsx/v1/TextArea.mjs.map +0 -1
  143. package/dist/jsx/v1/TextArea.native.js +0 -55
  144. package/dist/jsx/v1/TextArea.native.js.map +0 -1
  145. package/dist/jsx/v1/index.mjs +0 -3
  146. package/dist/jsx/v1/index.mjs.map +0 -1
  147. package/dist/jsx/v1/index.native.js +0 -24
  148. package/dist/jsx/v1/index.native.js.map +0 -1
  149. package/dist/jsx/v1/types.mjs +0 -2
  150. package/dist/jsx/v1/types.mjs.map +0 -1
  151. package/dist/jsx/v1/types.native.js +0 -21
  152. package/dist/jsx/v1/types.native.js.map +0 -1
  153. package/src/inputTypes.test-d.ts +0 -245
  154. package/src/v1/Input.native.tsx +0 -153
  155. package/src/v1/Input.tsx +0 -190
  156. package/src/v1/TextArea.tsx +0 -35
  157. package/src/v1/index.ts +0 -3
  158. package/src/v1/types.ts +0 -65
  159. package/types/v1/Input.d.ts +0 -64
  160. package/types/v1/Input.d.ts.map +0 -1
  161. package/types/v1/Input.native.d.ts +0 -63
  162. package/types/v1/Input.native.d.ts.map +0 -1
  163. package/types/v1/TextArea.d.ts +0 -41
  164. package/types/v1/TextArea.d.ts.map +0 -1
  165. package/types/v1/index.d.ts +0 -4
  166. package/types/v1/index.d.ts.map +0 -1
  167. package/types/v1/types.d.ts +0 -39
  168. package/types/v1/types.d.ts.map +0 -1
@@ -0,0 +1,144 @@
1
+ "use strict";
2
+
3
+
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all) __defProp(target, name, {
10
+ get: all[name],
11
+ enumerable: true
12
+ });
13
+ };
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
+ get: () => from[key],
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
22
+ };
23
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
24
+ var shared_exports = {};
25
+ __export(shared_exports, {
26
+ INPUT_NAME: () => INPUT_NAME,
27
+ defaultStyles: () => defaultStyles,
28
+ inputSizeVariant: () => inputSizeVariant,
29
+ styledBody: () => styledBody,
30
+ textAreaSizeVariant: () => textAreaSizeVariant
31
+ });
32
+ module.exports = __toCommonJS(shared_exports);
33
+ var import_core = require("@tamagui/core");
34
+ var import_core2 = require("@tamagui/core");
35
+ var import_get_font_sized = require("@tamagui/get-font-sized");
36
+ var defaultStyles = {
37
+ size: true,
38
+ outlineWidth: 0,
39
+ tabIndex: 0,
40
+ minWidth: 0
41
+ };
42
+ var resolveInputFrame = function(val, extras) {
43
+ return (0, import_core2.resolveTokenSize)(val, {
44
+ tokens: extras.tokens,
45
+ font: extras.font
46
+ }).frame;
47
+ };
48
+ var inputSizeKeys = [
49
+ "0",
50
+ "0-25",
51
+ "0-5",
52
+ "0-75",
53
+ "1",
54
+ "1-5",
55
+ "2",
56
+ "2-5",
57
+ "3",
58
+ "3-5",
59
+ "4",
60
+ "4-5",
61
+ "5",
62
+ "6",
63
+ "7",
64
+ "8",
65
+ "9",
66
+ "10",
67
+ "11",
68
+ "12",
69
+ "13",
70
+ "14",
71
+ "15",
72
+ "16",
73
+ "17",
74
+ "18",
75
+ "19",
76
+ "20"
77
+ ];
78
+ var getInputPadding = function(val, extras, steps) {
79
+ if (typeof val === "number") {
80
+ return steps === 1 ? Math.max(0, Math.round(val * .6 - 12)) : Math.max(0, Math.round(val * .52 - 11.5));
81
+ }
82
+ var key = val === true ? "4" : val;
83
+ var index = inputSizeKeys.indexOf(key);
84
+ return extras.tokens.space[inputSizeKeys[Math.max(0, index - steps)]];
85
+ };
86
+ var inputSizeVariant = function() {
87
+ var val = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true, extras = arguments.length > 1 ? arguments[1] : void 0;
88
+ if (extras.props.tag === "textarea" || extras.props.rows > 1 || extras.props.multiline || extras.props.numberOfLines > 1) {
89
+ return textAreaSizeVariant(val, extras);
90
+ }
91
+ var frame = resolveInputFrame(val, extras);
92
+ var fontStyle = (0, import_get_font_sized.getFontSized)(val, extras);
93
+ if (!import_core2.isWeb && fontStyle) {
94
+ delete fontStyle["lineHeight"];
95
+ }
96
+ return {
97
+ ...fontStyle,
98
+ height: frame.size,
99
+ borderRadius: frame.radius,
100
+ paddingHorizontal: getInputPadding(val, extras, 1)
101
+ };
102
+ };
103
+ var textAreaSizeVariant = function() {
104
+ var val = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true, extras = arguments.length > 1 ? arguments[1] : void 0;
105
+ var { props } = extras;
106
+ var frame = resolveInputFrame(val, extras);
107
+ var fontStyle = (0, import_get_font_sized.getFontSized)(val, extras);
108
+ var _props_rows;
109
+ var lines = (_props_rows = props.rows) !== null && _props_rows !== void 0 ? _props_rows : props.numberOfLines;
110
+ var height = typeof lines === "number" ? lines * (0, import_core2.getVariableValue)(fontStyle.lineHeight) : "auto";
111
+ if (!import_core2.isWeb && fontStyle) {
112
+ delete fontStyle["lineHeight"];
113
+ }
114
+ return {
115
+ borderRadius: frame.radius,
116
+ ...fontStyle,
117
+ paddingVertical: getInputPadding(val, extras, 2),
118
+ paddingHorizontal: getInputPadding(val, extras, 1),
119
+ height
120
+ };
121
+ };
122
+ var INPUT_NAME = "Input";
123
+ var styledBody = [{
124
+ name: INPUT_NAME,
125
+ render: "input",
126
+ ...defaultStyles,
127
+ variants: {
128
+ size: {
129
+ true: inputSizeVariant,
130
+ Size: inputSizeVariant
131
+ },
132
+ disabled: { true: {} }
133
+ }
134
+ }, {
135
+ isInput: true,
136
+ accept: {
137
+ placeholderTextColor: "color",
138
+ selectionColor: "color",
139
+ cursorColor: "color",
140
+ selectionHandleColor: "color",
141
+ underlineColorAndroid: "color"
142
+ },
143
+ validStyles: import_core.Text.staticConfig.validStyles
144
+ }];
@@ -1,152 +1,146 @@
1
1
  "use strict";
2
2
 
3
+
3
4
  var __defProp = Object.defineProperty;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
8
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
11
- });
9
+ for (var name in all) __defProp(target, name, {
10
+ get: all[name],
11
+ enumerable: true
12
+ });
12
13
  };
13
14
  var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
- get: () => from[key],
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
- });
19
- }
20
- return to;
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
+ get: () => from[key],
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
21
22
  };
22
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
23
- value: true
24
- }), mod);
23
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
24
  var shared_exports = {};
26
25
  __export(shared_exports, {
27
- INPUT_NAME: () => INPUT_NAME,
28
- defaultStyles: () => defaultStyles,
29
- inputSizeVariant: () => inputSizeVariant,
30
- styledBody: () => styledBody,
31
- textAreaSizeVariant: () => textAreaSizeVariant
26
+ INPUT_NAME: () => INPUT_NAME,
27
+ defaultStyles: () => defaultStyles,
28
+ inputSizeVariant: () => inputSizeVariant,
29
+ styledBody: () => styledBody,
30
+ textAreaSizeVariant: () => textAreaSizeVariant
32
31
  });
33
32
  module.exports = __toCommonJS(shared_exports);
34
33
  var import_core = require("@tamagui/core");
35
34
  var import_core2 = require("@tamagui/core");
36
- var import_get_button_sized = require("@tamagui/get-button-sized");
37
35
  var import_get_font_sized = require("@tamagui/get-font-sized");
38
- var import_get_token = require("@tamagui/get-token");
39
36
  var defaultStyles = {
40
- size: "$true",
41
- fontFamily: "$body",
42
- borderWidth: 1,
43
- outlineWidth: 0,
44
- color: "$color",
45
- ...(import_core2.isWeb ? {
46
- tabIndex: 0
47
- } : {
48
- focusable: true
49
- }),
50
- borderColor: "$borderColor",
51
- backgroundColor: "$background",
52
- // this fixes a flex bug where it overflows container
53
- minWidth: 0,
54
- hoverStyle: {
55
- borderColor: "$borderColorHover"
56
- },
57
- focusStyle: {
58
- borderColor: "$borderColorFocus"
59
- },
60
- focusVisibleStyle: {
61
- outlineColor: "$outlineColor",
62
- outlineWidth: 2,
63
- outlineStyle: "solid"
64
- }
37
+ size: true,
38
+ outlineWidth: 0,
39
+ tabIndex: 0,
40
+ minWidth: 0
41
+ };
42
+ var resolveInputFrame = function(val, extras) {
43
+ return (0, import_core2.resolveTokenSize)(val, {
44
+ tokens: extras.tokens,
45
+ font: extras.font
46
+ }).frame;
65
47
  };
66
- var inputSizeVariant = function () {
67
- var val = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "$true",
68
- extras = arguments.length > 1 ? arguments[1] : void 0;
69
- if (extras.props.tag === "textarea" || extras.props.rows > 1 || extras.props.multiline || extras.props.numberOfLines > 1) {
70
- return textAreaSizeVariant(val, extras);
71
- }
72
- var buttonStyles = (0, import_get_button_sized.getButtonSized)(val, extras);
73
- var paddingHorizontal = (0, import_get_token.getSpace)(val, {
74
- shift: -1,
75
- bounds: [2]
76
- });
77
- var fontStyle = (0, import_get_font_sized.getFontSized)(val, extras);
78
- if (!import_core2.isWeb && fontStyle) {
79
- delete fontStyle["lineHeight"];
80
- }
81
- return {
82
- ...fontStyle,
83
- ...buttonStyles,
84
- paddingHorizontal
85
- };
48
+ var inputSizeKeys = [
49
+ "0",
50
+ "0-25",
51
+ "0-5",
52
+ "0-75",
53
+ "1",
54
+ "1-5",
55
+ "2",
56
+ "2-5",
57
+ "3",
58
+ "3-5",
59
+ "4",
60
+ "4-5",
61
+ "5",
62
+ "6",
63
+ "7",
64
+ "8",
65
+ "9",
66
+ "10",
67
+ "11",
68
+ "12",
69
+ "13",
70
+ "14",
71
+ "15",
72
+ "16",
73
+ "17",
74
+ "18",
75
+ "19",
76
+ "20"
77
+ ];
78
+ var getInputPadding = function(val, extras, steps) {
79
+ if (typeof val === "number") {
80
+ return steps === 1 ? Math.max(0, Math.round(val * .6 - 12)) : Math.max(0, Math.round(val * .52 - 11.5));
81
+ }
82
+ var key = val === true ? "4" : val;
83
+ var index = inputSizeKeys.indexOf(key);
84
+ return extras.tokens.space[inputSizeKeys[Math.max(0, index - steps)]];
86
85
  };
87
- var textAreaSizeVariant = function () {
88
- var val = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "$true",
89
- extras = arguments.length > 1 ? arguments[1] : void 0;
90
- var {
91
- props
92
- } = extras;
93
- var buttonStyles = (0, import_get_button_sized.getButtonSized)(val, extras);
94
- var fontStyle = (0, import_get_font_sized.getFontSized)(val, extras);
95
- var _props_rows;
96
- var lines = (_props_rows = props.rows) !== null && _props_rows !== void 0 ? _props_rows : props.numberOfLines;
97
- var height = typeof lines === "number" ? lines * (0, import_core2.getVariableValue)(fontStyle.lineHeight) : "auto";
98
- if (!import_core2.isWeb && fontStyle) {
99
- delete fontStyle["lineHeight"];
100
- }
101
- var paddingVertical = (0, import_get_token.getSpace)(val, {
102
- shift: -2,
103
- bounds: [2]
104
- });
105
- var paddingHorizontal = (0, import_get_token.getSpace)(val, {
106
- shift: -1,
107
- bounds: [2]
108
- });
109
- return {
110
- ...buttonStyles,
111
- ...fontStyle,
112
- paddingVertical,
113
- paddingHorizontal,
114
- height
115
- };
86
+ var inputSizeVariant = function() {
87
+ var val = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true, extras = arguments.length > 1 ? arguments[1] : void 0;
88
+ if (extras.props.tag === "textarea" || extras.props.rows > 1 || extras.props.multiline || extras.props.numberOfLines > 1) {
89
+ return textAreaSizeVariant(val, extras);
90
+ }
91
+ var frame = resolveInputFrame(val, extras);
92
+ var fontStyle = (0, import_get_font_sized.getFontSized)(val, extras);
93
+ if (!import_core2.isWeb && fontStyle) {
94
+ delete fontStyle["lineHeight"];
95
+ }
96
+ return {
97
+ ...fontStyle,
98
+ height: frame.size,
99
+ borderRadius: frame.radius,
100
+ paddingHorizontal: getInputPadding(val, extras, 1)
101
+ };
102
+ };
103
+ var textAreaSizeVariant = function() {
104
+ var val = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true, extras = arguments.length > 1 ? arguments[1] : void 0;
105
+ var { props } = extras;
106
+ var frame = resolveInputFrame(val, extras);
107
+ var fontStyle = (0, import_get_font_sized.getFontSized)(val, extras);
108
+ var _props_rows;
109
+ var lines = (_props_rows = props.rows) !== null && _props_rows !== void 0 ? _props_rows : props.numberOfLines;
110
+ var height = typeof lines === "number" ? lines * (0, import_core2.getVariableValue)(fontStyle.lineHeight) : "auto";
111
+ if (!import_core2.isWeb && fontStyle) {
112
+ delete fontStyle["lineHeight"];
113
+ }
114
+ return {
115
+ borderRadius: frame.radius,
116
+ ...fontStyle,
117
+ paddingVertical: getInputPadding(val, extras, 2),
118
+ paddingHorizontal: getInputPadding(val, extras, 1),
119
+ height
120
+ };
116
121
  };
117
122
  var INPUT_NAME = "Input";
118
123
  var styledBody = [{
119
- name: INPUT_NAME,
120
- render: "input",
121
- variants: {
122
- unstyled: {
123
- true: {
124
- // reset browser <input>/<textarea> defaults
125
- outlineWidth: 0,
126
- borderWidth: 0,
127
- backgroundColor: "transparent"
128
- },
129
- false: defaultStyles
130
- },
131
- size: {
132
- "...size": inputSizeVariant
133
- },
134
- disabled: {
135
- true: {}
136
- }
137
- },
138
- defaultVariants: {
139
- unstyled: process.env.TAMAGUI_HEADLESS === "1"
140
- }
124
+ name: INPUT_NAME,
125
+ render: "input",
126
+ ...defaultStyles,
127
+ variants: {
128
+ size: {
129
+ true: inputSizeVariant,
130
+ Size: inputSizeVariant
131
+ },
132
+ disabled: { true: {} }
133
+ }
141
134
  }, {
142
- isInput: true,
143
- accept: {
144
- placeholderTextColor: "color",
145
- selectionColor: "color",
146
- cursorColor: "color",
147
- selectionHandleColor: "color",
148
- underlineColorAndroid: "color"
149
- },
150
- validStyles: import_core.Text.staticConfig.validStyles
135
+ isInput: true,
136
+ accept: {
137
+ placeholderTextColor: "color",
138
+ selectionColor: "color",
139
+ cursorColor: "color",
140
+ selectionHandleColor: "color",
141
+ underlineColorAndroid: "color"
142
+ },
143
+ validStyles: import_core.Text.staticConfig.validStyles
151
144
  }];
145
+
152
146
  //# sourceMappingURL=shared.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","shared_exports","__export","INPUT_NAME","defaultStyles","inputSizeVariant","styledBody","textAreaSizeVariant","module","exports","import_core","require","import_core2","import_get_button_sized","import_get_font_sized","import_get_token","size","fontFamily","borderWidth","outlineWidth","color","isWeb","tabIndex","focusable","borderColor","backgroundColor","minWidth","hoverStyle","focusStyle","focusVisibleStyle","outlineColor","outlineStyle","val","arguments","length","extras","props","tag","rows","multiline","numberOfLines","buttonStyles","getButtonSized","paddingHorizontal","getSpace","shift","bounds","fontStyle","getFontSized","_props_rows","lines","height","getVariableValue","lineHeight","paddingVertical","name","render","variants","unstyled","true","false","disabled","defaultVariants","process","env","TAMAGUI_HEADLESS","isInput"],"sources":["../../src/shared.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,cAAA;AAAAC,QAAA,CAAAD,cAAA;EAAAE,UAAA,EAAAA,CAAA,KAAAA,UAAA;EAAAC,aAAA,EAAAA,CAAA,KAAAA,aAAA;EAAAC,gBAAA,EAAAA,CAAA,KAAAA,gBAAA;EAAAC,UAAA,EAAAA,CAAA,KAAAA,UAAA;EAAAC,mBAAA,EAAAA,CAAA,KAAAA;AAAA;AACAC,MAAA,CAAAC,OAAA,GAAAb,YAAqB,CAAAK,cAAA;AACrB,IAAAS,WAAA,GAAAC,OAAwC;AACxC,IAAAC,YAAA,GAAAD,OAAA,gBAA+B;AAC/B,IAAAE,uBAAA,GAA6BF,OAAA;AAC7B,IAAAG,qBAAyB,GAAAH,OAAA;AAElB,IAAAI,gBAAM,GAAgBJ,OAAA;AAAA,IAC3BP,aAAM;EAC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uB;EACzB;AAAA,GAGF;EACFC,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"shared.native.js","names":[],"sources":["cjs/shared.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar shared_exports = {};\n__export(shared_exports, {\n INPUT_NAME: () => INPUT_NAME,\n defaultStyles: () => defaultStyles,\n inputSizeVariant: () => inputSizeVariant,\n styledBody: () => styledBody,\n textAreaSizeVariant: () => textAreaSizeVariant\n});\nmodule.exports = __toCommonJS(shared_exports);\nvar import_core = require(\"@tamagui/core\");\nvar import_core2 = require(\"@tamagui/core\");\nvar import_get_font_sized = require(\"@tamagui/get-font-sized\");\nvar defaultStyles = {\n size: true,\n outlineWidth: 0,\n tabIndex: 0,\n // this fixes a flex bug where it overflows container\n minWidth: 0\n};\nvar resolveInputFrame = function(val, extras) {\n return (0, import_core2.resolveTokenSize)(val, {\n tokens: extras.tokens,\n font: extras.font\n }).frame;\n};\nvar inputSizeKeys = [\n \"0\",\n \"0-25\",\n \"0-5\",\n \"0-75\",\n \"1\",\n \"1-5\",\n \"2\",\n \"2-5\",\n \"3\",\n \"3-5\",\n \"4\",\n \"4-5\",\n \"5\",\n \"6\",\n \"7\",\n \"8\",\n \"9\",\n \"10\",\n \"11\",\n \"12\",\n \"13\",\n \"14\",\n \"15\",\n \"16\",\n \"17\",\n \"18\",\n \"19\",\n \"20\"\n];\nvar getInputPadding = function(val, extras, steps) {\n if (typeof val === \"number\") {\n return steps === 1 ? Math.max(0, Math.round(val * 0.6 - 12)) : Math.max(0, Math.round(val * 0.52 - 11.5));\n }\n var key = val === true ? \"4\" : val;\n var index = inputSizeKeys.indexOf(key);\n return extras.tokens.space[inputSizeKeys[Math.max(0, index - steps)]];\n};\nvar inputSizeVariant = function() {\n var val = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true, extras = arguments.length > 1 ? arguments[1] : void 0;\n if (extras.props.tag === \"textarea\" || extras.props.rows > 1 || extras.props.multiline || extras.props.numberOfLines > 1) {\n return textAreaSizeVariant(val, extras);\n }\n var frame = resolveInputFrame(val, extras);\n var fontStyle = (0, import_get_font_sized.getFontSized)(val, extras);\n if (!import_core2.isWeb && fontStyle) {\n delete fontStyle[\"lineHeight\"];\n }\n return {\n ...fontStyle,\n height: frame.size,\n borderRadius: frame.radius,\n paddingHorizontal: getInputPadding(val, extras, 1)\n };\n};\nvar textAreaSizeVariant = function() {\n var val = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true, extras = arguments.length > 1 ? arguments[1] : void 0;\n var { props } = extras;\n var frame = resolveInputFrame(val, extras);\n var fontStyle = (0, import_get_font_sized.getFontSized)(val, extras);\n var _props_rows;\n var lines = (_props_rows = props.rows) !== null && _props_rows !== void 0 ? _props_rows : props.numberOfLines;\n var height = typeof lines === \"number\" ? lines * (0, import_core2.getVariableValue)(fontStyle.lineHeight) : \"auto\";\n if (!import_core2.isWeb && fontStyle) {\n delete fontStyle[\"lineHeight\"];\n }\n return {\n borderRadius: frame.radius,\n ...fontStyle,\n paddingVertical: getInputPadding(val, extras, 2),\n paddingHorizontal: getInputPadding(val, extras, 1),\n height\n };\n};\nvar INPUT_NAME = \"Input\";\nvar styledBody = [\n {\n name: INPUT_NAME,\n render: \"input\",\n ...defaultStyles,\n variants: {\n size: {\n true: inputSizeVariant,\n Size: inputSizeVariant\n },\n disabled: {\n true: {}\n }\n }\n },\n {\n isInput: true,\n accept: {\n placeholderTextColor: \"color\",\n selectionColor: \"color\",\n cursorColor: \"color\",\n selectionHandleColor: \"color\",\n underlineColorAndroid: \"color\"\n },\n validStyles: import_core.Text.staticConfig.validStyles\n }\n];\n//# sourceMappingURL=shared.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,iBAAiB,CAAC;AACtB,SAAS,gBAAgB;CACvB,kBAAkB;CAClB,qBAAqB;CACrB,wBAAwB;CACxB,kBAAkB;CAClB,2BAA2B;AAC7B,CAAC;AACD,OAAO,UAAU,aAAa,cAAc;AAC5C,IAAI,cAAc,QAAQ,eAAe;AACzC,IAAI,eAAe,QAAQ,eAAe;AAC1C,IAAI,wBAAwB,QAAQ,yBAAyB;AAC7D,IAAI,gBAAgB;CAClB,MAAM;CACN,cAAc;CACd,UAAU;CAEV,UAAU;AACZ;AACA,IAA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AW;CACnC,IAAI,MAAM,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK,MAAM,SAAS,UAAU,SAAS,IAAI,UAAU,KAAK,KAAK;CACrI,IAAI,EAAE,UAAU;CAChB,IAAI,QAAQ,kBAAkB,KAAK,MAAM;CACzC,IAAI,aAAa,GAAG,sBAAsB,cAAc,KAAK,MAAM;CACnE,IAAI;CACJ,IAAI,SAAS,cAAc,MAAM,UAAU,QAAQ,gBAAgB,KAAK,IAAI,cAAc,MAAM;CAChG,IAAI,SAAS,OAAO,UAAU,WAAW,SAAS,GAAG,aAAa,kBAAkB,UAAU,UAAU,IAAI;CAC5G,IAAI,CAAC,aAAa,SAAS,WAAW;EACpC,OAAO,UAAU;CACnB;CACA,OAAO;EACL,cAAc,MAAM;EACpB,GAAG;EACH,iBAAiB,gBAAgB,KAAK,QAAQ,CAAC;EAC/C,mBAAmB,gBAAgB,KAAK,QAAQ,CAAC;EACjD;CACF;AACF;AACA,IAAI,aAAa;AACjB,IAAI,aAAa,CACf;CACE,MAAM;CACN,QAAQ;CACR,GAAG;CACH,UAAU;EACR,MAAM;GACJ,MAAM;GACN,MAAM;EACR;EACA,UAAU,EACR,MAAM,CAAC,EACT;CACF;AACF,GACA;CACE,SAAS;CACT,QAAQ;EACN,sBAAsB;EACtB,gBAAgB;EAChB,aAAa;EACb,sBAAsB;EACtB,uBAAuB;CACzB;CACA,aAAa,YAAY,KAAK,aAAa;AAC7C,CACF"}
@@ -1,18 +1,17 @@
1
+
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
6
  var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
8
- get: () => from[key],
9
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
10
- });
11
- }
12
- return to;
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
9
+ get: () => from[key],
10
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
11
+ });
12
+ }
13
+ return to;
13
14
  };
14
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
15
- value: true
16
- }), mod);
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
17
16
  var types_exports = {};
18
- module.exports = __toCommonJS(types_exports);
17
+ module.exports = __toCommonJS(types_exports);
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
11
+ get: () => from[key],
12
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
13
+ });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var types_exports = {};
19
+ module.exports = __toCommonJS(types_exports);
@@ -1,21 +1,21 @@
1
1
  "use strict";
2
2
 
3
+
3
4
  var __defProp = Object.defineProperty;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
8
  var __copyProps = (to, from, except, desc) => {
8
- if (from && typeof from === "object" || typeof from === "function") {
9
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
10
- get: () => from[key],
11
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
12
- });
13
- }
14
- return to;
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
11
+ get: () => from[key],
12
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
13
+ });
14
+ }
15
+ return to;
15
16
  };
16
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
17
- value: true
18
- }), mod);
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
18
  var types_exports = {};
20
19
  module.exports = __toCommonJS(types_exports);
20
+
21
21
  //# sourceMappingURL=types.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","types_exports"],"sources":["../../src/types.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA","ignoreList":[]}
1
+ {"version":3,"file":"types.native.js","names":[],"sources":["cjs/types.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar types_exports = {};\nmodule.exports = __toCommonJS(types_exports);\n//# sourceMappingURL=types.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,OAAO,UAAU,aAAa,aAAa"}