@sb1/ffe-feedback-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.
Files changed (2) hide show
  1. package/README.md +62 -15
  2. package/package.json +8 -8
package/README.md CHANGED
@@ -1,30 +1,77 @@
1
1
  # @sb1/ffe-feedback-react
2
2
 
3
- React module for FFE feedback element.
3
+ ## Beskrivelse
4
4
 
5
- ## Install
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
- ## Usage
13
+ ## Bruk
12
14
 
13
- Full documentation is not yet available, but will be added to https://design.sparebank1.no/komponenter.
15
+ Full dokumentasjon: https://sparebank1.github.io/designsystem/
14
16
 
15
- This package depends on `@sb1/ffe-buttons-react`, `@sb1/ffe-icons-react` and `@sb1/ffe-form-react`.
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
- ## Development
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
- To start a local development server, run the following from the designsystem root folder:
25
+ ## Eksempler
21
26
 
22
- ```bash
23
- npm install
24
- npm run build
25
- npm start
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
- A local instance of `Storybook` with live reloading will run at http://localhost:6006/.
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
- Example implementations using the latest versions of all components are also available at https://sparebank1.github.io/designsystem.
77
+ Lokal Storybook kjører http://localhost:6006/.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sb1/ffe-feedback-react",
3
- "version": "100.8.3",
3
+ "version": "100.9.0",
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.8.3",
29
- "@sb1/ffe-core-react": "^100.8.3",
30
- "@sb1/ffe-feedback": "^100.8.3",
31
- "@sb1/ffe-form-react": "^100.8.3",
32
- "@sb1/ffe-icons-react": "^100.8.3",
28
+ "@sb1/ffe-buttons-react": "^100.9.0",
29
+ "@sb1/ffe-core-react": "^100.9.0",
30
+ "@sb1/ffe-feedback": "^100.9.0",
31
+ "@sb1/ffe-form-react": "^100.9.0",
32
+ "@sb1/ffe-icons-react": "^100.9.0",
33
33
  "classnames": "^2.3.1"
34
34
  },
35
35
  "devDependencies": {
36
- "@sb1/ffe-buildtool": "^100.8.3",
36
+ "@sb1/ffe-buildtool": "^100.9.0",
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": "f33cf64a467cb430540d1320e763a4f223a8012c"
47
+ "gitHead": "41f20cf10bec5ebe53036c282690983d2114fb45"
48
48
  }