@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';
|
|
@@ -1614,6 +1614,7 @@ var colors = {
|
|
|
1614
1614
|
hover: lateOceanColorPalette.black100,
|
|
1615
1615
|
white: lateOceanColorPalette.white,
|
|
1616
1616
|
black: lateOceanColorPalette.black1000,
|
|
1617
|
+
blackLight: lateOceanColorPalette.black555,
|
|
1617
1618
|
blackAnthracite: lateOceanColorPalette.black800,
|
|
1618
1619
|
uiBackground: lateOceanColorPalette.black25,
|
|
1619
1620
|
uiBackgroundLight: lateOceanColorPalette.white,
|
|
@@ -1914,34 +1915,34 @@ var inputStatesStyle = {
|
|
|
1914
1915
|
"default": {
|
|
1915
1916
|
backgroundColor: colors.uiBackgroundLight,
|
|
1916
1917
|
borderColor: colors.separator,
|
|
1917
|
-
color:
|
|
1918
|
+
color: colors.black
|
|
1918
1919
|
},
|
|
1919
1920
|
pending: {
|
|
1920
1921
|
backgroundColor: colors.uiBackgroundLight,
|
|
1921
1922
|
borderColor: colors.separator,
|
|
1922
|
-
color:
|
|
1923
|
+
color: colors.black
|
|
1923
1924
|
},
|
|
1924
1925
|
valid: {
|
|
1925
1926
|
backgroundColor: colors.uiBackgroundLight,
|
|
1926
1927
|
borderColor: lateOceanColorPalette.black100,
|
|
1927
|
-
color:
|
|
1928
|
+
color: colors.black
|
|
1928
1929
|
},
|
|
1929
1930
|
hover: {
|
|
1930
1931
|
borderColor: lateOceanColorPalette.black200,
|
|
1931
|
-
color:
|
|
1932
|
+
color: colors.black
|
|
1932
1933
|
},
|
|
1933
1934
|
focus: {
|
|
1934
1935
|
borderColor: colors.primary,
|
|
1935
|
-
color:
|
|
1936
|
+
color: colors.black
|
|
1936
1937
|
},
|
|
1937
1938
|
disabled: {
|
|
1938
1939
|
backgroundColor: colors.disabled,
|
|
1939
1940
|
borderColor: colors.separator,
|
|
1940
|
-
color:
|
|
1941
|
+
color: colors.blackLight
|
|
1941
1942
|
},
|
|
1942
1943
|
invalid: {
|
|
1943
1944
|
borderColor: colors.separator,
|
|
1944
|
-
color:
|
|
1945
|
+
color: colors.black
|
|
1945
1946
|
}
|
|
1946
1947
|
};
|
|
1947
1948
|
var input = {
|
|
@@ -1955,6 +1956,9 @@ var input = {
|
|
|
1955
1956
|
icon: {
|
|
1956
1957
|
size: 20
|
|
1957
1958
|
},
|
|
1959
|
+
rightContainer: {
|
|
1960
|
+
padding: 10
|
|
1961
|
+
},
|
|
1958
1962
|
padding: {
|
|
1959
1963
|
horizontal: 16,
|
|
1960
1964
|
vertical: 5
|
|
@@ -2371,6 +2375,7 @@ function Checkbox(_ref6) {
|
|
|
2371
2375
|
});
|
|
2372
2376
|
}
|
|
2373
2377
|
|
|
2378
|
+
/** @deprecated use native-base instead */
|
|
2374
2379
|
function getInputUIState(_ref) {
|
|
2375
2380
|
var isFocused = _ref.isFocused,
|
|
2376
2381
|
isDisabled = _ref.isDisabled,
|
|
@@ -2381,6 +2386,7 @@ function getInputUIState(_ref) {
|
|
|
2381
2386
|
return 'default';
|
|
2382
2387
|
}
|
|
2383
2388
|
|
|
2389
|
+
/** @deprecated this mixin is not SSR compatible */
|
|
2384
2390
|
var styledTextInputMixin = /*#__PURE__*/css(["background-color:", ";border-width:", "px;border-radius:", "px;border-color:", ";font-size:", ";color:", ";font-family:", ";"], function (_ref) {
|
|
2385
2391
|
var theme = _ref.theme,
|
|
2386
2392
|
$state = _ref.$state;
|
|
@@ -2402,7 +2408,7 @@ var styledTextInputMixin = /*#__PURE__*/css(["background-color:", ";border-width
|
|
|
2402
2408
|
}, function (_ref6) {
|
|
2403
2409
|
var theme = _ref6.theme,
|
|
2404
2410
|
$state = _ref6.$state;
|
|
2405
|
-
return theme.kitt.
|
|
2411
|
+
return theme.kitt.forms.input.states[$state].color || theme.kitt.forms.input.states["default"].color;
|
|
2406
2412
|
}, function (_ref7) {
|
|
2407
2413
|
var theme = _ref7.theme;
|
|
2408
2414
|
return theme.kitt.typography.types.bodies.fontFamily.regular;
|
|
@@ -3177,97 +3183,65 @@ var InputTextContainer = /*#__PURE__*/styled.View.withConfig({
|
|
|
3177
3183
|
displayName: "InputTextContainer"
|
|
3178
3184
|
})(["position:relative;"]);
|
|
3179
3185
|
|
|
3180
|
-
var _excluded$9 = ["id", "right", "
|
|
3181
|
-
var
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
var theme = _ref3.theme,
|
|
3202
|
-
_ref3$$minHeight = _ref3.$minHeight,
|
|
3203
|
-
$minHeight = _ref3$$minHeight === void 0 ? theme.kitt.forms.input.minHeight : _ref3$$minHeight;
|
|
3204
|
-
return $minHeight;
|
|
3205
|
-
});
|
|
3206
|
-
var RightInputContainer = /*#__PURE__*/styled.View.withConfig({
|
|
3207
|
-
displayName: "InputText__RightInputContainer"
|
|
3208
|
-
})(["position:absolute;right:0;top:0;bottom:0;justify-content:center;padding:10px;"]);
|
|
3209
|
-
var InputText = /*#__PURE__*/forwardRef(function (_ref4, ref) {
|
|
3210
|
-
var id = _ref4.id,
|
|
3211
|
-
right = _ref4.right,
|
|
3212
|
-
minHeight = _ref4.minHeight,
|
|
3213
|
-
formState = _ref4.state,
|
|
3214
|
-
internalForceState = _ref4.internalForceState,
|
|
3215
|
-
_ref4$disabled = _ref4.disabled,
|
|
3216
|
-
disabled = _ref4$disabled === void 0 ? false : _ref4$disabled,
|
|
3217
|
-
_ref4$autoCorrect = _ref4.autoCorrect,
|
|
3218
|
-
autoCorrect = _ref4$autoCorrect === void 0 ? true : _ref4$autoCorrect,
|
|
3219
|
-
_ref4$textContentType = _ref4.textContentType,
|
|
3220
|
-
textContentType = _ref4$textContentType === void 0 ? 'none' : _ref4$textContentType,
|
|
3221
|
-
_ref4$autoComplete = _ref4.autoComplete,
|
|
3222
|
-
autoComplete = _ref4$autoComplete === void 0 ? 'off' : _ref4$autoComplete,
|
|
3223
|
-
_ref4$keyboardType = _ref4.keyboardType,
|
|
3224
|
-
keyboardType = _ref4$keyboardType === void 0 ? 'default' : _ref4$keyboardType,
|
|
3225
|
-
multiline = _ref4.multiline,
|
|
3226
|
-
onSubmitEditing = _ref4.onSubmitEditing,
|
|
3227
|
-
_onFocus = _ref4.onFocus,
|
|
3228
|
-
_onBlur = _ref4.onBlur,
|
|
3229
|
-
props = _objectWithoutProperties(_ref4, _excluded$9);
|
|
3186
|
+
var _excluded$9 = ["id", "right", "state", "internalForceState", "disabled", "autoCorrect", "textContentType", "autoComplete", "keyboardType", "multiline", "onSubmitEditing", "onFocus", "onBlur"];
|
|
3187
|
+
var InputText = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
3188
|
+
var id = _ref.id,
|
|
3189
|
+
right = _ref.right;
|
|
3190
|
+
_ref.state;
|
|
3191
|
+
var internalForceState = _ref.internalForceState,
|
|
3192
|
+
_ref$disabled = _ref.disabled,
|
|
3193
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
3194
|
+
_ref$autoCorrect = _ref.autoCorrect,
|
|
3195
|
+
autoCorrect = _ref$autoCorrect === void 0 ? true : _ref$autoCorrect,
|
|
3196
|
+
_ref$textContentType = _ref.textContentType,
|
|
3197
|
+
textContentType = _ref$textContentType === void 0 ? 'none' : _ref$textContentType,
|
|
3198
|
+
_ref$autoComplete = _ref.autoComplete,
|
|
3199
|
+
autoComplete = _ref$autoComplete === void 0 ? 'off' : _ref$autoComplete,
|
|
3200
|
+
_ref$keyboardType = _ref.keyboardType,
|
|
3201
|
+
keyboardType = _ref$keyboardType === void 0 ? 'default' : _ref$keyboardType,
|
|
3202
|
+
multiline = _ref.multiline,
|
|
3203
|
+
onSubmitEditing = _ref.onSubmitEditing;
|
|
3204
|
+
_ref.onFocus;
|
|
3205
|
+
_ref.onBlur;
|
|
3206
|
+
var props = _objectWithoutProperties(_ref, _excluded$9);
|
|
3230
3207
|
|
|
3231
3208
|
var theme = /*#__PURE__*/useTheme();
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
3235
|
-
isFocused = _useState2[0],
|
|
3236
|
-
setIsFocused = _useState2[1];
|
|
3237
|
-
|
|
3238
|
-
var state = internalForceState || getInputUIState({
|
|
3239
|
-
isFocused: isFocused,
|
|
3240
|
-
isDisabled: disabled,
|
|
3241
|
-
formState: formState
|
|
3209
|
+
var fontSizeForNativeBase = createNativeBaseFontSize({
|
|
3210
|
+
base: 'body'
|
|
3242
3211
|
});
|
|
3212
|
+
var shouldHandleSingleLineOnIOS = Platform.OS === 'ios' && !multiline;
|
|
3243
3213
|
return /*#__PURE__*/jsxs(InputTextContainer, {
|
|
3244
3214
|
$isDisabled: disabled,
|
|
3245
|
-
children: [/*#__PURE__*/jsx(
|
|
3215
|
+
children: [/*#__PURE__*/jsx(Input, _objectSpread(_objectSpread({
|
|
3246
3216
|
ref: ref,
|
|
3247
3217
|
multiline: multiline,
|
|
3248
3218
|
nativeID: id,
|
|
3249
|
-
|
|
3219
|
+
isDisabled: internalForceState ? internalForceState === 'disabled' : disabled,
|
|
3220
|
+
isHovered: internalForceState ? internalForceState === 'hover' : undefined,
|
|
3221
|
+
isFocused: internalForceState ? internalForceState === 'focus' : undefined,
|
|
3250
3222
|
keyboardType: keyboardType,
|
|
3251
3223
|
autoComplete: autoComplete,
|
|
3252
3224
|
autoCorrect: autoCorrect,
|
|
3253
|
-
$minHeight: minHeight,
|
|
3254
3225
|
textContentType: textContentType,
|
|
3255
|
-
|
|
3256
|
-
|
|
3226
|
+
fontSize: fontSizeForNativeBase,
|
|
3227
|
+
lineHeight: // On basic text input, we set the line-height to zero for iOS to fix vertical text alignment
|
|
3228
|
+
// This is a iOS only fix since having 0 as a line-height value breaks text inputs on Android
|
|
3229
|
+
shouldHandleSingleLineOnIOS ? 0 : fontSizeForNativeBase,
|
|
3230
|
+
fontWeight: "bodies.regular",
|
|
3231
|
+
fontFamily: "bodies.regular",
|
|
3232
|
+
py: !multiline && Platform.OS !== 'web' ? 0 : undefined
|
|
3257
3233
|
}, props), {}, {
|
|
3258
|
-
|
|
3259
|
-
onFocus: function onFocus(e) {
|
|
3260
|
-
setIsFocused(true);
|
|
3261
|
-
if (_onFocus) _onFocus(e);
|
|
3262
|
-
},
|
|
3263
|
-
onBlur: function onBlur(e) {
|
|
3264
|
-
setIsFocused(false);
|
|
3265
|
-
if (_onBlur) _onBlur(e);
|
|
3266
|
-
},
|
|
3234
|
+
variant: "outline",
|
|
3267
3235
|
onSubmitEditing: multiline ? function () {
|
|
3268
3236
|
return null;
|
|
3269
3237
|
} : onSubmitEditing
|
|
3270
|
-
})), right ? /*#__PURE__*/jsx(
|
|
3238
|
+
})), right ? /*#__PURE__*/jsx(View, {
|
|
3239
|
+
position: "absolute",
|
|
3240
|
+
right: 0,
|
|
3241
|
+
top: 0,
|
|
3242
|
+
bottom: 0,
|
|
3243
|
+
justifyContent: "center",
|
|
3244
|
+
padding: theme.kitt.forms.input.rightContainer.padding,
|
|
3271
3245
|
children: right
|
|
3272
3246
|
}) : null]
|
|
3273
3247
|
});
|
|
@@ -4186,6 +4160,78 @@ var createKittNativeBaseCustomTheme = function (theme) {
|
|
|
4186
4160
|
bodies: theme.typography.types.bodies.fontFamily
|
|
4187
4161
|
},
|
|
4188
4162
|
components: {
|
|
4163
|
+
Input: {
|
|
4164
|
+
baseStyle: {
|
|
4165
|
+
width: '100%',
|
|
4166
|
+
minHeight: theme.forms.input.minHeight,
|
|
4167
|
+
py: theme.forms.input.padding.vertical,
|
|
4168
|
+
px: theme.forms.input.padding.horizontal,
|
|
4169
|
+
borderRadius: theme.forms.input.borderRadius,
|
|
4170
|
+
_disabled: {
|
|
4171
|
+
opacity: 1 // override default native-base opacity
|
|
4172
|
+
|
|
4173
|
+
},
|
|
4174
|
+
_light: {
|
|
4175
|
+
color: theme.forms.input.states["default"].color,
|
|
4176
|
+
placeholderTextColor: theme.forms.input.color.placeholder,
|
|
4177
|
+
borderColor: theme.forms.input.states["default"].borderColor,
|
|
4178
|
+
bg: theme.forms.input.states["default"].backgroundColor,
|
|
4179
|
+
_hover: {
|
|
4180
|
+
borderColor: theme.forms.input.states.hover.borderColor,
|
|
4181
|
+
color: theme.forms.input.states.hover.color,
|
|
4182
|
+
_focus: {
|
|
4183
|
+
borderColor: theme.forms.input.states.focus.borderColor,
|
|
4184
|
+
color: theme.forms.input.states.focus.color
|
|
4185
|
+
}
|
|
4186
|
+
},
|
|
4187
|
+
_focus: {
|
|
4188
|
+
borderColor: theme.forms.input.states.focus.borderColor,
|
|
4189
|
+
color: theme.forms.input.states.focus.color,
|
|
4190
|
+
_hover: {
|
|
4191
|
+
borderColor: theme.forms.input.states.focus.borderColor,
|
|
4192
|
+
color: theme.forms.input.states.focus.color
|
|
4193
|
+
},
|
|
4194
|
+
_stack: {
|
|
4195
|
+
style: {
|
|
4196
|
+
outlineWidth: 0
|
|
4197
|
+
}
|
|
4198
|
+
}
|
|
4199
|
+
},
|
|
4200
|
+
_invalid: {
|
|
4201
|
+
borderColor: theme.forms.input.states.invalid.borderColor,
|
|
4202
|
+
color: theme.forms.input.states.invalid.color,
|
|
4203
|
+
_hover: {
|
|
4204
|
+
borderColor: theme.forms.input.states.hover.borderColor,
|
|
4205
|
+
color: theme.forms.input.states.hover.color
|
|
4206
|
+
}
|
|
4207
|
+
},
|
|
4208
|
+
_ios: {
|
|
4209
|
+
selectionColor: theme.forms.input.color.selection
|
|
4210
|
+
},
|
|
4211
|
+
_android: {
|
|
4212
|
+
selectionColor: theme.forms.input.color.selection
|
|
4213
|
+
},
|
|
4214
|
+
_disabled: {
|
|
4215
|
+
placeholderTextColor: theme.forms.input.color.placeholder,
|
|
4216
|
+
color: theme.forms.input.states.disabled.color,
|
|
4217
|
+
borderColor: theme.forms.input.states.disabled.borderColor,
|
|
4218
|
+
bg: theme.forms.input.states.disabled.backgroundColor
|
|
4219
|
+
}
|
|
4220
|
+
}
|
|
4221
|
+
},
|
|
4222
|
+
variants: {
|
|
4223
|
+
outline: {
|
|
4224
|
+
borderWidth: theme.forms.input.borderWidth,
|
|
4225
|
+
_focus: {
|
|
4226
|
+
bg: theme.forms.input.states["default"].backgroundColor
|
|
4227
|
+
}
|
|
4228
|
+
},
|
|
4229
|
+
underlined: {},
|
|
4230
|
+
rounded: {},
|
|
4231
|
+
filled: {},
|
|
4232
|
+
unstyled: {}
|
|
4233
|
+
}
|
|
4234
|
+
},
|
|
4189
4235
|
Text: {
|
|
4190
4236
|
baseStyle: {
|
|
4191
4237
|
_light: {
|