@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
@@ -798,6 +798,24 @@ var button = {
798
798
  }
799
799
  };
800
800
 
801
+ var buttonBadge = {
802
+ backgroundColor: lateOceanColorPalette['coral.10'],
803
+ dimensions: {
804
+ withBadge: {
805
+ width: 10,
806
+ height: 10
807
+ },
808
+ badgeCount: {
809
+ width: 20,
810
+ height: 20
811
+ }
812
+ },
813
+ borderRadius: {
814
+ withBadge: 5,
815
+ badgeCount: 10
816
+ }
817
+ };
818
+
801
819
  var card = {
802
820
  borderRadius: 20,
803
821
  borderWidth: 2,
@@ -2521,6 +2539,7 @@ var theme = {
2521
2539
  forms: forms,
2522
2540
  highlight: highlight,
2523
2541
  icon: icon,
2542
+ buttonBadge: buttonBadge,
2524
2543
  iconButton: iconButton,
2525
2544
  listItem: listItem,
2526
2545
  pageLoader: pageLoader,
@@ -3137,6 +3156,36 @@ Typography.h4 = createHeading(4, 'header4');
3137
3156
  /** @deprecated use Typography.Header6 */
3138
3157
  Typography.h5 = createHeading(5, 'header5');
3139
3158
 
3159
+ function ButtonBadge(_ref) {
3160
+ var withBadge = _ref.withBadge,
3161
+ badgeCount = _ref.badgeCount;
3162
+ if (withBadge) {
3163
+ return /*#__PURE__*/jsx(View, {
3164
+ height: "kitt.buttonBadge.dimensions.withBadge.height",
3165
+ width: "kitt.buttonBadge.dimensions.withBadge.width",
3166
+ backgroundColor: "kitt.buttonBadge.backgroundColor",
3167
+ borderRadius: "kitt.buttonBadge.borderRadius.withBadge"
3168
+ });
3169
+ }
3170
+ if (badgeCount && badgeCount > 0) {
3171
+ return /*#__PURE__*/jsx(VStack, {
3172
+ alignItems: "center",
3173
+ justifyContent: "center",
3174
+ height: "kitt.buttonBadge.dimensions.badgeCount.height",
3175
+ width: "kitt.buttonBadge.dimensions.badgeCount.width",
3176
+ backgroundColor: "kitt.buttonBadge.backgroundColor",
3177
+ borderRadius: "kitt.buttonBadge.borderRadius.badgeCount",
3178
+ children: /*#__PURE__*/jsx(Typography.Text, {
3179
+ base: "body-xs",
3180
+ variant: "bold",
3181
+ color: "white",
3182
+ children: (badgeCount || 0) > 5 ? '+5' : badgeCount
3183
+ })
3184
+ });
3185
+ }
3186
+ return null;
3187
+ }
3188
+
3140
3189
  function Icon(_ref) {
3141
3190
  var icon = _ref.icon,
3142
3191
  _ref$size = _ref.size,
@@ -3255,6 +3304,8 @@ function ButtonContentChildren(_ref2) {
3255
3304
  icon = _ref2.icon,
3256
3305
  iconPosition = _ref2.iconPosition,
3257
3306
  innerSpacing = _ref2.innerSpacing,
3307
+ withBadge = _ref2.withBadge,
3308
+ badgeCount = _ref2.badgeCount,
3258
3309
  color = _ref2.color,
3259
3310
  children = _ref2.children;
3260
3311
  if ((process.env.NODE_ENV !== "production")) {
@@ -3298,7 +3349,13 @@ function ButtonContentChildren(_ref2) {
3298
3349
  children: children
3299
3350
  }), icon && iconPosition === 'right' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread(_objectSpread({}, buttonIconSharedProps), {}, {
3300
3351
  icon: icon
3301
- })) : null]
3352
+ })) : null, withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsx(View, {
3353
+ marginLeft: "kitt.2",
3354
+ children: /*#__PURE__*/jsx(ButtonBadge, {
3355
+ withBadge: withBadge,
3356
+ badgeCount: badgeCount
3357
+ })
3358
+ }) : null]
3302
3359
  });
