@ornikar/kitt-universal 32.0.1 → 32.1.1-canary.28d1f9f68cb643b8c67559f72df59006a88da1e9.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 (53) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/definitions/Choices/AnimatedChoiceItemView.d.ts +2 -1
  3. package/dist/definitions/Choices/AnimatedChoiceItemView.d.ts.map +1 -1
  4. package/dist/definitions/Choices/AnimatedChoiceItemView.web.d.ts +1 -1
  5. package/dist/definitions/Choices/AnimatedChoiceItemView.web.d.ts.map +1 -1
  6. package/dist/definitions/Choices/ChoiceItem.d.ts +2 -1
  7. package/dist/definitions/Choices/ChoiceItem.d.ts.map +1 -1
  8. package/dist/definitions/Choices/ChoiceItemContainer.d.ts +2 -1
  9. package/dist/definitions/Choices/ChoiceItemContainer.d.ts.map +1 -1
  10. package/dist/definitions/Choices/Choices.d.ts +5 -5
  11. package/dist/definitions/Choices/Choices.d.ts.map +1 -1
  12. package/dist/definitions/native-base/KittNativeBaseProvider.d.ts +15 -3
  13. package/dist/definitions/native-base/KittNativeBaseProvider.d.ts.map +1 -1
  14. package/dist/definitions/themes/default.d.ts +15 -3
  15. package/dist/definitions/themes/default.d.ts.map +1 -1
  16. package/dist/definitions/themes/late-ocean/colors.d.ts +11 -3
  17. package/dist/definitions/themes/late-ocean/colors.d.ts.map +1 -1
  18. package/dist/definitions/themes/palettes/deepPurpleColorPalette.d.ts +5 -0
  19. package/dist/definitions/themes/palettes/deepPurpleColorPalette.d.ts.map +1 -1
  20. package/dist/index-metro.es.android.js +58 -16
  21. package/dist/index-metro.es.android.js.map +1 -1
  22. package/dist/index-metro.es.ios.js +58 -16
  23. package/dist/index-metro.es.ios.js.map +1 -1
  24. package/dist/index-node-22.17.cjs.js +59 -14
  25. package/dist/index-node-22.17.cjs.js.map +1 -1
  26. package/dist/index-node-22.17.cjs.web.js +59 -14
  27. package/dist/index-node-22.17.cjs.web.js.map +1 -1
  28. package/dist/index-node-22.17.es.mjs +60 -15
  29. package/dist/index-node-22.17.es.mjs.map +1 -1
  30. package/dist/index-node-22.17.es.web.mjs +60 -15
  31. package/dist/index-node-22.17.es.web.mjs.map +1 -1
  32. package/dist/index.es.js +61 -16
  33. package/dist/index.es.js.map +1 -1
  34. package/dist/index.es.web.js +61 -16
  35. package/dist/index.es.web.js.map +1 -1
  36. package/dist/linaria-themes-metro.es.android.js +23 -6
  37. package/dist/linaria-themes-metro.es.android.js.map +1 -1
  38. package/dist/linaria-themes-metro.es.ios.js +23 -6
  39. package/dist/linaria-themes-metro.es.ios.js.map +1 -1
  40. package/dist/linaria-themes-node-22.17.cjs.js +23 -6
  41. package/dist/linaria-themes-node-22.17.cjs.js.map +1 -1
  42. package/dist/linaria-themes-node-22.17.cjs.web.js +23 -6
  43. package/dist/linaria-themes-node-22.17.cjs.web.js.map +1 -1
  44. package/dist/linaria-themes-node-22.17.es.mjs +23 -6
  45. package/dist/linaria-themes-node-22.17.es.mjs.map +1 -1
  46. package/dist/linaria-themes-node-22.17.es.web.mjs +23 -6
  47. package/dist/linaria-themes-node-22.17.es.web.mjs.map +1 -1
  48. package/dist/linaria-themes.es.js +23 -6
  49. package/dist/linaria-themes.es.js.map +1 -1
  50. package/dist/linaria-themes.es.web.js +23 -6
  51. package/dist/linaria-themes.es.web.js.map +1 -1
  52. package/dist/tsbuildinfo +1 -1
  53. package/package.json +1 -1
