@sb1/ffe-cards-react 17.6.1 → 17.6.2

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.
@@ -0,0 +1 @@
1
+ {"root":["../src/CardBase.tsx","../src/fixedForwardRef.tsx","../src/index.ts","../src/mergeRefs.ts","../src/types.ts","../src/GroupCard/GroupCard.tsx","../src/GroupCard/GroupCardElement.tsx","../src/GroupCard/GroupCardFooter.tsx","../src/GroupCard/GroupCardTitle.tsx","../src/IconCard/IconCard.tsx","../src/IllustrationCard/IllustrationCard.tsx","../src/ImageCard/ImageCard.tsx","../src/StippledCard/StippledCard.tsx","../src/TextCard/TextCard.tsx","../src/components/CardAction.tsx","../src/components/CardName.tsx","../src/components/ComponentBase.tsx","../src/components/Subtext.tsx","../src/components/Text.tsx","../src/components/Title.tsx","../src/components/WithCardAction.tsx","../src/components/index.ts"],"version":"5.7.2"}
@@ -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;
@@ -26,13 +26,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
26
26
  }) : function(o, v) {
27
27
  o["default"] = v;
28
28
  });
29
- var __importStar = (this && this.__importStar) || function (mod) {
30
- if (mod && mod.__esModule) return mod;
31
- var result = {};
32
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
- __setModuleDefault(result, mod);
34
- return result;
35
- };
29
+ var __importStar = (this && this.__importStar) || (function () {
30
+ var ownKeys = function(o) {
31
+ ownKeys = Object.getOwnPropertyNames || function (o) {
32
+ var ar = [];
33
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
34
+ return ar;
35
+ };
36
+ return ownKeys(o);
37
+ };
38
+ return function (mod) {
39
+ if (mod && mod.__esModule) return mod;
40
+ var result = {};
41
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
42
+ __setModuleDefault(result, mod);
43
+ return result;
44
+ };
45
+ })();
36
46
  var __rest = (this && this.__rest) || function (s, e) {
37
47
  var t = {};
38
48
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
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;
@@ -0,0 +1 @@
1
+ {"root":["../src/CardBase.tsx","../src/fixedForwardRef.tsx","../src/index.ts","../src/mergeRefs.ts","../src/types.ts","../src/GroupCard/GroupCard.tsx","../src/GroupCard/GroupCardElement.tsx","../src/GroupCard/GroupCardFooter.tsx","../src/GroupCard/GroupCardTitle.tsx","../src/IconCard/IconCard.tsx","../src/IllustrationCard/IllustrationCard.tsx","../src/ImageCard/ImageCard.tsx","../src/StippledCard/StippledCard.tsx","../src/TextCard/TextCard.tsx","../src/components/CardAction.tsx","../src/components/CardName.tsx","../src/components/ComponentBase.tsx","../src/components/Subtext.tsx","../src/components/Text.tsx","../src/components/Title.tsx","../src/components/WithCardAction.tsx","../src/components/index.ts"],"version":"5.7.2"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sb1/ffe-cards-react",
3
- "version": "17.6.1",
3
+ "version": "17.6.2",
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": "7110be1a43ed8022465ccb49a09d1efb0bab7687"
43
+ "gitHead": "4465142f7caa3b58f7468b04687120ac639fa19e"
44
44
  }
@@ -11,13 +11,13 @@ export type CardBaseProps<As extends ElementType = 'div'> = Omit<ComponentAsProp
11
11
  noPadding?: boolean;
12
12
  children: WithCardActionProps['children'] | React.ReactNode;
13
13
  };
14
- export declare const CardBase: <As extends React.ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
15
- shadow?: boolean | undefined;
14
+ export declare const CardBase: <As extends ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
15
+ shadow?: boolean;
16
16
  /** No margin on card */
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;
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;
@@ -7,10 +7,10 @@ export type GroupCardElementProps<As extends ElementType = 'div'> = Omit<Compone
7
7
  noSeparator?: boolean;
8
8
  children: React.ReactNode | ((cardRenderProps: CardRenderProps) => React.ReactNode);
9
9
  };
10
- export declare const GroupCardElement: <As extends React.ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
10
+ export declare const GroupCardElement: <As extends ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
11
11
  /** No padding on the element */
12
- noPadding?: boolean | undefined;
12
+ noPadding?: boolean;
13
13
  /** Visible border between the elements*/
14
- noSeparator?: boolean | undefined;
14
+ noSeparator?: boolean;
15
15
  children: React.ReactNode | ((cardRenderProps: CardRenderProps) => React.ReactNode);
16
16
  } & React.RefAttributes<any>) => React.JSX.Element;
