@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
@@ -664,20 +664,25 @@ const button = {
664
664
  },
665
665
  padding: {
666
666
  default: {
667
+ hasBadge: {
668
+ right: 8
669
+ },
667
670
  horizontal: 16,
668
671
  vertical: 7
669
672
  },
670
673
  large: {
674
+ hasBadge: {
675
+ right: 12
676
+ },
671
677
  horizontal: 24,
672
678
  vertical: 11
673
679
  },
674
680
  xLarge: {
681
+ hasBadge: {
682
+ right: 12
683
+ },
675
684
  horizontal: 24,
676
685
  vertical: 15
677
- },
678
- disabled: {
679
- horizontal: 14,
680
- vertical: 5
681
686
  }
682
687
  },
683
688
  transition: {
@@ -787,6 +792,24 @@ const button = {
787
792
  }
788
793
  };
789
794
 
795
+ const buttonBadge = {
796
+ backgroundColor: lateOceanColorPalette['coral.10'],
797
+ dimensions: {
798
+ withBadge: {
799
+ width: 10,
800
+ height: 10
801
+ },
802
+ badgeCount: {
803
+ width: 20,
804
+ height: 20
805
+ }
806
+ },
807
+ borderRadius: {
808
+ withBadge: 5,
809
+ badgeCount: 10
810
+ }
811
+ };
812
+
790
813
  const card = {
791
814
  borderRadius: 20,
792
815
  borderWidth: 2,
@@ -2502,6 +2525,7 @@ const theme = {
2502
2525
  forms,
2503
2526
  highlight,
2504
2527
  icon,
2528
+ buttonBadge,
2505
2529
  iconButton,
2506
2530
  listItem,
2507
2531
  pageLoader,
@@ -3110,6 +3134,37 @@ Typography.h4 = createHeading(4, 'header4');
3110
3134
  /** @deprecated use Typography.Header6 */
3111
3135
  Typography.h5 = createHeading(5, 'header5');
3112
3136
 
3137
+ function ButtonBadge({
3138
+ withBadge,
3139
+ badgeCount
3140
+ }) {
3141
+ if (withBadge) {
3142
+ return /*#__PURE__*/jsxRuntime.jsx(View, {
3143
+ height: "kitt.buttonBadge.dimensions.withBadge.height",
3144
+ width: "kitt.buttonBadge.dimensions.withBadge.width",
3145
+ backgroundColor: "kitt.buttonBadge.backgroundColor",
3146
+ borderRadius: "kitt.buttonBadge.borderRadius.withBadge"
3147
+ });
3148
+ }
3149
+ if (badgeCount && badgeCount > 0) {
3150
+ return /*#__PURE__*/jsxRuntime.jsx(VStack, {
3151
+ alignItems: "center",
3152
+ justifyContent: "center",
3153
+ height: "kitt.buttonBadge.dimensions.badgeCount.height",
3154
+ width: "kitt.buttonBadge.dimensions.badgeCount.width",
3155
+ backgroundColor: "kitt.buttonBadge.backgroundColor",
3156
+ borderRadius: "kitt.buttonBadge.borderRadius.badgeCount",
3157
+ children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
3158
+ base: "body-xs",
3159
+ variant: "bold",
3160
+ color: "white",
3161
+ children: (badgeCount || 0) > 5 ? '+5' : badgeCount
3162
+ })
3163
+ });
3164
+ }
3165
+ return null;
3166
+ }
3167
+
3113
3168
  function Icon({
3114
3169
  icon,
3115
3170
  size = 'kitt.icon.defaultSize',
@@ -3235,6 +3290,8 @@ function ButtonContentChildren({
3235
3290
  icon,
3236
3291
  iconPosition,
3237
3292
  innerSpacing,
3293
+ withBadge,
3294
+ badgeCount,
3238
3295
  color,
3239
3296
  children
3240
3297
  }) {
@@ -3281,6 +3338,12 @@ function ButtonContentChildren({
3281
3338
  }), icon && iconPosition === 'right' ? /*#__PURE__*/jsxRuntime.jsx(ButtonIcon, {
3282
3339
  ...buttonIconSharedProps,
3283
3340
  icon: icon
3341
+ }) : null, withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsxRuntime.jsx(View, {
3342
+ marginLeft: "kitt.2",
3343
+ children: /*#__PURE__*/jsxRuntime.jsx(ButtonBadge, {
3344
+ withBadge: withBadge,
3345
+ badgeCount: badgeCount
3346
+ })
3284
3347
  }) : null]
3285
3348
  });
