@ornikar/kitt-universal 25.53.0 → 25.54.1-canary.111977bfdb623207808928fa770ffbe060b3b380.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 (59) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/definitions/Actions/ActionsItem.d.ts.map +1 -1
  3. package/dist/definitions/Button/Button.d.ts +2 -0
  4. package/dist/definitions/Button/Button.d.ts.map +1 -1
  5. package/dist/definitions/Button/ButtonContent.d.ts +1 -1
  6. package/dist/definitions/Button/ButtonContent.d.ts.map +1 -1
  7. package/dist/definitions/ButtonBadge/ButtonBadge.d.ts +7 -0
  8. package/dist/definitions/ButtonBadge/ButtonBadge.d.ts.map +1 -0
  9. package/dist/definitions/CardModal/CardModal.d.ts +3 -0
  10. package/dist/definitions/CardModal/CardModal.d.ts.map +1 -1
  11. package/dist/definitions/FullscreenModal/Body.d.ts.map +1 -1
  12. package/dist/definitions/FullscreenModal/FullscreenModal.d.ts +17 -3
  13. package/dist/definitions/FullscreenModal/FullscreenModal.d.ts.map +1 -1
  14. package/dist/definitions/IconButton/IconButton.d.ts +2 -2
  15. package/dist/definitions/IconButton/IconButton.d.ts.map +1 -1
  16. package/dist/definitions/NavigationModal/NavigationModal.d.ts +2 -3
  17. package/dist/definitions/NavigationModal/NavigationModal.d.ts.map +1 -1
  18. package/dist/definitions/index.d.ts +2 -0
  19. package/dist/definitions/index.d.ts.map +1 -1
  20. package/dist/definitions/native-base/KittNativeBaseProvider.d.ts +21 -0
  21. package/dist/definitions/native-base/KittNativeBaseProvider.d.ts.map +1 -1
  22. package/dist/definitions/themes/default.d.ts +1 -0
  23. package/dist/definitions/themes/default.d.ts.map +1 -1
  24. package/dist/definitions/themes/late-ocean/buttonBadge.d.ts +21 -0
  25. package/dist/definitions/themes/late-ocean/buttonBadge.d.ts.map +1 -0
  26. package/dist/index-metro.es.android.js +124 -48
  27. package/dist/index-metro.es.android.js.map +1 -1
  28. package/dist/index-metro.es.ios.js +124 -48
  29. package/dist/index-metro.es.ios.js.map +1 -1
  30. package/dist/index-node-20.10.cjs.js +121 -45
  31. package/dist/index-node-20.10.cjs.js.map +1 -1
  32. package/dist/index-node-20.10.cjs.web.js +121 -45
  33. package/dist/index-node-20.10.cjs.web.js.map +1 -1
  34. package/dist/index-node-20.10.es.mjs +121 -46
  35. package/dist/index-node-20.10.es.mjs.map +1 -1
  36. package/dist/index-node-20.10.es.web.mjs +121 -46
  37. package/dist/index-node-20.10.es.web.mjs.map +1 -1
  38. package/dist/index.es.js +133 -58
  39. package/dist/index.es.js.map +1 -1
  40. package/dist/index.es.web.js +133 -58
  41. package/dist/index.es.web.js.map +1 -1
  42. package/dist/linaria-themes-metro.es.android.js +19 -0
  43. package/dist/linaria-themes-metro.es.android.js.map +1 -1
  44. package/dist/linaria-themes-metro.es.ios.js +19 -0
  45. package/dist/linaria-themes-metro.es.ios.js.map +1 -1
  46. package/dist/linaria-themes-node-20.10.cjs.js +19 -0
  47. package/dist/linaria-themes-node-20.10.cjs.js.map +1 -1
  48. package/dist/linaria-themes-node-20.10.cjs.web.js +19 -0
  49. package/dist/linaria-themes-node-20.10.cjs.web.js.map +1 -1
  50. package/dist/linaria-themes-node-20.10.es.mjs +19 -0
  51. package/dist/linaria-themes-node-20.10.es.mjs.map +1 -1
  52. package/dist/linaria-themes-node-20.10.es.web.mjs +19 -0
  53. package/dist/linaria-themes-node-20.10.es.web.mjs.map +1 -1
  54. package/dist/linaria-themes.es.js +19 -0
  55. package/dist/linaria-themes.es.js.map +1 -1
  56. package/dist/linaria-themes.es.web.js +19 -0
  57. package/dist/linaria-themes.es.web.js.map +1 -1
  58. package/dist/tsbuildinfo +1 -1
  59. package/package.json +1 -1
