@helsenorge/designsystem-react 10.1.0 → 10.3.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 (239) hide show
  1. package/AnchorLink.js +2 -2
  2. package/AnchorLink.js.map +1 -1
  3. package/Avatar.js +2 -2
  4. package/Avatar.js.map +1 -1
  5. package/Badge.js +3 -3
  6. package/Badge.js.map +1 -1
  7. package/Button.js +4 -4
  8. package/Button.js.map +1 -1
  9. package/CHANGELOG.md +1392 -801
  10. package/Checkbox.js +2 -2
  11. package/Checkbox.js.map +1 -1
  12. package/Close.js +2 -2
  13. package/Close.js.map +1 -1
  14. package/ErrorBoundary.js +2 -2
  15. package/ErrorBoundary.js.map +1 -1
  16. package/FormGroup.js +12 -12
  17. package/FormGroup.js.map +1 -1
  18. package/FormLayout.js +3 -3
  19. package/FormLayout.js.map +1 -1
  20. package/HelpBubble.js +2 -2
  21. package/HelpBubble.js.map +1 -1
  22. package/HighlightPanel.js +2 -2
  23. package/HighlightPanel.js.map +1 -1
  24. package/Icon.js +3 -3
  25. package/Icon.js.map +1 -1
  26. package/Illustration.js +3 -3
  27. package/Illustration.js.map +1 -1
  28. package/Input.js +2 -2
  29. package/Input.js.map +1 -1
  30. package/Label.js +8 -8
  31. package/Label.js.map +1 -1
  32. package/LazyIcon.js +1 -1
  33. package/LazyIllustration.js +3 -3
  34. package/LazyIllustration.js.map +1 -1
  35. package/LinkList.js +6 -6
  36. package/LinkList.js.map +1 -1
  37. package/ListHeader.js +7 -7
  38. package/ListHeader.js.map +1 -1
  39. package/Panel.js +2 -2
  40. package/Panel.js.map +1 -1
  41. package/PopOver.js +2 -2
  42. package/PopOver.js.map +1 -1
  43. package/RadioButton.js +2 -2
  44. package/RadioButton.js.map +1 -1
  45. package/Select.js +2 -2
  46. package/Select.js.map +1 -1
  47. package/Slider.js +3 -3
  48. package/Slider.js.map +1 -1
  49. package/Spacer.js +2 -2
  50. package/Spacer.js.map +1 -1
  51. package/StatusDot.js +1 -1
  52. package/StepButtons.js +4 -4
  53. package/StepButtons.js.map +1 -1
  54. package/TabList.js +4 -4
  55. package/TabList.js.map +1 -1
  56. package/Table.js +2 -2
  57. package/Table.js.map +1 -1
  58. package/TableBody.js +2 -2
  59. package/TableBody.js.map +1 -1
  60. package/TableExpandedRow.js +2 -2
  61. package/TableExpandedRow.js.map +1 -1
  62. package/TableHead.js +2 -2
  63. package/TableHead.js.map +1 -1
  64. package/TableRow.js +2 -2
  65. package/TableRow.js.map +1 -1
  66. package/Textarea.js +2 -2
  67. package/Textarea.js.map +1 -1
  68. package/Title.js +2 -2
  69. package/Title.js.map +1 -1
  70. package/TooltipWord.js +2 -2
  71. package/TooltipWord.js.map +1 -1
  72. package/Trigger.js +3 -3
  73. package/Trigger.js.map +1 -1
  74. package/components/AnchorLink/styles.module.scss +8 -9
  75. package/components/Avatar/styles.module.scss +9 -9
  76. package/components/Badge/styles.module.scss +9 -9
  77. package/components/Button/styles.module.scss +68 -57
  78. package/components/Checkbox/styles.module.scss +103 -103
  79. package/components/Chip/styles.module.scss +22 -22
  80. package/components/Close/styles.module.scss +4 -4
  81. package/components/DictionaryTrigger/index.js +2 -2
  82. package/components/DictionaryTrigger/index.js.map +1 -1
  83. package/components/DictionaryTrigger/styles.module.scss +5 -5
  84. package/components/Drawer/Drawer.d.ts +41 -0
  85. package/components/Drawer/Drawer.test.d.ts +1 -0
  86. package/components/Drawer/index.d.ts +3 -0
  87. package/components/Drawer/index.js +350 -0
  88. package/components/Drawer/index.js.map +1 -0
  89. package/components/Drawer/styles.module.scss +127 -0
  90. package/components/Drawer/styles.module.scss.d.ts +16 -0
  91. package/components/Dropdown/index.js +3 -3
  92. package/components/Dropdown/index.js.map +1 -1
  93. package/components/Dropdown/styles.module.scss +51 -51
  94. package/components/Duolist/index.js +6 -5
  95. package/components/Duolist/index.js.map +1 -1
  96. package/components/Duolist/styles.module.scss +57 -35
  97. package/components/Duolist/styles.module.scss.d.ts +1 -0
  98. package/components/EmptyState/styles.module.scss +12 -12
  99. package/components/ErrorWrapper/styles.module.scss +11 -21
  100. package/components/ErrorWrapper/styles.module.scss.d.ts +0 -1
  101. package/components/Expander/styles.module.scss +46 -46
  102. package/components/ExpanderHierarchy/expander.module.scss +29 -29
  103. package/components/ExpanderHierarchy/index.js +5 -5
  104. package/components/ExpanderHierarchy/index.js.map +1 -1
  105. package/components/ExpanderHierarchy/styles.module.scss +4 -5
  106. package/components/ExpanderList/index.js +8 -8
  107. package/components/ExpanderList/index.js.map +1 -1
  108. package/components/ExpanderList/styles.module.scss +30 -30
  109. package/components/EyebrowHeader/styles.module.scss +0 -2
  110. package/components/FormGroup/styles.module.scss +9 -9
  111. package/components/FormLayout/styles.module.scss +4 -5
  112. package/components/HelpBubble/styles.module.scss +13 -13
  113. package/components/HelpPanel/styles.module.scss +2 -2
  114. package/components/HelpQuestion/index.js +2 -2
  115. package/components/HelpQuestion/index.js.map +1 -1
  116. package/components/HelpQuestion/styles.module.scss +19 -19
  117. package/components/HighlightPanel/styles.module.scss +22 -54
  118. package/components/HighlightPanel/styles.module.scss.d.ts +1 -2
  119. package/components/HorizontalScroll/styles.module.scss +4 -3
  120. package/components/Icons/EuropeanHealthCard.js +1 -1
  121. package/components/Icons/GroupTwins.js +1 -1
  122. package/components/Icons/Inbox.js +1 -1
  123. package/components/Icons/LawBook.js +1 -1
  124. package/components/Icons/PersonCancel.js +1 -1
  125. package/components/Icons/PersonWithBrain.js +1 -1
  126. package/components/Icons/Puzzle.js +1 -1
  127. package/components/Icons/Snapchat.js +1 -1
  128. package/components/Illustrations/IllustrationNames.d.ts +1 -1
  129. package/components/Illustrations/IllustrationNames.js +4 -2
  130. package/components/Illustrations/IllustrationNames.js.map +1 -1
  131. package/components/Illustrations/ReadLetters.d.ts +9 -0
  132. package/components/Illustrations/ReadLetters.js +11 -0
  133. package/components/Illustrations/ReadLetters.js.map +1 -0
  134. package/components/Illustrations/ReadLettersMedium.d.ts +4 -0
  135. package/components/Illustrations/ReadLettersMedium.js +110 -0
  136. package/components/Illustrations/ReadLettersMedium.js.map +1 -0
  137. package/components/Illustrations/Support2.d.ts +9 -0
  138. package/components/Illustrations/Support2.js +11 -0
  139. package/components/Illustrations/Support2.js.map +1 -0
  140. package/components/Illustrations/Support2Medium.d.ts +4 -0
  141. package/components/Illustrations/Support2Medium.js +232 -0
  142. package/components/Illustrations/Support2Medium.js.map +1 -0
  143. package/components/Input/styles.module.scss +12 -12
  144. package/components/Label/styles.module.scss +28 -24
  145. package/components/Label/styles.module.scss.d.ts +3 -1
  146. package/components/LinkList/styles.module.scss +33 -33
  147. package/components/List/styles.module.scss +7 -7
  148. package/components/ListHeader/styles.module.scss +8 -8
  149. package/components/Loader/styles.module.scss +14 -14
  150. package/components/MaxCharacters/styles.module.scss +11 -11
  151. package/components/Modal/index.js +71 -82
  152. package/components/Modal/index.js.map +1 -1
  153. package/components/Modal/styles.module.scss +45 -39
  154. package/components/NotificationPanel/index.js +3 -3
  155. package/components/NotificationPanel/index.js.map +1 -1
  156. package/components/NotificationPanel/styles.module.scss +33 -33
  157. package/components/Panel/styles.module.scss +45 -45
  158. package/components/PanelList/index.js +5 -5
  159. package/components/PanelList/index.js.map +1 -1
  160. package/components/PanelList/styles.module.scss +5 -5
  161. package/components/PopMenu/index.js +5 -5
  162. package/components/PopMenu/index.js.map +1 -1
  163. package/components/PopMenu/styles.module.scss +15 -15
  164. package/components/PopOver/styles.module.scss +13 -14
  165. package/components/PopOver/styles.module.scss.d.ts +0 -3
  166. package/components/Portal/index.js +3 -3
  167. package/components/Portal/index.js.map +1 -1
  168. package/components/Progressbar/styles.module.scss +4 -4
  169. package/components/PromoPanel/index.js +2 -2
  170. package/components/PromoPanel/index.js.map +1 -1
  171. package/components/PromoPanel/styles.module.scss +22 -22
  172. package/components/RadioButton/styles.module.scss +99 -99
  173. package/components/Select/styles.module.scss +21 -21
  174. package/components/ServiceMessage/styles.module.scss +49 -49
  175. package/components/SharingStatus/styles.module.scss +13 -13
  176. package/components/Slider/styles.module.scss +24 -24
  177. package/components/Spacer/styles.module.scss +14 -14
  178. package/components/StatusDot/styles.module.scss +22 -22
  179. package/components/Step/styles.module.scss +3 -3
  180. package/components/StepButtons/styles.module.scss +9 -9
  181. package/components/Stepper/styles.module.scss +23 -15
  182. package/components/StickyNote/styles.module.scss +3 -3
  183. package/components/Table/styles.module.scss +32 -32
  184. package/components/Tabs/TabList/styles.module.scss +1 -1
  185. package/components/Tabs/TabPanel/styles.module.scss +5 -5
  186. package/components/Tabs/index.js +3 -3
  187. package/components/Tabs/index.js.map +1 -1
  188. package/components/Tabs/styles.module.scss +1 -1
  189. package/components/Tag/styles.module.scss +16 -16
  190. package/components/TagList/index.js +2 -2
  191. package/components/TagList/index.js.map +1 -1
  192. package/components/TagList/styles.module.scss +4 -4
  193. package/components/Textarea/styles.module.scss +9 -9
  194. package/components/Tile/index.js +6 -6
  195. package/components/Tile/index.js.map +1 -1
  196. package/components/Tile/styles.module.scss +25 -25
  197. package/components/Title/styles.module.scss +8 -8
  198. package/components/Toggle/index.js +3 -3910
  199. package/components/Toggle/index.js.map +1 -1
  200. package/components/Toggle/styles.module.scss +14 -14
  201. package/components/Tooltip/TooltipWord/styles.module.scss +4 -4
  202. package/components/Tooltip/index.js +2 -2
  203. package/components/Tooltip/index.js.map +1 -1
  204. package/components/Trigger/styles.module.scss +21 -21
  205. package/components/Validation/index.js +6 -6
  206. package/components/Validation/index.js.map +1 -1
  207. package/components/Validation/styles.module.scss +10 -10
  208. package/constants.d.ts +1 -0
  209. package/constants.js +1 -0
  210. package/constants.js.map +1 -1
  211. package/hoc/withBreakpoint/withBreakpoint.js +2 -2
  212. package/hoc/withBreakpoint/withBreakpoint.js.map +1 -1
  213. package/hooks/useBreakpoint.d.ts +0 -4
  214. package/hooks/useBreakpoint.js +23 -18
  215. package/hooks/useBreakpoint.js.map +1 -1
  216. package/hooks/useEventListenerState.js +3 -3
  217. package/hooks/useEventListenerState.js.map +1 -1
  218. package/hooks/useReturnFocusOnUnmount.d.ts +5 -0
  219. package/hooks/useReturnFocusOnUnmount.js +20 -0
  220. package/hooks/useReturnFocusOnUnmount.js.map +1 -0
  221. package/package.json +1 -1
  222. package/scss/_body.scss +5 -6
  223. package/scss/_breakpoints.scss +8 -2
  224. package/scss/_font-mixins.scss +57 -2
  225. package/scss/_fonts.scss +0 -2
  226. package/scss/_input.scss +53 -50
  227. package/scss/_print.scss +2 -2
  228. package/scss/layout.module.scss +2 -2
  229. package/scss/typography.module.scss +62 -37
  230. package/scss/typography.module.scss.d.ts +6 -0
  231. package/scss/typography.stories.tsx +24 -0
  232. package/theme/index.js +2 -2
  233. package/use-animate.js +3952 -0
  234. package/use-animate.js.map +1 -0
  235. package/utils/accessibility.d.ts +1 -0
  236. package/utils/accessibility.js +6 -1
  237. package/utils/accessibility.js.map +1 -1
  238. package/utils/component.js +4 -4
  239. package/utils/component.js.map +1 -1
