@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
@@ -3,7 +3,7 @@ import { View as View$1, ScrollView as ScrollView$1, Pressable as Pressable$1, I
3
3
  export { useClipboard, useContrastText, useMediaQuery, useSx, useToken } from 'native-base';
4
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
5
  import Animated, { useSharedValue, useAnimatedStyle, interpolateColor, withSpring, withTiming, Easing as Easing$1, runOnJS, useDerivedValue, useAnimatedProps, withDelay, withRepeat, interpolate, ReducedMotionConfig, ReduceMotion } from 'react-native-reanimated';
6
- 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';
6
+ 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';
7
7
  export { useWindowDimensions as useWindowSize } from 'react-native';
8
8
  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';
9
9
  import { BottomSheetView, BottomSheetScrollView, BottomSheetSectionList, BottomSheetFlatList, BottomSheetHandle, BottomSheetBackdrop, BottomSheetFooter, BottomSheetTextInput, BottomSheetModal, useBottomSheetModal } from '@gorhom/bottom-sheet';
@@ -41,6 +41,9 @@ const hex2rgba = (hex, alpha = 1) => {
41
41
  };
42
42
 
43
43
  const createColorScale = colorScale => colorScale;
44
+
45
+ // WARNING
46
+ // If you update this palette, don't forget to update the palette in @ornikar/bumper as well.
44
47
  const colorScales = {
45
48
  deepPurple: createColorScale({
46
49
  5: '#936C93',
@@ -105,9 +108,15 @@ const colorScales = {
105
108
  red: createColorScale({
106
109
  1: '#FDE4E3',
107
110
  2: '#FAB8B8',
108
- 6: '#F14847',
111
+ 6: '#E2483D',
109
112
  7: '#BD100F'
110
113
  }),
114
+ mauve: createColorScale({
115
+ 1: '#F8E7FF',
116
+ 2: '#F1D0FB',
117
+ 3: '#E4A4F9',
118
+ 4: '#D283EC'
119
+ }),
111
120
  'beige-alpha': createColorScale({
112
121
  '25': '#C1B59F40',
113
122
  '40': '#C1B59F66',
@@ -217,8 +226,14 @@ const colors = {
217
226
  }
218
227
  },
219
228
  highlight: {
220
- default: deepPurpleColorPalette['blue.1'],
221
- pressed: deepPurpleColorPalette['blue.2']
229
+ mid: {
230
+ default: deepPurpleColorPalette['mauve.1'],
231
+ pressed: deepPurpleColorPalette['mauve.2']
232
+ },
233
+ hi: {
234
+ default: deepPurpleColorPalette['mauve.3'],
235
+ pressed: deepPurpleColorPalette['mauve.4']
236
+ }
222
237
  },
223
238
  info: {
224
239
  hi: deepPurpleColorPalette['blue.6'],
@@ -246,17 +261,19 @@ const colors = {
246
261
  base: {
247
262
  hi: deepPurpleColorPalette['grey.9'],
248
263
  mid: deepPurpleColorPalette['beige.3'],
264
+ low: deepPurpleColorPalette['beige.2'],
249
265
  onContrasted: {
250
266
  hi: deepPurpleColorPalette['grey.0'],
251
267
  mid: deepPurpleColorPalette['white-alpha.20']
252
- }
268
+ },
269
+ accent: deepPurpleColorPalette['deepPurple.8']
253
270
  },
254
- accent: deepPurpleColorPalette['deepPurple.8'],
255
271
  info: deepPurpleColorPalette['blue.6'],
256
272
  success: deepPurpleColorPalette['green.6'],
257
273
  warning: deepPurpleColorPalette['yellow.6'],
258
274
  danger: deepPurpleColorPalette['red.6'],
259
- disabled: deepPurpleColorPalette['grey.2']
275
+ disabled: deepPurpleColorPalette['grey.2'],
276
+ highlight: deepPurpleColorPalette['mauve.3']
260
277
  }
261
278
  }
262
279
  };
@@ -4797,6 +4814,7 @@ function AnimatedChoiceItemView({
4797
4814
  isDisabled,
4798
4815
  isSelected,
4799
4816
  hasError,
4817
+ shouldExpand = false,
4800
4818
  animatedStyles
4801
4819
  }) {
4802
4820
  const sx = useSx();
@@ -4815,7 +4833,9 @@ function AnimatedChoiceItemView({
4815
4833
  isHovered,
4816
4834
  isPressed
4817
4835
  }),
4818
- padding: size === 'small' ? 'kitt.2' : 'kitt.4'
4836
+ padding: size === 'small' ? 'kitt.2' : 'kitt.4',
4837
+ flexGrow: shouldExpand ? 1 : undefined,
4838
+ flexShrink: shouldExpand ? 1 : undefined
4819
4839
  });
4820
4840
  return /*#__PURE__*/jsx(Animated.View, {
4821
4841
  style: [style, animatedStyles],
@@ -4879,6 +4899,7 @@ function ChoiceItem({
4879
4899
  value,
4880
4900
  selected,
4881
4901
  disabled,
4902
+ shouldExpand = false,
4882
4903
  children,
4883
4904
  isPressedInternal,
4884
4905
  isHoveredInternal,
@@ -4918,6 +4939,8 @@ function ChoiceItem({
4918
4939
  checked: selected
4919
4940
  },
4920
4941
  style: style,
4942
+ flexGrow: shouldExpand ? 1 : undefined,
4943
+ flexShrink: shouldExpand ? 1 : undefined,
4921
4944
  onBlur: onBlur,
4922
4945
  onFocus: onFocus,
4923
4946
  onPress: e => {
@@ -4937,6 +4960,8 @@ function ChoiceItem({
4937
4960
  });
4938
4961
  return /*#__PURE__*/jsxs(VStack, {
4939
4962
  space: "kitt.2",
4963
+ flexGrow: shouldExpand ? 1 : undefined,
4964
+ flexShrink: shouldExpand ? 1 : undefined,
4940
4965
  children: [/*#__PURE__*/jsxs(AnimatedChoiceItemView, {
4941
4966
  animatedStyles: backgroundStyles,
4942
4967
  isHovered: isHovered || isHoveredInternal,
@@ -4944,10 +4969,13 @@ function ChoiceItem({
4944
4969
  isSelected: selected,
4945
4970
  isPressed: isPressed || isPressedInternal,
4946
4971
  hasError: hasError,
4972
+ shouldExpand: shouldExpand,
4947
4973
  size: size,
4948
4974
  children: [/*#__PURE__*/jsxs(Stack, {
4949
4975
  alignItems: "center",
4950
4976
  space: "kitt.2",
4977
+ flexGrow: shouldExpand ? 1 : undefined,
4978
+ flexShrink: shouldExpand ? 1 : undefined,
4951
4979
  children: [icon ? /*#__PURE__*/jsx(TypographyIcon, {
4952
4980
  color: textColor,
4953
4981
  icon: icon
@@ -4976,36 +5004,49 @@ function ChoiceItem({
4976
5004
  function ChoiceItemContainer({
4977
5005
  children,
4978
5006
  direction,
5007
+ shouldExpand,
4979
5008
  isLast
4980
5009
  }) {
4981
5010
  const currentItemMarginValue = isLast ? undefined : 'kitt.3';
4982
- const flexProps = direction === 'row' ? {
5011
+ const directionFlexProps = direction === 'row' ? {
4983
5012
  flexGrow: 1,
4984
5013
  flexShrink: 1,
4985
5014
  flexBasis: 0
4986
5015
  } : {};
5016
+ const shouldExpandFlexProps = shouldExpand ? {
5017
+ flexGrow: 1,
5018
+ flexShrink: 1
5019
+ } : {};
4987
5020
  return /*#__PURE__*/jsx(View, {
4988
5021
  marginRight: direction === 'row' ? currentItemMarginValue : undefined,
4989
5022
  marginBottom: direction === 'column' ? currentItemMarginValue : undefined,
4990
- ...flexProps,
5023
+ ...directionFlexProps,
5024
+ ...shouldExpandFlexProps,
4991
5025
  children: children
4992
5026
  });
4993
5027
  }
4994
5028
 
4995
5029
  function ChoicesContainer({
4996
5030
  direction,
5031
+ shouldExpand,
4997
5032
  contentContainerStyle,
4998
5033
  ...props
4999
5034
  }) {
5035
+ const shouldExpandFlexProps = shouldExpand ? {
5036
+ flexGrow: 1,
5037
+ flexShrink: 1
5038
+ } : {};
5000
5039
  if (direction === 'row') {
5001
- return /*#__PURE__*/jsx(ScrollView$2, {
5040
+ return /*#__PURE__*/jsx(ScrollView, {
5002
5041
  horizontal: true,
5003
- contentContainerStyle: contentContainerStyle,
5004
- ...props
5042
+ contentContainerStyle: shouldExpand ? shouldExpandFlexProps : contentContainerStyle,
5043
+ ...props,
5044
+ ...shouldExpandFlexProps
5005
5045
  });
5006
5046
  }
5007
- return /*#__PURE__*/jsx(View$2, {
5008
- ...props
5047
+ return /*#__PURE__*/jsx(View, {
5048
+ ...props,
5049
+ ...shouldExpandFlexProps
5009
5050
  });
5010
5051
  }
5011
5052
 
@@ -5017,6 +5058,7 @@ function Choices({
5017
5058
  type,
5018
5059
  direction = 'column',
5019
5060
  disabled,
5061
+ shouldExpand = false,
5020
5062
  children,
5021
5063
  value,
5022
5064
  onPress,
@@ -5033,6 +5075,7 @@ function Choices({
5033
5075
  const sharedProps = {
5034
5076
  type,
5035
5077
  disabled,
5078
+ shouldExpand,
5036
5079
  onPress: !isForm ? onPress : undefined,
5037
5080
  onChange: isForm ? newValue => {
5038
5081
  setCurrentValue(newValue);
@@ -5044,6 +5087,7 @@ function Choices({
5044
5087
  };
5045
5088
  return /*#__PURE__*/jsx(ChoicesContainer, {
5046
5089
  direction: direction,
5090
+ shouldExpand: shouldExpand,
5047
5091
  testID: testID,
5048
5092
  id: id,
5049
5093
  style: style,
@@ -5055,6 +5099,7 @@ function Choices({
5055
5099
  });
5056
5100
  return /*#__PURE__*/jsx(ChoiceItemContainer, {
5057
5101
  direction: direction,
5102
+ shouldExpand: shouldExpand,
5058
5103
  isLast: index === childrenArray.length - 1,
5059
5104
  children: element
5060
5105
  }, child.key);