package/dist/index.es.js CHANGED
@@ -802,6 +802,24 @@ var button = {
802
802
  }
803
803
  };
804
804
 
805
+ var buttonBadge = {
806
+ backgroundColor: lateOceanColorPalette['coral.10'],
807
+ dimensions: {
808
+ withBadge: {
809
+ width: 10,
810
+ height: 10
811
+ },
812
+ badgeCount: {
813
+ width: 20,
814
+ height: 20
815
+ }
816
+ },
817
+ borderRadius: {
818
+ withBadge: 5,
819
+ badgeCount: 10
820
+ }
821
+ };
822
+
805
823
  var card = {
806
824
  borderRadius: 20,
807
825
  borderWidth: 2,
@@ -2525,6 +2543,7 @@ var theme = {
2525
2543
  forms: forms,
2526
2544
  highlight: highlight,
2527
2545
  icon: icon,
2546
+ buttonBadge: buttonBadge,
2528
2547
  iconButton: iconButton,
2529
2548
  listItem: listItem,
2530
2549
  pageLoader: pageLoader,
@@ -3100,6 +3119,36 @@ Typography.h4 = createHeading(4, 'header4');
3100
3119
  /** @deprecated use Typography.Header6 */
3101
3120
  Typography.h5 = createHeading(5, 'header5');
3102
3121
 
3122
+ function ButtonBadge(_ref) {
3123
+ var withBadge = _ref.withBadge,
3124
+ badgeCount = _ref.badgeCount;
3125
+ if (withBadge) {
3126
+ return /*#__PURE__*/jsx(View, {
3127
+ height: "kitt.buttonBadge.dimensions.withBadge.height",
3128
+ width: "kitt.buttonBadge.dimensions.withBadge.width",
3129
+ backgroundColor: "kitt.buttonBadge.backgroundColor",
3130
+ borderRadius: "kitt.buttonBadge.borderRadius.withBadge"
3131
+ });
3132
+ }
3133
+ if (badgeCount && badgeCount > 0) {
3134
+ return /*#__PURE__*/jsx(VStack, {
3135
+ alignItems: "center",
3136
+ justifyContent: "center",
3137
+ height: "kitt.buttonBadge.dimensions.badgeCount.height",
3138
+ width: "kitt.buttonBadge.dimensions.badgeCount.width",
3139
+ backgroundColor: "kitt.buttonBadge.backgroundColor",
3140
+ borderRadius: "kitt.buttonBadge.borderRadius.badgeCount",
3141
+ children: /*#__PURE__*/jsx(Typography.Text, {
3142
+ base: "body-xs",
3143
+ variant: "bold",
3144
+ color: "white",
3145
+ children: (badgeCount || 0) > 5 ? '+5' : badgeCount
3146
+ })
3147
+ });
3148
+ }
3149
+ return null;
3150
+ }
3151
+
3103
3152
  function Icon(_ref) {
3104
3153
  var icon = _ref.icon,
3105
3154
  _ref$size = _ref.size,
@@ -3218,6 +3267,8 @@ function ButtonContentChildren(_ref2) {
3218
3267
  icon = _ref2.icon,
3219
3268
  iconPosition = _ref2.iconPosition,
3220
3269
  innerSpacing = _ref2.innerSpacing,
3270
+ withBadge = _ref2.withBadge,
3271
+ badgeCount = _ref2.badgeCount,
3221
3272
  color = _ref2.color,
3222
3273
  children = _ref2.children;
3223
3274
  if ((process.env.NODE_ENV !== "production")) {
@@ -3261,7 +3312,13 @@ function ButtonContentChildren(_ref2) {
3261
3312
  children: children
3262
3313
  }), icon && iconPosition === 'right' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread(_objectSpread({}, buttonIconSharedProps), {}, {
3263
3314
  icon: icon
3264
- })) : null]
3315
+ })) : null, withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsx(View, {
3316
+ marginLeft: "kitt.2",
3317
+ children: /*#__PURE__*/jsx(ButtonBadge, {
3318
+ withBadge: withBadge,
3319
+ badgeCount: badgeCount
3320
+ })
3321
+ }) : null]
3265
3322
  });
