@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
@@ -787,6 +787,24 @@ const button = {
787
787
  }
788
788
  };
789
789
 
790
+ const buttonBadge = {
791
+ backgroundColor: lateOceanColorPalette['coral.10'],
792
+ dimensions: {
793
+ withBadge: {
794
+ width: 10,
795
+ height: 10
796
+ },
797
+ badgeCount: {
798
+ width: 20,
799
+ height: 20
800
+ }
801
+ },
802
+ borderRadius: {
803
+ withBadge: 5,
804
+ badgeCount: 10
805
+ }
806
+ };
807
+
790
808
  const card = {
791
809
  borderRadius: 20,
792
810
  borderWidth: 2,
@@ -2502,6 +2520,7 @@ const theme = {
2502
2520
  forms,
2503
2521
  highlight,
2504
2522
  icon,
2523
+ buttonBadge,
2505
2524
  iconButton,
2506
2525
  listItem,
2507
2526
  pageLoader,
@@ -3065,6 +3084,37 @@ Typography.h4 = createHeading(4, 'header4');
3065
3084
  /** @deprecated use Typography.Header6 */
3066
3085
  Typography.h5 = createHeading(5, 'header5');
3067
3086
 
3087
+ function ButtonBadge({
3088
+ withBadge,
3089
+ badgeCount
3090
+ }) {
3091
+ if (withBadge) {
3092
+ return /*#__PURE__*/jsx(View, {
3093
+ height: "kitt.buttonBadge.dimensions.withBadge.height",
3094
+ width: "kitt.buttonBadge.dimensions.withBadge.width",
3095
+ backgroundColor: "kitt.buttonBadge.backgroundColor",
3096
+ borderRadius: "kitt.buttonBadge.borderRadius.withBadge"
3097
+ });
3098
+ }
3099
+ if (badgeCount && badgeCount > 0) {
3100
+ return /*#__PURE__*/jsx(VStack, {
3101
+ alignItems: "center",
3102
+ justifyContent: "center",
3103
+ height: "kitt.buttonBadge.dimensions.badgeCount.height",
3104
+ width: "kitt.buttonBadge.dimensions.badgeCount.width",
3105
+ backgroundColor: "kitt.buttonBadge.backgroundColor",
3106
+ borderRadius: "kitt.buttonBadge.borderRadius.badgeCount",
3107
+ children: /*#__PURE__*/jsx(Typography.Text, {
3108
+ base: "body-xs",
3109
+ variant: "bold",
3110
+ color: "white",
3111
+ children: (badgeCount || 0) > 5 ? '+5' : badgeCount
3112
+ })
3113
+ });
3114
+ }
3115
+ return null;
3116
+ }
3117
+
3068
3118
  function Icon({
3069
3119
  icon,
3070
3120
  size = 'kitt.icon.defaultSize',
@@ -3189,6 +3239,8 @@ function ButtonContentChildren({
3189
3239
  icon,
3190
3240
  iconPosition,
3191
3241
  innerSpacing,
3242
+ withBadge,
3243
+ badgeCount,
3192
3244
  color,
3193
3245
  children
3194
3246
  }) {
@@ -3233,7 +3285,13 @@ function ButtonContentChildren({
3233
3285
  children: children
3234
3286
  }), icon && iconPosition === 'right' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread(_objectSpread({}, buttonIconSharedProps), {}, {
3235
3287
  icon: icon
3236
- })) : null]
3288
+ })) : null, withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsx(View, {
3289
+ marginLeft: "kitt.2",
3290
+ children: /*#__PURE__*/jsx(ButtonBadge, {
3291
+ withBadge: withBadge,
3292
+ badgeCount: badgeCount
3293
+ })
3294
+ }) : null]
3237
3295
  });
3238
3296
  }
