@sb1/ffe-cards-react 16.1.0 → 16.1.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.
package/es/CardBase.js CHANGED
@@ -27,7 +27,6 @@ import { fixedForwardRef } from './fixedForwardRef';
27
27
  function CardBaseWithForwardRef(props, ref) {
28
28
  var _a;
29
29
  var className = props.className, shadow = props.shadow, noMargin = props.noMargin, textCenter = props.textCenter, bgColor = props.bgColor, bgDarkmodeColor = props.bgDarkmodeColor, noPadding = props.noPadding, children = props.children, rest = __rest(props, ["className", "shadow", "noMargin", "textCenter", "bgColor", "bgDarkmodeColor", "noPadding", "children"]);
30
- var withCardActionProps = __assign({}, rest);
31
30
  return (React.createElement(WithCardAction, __assign({ className: classNames('ffe-card-base', className, (_a = {},
32
31
  _a["ffe-card-base--bg-".concat(bgColor)] = bgColor,
33
32
  _a["ffe-card-base--dm-bg-".concat(bgDarkmodeColor)] = bgDarkmodeColor,
@@ -35,7 +34,7 @@ function CardBaseWithForwardRef(props, ref) {
35
34
  _a['ffe-card-base--no-margin'] = noMargin,
36
35
  _a['ffe-card-base--text-center'] = textCenter,
37
36
  _a['ffe-card-base--no-padding'] = noPadding,
38
- _a)) }, withCardActionProps, { ref: ref }), function (_a) {
37
+ _a)) }, rest, { ref: ref }), function (_a) {
39
38
  var CardAction = _a.CardAction;
40
39
  return typeof children === 'function'
41
40
  ? children({ CardAction: CardAction })
@@ -26,8 +26,7 @@ import { WithCardAction, Text, Subtext, Title, CardName } from '../components';
26
26
  import { fixedForwardRef } from '../fixedForwardRef';
27
27
  function IconCardWithForwardRef(props, ref) {
28
28
  var className = props.className, condensed = props.condensed, icon = props.icon, children = props.children, rest = __rest(props, ["className", "condensed", "icon", "children"]);
29
- var withCardActionProps = __assign({}, rest);
30
- return (React.createElement(WithCardAction, __assign({ className: classNames('ffe-icon-card', { 'ffe-icon-card--condensed': condensed }, className) }, withCardActionProps, { ref: ref }), function (_a) {
29
+ return (React.createElement(WithCardAction, __assign({ className: classNames('ffe-icon-card', { 'ffe-icon-card--condensed': condensed }, className) }, rest, { ref: ref }), function (_a) {
31
30
  var CardAction = _a.CardAction;
32
31
  return (React.createElement(React.Fragment, null,
33
32
  React.cloneElement(icon, __assign(__assign({}, icon.props), { className: classNames('ffe-icon-card__icon', icon.props.className) })),
@@ -26,8 +26,7 @@ import { CardName, Subtext, Text, Title, WithCardAction } from '../components';
26
26
  import { fixedForwardRef } from '../fixedForwardRef';
27
27
  function ImageCardWithForwardRef(props, ref) {
28
28
  var className = props.className, imageSrc = props.imageSrc, imageAltText = props.imageAltText, children = props.children, rest = __rest(props, ["className", "imageSrc", "imageAltText", "children"]);
29
- var withCardActionProps = __assign({}, rest);
30
- return (React.createElement(WithCardAction, __assign({ className: classNames('ffe-image-card', className) }, withCardActionProps, { ref: ref }), function (_a) {
29
+ return (React.createElement(WithCardAction, __assign({ className: classNames('ffe-image-card', className) }, rest, { ref: ref }), function (_a) {
31
30
  var CardAction = _a.CardAction;
32
31
  return (React.createElement(React.Fragment, null,
33
32
  React.createElement("div", { className: "ffe-image-card__image-container" },
@@ -26,8 +26,7 @@ import { CardName, Subtext, Text, Title, WithCardAction } from '../components';
26
26
  import { fixedForwardRef } from '../fixedForwardRef';
27
27
  function StippledCardWithForwardRef(props, ref) {
28
28
  var className = props.className, condensed = props.condensed, img = props.img, children = props.children, rest = __rest(props, ["className", "condensed", "img", "children"]);
29
- var withCardActionProps = __assign({}, rest);
30
- return (React.createElement(WithCardAction, __assign({ className: classNames('ffe-stippled-card', { 'ffe-stippled-card--condensed': condensed }, className) }, withCardActionProps, { ref: ref }), function (_a) {
29
+ return (React.createElement(WithCardAction, __assign({ className: classNames('ffe-stippled-card', { 'ffe-stippled-card--condensed': condensed }, className) }, rest, { ref: ref }), function (_a) {
31
30
  var CardAction = _a.CardAction;
32
31
  return (React.createElement(React.Fragment, null,
33
32
  React.createElement("div", { className: classNames('ffe-stippled-card__img', {
@@ -26,8 +26,7 @@ import { CardName, Subtext, Text, Title, WithCardAction } from '../components';
26
26
  import { fixedForwardRef } from '../fixedForwardRef';
27
27
  function TextCardWithForwardRef(props, ref) {
28
28
  var className = props.className, leftAlign = props.leftAlign, children = props.children, rest = __rest(props, ["className", "leftAlign", "children"]);
29
- var withCardActionProps = __assign({}, rest);
30
- return (React.createElement(WithCardAction, __assign({ className: classNames('ffe-text-card', { 'ffe-text-card--left-align': leftAlign }, className) }, withCardActionProps, { ref: ref }), function (_a) {
29
+ return (React.createElement(WithCardAction, __assign({ className: classNames('ffe-text-card', { 'ffe-text-card--left-align': leftAlign }, className) }, rest, { ref: ref }), function (_a) {
31
30
  var CardAction = _a.CardAction;
32
31
  return typeof children === 'function'
33
32
  ? children({ Text: Text, Subtext: Subtext, Title: Title, CardName: CardName, CardAction: CardAction })
package/lib/CardBase.js CHANGED
@@ -33,7 +33,6 @@ var fixedForwardRef_1 = require("./fixedForwardRef");
33
33
  function CardBaseWithForwardRef(props, ref) {
34
34
  var _a;
35
35
  var className = props.className, shadow = props.shadow, noMargin = props.noMargin, textCenter = props.textCenter, bgColor = props.bgColor, bgDarkmodeColor = props.bgDarkmodeColor, noPadding = props.noPadding, children = props.children, rest = __rest(props, ["className", "shadow", "noMargin", "textCenter", "bgColor", "bgDarkmodeColor", "noPadding", "children"]);
36
- var withCardActionProps = __assign({}, rest);
37
36
  return (react_1.default.createElement(components_1.WithCardAction, __assign({ className: (0, classnames_1.default)('ffe-card-base', className, (_a = {},
38
37
  _a["ffe-card-base--bg-".concat(bgColor)] = bgColor,
39
38
  _a["ffe-card-base--dm-bg-".concat(bgDarkmodeColor)] = bgDarkmodeColor,
@@ -41,7 +40,7 @@ function CardBaseWithForwardRef(props, ref) {
41
40
  _a['ffe-card-base--no-margin'] = noMargin,
42
41
  _a['ffe-card-base--text-center'] = textCenter,
43
42
  _a['ffe-card-base--no-padding'] = noPadding,
44
- _a)) }, withCardActionProps, { ref: ref }), function (_a) {
43
+ _a)) }, rest, { ref: ref }), function (_a) {
45
44
  var CardAction = _a.CardAction;
46
45
  return typeof children === 'function'
47
46
  ? children({ CardAction: CardAction })
@@ -32,8 +32,7 @@ var components_1 = require("../components");
32
32
  var fixedForwardRef_1 = require("../fixedForwardRef");
33
33
  function IconCardWithForwardRef(props, ref) {
34
34
  var className = props.className, condensed = props.condensed, icon = props.icon, children = props.children, rest = __rest(props, ["className", "condensed", "icon", "children"]);
35
- var withCardActionProps = __assign({}, rest);
36
- return (react_1.default.createElement(components_1.WithCardAction, __assign({ className: (0, classnames_1.default)('ffe-icon-card', { 'ffe-icon-card--condensed': condensed }, className) }, withCardActionProps, { ref: ref }), function (_a) {
35
+ return (react_1.default.createElement(components_1.WithCardAction, __assign({ className: (0, classnames_1.default)('ffe-icon-card', { 'ffe-icon-card--condensed': condensed }, className) }, rest, { ref: ref }), function (_a) {
37
36
  var CardAction = _a.CardAction;
38
37
  return (react_1.default.createElement(react_1.default.Fragment, null,
39
38
  react_1.default.cloneElement(icon, __assign(__assign({}, icon.props), { className: (0, classnames_1.default)('ffe-icon-card__icon', icon.props.className) })),
@@ -32,8 +32,7 @@ var components_1 = require("../components");
32
32
  var fixedForwardRef_1 = require("../fixedForwardRef");
33
33
  function ImageCardWithForwardRef(props, ref) {
34
34
  var className = props.className, imageSrc = props.imageSrc, imageAltText = props.imageAltText, children = props.children, rest = __rest(props, ["className", "imageSrc", "imageAltText", "children"]);
35
- var withCardActionProps = __assign({}, rest);
36
- return (react_1.default.createElement(components_1.WithCardAction, __assign({ className: (0, classnames_1.default)('ffe-image-card', className) }, withCardActionProps, { ref: ref }), function (_a) {
35
+ return (react_1.default.createElement(components_1.WithCardAction, __assign({ className: (0, classnames_1.default)('ffe-image-card', className) }, rest, { ref: ref }), function (_a) {
37
36
  var CardAction = _a.CardAction;
38
37
  return (react_1.default.createElement(react_1.default.Fragment, null,
39
38
  react_1.default.createElement("div", { className: "ffe-image-card__image-container" },
@@ -32,8 +32,7 @@ var components_1 = require("../components");
32
32
  var fixedForwardRef_1 = require("../fixedForwardRef");
33
33
  function StippledCardWithForwardRef(props, ref) {
34
34
  var className = props.className, condensed = props.condensed, img = props.img, children = props.children, rest = __rest(props, ["className", "condensed", "img", "children"]);
35
- var withCardActionProps = __assign({}, rest);
36
- return (react_1.default.createElement(components_1.WithCardAction, __assign({ className: (0, classnames_1.default)('ffe-stippled-card', { 'ffe-stippled-card--condensed': condensed }, className) }, withCardActionProps, { ref: ref }), function (_a) {
35
+ return (react_1.default.createElement(components_1.WithCardAction, __assign({ className: (0, classnames_1.default)('ffe-stippled-card', { 'ffe-stippled-card--condensed': condensed }, className) }, rest, { ref: ref }), function (_a) {
37
36
  var CardAction = _a.CardAction;
38
37
  return (react_1.default.createElement(react_1.default.Fragment, null,
39
38
  react_1.default.createElement("div", { className: (0, classnames_1.default)('ffe-stippled-card__img', {
@@ -32,8 +32,7 @@ var components_1 = require("../components");
32
32
  var fixedForwardRef_1 = require("../fixedForwardRef");
33
33
  function TextCardWithForwardRef(props, ref) {
34
34
  var className = props.className, leftAlign = props.leftAlign, children = props.children, rest = __rest(props, ["className", "leftAlign", "children"]);
35
- var withCardActionProps = __assign({}, rest);
36
- return (react_1.default.createElement(components_1.WithCardAction, __assign({ className: (0, classnames_1.default)('ffe-text-card', { 'ffe-text-card--left-align': leftAlign }, className) }, withCardActionProps, { ref: ref }), function (_a) {
35
+ return (react_1.default.createElement(components_1.WithCardAction, __assign({ className: (0, classnames_1.default)('ffe-text-card', { 'ffe-text-card--left-align': leftAlign }, className) }, rest, { ref: ref }), function (_a) {
37
36
  var CardAction = _a.CardAction;
38
37
  return typeof children === 'function'
39
38
  ? children({ Text: components_1.Text, Subtext: components_1.Subtext, Title: components_1.Title, CardName: components_1.CardName, CardAction: CardAction })
@@ -25,7 +25,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
25
25
  return (mod && mod.__esModule) ? mod : { "default": mod };
26
26
  };
27
27
  Object.defineProperty(exports, "__esModule", { value: true });
28
- exports.CardName = void 0;
28
+ exports.CardName = CardName;
29
29
  var react_1 = __importDefault(require("react"));
30
30
  var classnames_1 = __importDefault(require("classnames"));
31
31
  var ComponentBase_1 = require("./ComponentBase");
@@ -33,4 +33,3 @@ function CardName(props) {
33
33
  var className = props.className, rest = __rest(props, ["className"]);
34
34
  return (react_1.default.createElement(ComponentBase_1.ComponentBase, __assign({ className: (0, classnames_1.default)('ffe-card-body__card-name', className) }, rest)));
35
35
  }
36
- exports.CardName = CardName;
@@ -25,10 +25,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
25
25
  return (mod && mod.__esModule) ? mod : { "default": mod };
26
26
  };
27
27
  Object.defineProperty(exports, "__esModule", { value: true });
28
- exports.ComponentBase = void 0;
28
+ exports.ComponentBase = ComponentBase;
29
29
  var react_1 = __importDefault(require("react"));
30
30
  function ComponentBase(props) {
31
31
  var _a = props.as, Comp = _a === void 0 ? 'p' : _a, rest = __rest(props, ["as"]);
32
32
  return react_1.default.createElement(Comp, __assign({}, rest));
33
33
  }
34
- exports.ComponentBase = ComponentBase;
@@ -25,7 +25,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
25
25
  return (mod && mod.__esModule) ? mod : { "default": mod };
26
26
  };
27
27
  Object.defineProperty(exports, "__esModule", { value: true });
28
- exports.Subtext = void 0;
28
+ exports.Subtext = Subtext;
29
29
  var react_1 = __importDefault(require("react"));
30
30
  var classnames_1 = __importDefault(require("classnames"));
31
31
  var ComponentBase_1 = require("./ComponentBase");
@@ -33,4 +33,3 @@ function Subtext(props) {
33
33
  var className = props.className, rest = __rest(props, ["className"]);
34
34
  return (react_1.default.createElement(ComponentBase_1.ComponentBase, __assign({ className: (0, classnames_1.default)('ffe-card-body__subtext', className) }, rest)));
35
35
  }
36
- exports.Subtext = Subtext;
@@ -25,7 +25,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
25
25
  return (mod && mod.__esModule) ? mod : { "default": mod };
26
26
  };
27
27
  Object.defineProperty(exports, "__esModule", { value: true });
28
- exports.Text = void 0;
28
+ exports.Text = Text;
29
29
  var react_1 = __importDefault(require("react"));
30
30
  var classnames_1 = __importDefault(require("classnames"));
31
31
  var ComponentBase_1 = require("./ComponentBase");
@@ -33,4 +33,3 @@ function Text(props) {
33
33
  var className = props.className, rest = __rest(props, ["className"]);
34
34
  return (react_1.default.createElement(ComponentBase_1.ComponentBase, __assign({ className: (0, classnames_1.default)('ffe-card-body__text', className) }, rest)));
35
35
  }
36
- exports.Text = Text;
@@ -25,7 +25,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
25
25
  return (mod && mod.__esModule) ? mod : { "default": mod };
26
26
  };
27
27
  Object.defineProperty(exports, "__esModule", { value: true });
28
- exports.Title = void 0;
28
+ exports.Title = Title;
29
29
  var react_1 = __importDefault(require("react"));
30
30
  var classnames_1 = __importDefault(require("classnames"));
31
31
  var ComponentBase_1 = require("./ComponentBase");
@@ -35,4 +35,3 @@ function Title(props) {
35
35
  'ffe-card-body__title--overflow-ellipsis': overflowEllipsis,
36
36
  }, className) }, rest)));
37
37
  }
38
- exports.Title = Title;
package/lib/mergeRefs.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mergeRefs = void 0;
3
+ exports.mergeRefs = mergeRefs;
4
4
  function mergeRefs(refs) {
5
5
  return function (value) {
6
6
  refs.forEach(function (ref) {
@@ -14,4 +14,3 @@ function mergeRefs(refs) {
14
14
  });
15
15
  };
16
16
  }
17
- exports.mergeRefs = mergeRefs;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sb1/ffe-cards-react",
3
- "version": "16.1.0",
3
+ "version": "16.1.1",
4
4
  "description": "React implementation of ffe-react",
5
5
  "license": "MIT",
6
6
  "author": "SpareBank 1",
@@ -40,5 +40,5 @@
40
40
  "publishConfig": {
41
41
  "access": "public"
42
42
  },
43
- "gitHead": "05bff605c7ba31315c43502a94476248b5d1186d"
43
+ "gitHead": "93dd227b3321cf54c3a3acf4144c50dad248033f"
44
44
  }
@@ -12,13 +12,13 @@ export type CardBaseProps<As extends ElementType = 'div'> = Omit<ComponentAsProp
12
12
  noPadding?: boolean;
13
13
  children: WithCardActionProps['children'] | React.ReactNode;
14
14
  };
15
- export declare const CardBase: <As extends React.ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
16
- shadow?: boolean | undefined;
17
- noMargin?: boolean | undefined;
18
- textCenter?: boolean | undefined;
19
- bgColor?: BgColor | undefined;
20
- bgDarkmodeColor?: BgColorDarkmode | undefined;
21
- noPadding?: boolean | undefined;
22
- children: WithCardActionProps['children'] | React.ReactNode;
15
+ export declare const CardBase: <As extends ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
16
+ shadow?: boolean;
17
+ noMargin?: boolean;
18
+ textCenter?: boolean;
19
+ bgColor?: BgColor;
20
+ bgDarkmodeColor?: BgColorDarkmode;
21
+ noPadding?: boolean;
22
+ children: WithCardActionProps["children"] | React.ReactNode;
23
23
  } & React.RefAttributes<any>) => React.JSX.Element;
24
24
  export {};
@@ -7,10 +7,10 @@ export type IconCardProps<As extends ElementType = 'div'> = Omit<ComponentAsProp
7
7
  condensed?: boolean;
8
8
  children: React.ReactNode | ((cardRenderProps: CardRenderProps) => React.ReactNode);
9
9
  };
10
- export declare const IconCard: <As extends React.ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
10
+ export declare const IconCard: <As extends ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
11
11
  /** Element of icon */
12
12
  icon: ReactElement;
13
13
  /** Smaller icon and less space */
14
- condensed?: boolean | undefined;
14
+ condensed?: boolean;
15
15
  children: React.ReactNode | ((cardRenderProps: CardRenderProps) => React.ReactNode);
16
16
  } & React.RefAttributes<any>) => React.JSX.Element;
@@ -7,7 +7,7 @@ export type ImageCardProps<As extends ElementType = 'div'> = Omit<ComponentAsPro
7
7
  imageAltText: string;
8
8
  children: React.ReactNode | ((cardRenderProps: CardRenderProps) => React.ReactNode);
9
9
  };
10
- export declare const ImageCard: <As extends React.ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
10
+ export declare const ImageCard: <As extends ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
11
11
  /** The src for the image */
12
12
  imageSrc: string;
13
13
  /** The alt text for the image */
@@ -10,13 +10,13 @@ export type StippledCardProps<As extends ElementType = 'div'> = Omit<ComponentAs
10
10
  };
11
11
  children: React.ReactNode | ((cardRenderProps: CardRenderProps) => React.ReactNode);
12
12
  };
13
- export declare const StippledCard: <As extends React.ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
13
+ export declare const StippledCard: <As extends ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
14
14
  /** Smaller icon and less space */
15
- condensed?: boolean | undefined;
15
+ condensed?: boolean;
16
16
  /** Image to be rendered*/
17
17
  img?: {
18
18
  element: ReactNode;
19
- type: 'icon' | 'custom';
20
- } | undefined;
19
+ type: "icon" | "custom";
20
+ };
21
21
  children: React.ReactNode | ((cardRenderProps: CardRenderProps) => React.ReactNode);
22
22
  } & React.RefAttributes<any>) => React.JSX.Element;
@@ -3,12 +3,12 @@ import { CardRenderProps, ComponentAsPropParams } from '../types';
3
3
  export type TextCardProps<As extends ElementType = 'div'> = Omit<ComponentAsPropParams<As>, 'children'> & {
4
4
  /** Left-aligned text on the card */
5
5
  leftAlign?: boolean;
6
- /** Function that's passed available sub-components as arguments, or regular children */
6
+ /** Function that's passed available subcomponents as arguments, or regular children */
7
7
  children: React.ReactNode | ((cardRenderProps: CardRenderProps) => React.ReactNode);
8
8
  };
9
- export declare const TextCard: <As extends React.ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
9
+ export declare const TextCard: <As extends ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
10
10
  /** Left-aligned text on the card */
11
- leftAlign?: boolean | undefined;
12
- /** Function that's passed available sub-components as arguments, or regular children */
11
+ leftAlign?: boolean;
12
+ /** Function that's passed available subcomponents as arguments, or regular children */
13
13
  children: React.ReactNode | ((cardRenderProps: CardRenderProps) => React.ReactNode);
14
14
  } & React.RefAttributes<any>) => React.JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import React, { ElementType } from 'react';
2
2
  import { ComponentAsPropParams } from '../types';
3
3
  export type CardActionProps<As extends ElementType = 'a'> = ComponentAsPropParams<As>;
4
- export declare const CardAction: <As extends React.ElementType>(props: {
4
+ export declare const CardAction: <As extends ElementType>(props: {
5
5
  as?: As | undefined;
6
6
  } & import("../types").DistributiveOmit<React.ComponentPropsWithRef<React.ElementType extends As ? "a" : As>, "as" & {
7
7
  ref: React.ForwardedRef<any>;
@@ -6,7 +6,7 @@ export type WithCardActionProps<As extends ElementType = 'div'> = Omit<Component
6
6
  CardAction: typeof CardAction;
7
7
  }) => React.ReactNode;
8
8
  };
9
- export declare const WithCardAction: <As extends React.ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
9
+ export declare const WithCardAction: <As extends ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
10
10
  children: (props: {
11
11
  CardAction: typeof CardAction;
12
12
  }) => React.ReactNode;