@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.
- package/es/CardBase.js +11 -37
- package/es/GroupCard/GroupCard.js +7 -31
- package/es/GroupCard/GroupCardElement.js +6 -31
- package/es/GroupCard/GroupCardFooter.js +6 -31
- package/es/GroupCard/GroupCardTitle.js +6 -31
- package/es/IconCard/IconCard.js +19 -36
- package/es/IllustrationCard/IllustrationCard.js +11 -34
- package/es/ImageCard/ImageCard.js +16 -41
- package/es/StippledCard/StippledCard.js +18 -43
- package/es/TextCard/TextCard.js +6 -31
- package/es/components/CardAction.js +3 -25
- package/es/components/CardName.js +2 -24
- package/es/components/ComponentBase.js +2 -24
- package/es/components/Subtext.js +2 -24
- package/es/components/Text.js +2 -24
- package/es/components/Title.js +3 -25
- package/es/components/WithCardAction.js +12 -35
- package/es/fixedForwardRef.js +1 -1
- package/es/mergeRefs.js +2 -2
- package/lib/CardBase.js +14 -40
- package/lib/GroupCard/GroupCard.js +9 -33
- package/lib/GroupCard/GroupCardElement.js +9 -34
- package/lib/GroupCard/GroupCardFooter.js +9 -34
- package/lib/GroupCard/GroupCardTitle.js +9 -34
- package/lib/IconCard/IconCard.js +18 -35
- package/lib/IllustrationCard/IllustrationCard.js +10 -33
- package/lib/ImageCard/ImageCard.js +19 -44
- package/lib/StippledCard/StippledCard.js +21 -46
- package/lib/TextCard/TextCard.js +9 -34
- package/lib/components/CardAction.js +4 -26
- package/lib/components/CardName.js +5 -27
- package/lib/components/ComponentBase.js +3 -25
- package/lib/components/Subtext.js +5 -27
- package/lib/components/Text.js +5 -27
- package/lib/components/Title.js +6 -28
- package/lib/components/WithCardAction.js +16 -39
- package/lib/fixedForwardRef.js +1 -1
- package/lib/mergeRefs.js +2 -2
- 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
|
-
|
|
26
|
-
return React.createElement(Comp,
|
|
3
|
+
const { as: Comp = 'p', ...rest } = props;
|
|
4
|
+
return React.createElement(Comp, { ...rest });
|
|
27
5
|
}
|
package/es/components/Subtext.js
CHANGED
|
@@ -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
|
-
|
|
28
|
-
return (React.createElement(ComponentBase,
|
|
5
|
+
const { className, ...rest } = props;
|
|
6
|
+
return (React.createElement(ComponentBase, { className: classNames('ffe-card-body__subtext', className), ...rest }));
|
|
29
7
|
}
|
package/es/components/Text.js
CHANGED
|
@@ -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
|
-
|
|
28
|
-
return (React.createElement(ComponentBase,
|
|
5
|
+
const { className, ...rest } = props;
|
|
6
|
+
return (React.createElement(ComponentBase, { className: classNames('ffe-card-body__text', className), ...rest }));
|
|
29
7
|
}
|
package/es/components/Title.js
CHANGED
|
@@ -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
|
-
|
|
28
|
-
return (React.createElement(ComponentBase,
|
|
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)
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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(
|
|
35
|
-
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
const isStillUsingCardAction = !!cardActionInnerRef.current;
|
|
36
14
|
if (isUsingCardAction !== isStillUsingCardAction) {
|
|
37
15
|
setIsUsingCardAction(isStillUsingCardAction);
|
|
38
16
|
}
|
|
39
17
|
}, [isUsingCardAction]);
|
|
40
|
-
|
|
41
|
-
|
|
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
|
|
23
|
+
: cardActionInnerRef, ...restCardAction }));
|
|
47
24
|
}, []);
|
|
48
|
-
return (React.createElement(Comp,
|
|
25
|
+
return (React.createElement(Comp, { ...rest, className: classNames(className, isUsingCardAction && `${baseClassName}--clickable`), onClick: (e) => {
|
|
49
26
|
var _a, _b, _c;
|
|
50
|
-
|
|
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 }
|
|
33
|
+
}, ref: ref }, children({
|
|
57
34
|
CardAction: fixedForwardRef(PartialAppliedCardAction),
|
|
58
35
|
})));
|
|
59
36
|
}
|
|
60
|
-
export
|
|
37
|
+
export const WithCardAction = fixedForwardRef(WithCardActionForwardRef);
|
package/es/fixedForwardRef.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export const fixedForwardRef = forwardRef;
|
package/es/mergeRefs.js
CHANGED
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
35
|
-
return (react_1.default.createElement(components_1.WithCardAction,
|
|
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
|
-
})
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
35
|
-
return (react_1.default.createElement(components_1.WithCardAction,
|
|
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
|
-
})
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
35
|
-
return (react_1.default.createElement(components_1.WithCardAction,
|
|
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
|
-
})
|
|
39
|
-
|
|
40
|
-
|
|
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);
|
package/lib/IconCard/IconCard.js
CHANGED
|
@@ -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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
35
|
-
return (react_1.default.createElement(components_1.WithCardAction,
|
|
36
|
-
|
|
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
|
|
20
|
+
CardAction,
|
|
44
21
|
})
|
|
45
22
|
: children));
|
|
46
|
-
|
|
47
|
-
react_1.default.cloneElement(icon,
|
|
48
|
-
|
|
49
|
-
|
|
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,
|