@digdir/designsystemet-react 0.58.0 → 0.59.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.
@@ -19,9 +19,9 @@ const icons = {
19
19
  title: 'Feil',
20
20
  },
21
21
  };
22
- const Alert = React.forwardRef(({ severity = 'info', elevated, iconTitle, children, className, ...rest }, ref) => {
22
+ const Alert = React.forwardRef(({ severity = 'info', elevated, iconTitle, size, children, className, ...rest }, ref) => {
23
23
  const { Icon, title } = icons[severity];
24
- return (jsxRuntime.jsx("div", { ref: ref, className: clsx.clsx('fds-alert', `fds-alert--${severity}`, elevated && `fds-alert--elevated`, className), ...rest, children: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Icon, { title: iconTitle || title, className: 'fds-alert__icon' }), jsxRuntime.jsx(Paragraph.Paragraph, { asChild: true, className: 'fds-alert__content', children: jsxRuntime.jsx("span", { children: children }) })] }) }));
24
+ return (jsxRuntime.jsx("div", { ref: ref, className: clsx.clsx('fds-alert', `fds-alert--${size}`, `fds-alert--${severity}`, elevated && `fds-alert--elevated`, className), ...rest, children: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Icon, { title: iconTitle || title, className: 'fds-alert__icon' }), jsxRuntime.jsx(Paragraph.Paragraph, { asChild: true, size: size, className: 'fds-alert__content', children: jsxRuntime.jsx("span", { children: children }) })] }) }));
25
25
  });
26
26
  Alert.displayName = 'Alert';
27
27
 
@@ -5,14 +5,13 @@ var jsxRuntime = require('react/jsx-runtime');
5
5
  var React = require('react');
6
6
  var clsx = require('../../node_modules/clsx/dist/clsx.js');
7
7
  var index = require('../../node_modules/@radix-ui/react-slot/dist/index.js');
8
- var Button_module = require('./Button.module.css.js');
9
8
 
10
9
  /**
11
10
  * Button used for interaction
12
11
  */
13
12
  const Button = React.forwardRef(({ children, color = 'first', variant = 'primary', size = 'medium', fullWidth = false, icon = false, type = 'button', className, as = 'button', asChild, ...rest }, ref) => {
14
13
  const Component = asChild ? index.Slot : as;
15
- return (jsxRuntime.jsx(Component, { ref: ref, type: type, className: clsx.clsx(Button_module.button, `fds-focus`, Button_module[size], Button_module[variant], Button_module[color], { [Button_module.fullWidth]: fullWidth }, { [Button_module.onlyIcon]: icon }, className), ...rest, children: children }));
14
+ return (jsxRuntime.jsx(Component, { ref: ref, type: type, className: clsx.clsx('fds-btn', `fds-focus`, `fds-btn--${size}`, `fds-btn--${variant}`, `fds-btn--${color}`, { 'fds-btn--full-width': fullWidth }, { 'fds-btn--icon-only': icon }, className), ...rest, children: children }));
16
15
  });
17
16
  Button.displayName = 'Button';
18
17
 
@@ -3,10 +3,9 @@
3
3
 
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
5
  var clsx = require('../../node_modules/clsx/dist/clsx.js');
6
- var SkipLink_module = require('./SkipLink.module.css.js');
7
6
 
8
7
  const SkipLink = ({ href, children, className, ...rest }) => {
9
- return (jsxRuntime.jsx("a", { href: href, className: clsx.clsx(`fds-sr-only`, SkipLink_module.skiplink, className), ...rest, children: children }));
8
+ return (jsxRuntime.jsx("a", { href: href, className: clsx.clsx(`fds-sr-only`, 'fds-skiplink', className), ...rest, children: children }));
10
9
  };
11
10
  SkipLink.displayName = 'SkipLink';
12
11
 
