@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
@@ -661,20 +661,25 @@ const button = {
661
661
  },
662
662
  padding: {
663
663
  default: {
664
+ hasBadge: {
665
+ right: 8
666
+ },
664
667
  horizontal: 16,
665
668
  vertical: 7
666
669
  },
667
670
  large: {
671
+ hasBadge: {
672
+ right: 12
673
+ },
668
674
  horizontal: 24,
669
675
  vertical: 11
670
676
  },
671
677
  xLarge: {
678
+ hasBadge: {
679
+ right: 12
680
+ },
672
681
  horizontal: 24,
673
682
  vertical: 15
674
- },
675
- disabled: {
676
- horizontal: 14,
677
- vertical: 5
678
683
  }
679
684
  },
680
685
  transition: {
@@ -784,6 +789,24 @@ const button = {
784
789
  }
785
790
  };
786
791
 
792
+ const buttonBadge = {
793
+ backgroundColor: lateOceanColorPalette['coral.10'],
794
+ dimensions: {
795
+ withBadge: {
796
+ width: 10,
797
+ height: 10
798
+ },
799
+ badgeCount: {
800
+ width: 20,
801
+ height: 20
802
+ }
803
+ },
804
+ borderRadius: {
805
+ withBadge: 5,
806
+ badgeCount: 10
807
+ }
808
+ };
809
+
787
810
  const card = {
788
811
  borderRadius: 20,
789
812
  borderWidth: 2,
@@ -2499,6 +2522,7 @@ const theme = {
2499
2522
  forms,
2500
2523
  highlight,
2501
2524
  icon,
2525
+ buttonBadge,
2502
2526
  iconButton,
2503
2527
  listItem,
2504
2528
  pageLoader,
@@ -3063,6 +3087,37 @@ Typography.h4 = createHeading(4, 'header4');
3063
3087
  /** @deprecated use Typography.Header6 */
3064
3088
  Typography.h5 = createHeading(5, 'header5');
3065
3089
 
3090
+ function ButtonBadge({
3091
+ withBadge,
3092
+ badgeCount
3093
+ }) {
3094
+ if (withBadge) {
3095
+ return /*#__PURE__*/jsx(View, {
3096
+ height: "kitt.buttonBadge.dimensions.withBadge.height",
3097
+ width: "kitt.buttonBadge.dimensions.withBadge.width",
3098
+ backgroundColor: "kitt.buttonBadge.backgroundColor",
3099
+ borderRadius: "kitt.buttonBadge.borderRadius.withBadge"
3100
+ });
3101
+ }
3102
+ if (badgeCount && badgeCount > 0) {
3103
+ return /*#__PURE__*/jsx(VStack, {
3104
+ alignItems: "center",
3105
+ justifyContent: "center",
3106
+ height: "kitt.buttonBadge.dimensions.badgeCount.height",
3107
+ width: "kitt.buttonBadge.dimensions.badgeCount.width",
3108
+ backgroundColor: "kitt.buttonBadge.backgroundColor",
3109
+ borderRadius: "kitt.buttonBadge.borderRadius.badgeCount",
3110
+ children: /*#__PURE__*/jsx(Typography.Text, {
3111
+ base: "body-xs",
3112
+ variant: "bold",
3113
+ color: "white",
3114
+ children: (badgeCount || 0) > 5 ? '+5' : badgeCount
3115
+ })
3116
+ });
3117
+ }
3118
+ return null;
3119
+ }
3120
+
3066
3121
  function Icon({
3067
3122
  icon,
3068
3123
  size = 'kitt.icon.defaultSize',
@@ -3188,6 +3243,8 @@ function ButtonContentChildren({
3188
3243
  icon,
3189
3244
  iconPosition,
3190
3245
  innerSpacing,
3246
+ withBadge,
3247
+ badgeCount,
3191
3248
  color,
3192
3249
  children
3193
3250
  }) {
@@ -3234,6 +3291,12 @@ function ButtonContentChildren({
3234
3291
  }), icon && iconPosition === 'right' ? /*#__PURE__*/jsx(ButtonIcon, {
3235
3292
  ...buttonIconSharedProps,
3236
3293
  icon: icon
3294
+ }) : null, withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsx(View, {
3295
+ marginLeft: "kitt.2",
3296
+ children: /*#__PURE__*/jsx(ButtonBadge, {
3297
+ withBadge: withBadge,
3298
+ badgeCount: badgeCount
3299
+ })
3237
3300
  }) : null]
3238
3301
  });
3239
3302
  }
@@ -3271,22 +3334,19 @@ function ButtonContent({
3271
3334
  }
3272
3335
 
3273
3336
  function getCurrentPaddingConfig({
3274
- size,
3275
- isDisabled
3337
+ size
3276
3338
  }) {
3277
3339
  if (size === 'large') return 'large';
3278
3340
  if (size === 'xLarge') return 'xLarge';
3279
- if (isDisabled) return 'disabled';
3280
3341
  return 'default';
3281
3342
  }
3282
3343
  function ButtonPadding({
3283
3344
  children,
3284
3345
  size,
3285
- isDisabled
3346
+ hasBadge
3286
3347
  }) {
3287
3348
  const currentPaddingKey = getCurrentPaddingConfig({
3288
- size,
3289
- isDisabled
3349
+ size
3290
3350
  });
3291
3351
  return /*#__PURE__*/jsx(View, {
3292
3352
  position: "relative",
@@ -3295,6 +3355,7 @@ function ButtonPadding({
3295
3355
  justifyContent: "center",
3296
3356
  paddingX: `kitt.button.padding.${currentPaddingKey}.horizontal`,
3297
3357
  paddingY: `kitt.button.padding.${currentPaddingKey}.vertical`,
3358
+ paddingRight: hasBadge ? `kitt.button.padding.${currentPaddingKey}.hasBadge.right` : undefined,
3298
3359
  minHeight: "kitt.button.minHeight",
3299
3360
  children: children
3300
3361
  });
@@ -3417,6 +3478,8 @@ const Button = /*#__PURE__*/forwardRef(({
3417
3478
  testID,
3418
3479
  href,
3419
3480
  hrefAttrs,
3481
+ withBadge,
3482
+ badgeCount,
3420
3483
  accessibilityRole = 'button',
3421
3484
  innerSpacing = 'center',
3422
3485
  isHoveredInternal,
@@ -3481,13 +3544,15 @@ const Button = /*#__PURE__*/forwardRef(({
3481
3544
  isStretch: stretch,
3482
3545
  children: /*#__PURE__*/jsxs(ButtonPadding, {
3483
3546
  size: size,
3484
- isDisabled: disabled,
3547
+ hasBadge: Boolean(withBadge || badgeCount && badgeCount > 0),
3485
3548
  children: [/*#__PURE__*/jsx(ButtonContent, {
3486
3549
  type: type,
3487
3550
  variant: variant,
3488
3551
  isDisabled: disabled,
3489
3552
  icon: icon,
3490
3553
  iconPosition: iconPosition,
3554
+ withBadge: withBadge,
3555
+ badgeCount: badgeCount,
3491
3556
  isHovered: isHovered,
3492
3557
  isPressed: isPressed,
3493
3558
  isFocused: isFocused,
@@ -8471,7 +8536,7 @@ function IconButton({
8471
8536
  ariaLabel,
8472
8537
  accessibilityRole = 'button',
8473
8538
  withBadge,
8474
- bagdeCount,
8539
+ badgeCount,
8475
8540
  isHoveredInternal,
8476
8541
  isPressedInternal,
8477
8542
  isFocusedInternal,
@@ -8534,32 +8599,13 @@ function IconButton({
8534
8599
  icon: icon
8535
8600
  })
8536
8601
  })]
8537
- }), withBadge ? /*#__PURE__*/jsx(View, {
8538
- height: "10px",
8539
- width: "10px",
8540
- backgroundColor: lateOceanColorPalette['coral.10'],
8541
- borderRadius: "kitt.iconButton.borderRadius",
8542
- position: "absolute",
8543
- top: "1px",
8544
- right: "1px"
8545
- }) : null, !withBadge && bagdeCount && bagdeCount > 0 ? /*#__PURE__*/jsx(View, {
8546
- height: "20px",
8547
- width: "20px",
8548
- backgroundColor: lateOceanColorPalette['coral.10'],
8549
- borderRadius: "kitt.iconButton.borderRadius",
8602
+ }), withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsx(View, {
8550
8603
  position: "absolute",
8551
- top: "-6px",
8552
- right: "-6px",
8553
- children: /*#__PURE__*/jsx(View, {
8554
- alignItems: "center",
8555
- justifyContent: "center",
8556
- marginTop: "2px",
8557
- children: /*#__PURE__*/jsx(Typography.Text, {
8558
- base: "body-xs",
8559
- variant: "bold",
8560
- color: "white",
8561
- children: bagdeCount > 5 ? '+5' : bagdeCount
8562
- })
8604
+ top: withBadge ? '1px' : '-6px',
8605
+ right: withBadge ? '1px' : '-6px',
8606
+ children: /*#__PURE__*/jsx(ButtonBadge, {
8607
+ withBadge: withBadge,
8608
+ badgeCount: badgeCount
8563
8609
  })
8564
8610
  }) : null]
8565
8611
  });
@@ -9551,6 +9597,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
9551
9597
  backgroundColor: theme.skeleton.backgroundColor,
9552
9598
  flareColor: theme.skeleton.flareColor
9553
9599
  },
9600
+ buttonBadge: {
9601
+ backgroundColor: theme.buttonBadge.backgroundColor
9602
+ },
9554
9603
  iconButton: {
9555
9604
  borderColor: theme.iconButton.borderColor,
9556
9605
  disabled: {
@@ -9739,6 +9788,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
9739
9788
  button: {
9740
9789
  borderRadius: theme.button.borderRadius
9741
9790
  },
9791
+ buttonBadge: {
9792
+ borderRadius: theme.buttonBadge.borderRadius
9793
+ },
9742
9794
  card: {
9743
9795
  borderRadius: theme.card.borderRadius
9744
9796
  },
@@ -10118,6 +10170,18 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
10118
10170
  maxWidth: theme.button.maxWidth,
10119
10171
  minHeight: theme.button.minHeight
10120
10172
  },
10173
+ buttonBadge: {
10174
+ dimensions: {
10175
+ withBadge: {
10176
+ width: theme.buttonBadge.dimensions.withBadge.width,
10177
+ height: theme.buttonBadge.dimensions.withBadge.height
10178
+ },
10179
+ badgeCount: {
10180
+ width: theme.buttonBadge.dimensions.badgeCount.width,
10181
+ height: theme.buttonBadge.dimensions.badgeCount.height
10182
+ }
10183
+ }
10184
+ },
10121
10185
  icon: theme.icon,
10122
10186
  cardModal: {
10123
10187
  header: {
@@ -13946,5 +14010,5 @@ function VerticalSteps({
13946
14010
  VerticalSteps.Step = Step;
13947
14011
  VerticalSteps.BorderlessStep = BorderlessStep;
13948
14012
 
13949
- 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 };
14013
+ 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 };
13950
14014
  //# sourceMappingURL=index-node-20.10.es.mjs.map