@fibery/ui-kit 1.28.1 → 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,9 +1,10 @@
1
1
  {
2
2
  "name": "@fibery/ui-kit",
3
- "version": "1.28.1",
3
+ "version": "1.28.3",
4
4
  "private": false,
5
5
  "files": [
6
6
  "src/antd/styles.ts",
7
+ "src/icon-button.tsx",
7
8
  "src/button.tsx",
8
9
  "src/design-system.ts",
9
10
  "src/theme-styles.ts",
@@ -109,8 +110,8 @@
109
110
  "svgo": "2.8.0",
110
111
  "typescript": "5.1.6",
111
112
  "unist-util-reduce": "0.2.2",
112
- "@fibery/eslint-config": "8.5.1",
113
- "@fibery/babel-preset": "7.4.0"
113
+ "@fibery/babel-preset": "7.4.0",
114
+ "@fibery/eslint-config": "8.5.1"
114
115
  },
115
116
  "jest": {
116
117
  "testEnvironment": "jsdom",
@@ -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
- padding: ${getPadding}px;
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>
@@ -0,0 +1,3 @@
1
+ import {IconButton} from "./button/icon-button";
2
+
3
+ export {IconButton};