@ornikar/kitt-universal 9.8.0 → 9.9.0
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/definitions/forms/InputText/InputText.d.ts.map +1 -1
- package/dist/definitions/forms/InputText/InputTextContainer.web.d.ts.map +1 -1
- package/dist/definitions/forms/styledTextInputMixin.d.ts +1 -0
- package/dist/definitions/forms/styledTextInputMixin.d.ts.map +1 -1
- package/dist/definitions/forms/utils.d.ts +1 -0
- package/dist/definitions/forms/utils.d.ts.map +1 -1
- package/dist/definitions/native-base/KittNativeBaseProvider.d.ts +72 -0
- package/dist/definitions/native-base/KittNativeBaseProvider.d.ts.map +1 -1
- package/dist/definitions/themes/default.d.ts +1 -0
- package/dist/definitions/themes/default.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/colors.d.ts +1 -0
- package/dist/definitions/themes/late-ocean/colors.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/input.d.ts +4 -2
- package/dist/definitions/themes/late-ocean/input.d.ts.map +1 -1
- package/dist/index-browser-all.es.android.js +131 -85
- package/dist/index-browser-all.es.android.js.map +1 -1
- package/dist/index-browser-all.es.ios.js +131 -85
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +131 -85
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +131 -97
- package/dist/index-browser-all.es.web.js.map +1 -1
- package/dist/index-node-14.17.cjs.js +108 -59
- package/dist/index-node-14.17.cjs.js.map +1 -1
- package/dist/index-node-14.17.cjs.web.css +1 -1
- package/dist/index-node-14.17.cjs.web.js +107 -69
- package/dist/index-node-14.17.cjs.web.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.android.js +11 -7
- package/dist/linaria-themes-browser-all.es.android.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.ios.js +11 -7
- package/dist/linaria-themes-browser-all.es.ios.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.js +11 -7
- package/dist/linaria-themes-browser-all.es.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.web.js +11 -7
- package/dist/linaria-themes-browser-all.es.web.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.js +11 -7
- package/dist/linaria-themes-node-14.17.cjs.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.web.js +11 -7
- package/dist/linaria-themes-node-14.17.cjs.web.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
2
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
|
-
import { Stack as Stack$1, VStack as VStack$1, HStack as HStack$1, Text as Text$1, View as View$1, ScrollView as ScrollView$1, Pressable as Pressable$1, Image as Image$1, NativeBaseProvider, extendTheme } from 'native-base';
|
|
3
|
+
import { Stack as Stack$1, VStack as VStack$1, HStack as HStack$1, Text as Text$1, View as View$1, ScrollView as ScrollView$1, Pressable as Pressable$1, Image as Image$1, Input, NativeBaseProvider, extendTheme } from 'native-base';
|
|
4
4
|
import _extends from '@babel/runtime/helpers/extends';
|
|
5
5
|
import React, { forwardRef, useContext, createContext, cloneElement, useRef, useEffect, useState, Children, useMemo, Fragment as Fragment$1 } from 'react';
|
|
6
|
-
import { Platform, Animated as Animated$1, Easing, useWindowDimensions, Image, StyleSheet, View as View$2, ScrollView as ScrollView$2, Linking, Pressable as Pressable$2, Modal as Modal$1, Text as Text$2
|
|
6
|
+
import { Platform, Animated as Animated$1, Easing, useWindowDimensions, Image, StyleSheet, View as View$2, ScrollView as ScrollView$2, Linking, Pressable as Pressable$2, Modal as Modal$1, Text as Text$2 } from 'react-native';
|
|
7
7
|
export { useWindowDimensions as useWindowSize } from 'react-native';
|
|
8
8
|
import Animated, { useSharedValue, useAnimatedStyle, interpolateColor, withSpring, useDerivedValue, withTiming, useAnimatedProps, withDelay, Easing as Easing$1, withRepeat, interpolate } from 'react-native-reanimated';
|
|
9
9
|
import styled, { useTheme, css, ThemeProvider } from 'styled-components/native';
|
|
@@ -1613,6 +1613,7 @@ var colors = {
|
|
|
1613
1613
|
hover: lateOceanColorPalette.black100,
|
|
1614
1614
|
white: lateOceanColorPalette.white,
|
|
1615
1615
|
black: lateOceanColorPalette.black1000,
|
|
1616
|
+
blackLight: lateOceanColorPalette.black555,
|
|
1616
1617
|
blackAnthracite: lateOceanColorPalette.black800,
|
|
1617
1618
|
uiBackground: lateOceanColorPalette.black25,
|
|
1618
1619
|
uiBackgroundLight: lateOceanColorPalette.white,
|
|
@@ -1913,34 +1914,34 @@ var inputStatesStyle = {
|
|
|
1913
1914
|
"default": {
|
|
1914
1915
|
backgroundColor: colors.uiBackgroundLight,
|
|
1915
1916
|
borderColor: colors.separator,
|
|
1916
|
-
color:
|
|
1917
|
+
color: colors.black
|
|
1917
1918
|
},
|
|
1918
1919
|
pending: {
|
|
1919
1920
|
backgroundColor: colors.uiBackgroundLight,
|
|
1920
1921
|
borderColor: colors.separator,
|
|
1921
|
-
color:
|
|
1922
|
+
color: colors.black
|
|
1922
1923
|
},
|
|
1923
1924
|
valid: {
|
|
1924
1925
|
backgroundColor: colors.uiBackgroundLight,
|
|
1925
1926
|
borderColor: lateOceanColorPalette.black100,
|
|
1926
|
-
color:
|
|
1927
|
+
color: colors.black
|
|
1927
1928
|
},
|
|
1928
1929
|
hover: {
|
|
1929
1930
|
borderColor: lateOceanColorPalette.black200,
|
|
1930
|
-
color:
|
|
1931
|
+
color: colors.black
|
|
1931
1932
|
},
|
|
1932
1933
|
focus: {
|
|
1933
1934
|
borderColor: colors.primary,
|
|
1934
|
-
color:
|
|
1935
|
+
color: colors.black
|
|
1935
1936
|
},
|
|
1936
1937
|
disabled: {
|
|
1937
1938
|
backgroundColor: colors.disabled,
|
|
1938
1939
|
borderColor: colors.separator,
|
|
1939
|
-
color:
|
|
1940
|
+
color: colors.blackLight
|
|
1940
1941
|
},
|
|
1941
1942
|
invalid: {
|
|
1942
1943
|
borderColor: colors.separator,
|
|
1943
|
-
color:
|
|
1944
|
+
color: colors.black
|
|
1944
1945
|
}
|
|
1945
1946
|
};
|
|
1946
1947
|
var input = {
|
|
@@ -1954,6 +1955,9 @@ var input = {
|
|
|
1954
1955
|
icon: {
|
|
1955
1956
|
size: 20
|
|
1956
1957
|
},
|
|
1958
|
+
rightContainer: {
|
|
1959
|
+
padding: 10
|
|
1960
|
+
},
|
|
1957
1961
|
padding: {
|
|
1958
1962
|
horizontal: 16,
|
|
1959
1963
|
vertical: 5
|
|
@@ -2370,6 +2374,7 @@ function Checkbox(_ref6) {
|
|
|
2370
2374
|
});
|
|
2371
2375
|
}
|
|
2372
2376
|
|
|
2377
|
+
/** @deprecated use native-base instead */
|
|
2373
2378
|
function getInputUIState(_ref) {
|
|
2374
2379
|
var isFocused = _ref.isFocused,
|
|
2375
2380
|
isDisabled = _ref.isDisabled,
|
|
@@ -2380,6 +2385,7 @@ function getInputUIState(_ref) {
|
|
|
2380
2385
|
return 'default';
|
|
2381
2386
|
}
|
|
2382
2387
|
|
|
2388
|
+
/** @deprecated this mixin is not SSR compatible */
|
|
2383
2389
|
var styledTextInputMixin = /*#__PURE__*/css(["background-color:", ";border-width:", "px;border-radius:", "px;border-color:", ";font-size:", ";color:", ";font-family:", ";"], function (_ref) {
|
|
2384
2390
|
var theme = _ref.theme,
|
|
2385
2391
|
$state = _ref.$state;
|
|
@@ -2401,7 +2407,7 @@ var styledTextInputMixin = /*#__PURE__*/css(["background-color:", ";border-width
|
|
|
2401
2407
|
}, function (_ref6) {
|
|
2402
2408
|
var theme = _ref6.theme,
|
|
2403
2409
|
$state = _ref6.$state;
|
|
2404
|
-
return theme.kitt.
|
|
2410
|
+
return theme.kitt.forms.input.states[$state].color || theme.kitt.forms.input.states["default"].color;
|
|
2405
2411
|
}, function (_ref7) {
|
|
2406
2412
|
var theme = _ref7.theme;
|
|
2407
2413
|
return theme.kitt.typography.types.bodies.fontFamily.regular;
|
|
@@ -3124,97 +3130,65 @@ var InputTextContainer = /*#__PURE__*/styled.View.withConfig({
|
|
|
3124
3130
|
displayName: "InputTextContainer"
|
|
3125
3131
|
})(["position:relative;"]);
|
|
3126
3132
|
|
|
3127
|
-
var _excluded$9 = ["id", "right", "
|
|
3128
|
-
var
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
var theme = _ref3.theme,
|
|
3149
|
-
_ref3$$minHeight = _ref3.$minHeight,
|
|
3150
|
-
$minHeight = _ref3$$minHeight === void 0 ? theme.kitt.forms.input.minHeight : _ref3$$minHeight;
|
|
3151
|
-
return $minHeight;
|
|
3152
|
-
});
|
|
3153
|
-
var RightInputContainer = /*#__PURE__*/styled.View.withConfig({
|
|
3154
|
-
displayName: "InputText__RightInputContainer"
|
|
3155
|
-
})(["position:absolute;right:0;top:0;bottom:0;justify-content:center;padding:10px;"]);
|
|
3156
|
-
var InputText = /*#__PURE__*/forwardRef(function (_ref4, ref) {
|
|
3157
|
-
var id = _ref4.id,
|
|
3158
|
-
right = _ref4.right,
|
|
3159
|
-
minHeight = _ref4.minHeight,
|
|
3160
|
-
formState = _ref4.state,
|
|
3161
|
-
internalForceState = _ref4.internalForceState,
|
|
3162
|
-
_ref4$disabled = _ref4.disabled,
|
|
3163
|
-
disabled = _ref4$disabled === void 0 ? false : _ref4$disabled,
|
|
3164
|
-
_ref4$autoCorrect = _ref4.autoCorrect,
|
|
3165
|
-
autoCorrect = _ref4$autoCorrect === void 0 ? true : _ref4$autoCorrect,
|
|
3166
|
-
_ref4$textContentType = _ref4.textContentType,
|
|
3167
|
-
textContentType = _ref4$textContentType === void 0 ? 'none' : _ref4$textContentType,
|
|
3168
|
-
_ref4$autoComplete = _ref4.autoComplete,
|
|
3169
|
-
autoComplete = _ref4$autoComplete === void 0 ? 'off' : _ref4$autoComplete,
|
|
3170
|
-
_ref4$keyboardType = _ref4.keyboardType,
|
|
3171
|
-
keyboardType = _ref4$keyboardType === void 0 ? 'default' : _ref4$keyboardType,
|
|
3172
|
-
multiline = _ref4.multiline,
|
|
3173
|
-
onSubmitEditing = _ref4.onSubmitEditing,
|
|
3174
|
-
_onFocus = _ref4.onFocus,
|
|
3175
|
-
_onBlur = _ref4.onBlur,
|
|
3176
|
-
props = _objectWithoutProperties(_ref4, _excluded$9);
|
|
3133
|
+
var _excluded$9 = ["id", "right", "state", "internalForceState", "disabled", "autoCorrect", "textContentType", "autoComplete", "keyboardType", "multiline", "onSubmitEditing", "onFocus", "onBlur"];
|
|
3134
|
+
var InputText = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
3135
|
+
var id = _ref.id,
|
|
3136
|
+
right = _ref.right;
|
|
3137
|
+
_ref.state;
|
|
3138
|
+
var internalForceState = _ref.internalForceState,
|
|
3139
|
+
_ref$disabled = _ref.disabled,
|
|
3140
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
3141
|
+
_ref$autoCorrect = _ref.autoCorrect,
|
|
3142
|
+
autoCorrect = _ref$autoCorrect === void 0 ? true : _ref$autoCorrect,
|
|
3143
|
+
_ref$textContentType = _ref.textContentType,
|
|
3144
|
+
textContentType = _ref$textContentType === void 0 ? 'none' : _ref$textContentType,
|
|
3145
|
+
_ref$autoComplete = _ref.autoComplete,
|
|
3146
|
+
autoComplete = _ref$autoComplete === void 0 ? 'off' : _ref$autoComplete,
|
|
3147
|
+
_ref$keyboardType = _ref.keyboardType,
|
|
3148
|
+
keyboardType = _ref$keyboardType === void 0 ? 'default' : _ref$keyboardType,
|
|
3149
|
+
multiline = _ref.multiline,
|
|
3150
|
+
onSubmitEditing = _ref.onSubmitEditing;
|
|
3151
|
+
_ref.onFocus;
|
|
3152
|
+
_ref.onBlur;
|
|
3153
|
+
var props = _objectWithoutProperties(_ref, _excluded$9);
|
|
3177
3154
|
|
|
3178
3155
|
var theme = /*#__PURE__*/useTheme();
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
3182
|
-
isFocused = _useState2[0],
|
|
3183
|
-
setIsFocused = _useState2[1];
|
|
3184
|
-
|
|
3185
|
-
var state = internalForceState || getInputUIState({
|
|
3186
|
-
isFocused: isFocused,
|
|
3187
|
-
isDisabled: disabled,
|
|
3188
|
-
formState: formState
|
|
3156
|
+
var fontSizeForNativeBase = createNativeBaseFontSize({
|
|
3157
|
+
base: 'body'
|
|
3189
3158
|
});
|
|
3159
|
+
var shouldHandleSingleLineOnIOS = Platform.OS === 'ios' && !multiline;
|
|
3190
3160
|
return /*#__PURE__*/jsxs(InputTextContainer, {
|
|
3191
3161
|
$isDisabled: disabled,
|
|
3192
|
-
children: [/*#__PURE__*/jsx(
|
|
3162
|
+
children: [/*#__PURE__*/jsx(Input, _objectSpread(_objectSpread({
|
|
3193
3163
|
ref: ref,
|
|
3194
3164
|
multiline: multiline,
|
|
3195
3165
|
nativeID: id,
|
|
3196
|
-
|
|
3166
|
+
isDisabled: internalForceState ? internalForceState === 'disabled' : disabled,
|
|
3167
|
+
isHovered: internalForceState ? internalForceState === 'hover' : undefined,
|
|
3168
|
+
isFocused: internalForceState ? internalForceState === 'focus' : undefined,
|
|
3197
3169
|
keyboardType: keyboardType,
|
|
3198
3170
|
autoComplete: autoComplete,
|
|
3199
3171
|
autoCorrect: autoCorrect,
|
|
3200
|
-
$minHeight: minHeight,
|
|
3201
3172
|
textContentType: textContentType,
|
|
3202
|
-
|
|
3203
|
-
|
|
3173
|
+
fontSize: fontSizeForNativeBase,
|
|
3174
|
+
lineHeight: // On basic text input, we set the line-height to zero for iOS to fix vertical text alignment
|
|
3175
|
+
// This is a iOS only fix since having 0 as a line-height value breaks text inputs on Android
|
|
3176
|
+
shouldHandleSingleLineOnIOS ? 0 : fontSizeForNativeBase,
|
|
3177
|
+
fontWeight: "bodies.regular",
|
|
3178
|
+
fontFamily: "bodies.regular",
|
|
3179
|
+
py: !multiline && Platform.OS !== 'web' ? 0 : undefined
|
|
3204
3180
|
}, props), {}, {
|
|
3205
|
-
|
|
3206
|
-
onFocus: function onFocus(e) {
|
|
3207
|
-
setIsFocused(true);
|
|
3208
|
-
if (_onFocus) _onFocus(e);
|
|
3209
|
-
},
|
|
3210
|
-
onBlur: function onBlur(e) {
|
|
3211
|
-
setIsFocused(false);
|
|
3212
|
-
if (_onBlur) _onBlur(e);
|
|
3213
|
-
},
|
|
3181
|
+
variant: "outline",
|
|
3214
3182
|
onSubmitEditing: multiline ? function () {
|
|
3215
3183
|
return null;
|
|
3216
3184
|
} : onSubmitEditing
|
|
3217
|
-
})), right ? /*#__PURE__*/jsx(
|
|
3185
|
+
})), right ? /*#__PURE__*/jsx(View, {
|
|
3186
|
+
position: "absolute",
|
|
3187
|
+
right: 0,
|
|
3188
|
+
top: 0,
|
|
3189
|
+
bottom: 0,
|
|
3190
|
+
justifyContent: "center",
|
|
3191
|
+
padding: theme.kitt.forms.input.rightContainer.padding,
|
|
3218
3192
|
children: right
|
|
3219
3193
|
}) : null]
|
|
3220
3194
|
});
|
|
@@ -4133,6 +4107,78 @@ var createKittNativeBaseCustomTheme = function (theme) {
|
|
|
4133
4107
|
bodies: theme.typography.types.bodies.fontFamily
|
|
4134
4108
|
},
|
|
4135
4109
|
components: {
|
|
4110
|
+
Input: {
|
|
4111
|
+
baseStyle: {
|
|
4112
|
+
width: '100%',
|
|
4113
|
+
minHeight: theme.forms.input.minHeight,
|
|
4114
|
+
py: theme.forms.input.padding.vertical,
|
|
4115
|
+
px: theme.forms.input.padding.horizontal,
|
|
4116
|
+
borderRadius: theme.forms.input.borderRadius,
|
|
4117
|
+
_disabled: {
|
|
4118
|
+
opacity: 1 // override default native-base opacity
|
|
4119
|
+
|
|
4120
|
+
},
|
|
4121
|
+
_light: {
|
|
4122
|
+
color: theme.forms.input.states["default"].color,
|
|
4123
|
+
placeholderTextColor: theme.forms.input.color.placeholder,
|
|
4124
|
+
borderColor: theme.forms.input.states["default"].borderColor,
|
|
4125
|
+
bg: theme.forms.input.states["default"].backgroundColor,
|
|
4126
|
+
_hover: {
|
|
4127
|
+
borderColor: theme.forms.input.states.hover.borderColor,
|
|
4128
|
+
color: theme.forms.input.states.hover.color,
|
|
4129
|
+
_focus: {
|
|
4130
|
+
borderColor: theme.forms.input.states.focus.borderColor,
|
|
4131
|
+
color: theme.forms.input.states.focus.color
|
|
4132
|
+
}
|
|
4133
|
+
},
|
|
4134
|
+
_focus: {
|
|
4135
|
+
borderColor: theme.forms.input.states.focus.borderColor,
|
|
4136
|
+
color: theme.forms.input.states.focus.color,
|
|
4137
|
+
_hover: {
|
|
4138
|
+
borderColor: theme.forms.input.states.focus.borderColor,
|
|
4139
|
+
color: theme.forms.input.states.focus.color
|
|
4140
|
+
},
|
|
4141
|
+
_stack: {
|
|
4142
|
+
style: {
|
|
4143
|
+
outlineWidth: 0
|
|
4144
|
+
}
|
|
4145
|
+
}
|
|
4146
|
+
},
|
|
4147
|
+
_invalid: {
|
|
4148
|
+
borderColor: theme.forms.input.states.invalid.borderColor,
|
|
4149
|
+
color: theme.forms.input.states.invalid.color,
|
|
4150
|
+
_hover: {
|
|
4151
|
+
borderColor: theme.forms.input.states.hover.borderColor,
|
|
4152
|
+
color: theme.forms.input.states.hover.color
|
|
4153
|
+
}
|
|
4154
|
+
},
|
|
4155
|
+
_ios: {
|
|
4156
|
+
selectionColor: theme.forms.input.color.selection
|
|
4157
|
+
},
|
|
4158
|
+
_android: {
|
|
4159
|
+
selectionColor: theme.forms.input.color.selection
|
|
4160
|
+
},
|
|
4161
|
+
_disabled: {
|
|
4162
|
+
placeholderTextColor: theme.forms.input.color.placeholder,
|
|
4163
|
+
color: theme.forms.input.states.disabled.color,
|
|
4164
|
+
borderColor: theme.forms.input.states.disabled.borderColor,
|
|
4165
|
+
bg: theme.forms.input.states.disabled.backgroundColor
|
|
4166
|
+
}
|
|
4167
|
+
}
|
|
4168
|
+
},
|
|
4169
|
+
variants: {
|
|
4170
|
+
outline: {
|
|
4171
|
+
borderWidth: theme.forms.input.borderWidth,
|
|
4172
|
+
_focus: {
|
|
4173
|
+
bg: theme.forms.input.states["default"].backgroundColor
|
|
4174
|
+
}
|
|
4175
|
+
},
|
|
4176
|
+
underlined: {},
|
|
4177
|
+
rounded: {},
|
|
4178
|
+
filled: {},
|
|
4179
|
+
unstyled: {}
|
|
4180
|
+
}
|
|
4181
|
+
},
|
|
4136
4182
|
Text: {
|
|
4137
4183
|
baseStyle: {
|
|
4138
4184
|
_light: {
|