@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
@@ -1049,6 +1049,88 @@ function Card(_ref6) {
1049
1049
  });
1050
1050
  }
1051
1051
 
1052
+ var useNativeAnimation = function (_ref) {
1053
+ var selected = _ref.selected,
1054
+ disabled = _ref.disabled,
1055
+ isPressedInternal = _ref.isPressedInternal;
1056
+ var theme = /*#__PURE__*/useTheme();
1057
+ var pressed = useSharedValue(Boolean(isPressedInternal));
1058
+ var progress = useDerivedValue(function () {
1059
+ var _f = function () {
1060
+ return withTiming(pressed.value ? 1 : 0, {
1061
+ duration: theme.kitt.choices.item.transition.duration
1062
+ });
1063
+ };
1064
+
1065
+ _f._closure = {
1066
+ withTiming: withTiming,
1067
+ pressed: pressed,
1068
+ theme: {
1069
+ kitt: {
1070
+ choices: {
1071
+ item: {
1072
+ transition: {
1073
+ duration: theme.kitt.choices.item.transition.duration
1074
+ }
1075
+ }
1076
+ }
1077
+ }
1078
+ }
1079
+ };
1080
+ _f.asString = "function _f(){const{withTiming,pressed,theme}=jsThis._closure;{return withTiming(pressed.value?1:0,{duration:theme.kitt.choices.item.transition.duration});}}";
1081
+ _f.__workletHash = 1120030177160;
1082
+ _f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Choices/hooks/useNativeAnimation.tsx (31:35)";
1083
+ return _f;
1084
+ }());
1085
+ var backgroundStyles = useAnimatedStyle(function () {
1086
+ var _f = function () {
1087
+ var _theme$kitt$choices$i = theme.kitt.choices.item.backgroundColor,
1088
+ defaultBg = _theme$kitt$choices$i["default"],
1089
+ pressedBg = _theme$kitt$choices$i.pressed,
1090
+ selectedBg = _theme$kitt$choices$i.selected,
1091
+ disabledBg = _theme$kitt$choices$i.disabled;
1092
+ if (disabled) return {
1093
+ backgroundColor: disabledBg
1094
+ };
1095
+ if (selected) return {
1096
+ backgroundColor: selectedBg
1097
+ };
1098
+ return {
1099
+ backgroundColor: interpolateColor(progress.value, [0, 1], [defaultBg, pressedBg])
1100
+ };
1101
+ };
1102
+
1103
+ _f._closure = {
1104
+ theme: {
1105
+ kitt: {
1106
+ choices: {
1107
+ item: {
1108
+ backgroundColor: theme.kitt.choices.item.backgroundColor
1109
+ }
1110
+ }
1111
+ }
1112
+ },
1113
+ disabled: disabled,
1114
+ selected: selected,
1115
+ interpolateColor: interpolateColor,
1116
+ progress: progress
1117
+ };
1118
+ _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])};}}";
1119
+ _f.__workletHash = 15506726129309;
1120
+ _f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Choices/hooks/useNativeAnimation.tsx (35:44)";
1121
+ return _f;
1122
+ }());
1123
+ return {
1124
+ onPressIn: function onPressIn() {
1125
+ pressed.value = true;
1126
+ },
1127
+ onPressOut: function onPressOut() {
1128
+ pressed.value = false;
1129
+ },
1130
+ backgroundStyles: backgroundStyles
1131
+ };
1132
+ };
1133
+
1052
1134
  function getCurrentTextColor(_ref) {
1053
1135
  var isDisabled = _ref.isDisabled,
1054
1136
  isSelected = _ref.isSelected,
@@ -1080,7 +1162,7 @@ var DisabledBorder = /*#__PURE__*/styled(View$2).withConfig({
1080
1162
  color = _theme$kitt$choices$i.color;
1081
1163
  return css(["border:", "px solid ", ";"], width, color);
1082
1164
  });
1083
- var ChoiceItemView = /*#__PURE__*/styled(Animated.View).withConfig({
1165
+ var ChoiceItemView = /*#__PURE__*/styled(Platform.OS === 'web' ? View$2 : Animated.View).withConfig({
1084
1166
  displayName: "ChoiceItem__ChoiceItemView"
1085
1167
  })(["position:relative;border-radius:", "px;background-color:", ";", ";", ""], function (_ref4) {
1086
1168
  var theme = _ref4.theme,
@@ -1136,73 +1218,15 @@ function ChoiceItem(_ref8) {
1136
1218
  onChange = _ref8.onChange,
1137
1219
  onBlur = _ref8.onBlur,
1138
1220
  onFocus = _ref8.onFocus;
1139
- var theme = /*#__PURE__*/useTheme();
1140
- var pressed = useSharedValue(Boolean(isPressedInternal));
1141
- var progress = useDerivedValue(function () {
1142
- var _f = function () {
1143
- return withTiming(pressed.value ? 1 : 0, {
1144
- duration: theme.kitt.choices.item.transition.duration
1145
- });
1146
- };
1147
-
1148
- _f._closure = {
1149
- withTiming: withTiming,
1150
- pressed: pressed,
1151
- theme: {
1152
- kitt: {
1153
- choices: {
1154
- item: {
1155
- transition: {
1156
- duration: theme.kitt.choices.item.transition.duration
1157
- }
1158
- }
1159
- }
1160
- }
1161
- }
1162
- };
1163
- _f.asString = "function _f(){const{withTiming,pressed,theme}=jsThis._closure;{return withTiming(pressed.value?1:0,{duration:theme.kitt.choices.item.transition.duration});}}";
1164
- _f.__workletHash = 1120030177160;
1165
- _f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Choices/ChoiceItem.tsx (180:35)";
1166
- return _f;
1167
- }());
1168
- var backgroundStyles = useAnimatedStyle(function () {
1169
- var _f = function () {
1170
- var _theme$kitt$choices$i5 = theme.kitt.choices.item.backgroundColor,
1171
- defaultBg = _theme$kitt$choices$i5["default"],
1172
- pressedBg = _theme$kitt$choices$i5.pressed,
1173
- selectedBg = _theme$kitt$choices$i5.selected,
1174
- disabledBg = _theme$kitt$choices$i5.disabled;
1175
- if (disabled) return {
1176
- backgroundColor: disabledBg
1177
- };
1178
- if (selected) return {
1179
- backgroundColor: selectedBg
1180
- };
1181
- return {
1182
- backgroundColor: interpolateColor(progress.value, [0, 1], [defaultBg, pressedBg])
1183
- };
1184
- };
1185
1221
 
1186
- _f._closure = {
1187
- theme: {
1188
- kitt: {
1189
- choices: {
1190
- item: {
1191
- backgroundColor: theme.kitt.choices.item.backgroundColor
1192
- }
1193
- }
1194
- }
1195
- },
1196
- disabled: disabled,
1197
- selected: selected,
1198
- interpolateColor: interpolateColor,
1199
- progress: progress
1200
- };
1201
- _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])};}}";
1202
- _f.__workletHash = 15506726129309;
1203
- _f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Choices/ChoiceItem.tsx (184:44)";
1204
- return _f;
1205
- }());
1222
+ var _useNativeAnimation = useNativeAnimation({
1223
+ selected: selected,
1224
+ disabled: disabled,
1225
+ isPressedInternal: isPressedInternal
1226
+ }),
1227
+ onPressIn = _useNativeAnimation.onPressIn,
1228
+ onPressOut = _useNativeAnimation.onPressOut,
1229
+ backgroundStyles = _useNativeAnimation.backgroundStyles;
1206
1230
 
1207
1231
  var handleChange = function () {
1208
1232
  if (!onChange) return; // Checkbox can be toggled
@@ -1229,12 +1253,8 @@ function ChoiceItem(_ref8) {
1229
1253
  handleChange();
1230
1254
  if (onBlur) onBlur(e);
1231
1255
  },
1232
- onPressIn: function onPressIn() {
1233
- pressed.value = true;
1234
- },
1235
- onPressOut: function onPressOut() {
1236
- pressed.value = false;
1237
- },
1256
+ onPressIn: onPressIn,
1257
+ onPressOut: onPressOut,
1238
1258
  children: function children(_ref9) {
1239
1259
  var isHovered = _ref9.isHovered,
1240
1260
  isPressed = _ref9.isPressed;
@@ -1948,8 +1968,14 @@ var input = {
1948
1968
  };
1949
1969
 
1950
1970
  var inputField = {
1971
+ containerPaddingTop: 5,
1972
+ containerPaddingBottom: 10,
1973
+ feedbackPaddingTop: {
1974
+ base: 5,
1975
+ small: 10
1976
+ },
1951
1977
  labelContainerPaddingBottom: 5,
1952
- iconMarginLeft: 6
1978
+ labelFeedbackMarginLeft: 6
1953
1979
  };
1954
1980
 
1955
1981
  var inputTag = {
@@ -3261,40 +3287,25 @@ function InputFeedback(_ref) {
3261
3287
  });
3262
3288
  }
3263
3289
 
3264
- var FieldContainer = /*#__PURE__*/styled.View.withConfig({
3265
- displayName: "InputField__FieldContainer"
3266
- })(["padding:5px 0 10px;"]);
3267
- var FeedbackContainer = /*#__PURE__*/styled.View.withConfig({
3268
- displayName: "InputField__FeedbackContainer"
3269
- })(["", ";"], function (_ref) {
3270
- var theme = _ref.theme;
3271
- return theme.responsive.ifWindowSizeMatches({
3272
- minWidth: KittBreakpoints.SMALL
3273
- }, 'padding-top: 10px', 'padding-top: 5px');
3274
- });
3275
- var FieldLabelContainer = /*#__PURE__*/styled.View.withConfig({
3276
- displayName: "InputField__FieldLabelContainer"
3277
- })(["flex-direction:row;align-items:center;padding-bottom:", "px;"], function (_ref2) {
3278
- var theme = _ref2.theme;
3279
- return theme.kitt.forms.inputField.labelContainerPaddingBottom;
3280
- });
3281
- var LabelContainer = /*#__PURE__*/styled.View.withConfig({
3282
- displayName: "InputField__LabelContainer"
3283
- })(["margin-right:", "px;"], function (_ref3) {
3284
- var theme = _ref3.theme;
3285
- return theme.kitt.forms.inputField.iconMarginLeft;
3286
- });
3287
- function InputField(_ref4) {
3288
- var label = _ref4.label,
3289
- labelFeedback = _ref4.labelFeedback,
3290
- input = _ref4.input,
3291
- feedback = _ref4.feedback;
3292
- return /*#__PURE__*/jsxs(FieldContainer, {
3293
- children: [label ? /*#__PURE__*/jsxs(FieldLabelContainer, {
3294
- children: [/*#__PURE__*/jsx(LabelContainer, {
3290
+ function InputField(_ref) {
3291
+ var label = _ref.label,
3292
+ labelFeedback = _ref.labelFeedback,
3293
+ input = _ref.input,
3294
+ feedback = _ref.feedback;
3295
+ var theme = /*#__PURE__*/useTheme();
3296
+ return /*#__PURE__*/jsxs(View, {
3297
+ paddingTop: theme.kitt.forms.inputField.containerPaddingTop,
3298
+ paddingBottom: theme.kitt.forms.inputField.containerPaddingBottom,
3299
+ children: [label ? /*#__PURE__*/jsxs(View, {
3300
+ flexDirection: "row",
3301
+ alignItems: "center",
3302
+ paddingBottom: theme.kitt.forms.inputField.labelContainerPaddingBottom,
3303
+ children: [/*#__PURE__*/jsx(View, {
3304
+ marginRight: theme.kitt.forms.inputField.labelFeedbackMarginLeft,
3295
3305
  children: label
3296
3306
  }), labelFeedback]
3297
- }) : null, input, feedback ? /*#__PURE__*/jsx(FeedbackContainer, {
3307
+ }) : null, input, feedback ? /*#__PURE__*/jsx(View, {
3308
+ paddingTop: theme.kitt.forms.inputField.feedbackPaddingTop,
3298
3309
  children: feedback
3299
3310
  }) : null]
3300
3311
  });