3266
3323
  }
3267
3324
  function ButtonContent(_ref3) {
@@ -3435,6 +3492,8 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
3435
3492
  testID = _ref.testID,
3436
3493
  href = _ref.href,
3437
3494
  hrefAttrs = _ref.hrefAttrs,
3495
+ withBadge = _ref.withBadge,
3496
+ badgeCount = _ref.badgeCount,
3438
3497
  _ref$accessibilityRol = _ref.accessibilityRole,
3439
3498
  accessibilityRole = _ref$accessibilityRol === void 0 ? 'button' : _ref$accessibilityRol,
3440
3499
  _ref$innerSpacing = _ref.innerSpacing,
@@ -3506,6 +3565,8 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
3506
3565
  isDisabled: disabled,
3507
3566
  icon: icon,
3508
3567
  iconPosition: iconPosition,
3568
+ withBadge: withBadge,
3569
+ badgeCount: badgeCount,
3509
3570
  isHovered: isHovered,
3510
3571
  isPressed: isPressed,
3511
3572
  isFocused: isFocused,
@@ -3588,6 +3649,8 @@ var ActionsItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
3588
3649
  isLoading = _useState2[0],
3589
3650
  setIsLoading = _useState2[1];
3590
3651
  var mountedRef = useRef(false);
3652
+ // securing the loading state with a ref to avoid user action between rerenders
3653
+ var loadingRef = useRef(false);
3591
3654
 
3592
3655
  // effect just for tracking mounted state, as onPress can unmount the ActionButton
3593
3656
  useEffect(function () {
@@ -3609,34 +3672,37 @@ var ActionsItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
3609
3672
  return _regeneratorRuntime().wrap(function (_context) {
3610
3673
  while (1) switch (_context.prev = _context.next) {
3611
3674
  case 0:
3612
- if (onPress) {
3675
+ if (!(!onPress || loadingRef.current)) {
3613
3676
  _context.next = 2;
3614
3677
  break;
3615
3678
  }
3616
3679
  return _context.abrupt("return");
3617
3680
  case 2:
3618
3681
  setIsLoading(true);
3619
- _context.prev = 3;
3620
- _context.next = 6;
3682
+ loadingRef.current = true;
3683
+ _context.prev = 4;
3684
+ _context.next = 7;
3621
3685
  return onPress(e);
3622
- case 6:
3686
+ case 7:
3623
3687
  if (mountedRef.current) {
3624
3688
  setIsLoading(false);
3689
+ loadingRef.current = false;
3625
3690
  }
3626
- _context.next = 13;
3691
+ _context.next = 14;
3627
3692
  break;
3628
- case 9:
3629
- _context.prev = 9;
3630
- _context.t0 = _context["catch"](3);
3693
+ case 10:
3694
+ _context.prev = 10;
3695
+ _context.t0 = _context["catch"](4);
3631
3696
  if (mountedRef.current) {
3697
+ loadingRef.current = false;
3632
3698
  setIsLoading(false);
3633
3699
  }
3634
3700
  throw _context.t0;
3635
- case 13:
3701
+ case 14:
3636
3702
  case "end":
3637
3703
  return _context.stop();
3638
3704
  }
3639
- }, _callee, null, [[3, 9]]);
3705
+ }, _callee, null, [[4, 10]]);
3640
3706
  }));
