@fibery/ui-kit 1.28.2 → 1.28.3
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fibery/ui-kit",
|
|
3
|
-
"version": "1.28.
|
|
3
|
+
"version": "1.28.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"files": [
|
|
6
6
|
"src/antd/styles.ts",
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
"screenfull": "6.0.1",
|
|
77
77
|
"ua-parser-js": "0.7.24",
|
|
78
78
|
"@fibery/emoji-data": "2.4.0",
|
|
79
|
-
"@fibery/
|
|
80
|
-
"@fibery/
|
|
79
|
+
"@fibery/react": "1.3.1",
|
|
80
|
+
"@fibery/helpers": "1.2.0"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
83
|
"react": "^18.2.0",
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import {styled} from "@linaria/react";
|
|
2
|
+
import {css} from "@linaria/core";
|
|
2
3
|
import {Children, cloneElement, forwardRef} from "react";
|
|
3
4
|
import {ButtonBase, ButtonBaseProps} from "./button-base";
|
|
4
5
|
import {IconProps} from "../icons/types";
|
|
6
|
+
import cx from "classnames";
|
|
5
7
|
|
|
6
8
|
export type IconButtonSize = "super-small" | "small" | "normal" | "big";
|
|
7
9
|
|
|
@@ -24,8 +26,12 @@ type StyledProps = {
|
|
|
24
26
|
|
|
25
27
|
const getPadding = ({size}: StyledProps) => Paddings[size];
|
|
26
28
|
|
|
29
|
+
const weight = css``;
|
|
30
|
+
|
|
27
31
|
const StyledIconButton = styled(ButtonBase)<StyledProps>`
|
|
28
|
-
|
|
32
|
+
&.${weight} {
|
|
33
|
+
padding: ${getPadding}px;
|
|
34
|
+
}
|
|
29
35
|
`;
|
|
30
36
|
|
|
31
37
|
export const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton(
|
|
@@ -35,7 +41,7 @@ export const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(functio
|
|
|
35
41
|
const iconNode = Children.only(children) as React.ReactElement<IconProps>;
|
|
36
42
|
|
|
37
43
|
return (
|
|
38
|
-
<StyledIconButton ref={ref} size={size} className={className} borderless {...rest}>
|
|
44
|
+
<StyledIconButton ref={ref} size={size} className={cx(className, weight)} borderless {...rest}>
|
|
39
45
|
{/* maybe better to use css variables? */}
|
|
40
46
|
{cloneElement(iconNode, {color: iconNode.props.color || "inherit"})}
|
|
41
47
|
</StyledIconButton>
|