@sb1/ffe-cards-react 14.0.0 → 15.0.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.
Files changed (43) hide show
  1. package/es/CardBase.js +35 -40
  2. package/es/IconCard/IconCard.js +33 -42
  3. package/es/ImageCard/ImageCard.js +35 -40
  4. package/es/StippledCard/StippledCard.js +35 -45
  5. package/es/TextCard/TextCard.js +31 -32
  6. package/es/components/CardName.js +27 -17
  7. package/es/components/ComponentBase.js +25 -20
  8. package/es/components/Subtext.js +27 -17
  9. package/es/components/Text.js +27 -17
  10. package/es/components/Title.js +29 -23
  11. package/es/components/index.js +4 -4
  12. package/es/fixedForwardRef.js +2 -0
  13. package/es/index.js +5 -5
  14. package/es/types.js +1 -0
  15. package/lib/CardBase.js +41 -47
  16. package/lib/IconCard/IconCard.js +38 -50
  17. package/lib/ImageCard/ImageCard.js +40 -49
  18. package/lib/StippledCard/StippledCard.js +40 -51
  19. package/lib/TextCard/TextCard.js +35 -40
  20. package/lib/components/CardName.js +33 -23
  21. package/lib/components/ComponentBase.js +31 -26
  22. package/lib/components/Subtext.js +33 -23
  23. package/lib/components/Text.js +33 -23
  24. package/lib/components/Title.js +35 -29
  25. package/lib/components/index.js +10 -33
  26. package/lib/fixedForwardRef.js +5 -0
  27. package/lib/index.js +12 -40
  28. package/lib/types.js +2 -0
  29. package/package.json +7 -8
  30. package/types/CardBase.d.ts +23 -0
  31. package/types/IconCard/IconCard.d.ts +16 -0
  32. package/types/ImageCard/ImageCard.d.ts +16 -0
  33. package/types/StippledCard/StippledCard.d.ts +22 -0
  34. package/types/TextCard/TextCard.d.ts +14 -0
  35. package/types/components/CardName.d.ts +4 -0
  36. package/types/components/ComponentBase.d.ts +6 -0
  37. package/types/components/Subtext.d.ts +4 -0
  38. package/types/components/Text.d.ts +4 -0
  39. package/types/components/Title.d.ts +7 -0
  40. package/types/components/index.d.ts +4 -0
  41. package/types/fixedForwardRef.d.ts +4 -0
  42. package/types/index.d.ts +5 -87
  43. package/types/types.d.ts +15 -0
package/es/CardBase.js CHANGED
@@ -1,42 +1,37 @@
1
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["className", "element", "bgColor", "bgDarkmodeColor", "shadow", "noMargin", "textCenter", "children"];
3
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
8
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
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
+ };
9
23
  import React from 'react';
24
+ import { fixedForwardRef } from './fixedForwardRef';
10
25
  import classNames from 'classnames';
