@sb1/ffe-grid-react 15.0.21 → 16.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/GridCol.js CHANGED
@@ -41,14 +41,11 @@ var centerTextClass = function (centerText) {
41
41
  var centerClass = function (center) {
42
42
  return center ? 'ffe-grid__col--center' : null;
43
43
  };
44
- var backgroundClass = function (background) {
45
- return background ? "ffe-grid__col--bg-".concat(background) : null;
46
- };
47
- var backgroundDarkClass = function (backgroundDark) {
48
- return backgroundDark ? "ffe-grid__col--bg-dark-".concat(backgroundDark) : null;
44
+ var backgroundClass = function (bgColor) {
45
+ return bgColor ? "ffe-grid__col--bg-".concat(bgColor) : null;
49
46
  };
50
47
  export var GridCol = function (_a) {
51
- var background = _a.background, backgroundDark = _a.backgroundDark, className = _a.className, _b = _a.as, Comp = _b === void 0 ? 'div' : _b, centerText = _a.centerText, center = _a.center, children = _a.children, sm = _a.sm, md = _a.md, lg = _a.lg, rest = __rest(_a, ["background", "backgroundDark", "className", "as", "centerText", "center", "children", "sm", "md", "lg"]);
48
+ var bgColor = _a.bgColor, className = _a.className, _b = _a.as, Comp = _b === void 0 ? 'div' : _b, centerText = _a.centerText, center = _a.center, children = _a.children, sm = _a.sm, md = _a.md, lg = _a.lg, rest = __rest(_a, ["bgColor", "className", "as", "centerText", "center", "children", "sm", "md", "lg"]);
52
49
  return (React.createElement(Comp, __assign({ className: [
53
50
  'ffe-grid__col',
54
51
  className,
@@ -57,8 +54,7 @@ export var GridCol = function (_a) {
57
54
  sizeClasses('sm', !sm && !lg && !md ? 12 : sm),
58
55
  centerTextClass(centerText),
59
56
  centerClass(center),
60
- backgroundClass(background),
61
- backgroundDarkClass(backgroundDark),
57
+ backgroundClass(bgColor),
62
58
  ]
63
59
  .filter(function (x) { return x; })
64
60
  .join(' ') }, rest), children));
package/es/GridRow.js CHANGED
@@ -36,12 +36,9 @@ var sizeClasses = function (size, def) {
36
36
  _a));
37
37
  };
38
38
  export var GridRow = function (_a) {
39
- var _b, _c, _d, _e;
40
- var background = _a.background, backgroundDark = _a.backgroundDark, className = _a.className, children = _a.children, _f = _a.as, Comp = _f === void 0 ? 'div' : _f, sm = _a.sm, md = _a.md, lg = _a.lg, padding = _a.padding, margin = _a.margin, rest = __rest(_a, ["background", "backgroundDark", "className", "children", "as", "sm", "md", "lg", "padding", "margin"]);
41
- var hasBackgroundColor = !!background;
42
- var hasBackgroundDarkColor = !!backgroundDark;
43
- var content = hasBackgroundColor || hasBackgroundDarkColor ? (React.createElement("div", { className: "ffe-grid__row-wrapper" }, children)) : (children);
44
- return (React.createElement(Comp, __assign({ className: classNames(className, sizeClasses('lg', lg), sizeClasses('md', md), sizeClasses('sm', sm), 'ffe-grid__row', (_b = {}, _b["ffe-grid__row--bg-".concat(background)] = hasBackgroundColor, _b), (_c = {},
45
- _c["ffe-grid__row--bg-dark-".concat(backgroundDark)] = hasBackgroundDarkColor,
46
- _c), (_d = {}, _d["ffe-grid__row--padding-".concat(padding)] = padding, _d), (_e = {}, _e["ffe-grid__row--margin-".concat(margin)] = margin, _e)) }, rest), content));
39
+ var _b, _c, _d;
40
+ var bgColor = _a.bgColor, className = _a.className, children = _a.children, _e = _a.as, Comp = _e === void 0 ? 'div' : _e, sm = _a.sm, md = _a.md, lg = _a.lg, padding = _a.padding, margin = _a.margin, rest = __rest(_a, ["bgColor", "className", "children", "as", "sm", "md", "lg", "padding", "margin"]);
41
+ var hasBackgroundColor = !!bgColor;
42
+ var content = hasBackgroundColor ? (React.createElement("div", { className: "ffe-grid__row-wrapper" }, children)) : (children);
43
+ return (React.createElement(Comp, __assign({ className: classNames(className, sizeClasses('lg', lg), sizeClasses('md', md), sizeClasses('sm', sm), 'ffe-grid__row', (_b = {}, _b["ffe-grid__row--bg-".concat(bgColor)] = hasBackgroundColor, _b), (_c = {}, _c["ffe-grid__row--padding-".concat(padding)] = padding, _c), (_d = {}, _d["ffe-grid__row--margin-".concat(margin)] = margin, _d)) }, rest), content));
47
44
  };
package/lib/GridCol.js CHANGED
@@ -47,14 +47,11 @@ var centerTextClass = function (centerText) {
47
47
  var centerClass = function (center) {
48
48
  return center ? 'ffe-grid__col--center' : null;
49
49
  };
50
- var backgroundClass = function (background) {
51
- return background ? "ffe-grid__col--bg-".concat(background) : null;
52
- };
53
- var backgroundDarkClass = function (backgroundDark) {
54
- return backgroundDark ? "ffe-grid__col--bg-dark-".concat(backgroundDark) : null;
50
+ var backgroundClass = function (bgColor) {
51
+ return bgColor ? "ffe-grid__col--bg-".concat(bgColor) : null;
55
52
  };
56
53
  var GridCol = function (_a) {
57
- var background = _a.background, backgroundDark = _a.backgroundDark, className = _a.className, _b = _a.as, Comp = _b === void 0 ? 'div' : _b, centerText = _a.centerText, center = _a.center, children = _a.children, sm = _a.sm, md = _a.md, lg = _a.lg, rest = __rest(_a, ["background", "backgroundDark", "className", "as", "centerText", "center", "children", "sm", "md", "lg"]);
54
+ var bgColor = _a.bgColor, className = _a.className, _b = _a.as, Comp = _b === void 0 ? 'div' : _b, centerText = _a.centerText, center = _a.center, children = _a.children, sm = _a.sm, md = _a.md, lg = _a.lg, rest = __rest(_a, ["bgColor", "className", "as", "centerText", "center", "children", "sm", "md", "lg"]);
58
55
  return (react_1.default.createElement(Comp, __assign({ className: [
59
56
  'ffe-grid__col',
60
57
  className,
@@ -63,8 +60,7 @@ var GridCol = function (_a) {
63
60
  sizeClasses('sm', !sm && !lg && !md ? 12 : sm),
64
61
  centerTextClass(centerText),
65
62
  centerClass(center),
66
- backgroundClass(background),
67
- backgroundDarkClass(backgroundDark),
63
+ backgroundClass(bgColor),
68
64
  ]
69
65
  .filter(function (x) { return x; })
70
66
  .join(' ') }, rest), children));
package/lib/GridRow.js CHANGED
@@ -42,13 +42,10 @@ var sizeClasses = function (size, def) {
42
42
  _a));
43
43
  };
44
44
  var GridRow = function (_a) {
45
- var _b, _c, _d, _e;
46
- var background = _a.background, backgroundDark = _a.backgroundDark, className = _a.className, children = _a.children, _f = _a.as, Comp = _f === void 0 ? 'div' : _f, sm = _a.sm, md = _a.md, lg = _a.lg, padding = _a.padding, margin = _a.margin, rest = __rest(_a, ["background", "backgroundDark", "className", "children", "as", "sm", "md", "lg", "padding", "margin"]);
47
- var hasBackgroundColor = !!background;
48
- var hasBackgroundDarkColor = !!backgroundDark;
49
- var content = hasBackgroundColor || hasBackgroundDarkColor ? (react_1.default.createElement("div", { className: "ffe-grid__row-wrapper" }, children)) : (children);
50
- return (react_1.default.createElement(Comp, __assign({ className: (0, classnames_1.default)(className, sizeClasses('lg', lg), sizeClasses('md', md), sizeClasses('sm', sm), 'ffe-grid__row', (_b = {}, _b["ffe-grid__row--bg-".concat(background)] = hasBackgroundColor, _b), (_c = {},
51
- _c["ffe-grid__row--bg-dark-".concat(backgroundDark)] = hasBackgroundDarkColor,
52
- _c), (_d = {}, _d["ffe-grid__row--padding-".concat(padding)] = padding, _d), (_e = {}, _e["ffe-grid__row--margin-".concat(margin)] = margin, _e)) }, rest), content));
45
+ var _b, _c, _d;
46
+ var bgColor = _a.bgColor, className = _a.className, children = _a.children, _e = _a.as, Comp = _e === void 0 ? 'div' : _e, sm = _a.sm, md = _a.md, lg = _a.lg, padding = _a.padding, margin = _a.margin, rest = __rest(_a, ["bgColor", "className", "children", "as", "sm", "md", "lg", "padding", "margin"]);
47
+ var hasBackgroundColor = !!bgColor;
48
+ var content = hasBackgroundColor ? (react_1.default.createElement("div", { className: "ffe-grid__row-wrapper" }, children)) : (children);
49
+ return (react_1.default.createElement(Comp, __assign({ className: (0, classnames_1.default)(className, sizeClasses('lg', lg), sizeClasses('md', md), sizeClasses('sm', sm), 'ffe-grid__row', (_b = {}, _b["ffe-grid__row--bg-".concat(bgColor)] = hasBackgroundColor, _b), (_c = {}, _c["ffe-grid__row--padding-".concat(padding)] = padding, _c), (_d = {}, _d["ffe-grid__row--margin-".concat(margin)] = margin, _d)) }, rest), content));
53
50
  };
54
51
  exports.GridRow = GridRow;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sb1/ffe-grid-react",
3
- "version": "15.0.21",
3
+ "version": "16.0.0",
4
4
  "license": "MIT",
5
5
  "author": "SpareBank1",
6
6
  "files": [
@@ -25,11 +25,11 @@
25
25
  "test:watch": "ffe-buildtool jest --watch"
26
26
  },
27
27
  "dependencies": {
28
- "@sb1/ffe-grid": "^15.1.5",
28
+ "@sb1/ffe-grid": "^16.0.0",
29
29
  "classnames": "^2.3.1"
30
30
  },
31
31
  "devDependencies": {
32
- "@sb1/ffe-buildtool": "^0.9.2",
32
+ "@sb1/ffe-buildtool": "^0.10.0",
33
33
  "react": "^18.2.0",
34
34
  "react-dom": "^18.2.0"
35
35
  },
@@ -39,5 +39,5 @@
39
39
  "publishConfig": {
40
40
  "access": "public"
41
41
  },
42
- "gitHead": "dc81c750740fef9a1e01725f2ade086c11d81d30"
42
+ "gitHead": "5a72f08b0873cc96b0d439dd029839db4d5d4ea9"
43
43
  }
@@ -1,16 +1,14 @@
1
1
  import React, { ElementType } from 'react';
2
- import { BackgroundColor, BackgroundColorDark, ComponentWithoutRefAsPropParams } from './types';
3
- type ColumnsRange = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12';
4
- interface GridColSize {
5
- cols: ColumnsRange;
6
- offset?: ColumnsRange;
7
- }
8
- type SizeModifier = ColumnsRange | GridColSize;
2
+ import { BackgroundColor, ComponentWithoutRefAsPropParams, SizeModifier } from './types';
9
3
  export type GridColProps<As extends ElementType = any> = ComponentWithoutRefAsPropParams<As> & {
10
- /** Supported background colors */
11
- background?: BackgroundColor;
12
- /** Supported dark background colors */
13
- backgroundDark?: BackgroundColorDark;
4
+ /**
5
+ * Supported background colors
6
+ *
7
+ * Property has new values that work with dark and accent mode as part of the Semantic Color update
8
+ * Possible values: `primary` `secondary` `tertiary`
9
+ * [Read more in the upgrade guide](https://sparebank1.github.io/designsystem/?path=/docs/introduksjon-changelog--docs#2025---februar---semantiske-farger)
10
+ */
11
+ bgColor?: BackgroundColor;
14
12
  /** Center text content horizontally */
15
13
  centerText?: boolean;
16
14
  /** Center content vertically */
@@ -23,4 +21,3 @@ export type GridColProps<As extends ElementType = any> = ComponentWithoutRefAsPr
23
21
  lg?: SizeModifier;
24
22
  };
25
23
  export declare const GridCol: React.FC<GridColProps>;
26
- export {};
@@ -1,5 +1,5 @@
1
1
  import React, { ElementType } from 'react';
2
- import { ComponentWithoutRefAsPropParams, BackgroundColor, BackgroundColorDark, Margin, Padding } from './types';
2
+ import { ComponentWithoutRefAsPropParams, BackgroundColor, Margin, Padding } from './types';
3
3
  interface GridRowSize {
4
4
  margin?: Margin;
5
5
  padding?: Padding;
@@ -10,10 +10,14 @@ export type GridRowProps<As extends ElementType = any> = ComponentWithoutRefAsPr
10
10
  padding?: Padding;
11
11
  /** Margin in the top and bottom of the row */
12
12
  margin?: Margin;
13
- /** Supported background colors */
14
- background?: BackgroundColor;
15
- /** Supported dark background colors */
16
- backgroundDark?: BackgroundColorDark;
13
+ /**
14
+ * Supported background colors
15
+ *
16
+ * Property has new values that work with dark and accent mode as part of the Semantic Color update
17
+ * Possible values: `primary` `secondary` `tertiary`
18
+ * [Read more in the upgrade guide](https://sparebank1.github.io/designsystem/?path=/docs/introduksjon-changelog--docs#2025---februar---semantiske-farger)
19
+ */
20
+ bgColor?: BackgroundColor;
17
21
  /** Size modifiers for small screen sizes */
18
22
  sm?: SizeModifier;
19
23
  /** Size modifiers for medium screen sizes */
package/types/types.d.ts CHANGED
@@ -7,5 +7,11 @@ export type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
7
7
  export type Margin = '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl';
8
8
  export type Padding = '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl';
9
9
  export type Gap = 'none' | '2xs' | 'xs' | 'sm' | 'md' | 'lg';
10
- export type BackgroundColor = 'frost-30' | 'sand' | 'sand-70' | 'sand-30' | 'syrin-70' | 'syrin-30' | 'vann' | 'vann-30' | 'fjell' | 'hvit';
11
- export type BackgroundColorDark = 'svart' | 'natt' | 'koksgraa';
10
+ export type BackgroundColor = 'primary' | 'secondary' | 'tertiary';
11
+ type ColumnsRange = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12';
12
+ interface GridColSize {
13
+ cols: ColumnsRange;
14
+ offset?: ColumnsRange;
15
+ }
16
+ export type SizeModifier = ColumnsRange | GridColSize;
17
+ export {};