@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.
Files changed (42) hide show
  1. package/dist/definitions/forms/InputText/InputText.d.ts.map +1 -1
  2. package/dist/definitions/forms/InputText/InputTextContainer.web.d.ts.map +1 -1
  3. package/dist/definitions/forms/styledTextInputMixin.d.ts +1 -0
  4. package/dist/definitions/forms/styledTextInputMixin.d.ts.map +1 -1
  5. package/dist/definitions/forms/utils.d.ts +1 -0
  6. package/dist/definitions/forms/utils.d.ts.map +1 -1
  7. package/dist/definitions/native-base/KittNativeBaseProvider.d.ts +72 -0
  8. package/dist/definitions/native-base/KittNativeBaseProvider.d.ts.map +1 -1
  9. package/dist/definitions/themes/default.d.ts +1 -0
  10. package/dist/definitions/themes/default.d.ts.map +1 -1
  11. package/dist/definitions/themes/late-ocean/colors.d.ts +1 -0
  12. package/dist/definitions/themes/late-ocean/colors.d.ts.map +1 -1
  13. package/dist/definitions/themes/late-ocean/input.d.ts +4 -2
  14. package/dist/definitions/themes/late-ocean/input.d.ts.map +1 -1
  15. package/dist/index-browser-all.es.android.js +131 -85
  16. package/dist/index-browser-all.es.android.js.map +1 -1
  17. package/dist/index-browser-all.es.ios.js +131 -85
  18. package/dist/index-browser-all.es.ios.js.map +1 -1
  19. package/dist/index-browser-all.es.js +131 -85
  20. package/dist/index-browser-all.es.js.map +1 -1
  21. package/dist/index-browser-all.es.web.js +131 -97
  22. package/dist/index-browser-all.es.web.js.map +1 -1
  23. package/dist/index-node-14.17.cjs.js +108 -59
  24. package/dist/index-node-14.17.cjs.js.map +1 -1
  25. package/dist/index-node-14.17.cjs.web.css +1 -1
  26. package/dist/index-node-14.17.cjs.web.js +107 -69
  27. package/dist/index-node-14.17.cjs.web.js.map +1 -1
  28. package/dist/linaria-themes-browser-all.es.android.js +11 -7
  29. package/dist/linaria-themes-browser-all.es.android.js.map +1 -1
  30. package/dist/linaria-themes-browser-all.es.ios.js +11 -7
  31. package/dist/linaria-themes-browser-all.es.ios.js.map +1 -1
  32. package/dist/linaria-themes-browser-all.es.js +11 -7
  33. package/dist/linaria-themes-browser-all.es.js.map +1 -1
  34. package/dist/linaria-themes-browser-all.es.web.js +11 -7
  35. package/dist/linaria-themes-browser-all.es.web.js.map +1 -1
  36. package/dist/linaria-themes-node-14.17.cjs.js +11 -7
  37. package/dist/linaria-themes-node-14.17.cjs.js.map +1 -1
  38. package/dist/linaria-themes-node-14.17.cjs.web.js +11 -7
  39. package/dist/linaria-themes-node-14.17.cjs.web.js.map +1 -1
  40. package/dist/styles.css +1 -1
  41. package/dist/tsbuildinfo +1 -1
  42. package/package.json +2 -2
@@ -1,10 +1,10 @@
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$2, ScrollView as ScrollView$1, Pressable as Pressable$2, 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$2, ScrollView as ScrollView$1, Pressable as Pressable$2, Image as Image$1, Input, NativeBaseProvider, extendTheme } from 'native-base';
4
4
  import _extends from '@babel/runtime/helpers/extends';
5
5
  import { forwardRef, useContext, createContext, cloneElement, useState, useRef, useEffect, Children, useMemo, Fragment } from 'react';
6
6
  import { styled } from '@linaria/react';
7
- import { Pressable as Pressable$1, View as View$1, useWindowDimensions, Image, StyleSheet, ScrollView as ScrollView$2, Linking, TextInput, Modal as Modal$1, Text as Text$2 } from 'react-native';
7
+ import { Pressable as Pressable$1, View as View$1, useWindowDimensions, Image, StyleSheet, ScrollView as ScrollView$2, Linking, Modal as Modal$1, Text as Text$2 } from 'react-native';
8
8
  export { useWindowDimensions as useWindowSize } from 'react-native';