11
- import { oneOfType, node, func, string, elementType, bool, oneOf } from 'prop-types';
12
- var CardBase = /*#__PURE__*/React.forwardRef(function (props, ref) {
13
- var className = props.className,
14
- _props$element = props.element,
15
- Element = _props$element === void 0 ? 'a' : _props$element,
16
- bgColor = props.bgColor,
17
- bgDarkmodeColor = props.bgDarkmodeColor,
18
- _props$shadow = props.shadow,
19
- shadow = _props$shadow === void 0 ? false : _props$shadow,
20
- _props$noMargin = props.noMargin,
21
- noMargin = _props$noMargin === void 0 ? false : _props$noMargin,
22
- _props$textCenter = props.textCenter,
23
- textCenter = _props$textCenter === void 0 ? false : _props$textCenter,
24
- children = props.children,
25
- rest = _objectWithoutProperties(props, _excluded);
26
- return /*#__PURE__*/React.createElement(Element, _extends({
27
- className: classNames('ffe-card-base', className, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "ffe-card-base--bg-".concat(bgColor), bgColor), "ffe-card-base--dm-bg-".concat(bgDarkmodeColor), bgDarkmodeColor), 'ffe-card-base--box-shadow', shadow), 'ffe-card-base--no-margin', noMargin), 'ffe-card-base--text-center', textCenter)),
28
- ref: ref
29
- }, rest), children);
30
- });
31
- CardBase.propTypes = {
32
- className: string,
33
- bgColor: oneOf(['sand-30', 'sand-70', 'frost-30', 'syrin-30', 'syrin-70']),
34
- bgDarkmodeColor: oneOf(['natt', 'svart', 'koksgraa']),
35
- shadow: bool,
36
- noMargin: bool,
37
- textCenter: bool,
38
- children: node,
39
- /** The element to render the card as */
40
- element: oneOfType([func, string, elementType])
41
- };
42
- export default CardBase;
26
+ function CardBaseWithForwardRef(props, ref) {
27
+ var _a;
28
+ var _b = props.as, Comp = _b === void 0 ? 'a' : _b, className = props.className, shadow = props.shadow, noMargin = props.noMargin, textCenter = props.textCenter, bgColor = props.bgColor, bgDarkmodeColor = props.bgDarkmodeColor, rest = __rest(props, ["as", "className", "shadow", "noMargin", "textCenter", "bgColor", "bgDarkmodeColor"]);
29
+ return (React.createElement(Comp, __assign({ className: classNames('ffe-card-base', className, (_a = {},
30
+ _a["ffe-card-base--bg-".concat(bgColor)] = bgColor,
31
+ _a["ffe-card-base--dm-bg-".concat(bgDarkmodeColor)] = bgDarkmodeColor,
32
+ _a['ffe-card-base--box-shadow'] = shadow,
33
+ _a['ffe-card-base--no-margin'] = noMargin,
34
+ _a['ffe-card-base--text-center'] = textCenter,
35
+ _a)) }, rest, { ref: ref })));
36
+ }
37
+ export var CardBase = fixedForwardRef(CardBaseWithForwardRef);
@@ -1,44 +1,35 @@
1
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["className", "icon", "condensed", "element", "children"];
3
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
7
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
8
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
9
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
10
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
11
- import React from 'react';
12
- import classNames from 'classnames';
13
- import { node, string, bool, func, oneOfType, elementType } from 'prop-types';
14
- import * as components from '../components';
15
- var IconCard = function IconCard(props) {
16
- var className = props.className,
17
- icon = props.icon,
18
- condensed = props.condensed,
19
- _props$element = props.element,
20
- Element = _props$element === void 0 ? 'a' : _props$element,
21
- children = props.children,
22
- rest = _objectWithoutProperties(props, _excluded);
23
- return /*#__PURE__*/React.createElement(Element, _extends({
24
- className: classNames('ffe-icon-card', {
25
- 'ffe-icon-card--condensed': condensed
26
- }, className)
27
- }, rest), /*#__PURE__*/React.cloneElement(icon, _objectSpread(_objectSpread({}, icon.props), {}, {
28
- className: classNames('ffe-icon-card__icon', icon.props.className)
29
- })), /*#__PURE__*/React.createElement("div", {
30
- className: "ffe-icon-card__body"
31
- }, typeof children === 'function' ? children(components) : children));
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);
32
11
  };
33
- IconCard.propTypes = {
34
- className: string,
35
- /** Element of icon */
36
- icon: node.isRequired,
37
- /** Smaller icon and less space */
38
- condensed: bool,
39
- /** The element to render the card as */
40
- element: oneOfType([func, string, elementType]),
41
- /** Function that's passed available sub-components as arguments, or regular children */
42
- children: oneOfType([func, node])
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;
43
22
  };