@@ -5,8 +5,8 @@ export type GroupCardFooterProps<As extends ElementType = 'div'> = Omit<Componen
5
5
  noPadding?: boolean;
6
6
  children: React.ReactNode | ((cardRenderProps: CardRenderProps) => React.ReactNode);
7
7
  };
8
- export declare const GroupCardFooter: <As extends React.ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
8
+ export declare const GroupCardFooter: <As extends ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
9
9
  /** No padding on the element */
10
- noPadding?: boolean | undefined;
10
+ noPadding?: boolean;
11
11
  children: React.ReactNode | ((cardRenderProps: CardRenderProps) => React.ReactNode);
12
12
  } & React.RefAttributes<any>) => React.JSX.Element;
@@ -7,10 +7,10 @@ export type GroupCardTitleProps<As extends ElementType = 'div'> = Omit<Component
7
7
  noSeparator?: boolean;
8
8
  children: React.ReactNode | ((cardRenderProps: CardRenderProps) => React.ReactNode);
9
9
  };
10
- export declare const GroupCardTitle: <As extends React.ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
10
+ export declare const GroupCardTitle: <As extends ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
11
11
  /** No padding on the element */
12
- noPadding?: boolean | undefined;
12
+ noPadding?: boolean;
13
13
  /** Visible border underneath title*/
14
- noSeparator?: boolean | undefined;
14
+ noSeparator?: boolean;
15
15
  children: React.ReactNode | ((cardRenderProps: CardRenderProps) => React.ReactNode);
16
16
  } & React.RefAttributes<any>) => React.JSX.Element;
@@ -11,14 +11,14 @@ export type IconCardProps<As extends ElementType = 'div'> = Omit<ComponentAsProp
11
11
  noMargin?: boolean;
12
12
  children: React.ReactNode | ((cardRenderProps: CardRenderProps) => React.ReactNode);
13
13
  };
14
- export declare const IconCard: <As extends React.ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
14
+ export declare const IconCard: <As extends ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
15
15
  /** Element of icon */
16
16
  icon: ReactElement;
17
17
  /** Smaller icon and less space */
18
- condensed?: boolean | undefined;
18
+ condensed?: boolean;
19
19
  /** Position icon at left (default) or right of the card content */
20
- iconPosition?: "left" | "right" | undefined;
20
+ iconPosition?: "right" | "left";
21
21
  /** No margin on card */
22
- noMargin?: boolean | undefined;
22
+ noMargin?: boolean;
23
23
  children: React.ReactNode | ((cardRenderProps: CardRenderProps) => React.ReactNode);
24
24
  } & React.RefAttributes<any>) => React.JSX.Element;
@@ -11,14 +11,14 @@ export type IllustrationCardProps<As extends ElementType = 'div'> = Omit<Compone
11
11
  noMargin?: boolean;
12
12
  children: React.ReactNode | ((cardRenderProps: CardRenderProps) => React.ReactNode);
13
13
  };
14
- export declare const IllustrationCard: <As extends React.ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
14
+ export declare const IllustrationCard: <As extends ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
15
15
  /** Element of illustration */
16
16
  img: ReactElement;
17
17
  /** Smaller illustration and less space */
18
- condensed?: boolean | undefined;
18
+ condensed?: boolean;
19
19
  /** Position illustration at left (default) or right of the card content */
20
- illustrationPosition?: "left" | "right" | undefined;
20
+ illustrationPosition?: "right" | "left";
21
21
  /** No margin on card */
22
- noMargin?: boolean | undefined;
22
+ noMargin?: boolean;
23
23
  children: React.ReactNode | ((cardRenderProps: CardRenderProps) => React.ReactNode);
24
24
  } & React.RefAttributes<any>) => React.JSX.Element;
@@ -9,12 +9,12 @@ export type ImageCardProps<As extends ElementType = 'div'> = Omit<ComponentAsPro
9
9
  noMargin?: boolean;
10
10
  children: React.ReactNode | ((cardRenderProps: CardRenderProps) => React.ReactNode);
11
11
  };
12
- export declare const ImageCard: <As extends React.ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
12
+ export declare const ImageCard: <As extends ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
13
13
  /** The src for the image */
14
14
  imageSrc: string;
15
15
  /** The alt text for the image */
16
16
  imageAltText: string;
17
17
  /** No margin on card */
18
- noMargin?: boolean | undefined;
18
+ noMargin?: boolean;
19
19
  children: React.ReactNode | ((cardRenderProps: CardRenderProps) => React.ReactNode);
20
20
  } & React.RefAttributes<any>) => React.JSX.Element;
@@ -14,14 +14,14 @@ export type StippledCardProps<As extends ElementType = 'div'> = Omit<ComponentAs
14
14
  noMargin?: boolean;
