@sb1/ffe-buttons-react 24.2.2 → 24.3.1

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.
@@ -28,8 +28,8 @@ import classNames from 'classnames';
28
28
  * @ignore
29
29
  */
30
30
  function InlineBaseButtonWithForwardRef(props, ref) {
31
- var _a = props.as, Comp = _a === void 0 ? 'button' : _a, buttonType = props.buttonType, className = props.className, leftIcon = props.leftIcon, rightIcon = props.rightIcon, children = props.children, rest = __rest(props, ["as", "buttonType", "className", "leftIcon", "rightIcon", "children"]);
32
- return (React.createElement(Comp, __assign({ className: classNames('ffe-inline-button', "ffe-inline-button--".concat(buttonType), className) }, rest, { ref: ref }),
31
+ var _a = props.as, Comp = _a === void 0 ? 'button' : _a, buttonType = props.buttonType, className = props.className, leftIcon = props.leftIcon, rightIcon = props.rightIcon, _b = props.size, size = _b === void 0 ? 'md' : _b, _c = props.iconOnly, iconOnly = _c === void 0 ? false : _c, children = props.children, rest = __rest(props, ["as", "buttonType", "className", "leftIcon", "rightIcon", "size", "iconOnly", "children"]);
32
+ return (React.createElement(Comp, __assign({ className: classNames('ffe-inline-button', className, "ffe-inline-button--".concat(size), "ffe-inline-button--".concat(buttonType), { 'ffe-inline-button--icon-only': iconOnly }) }, rest, { ref: ref }),
33
33
  leftIcon &&
34
34
  React.cloneElement(leftIcon, {
35
35
  className: 'ffe-inline-button__icon ffe-inline-button__icon--left',
@@ -34,8 +34,8 @@ var classnames_1 = __importDefault(require("classnames"));
34
34
  * @ignore
35
35
  */
36
36
  function InlineBaseButtonWithForwardRef(props, ref) {
37
- var _a = props.as, Comp = _a === void 0 ? 'button' : _a, buttonType = props.buttonType, className = props.className, leftIcon = props.leftIcon, rightIcon = props.rightIcon, children = props.children, rest = __rest(props, ["as", "buttonType", "className", "leftIcon", "rightIcon", "children"]);
38
- return (react_1.default.createElement(Comp, __assign({ className: (0, classnames_1.default)('ffe-inline-button', "ffe-inline-button--".concat(buttonType), className) }, rest, { ref: ref }),
37
+ var _a = props.as, Comp = _a === void 0 ? 'button' : _a, buttonType = props.buttonType, className = props.className, leftIcon = props.leftIcon, rightIcon = props.rightIcon, _b = props.size, size = _b === void 0 ? 'md' : _b, _c = props.iconOnly, iconOnly = _c === void 0 ? false : _c, children = props.children, rest = __rest(props, ["as", "buttonType", "className", "leftIcon", "rightIcon", "size", "iconOnly", "children"]);
38
+ return (react_1.default.createElement(Comp, __assign({ className: (0, classnames_1.default)('ffe-inline-button', className, "ffe-inline-button--".concat(size), "ffe-inline-button--".concat(buttonType), { 'ffe-inline-button--icon-only': iconOnly }) }, rest, { ref: ref }),
39
39
  leftIcon &&
40
40
  react_1.default.cloneElement(leftIcon, {
41
41
  className: 'ffe-inline-button__icon ffe-inline-button__icon--left',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sb1/ffe-buttons-react",
3
- "version": "24.2.2",
3
+ "version": "24.3.1",
4
4
  "description": "React implementation of ffe-buttons",
5
5
  "keywords": [
6
6
  "ffe"
@@ -29,7 +29,7 @@
29
29
  "test:watch": "ffe-buildtool jest --watch"
30
30
  },
31
31
  "dependencies": {
32
- "@sb1/ffe-buttons": "^21.2.2",
32
+ "@sb1/ffe-buttons": "^21.3.1",
33
33
  "@sb1/ffe-icons-react": "^11.0.20",
34
34
  "classnames": "^2.3.1"
35
35
  },
@@ -45,5 +45,5 @@
45
45
  "publishConfig": {
46
46
  "access": "public"
47
47
  },
48
- "gitHead": "6178a69a187ee277628318f8ede898d1d6cd3462"
48
+ "gitHead": "91a4853d0ff0b12af2b2dfbfc6ebeb7b2653a922"
49
49
  }
@@ -7,8 +7,9 @@ export type BaseButtonProps<As extends ElementType = 'button'> = ComponentAsProp
7
7
  isLoading?: boolean;
8
8
  leftIcon?: ReactElement;
9
9
  rightIcon?: ReactElement;
10
- /** Default md. */
10
+ /** Size of the button, default md. */
11
11
  size?: 'sm' | 'md' | 'lg';
12
+ /** Using only an icon, no label */
12
13
  iconOnly?: boolean;
13
14
  };
14
15
  export declare const BaseButton: <As extends ElementType>(props: {
@@ -22,7 +23,8 @@ export declare const BaseButton: <As extends ElementType>(props: {
22
23
  isLoading?: boolean;
23
24
  leftIcon?: ReactElement;
24
25
  rightIcon?: ReactElement;
25
- /** Default md. */
26
+ /** Size of the button, default md. */
26
27
  size?: "sm" | "md" | "lg";
28
+ /** Using only an icon, no label */
27
29
  iconOnly?: boolean;
28
30
  } & React.RefAttributes<any>) => React.JSX.Element;
@@ -10,6 +10,10 @@ export type InlineBaseButtonProps<As extends ElementType = 'button'> = Component
10
10
  leftIcon?: ReactElement;
11
11
  /** Icon shown to the right of the label */
12
12
  rightIcon?: ReactElement;
13
+ /** Size of the button, default md. */
14
+ size?: 'sm' | 'md' | 'lg';
15
+ /** Using only an icon, no label */
16
+ iconOnly?: boolean;
13
17
  };
14
18
  export declare const InlineBaseButton: <As extends ElementType>(props: {
15
19
  as?: As | undefined;
@@ -25,4 +29,8 @@ export declare const InlineBaseButton: <As extends ElementType>(props: {
25
29
  leftIcon?: ReactElement;
26
30
  /** Icon shown to the right of the label */
27
31
  rightIcon?: ReactElement;
32
+ /** Size of the button, default md. */
33
+ size?: "sm" | "md" | "lg";
34
+ /** Using only an icon, no label */
35
+ iconOnly?: boolean;
28
36
  } & React.RefAttributes<any>) => React.JSX.Element;