44
- export default IconCard;
23
+ import React from 'react';
24
+ import { fixedForwardRef } from '../fixedForwardRef';
25
+ import classNames from 'classnames';
26
+ import { Text, Subtext, Title, CardName } from '../components';
27
+ function IconCardWithForwardRef(props, ref) {
28
+ var _a = props.as, Comp = _a === void 0 ? 'a' : _a, className = props.className, condensed = props.condensed, icon = props.icon, children = props.children, rest = __rest(props, ["as", "className", "condensed", "icon", "children"]);
29
+ return (React.createElement(Comp, __assign({ className: classNames('ffe-icon-card', { 'ffe-icon-card--condensed': condensed }, className) }, rest, { ref: ref }),
30
+ React.cloneElement(icon, __assign(__assign({}, icon.props), { className: classNames('ffe-icon-card__icon', icon.props.className) })),
31
+ React.createElement("div", { className: "ffe-icon-card__body" }, typeof children === 'function'
32
+ ? children({ Text: Text, Subtext: Subtext, Title: Title, CardName: CardName })
33
+ : children)));
34
+ }
35
+ export var IconCard = fixedForwardRef(IconCardWithForwardRef);
@@ -1,42 +1,37 @@
1
- var _excluded = ["className", "imageSrc", "imageAltText", "element", "children"];
2
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
5
- import React from 'react';
6
- import classNames from 'classnames';
7
- import { node, string, func, oneOfType, elementType } from 'prop-types';
8
- import * as components from '../components';
9
- var ImageCard = function ImageCard(props) {
10
- var className = props.className,
11
- imageSrc = props.imageSrc,
12
- imageAltText = props.imageAltText,
13
- _props$element = props.element,
14
- Element = _props$element === void 0 ? 'a' : _props$element,
15
- children = props.children,
16
- rest = _objectWithoutProperties(props, _excluded);
17
- return /*#__PURE__*/React.createElement(Element, _extends({
18
- className: classNames('ffe-image-card', className)
19
- }, rest), /*#__PURE__*/React.createElement("div", {
20
- className: "ffe-image-card__image-container"
21
- }, /*#__PURE__*/React.createElement("div", {
22
- className: "ffe-image-card__image-overlay"
23
- }), /*#__PURE__*/React.createElement("img", {
24
- src: imageSrc,
25
- alt: imageAltText,
26
- className: "ffe-image-card__image"
27
- })), /*#__PURE__*/React.createElement("div", {
28
- className: "ffe-image-card__body"
29
- }, typeof children === 'function' ? children(components) : children));
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);
30
11
  };
31
- ImageCard.propTypes = {
32
- className: string,
33
- /** The src for the image */
34
- imageSrc: string.isRequired,
35
- /** The alt text for the image */
36
- imageAltText: string.isRequired,
37
- /** The element to render the card as */
38
- element: oneOfType([func, string, elementType]),
39
- /** Function that's passed available sub-components as arguments, or regular children */
40
- children: oneOfType([func, node])
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;
41
22
  };
42
- export default ImageCard;
23
+ import React from 'react';
24
+ import { fixedForwardRef } from '../fixedForwardRef';
25
+ import classNames from 'classnames';
26
+ import { Text, Subtext, Title, CardName } from '../components';
27
+ function ImageCardWithForwardRef(props, ref) {
28
+ var _a = props.as, Comp = _a === void 0 ? 'a' : _a, className = props.className, imageSrc = props.imageSrc, imageAltText = props.imageAltText, children = props.children, rest = __rest(props, ["as", "className", "imageSrc", "imageAltText", "children"]);
29
+ return (React.createElement(Comp, __assign({ className: classNames('ffe-image-card', className) }, rest, { ref: ref }),
30
+ React.createElement("div", { className: "ffe-image-card__image-container" },
31
+ React.createElement("div", { className: "ffe-image-card__image-overlay" }),
32
+ React.createElement("img", { src: imageSrc, alt: imageAltText, className: "ffe-image-card__image" })),
33
+ React.createElement("div", { className: "ffe-image-card__body" }, typeof children === 'function'
34
+ ? children({ Text: Text, Subtext: Subtext, Title: Title, CardName: CardName })
35
+ : children)));
36
+ }
37
+ export var ImageCard = fixedForwardRef(ImageCardWithForwardRef);
@@ -1,47 +1,37 @@
1
- var _excluded = ["className", "element", "children", "img", "condensed"];
2
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
5
- import React from 'react';
6
- import classNames from 'classnames';
7
- import { bool, elementType, element, func, node, oneOfType, string, shape, oneOf } from 'prop-types';
8
- import { Text, Title, Subtext, CardName } from '../components';
9
- var StippledCard = function StippledCard(_ref) {
10
- var className = _ref.className,
11
- _ref$element = _ref.element,
12
- Element = _ref$element === void 0 ? 'a' : _ref$element,
13
- children = _ref.children,
14
- img = _ref.img,
15
- condensed = _ref.condensed,
16
- rest = _objectWithoutProperties(_ref, _excluded);
17
- return /*#__PURE__*/React.createElement(Element, _extends({
18
- className: classNames('ffe-stippled-card', {
19
- 'ffe-stippled-card--condensed': condensed
20
- }, className)
21
- }, rest), /*#__PURE__*/React.createElement("div", {
22
- className: classNames('ffe-stippled-card__img', {
23
- 'ffe-stippled-card__img--icon': (img === null || img === void 0 ? void 0 : img.type) === 'icon'
24
- }),
25
- "aria-hidden": (img === null || img === void 0 ? void 0 : img.type) === 'icon'
26
- }, img === null || img === void 0 ? void 0 : img.element), /*#__PURE__*/React.createElement("div", null, typeof children === 'function' ? children({
27
- CardName: CardName,
28
- Title: Title,
29
- Text: Text,
30
- Subtext: Subtext
31
- }) : children));
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);
32
11
  };