package/scss/_body.scss CHANGED
@@ -1,12 +1,11 @@
1
1
  @use 'sass:map';
2
- @import './palette';
3
- @import './breakpoints';
4
- @import './font-mixins';
2
+ @use './palette' as palette;
3
+ @use './font-mixins' as fonts;
5
4
 
6
5
  body {
7
6
  font-family: 'Source Sans Pro', Arial, Verdana, sans-serif;
8
- background-color: $white;
9
- color: $black;
7
+ background-color: palette.$white;
8
+ color: palette.$black;
10
9
 
11
- @include body;
10
+ @include fonts.body;
12
11
  }
@@ -1,7 +1,7 @@
1
1
  @use 'sass:map';
2
- @import 'spacers';
2
+ @use 'spacers' as spacers;
3
3
 
4
- $grid-gutter-width: map.get($spacers, 5);
4
+ $grid-gutter-width: map.get(spacers.$spacers, 5);
5
5
  $grid-columns: 12;
6
6
  $grid-breakpoints: (
7
7
  xxs: 0,
@@ -21,3 +21,9 @@ $container-max-widths: (
21
21
  md: 612px,
22
22
  lg: 1056px,
23
23
  );
24
+
25
+ @mixin tiny-screens-media-query {
26
+ @media (width <= 319px), (height <= 308px) {
27
+ @content;
28
+ }
29
+ }
@@ -1,6 +1,6 @@
1
1
  @use 'sass:map';
2
- @import './spacers';
3
- @import './breakpoints';
2
+ @use './spacers' as spacers;
3
+ @use './breakpoints' as *;
4
4
 
5
5
  @mixin title-feature {
6
6
  font-size: 2.375rem;
@@ -135,6 +135,28 @@
135
135
  }
136
136
  }
