@ornikar/kitt-universal 25.23.0 → 25.24.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,15 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [25.24.0](https://github.com/ornikar/kitt/compare/@ornikar/kitt-universal@25.23.0...@ornikar/kitt-universal@25.24.0) (2024-10-17)
7
+
8
+
9
+ ### Features
10
+
11
+ * button inner spacing [no issue] ([#2486](https://github.com/ornikar/kitt/issues/2486)) ([6018fb4](https://github.com/ornikar/kitt/commit/6018fb4b9192ebc5763c5dfeaf5c18bc9e2c0339))
12
+
13
+
14
+
6
15
  ## [25.23.0](https://github.com/ornikar/kitt/compare/@ornikar/kitt-universal@25.22.0...@ornikar/kitt-universal@25.23.0) (2024-10-16)
7
16
 
8
17
 
@@ -1,5 +1,5 @@
1
1
  import type { ReactElement, ReactNode } from 'react';
2
- import type { PressableProps } from '../native-base/primitives';
2
+ import type { PressableProps, ViewProps } from '../native-base/primitives';
3
3
  import type { ResponsiveValue } from '../utils/createResponsiveStyleFromProp/createResponsiveStyleFromProp';
4
4
  export type SubtleButtonType = 'subtle' | 'subtle-dark' | 'subtle-revert';
5
5
  export type ButtonType = 'primary' | 'default' | 'dark' | SubtleButtonType | 'danger';
@@ -27,6 +27,7 @@ export interface ButtonProps extends Pick<PressableProps, 'onPress' | 'onHoverIn
27
27
  href?: PressableProps['href'];
28
28
  hrefAttrs?: PressableProps['hrefAttrs'];
29
29
  accessibilityRole?: PressableProps['accessibilityRole'];
30
+ innerSpacing?: ViewProps['justifyContent'];
30
31
  /**
31
32
  * @deprecated props className is not supported
32
33
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,E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ACnB,OAAO,CAAC,EAAE,eAAe,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;IAC/C;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,MAAM,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC;IAClC,IAAI,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IAC9B,SAAS,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;IACxC,iBAAiB,CAAC,EAAE,cAAc,CAAC,mBAAmB,CAAC,CAAC;IACxD,YAAY,CAAC,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC3C;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IAChC,kCAAkC;IAClC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,kCAAkC;IAClC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,kCAAkC;IAClC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,OAAO,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;CACrC;AAED,eAAO,MAAM,MAAM,uOAwGlB,CAAC"}
@@ -15,7 +15,7 @@ interface ButtonContentChildrenProps extends Except<ButtonProps, 'onPress' | 'di
15
15
  type: NonNullable<ButtonType>;
16
16
  color: TypographyColor;
17
17
  }
18
- export declare function ButtonContentChildren({ type, icon, iconPosition, color, children, }: ButtonContentChildrenProps): ReactNode;
19
- export declare function ButtonContent({ type, variant, isDisabled, icon, children, isHovered, isPressed, isFocused, ...props }: ButtonContentProps): ReactNode;
18
+ export declare function ButtonContentChildren({ type, icon, iconPosition, innerSpacing, color, children, }: ButtonContentChildrenProps): ReactNode;
19
+ export declare function ButtonContent({ type, variant, isDisabled, icon, children, isHovered, isPressed, isFocused, innerSpacing, ...props }: ButtonContentProps): ReactNode;
20
20
  export {};
21
21
  //# sourceMappingURL=ButtonContent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonContent.d.ts","sourceRoot":"","sources":["../../../src/Button/ButtonContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAGhE,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAkBvE,UAAU,kBAAmB,SAAQ,MAAM,CAAC,WAAW,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;IAC1F,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;IAC9B,OAAO,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;IACpC,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,UAAU,0BAA2B,SAAQ,MAAM,CAAC,WAAW,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;IAClG,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;IAC9B,KAAK,EAAE,eAAe,CAAC;CACxB;AAED,wBAAgB,qBAAqB,CAAC,EACpC,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,QAAQ,GACT,EAAE,0BAA0B,GAAG,SAAS,CAiDxC;AAED,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,OAAO,EACP,UAAU,EACV,IAA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Y,EACZ,GAAG,KAAK,EACT,EAAE,kBAAkB,GAAG,SAAS,CAyBhC"}
@@ -3065,7 +3065,7 @@ const getButtonTextColorByType = (type, variant, isHovered, isPressed) => {
3065
3065
  }
3066
3066
  };
3067
3067
 
3068
- const _excluded$P = ["type", "variant", "isDisabled", "icon", "children", "isHovered", "isPressed", "isFocused"];
3068
+ const _excluded$P = ["type", "variant", "isDisabled", "icon", "children", "isHovered", "isPressed", "isFocused", "innerSpacing"];
3069
3069
  function ButtonIcon({
3070
3070
  icon,
3071
3071
  color,
@@ -3086,6 +3086,7 @@ function ButtonContentChildren({
3086
3086
  type,
3087
3087
  icon,
3088
3088
  iconPosition,
3089
+ innerSpacing,
3089
3090
  color,
3090
3091
  children
3091
3092
  }) {
@@ -3114,7 +3115,7 @@ function ButtonContentChildren({
3114
3115
  };
3115
3116
  return /*#__PURE__*/jsxs(View, {
3116
3117
  alignItems: "center",
3117
- justifyContent: "center",
3118
+ justifyContent: innerSpacing,
3118
3119
  flexDirection: "row",
3119
3120
  children: [icon && iconPosition === 'left' ? /*#__PURE__*/jsx(ButtonIcon, _objectSpread(_objectSpread({}, buttonIconSharedProps), {}, {
3120
3121
  testID: "button.ButtonContent.leftButtonIcon",
@@ -3142,7 +3143,8 @@ function ButtonContent(_ref) {
3142
3143
  children,
3143
3144
  isHovered,
3144
3145
  isPressed,
3145
- isFocused
3146
+ isFocused,
3147
+ innerSpacing
3146
3148
  } = _ref,
3147
3149
  props = _objectWithoutProperties(_ref, _excluded$P);
3148
3150
  const color = isDisabled ? 'black-light' : getButtonTextColorByType(type, variant, isHovered, isPressed);
@@ -3150,7 +3152,7 @@ function ButtonContent(_ref) {
3150
3152
  _web: {
3151
3153
  // Make the multilines case work properly on web
3152
3154
  // We don't apply those styles on native because it will break
3153
- flexGrow: 0,
3155
+ flexGrow: innerSpacing === 'center' ? 0 : 1,
3154
3156
  flexShrink: 1,
3155
3157
  flexBasis: 'auto'
3156
3158
  },
@@ -3158,7 +3160,8 @@ function ButtonContent(_ref) {
3158
3160
  icon: icon,
3159
3161
  type: type,
3160
3162
  isDisabled: isDisabled,
3161
- color: color
3163
+ color: color,
3164
+ innerSpacing: innerSpacing
3162
3165
  }, props), {}, {
3163
3166
  children: children
3164
3167
  }))
@@ -3313,6 +3316,7 @@ const Button = /*#__PURE__*/forwardRef(({
3313
3316
  href,
3314
3317
  hrefAttrs,
3315
3318
  accessibilityRole: _accessibilityRole = 'button',
3319
+ innerSpacing: _innerSpacing = 'center',
3316
3320
  isHoveredInternal,
3317
3321
  isPressedInternal,
3318
3322
  isFocusedInternal,
@@ -3385,6 +3389,7 @@ const Button = /*#__PURE__*/forwardRef(({
3385
3389
  isHovered: isHovered,
3386
3390
  isPressed: isPressed,
3387
3391
  isFocused: isFocused,
3392
+ innerSpacing: _innerSpacing,
3388
3393
  children: children
3389
3394
  }), disabled ? /*#__PURE__*/jsx(DisabledBorder, {}) : null, /*#__PURE__*/jsx(FocusBorder, {
3390
3395
  type: _type,