@ornikar/kitt-universal 9.5.0 → 9.6.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 (39) hide show
  1. package/dist/definitions/Choices/ChoiceItem.d.ts.map +1 -1
  2. package/dist/definitions/Choices/hooks/useNativeAnimation.d.ts +14 -0
  3. package/dist/definitions/Choices/hooks/useNativeAnimation.d.ts.map +1 -0
  4. package/dist/definitions/Choices/hooks/useNativeAnimation.web.d.ts +7 -0
  5. package/dist/definitions/Choices/hooks/useNativeAnimation.web.d.ts.map +1 -0
  6. package/dist/definitions/forms/InputField/InputField.d.ts.map +1 -1
  7. package/dist/definitions/native-base/KittNativeBaseProvider.d.ts +1 -1
  8. package/dist/definitions/themes/default.d.ts +7 -1
  9. package/dist/definitions/themes/default.d.ts.map +1 -1
  10. package/dist/definitions/themes/late-ocean/forms.d.ts +7 -1
  11. package/dist/definitions/themes/late-ocean/forms.d.ts.map +1 -1
  12. package/dist/definitions/themes/late-ocean/inputField.d.ts +7 -1
  13. package/dist/definitions/themes/late-ocean/inputField.d.ts.map +1 -1
  14. package/dist/index-browser-all.es.android.js +117 -106
  15. package/dist/index-browser-all.es.android.js.map +1 -1
  16. package/dist/index-browser-all.es.ios.js +117 -106
  17. package/dist/index-browser-all.es.ios.js.map +1 -1
  18. package/dist/index-browser-all.es.js +117 -106
  19. package/dist/index-browser-all.es.js.map +1 -1
  20. package/dist/index-browser-all.es.web.js +38 -111
  21. package/dist/index-browser-all.es.web.js.map +1 -1
  22. package/dist/index-node-14.17.cjs.js +115 -104
  23. package/dist/index-node-14.17.cjs.js.map +1 -1
  24. package/dist/index-node-14.17.cjs.web.js +35 -106
  25. package/dist/index-node-14.17.cjs.web.js.map +1 -1
  26. package/dist/linaria-themes-browser-all.es.android.js +7 -1
  27. package/dist/linaria-themes-browser-all.es.android.js.map +1 -1
  28. package/dist/linaria-themes-browser-all.es.ios.js +7 -1
  29. package/dist/linaria-themes-browser-all.es.ios.js.map +1 -1
  30. package/dist/linaria-themes-browser-all.es.js +7 -1
  31. package/dist/linaria-themes-browser-all.es.js.map +1 -1
  32. package/dist/linaria-themes-browser-all.es.web.js +7 -1
  33. package/dist/linaria-themes-browser-all.es.web.js.map +1 -1
  34. package/dist/linaria-themes-node-14.17.cjs.js +7 -1
  35. package/dist/linaria-themes-node-14.17.cjs.js.map +1 -1
  36. package/dist/linaria-themes-node-14.17.cjs.web.js +7 -1
  37. package/dist/linaria-themes-node-14.17.cjs.web.js.map +1 -1
  38. package/dist/tsbuildinfo +1 -1
  39. package/package.json +27 -2
@@ -13,7 +13,6 @@ import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
13
13
  import _regeneratorRuntime from '@babel/runtime/regenerator';
14
14
  import { ArcIcon, UserIcon, CheckboxMark, EyeOffIcon, EyeIcon, InfoIcon, AlertTriangleIcon, CheckIcon, AlertCircleIcon, XIcon, TooltipArrowIcon } from '@ornikar/kitt-icons';
15
15
  export * from '@ornikar/kitt-icons';
16
- import Animated, { useSharedValue, useDerivedValue, withTiming, useAnimatedStyle, interpolateColor } from 'react-native-reanimated';
17
16
  import { parse } from 'twemoji-parser';
18
17
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
19
18
  import { Portal } from 'react-portal';
@@ -1062,6 +1061,14 @@ function Card(_ref6) {
1062
1061
  });
1063
1062
  }
1064
1063
 
