@sb1/ffe-cards-react 100.12.4 → 101.0.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.
Files changed (39) hide show
  1. package/es/CardBase.js +11 -37
  2. package/es/GroupCard/GroupCard.js +7 -31
  3. package/es/GroupCard/GroupCardElement.js +6 -31
  4. package/es/GroupCard/GroupCardFooter.js +6 -31
  5. package/es/GroupCard/GroupCardTitle.js +6 -31
  6. package/es/IconCard/IconCard.js +19 -36
  7. package/es/IllustrationCard/IllustrationCard.js +11 -34
  8. package/es/ImageCard/ImageCard.js +16 -41
  9. package/es/StippledCard/StippledCard.js +18 -43
  10. package/es/TextCard/TextCard.js +6 -31
  11. package/es/components/CardAction.js +3 -25
  12. package/es/components/CardName.js +2 -24
  13. package/es/components/ComponentBase.js +2 -24
  14. package/es/components/Subtext.js +2 -24
  15. package/es/components/Text.js +2 -24
  16. package/es/components/Title.js +3 -25
  17. package/es/components/WithCardAction.js +12 -35
  18. package/es/fixedForwardRef.js +1 -1
  19. package/es/mergeRefs.js +2 -2
  20. package/lib/CardBase.js +14 -40
  21. package/lib/GroupCard/GroupCard.js +9 -33
  22. package/lib/GroupCard/GroupCardElement.js +9 -34
  23. package/lib/GroupCard/GroupCardFooter.js +9 -34
  24. package/lib/GroupCard/GroupCardTitle.js +9 -34
  25. package/lib/IconCard/IconCard.js +18 -35
  26. package/lib/IllustrationCard/IllustrationCard.js +10 -33
  27. package/lib/ImageCard/ImageCard.js +19 -44
  28. package/lib/StippledCard/StippledCard.js +21 -46
  29. package/lib/TextCard/TextCard.js +9 -34
  30. package/lib/components/CardAction.js +4 -26
  31. package/lib/components/CardName.js +5 -27
  32. package/lib/components/ComponentBase.js +3 -25
  33. package/lib/components/Subtext.js +5 -27
  34. package/lib/components/Text.js +5 -27
  35. package/lib/components/Title.js +6 -28
  36. package/lib/components/WithCardAction.js +16 -39
  37. package/lib/fixedForwardRef.js +1 -1
  38. package/lib/mergeRefs.js +2 -2
  39. package/package.json +6 -6
@@ -1,27 +1,5 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
1
  import React from 'react';
24
2
  export function ComponentBase(props) {
25
- var _a = props.as, Comp = _a === void 0 ? 'p' : _a, rest = __rest(props, ["as"]);
26
- return React.createElement(Comp, __assign({}, rest));
3
+ const { as: Comp = 'p', ...rest } = props;
4
+ return React.createElement(Comp, { ...rest });
27
5
  }
@@ -1,29 +1,7 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
1
  import React from 'react';
24
2
  import classNames from 'classnames';
25
3
  import { ComponentBase } from './ComponentBase';
26
4
  export function Subtext(props) {
27
- var className = props.className, rest = __rest(props, ["className"]);
28
- return (React.createElement(ComponentBase, __assign({ className: classNames('ffe-card-body__subtext', className) }, rest)));
5
+ const { className, ...rest } = props;
6
+ return (React.createElement(ComponentBase, { className: classNames('ffe-card-body__subtext', className), ...rest }));
29
7
  }
@@ -1,29 +1,7 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
1
  import React from 'react';
24
2
  import classNames from 'classnames';
25
3
  import { ComponentBase } from './ComponentBase';
26
4
  export function Text(props) {
27
- var className = props.className, rest = __rest(props, ["className"]);
28
- return (React.createElement(ComponentBase, __assign({ className: classNames('ffe-card-body__text', className) }, rest)));
5
+ const { className, ...rest } = props;
6
+ return (React.createElement(ComponentBase, { className: classNames('ffe-card-body__text', className), ...rest }));
29
7
  }
@@ -1,31 +1,9 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
1
  import React from 'react';
24
2
  import classNames from 'classnames';
25
3
  import { ComponentBase } from './ComponentBase';
