@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
@@ -684,20 +684,25 @@ const button = {
684
684
  },
685
685
  padding: {
686
686
  default: {
687
+ hasBadge: {
688
+ right: 8
689
+ },
687
690
  horizontal: 16,
688
691
  vertical: 7
689
692
  },
690
693
  large: {
694
+ hasBadge: {
695
+ right: 12
696
+ },
691
697
  horizontal: 24,
692
698
  vertical: 11
693
699
  },
694
700
  xLarge: {
701
+ hasBadge: {
702
+ right: 12
703
+ },
695
704
  horizontal: 24,
696
705
  vertical: 15
697
- },
698
- disabled: {
699
- horizontal: 14,
700
- vertical: 5
701
706
  }
702
707
  },
703
708
  transition: {
@@ -807,6 +812,24 @@ const button = {
807
812
  }
808
813
  };
809
814
 
815
+ const buttonBadge = {
816
+ backgroundColor: lateOceanColorPalette['coral.10'],
817
+ dimensions: {
818
+ withBadge: {
819
+ width: 10,
820
+ height: 10
821
+ },
822
+ badgeCount: {
823
+ width: 20,
824
+ height: 20
825
+ }
826
+ },
827
+ borderRadius: {
828
+ withBadge: 5,
829
+ badgeCount: 10
830
+ }
831
+ };
832
+
810
833
  const card = {
811
834
  borderRadius: 20,
812
835
  borderWidth: 2,
@@ -2522,6 +2545,7 @@ const theme = {
2522
2545
  forms,
2523
2546
  highlight,
2524
2547
  icon,
2548
+ buttonBadge,
2525
2549
  iconButton,
2526
2550
  listItem,
2527
2551
  pageLoader,
@@ -3086,6 +3110,37 @@ Typography.h4 = createHeading(4, 'header4');
3086
3110
  /** @deprecated use Typography.Header6 */
3087
3111
  Typography.h5 = createHeading(5, 'header5');
3088
3112
 
3113
+ function ButtonBadge({
3114
+ withBadge,
3115
+ badgeCount
3116
+ }) {
3117
+ if (withBadge) {
3118
+ return /*#__PURE__*/jsxRuntime.jsx(View, {
3119
+ height: "kitt.buttonBadge.dimensions.withBadge.height",
3120
+ width: "kitt.buttonBadge.dimensions.withBadge.width",
3121
+ backgroundColor: "kitt.buttonBadge.backgroundColor",
3122
+ borderRadius: "kitt.buttonBadge.borderRadius.withBadge"
3123
+ });
3124
+ }
3125
+ if (badgeCount && badgeCount > 0) {
3126
+ return /*#__PURE__*/jsxRuntime.jsx(VStack, {
3127
+ alignItems: "center",
3128
+ justifyContent: "center",
3129
+ height: "kitt.buttonBadge.dimensions.badgeCount.height",
3130
+ width: "kitt.buttonBadge.dimensions.badgeCount.width",
3131
+ backgroundColor: "kitt.buttonBadge.backgroundColor",
3132
+ borderRadius: "kitt.buttonBadge.borderRadius.badgeCount",
3133
+ children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
3134
+ base: "body-xs",
3135
+ variant: "bold",
3136
+ color: "white",
3137
+ children: (badgeCount || 0) > 5 ? '+5' : badgeCount
3138
+ })
3139
+ });
3140
+ }
3141
+ return null;
3142
+ }
3143
+
3089
3144
  function Icon({
3090
3145
  icon,
3091
3146
  size = 'kitt.icon.defaultSize',
@@ -3211,6 +3266,8 @@ function ButtonContentChildren({
3211
3266
  icon,
3212
3267
  iconPosition,
3213
3268
  innerSpacing,
3269
+ withBadge,
3270
+ badgeCount,
3214
3271
  color,
3215
3272
  children
3216
3273
  }) {
@@ -3257,6 +3314,12 @@ function ButtonContentChildren({
3257
3314
  }), icon && iconPosition === 'right' ? /*#__PURE__*/jsxRuntime.jsx(ButtonIcon, {
3258
3315
  ...buttonIconSharedProps,
3259
3316
  icon: icon
3317
+ }) : null, withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsxRuntime.jsx(View, {
3318
+ marginLeft: "kitt.2",
3319
+ children: /*#__PURE__*/jsxRuntime.jsx(ButtonBadge, {
3320
+ withBadge: withBadge,
3321
+ badgeCount: badgeCount
3322
+ })
3260
3323
  }) : null]
3261
3324
  });