33
- StippledCard.propTypes = {
34
- className: string,
35
- /** The element to render the card as */
36
- element: oneOfType([func, string, elementType]),
37
- /** Function that's passed available sub-components as arguments, or regular children */
38
- children: oneOfType([func, node]).isRequired,
39
- /** Image to be rendered*/
40
- img: shape({
41
- element: element.isRequired,
42
- type: oneOf(['icon', 'custom']).isRequired
43
- }),
44
- /** Smaller icon and less space */
45
- condensed: bool
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;
46
22
  };
47
- export default StippledCard;
23
+ import React from 'react';
24
+ import { fixedForwardRef } from '../fixedForwardRef';
25
+ import classNames from 'classnames';
26
+ import { Text, Subtext, Title, CardName } from '../components';
27
+ function StippledCardWithForwardRef(props, ref) {
28
+ var _a = props.as, Comp = _a === void 0 ? 'a' : _a, className = props.className, condensed = props.condensed, img = props.img, children = props.children, rest = __rest(props, ["as", "className", "condensed", "img", "children"]);
29
+ return (React.createElement(Comp, __assign({ className: classNames('ffe-stippled-card', { 'ffe-stippled-card--condensed': condensed }, className) }, rest, { ref: ref }),
30
+ React.createElement("div", { className: classNames('ffe-stippled-card__img', {
31
+ 'ffe-stippled-card__img--icon': (img === null || img === void 0 ? void 0 : img.type) === 'icon',
32
+ }), "aria-hidden": (img === null || img === void 0 ? void 0 : img.type) === 'icon' }, img === null || img === void 0 ? void 0 : img.element),
33
+ React.createElement("div", null, typeof children === 'function'
34
+ ? children({ CardName: CardName, Title: Title, Text: Text, Subtext: Subtext })
35
+ : children)));
36
+ }
37
+ export var StippledCard = fixedForwardRef(StippledCardWithForwardRef);
@@ -1,34 +1,33 @@
1
- var _excluded = ["className", "leftAlign", "element", "children"];
2
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
5
- import React from 'react';
6
- import classNames from 'classnames';
7
- import { string, func, node, oneOfType, bool, elementType } from 'prop-types';
8
- import * as components from '../components';
9
- var TextCard = function TextCard(props) {
10
- var className = props.className,
11
- leftAlign = props.leftAlign,
12
- _props$element = props.element,
13
- Element = _props$element === void 0 ? 'a' : _props$element,
14
- children = props.children,
15
- rest = _objectWithoutProperties(props, _excluded);
16
- return /*#__PURE__*/React.createElement(Element, _extends({
17
- className: classNames('ffe-text-card', {
18
- 'ffe-text-card--left-align': leftAlign
19
- }, className)
20
- }, rest), typeof children === 'function' ? children(components) : children);
21
- };
22
- TextCard.defaultProps = {
23
- element: 'a'
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);
24
11
  };
25
- TextCard.propTypes = {
26
- className: string,
27
- /** Left-aligned text on the card */
28
- leftAlign: bool,
29
- /** The element to render the card as */
30
- element: oneOfType([func, string, elementType]),
31
- /** Function that's passed available sub-components as arguments, or regular children */
32
- children: oneOfType([func, node])
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;
33
22
  };
