@tamagui/input 1.135.4-1761748186554 → 1.135.4
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 +1 -1
- package/dist/cjs/Input.js +1 -1
- package/dist/cjs/Input.js.map +1 -1
- package/dist/cjs/Input.native.js +98 -115
- package/dist/cjs/Input.native.js.map +6 -1
- package/dist/cjs/TextArea.native.js +33 -39
- package/dist/cjs/TextArea.native.js.map +6 -1
- package/dist/cjs/index.native.js +14 -14
- package/dist/cjs/index.native.js.map +6 -1
- package/dist/cjs/shared.native.js +81 -93
- package/dist/cjs/shared.native.js.map +6 -1
- package/dist/cjs/types.native.js +5 -9
- package/dist/cjs/types.native.js.map +6 -1
- package/dist/jsx/Input.native.js +89 -129
- package/dist/jsx/Input.native.js.map +6 -1
- package/dist/jsx/TextArea.native.js +26 -50
- package/dist/jsx/TextArea.native.js.map +6 -1
- package/dist/jsx/index.native.js +3 -22
- package/dist/jsx/index.native.js.map +6 -1
- package/dist/jsx/shared.native.js +77 -109
- package/dist/jsx/shared.native.js.map +6 -1
- package/dist/jsx/types.native.js +1 -19
- package/dist/jsx/types.native.js.map +6 -1
- package/package.json +14 -15
|
@@ -1 +1,6 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/shared.tsx"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAqB,0BACrBA,eAAwC,0BACxC,0BAA+B,sCAC/B,wBAA6B,oCAC7B,mBAAyB,+BACd,gBAAgB;AAAA,EACvB,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,cAAc;AAAA,EACd,OAAO;AAAA,EACP,GAAG,qBAAQ;AAAA,IACP,UAAU;AAAA,EACd,IAAI;AAAA,IACA,WAAW;AAAA,EACf;AAAA,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BAAoB,2BAAS,KAAK;AAAA,IAClC,OAAO;AAAA,IACP,QAAQ;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ,CAAC;AACD,SAAO;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AACJ,GACW,aAAa,SACb,aAAa;AAAA,EACpB;AAAA,IACI,MAAM;AAAA,IACN,KAAK;AAAA,IACL,UAAU;AAAA,MACN,UAAU;AAAA,QACN,OAAO;AAAA,MACX;AAAA,MACA,MAAM;AAAA,QACF,WAAW;AAAA,MACf;AAAA,MACA,UAAU;AAAA,QACN,MAAM,CAAC;AAAA,MACX;AAAA,IACJ;AAAA,IACA,iBAAiB;AAAA,MACb,UAAU,QAAQ,IAAI,qBAAqB;AAAA,IAC/C;AAAA,EACJ;AAAA,EACA;AAAA,IACI,SAAS;AAAA,IACT,QAAQ;AAAA,MACJ,sBAAsB;AAAA,MACtB,gBAAgB;AAAA,IACpB;AAAA,IACA,aAAa,iBAAK,aAAa;AAAA,EACnC;AACJ;",
|
|
5
|
+
"names": ["import_core"]
|
|
6
|
+
}
|
package/dist/cjs/types.native.js
CHANGED
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
6
|
var __copyProps = (to, from, except, desc) => {
|
|
8
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
});
|
|
7
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
10
|
return to;
|
|
13
11
|
};
|
|
14
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
15
|
-
value: !0
|
|
16
|
-
}), mod);
|
|
12
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
17
13
|
var types_exports = {};
|
|
18
14
|
module.exports = __toCommonJS(types_exports);
|
|
19
|
-
//# sourceMappingURL=types.
|
|
15
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/types.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;AAAA;AAAA;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
package/dist/jsx/Input.native.js
CHANGED
|
@@ -1,137 +1,97 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { styled, useComposedRefs } from "@tamagui/core";
|
|
4
|
+
import { registerFocusable } from "@tamagui/focusable";
|
|
5
|
+
import { TextInput } from "react-native";
|
|
6
|
+
import { styledBody } from "./shared";
|
|
7
|
+
var StyledInput = styled(TextInput, styledBody[0], styledBody[1]), Input = StyledInput.styleable(function(inProps, forwardedRef) {
|
|
8
|
+
var {
|
|
9
|
+
// some of destructed props are just to avoid passing them to ...rest because they are not in native.
|
|
10
|
+
type,
|
|
11
|
+
//@ts-ignore
|
|
12
|
+
dirname,
|
|
13
|
+
max,
|
|
14
|
+
min,
|
|
15
|
+
minLength,
|
|
16
|
+
multiple,
|
|
17
|
+
name,
|
|
18
|
+
required,
|
|
19
|
+
step,
|
|
20
|
+
disabled,
|
|
21
|
+
id,
|
|
22
|
+
caretColor,
|
|
23
|
+
onChange,
|
|
24
|
+
onInput,
|
|
25
|
+
rows,
|
|
26
|
+
enterKeyHint,
|
|
27
|
+
returnKeyType,
|
|
28
|
+
onKeyDown,
|
|
29
|
+
inputMode,
|
|
30
|
+
tag,
|
|
31
|
+
...rest
|
|
32
|
+
} = inProps, ref = React.useRef(null), composedRefs = useComposedRefs(forwardedRef, ref), secureTextEntry = !1, cursorColor = caretColor, _returnKeyType = returnKeyType, _enterKeyHint = enterKeyHint;
|
|
33
|
+
enterKeyHint === "go" && (_returnKeyType = "go", _enterKeyHint = void 0);
|
|
34
|
+
var _inputMode = inputMode;
|
|
35
|
+
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";
|
|
36
|
+
var showSoftInputOnFocus = !0;
|
|
37
|
+
inputMode === "none" && (showSoftInputOnFocus = !1);
|
|
38
|
+
var finalProps = {
|
|
39
|
+
...rest,
|
|
40
|
+
inputMode: _inputMode,
|
|
41
|
+
showSoftInputOnFocus,
|
|
42
|
+
disabled,
|
|
43
|
+
id,
|
|
44
|
+
cursorColor,
|
|
45
|
+
enterKeyHint: _enterKeyHint,
|
|
46
|
+
returnKeyType: _returnKeyType,
|
|
47
|
+
secureTextEntry,
|
|
48
|
+
numberOfLines: rows || rest.numberOfLines
|
|
49
|
+
};
|
|
50
|
+
return tag === "textarea" && (finalProps.multiline = !0), onKeyDown && (finalProps.onKeyPress = function(e) {
|
|
51
|
+
var { key } = e.nativeEvent;
|
|
52
|
+
(key === "Backspace" || tag === "textarea" && key === "Enter" || key.length === 1) && onKeyDown({
|
|
53
|
+
key,
|
|
54
|
+
type: "keydown"
|
|
13
55
|
});
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
56
|
+
}, finalProps.onSubmitEditing = function(e) {
|
|
57
|
+
onKeyDown({
|
|
58
|
+
key: "Enter",
|
|
59
|
+
type: "keydown"
|
|
19
60
|
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
caretColor,
|
|
62
|
-
onChange,
|
|
63
|
-
onInput,
|
|
64
|
-
rows,
|
|
65
|
-
enterKeyHint,
|
|
66
|
-
returnKeyType,
|
|
67
|
-
onKeyDown,
|
|
68
|
-
inputMode,
|
|
69
|
-
tag,
|
|
70
|
-
...rest
|
|
71
|
-
} = inProps,
|
|
72
|
-
ref = import_react.default.useRef(null),
|
|
73
|
-
composedRefs = (0, import_core.useComposedRefs)(forwardedRef, ref),
|
|
74
|
-
secureTextEntry = !1,
|
|
75
|
-
cursorColor = caretColor,
|
|
76
|
-
_returnKeyType = returnKeyType,
|
|
77
|
-
_enterKeyHint = enterKeyHint;
|
|
78
|
-
enterKeyHint === "go" && (_returnKeyType = "go", _enterKeyHint = void 0);
|
|
79
|
-
var _inputMode = inputMode;
|
|
80
|
-
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";
|
|
81
|
-
var showSoftInputOnFocus = !0;
|
|
82
|
-
inputMode === "none" && (showSoftInputOnFocus = !1);
|
|
83
|
-
var finalProps = {
|
|
84
|
-
...rest,
|
|
85
|
-
inputMode: _inputMode,
|
|
86
|
-
showSoftInputOnFocus,
|
|
87
|
-
disabled,
|
|
88
|
-
id,
|
|
89
|
-
cursorColor,
|
|
90
|
-
enterKeyHint: _enterKeyHint,
|
|
91
|
-
returnKeyType: _returnKeyType,
|
|
92
|
-
secureTextEntry,
|
|
93
|
-
numberOfLines: rows || rest.numberOfLines
|
|
94
|
-
};
|
|
95
|
-
return tag === "textarea" && (finalProps.multiline = !0), onKeyDown && (finalProps.onKeyPress = function (e) {
|
|
96
|
-
var {
|
|
97
|
-
key
|
|
98
|
-
} = e.nativeEvent;
|
|
99
|
-
(key === "Backspace" || tag === "textarea" && key === "Enter" || key.length === 1) && onKeyDown({
|
|
100
|
-
key,
|
|
101
|
-
type: "keydown"
|
|
102
|
-
});
|
|
103
|
-
}, finalProps.onSubmitEditing = function (e) {
|
|
104
|
-
onKeyDown({
|
|
105
|
-
key: "Enter",
|
|
106
|
-
type: "keydown"
|
|
107
|
-
});
|
|
108
|
-
}), (onChange || onInput) && (finalProps.onChange = function (e) {
|
|
109
|
-
var {
|
|
110
|
-
text
|
|
111
|
-
} = e.nativeEvent;
|
|
112
|
-
onChange && onChange({
|
|
113
|
-
target: {
|
|
114
|
-
value: text
|
|
115
|
-
},
|
|
116
|
-
type: "change"
|
|
117
|
-
}), onInput?.({
|
|
118
|
-
target: {
|
|
119
|
-
value: text
|
|
120
|
-
},
|
|
121
|
-
type: "input"
|
|
122
|
-
});
|
|
123
|
-
}), import_react.default.useEffect(function () {
|
|
124
|
-
if (id && !disabled) return (0, import_focusable.registerFocusable)(id, {
|
|
125
|
-
focusAndSelect: function () {
|
|
61
|
+
}), (onChange || onInput) && (finalProps.onChange = function(e) {
|
|
62
|
+
var { text } = e.nativeEvent;
|
|
63
|
+
onChange && onChange({
|
|
64
|
+
target: {
|
|
65
|
+
value: text
|
|
66
|
+
},
|
|
67
|
+
type: "change"
|
|
68
|
+
}), onInput != null && onInput({
|
|
69
|
+
target: {
|
|
70
|
+
value: text
|
|
71
|
+
},
|
|
72
|
+
type: "input"
|
|
73
|
+
});
|
|
74
|
+
}), React.useEffect(function() {
|
|
75
|
+
if (id && !disabled)
|
|
76
|
+
return registerFocusable(id, {
|
|
77
|
+
focusAndSelect: function() {
|
|
126
78
|
var _ref_current;
|
|
127
79
|
(_ref_current = ref.current) === null || _ref_current === void 0 || _ref_current.focus();
|
|
128
80
|
},
|
|
129
|
-
focus: function
|
|
81
|
+
focus: function() {
|
|
82
|
+
}
|
|
130
83
|
});
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
84
|
+
}, [
|
|
85
|
+
id,
|
|
86
|
+
disabled
|
|
87
|
+
]), /* @__PURE__ */ _jsx(StyledInput, {
|
|
88
|
+
onChange: function(e) {
|
|
89
|
+
},
|
|
90
|
+
ref: composedRefs,
|
|
91
|
+
...finalProps
|
|
136
92
|
});
|
|
93
|
+
});
|
|
94
|
+
export {
|
|
95
|
+
Input
|
|
96
|
+
};
|
|
137
97
|
//# sourceMappingURL=Input.native.js.map
|
|
@@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-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
tag: "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
|
|
1
|
+
import { styled } from "@tamagui/web";
|
|
2
|
+
import { Input } from "./Input";
|
|
3
|
+
import { defaultStyles, textAreaSizeVariant } from "./shared";
|
|
4
|
+
var TextArea = styled(Input, {
|
|
5
|
+
name: "TextArea",
|
|
6
|
+
tag: "textarea",
|
|
7
|
+
// this attribute fixes firefox newline issue
|
|
8
|
+
// @ts-ignore
|
|
9
|
+
whiteSpace: "pre-wrap",
|
|
10
|
+
variants: {
|
|
11
|
+
unstyled: {
|
|
12
|
+
false: {
|
|
13
|
+
height: "auto",
|
|
14
|
+
...defaultStyles,
|
|
15
|
+
numberOfLines: 3
|
|
47
16
|
}
|
|
48
17
|
},
|
|
49
|
-
|
|
50
|
-
|
|
18
|
+
size: {
|
|
19
|
+
"...size": textAreaSizeVariant
|
|
51
20
|
}
|
|
52
|
-
}
|
|
53
|
-
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
export {
|
|
27
|
+
TextArea
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=TextArea.js.map
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/TextArea.tsx"],
|
|
4
|
+
"mappings": "AAAA,SAAS,cAAc;AACvB,SAAS,aAAa;AACtB,SAAS,eAAe,2BAA2B;AAIxC,IAAI,WAAW,OAAO,OAAO;AAAA,EACpC,MAAM;AAAA,EACN,KAAK;AAAA;AAAA;AAAA,EAGL,YAAY;AAAA,EACZ,UAAU;AAAA,IACN,UAAU;AAAA,MACN,OAAO;AAAA,QACH,QAAQ;AAAA,QACR,GAAG;AAAA,QACH,eAAe;AAAA,MACnB;AAAA,IACJ;AAAA,IACA,MAAM;AAAA,MACF,WAAW;AAAA,IACf;AAAA,EACJ;AAAA,EACA,iBAAiB;AAAA,IACb,UAAU,QAAQ,IAAI,qBAAqB;AAAA,EAC/C;AACJ,CAAC;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
package/dist/jsx/index.native.js
CHANGED
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __copyProps = (to, from, except, desc) => {
|
|
8
|
-
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
9
|
-
get: () => from[key],
|
|
10
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
11
|
-
});
|
|
12
|
-
return to;
|
|
13
|
-
},
|
|
14
|
-
__reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
16
|
-
value: !0
|
|
17
|
-
}), mod);
|
|
18
|
-
var index_exports = {};
|
|
19
|
-
module.exports = __toCommonJS(index_exports);
|
|
20
|
-
__reExport(index_exports, require("./Input.native.js"), module.exports);
|
|
21
|
-
__reExport(index_exports, require("./TextArea.native.js"), module.exports);
|
|
22
|
-
//# sourceMappingURL=index.native.js.map
|
|
1
|
+
export * from "./Input";
|
|
2
|
+
export * from "./TextArea";
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.ts"],
|
|
4
|
+
"mappings": "AAAA,cAAc;AACd,cAAc;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -1,111 +1,70 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { Text } from "@tamagui/core";
|
|
2
|
+
import { getVariableValue, isWeb } from "@tamagui/core";
|
|
3
|
+
import { getButtonSized } from "@tamagui/get-button-sized";
|
|
4
|
+
import { getFontSized } from "@tamagui/get-font-sized";
|
|
5
|
+
import { getSpace } from "@tamagui/get-token";
|
|
6
|
+
var defaultStyles = {
|
|
7
|
+
size: "$true",
|
|
8
|
+
fontFamily: "$body",
|
|
9
|
+
borderWidth: 1,
|
|
10
|
+
outlineWidth: 0,
|
|
11
|
+
color: "$color",
|
|
12
|
+
...isWeb ? {
|
|
13
|
+
tabIndex: 0
|
|
14
|
+
} : {
|
|
15
|
+
focusable: !0
|
|
12
16
|
},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
-
value: !0
|
|
22
|
-
}), mod);
|
|
23
|
-
var shared_exports = {};
|
|
24
|
-
__export(shared_exports, {
|
|
25
|
-
INPUT_NAME: () => INPUT_NAME,
|
|
26
|
-
defaultStyles: () => defaultStyles,
|
|
27
|
-
inputSizeVariant: () => inputSizeVariant,
|
|
28
|
-
styledBody: () => styledBody,
|
|
29
|
-
textAreaSizeVariant: () => textAreaSizeVariant
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(shared_exports);
|
|
32
|
-
var import_core = require("@tamagui/core"),
|
|
33
|
-
import_core2 = require("@tamagui/core"),
|
|
34
|
-
import_get_button_sized = require("@tamagui/get-button-sized"),
|
|
35
|
-
import_get_font_sized = require("@tamagui/get-font-sized"),
|
|
36
|
-
import_get_token = require("@tamagui/get-token"),
|
|
37
|
-
defaultStyles = {
|
|
38
|
-
size: "$true",
|
|
39
|
-
fontFamily: "$body",
|
|
40
|
-
borderWidth: 1,
|
|
41
|
-
outlineWidth: 0,
|
|
42
|
-
color: "$color",
|
|
43
|
-
...(import_core2.isWeb ? {
|
|
44
|
-
tabIndex: 0
|
|
45
|
-
} : {
|
|
46
|
-
focusable: !0
|
|
47
|
-
}),
|
|
48
|
-
borderColor: "$borderColor",
|
|
49
|
-
backgroundColor: "$background",
|
|
50
|
-
// this fixes a flex bug where it overflows container
|
|
51
|
-
minWidth: 0,
|
|
52
|
-
hoverStyle: {
|
|
53
|
-
borderColor: "$borderColorHover"
|
|
54
|
-
},
|
|
55
|
-
focusStyle: {
|
|
56
|
-
borderColor: "$borderColorFocus"
|
|
57
|
-
},
|
|
58
|
-
focusVisibleStyle: {
|
|
59
|
-
outlineColor: "$outlineColor",
|
|
60
|
-
outlineWidth: 2,
|
|
61
|
-
outlineStyle: "solid"
|
|
62
|
-
}
|
|
17
|
+
borderColor: "$borderColor",
|
|
18
|
+
backgroundColor: "$background",
|
|
19
|
+
// this fixes a flex bug where it overflows container
|
|
20
|
+
minWidth: 0,
|
|
21
|
+
hoverStyle: {
|
|
22
|
+
borderColor: "$borderColorHover"
|
|
63
23
|
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
extras = arguments.length > 1 ? arguments[1] : void 0;
|
|
67
|
-
if (extras.props.multiline || extras.props.numberOfLines > 1) return textAreaSizeVariant(val, extras);
|
|
68
|
-
var buttonStyles = (0, import_get_button_sized.getButtonSized)(val, extras),
|
|
69
|
-
paddingHorizontal = (0, import_get_token.getSpace)(val, {
|
|
70
|
-
shift: -1,
|
|
71
|
-
bounds: [2]
|
|
72
|
-
}),
|
|
73
|
-
fontStyle = (0, import_get_font_sized.getFontSized)(val, extras);
|
|
74
|
-
return !import_core2.isWeb && fontStyle && delete fontStyle.lineHeight, {
|
|
75
|
-
...fontStyle,
|
|
76
|
-
...buttonStyles,
|
|
77
|
-
paddingHorizontal
|
|
78
|
-
};
|
|
24
|
+
focusStyle: {
|
|
25
|
+
borderColor: "$borderColorFocus"
|
|
79
26
|
},
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
},
|
|
107
|
-
|
|
108
|
-
|
|
27
|
+
focusVisibleStyle: {
|
|
28
|
+
outlineColor: "$outlineColor",
|
|
29
|
+
outlineWidth: 2,
|
|
30
|
+
outlineStyle: "solid"
|
|
31
|
+
}
|
|
32
|
+
}, inputSizeVariant = function() {
|
|
33
|
+
var val = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "$true", extras = arguments.length > 1 ? arguments[1] : void 0;
|
|
34
|
+
if (extras.props.multiline || extras.props.numberOfLines > 1)
|
|
35
|
+
return textAreaSizeVariant(val, extras);
|
|
36
|
+
var buttonStyles = getButtonSized(val, extras), paddingHorizontal = getSpace(val, {
|
|
37
|
+
shift: -1,
|
|
38
|
+
bounds: [
|
|
39
|
+
2
|
|
40
|
+
]
|
|
41
|
+
}), fontStyle = getFontSized(val, extras);
|
|
42
|
+
return !isWeb && fontStyle && delete fontStyle.lineHeight, {
|
|
43
|
+
...fontStyle,
|
|
44
|
+
...buttonStyles,
|
|
45
|
+
paddingHorizontal
|
|
46
|
+
};
|
|
47
|
+
}, textAreaSizeVariant = function() {
|
|
48
|
+
var val = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "$true", extras = arguments.length > 1 ? arguments[1] : void 0, { props } = extras, buttonStyles = getButtonSized(val, extras), fontStyle = getFontSized(val, extras), _props_rows, lines = (_props_rows = props.rows) !== null && _props_rows !== void 0 ? _props_rows : props.numberOfLines, height = typeof lines == "number" ? lines * getVariableValue(fontStyle.lineHeight) : "auto", paddingVertical = getSpace(val, {
|
|
49
|
+
shift: -2,
|
|
50
|
+
bounds: [
|
|
51
|
+
2
|
|
52
|
+
]
|
|
53
|
+
}), paddingHorizontal = getSpace(val, {
|
|
54
|
+
shift: -1,
|
|
55
|
+
bounds: [
|
|
56
|
+
2
|
|
57
|
+
]
|
|
58
|
+
});
|
|
59
|
+
return {
|
|
60
|
+
...buttonStyles,
|
|
61
|
+
...fontStyle,
|
|
62
|
+
paddingVertical,
|
|
63
|
+
paddingHorizontal,
|
|
64
|
+
height
|
|
65
|
+
};
|
|
66
|
+
}, INPUT_NAME = "Input", styledBody = [
|
|
67
|
+
{
|
|
109
68
|
name: INPUT_NAME,
|
|
110
69
|
tag: "input",
|
|
111
70
|
variants: {
|
|
@@ -122,12 +81,21 @@ var import_core = require("@tamagui/core"),
|
|
|
122
81
|
defaultVariants: {
|
|
123
82
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
124
83
|
}
|
|
125
|
-
},
|
|
84
|
+
},
|
|
85
|
+
{
|
|
126
86
|
isInput: !0,
|
|
127
87
|
accept: {
|
|
128
88
|
placeholderTextColor: "color",
|
|
129
89
|
selectionColor: "color"
|
|
130
90
|
},
|
|
131
|
-
validStyles:
|
|
132
|
-
}
|
|
133
|
-
|
|
91
|
+
validStyles: Text.staticConfig.validStyles
|
|
92
|
+
}
|
|
93
|
+
];
|
|
94
|
+
export {
|
|
95
|
+
INPUT_NAME,
|
|
96
|
+
defaultStyles,
|
|
97
|
+
inputSizeVariant,
|
|
98
|
+
styledBody,
|
|
99
|
+
textAreaSizeVariant
|
|
100
|
+
};
|
|
101
|
+
//# sourceMappingURL=shared.js.map
|