@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
package/dist/index.es.js CHANGED
@@ -679,20 +679,25 @@ var button = {
679
679
  },
680
680
  padding: {
681
681
  "default": {
682
+ hasBadge: {
683
+ right: 8
684
+ },
682
685
  horizontal: 16,
683
686
  vertical: 7
684
687
  },
685
688
  large: {
689
+ hasBadge: {
690
+ right: 12
691
+ },
686
692
  horizontal: 24,
687
693
  vertical: 11
688
694
  },
689
695
  xLarge: {
696
+ hasBadge: {
697
+ right: 12
698
+ },
690
699
  horizontal: 24,
691
700
  vertical: 15
692
- },
693
- disabled: {
694
- horizontal: 14,
695
- vertical: 5
696
701
  }
697
702
  },
698
703
  transition: {
@@ -802,6 +807,24 @@ var button = {
802
807
  }
803
808
  };
804
809
 
810
+ var buttonBadge = {
811
+ backgroundColor: lateOceanColorPalette['coral.10'],
812
+ dimensions: {
813
+ withBadge: {
814
+ width: 10,
815
+ height: 10
816
+ },
817
+ badgeCount: {
818
+ width: 20,
819
+ height: 20
820
+ }
821
+ },
822
+ borderRadius: {
823
+ withBadge: 5,
824
+ badgeCount: 10
825
+ }
826
+ };
827
+
805
828
  var card = {
806
829
  borderRadius: 20,
807
830
  borderWidth: 2,
@@ -2525,6 +2548,7 @@ var theme = {
2525
2548
  forms: forms,
2526
2549
  highlight: highlight,
2527
2550
  icon: icon,
2551
+ buttonBadge: buttonBadge,
2528
2552
  iconButton: iconButton,
2529
2553
  listItem: listItem,
2530
2554
  pageLoader: pageLoader,
@@ -3100,6 +3124,36 @@ Typography.h4 = createHeading(4, 'header4');
3100
3124
  /** @deprecated use Typography.Header6 */
3101
3125
  Typography.h5 = createHeading(5, 'header5');
3102
3126
 
3127
+ function ButtonBadge(_ref) {
3128
+ var withBadge = _ref.withBadge,
3129
+ badgeCount = _ref.badgeCount;
3130
+ if (withBadge) {
3131
+ return /*#__PURE__*/jsx(View, {
3132
+ height: "kitt.buttonBadge.dimensions.withBadge.height",
3133
+ width: "kitt.buttonBadge.dimensions.withBadge.width",
3134
+ backgroundColor: "kitt.buttonBadge.backgroundColor",
3135
+ borderRadius: "kitt.buttonBadge.borderRadius.withBadge"
3136
+ });
3137
+ }
3138
+ if (badgeCount && badgeCount > 0) {
3139
+ return /*#__PURE__*/jsx(VStack, {
3140
+ alignItems: "center",
3141
+ justifyContent: "center",
3142
+ height: "kitt.buttonBadge.dimensions.badgeCount.height",
3143
+ width: "kitt.buttonBadge.dimensions.badgeCount.width",
3144
+ backgroundColor: "kitt.buttonBadge.backgroundColor",
3145
+ borderRadius: "kitt.buttonBadge.borderRadius.badgeCount",
3146
+ children: /*#__PURE__*/jsx(Typography.Text, {
3147
+ base: "body-xs",
3148
+ variant: "bold",
3149
+ color: "white",
3150
+ children: (badgeCount || 0) > 5 ? '+5' : badgeCount
3151
+ })
3152
+ });
3153
+ }
3154
+ return null;
3155
+ }
3156
+
3103
3157
  function Icon(_ref) {
3104
3158
  var icon = _ref.icon,
3105
3159
  _ref$size = _ref.size,
@@ -3218,6 +3272,8 @@ function ButtonContentChildren(_ref2) {
3218
3272
  icon = _ref2.icon,
3219
3273
  iconPosition = _ref2.iconPosition,
3220
3274
  innerSpacing = _ref2.innerSpacing,
3275
+ withBadge = _ref2.withBadge,
3276
+ badgeCount = _ref2.badgeCount,
3221
3277
  color = _ref2.color,
3222
3278
  children = _ref2.children;
3223
3279
  if ((process.env.NODE_ENV !== "production")) {
@@ -3261,7 +3317,13 @@ function ButtonContentChildren(_ref2) {
3261
3317
  children: children
3262
3318
  }), icon && iconPosition === 'right' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread(_objectSpread({}, buttonIconSharedProps), {}, {
3263
3319
  icon: icon
3264
- })) : null]
3320
+ })) : null, withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsx(View, {
3321
+ marginLeft: "kitt.2",
3322
+ children: /*#__PURE__*/jsx(ButtonBadge, {
3323
+ withBadge: withBadge,
3324
+ badgeCount: badgeCount
3325
+ })
3326
+ }) : null]
3265
3327
  });