3262
3325
  }
@@ -3294,22 +3357,19 @@ function ButtonContent({
3294
3357
  }
3295
3358
 
3296
3359
  function getCurrentPaddingConfig({
3297
- size,
3298
- isDisabled
3360
+ size
3299
3361
  }) {
3300
3362
  if (size === 'large') return 'large';
3301
3363
  if (size === 'xLarge') return 'xLarge';
3302
- if (isDisabled) return 'disabled';
3303
3364
  return 'default';
3304
3365
  }
3305
3366
  function ButtonPadding({
3306
3367
  children,
3307
3368
  size,
3308
- isDisabled
3369
+ hasBadge
3309
3370
  }) {
3310
3371
  const currentPaddingKey = getCurrentPaddingConfig({
3311
- size,
3312
- isDisabled
3372
+ size
3313
3373
  });
3314
3374
  return /*#__PURE__*/jsxRuntime.jsx(View, {
3315
3375
  position: "relative",
@@ -3318,6 +3378,7 @@ function ButtonPadding({
3318
3378
  justifyContent: "center",
3319
3379
  paddingX: `kitt.button.padding.${currentPaddingKey}.horizontal`,
3320
3380
  paddingY: `kitt.button.padding.${currentPaddingKey}.vertical`,
3381
+ paddingRight: hasBadge ? `kitt.button.padding.${currentPaddingKey}.hasBadge.right` : undefined,
3321
3382
  minHeight: "kitt.button.minHeight",
3322
3383
  children: children
3323
3384
  });
@@ -3440,6 +3501,8 @@ const Button = /*#__PURE__*/React.forwardRef(({
3440
3501
  testID,
3441
3502
  href,
3442
3503
  hrefAttrs,
3504
+ withBadge,
3505
+ badgeCount,
3443
3506
  accessibilityRole = 'button',
3444
3507
  innerSpacing = 'center',
3445
3508
  isHoveredInternal,
@@ -3504,13 +3567,15 @@ const Button = /*#__PURE__*/React.forwardRef(({
3504
3567
  isStretch: stretch,
3505
3568
  children: /*#__PURE__*/jsxRuntime.jsxs(ButtonPadding, {
3506
3569
  size: size,
3507
- isDisabled: disabled,
3570
+ hasBadge: Boolean(withBadge || badgeCount && badgeCount > 0),
3508
3571
  children: [/*#__PURE__*/jsxRuntime.jsx(ButtonContent, {
3509
3572
  type: type,
3510
3573
  variant: variant,
3511
3574
  isDisabled: disabled,
3512
3575
  icon: icon,
3513
3576
  iconPosition: iconPosition,
3577
+ withBadge: withBadge,
3578
+ badgeCount: badgeCount,
3514
3579
  isHovered: isHovered,
3515
3580
  isPressed: isPressed,
3516
3581
  isFocused: isFocused,
@@ -8494,7 +8559,7 @@ function IconButton({
8494
8559
  ariaLabel,
8495
8560
  accessibilityRole = 'button',
8496
8561
  withBadge,
8497
- bagdeCount,
8562
+ badgeCount,
8498
8563
  isHoveredInternal,
8499
8564
  isPressedInternal,
8500
8565
  isFocusedInternal,
@@ -8557,32 +8622,13 @@ function IconButton({
8557
8622
  icon: icon
8558
8623
  })
8559
8624
  })]
8560
- }), withBadge ? /*#__PURE__*/jsxRuntime.jsx(View, {
8561
- height: "10px",
8562
- width: "10px",
8563
- backgroundColor: lateOceanColorPalette['coral.10'],
8564
- borderRadius: "kitt.iconButton.borderRadius",
8565
- position: "absolute",
8566
- top: "1px",
8567
- right: "1px"
8568
- }) : null, !withBadge && bagdeCount && bagdeCount > 0 ? /*#__PURE__*/jsxRuntime.jsx(View, {
8569
- height: "20px",
8570
- width: "20px",
8571
- backgroundColor: lateOceanColorPalette['coral.10'],
8572
- borderRadius: "kitt.iconButton.borderRadius",
8625
+ }), withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsxRuntime.jsx(View, {
8573
8626
  position: "absolute",
8574
- top: "-6px",
8575
- right: "-6px",
8576
- children: /*#__PURE__*/jsxRuntime.jsx(View, {
8577
- alignItems: "center",
8578
- justifyContent: "center",
8579
- marginTop: "2px",
8580
- children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
8581
- base: "body-xs",
8582
- variant: "bold",
8583
- color: "white",
8584
- children: bagdeCount > 5 ? '+5' : bagdeCount
8585
- })
8627
+ top: withBadge ? '1px' : '-6px',
8628
+ right: withBadge ? '1px' : '-6px',
8629
+ children: /*#__PURE__*/jsxRuntime.jsx(ButtonBadge, {
8630
+ withBadge: withBadge,
8631
+ badgeCount: badgeCount
8586
8632
  })
8587
8633
  }) : null]
8588
8634
  });
@@ -9574,6 +9620,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
9574
9620
  backgroundColor: theme.skeleton.backgroundColor,
9575
9621
  flareColor: theme.skeleton.flareColor
9576
9622
  },
9623
+ buttonBadge: {
9624
+ backgroundColor: theme.buttonBadge.backgroundColor
9625
+ },
9577
9626
  iconButton: {
9578
9627
  borderColor: theme.iconButton.borderColor,
9579
9628
  disabled: {
@@ -9762,6 +9811,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
9762
9811
  button: {
9763
9812
  borderRadius: theme.button.borderRadius
9764
9813
  },
9814
+ buttonBadge: {
9815
+ borderRadius: theme.buttonBadge.borderRadius
9816
+ },
9765
9817
  card: {
9766
9818
  borderRadius: theme.card.borderRadius
9767
9819
  },
@@ -10141,6 +10193,18 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
10141
10193
  maxWidth: theme.button.maxWidth,
10142
10194
  minHeight: theme.button.minHeight
10143
10195
  },
10196
+ buttonBadge: {
10197
+ dimensions: {
10198
+ withBadge: {
10199
+ width: theme.buttonBadge.dimensions.withBadge.width,
10200
+ height: theme.buttonBadge.dimensions.withBadge.height
10201
+ },
10202
+ badgeCount: {
10203
+ width: theme.buttonBadge.dimensions.badgeCount.width,
10204
+ height: theme.buttonBadge.dimensions.badgeCount.height
10205
+ }
10206
+ }
10207
+ },
10144
10208
  icon: theme.icon,
10145
10209
  cardModal: {
10146
10210
  header: {
@@ -13981,6 +14045,7 @@ exports.Autocomplete = Autocomplete;
13981
14045
  exports.Avatar = Avatar;
13982
14046
  exports.BottomSheet = BottomSheet;
13983
14047
  exports.Button = Button;
14048
+ exports.ButtonBadge = ButtonBadge;
13984
14049
  exports.CardModal = CardModal;
13985
14050
  exports.Center = Center;
13986
14051
  exports.Checkbox = Checkbox;