@sb1/ffe-symbols-react 3.0.3 → 5.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/CHANGELOG.md CHANGED
@@ -3,6 +3,31 @@
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.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
+
8
+ ### Bug Fixes
9
+
10
+ - **ffe-symbols-react:** remove default props ([6f8529d](https://github.com/SpareBank1/designsystem/commit/6f8529ddeb432cda43cd08d2917dd28f2a673917))
11
+
12
+ ### Documentation
13
+
14
+ - **ffe-symbols-react:** this package has been deprecated ([970906a](https://github.com/SpareBank1/designsystem/commit/970906a22848052d9802cf9b7a5c773a001ad629))
15
+
16
+ ### BREAKING CHANGES
17
+
18
+ - **ffe-symbols-react:** This package has been deprecated.
19
+ Please use @sb1/ffe-icons and @sb1/ffe-icons-react.
20
+
21
+ # [4.0.0](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-symbols-react@3.0.3...@sb1/ffe-symbols-react@4.0.0) (2024-02-26)
22
+
23
+ ### Bug Fixes
24
+
25
+ - **ffe-symbols-react:** fjern weight 400 og størrelsene xs og 2xl ([829570e](https://github.com/SpareBank1/designsystem/commit/829570e71186a08016d80c5294de0579dbff3446))
26
+
27
+ ### BREAKING CHANGES
28
+
29
+ - **ffe-symbols-react:** Fjerner 400 som weight og størrelsene xs og 2xl fra Symbol-komponenten.
30
+
6
31
  ## [3.0.3](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-symbols-react@3.0.2...@sb1/ffe-symbols-react@3.0.3) (2024-02-12)
7
32
 
8
33
  **Note:** Version bump only for package @sb1/ffe-symbols-react
package/README.md CHANGED
@@ -1,25 +1,7 @@
1
1
  # @sb1/ffe-symbols-react
2
2
 
3
- ## Install
3
+ ## Deprecated package
4
4
 
5
- ```
6
- npm install --save @sb1/ffe-symbols-react
7
- ```
5
+ This package is deprecated, and will be removed from the designsystem repo.
8
6
 
9
- ## Usage
10
-
11
- Full documentation on icon usage is available at https://design.sparebank1.no/komponenter/ikoner/.
12
-
13
- ## Development
14
-
15
- To start a local development server, run the following from the designsystem root folder:
16
-
17
- ```bash
18
- npm install
19
- npm run build
20
- npm start
21
- ```
22
-
23
- A local instance of `component-overview` with live reloading will run at http://localhost:1234/.
24
-
25
- Example implementations using the latest versions of all components are also available at https://sparebank1.github.io/designsystem.
7
+ To use the new set of icons, please refer to [ffe-icons](https://github.com/SpareBank1/designsystem/tree/develop/packages/ffe-icons) and/or [ffe-icons-react](https://github.com/SpareBank1/designsystem/tree/develop/packages/ffe-icons-react).
package/es/Symbol.js CHANGED
@@ -8,8 +8,10 @@ import classNames from 'classnames';
8
8
  var _Symbol = function _Symbol(props) {
9
9
  var className = props.className,
10
10
  size = props.size,
11
- weight = props.weight,
12
- fill = props.fill,
11
+ _props$weight = props.weight,
12
+ weight = _props$weight === void 0 ? 300 : _props$weight,
13
+ _props$fill = props.fill,
14
+ fill = _props$fill === void 0 ? false : _props$fill,
13
15
  ariaLabel = props.ariaLabel,
14
16
  icon = props.icon,
15
17
  rest = _objectWithoutProperties(props, _excluded);
@@ -21,19 +23,15 @@ var _Symbol = function _Symbol(props) {
21
23
  }, rest), icon);
22
24
  };
23
25
  export { _Symbol as Symbol };
24
- _Symbol.defaultProps = {
25
- fill: false,
26
- weight: 400
27
- };
28
26
  _Symbol.propTypes = {
29
27
  /** Fills the icon with color */
30
28
  fill: bool,
31
29
  /** The name of the icon that should be shown */
32
30
  icon: string.isRequired,
33
31
  /** Size of the icon, default is the closest defined font-size */
34
- size: oneOf(['xs', 'sm', 'md', 'lg', 'xl', '2xl']),
32
+ size: oneOf(['sm', 'md', 'lg', 'xl']),
35
33
  /** Symbols stroke weight. This can affect overall size of symbol, 400 is default */
36
- weight: oneOf([300, 400, 500]),
34
+ weight: oneOf([300, 500]),
37
35
  /** Additional classnames */
38
36
  className: string,
39
37
  /** Aria label text. If null/undefined, aria-hidden is automatically set to true */
package/lib/Symbol.js CHANGED
@@ -15,8 +15,10 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
15
15
  var _Symbol = exports.Symbol = function _Symbol(props) {
16
16
  var className = props.className,
17
17
  size = props.size,
18
- weight = props.weight,
19
- fill = props.fill,
18
+ _props$weight = props.weight,
19
+ weight = _props$weight === void 0 ? 300 : _props$weight,
20
+ _props$fill = props.fill,
21
+ fill = _props$fill === void 0 ? false : _props$fill,
20
22
  ariaLabel = props.ariaLabel,
21
23
  icon = props.icon,
22
24
  rest = _objectWithoutProperties(props, _excluded);
@@ -27,19 +29,15 @@ var _Symbol = exports.Symbol = function _Symbol(props) {
27
29
  "aria-hidden": !ariaLabel
28
30
  }, rest), icon);
29
31
  };
30
- _Symbol.defaultProps = {
31
- fill: false,
32
- weight: 400
33
- };
34
32
  _Symbol.propTypes = {
35
33
  /** Fills the icon with color */
36
34
  fill: _propTypes.bool,
37
35
  /** The name of the icon that should be shown */
38
36
  icon: _propTypes.string.isRequired,
39
37
  /** Size of the icon, default is the closest defined font-size */
40
- size: (0, _propTypes.oneOf)(['xs', 'sm', 'md', 'lg', 'xl', '2xl']),
38
+ size: (0, _propTypes.oneOf)(['sm', 'md', 'lg', 'xl']),
41
39
  /** Symbols stroke weight. This can affect overall size of symbol, 400 is default */
42
- weight: (0, _propTypes.oneOf)([300, 400, 500]),
40
+ weight: (0, _propTypes.oneOf)([300, 500]),
43
41
  /** Additional classnames */
44
42
  className: _propTypes.string,
45
43
  /** Aria label text. If null/undefined, aria-hidden is automatically set to true */
package/lib/index.js CHANGED
@@ -18,4 +18,4 @@ Object.defineProperty(exports, "default", {
18
18
  });
19
19
  var _Symbol = _interopRequireWildcard(require("./Symbol"));
20
20
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
21
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
21
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sb1/ffe-symbols-react",
3
- "version": "3.0.3",
3
+ "version": "5.0.0",
4
4
  "description": "React-komponenter for Material Symbols tilpasset Sb1 sine behov",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "homepage": "https://github.com/SpareBank1/designsystem#readme",
25
25
  "dependencies": {
26
- "@sb1/ffe-symbols": "^2.1.2",
26
+ "@sb1/ffe-symbols": "^3.0.0",
27
27
  "classnames": "^2.3.2",
28
28
  "prop-types": "^15.8.1",
29
29
  "react": "^18.2.0"
@@ -35,5 +35,5 @@
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  },
38
- "gitHead": "e9f8ba0eb329a7b2fc1aa21512c67ad440b74bb0"
38
+ "gitHead": "c291894cefef43c0607f844862e87031452a0d94"
39
39
  }
package/src/Symbol.js CHANGED
@@ -3,7 +3,15 @@ import { string, bool, oneOf } from 'prop-types';
3
3
  import classNames from 'classnames';
4
4
 
5
5
  export const Symbol = props => {
6
- const { className, size, weight, fill, ariaLabel, icon, ...rest } = props;
6
+ const {
7
+ className,
8
+ size,
9
+ weight = 300,
10
+ fill = false,
11
+ ariaLabel,
12
+ icon,
13
+ ...rest
14
+ } = props;
7
15
 
8
16
  return (
9
17
  <span
@@ -23,20 +31,15 @@ export const Symbol = props => {
23
31
  );
24
32
  };
25
33
 
26
- Symbol.defaultProps = {
27
- fill: false,
28
- weight: 400,
29
- };
30
-
31
34
  Symbol.propTypes = {
32
35
  /** Fills the icon with color */
33
36
  fill: bool,
34
37
  /** The name of the icon that should be shown */
35
38
  icon: string.isRequired,
36
39
  /** Size of the icon, default is the closest defined font-size */
37
- size: oneOf(['xs', 'sm', 'md', 'lg', 'xl', '2xl']),
40
+ size: oneOf(['sm', 'md', 'lg', 'xl']),
38
41
  /** Symbols stroke weight. This can affect overall size of symbol, 400 is default */
39
- weight: oneOf([300, 400, 500]),
42
+ weight: oneOf([300, 500]),
40
43
  /** Additional classnames */
41
44
  className: string,
42
45
  /** Aria label text. If null/undefined, aria-hidden is automatically set to true */
@@ -11,9 +11,9 @@ describe('<Symbol />', () => {
11
11
  });
12
12
  it('renders filled symbol correctly', () => {
13
13
  const wrapper = getWrapper();
14
- expect(wrapper.hasClass('ffe-symbol--400')).toBe(true);
14
+ expect(wrapper.hasClass('ffe-symbol--300')).toBe(true);
15
15
  const filled = getWrapper({ fill: true });
16
- expect(filled.hasClass('ffe-symbol--filled-400')).toBe(true);
16
+ expect(filled.hasClass('ffe-symbol--filled-300')).toBe(true);
17
17
  });
18
18
  it('set correct symbol weight', () => {
19
19
  const wrapper = getWrapper({ weight: 500 });
package/src/index.d.ts CHANGED
@@ -3,8 +3,8 @@ import { SymbolName } from './symbolNames.ts';
3
3
 
4
4
  export interface SymbolProps {
5
5
  fill?: boolean;
6
- size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
7
- weight?: 300 | 400 | 500;
6
+ size?: 'sm' | 'md' | 'lg' | 'xl';
7
+ weight?: 300 | 500;
8
8
  icon: SymbolName;
9
9
  className?: string;
10
10
  ariaLabel?: string;
package/types/index.d.ts CHANGED
@@ -3,8 +3,8 @@ import { SymbolName } from './symbolNames.ts';
3
3
 
4
4
  export interface SymbolProps {
5
5
  fill?: boolean;
6
- size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
7
- weight?: 300 | 400 | 500;
6
+ size?: 'sm' | 'md' | 'lg' | 'xl';
7
+ weight?: 300 | 500;
8
8
  icon: SymbolName;
9
9
  className?: string;
10
10
  ariaLabel?: string;