@@ -1,297 +1,3 @@
1
- @layer fds.button {
2
- .fds-button-button-8fa00f0f {
3
- --fc-button-padding: 0 var(--fds-spacing-4);
4
- --fc-button-color: var(--fds-semantic-text-action-first-on_action);
5
-
6
- display: flex;
7
- align-items: center;
8
- border: var(--fds-border_width-default) solid transparent;
9
- color: var(--fc-button-color);
10
- fill: var(--fc-button-color);
11
- min-width: 2.5em;
12
- padding: var(--fc-button-padding);
13
- box-sizing: border-box;
14
- cursor: pointer;
15
- font-family: inherit;
16
- justify-content: center;
17
- text-align: center;
18
- text-decoration: none;
19
- position: relative;
20
- border-radius: var(--fds-border_radius-interactive);
21
- min-height: var(--fds-sizing-10);
22
- }
23
-
24
- .fds-button-button-8fa00f0f svg {
25
- overflow: visible;
26
- }
27
-
28
- .fds-button-small-8fa00f0f::before {
29
- position: absolute;
30
- top: 0;
31
- left: 0;
32
- width: auto;
33
- min-height: auto;
34
- content: '';
35
- }
36
-
37
- .fds-button-small-8fa00f0f::after {
38
- position: absolute;
39
- top: -5px;
40
- left: 0;
41
- width: 100%;
42
- height: 44px;
43
- content: '';
44
- }
45
-
46
- .fds-button-button-8fa00f0f:disabled,
47
- .fds-button-button-8fa00f0f[aria-disabled='true'] {
48
- cursor: not-allowed;
49
- opacity: var(--fds-opacity-disabled);
50
- }
51
-
52
- .fds-button-small-8fa00f0f {
53
- --fc-button-padding: 0 var(--fds-spacing-3);
54
-
55
- gap: var(--fds-sizing-1);
56
- font: var(--fds-typography-paragraph-short-small);
57
- font-family: inherit;
58
- min-height: var(--fds-sizing-10);
59
- }
60
-
61
- .fds-button-medium-8fa00f0f {
62
- --fc-button-padding: 0 var(--fds-spacing-4);
63
-
64
- gap: var(--fds-sizing-2);
65
- font: var(--fds-typography-paragraph-short-medium);
66
- font-family: inherit;
67
- min-height: var(--fds-sizing-12);
68
- }
69
-
70
- .fds-button-large-8fa00f0f {
71
- --fc-button-padding: 0 var(--fds-spacing-5);
72
-
73
- gap: var(--fds-sizing-2);
74
- font: var(--fds-typography-paragraph-short-large);
75
- font-family: inherit;
76
- min-height: var(--fds-sizing-14);
77
- }
78
-
79
- .fds-button-fullWidth-8fa00f0f {
80
- width: 100%;
81
- }
82
-
83
- .fds-button-secondary-8fa00f0f,
84
- .fds-button-tertiary-8fa00f0f {
85
- background-color: transparent;
86
- }
87
-
88
- .fds-button-onlyIcon-8fa00f0f {
89
- --fc-button-padding: 0;
90
- }
91
-
92
- /* Only use hover for non-touch devices to prevent sticky-hovering */
93
- @media (hover: hover) and (pointer: fine) {
94
- .fds-button-primary-8fa00f0f:where(.fds-button-first-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
95
- background-color: var(--fds-semantic-surface-action-first-hover);
96
- }
97
-
98
- .fds-button-primary-8fa00f0f:where(.fds-button-second-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
99
- background-color: var(--fds-semantic-surface-action-second-hover);
100
- }
101
-
102
- .fds-button-primary-8fa00f0f:where(.fds-button-success-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
103
- background-color: var(--fds-semantic-surface-success-hover);
104
- }
105
-
106
- .fds-button-primary-8fa00f0f:where(.fds-button-danger-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
107
- background-color: var(--fds-semantic-surface-danger-hover);
108
- }
109
-
110
- .fds-button-secondary-8fa00f0f:where(.fds-button-first-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
111
- --fc-button-color: var(--fds-semantic-text-action-first-hover);
112
-
113
- border-color: var(--fds-semantic-border-action-first-hover);
114
- background-color: var(--fds-semantic-surface-action-first-no_fill-hover);
115
- }
116
-
117
- .fds-button-secondary-8fa00f0f:where(.fds-button-second-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
118
- --fc-button-color: var(--fds-semantic-text-action-second-hover);
119
-
120
- border-color: var(--fds-semantic-border-action-second-hover);
121
- background-color: var(--fds-semantic-surface-action-second-no_fill-hover);
122
- }
123
-
124
- .fds-button-secondary-8fa00f0f:where(.fds-button-success-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
125
- --fc-button-color: var(--fds-semantic-text-success-hover);
126
-
127
- border-color: var(--fds-semantic-border-success-hover);
128
- background-color: var(--fds-semantic-surface-success-no_fill-hover);
129
- }
130
-
131
- .fds-button-secondary-8fa00f0f:where(.fds-button-danger-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
132
- --fc-button-color: var(--fds-semantic-text-danger-hover);
133
-
134
- border-color: var(--fds-semantic-border-danger-hover);
135
- background-color: var(--fds-semantic-surface-danger-no_fill-hover);
136
- }
137
-
138
- .fds-button-tertiary-8fa00f0f:where(.fds-button-first-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
139
- --fc-button-color: var(--fds-semantic-text-action-first-hover);
140
-
141
- background-color: var(--fds-semantic-surface-action-first-no_fill-hover);
142
- }
143
-
144
- .fds-button-tertiary-8fa00f0f:where(.fds-button-second-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
145
- --fc-button-color: var(--fds-semantic-text-action-second-hover);
146
-
147
- background-color: var(--fds-semantic-surface-action-second-no_fill-hover);
148
- }
149
-
150
- .fds-button-tertiary-8fa00f0f:where(.fds-button-success-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
151
- --fc-button-color: var(--fds-semantic-text-success-hover);
152
-
153
- background-color: var(--fds-semantic-surface-success-no_fill-hover);
154
- }
155
-
156
- .fds-button-tertiary-8fa00f0f:where(.fds-button-danger-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
157
- --fc-button-color: var(--fds-semantic-text-danger-hover);
158
-
159
- background-color: var(--fds-semantic-surface-danger-no_fill-hover);
160
- }
161
- }
162
-
163
- /* Primary button colors */
164
- .fds-button-primary-8fa00f0f:where(.fds-button-first-8fa00f0f) {
165
- background-color: var(--fds-semantic-surface-action-first-default);
166
- }
167
-
168
- .fds-button-primary-8fa00f0f:where(.fds-button-second-8fa00f0f) {
169
- background-color: var(--fds-semantic-surface-action-second-default);
170
- }
171
-
172
- .fds-button-primary-8fa00f0f:where(.fds-button-success-8fa00f0f) {
173
- background-color: var(--fds-semantic-surface-success-default);
174
- }
175
-
176
- .fds-button-primary-8fa00f0f:where(.fds-button-danger-8fa00f0f) {
177
- background-color: var(--fds-semantic-surface-danger-default);
178
- }
179
-
180
- .fds-button-primary-8fa00f0f:where(.fds-button-first-8fa00f0f):not([aria-disabled='true'], :disabled):active {
181
- background-color: var(--fds-semantic-surface-action-first-active);
182
- }
183
-
184
- .fds-button-primary-8fa00f0f:where(.fds-button-second-8fa00f0f):not([aria-disabled='true'], :disabled):active {
185
- background-color: var(--fds-semantic-surface-action-second-active);
186
- }
187
-
188
- .fds-button-primary-8fa00f0f:where(.fds-button-success-8fa00f0f):not([aria-disabled='true'], :disabled):active {
189
- background-color: var(--fds-semantic-surface-success-active);
190
- }
191
-
192
- .fds-button-primary-8fa00f0f:where(.fds-button-danger-8fa00f0f):not([aria-disabled='true'], :disabled):active {
193
- background-color: var(--fds-semantic-surface-danger-active);
194
- }
195
-
196
- /* Secondary button colors */
197
- .fds-button-secondary-8fa00f0f:where(.fds-button-first-8fa00f0f) {
198
- --fc-button-color: var(--fds-semantic-text-action-first-default);
199
-
200
- border-color: var(--fds-semantic-border-action-first-default);
201
- background-color: var(--fds-semantic-surface-action-first-no_fill);
202
- }
203
-
204
- .fds-button-secondary-8fa00f0f:where(.fds-button-second-8fa00f0f) {
205
- --fc-button-color: var(--fds-semantic-text-action-second-default);
206
-
207
- border-color: var(--fds-semantic-border-action-second-default);
208
- background-color: var(--fds-semantic-surface-action-second-no_fill);
209
- }
210
-
211
- .fds-button-secondary-8fa00f0f:where(.fds-button-success-8fa00f0f) {
212
- --fc-button-color: var(--fds-semantic-text-success-default);
213
-
214
- border-color: var(--fds-semantic-border-success-default);
215
- background-color: var(--fds-semantic-surface-success-no_fill);
216
- }
217
-
218
- .fds-button-secondary-8fa00f0f:where(.fds-button-danger-8fa00f0f) {
219
- --fc-button-color: var(--fds-semantic-text-danger-default);
220
-
221
- border-color: var(--fds-semantic-border-danger-default);
222
- background-color: var(--fds-semantic-surface-danger-no_fill);
223
- }
224
-
225
- .fds-button-secondary-8fa00f0f:where(.fds-button-first-8fa00f0f):not([aria-disabled='true'], :disabled):active {
226
- --fc-button-color: var(--fds-semantic-text-action-first-active);
227
-
228
- border-color: var(--fds-semantic-border-action-first-active);
229
- background-color: var(--fds-semantic-surface-action-first-no_fill-active);
230
- }
231
-
232
- .fds-button-secondary-8fa00f0f:where(.fds-button-second-8fa00f0f):not([aria-disabled='true'], :disabled):active {
233
- --fc-button-color: var(--fds-semantic-text-action-second-active);
234
-
235
- border-color: var(--fds-semantic-border-action-second-active);
236
- background-color: var(--fds-semantic-surface-action-second-no_fill-active);
237
- }
238
-
239
- .fds-button-secondary-8fa00f0f:where(.fds-button-success-8fa00f0f):not([aria-disabled='true'], :disabled):active {
240
- --fc-button-color: var(--fds-semantic-text-success-active);
241
-
242
- border-color: var(--fds-semantic-border-success-active);
243
- background-color: var(--fds-semantic-surface-success-no_fill-active);
244
- }
245
-
246
- .fds-button-secondary-8fa00f0f:where(.fds-button-danger-8fa00f0f):not([aria-disabled='true'], :disabled):active {
247
- --fc-button-color: var(--fds-semantic-text-danger-active);
248
-
249
- border-color: var(--fds-semantic-border-danger-active);
250
- background-color: var(--fds-semantic-surface-danger-no_fill-active);
251
- }
252
-
253
- /* Tertiary button colors */
254
- .fds-button-tertiary-8fa00f0f:where(.fds-button-first-8fa00f0f) {
255
- --fc-button-color: var(--fds-semantic-text-action-first-default);
256
- }
257
-
258
- .fds-button-tertiary-8fa00f0f:where(.fds-button-second-8fa00f0f) {
259
- --fc-button-color: var(--fds-semantic-text-action-second-default);
260
- }
261
-
262
- .fds-button-tertiary-8fa00f0f:where(.fds-button-success-8fa00f0f) {
263
- --fc-button-color: var(--fds-semantic-text-success-default);
264
- }
265
-
266
- .fds-button-tertiary-8fa00f0f:where(.fds-button-danger-8fa00f0f) {
267
- --fc-button-color: var(--fds-semantic-text-danger-default);
268
- }
269
-
270
- .fds-button-tertiary-8fa00f0f:where(.fds-button-first-8fa00f0f):not([aria-disabled='true'], :disabled):active {
271
- --fc-button-color: var(--fds-semantic-text-action-first-active);
272
-
273
- background-color: var(--fds-semantic-surface-action-first-no_fill-active);
274
- }
275
-
276
- .fds-button-tertiary-8fa00f0f:where(.fds-button-second-8fa00f0f):not([aria-disabled='true'], :disabled):active {
277
- --fc-button-color: var(--fds-semantic-text-action-second-active);
278
-
279
- background-color: var(--fds-semantic-surface-action-second-no_fill-active);
280
- }
281
-
282
- .fds-button-tertiary-8fa00f0f:where(.fds-button-success-8fa00f0f):not([aria-disabled='true'], :disabled):active {
283
- --fc-button-color: var(--fds-semantic-text-success-active);
284
-
285
- background-color: var(--fds-semantic-surface-success-no_fill-active);
286
- }
287
-
288
- .fds-button-tertiary-8fa00f0f:where(.fds-button-danger-8fa00f0f):not([aria-disabled='true'], :disabled):active {
289
- --fc-button-color: var(--fds-semantic-text-danger-active);
290
-
291
- background-color: var(--fds-semantic-surface-danger-no_fill-active);
292
- }
293
- }
294
-
295
1
  @layer fds.paragraph {
296
2
  .fds-paragraph-paragraph-b69df5f3 {
297
3
  --fdsc-bottom-spacing: var(--fds-spacing-5);
@@ -1360,27 +1066,6 @@
1360
1066
  }
1361
1067
  }
