@ornikar/kitt-universal 25.54.0 → 25.55.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 (55) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/definitions/Button/Button.d.ts +2 -0
  3. package/dist/definitions/Button/Button.d.ts.map +1 -1
  4. package/dist/definitions/Button/ButtonContent.d.ts +1 -1
  5. package/dist/definitions/Button/ButtonContent.d.ts.map +1 -1
  6. package/dist/definitions/Button/ButtonPadding.d.ts +2 -2
  7. package/dist/definitions/Button/ButtonPadding.d.ts.map +1 -1
  8. package/dist/definitions/ButtonBadge/ButtonBadge.d.ts +7 -0
  9. package/dist/definitions/ButtonBadge/ButtonBadge.d.ts.map +1 -0
  10. package/dist/definitions/IconButton/IconButton.d.ts +2 -2
  11. package/dist/definitions/IconButton/IconButton.d.ts.map +1 -1
  12. package/dist/definitions/index.d.ts +2 -0
  13. package/dist/definitions/index.d.ts.map +1 -1
  14. package/dist/definitions/native-base/KittNativeBaseProvider.d.ts +24 -3
  15. package/dist/definitions/native-base/KittNativeBaseProvider.d.ts.map +1 -1
  16. package/dist/definitions/themes/default.d.ts +1 -0
  17. package/dist/definitions/themes/default.d.ts.map +1 -1
  18. package/dist/definitions/themes/late-ocean/button.d.ts +3 -1
  19. package/dist/definitions/themes/late-ocean/button.d.ts.map +1 -1
  20. package/dist/definitions/themes/late-ocean/buttonBadge.d.ts +21 -0
  21. package/dist/definitions/themes/late-ocean/buttonBadge.d.ts.map +1 -0
  22. package/dist/index-metro.es.android.js +103 -39
  23. package/dist/index-metro.es.android.js.map +1 -1
  24. package/dist/index-metro.es.ios.js +103 -39
  25. package/dist/index-metro.es.ios.js.map +1 -1
  26. package/dist/index-node-20.10.cjs.js +102 -37
  27. package/dist/index-node-20.10.cjs.js.map +1 -1
  28. package/dist/index-node-20.10.cjs.web.js +102 -37
  29. package/dist/index-node-20.10.cjs.web.js.map +1 -1
  30. package/dist/index-node-20.10.es.mjs +102 -38
  31. package/dist/index-node-20.10.es.mjs.map +1 -1
  32. package/dist/index-node-20.10.es.web.mjs +102 -38
  33. package/dist/index-node-20.10.es.web.mjs.map +1 -1
  34. package/dist/index.es.js +102 -39
  35. package/dist/index.es.js.map +1 -1
  36. package/dist/index.es.web.js +102 -39
  37. package/dist/index.es.web.js.map +1 -1
  38. package/dist/linaria-themes-metro.es.android.js +28 -4
  39. package/dist/linaria-themes-metro.es.android.js.map +1 -1
  40. package/dist/linaria-themes-metro.es.ios.js +28 -4
  41. package/dist/linaria-themes-metro.es.ios.js.map +1 -1
  42. package/dist/linaria-themes-node-20.10.cjs.js +28 -4
  43. package/dist/linaria-themes-node-20.10.cjs.js.map +1 -1
  44. package/dist/linaria-themes-node-20.10.cjs.web.js +28 -4
  45. package/dist/linaria-themes-node-20.10.cjs.web.js.map +1 -1
  46. package/dist/linaria-themes-node-20.10.es.mjs +28 -4
  47. package/dist/linaria-themes-node-20.10.es.mjs.map +1 -1
  48. package/dist/linaria-themes-node-20.10.es.web.mjs +28 -4
  49. package/dist/linaria-themes-node-20.10.es.web.mjs.map +1 -1
  50. package/dist/linaria-themes.es.js +28 -4
  51. package/dist/linaria-themes.es.js.map +1 -1
  52. package/dist/linaria-themes.es.web.js +28 -4
  53. package/dist/linaria-themes.es.web.js.map +1 -1
  54. package/dist/tsbuildinfo +1 -1
  55. package/package.json +1 -1
