@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
@@ -11,7 +11,7 @@ import _typeof from '@babel/runtime/helpers/typeof';
11
11
  import _regeneratorRuntime from '@babel/runtime/helpers/regeneratorRuntime';
12
12
  import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
13
13
  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';
14
- import { Animated, Easing, ScrollView as ScrollView$2, View as View$2, StyleSheet, Modal, Linking, Pressable as Pressable$2, useWindowDimensions } from 'react-native';
14
+ import { Animated, Easing, StyleSheet, Modal, Linking, Pressable as Pressable$2, useWindowDimensions } from 'react-native';
15
15
  export { useWindowDimensions as useWindowSize } from 'react-native';
16
16
  import { createPortal } from 'react-dom';
17
17
  import { CSSTransition } from 'react-transition-group';
@@ -52,6 +52,9 @@ var hex2rgba = function (hex) {
52
52
  var createColorScale = function (colorScale) {
53
53
  return colorScale;
54
54
  };
55
+
56
+ // WARNING
57
+ // If you update this palette, don't forget to update the palette in @ornikar/bumper as well.
55
58
  var colorScales = {
56
59
  deepPurple: createColorScale({
57
60
  5: '#936C93',
@@ -116,9 +119,15 @@ var colorScales = {
116
119
  red: createColorScale({
117
120
  1: '#FDE4E3',
118
121
  2: '#FAB8B8',
119
- 6: '#F14847',
122
+ 6: '#E2483D',
120
123
  7: '#BD100F'
121
124
  }),
125
+ mauve: createColorScale({
126
+ 1: '#F8E7FF',
127
+ 2: '#F1D0FB',
128
+ 3: '#E4A4F9',
129
+ 4: '#D283EC'
130
+ }),
122
131
  'beige-alpha': createColorScale({
123
132
  '25': '#C1B59F40',
124
133
  '40': '#C1B59F66',
@@ -233,8 +242,14 @@ var colors = {
233
242
  }
234
243
  },
235
244
  highlight: {
236
- "default": deepPurpleColorPalette['blue.1'],
237
- pressed: deepPurpleColorPalette['blue.2']
245
+ mid: {
246
+ "default": deepPurpleColorPalette['mauve.1'],
247
+ pressed: deepPurpleColorPalette['mauve.2']
248
+ },
249
+ hi: {
250
+ "default": deepPurpleColorPalette['mauve.3'],
251
+ pressed: deepPurpleColorPalette['mauve.4']
252
+ }
238
253
  },
239
254
  info: {
240
255
  hi: deepPurpleColorPalette['blue.6'],
@@ -262,17 +277,19 @@ var colors = {
262
277
  base: {
263
278
  hi: deepPurpleColorPalette['grey.9'],
264
279
  mid: deepPurpleColorPalette['beige.3'],
280
+ low: deepPurpleColorPalette['beige.2'],
265
281
  onContrasted: {
266
282
  hi: deepPurpleColorPalette['grey.0'],
267
283
  mid: deepPurpleColorPalette['white-alpha.20']
268
- }
284
+ },
285
+ accent: deepPurpleColorPalette['deepPurple.8']
269
286
  },
270
- accent: deepPurpleColorPalette['deepPurple.8'],
271
287
  info: deepPurpleColorPalette['blue.6'],
272
288
  success: deepPurpleColorPalette['green.6'],
273
289
  warning: deepPurpleColorPalette['yellow.6'],
274
290
  danger: deepPurpleColorPalette['red.6'],
275
- disabled: deepPurpleColorPalette['grey.2']
291
+ disabled: deepPurpleColorPalette['grey.2'],
292
+ highlight: deepPurpleColorPalette['mauve.3']
276
293
  }
277
294
  }
278
295
  };
@@ -4725,7 +4742,9 @@ function AnimatedChoiceItemView(_ref) {
4725
4742
  isPressed = _ref.isPressed,
4726
4743
  isDisabled = _ref.isDisabled,
4727
4744
  isSelected = _ref.isSelected,
4728
- hasError = _ref.hasError;
4745
+ hasError = _ref.hasError,
4746
+ _ref$shouldExpand = _ref.shouldExpand,
4747
+ shouldExpand = _ref$shouldExpand === void 0 ? false : _ref$shouldExpand;
4729
4748
  var theme = useTheme();
4730
4749
  return /*#__PURE__*/jsx(View, {
4731
4750
  position: "relative",
@@ -4743,6 +4762,8 @@ function AnimatedChoiceItemView(_ref) {
4743
4762
  isPressed: isPressed
4744
4763
  }),
4745
4764
  padding: size === 'small' ? 'kitt.2' : 'kitt.4',
4765
+ flexGrow: shouldExpand ? 1 : undefined,
4766
+ flexShrink: shouldExpand ? 1 : undefined,
4746
4767
  _web: {
4747
4768
  style: {
4748
4769
  transitionProperty: theme.kitt.choices.item.transition.property,
@@ -4779,6 +4800,8 @@ function ChoiceItem(_ref) {
4779
4800
  value = _ref.value,
4780
4801
  selected = _ref.selected,
4781
4802
  disabled = _ref.disabled,
4803
+ _ref$shouldExpand = _ref.shouldExpand,
4804
+ shouldExpand = _ref$shouldExpand === void 0 ? false : _ref$shouldExpand,
4782
4805
  _children = _ref.children,
4783
4806
  isPressedInternal = _ref.isPressedInternal,
4784
4807
  isHoveredInternal = _ref.isHoveredInternal,
@@ -4812,6 +4835,8 @@ function ChoiceItem(_ref) {
4812
4835
  checked: selected
4813
4836
  },
4814
4837
  style: style,
4838
+ flexGrow: shouldExpand ? 1 : undefined,
4839
+ flexShrink: shouldExpand ? 1 : undefined,
4815
4840
  onBlur: onBlur,
4816
4841
  onFocus: onFocus,
4817
4842
  onPress: function (e) {
@@ -4830,6 +4855,8 @@ function ChoiceItem(_ref) {
4830
4855
  });
4831
4856
  return /*#__PURE__*/jsxs(VStack, {
4832
4857
  space: "kitt.2",
4858
+ flexGrow: shouldExpand ? 1 : undefined,
4859
+ flexShrink: shouldExpand ? 1 : undefined,
4833
4860
  children: [/*#__PURE__*/jsxs(AnimatedChoiceItemView, {
4834
4861
  animatedStyles: backgroundStyles,
4835
4862
  isHovered: isHovered || isHoveredInternal,
@@ -4837,10 +4864,13 @@ function ChoiceItem(_ref) {
4837
4864
  isSelected: selected,
4838
4865
  isPressed: isPressed || isPressedInternal,
4839
4866
  hasError: hasError,
4867
+ shouldExpand: shouldExpand,
4840
4868
  size: size,
4841
4869
  children: [/*#__PURE__*/jsxs(Stack, {
4842
4870
  alignItems: "center",
4843
4871
  space: "kitt.2",
4872
+ flexGrow: shouldExpand ? 1 : undefined,
4873
+ flexShrink: shouldExpand ? 1 : undefined,
4844
4874
  children: [icon ? /*#__PURE__*/jsx(TypographyIcon, {
4845
4875
  color: textColor,
4846
4876
  icon: icon
@@ -4869,33 +4899,43 @@ function ChoiceItem(_ref) {
4869
4899
  function ChoiceItemContainer(_ref) {
4870
4900
  var children = _ref.children,
4871
4901
  direction = _ref.direction,
4902
+ shouldExpand = _ref.shouldExpand,
4872
4903
  isLast = _ref.isLast;
4873
4904
  var currentItemMarginValue = isLast ? undefined : 'kitt.3';
4874
- var flexProps = direction === 'row' ? {
4905
+ var directionFlexProps = direction === 'row' ? {
4875
4906
  flexGrow: 1,
4876
4907
  flexShrink: 1,
4877
4908
  flexBasis: 0
4878
4909
  } : {};
4879
- return /*#__PURE__*/jsx(View, _objectSpread(_objectSpread({
4910
+ var shouldExpandFlexProps = shouldExpand ? {
4911
+ flexGrow: 1,
4912
+ flexShrink: 1
4913
+ } : {};
4914
+ return /*#__PURE__*/jsx(View, _objectSpread(_objectSpread(_objectSpread({
4880
4915
  marginRight: direction === 'row' ? currentItemMarginValue : undefined,
4881
4916
  marginBottom: direction === 'column' ? currentItemMarginValue : undefined
4882
- }, flexProps), {}, {
4917
+ }, directionFlexProps), shouldExpandFlexProps), {}, {
4883
4918
  children: children
4884
4919
  }));
4885
4920
  }
4886
4921
 
4887
- var _excluded$D = ["direction", "contentContainerStyle"];
4922
+ var _excluded$D = ["direction", "shouldExpand", "contentContainerStyle"];
4888
4923
  function ChoicesContainer(_ref) {
4889
4924
  var direction = _ref.direction,
4925
+ shouldExpand = _ref.shouldExpand,
4890
4926
  contentContainerStyle = _ref.contentContainerStyle,
4891
4927
  props = _objectWithoutProperties(_ref, _excluded$D);
4928
+ var shouldExpandFlexProps = shouldExpand ? {
4929
+ flexGrow: 1,
4930
+ flexShrink: 1
4931
+ } : {};
4892
4932
  if (direction === 'row') {
4893
- return /*#__PURE__*/jsx(ScrollView$2, _objectSpread({
4933
+ return /*#__PURE__*/jsx(ScrollView, _objectSpread(_objectSpread({
4894
4934
  horizontal: true,
4895
- contentContainerStyle: contentContainerStyle
4896
- }, props));
4935
+ contentContainerStyle: shouldExpand ? shouldExpandFlexProps : contentContainerStyle
4936
+ }, props), shouldExpandFlexProps));
4897
4937
  }
4898
- return /*#__PURE__*/jsx(View$2, _objectSpread({}, props));
4938
+ return /*#__PURE__*/jsx(View, _objectSpread(_objectSpread({}, props), shouldExpandFlexProps));
4899
4939
  }
4900
4940
 
4901
4941
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -4907,6 +4947,8 @@ function Choices(_ref2) {
4907
4947
  _ref2$direction = _ref2.direction,
4908
4948
  direction = _ref2$direction === void 0 ? 'column' : _ref2$direction,
4909
4949
  disabled = _ref2.disabled,
4950
+ _ref2$shouldExpand = _ref2.shouldExpand,
4951
+ shouldExpand = _ref2$shouldExpand === void 0 ? false : _ref2$shouldExpand,
4910
4952
  children = _ref2.children,
4911
4953
  value = _ref2.value,
4912
4954
  onPress = _ref2.onPress,
@@ -4925,6 +4967,7 @@ function Choices(_ref2) {
4925
4967
  var sharedProps = {
4926
4968
  type: type,
4927
4969
  disabled: disabled,
4970
+ shouldExpand: shouldExpand,
4928
4971
  onPress: !isForm ? onPress : undefined,
4929
4972
  onChange: isForm ? function (newValue) {
4930
4973
  setCurrentValue(newValue);
@@ -4936,6 +4979,7 @@ function Choices(_ref2) {
4936
4979
  };
4937
4980
  return /*#__PURE__*/jsx(ChoicesContainer, {
4938
4981
  direction: direction,
4982
+ shouldExpand: shouldExpand,
4939
4983
  testID: testID,
4940
4984
  id: id,
4941
4985
  style: style,
@@ -4946,6 +4990,7 @@ function Choices(_ref2) {
4946
4990
  }, sharedProps));
4947
4991
  return /*#__PURE__*/jsx(ChoiceItemContainer, {
4948
4992
  direction: direction,
4993
+ shouldExpand: shouldExpand,
4949
4994
  isLast: index === childrenArray.length - 1,
4950
4995
  children: element
4951
4996
  }, child.key);