@@ -7,7 +7,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
7
  import _objectDestructuringEmpty from '@babel/runtime/helpers/objectDestructuringEmpty';
8
8
  import _extends from '@babel/runtime/helpers/extends';
9
9
  import Animated, { useSharedValue, useAnimatedStyle, interpolateColor, withSpring, withTiming, Easing as Easing$1, runOnJS, useDerivedValue, useAnimatedProps, withDelay, withRepeat, interpolate, ReducedMotionConfig, ReduceMotion } from 'react-native-reanimated';
10
- import { Platform, Animated as Animated$1, Easing, StyleSheet, Modal, ScrollView as ScrollView$2, View as View$2, Linking, Pressable as Pressable$2, Keyboard, Text as Text$1, useWindowDimensions, PixelRatio } from 'react-native';
10
+ import { Platform, Animated as Animated$1, Easing, StyleSheet, Modal, Linking, Pressable as Pressable$2, Keyboard, Text as Text$1, useWindowDimensions, ScrollView as ScrollView$2, PixelRatio } from 'react-native';
11
11
  export { useWindowDimensions as useWindowSize } from 'react-native';
12
12
  import { SpinnerGapRegularIcon, UserRegularIcon, XRegularIcon, ArrowLeftRegularIcon, CaretUpFillIcon, CaretDownFillIcon, MapPinRegularIcon, EyeClosedRegularIcon, EyeRegularIcon, CheckCircleFillIcon, CaretDownRegularIcon, CaretRightRegularIcon, InfoRegularIcon, WarningRegularIcon, CheckRegularIcon, WarningCircleRegularIcon, ArrowCounterClockwiseRegularIcon, InfoFillIcon, WarningCircleFillIcon, WarningFillIcon } from '@ornikar/kitt-icons/phosphor';
13
13
  import { BottomSheetView, BottomSheetScrollView, BottomSheetSectionList, BottomSheetFlatList, BottomSheetHandle, BottomSheetBackdrop, BottomSheetFooter, BottomSheetTextInput, BottomSheetModal, useBottomSheetModal } from '@gorhom/bottom-sheet';
@@ -45,6 +45,9 @@ const hex2rgba = (hex, alpha = 1) => {
45
45
  };
46
46
 
47
47
  const createColorScale = colorScale => colorScale;