@@ -657,20 +657,25 @@ const button = {
657
657
  },
658
658
  padding: {
659
659
  default: {
660
+ hasBadge: {
661
+ right: 8
662
+ },
660
663
  horizontal: 16,
661
664
  vertical: 7
662
665
  },
663
666
  large: {
667
+ hasBadge: {
668
+ right: 12
669
+ },
664
670
  horizontal: 24,
665
671
  vertical: 11
666
672
  },
667
673
  xLarge: {
674
+ hasBadge: {
675
+ right: 12
676
+ },
668
677
  horizontal: 24,
669
678
  vertical: 15
670
- },
671
- disabled: {
672
- horizontal: 14,
673
- vertical: 5
674
679
  }
675
680
  },
676
681
  transition: {
@@ -780,6 +785,24 @@ const button = {
780
785
  }
781
786
  };
782
787
 
788
+ const buttonBadge = {
789
+ backgroundColor: lateOceanColorPalette['coral.10'],
790
+ dimensions: {
791
+ withBadge: {
792
+ width: 10,
793
+ height: 10
794
+ },
795
+ badgeCount: {
796
+ width: 20,
797
+ height: 20
798
+ }
799
+ },
800
+ borderRadius: {
801
+ withBadge: 5,
802
+ badgeCount: 10
803
+ }
804
+ };
805
+
783
806
  const card = {
784
807
  borderRadius: 20,
785
808
  borderWidth: 2,
@@ -2495,6 +2518,7 @@ const theme = {
2495
2518
  forms,
2496
2519
  highlight,
2497
2520
  icon,
2521
+ buttonBadge,
2498
2522
  iconButton,
2499
2523
  listItem,
2500
2524
  pageLoader,
@@ -3103,6 +3127,37 @@ Typography.h4 = createHeading(4, 'header4');
3103
3127
  /** @deprecated use Typography.Header6 */
3104
3128
  Typography.h5 = createHeading(5, 'header5');
3105
3129
 
3130
+ function ButtonBadge({
3131
+ withBadge,
3132
+ badgeCount
3133
+ }) {
3134
+ if (withBadge) {
3135
+ return /*#__PURE__*/jsx(View, {
3136
+ height: "kitt.buttonBadge.dimensions.withBadge.height",
3137
+ width: "kitt.buttonBadge.dimensions.withBadge.width",
3138
+ backgroundColor: "kitt.buttonBadge.backgroundColor",
3139
+ borderRadius: "kitt.buttonBadge.borderRadius.withBadge"
3140
+ });
3141
+ }
3142
+ if (badgeCount && badgeCount > 0) {
3143
+ return /*#__PURE__*/jsx(VStack, {
3144
+ alignItems: "center",
3145
+ justifyContent: "center",
3146
+ height: "kitt.buttonBadge.dimensions.badgeCount.height",
3147
+ width: "kitt.buttonBadge.dimensions.badgeCount.width",
3148
+ backgroundColor: "kitt.buttonBadge.backgroundColor",
3149
+ borderRadius: "kitt.buttonBadge.borderRadius.badgeCount",
3150
+ children: /*#__PURE__*/jsx(Typography.Text, {
3151
+ base: "body-xs",
3152
+ variant: "bold",
3153
+ color: "white",
3154
+ children: (badgeCount || 0) > 5 ? '+5' : badgeCount
3155
+ })
3156
+ });
3157
+ }
3158
+ return null;
3159
+ }
3160
+
3106
3161
  function Icon({
3107
3162
  icon,
3108
3163
  size = 'kitt.icon.defaultSize',
@@ -3228,6 +3283,8 @@ function ButtonContentChildren({
3228
3283
  icon,
3229
3284
  iconPosition,
3230
3285
  innerSpacing,
3286
+ withBadge,
3287
+ badgeCount,
3231
3288
  color,
3232
3289
  children
3233
3290
  }) {
@@ -3274,6 +3331,12 @@ function ButtonContentChildren({
3274
3331
  }), icon && iconPosition === 'right' ? /*#__PURE__*/jsx(ButtonIcon, {
3275
3332
  ...buttonIconSharedProps,
3276
3333
  icon: icon
3334
+ }) : null, withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsx(View, {
3335
+ marginLeft: "kitt.2",
3336
+ children: /*#__PURE__*/jsx(ButtonBadge, {
3337
+ withBadge: withBadge,
3338
+ badgeCount: badgeCount
3339
+ })
3277
3340
  }) : null]
3278
3341
  });
3279
3342
  }
@@ -3311,22 +3374,19 @@ function ButtonContent({
3311
3374
  }
3312
3375
 
3313
3376
  function getCurrentPaddingConfig({
3314
- size,
3315
- isDisabled
3377
+ size
3316
3378
  }) {
3317
3379
  if (size === 'large') return 'large';
3318
3380
  if (size === 'xLarge') return 'xLarge';
3319
- if (isDisabled) return 'disabled';
3320
3381
  return 'default';
3321
3382
  }
3322
3383
  function ButtonPadding({
3323
3384
  children,
3324
3385
  size,
3325
- isDisabled
3386
+ hasBadge
3326
3387
  }) {
3327
3388
  const currentPaddingKey = getCurrentPaddingConfig({
3328
- size,
3329
- isDisabled
3389
+ size
3330
3390
  });
3331
3391
  return /*#__PURE__*/jsx(View, {
3332
3392
  position: "relative",
@@ -3335,6 +3395,7 @@ function ButtonPadding({
3335
3395
  justifyContent: "center",
3336
3396
  paddingX: `kitt.button.padding.${currentPaddingKey}.horizontal`,
3337
3397
  paddingY: `kitt.button.padding.${currentPaddingKey}.vertical`,
3398
+ paddingRight: hasBadge ? `kitt.button.padding.${currentPaddingKey}.hasBadge.right` : undefined,
3338
3399
  minHeight: "kitt.button.minHeight",
3339
3400
  children: children
3340
3401
  });
@@ -3418,6 +3479,8 @@ const Button = /*#__PURE__*/forwardRef(({
3418
3479
  testID,
3419
3480
  href,
3420
3481
  hrefAttrs,
3482
+ withBadge,
3483
+ badgeCount,
3421
3484
  accessibilityRole = 'button',
3422
3485
  innerSpacing = 'center',
3423
3486
  isHoveredInternal,
@@ -3479,13 +3542,15 @@ const Button = /*#__PURE__*/forwardRef(({
3479
3542
  isStretch: stretch,
3480
3543
  children: /*#__PURE__*/jsxs(ButtonPadding, {
3481
3544
  size: size,
3482
- isDisabled: disabled,
3545
+ hasBadge: Boolean(withBadge || badgeCount && badgeCount > 0),
3483
3546
  children: [/*#__PURE__*/jsx(ButtonContent, {
3484
3547
  type: type,
3485
3548
  variant: variant,
3486
3549
  isDisabled: disabled,
3487
3550
  icon: icon,
3488
3551
  iconPosition: iconPosition,
3552
+ withBadge: withBadge,
3553
+ badgeCount: badgeCount,
3489
3554
  isHovered: isHovered,
3490
3555
  isPressed: isPressed,
3491
3556
  isFocused: isFocused,
@@ -7629,7 +7694,7 @@ function IconButton({
7629
7694
  ariaLabel,
7630
7695
  accessibilityRole = 'button',
7631
7696
  withBadge,
7632
- bagdeCount,
7697
+ badgeCount,
7633
7698
  isHoveredInternal,
7634
7699
  isPressedInternal,
7635
7700
  isFocusedInternal,
@@ -7689,32 +7754,13 @@ function IconButton({
7689
7754
  icon: icon
7690
7755
  })
7691
7756
  })]
7692
- }), withBadge ? /*#__PURE__*/jsx(View, {
7693
- height: "10px",
7694
- width: "10px",
7695
- backgroundColor: lateOceanColorPalette['coral.10'],
7696
- borderRadius: "kitt.iconButton.borderRadius",
7757
+ }), withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsx(View, {
7697
7758
  position: "absolute",
7698
- top: "1px",
7699
- right: "1px"
7700
- }) : null, !withBadge && bagdeCount && bagdeCount > 0 ? /*#__PURE__*/jsx(View, {
7701
- height: "20px",
7702
- width: "20px",
7703
- backgroundColor: lateOceanColorPalette['coral.10'],
7704
- borderRadius: "kitt.iconButton.borderRadius",
7705
- position: "absolute",
7706
- top: "-6px",
7707
- right: "-6px",
7708
- children: /*#__PURE__*/jsx(View, {
7709
- alignItems: "center",
7710
- justifyContent: "center",
7711
- marginTop: "2px",
7712
- children: /*#__PURE__*/jsx(Typography.Text, {
7713
- base: "body-xs",
7714
- variant: "bold",
7715
- color: "white",
7716
- children: bagdeCount > 5 ? '+5' : bagdeCount
7717
- })
7759
+ top: withBadge ? '1px' : '-6px',
7760
+ right: withBadge ? '1px' : '-6px',
7761
+ children: /*#__PURE__*/jsx(ButtonBadge, {
7762
+ withBadge: withBadge,
7763
+ badgeCount: badgeCount
7718
7764
  })
7719
7765
  }) : null]
7720
7766
  });
@@ -8789,6 +8835,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
8789
8835
  backgroundColor: theme.skeleton.backgroundColor,
8790
8836
  flareColor: theme.skeleton.flareColor
8791
8837
  },
8838
+ buttonBadge: {
8839
+ backgroundColor: theme.buttonBadge.backgroundColor
8840
+ },
8792
8841
  iconButton: {
8793
8842
  borderColor: theme.iconButton.borderColor,
8794
8843
  disabled: {
@@ -8977,6 +9026,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
8977
9026
  button: {
8978
9027
  borderRadius: theme.button.borderRadius
8979
9028
  },
9029
+ buttonBadge: {
9030
+ borderRadius: theme.buttonBadge.borderRadius
9031
+ },
8980
9032
  card: {
8981
9033
  borderRadius: theme.card.borderRadius
8982
9034
  },
@@ -9356,6 +9408,18 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
9356
9408
  maxWidth: theme.button.maxWidth,
9357
9409
  minHeight: theme.button.minHeight
9358
9410
  },
9411
+ buttonBadge: {
9412
+ dimensions: {
9413
+ withBadge: {
9414
+ width: theme.buttonBadge.dimensions.withBadge.width,
9415
+ height: theme.buttonBadge.dimensions.withBadge.height
9416
+ },
9417
+ badgeCount: {
9418
+ width: theme.buttonBadge.dimensions.badgeCount.width,
9419
+ height: theme.buttonBadge.dimensions.badgeCount.height
9420
+ }
9421
+ }
9422
+ },
9359
9423
  icon: theme.icon,
9360
9424
  cardModal: {
9361
9425
  header: {
@@ -13069,5 +13133,5 @@ function VerticalSteps({
13069
13133
  VerticalSteps.Step = Step;
13070
13134
  VerticalSteps.BorderlessStep = BorderlessStep;
13071
13135
 
13072
- 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 };
13136
+ 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 };
13073
13137
  //# sourceMappingURL=index-node-20.10.es.web.mjs.map