137
137
 
138
+ @mixin sublabel {
139
+ font-size: 1rem;
140
+ line-height: 1.2rem;
141
+ font-weight: 600;
142
+
143
+ @media (min-width: map.get($grid-breakpoints, md)) {
144
+ font-size: 1.125rem;
145
+ line-height: 1.463rem;
146
+ }
147
+ }
148
+
149
+ @mixin sublabel-subdued {
150
+ font-size: 1rem;
151
+ line-height: 1.2rem;
152
+ font-weight: 400;
153
+
154
+ @media (min-width: map.get($grid-breakpoints, md)) {
155
+ font-size: 1.125rem;
156
+ line-height: 1.463rem;
157
+ }
158
+ }
159
+
138
160
  @mixin compact-data {
139
161
  font-size: 1rem;
140
162
  line-height: 1.5rem;
@@ -183,3 +205,36 @@
183
205
  line-height: 1.75rem;
184
206
  }
185
207
  }
208
+
209
+ @mixin text-list {
210
+ font-size: 1.125rem;
211
+ line-height: 1.375rem;
212
+ font-weight: 400;
213
+
214
+ @media (min-width: map.get($grid-breakpoints, md)) {
215
+ font-size: 1.25rem;
216
+ line-height: 1.625rem;
217
+ }
218
+ }
219
+
220
+ @mixin definition-list-type {
221
+ font-size: 1.125rem;
222
+ line-height: 1.375rem;
223
+ font-weight: 600;
224
+
225
+ @media (min-width: map.get($grid-breakpoints, md)) {
226
+ font-size: 1.25rem;
227
+ line-height: 1.625rem;
228
+ }
229
+ }
230
+
231
+ @mixin definition-list-data {
232
+ font-size: 1.125rem;
233
+ line-height: 1.375rem;
234
+ font-weight: 400;
235
+
236
+ @media (min-width: map.get($grid-breakpoints, md)) {
237
+ font-size: 1.25rem;
238
+ line-height: 1.625rem;
239
+ }
240
+ }
package/scss/_fonts.scss CHANGED
@@ -1,5 +1,3 @@
1
- @import './font-settings';
2
-
3
1
  /* latin */