15
15
  children: React.ReactNode | ((cardRenderProps: CardRenderProps) => React.ReactNode);
16
16
  };
17
- export declare const StippledCard: <As extends React.ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
17
+ export declare const StippledCard: <As extends ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
18
18
  /** Smaller icon and less space */
19
- condensed?: boolean | undefined;
19
+ condensed?: boolean;
20
20
  /** Image to be rendered*/
21
- img?: Img | undefined;
22
- rightImg?: Img | undefined;
21
+ img?: Img;
22
+ rightImg?: Img;
23
23
  /** No margin on card */
24
- noMargin?: boolean | undefined;
24
+ noMargin?: boolean;
25
25
  children: React.ReactNode | ((cardRenderProps: CardRenderProps) => React.ReactNode);
26
26
  } & React.RefAttributes<any>) => React.JSX.Element;
27
27
  export {};
@@ -8,11 +8,11 @@ export type TextCardProps<As extends ElementType = 'div'> = Omit<ComponentAsProp
8
8
  /** Function that's passed available subcomponents as arguments, or regular children */
9
9
  children: React.ReactNode | ((cardRenderProps: CardRenderProps) => React.ReactNode);
10
10
  };
11
- export declare const TextCard: <As extends React.ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
11
+ export declare const TextCard: <As extends ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
12
12
  /** Left-aligned text on the card */
13
- leftAlign?: boolean | undefined;
13
+ leftAlign?: boolean;
14
14
  /** No margin on card */
15
- noMargin?: boolean | undefined;
15
+ noMargin?: boolean;
16
16
  /** Function that's passed available subcomponents as arguments, or regular children */
17
17
  children: React.ReactNode | ((cardRenderProps: CardRenderProps) => React.ReactNode);
18
18
  } & React.RefAttributes<any>) => React.JSX.Element;
@@ -1,8 +1,8 @@
1
- import React, { ElementType } from 'react';
1
+ import React, { ElementType, ForwardedRef } 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
- ref: React.ForwardedRef<any>;
7
+ ref: ForwardedRef<any>;
8
8
  }> & React.RefAttributes<any>) => React.JSX.Element;
@@ -7,7 +7,7 @@ export type WithCardActionProps<As extends ElementType = 'div'> = Omit<Component
7
7
  CardAction: typeof CardAction;
8
8
  }) => React.ReactNode;
9
9
  };
10
- export declare const WithCardAction: <As extends React.ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
10
+ export declare const WithCardAction: <As extends ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
11
11
  baseClassName: string;
12
12
  children: (props: {
13
13
  CardAction: typeof CardAction;
package/types/index.d.ts CHANGED
@@ -8,3 +8,4 @@ export { GroupCardFooter, type GroupCardFooterProps, } from './GroupCard/GroupCa
8
8
  export { IllustrationCard, type IllustrationCardProps, } from './IllustrationCard/IllustrationCard';
9
9
  export { ImageCard, type ImageCardProps } from './ImageCard/ImageCard';
10
10
  export { StippledCard, type StippledCardProps, } from './StippledCard/StippledCard';
11
+ export type { CardRenderProps, CardActionRenderProps } from './types';
@@ -0,0 +1 @@
1
+ {"root":["../src/CardBase.tsx","../src/fixedForwardRef.tsx","../src/index.ts","../src/mergeRefs.ts","../src/types.ts","../src/GroupCard/GroupCard.tsx","../src/GroupCard/GroupCardElement.tsx","../src/GroupCard/GroupCardFooter.tsx","../src/GroupCard/GroupCardTitle.tsx","../src/IconCard/IconCard.tsx","../src/IllustrationCard/IllustrationCard.tsx","../src/ImageCard/ImageCard.tsx","../src/StippledCard/StippledCard.tsx","../src/TextCard/TextCard.tsx","../src/components/CardAction.tsx","../src/components/CardName.tsx","../src/components/ComponentBase.tsx","../src/components/Subtext.tsx","../src/components/Text.tsx","../src/components/Title.tsx","../src/components/WithCardAction.tsx","../src/components/index.ts"],"version":"5.7.2"}
package/types/types.d.ts CHANGED
@@ -14,5 +14,8 @@ export interface CardRenderProps {
14
14
  Text: typeof Text;
15
15
  CardAction: typeof CardAction;
16
16
  }
17
+ export interface CardActionRenderProps {
18
+ CardAction: typeof CardAction;
19
+ }
17
20
  export type BgColor = 'sand-30' | 'sand-70' | 'frost-30' | 'syrin-30' | 'syrin-70';
18
21
  export type BgColorDarkmode = 'natt' | 'svart' | 'koksgraa';