9
9
  import styled$1, { useTheme, css, ThemeProvider } from 'styled-components/native';
10
10
  import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
@@ -1526,6 +1526,7 @@ var colors = {
1526
1526
  hover: lateOceanColorPalette.black100,
1527
1527
  white: lateOceanColorPalette.white,
1528
1528
  black: lateOceanColorPalette.black1000,
1529
+ blackLight: lateOceanColorPalette.black555,
1529
1530
  blackAnthracite: lateOceanColorPalette.black800,
1530
1531
  uiBackground: lateOceanColorPalette.black25,
1531
1532
  uiBackgroundLight: lateOceanColorPalette.white,
@@ -1826,34 +1827,34 @@ var inputStatesStyle = {
1826
1827
  "default": {
1827
1828
  backgroundColor: colors.uiBackgroundLight,
1828
1829
  borderColor: colors.separator,
1829
- color: 'black'
1830
+ color: colors.black
1830
1831
  },
1831
1832
  pending: {
1832
1833
  backgroundColor: colors.uiBackgroundLight,
1833
1834
  borderColor: colors.separator,
1834
- color: 'black'
1835
+ color: colors.black
1835
1836
  },
1836
1837
  valid: {
1837
1838
  backgroundColor: colors.uiBackgroundLight,
1838
1839
  borderColor: lateOceanColorPalette.black100,
1839
- color: 'black'
1840
+ color: colors.black
1840
1841
  },
1841
1842
  hover: {
1842
1843
  borderColor: lateOceanColorPalette.black200,
1843
- color: 'black'
1844
+ color: colors.black
1844
1845
  },
1845
1846
  focus: {
1846
1847
  borderColor: colors.primary,
1847
- color: 'black'
1848
+ color: colors.black
1848
1849
  },
1849
1850
  disabled: {
1850
1851
  backgroundColor: colors.disabled,
1851
1852
  borderColor: colors.separator,
1852
- color: 'black-light'
1853
+ color: colors.blackLight
1853
1854
  },
1854
1855
  invalid: {
1855
1856
  borderColor: colors.separator,
1856
- color: 'black'
1857
+ color: colors.black
1857
1858
  }
1858
1859
  };
1859
1860
  var input = {
@@ -1867,6 +1868,9 @@ var input = {
1867
1868
  icon: {
1868
1869
  size: 20
1869
1870
  },
1871
+ rightContainer: {
1872
+ padding: 10
1873
+ },
1870
1874
  padding: {
1871
1875
  horizontal: 16,
1872
1876
  vertical: 5
@@ -2285,6 +2289,7 @@ function Checkbox(_ref6) {
2285
2289
  });
2286
2290
  }
2287
2291
 
2292
+ /** @deprecated use native-base instead */
2288
2293
  function getInputUIState(_ref) {
2289
2294
  var isFocused = _ref.isFocused,
2290
2295
  isDisabled = _ref.isDisabled,
@@ -2295,6 +2300,7 @@ function getInputUIState(_ref) {
2295
2300
  return 'default';
2296
2301
  }
2297
2302
 
2303
+ /** @deprecated this mixin is not SSR compatible */
2298
2304
  var styledTextInputMixin = /*#__PURE__*/css(["background-color:", ";border-width:", "px;border-radius:", "px;border-color:", ";font-size:", ";color:", ";font-family:", ";"], function (_ref) {
2299
2305
  var theme = _ref.theme,
2300
2306
  $state = _ref.$state;
@@ -2316,7 +2322,7 @@ var styledTextInputMixin = /*#__PURE__*/css(["background-color:", ";border-width
2316
2322
  }, function (_ref6) {
2317
2323
  var theme = _ref6.theme,
2318
2324
  $state = _ref6.$state;
2319
- return theme.kitt.typography.colors[theme.kitt.forms.input.states[$state].color];
2325
+ return theme.kitt.forms.input.states[$state].color || theme.kitt.forms.input.states["default"].color;
2320
2326
  }, function (_ref7) {
2321
2327
  var theme = _ref7.theme;
2322
2328
  return theme.kitt.typography.types.bodies.fontFamily.regular;
@@ -2459,118 +2465,74 @@ var InputTextContainer = withTheme( /*#__PURE__*/styled("div")({
2459
2465
  "class": "kitt-u_InputTextContainer_i1encr9g",
2460
2466
  vars: {
2461
2467
  "i1encr9g-0": [function (_ref) {
2462
- var $isDisabled = _ref.$isDisabled;
2463
- return $isDisabled ? 'not-allowed' : 'inherit';
2464
- }],
2465
- "i1encr9g-1": [function (_ref2) {
2466
- var theme = _ref2.theme;
2468
+ var theme = _ref.theme;
2467
2469
  var _theme$kitt$forms$inp = theme.kitt.forms.input.transition,
2468
2470
  property = _theme$kitt$forms$inp.property,
2469
2471
  duration = _theme$kitt$forms$inp.duration,
2470
2472
  timingFunction = _theme$kitt$forms$inp.timingFunction;
2471
2473
  return "".concat(property, " ").concat(duration, " ").concat(timingFunction);
2472
- }],
2473
- "i1encr9g-2": [function (_ref3) {
2474
- var theme = _ref3.theme,
2475
- $isDisabled = _ref3.$isDisabled;
2476
- if ($isDisabled) return theme.kitt.forms.input.states.disabled.borderColor;
2477
- return theme.kitt.forms.input.states.hover.borderColor;
2478
- }],
2479
- "i1encr9g-3": [function (_ref4) {
2480
- var theme = _ref4.theme,
2481
- $isDisabled = _ref4.$isDisabled;
2482
- if ($isDisabled) return theme.kitt.forms.input.states.disabled.borderColor;
2483
- return theme.kitt.forms.input.states.focus.borderColor;
2484
2474
  }]
2485
2475
  }
2486
2476
  }));
2487
2477
 
2488
- var _excluded$b = ["id", "right", "minHeight", "state", "internalForceState", "disabled", "autoCorrect", "textContentType", "autoComplete", "keyboardType", "multiline", "onSubmitEditing", "onFocus", "onBlur"];
2489
- var StyledTextInput = /*#__PURE__*/styled$1(TextInput).withConfig({
2490
- displayName: "InputText__StyledTextInput",
2491
- componentId: "kitt-universal__sc-uke279-0"
2492
- })(["", " padding:", ";line-height:", ";width:100%;min-height:", "px;"], styledTextInputMixin, function (_ref) {
2493
- var theme = _ref.theme,
2494
- multiline = _ref.multiline;
2495
- if (!multiline && "web" !== 'web') return "0 ".concat(theme.kitt.forms.input.padding.horizontal, "px");
2496
- return "".concat(theme.kitt.forms.input.padding.vertical, "px ").concat(theme.kitt.forms.input.padding.horizontal, "px");
2497
- }, function (_ref2) {
2498
- var theme = _ref2.theme;
2499
- _ref2.multiline;
2500
- var typeConfigKey = getTypographyTypeConfigKey(theme);
2501
- return "".concat(theme.kitt.typography.types.bodies.configs.body[typeConfigKey].lineHeight, "px");
2502
- }, function (_ref3) {
2503
- var theme = _ref3.theme,
2504
- _ref3$$minHeight = _ref3.$minHeight,
2505
- $minHeight = _ref3$$minHeight === void 0 ? theme.kitt.forms.input.minHeight : _ref3$$minHeight;
2506
- return $minHeight;
2507
- });
2508
- var RightInputContainer = /*#__PURE__*/styled$1(View$1).withConfig({
2509
- displayName: "InputText__RightInputContainer",
2510
- componentId: "kitt-universal__sc-uke279-1"
2511
- })(["position:absolute;right:0;top:0;bottom:0;justify-content:center;padding:10px;"]);
2512
- var InputText = /*#__PURE__*/forwardRef(function (_ref4, ref) {
2513
- var id = _ref4.id,
2514
- right = _ref4.right,
2515
- minHeight = _ref4.minHeight,
2516
- formState = _ref4.state,
2517
- internalForceState = _ref4.internalForceState,
2518
- _ref4$disabled = _ref4.disabled,
2519
- disabled = _ref4$disabled === void 0 ? false : _ref4$disabled,
2520
- _ref4$autoCorrect = _ref4.autoCorrect,
2521
- autoCorrect = _ref4$autoCorrect === void 0 ? true : _ref4$autoCorrect,
2522
- _ref4$textContentType = _ref4.textContentType,
2523
- textContentType = _ref4$textContentType === void 0 ? 'none' : _ref4$textContentType,
2524
- _ref4$autoComplete = _ref4.autoComplete,
2525
- autoComplete = _ref4$autoComplete === void 0 ? 'off' : _ref4$autoComplete,
2526
- _ref4$keyboardType = _ref4.keyboardType,
2527
- keyboardType = _ref4$keyboardType === void 0 ? 'default' : _ref4$keyboardType,
2528
- multiline = _ref4.multiline,
2529
- onSubmitEditing = _ref4.onSubmitEditing,
2530
- _onFocus = _ref4.onFocus,
2531
- _onBlur = _ref4.onBlur,
2532
- props = _objectWithoutProperties(_ref4, _excluded$b);
2478
+ var _excluded$b = ["id", "right", "state", "internalForceState", "disabled", "autoCorrect", "textContentType", "autoComplete", "keyboardType", "multiline", "onSubmitEditing", "onFocus", "onBlur"];
2479
+ var InputText = /*#__PURE__*/forwardRef(function (_ref, ref) {
2480
+ var id = _ref.id,
2481
+ right = _ref.right;
2482
+ _ref.state;
2483
+ var internalForceState = _ref.internalForceState,
2484
+ _ref$disabled = _ref.disabled,
2485
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
2486
+ _ref$autoCorrect = _ref.autoCorrect,
2487
+ autoCorrect = _ref$autoCorrect === void 0 ? true : _ref$autoCorrect,
2488
+ _ref$textContentType = _ref.textContentType,
2489
+ textContentType = _ref$textContentType === void 0 ? 'none' : _ref$textContentType,
2490
+ _ref$autoComplete = _ref.autoComplete,
2491
+ autoComplete = _ref$autoComplete === void 0 ? 'off' : _ref$autoComplete,
2492
+ _ref$keyboardType = _ref.keyboardType,
2493
+ keyboardType = _ref$keyboardType === void 0 ? 'default' : _ref$keyboardType,
2494
+ multiline = _ref.multiline,
2495
+ onSubmitEditing = _ref.onSubmitEditing;
2496
+ _ref.onFocus;
2497
+ _ref.onBlur;
2498
+ var props = _objectWithoutProperties(_ref, _excluded$b);
2533
2499
 
2534
2500
  var theme = /*#__PURE__*/useTheme();
2535
-
2536
- var _useState = useState(false),
2537
- _useState2 = _slicedToArray(_useState, 2),
2538
- isFocused = _useState2[0],
2539
- setIsFocused = _useState2[1];
2540
-
2541
- var state = internalForceState || getInputUIState({
2542
- isFocused: isFocused,
2543
- isDisabled: disabled,
2544
- formState: formState
2501
+ var fontSizeForNativeBase = createNativeBaseFontSize({
2502
+ base: 'body'
2545
2503
  });
2546
2504
  return /*#__PURE__*/jsxs(InputTextContainer, {
2547
2505
  $isDisabled: disabled,
2548
- children: [/*#__PURE__*/jsx(StyledTextInput, _objectSpread(_objectSpread({
2506
+ children: [/*#__PURE__*/jsx(Input, _objectSpread(_objectSpread({
2549
2507
  ref: ref,
2550
2508
  multiline: multiline,
2551
2509
  nativeID: id,
2552
- editable: !disabled,
2510
+ isDisabled: internalForceState ? internalForceState === 'disabled' : disabled,
2511
+ isHovered: internalForceState ? internalForceState === 'hover' : undefined,
2512
+ isFocused: internalForceState ? internalForceState === 'focus' : undefined,
2553
2513
  keyboardType: keyboardType,
2554
2514
  autoComplete: autoComplete,
2555
2515
  autoCorrect: autoCorrect,
2556
- $minHeight: minHeight,
2557
2516
  textContentType: textContentType,
2558
- placeholderTextColor: theme.kitt.forms.input.color.placeholder,
2559
- selectionColor: theme.kitt.forms.input.color.selection
2517
+ fontSize: fontSizeForNativeBase,
2518
+ lineHeight: // On basic text input, we set the line-height to zero for iOS to fix vertical text alignment
2519
+ // This is a iOS only fix since having 0 as a line-height value breaks text inputs on Android
2520
+ fontSizeForNativeBase,
2521
+ fontWeight: "bodies.regular",
2522
+ fontFamily: "bodies.regular",
2523
+ py: !multiline && "web" !== 'web' ? 0 : undefined
2560
2524
  }, props), {}, {
2561
- $state: state,
2562
- onFocus: function onFocus(e) {
2563
- setIsFocused(true);
2564
- if (_onFocus) _onFocus(e);
2565
- },
2566
- onBlur: function onBlur(e) {
2567
- setIsFocused(false);
2568
- if (_onBlur) _onBlur(e);
2569
- },
2525
+ variant: "outline",
2570
2526
  onSubmitEditing: multiline ? function () {
2571
2527
  return null;
2572
2528
  } : onSubmitEditing
2573
- })), right ? /*#__PURE__*/jsx(RightInputContainer, {
2529
+ })), right ? /*#__PURE__*/jsx(View, {
2530
+ position: "absolute",
2531
+ right: 0,
2532
+ top: 0,
2533
+ bottom: 0,
2534
+ justifyContent: "center",
2535
+ padding: theme.kitt.forms.input.rightContainer.padding,
2574
2536
  children: right
2575
2537
  }) : null]
2576
2538
  });
@@ -3836,6 +3798,78 @@ var createKittNativeBaseCustomTheme = function (theme) {
3836
3798
  bodies: theme.typography.types.bodies.fontFamily
3837
3799
  },
3838
3800
  components: {
3801
+ Input: {
3802
+ baseStyle: {
3803
+ width: '100%',
3804
+ minHeight: theme.forms.input.minHeight,
3805
+ py: theme.forms.input.padding.vertical,
3806
+ px: theme.forms.input.padding.horizontal,
3807
+ borderRadius: theme.forms.input.borderRadius,
3808
+ _disabled: {
3809
+ opacity: 1 // override default native-base opacity
3810
+
3811
+ },
3812
+ _light: {
3813
+ color: theme.forms.input.states["default"].color,
3814
+ placeholderTextColor: theme.forms.input.color.placeholder,
3815
+ borderColor: theme.forms.input.states["default"].borderColor,
3816
+ bg: theme.forms.input.states["default"].backgroundColor,
3817
+ _hover: {
3818
+ borderColor: theme.forms.input.states.hover.borderColor,
3819
+ color: theme.forms.input.states.hover.color,
3820
+ _focus: {
3821
+ borderColor: theme.forms.input.states.focus.borderColor,
3822
+ color: theme.forms.input.states.focus.color
3823
+ }
3824
+ },
3825
+ _focus: {
3826
+ borderColor: theme.forms.input.states.focus.borderColor,
3827
+ color: theme.forms.input.states.focus.color,
3828
+ _hover: {
3829
+ borderColor: theme.forms.input.states.focus.borderColor,
3830
+ color: theme.forms.input.states.focus.color
3831
+ },
3832
+ _stack: {
3833
+ style: {
3834
+ outlineWidth: 0
3835
+ }
3836
+ }
3837
+ },
3838
+ _invalid: {
3839
+ borderColor: theme.forms.input.states.invalid.borderColor,
3840
+ color: theme.forms.input.states.invalid.color,
3841
+ _hover: {
3842
+ borderColor: theme.forms.input.states.hover.borderColor,
3843
+ color: theme.forms.input.states.hover.color
3844
+ }
3845
+ },
3846
+ _ios: {
3847
+ selectionColor: theme.forms.input.color.selection
3848
+ },
3849
+ _android: {
3850
+ selectionColor: theme.forms.input.color.selection
3851
+ },
3852
+ _disabled: {
3853
+ placeholderTextColor: theme.forms.input.color.placeholder,
3854
+ color: theme.forms.input.states.disabled.color,
3855
+ borderColor: theme.forms.input.states.disabled.borderColor,
3856
+ bg: theme.forms.input.states.disabled.backgroundColor
3857
+ }
3858
+ }
3859
+ },
3860
+ variants: {
3861
+ outline: {
3862
+ borderWidth: theme.forms.input.borderWidth,
3863
+ _focus: {
3864
+ bg: theme.forms.input.states["default"].backgroundColor
3865
+ }
3866
+ },
3867
+ underlined: {},
3868
+ rounded: {},
3869
+ filled: {},
3870
+ unstyled: {}
3871
+ }
3872
+ },
3839
3873
  Text: {
3840
3874
  baseStyle: {
3841
3875
  _light: {