@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
@@ -675,20 +675,25 @@ var button = {
675
675
  },
676
676
  padding: {
677
677
  "default": {
678
+ hasBadge: {
679
+ right: 8
680
+ },
678
681
  horizontal: 16,
679
682
  vertical: 7
680
683
  },
681
684
  large: {
685
+ hasBadge: {
686
+ right: 12
687
+ },
682
688
  horizontal: 24,
683
689
  vertical: 11
684
690
  },
685
691
  xLarge: {
692
+ hasBadge: {
693
+ right: 12
694
+ },
686
695
  horizontal: 24,
687
696
  vertical: 15
688
- },
689
- disabled: {
690
- horizontal: 14,
691
- vertical: 5
692
697
  }
693
698
  },
694
699
  transition: {
@@ -798,6 +803,24 @@ var button = {
798
803
  }
799
804
  };
800
805
 
806
+ var buttonBadge = {
807
+ backgroundColor: lateOceanColorPalette['coral.10'],
808
+ dimensions: {
809
+ withBadge: {
810
+ width: 10,
811
+ height: 10
812
+ },
813
+ badgeCount: {
814
+ width: 20,
815
+ height: 20
816
+ }
817
+ },
818
+ borderRadius: {
819
+ withBadge: 5,
820
+ badgeCount: 10
821
+ }
822
+ };
823
+
801
824
  var card = {
802
825
  borderRadius: 20,
803
826
  borderWidth: 2,
@@ -2521,6 +2544,7 @@ var theme = {
2521
2544
  forms: forms,
2522
2545
  highlight: highlight,
2523
2546
  icon: icon,
2547
+ buttonBadge: buttonBadge,
2524
2548
  iconButton: iconButton,
2525
2549
  listItem: listItem,
2526
2550
  pageLoader: pageLoader,
@@ -3137,6 +3161,36 @@ Typography.h4 = createHeading(4, 'header4');
3137
3161
  /** @deprecated use Typography.Header6 */
3138
3162
  Typography.h5 = createHeading(5, 'header5');
3139
3163
 
3164
+ function ButtonBadge(_ref) {
3165
+ var withBadge = _ref.withBadge,
3166
+ badgeCount = _ref.badgeCount;
3167
+ if (withBadge) {
3168
+ return /*#__PURE__*/jsx(View, {
3169
+ height: "kitt.buttonBadge.dimensions.withBadge.height",
3170
+ width: "kitt.buttonBadge.dimensions.withBadge.width",
3171
+ backgroundColor: "kitt.buttonBadge.backgroundColor",
3172
+ borderRadius: "kitt.buttonBadge.borderRadius.withBadge"
3173
+ });
3174
+ }
3175
+ if (badgeCount && badgeCount > 0) {
3176
+ return /*#__PURE__*/jsx(VStack, {
3177
+ alignItems: "center",
3178
+ justifyContent: "center",
3179
+ height: "kitt.buttonBadge.dimensions.badgeCount.height",
3180
+ width: "kitt.buttonBadge.dimensions.badgeCount.width",
3181
+ backgroundColor: "kitt.buttonBadge.backgroundColor",
3182
+ borderRadius: "kitt.buttonBadge.borderRadius.badgeCount",
3183
+ children: /*#__PURE__*/jsx(Typography.Text, {
3184
+ base: "body-xs",
3185
+ variant: "bold",
3186
+ color: "white",
3187
+ children: (badgeCount || 0) > 5 ? '+5' : badgeCount
3188
+ })
3189
+ });
3190
+ }
3191
+ return null;
3192
+ }
3193
+
3140
3194
  function Icon(_ref) {
3141
3195
  var icon = _ref.icon,
3142
3196
  _ref$size = _ref.size,
@@ -3255,6 +3309,8 @@ function ButtonContentChildren(_ref2) {
3255
3309
  icon = _ref2.icon,
3256
3310
  iconPosition = _ref2.iconPosition,
3257
3311
  innerSpacing = _ref2.innerSpacing,
3312
+ withBadge = _ref2.withBadge,
3313
+ badgeCount = _ref2.badgeCount,
3258
3314
  color = _ref2.color,
3259
3315
  children = _ref2.children;
3260
3316
  if ((process.env.NODE_ENV !== "production")) {
@@ -3298,7 +3354,13 @@ function ButtonContentChildren(_ref2) {
3298
3354
  children: children
3299
3355
  }), icon && iconPosition === 'right' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread(_objectSpread({}, buttonIconSharedProps), {}, {
3300
3356
  icon: icon
3301
- })) : null]
3357
+ })) : null, withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsx(View, {
3358
+ marginLeft: "kitt.2",
3359
+ children: /*#__PURE__*/jsx(ButtonBadge, {
3360
+ withBadge: withBadge,
3361
+ badgeCount: badgeCount
3362
+ })
3363
+ }) : null]
3302
3364
  });
