@sb1/ffe-core-react 100.8.3 → 100.9.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 +114 -13
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,24 +1,127 @@
|
|
|
1
1
|
# @sb1/ffe-core-react
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Beskrivelse
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
React-komponenter for typografi og grunnleggende tekstmønstre. Bruk for overskrifter, avsnitt, lenker og tekstinnhold med riktig stil og semantikk.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Merk: `Wave` er deprecated, bruk varianten i `@sb1/ffe-shapes-react`.
|
|
8
|
+
|
|
9
|
+
## Installasjon
|
|
10
|
+
|
|
11
|
+
```bash
|
|
8
12
|
npm install --save @sb1/ffe-core-react
|
|
9
13
|
```
|
|
10
14
|
|
|
11
|
-
##
|
|
15
|
+
## Bruk
|
|
16
|
+
|
|
17
|
+
Dokumentasjon: https://sparebank1.github.io/designsystem/
|
|
18
|
+
|
|
19
|
+
### Importere CSS
|
|
20
|
+
|
|
21
|
+
```css
|
|
22
|
+
@import '@sb1/ffe-core/css/ffe.css';
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Eksempler
|
|
26
|
+
|
|
27
|
+
### Tilgjengelige komponenter
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
import {
|
|
31
|
+
Heading1,
|
|
32
|
+
Heading2,
|
|
33
|
+
Heading3,
|
|
34
|
+
Heading4,
|
|
35
|
+
Heading5,
|
|
36
|
+
Heading6,
|
|
37
|
+
Paragraph,
|
|
38
|
+
BodyText,
|
|
39
|
+
SmallText,
|
|
40
|
+
MicroText,
|
|
41
|
+
EmphasizedText,
|
|
42
|
+
StrongText,
|
|
43
|
+
PreformattedText,
|
|
44
|
+
LinkText,
|
|
45
|
+
LinkIcon,
|
|
46
|
+
DividerLine,
|
|
47
|
+
} from '@sb1/ffe-core-react';
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Overskrifter (Heading1-Heading6)
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
<Heading1>Sidetittel</Heading1>
|
|
54
|
+
<Heading2 lookLike={1}>Semantisk h2 som ser ut som h1</Heading2>
|
|
55
|
+
<Heading3 withBorder noMargin>Med understrek, uten margin</Heading3>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Paragraph
|
|
12
59
|
|
|
13
|
-
|
|
60
|
+
```tsx
|
|
61
|
+
<Paragraph lead>Ledende avsnitt med større skrift.</Paragraph>
|
|
62
|
+
<Paragraph>Standard brødtekst.</Paragraph>
|
|
63
|
+
```
|
|
14
64
|
|
|
15
|
-
|
|
16
|
-
https://design.sparebank1.no/profil/farger/
|
|
17
|
-
https://design.sparebank1.no/profil/spacing/
|
|
65
|
+
### BodyText
|
|
18
66
|
|
|
19
|
-
|
|
67
|
+
Brødtekst med polymorfisk `as`-prop. Standard: `div`.
|
|
20
68
|
|
|
21
|
-
|
|
69
|
+
```tsx
|
|
70
|
+
<BodyText>Brødtekst i en div.</BodyText>
|
|
71
|
+
<BodyText as="span">Brødtekst som span.</BodyText>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### SmallText
|
|
75
|
+
|
|
76
|
+
Liten tekst. Standard element: `span`.
|
|
77
|
+
|
|
78
|
+
```tsx
|
|
79
|
+
<SmallText>Liten hjelpetekst</SmallText>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### MicroText
|
|
83
|
+
|
|
84
|
+
Ekstra liten tekst. Standard element: `span`. Støtter `strong`-prop.
|
|
85
|
+
|
|
86
|
+
```tsx
|
|
87
|
+
<MicroText>Veldig liten tekst</MicroText>
|
|
88
|
+
<MicroText strong>Veldig liten, fet tekst</MicroText>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Tekstformatering
|
|
92
|
+
|
|
93
|
+
```tsx
|
|
94
|
+
<EmphasizedText>Betont tekst (kursiv, rendrer em)</EmphasizedText>
|
|
95
|
+
<StrongText>Viktig tekst (fet, rendrer strong)</StrongText>
|
|
96
|
+
<PreformattedText>{`kode her`}</PreformattedText>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### LinkText
|
|
100
|
+
|
|
101
|
+
Tekstlenke med valgfri understreking. Standard element: `a`.
|
|
102
|
+
|
|
103
|
+
```tsx
|
|
104
|
+
<LinkText href="https://sparebank1.no">Gå til SpareBank 1</LinkText>
|
|
105
|
+
<LinkText as={Link} to="/dashboard">Med React Router</LinkText>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### LinkIcon
|
|
109
|
+
|
|
110
|
+
Lenke med pilikon. Standard element: `a`. Støtter `as`-prop.
|
|
111
|
+
|
|
112
|
+
```tsx
|
|
113
|
+
<LinkIcon href="/produkter">Se alle produkter</LinkIcon>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### DividerLine
|
|
117
|
+
|
|
118
|
+
Visuell skillelinje. Rendrer `<hr>` med `aria-hidden="true"`.
|
|
119
|
+
|
|
120
|
+
```tsx
|
|
121
|
+
<DividerLine />
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Utvikling
|
|
22
125
|
|
|
23
126
|
```bash
|
|
24
127
|
npm install
|
|
@@ -26,6 +129,4 @@ npm run build
|
|
|
26
129
|
npm start
|
|
27
130
|
```
|
|
28
131
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
Example implementations using the latest versions of all components are also available at https://sparebank1.github.io/designsystem.
|
|
132
|
+
Lokal Storybook på http://localhost:6006/.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sb1/ffe-core-react",
|
|
3
|
-
"version": "100.
|
|
3
|
+
"version": "100.9.0",
|
|
4
4
|
"description": "React components for ffe-core components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ffe"
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"test:watch": "ffe-buildtool jest --watch"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@sb1/ffe-core": "^100.
|
|
31
|
+
"@sb1/ffe-core": "^100.9.0",
|
|
32
32
|
"classnames": "^2.3.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@sb1/ffe-buildtool": "^100.
|
|
35
|
+
"@sb1/ffe-buildtool": "^100.9.0",
|
|
36
36
|
"eslint": "^9.22.0",
|
|
37
37
|
"react": "^18.2.0",
|
|
38
38
|
"react-dom": "^18.2.0"
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "41f20cf10bec5ebe53036c282690983d2114fb45"
|
|
47
47
|
}
|