34
- export default TextCard;
23
+ import React from 'react';
24
+ import { fixedForwardRef } from '../fixedForwardRef';
25
+ import classNames from 'classnames';
26
+ import { Text, Subtext, Title, CardName } from '../components';
27
+ function TextCardWithForwardRef(props, ref) {
28
+ var _a = props.as, Comp = _a === void 0 ? 'a' : _a, className = props.className, leftAlign = props.leftAlign, children = props.children, rest = __rest(props, ["as", "className", "leftAlign", "children"]);
29
+ return (React.createElement(Comp, __assign({ className: classNames('ffe-text-card', { 'ffe-text-card--left-align': leftAlign }, className) }, rest, { ref: ref }), typeof children === 'function'
30
+ ? children({ Text: Text, Subtext: Subtext, Title: Title, CardName: CardName })
31
+ : children));
32
+ }
33
+ export var TextCard = fixedForwardRef(TextCardWithForwardRef);
@@ -1,19 +1,29 @@
1
- var _excluded = ["className"];
2
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
5
- import React from 'react';
6
- import classNames from 'classnames';
7
- import { string } from 'prop-types';
8
- import ComponentBase from './ComponentBase';
9
- var CardName = function CardName(_ref) {
10
- var className = _ref.className,
11
- rest = _objectWithoutProperties(_ref, _excluded);
12
- return /*#__PURE__*/React.createElement(ComponentBase, _extends({
13
- className: classNames('ffe-card-body__card-name', className)
14
- }, rest));
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);
15
11
  };
16
- CardName.propTypes = {
17
- className: string
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;
18
22
  };
19
- export default CardName;
23
+ import React from 'react';
24
+ import classNames from 'classnames';
25
+ import { ComponentBase } from './ComponentBase';
26
+ export function CardName(props) {
27
+ var className = props.className, rest = __rest(props, ["className"]);
28
+ return (React.createElement(ComponentBase, __assign({ className: classNames('ffe-card-body__card-name', className) }, rest)));
29
+ }
@@ -1,22 +1,27 @@
1
- var _excluded = ["className", "element"];
2
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
5
- import React from 'react';
6
- import classNames from 'classnames';
7
- import { string, node, oneOfType, func, elementType } from 'prop-types';
8
- var ComponentBase = function ComponentBase(_ref) {
9
- var className = _ref.className,
10
- _ref$element = _ref.element,
11
- Element = _ref$element === void 0 ? 'p' : _ref$element,
12
- rest = _objectWithoutProperties(_ref, _excluded);
13
- return /*#__PURE__*/React.createElement(Element, _extends({
14
- className: classNames(className)
15
- }, rest));
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);
16
11
  };
17
- ComponentBase.propTypes = {
18
- className: string,
19
- element: oneOfType([func, string, elementType]),
20
- children: node
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;
21
22
  };
22
- export default ComponentBase;
23
+ import React from 'react';
24
+ 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));
27
+ }
@@ -1,19 +1,29 @@
1
- var _excluded = ["className"];
2
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
5
- import React from 'react';
6
- import classNames from 'classnames';
7
- import { string } from 'prop-types';
8
- import ComponentBase from './ComponentBase';
9
- var Subtext = function Subtext(_ref) {
10
- var className = _ref.className,
11
- rest = _objectWithoutProperties(_ref, _excluded);
12
- return /*#__PURE__*/React.createElement(ComponentBase, _extends({
13
- className: classNames('ffe-card-body__subtext', className)
14
- }, rest));
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);
15
11
  };
16
- Subtext.propTypes = {
17
- className: string
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;
18
22
  };
19
- export default Subtext;
23
+ import React from 'react';
24
+ import classNames from 'classnames';
25
+ import { ComponentBase } from './ComponentBase';
26
+ 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)));
29
+ }
@@ -1,19 +1,29 @@
1
- var _excluded = ["className"];
2
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
5
- import React from 'react';
6
- import classNames from 'classnames';
7
- import { string } from 'prop-types';
8
- import ComponentBase from './ComponentBase';
9
- var Text = function Text(_ref) {
10
- var className = _ref.className,
11
- rest = _objectWithoutProperties(_ref, _excluded);
12
- return /*#__PURE__*/React.createElement(ComponentBase, _extends({
13
- className: classNames('ffe-card-body__text', className)
14
- }, rest));
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);
15
11
  };
16
- Text.propTypes = {
17
- className: string
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;
18
22
  };
19
- export default Text;
23
+ import React from 'react';
24
+ import classNames from 'classnames';
25
+ import { ComponentBase } from './ComponentBase';
26
+ 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)));
29
+ }