@sb1/ffe-feedback-react 100.8.3 → 100.10.1
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 +62 -15
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -1,30 +1,77 @@
|
|
|
1
1
|
# @sb1/ffe-feedback-react
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Beskrivelse
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
React-komponent for tilbakemeldinger. Viser thumbs up/down-velger, utvides til tekstfelt etter klikk, og viser bekreftelse ved innsending.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Installasjon
|
|
8
|
+
|
|
9
|
+
```bash
|
|
8
10
|
npm install --save @sb1/ffe-feedback-react
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
##
|
|
13
|
+
## Bruk
|
|
12
14
|
|
|
13
|
-
Full
|
|
15
|
+
Full dokumentasjon: https://sparebank1.github.io/designsystem/
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
Make sure you import the less-files.
|
|
17
|
+
Avhengig av `@sb1/ffe-buttons-react`, `@sb1/ffe-icons-react` og `@sb1/ffe-form-react`. Importer CSS:
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
```css
|
|
20
|
+
@import url('@sb1/ffe-buttons/css/ffe-buttons.css');
|
|
21
|
+
@import url('@sb1/ffe-icons/css/ffe-icons.css');
|
|
22
|
+
@import url('@sb1/ffe-form/css/ffe-form.css');
|
|
23
|
+
```
|
|
19
24
|
|
|
20
|
-
|
|
25
|
+
## Eksempler
|
|
21
26
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
### Grunnleggende bruk
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
import { Feedback } from '@sb1/ffe-feedback-react';
|
|
31
|
+
|
|
32
|
+
function MinKomponent() {
|
|
33
|
+
return (
|
|
34
|
+
<Feedback
|
|
35
|
+
onThumbClick={thumb => console.log('Valgt:', thumb)}
|
|
36
|
+
onFeedbackSend={(text, consent) =>
|
|
37
|
+
console.log('Tilbakemelding:', text)
|
|
38
|
+
}
|
|
39
|
+
/>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
26
42
|
```
|
|
27
43
|
|
|
28
|
-
|
|
44
|
+
### Med samtykke og kontaktlenke
|
|
45
|
+
|
|
46
|
+
```tsx
|
|
47
|
+
import { Feedback } from '@sb1/ffe-feedback-react';
|
|
48
|
+
|
|
49
|
+
function TilbakemeldingMedSamtykke() {
|
|
50
|
+
return (
|
|
51
|
+
<Feedback
|
|
52
|
+
onThumbClick={thumb =>
|
|
53
|
+
analytics.track('feedback_thumb', { value: thumb })
|
|
54
|
+
}
|
|
55
|
+
onFeedbackSend={(text, consent) =>
|
|
56
|
+
api.sendFeedback({ text, canContact: consent })
|
|
57
|
+
}
|
|
58
|
+
onFinish={() => console.log('Bruker avsluttet')}
|
|
59
|
+
includeConsent={true}
|
|
60
|
+
contactLink={{
|
|
61
|
+
url: 'https://example.com/kontakt',
|
|
62
|
+
linkText: 'Kontakt oss',
|
|
63
|
+
}}
|
|
64
|
+
bgColor="secondary"
|
|
65
|
+
locale="en"
|
|
66
|
+
/>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Utvikling
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
npm install && npm run build && npm start
|
|
75
|
+
```
|
|
29
76
|
|
|
30
|
-
|
|
77
|
+
Lokal Storybook kjører på http://localhost:6006/.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sb1/ffe-feedback-react",
|
|
3
|
-
"version": "100.
|
|
3
|
+
"version": "100.10.1",
|
|
4
4
|
"description": "React component for ffe-feedback",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "SpareBank 1",
|
|
@@ -25,15 +25,15 @@
|
|
|
25
25
|
"test:watch": "ffe-buildtool jest --watch"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@sb1/ffe-buttons-react": "^100.
|
|
29
|
-
"@sb1/ffe-core-react": "^100.
|
|
30
|
-
"@sb1/ffe-feedback": "^100.
|
|
31
|
-
"@sb1/ffe-form-react": "^100.
|
|
32
|
-
"@sb1/ffe-icons-react": "^100.
|
|
28
|
+
"@sb1/ffe-buttons-react": "^100.10.1",
|
|
29
|
+
"@sb1/ffe-core-react": "^100.10.1",
|
|
30
|
+
"@sb1/ffe-feedback": "^100.10.1",
|
|
31
|
+
"@sb1/ffe-form-react": "^100.10.1",
|
|
32
|
+
"@sb1/ffe-icons-react": "^100.10.1",
|
|
33
33
|
"classnames": "^2.3.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@sb1/ffe-buildtool": "^100.
|
|
36
|
+
"@sb1/ffe-buildtool": "^100.10.1",
|
|
37
37
|
"eslint": "^9.22.0",
|
|
38
38
|
"react": "^18.2.0",
|
|
39
39
|
"react-dom": "^18.2.0"
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "a07d2274928d56dc447a3dbca8f44d1f96996d8c"
|
|
48
48
|
}
|