@sb1/ffe-symbols-react 2.0.0 → 2.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 +10 -0
- package/es/Symbol.js +3 -6
- package/lib/Symbol.js +3 -6
- package/package.json +3 -3
- package/src/Symbol.js +3 -7
- package/src/Symbol.spec.js +4 -18
- package/src/index.d.ts +1 -1
- package/types/index.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
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
|
+
## [2.0.2](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-symbols-react@2.0.1...@sb1/ffe-symbols-react@2.0.2) (2023-09-15)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @sb1/ffe-symbols-react
|
|
9
|
+
|
|
10
|
+
## [2.0.1](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-symbols-react@2.0.0...@sb1/ffe-symbols-react@2.0.1) (2023-08-29)
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
- **ffe-symbols-react:** endringer relatert til at det nå er flere fontfiler ([8809cbc](https://github.com/SpareBank1/designsystem/commit/8809cbc3fde43a35576077c27c8a9355e134a971))
|
|
15
|
+
|
|
6
16
|
# [2.0.0](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-symbols-react@1.1.6...@sb1/ffe-symbols-react@2.0.0) (2023-08-25)
|
|
7
17
|
|
|
8
18
|
### Bug Fixes
|
package/es/Symbol.js
CHANGED
|
@@ -14,11 +14,8 @@ var _Symbol = function _Symbol(props) {
|
|
|
14
14
|
ariaLabel = props.ariaLabel,
|
|
15
15
|
rest = _objectWithoutProperties(props, _excluded);
|
|
16
16
|
return /*#__PURE__*/React.createElement("span", _extends({
|
|
17
|
-
className: classNames('ffe-symbol', size && "ffe-symbol--".concat(size), className),
|
|
18
|
-
role: "img",
|
|
19
|
-
style: {
|
|
20
|
-
fontVariationSettings: "'FILL' ".concat(fill ? 1 : 0, ", 'GRAD' 0, 'wght' ").concat(weight)
|
|
21
|
-
},
|
|
17
|
+
className: classNames('ffe-symbol', fill ? "ffe-symbol--filled-".concat(weight) : "ffe-symbol--".concat(weight), size && "ffe-symbol--".concat(size), className),
|
|
18
|
+
role: "graphics-symbol img",
|
|
22
19
|
"aria-label": ariaLabel ? ariaLabel : null,
|
|
23
20
|
"aria-hidden": !ariaLabel
|
|
24
21
|
}, rest), children);
|
|
@@ -36,7 +33,7 @@ _Symbol.propTypes = {
|
|
|
36
33
|
/** Size of the icon, default is the closest defined font-size */
|
|
37
34
|
size: oneOf(['xs', 'sm', 'md', 'lg', 'xl', '2xl']),
|
|
38
35
|
/** Symbols stroke weight. This can affect overall size of symbol, 400 is default */
|
|
39
|
-
weight: oneOf([300, 400, 500
|
|
36
|
+
weight: oneOf([300, 400, 500]),
|
|
40
37
|
/** Additional classnames */
|
|
41
38
|
className: string,
|
|
42
39
|
/** Aria label text. If null, aria-hidden is automatically set to true */
|
package/lib/Symbol.js
CHANGED
|
@@ -21,11 +21,8 @@ var _Symbol = function _Symbol(props) {
|
|
|
21
21
|
ariaLabel = props.ariaLabel,
|
|
22
22
|
rest = _objectWithoutProperties(props, _excluded);
|
|
23
23
|
return /*#__PURE__*/_react.default.createElement("span", _extends({
|
|
24
|
-
className: (0, _classnames.default)('ffe-symbol', size && "ffe-symbol--".concat(size), className),
|
|
25
|
-
role: "img",
|
|
26
|
-
style: {
|
|
27
|
-
fontVariationSettings: "'FILL' ".concat(fill ? 1 : 0, ", 'GRAD' 0, 'wght' ").concat(weight)
|
|
28
|
-
},
|
|
24
|
+
className: (0, _classnames.default)('ffe-symbol', fill ? "ffe-symbol--filled-".concat(weight) : "ffe-symbol--".concat(weight), size && "ffe-symbol--".concat(size), className),
|
|
25
|
+
role: "graphics-symbol img",
|
|
29
26
|
"aria-label": ariaLabel ? ariaLabel : null,
|
|
30
27
|
"aria-hidden": !ariaLabel
|
|
31
28
|
}, rest), children);
|
|
@@ -43,7 +40,7 @@ _Symbol.propTypes = {
|
|
|
43
40
|
/** Size of the icon, default is the closest defined font-size */
|
|
44
41
|
size: (0, _propTypes.oneOf)(['xs', 'sm', 'md', 'lg', 'xl', '2xl']),
|
|
45
42
|
/** Symbols stroke weight. This can affect overall size of symbol, 400 is default */
|
|
46
|
-
weight: (0, _propTypes.oneOf)([300, 400, 500
|
|
43
|
+
weight: (0, _propTypes.oneOf)([300, 400, 500]),
|
|
47
44
|
/** Additional classnames */
|
|
48
45
|
className: _propTypes.string,
|
|
49
46
|
/** Aria label text. If null, aria-hidden is automatically set to true */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sb1/ffe-symbols-react",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.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",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"homepage": "https://github.com/SpareBank1/designsystem#readme",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@sb1/ffe-symbols": "^
|
|
26
|
+
"@sb1/ffe-symbols": "^2.1.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": "
|
|
38
|
+
"gitHead": "2717d62c2fe4125c7160d0253f4bcc56fde9e06e"
|
|
39
39
|
}
|
package/src/Symbol.js
CHANGED
|
@@ -17,15 +17,11 @@ export const Symbol = props => {
|
|
|
17
17
|
<span
|
|
18
18
|
className={classNames(
|
|
19
19
|
'ffe-symbol',
|
|
20
|
+
fill ? `ffe-symbol--filled-${weight}` : `ffe-symbol--${weight}`,
|
|
20
21
|
size && `ffe-symbol--${size}`,
|
|
21
22
|
className,
|
|
22
23
|
)}
|
|
23
|
-
role="img"
|
|
24
|
-
style={{
|
|
25
|
-
fontVariationSettings: `'FILL' ${
|
|
26
|
-
fill ? 1 : 0
|
|
27
|
-
}, 'GRAD' 0, 'wght' ${weight}`,
|
|
28
|
-
}}
|
|
24
|
+
role="graphics-symbol img"
|
|
29
25
|
aria-label={ariaLabel ? ariaLabel : null}
|
|
30
26
|
aria-hidden={!ariaLabel}
|
|
31
27
|
{...rest}
|
|
@@ -48,7 +44,7 @@ Symbol.propTypes = {
|
|
|
48
44
|
/** Size of the icon, default is the closest defined font-size */
|
|
49
45
|
size: oneOf(['xs', 'sm', 'md', 'lg', 'xl', '2xl']),
|
|
50
46
|
/** Symbols stroke weight. This can affect overall size of symbol, 400 is default */
|
|
51
|
-
weight: oneOf([300, 400, 500
|
|
47
|
+
weight: oneOf([300, 400, 500]),
|
|
52
48
|
/** Additional classnames */
|
|
53
49
|
className: string,
|
|
54
50
|
/** Aria label text. If null, aria-hidden is automatically set to true */
|
package/src/Symbol.spec.js
CHANGED
|
@@ -16,27 +16,13 @@ describe('<Symbol />', () => {
|
|
|
16
16
|
});
|
|
17
17
|
it('renders filled symbol correctly', () => {
|
|
18
18
|
const wrapper = getWrapper();
|
|
19
|
-
expect(wrapper.
|
|
20
|
-
'fontVariationSettings',
|
|
21
|
-
"'FILL' 0, 'GRAD' 0, 'wght' 400",
|
|
22
|
-
);
|
|
19
|
+
expect(wrapper.hasClass('ffe-symbol--400')).toBe(true);
|
|
23
20
|
const filled = getWrapper({ fill: true });
|
|
24
|
-
expect(filled.
|
|
25
|
-
'fontVariationSettings',
|
|
26
|
-
"'FILL' 1, 'GRAD' 0, 'wght' 400",
|
|
27
|
-
);
|
|
21
|
+
expect(filled.hasClass('ffe-symbol--filled-400')).toBe(true);
|
|
28
22
|
});
|
|
29
23
|
it('set correct symbol weight', () => {
|
|
30
|
-
const wrapper = getWrapper();
|
|
31
|
-
expect(wrapper.
|
|
32
|
-
'fontVariationSettings',
|
|
33
|
-
"'FILL' 0, 'GRAD' 0, 'wght' 400",
|
|
34
|
-
);
|
|
35
|
-
const filled = getWrapper({ weight: 600 });
|
|
36
|
-
expect(filled.get(0).props.style).toHaveProperty(
|
|
37
|
-
'fontVariationSettings',
|
|
38
|
-
"'FILL' 0, 'GRAD' 0, 'wght' 600",
|
|
39
|
-
);
|
|
24
|
+
const wrapper = getWrapper({ weight: 500 });
|
|
25
|
+
expect(wrapper.hasClass('ffe-symbol--500')).toBe(true);
|
|
40
26
|
});
|
|
41
27
|
it('renders classes correctly', () => {
|
|
42
28
|
const wrapper = getWrapper({ className: 'test-class' });
|
package/src/index.d.ts
CHANGED
package/types/index.d.ts
CHANGED