3303
3360
  }
3304
3361
  function ButtonContent(_ref3) {
@@ -3437,6 +3494,8 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
3437
3494
  testID = _ref.testID,
3438
3495
  href = _ref.href,
3439
3496
  hrefAttrs = _ref.hrefAttrs,
3497
+ withBadge = _ref.withBadge,
3498
+ badgeCount = _ref.badgeCount,
3440
3499
  _ref$accessibilityRol = _ref.accessibilityRole,
3441
3500
  accessibilityRole = _ref$accessibilityRol === void 0 ? 'button' : _ref$accessibilityRol,
3442
3501
  _ref$innerSpacing = _ref.innerSpacing,
@@ -3505,6 +3564,8 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
3505
3564
  isDisabled: disabled,
3506
3565
  icon: icon,
3507
3566
  iconPosition: iconPosition,
3567
+ withBadge: withBadge,
3568
+ badgeCount: badgeCount,
3508
3569
  isHovered: isHovered,
3509
3570
  isPressed: isPressed,
3510
3571
  isFocused: isFocused,
@@ -3561,6 +3622,8 @@ var ActionsItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
3561
3622
  isLoading = _useState2[0],
3562
3623
  setIsLoading = _useState2[1];
3563
3624
  var mountedRef = useRef(false);
3625
+ // securing the loading state with a ref to avoid user action between rerenders
3626
+ var loadingRef = useRef(false);
3564
3627
 
3565
3628
  // effect just for tracking mounted state, as onPress can unmount the ActionButton
3566
3629
  useEffect(function () {
@@ -3582,34 +3645,37 @@ var ActionsItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
3582
3645
  return _regeneratorRuntime().wrap(function (_context) {
3583
3646
  while (1) switch (_context.prev = _context.next) {
3584
3647
  case 0:
3585
- if (onPress) {
3648
+ if (!(!onPress || loadingRef.current)) {
3586
3649
  _context.next = 2;
3587
3650
  break;
3588
3651
  }
3589
3652
  return _context.abrupt("return");
3590
3653
  case 2:
3591
3654
  setIsLoading(true);
3592
- _context.prev = 3;
3593
- _context.next = 6;
3655
+ loadingRef.current = true;
3656
+ _context.prev = 4;
3657
+ _context.next = 7;
3594
3658
  return onPress(e);
3595
- case 6:
3659
+ case 7:
3596
3660
  if (mountedRef.current) {
3597
3661
  setIsLoading(false);
3662
+ loadingRef.current = false;
3598
3663
  }
3599
- _context.next = 13;
3664
+ _context.next = 14;
3600
3665
  break;
3601
- case 9:
3602
- _context.prev = 9;
3603
- _context.t0 = _context["catch"](3);
3666
+ case 10:
3667
+ _context.prev = 10;
3668
+ _context.t0 = _context["catch"](4);
3604
3669
  if (mountedRef.current) {
3670
+ loadingRef.current = false;
3605
3671
  setIsLoading(false);
3606
3672
  }
3607
3673
  throw _context.t0;
3608
- case 13:
3674
+ case 14:
3609
3675
  case "end":
3610
3676
  return _context.stop();
3611
3677
  }
3612
- }, _callee, null, [[3, 9]]);
3678
+ }, _callee, null, [[4, 10]]);
3613
3679
  }));