3266
3328
  }
3267
3329
  function ButtonContent(_ref3) {
@@ -3297,20 +3359,17 @@ function ButtonContent(_ref3) {
3297
3359
  }
3298
3360
 
3299
3361
  function getCurrentPaddingConfig(_ref) {
3300
- var size = _ref.size,
3301
- isDisabled = _ref.isDisabled;
3362
+ var size = _ref.size;
3302
3363
  if (size === 'large') return 'large';
3303
3364
  if (size === 'xLarge') return 'xLarge';
3304
- if (isDisabled) return 'disabled';
3305
3365
  return 'default';
3306
3366
  }
3307
3367
  function ButtonPadding(_ref2) {
3308
3368
  var children = _ref2.children,
3309
3369
  size = _ref2.size,
3310
- isDisabled = _ref2.isDisabled;
3370
+ hasBadge = _ref2.hasBadge;
3311
3371
  var currentPaddingKey = getCurrentPaddingConfig({
3312
- size: size,
3313
- isDisabled: isDisabled
3372
+ size: size
3314
3373
  });
3315
3374
  return /*#__PURE__*/jsx(View, {
3316
3375
  position: "relative",
@@ -3319,6 +3378,7 @@ function ButtonPadding(_ref2) {
3319
3378
  justifyContent: "center",
3320
3379
  paddingX: "kitt.button.padding.".concat(currentPaddingKey, ".horizontal"),
3321
3380
  paddingY: "kitt.button.padding.".concat(currentPaddingKey, ".vertical"),
3381
+ paddingRight: hasBadge ? "kitt.button.padding.".concat(currentPaddingKey, ".hasBadge.right") : undefined,
3322
3382
  minHeight: "kitt.button.minHeight",
3323
3383
  children: children
3324
3384
  });
@@ -3435,6 +3495,8 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
3435
3495
  testID = _ref.testID,
3436
3496
  href = _ref.href,
3437
3497
  hrefAttrs = _ref.hrefAttrs,
3498
+ withBadge = _ref.withBadge,
3499
+ badgeCount = _ref.badgeCount,
3438
3500
  _ref$accessibilityRol = _ref.accessibilityRole,
3439
3501
  accessibilityRole = _ref$accessibilityRol === void 0 ? 'button' : _ref$accessibilityRol,
3440
3502
  _ref$innerSpacing = _ref.innerSpacing,
@@ -3499,13 +3561,15 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
3499
3561
  isStretch: stretch,
3500
3562
  children: /*#__PURE__*/jsxs(ButtonPadding, {
3501
3563
  size: size,
3502
- isDisabled: disabled,
3564
+ hasBadge: Boolean(withBadge || badgeCount && badgeCount > 0),
3503
3565
  children: [/*#__PURE__*/jsx(ButtonContent, {
3504
3566
  type: type,
3505
3567
  variant: variant,
3506
3568
  isDisabled: disabled,
3507
3569
  icon: icon,
3508
3570
  iconPosition: iconPosition,
3571
+ withBadge: withBadge,
3572
+ badgeCount: badgeCount,
3509
3573
  isHovered: isHovered,
3510
3574
  isPressed: isPressed,
3511
3575
  isFocused: isFocused,
@@ -8752,7 +8816,7 @@ function IconButton(_ref) {
8752
8816
  _ref$accessibilityRol = _ref.accessibilityRole,
8753
8817
  accessibilityRole = _ref$accessibilityRol === void 0 ? 'button' : _ref$accessibilityRol,
8754
8818
  withBadge = _ref.withBadge,
8755
- bagdeCount = _ref.bagdeCount,
8819
+ badgeCount = _ref.badgeCount,
8756
8820
  isHoveredInternal = _ref.isHoveredInternal,
8757
8821
  isPressedInternal = _ref.isPressedInternal,
8758
8822
  isFocusedInternal = _ref.isFocusedInternal,
@@ -8812,32 +8876,13 @@ function IconButton(_ref) {
8812
8876
  icon: icon
8813
8877
  })
8814
8878
  })]
8815
- }), withBadge ? /*#__PURE__*/jsx(View, {
8816
- height: "10px",
8817
- width: "10px",
8818
- backgroundColor: lateOceanColorPalette['coral.10'],
8819
- borderRadius: "kitt.iconButton.borderRadius",
8820
- position: "absolute",
8821
- top: "1px",
8822
- right: "1px"
8823
- }) : null, !withBadge && bagdeCount && bagdeCount > 0 ? /*#__PURE__*/jsx(View, {
8824
- height: "20px",
8825
- width: "20px",
8826
- backgroundColor: lateOceanColorPalette['coral.10'],
8827
- borderRadius: "kitt.iconButton.borderRadius",
8879
+ }), withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsx(View, {
8828
8880
  position: "absolute",
8829
- top: "-6px",
8830
- right: "-6px",
8831
- children: /*#__PURE__*/jsx(View, {
8832
- alignItems: "center",
8833
- justifyContent: "center",
8834
- marginTop: "2px",
8835
- children: /*#__PURE__*/jsx(Typography.Text, {
8836
- base: "body-xs",
8837
- variant: "bold",
8838
- color: "white",
8839
- children: bagdeCount > 5 ? '+5' : bagdeCount
8840
- })
8881
+ top: withBadge ? '1px' : '-6px',
8882
+ right: withBadge ? '1px' : '-6px',
8883
+ children: /*#__PURE__*/jsx(ButtonBadge, {
8884
+ withBadge: withBadge,
8885
+ badgeCount: badgeCount
8841
8886
  })
8842
8887
  }) : null]
8843
8888
  });
@@ -9833,6 +9878,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
9833
9878
  backgroundColor: theme.skeleton.backgroundColor,
9834
9879
  flareColor: theme.skeleton.flareColor
9835
9880
  },
9881
+ buttonBadge: {
9882
+ backgroundColor: theme.buttonBadge.backgroundColor
9883
+ },
9836
9884
  iconButton: {
9837
9885
  borderColor: theme.iconButton.borderColor,
9838
9886
  disabled: {
@@ -10020,6 +10068,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
10020
10068
  button: {
10021
10069
  borderRadius: theme.button.borderRadius
10022
10070
  },
10071
+ buttonBadge: {
10072
+ borderRadius: theme.buttonBadge.borderRadius
10073
+ },
10023
10074
  card: {
10024
10075
  borderRadius: theme.card.borderRadius
10025
10076
  },
@@ -10396,6 +10447,18 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
10396
10447
  maxWidth: theme.button.maxWidth,
10397
10448
  minHeight: theme.button.minHeight
10398
10449
  },
10450
+ buttonBadge: {
10451
+ dimensions: {
10452
+ withBadge: {
10453
+ width: theme.buttonBadge.dimensions.withBadge.width,
10454
+ height: theme.buttonBadge.dimensions.withBadge.height
10455
+ },
10456
+ badgeCount: {
10457
+ width: theme.buttonBadge.dimensions.badgeCount.width,
10458
+ height: theme.buttonBadge.dimensions.badgeCount.height
10459
+ }
10460
+ }
10461
+ },
10399
10462
  icon: theme.icon,
10400
10463
  cardModal: {
10401
10464
  header: {
@@ -14244,5 +14307,5 @@ function VerticalSteps(_ref) {
14244
14307
  VerticalSteps.Step = Step;
14245
14308
  VerticalSteps.BorderlessStep = BorderlessStep;
14246
14309
 
14247
- 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 };
14310
+ 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 };
14248
14311
  //# sourceMappingURL=index.es.js.map