@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.
- package/dist/cjs/Input.cjs +78 -162
- package/dist/cjs/Input.native.cjs +209 -0
- package/dist/cjs/Input.native.js +186 -282
- package/dist/cjs/Input.native.js.map +1 -1
- package/dist/cjs/InputNativeProps.cjs +10 -11
- package/dist/cjs/InputNativeProps.native.cjs +19 -0
- package/dist/cjs/InputNativeProps.native.js +10 -10
- package/dist/cjs/InputNativeProps.native.js.map +1 -1
- package/dist/cjs/TextArea.cjs +25 -38
- package/dist/cjs/TextArea.native.cjs +41 -0
- package/dist/cjs/TextArea.native.js +25 -37
- package/dist/cjs/TextArea.native.js.map +1 -1
- package/dist/cjs/index.cjs +16 -17
- package/dist/cjs/index.native.cjs +33 -0
- package/dist/cjs/index.native.js +16 -16
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/shared.cjs +115 -122
- package/dist/cjs/shared.native.cjs +144 -0
- package/dist/cjs/shared.native.js +120 -126
- package/dist/cjs/shared.native.js.map +1 -1
- package/dist/cjs/types.cjs +10 -11
- package/dist/cjs/types.native.cjs +19 -0
- package/dist/cjs/types.native.js +10 -10
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/esm/Input.mjs +63 -137
- package/dist/esm/Input.mjs.map +1 -1
- package/dist/esm/Input.native.js +172 -259
- package/dist/esm/Input.native.js.map +1 -1
- package/dist/esm/InputNativeProps.mjs +0 -2
- package/dist/esm/InputNativeProps.native.js +0 -2
- package/dist/esm/TextArea.mjs +12 -20
- package/dist/esm/TextArea.mjs.map +1 -1
- package/dist/esm/TextArea.native.js +12 -20
- package/dist/esm/TextArea.native.js.map +1 -1
- package/dist/esm/index.js +6 -4
- package/dist/esm/index.mjs +6 -4
- package/dist/esm/index.native.js +6 -4
- package/dist/esm/shared.mjs +99 -104
- package/dist/esm/shared.mjs.map +1 -1
- package/dist/esm/shared.native.js +104 -109
- package/dist/esm/shared.native.js.map +1 -1
- package/dist/esm/types.mjs +0 -2
- package/dist/esm/types.native.js +0 -2
- package/dist/jsx/Input.mjs +63 -137
- package/dist/jsx/Input.mjs.map +1 -1
- package/dist/jsx/Input.native.cjs +209 -0
- package/dist/jsx/Input.native.js +186 -282
- package/dist/jsx/Input.native.js.map +1 -1
- package/dist/jsx/InputNativeProps.mjs +0 -2
- package/dist/jsx/InputNativeProps.native.cjs +19 -0
- package/dist/jsx/InputNativeProps.native.js +10 -10
- package/dist/jsx/InputNativeProps.native.js.map +1 -1
- package/dist/jsx/TextArea.mjs +12 -20
- package/dist/jsx/TextArea.mjs.map +1 -1
- package/dist/jsx/TextArea.native.cjs +41 -0
- package/dist/jsx/TextArea.native.js +25 -37
- package/dist/jsx/TextArea.native.js.map +1 -1
- package/dist/jsx/index.js +6 -4
- package/dist/jsx/index.mjs +6 -4
- package/dist/jsx/index.native.cjs +33 -0
- package/dist/jsx/index.native.js +16 -16
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/shared.mjs +99 -104
- package/dist/jsx/shared.mjs.map +1 -1
- package/dist/jsx/shared.native.cjs +144 -0
- package/dist/jsx/shared.native.js +120 -126
- package/dist/jsx/shared.native.js.map +1 -1
- package/dist/jsx/types.mjs +0 -2
- package/dist/jsx/types.native.cjs +19 -0
- package/dist/jsx/types.native.js +10 -10
- package/dist/jsx/types.native.js.map +1 -1
- package/package.json +13 -15
- package/src/Input.native.tsx +263 -240
- package/src/Input.tsx +162 -152
- package/src/TextArea.tsx +6 -14
- package/src/shared.tsx +65 -70
- package/src/types.ts +1 -1
- package/types/Input.d.ts +57 -41
- package/types/Input.d.ts.map +1 -1
- package/types/Input.native.d.ts +57 -41
- package/types/Input.native.d.ts.map +1 -1
- package/types/TextArea.d.ts +172 -24
- package/types/TextArea.d.ts.map +1 -1
- package/types/shared.d.ts +14 -99
- package/types/shared.d.ts.map +1 -1
- package/types/types.d.ts +1 -1
- package/dist/cjs/inputTypes.test-d.cjs +0 -128
- package/dist/cjs/inputTypes.test-d.native.js +0 -131
- package/dist/cjs/inputTypes.test-d.native.js.map +0 -1
- package/dist/cjs/v1/Input.cjs +0 -200
- package/dist/cjs/v1/Input.native.js +0 -183
- package/dist/cjs/v1/Input.native.js.map +0 -1
- package/dist/cjs/v1/TextArea.cjs +0 -52
- package/dist/cjs/v1/TextArea.native.js +0 -55
- package/dist/cjs/v1/TextArea.native.js.map +0 -1
- package/dist/cjs/v1/index.cjs +0 -21
- package/dist/cjs/v1/index.native.js +0 -24
- package/dist/cjs/v1/index.native.js.map +0 -1
- package/dist/cjs/v1/types.cjs +0 -18
- package/dist/cjs/v1/types.native.js +0 -21
- package/dist/cjs/v1/types.native.js.map +0 -1
- package/dist/esm/InputNativeProps.mjs.map +0 -1
- package/dist/esm/InputNativeProps.native.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/index.native.js.map +0 -1
- package/dist/esm/inputTypes.test-d.mjs +0 -129
- package/dist/esm/inputTypes.test-d.mjs.map +0 -1
- package/dist/esm/inputTypes.test-d.native.js +0 -129
- package/dist/esm/inputTypes.test-d.native.js.map +0 -1
- package/dist/esm/types.mjs.map +0 -1
- package/dist/esm/types.native.js.map +0 -1
- package/dist/esm/v1/Input.mjs +0 -164
- package/dist/esm/v1/Input.mjs.map +0 -1
- package/dist/esm/v1/Input.native.js +0 -144
- package/dist/esm/v1/Input.native.js.map +0 -1
- package/dist/esm/v1/TextArea.mjs +0 -27
- package/dist/esm/v1/TextArea.mjs.map +0 -1
- package/dist/esm/v1/TextArea.native.js +0 -27
- package/dist/esm/v1/TextArea.native.js.map +0 -1
- package/dist/esm/v1/index.mjs +0 -3
- package/dist/esm/v1/index.mjs.map +0 -1
- package/dist/esm/v1/index.native.js +0 -3
- package/dist/esm/v1/index.native.js.map +0 -1
- package/dist/esm/v1/types.mjs +0 -2
- package/dist/esm/v1/types.mjs.map +0 -1
- package/dist/esm/v1/types.native.js +0 -2
- package/dist/esm/v1/types.native.js.map +0 -1
- package/dist/jsx/InputNativeProps.mjs.map +0 -1
- package/dist/jsx/index.js.map +0 -1
- package/dist/jsx/index.mjs.map +0 -1
- package/dist/jsx/inputTypes.test-d.mjs +0 -129
- package/dist/jsx/inputTypes.test-d.mjs.map +0 -1
- package/dist/jsx/inputTypes.test-d.native.js +0 -131
- package/dist/jsx/inputTypes.test-d.native.js.map +0 -1
- package/dist/jsx/types.mjs.map +0 -1
- package/dist/jsx/v1/Input.mjs +0 -164
- package/dist/jsx/v1/Input.mjs.map +0 -1
- package/dist/jsx/v1/Input.native.js +0 -183
- package/dist/jsx/v1/Input.native.js.map +0 -1
- package/dist/jsx/v1/TextArea.mjs +0 -27
- package/dist/jsx/v1/TextArea.mjs.map +0 -1
- package/dist/jsx/v1/TextArea.native.js +0 -55
- package/dist/jsx/v1/TextArea.native.js.map +0 -1
- package/dist/jsx/v1/index.mjs +0 -3
- package/dist/jsx/v1/index.mjs.map +0 -1
- package/dist/jsx/v1/index.native.js +0 -24
- package/dist/jsx/v1/index.native.js.map +0 -1
- package/dist/jsx/v1/types.mjs +0 -2
- package/dist/jsx/v1/types.mjs.map +0 -1
- package/dist/jsx/v1/types.native.js +0 -21
- package/dist/jsx/v1/types.native.js.map +0 -1
- package/src/inputTypes.test-d.ts +0 -245
- package/src/v1/Input.native.tsx +0 -153
- package/src/v1/Input.tsx +0 -190
- package/src/v1/TextArea.tsx +0 -35
- package/src/v1/index.ts +0 -3
- package/src/v1/types.ts +0 -65
- package/types/v1/Input.d.ts +0 -64
- package/types/v1/Input.d.ts.map +0 -1
- package/types/v1/Input.native.d.ts +0 -63
- package/types/v1/Input.native.d.ts.map +0 -1
- package/types/v1/TextArea.d.ts +0 -41
- package/types/v1/TextArea.d.ts.map +0 -1
- package/types/v1/index.d.ts +0 -4
- package/types/v1/index.d.ts.map +0 -1
- package/types/v1/types.d.ts +0 -39
- 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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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,"
|
|
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":"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"}
|
package/dist/cjs/types.cjs
CHANGED
|
@@ -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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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);
|
package/dist/cjs/types.native.js
CHANGED
|
@@ -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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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,"
|
|
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"}
|