3614
3680
  return function () {
3615
3681
  return _ref2.apply(this, arguments);
@@ -7187,7 +7253,10 @@ function FullscreenModalBody(_ref) {
7187
7253
  verticalPadding = _useTheme.kitt.fullscreenModal.body.verticalPadding;
7188
7254
  var paddingBottom = shouldHandleBottomNotch ? Math.max(bottom, verticalPadding) : verticalPadding;
7189
7255
  var paddingTop = shouldHandleTopNotch ? Math.max(top, verticalPadding) : verticalPadding;
7190
- return /*#__PURE__*/jsx(View, _objectSpread(_objectSpread({}, props), {}, {
7256
+ return /*#__PURE__*/jsx(View, _objectSpread(_objectSpread({
7257
+ flexGrow: 1,
7258
+ flexShrink: 1
7259
+ }, props), {}, {
7191
7260
  paddingX: "kitt.fullscreenModal.horizontalPadding",
7192
7261
  paddingTop: paddingTop,
7193
7262
  paddingBottom: paddingBottom,
@@ -7400,27 +7469,30 @@ function FullscreenModalHeader(_ref) {
7400
7469
  }
7401
7470
 
7402
7471
  function FullscreenModal(_ref) {
7403
- var body = _ref.body,
7472
+ var children = _ref.children,
7473
+ body = _ref.body,
7404
7474
  header = _ref.header,
7405
7475
  footer = _ref.footer,
7406
7476
  backgroundColor = _ref.backgroundColor;
7407
- return /*#__PURE__*/jsxs(FullscreenModalContainer, {
7477
+ return /*#__PURE__*/jsx(FullscreenModalContainer, {
7408
7478
  backgroundColor: backgroundColor,
7409
- children: [header ? /*#__PURE__*/jsx(View, {
7410
- children: header
7411
- }) : null, /*#__PURE__*/jsxs(View, {
7412
- flexGrow: 1,
7413
- flexShrink: 1,
7414
- justifyContent: "space-between",
7415
- children: [/*#__PURE__*/jsx(ScrollView$2, {
7416
- bounces: false,
7417
- contentContainerStyle: {
7418
- flexGrow: 1,
7419
- position: 'relative'
7420
- },
7421
- children: body
7422
- }), footer || null]
7423
- })]
7479
+ children: children || /*#__PURE__*/jsxs(Fragment, {
7480
+ children: [header ? /*#__PURE__*/jsx(View, {
7481
+ children: header
7482
+ }) : null, /*#__PURE__*/jsxs(View, {
7483
+ flexGrow: 1,
7484
+ flexShrink: 1,
7485
+ justifyContent: "space-between",
7486
+ children: [/*#__PURE__*/jsx(ScrollView$2, {
7487
+ bounces: false,
7488
+ contentContainerStyle: {
7489
+ flexGrow: 1,
7490
+ position: 'relative'
7491
+ },
7492
+ children: body
7493
+ }), footer || null]
7494
+ })]
7495
+ })
7424
7496
  });
7425
7497
  }
7426
7498
  FullscreenModal.Header = FullscreenModalHeader;
@@ -7813,7 +7885,7 @@ function IconButton(_ref) {
7813
7885
  _ref$accessibilityRol = _ref.accessibilityRole,
7814
7886
  accessibilityRole = _ref$accessibilityRol === void 0 ? 'button' : _ref$accessibilityRol,
7815
7887
  withBadge = _ref.withBadge,
7816
- bagdeCount = _ref.bagdeCount,
7888
+ badgeCount = _ref.badgeCount,
7817
7889
  isHoveredInternal = _ref.isHoveredInternal,
7818
7890
  isPressedInternal = _ref.isPressedInternal,
7819
7891
  isFocusedInternal = _ref.isFocusedInternal,
@@ -7870,32 +7942,13 @@ function IconButton(_ref) {
7870
7942
  icon: icon
7871
7943
  })
7872
7944
  })]
7873
- }), withBadge ? /*#__PURE__*/jsx(View, {
7874
- height: "10px",
7875
- width: "10px",
7876
- backgroundColor: lateOceanColorPalette['coral.10'],
7877
- borderRadius: "kitt.iconButton.borderRadius",
7945
+ }), withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsx(View, {
7878
7946
  position: "absolute",
7879
- top: "1px",
7880
- right: "1px"
7881
- }) : null, !withBadge && bagdeCount && bagdeCount > 0 ? /*#__PURE__*/jsx(View, {
7882
- height: "20px",
7883
- width: "20px",
7884
- backgroundColor: lateOceanColorPalette['coral.10'],
7885
- borderRadius: "kitt.iconButton.borderRadius",
7886
- position: "absolute",
7887
- top: "-6px",
7888
- right: "-6px",
7889
- children: /*#__PURE__*/jsx(View, {
7890
- alignItems: "center",
7891
- justifyContent: "center",
7892
- marginTop: "2px",
7893
- children: /*#__PURE__*/jsx(Typography.Text, {
7894
- base: "body-xs",
7895
- variant: "bold",
7896
- color: "white",
7897
- children: bagdeCount > 5 ? '+5' : bagdeCount
7898
- })
7947
+ top: withBadge ? '1px' : '-6px',
7948
+ right: withBadge ? '1px' : '-6px',
7949
+ children: /*#__PURE__*/jsx(ButtonBadge, {
7950
+ withBadge: withBadge,
7951
+ badgeCount: badgeCount
7899
7952
  })
7900
7953
  }) : null]
7901
7954
  });
@@ -8974,6 +9027,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
8974
9027
  backgroundColor: theme.skeleton.backgroundColor,
8975
9028
  flareColor: theme.skeleton.flareColor
8976
9029
  },
9030
+ buttonBadge: {
9031
+ backgroundColor: theme.buttonBadge.backgroundColor
9032
+ },
8977
9033
  iconButton: {
8978
9034
  borderColor: theme.iconButton.borderColor,
8979
9035
  disabled: {
@@ -9161,6 +9217,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
9161
9217
  button: {
9162
9218
  borderRadius: theme.button.borderRadius
9163
9219
  },
9220
+ buttonBadge: {
9221
+ borderRadius: theme.buttonBadge.borderRadius
9222
+ },
9164
9223
  card: {
9165
9224
  borderRadius: theme.card.borderRadius
9166
9225
  },
@@ -9537,6 +9596,18 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
9537
9596
  maxWidth: theme.button.maxWidth,
9538
9597
  minHeight: theme.button.minHeight
9539
9598
  },
9599
+ buttonBadge: {
9600
+ dimensions: {
9601
+ withBadge: {
9602
+ width: theme.buttonBadge.dimensions.withBadge.width,
9603
+ height: theme.buttonBadge.dimensions.withBadge.height
9604
+ },
9605
+ badgeCount: {
9606
+ width: theme.buttonBadge.dimensions.badgeCount.width,
9607
+ height: theme.buttonBadge.dimensions.badgeCount.height
9608
+ }
9609
+ }
9610
+ },
9540
9611
  icon: theme.icon,
9541
9612
  cardModal: {
9542
9613
  header: {
@@ -10992,12 +11063,16 @@ function NavigationModal(_ref) {
10992
11063
  var body = _ref.body,
10993
11064
  backgroundColor = _ref.backgroundColor,
10994
11065
  footer = _ref.footer,
10995
- header = _ref.header;
11066
+ header = _ref.header,
11067
+ children = _ref.children;
10996
11068
  var Component = useBreakpointValue({
10997
11069
  base: FullscreenModal,
10998
11070
  small: CardModal
10999
11071
  });
11000
- return /*#__PURE__*/jsx(Component, {
11072
+ return children ? /*#__PURE__*/jsx(Component, {
11073
+ backgroundColor: backgroundColor,
11074
+ children: children
11075
+ }) : /*#__PURE__*/jsx(Component, {
11001
11076
  body: body,
11002
11077
  backgroundColor: backgroundColor,
11003
11078
  footer: footer,
@@ -13252,5 +13327,5 @@ function VerticalSteps(_ref) {
13252
13327
  VerticalSteps.Step = Step;
13253
13328
  VerticalSteps.BorderlessStep = BorderlessStep;
13254
13329
 
13255
- 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, 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 };
13330
+ 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, 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 };
13256
13331
  //# sourceMappingURL=index.es.web.js.map