@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
@@ -780,6 +780,24 @@ const button = {
780
780
  }
781
781
  };
782
782
 
783
+ const buttonBadge = {
784
+ backgroundColor: lateOceanColorPalette['coral.10'],
785
+ dimensions: {
786
+ withBadge: {
787
+ width: 10,
788
+ height: 10
789
+ },
790
+ badgeCount: {
791
+ width: 20,
792
+ height: 20
793
+ }
794
+ },
795
+ borderRadius: {
796
+ withBadge: 5,
797
+ badgeCount: 10
798
+ }
799
+ };
800
+
783
801
  const card = {
784
802
  borderRadius: 20,
785
803
  borderWidth: 2,
@@ -2495,6 +2513,7 @@ const theme = {
2495
2513
  forms,
2496
2514
  highlight,
2497
2515
  icon,
2516
+ buttonBadge,
2498
2517
  iconButton,
2499
2518
  listItem,
2500
2519
  pageLoader,
@@ -3103,6 +3122,37 @@ Typography.h4 = createHeading(4, 'header4');
3103
3122
  /** @deprecated use Typography.Header6 */
3104
3123
  Typography.h5 = createHeading(5, 'header5');
3105
3124
 
3125
+ function ButtonBadge({
3126
+ withBadge,
3127
+ badgeCount
3128
+ }) {
3129
+ if (withBadge) {
3130
+ return /*#__PURE__*/jsx(View, {
3131
+ height: "kitt.buttonBadge.dimensions.withBadge.height",
3132
+ width: "kitt.buttonBadge.dimensions.withBadge.width",
3133
+ backgroundColor: "kitt.buttonBadge.backgroundColor",
3134
+ borderRadius: "kitt.buttonBadge.borderRadius.withBadge"
3135
+ });
3136
+ }
3137
+ if (badgeCount && badgeCount > 0) {
3138
+ return /*#__PURE__*/jsx(VStack, {
3139
+ alignItems: "center",
3140
+ justifyContent: "center",
3141
+ height: "kitt.buttonBadge.dimensions.badgeCount.height",
3142
+ width: "kitt.buttonBadge.dimensions.badgeCount.width",
3143
+ backgroundColor: "kitt.buttonBadge.backgroundColor",
3144
+ borderRadius: "kitt.buttonBadge.borderRadius.badgeCount",
3145
+ children: /*#__PURE__*/jsx(Typography.Text, {
3146
+ base: "body-xs",
3147
+ variant: "bold",
3148
+ color: "white",
3149
+ children: (badgeCount || 0) > 5 ? '+5' : badgeCount
3150
+ })
3151
+ });
3152
+ }
3153
+ return null;
3154
+ }
3155
+
3106
3156
  function Icon({
3107
3157
  icon,
3108
3158
  size = 'kitt.icon.defaultSize',
@@ -3228,6 +3278,8 @@ function ButtonContentChildren({
3228
3278
  icon,
3229
3279
  iconPosition,
3230
3280
  innerSpacing,
3281
+ withBadge,
3282
+ badgeCount,
3231
3283
  color,
3232
3284
  children
3233
3285
  }) {
@@ -3274,6 +3326,12 @@ function ButtonContentChildren({
3274
3326
  }), icon && iconPosition === 'right' ? /*#__PURE__*/jsx(ButtonIcon, {
3275
3327
  ...buttonIconSharedProps,
3276
3328
  icon: icon
3329
+ }) : null, withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsx(View, {
3330
+ marginLeft: "kitt.2",
3331
+ children: /*#__PURE__*/jsx(ButtonBadge, {
3332
+ withBadge: withBadge,
3333
+ badgeCount: badgeCount
3334
+ })
3277
3335
  }) : null]
3278
3336
  });
3279
3337
  }
@@ -3418,6 +3476,8 @@ const Button = /*#__PURE__*/forwardRef(({
3418
3476
  testID,
3419
3477
  href,
3420
3478
  hrefAttrs,
3479
+ withBadge,
3480
+ badgeCount,
3421
3481
  accessibilityRole = 'button',
3422
3482
  innerSpacing = 'center',
3423
3483
  isHoveredInternal,
@@ -3486,6 +3546,8 @@ const Button = /*#__PURE__*/forwardRef(({
3486
3546
  isDisabled: disabled,
3487
3547
  icon: icon,
3488
3548
  iconPosition: iconPosition,
3549
+ withBadge: withBadge,
3550
+ badgeCount: badgeCount,
3489
3551
  isHovered: isHovered,
3490
3552
  isPressed: isPressed,
3491
3553
  isFocused: isFocused,
@@ -3539,6 +3601,8 @@ const ActionsItem = /*#__PURE__*/forwardRef(({
3539
3601
  }, ref) => {
3540
3602
  const [isLoading, setIsLoading] = useState(false);
3541
3603
  const mountedRef = useRef(false);
3604
+ // securing the loading state with a ref to avoid user action between rerenders
3605
+ const loadingRef = useRef(false);
3542
3606
 
3543
3607
  // effect just for tracking mounted state, as onPress can unmount the ActionButton
3544
3608
  useEffect(() => {
@@ -3556,15 +3620,18 @@ const ActionsItem = /*#__PURE__*/forwardRef(({
3556
3620
  icon: isLoading ? /*#__PURE__*/jsx(LoaderIcon, {}) : icon,
3557
3621
  onPress: e => {
3558
3622
  (async () => {
3559
- if (!onPress) return;
3623
+ if (!onPress || loadingRef.current) return;
3560
3624
  setIsLoading(true);
3625
+ loadingRef.current = true;
3561
3626
  try {
3562
3627
  await onPress(e);
3563
3628
  if (mountedRef.current) {
3564
3629
  setIsLoading(false);
3630
+ loadingRef.current = false;
3565
3631
  }
3566
3632
  } catch (error) {
3567
3633
  if (mountedRef.current) {
3634
+ loadingRef.current = false;
3568
3635
  setIsLoading(false);
3569
3636
  }
3570
3637
  throw error;
@@ -7000,6 +7067,8 @@ function FullscreenModalBody({
7000
7067
  const paddingBottom = shouldHandleBottomNotch ? Math.max(bottom, verticalPadding) : verticalPadding;
7001
7068
  const paddingTop = shouldHandleTopNotch ? Math.max(top, verticalPadding) : verticalPadding;
7002
7069
  return /*#__PURE__*/jsx(View, {
7070
+ flexGrow: 1,
7071
+ flexShrink: 1,
7003
7072
  ...props,
7004
7073
  paddingX: "kitt.fullscreenModal.horizontalPadding",
7005
7074
  paddingTop: paddingTop,
@@ -7212,28 +7281,31 @@ function FullscreenModalHeader({
7212
7281
  }
7213
7282
 
7214
7283
  function FullscreenModal({
7284
+ children,
7215
7285
  body,
7216
7286
  header,
7217
7287
  footer,
7218
7288
  backgroundColor
7219
7289
  }) {
7220
- return /*#__PURE__*/jsxs(FullscreenModalContainer, {
7290
+ return /*#__PURE__*/jsx(FullscreenModalContainer, {
7221
7291
  backgroundColor: backgroundColor,
7222
- children: [header ? /*#__PURE__*/jsx(View, {
7223
- children: header
7224
- }) : null, /*#__PURE__*/jsxs(View, {
7225
- flexGrow: 1,
7226
- flexShrink: 1,
7227
- justifyContent: "space-between",
7228
- children: [/*#__PURE__*/jsx(ScrollView$2, {
7229
- bounces: false,
7230
- contentContainerStyle: {
7231
- flexGrow: 1,
7232
- position: 'relative'
7233
- },
7234
- children: body
7235
- }), footer || null]
7236
- })]
7292
+ children: children || /*#__PURE__*/jsxs(Fragment, {
7293
+ children: [header ? /*#__PURE__*/jsx(View, {
7294
+ children: header
7295
+ }) : null, /*#__PURE__*/jsxs(View, {
7296
+ flexGrow: 1,
7297
+ flexShrink: 1,
7298
+ justifyContent: "space-between",
7299
+ children: [/*#__PURE__*/jsx(ScrollView$2, {
7300
+ bounces: false,
7301
+ contentContainerStyle: {
7302
+ flexGrow: 1,
7303
+ position: 'relative'
7304
+ },
7305
+ children: body
7306
+ }), footer || null]
7307
+ })]
7308
+ })
7237
7309
  });
7238
7310
  }
7239
7311
  FullscreenModal.Header = FullscreenModalHeader;
@@ -7624,7 +7696,7 @@ function IconButton({
7624
7696
  ariaLabel,
7625
7697
  accessibilityRole = 'button',
7626
7698
  withBadge,
7627
- bagdeCount,
7699
+ badgeCount,
7628
7700
  isHoveredInternal,
7629
7701
  isPressedInternal,
7630
7702
  isFocusedInternal,
@@ -7684,32 +7756,13 @@ function IconButton({
7684
7756
  icon: icon
7685
7757
  })
7686
7758
  })]
7687
- }), withBadge ? /*#__PURE__*/jsx(View, {
7688
- height: "10px",
7689
- width: "10px",
7690
- backgroundColor: lateOceanColorPalette['coral.10'],
7691
- borderRadius: "kitt.iconButton.borderRadius",
7759
+ }), withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsx(View, {
7692
7760
  position: "absolute",
7693
- top: "1px",
7694
- right: "1px"
7695
- }) : null, !withBadge && bagdeCount && bagdeCount > 0 ? /*#__PURE__*/jsx(View, {
7696
- height: "20px",
7697
- width: "20px",
7698
- backgroundColor: lateOceanColorPalette['coral.10'],
7699
- borderRadius: "kitt.iconButton.borderRadius",
7700
- position: "absolute",
7701
- top: "-6px",
7702
- right: "-6px",
7703
- children: /*#__PURE__*/jsx(View, {
7704
- alignItems: "center",
7705
- justifyContent: "center",
7706
- marginTop: "2px",
7707
- children: /*#__PURE__*/jsx(Typography.Text, {
7708
- base: "body-xs",
7709
- variant: "bold",
7710
- color: "white",
7711
- children: bagdeCount > 5 ? '+5' : bagdeCount
7712
- })
7761
+ top: withBadge ? '1px' : '-6px',
7762
+ right: withBadge ? '1px' : '-6px',
7763
+ children: /*#__PURE__*/jsx(ButtonBadge, {
7764
+ withBadge: withBadge,
7765
+ badgeCount: badgeCount
7713
7766
  })
7714
7767
  }) : null]
7715
7768
  });
@@ -8784,6 +8837,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
8784
8837
  backgroundColor: theme.skeleton.backgroundColor,
8785
8838
  flareColor: theme.skeleton.flareColor
8786
8839
  },
8840
+ buttonBadge: {
8841
+ backgroundColor: theme.buttonBadge.backgroundColor
8842
+ },
8787
8843
  iconButton: {
8788
8844
  borderColor: theme.iconButton.borderColor,
8789
8845
  disabled: {
@@ -8972,6 +9028,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
8972
9028
  button: {
8973
9029
  borderRadius: theme.button.borderRadius
8974
9030
  },
9031
+ buttonBadge: {
9032
+ borderRadius: theme.buttonBadge.borderRadius
9033
+ },
8975
9034
  card: {
8976
9035
  borderRadius: theme.card.borderRadius
8977
9036
  },
@@ -9351,6 +9410,18 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
9351
9410
  maxWidth: theme.button.maxWidth,
9352
9411
  minHeight: theme.button.minHeight
9353
9412
  },
9413
+ buttonBadge: {
9414
+ dimensions: {
9415
+ withBadge: {
9416
+ width: theme.buttonBadge.dimensions.withBadge.width,
9417
+ height: theme.buttonBadge.dimensions.withBadge.height
9418
+ },
9419
+ badgeCount: {
9420
+ width: theme.buttonBadge.dimensions.badgeCount.width,
9421
+ height: theme.buttonBadge.dimensions.badgeCount.height
9422
+ }
9423
+ }
9424
+ },
9354
9425
  icon: theme.icon,
9355
9426
  cardModal: {
9356
9427
  header: {
@@ -10798,13 +10869,17 @@ function NavigationModal({
10798
10869
  body,
10799
10870
  backgroundColor,
10800
10871
  footer,
10801
- header
10872
+ header,
10873
+ children
10802
10874
  }) {
10803
10875
  const Component = useBreakpointValue({
10804
10876
  base: FullscreenModal,
10805
10877
  small: CardModal
10806
10878
  });
10807
- return /*#__PURE__*/jsx(Component, {
10879
+ return children ? /*#__PURE__*/jsx(Component, {
10880
+ backgroundColor: backgroundColor,
10881
+ children: children
10882
+ }) : /*#__PURE__*/jsx(Component, {
10808
10883
  body: body,
10809
10884
  backgroundColor: backgroundColor,
10810
10885
  footer: footer,
@@ -13060,5 +13135,5 @@ function VerticalSteps({
13060
13135
  VerticalSteps.Step = Step;
13061
13136
  VerticalSteps.BorderlessStep = BorderlessStep;
13062
13137
 
13063
- 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 };
13138
+ 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 };
13064
13139
  //# sourceMappingURL=index-node-20.10.es.web.mjs.map