1064
+ var useNativeAnimation = function () {
1065
+ return {
1066
+ onPressIn: function onPressIn() {},
1067
+ onPressOut: function onPressOut() {},
1068
+ backgroundStyles: undefined
1069
+ };
1070
+ };
1071
+
1065
1072
  function getCurrentTextColor(_ref) {
1066
1073
  var isDisabled = _ref.isDisabled,
1067
1074
  isSelected = _ref.isSelected,
@@ -1094,7 +1101,7 @@ var DisabledBorder = /*#__PURE__*/styled$1(View$1).withConfig({
1094
1101
  color = _theme$kitt$choices$i.color;
1095
1102
  return css(["border:", "px solid ", ";"], width, color);
1096
1103
  });
1097
- var ChoiceItemView = /*#__PURE__*/styled$1(Animated.View).withConfig({
1104
+ var ChoiceItemView = /*#__PURE__*/styled$1(View$1).withConfig({
1098
1105
  displayName: "ChoiceItem__ChoiceItemView",
1099
1106
  componentId: "kitt-universal__sc-wuv3y6-1"
1100
1107
  })(["position:relative;border-radius:", "px;background-color:", ";", ";", ""], function (_ref4) {
@@ -1150,73 +1157,10 @@ function ChoiceItem(_ref8) {
1150
1157
  onChange = _ref8.onChange,
1151
1158
  onBlur = _ref8.onBlur,
1152
1159
  onFocus = _ref8.onFocus;
1153
- var theme = /*#__PURE__*/useTheme();
1154
- var pressed = useSharedValue(Boolean(isPressedInternal));
1155
- var progress = useDerivedValue(function () {
1156
- var _f = function () {
1157
- return withTiming(pressed.value ? 1 : 0, {
1158
- duration: theme.kitt.choices.item.transition.duration
1159
- });
1160
- };
1161
-
1162
- _f._closure = {
1163
- withTiming: withTiming,
1164
- pressed: pressed,
1165
- theme: {
1166
- kitt: {
1167
- choices: {
1168
- item: {
1169
- transition: {
1170
- duration: theme.kitt.choices.item.transition.duration
1171
- }
1172
- }
1173
- }
1174
- }
1175
- }
1176
- };
1177
- _f.asString = "function _f(){const{withTiming,pressed,theme}=jsThis._closure;{return withTiming(pressed.value?1:0,{duration:theme.kitt.choices.item.transition.duration});}}";
1178
- _f.__workletHash = 1120030177160;
1179
- _f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Choices/ChoiceItem.tsx (180:35)";
1180
- return _f;
1181
- }());
1182
- useAnimatedStyle(function () {
1183
- var _f = function () {
1184
- var _theme$kitt$choices$i5 = theme.kitt.choices.item.backgroundColor,
1185
- defaultBg = _theme$kitt$choices$i5["default"],
1186
- pressedBg = _theme$kitt$choices$i5.pressed,
1187
- selectedBg = _theme$kitt$choices$i5.selected,
1188
- disabledBg = _theme$kitt$choices$i5.disabled;
1189
- if (disabled) return {
1190
- backgroundColor: disabledBg
1191
- };
1192
- if (selected) return {
1193
- backgroundColor: selectedBg
1194
- };
1195
- return {
1196
- backgroundColor: interpolateColor(progress.value, [0, 1], [defaultBg, pressedBg])
1197
- };
1198
- };
1199
1160
 
1200
- _f._closure = {
1201
- theme: {
1202
- kitt: {
1203
- choices: {
1204
- item: {
1205
- backgroundColor: theme.kitt.choices.item.backgroundColor
1206
- }
1207
- }
1208
- }
1209
- },
1210
- disabled: disabled,
1211
- selected: selected,
1212
- interpolateColor: interpolateColor,
1213
- progress: progress
1214
- };
1215
- _f.asString = "function _f(){const{theme,disabled,selected,interpolateColor,progress}=jsThis._closure;{const{default:defaultBg,pressed:pressedBg,selected:selectedBg,disabled:disabledBg}=theme.kitt.choices.item.backgroundColor;if(disabled)return{backgroundColor:disabledBg};if(selected)return{backgroundColor:selectedBg};return{backgroundColor:interpolateColor(progress.value,[0,1],[defaultBg,pressedBg])};}}";
1216
- _f.__workletHash = 15506726129309;
1217
- _f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Choices/ChoiceItem.tsx (184:44)";
1218
- return _f;
1219
- }());
1161
+ var _useNativeAnimation = useNativeAnimation(),
1162
+ onPressIn = _useNativeAnimation.onPressIn,
1163
+ onPressOut = _useNativeAnimation.onPressOut;
1220
1164
 
1221
1165
  var handleChange = function () {
1222
1166
  if (!onChange) return; // Checkbox can be toggled
@@ -1243,12 +1187,8 @@ function ChoiceItem(_ref8) {
1243
1187
  handleChange();
1244
1188
  if (onBlur) onBlur(e);
1245
1189
  },
1246
- onPressIn: function onPressIn() {
1247
- pressed.value = true;
1248
- },
1249
- onPressOut: function onPressOut() {
1250
- pressed.value = false;
1251
- },
1190
+ onPressIn: onPressIn,
1191
+ onPressOut: onPressOut,
1252
1192
  children: function children(_ref9) {
1253
1193
  var isHovered = _ref9.isHovered,
1254
1194
  isPressed = _ref9.isPressed;
@@ -1940,8 +1880,14 @@ var input = {
1940
1880
  };
1941
1881
 
1942
1882
  var inputField = {
1883
+ containerPaddingTop: 5,
1884
+ containerPaddingBottom: 10,
1885
+ feedbackPaddingTop: {
1886
+ base: 5,
1887
+ small: 10
1888
+ },
1943
1889
  labelContainerPaddingBottom: 5,
1944
- iconMarginLeft: 6
1890
+ labelFeedbackMarginLeft: 6
1945
1891
  };
1946
1892
 
1947
1893
  var inputTag = {
@@ -2644,44 +2590,25 @@ function InputFeedback(_ref) {
2644
2590
  });
2645
2591
  }
2646
2592
 
2647
- var FieldContainer = /*#__PURE__*/styled$1(View$1).withConfig({
2648
- displayName: "InputField__FieldContainer",
2649
- componentId: "kitt-universal__sc-13fkixs-0"
2650
- })(["padding:5px 0 10px;"]);
2651
- var FeedbackContainer = /*#__PURE__*/styled$1(View$1).withConfig({
2652
- displayName: "InputField__FeedbackContainer",
2653
- componentId: "kitt-universal__sc-13fkixs-1"
2654
- })(["", ";"], function (_ref) {
2655
- var theme = _ref.theme;
2656
- return theme.responsive.ifWindowSizeMatches({
2657
- minWidth: KittBreakpoints.SMALL
2658
- }, 'padding-top: 10px', 'padding-top: 5px');
2659
- });
2660
- var FieldLabelContainer = /*#__PURE__*/styled$1(View$1).withConfig({
2661
- displayName: "InputField__FieldLabelContainer",
2662
- componentId: "kitt-universal__sc-13fkixs-2"
2663
- })(["flex-direction:row;align-items:center;padding-bottom:", "px;"], function (_ref2) {
2664
- var theme = _ref2.theme;
2665
- return theme.kitt.forms.inputField.labelContainerPaddingBottom;
2666
- });
2667
- var LabelContainer = /*#__PURE__*/styled$1(View$1).withConfig({
2668
- displayName: "InputField__LabelContainer",
2669
- componentId: "kitt-universal__sc-13fkixs-3"
2670
- })(["margin-right:", "px;"], function (_ref3) {
2671
- var theme = _ref3.theme;
2672
- return theme.kitt.forms.inputField.iconMarginLeft;
2673
- });
2674
- function InputField(_ref4) {
2675
- var label = _ref4.label,
2676
- labelFeedback = _ref4.labelFeedback,
2677
- input = _ref4.input,
2678
- feedback = _ref4.feedback;
2679
- return /*#__PURE__*/jsxs(FieldContainer, {
2680
- children: [label ? /*#__PURE__*/jsxs(FieldLabelContainer, {
2681
- children: [/*#__PURE__*/jsx(LabelContainer, {
2593
+ function InputField(_ref) {
2594
+ var label = _ref.label,
2595
+ labelFeedback = _ref.labelFeedback,
2596
+ input = _ref.input,
2597
+ feedback = _ref.feedback;
2598
+ var theme = /*#__PURE__*/useTheme();
2599
+ return /*#__PURE__*/jsxs(View, {
2600
+ paddingTop: theme.kitt.forms.inputField.containerPaddingTop,
2601
+ paddingBottom: theme.kitt.forms.inputField.containerPaddingBottom,
2602
+ children: [label ? /*#__PURE__*/jsxs(View, {
2603
+ flexDirection: "row",
2604
+ alignItems: "center",
2605
+ paddingBottom: theme.kitt.forms.inputField.labelContainerPaddingBottom,
2606
+ children: [/*#__PURE__*/jsx(View, {
2607
+ marginRight: theme.kitt.forms.inputField.labelFeedbackMarginLeft,
2682
2608
  children: label
2683
2609
  }), labelFeedback]
2684
- }) : null, input, feedback ? /*#__PURE__*/jsx(FeedbackContainer, {
2610
+ }) : null, input, feedback ? /*#__PURE__*/jsx(View, {
2611
+ paddingTop: theme.kitt.forms.inputField.feedbackPaddingTop,
2685
2612
  children: feedback
2686
2613
  }) : null]
2687
2614
  });