@ornikar/kitt-universal 25.52.0 → 25.53.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 +9 -0
- package/dist/definitions/IconButton/IconButton.d.ts +3 -1
- package/dist/definitions/IconButton/IconButton.d.ts.map +1 -1
- package/dist/index-metro.es.android.js +47 -16
- package/dist/index-metro.es.android.js.map +1 -1
- package/dist/index-metro.es.ios.js +47 -16
- package/dist/index-metro.es.ios.js.map +1 -1
- package/dist/index-node-20.10.cjs.js +47 -16
- package/dist/index-node-20.10.cjs.js.map +1 -1
- package/dist/index-node-20.10.cjs.web.js +47 -16
- package/dist/index-node-20.10.cjs.web.js.map +1 -1
- package/dist/index-node-20.10.es.mjs +47 -16
- package/dist/index-node-20.10.es.mjs.map +1 -1
- package/dist/index-node-20.10.es.web.mjs +47 -16
- package/dist/index-node-20.10.es.web.mjs.map +1 -1
- package/dist/index.es.js +47 -16
- package/dist/index.es.js.map +1 -1
- package/dist/index.es.web.js +47 -16
- package/dist/index.es.web.js.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +1 -1
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.53.0](https://github.com/ornikar/kitt/compare/@ornikar/kitt-universal@25.52.0...@ornikar/kitt-universal@25.53.0) (2025-05-19)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* add badge prop for IconButton - OSE-17330 ([#2592](https://github.com/ornikar/kitt/issues/2592)) ([df370d6](https://github.com/ornikar/kitt/commit/df370d68e657b60ace721b7039beed99ef00b40e))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
6
15
|
## [25.52.0](https://github.com/ornikar/kitt/compare/@ornikar/kitt-universal@25.51.0...@ornikar/kitt-universal@25.52.0) (2025-05-15)
|
|
7
16
|
|
|
8
17
|
|
|
@@ -9,6 +9,8 @@ export interface IconButtonProps {
|
|
|
9
9
|
testID?: string;
|
|
10
10
|
ariaLabel?: PressableProps['aria-label'];
|
|
11
11
|
accessibilityRole?: PressableProps['accessibilityRole'];
|
|
12
|
+
withBadge?: boolean;
|
|
13
|
+
bagdeCount?: number;
|
|
12
14
|
/** @internal for story purpose */
|
|
13
15
|
isHoveredInternal?: boolean;
|
|
14
16
|
/** @internal for story purpose */
|
|
@@ -17,6 +19,6 @@ export interface IconButtonProps {
|
|
|
17
19
|
isFocusedInternal?: boolean;
|
|
18
20
|
onPress?: () => void;
|
|
19
21
|
}
|
|
20
|
-
export declare function IconButton({ icon, color, disabled, testID, ariaLabel, accessibilityRole, isHoveredInternal, isPressedInternal, isFocusedInternal, onPress, }: IconButtonProps): ReactNode;
|
|
22
|
+
export declare function IconButton({ icon, color, disabled, testID, ariaLabel, accessibilityRole, withBadge, bagdeCount, isHoveredInternal, isPressedInternal, isFocusedInternal, onPress, }: IconButtonProps): ReactNode;
|
|
21
23
|
export declare function CloseIconButton(props: Except<IconButtonProps, 'icon'>): ReactNode;
|
|
22
24
|
//# sourceMappingURL=IconButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../src/IconButton/IconButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../src/IconButton/IconButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACr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deCount,
|
|
8497
8499
|
isHoveredInternal,
|
|
8498
8500
|
isPressedInternal,
|
|
8499
8501
|
isFocusedInternal,
|
|
@@ -8535,26 +8537,55 @@ function IconButton({
|
|
|
8535
8537
|
}) => {
|
|
8536
8538
|
const isCurrentHovered = isHovered || isHoveredInternal;
|
|
8537
8539
|
const isCurrentPressed = isPressed || isPressedInternal;
|
|
8538
|
-
return /*#__PURE__*/jsxs(
|
|
8539
|
-
|
|
8540
|
-
isHovered: isCurrentHovered,
|
|
8541
|
-
isPressed: isCurrentPressed,
|
|
8542
|
-
scaleStyles: scaleStyles,
|
|
8543
|
-
children: [/*#__PURE__*/jsx(AnimatedBackground, {
|
|
8544
|
-
color: color,
|
|
8540
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
8541
|
+
children: [/*#__PURE__*/jsxs(AnimatedScale, {
|
|
8545
8542
|
isDisabled: disabled,
|
|
8546
8543
|
isHovered: isCurrentHovered,
|
|
8547
8544
|
isPressed: isCurrentPressed,
|
|
8548
|
-
|
|
8549
|
-
|
|
8550
|
-
|
|
8551
|
-
|
|
8552
|
-
|
|
8553
|
-
|
|
8554
|
-
|
|
8555
|
-
|
|
8545
|
+
scaleStyles: scaleStyles,
|
|
8546
|
+
children: [/*#__PURE__*/jsx(AnimatedBackground, {
|
|
8547
|
+
color: color,
|
|
8548
|
+
isDisabled: disabled,
|
|
8549
|
+
isHovered: isCurrentHovered,
|
|
8550
|
+
isPressed: isCurrentPressed,
|
|
8551
|
+
isFocused: isFocused || isFocusedInternal,
|
|
8552
|
+
opacityStyles: opacityStyles
|
|
8553
|
+
}), /*#__PURE__*/jsx(View, {
|
|
8554
|
+
alignItems: "center",
|
|
8555
|
+
justifyContent: "center",
|
|
8556
|
+
children: /*#__PURE__*/jsx(TypographyIcon, {
|
|
8557
|
+
color: getIconButtonTextColorByColor(color, disabled),
|
|
8558
|
+
icon: icon
|
|
8559
|
+
})
|
|
8560
|
+
})]
|
|
8561
|
+
}), withBadge ? /*#__PURE__*/jsx(View, {
|
|
8562
|
+
height: "10px",
|
|
8563
|
+
width: "10px",
|
|
8564
|
+
backgroundColor: lateOceanColorPalette['coral.10'],
|
|
8565
|
+
borderRadius: "kitt.iconButton.borderRadius",
|
|
8566
|
+
position: "absolute",
|
|
8567
|
+
top: "1px",
|
|
8568
|
+
right: "1px"
|
|
8569
|
+
}) : null, !withBadge && bagdeCount && bagdeCount > 0 ? /*#__PURE__*/jsx(View, {
|
|
8570
|
+
height: "20px",
|
|
8571
|
+
width: "20px",
|
|
8572
|
+
backgroundColor: lateOceanColorPalette['coral.10'],
|
|
8573
|
+
borderRadius: "kitt.iconButton.borderRadius",
|
|
8574
|
+
position: "absolute",
|
|
8575
|
+
top: "-6px",
|
|
8576
|
+
right: "-6px",
|
|
8577
|
+
children: /*#__PURE__*/jsx(View, {
|
|
8578
|
+
alignItems: "center",
|
|
8579
|
+
justifyContent: "center",
|
|
8580
|
+
marginTop: "2px",
|
|
8581
|
+
children: /*#__PURE__*/jsx(Typography.Text, {
|
|
8582
|
+
base: "body-xs",
|
|
8583
|
+
variant: "bold",
|
|
8584
|
+
color: "white",
|
|
8585
|
+
children: bagdeCount > 5 ? '+5' : bagdeCount
|
|
8586
|
+
})
|
|
8556
8587
|
})
|
|
8557
|
-
})]
|
|
8588
|
+
}) : null]
|
|
8558
8589
|
});
|
|
8559
8590
|
}
|
|
8560
8591
|
});
|