@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
@@ -1524,6 +1524,7 @@ const colors = {
1524
1524
  hover: lateOceanColorPalette.black100,
1525
1525
  white: lateOceanColorPalette.white,
1526
1526
  black: lateOceanColorPalette.black1000,
1527
+ blackLight: lateOceanColorPalette.black555,
1527
1528
  blackAnthracite: lateOceanColorPalette.black800,
1528
1529
  uiBackground: lateOceanColorPalette.black25,
1529
1530
  uiBackgroundLight: lateOceanColorPalette.white,
@@ -1820,34 +1821,34 @@ const inputStatesStyle = {
1820
1821
  default: {
1821
1822
  backgroundColor: colors.uiBackgroundLight,
1822
1823
  borderColor: colors.separator,
1823
- color: 'black'
1824
+ color: colors.black
1824
1825
  },
1825
1826
  pending: {
1826
1827
  backgroundColor: colors.uiBackgroundLight,
1827
1828
  borderColor: colors.separator,
1828
- color: 'black'
1829
+ color: colors.black
1829
1830
  },
1830
1831
  valid: {
1831
1832
  backgroundColor: colors.uiBackgroundLight,
1832
1833
  borderColor: lateOceanColorPalette.black100,
1833
- color: 'black'
1834
+ color: colors.black
1834
1835
  },
1835
1836
  hover: {
1836
1837
  borderColor: lateOceanColorPalette.black200,
1837
- color: 'black'
1838
+ color: colors.black
1838
1839
  },
1839
1840
  focus: {
1840
1841
  borderColor: colors.primary,
1841
- color: 'black'
1842
+ color: colors.black
1842
1843
  },
1843
1844
  disabled: {
1844
1845
  backgroundColor: colors.disabled,
1845
1846
  borderColor: colors.separator,
1846
- color: 'black-light'
1847
+ color: colors.blackLight
1847
1848
  },
1848
1849
  invalid: {
1849
1850
  borderColor: colors.separator,
1850
- color: 'black'
1851
+ color: colors.black
1851
1852
  }
1852
1853
  };
1853
1854
  const input = {
@@ -1861,6 +1862,9 @@ const input = {
1861
1862
  icon: {
1862
1863
  size: 20
1863
1864
  },
1865
+ rightContainer: {
1866
+ padding: 10
1867
+ },
1864
1868
  padding: {
1865
1869
  horizontal: 16,
1866
1870
  vertical: 5
@@ -2263,6 +2267,7 @@ function Checkbox({
2263
2267
  });
2264
2268
  }
2265
2269
 
2270
+ /** @deprecated use native-base instead */
2266
2271
  function getInputUIState({
2267
2272
  isFocused,
2268
2273
  isDisabled,
@@ -2274,6 +2279,7 @@ function getInputUIState({
2274
2279
  return 'default';
2275
2280
  }
2276
2281
 
2282
+ /** @deprecated this mixin is not SSR compatible */
2277
2283
  const styledTextInputMixin = /*#__PURE__*/styled.css(["background-color:", ";border-width:", "px;border-radius:", "px;border-color:", ";font-size:", ";color:", ";font-family:", ";"], ({
2278
2284
  theme,
2279
2285
  $state
@@ -2292,7 +2298,7 @@ const styledTextInputMixin = /*#__PURE__*/styled.css(["background-color:", ";bor
2292
2298
  }, ({
2293
2299
  theme,
2294
2300
  $state
2295
- }) => theme.kitt.typography.colors[theme.kitt.forms.input.states[$state].color], ({
2301
+ }) => theme.kitt.forms.input.states[$state].color || theme.kitt.forms.input.states.default.color, ({
2296
2302
  theme
2297
2303
  }) => theme.kitt.typography.types.bodies.fontFamily.regular);
2298
2304
 
@@ -3055,40 +3061,9 @@ const InputTextContainer = /*#__PURE__*/styled__default.View.withConfig({
3055
3061
  componentId: "kitt-universal__sc-8j6fjq-0"
3056
3062
  })(["position:relative;"]);
3057
3063
 
3058
- const StyledTextInput = /*#__PURE__*/styled__default(reactNative.TextInput).withConfig({
3059
- displayName: "InputText__StyledTextInput",
3060
- componentId: "kitt-universal__sc-uke279-0"
3061
- })(["", " padding:", ";line-height:", ";width:100%;min-height:", "px;"], styledTextInputMixin, ({
3062
- theme,
3063
- multiline
3064
- }) => {
3065
- if (!multiline && reactNative.Platform.OS !== 'web') return `0 ${theme.kitt.forms.input.padding.horizontal}px`;
3066
- return `${theme.kitt.forms.input.padding.vertical}px ${theme.kitt.forms.input.padding.horizontal}px`;
3067
- }, ({
3068
- theme,
3069
- multiline
3070
- }) => {
3071
- const shouldHandleSingleLineOnIOS = reactNative.Platform.OS === 'ios' && !multiline; // On basic text input, we set the line-height to zero for iOS to fix vertical text alignment
3072
- // This is a iOS only fix since having 0 as a line-height value breaks text inputs on Android
3073
-
3074
- if (shouldHandleSingleLineOnIOS) {
3075
- return 0;
3076
- }
3077
-
3078
- const typeConfigKey = getTypographyTypeConfigKey(theme);
3079
- return `${theme.kitt.typography.types.bodies.configs.body[typeConfigKey].lineHeight}px`;
3080
- }, ({
3081
- theme,
3082
- $minHeight = theme.kitt.forms.input.minHeight
3083
- }) => $minHeight);
3084
- const RightInputContainer = /*#__PURE__*/styled__default.View.withConfig({
3085
- displayName: "InputText__RightInputContainer",
3086
- componentId: "kitt-universal__sc-uke279-1"
3087
- })(["position:absolute;right:0;top:0;bottom:0;justify-content:center;padding:10px;"]);
3088
3064
  const InputText = /*#__PURE__*/React.forwardRef(({
3089
3065
  id,
3090
3066
  right,
3091
- minHeight,
3092
3067
  state: formState,
3093
3068
  internalForceState,
3094
3069
  disabled = false,
@@ -3103,38 +3078,40 @@ const InputText = /*#__PURE__*/React.forwardRef(({
3103
3078
  ...props
3104
3079
  }, ref) => {
3105
3080
  const theme = /*#__PURE__*/styled.useTheme();
3106
- const [isFocused, setIsFocused] = React.useState(false);
3107
- const state = internalForceState || getInputUIState({
3108
- isFocused,
3109
- isDisabled: disabled,
3110
- formState
3081
+ const fontSizeForNativeBase = createNativeBaseFontSize({
3082
+ base: 'body'
3111
3083
  });
3084
+ const shouldHandleSingleLineOnIOS = reactNative.Platform.OS === 'ios' && !multiline;
3112
3085
  return /*#__PURE__*/jsxRuntime.jsxs(InputTextContainer, {
3113
3086
  $isDisabled: disabled,
3114
- children: [/*#__PURE__*/jsxRuntime.jsx(StyledTextInput, {
3087
+ children: [/*#__PURE__*/jsxRuntime.jsx(nativeBase.Input, {
3115
3088
  ref: ref,
3116
3089
  multiline: multiline,
3117
3090
  nativeID: id,
3118
- editable: !disabled,
3091
+ isDisabled: internalForceState ? internalForceState === 'disabled' : disabled,
3092
+ isHovered: internalForceState ? internalForceState === 'hover' : undefined,
3093
+ isFocused: internalForceState ? internalForceState === 'focus' : undefined,
3119
3094
  keyboardType: keyboardType,
3120
3095
  autoComplete: autoComplete,
3121
3096
  autoCorrect: autoCorrect,
3122
- $minHeight: minHeight,
3123
3097
  textContentType: textContentType,
3124
- placeholderTextColor: theme.kitt.forms.input.color.placeholder,
3125
- selectionColor: theme.kitt.forms.input.color.selection,
3098
+ fontSize: fontSizeForNativeBase,
3099
+ lineHeight: // On basic text input, we set the line-height to zero for iOS to fix vertical text alignment
3100
+ // This is a iOS only fix since having 0 as a line-height value breaks text inputs on Android
3101
+ shouldHandleSingleLineOnIOS ? 0 : fontSizeForNativeBase,
3102
+ fontWeight: "bodies.regular",
3103
+ fontFamily: "bodies.regular",
3104
+ py: !multiline && reactNative.Platform.OS !== 'web' ? 0 : undefined,
3126
3105
  ...props,
3127
- $state: state,
3128
- onFocus: e => {
3129
- setIsFocused(true);
3130
- if (onFocus) onFocus(e);
3131
- },
3132
- onBlur: e => {
3133
- setIsFocused(false);
3134
- if (onBlur) onBlur(e);
3135
- },
3106
+ variant: "outline",
3136
3107
  onSubmitEditing: multiline ? () => null : onSubmitEditing
3137
- }), right ? /*#__PURE__*/jsxRuntime.jsx(RightInputContainer, {
3108
+ }), right ? /*#__PURE__*/jsxRuntime.jsx(View, {
3109
+ position: "absolute",
3110
+ right: 0,
3111
+ top: 0,
3112
+ bottom: 0,
3113
+ justifyContent: "center",
3114
+ padding: theme.kitt.forms.input.rightContainer.padding,
3138
3115
  children: right
3139
3116
  }) : null]
3140
3117
  });
@@ -4042,6 +4019,78 @@ const createKittNativeBaseCustomTheme = theme => {
4042
4019
  bodies: theme.typography.types.bodies.fontFamily
4043
4020
  },
4044
4021
  components: {
4022
+ Input: {
4023
+ baseStyle: {
4024
+ width: '100%',
4025
+ minHeight: theme.forms.input.minHeight,
4026
+ py: theme.forms.input.padding.vertical,
4027
+ px: theme.forms.input.padding.horizontal,
4028
+ borderRadius: theme.forms.input.borderRadius,
4029
+ _disabled: {
4030
+ opacity: 1 // override default native-base opacity
4031
+
4032
+ },
4033
+ _light: {
4034
+ color: theme.forms.input.states.default.color,
4035
+ placeholderTextColor: theme.forms.input.color.placeholder,
4036
+ borderColor: theme.forms.input.states.default.borderColor,
4037
+ bg: theme.forms.input.states.default.backgroundColor,
4038
+ _hover: {
4039
+ borderColor: theme.forms.input.states.hover.borderColor,
4040
+ color: theme.forms.input.states.hover.color,
4041
+ _focus: {
4042
+ borderColor: theme.forms.input.states.focus.borderColor,
4043
+ color: theme.forms.input.states.focus.color
4044
+ }
4045
+ },
4046
+ _focus: {
4047
+ borderColor: theme.forms.input.states.focus.borderColor,
4048
+ color: theme.forms.input.states.focus.color,
4049
+ _hover: {
4050
+ borderColor: theme.forms.input.states.focus.borderColor,
4051
+ color: theme.forms.input.states.focus.color
4052
+ },
4053
+ _stack: {
4054
+ style: {
4055
+ outlineWidth: 0
4056
+ }
4057
+ }
4058
+ },
4059
+ _invalid: {
4060
+ borderColor: theme.forms.input.states.invalid.borderColor,
4061
+ color: theme.forms.input.states.invalid.color,
4062
+ _hover: {
4063
+ borderColor: theme.forms.input.states.hover.borderColor,
4064
+ color: theme.forms.input.states.hover.color
4065
+ }
4066
+ },
4067
+ _ios: {
4068
+ selectionColor: theme.forms.input.color.selection
4069
+ },
4070
+ _android: {
4071
+ selectionColor: theme.forms.input.color.selection
4072
+ },
4073
+ _disabled: {
4074
+ placeholderTextColor: theme.forms.input.color.placeholder,
4075
+ color: theme.forms.input.states.disabled.color,
4076
+ borderColor: theme.forms.input.states.disabled.borderColor,
4077
+ bg: theme.forms.input.states.disabled.backgroundColor
4078
+ }
4079
+ }
4080
+ },
4081
+ variants: {
4082
+ outline: {
4083
+ borderWidth: theme.forms.input.borderWidth,
4084
+ _focus: {
4085
+ bg: theme.forms.input.states.default.backgroundColor
4086
+ }
4087
+ },
4088
+ underlined: {},
4089
+ rounded: {},
4090
+ filled: {},
4091
+ unstyled: {}
4092
+ }
4093
+ },
4045
4094
  Text: {
4046
4095
  baseStyle: {
4047
4096
  _light: {