@sb1/ffe-cards-react 18.0.0 → 19.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/CardBase.js CHANGED
@@ -20,17 +20,15 @@ var __rest = (this && this.__rest) || function (s, e) {
20
20
  }
21
21
  return t;
22
22
  };
23
- import React from 'react';
24
23
  import classNames from 'classnames';
24
+ import React from 'react';
25
25
  import { WithCardAction } from './components';
26
26
  import { fixedForwardRef } from './fixedForwardRef';
27
27
  function CardBaseWithForwardRef(props, ref) {
28
28
  var _a;
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"]);
29
+ var className = props.className, noMargin = props.noMargin, textCenter = props.textCenter, _b = props.bgColor, bgColor = _b === void 0 ? 'primary' : _b, noPadding = props.noPadding, children = props.children, rest = __rest(props, ["className", "noMargin", "textCenter", "bgColor", "noPadding", "children"]);
30
30
  return (React.createElement(WithCardAction, __assign({ baseClassName: "ffe-card-base", className: classNames('ffe-card-base', className, (_a = {},
31
31
  _a["ffe-card-base--bg-".concat(bgColor)] = bgColor,
32
- _a["ffe-card-base--dm-bg-".concat(bgDarkmodeColor)] = bgDarkmodeColor,
33
- _a['ffe-card-base--shadow'] = shadow,
34
32
  _a['ffe-card-base--no-margin'] = noMargin,
35
33
  _a['ffe-card-base--text-center'] = textCenter,
36
34
  _a['ffe-card-base--no-padding'] = noPadding,
@@ -20,18 +20,16 @@ var __rest = (this && this.__rest) || function (s, e) {
20
20
  }
21
21
  return t;
22
22
  };
23
- import React from 'react';
24
23
  import classNames from 'classnames';
24
+ import React from 'react';
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, noMargin = _a.noMargin, rest = __rest(_a, ["shadow", "className", "children", "bgColor", "bgDarkmodeColor", "noMargin"]);
28
+ var className = _a.className, children = _a.children, _c = _a.bgColor, bgColor = _c === void 0 ? 'primary' : _c, noMargin = _a.noMargin, rest = __rest(_a, ["className", "children", "bgColor", "noMargin"]);
29
29
  return (React.createElement("div", __assign({ className: classNames('ffe-group-card', (_b = {
30
- 'ffe-group-card--shadow': shadow,
31
30
  'ffe-group-card--no-margin': noMargin
32
31
  },
33
32
  _b["ffe-group-card--bg-".concat(bgColor)] = bgColor,
34
- _b["ffe-group-card--dm-bg-".concat(bgDarkmodeColor)] = bgDarkmodeColor,
35
33
  _b), className), role: "group" }, rest, { ref: ref }), children));
36
34
  }
37
35
  export var GroupCard = fixedForwardRef(GroupCardWithForwardRef);
package/lib/CardBase.js CHANGED
@@ -26,17 +26,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  };
27
27
  Object.defineProperty(exports, "__esModule", { value: true });
28
28
  exports.CardBase = void 0;
29
- var react_1 = __importDefault(require("react"));
30
29
  var classnames_1 = __importDefault(require("classnames"));
30
+ var react_1 = __importDefault(require("react"));
31
31
  var components_1 = require("./components");
32
32
  var fixedForwardRef_1 = require("./fixedForwardRef");
33
33
  function CardBaseWithForwardRef(props, ref) {
34
34
  var _a;
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"]);
35
+ var className = props.className, noMargin = props.noMargin, textCenter = props.textCenter, _b = props.bgColor, bgColor = _b === void 0 ? 'primary' : _b, noPadding = props.noPadding, children = props.children, rest = __rest(props, ["className", "noMargin", "textCenter", "bgColor", "noPadding", "children"]);
36
36
  return (react_1.default.createElement(components_1.WithCardAction, __assign({ baseClassName: "ffe-card-base", className: (0, classnames_1.default)('ffe-card-base', className, (_a = {},
37
37
  _a["ffe-card-base--bg-".concat(bgColor)] = bgColor,
38
- _a["ffe-card-base--dm-bg-".concat(bgDarkmodeColor)] = bgDarkmodeColor,
39
- _a['ffe-card-base--shadow'] = shadow,
40
38
  _a['ffe-card-base--no-margin'] = noMargin,
41
39
  _a['ffe-card-base--text-center'] = textCenter,
42
40
  _a['ffe-card-base--no-padding'] = noPadding,
@@ -26,18 +26,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  };
27
27
  Object.defineProperty(exports, "__esModule", { value: true });
28
28
  exports.GroupCard = void 0;
29
- var react_1 = __importDefault(require("react"));
30
29
  var classnames_1 = __importDefault(require("classnames"));
30
+ var react_1 = __importDefault(require("react"));
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, noMargin = _a.noMargin, rest = __rest(_a, ["shadow", "className", "children", "bgColor", "bgDarkmodeColor", "noMargin"]);
34
+ var className = _a.className, children = _a.children, _c = _a.bgColor, bgColor = _c === void 0 ? 'primary' : _c, noMargin = _a.noMargin, rest = __rest(_a, ["className", "children", "bgColor", "noMargin"]);
35
35
  return (react_1.default.createElement("div", __assign({ className: (0, classnames_1.default)('ffe-group-card', (_b = {
36
- 'ffe-group-card--shadow': shadow,
37
36
  'ffe-group-card--no-margin': noMargin
38
37
  },
39
38
  _b["ffe-group-card--bg-".concat(bgColor)] = bgColor,
40
- _b["ffe-group-card--dm-bg-".concat(bgDarkmodeColor)] = bgDarkmodeColor,
41
39
  _b), className), role: "group" }, rest, { ref: ref }), children));
42
40
  }
43
41
  exports.GroupCard = (0, fixedForwardRef_1.fixedForwardRef)(GroupCardWithForwardRef);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sb1/ffe-cards-react",
3
- "version": "18.0.0",
3
+ "version": "19.0.0",
4
4
  "description": "React implementation of ffe-react",
5
5
  "license": "MIT",
6
6
  "author": "SpareBank 1",
@@ -26,11 +26,11 @@
26
26
  "test:watch": "ffe-buildtool jest --watch"
27
27
  },
28
28
  "dependencies": {
29
- "@sb1/ffe-cards": "^21.0.0"
29
+ "@sb1/ffe-cards": "^22.0.0"
30
30
  },
31
31
  "devDependencies": {
32
- "@sb1/ffe-buildtool": "^0.9.1",
33
- "@sb1/ffe-icons-react": "^11.0.17",
32
+ "@sb1/ffe-buildtool": "^0.10.0",
33
+ "@sb1/ffe-icons-react": "^11.0.19",
34
34
  "react": "^18.2.0",
35
35
  "react-dom": "^18.2.0"
36
36
  },
@@ -40,5 +40,5 @@
40
40
  "publishConfig": {
41
41
  "access": "public"
42
42
  },
43
- "gitHead": "7b652097b54e99c0993ffb58b147805a54472a91"
43
+ "gitHead": "5a72f08b0873cc96b0d439dd029839db4d5d4ea9"
44
44
  }
@@ -1,23 +1,39 @@
1
1
  import React, { ElementType } from 'react';
2
2
  import { WithCardActionProps } from './components';
3
- import { BgColor, BgColorDarkmode, ComponentAsPropParams } from './types';
3
+ import { BackgroundColor, ComponentAsPropParams } from './types';
4
4
  export type CardBaseProps<As extends ElementType = 'div'> = Omit<ComponentAsPropParams<As>, 'children'> & {
5
- shadow?: boolean;
6
5
  /** No margin on card */
7
6
  noMargin?: boolean;
8
7
  textCenter?: boolean;
9
- bgColor?: BgColor;
10
- bgDarkmodeColor?: BgColorDarkmode;
8
+ /**
9
+ * Property has new values that work with dark and accent mode as part of the Semantic Color update
10
+ * Possible values: `primary` `secondary` `tertiary`
11
+ * [Read more in the upgrade guide](https://sparebank1.github.io/designsystem/?path=/docs/introduksjon-changelog--docs#2025---februar---semantiske-farger)
12
+ */
13
+ bgColor?: BackgroundColor;
14
+ /** @deprecated as part of update to Semantic Colors
15
+ *
16
+ * Property is replaced by the updated values for `bgColor` that works on dark mode
17
+ * [Read more in the upgrade guide](https://sparebank1.github.io/designsystem/?path=/docs/introduksjon-changelog--docs#2025---februar---semantiske-farger) */
18
+ bgDarkmodeColor?: never;
11
19
  noPadding?: boolean;
12
20
  children: WithCardActionProps['children'] | React.ReactNode;
13
21
  };
14
22
  export declare const CardBase: <As extends ElementType>(props: Omit<ComponentAsPropParams<As>, "children"> & {
15
- shadow?: boolean;
16
23
  /** No margin on card */
17
24
  noMargin?: boolean;
18
25
  textCenter?: boolean;
19
- bgColor?: BgColor;
20
- bgDarkmodeColor?: BgColorDarkmode;
26
+ /**
27
+ * Property has new values that work with dark and accent mode as part of the Semantic Color update
28
+ * Possible values: `primary` `secondary` `tertiary`
29
+ * [Read more in the upgrade guide](https://sparebank1.github.io/designsystem/?path=/docs/introduksjon-changelog--docs#2025---februar---semantiske-farger)
30
+ */
31
+ bgColor?: BackgroundColor;
32
+ /** @deprecated as part of update to Semantic Colors
33
+ *
34
+ * Property is replaced by the updated values for `bgColor` that works on dark mode
35
+ * [Read more in the upgrade guide](https://sparebank1.github.io/designsystem/?path=/docs/introduksjon-changelog--docs#2025---februar---semantiske-farger) */
36
+ bgDarkmodeColor?: never;
21
37
  noPadding?: boolean;
22
38
  children: WithCardActionProps["children"] | React.ReactNode;
23
39
  } & React.RefAttributes<any>) => React.JSX.Element;
@@ -1,13 +1,21 @@
1
1
  import React from 'react';
2
- import { BgColor, BgColorDarkmode } from '../types';
2
+ import { BackgroundColor } from '../types';
3
3
  export interface GroupCardProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {
4
- shadow?: boolean;
5
4
  /** The children of the GroupCard component */
6
5
  children: React.ReactNode;
7
- /** The background color of the whole groupcard element */
8
- bgColor?: BgColor;
9
- /** The background color for darkmode of the whole groupcard element */
10
- bgDarkmodeColor?: BgColorDarkmode;
6
+ /**
7
+ * The background color of the whole groupcard element
8
+ *
9
+ * Property has new values that work with dark and accent mode as part of the Semantic Color update
10
+ * Possible values: `primary` `secondary` `tertiary`
11
+ * [Read more in the upgrade guide](https://sparebank1.github.io/designsystem/?path=/docs/introduksjon-changelog--docs#2025---februar---semantiske-farger)
12
+ */
13
+ bgColor?: BackgroundColor;
14
+ /** @deprecated as part of update to Semantic Colors
15
+ *
16
+ * Property is replaced by the updated values for `bgColor` that works on dark mode
17
+ * [Read more in the upgrade guide](https://sparebank1.github.io/designsystem/?path=/docs/introduksjon-changelog--docs#2025---februar---semantiske-farger) */
18
+ bgDarkmodeColor?: never;
11
19
  /** No margin on card */
12
20
  noMargin?: boolean;
13
21
  }
package/types/types.d.ts CHANGED
@@ -17,5 +17,4 @@ export interface CardRenderProps {
17
17
  export interface CardActionRenderProps {
18
18
  CardAction: typeof CardAction;
19
19
  }
20
- export type BgColor = 'sand-30' | 'sand-70' | 'frost-30' | 'syrin-30' | 'syrin-70';
21
- export type BgColorDarkmode = 'natt' | 'svart' | 'koksgraa';
20
+ export type BackgroundColor = 'primary' | 'secondary' | 'tertiary';