@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
@@ -784,6 +784,24 @@ const button = {
784
784
  }
785
785
  };
786
786
 
787
+ const buttonBadge = {
788
+ backgroundColor: lateOceanColorPalette['coral.10'],
789
+ dimensions: {
790
+ withBadge: {
791
+ width: 10,
792
+ height: 10
793
+ },
794
+ badgeCount: {
795
+ width: 20,
796
+ height: 20
797
+ }
798
+ },
799
+ borderRadius: {
800
+ withBadge: 5,
801
+ badgeCount: 10
802
+ }
803
+ };
804
+
787
805
  const card = {
788
806
  borderRadius: 20,
789
807
  borderWidth: 2,
@@ -2499,6 +2517,7 @@ const theme = {
2499
2517
  forms,
2500
2518
  highlight,
2501
2519
  icon,
2520
+ buttonBadge,
2502
2521
  iconButton,
2503
2522
  listItem,
2504
2523
  pageLoader,
@@ -3063,6 +3082,37 @@ Typography.h4 = createHeading(4, 'header4');
3063
3082
  /** @deprecated use Typography.Header6 */
3064
3083
  Typography.h5 = createHeading(5, 'header5');
3065
3084
 
3085
+ function ButtonBadge({
3086
+ withBadge,
3087
+ badgeCount
3088
+ }) {
3089
+ if (withBadge) {
3090
+ return /*#__PURE__*/jsx(View, {
3091
+ height: "kitt.buttonBadge.dimensions.withBadge.height",
3092
+ width: "kitt.buttonBadge.dimensions.withBadge.width",
3093
+ backgroundColor: "kitt.buttonBadge.backgroundColor",
3094
+ borderRadius: "kitt.buttonBadge.borderRadius.withBadge"
3095
+ });
3096
+ }
3097
+ if (badgeCount && badgeCount > 0) {
3098
+ return /*#__PURE__*/jsx(VStack, {
3099
+ alignItems: "center",
3100
+ justifyContent: "center",
3101
+ height: "kitt.buttonBadge.dimensions.badgeCount.height",
3102
+ width: "kitt.buttonBadge.dimensions.badgeCount.width",
3103
+ backgroundColor: "kitt.buttonBadge.backgroundColor",
3104
+ borderRadius: "kitt.buttonBadge.borderRadius.badgeCount",
3105
+ children: /*#__PURE__*/jsx(Typography.Text, {
3106
+ base: "body-xs",
3107
+ variant: "bold",
3108
+ color: "white",
3109
+ children: (badgeCount || 0) > 5 ? '+5' : badgeCount
3110
+ })
3111
+ });
3112
+ }
3113
+ return null;
3114
+ }
3115
+
3066
3116
  function Icon({
3067
3117
  icon,
3068
3118
  size = 'kitt.icon.defaultSize',
@@ -3188,6 +3238,8 @@ function ButtonContentChildren({
3188
3238
  icon,
3189
3239
  iconPosition,
3190
3240
  innerSpacing,
3241
+ withBadge,
3242
+ badgeCount,
3191
3243
  color,
3192
3244
  children
3193
3245
  }) {
@@ -3234,6 +3286,12 @@ function ButtonContentChildren({
3234
3286
  }), icon && iconPosition === 'right' ? /*#__PURE__*/jsx(ButtonIcon, {
3235
3287
  ...buttonIconSharedProps,
3236
3288
  icon: icon
3289
+ }) : null, withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsx(View, {
3290
+ marginLeft: "kitt.2",
3291
+ children: /*#__PURE__*/jsx(ButtonBadge, {
3292
+ withBadge: withBadge,
3293
+ badgeCount: badgeCount
3294
+ })
3237
3295
  }) : null]
3238
3296
  });
3239
3297
  }
@@ -3417,6 +3475,8 @@ const Button = /*#__PURE__*/forwardRef(({
3417
3475
  testID,
3418
3476
  href,
3419
3477
  hrefAttrs,
3478
+ withBadge,
3479
+ badgeCount,
3420
3480
  accessibilityRole = 'button',
3421
3481
  innerSpacing = 'center',
3422
3482
  isHoveredInternal,
@@ -3488,6 +3548,8 @@ const Button = /*#__PURE__*/forwardRef(({
3488
3548
  isDisabled: disabled,
3489
3549
  icon: icon,
3490
3550
  iconPosition: iconPosition,
3551
+ withBadge: withBadge,
3552
+ badgeCount: badgeCount,
3491
3553
  isHovered: isHovered,
3492
3554
  isPressed: isPressed,
3493
3555
  isFocused: isFocused,
@@ -3567,6 +3629,8 @@ const ActionsItem = /*#__PURE__*/forwardRef(({
3567
3629
  }, ref) => {
3568
3630
  const [isLoading, setIsLoading] = useState(false);
3569
3631
  const mountedRef = useRef(false);
3632
+ // securing the loading state with a ref to avoid user action between rerenders
3633
+ const loadingRef = useRef(false);
3570
3634
 
3571
3635
  // effect just for tracking mounted state, as onPress can unmount the ActionButton
3572
3636
  useEffect(() => {
@@ -3584,15 +3648,18 @@ const ActionsItem = /*#__PURE__*/forwardRef(({
3584
3648
  icon: isLoading ? /*#__PURE__*/jsx(LoaderIcon, {}) : icon,
3585
3649
  onPress: e => {
3586
3650
  (async () => {
3587
- if (!onPress) return;
3651
+ if (!onPress || loadingRef.current) return;
3588
3652
  setIsLoading(true);
3653
+ loadingRef.current = true;
3589
3654
  try {
3590
3655
  await onPress(e);
3591
3656
  if (mountedRef.current) {
3592
3657
  setIsLoading(false);
3658
+ loadingRef.current = false;
3593
3659
  }
3594
3660
  } catch (error) {
3595
3661
  if (mountedRef.current) {
3662
+ loadingRef.current = false;
3596
3663
  setIsLoading(false);
3597
3664
  }
3598
3665
  throw error;
@@ -7761,6 +7828,8 @@ function FullscreenModalBody({
7761
7828
  const paddingBottom = shouldHandleBottomNotch ? Math.max(bottom, verticalPadding) : verticalPadding;
7762
7829
  const paddingTop = shouldHandleTopNotch ? Math.max(top, verticalPadding) : verticalPadding;
7763
7830
  return /*#__PURE__*/jsx(View, {
7831
+ flexGrow: 1,
7832
+ flexShrink: 1,
7764
7833
  ...props,
7765
7834
  paddingX: "kitt.fullscreenModal.horizontalPadding",
7766
7835
  paddingTop: paddingTop,
@@ -8038,28 +8107,31 @@ function FullscreenModalHeader({
8038
8107
  }
8039
8108
 
8040
8109
  function FullscreenModal({
8110
+ children,
8041
8111
  body,
8042
8112
  header,
8043
8113
  footer,
8044
8114
  backgroundColor
8045
8115
  }) {
8046
- return /*#__PURE__*/jsxs(FullscreenModalContainer, {
8116
+ return /*#__PURE__*/jsx(FullscreenModalContainer, {
8047
8117
  backgroundColor: backgroundColor,
8048
- children: [header ? /*#__PURE__*/jsx(View, {
8049
- children: header
8050
- }) : null, /*#__PURE__*/jsxs(View, {
8051
- flexGrow: 1,
8052
- flexShrink: 1,
8053
- justifyContent: "space-between",
8054
- children: [/*#__PURE__*/jsx(ScrollView$2, {
8055
- bounces: false,
8056
- contentContainerStyle: {
8057
- flexGrow: 1,
8058
- position: 'relative'
8059
- },
8060
- children: body
8061
- }), footer || null]
8062
- })]
8118
+ children: children || /*#__PURE__*/jsxs(Fragment, {
8119
+ children: [header ? /*#__PURE__*/jsx(View, {
8120
+ children: header
8121
+ }) : null, /*#__PURE__*/jsxs(View, {
8122
+ flexGrow: 1,
8123
+ flexShrink: 1,
8124
+ justifyContent: "space-between",
8125
+ children: [/*#__PURE__*/jsx(ScrollView$2, {
8126
+ bounces: false,
8127
+ contentContainerStyle: {
8128
+ flexGrow: 1,
8129
+ position: 'relative'
8130
+ },
8131
+ children: body
8132
+ }), footer || null]
8133
+ })]
8134
+ })
8063
8135
  });
8064
8136
  }
8065
8137
  FullscreenModal.Header = FullscreenModalHeader;
@@ -8466,7 +8538,7 @@ function IconButton({
8466
8538
  ariaLabel,
8467
8539
  accessibilityRole = 'button',
8468
8540
  withBadge,
8469
- bagdeCount,
8541
+ badgeCount,
8470
8542
  isHoveredInternal,
8471
8543
  isPressedInternal,
8472
8544
  isFocusedInternal,
@@ -8529,32 +8601,13 @@ function IconButton({
8529
8601
  icon: icon
8530
8602
  })
8531
8603
  })]
8532
- }), withBadge ? /*#__PURE__*/jsx(View, {
8533
- height: "10px",
8534
- width: "10px",
8535
- backgroundColor: lateOceanColorPalette['coral.10'],
8536
- borderRadius: "kitt.iconButton.borderRadius",
8537
- position: "absolute",
8538
- top: "1px",
8539
- right: "1px"
8540
- }) : null, !withBadge && bagdeCount && bagdeCount > 0 ? /*#__PURE__*/jsx(View, {
8541
- height: "20px",
8542
- width: "20px",
8543
- backgroundColor: lateOceanColorPalette['coral.10'],
8544
- borderRadius: "kitt.iconButton.borderRadius",
8604
+ }), withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsx(View, {
8545
8605
  position: "absolute",
8546
- top: "-6px",
8547
- right: "-6px",
8548
- children: /*#__PURE__*/jsx(View, {
8549
- alignItems: "center",
8550
- justifyContent: "center",
8551
- marginTop: "2px",
8552
- children: /*#__PURE__*/jsx(Typography.Text, {
8553
- base: "body-xs",
8554
- variant: "bold",
8555
- color: "white",
8556
- children: bagdeCount > 5 ? '+5' : bagdeCount
8557
- })
8606
+ top: withBadge ? '1px' : '-6px',
8607
+ right: withBadge ? '1px' : '-6px',
8608
+ children: /*#__PURE__*/jsx(ButtonBadge, {
8609
+ withBadge: withBadge,
8610
+ badgeCount: badgeCount
8558
8611
  })
8559
8612
  }) : null]
8560
8613
  });
@@ -9546,6 +9599,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
9546
9599
  backgroundColor: theme.skeleton.backgroundColor,
9547
9600
  flareColor: theme.skeleton.flareColor
9548
9601
  },
9602
+ buttonBadge: {
9603
+ backgroundColor: theme.buttonBadge.backgroundColor
9604
+ },
9549
9605
  iconButton: {
9550
9606
  borderColor: theme.iconButton.borderColor,
9551
9607
  disabled: {
@@ -9734,6 +9790,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
9734
9790
  button: {
9735
9791
  borderRadius: theme.button.borderRadius
9736
9792
  },
9793
+ buttonBadge: {
9794
+ borderRadius: theme.buttonBadge.borderRadius
9795
+ },
9737
9796
  card: {
9738
9797
  borderRadius: theme.card.borderRadius
9739
9798
  },
@@ -10113,6 +10172,18 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
10113
10172
  maxWidth: theme.button.maxWidth,
10114
10173
  minHeight: theme.button.minHeight
10115
10174
  },
10175
+ buttonBadge: {
10176
+ dimensions: {
10177
+ withBadge: {
10178
+ width: theme.buttonBadge.dimensions.withBadge.width,
10179
+ height: theme.buttonBadge.dimensions.withBadge.height
10180
+ },
10181
+ badgeCount: {
10182
+ width: theme.buttonBadge.dimensions.badgeCount.width,
10183
+ height: theme.buttonBadge.dimensions.badgeCount.height
10184
+ }
10185
+ }
10186
+ },
10116
10187
  icon: theme.icon,
10117
10188
  cardModal: {
10118
10189
  header: {
@@ -11520,13 +11591,17 @@ function NavigationModal({
11520
11591
  body,
11521
11592
  backgroundColor,
11522
11593
  footer,
11523
- header
11594
+ header,
11595
+ children
11524
11596
  }) {
11525
11597
  const Component = useBreakpointValue({
11526
11598
  base: FullscreenModal,
11527
11599
  small: CardModal
11528
11600
  });
11529
- return /*#__PURE__*/jsx(Component, {
11601
+ return children ? /*#__PURE__*/jsx(Component, {
11602
+ backgroundColor: backgroundColor,
11603
+ children: children
11604
+ }) : /*#__PURE__*/jsx(Component, {
11530
11605
  body: body,
11531
11606
  backgroundColor: backgroundColor,
11532
11607
  footer: footer,
@@ -13937,5 +14012,5 @@ function VerticalSteps({
13937
14012
  VerticalSteps.Step = Step;
13938
14013
  VerticalSteps.BorderlessStep = BorderlessStep;
13939
14014
 
13940
- 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 };
14015
+ 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 };
13941
14016
  //# sourceMappingURL=index-node-20.10.es.mjs.map