3239
3297
  function ButtonContent(_ref) {
@@ -3417,6 +3475,8 @@ const Button = /*#__PURE__*/forwardRef(({
3417
3475
  testID,
3418
3476
  href,
3419
3477
  hrefAttrs,
3478
+ withBadge,
3479
+ badgeCount,
3420
3480
  accessibilityRole: _accessibilityRole = 'button',
3421
3481
  innerSpacing: _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,
@@ -3569,6 +3631,8 @@ const ActionsItem = /*#__PURE__*/forwardRef((_ref, ref) => {
3569
3631
  props = _objectWithoutProperties(_ref, _excluded$P);
3570
3632
  const [isLoading, setIsLoading] = useState(false);
3571
3633
  const mountedRef = useRef(false);
3634
+ // securing the loading state with a ref to avoid user action between rerenders
3635
+ const loadingRef = useRef(false);
3572
3636
 
3573
3637
  // effect just for tracking mounted state, as onPress can unmount the ActionButton
3574
3638
  useEffect(() => {
@@ -3586,15 +3650,18 @@ const ActionsItem = /*#__PURE__*/forwardRef((_ref, ref) => {
3586
3650
  icon: isLoading ? /*#__PURE__*/jsx(LoaderIcon, {}) : icon,
3587
3651
  onPress: e => {
3588
3652
  (async () => {
3589
- if (!onPress) return;
3653
+ if (!onPress || loadingRef.current) return;
3590
3654
  setIsLoading(true);
3655
+ loadingRef.current = true;
3591
3656
  try {
3592
3657
  await onPress(e);
3593
3658
  if (mountedRef.current) {
3594
3659
  setIsLoading(false);
3660
+ loadingRef.current = false;
3595
3661
  }
3596
3662
  } catch (error) {
3597
3663
  if (mountedRef.current) {
3664
+ loadingRef.current = false;
3598
3665
  setIsLoading(false);
3599
3666
  }
3600
3667
  throw error;
@@ -7784,7 +7851,10 @@ function FullscreenModalBody(_ref) {
7784
7851
  } = useTheme();
7785
7852
  const paddingBottom = shouldHandleBottomNotch ? Math.max(bottom, verticalPadding) : verticalPadding;
7786
7853
  const paddingTop = shouldHandleTopNotch ? Math.max(top, verticalPadding) : verticalPadding;
7787
- return /*#__PURE__*/jsx(View, _objectSpread(_objectSpread({}, props), {}, {
7854
+ return /*#__PURE__*/jsx(View, _objectSpread(_objectSpread({
7855
+ flexGrow: 1,
7856
+ flexShrink: 1
7857
+ }, props), {}, {
7788
7858
  paddingX: "kitt.fullscreenModal.horizontalPadding",
7789
7859
  paddingTop: paddingTop,
7790
7860
  paddingBottom: paddingBottom,
@@ -8066,28 +8136,31 @@ function FullscreenModalHeader(_ref) {
8066
8136
  }
8067
8137
 
8068
8138
  function FullscreenModal({
8139
+ children,
8069
8140
  body,
8070
8141
  header,
8071
8142
  footer,
8072
8143
  backgroundColor
8073
8144
  }) {
8074
- return /*#__PURE__*/jsxs(FullscreenModalContainer, {
8145
+ return /*#__PURE__*/jsx(FullscreenModalContainer, {
8075
8146
  backgroundColor: backgroundColor,
8076
- children: [header ? /*#__PURE__*/jsx(View, {
8077
- children: header
8078
- }) : null, /*#__PURE__*/jsxs(View, {
8079
- flexGrow: 1,
8080
- flexShrink: 1,
8081
- justifyContent: "space-between",
8082
- children: [/*#__PURE__*/jsx(ScrollView$2, {
8083
- bounces: false,
8084
- contentContainerStyle: {
8085
- flexGrow: 1,
8086
- position: 'relative'
8087
- },
8088
- children: body
8089
- }), footer || null]
8090
- })]
8147
+ children: children || /*#__PURE__*/jsxs(Fragment, {
8148
+ children: [header ? /*#__PURE__*/jsx(View, {
8149
+ children: header
8150
+ }) : null, /*#__PURE__*/jsxs(View, {
8151
+ flexGrow: 1,
8152
+ flexShrink: 1,
8153
+ justifyContent: "space-between",
8154
+ children: [/*#__PURE__*/jsx(ScrollView$2, {
8155
+ bounces: false,
8156
+ contentContainerStyle: {
8157
+ flexGrow: 1,
8158
+ position: 'relative'
8159
+ },
8160
+ children: body
8161
+ }), footer || null]
8162
+ })]
8163
+ })
8091
8164
  });
8092
8165
  }
8093
8166
  FullscreenModal.Header = FullscreenModalHeader;
@@ -8495,7 +8568,7 @@ function IconButton({
8495
8568
  ariaLabel,
8496
8569
  accessibilityRole = 'button',
8497
8570
  withBadge,
8498
- bagdeCount,
8571
+ badgeCount,
8499
8572
  isHoveredInternal,
8500
8573
  isPressedInternal,
8501
8574
  isFocusedInternal,
@@ -8558,32 +8631,13 @@ function IconButton({
8558
8631
  icon: icon
8559
8632
  })
8560
8633
  })]
8561
- }), withBadge ? /*#__PURE__*/jsx(View, {
8562
- height: "10px",
8563
- width: "10px",
8564
- backgroundColor: lateOceanColorPalette['coral.10'],
8565
- borderRadius: "kitt.iconButton.borderRadius",
8634
+ }), withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsx(View, {
8566
8635
  position: "absolute",
8567
- top: "1px",
8568
- right: "1px"
8569
- }) : null, !withBadge && bagdeCount && bagdeCount > 0 ? /*#__PURE__*/jsx(View, {
8570
- height: "20px",
8571
- width: "20px",
8572
- backgroundColor: lateOceanColorPalette['coral.10'],
8573
- borderRadius: "kitt.iconButton.borderRadius",
8574
- position: "absolute",
8575
- top: "-6px",
8576
- right: "-6px",
8577
- children: /*#__PURE__*/jsx(View, {
8578
- alignItems: "center",
8579
- justifyContent: "center",
8580
- marginTop: "2px",
8581
- children: /*#__PURE__*/jsx(Typography.Text, {
8582
- base: "body-xs",
8583
- variant: "bold",
8584
- color: "white",
8585
- children: bagdeCount > 5 ? '+5' : bagdeCount
8586
- })
8636
+ top: withBadge ? '1px' : '-6px',
8637
+ right: withBadge ? '1px' : '-6px',
8638
+ children: /*#__PURE__*/jsx(ButtonBadge, {
8639
+ withBadge: withBadge,
8640
+ badgeCount: badgeCount
8587
8641
  })
8588
8642
  }) : null]
8589
8643
  });
@@ -9574,6 +9628,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
9574
9628
  backgroundColor: theme.skeleton.backgroundColor,
9575
9629
  flareColor: theme.skeleton.flareColor
9576
9630
  },
9631
+ buttonBadge: {
9632
+ backgroundColor: theme.buttonBadge.backgroundColor
9633
+ },
9577
9634
  iconButton: {
9578
9635
  borderColor: theme.iconButton.borderColor,
9579
9636
  disabled: {
@@ -9761,6 +9818,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
9761
9818
  button: {
9762
9819
  borderRadius: theme.button.borderRadius
9763
9820
  },
9821
+ buttonBadge: {
9822
+ borderRadius: theme.buttonBadge.borderRadius
9823
+ },
9764
9824
  card: {
9765
9825
  borderRadius: theme.card.borderRadius
9766
9826
  },
@@ -10137,6 +10197,18 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
10137
10197
  maxWidth: theme.button.maxWidth,
10138
10198
  minHeight: theme.button.minHeight
10139
10199
  },
10200
+ buttonBadge: {
10201
+ dimensions: {
10202
+ withBadge: {
10203
+ width: theme.buttonBadge.dimensions.withBadge.width,
10204
+ height: theme.buttonBadge.dimensions.withBadge.height
10205
+ },
10206
+ badgeCount: {
10207
+ width: theme.buttonBadge.dimensions.badgeCount.width,
10208
+ height: theme.buttonBadge.dimensions.badgeCount.height
10209
+ }
10210
+ }
10211
+ },
10140
10212
  icon: theme.icon,
10141
10213
  cardModal: {
10142
10214
  header: {
@@ -11539,13 +11611,17 @@ function NavigationModal({
11539
11611
  body,
11540
11612
  backgroundColor,
11541
11613
  footer,
11542
- header
11614
+ header,
11615
+ children
11543
11616
  }) {
11544
11617
  const Component = useBreakpointValue({
11545
11618
  base: FullscreenModal,
11546
11619
  small: CardModal
11547
11620
  });
11548
- return /*#__PURE__*/jsx(Component, {
11621
+ return children ? /*#__PURE__*/jsx(Component, {
11622
+ backgroundColor: backgroundColor,
11623
+ children: children
11624
+ }) : /*#__PURE__*/jsx(Component, {
11549
11625
  body: body,
11550
11626
  backgroundColor: backgroundColor,
11551
11627
  footer: footer,
@@ -13972,5 +14048,5 @@ function VerticalSteps(_ref) {
13972
14048
  VerticalSteps.Step = Step;
13973
14049
  VerticalSteps.BorderlessStep = BorderlessStep;
13974
14050
 
13975
- 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 };
14051
+ 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 };
13976
14052
  //# sourceMappingURL=index-metro.es.ios.js.map