26
4
  export function Title(props) {
27
- var className = props.className, overflowEllipsis = props.overflowEllipsis, rest = __rest(props, ["className", "overflowEllipsis"]);
28
- return (React.createElement(ComponentBase, __assign({ className: classNames('ffe-card-body__title', {
5
+ const { className, overflowEllipsis, ...rest } = props;
6
+ return (React.createElement(ComponentBase, { className: classNames('ffe-card-body__title', {
29
7
  'ffe-card-body__title--overflow-ellipsis': overflowEllipsis,
30
- }, className) }, rest)));
8
+ }, className), ...rest }));
31
9
  }
@@ -1,60 +1,37 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
1
  import React, { useCallback, useRef, useState, useEffect, } from 'react';
24
2
  import classNames from 'classnames';
25
3
  import { mergeRefs } from '../mergeRefs';
26
4
  import { CardAction } from './CardAction';
27
5
  import { fixedForwardRef } from '../fixedForwardRef';
28
6
  function WithCardActionForwardRef(props, ref) {
29
- var children = props.children, _a = props.as, Comp = _a === void 0 ? 'div' : _a, onClick = props.onClick, className = props.className, baseClassName = props.baseClassName, rest = __rest(props, ["children", "as", "onClick", "className", "baseClassName"]);
30
- var cardActionInnerRef = useRef(null);
31
- var _b = useState(), isUsingCardAction = _b[0], setIsUsingCardAction = _b[1];
7
+ const { children, as: Comp = 'div', onClick, className, baseClassName, ...rest } = props;
8
+ const cardActionInnerRef = useRef(null);
9
+ const [isUsingCardAction, setIsUsingCardAction] = useState();
32
10
  /** Før att hover og focus skall fungera i browsers som ikke støtter :has.
33
11
  * Allt med klassen '--clickable' kan eftervart fjernes. */
34
- useEffect(function () {
35
- var isStillUsingCardAction = !!cardActionInnerRef.current;
12
+ useEffect(() => {
13
+ const isStillUsingCardAction = !!cardActionInnerRef.current;
36
14
  if (isUsingCardAction !== isStillUsingCardAction) {
37
15
  setIsUsingCardAction(isStillUsingCardAction);
38
16
  }
39
17
  }, [isUsingCardAction]);
40
- var PartialAppliedCardAction = useCallback(function (_a, cardActionRef) {
41
- var cardActionClassName = _a.className, restCardAction = __rest(_a, ["className"]);
42
- return (React.createElement(CardAction, __assign({ className: classNames(cardActionClassName, 'ffe-card__action', {
18
+ const PartialAppliedCardAction = useCallback(({ className: cardActionClassName, ...restCardAction }, cardActionRef) => {
19
+ return (React.createElement(CardAction, { className: classNames(cardActionClassName, 'ffe-card__action', {
43
20
  'ffe-card__action--raw': !cardActionClassName,
44
21
  }), ref: cardActionRef
45
22
  ? mergeRefs([cardActionRef, cardActionInnerRef])
46
- : cardActionInnerRef }, restCardAction)));
23
+ : cardActionInnerRef, ...restCardAction }));
47
24
  }, []);
48
- return (React.createElement(Comp, __assign({}, rest, { className: classNames(className, isUsingCardAction && "".concat(baseClassName, "--clickable")), onClick: function (e) {
25
+ return (React.createElement(Comp, { ...rest, className: classNames(className, isUsingCardAction && `${baseClassName}--clickable`), onClick: (e) => {
49
26
  var _a, _b, _c;
50
- var hasSelectedText = !!((_a = window.getSelection()) === null || _a === void 0 ? void 0 : _a.toString().length);
27
+ const hasSelectedText = !!((_a = window.getSelection()) === null || _a === void 0 ? void 0 : _a.toString().length);
51
28
  if (!hasSelectedText &&
52
29
  !((_b = cardActionInnerRef.current) === null || _b === void 0 ? void 0 : _b.contains(e.target))) {
53
30
  (_c = cardActionInnerRef.current) === null || _c === void 0 ? void 0 : _c.click();
54
31
  }
55
32
  onClick === null || onClick === void 0 ? void 0 : onClick(e);
56
- }, ref: ref }), children({
33
+ }, ref: ref }, children({
57
34
  CardAction: fixedForwardRef(PartialAppliedCardAction),
58
35
  })));
59
36
  }
60
- export var WithCardAction = fixedForwardRef(WithCardActionForwardRef);
37
+ export const WithCardAction = fixedForwardRef(WithCardActionForwardRef);
@@ -1,2 +1,2 @@
1
1
  import { forwardRef } from 'react';
2
- export var fixedForwardRef = forwardRef;
2
+ export const fixedForwardRef = forwardRef;
package/es/mergeRefs.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export function mergeRefs(refs) {
2
- return function (value) {
3
- refs.forEach(function (ref) {
2
+ return value => {
3
+ refs.forEach(ref => {
4
4
  if (typeof ref === 'function') {
5
5
  ref(value);
6
6
  }
package/lib/CardBase.js CHANGED
@@ -1,49 +1,23 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __rest = (this && this.__rest) || function (s, e) {
14
- var t = {};
15
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
- t[p] = s[p];
17
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
- t[p[i]] = s[p[i]];
21
- }
22
- return t;
23
- };
24
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
25
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
26
4
  };
27
5
  Object.defineProperty(exports, "__esModule", { value: true });
28
6
  exports.CardBase = void 0;
29
- var classnames_1 = __importDefault(require("classnames"));
30
- var react_1 = __importDefault(require("react"));
31
- var components_1 = require("./components");
32
- var fixedForwardRef_1 = require("./fixedForwardRef");
7
+ const classnames_1 = __importDefault(require("classnames"));
8
+ const react_1 = __importDefault(require("react"));
9
+ const components_1 = require("./components");
10
+ const fixedForwardRef_1 = require("./fixedForwardRef");
33
11
  function CardBaseWithForwardRef(props, ref) {
34
- var _a;
35
- var className = props.className, noMargin = props.noMargin, textCenter = props.textCenter, _b = props.bgColor, bgColor = _b === void 0 ? 'primary' : _b, noPadding = props.noPadding, _c = props.appearance, appearance = _c === void 0 ? 'default' : _c, children = props.children, rest = __rest(props, ["className", "noMargin", "textCenter", "bgColor", "noPadding", "appearance", "children"]);
36
- return (react_1.default.createElement(components_1.WithCardAction, __assign({ baseClassName: "ffe-card-base", className: (0, classnames_1.default)('ffe-card-base', className, (_a = {},
37
- _a["ffe-card-base--bg-".concat(bgColor)] = bgColor,
38
- _a['ffe-card-base--no-margin'] = noMargin,
39
- _a['ffe-card-base--text-center'] = textCenter,
40
- _a['ffe-card-base--no-padding'] = noPadding,
41
- _a['ffe-default-mode'] = appearance === 'default',
42
- _a)) }, rest, { ref: ref }), function (_a) {
43
- var CardAction = _a.CardAction;
44
- return typeof children === 'function'
45
- ? children({ CardAction: CardAction })
46
- : children;
47
- }));
12
+ const { className, noMargin, textCenter, bgColor = 'primary', noPadding, appearance = 'default', children, ...rest } = props;
13
+ return (react_1.default.createElement(components_1.WithCardAction, { baseClassName: "ffe-card-base", className: (0, classnames_1.default)('ffe-card-base', className, {
14
+ [`ffe-card-base--bg-${bgColor}`]: bgColor,
15
+ 'ffe-card-base--no-margin': noMargin,
16
+ 'ffe-card-base--text-center': textCenter,
17
+ 'ffe-card-base--no-padding': noPadding,
18
+ 'ffe-default-mode': appearance === 'default',
19
+ }), ...rest, ref: ref }, ({ CardAction }) => typeof children === 'function'
20
+ ? children({ CardAction })
21
+ : children));
48
22
  }
49
23
  exports.CardBase = (0, fixedForwardRef_1.fixedForwardRef)(CardBaseWithForwardRef);
@@ -1,42 +1,18 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __rest = (this && this.__rest) || function (s, e) {
14
- var t = {};
15
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
- t[p] = s[p];
17
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
- t[p[i]] = s[p[i]];
21
- }
22
- return t;
23
- };
24
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
25
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
26
4
  };
27
5
  Object.defineProperty(exports, "__esModule", { value: true });
28
6
  exports.GroupCard = void 0;
29
- var classnames_1 = __importDefault(require("classnames"));
30
- var react_1 = __importDefault(require("react"));
31
- var fixedForwardRef_1 = require("../fixedForwardRef");
7
+ const classnames_1 = __importDefault(require("classnames"));
8
+ const react_1 = __importDefault(require("react"));
9
+ const fixedForwardRef_1 = require("../fixedForwardRef");
32
10
  function GroupCardWithForwardRef(props, ref) {
33
- var _a;
34
- var className = props.className, children = props.children, _b = props.bgColor, bgColor = _b === void 0 ? 'primary' : _b, noMargin = props.noMargin, _c = props.appearance, appearance = _c === void 0 ? 'default' : _c, _d = props.as, Comp = _d === void 0 ? 'div' : _d, rest = __rest(props, ["className", "children", "bgColor", "noMargin", "appearance", "as"]);
35
- return (react_1.default.createElement(Comp, __assign({ className: (0, classnames_1.default)('ffe-group-card', (_a = {
36
- 'ffe-group-card--no-margin': noMargin
37
- },
38
- _a["ffe-group-card--bg-".concat(bgColor)] = bgColor,
39
- _a['ffe-default-mode'] = appearance === 'default',
40
- _a), className), role: Comp === 'div' ? 'group' : undefined }, rest, { ref: ref }), children));
11
+ const { className, children, bgColor = 'primary', noMargin, appearance = 'default', as: Comp = 'div', ...rest } = props;
12
+ return (react_1.default.createElement(Comp, { className: (0, classnames_1.default)('ffe-group-card', {
13
+ 'ffe-group-card--no-margin': noMargin,
14
+ [`ffe-group-card--bg-${bgColor}`]: bgColor,
15
+ 'ffe-default-mode': appearance === 'default',
16
+ }, className), role: Comp === 'div' ? 'group' : undefined, ...rest, ref: ref }, children));
41
17
  }
42
18
  exports.GroupCard = (0, fixedForwardRef_1.fixedForwardRef)(GroupCardWithForwardRef);
@@ -1,45 +1,20 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __rest = (this && this.__rest) || function (s, e) {
14
- var t = {};
15
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
- t[p] = s[p];
17
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
- t[p[i]] = s[p[i]];
21
- }
22
- return t;
23
- };
24
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
25
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
26
4
  };
27
5
  Object.defineProperty(exports, "__esModule", { value: true });
28
6
  exports.GroupCardElement = void 0;
29
- var react_1 = __importDefault(require("react"));
30
- var classnames_1 = __importDefault(require("classnames"));
31
- var components_1 = require("../components");
32
- var fixedForwardRef_1 = require("../fixedForwardRef");
7
+ const react_1 = __importDefault(require("react"));
8
+ const classnames_1 = __importDefault(require("classnames"));
9
+ const components_1 = require("../components");
10
+ const fixedForwardRef_1 = require("../fixedForwardRef");
33
11
  function GroupCardElementWithForwardRef(props, ref) {
34
- var className = props.className, _a = props.noPadding, noPadding = _a === void 0 ? false : _a, _b = props.noSeparator, noSeparator = _b === void 0 ? false : _b, children = props.children, rest = __rest(props, ["className", "noPadding", "noSeparator", "children"]);
35
- return (react_1.default.createElement(components_1.WithCardAction, __assign({ baseClassName: "ffe-group-card__element", className: (0, classnames_1.default)('ffe-group-card__element', className, {
12
+ const { className, noPadding = false, noSeparator = false, children, ...rest } = props;
13
+ return (react_1.default.createElement(components_1.WithCardAction, { baseClassName: "ffe-group-card__element", className: (0, classnames_1.default)('ffe-group-card__element', className, {
36
14
  'ffe-group-card__element--no-padding': noPadding,
37
15
  'ffe-group-card__element--no-separator': noSeparator,
38
- }) }, rest, { ref: ref }), function (_a) {
39
- var CardAction = _a.CardAction;
40
- return typeof children === 'function'
41
- ? children({ Text: components_1.Text, Subtext: components_1.Subtext, Title: components_1.Title, CardName: components_1.CardName, CardAction: CardAction })
42
- : children;
43
- }));
16
+ }), ...rest, ref: ref }, ({ CardAction }) => typeof children === 'function'
17
+ ? children({ Text: components_1.Text, Subtext: components_1.Subtext, Title: components_1.Title, CardName: components_1.CardName, CardAction })
18
+ : children));
44
19
  }
45
20
  exports.GroupCardElement = (0, fixedForwardRef_1.fixedForwardRef)(GroupCardElementWithForwardRef);
@@ -1,44 +1,19 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __rest = (this && this.__rest) || function (s, e) {
14
- var t = {};
15
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
- t[p] = s[p];
17
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
- t[p[i]] = s[p[i]];
21
- }
22
- return t;
23
- };
24
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
25
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
26
4
  };
27
5
  Object.defineProperty(exports, "__esModule", { value: true });
28
6
  exports.GroupCardFooter = void 0;
29
- var react_1 = __importDefault(require("react"));
30
- var classnames_1 = __importDefault(require("classnames"));
31
- var components_1 = require("../components");
32
- var fixedForwardRef_1 = require("../fixedForwardRef");
7
+ const react_1 = __importDefault(require("react"));
8
+ const classnames_1 = __importDefault(require("classnames"));
9
+ const components_1 = require("../components");
10
+ const fixedForwardRef_1 = require("../fixedForwardRef");
33
11
  function GroupCardFooterWithForwardRef(props, ref) {
34
- var className = props.className, _a = props.noPadding, noPadding = _a === void 0 ? false : _a, children = props.children, rest = __rest(props, ["className", "noPadding", "children"]);
35
- return (react_1.default.createElement(components_1.WithCardAction, __assign({ baseClassName: "ffe-group-card__footer", className: (0, classnames_1.default)('ffe-group-card__footer', className, {
12
+ const { className, noPadding = false, children, ...rest } = props;
13
+ return (react_1.default.createElement(components_1.WithCardAction, { baseClassName: "ffe-group-card__footer", className: (0, classnames_1.default)('ffe-group-card__footer', className, {
36
14
  'ffe-group-card__element--no-padding': noPadding,
37
- }) }, rest, { ref: ref }), function (_a) {
38
- var CardAction = _a.CardAction;
39
- return typeof children === 'function'
40
- ? children({ Text: components_1.Text, Subtext: components_1.Subtext, Title: components_1.Title, CardName: components_1.CardName, CardAction: CardAction })
41
- : children;
42
- }));
15
+ }), ...rest, ref: ref }, ({ CardAction }) => typeof children === 'function'
16
+ ? children({ Text: components_1.Text, Subtext: components_1.Subtext, Title: components_1.Title, CardName: components_1.CardName, CardAction })
17
+ : children));
43
18
  }
44
19
  exports.GroupCardFooter = (0, fixedForwardRef_1.fixedForwardRef)(GroupCardFooterWithForwardRef);
@@ -1,45 +1,20 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __rest = (this && this.__rest) || function (s, e) {
14
- var t = {};
15
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
- t[p] = s[p];
17
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
- t[p[i]] = s[p[i]];
21
- }
22
- return t;
23
- };
24
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
25
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
26
4
  };
27
5
  Object.defineProperty(exports, "__esModule", { value: true });
28
6
  exports.GroupCardTitle = void 0;
29
- var react_1 = __importDefault(require("react"));
30
- var classnames_1 = __importDefault(require("classnames"));
31
- var components_1 = require("../components");
32
- var fixedForwardRef_1 = require("../fixedForwardRef");
7
+ const react_1 = __importDefault(require("react"));
8
+ const classnames_1 = __importDefault(require("classnames"));
9
+ const components_1 = require("../components");
10
+ const fixedForwardRef_1 = require("../fixedForwardRef");
33
11
  function GroupCardTitleWithForwardRef(props, ref) {
34
- var className = props.className, _a = props.noPadding, noPadding = _a === void 0 ? false : _a, _b = props.noSeparator, noSeparator = _b === void 0 ? false : _b, children = props.children, rest = __rest(props, ["className", "noPadding", "noSeparator", "children"]);
35
- return (react_1.default.createElement(components_1.WithCardAction, __assign({ baseClassName: "ffe-group-card__title", className: (0, classnames_1.default)('ffe-group-card__title', className, {
12
+ const { className, noPadding = false, noSeparator = false, children, ...rest } = props;
13
+ return (react_1.default.createElement(components_1.WithCardAction, { baseClassName: "ffe-group-card__title", className: (0, classnames_1.default)('ffe-group-card__title', className, {
36
14
  'ffe-group-card__element--no-padding': noPadding,
37
15
  'ffe-group-card__element--no-separator': noSeparator,
38
- }) }, rest, { ref: ref }), function (_a) {
39
- var CardAction = _a.CardAction;
40
- return typeof children === 'function'
41
- ? children({ Text: components_1.Text, Subtext: components_1.Subtext, Title: components_1.Title, CardName: components_1.CardName, CardAction: CardAction })
42
- : children;
43
- }));
16
+ }), ...rest, ref: ref }, ({ CardAction }) => typeof children === 'function'
17
+ ? children({ Text: components_1.Text, Subtext: components_1.Subtext, Title: components_1.Title, CardName: components_1.CardName, CardAction })
18
+ : children));
44
19
  }
45
20
  exports.GroupCardTitle = (0, fixedForwardRef_1.fixedForwardRef)(GroupCardTitleWithForwardRef);
@@ -1,52 +1,35 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __rest = (this && this.__rest) || function (s, e) {
14
- var t = {};
15
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
- t[p] = s[p];
17
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
- t[p[i]] = s[p[i]];
21
- }
22
- return t;
23
- };
24
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
25
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
26
4
  };
27
5
  Object.defineProperty(exports, "__esModule", { value: true });
28
6
  exports.IconCard = void 0;
29
- var classnames_1 = __importDefault(require("classnames"));
30
- var react_1 = __importDefault(require("react"));
31
- var components_1 = require("../components");
32
- var fixedForwardRef_1 = require("../fixedForwardRef");
7
+ const classnames_1 = __importDefault(require("classnames"));
8
+ const react_1 = __importDefault(require("react"));
9
+ const components_1 = require("../components");
10
+ const fixedForwardRef_1 = require("../fixedForwardRef");
33
11
  function IconCardWithForwardRef(props, ref) {
34
- var className = props.className, condensed = props.condensed, icon = props.icon, rightIcon = props.rightIcon, noMargin = props.noMargin, _a = props.appearance, appearance = _a === void 0 ? 'default' : _a, children = props.children, rest = __rest(props, ["className", "condensed", "icon", "rightIcon", "noMargin", "appearance", "children"]);
35
- return (react_1.default.createElement(components_1.WithCardAction, __assign({ baseClassName: "ffe-icon-card", className: (0, classnames_1.default)('ffe-icon-card', { 'ffe-icon-card--condensed': condensed }, { 'ffe-icon-card--no-margin': noMargin }, { 'ffe-default-mode': appearance === 'default' }, className) }, rest, { ref: ref }), function (_a) {
36
- var CardAction = _a.CardAction;
37
- var bodyElement = (react_1.default.createElement("div", { className: "ffe-icon-card__body" }, typeof children === 'function'
12
+ const { className, condensed, icon, rightIcon, noMargin, appearance = 'default', children, ...rest } = props;
13
+ return (react_1.default.createElement(components_1.WithCardAction, { baseClassName: "ffe-icon-card", className: (0, classnames_1.default)('ffe-icon-card', { 'ffe-icon-card--condensed': condensed }, { 'ffe-icon-card--no-margin': noMargin }, { 'ffe-default-mode': appearance === 'default' }, className), ...rest, ref: ref }, ({ CardAction }) => {
14
+ const bodyElement = (react_1.default.createElement("div", { className: "ffe-icon-card__body" }, typeof children === 'function'
38
15
  ? children({
39
16
  Text: components_1.Text,
40
17
  Subtext: components_1.Subtext,
41
18
  Title: components_1.Title,
42
19
  CardName: components_1.CardName,
43
- CardAction: CardAction,
20
+ CardAction,
44
21
  })
45
22
  : children));
46
- var iconElement = icon &&
47
- react_1.default.cloneElement(icon, __assign(__assign({}, icon.props), { className: (0, classnames_1.default)('ffe-icon-card__icon', icon.props.className) }));
48
- var rightIconElement = rightIcon &&
49
- react_1.default.cloneElement(rightIcon, __assign(__assign({}, rightIcon.props), { className: (0, classnames_1.default)('ffe-icon-card__icon', rightIcon.props.className) }));
23
+ const iconElement = icon &&
24
+ react_1.default.cloneElement(icon, {
25
+ ...icon.props,
26
+ className: (0, classnames_1.default)('ffe-icon-card__icon', icon.props.className),
27
+ });
28
+ const rightIconElement = rightIcon &&
29
+ react_1.default.cloneElement(rightIcon, {
30
+ ...rightIcon.props,
31
+ className: (0, classnames_1.default)('ffe-icon-card__icon', rightIcon.props.className),
32
+ });
50
33
  return (react_1.default.createElement(react_1.default.Fragment, null,
51
34
  iconElement,
52
35
  bodyElement,