4
2
  @font-face {
5
3
  font-family: 'Source Sans Pro';
package/scss/_input.scss CHANGED
@@ -1,5 +1,8 @@
1
1
  @use 'sass:map';
2
- @import './font-settings';
2
+ @use './palette' as palette;
3
+ @use './spacers' as spacers;
4
+ @use './font-settings' as font-settings;
5
+ @use './breakpoints' as *;
3
6
 
4
7
  @mixin input-wrapper {
5
8
  width: 100%;
@@ -7,11 +10,11 @@
7
10
 
8
11
  @mixin input-container {
9
12
  display: flex;
10
- font-size: $font-size-sm;
13
+ font-size: font-settings.$font-size-sm;
11
14
  width: 100%;
12
- border: 2px solid $neutral700;
15
+ border: 2px solid palette.$neutral700;
13
16
  outline: none;
14
- background: $white;
17
+ background: palette.$white;
15
18
 
16
19
  svg:first-of-type {
17
20
  padding-left: 0.375rem;
@@ -22,79 +25,79 @@
22
25
  }
23
26
 
24
27
  &--large {
25
- padding: getSpacer(2xs) 0;
28
+ padding: spacers.getSpacer(2xs) 0;
26
29
 
27
30
  svg:first-of-type {
28
- padding-left: getSpacer(2xs);
31
+ padding-left: spacers.getSpacer(2xs);
29
32
  }
30
33
 
31
34
  svg:last-of-type {
32
- padding-right: getSpacer(2xs);
35
+ padding-right: spacers.getSpacer(2xs);
33
36
  }
34
37
  }
35
38
 
36
39
  &:focus-within {
37
- background: $white;
38
- border-color: $neutral900;
39
- box-shadow: 0 0 0 2px $neutral900;
40
+ background: palette.$white;
41
+ border-color: palette.$neutral900;
42
+ box-shadow: 0 0 0 2px palette.$neutral900;
40
43
  }
41
44
 
42
45
  &:hover {
43
- background: $neutral50;
44
- border-color: $neutral700;
45
- box-shadow: 0 0 0 1px $neutral700;
46
+ background: palette.$neutral50;
47
+ border-color: palette.$neutral700;
48
+ box-shadow: 0 0 0 1px palette.$neutral700;
46
49
 
47
50
  &:focus-within {
48
- border-color: $black;
49
- box-shadow: 0 0 0 2px $black;
51
+ border-color: palette.$black;
52
+ box-shadow: 0 0 0 2px palette.$black;
50
53
  }
51
54
  }
52
55
 
53
56
  &--on-blueberry {
54
- border-color: $blueberry500;
57
+ border-color: palette.$blueberry500;
55
58
 
56
59
  &:hover {
57
- background: $blueberry50;
58
- box-shadow: 0 0 0 1px $blueberry500;
59
- border-color: $blueberry500;
60
+ background: palette.$blueberry50;
61
+ box-shadow: 0 0 0 1px palette.$blueberry500;
62
+ border-color: palette.$blueberry500;
60
63
  }
61
64
 
62
65
  &:focus-within {
63
- background: $white;
64
- border-color: $neutral900;
65
- box-shadow: 0 0 0 2px $neutral900;
66
+ background: palette.$white;
67
+ border-color: palette.$neutral900;
68
+ box-shadow: 0 0 0 2px palette.$neutral900;
66
69
  }
67
70
  }
68
71
 
69
72
  &--on-dark {
70
- border-color: $blueberry900;
73
+ border-color: palette.$blueberry900;
71
74
 
72
75
  &:hover {
73
- background: $blueberry50;
74
- border-color: $blueberry900;
75
- box-shadow: 0 0 0 1px $blueberry900;
76
+ background: palette.$blueberry50;
77
+ border-color: palette.$blueberry900;
78
+ box-shadow: 0 0 0 1px palette.$blueberry900;
76
79
  }
77
80
 
78
81
  &:focus-within {
79
- background: $white;
80
- border-color: $neutral900;
81
- box-shadow: 0 0 0 2px $neutral900;
82
+ background: palette.$white;
83
+ border-color: palette.$neutral900;
84
+ box-shadow: 0 0 0 2px palette.$neutral900;
82
85
  }
83
86
  }
84
87
 
85
88
  &--invalid {
86
- border-color: $cherry600;
89
+ border-color: palette.$cherry600;
87
90
 
88
91
  &:hover {
89
- background: $cherry100;
90
- border-color: $cherry600;
91
- box-shadow: 0 0 0 2px $cherry600;
92
+ background: palette.$cherry100;
93
+ border-color: palette.$cherry600;
94
+ box-shadow: 0 0 0 2px palette.$cherry600;
92
95
  }
93
96
 
94
97
  &:focus-within {
95
- background: $white;
96
- border-color: $neutral900;
97
- box-shadow: 0 0 0 2px $neutral900;
98
+ background: palette.$white;
99
+ border-color: palette.$neutral900;
100
+ box-shadow: 0 0 0 2px palette.$neutral900;
98
101
  }
99
102
  }
100
103
 
@@ -102,32 +105,32 @@
102
105
  background: transparent;
103
106
 
104
107
  &:hover {
105
- background: $neutral100;
108
+ background: palette.$neutral100;
106
109
  }
107
110
 
108
111
  &:focus-within {
109
- background: $white;
112
+ background: palette.$white;
110
113
  }
111
114
  }
112
115
  &--transparent#{&}--on-blueberry {
113
116
  &:hover {
114
- background: $blueberry100;
117
+ background: palette.$blueberry100;
115
118
  }
116
119
 
117
120
  &:focus-within {
118
- background: $white;
121
+ background: palette.$white;
119
122
  }
120
123
  }
121
124
 
122
125
  &--disabled {
123
126
  background: transparent;
124
- border-color: $neutral600;
127
+ border-color: palette.$neutral600;
125
128
  border-style: dashed;
126
- color: $neutral700;
129
+ color: palette.$neutral700;
127
130
 
128
131
  &:hover {
129
132
  background: transparent;
130
- border-color: $neutral600;
133
+ border-color: palette.$neutral600;
131
134
  box-shadow: none;
132
135
  }
133
136
  }
@@ -135,31 +138,31 @@
135
138
  &__input {
136
139
  line-height: 1.625rem;
137
140
  font-family: inherit;
138
- font-size: $font-size-sm;
139
- padding: 0 getSpacer(2xs);
141
+ font-size: font-settings.$font-size-sm;
142
+ padding: 0 spacers.getSpacer(2xs);
140
143
  border: none;
141
144
  outline: none;
142
145
  background-color: transparent;
143
146
  width: 100%;
144
147
 
145
148
  @media (min-width: map.get($grid-breakpoints, md)) {
146
- font-size: $font-size-md;
149
+ font-size: font-settings.$font-size-md;
147
150
  }
148
151
 
149
152
  &::placeholder {
150
- color: $neutral500;
153
+ color: palette.$neutral500;
151
154
  }
152
155
 
153
156
  &--disabled {
154
- color: $neutral700;
157
+ color: palette.$neutral700;
155
158
  }
156
159
 
157
160
  &:first-child {
158
- padding-left: getSpacer(s);
161
+ padding-left: spacers.getSpacer(s);
159
162
  }
160
163
 
161
164
  &:last-child {
162
- padding-right: getSpacer(s);
165
+ padding-right: spacers.getSpacer(s);
163
166
  }
164
167
  }
165
168
  }
