@sb1/ffe-chart-donut-react 8.0.5 → 8.1.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 CHANGED
@@ -16,6 +16,14 @@ Full documentation on chart donut usage is available at https://design.sparebank
16
16
  @import 'path/to/node_modules/@sb1/ffe-chart-donut-react/less/ffe-chart-donut';
17
17
  ```
18
18
 
19
+ ### Importing compiled CSS
20
+
21
+ If your project does not use Less, you can import the compiled styling:
22
+
23
+ ```css
24
+ @import '~@sb1/ffe-chart-donut-react/css/ffe-chart-donut.css';
25
+ ```
26
+
19
27
  ## Theming with CSS custom properties
20
28
 
21
29
  In order to support theming of components, this package contains styling that depends on a set of custom properties, defined in `less/theme.less`. These properties in turn depend on a base theme defined in `ffe-core`.
@@ -0,0 +1,78 @@
1
+ :root,
2
+ :host {
3
+ --ffe-v-chart-donut-first-color: var(--ffe-farge-vann);
4
+ --ffe-v-chart-donut-last-color: var(--ffe-farge-fjell);
5
+ --ffe-v-chart-donut-text-color: var(--ffe-farge-koksgraa);
6
+ }
7
+ @media (prefers-color-scheme: dark) {
8
+ :root .regard-color-scheme-preference,
9
+ :host .regard-color-scheme-preference {
10
+ --ffe-v-chart-donut-first-color: var(--ffe-farge-vann-30);
11
+ --ffe-v-chart-donut-last-color: var(--ffe-farge-vann-70);
12
+ --ffe-v-chart-donut-text-color: var(--ffe-farge-lysgraa);
13
+ }
14
+ }
15
+ .ffe-chart-donut {
16
+ display: grid;
17
+ width: -webkit-fit-content;
18
+ width: -moz-fit-content;
19
+ width: fit-content;
20
+ grid-template-columns: auto;
21
+ grid-template-rows: auto;
22
+ place-items: center;
23
+ position: relative;
24
+ text-align: left;
25
+ }
26
+ .ffe-chart-donut--first {
27
+ stroke: var(--ffe-v-chart-donut-first-color);
28
+ }
29
+ .ffe-chart-donut--last {
30
+ stroke: var(--ffe-v-chart-donut-last-color);
31
+ }
32
+ .ffe-chart-donut__circle,
33
+ .ffe-chart-donut__description {
34
+ grid-column: 1 / 1;
35
+ grid-row: 1 / 1;
36
+ }
37
+ .ffe-chart-donut__circle {
38
+ width: 12.5rem;
39
+ aspect-ratio: 1;
40
+ }
41
+ .ffe-chart-donut__description {
42
+ z-index: 1;
43
+ }
44
+ .ffe-chart-donut__name {
45
+ color: var(--ffe-v-chart-donut-text-color);
46
+ text-align: center;
47
+ }
48
+ .ffe-chart-donut__fractions {
49
+ display: grid;
50
+ grid-template-columns: auto 1px auto;
51
+ grid-template-rows: auto auto;
52
+ grid-column-gap: var(--ffe-spacing-xs);
53
+ }
54
+ .ffe-chart-donut__fractions::after {
55
+ grid-column: 2 / 3;
56
+ grid-row: 1 / 2;
57
+ display: -webkit-box;
58
+ display: -ms-flexbox;
59
+ display: flex;
60
+ background: var(--ffe-v-chart-donut-text-color);
61
+ height: 1lh;
62
+ content: '';
63
+ }
64
+ .ffe-chart-donut__fraction {
65
+ display: grid;
66
+ place-items: center;
67
+ }
68
+ .ffe-chart-donut .ffe-chart-donut__amount {
69
+ color: var(--ffe-v-chart-donut-text-color);
70
+ }
71
+ .ffe-chart-donut__fraction:first-of-type {
72
+ grid-column: 1 / 2;
73
+ grid-row: 1 / 3;
74
+ }
75
+ .ffe-chart-donut__fraction:last-of-type {
76
+ grid-column: 3 / 4;
77
+ grid-row: 1 / 3;
78
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sb1/ffe-chart-donut-react",
3
- "version": "8.0.5",
3
+ "version": "8.1.0",
4
4
  "description": "Donut chart in SVG",
5
5
  "keywords": [
6
6
  "ffe"
@@ -10,7 +10,8 @@
10
10
  "files": [
11
11
  "lib",
12
12
  "es",
13
- "less"
13
+ "less",
14
+ "css"
14
15
  ],
15
16
  "main": "lib/index.js",
16
17
  "module": "es/index.js",
@@ -20,7 +21,7 @@
20
21
  "url": "ssh://git@github.com:SpareBank1/designsystem.git"
21
22
  },
22
23
  "scripts": {
23
- "build": "ffe-buildtool tsc",
24
+ "build": "ffe-buildtool tsc && lessc less/ffe-chart-donut.less css/ffe-chart-donut.css --autoprefix",
24
25
  "build:es": "ffe-buildtool tsc --es",
25
26
  "lint": "eslint src --ext ts,tsx",
26
27
  "lint:fix": "eslint src --fix --ext ts,tsx",
@@ -38,5 +39,5 @@
38
39
  "publishConfig": {
39
40
  "access": "public"
40
41
  },
41
- "gitHead": "a14800de9fd87134f0eae31e5dad841089aaffd8"
42
+ "gitHead": "55ee3d40abaef9433c55aa993889e67c3f5c5abd"
42
43
  }