@sb1/ffe-cards-react 17.3.1 → 17.4.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.
@@ -25,7 +25,7 @@ import classNames from 'classnames';
25
25
  import { fixedForwardRef } from '../fixedForwardRef';
26
26
  function GroupCardWithForwardRef(_a, ref) {
27
27
  var _b;
28
- var shadow = _a.shadow, className = _a.className, children = _a.children, bgColor = _a.bgColor, bgDarkmodeColor = _a.bgDarkmodeColor, rest = __rest(_a, ["shadow", "className", "children", "bgColor", "bgDarkmodeColor"]);
28
+ var _c = _a.shadow, shadow = _c === void 0 ? true : _c, className = _a.className, children = _a.children, bgColor = _a.bgColor, bgDarkmodeColor = _a.bgDarkmodeColor, rest = __rest(_a, ["shadow", "className", "children", "bgColor", "bgDarkmodeColor"]);
29
29
  return (React.createElement("div", __assign({ className: classNames('ffe-group-card', (_b = {
30
30
  'ffe-group-card--shadow': shadow
31
31
  },
@@ -25,7 +25,7 @@ import classNames from 'classnames';
25
25
  import { CardName, Subtext, Text, Title, WithCardAction } from '../components';
26
26
  import { fixedForwardRef } from '../fixedForwardRef';
27
27
  function GroupCardElementWithForwardRef(props, ref) {
28
- var className = props.className, noPadding = props.noPadding, _a = props.noSeparator, noSeparator = _a === void 0 ? false : _a, children = props.children, rest = __rest(props, ["className", "noPadding", "noSeparator", "children"]);
28
+ 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"]);
29
29
  return (React.createElement(WithCardAction, __assign({ baseClassName: "ffe-group-card__element", className: classNames('ffe-group-card__element', className, {
30
30
  'ffe-group-card__element--no-padding': noPadding,
31
31
  'ffe-group-card__element--no-separator': noSeparator,
@@ -0,0 +1,38 @@
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
+ import React from 'react';
24
+ import classNames from 'classnames';
25
+ import { CardName, Subtext, Text, Title, WithCardAction } from '../components';
26
+ import { fixedForwardRef } from '../fixedForwardRef';
27
+ function GroupCardFooterWithForwardRef(props, ref) {
28
+ var className = props.className, _a = props.noPadding, noPadding = _a === void 0 ? false : _a, children = props.children, rest = __rest(props, ["className", "noPadding", "children"]);
29
+ return (React.createElement(WithCardAction, __assign({ baseClassName: "ffe-group-card__footer", className: classNames('ffe-group-card__footer', className, {
30
+ 'ffe-group-card__element--no-padding': noPadding,
31
+ }) }, rest, { ref: ref }), function (_a) {
32
+ var CardAction = _a.CardAction;
33
+ return typeof children === 'function'
34
+ ? children({ Text: Text, Subtext: Subtext, Title: Title, CardName: CardName, CardAction: CardAction })
35
+ : children;
36
+ }));
37
+ }
38
+ export var GroupCardFooter = fixedForwardRef(GroupCardFooterWithForwardRef);
@@ -0,0 +1,39 @@
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
+ import React from 'react';
24
+ import classNames from 'classnames';
25
+ import { CardName, Subtext, Text, Title, WithCardAction } from '../components';
26
+ import { fixedForwardRef } from '../fixedForwardRef';
27
+ function GroupCardTitleWithForwardRef(props, ref) {
28
+ 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"]);
29
+ return (React.createElement(WithCardAction, __assign({ baseClassName: "ffe-group-card__title", className: classNames('ffe-group-card__title', className, {
30
+ 'ffe-group-card__element--no-padding': noPadding,
31
+ 'ffe-group-card__element--no-separator': noSeparator,
32
+ }) }, rest, { ref: ref }), function (_a) {
33
+ var CardAction = _a.CardAction;
34
+ return typeof children === 'function'
35
+ ? children({ Text: Text, Subtext: Subtext, Title: Title, CardName: CardName, CardAction: CardAction })
36
+ : children;
37
+ }));
38
+ }
39
+ export var GroupCardTitle = fixedForwardRef(GroupCardTitleWithForwardRef);
package/es/index.js CHANGED
@@ -3,6 +3,8 @@ export { TextCard } from './TextCard/TextCard';
3
3
  export { IconCard } from './IconCard/IconCard';
4
4
  export { GroupCard } from './GroupCard/GroupCard';
5
5
  export { GroupCardElement, } from './GroupCard/GroupCardElement';
6
+ export { GroupCardTitle, } from './GroupCard/GroupCardTitle';
7
+ export { GroupCardFooter, } from './GroupCard/GroupCardFooter';
6
8
  export { IllustrationCard, } from './IllustrationCard/IllustrationCard';
7
9
  export { ImageCard } from './ImageCard/ImageCard';
8
10
  export { StippledCard } from './StippledCard/StippledCard';
@@ -31,7 +31,7 @@ var classnames_1 = __importDefault(require("classnames"));
31
31
  var fixedForwardRef_1 = require("../fixedForwardRef");
32
32
  function GroupCardWithForwardRef(_a, ref) {
33
33
  var _b;
34
- var shadow = _a.shadow, className = _a.className, children = _a.children, bgColor = _a.bgColor, bgDarkmodeColor = _a.bgDarkmodeColor, rest = __rest(_a, ["shadow", "className", "children", "bgColor", "bgDarkmodeColor"]);
34
+ var _c = _a.shadow, shadow = _c === void 0 ? true : _c, className = _a.className, children = _a.children, bgColor = _a.bgColor, bgDarkmodeColor = _a.bgDarkmodeColor, rest = __rest(_a, ["shadow", "className", "children", "bgColor", "bgDarkmodeColor"]);
35
35
  return (react_1.default.createElement("div", __assign({ className: (0, classnames_1.default)('ffe-group-card', (_b = {
36
36
  'ffe-group-card--shadow': shadow
37
37
  },
@@ -31,7 +31,7 @@ var classnames_1 = __importDefault(require("classnames"));
31
31
  var components_1 = require("../components");
32
32
  var fixedForwardRef_1 = require("../fixedForwardRef");
33
33
  function GroupCardElementWithForwardRef(props, ref) {
34
- var className = props.className, noPadding = props.noPadding, _a = props.noSeparator, noSeparator = _a === void 0 ? false : _a, children = props.children, rest = __rest(props, ["className", "noPadding", "noSeparator", "children"]);
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
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, {
36
36
  'ffe-group-card__element--no-padding': noPadding,
37
37
  'ffe-group-card__element--no-separator': noSeparator,
@@ -0,0 +1,44 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
25
+ return (mod && mod.__esModule) ? mod : { "default": mod };
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ 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");
33
+ 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, {
36
+ '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
+ }));
43
+ }
44
+ exports.GroupCardFooter = (0, fixedForwardRef_1.fixedForwardRef)(GroupCardFooterWithForwardRef);
@@ -0,0 +1,45 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
25
+ return (mod && mod.__esModule) ? mod : { "default": mod };
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ 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");
33
+ 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, {
36
+ 'ffe-group-card__element--no-padding': noPadding,
37
+ '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
+ }));
44
+ }
45
+ exports.GroupCardTitle = (0, fixedForwardRef_1.fixedForwardRef)(GroupCardTitleWithForwardRef);
package/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StippledCard = exports.ImageCard = exports.IllustrationCard = exports.GroupCardElement = exports.GroupCard = exports.IconCard = exports.TextCard = exports.CardBase = void 0;
3
+ exports.StippledCard = exports.ImageCard = exports.IllustrationCard = exports.GroupCardFooter = exports.GroupCardTitle = exports.GroupCardElement = exports.GroupCard = exports.IconCard = exports.TextCard = exports.CardBase = void 0;
4
4
  var CardBase_1 = require("./CardBase");
5
5
  Object.defineProperty(exports, "CardBase", { enumerable: true, get: function () { return CardBase_1.CardBase; } });
6
6
  var TextCard_1 = require("./TextCard/TextCard");
@@ -11,6 +11,10 @@ var GroupCard_1 = require("./GroupCard/GroupCard");
11
11
  Object.defineProperty(exports, "GroupCard", { enumerable: true, get: function () { return GroupCard_1.GroupCard; } });
12
12
  var GroupCardElement_1 = require("./GroupCard/GroupCardElement");
13
13
  Object.defineProperty(exports, "GroupCardElement", { enumerable: true, get: function () { return GroupCardElement_1.GroupCardElement; } });
14
+ var GroupCardTitle_1 = require("./GroupCard/GroupCardTitle");
15
+ Object.defineProperty(exports, "GroupCardTitle", { enumerable: true, get: function () { return GroupCardTitle_1.GroupCardTitle; } });
16
+ var GroupCardFooter_1 = require("./GroupCard/GroupCardFooter");
17
+ Object.defineProperty(exports, "GroupCardFooter", { enumerable: true, get: function () { return GroupCardFooter_1.GroupCardFooter; } });
14
18
  var IllustrationCard_1 = require("./IllustrationCard/IllustrationCard");
15
19
  Object.defineProperty(exports, "IllustrationCard", { enumerable: true, get: function () { return IllustrationCard_1.IllustrationCard; } });
16
20
  var ImageCard_1 = require("./ImageCard/ImageCard");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sb1/ffe-cards-react",
3
- "version": "17.3.1",
3
+ "version": "17.4.0",
4
4
  "description": "React implementation of ffe-react",
5
5
  "license": "MIT",
6
6
  "author": "SpareBank 1",
@@ -26,7 +26,7 @@
26
26
  "test:watch": "ffe-buildtool jest --watch"
27
27
  },
28
28
  "dependencies": {
29
- "@sb1/ffe-cards": "^20.0.0"
29
+ "@sb1/ffe-cards": "^20.1.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@sb1/ffe-buildtool": "^0.8.0",
@@ -40,5 +40,5 @@
40
40
  "publishConfig": {
41
41
  "access": "public"
42
42
  },
43
- "gitHead": "98d33cf2e867ce718139edf1adf97336b8da6b68"
43
+ "gitHead": "34e8b677a65ef2704f1dd5c55a8380d10e7d6cd2"
44
44
  }
@@ -0,0 +1,12 @@
1
+ import React, { ElementType } from 'react';
2
+ import { CardRenderProps, ComponentAsPropParams } from '../types';
3
+ export type GroupCardFooterProps<As extends ElementType = 'div'> = Omit<ComponentAsPropParams<As>, 'children'> & {
4
+ /** No padding on the element */
5
+ noPadding?: boolean;
6
+ children: React.ReactNode | ((cardRenderProps: CardRenderProps) => React.ReactNode);
7
+ };
8
+ export declare const GroupCardFooter: <As extends ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
9
+ /** No padding on the element */
10
+ noPadding?: boolean;
11
+ children: React.ReactNode | ((cardRenderProps: CardRenderProps) => React.ReactNode);
12
+ } & React.RefAttributes<any>) => React.JSX.Element;
@@ -0,0 +1,16 @@
1
+ import React, { ElementType } from 'react';
2
+ import { CardRenderProps, ComponentAsPropParams } from '../types';
3
+ export type GroupCardTitleProps<As extends ElementType = 'div'> = Omit<ComponentAsPropParams<As>, 'children'> & {
4
+ /** No padding on the element */
5
+ noPadding?: boolean;
6
+ /** Visible border underneath title*/
7
+ noSeparator?: boolean;
8
+ children: React.ReactNode | ((cardRenderProps: CardRenderProps) => React.ReactNode);
9
+ };
10
+ export declare const GroupCardTitle: <As extends ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
11
+ /** No padding on the element */
12
+ noPadding?: boolean;
13
+ /** Visible border underneath title*/
14
+ noSeparator?: boolean;
15
+ children: React.ReactNode | ((cardRenderProps: CardRenderProps) => React.ReactNode);
16
+ } & React.RefAttributes<any>) => React.JSX.Element;
package/types/index.d.ts CHANGED
@@ -3,6 +3,8 @@ export { TextCard, TextCardProps } from './TextCard/TextCard';
3
3
  export { IconCard, IconCardProps } from './IconCard/IconCard';
4
4
  export { GroupCard, GroupCardProps } from './GroupCard/GroupCard';
5
5
  export { GroupCardElement, GroupCardElementProps, } from './GroupCard/GroupCardElement';
6
+ export { GroupCardTitle, GroupCardTitleProps, } from './GroupCard/GroupCardTitle';
7
+ export { GroupCardFooter, GroupCardFooterProps, } from './GroupCard/GroupCardFooter';
6
8
  export { IllustrationCard, IllustrationCardProps, } from './IllustrationCard/IllustrationCard';
7
9
  export { ImageCard, ImageCardProps } from './ImageCard/ImageCard';
8
10
  export { StippledCard, StippledCardProps } from './StippledCard/StippledCard';