@tamagui/input 3.0.0-beta.831.1 → 3.0.0-beta.889.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 +3 -9
- package/dist/cjs/Input.native.cjs +1 -1
- package/dist/cjs/Input.native.js +1 -1
- package/dist/cjs/Input.native.js.map +1 -1
- package/dist/cjs/TextArea.cjs +3 -5
- package/dist/cjs/TextArea.native.cjs +3 -5
- package/dist/cjs/TextArea.native.js +3 -5
- package/dist/cjs/TextArea.native.js.map +1 -1
- package/dist/cjs/shared.cjs +59 -45
- package/dist/cjs/shared.native.cjs +64 -48
- package/dist/cjs/shared.native.js +64 -48
- package/dist/cjs/shared.native.js.map +1 -1
- package/dist/esm/Input.mjs +5 -11
- package/dist/esm/Input.mjs.map +1 -1
- package/dist/esm/Input.native.js +2 -2
- package/dist/esm/Input.native.js.map +1 -1
- package/dist/esm/TextArea.mjs +4 -6
- package/dist/esm/TextArea.mjs.map +1 -1
- package/dist/esm/TextArea.native.js +4 -6
- package/dist/esm/TextArea.native.js.map +1 -1
- package/dist/esm/shared.mjs +59 -46
- package/dist/esm/shared.mjs.map +1 -1
- package/dist/esm/shared.native.js +63 -48
- package/dist/esm/shared.native.js.map +1 -1
- package/dist/jsx/Input.mjs +5 -11
- package/dist/jsx/Input.mjs.map +1 -1
- package/dist/jsx/Input.native.cjs +1 -1
- package/dist/jsx/Input.native.js +1 -1
- package/dist/jsx/Input.native.js.map +1 -1
- package/dist/jsx/TextArea.mjs +4 -6
- package/dist/jsx/TextArea.mjs.map +1 -1
- package/dist/jsx/TextArea.native.cjs +3 -5
- package/dist/jsx/TextArea.native.js +3 -5
- package/dist/jsx/TextArea.native.js.map +1 -1
- package/dist/jsx/shared.mjs +59 -46
- package/dist/jsx/shared.mjs.map +1 -1
- package/dist/jsx/shared.native.cjs +64 -48
- package/dist/jsx/shared.native.js +64 -48
- package/dist/jsx/shared.native.js.map +1 -1
- package/package.json +12 -12
- package/src/Input.native.tsx +4 -2
- package/src/Input.tsx +5 -19
- package/src/TextArea.tsx +5 -6
- package/src/shared.tsx +69 -54
- package/types/Input.d.ts +8 -42
- package/types/Input.d.ts.map +1 -1
- package/types/Input.native.d.ts +8 -42
- package/types/Input.native.d.ts.map +1 -1
- package/types/TextArea.d.ts +5 -171
- package/types/TextArea.d.ts.map +1 -1
- package/types/shared.d.ts +31 -17
- package/types/shared.d.ts.map +1 -1
package/dist/cjs/Input.cjs
CHANGED
|
@@ -33,11 +33,10 @@ var import_element = require("@tamagui/element");
|
|
|
33
33
|
var import_react = __toESM(require("react"), 1);
|
|
34
34
|
var import_shared = require("./shared.cjs");
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
-
const StyledInput = (0, import_core.styled)(import_core.View, import_shared.styledBody[0], import_shared.styledBody[1]);
|
|
36
|
+
const StyledInput = (0, import_core.styled)(import_core.View, import_shared.styledBody[0], import_shared.styledBody[1]).resolve(import_shared.resolveMultilineInputSize);
|
|
37
37
|
const Input = (0, import_core.createStyledHOC)(StyledInput, (props, _forwardedRef) => {
|
|
38
|
-
const { disabled, id, onChangeText, onSubmitEditing, onSelectionChange, selection,
|
|
38
|
+
const { disabled, id, onChangeText, onSubmitEditing, onSelectionChange, selection, rows, keyboardAppearance, returnKeyType, submitBehavior, blurOnSubmit, caretHidden, contextMenuHidden, selectTextOnFocus, secureTextEntry, maxFontSizeMultiplier, allowFontScaling, multiline, keyboardType, autoCapitalize: autoCapitalizeProp, autoCorrect: autoCorrectProp, autoFocusNative, textContentType, onEndEditing, onContentSizeChange, onScroll, onKeyPress, clearButtonMode, clearTextOnFocus, enablesReturnKeyAutomatically, dataDetectorTypes, scrollEnabled, passwordRules, rejectResponderTermination, spellCheck, lineBreakStrategyIOS, lineBreakModeIOS, smartInsertDelete, inputAccessoryViewID, inputAccessoryViewButtonLabel, disableKeyboardShortcuts, underlineColorAndroid, importantForAutofill, disableFullscreenUI, inlineImageLeft, inlineImagePadding, returnKeyLabel, textBreakStrategy, textAlignVertical, verticalAlign, showSoftInputOnFocus, numberOfLines, ...rest } = props;
|
|
39
39
|
const { ref, composedRef } = (0, import_element.useWebRef)(_forwardedRef);
|
|
40
|
-
const theme = (0, import_core.useTheme)();
|
|
41
40
|
const autoCorrect = autoCorrectProp === true ? "on" : autoCorrectProp === false ? "off" : autoCorrectProp;
|
|
42
41
|
const autoCapitalize = autoCapitalizeProp === "sentences" || autoCapitalizeProp === "words" ? "on" : autoCapitalizeProp === "none" || autoCapitalizeProp === "characters" ? "off" : autoCapitalizeProp;
|
|
43
42
|
import_react.default.useEffect(() => {
|
|
@@ -83,12 +82,7 @@ const Input = (0, import_core.createStyledHOC)(StyledInput, (props, _forwardedRe
|
|
|
83
82
|
autoCorrect,
|
|
84
83
|
autoCapitalize,
|
|
85
84
|
onKeyDown: onSubmitEditing ? handleKeyDown : rest.onKeyDown,
|
|
86
|
-
onChange: onChangeText ? handleChange : rest.onChange
|
|
87
|
-
style: {
|
|
88
|
-
...rest.style,
|
|
89
|
-
...placeholderTextColor && { "--t_placeholderColor": theme[placeholderTextColor]?.variable || placeholderTextColor },
|
|
90
|
-
...selectionColor && { "--t_selectionColor": theme[selectionColor]?.variable || selectionColor }
|
|
91
|
-
}
|
|
85
|
+
onChange: onChangeText ? handleChange : rest.onChange
|
|
92
86
|
};
|
|
93
87
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledInput, {
|
|
94
88
|
ref: composedRef,
|
|
@@ -36,7 +36,7 @@ var import_core = require("@tamagui/core");
|
|
|
36
36
|
var import_focusable = require("@tamagui/focusable");
|
|
37
37
|
var import_element = require("@tamagui/element");
|
|
38
38
|
var import_shared = require("./shared.native.js");
|
|
39
|
-
var StyledInput = (0, import_core.styled)(import_react_native.TextInput, import_shared.styledBody[0], import_shared.styledBody[1]);
|
|
39
|
+
var StyledInput = (0, import_core.styled)(import_react_native.TextInput, import_shared.styledBody[0], import_shared.styledBody[1]).resolve(import_shared.resolveMultilineInputSize);
|
|
40
40
|
var Input = (0, import_core.createStyledHOC)(StyledInput, function(props, forwardedRef) {
|
|
41
41
|
var { type, disabled, readOnly, id, rows, autoComplete, enterKeyHint, onChange, onInput, onKeyDown, onChangeText, onSubmitEditing, onSelectionChange, onEndEditing, onContentSizeChange, onScroll, onKeyPress: onKeyPressProp, selection, keyboardAppearance, returnKeyType: returnKeyTypeProp, submitBehavior, blurOnSubmit, caretHidden, contextMenuHidden, selectTextOnFocus, secureTextEntry: secureTextEntryProp, maxFontSizeMultiplier, allowFontScaling, multiline: multilineProp, keyboardType: keyboardTypeProp, inputMode: inputModeProp, autoCapitalize: autoCapitalizeProp, autoCorrect: autoCorrectProp, autoFocusNative, textContentType, clearButtonMode, clearTextOnFocus, enablesReturnKeyAutomatically, dataDetectorTypes, scrollEnabled, passwordRules, rejectResponderTermination, spellCheck, lineBreakStrategyIOS, lineBreakModeIOS, smartInsertDelete, inputAccessoryViewID, inputAccessoryViewButtonLabel, disableKeyboardShortcuts, importantForAutofill, disableFullscreenUI, inlineImageLeft, inlineImagePadding, returnKeyLabel, textBreakStrategy, textAlignVertical, verticalAlign, showSoftInputOnFocus, numberOfLines: numberOfLinesProp, dirname, min, max, minLength, multiple, name, pattern, required, step, render, caretColor, cursorColor: cursorColorProp, selectionColor: selectionColorProp, ...rest } = props;
|
|
42
42
|
var { ref, composedRef } = (0, import_element.useNativeInputRef)(forwardedRef);
|
package/dist/cjs/Input.native.js
CHANGED
|
@@ -36,7 +36,7 @@ var import_core = require("@tamagui/core");
|
|
|
36
36
|
var import_focusable = require("@tamagui/focusable");
|
|
37
37
|
var import_element = require("@tamagui/element");
|
|
38
38
|
var import_shared = require("./shared.native.js");
|
|
39
|
-
var StyledInput = (0, import_core.styled)(import_react_native.TextInput, import_shared.styledBody[0], import_shared.styledBody[1]);
|
|
39
|
+
var StyledInput = (0, import_core.styled)(import_react_native.TextInput, import_shared.styledBody[0], import_shared.styledBody[1]).resolve(import_shared.resolveMultilineInputSize);
|
|
40
40
|
var Input = (0, import_core.createStyledHOC)(StyledInput, function(props, forwardedRef) {
|
|
41
41
|
var { type, disabled, readOnly, id, rows, autoComplete, enterKeyHint, onChange, onInput, onKeyDown, onChangeText, onSubmitEditing, onSelectionChange, onEndEditing, onContentSizeChange, onScroll, onKeyPress: onKeyPressProp, selection, keyboardAppearance, returnKeyType: returnKeyTypeProp, submitBehavior, blurOnSubmit, caretHidden, contextMenuHidden, selectTextOnFocus, secureTextEntry: secureTextEntryProp, maxFontSizeMultiplier, allowFontScaling, multiline: multilineProp, keyboardType: keyboardTypeProp, inputMode: inputModeProp, autoCapitalize: autoCapitalizeProp, autoCorrect: autoCorrectProp, autoFocusNative, textContentType, clearButtonMode, clearTextOnFocus, enablesReturnKeyAutomatically, dataDetectorTypes, scrollEnabled, passwordRules, rejectResponderTermination, spellCheck, lineBreakStrategyIOS, lineBreakModeIOS, smartInsertDelete, inputAccessoryViewID, inputAccessoryViewButtonLabel, disableKeyboardShortcuts, importantForAutofill, disableFullscreenUI, inlineImageLeft, inlineImagePadding, returnKeyLabel, textBreakStrategy, textAlignVertical, verticalAlign, showSoftInputOnFocus, numberOfLines: numberOfLinesProp, dirname, min, max, minLength, multiple, name, pattern, required, step, render, caretColor, cursorColor: cursorColorProp, selectionColor: selectionColorProp, ...rest } = props;
|
|
42
42
|
var { ref, composedRef } = (0, import_element.useNativeInputRef)(forwardedRef);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.native.js","names":[],"sources":["cjs/Input.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Input_native_exports = {};\n__export(Input_native_exports, {\n Input: () => Input\n});\nmodule.exports = __toCommonJS(Input_native_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_react_native = require(\"react-native\");\nvar import_core = require(\"@tamagui/core\");\nvar import_focusable = require(\"@tamagui/focusable\");\nvar import_element = require(\"@tamagui/element\");\nvar import_shared = require(\"./shared\");\nvar StyledInput = (0, import_core.styled)(import_react_native.TextInput, import_shared.styledBody[0], import_shared.styledBody[1]);\nvar Input = (0, import_core.createStyledHOC)(StyledInput, function(props, forwardedRef) {\n var {\n // Web props we need to convert\n type,\n disabled,\n readOnly,\n id,\n rows,\n autoComplete,\n enterKeyHint,\n // Callbacks\n onChange,\n onInput,\n onKeyDown,\n onChangeText,\n onSubmitEditing,\n onSelectionChange,\n onEndEditing,\n onContentSizeChange,\n onScroll,\n onKeyPress: onKeyPressProp,\n selection,\n // Native-only props (pass through directly)\n keyboardAppearance,\n returnKeyType: returnKeyTypeProp,\n submitBehavior,\n blurOnSubmit,\n caretHidden,\n contextMenuHidden,\n selectTextOnFocus,\n secureTextEntry: secureTextEntryProp,\n maxFontSizeMultiplier,\n allowFontScaling,\n multiline: multilineProp,\n keyboardType: keyboardTypeProp,\n inputMode: inputModeProp,\n autoCapitalize: autoCapitalizeProp,\n autoCorrect: autoCorrectProp,\n autoFocusNative,\n textContentType,\n // iOS-only props\n clearButtonMode,\n clearTextOnFocus,\n enablesReturnKeyAutomatically,\n dataDetectorTypes,\n scrollEnabled,\n passwordRules,\n rejectResponderTermination,\n spellCheck,\n lineBreakStrategyIOS,\n lineBreakModeIOS,\n smartInsertDelete,\n inputAccessoryViewID,\n inputAccessoryViewButtonLabel,\n disableKeyboardShortcuts,\n // Android-only props\n importantForAutofill,\n disableFullscreenUI,\n inlineImageLeft,\n inlineImagePadding,\n returnKeyLabel,\n textBreakStrategy,\n textAlignVertical,\n verticalAlign,\n showSoftInputOnFocus,\n numberOfLines: numberOfLinesProp,\n // Web-only props to filter out\n // @ts-ignore\n dirname,\n min,\n max,\n minLength,\n multiple,\n name,\n pattern,\n required,\n step,\n render,\n // caretColor is web-only as a CSS prop; on native forward to\n // cursorColor (Android) + selectionColor (iOS+Android caret) unless\n // those are explicitly set.\n // @ts-ignore - caretColor is typed as web-only in core\n caretColor,\n cursorColor: cursorColorProp,\n selectionColor: selectionColorProp,\n ...rest\n } = props;\n var { ref, composedRef } = (0, import_element.useNativeInputRef)(forwardedRef);\n var secureTextEntry = secureTextEntryProp !== null && secureTextEntryProp !== void 0 ? secureTextEntryProp : false;\n var keyboardType = keyboardTypeProp !== null && keyboardTypeProp !== void 0 ? keyboardTypeProp : \"default\";\n var inputMode = inputModeProp;\n if (!secureTextEntryProp && !keyboardTypeProp && !inputModeProp) {\n switch (type) {\n case \"password\":\n secureTextEntry = true;\n break;\n case \"email\":\n keyboardType = \"email-address\";\n inputMode = \"email\";\n break;\n case \"tel\":\n keyboardType = \"phone-pad\";\n inputMode = \"tel\";\n break;\n case \"number\":\n keyboardType = \"numeric\";\n inputMode = \"numeric\";\n break;\n case \"url\":\n keyboardType = \"url\";\n inputMode = \"url\";\n break;\n case \"search\":\n inputMode = \"search\";\n break;\n }\n }\n var returnKeyType = returnKeyTypeProp;\n if (!returnKeyType && enterKeyHint) {\n switch (enterKeyHint) {\n case \"done\":\n returnKeyType = \"done\";\n break;\n case \"go\":\n returnKeyType = \"go\";\n break;\n case \"next\":\n returnKeyType = \"next\";\n break;\n case \"search\":\n returnKeyType = \"search\";\n break;\n case \"send\":\n returnKeyType = \"send\";\n break;\n }\n }\n var multiline = multilineProp !== null && multilineProp !== void 0 ? multilineProp : render === \"textarea\" || rows && rows > 1;\n var numberOfLines = numberOfLinesProp !== null && numberOfLinesProp !== void 0 ? numberOfLinesProp : rows;\n var autoCorrect = autoCorrectProp === \"on\" ? true : autoCorrectProp === \"off\" ? false : autoCorrectProp;\n var autoCapitalize = autoCapitalizeProp === \"on\" ? \"sentences\" : autoCapitalizeProp === \"off\" ? \"none\" : autoCapitalizeProp;\n import_react.default.useEffect(function() {\n if (!id || disabled) return;\n return (0, import_focusable.registerFocusable)(id, {\n focusAndSelect: function() {\n var _ref_current;\n return (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.focus();\n },\n focus: function() {\n var _ref_current;\n return (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.focus();\n }\n });\n }, [\n id,\n disabled\n ]);\n var handleChangeText = function(text) {\n onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(text);\n if (onChange) {\n onChange({\n target: {\n value: text\n },\n type: \"change\"\n });\n }\n if (onInput) {\n onInput({\n target: {\n value: text\n },\n type: \"input\"\n });\n }\n };\n var handleKeyPress = function(e) {\n onKeyPressProp === null || onKeyPressProp === void 0 ? void 0 : onKeyPressProp(e);\n if (onKeyDown) {\n var { key } = e.nativeEvent;\n if (key === \"Backspace\" || key === \"Enter\" || key.length === 1) {\n onKeyDown({\n key,\n type: \"keydown\"\n });\n }\n }\n };\n var handleSubmitEditing = function(e) {\n if (onKeyDown) {\n onKeyDown({\n key: \"Enter\",\n type: \"keydown\"\n });\n }\n onSubmitEditing === null || onSubmitEditing === void 0 ? void 0 : onSubmitEditing(e);\n };\n var handleSelectionChange = function(e) {\n onSelectionChange === null || onSelectionChange === void 0 ? void 0 : onSelectionChange(e);\n };\n var finalProps = {\n ...rest,\n editable: !disabled && !readOnly,\n secureTextEntry,\n keyboardType,\n keyboardAppearance,\n inputMode,\n returnKeyType,\n multiline,\n numberOfLines,\n selection,\n autoComplete,\n autoFocus: autoFocusNative,\n // callbacks\n onChangeText: handleChangeText,\n onKeyPress: onKeyPressProp || onKeyDown ? handleKeyPress : void 0,\n onSubmitEditing: onKeyDown || onSubmitEditing ? handleSubmitEditing : void 0,\n onSelectionChange: onSelectionChange ? handleSelectionChange : void 0,\n onEndEditing,\n onContentSizeChange,\n onScroll,\n // cross-platform native props\n submitBehavior,\n blurOnSubmit,\n caretHidden,\n contextMenuHidden,\n selectTextOnFocus,\n maxFontSizeMultiplier,\n allowFontScaling,\n autoCapitalize,\n autoCorrect,\n textContentType,\n // iOS-only props\n clearButtonMode,\n clearTextOnFocus,\n enablesReturnKeyAutomatically,\n dataDetectorTypes,\n scrollEnabled,\n passwordRules,\n rejectResponderTermination,\n spellCheck,\n lineBreakStrategyIOS,\n lineBreakModeIOS,\n smartInsertDelete,\n inputAccessoryViewID,\n inputAccessoryViewButtonLabel,\n disableKeyboardShortcuts,\n // Android-only props\n importantForAutofill,\n disableFullscreenUI,\n inlineImageLeft,\n inlineImagePadding,\n returnKeyLabel,\n textBreakStrategy,\n textAlignVertical,\n verticalAlign,\n showSoftInputOnFocus,\n // caretColor → cursorColor (Android) + selectionColor (iOS+Android),\n // unless the caller passed those explicitly.\n cursorColor: cursorColorProp !== null && cursorColorProp !== void 0 ? cursorColorProp : caretColor,\n selectionColor: selectionColorProp !== null && selectionColorProp !== void 0 ? selectionColorProp : caretColor\n };\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledInput, {\n ref: composedRef,\n ...finalProps\n });\n});\n//# sourceMappingURL=Input.native.js.map\n"],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AmB,KAAK,IAAI,KAAK,IAAI,eAAe,CAAC;EAChF,IAAI,WAAW;GACb,IAAI,EAAE,QAAQ,EAAE;GAChB,IAAI,QAAQ,eAAe,QAAQ,WAAW,IAAI,WAAW,GAAG;IAC9D,UAAU;KACR;KACA,MAAM;IACR,CAAC;GACH;EACF;CACF;CACA,IAAI,sBAAsB,SAAS,GAAG;EACpC,IAAI,WAAW;GACb,UAAU;IACR,KAAK;IACL,MAAM;GACR,CAAC;EACH;EACA,oBAAoB,QAAQ,oBAAoB,KAAK,IAAI,KAAK,IAAI,gBAAgB,CAAC;CACrF;CACA,IAAI,wBAAwB,SAAS,GAAG;EACtC,sBAAsB,QAAQ,sBAAsB,KAAK,IAAI,KAAK,IAAI,kBAAkB,CAAC;CAC3F;CACA,IAAI,aAAa;EACf,GAAG;EACH,UAAU,CAAC,YAAY,CAAC;EACxB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,WAAW;EAEX,cAAc;EACd,YAAY,kBAAkB,YAAY,iBAAiB,KAAK;EAChE,iBAAiB,aAAa,kBAAkB,sBAAsB,KAAK;EAC3E,mBAAmB,oBAAoB,wBAAwB,KAAK;EACpE;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAGA,aAAa,oBAAoB,QAAQ,oBAAoB,KAAK,IAAI,kBAAkB;EACxF,gBAAgB,uBAAuB,QAAQ,uBAAuB,KAAK,IAAI,qBAAqB;CACtG;CACA,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,aAAa;EAC9D,KAAK;EACL,GAAG;CACL,CAAC;AACH,CAAC"}
|
|
1
|
+
{"version":3,"file":"Input.native.js","names":[],"sources":["cjs/Input.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Input_native_exports = {};\n__export(Input_native_exports, {\n Input: () => Input\n});\nmodule.exports = __toCommonJS(Input_native_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_react_native = require(\"react-native\");\nvar import_core = require(\"@tamagui/core\");\nvar import_focusable = require(\"@tamagui/focusable\");\nvar import_element = require(\"@tamagui/element\");\nvar import_shared = require(\"./shared\");\nvar StyledInput = (0, import_core.styled)(import_react_native.TextInput, import_shared.styledBody[0], import_shared.styledBody[1]).resolve(import_shared.resolveMultilineInputSize);\nvar Input = (0, import_core.createStyledHOC)(StyledInput, function(props, forwardedRef) {\n var {\n // Web props we need to convert\n type,\n disabled,\n readOnly,\n id,\n rows,\n autoComplete,\n enterKeyHint,\n // Callbacks\n onChange,\n onInput,\n onKeyDown,\n onChangeText,\n onSubmitEditing,\n onSelectionChange,\n onEndEditing,\n onContentSizeChange,\n onScroll,\n onKeyPress: onKeyPressProp,\n selection,\n // Native-only props (pass through directly)\n keyboardAppearance,\n returnKeyType: returnKeyTypeProp,\n submitBehavior,\n blurOnSubmit,\n caretHidden,\n contextMenuHidden,\n selectTextOnFocus,\n secureTextEntry: secureTextEntryProp,\n maxFontSizeMultiplier,\n allowFontScaling,\n multiline: multilineProp,\n keyboardType: keyboardTypeProp,\n inputMode: inputModeProp,\n autoCapitalize: autoCapitalizeProp,\n autoCorrect: autoCorrectProp,\n autoFocusNative,\n textContentType,\n // iOS-only props\n clearButtonMode,\n clearTextOnFocus,\n enablesReturnKeyAutomatically,\n dataDetectorTypes,\n scrollEnabled,\n passwordRules,\n rejectResponderTermination,\n spellCheck,\n lineBreakStrategyIOS,\n lineBreakModeIOS,\n smartInsertDelete,\n inputAccessoryViewID,\n inputAccessoryViewButtonLabel,\n disableKeyboardShortcuts,\n // Android-only props\n importantForAutofill,\n disableFullscreenUI,\n inlineImageLeft,\n inlineImagePadding,\n returnKeyLabel,\n textBreakStrategy,\n textAlignVertical,\n verticalAlign,\n showSoftInputOnFocus,\n numberOfLines: numberOfLinesProp,\n // Web-only props to filter out\n // @ts-ignore\n dirname,\n min,\n max,\n minLength,\n multiple,\n name,\n pattern,\n required,\n step,\n render,\n // caretColor is web-only as a CSS prop; on native forward to\n // cursorColor (Android) + selectionColor (iOS+Android caret) unless\n // those are explicitly set.\n // @ts-ignore - caretColor is typed as web-only in core\n caretColor,\n cursorColor: cursorColorProp,\n selectionColor: selectionColorProp,\n ...rest\n } = props;\n var { ref, composedRef } = (0, import_element.useNativeInputRef)(forwardedRef);\n var secureTextEntry = secureTextEntryProp !== null && secureTextEntryProp !== void 0 ? secureTextEntryProp : false;\n var keyboardType = keyboardTypeProp !== null && keyboardTypeProp !== void 0 ? keyboardTypeProp : \"default\";\n var inputMode = inputModeProp;\n if (!secureTextEntryProp && !keyboardTypeProp && !inputModeProp) {\n switch (type) {\n case \"password\":\n secureTextEntry = true;\n break;\n case \"email\":\n keyboardType = \"email-address\";\n inputMode = \"email\";\n break;\n case \"tel\":\n keyboardType = \"phone-pad\";\n inputMode = \"tel\";\n break;\n case \"number\":\n keyboardType = \"numeric\";\n inputMode = \"numeric\";\n break;\n case \"url\":\n keyboardType = \"url\";\n inputMode = \"url\";\n break;\n case \"search\":\n inputMode = \"search\";\n break;\n }\n }\n var returnKeyType = returnKeyTypeProp;\n if (!returnKeyType && enterKeyHint) {\n switch (enterKeyHint) {\n case \"done\":\n returnKeyType = \"done\";\n break;\n case \"go\":\n returnKeyType = \"go\";\n break;\n case \"next\":\n returnKeyType = \"next\";\n break;\n case \"search\":\n returnKeyType = \"search\";\n break;\n case \"send\":\n returnKeyType = \"send\";\n break;\n }\n }\n var multiline = multilineProp !== null && multilineProp !== void 0 ? multilineProp : render === \"textarea\" || rows && rows > 1;\n var numberOfLines = numberOfLinesProp !== null && numberOfLinesProp !== void 0 ? numberOfLinesProp : rows;\n var autoCorrect = autoCorrectProp === \"on\" ? true : autoCorrectProp === \"off\" ? false : autoCorrectProp;\n var autoCapitalize = autoCapitalizeProp === \"on\" ? \"sentences\" : autoCapitalizeProp === \"off\" ? \"none\" : autoCapitalizeProp;\n import_react.default.useEffect(function() {\n if (!id || disabled) return;\n return (0, import_focusable.registerFocusable)(id, {\n focusAndSelect: function() {\n var _ref_current;\n return (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.focus();\n },\n focus: function() {\n var _ref_current;\n return (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.focus();\n }\n });\n }, [\n id,\n disabled\n ]);\n var handleChangeText = function(text) {\n onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(text);\n if (onChange) {\n onChange({\n target: {\n value: text\n },\n type: \"change\"\n });\n }\n if (onInput) {\n onInput({\n target: {\n value: text\n },\n type: \"input\"\n });\n }\n };\n var handleKeyPress = function(e) {\n onKeyPressProp === null || onKeyPressProp === void 0 ? void 0 : onKeyPressProp(e);\n if (onKeyDown) {\n var { key } = e.nativeEvent;\n if (key === \"Backspace\" || key === \"Enter\" || key.length === 1) {\n onKeyDown({\n key,\n type: \"keydown\"\n });\n }\n }\n };\n var handleSubmitEditing = function(e) {\n if (onKeyDown) {\n onKeyDown({\n key: \"Enter\",\n type: \"keydown\"\n });\n }\n onSubmitEditing === null || onSubmitEditing === void 0 ? void 0 : onSubmitEditing(e);\n };\n var handleSelectionChange = function(e) {\n onSelectionChange === null || onSelectionChange === void 0 ? void 0 : onSelectionChange(e);\n };\n var finalProps = {\n ...rest,\n editable: !disabled && !readOnly,\n secureTextEntry,\n keyboardType,\n keyboardAppearance,\n inputMode,\n returnKeyType,\n multiline,\n numberOfLines,\n selection,\n autoComplete,\n autoFocus: autoFocusNative,\n // callbacks\n onChangeText: handleChangeText,\n onKeyPress: onKeyPressProp || onKeyDown ? handleKeyPress : void 0,\n onSubmitEditing: onKeyDown || onSubmitEditing ? handleSubmitEditing : void 0,\n onSelectionChange: onSelectionChange ? handleSelectionChange : void 0,\n onEndEditing,\n onContentSizeChange,\n onScroll,\n // cross-platform native props\n submitBehavior,\n blurOnSubmit,\n caretHidden,\n contextMenuHidden,\n selectTextOnFocus,\n maxFontSizeMultiplier,\n allowFontScaling,\n autoCapitalize,\n autoCorrect,\n textContentType,\n // iOS-only props\n clearButtonMode,\n clearTextOnFocus,\n enablesReturnKeyAutomatically,\n dataDetectorTypes,\n scrollEnabled,\n passwordRules,\n rejectResponderTermination,\n spellCheck,\n lineBreakStrategyIOS,\n lineBreakModeIOS,\n smartInsertDelete,\n inputAccessoryViewID,\n inputAccessoryViewButtonLabel,\n disableKeyboardShortcuts,\n // Android-only props\n importantForAutofill,\n disableFullscreenUI,\n inlineImageLeft,\n inlineImagePadding,\n returnKeyLabel,\n textBreakStrategy,\n textAlignVertical,\n verticalAlign,\n showSoftInputOnFocus,\n // caretColor → cursorColor (Android) + selectionColor (iOS+Android),\n // unless the caller passed those explicitly.\n cursorColor: cursorColorProp !== null && cursorColorProp !== void 0 ? cursorColorProp : caretColor,\n selectionColor: selectionColorProp !== null && selectionColorProp !== void 0 ? selectionColorProp : caretColor\n };\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledInput, {\n ref: composedRef,\n ...finalProps\n });\n});\n//# sourceMappingURL=Input.native.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,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,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAAK,YAAY;AAAK,CAAC,IAAI,QACzG,GACF;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,uBAAuB,CAAC;AAC5B,SAAS,sBAAsB,EAC7B,aAAa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AkB;EACxF,gBAAgB,uBAAuB,QAAQ,uBAAuB,KAAK,IAAI,qBAAqB;CACtG;CACA,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,aAAa;EAC9D,KAAK;EACL,GAAG;CACL,CAAC;AACH,CAAC"}
|
package/dist/cjs/TextArea.cjs
CHANGED
|
@@ -24,15 +24,13 @@ module.exports = __toCommonJS(TextArea_exports);
|
|
|
24
24
|
var import_web = require("@tamagui/web");
|
|
25
25
|
var import_Input = require("./Input.cjs");
|
|
26
26
|
var import_shared = require("./shared.cjs");
|
|
27
|
-
const
|
|
27
|
+
const TextAreaFrame = (0, import_web.styled)(import_Input.Input, {
|
|
28
28
|
displayName: "TextArea",
|
|
29
29
|
render: "textarea",
|
|
30
30
|
whiteSpace: "pre-wrap",
|
|
31
31
|
height: "auto",
|
|
32
32
|
...import_shared.defaultStyles,
|
|
33
33
|
rows: 3,
|
|
34
|
-
variants: { size:
|
|
35
|
-
true: import_shared.textAreaSizeVariant,
|
|
36
|
-
Size: import_shared.textAreaSizeVariant
|
|
37
|
-
} }
|
|
34
|
+
variants: { size: import_shared.textAreaSizeVariant }
|
|
38
35
|
});
|
|
36
|
+
const TextArea = TextAreaFrame.resolve(import_shared.resolveTextAreaSize);
|
|
@@ -26,15 +26,13 @@ module.exports = __toCommonJS(TextArea_exports);
|
|
|
26
26
|
var import_web = require("@tamagui/web");
|
|
27
27
|
var import_Input = require("./Input.native.js");
|
|
28
28
|
var import_shared = require("./shared.native.js");
|
|
29
|
-
var
|
|
29
|
+
var TextAreaFrame = (0, import_web.styled)(import_Input.Input, {
|
|
30
30
|
displayName: "TextArea",
|
|
31
31
|
render: "textarea",
|
|
32
32
|
whiteSpace: "pre-wrap",
|
|
33
33
|
height: "auto",
|
|
34
34
|
...import_shared.defaultStyles,
|
|
35
35
|
rows: 3,
|
|
36
|
-
variants: { size:
|
|
37
|
-
true: import_shared.textAreaSizeVariant,
|
|
38
|
-
Size: import_shared.textAreaSizeVariant
|
|
39
|
-
} }
|
|
36
|
+
variants: { size: import_shared.textAreaSizeVariant }
|
|
40
37
|
});
|
|
38
|
+
var TextArea = TextAreaFrame.resolve(import_shared.resolveTextAreaSize);
|
|
@@ -26,17 +26,15 @@ module.exports = __toCommonJS(TextArea_exports);
|
|
|
26
26
|
var import_web = require("@tamagui/web");
|
|
27
27
|
var import_Input = require("./Input.native.js");
|
|
28
28
|
var import_shared = require("./shared.native.js");
|
|
29
|
-
var
|
|
29
|
+
var TextAreaFrame = (0, import_web.styled)(import_Input.Input, {
|
|
30
30
|
displayName: "TextArea",
|
|
31
31
|
render: "textarea",
|
|
32
32
|
whiteSpace: "pre-wrap",
|
|
33
33
|
height: "auto",
|
|
34
34
|
...import_shared.defaultStyles,
|
|
35
35
|
rows: 3,
|
|
36
|
-
variants: { size:
|
|
37
|
-
true: import_shared.textAreaSizeVariant,
|
|
38
|
-
Size: import_shared.textAreaSizeVariant
|
|
39
|
-
} }
|
|
36
|
+
variants: { size: import_shared.textAreaSizeVariant }
|
|
40
37
|
});
|
|
38
|
+
var TextArea = TextAreaFrame.resolve(import_shared.resolveTextAreaSize);
|
|
41
39
|
|
|
42
40
|
//# sourceMappingURL=TextArea.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.native.js","names":[],"sources":["cjs/TextArea.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 TextArea_exports = {};\n__export(TextArea_exports, {\n TextArea: () => TextArea\n});\nmodule.exports = __toCommonJS(TextArea_exports);\nvar import_web = require(\"@tamagui/web\");\nvar import_Input = require(\"./Input\");\nvar import_shared = require(\"./shared\");\nvar
|
|
1
|
+
{"version":3,"file":"TextArea.native.js","names":[],"sources":["cjs/TextArea.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 TextArea_exports = {};\n__export(TextArea_exports, {\n TextArea: () => TextArea\n});\nmodule.exports = __toCommonJS(TextArea_exports);\nvar import_web = require(\"@tamagui/web\");\nvar import_Input = require(\"./Input\");\nvar import_shared = require(\"./shared\");\nvar TextAreaFrame = (0, import_web.styled)(import_Input.Input, {\n displayName: \"TextArea\",\n render: \"textarea\",\n // this attribute fixes firefox newline issue\n // @ts-ignore\n whiteSpace: \"pre-wrap\",\n height: \"auto\",\n ...import_shared.defaultStyles,\n rows: 3,\n variants: {\n size: import_shared.textAreaSizeVariant\n }\n});\nvar TextArea = TextAreaFrame.resolve(import_shared.resolveTextAreaSize);\n//# sourceMappingURL=TextArea.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,mBAAmB,CAAC;AACxB,SAAS,kBAAkB,EACzB,gBAAgB,SAClB,CAAC;AACD,OAAO,UAAU,aAAa,gBAAgB;AAC9C,IAAI,aAAa,QAAQ,cAAc;AACvC,IAAI,eAAe,QAAQ,mBAAS;AACpC,IAAI,gBAAgB,QAAQ,oBAAU;AACtC,IAAI,iBAAiB,GAAG,WAAW,OAAM,CAAE,aAAa,OAAO;CAC7D,aAAa;CACb,QAAQ;CAGR,YAAY;CACZ,QAAQ;CACR,GAAG,cAAc;CACjB,MAAM;CACN,UAAU,EACR,MAAM,cAAc,oBACtB;AACF,CAAC;AACD,IAAI,WAAW,cAAc,QAAQ,cAAc,mBAAmB"}
|
package/dist/cjs/shared.cjs
CHANGED
|
@@ -23,12 +23,13 @@ __export(shared_exports, {
|
|
|
23
23
|
INPUT_NAME: () => INPUT_NAME,
|
|
24
24
|
defaultStyles: () => defaultStyles,
|
|
25
25
|
inputSizeVariant: () => inputSizeVariant,
|
|
26
|
+
resolveMultilineInputSize: () => resolveMultilineInputSize,
|
|
27
|
+
resolveTextAreaSize: () => resolveTextAreaSize,
|
|
26
28
|
styledBody: () => styledBody,
|
|
27
29
|
textAreaSizeVariant: () => textAreaSizeVariant
|
|
28
30
|
});
|
|
29
31
|
module.exports = __toCommonJS(shared_exports);
|
|
30
32
|
var import_core = require("@tamagui/core");
|
|
31
|
-
var import_core2 = require("@tamagui/core");
|
|
32
33
|
var import_get_font_sized = require("@tamagui/get-font-sized");
|
|
33
34
|
const defaultStyles = {
|
|
34
35
|
size: true,
|
|
@@ -36,9 +37,9 @@ const defaultStyles = {
|
|
|
36
37
|
tabIndex: 0,
|
|
37
38
|
minWidth: 0
|
|
38
39
|
};
|
|
39
|
-
const resolveInputFrame = (val,
|
|
40
|
-
tokens:
|
|
41
|
-
font:
|
|
40
|
+
const resolveInputFrame = (val, env) => (0, import_core.resolveTokenSize)(val, {
|
|
41
|
+
tokens: env.tokens,
|
|
42
|
+
font: env.font
|
|
42
43
|
}).frame;
|
|
43
44
|
const inputSizeKeys = [
|
|
44
45
|
"0",
|
|
@@ -70,67 +71,80 @@ const inputSizeKeys = [
|
|
|
70
71
|
"19",
|
|
71
72
|
"20"
|
|
72
73
|
];
|
|
73
|
-
const getInputPadding = (val,
|
|
74
|
+
const getInputPadding = (val, env, steps) => {
|
|
74
75
|
if (typeof val === "number") {
|
|
75
76
|
return steps === 1 ? Math.max(0, Math.round(val * .6 - 12)) : Math.max(0, Math.round(val * .52 - 11.5));
|
|
76
77
|
}
|
|
77
78
|
const key = val === true ? "4" : val;
|
|
78
79
|
const index = inputSizeKeys.indexOf(key);
|
|
79
|
-
return
|
|
80
|
+
return env.tokens.space[inputSizeKeys[Math.max(0, index - steps)]];
|
|
80
81
|
};
|
|
81
|
-
const inputSizeVariant = (val = true,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
const frame = resolveInputFrame(val, extras);
|
|
86
|
-
const fontStyle = (0, import_get_font_sized.getFontSized)(val, extras);
|
|
87
|
-
if (!import_core2.isWeb && fontStyle) {
|
|
88
|
-
delete fontStyle["lineHeight"];
|
|
89
|
-
}
|
|
82
|
+
const inputSizeVariant = import_core.styled.dynamic((val = true, env) => {
|
|
83
|
+
const frame = resolveInputFrame(val, env);
|
|
84
|
+
const fontStyle = (0, import_get_font_sized.getFontSized)(val, env);
|
|
90
85
|
return {
|
|
91
|
-
|
|
86
|
+
color: fontStyle?.color,
|
|
87
|
+
fontFamily: fontStyle?.fontFamily,
|
|
88
|
+
fontSize: fontStyle?.fontSize,
|
|
89
|
+
fontStyle: fontStyle?.fontStyle,
|
|
90
|
+
fontWeight: fontStyle?.fontWeight,
|
|
91
|
+
letterSpacing: fontStyle?.letterSpacing,
|
|
92
|
+
lineHeight: import_core.isWeb ? fontStyle?.lineHeight : void 0,
|
|
93
|
+
textTransform: fontStyle?.textTransform,
|
|
92
94
|
height: frame.size,
|
|
93
95
|
borderRadius: frame.radius,
|
|
94
|
-
paddingHorizontal: getInputPadding(val,
|
|
96
|
+
paddingHorizontal: getInputPadding(val, env, 1)
|
|
95
97
|
};
|
|
96
|
-
};
|
|
97
|
-
const textAreaSizeVariant = (val = true,
|
|
98
|
-
const
|
|
99
|
-
const
|
|
100
|
-
const fontStyle = (0, import_get_font_sized.getFontSized)(val, extras);
|
|
101
|
-
const lines = props.rows ?? props.numberOfLines;
|
|
102
|
-
const height = typeof lines === "number" ? lines * (0, import_core2.getVariableValue)(fontStyle.lineHeight) : "auto";
|
|
103
|
-
if (!import_core2.isWeb && fontStyle) {
|
|
104
|
-
delete fontStyle["lineHeight"];
|
|
105
|
-
}
|
|
98
|
+
});
|
|
99
|
+
const textAreaSizeVariant = import_core.styled.dynamic((val = true, env) => {
|
|
100
|
+
const frame = resolveInputFrame(val, env);
|
|
101
|
+
const fontStyle = (0, import_get_font_sized.getFontSized)(val, env);
|
|
106
102
|
return {
|
|
107
103
|
borderRadius: frame.radius,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
104
|
+
color: fontStyle?.color,
|
|
105
|
+
fontFamily: fontStyle?.fontFamily,
|
|
106
|
+
fontSize: fontStyle?.fontSize,
|
|
107
|
+
fontStyle: fontStyle?.fontStyle,
|
|
108
|
+
fontWeight: fontStyle?.fontWeight,
|
|
109
|
+
letterSpacing: fontStyle?.letterSpacing,
|
|
110
|
+
lineHeight: import_core.isWeb ? fontStyle?.lineHeight : void 0,
|
|
111
|
+
textTransform: fontStyle?.textTransform,
|
|
112
|
+
paddingVertical: getInputPadding(val, env, 2),
|
|
113
|
+
paddingHorizontal: getInputPadding(val, env, 1),
|
|
114
|
+
height: "auto"
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
const resolveTextAreaSize = (props, env) => {
|
|
118
|
+
const sized = textAreaSizeVariant(props.size ?? true, env);
|
|
119
|
+
const fontStyle = (0, import_get_font_sized.getFontSized)(props.size ?? true, env);
|
|
120
|
+
const lines = props.rows ?? props.numberOfLines;
|
|
121
|
+
const height = typeof lines === "number" ? lines * (0, import_core.getVariableValue)(fontStyle?.lineHeight) : sized?.height;
|
|
122
|
+
return {
|
|
123
|
+
borderRadius: sized?.borderRadius,
|
|
124
|
+
color: sized?.color,
|
|
125
|
+
fontFamily: sized?.fontFamily,
|
|
126
|
+
fontSize: sized?.fontSize,
|
|
127
|
+
fontStyle: sized?.fontStyle,
|
|
128
|
+
fontWeight: sized?.fontWeight,
|
|
129
|
+
letterSpacing: sized?.letterSpacing,
|
|
130
|
+
lineHeight: sized?.lineHeight,
|
|
131
|
+
textTransform: sized?.textTransform,
|
|
132
|
+
paddingVertical: sized?.paddingVertical,
|
|
133
|
+
paddingHorizontal: sized?.paddingHorizontal,
|
|
111
134
|
height
|
|
112
135
|
};
|
|
113
136
|
};
|
|
137
|
+
const resolveMultilineInputSize = (props, env) => {
|
|
138
|
+
if (!(props.rows > 1 || props.multiline || props.numberOfLines > 1)) return;
|
|
139
|
+
return resolveTextAreaSize(props, env);
|
|
140
|
+
};
|
|
114
141
|
const INPUT_NAME = "Input";
|
|
115
142
|
const styledBody = [{
|
|
116
143
|
name: INPUT_NAME,
|
|
117
144
|
render: "input",
|
|
118
145
|
...defaultStyles,
|
|
119
146
|
variants: {
|
|
120
|
-
size:
|
|
121
|
-
true: inputSizeVariant,
|
|
122
|
-
Size: inputSizeVariant
|
|
123
|
-
},
|
|
147
|
+
size: inputSizeVariant,
|
|
124
148
|
disabled: { true: {} }
|
|
125
149
|
}
|
|
126
|
-
}, {
|
|
127
|
-
isInput: true,
|
|
128
|
-
accept: {
|
|
129
|
-
placeholderTextColor: "color",
|
|
130
|
-
selectionColor: "color",
|
|
131
|
-
cursorColor: "color",
|
|
132
|
-
selectionHandleColor: "color",
|
|
133
|
-
underlineColorAndroid: "color"
|
|
134
|
-
},
|
|
135
|
-
validStyles: import_core.Text.staticConfig.validStyles
|
|
136
|
-
}];
|
|
150
|
+
}, { isInput: true }];
|
|
@@ -25,12 +25,13 @@ __export(shared_exports, {
|
|
|
25
25
|
INPUT_NAME: () => INPUT_NAME,
|
|
26
26
|
defaultStyles: () => defaultStyles,
|
|
27
27
|
inputSizeVariant: () => inputSizeVariant,
|
|
28
|
+
resolveMultilineInputSize: () => resolveMultilineInputSize,
|
|
29
|
+
resolveTextAreaSize: () => resolveTextAreaSize,
|
|
28
30
|
styledBody: () => styledBody,
|
|
29
31
|
textAreaSizeVariant: () => textAreaSizeVariant
|
|
30
32
|
});
|
|
31
33
|
module.exports = __toCommonJS(shared_exports);
|
|
32
34
|
var import_core = require("@tamagui/core");
|
|
33
|
-
var import_core2 = require("@tamagui/core");
|
|
34
35
|
var import_get_font_sized = require("@tamagui/get-font-sized");
|
|
35
36
|
var defaultStyles = {
|
|
36
37
|
size: true,
|
|
@@ -38,10 +39,10 @@ var defaultStyles = {
|
|
|
38
39
|
tabIndex: 0,
|
|
39
40
|
minWidth: 0
|
|
40
41
|
};
|
|
41
|
-
var resolveInputFrame = function(val,
|
|
42
|
-
return (0,
|
|
43
|
-
tokens:
|
|
44
|
-
font:
|
|
42
|
+
var resolveInputFrame = function(val, env) {
|
|
43
|
+
return (0, import_core.resolveTokenSize)(val, {
|
|
44
|
+
tokens: env.tokens,
|
|
45
|
+
font: env.font
|
|
45
46
|
}).frame;
|
|
46
47
|
};
|
|
47
48
|
var inputSizeKeys = [
|
|
@@ -74,70 +75,85 @@ var inputSizeKeys = [
|
|
|
74
75
|
"19",
|
|
75
76
|
"20"
|
|
76
77
|
];
|
|
77
|
-
var getInputPadding = function(val,
|
|
78
|
+
var getInputPadding = function(val, env, steps) {
|
|
78
79
|
if (typeof val === "number") {
|
|
79
80
|
return steps === 1 ? Math.max(0, Math.round(val * .6 - 12)) : Math.max(0, Math.round(val * .52 - 11.5));
|
|
80
81
|
}
|
|
81
82
|
var key = val === true ? "4" : val;
|
|
82
83
|
var index = inputSizeKeys.indexOf(key);
|
|
83
|
-
return
|
|
84
|
+
return env.tokens.space[inputSizeKeys[Math.max(0, index - steps)]];
|
|
84
85
|
};
|
|
85
|
-
var inputSizeVariant = function() {
|
|
86
|
-
var val = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
var frame = resolveInputFrame(val, extras);
|
|
91
|
-
var fontStyle = (0, import_get_font_sized.getFontSized)(val, extras);
|
|
92
|
-
if (!import_core2.isWeb && fontStyle) {
|
|
93
|
-
delete fontStyle["lineHeight"];
|
|
94
|
-
}
|
|
86
|
+
var inputSizeVariant = import_core.styled.dynamic(function() {
|
|
87
|
+
var val = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true, env = arguments.length > 1 ? arguments[1] : void 0;
|
|
88
|
+
var frame = resolveInputFrame(val, env);
|
|
89
|
+
var fontStyle = (0, import_get_font_sized.getFontSized)(val, env);
|
|
95
90
|
return {
|
|
96
|
-
|
|
91
|
+
color: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.color,
|
|
92
|
+
fontFamily: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontFamily,
|
|
93
|
+
fontSize: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontSize,
|
|
94
|
+
fontStyle: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontStyle,
|
|
95
|
+
fontWeight: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontWeight,
|
|
96
|
+
letterSpacing: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.letterSpacing,
|
|
97
|
+
lineHeight: import_core.isWeb ? fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.lineHeight : void 0,
|
|
98
|
+
textTransform: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.textTransform,
|
|
97
99
|
height: frame.size,
|
|
98
100
|
borderRadius: frame.radius,
|
|
99
|
-
paddingHorizontal: getInputPadding(val,
|
|
101
|
+
paddingHorizontal: getInputPadding(val, env, 1)
|
|
100
102
|
};
|
|
101
|
-
};
|
|
102
|
-
var textAreaSizeVariant = function() {
|
|
103
|
-
var val = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true,
|
|
104
|
-
var
|
|
105
|
-
var
|
|
106
|
-
|
|
103
|
+
});
|
|
104
|
+
var textAreaSizeVariant = import_core.styled.dynamic(function() {
|
|
105
|
+
var val = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true, env = arguments.length > 1 ? arguments[1] : void 0;
|
|
106
|
+
var frame = resolveInputFrame(val, env);
|
|
107
|
+
var fontStyle = (0, import_get_font_sized.getFontSized)(val, env);
|
|
108
|
+
return {
|
|
109
|
+
borderRadius: frame.radius,
|
|
110
|
+
color: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.color,
|
|
111
|
+
fontFamily: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontFamily,
|
|
112
|
+
fontSize: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontSize,
|
|
113
|
+
fontStyle: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontStyle,
|
|
114
|
+
fontWeight: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.fontWeight,
|
|
115
|
+
letterSpacing: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.letterSpacing,
|
|
116
|
+
lineHeight: import_core.isWeb ? fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.lineHeight : void 0,
|
|
117
|
+
textTransform: fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.textTransform,
|
|
118
|
+
paddingVertical: getInputPadding(val, env, 2),
|
|
119
|
+
paddingHorizontal: getInputPadding(val, env, 1),
|
|
120
|
+
height: "auto"
|
|
121
|
+
};
|
|
122
|
+
});
|
|
123
|
+
var resolveTextAreaSize = function(props, env) {
|
|
124
|
+
var _props_size;
|
|
125
|
+
var sized = textAreaSizeVariant((_props_size = props.size) !== null && _props_size !== void 0 ? _props_size : true, env);
|
|
126
|
+
var _props_size1;
|
|
127
|
+
var fontStyle = (0, import_get_font_sized.getFontSized)((_props_size1 = props.size) !== null && _props_size1 !== void 0 ? _props_size1 : true, env);
|
|
107
128
|
var _props_rows;
|
|
108
129
|
var lines = (_props_rows = props.rows) !== null && _props_rows !== void 0 ? _props_rows : props.numberOfLines;
|
|
109
|
-
var height = typeof lines === "number" ? lines * (0,
|
|
110
|
-
if (!import_core2.isWeb && fontStyle) {
|
|
111
|
-
delete fontStyle["lineHeight"];
|
|
112
|
-
}
|
|
130
|
+
var height = typeof lines === "number" ? lines * (0, import_core.getVariableValue)(fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.lineHeight) : sized === null || sized === void 0 ? void 0 : sized.height;
|
|
113
131
|
return {
|
|
114
|
-
borderRadius:
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
132
|
+
borderRadius: sized === null || sized === void 0 ? void 0 : sized.borderRadius,
|
|
133
|
+
color: sized === null || sized === void 0 ? void 0 : sized.color,
|
|
134
|
+
fontFamily: sized === null || sized === void 0 ? void 0 : sized.fontFamily,
|
|
135
|
+
fontSize: sized === null || sized === void 0 ? void 0 : sized.fontSize,
|
|
136
|
+
fontStyle: sized === null || sized === void 0 ? void 0 : sized.fontStyle,
|
|
137
|
+
fontWeight: sized === null || sized === void 0 ? void 0 : sized.fontWeight,
|
|
138
|
+
letterSpacing: sized === null || sized === void 0 ? void 0 : sized.letterSpacing,
|
|
139
|
+
lineHeight: sized === null || sized === void 0 ? void 0 : sized.lineHeight,
|
|
140
|
+
textTransform: sized === null || sized === void 0 ? void 0 : sized.textTransform,
|
|
141
|
+
paddingVertical: sized === null || sized === void 0 ? void 0 : sized.paddingVertical,
|
|
142
|
+
paddingHorizontal: sized === null || sized === void 0 ? void 0 : sized.paddingHorizontal,
|
|
118
143
|
height
|
|
119
144
|
};
|
|
120
145
|
};
|
|
146
|
+
var resolveMultilineInputSize = function(props, env) {
|
|
147
|
+
if (!(props.rows > 1 || props.multiline || props.numberOfLines > 1)) return;
|
|
148
|
+
return resolveTextAreaSize(props, env);
|
|
149
|
+
};
|
|
121
150
|
var INPUT_NAME = "Input";
|
|
122
151
|
var styledBody = [{
|
|
123
152
|
name: INPUT_NAME,
|
|
124
153
|
render: "input",
|
|
125
154
|
...defaultStyles,
|
|
126
155
|
variants: {
|
|
127
|
-
size:
|
|
128
|
-
true: inputSizeVariant,
|
|
129
|
-
Size: inputSizeVariant
|
|
130
|
-
},
|
|
156
|
+
size: inputSizeVariant,
|
|
131
157
|
disabled: { true: {} }
|
|
132
158
|
}
|
|
133
|
-
}, {
|
|
134
|
-
isInput: true,
|
|
135
|
-
accept: {
|
|
136
|
-
placeholderTextColor: "color",
|
|
137
|
-
selectionColor: "color",
|
|
138
|
-
cursorColor: "color",
|
|
139
|
-
selectionHandleColor: "color",
|
|
140
|
-
underlineColorAndroid: "color"
|
|
141
|
-
},
|
|
142
|
-
validStyles: import_core.Text.staticConfig.validStyles
|
|
143
|
-
}];
|
|
159
|
+
}, { isInput: true }];
|