@sb1/ffe-icons-react 100.8.3 → 100.10.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/README.md +51 -12
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,25 +1,64 @@
|
|
|
1
1
|
# @sb1/ffe-icons-react
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Beskrivelse
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Ikonkomponenter som bruker CSS mask-image for SVG-ikoner som kan farges med CSS. Sett `ariaLabel` for meningsbærende ikoner, utelat den for dekorative ikoner (skjules automatisk).
|
|
6
|
+
|
|
7
|
+
## Installasjon
|
|
8
|
+
|
|
9
|
+
```bash
|
|
6
10
|
npm install --save @sb1/ffe-icons-react
|
|
7
11
|
```
|
|
8
12
|
|
|
9
|
-
##
|
|
13
|
+
## Bruk
|
|
14
|
+
|
|
15
|
+
Full dokumentasjon: https://sparebank1.github.io/designsystem/
|
|
16
|
+
|
|
17
|
+
Importer CSS:
|
|
18
|
+
|
|
19
|
+
```css
|
|
20
|
+
@import url('@sb1/ffe-icons/css/ffe-icons.css');
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Eksempler
|
|
10
24
|
|
|
11
|
-
|
|
25
|
+
```tsx
|
|
26
|
+
import { Icon } from '@sb1/ffe-icons-react';
|
|
12
27
|
|
|
13
|
-
|
|
28
|
+
// Med tilgjengelighetstekst
|
|
29
|
+
<Icon fileUrl="./icons/open/300/md/house.svg" ariaLabel="Hjem" />
|
|
14
30
|
|
|
15
|
-
|
|
31
|
+
// Dekorativt ikon (skjules fra skjermleser)
|
|
32
|
+
<Icon fileUrl="./icons/open/300/md/arrow-right.svg" />
|
|
16
33
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
34
|
+
// Med størrelse og fargeklasse
|
|
35
|
+
<Icon
|
|
36
|
+
fileUrl="./icons/open/300/sm/star.svg"
|
|
37
|
+
size="sm"
|
|
38
|
+
className="ffe-text-color--vann"
|
|
39
|
+
ariaLabel="Favoritt"
|
|
40
|
+
/>
|
|
21
41
|
```
|
|
22
42
|
|
|
23
|
-
|
|
43
|
+
### Ikonsti-format
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
./icons/{variant}/{weight}/{size}/{icon-name}.svg
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
- **variant**: `open` eller `filled`
|
|
50
|
+
- **weight**: `300`, `400`, eller `500`
|
|
51
|
+
- **size**: `sm`, `md`, `lg`, eller `xl`
|
|
52
|
+
|
|
53
|
+
### Tilgjengelighet
|
|
54
|
+
|
|
55
|
+
- Sett `ariaLabel` for meningsbærende ikoner
|
|
56
|
+
- Utelat `ariaLabel` for dekorative ikoner (setter automatisk `aria-hidden="true"`)
|
|
57
|
+
|
|
58
|
+
## Utvikling
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npm install && npm run build && npm start
|
|
62
|
+
```
|
|
24
63
|
|
|
25
|
-
|
|
64
|
+
Lokal Storybook kjører på http://localhost:6006/.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sb1/ffe-icons-react",
|
|
3
|
-
"version": "100.
|
|
3
|
+
"version": "100.10.0",
|
|
4
4
|
"description": "React-komponenter for ffe-icons",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "SpareBank 1",
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"test": "ffe-buildtool jest"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@sb1/ffe-icons": "^100.
|
|
29
|
+
"@sb1/ffe-icons": "^100.10.0",
|
|
30
30
|
"classnames": "^2.5.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@sb1/ffe-buildtool": "^100.
|
|
33
|
+
"@sb1/ffe-buildtool": "^100.10.0",
|
|
34
34
|
"eslint": "^9.22.0",
|
|
35
35
|
"react": "^18.2.0",
|
|
36
36
|
"react-dom": "^18.2.0"
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "efdd3866d59d794436a97a8dd6760f4c76466a71"
|
|
45
45
|
}
|