package/scss/_print.scss CHANGED
@@ -1,5 +1,5 @@
1
1
  @use 'sass:map';
2
- @import 'palette';
2
+ @use 'palette' as palette;
3
3
  @import 'breakpoints';
4
4
 
5
5
  @media print {
@@ -32,7 +32,7 @@
32
32
 
33
33
  pre,
34
34
  blockquote {
35
- border: 1px solid $neutral500;
35
+ border: 1px solid palette.$neutral500;
36
36
  page-break-inside: avoid;
37
37
  }
38
38
 
@@ -1,4 +1,4 @@
1
- @import './breakpoints';
1
+ @use './breakpoints' as *;
2
2
 
3
3
  /*
4
4
  Denne filen er ment til å importeres som en css module:
@@ -8,7 +8,7 @@ import designsystemlayout from './scss/layout.scss'
8
8
 
9
9
  .container-breakout {
10
10
  // This is a copy of how bootstrap's row class sets margins inside a container
11
- // https://github.com/twbs/bootstrap/blob/e5643aaa89eb67327a5b4abe7db976f0ea276b70/scss/mixins/_grid.scss#L16C1-L17C30
11
+ // https://github.com/twbs/bootstrap/blob/e5643aaa89eb67327a5b4abe7db976f0ea276b70/scss/mixins/_scss#L16C1-L17C30
12
12
  margin-right: -$grid-gutter-width * 0.5;
13
13
  margin-left: -$grid-gutter-width * 0.5;
14
14
  }
@@ -1,9 +1,10 @@
1
1
  @use 'sass:map';
2
- @import './spacers';
3
- @import './breakpoints';
2
+ @use './spacers' as spacers;
3
+ @use './palette' as palette;
4
+ @use './font-mixins' as fonts;
5
+ @use './font-settings' as font-settings;
6
+ @use './breakpoints' as *;
4
7
  @import './fonts';
5
- @import './palette';
6
- @import './font-mixins';
7
8
 
8
9
  /*
9
10
  Denne filen er ment til å importeres som en css module:
@@ -12,99 +13,123 @@ import designsystemtypography from './scss/typography.scss'
12
13
  */
13
14
 
14
15
  .title-feature {
15
- @include title-feature;
16
+ @include fonts.title-feature;
16
17
  }
17
18
 
18
19
  .focused-content {
19
- font-size: $font-size-sm;
20
- line-height: $lineheight-size-sm;
20
+ font-size: font-settings.$font-size-sm;
21
+ line-height: font-settings.$lineheight-size-sm;
21
22
  }
22
23
 
23
24
  .title1 {
24
- @include title1;
25
+ @include fonts.title1;
25
26
  }
26
27
 
27
28
  .title2 {
28
- @include title2;
29
+ @include fonts.title2;
29
30
  }
30
31
 
31
32
  .title3 {
32
- @include title3;
33
+ @include fonts.title3;
33
34
  }
34
35
 
35
36
  .title4 {
36
- @include title4;
37
+ @include fonts.title4;
37
38
  }
38
39
 
39
40
  .title5 {
40
- @include title5;
41
+ @include fonts.title5;
41
42
  }
42
43
 
43
44
  .title6 {
44
- @include title6;
45
+ @include fonts.title6;
45
46
  }
46
47
 
47
48
  .body {
48
- @include body;
49
+ @include fonts.body;
49
50
  }
50
51
 
51
52
  .preamble {
52
- @include preamble;
53
+ @include fonts.preamble;
53
54
  }
54
55
 
55
56
  .legend {
56
- @include legend;
57
+ @include fonts.legend;
57
58
  }
58
59
 
59
60
  .label {
60
- @include label;
61
+ @include fonts.label;
62
+ }
63
+
64
+ .label-subdued {
65
+ @include fonts.label-subdued;
66
+ }
67
+
68
+ .sublabel {
69
+ @include fonts.sublabel;
70
+ }
71
+
72
+ .sublabel-subdued {
73
+ @include fonts.sublabel-subdued;
61
74
  }
62
75
 
63
76
  .compact-data {
64
- @include compact-data;
77
+ @include fonts.compact-data;
65
78
  }
66
79
 
67
80
  .table-cell {
68
- @include table-cell;
81
+ @include fonts.table-cell;
69
82
  }
70
83
 
71
84
  .strong {
72
- font-size: $font-size-sm;
73
- line-height: $lineheight-size-sm;
85
+ font-size: font-settings.$font-size-sm;
86
+ line-height: font-settings.$lineheight-size-sm;
74
87
 
75
88
  @media (min-width: map.get($grid-breakpoints, md)) {
76
- font-size: $font-size-md;
77
- line-height: $lineheight-size-md;
89
+ font-size: font-settings.$font-size-md;
90
+ line-height: font-settings.$lineheight-size-md;
78
91
  }
79
92
  }
80
93
 
81
94
  .form {
82
- font-size: $font-size-sm;
83
- line-height: $lineheight-size-sm;
95
+ font-size: font-settings.$font-size-sm;
96
+ line-height: font-settings.$lineheight-size-sm;
84
97
 
85
98
  @media (min-width: map.get($grid-breakpoints, md)) {
86
- font-size: $font-size-md;
99
+ font-size: font-settings.$font-size-md;
87
100
  }
88
101
  }
89
102
 
90
103
  .status-timestamp {
91
- @include status-timestamp;
104
+ @include fonts.status-timestamp;
92
105
  }
93
106
 
94
107
  .image-caption {
95
- @include image-caption;
108
+ @include fonts.image-caption;
96
109
  }
97
110
 
98
111
  .image-credit {
99
- @include image-credit;
112
+ @include fonts.image-credit;
100
113
  }
101
114
 
102
115
  .input-text {
103
- @include input-text;
116
+ @include fonts.input-text;
104
117
  }
105
118
 
106
119
  .input-text-large {
107
- @include input-text-large;
120
+ @include fonts.input-text-large;
121
+ }
122
+
123
+ .text-list {
124
+ @include fonts.text-list;
125
+ }
126
+
127
+ .definition-list-type {
128
+ @include fonts.definition-list-type;
129
+ }
130
+
131
+ .definition-list-data {
132
+ @include fonts.definition-list-data;
108
133
  }
109
134
 
110
135
  .anchorlink-wrapper {
@@ -114,24 +139,24 @@ import designsystemtypography from './scss/typography.scss'
114
139
  overflow-wrap: break-word;
115
140
  word-break: break-word;
116
141
  text-align: left;
117
- color: $blueberry600;
142
+ color: palette.$blueberry600;
118
143
  border: 0.15rem solid transparent;
119
144
  text-decoration: underline;
120
145
  text-underline-offset: 0.16rem;
121
- text-decoration-color: $blueberry400;
146
+ text-decoration-color: palette.$blueberry400;
122
147
  text-decoration-thickness: 0.0625rem;
123
148
  padding: 0.1rem;
124
149
 
125
150
  &:hover {
126
151
  cursor: pointer;
127
- color: $blueberry700;
128
- background-color: $blueberry50;
129
- text-decoration-color: $blueberry600;
152
+ color: palette.$blueberry700;
153
+ background-color: palette.$blueberry50;
154
+ text-decoration-color: palette.$blueberry600;
130
155
  }
131
156
 
132
157
  &:focus {
133
158
  outline: none;
134
- border: 0.15rem solid $black;
159
+ border: 0.15rem solid palette.$black;
135
160
  }
136
161
 
137
162
  &[target='_blank'] {
@@ -2,6 +2,8 @@ export type Styles = {
2
2
  'anchorlink-wrapper': string;
3
3
  body: string;
4
4
  'compact-data': string;
5
+ 'definition-list-data': string;
6
+ 'definition-list-type': string;
5
7
  'focused-content': string;
6
8
  form: string;
7
9
  'image-caption': string;
@@ -9,11 +11,15 @@ export type Styles = {
9
11
  'input-text': string;
10
12
  'input-text-large': string;
11
13
  label: string;
14
+ 'label-subdued': string;
12
15
  legend: string;
13
16
  preamble: string;
14
17
  'status-timestamp': string;
15
18
  strong: string;
19
+ sublabel: string;
20
+ 'sublabel-subdued': string;
16
21
  'table-cell': string;
22
+ 'text-list': string;
17
23
  'title-feature': string;
18
24
  title1: string;
19
25
  title2: string;
@@ -65,6 +65,18 @@ export const Label: Story = {
65
65
  render: args => <div className={designsystemtypography.label}>{args.tekst}</div>,
66
66
  };
67
67
 
68
+ export const LabelSubdued: Story = {
69
+ render: args => <div className={designsystemtypography['label-subdued']}>{args.tekst}</div>,
70
+ };
71
+
72
+ export const Sublabel: Story = {
73
+ render: args => <div className={designsystemtypography.sublabel}>{args.tekst}</div>,
74
+ };
75
+
76
+ export const SublabelSubdued: Story = {
77
+ render: args => <div className={designsystemtypography['sublabel-subdued']}>{args.tekst}</div>,
78
+ };
79
+
68
80
  export const CompactData: Story = {
69
81
  render: args => <div className={designsystemtypography['compact-data']}>{args.tekst}</div>,
70
82
  };
@@ -97,6 +109,18 @@ export const InputTextLarge: Story = {
97
109
  render: args => <div className={designsystemtypography['input-text-large']}>{args.tekst}</div>,
98
110
  };
99
111
 
112
+ export const TextList: Story = {
113
+ render: args => <div className={designsystemtypography['text-list']}>{args.tekst}</div>,
114
+ };
115
+
116
+ export const DefinitionListType: Story = {
117
+ render: args => <div className={designsystemtypography['definition-list-type']}>{args.tekst}</div>,
118
+ };
119
+
120
+ export const DefinitionListData: Story = {
121
+ render: args => <div className={designsystemtypography['definition-list-data']}>{args.tekst}</div>,
122
+ };
123
+
100
124
  export const AnchorlinkWrapper: Story = {
101
125
  render: args => (
102
126
  <div className={designsystemtypography['anchorlink-wrapper']}>
package/theme/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { screen, breakpoints } from "./grid.js";
1
+ import { breakpoints, screen } from "./grid.js";
2
2
  import { palette } from "./palette.js";
3
- import { spacer, spacers } from "./spacers.js";
3
+ import { spacers, spacer } from "./spacers.js";
4
4
  const theme = {
5
5
  spacer,
6
6
  spacers,