1362
1068
 
1363
- @layer fds.skiplink {
1364
- .fds-skiplink-skiplink-d4abeaef:focus {
1365
- display: block;
1366
- outline: 0;
1367
- position: static;
1368
- width: auto;
1369
- height: auto;
1370
- margin: inherit;
1371
- overflow: visible;
1372
- clip: auto;
1373
- clip-path: none;
1374
- white-space: inherit;
1375
- text-decoration: underline;
1376
- text-decoration-thickness: 3px;
1377
- text-underline-offset: 0.3em;
1378
- padding: var(--fds-spacing-3) var(--fds-spacing-4) var(--fds-spacing-3) var(--fds-spacing-6);
1379
- color: var(--fds-semantic-text-neutral-default);
1380
- background: var(--fds-semantic-border-focus-outline);
1381
- }
1382
- }
1383
-
1384
1069
  @layer fds.tooltip {
1385
1070
  .fds-tooltip-wrapper-a3778147 {
1386
1071
  background: var(--fds-semantic-surface-neutral-inverted);
@@ -17,9 +17,9 @@ const icons = {
17
17
  title: 'Feil',
18
18
  },
19
19
  };
20
- const Alert = forwardRef(({ severity = 'info', elevated, iconTitle, children, className, ...rest }, ref) => {
20
+ const Alert = forwardRef(({ severity = 'info', elevated, iconTitle, size, children, className, ...rest }, ref) => {
21
21
  const { Icon, title } = icons[severity];
22
- return (jsx("div", { ref: ref, className: clsx('fds-alert', `fds-alert--${severity}`, elevated && `fds-alert--elevated`, className), ...rest, children: jsxs(Fragment, { children: [jsx(Icon, { title: iconTitle || title, className: 'fds-alert__icon' }), jsx(Paragraph, { asChild: true, className: 'fds-alert__content', children: jsx("span", { children: children }) })] }) }));
22
+ return (jsx("div", { ref: ref, className: clsx('fds-alert', `fds-alert--${size}`, `fds-alert--${severity}`, elevated && `fds-alert--elevated`, className), ...rest, children: jsxs(Fragment, { children: [jsx(Icon, { title: iconTitle || title, className: 'fds-alert__icon' }), jsx(Paragraph, { asChild: true, size: size, className: 'fds-alert__content', children: jsx("span", { children: children }) })] }) }));
23
23
  });
24
24
  Alert.displayName = 'Alert';
25
25
 
@@ -3,14 +3,13 @@ import { jsx } from 'react/jsx-runtime';
3
3
  import { forwardRef } from 'react';
4
4
  import { clsx } from '../../node_modules/clsx/dist/clsx.js';
5
5
  import { Slot as $5e63c961fc1ce211$export$8c6ed5c666ac1360 } from '../../node_modules/@radix-ui/react-slot/dist/index.js';
6
- import classes from './Button.module.css.js';
7
6
 
8
7
  /**
9
8
  * Button used for interaction
10
9
  */
11
10
  const Button = forwardRef(({ children, color = 'first', variant = 'primary', size = 'medium', fullWidth = false, icon = false, type = 'button', className, as = 'button', asChild, ...rest }, ref) => {
12
11
  const Component = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : as;
13
- return (jsx(Component, { ref: ref, type: type, className: clsx(classes.button, `fds-focus`, classes[size], classes[variant], classes[color], { [classes.fullWidth]: fullWidth }, { [classes.onlyIcon]: icon }, className), ...rest, children: children }));
12
+ return (jsx(Component, { ref: ref, type: type, className: clsx('fds-btn', `fds-focus`, `fds-btn--${size}`, `fds-btn--${variant}`, `fds-btn--${color}`, { 'fds-btn--full-width': fullWidth }, { 'fds-btn--icon-only': icon }, className), ...rest, children: children }));
14
13
  });
15
14
  Button.displayName = 'Button';
16
15
 
@@ -1,10 +1,9 @@
1
1
  'use client';
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
  import { clsx } from '../../node_modules/clsx/dist/clsx.js';
4
- import classes from './SkipLink.module.css.js';
5
4
 
6
5
  const SkipLink = ({ href, children, className, ...rest }) => {
7
- return (jsx("a", { href: href, className: clsx(`fds-sr-only`, classes.skiplink, className), ...rest, children: children }));
6
+ return (jsx("a", { href: href, className: clsx(`fds-sr-only`, 'fds-skiplink', className), ...rest, children: children }));
8
7
  };
9
8
  SkipLink.displayName = 'SkipLink';
10
9
 
@@ -1,297 +1,3 @@
1
- @layer fds.button {
2
- .fds-button-button-8fa00f0f {
3
- --fc-button-padding: 0 var(--fds-spacing-4);
4
- --fc-button-color: var(--fds-semantic-text-action-first-on_action);
5
-
6
- display: flex;
7
- align-items: center;
8
- border: var(--fds-border_width-default) solid transparent;
9
- color: var(--fc-button-color);
10
- fill: var(--fc-button-color);
11
- min-width: 2.5em;
12
- padding: var(--fc-button-padding);
13
- box-sizing: border-box;
14
- cursor: pointer;
15
- font-family: inherit;
16
- justify-content: center;
17
- text-align: center;
18
- text-decoration: none;
19
- position: relative;
20
- border-radius: var(--fds-border_radius-interactive);
21
- min-height: var(--fds-sizing-10);
22
- }
23
-
24
- .fds-button-button-8fa00f0f svg {
25
- overflow: visible;
26
- }
27
-
28
- .fds-button-small-8fa00f0f::before {
29
- position: absolute;
30
- top: 0;
31
- left: 0;
32
- width: auto;
33
- min-height: auto;
34
- content: '';
35
- }
36
-
37
- .fds-button-small-8fa00f0f::after {
38
- position: absolute;
39
- top: -5px;
40
- left: 0;
41
- width: 100%;
42
- height: 44px;
43
- content: '';
44
- }
45
-
46
- .fds-button-button-8fa00f0f:disabled,
47
- .fds-button-button-8fa00f0f[aria-disabled='true'] {
48
- cursor: not-allowed;
49
- opacity: var(--fds-opacity-disabled);
50
- }
51
-
52
- .fds-button-small-8fa00f0f {
53
- --fc-button-padding: 0 var(--fds-spacing-3);
54
-
55
- gap: var(--fds-sizing-1);
56
- font: var(--fds-typography-paragraph-short-small);
57
- font-family: inherit;
58
- min-height: var(--fds-sizing-10);
59
- }
60
-
61
- .fds-button-medium-8fa00f0f {
62
- --fc-button-padding: 0 var(--fds-spacing-4);
63
-
64
- gap: var(--fds-sizing-2);
65
- font: var(--fds-typography-paragraph-short-medium);
66
- font-family: inherit;
67
- min-height: var(--fds-sizing-12);
68
- }
69
-
70
- .fds-button-large-8fa00f0f {
71
- --fc-button-padding: 0 var(--fds-spacing-5);
72
-
73
- gap: var(--fds-sizing-2);
74
- font: var(--fds-typography-paragraph-short-large);
75
- font-family: inherit;
76
- min-height: var(--fds-sizing-14);
77
- }
78
-
79
- .fds-button-fullWidth-8fa00f0f {
80
- width: 100%;
81
- }
82
-
83
- .fds-button-secondary-8fa00f0f,
84
- .fds-button-tertiary-8fa00f0f {
85
- background-color: transparent;
86
- }
87
-
88
- .fds-button-onlyIcon-8fa00f0f {
89
- --fc-button-padding: 0;
90
- }
91
-
92
- /* Only use hover for non-touch devices to prevent sticky-hovering */
93
- @media (hover: hover) and (pointer: fine) {
94
- .fds-button-primary-8fa00f0f:where(.fds-button-first-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
95
- background-color: var(--fds-semantic-surface-action-first-hover);
96
- }
97
-
98
- .fds-button-primary-8fa00f0f:where(.fds-button-second-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
99
- background-color: var(--fds-semantic-surface-action-second-hover);
100
- }
101
-
102
- .fds-button-primary-8fa00f0f:where(.fds-button-success-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
103
- background-color: var(--fds-semantic-surface-success-hover);
104
- }
105
-
106
- .fds-button-primary-8fa00f0f:where(.fds-button-danger-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
107
- background-color: var(--fds-semantic-surface-danger-hover);
108
- }
109
-
110
- .fds-button-secondary-8fa00f0f:where(.fds-button-first-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
111
- --fc-button-color: var(--fds-semantic-text-action-first-hover);
112
-
113
- border-color: var(--fds-semantic-border-action-first-hover);
114
- background-color: var(--fds-semantic-surface-action-first-no_fill-hover);
115
- }
116
-
117
- .fds-button-secondary-8fa00f0f:where(.fds-button-second-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
118
- --fc-button-color: var(--fds-semantic-text-action-second-hover);
119
-
120
- border-color: var(--fds-semantic-border-action-second-hover);
121
- background-color: var(--fds-semantic-surface-action-second-no_fill-hover);
122
- }
123
-
124
- .fds-button-secondary-8fa00f0f:where(.fds-button-success-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
125
- --fc-button-color: var(--fds-semantic-text-success-hover);
126
-
127
- border-color: var(--fds-semantic-border-success-hover);
128
- background-color: var(--fds-semantic-surface-success-no_fill-hover);
129
- }
130
-
131
- .fds-button-secondary-8fa00f0f:where(.fds-button-danger-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
132
- --fc-button-color: var(--fds-semantic-text-danger-hover);
133
-
134
- border-color: var(--fds-semantic-border-danger-hover);
135
- background-color: var(--fds-semantic-surface-danger-no_fill-hover);
136
- }
137
-
138
- .fds-button-tertiary-8fa00f0f:where(.fds-button-first-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
139
- --fc-button-color: var(--fds-semantic-text-action-first-hover);
140
-
141
- background-color: var(--fds-semantic-surface-action-first-no_fill-hover);
142
- }
143
-
144
- .fds-button-tertiary-8fa00f0f:where(.fds-button-second-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
145
- --fc-button-color: var(--fds-semantic-text-action-second-hover);
146
-
147
- background-color: var(--fds-semantic-surface-action-second-no_fill-hover);
148
- }
149
-
150
- .fds-button-tertiary-8fa00f0f:where(.fds-button-success-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
151
- --fc-button-color: var(--fds-semantic-text-success-hover);
152
-
153
- background-color: var(--fds-semantic-surface-success-no_fill-hover);
154
- }
155
-
156
- .fds-button-tertiary-8fa00f0f:where(.fds-button-danger-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
157
- --fc-button-color: var(--fds-semantic-text-danger-hover);
158
-
159
- background-color: var(--fds-semantic-surface-danger-no_fill-hover);
160
- }
161
- }
162
-
163
- /* Primary button colors */
164
- .fds-button-primary-8fa00f0f:where(.fds-button-first-8fa00f0f) {
165
- background-color: var(--fds-semantic-surface-action-first-default);
166
- }
167
-
168
- .fds-button-primary-8fa00f0f:where(.fds-button-second-8fa00f0f) {
169
- background-color: var(--fds-semantic-surface-action-second-default);
170
- }
171
-
172
- .fds-button-primary-8fa00f0f:where(.fds-button-success-8fa00f0f) {
173
- background-color: var(--fds-semantic-surface-success-default);
174
- }
175
-
176
- .fds-button-primary-8fa00f0f:where(.fds-button-danger-8fa00f0f) {
177
- background-color: var(--fds-semantic-surface-danger-default);
178
- }
179
-
180
- .fds-button-primary-8fa00f0f:where(.fds-button-first-8fa00f0f):not([aria-disabled='true'], :disabled):active {
181
- background-color: var(--fds-semantic-surface-action-first-active);
182
- }
183
-
184
- .fds-button-primary-8fa00f0f:where(.fds-button-second-8fa00f0f):not([aria-disabled='true'], :disabled):active {
185
- background-color: var(--fds-semantic-surface-action-second-active);
186
- }
187
-
188
- .fds-button-primary-8fa00f0f:where(.fds-button-success-8fa00f0f):not([aria-disabled='true'], :disabled):active {
189
- background-color: var(--fds-semantic-surface-success-active);
190
- }
191
-
192
- .fds-button-primary-8fa00f0f:where(.fds-button-danger-8fa00f0f):not([aria-disabled='true'], :disabled):active {
193
- background-color: var(--fds-semantic-surface-danger-active);
194
- }
195
-
196
- /* Secondary button colors */
197
- .fds-button-secondary-8fa00f0f:where(.fds-button-first-8fa00f0f) {
198
- --fc-button-color: var(--fds-semantic-text-action-first-default);
199
-
200
- border-color: var(--fds-semantic-border-action-first-default);
201
- background-color: var(--fds-semantic-surface-action-first-no_fill);
202
- }
203
-
204
- .fds-button-secondary-8fa00f0f:where(.fds-button-second-8fa00f0f) {
205
- --fc-button-color: var(--fds-semantic-text-action-second-default);
206
-
207
- border-color: var(--fds-semantic-border-action-second-default);
208
- background-color: var(--fds-semantic-surface-action-second-no_fill);
209
- }
210
-
211
- .fds-button-secondary-8fa00f0f:where(.fds-button-success-8fa00f0f) {
212
- --fc-button-color: var(--fds-semantic-text-success-default);
213
-
214
- border-color: var(--fds-semantic-border-success-default);
215
- background-color: var(--fds-semantic-surface-success-no_fill);
216
- }
217
-
218
- .fds-button-secondary-8fa00f0f:where(.fds-button-danger-8fa00f0f) {
219
- --fc-button-color: var(--fds-semantic-text-danger-default);
220
-
221
- border-color: var(--fds-semantic-border-danger-default);
222
- background-color: var(--fds-semantic-surface-danger-no_fill);
223
- }
224
-
225
- .fds-button-secondary-8fa00f0f:where(.fds-button-first-8fa00f0f):not([aria-disabled='true'], :disabled):active {
226
- --fc-button-color: var(--fds-semantic-text-action-first-active);
227
-
228
- border-color: var(--fds-semantic-border-action-first-active);
229
- background-color: var(--fds-semantic-surface-action-first-no_fill-active);
230
- }
231
-
232
- .fds-button-secondary-8fa00f0f:where(.fds-button-second-8fa00f0f):not([aria-disabled='true'], :disabled):active {
233
- --fc-button-color: var(--fds-semantic-text-action-second-active);
234
-
235
- border-color: var(--fds-semantic-border-action-second-active);
236
- background-color: var(--fds-semantic-surface-action-second-no_fill-active);
237
- }
238
-
239
- .fds-button-secondary-8fa00f0f:where(.fds-button-success-8fa00f0f):not([aria-disabled='true'], :disabled):active {
240
- --fc-button-color: var(--fds-semantic-text-success-active);
241
-
242
- border-color: var(--fds-semantic-border-success-active);
243
- background-color: var(--fds-semantic-surface-success-no_fill-active);
244
- }
245
-
246
- .fds-button-secondary-8fa00f0f:where(.fds-button-danger-8fa00f0f):not([aria-disabled='true'], :disabled):active {
247
- --fc-button-color: var(--fds-semantic-text-danger-active);
248
-
249
- border-color: var(--fds-semantic-border-danger-active);
250
- background-color: var(--fds-semantic-surface-danger-no_fill-active);
251
- }
252
-
253
- /* Tertiary button colors */
254
- .fds-button-tertiary-8fa00f0f:where(.fds-button-first-8fa00f0f) {
255
- --fc-button-color: var(--fds-semantic-text-action-first-default);
256
- }
257
-
258
- .fds-button-tertiary-8fa00f0f:where(.fds-button-second-8fa00f0f) {
259
- --fc-button-color: var(--fds-semantic-text-action-second-default);
260
- }
261
-
262
- .fds-button-tertiary-8fa00f0f:where(.fds-button-success-8fa00f0f) {
263
- --fc-button-color: var(--fds-semantic-text-success-default);
264
- }
265
-
266
- .fds-button-tertiary-8fa00f0f:where(.fds-button-danger-8fa00f0f) {
267
- --fc-button-color: var(--fds-semantic-text-danger-default);
268
- }
269
-
270
- .fds-button-tertiary-8fa00f0f:where(.fds-button-first-8fa00f0f):not([aria-disabled='true'], :disabled):active {
271
- --fc-button-color: var(--fds-semantic-text-action-first-active);
272
-
273
- background-color: var(--fds-semantic-surface-action-first-no_fill-active);
274
- }
275
-
276
- .fds-button-tertiary-8fa00f0f:where(.fds-button-second-8fa00f0f):not([aria-disabled='true'], :disabled):active {
277
- --fc-button-color: var(--fds-semantic-text-action-second-active);
278
-
279
- background-color: var(--fds-semantic-surface-action-second-no_fill-active);
280
- }
281
-
282
- .fds-button-tertiary-8fa00f0f:where(.fds-button-success-8fa00f0f):not([aria-disabled='true'], :disabled):active {
283
- --fc-button-color: var(--fds-semantic-text-success-active);
284
-
285
- background-color: var(--fds-semantic-surface-success-no_fill-active);
286
- }
287
-
288
- .fds-button-tertiary-8fa00f0f:where(.fds-button-danger-8fa00f0f):not([aria-disabled='true'], :disabled):active {
289
- --fc-button-color: var(--fds-semantic-text-danger-active);
290
-
291
- background-color: var(--fds-semantic-surface-danger-no_fill-active);
292
- }
293
- }
294
-
295
1
  @layer fds.paragraph {
296
2
  .fds-paragraph-paragraph-b69df5f3 {
297
3
  --fdsc-bottom-spacing: var(--fds-spacing-5);
@@ -1360,27 +1066,6 @@
1360
1066
  }
1361
1067
  }
1362
1068
 
1363
- @layer fds.skiplink {
1364
- .fds-skiplink-skiplink-d4abeaef:focus {
1365
- display: block;
1366
- outline: 0;
1367
- position: static;
1368
- width: auto;
1369
- height: auto;
1370
- margin: inherit;
1371
- overflow: visible;
1372
- clip: auto;
1373
- clip-path: none;
1374
- white-space: inherit;
1375
- text-decoration: underline;
1376
- text-decoration-thickness: 3px;
1377
- text-underline-offset: 0.3em;
1378
- padding: var(--fds-spacing-3) var(--fds-spacing-4) var(--fds-spacing-3) var(--fds-spacing-6);
1379
- color: var(--fds-semantic-text-neutral-default);
1380
- background: var(--fds-semantic-border-focus-outline);
1381
- }
1382
- }
1383
-
1384
1069
  @layer fds.tooltip {
1385
1070
  .fds-tooltip-wrapper-a3778147 {
1386
1071
  background: var(--fds-semantic-surface-neutral-inverted);
@@ -10,6 +10,12 @@ export type AlertProps = {
10
10
  * Use this to inform screenreaders of severity.
11
11
  * Defaults to Norwegian. */
12
12
  iconTitle?: string;
13
+ /** Sets the size of the alert.
14
+ * Does not affect font size.
15
+ *
16
+ * @default 'medium'
17
+ */
18
+ size?: 'small' | 'medium' | 'large';
13
19
  } & HTMLAttributes<HTMLDivElement>;
14
20
  export declare const Alert: import("react").ForwardRefExoticComponent<{
15
21
  /** Sets color & icon according to severity */
@@ -21,6 +27,12 @@ export declare const Alert: import("react").ForwardRefExoticComponent<{
21
27
  * Use this to inform screenreaders of severity.
22
28
  * Defaults to Norwegian. */
23
29
  iconTitle?: string | undefined;
30
+ /** Sets the size of the alert.
31
+ * Does not affect font size.
32
+ *
33
+ * @default 'medium'
34
+ */
35
+ size?: "small" | "medium" | "large" | undefined;
24
36
  } & HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
25
37
  export {};
26
38
  //# sourceMappingURL=Alert.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../../src/components/Alert/Alert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AA4B5C,KAAK,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE1D,MAAM,MAAM,UAAU,GAAG;IACvB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;iCAG6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEnC,eAAO,MAAM,KAAK;IAXhB,8CAA8C;;IAE9C,6CAA6C;;IAE7C;;;iCAG6B;;mFAqC9B,CAAC"}
1
+ {"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../../src/components/Alert/Alert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AA4B5C,KAAK,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE1D,MAAM,MAAM,UAAU,GAAG;IACvB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;iCAG6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;CACrC,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AACnC,eAAO,MAAM,KAAK;IAhBhB,8CAA8C;;IAE9C,6CAA6C;;IAE7C;;;iCAG6B;;IAE7B;;;;OAIG;;mFA8CJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAIlD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAI7E,MAAM,MAAM,WAAW,GAAG;IACxB,mCAAmC;IACnC,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;IAC/C,yCAAyC;IACzC,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;IAClD,WAAW;IACX,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,0DAA0D;IAC1D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAE5C;;GAEG;AACH,eAAO,MAAM,MAAM,EAAE,oBAAoB,CAAC,WAAW,EAAE,iBAAiB,CAwCrE,CAAC"}
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAIlD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAE7E,MAAM,MAAM,WAAW,GAAG;IACxB,mCAAmC;IACnC,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;IAC/C,yCAAyC;IACzC,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;IAClD,WAAW;IACX,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,0DAA0D;IAC1D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAE5C;;GAEG;AACH,eAAO,MAAM,MAAM,EAAE,oBAAoB,CAAC,WAAW,EAAE,iBAAiB,CAwCrE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SkipLink.d.ts","sourceRoot":"","sources":["../../../../src/components/SkipLink/SkipLink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAK7D,MAAM,MAAM,aAAa,GAAG;IAC1B,kDAAkD;IAClD,QAAQ,EAAE,SAAS,CAAC;IAEpB,mFAAmF;IACnF,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAE5C,eAAO,MAAM,QAAQ;6CAKlB,aAAa,GAAG,WAAW;;CAU7B,CAAC"}
1
+ {"version":3,"file":"SkipLink.d.ts","sourceRoot":"","sources":["../../../../src/components/SkipLink/SkipLink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG7D,MAAM,MAAM,aAAa,GAAG;IAC1B,kDAAkD;IAClD,QAAQ,EAAE,SAAS,CAAC;IAEpB,mFAAmF;IACnF,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAE5C,eAAO,MAAM,QAAQ;6CAKlB,aAAa,GAAG,WAAW;;CAU7B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digdir/designsystemet-react",
3
- "version": "0.58.0",
3
+ "version": "0.59.0",
4
4
  "description": "React components for Designsystemet",
5
5
  "author": "Designsystemet team",
6
6
  "repository": "https://github.com/digdir/designsystemet",
@@ -43,5 +43,5 @@
43
43
  "rollup": "^4.12.1",
44
44
  "typescript": "^5.4.2"
45
45
  },
46
- "gitHead": "a1ead4651e04770749e1d74f98db0fc093d78a34"
46
+ "gitHead": "aeed6074c31e5e21c7ca9e83a883fe87cd1111d5"
47
47
  }
@@ -1,6 +0,0 @@
1
- 'use client';
2
- 'use strict';
3
-
4
- var classes = {"button":"fds-button-button-8fa00f0f","small":"fds-button-small-8fa00f0f","medium":"fds-button-medium-8fa00f0f","large":"fds-button-large-8fa00f0f","fullWidth":"fds-button-fullWidth-8fa00f0f","secondary":"fds-button-secondary-8fa00f0f","tertiary":"fds-button-tertiary-8fa00f0f","onlyIcon":"fds-button-onlyIcon-8fa00f0f","primary":"fds-button-primary-8fa00f0f","first":"fds-button-first-8fa00f0f","second":"fds-button-second-8fa00f0f","success":"fds-button-success-8fa00f0f","danger":"fds-button-danger-8fa00f0f"};
5
-
6
- module.exports = classes;
@@ -1,6 +0,0 @@
1
- 'use client';
2
- 'use strict';
3
-
4
- var classes = {"skiplink":"fds-skiplink-skiplink-d4abeaef"};
5
-
6
- module.exports = classes;
@@ -1,4 +0,0 @@
1
- 'use client';
2
- var classes = {"button":"fds-button-button-8fa00f0f","small":"fds-button-small-8fa00f0f","medium":"fds-button-medium-8fa00f0f","large":"fds-button-large-8fa00f0f","fullWidth":"fds-button-fullWidth-8fa00f0f","secondary":"fds-button-secondary-8fa00f0f","tertiary":"fds-button-tertiary-8fa00f0f","onlyIcon":"fds-button-onlyIcon-8fa00f0f","primary":"fds-button-primary-8fa00f0f","first":"fds-button-first-8fa00f0f","second":"fds-button-second-8fa00f0f","success":"fds-button-success-8fa00f0f","danger":"fds-button-danger-8fa00f0f"};
3
-
4
- export { classes as default };
@@ -1,4 +0,0 @@
1
- 'use client';
2
- var classes = {"skiplink":"fds-skiplink-skiplink-d4abeaef"};
3
-
4
- export { classes as default };