3286
3349
  }
@@ -3318,22 +3381,19 @@ function ButtonContent({
3318
3381
  }
3319
3382
 
3320
3383
  function getCurrentPaddingConfig({
3321
- size,
3322
- isDisabled
3384
+ size
3323
3385
  }) {
3324
3386
  if (size === 'large') return 'large';
3325
3387
  if (size === 'xLarge') return 'xLarge';
3326
- if (isDisabled) return 'disabled';
3327
3388
  return 'default';
3328
3389
  }
3329
3390
  function ButtonPadding({
3330
3391
  children,
3331
3392
  size,
3332
- isDisabled
3393
+ hasBadge
3333
3394
  }) {
3334
3395
  const currentPaddingKey = getCurrentPaddingConfig({
3335
- size,
3336
- isDisabled
3396
+ size
3337
3397
  });
3338
3398
  return /*#__PURE__*/jsxRuntime.jsx(View, {
3339
3399
  position: "relative",
@@ -3342,6 +3402,7 @@ function ButtonPadding({
3342
3402
  justifyContent: "center",
3343
3403
  paddingX: `kitt.button.padding.${currentPaddingKey}.horizontal`,
3344
3404
  paddingY: `kitt.button.padding.${currentPaddingKey}.vertical`,
3405
+ paddingRight: hasBadge ? `kitt.button.padding.${currentPaddingKey}.hasBadge.right` : undefined,
3345
3406
  minHeight: "kitt.button.minHeight",
3346
3407
  children: children
3347
3408
  });
@@ -3425,6 +3486,8 @@ const Button = /*#__PURE__*/react.forwardRef(({
3425
3486
  testID,
3426
3487
  href,
3427
3488
  hrefAttrs,
3489
+ withBadge,
3490
+ badgeCount,
3428
3491
  accessibilityRole = 'button',
3429
3492
  innerSpacing = 'center',
3430
3493
  isHoveredInternal,
@@ -3486,13 +3549,15 @@ const Button = /*#__PURE__*/react.forwardRef(({
3486
3549
  isStretch: stretch,
3487
3550
  children: /*#__PURE__*/jsxRuntime.jsxs(ButtonPadding, {
3488
3551
  size: size,
3489
- isDisabled: disabled,
3552
+ hasBadge: Boolean(withBadge || badgeCount && badgeCount > 0),
3490
3553
  children: [/*#__PURE__*/jsxRuntime.jsx(ButtonContent, {
3491
3554
  type: type,
3492
3555
  variant: variant,
3493
3556
  isDisabled: disabled,
3494
3557
  icon: icon,
3495
3558
  iconPosition: iconPosition,
3559
+ withBadge: withBadge,
3560
+ badgeCount: badgeCount,
3496
3561
  isHovered: isHovered,
3497
3562
  isPressed: isPressed,
3498
3563
  isFocused: isFocused,
@@ -7636,7 +7701,7 @@ function IconButton({
7636
7701
  ariaLabel,
7637
7702
  accessibilityRole = 'button',
7638
7703
  withBadge,
7639
- bagdeCount,
7704
+ badgeCount,
7640
7705
  isHoveredInternal,
7641
7706
  isPressedInternal,
7642
7707
  isFocusedInternal,
@@ -7696,32 +7761,13 @@ function IconButton({
7696
7761
  icon: icon
7697
7762
  })
7698
7763
  })]
7699
- }), withBadge ? /*#__PURE__*/jsxRuntime.jsx(View, {
7700
- height: "10px",
7701
- width: "10px",
7702
- backgroundColor: lateOceanColorPalette['coral.10'],
7703
- borderRadius: "kitt.iconButton.borderRadius",
7764
+ }), withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsxRuntime.jsx(View, {
7704
7765
  position: "absolute",
7705
- top: "1px",
7706
- right: "1px"
7707
- }) : null, !withBadge && bagdeCount && bagdeCount > 0 ? /*#__PURE__*/jsxRuntime.jsx(View, {
7708
- height: "20px",
7709
- width: "20px",
7710
- backgroundColor: lateOceanColorPalette['coral.10'],
7711
- borderRadius: "kitt.iconButton.borderRadius",
7712
- position: "absolute",
7713
- top: "-6px",
7714
- right: "-6px",
7715
- children: /*#__PURE__*/jsxRuntime.jsx(View, {
7716
- alignItems: "center",
7717
- justifyContent: "center",
7718
- marginTop: "2px",
7719
- children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
7720
- base: "body-xs",
7721
- variant: "bold",
7722
- color: "white",
7723
- children: bagdeCount > 5 ? '+5' : bagdeCount
7724
- })
7766
+ top: withBadge ? '1px' : '-6px',
7767
+ right: withBadge ? '1px' : '-6px',
7768
+ children: /*#__PURE__*/jsxRuntime.jsx(ButtonBadge, {
7769
+ withBadge: withBadge,
7770
+ badgeCount: badgeCount
7725
7771
  })
7726
7772
  }) : null]
7727
7773
  });
@@ -8796,6 +8842,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
8796
8842
  backgroundColor: theme.skeleton.backgroundColor,
8797
8843
  flareColor: theme.skeleton.flareColor
8798
8844
  },
8845
+ buttonBadge: {
8846
+ backgroundColor: theme.buttonBadge.backgroundColor
8847
+ },
8799
8848
  iconButton: {
8800
8849
  borderColor: theme.iconButton.borderColor,
8801
8850
  disabled: {
@@ -8984,6 +9033,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
8984
9033
  button: {
8985
9034
  borderRadius: theme.button.borderRadius
8986
9035
  },
9036
+ buttonBadge: {
9037
+ borderRadius: theme.buttonBadge.borderRadius
9038
+ },
8987
9039
  card: {
8988
9040
  borderRadius: theme.card.borderRadius
8989
9041
  },
@@ -9363,6 +9415,18 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
9363
9415
  maxWidth: theme.button.maxWidth,
9364
9416
  minHeight: theme.button.minHeight
9365
9417
  },
9418
+ buttonBadge: {
9419
+ dimensions: {
9420
+ withBadge: {
9421
+ width: theme.buttonBadge.dimensions.withBadge.width,
9422
+ height: theme.buttonBadge.dimensions.withBadge.height
9423
+ },
9424
+ badgeCount: {
9425
+ width: theme.buttonBadge.dimensions.badgeCount.width,
9426
+ height: theme.buttonBadge.dimensions.badgeCount.height
9427
+ }
9428
+ }
9429
+ },
9366
9430
  icon: theme.icon,
9367
9431
  cardModal: {
9368
9432
  header: {
@@ -13088,6 +13152,7 @@ exports.Autocomplete = Autocomplete;
13088
13152
  exports.Avatar = Avatar;
13089
13153
  exports.BottomSheet = BottomSheet;
13090
13154
  exports.Button = Button;
13155
+ exports.ButtonBadge = ButtonBadge;
13091
13156
  exports.CardModal = CardModal;
13092
13157
  exports.Center = Center;
13093
13158
  exports.Checkbox = Checkbox;