3303
3365
  }
3304
3366
  function ButtonContent(_ref3) {
@@ -3334,20 +3396,17 @@ function ButtonContent(_ref3) {
3334
3396
  }
3335
3397
 
3336
3398
  function getCurrentPaddingConfig(_ref) {
3337
- var size = _ref.size,
3338
- isDisabled = _ref.isDisabled;
3399
+ var size = _ref.size;
3339
3400
  if (size === 'large') return 'large';
3340
3401
  if (size === 'xLarge') return 'xLarge';
3341
- if (isDisabled) return 'disabled';
3342
3402
  return 'default';
3343
3403
  }
3344
3404
  function ButtonPadding(_ref2) {
3345
3405
  var children = _ref2.children,
3346
3406
  size = _ref2.size,
3347
- isDisabled = _ref2.isDisabled;
3407
+ hasBadge = _ref2.hasBadge;
3348
3408
  var currentPaddingKey = getCurrentPaddingConfig({
3349
- size: size,
3350
- isDisabled: isDisabled
3409
+ size: size
3351
3410
  });
3352
3411
  return /*#__PURE__*/jsx(View, {
3353
3412
  position: "relative",
@@ -3356,6 +3415,7 @@ function ButtonPadding(_ref2) {
3356
3415
  justifyContent: "center",
3357
3416
  paddingX: "kitt.button.padding.".concat(currentPaddingKey, ".horizontal"),
3358
3417
  paddingY: "kitt.button.padding.".concat(currentPaddingKey, ".vertical"),
3418
+ paddingRight: hasBadge ? "kitt.button.padding.".concat(currentPaddingKey, ".hasBadge.right") : undefined,
3359
3419
  minHeight: "kitt.button.minHeight",
3360
3420
  children: children
3361
3421
  });
@@ -3437,6 +3497,8 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
3437
3497
  testID = _ref.testID,
3438
3498
  href = _ref.href,
3439
3499
  hrefAttrs = _ref.hrefAttrs,
3500
+ withBadge = _ref.withBadge,
3501
+ badgeCount = _ref.badgeCount,
3440
3502
  _ref$accessibilityRol = _ref.accessibilityRole,
3441
3503
  accessibilityRole = _ref$accessibilityRol === void 0 ? 'button' : _ref$accessibilityRol,
3442
3504
  _ref$innerSpacing = _ref.innerSpacing,
@@ -3498,13 +3560,15 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
3498
3560
  isStretch: stretch,
3499
3561
  children: /*#__PURE__*/jsxs(ButtonPadding, {
3500
3562
  size: size,
3501
- isDisabled: disabled,
3563
+ hasBadge: Boolean(withBadge || badgeCount && badgeCount > 0),
3502
3564
  children: [/*#__PURE__*/jsx(ButtonContent, {
3503
3565
  type: type,
3504
3566
  variant: variant,
3505
3567
  isDisabled: disabled,
3506
3568
  icon: icon,
3507
3569
  iconPosition: iconPosition,
3570
+ withBadge: withBadge,
3571
+ badgeCount: badgeCount,
3508
3572
  isHovered: isHovered,
3509
3573
  isPressed: isPressed,
3510
3574
  isFocused: isFocused,
@@ -7819,7 +7883,7 @@ function IconButton(_ref) {
7819
7883
  _ref$accessibilityRol = _ref.accessibilityRole,
7820
7884
  accessibilityRole = _ref$accessibilityRol === void 0 ? 'button' : _ref$accessibilityRol,
7821
7885
  withBadge = _ref.withBadge,
7822
- bagdeCount = _ref.bagdeCount,
7886
+ badgeCount = _ref.badgeCount,
7823
7887
  isHoveredInternal = _ref.isHoveredInternal,
7824
7888
  isPressedInternal = _ref.isPressedInternal,
7825
7889
  isFocusedInternal = _ref.isFocusedInternal,
@@ -7876,32 +7940,13 @@ function IconButton(_ref) {
7876
7940
  icon: icon
7877
7941
  })
7878
7942
  })]
7879
- }), withBadge ? /*#__PURE__*/jsx(View, {
7880
- height: "10px",
7881
- width: "10px",
7882
- backgroundColor: lateOceanColorPalette['coral.10'],
7883
- borderRadius: "kitt.iconButton.borderRadius",
7884
- position: "absolute",
7885
- top: "1px",
7886
- right: "1px"
7887
- }) : null, !withBadge && bagdeCount && bagdeCount > 0 ? /*#__PURE__*/jsx(View, {
7888
- height: "20px",
7889
- width: "20px",
7890
- backgroundColor: lateOceanColorPalette['coral.10'],
7891
- borderRadius: "kitt.iconButton.borderRadius",
7943
+ }), withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsx(View, {
7892
7944
  position: "absolute",
7893
- top: "-6px",
7894
- right: "-6px",
7895
- children: /*#__PURE__*/jsx(View, {
7896
- alignItems: "center",
7897
- justifyContent: "center",
7898
- marginTop: "2px",
7899
- children: /*#__PURE__*/jsx(Typography.Text, {
7900
- base: "body-xs",
7901
- variant: "bold",
7902
- color: "white",
7903
- children: bagdeCount > 5 ? '+5' : bagdeCount
7904
- })
7945
+ top: withBadge ? '1px' : '-6px',
7946
+ right: withBadge ? '1px' : '-6px',
7947
+ children: /*#__PURE__*/jsx(ButtonBadge, {
7948
+ withBadge: withBadge,
7949
+ badgeCount: badgeCount
7905
7950
  })
7906
7951
  }) : null]
7907
7952
  });
@@ -8980,6 +9025,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
8980
9025
  backgroundColor: theme.skeleton.backgroundColor,
8981
9026
  flareColor: theme.skeleton.flareColor
8982
9027
  },
9028
+ buttonBadge: {
9029
+ backgroundColor: theme.buttonBadge.backgroundColor
9030
+ },
8983
9031
  iconButton: {
8984
9032
  borderColor: theme.iconButton.borderColor,
8985
9033
  disabled: {
@@ -9167,6 +9215,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
9167
9215
  button: {
9168
9216
  borderRadius: theme.button.borderRadius
9169
9217
  },
9218
+ buttonBadge: {
9219
+ borderRadius: theme.buttonBadge.borderRadius
9220
+ },
9170
9221
  card: {
9171
9222
  borderRadius: theme.card.borderRadius
9172
9223
  },
@@ -9543,6 +9594,18 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
9543
9594
  maxWidth: theme.button.maxWidth,
9544
9595
  minHeight: theme.button.minHeight
9545
9596
  },
9597
+ buttonBadge: {
9598
+ dimensions: {
9599
+ withBadge: {
9600
+ width: theme.buttonBadge.dimensions.withBadge.width,
9601
+ height: theme.buttonBadge.dimensions.withBadge.height
9602
+ },
9603
+ badgeCount: {
9604
+ width: theme.buttonBadge.dimensions.badgeCount.width,
9605
+ height: theme.buttonBadge.dimensions.badgeCount.height
9606
+ }
9607
+ }
9608
+ },
9546
9609
  icon: theme.icon,
9547
9610
  cardModal: {
9548
9611
  header: {
@@ -13262,5 +13325,5 @@ function VerticalSteps(_ref) {
13262
13325
  VerticalSteps.Step = Step;
13263
13326
  VerticalSteps.BorderlessStep = BorderlessStep;
13264
13327
 
13265
- 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 };
13328
+ 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 };
13266
13329
  //# sourceMappingURL=index.es.web.js.map