48
+
49
+ // WARNING
50
+ // If you update this palette, don't forget to update the palette in @ornikar/bumper as well.
48
51
  const colorScales = {
49
52
  deepPurple: createColorScale({
50
53
  5: '#936C93',
@@ -109,9 +112,15 @@ const colorScales = {
109
112
  red: createColorScale({
110
113
  1: '#FDE4E3',
111
114
  2: '#FAB8B8',
112
- 6: '#F14847',
115
+ 6: '#E2483D',
113
116
  7: '#BD100F'
114
117
  }),
118
+ mauve: createColorScale({
119
+ 1: '#F8E7FF',
120
+ 2: '#F1D0FB',
121
+ 3: '#E4A4F9',
122
+ 4: '#D283EC'
123
+ }),
115
124
  'beige-alpha': createColorScale({
116
125
  '25': '#C1B59F40',
117
126
  '40': '#C1B59F66',
@@ -220,8 +229,14 @@ const colors = {
220
229
  }
221
230
  },
222
231
  highlight: {
223
- default: deepPurpleColorPalette['blue.1'],
224
- pressed: deepPurpleColorPalette['blue.2']
232
+ mid: {
233
+ default: deepPurpleColorPalette['mauve.1'],
234
+ pressed: deepPurpleColorPalette['mauve.2']
235
+ },
236
+ hi: {
237
+ default: deepPurpleColorPalette['mauve.3'],
238
+ pressed: deepPurpleColorPalette['mauve.4']
239
+ }
225
240
  },
226
241
  info: {
227
242
  hi: deepPurpleColorPalette['blue.6'],
@@ -249,17 +264,19 @@ const colors = {
249
264
  base: {
250
265
  hi: deepPurpleColorPalette['grey.9'],
251
266
  mid: deepPurpleColorPalette['beige.3'],
267
+ low: deepPurpleColorPalette['beige.2'],
252
268
  onContrasted: {
253
269
  hi: deepPurpleColorPalette['grey.0'],
254
270
  mid: deepPurpleColorPalette['white-alpha.20']
255
- }
271
+ },
272
+ accent: deepPurpleColorPalette['deepPurple.8']
256
273
  },
257
- accent: deepPurpleColorPalette['deepPurple.8'],
258
274
  info: deepPurpleColorPalette['blue.6'],
259
275
  success: deepPurpleColorPalette['green.6'],
260
276
  warning: deepPurpleColorPalette['yellow.6'],
261
277
  danger: deepPurpleColorPalette['red.6'],
262
- disabled: deepPurpleColorPalette['grey.2']
278
+ disabled: deepPurpleColorPalette['grey.2'],
279
+ highlight: deepPurpleColorPalette['mauve.3']
263
280
  }
264
281
  }
265
282
  };
@@ -4794,6 +4811,7 @@ function AnimatedChoiceItemView({
4794
4811
  isDisabled,
4795
4812
  isSelected,
4796
4813
  hasError,
4814
+ shouldExpand = false,
4797
4815
  animatedStyles
4798
4816
  }) {
4799
4817
  const sx = useSx();
@@ -4812,7 +4830,9 @@ function AnimatedChoiceItemView({
4812
4830
  isHovered,
4813
4831
  isPressed
4814
4832
  }),
4815
- padding: size === 'small' ? 'kitt.2' : 'kitt.4'
4833
+ padding: size === 'small' ? 'kitt.2' : 'kitt.4',
4834
+ flexGrow: shouldExpand ? 1 : undefined,
4835
+ flexShrink: shouldExpand ? 1 : undefined
4816
4836
  });
4817
4837
  return /*#__PURE__*/jsx(Animated.View, {
4818
4838
  style: [style, animatedStyles],
@@ -4876,6 +4896,7 @@ function ChoiceItem({
4876
4896
  value,
4877
4897
  selected,
4878
4898
  disabled,
4899
+ shouldExpand = false,
4879
4900
  children,
4880
4901
  isPressedInternal,
4881
4902
  isHoveredInternal,
@@ -4915,6 +4936,8 @@ function ChoiceItem({
4915
4936
  checked: selected
4916
4937
  },
4917
4938
  style: style,
4939
+ flexGrow: shouldExpand ? 1 : undefined,
4940
+ flexShrink: shouldExpand ? 1 : undefined,
4918
4941
  onBlur: onBlur,
4919
4942
  onFocus: onFocus,
4920
4943
  onPress: e => {
@@ -4934,6 +4957,8 @@ function ChoiceItem({
4934
4957
  });
4935
4958
  return /*#__PURE__*/jsxs(VStack, {
4936
4959
  space: "kitt.2",
4960
+ flexGrow: shouldExpand ? 1 : undefined,
4961
+ flexShrink: shouldExpand ? 1 : undefined,
4937
4962
  children: [/*#__PURE__*/jsxs(AnimatedChoiceItemView, {
4938
4963
  animatedStyles: backgroundStyles,
4939
4964
  isHovered: isHovered || isHoveredInternal,
@@ -4941,10 +4966,13 @@ function ChoiceItem({
4941
4966
  isSelected: selected,
4942
4967
  isPressed: isPressed || isPressedInternal,
4943
4968
  hasError: hasError,
4969
+ shouldExpand: shouldExpand,
4944
4970
  size: size,
4945
4971
  children: [/*#__PURE__*/jsxs(Stack, {
4946
4972
  alignItems: "center",
4947
4973
  space: "kitt.2",
4974
+ flexGrow: shouldExpand ? 1 : undefined,
4975
+ flexShrink: shouldExpand ? 1 : undefined,
4948
4976
  children: [icon ? /*#__PURE__*/jsx(TypographyIcon, {
4949
4977
  color: textColor,
4950
4978
  icon: icon
@@ -4973,36 +5001,46 @@ function ChoiceItem({
4973
5001
  function ChoiceItemContainer({
4974
5002
  children,
4975
5003
  direction,
5004
+ shouldExpand,
4976
5005
  isLast
4977
5006
  }) {
4978
5007
  const currentItemMarginValue = isLast ? undefined : 'kitt.3';
4979
- const flexProps = direction === 'row' ? {
5008
+ const directionFlexProps = direction === 'row' ? {
4980
5009
  flexGrow: 1,
4981
5010
  flexShrink: 1,
4982
5011
  flexBasis: 0
4983
5012
  } : {};
4984
- return /*#__PURE__*/jsx(View, _objectSpread(_objectSpread({
5013
+ const shouldExpandFlexProps = shouldExpand ? {
5014
+ flexGrow: 1,
5015
+ flexShrink: 1
5016
+ } : {};
5017
+ return /*#__PURE__*/jsx(View, _objectSpread(_objectSpread(_objectSpread({
4985
5018
  marginRight: direction === 'row' ? currentItemMarginValue : undefined,
4986
5019
  marginBottom: direction === 'column' ? currentItemMarginValue : undefined
4987
- }, flexProps), {}, {
5020
+ }, directionFlexProps), shouldExpandFlexProps), {}, {
4988
5021
  children: children
4989
5022
  }));
4990
5023
  }
4991
5024
 
4992
- const _excluded$G = ["direction", "contentContainerStyle"];
5025
+ const _excluded$G = ["direction", "shouldExpand", "contentContainerStyle"];
4993
5026
  function ChoicesContainer(_ref) {
4994
5027
  let {
4995
5028
  direction,
5029
+ shouldExpand,
4996
5030
  contentContainerStyle
4997
5031
  } = _ref,
4998
5032
  props = _objectWithoutProperties(_ref, _excluded$G);
5033
+ const shouldExpandFlexProps = shouldExpand ? {
5034
+ flexGrow: 1,
5035
+ flexShrink: 1
5036
+ } : {};
4999
5037
  if (direction === 'row') {
5000
- return /*#__PURE__*/jsx(ScrollView$2, _objectSpread({
5038
+ return /*#__PURE__*/jsx(ScrollView, _objectSpread(_objectSpread({
5001
5039
  horizontal: true,
5002
- contentContainerStyle: contentContainerStyle
5003
- }, props));
5040
+ contentContainerStyle: shouldExpand ? shouldExpandFlexProps : contentContainerStyle
5041
+ }, props), shouldExpandFlexProps));
5004
5042
  }
5005
- return /*#__PURE__*/jsx(View$2, _objectSpread({}, props));
5043
+ return /*#__PURE__*/jsx(View, _objectSpread(_objectSpread({}, props), shouldExpandFlexProps));
5006
5044
  }
5007
5045
 
5008
5046
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -5013,6 +5051,7 @@ function Choices({
5013
5051
  type,
5014
5052
  direction = 'column',
5015
5053
  disabled,
5054
+ shouldExpand = false,
5016
5055
  children,
5017
5056
  value,
5018
5057
  onPress,
@@ -5029,6 +5068,7 @@ function Choices({
5029
5068
  const sharedProps = {
5030
5069
  type,
5031
5070
  disabled,
5071
+ shouldExpand,
5032
5072
  onPress: !isForm ? onPress : undefined,
5033
5073
  onChange: isForm ? newValue => {
5034
5074
  setCurrentValue(newValue);
@@ -5040,6 +5080,7 @@ function Choices({
5040
5080
  };
5041
5081
  return /*#__PURE__*/jsx(ChoicesContainer, {
5042
5082
  direction: direction,
5083
+ shouldExpand: shouldExpand,
5043
5084
  testID: testID,
5044
5085
  id: id,
5045
5086
  style: style,
@@ -5050,6 +5091,7 @@ function Choices({
5050
5091
  }, sharedProps));
5051
5092
  return /*#__PURE__*/jsx(ChoiceItemContainer, {
5052
5093
  direction: direction,
5094
+ shouldExpand: shouldExpand,
5053
5095
  isLast: index === childrenArray.length - 1,
5054
5096
  children: element
5055
5097
  }, child.key);