3641
3707
  return function () {
3642
3708
  return _ref2.apply(this, arguments);
@@ -8027,7 +8093,10 @@ function FullscreenModalBody(_ref) {
8027
8093
  verticalPadding = _useTheme.kitt.fullscreenModal.body.verticalPadding;
8028
8094
  var paddingBottom = shouldHandleBottomNotch ? Math.max(bottom, verticalPadding) : verticalPadding;
8029
8095
  var paddingTop = shouldHandleTopNotch ? Math.max(top, verticalPadding) : verticalPadding;
8030
- return /*#__PURE__*/jsx(View, _objectSpread(_objectSpread({}, props), {}, {
8096
+ return /*#__PURE__*/jsx(View, _objectSpread(_objectSpread({
8097
+ flexGrow: 1,
8098
+ flexShrink: 1
8099
+ }, props), {}, {
8031
8100
  paddingX: "kitt.fullscreenModal.horizontalPadding",
8032
8101
  paddingTop: paddingTop,
8033
8102
  paddingBottom: paddingBottom,
@@ -8315,27 +8384,30 @@ function FullscreenModalHeader(_ref) {
8315
8384
  }
8316
8385
 
8317
8386
  function FullscreenModal(_ref) {
8318
- var body = _ref.body,
8387
+ var children = _ref.children,
8388
+ body = _ref.body,
8319
8389
  header = _ref.header,
8320
8390
  footer = _ref.footer,
8321
8391
  backgroundColor = _ref.backgroundColor;
8322
- return /*#__PURE__*/jsxs(FullscreenModalContainer, {
8392
+ return /*#__PURE__*/jsx(FullscreenModalContainer, {
8323
8393
  backgroundColor: backgroundColor,
8324
- children: [header ? /*#__PURE__*/jsx(View, {
8325
- children: header
8326
- }) : null, /*#__PURE__*/jsxs(View, {
8327
- flexGrow: 1,
8328
- flexShrink: 1,
8329
- justifyContent: "space-between",
8330
- children: [/*#__PURE__*/jsx(ScrollView$2, {
8331
- bounces: false,
8332
- contentContainerStyle: {
8333
- flexGrow: 1,
8334
- position: 'relative'
8335
- },
8336
- children: body
8337
- }), footer || null]
8338
- })]
8394
+ children: children || /*#__PURE__*/jsxs(Fragment, {
8395
+ children: [header ? /*#__PURE__*/jsx(View, {
8396
+ children: header
8397
+ }) : null, /*#__PURE__*/jsxs(View, {
8398
+ flexGrow: 1,
8399
+ flexShrink: 1,
8400
+ justifyContent: "space-between",
8401
+ children: [/*#__PURE__*/jsx(ScrollView$2, {
8402
+ bounces: false,
8403
+ contentContainerStyle: {
8404
+ flexGrow: 1,
8405
+ position: 'relative'
8406
+ },
8407
+ children: body
8408
+ }), footer || null]
8409
+ })]
8410
+ })
8339
8411
  });
8340
8412
  }
8341
8413
  FullscreenModal.Header = FullscreenModalHeader;
@@ -8746,7 +8818,7 @@ function IconButton(_ref) {
8746
8818
  _ref$accessibilityRol = _ref.accessibilityRole,
8747
8819
  accessibilityRole = _ref$accessibilityRol === void 0 ? 'button' : _ref$accessibilityRol,
8748
8820
  withBadge = _ref.withBadge,
8749
- bagdeCount = _ref.bagdeCount,
8821
+ badgeCount = _ref.badgeCount,
8750
8822
  isHoveredInternal = _ref.isHoveredInternal,
8751
8823
  isPressedInternal = _ref.isPressedInternal,
8752
8824
  isFocusedInternal = _ref.isFocusedInternal,
@@ -8806,32 +8878,13 @@ function IconButton(_ref) {
8806
8878
  icon: icon
8807
8879
  })
8808
8880
  })]
8809
- }), withBadge ? /*#__PURE__*/jsx(View, {
8810
- height: "10px",
8811
- width: "10px",
8812
- backgroundColor: lateOceanColorPalette['coral.10'],
8813
- borderRadius: "kitt.iconButton.borderRadius",
8814
- position: "absolute",
8815
- top: "1px",
8816
- right: "1px"
8817
- }) : null, !withBadge && bagdeCount && bagdeCount > 0 ? /*#__PURE__*/jsx(View, {
8818
- height: "20px",
8819
- width: "20px",
8820
- backgroundColor: lateOceanColorPalette['coral.10'],
8821
- borderRadius: "kitt.iconButton.borderRadius",
8881
+ }), withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsx(View, {
8822
8882
  position: "absolute",
8823
- top: "-6px",
8824
- right: "-6px",
8825
- children: /*#__PURE__*/jsx(View, {
8826
- alignItems: "center",
8827
- justifyContent: "center",
8828
- marginTop: "2px",
8829
- children: /*#__PURE__*/jsx(Typography.Text, {
8830
- base: "body-xs",
8831
- variant: "bold",
8832
- color: "white",
8833
- children: bagdeCount > 5 ? '+5' : bagdeCount
8834
- })
8883
+ top: withBadge ? '1px' : '-6px',
8884
+ right: withBadge ? '1px' : '-6px',
8885
+ children: /*#__PURE__*/jsx(ButtonBadge, {
8886
+ withBadge: withBadge,
8887
+ badgeCount: badgeCount
8835
8888
  })
8836
8889
  }) : null]
8837
8890
  });
@@ -9827,6 +9880,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
9827
9880
  backgroundColor: theme.skeleton.backgroundColor,
9828
9881
  flareColor: theme.skeleton.flareColor
9829
9882
  },
9883
+ buttonBadge: {
9884
+ backgroundColor: theme.buttonBadge.backgroundColor
9885
+ },
9830
9886
  iconButton: {
9831
9887
  borderColor: theme.iconButton.borderColor,
9832
9888
  disabled: {
@@ -10014,6 +10070,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
10014
10070
  button: {
10015
10071
  borderRadius: theme.button.borderRadius
10016
10072
  },
10073
+ buttonBadge: {
10074
+ borderRadius: theme.buttonBadge.borderRadius
10075
+ },
10017
10076
  card: {
10018
10077
  borderRadius: theme.card.borderRadius
10019
10078
  },
@@ -10390,6 +10449,18 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
10390
10449
  maxWidth: theme.button.maxWidth,
10391
10450
  minHeight: theme.button.minHeight
10392
10451
  },
10452
+ buttonBadge: {
10453
+ dimensions: {
10454
+ withBadge: {
10455
+ width: theme.buttonBadge.dimensions.withBadge.width,
10456
+ height: theme.buttonBadge.dimensions.withBadge.height
10457
+ },
10458
+ badgeCount: {
10459
+ width: theme.buttonBadge.dimensions.badgeCount.width,
10460
+ height: theme.buttonBadge.dimensions.badgeCount.height
10461
+ }
10462
+ }
10463
+ },
10393
10464
  icon: theme.icon,
10394
10465
  cardModal: {
10395
10466
  header: {
@@ -11800,12 +11871,16 @@ function NavigationModal(_ref) {
11800
11871
  var body = _ref.body,
11801
11872
  backgroundColor = _ref.backgroundColor,
11802
11873
  footer = _ref.footer,
11803
- header = _ref.header;
11874
+ header = _ref.header,
11875
+ children = _ref.children;
11804
11876
  var Component = useBreakpointValue({
11805
11877
  base: FullscreenModal,
11806
11878
  small: CardModal
11807
11879
  });
11808
- return /*#__PURE__*/jsx(Component, {
11880
+ return children ? /*#__PURE__*/jsx(Component, {
11881
+ backgroundColor: backgroundColor,
11882
+ children: children
11883
+ }) : /*#__PURE__*/jsx(Component, {
11809
11884
  body: body,
11810
11885
  backgroundColor: backgroundColor,
11811
11886
  footer: footer,
@@ -14234,5 +14309,5 @@ function VerticalSteps(_ref) {
14234
14309
  VerticalSteps.Step = Step;
14235
14310
  VerticalSteps.BorderlessStep = BorderlessStep;
14236
14311
 
14237
- export { ActionCard, Actions, Autocomplete, Avatar, BottomSheet, Button, CardModal, Center, Checkbox, ChoicesElements, CloseIconButton, DatePicker, DialogModal, DocumentPicker, Emoji, ExternalAppLink, ExternalLink, FilePicker, FlatList, Flex, FullscreenModal, GoogleMapsApiKeyProvider, GoogleMapsAutocompleteProvider, GroupTags, HStack, Highlight, Icon, IconButton, Image, ImagePicker, InfoCard, InputAddress, InputEmail, InputFeedback, InputField, InputIban, InputIcon, InputNumber, InputPassword, InputPhone, InputPressable, InputTag, InputText, KittBreakpointNameEnum, KittBreakpoints, KittBreakpointsMax, KittMapConfigProvider, KittNativeBaseProvider, KittThemeDecorator, KittThemeProvider, Label, ListItem, LoaderIcon, MapMarker, MapMarkerVariantEnum, MatchWindowSize, Message, ModalBehaviour, FlatList as NativeOnlyFlatList, NavigationModal, Notification, Overlay, PageLoader, Picker, Pressable, RadioWithRef as Radio, RadioButtonGroup, ScrollView, DeprecatedSection as Section, SectionList, SegmentedProgressBar, Skeleton, SpinningIcon, Stack, StaticMap, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, StyleWebWrapper, SwitchBreakpoints, TabBar, Tag, TextArea, TimePicker, ToastComponent, Toggle, Tooltip, Typography, TypographyEmoji, TypographyIcon, TypographyLink, VStack, VerticalSteps, View, createChoicesComponent, createResponsiveStyleFromProp, getStaticMapImageUrl, getValueForBreakpoint, hex2rgba, matchWindowSize, storyPadding, theme, useBottomSheet, useBreakpointValue, useCurrentBreakpointName, useGetStaticMapImageUrl, useKittMapConfig, useKittTheme, useMatchWindowSize, useOpenExternalLink, useStaticBottomSheet, useStoryBlockColor, useTheme };
14312
+ export { ActionCard, Actions, Autocomplete, Avatar, BottomSheet, Button, ButtonBadge, CardModal, Center, Checkbox, ChoicesElements, CloseIconButton, DatePicker, DialogModal, DocumentPicker, Emoji, ExternalAppLink, ExternalLink, FilePicker, FlatList, Flex, FullscreenModal, GoogleMapsApiKeyProvider, GoogleMapsAutocompleteProvider, GroupTags, HStack, Highlight, Icon, IconButton, Image, ImagePicker, InfoCard, InputAddress, InputEmail, InputFeedback, InputField, InputIban, InputIcon, InputNumber, InputPassword, InputPhone, InputPressable, InputTag, InputText, KittBreakpointNameEnum, KittBreakpoints, KittBreakpointsMax, KittMapConfigProvider, KittNativeBaseProvider, KittThemeDecorator, KittThemeProvider, Label, ListItem, LoaderIcon, MapMarker, MapMarkerVariantEnum, MatchWindowSize, Message, ModalBehaviour, FlatList as NativeOnlyFlatList, NavigationModal, Notification, Overlay, PageLoader, Picker, Pressable, RadioWithRef as Radio, RadioButtonGroup, ScrollView, DeprecatedSection as Section, SectionList, SegmentedProgressBar, Skeleton, SpinningIcon, Stack, StaticMap, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, StyleWebWrapper, SwitchBreakpoints, TabBar, Tag, TextArea, TimePicker, ToastComponent, Toggle, Tooltip, Typography, TypographyEmoji, TypographyIcon, TypographyLink, VStack, VerticalSteps, View, createChoicesComponent, createResponsiveStyleFromProp, getStaticMapImageUrl, getValueForBreakpoint, hex2rgba, matchWindowSize, storyPadding, theme, useBottomSheet, useBreakpointValue, useCurrentBreakpointName, useGetStaticMapImageUrl, useKittMapConfig, useKittTheme, useMatchWindowSize, useOpenExternalLink, useStaticBottomSheet, useStoryBlockColor, useTheme };
14238
14313
  //# sourceMappingURL=index.es.js.map