@sb1/ffe-symbols-react 5.0.0 → 5.0.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [5.0.2](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-symbols-react@5.0.1...@sb1/ffe-symbols-react@5.0.2) (2024-05-03)
7
+
8
+ **Note:** Version bump only for package @sb1/ffe-symbols-react
9
+
10
+ ## [5.0.1](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-symbols-react@5.0.0...@sb1/ffe-symbols-react@5.0.1) (2024-05-03)
11
+
12
+ **Note:** Version bump only for package @sb1/ffe-symbols-react
13
+
6
14
  # [5.0.0](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-symbols-react@4.0.0...@sb1/ffe-symbols-react@5.0.0) (2024-04-29)
7
15
 
8
16
  ### Bug Fixes
package/es/Symbol.js CHANGED
@@ -1,7 +1,7 @@
1
1
  var _excluded = ["className", "size", "weight", "fill", "ariaLabel", "icon"];
2
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
3
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
4
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
5
5
  import React from 'react';
6
6
  import { string, bool, oneOf } from 'prop-types';
7
7
  import classNames from 'classnames';
package/lib/Symbol.js CHANGED
@@ -11,7 +11,7 @@ var _excluded = ["className", "size", "weight", "fill", "ariaLabel", "icon"];
11
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
12
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
13
13
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
14
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
14
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
15
15
  var _Symbol = exports.Symbol = function _Symbol(props) {
16
16
  var className = props.className,
17
17
  size = props.size,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sb1/ffe-symbols-react",
3
- "version": "5.0.0",
3
+ "version": "5.0.2",
4
4
  "description": "React-komponenter for Material Symbols tilpasset Sb1 sine behov",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -9,6 +9,7 @@
9
9
  "build": "ffe-buildtool babel && cp src/symbolNames.ts types/symbolNames.ts",
10
10
  "watch": "ffe-buildtool babel-watch",
11
11
  "lint": "eslint src",
12
+ "lint:fix": "eslint src --fix",
12
13
  "test": "ffe-buildtool jest",
13
14
  "test:watch": "ffe-buildtool jest --watch"
14
15
  },
@@ -23,17 +24,17 @@
23
24
  },
24
25
  "homepage": "https://github.com/SpareBank1/designsystem#readme",
25
26
  "dependencies": {
26
- "@sb1/ffe-symbols": "^3.0.0",
27
+ "@sb1/ffe-symbols": "^4.0.1",
27
28
  "classnames": "^2.3.2",
28
29
  "prop-types": "^15.8.1",
29
30
  "react": "^18.2.0"
30
31
  },
31
32
  "devDependencies": {
32
- "@sb1/ffe-buildtool": "^0.5.1",
33
- "eslint": "^5.9.0"
33
+ "@sb1/ffe-buildtool": "^0.5.3",
34
+ "eslint": "^8.57.0"
34
35
  },
35
36
  "publishConfig": {
36
37
  "access": "public"
37
38
  },
38
- "gitHead": "c291894cefef43c0607f844862e87031452a0d94"
39
+ "gitHead": "2ea32d4ec00a7891180a41c329a5317d6d986c13"
39
40
  }
@@ -1,43 +0,0 @@
1
- import React from 'react';
2
- import Symbol from '.';
3
-
4
- const getWrapper = props => shallow(<Symbol icon="home" {...props} />);
5
-
6
- describe('<Symbol />', () => {
7
- it('renders without exploding', () => {
8
- const wrapper = getWrapper();
9
- expect(wrapper.exists()).toBe(true);
10
- expect(wrapper.is('span')).toBe(true);
11
- });
12
- it('renders filled symbol correctly', () => {
13
- const wrapper = getWrapper();
14
- expect(wrapper.hasClass('ffe-symbol--300')).toBe(true);
15
- const filled = getWrapper({ fill: true });
16
- expect(filled.hasClass('ffe-symbol--filled-300')).toBe(true);
17
- });
18
- it('set correct symbol weight', () => {
19
- const wrapper = getWrapper({ weight: 500 });
20
- expect(wrapper.hasClass('ffe-symbol--500')).toBe(true);
21
- });
22
- it('renders classes correctly', () => {
23
- const wrapper = getWrapper({ className: 'test-class' });
24
- expect(wrapper.hasClass('ffe-symbol')).toBe(true);
25
- expect(wrapper.hasClass('test-class')).toBe(true);
26
- });
27
- it('renders correct sized symbol of prop', () => {
28
- const wrapper = getWrapper({ size: 'xl' });
29
- expect(wrapper.hasClass('ffe-symbol--xl')).toBe(true);
30
- });
31
- it('passes props correctly', () => {
32
- const wrapper = getWrapper({ id: 'test-id' });
33
- expect(wrapper.prop('id')).toBe('test-id');
34
- });
35
- it('set aria-hidden to true when aria-label is undefined', () => {
36
- const wrapper = getWrapper();
37
- expect(wrapper.prop('aria-hidden')).toBe(true);
38
- });
39
- it('set aria-hidden to false when aria-label is set', () => {
40
- const wrapper = getWrapper({ ariaLabel: 'hus icon' });
41
- expect(wrapper.prop('aria-hidden')).toBe(false);
42
- });
43
- });