@politiet/sheriff-web-components 2.13.0 → 2.14.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 (139) hide show
  1. package/custom-elements.json +3996 -1344
  2. package/dist/controllers/index.d.ts +3 -0
  3. package/dist/controllers/index.d.ts.map +1 -0
  4. package/dist/controllers/index.js +3 -0
  5. package/dist/controllers/index.js.map +1 -0
  6. package/dist/controllers/sds-drag-drop-controller.d.ts +25 -0
  7. package/dist/controllers/sds-drag-drop-controller.d.ts.map +1 -0
  8. package/dist/controllers/sds-drag-drop-controller.js +52 -0
  9. package/dist/controllers/sds-drag-drop-controller.js.map +1 -0
  10. package/dist/controllers/sds-file-preview-controller.d.ts +38 -0
  11. package/dist/controllers/sds-file-preview-controller.d.ts.map +1 -0
  12. package/dist/controllers/sds-file-preview-controller.js +90 -0
  13. package/dist/controllers/sds-file-preview-controller.js.map +1 -0
  14. package/dist/frameworks/preact.d.ts +14 -1
  15. package/dist/frameworks/preact.d.ts.map +1 -1
  16. package/dist/frameworks/react.d.ts +30 -1
  17. package/dist/frameworks/react.d.ts.map +1 -1
  18. package/dist/frameworks/solidjs.d.ts +4 -0
  19. package/dist/frameworks/solidjs.d.ts.map +1 -1
  20. package/dist/frameworks/svelte.d.ts +4 -0
  21. package/dist/frameworks/svelte.d.ts.map +1 -1
  22. package/dist/frameworks/vue.d.ts +24 -1
  23. package/dist/frameworks/vue.d.ts.map +1 -1
  24. package/dist/index.d.ts +8 -0
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +4 -0
  27. package/dist/index.js.map +1 -1
  28. package/dist/mixins/sds-dialog-target-mixin.d.ts.map +1 -1
  29. package/dist/mixins/sds-dialog-target-mixin.js +10 -0
  30. package/dist/mixins/sds-dialog-target-mixin.js.map +1 -1
  31. package/dist/react-wrappers/SDSDialogWrapper.d.ts +1 -0
  32. package/dist/react-wrappers/SDSDialogWrapper.d.ts.map +1 -1
  33. package/dist/react-wrappers/SDSDialogWrapper.js +1 -0
  34. package/dist/react-wrappers/SDSDialogWrapper.js.map +1 -1
  35. package/dist/react-wrappers/SDSFileUploadFileListWrapper.d.ts +3 -0
  36. package/dist/react-wrappers/SDSFileUploadFileListWrapper.d.ts.map +1 -0
  37. package/dist/react-wrappers/SDSFileUploadFileListWrapper.js +10 -0
  38. package/dist/react-wrappers/SDSFileUploadFileListWrapper.js.map +1 -0
  39. package/dist/react-wrappers/SDSFileUploadItemWrapper.d.ts +6 -0
  40. package/dist/react-wrappers/SDSFileUploadItemWrapper.d.ts.map +1 -0
  41. package/dist/react-wrappers/SDSFileUploadItemWrapper.js +12 -0
  42. package/dist/react-wrappers/SDSFileUploadItemWrapper.js.map +1 -0
  43. package/dist/react-wrappers/SDSFileUploadWrapper.d.ts +12 -0
  44. package/dist/react-wrappers/SDSFileUploadWrapper.d.ts.map +1 -0
  45. package/dist/react-wrappers/SDSFileUploadWrapper.js +18 -0
  46. package/dist/react-wrappers/SDSFileUploadWrapper.js.map +1 -0
  47. package/dist/react-wrappers/SDSSearchWrapper.d.ts +15 -0
  48. package/dist/react-wrappers/SDSSearchWrapper.d.ts.map +1 -0
  49. package/dist/react-wrappers/SDSSearchWrapper.js +19 -0
  50. package/dist/react-wrappers/SDSSearchWrapper.js.map +1 -0
  51. package/dist/react-wrappers/index.d.ts +4 -0
  52. package/dist/react-wrappers/index.d.ts.map +1 -1
  53. package/dist/react-wrappers/index.js +4 -0
  54. package/dist/react-wrappers/index.js.map +1 -1
  55. package/dist/sds-button/sds-button.component.d.ts +0 -1
  56. package/dist/sds-button/sds-button.component.d.ts.map +1 -1
  57. package/dist/sds-button/sds-button.component.js +10 -16
  58. package/dist/sds-button/sds-button.component.js.map +1 -1
  59. package/dist/sds-button/sds-button.styles.d.ts.map +1 -1
  60. package/dist/sds-button/sds-button.styles.js +7 -2
  61. package/dist/sds-button/sds-button.styles.js.map +1 -1
  62. package/dist/sds-dialog/sds-dialog.component.d.ts.map +1 -1
  63. package/dist/sds-dialog/sds-dialog.component.js +11 -1
  64. package/dist/sds-dialog/sds-dialog.component.js.map +1 -1
  65. package/dist/sds-file-upload/sds-file-upload.d.ts +102 -0
  66. package/dist/sds-file-upload/sds-file-upload.d.ts.map +1 -0
  67. package/dist/sds-file-upload/sds-file-upload.js +384 -0
  68. package/dist/sds-file-upload/sds-file-upload.js.map +1 -0
  69. package/dist/sds-file-upload/sds-file-upload.styles.d.ts +2 -0
  70. package/dist/sds-file-upload/sds-file-upload.styles.d.ts.map +1 -0
  71. package/dist/sds-file-upload/sds-file-upload.styles.js +234 -0
  72. package/dist/sds-file-upload/sds-file-upload.styles.js.map +1 -0
  73. package/dist/sds-file-upload-file-list/sds-file-upload-file-list.d.ts +14 -0
  74. package/dist/sds-file-upload-file-list/sds-file-upload-file-list.d.ts.map +1 -0
  75. package/dist/sds-file-upload-file-list/sds-file-upload-file-list.js +26 -0
  76. package/dist/sds-file-upload-file-list/sds-file-upload-file-list.js.map +1 -0
  77. package/dist/sds-file-upload-file-list/sds-file-upload-file-list.styles.d.ts +2 -0
  78. package/dist/sds-file-upload-file-list/sds-file-upload-file-list.styles.d.ts.map +1 -0
  79. package/dist/sds-file-upload-file-list/sds-file-upload-file-list.styles.js +19 -0
  80. package/dist/sds-file-upload-file-list/sds-file-upload-file-list.styles.js.map +1 -0
  81. package/dist/sds-file-upload-item/assets/u-progress.js +2 -0
  82. package/dist/sds-file-upload-item/sds-file-upload-item.d.ts +62 -0
  83. package/dist/sds-file-upload-item/sds-file-upload-item.d.ts.map +1 -0
  84. package/dist/sds-file-upload-item/sds-file-upload-item.js +205 -0
  85. package/dist/sds-file-upload-item/sds-file-upload-item.js.map +1 -0
  86. package/dist/sds-file-upload-item/sds-file-upload-item.styles.d.ts +2 -0
  87. package/dist/sds-file-upload-item/sds-file-upload-item.styles.d.ts.map +1 -0
  88. package/dist/sds-file-upload-item/sds-file-upload-item.styles.js +227 -0
  89. package/dist/sds-file-upload-item/sds-file-upload-item.styles.js.map +1 -0
  90. package/dist/sds-radio/sds-radio.d.ts +53 -1
  91. package/dist/sds-radio/sds-radio.d.ts.map +1 -1
  92. package/dist/sds-radio/sds-radio.js +218 -41
  93. package/dist/sds-radio/sds-radio.js.map +1 -1
  94. package/dist/sds-radio/sds-radio.styles.js +36 -36
  95. package/dist/sds-radio/sds-radio.styles.js.map +1 -1
  96. package/dist/sds-radio-group/sds-radio-group.d.ts +4 -2
  97. package/dist/sds-radio-group/sds-radio-group.d.ts.map +1 -1
  98. package/dist/sds-radio-group/sds-radio-group.js +10 -3
  99. package/dist/sds-radio-group/sds-radio-group.js.map +1 -1
  100. package/dist/sds-search/sds-search.component.d.ts +128 -0
  101. package/dist/sds-search/sds-search.component.d.ts.map +1 -0
  102. package/dist/sds-search/sds-search.component.js +345 -0
  103. package/dist/sds-search/sds-search.component.js.map +1 -0
  104. package/dist/sds-search/sds-search.d.ts +13 -0
  105. package/dist/sds-search/sds-search.d.ts.map +1 -0
  106. package/dist/sds-search/sds-search.js +18 -0
  107. package/dist/sds-search/sds-search.js.map +1 -0
  108. package/dist/sds-search/sds-search.styles.d.ts +2 -0
  109. package/dist/sds-search/sds-search.styles.d.ts.map +1 -0
  110. package/dist/sds-search/sds-search.styles.js +74 -0
  111. package/dist/sds-search/sds-search.styles.js.map +1 -0
  112. package/dist/sds-textfield/sds-textfield.component.d.ts +4 -1
  113. package/dist/sds-textfield/sds-textfield.component.d.ts.map +1 -1
  114. package/dist/sds-textfield/sds-textfield.component.js +20 -5
  115. package/dist/sds-textfield/sds-textfield.component.js.map +1 -1
  116. package/dist/sds-textfield/sds-textfield.styles.d.ts.map +1 -1
  117. package/dist/sds-textfield/sds-textfield.styles.js +11 -0
  118. package/dist/sds-textfield/sds-textfield.styles.js.map +1 -1
  119. package/dist/sheriff-web-components.js +1104 -375
  120. package/dist/skill/SKILL.md +136 -42
  121. package/dist/skill/references/components.md +332 -35
  122. package/dist/skill/references/react-wrappers.md +41 -9
  123. package/dist/utils/file-validation.d.ts +31 -0
  124. package/dist/utils/file-validation.d.ts.map +1 -0
  125. package/dist/utils/file-validation.js +57 -0
  126. package/dist/utils/file-validation.js.map +1 -0
  127. package/dist/utils/format-bytes.d.ts +6 -0
  128. package/dist/utils/format-bytes.d.ts.map +1 -0
  129. package/dist/utils/format-bytes.js +13 -0
  130. package/dist/utils/format-bytes.js.map +1 -0
  131. package/dist/utils/video-thumbnail.d.ts +8 -0
  132. package/dist/utils/video-thumbnail.d.ts.map +1 -0
  133. package/dist/utils/video-thumbnail.js +77 -0
  134. package/dist/utils/video-thumbnail.js.map +1 -0
  135. package/dist/version.d.ts +1 -1
  136. package/dist/version.js +1 -1
  137. package/dist/version.js.map +1 -1
  138. package/package.json +24 -4
  139. package/web-types.json +3452 -1048
@@ -1,6 +1,14 @@
1
1
  # Component Reference
2
2
 
3
- Full API for each SDS web component. All components support `size` (`"lg"` | `"md"` | `"sm"`, default `"md"`) unless noted otherwise.
3
+ Full API for each SDS web component.
4
+
5
+ Sizes used by components are `"lg"` | `"md"` | `"sm"` with default `"md"`, except:
6
+
7
+ - `sds-button` — defaults to `"lg"`
8
+ - `sds-heading` / `sds-text` — use `"xl" | "lg" | "md" | "sm" | "xs"`
9
+ - `sds-icon` — `"sm" | "md" | "lg"`
10
+
11
+ `data-palette` works on every component and inherits from ancestor containers. Exceptions: `sds-alert` (own typed property, must be set on the element), `sds-tooltip` and `sds-environment-banner` (no palette support). See the `@politiet/sheriff-css-framework` skill for palette values.
4
12
 
5
13
  ---
6
14
 
@@ -33,9 +41,10 @@ Contextual alert/message banner. Source: `sds-alert.component.ts`.
33
41
  </sds-alert>
34
42
  ```
35
43
 
36
- **Props:** `variant` (`"primary"` | `"secondary"`, default `"primary"`), `size` (`"lg"` | `"md"` | `"sm"`), `removable-label` (string — shows close button on primary variant), `data-palette` (`"info"` | `"success"` | `"attention"` | `"danger"`, default `"info"`)
44
+ **Props:** `variant` (`"primary"` | `"secondary"`, default `"primary"`), `size` (`"lg"` | `"md"` | `"sm"`, default `"md"`), `removable-label` (string — shows close button, **primary variant only**), `data-palette` (`"info"` | `"success"` | `"attention"` | `"danger"`, default `"info"`)
37
45
  **Slots:** `title` (heading element), `message` (`<p>`)
38
46
  **Events:** `sds-remove` (close button clicked)
47
+ **Note:** `data-palette` also selects the status icon (info → `InformationSquareFill-aksel-filled`, success → `check_circle-material-filled`, attention → `warning-material-filled`, danger → `dangerous-material-filled`). Because it is a typed property rather than plain CSS, it must be set on the `sds-alert` itself — an ancestor `data-palette` will not reach it, and `warning` is not a valid value here.
39
48
 
40
49
  ---
41
50
 
@@ -49,9 +58,9 @@ Button or link-styled-as-button. Source: `sds-button.component.ts`.
49
58
  <sds-button variant="tertiary">Learn more</sds-button>
50
59
  <sds-button href="https://example.com" target="_blank">Visit site</sds-button>
51
60
 
52
- <!-- Icon-only -->
53
- <sds-button variant="primary" icon>
54
- <sds-icon name="search-material-outlined" label="Search"></sds-icon>
61
+ <!-- Icon-only: accessible name via `label` on the button -->
62
+ <sds-button variant="primary" icon label="Search">
63
+ <sds-icon name="search-material-outlined"></sds-icon>
55
64
  </sds-button>
56
65
 
57
66
  <!-- With leading/trailing icons -->
@@ -67,12 +76,20 @@ Button or link-styled-as-button. Source: `sds-button.component.ts`.
67
76
 
68
77
  <sds-button variant="primary" loading>Saving...</sds-button>
69
78
  <sds-button variant="primary" type="submit">Submit</sds-button>
79
+
80
+ <!-- On a dark or palette-coloured surface -->
81
+ <div class="sds-color-accent-action-default sds-spacing-p-md">
82
+ <sds-button inverted>Inverted</sds-button>
83
+ </div>
70
84
  ```
71
85
 
72
- **Props:** `variant` (`"primary"` | `"secondary"` | `"tertiary"`, default `"primary"`), `size` (`"lg"` | `"md"` | `"sm"`, default `"lg"`), `type` (`"button"` | `"submit"` | `"reset"`, default `"button"`), `disabled`, `loading`, `icon` (compact icon-only mode), `href`, `target`, `name`, `value`, `form`
86
+ **Props:** `variant` (`"primary"` | `"secondary"` | `"tertiary"`, default `"primary"`), `size` (`"lg"` | `"md"` | `"sm"`, default `"lg"`), `type` (`"button"` | `"submit"` | `"reset"`, default `"button"`), `disabled`, `loading`, `icon` (compact icon-only mode), `inverted` (for dark/coloured backgrounds), `label` (sets `aria-label` on the internal button — use for icon-only buttons), `href`, `target`, `name`, `value`, `form`
87
+ **Dialog targeting:** `command` (`"show-modal"` | `"close"` | `"request-close"`) + `commandfor` (dialog `id`). Legacy aliases `data-command` / `data-commandfor` also work.
88
+ **Popover targeting:** `popovertarget` (popover `id`), `popovertargetaction` (`"show"` | `"hide"` | `"toggle"`)
73
89
  **Slots:** default (label), `before`, `after`
74
90
  **Events:** `click`, `submit`, `reset`
75
91
  **Danger pattern:** `<sds-button variant="primary" data-palette="danger">Delete</sds-button>`
92
+ **Notes:** Form-associated. When `href` is set the component renders an `<a>` instead of a `<button>`, so `type`, `disabled`, `loading`, and `label` do not apply. `loading` replaces the `before` and `after` slots with a spinner.
76
93
 
77
94
  ---
78
95
 
@@ -93,8 +110,8 @@ Content container card. Renders as `<a>` with arrow icon when `link` is set.
93
110
  ```
94
111
 
95
112
  **Props:** `link` (URL — renders as anchor)
96
- **Slots:** `heading` (`<h2>`–`<h6>` only), `text` (`<p>` only, no nested elements)
97
- **Note:** Slots enforce strict content validation — use native heading/paragraph elements.
113
+ **Slots:** `heading` (one of `<h2>`–`<h6>`), `text` (`<p>` only, no nested elements)
114
+ **Note:** Slot content is validated on render — invalid content still renders but logs a `console.warn`. Use native heading/paragraph elements.
98
115
 
99
116
  ---
100
117
 
@@ -108,10 +125,17 @@ Single checkbox input.
108
125
  <sds-checkbox label="Remember me" name="remember" help-text="Stay logged in for 30 days"></sds-checkbox>
109
126
  <sds-checkbox label="Required option" name="required" error></sds-checkbox>
110
127
  <sds-checkbox label="Locked choice" name="locked" checked readonly></sds-checkbox>
128
+
129
+ <!-- Label with markup -->
130
+ <sds-checkbox name="terms">
131
+ <span slot="label">I accept the <a href="/terms">terms</a></span>
132
+ </sds-checkbox>
111
133
  ```
112
134
 
113
135
  **Props:** `label`, `name`, `value`, `checked`, `disabled`, `required`, `readonly`, `error` (boolean — use checkbox-group for text error messages), `help-text`, `size`
136
+ **Slots:** `label` (alternative to the `label` attribute)
114
137
  **Events:** `change`, `focus`, `blur`
138
+ **Note:** Form-associated. Setting `disabled` explicitly makes the checkbox self-controlled — a parent `sds-checkbox-group` will no longer override it.
115
139
 
116
140
  ---
117
141
 
@@ -154,11 +178,18 @@ Form-associated chip/pill. Two variants: `selectable` (toggle) and `removable` (
154
178
  Locked
155
179
  <sds-icon size="sm" name="lock-material-outlined"></sds-icon>
156
180
  </sds-chip>
181
+
182
+ <!-- Palette theming (works on the chip or any ancestor) -->
183
+ <sds-chip data-palette="danger" name="risk" value="high">High risk</sds-chip>
184
+ <div data-palette="success">
185
+ <sds-chip name="status" value="ok" checked>Approved</sds-chip>
186
+ </div>
157
187
  ```
158
188
 
159
- **Props:** `variant` (`"selectable"` | `"removable"`, default `"selectable"`), `checked`, `name`, `value`, `disabled`, `readonly`, `size`
189
+ **Props:** `variant` (`"selectable"` | `"removable"`, default `"selectable"`), `checked`, `name`, `value`, `disabled`, `readonly`, `size`, `data-palette`
160
190
  **Slots:** default (label, can include `sds-icon`)
161
191
  **Events:** `change` (selectable), `sds-remove` (removable)
192
+ **Note:** Form-associated — the chip submits `value` only while `checked`.
162
193
 
163
194
  ---
164
195
 
@@ -190,7 +221,41 @@ Expandable/collapsible accordion. Summary text is a slot.
190
221
 
191
222
  **Props:** `open`, `standalone` (rounded corners + border), `name` (exclusive accordion group)
192
223
  **Slots:** `summary` (always visible), default (expandable content)
193
- **Events:** `sds-toggle` (detail: `{ open: boolean }`)
224
+ **Events:** `toggle` (detail: `{ open: boolean }`) — **not** `sds-toggle`
225
+
226
+ ---
227
+
228
+ ## sds-details-group
229
+
230
+ Wraps sibling `sds-details` into one visually joined accordion. Set `name` to make the group exclusive — the group copies its `name` onto every child and closes the others when one opens.
231
+
232
+ ```html
233
+ <sds-details-group>
234
+ <sds-details>
235
+ <span slot="summary">Hva er Sheriff?</span>
236
+ <p>Sheriff er politiet sitt designsystem</p>
237
+ </sds-details>
238
+ <sds-details>
239
+ <span slot="summary">Hvordan kommer jeg i gang?</span>
240
+ <p>Start med å lese dokumentasjonen.</p>
241
+ </sds-details>
242
+ </sds-details-group>
243
+
244
+ <sds-details-group outlined name="faq">
245
+ <sds-details>
246
+ <span slot="summary">Question 1</span>
247
+ <p>Answer 1</p>
248
+ </sds-details>
249
+ <sds-details>
250
+ <span slot="summary">Question 2</span>
251
+ <p>Answer 2</p>
252
+ </sds-details>
253
+ </sds-details-group>
254
+ ```
255
+
256
+ **Props:** `outlined` (adds a border around the group), `name` (exclusive group — propagates to children)
257
+ **Slots:** default (`sds-details` children)
258
+ **Note:** Do not set `name` on the children when using a group `name`; the group overwrites it.
194
259
 
195
260
  ---
196
261
 
@@ -199,21 +264,105 @@ Expandable/collapsible accordion. Summary text is a slot.
199
264
  Modal/dialog wrapping native `<dialog>`.
200
265
 
201
266
  ```html
202
- <sds-dialog modal closedby="any">
267
+ <sds-button command="show-modal" commandfor="confirm">Delete…</sds-button>
268
+
269
+ <sds-dialog id="confirm" modal closedby="any">
203
270
  <sds-heading level="h2" size="md" slot="header">Confirm Action</sds-heading>
204
271
  <sds-text>Are you sure you want to proceed?</sds-text>
205
- <div slot="footer" style="display: flex; gap: var(--sds-spacing-2xs);">
206
- <sds-button size="md">Confirm</sds-button>
207
- <sds-button size="md" variant="secondary" data-command="close">Cancel</sds-button>
272
+ <div slot="footer" class="sds-stack-x-2xs">
273
+ <sds-button size="md" data-palette="danger">Confirm</sds-button>
274
+ <sds-button size="md" variant="secondary" command="close">Cancel</sds-button>
208
275
  </div>
209
276
  </sds-dialog>
210
277
  ```
211
278
 
212
- **Props:** `open`, `modal`, `closedby` (`"none"` | `"closerequest"` | `"any"`, default `"closerequest"`), `close-button-label` (default `"Lukk dialogvindu"`, empty string hides button)
279
+ **Props:** `open`, `modal`, `closedby` (`"none"` | `"closerequest"` | `"any"`, default `"closerequest"`), `close-button-label` (default `"Lukk dialogvindu"`, empty string hides the built-in close button)
213
280
  **Slots:** `header`, default (body), `footer`
214
- **Events:** `close`
215
- **Methods:** `show()`, `showModal()`, `close()`
216
- **Note:** `data-command="close"` on any inner button closes the dialog.
281
+ **Events:** `close`, `cancel` (fires before the dialog closes via ESC, outside click or `requestClose()`; call `preventDefault()` to keep it open). `sds-close` still fires but is **deprecated** — listening for it logs a console warning and it is removed in the next major.
282
+ **Methods:** `show()`, `showModal()` (also sets `modal`), `close()`, `requestClose()`
283
+ **Notes:**
284
+
285
+ - `command="close"` or `data-command="close"` on any button inside the dialog closes it, no `commandfor` needed.
286
+ - `command="show-modal"` requires `commandfor="{dialog id}"` and wires `aria-haspopup`/`aria-expanded`/`aria-controls` on the trigger.
287
+ - `closedby="any"` includes a Safari polyfill for outside clicks.
288
+ - An element in the default slot carrying `autofocus` receives focus once the open animation ends.
289
+ - `close` bubbles, so a listener on an outer dialog also receives it from a nested dialog. Check `event.target === event.currentTarget` when nesting. `cancel` does not bubble, matching the native event.
290
+
291
+ ---
292
+
293
+ ## sds-environment-banner
294
+
295
+ Thin strip identifying the running environment and build, for internal apps. Source: `sds-environment-banner.component.ts`.
296
+
297
+ ```html
298
+ <sds-environment-banner env="test" build="2026.9.1-rc3"></sds-environment-banner> <sds-environment-banner env="dev"></sds-environment-banner>
299
+ ```
300
+
301
+ **Props:** `env` (`"opplaering"` | `"local"` | `"dev"` | `"test"` | `"stage"` | `"prod"`), `build` (free-text build identifier)
302
+ **Slots:** none
303
+ **Note:** Renders the Norwegian label for `env` (`opplaering` → "Opplæring"). Colors are fixed per environment — `data-palette` has no effect. Both props are optional; omitting `env` hides the label and omitting `build` hides the build text.
304
+
305
+ ---
306
+
307
+ ## sds-file-upload
308
+
309
+ File picker with drag and drop and a built-in list of selected files. Form-associated. **Beta** — larger API changes may still happen.
310
+
311
+ ```html
312
+ <sds-file-upload name="attachments" multiple accept=".pdf,image/*" max-size-in-bytes="10485760" file-limitation-text="PDF eller bilde, maks 10 MB">
313
+ <span slot="label">Vedlegg</span>
314
+ </sds-file-upload>
315
+
316
+ <sds-file-upload name="cv" variant="compact" size="sm" required>
317
+ <span slot="label">CV</span>
318
+ </sds-file-upload>
319
+ ```
320
+
321
+ **Props:** `name`, `label`, `accept` (same syntax as native: extensions, `image/*`, exact MIME types), `multiple`, `required`, `disabled`, `max-size-in-bytes`, `help-text`, `error-message`, `file-limitation-text`, `hide-file-list`, `variant` (`"default"` | `"compact"`), `size`
322
+ **Slots:** `label` (alternative to the `label` attribute, wins if both are set). Without a label, the input is named "Velg fil" / "Velg filer".
323
+ **Events:**
324
+
325
+ - `input`, `change` — the accepted selection changed (picked, dropped, removed or cleared). `input` fires right before `change`.
326
+ - `cancel` — the user closed the file picker without choosing anything. Not cancelable.
327
+ - `focus`, `blur`
328
+ - `sds-reject` — detail `{ rejected: { file, reason, errorCode }[] }`, `errorCode` is `"type-mismatch"` | `"too-large"`. `reason` is a Norwegian message.
329
+ - `sds-preview-ready` — detail `{ file, url }`, fired when an image or video thumbnail is ready.
330
+
331
+ **Properties and methods:** `files` (`File[]`, read-only), `rejectedFiles` (`{ file, reason, errorCode }[]`, read-only), `value` (`C:\fakepath\…` of the first file; only `""` may be assigned, which clears, other values throw), `removeFile(file)`, `clear()`, `dismissRejected(file)`, `getPreviewUrl(file)`, `focus()`, `blur()`, `checkValidity()`, `reportValidity()`, `setCustomValidity(message)`
332
+ **Notes:**
333
+
334
+ - Behaves like `<input type="file">`: a single-file selection always replaces the previous one, even if the new file is rejected. The same goes for `multiple`: every new selection replaces the previous files. Duplicates within a selection (same name, size and last modified) are dropped.
335
+ - Submits every accepted file under `name` as `FormData`, or an empty `File` when nothing is selected, like native. There is no `value` attribute to set, and no `readonly`.
336
+ - Constraint errors (`required`) use the native validation bubble. `setCustomValidity(message)` sets `error-message`.
337
+ - Don't call `URL.revokeObjectURL` on URLs from `getPreviewUrl()` or `sds-preview-ready` — the component cleans them up.
338
+ - Rejected files show in the built-in list with "Feil ved opplasting" and the `reason` as the error message.
339
+
340
+ ### sds-file-upload-item
341
+
342
+ One file row: icon or thumbnail, name, size, a remove button and optional upload progress. Used by the built-in list, and for building your own list.
343
+
344
+ **Props:** `file` (file name), `size-in-bytes`, `error-message`, `preview` (image URL), `uploaded-percent` (shows a progress bar while set), `uploaded-size-in-bytes`, `disabled`, `for` (`id` of the owning `sds-file-upload`)
345
+ **Slots:** `actions-end` (extra buttons, placed before the remove button)
346
+ **Events:** `sds-remove` (cancelable) — fired when the remove button is pressed.
347
+ **Note:** Without `for`, listen for `sds-remove` and call `removeFile(file)` (or `dismissRejected(file)` for an item with `error-message`) on the upload yourself. With `for`, the item does that and removes itself from the DOM; `preventDefault()` on `sds-remove` cancels both. `disabled` doesn't reach buttons in `actions-end`, so disable those yourself, and include the file name in their labels (`label="Last ned rapport.pdf"`).
348
+
349
+ ### sds-file-upload-file-list
350
+
351
+ List container (`role="list"`) for `sds-file-upload-item` children. No props or events.
352
+
353
+ **Slots:** default (`sds-file-upload-item` children)
354
+
355
+ Custom file list — set `hide-file-list` on the upload and render the items yourself, for example to show upload progress:
356
+
357
+ ```html
358
+ <sds-file-upload id="docs" name="docs" multiple hide-file-list>
359
+ <span slot="label">Dokumenter</span>
360
+ </sds-file-upload>
361
+
362
+ <sds-file-upload-file-list>
363
+ <sds-file-upload-item for="docs" file="rapport.pdf" size-in-bytes="482133" uploaded-percent="40"></sds-file-upload-item>
364
+ </sds-file-upload-file-list>
365
+ ```
217
366
 
218
367
  ---
219
368
 
@@ -227,7 +376,7 @@ Semantic heading. Source: `sds-heading.component.ts`.
227
376
  <sds-heading level="h2" data-palette="accent">Accent heading</sds-heading>
228
377
  ```
229
378
 
230
- **Props:** `level` (`"h1"`–`"h6"`, default `"h1"`), `size` (`"xl"` | `"lg"` | `"md"` | `"sm"` | `"xs"` — visual override)
379
+ **Props:** `level` (`"h1"`–`"h6"`, default `"h1"`), `size` (`"xl"` | `"lg"` | `"md"` | `"sm"` | `"xs"` — visual override; `"l"`/`"m"`/`"s"` are deprecated v1 aliases)
231
380
  **Slots:** default
232
381
 
233
382
  ---
@@ -249,14 +398,38 @@ Dynamic SVG icon. Source: `sds-icon.component.ts`.
249
398
  </sds-icon>
250
399
  ```
251
400
 
252
- **Props:** `name` (`{icon}-{source}-{variant}`), `size` (`"sm"` | `"md"` | `"lg"`), `label` (sets `role="img"` + `aria-label`), `color`
401
+ **Props:** `name` (`{icon}-{source}-{variant}`; typed as `string`, not the `IconName` union), `size` (`"sm"` | `"md"` | `"lg"`; `"s"`/`"m"` are deprecated aliases), `label` (sets `role="img"` + `aria-label`; omit for decorative icons), `color` (any CSS color, applied inline)
253
402
  **Slots:** default (custom `<svg>` — use instead of `name`)
403
+ **Static methods:** `SDSIcon.setLoadLocal(boolean)`, `SDSIcon.registerResolver(fn)`
254
404
  **CSS vars:** `--sds-icon-size`, `--sds-icon-color`, `--sds-icon-display`
255
405
 
256
406
  For icon naming, loading, and resolvers, see `@politiet/sheriff-icons` package skill.
257
407
 
258
408
  ---
259
409
 
410
+ ## sds-internal-header
411
+
412
+ App header for internal (non-public) applications. Renders the internal Sheriff mark plus optional app name and two content slots. Source: `sds-internal-header.component.ts`.
413
+
414
+ ```html
415
+ <sds-internal-header app-name="Saksbehandling" home-href="/">
416
+ <nav slot="start">
417
+ <a href="/oversikt">Oversikt</a>
418
+ <a href="/oppgaver">Oppgaver</a>
419
+ </nav>
420
+ <div slot="end" class="sds-stack-x-3xs">
421
+ <sds-button inverted>Søk</sds-button>
422
+ <sds-button inverted variant="tertiary">Logg ut</sds-button>
423
+ </div>
424
+ </sds-internal-header>
425
+ ```
426
+
427
+ **Props:** `app-name` (title text), `home-href` (wraps the app name in a link to this URL)
428
+ **Slots:** `start` (primary navigation), `end` (actions / user menu)
429
+ **Note:** Renders a `<header>` internally, so do not wrap it in another `<header>`. Use `inverted` on nested `sds-button`s.
430
+
431
+ ---
432
+
260
433
  ## sds-loader
261
434
 
262
435
  Loading spinner with built-in `aria-label="Laster"`.
@@ -264,11 +437,18 @@ Loading spinner with built-in `aria-label="Laster"`.
264
437
  ```html
265
438
  <sds-loader></sds-loader>
266
439
  <sds-loader size="lg"></sds-loader>
267
- <sds-loader contrast></sds-loader>
268
- <sds-loader data-palette="accent"></sds-loader>
440
+
441
+ <!-- On a palette-coloured surface -->
442
+ <div data-palette="accent" class="sds-color-action-default sds-spacing-p-md">
443
+ <sds-loader></sds-loader>
444
+ </div>
445
+
446
+ <!-- Palette colours, plain background -->
447
+ <sds-loader data-palette="accent" contrast></sds-loader>
269
448
  ```
270
449
 
271
- **Props:** `size`, `contrast` (for colored backgrounds)
450
+ **Props:** `size`, `contrast`
451
+ **Note:** With `data-palette` the spinner switches to the palette's _contrast_ colour, i.e. it is meant to sit **on** a palette-coloured surface. Add `contrast` to flip it back to the palette's action colour for a plain background.
272
452
 
273
453
  ---
274
454
 
@@ -283,9 +463,71 @@ Loading spinner with built-in `aria-label="Laster"`.
283
463
  </sds-notification>
284
464
  ```
285
465
 
286
- **Props:** `variant` (`"info"` | `"success"` | `"attention"` | `"danger"`), `removable-label`
466
+ **Props:** `variant` (`"info"` | `"success"` | `"attention"` | `"danger"`, default `"info"`; `"warning"` and `"critical"` are deprecated aliases for `attention` and `danger`), `removable-label`
287
467
  **Slots:** `title`, `message`
288
468
  **Events:** `sds-remove`
469
+ **Note:** Constructing one logs a deprecation warning. The nearest `sds-alert` equivalent maps `variant` onto `data-palette`.
470
+
471
+ ---
472
+
473
+ ## sds-popover
474
+
475
+ Anchored popover built on the native Popover API. The element sets `popover="auto"` on itself unless you provide your own `popover` value, and is opened by a trigger with `popovertarget`.
476
+
477
+ ```html
478
+ <sds-button popovertarget="filters">Filters</sds-button>
479
+
480
+ <sds-popover id="filters" placement="bottom-start">
481
+ <div class="sds-stack-y-3xs">
482
+ <sds-checkbox label="Open cases" name="open"></sds-checkbox>
483
+ <sds-checkbox label="Closed cases" name="closed"></sds-checkbox>
484
+ </div>
485
+ </sds-popover>
486
+
487
+ <!-- Long content: make the popover scrollable instead of overflowing -->
488
+ <sds-popover id="long" placement="bottom" overscroll="contain">…</sds-popover>
489
+ ```
490
+
491
+ **Props:** `placement` (`"top"` | `"bottom"` | `"left"` | `"right"`, each also with `-start` / `-end`, or `"none"`; default `"top"`), `autoplacement` (`"true"` | `"false"`, default behaviour is to flip when there is no room), `overscroll` (`"contain"` — makes the popover scrollable)
492
+ **Native attribute:** `popover` (`"auto"` | `"manual"`, defaults to `"auto"`)
493
+ **Slots:** default (popover content)
494
+ **Events:** `toggle` (native `ToggleEvent` — check `newState`)
495
+ **Methods:** `showPopover()`, `hidePopover()` (native Popover API)
496
+ **Note:** A trigger using `popovertarget` automatically gets `aria-haspopup`, `aria-expanded`, and `aria-controls`. The popover needs an `id`.
497
+
498
+ ---
499
+
500
+ ## sds-process
501
+
502
+ Timeline / process list. Renders with `role="list"`; each `sds-process-step` is a `listitem`.
503
+
504
+ ```html
505
+ <sds-process heading-level="h3">
506
+ <sds-process-step heading="14:41"> Fører som ikke klarte å stanse var ruset og er anmeldt. </sds-process-step>
507
+ <sds-process-step heading="13:48">Veien er ryddet og vi har avsluttet på stedet.</sds-process-step>
508
+ </sds-process>
509
+
510
+ <!-- Numbered / custom markers -->
511
+ <sds-process heading-level="h3">
512
+ <sds-process-step heading="Send inn søknad" timestamp="1. mars">
513
+ <span slot="marker">1</span>
514
+ Fyll ut skjemaet.
515
+ </sds-process-step>
516
+ <sds-process-step heading="Behandling" timestamp="2.–14. mars">
517
+ <span slot="marker">2</span>
518
+ Vi behandler søknaden.
519
+ </sds-process-step>
520
+ </sds-process>
521
+ ```
522
+
523
+ **Props:** `heading-level` (`"h2"`–`"h6"`, default `"h2"`) — applied to every child step's heading
524
+ **Slots:** default (`sds-process-step` children)
525
+
526
+ ### sds-process-step
527
+
528
+ **Props:** `heading` (rendered at the parent's `heading-level`), `timestamp`
529
+ **Slots:** default (step body), `marker` (leading marker content — a number, icon, or label)
530
+ **Note:** A step with an empty `marker` slot renders in a compact "sub-step" style.
289
531
 
290
532
  ---
291
533
 
@@ -301,6 +543,7 @@ Single radio button.
301
543
  ```
302
544
 
303
545
  **Props:** `label`, `name`, `value` (default `"on"`), `checked`, `disabled`, `required`, `readonly`, `error`, `hide-label`, `help-text`, `size`
546
+ **Slots:** `label` (alternative to the `label` attribute)
304
547
  **Events:** `change`, `focus`, `blur`
305
548
 
306
549
  ---
@@ -326,12 +569,34 @@ Groups radio buttons with shared legend and validation.
326
569
  </sds-radio-group>
327
570
  ```
328
571
 
329
- **Props:** `legend`, `disabled` (propagates), `required` (propagates), `readonly` (propagates), `direction` (`"column"` | `"row"`), `error-message`, `help-text`, `size` (propagates)
572
+ **Props:** `legend`, `disabled` (propagates), `required` (propagates), `readonly` (propagates), `direction` (`"column"` | `"row"`, default `"column"`), `error-message`, `help-text`, `size` (propagates)
330
573
  **Slots:** default (`sds-radio` children)
331
574
  **Events:** `sds-update`
332
575
 
333
576
  ---
334
577
 
578
+ ## sds-search
579
+
580
+ Search field: an `sds-textfield` (`type="search"`) and an icon button, shoulder to shoulder.
581
+
582
+ ```html
583
+ <search aria-label="Registersøk">
584
+ <form action="/sok">
585
+ <sds-search label="Søk i registeret" hide-label name="q"></sds-search>
586
+ </form>
587
+ </search>
588
+
589
+ <sds-search label="Søk" button-variant="secondary"></sds-search>
590
+ ```
591
+
592
+ **Props:** `label`, `hide-label`, `name`, `value`, `placeholder`, `disabled`, `readonly`, `error-message`, `help-text`, `size`, `button-label` (default `"Søk"`), `button-variant`, `required`, `minlength`, `maxlength`, `pattern`, `autocomplete` (forwarded to the inner input)
593
+ **Slots:** `label` (rich label content, takes precedence over the `label` prop), `button` (replaces the default icon button; the slotted control owns its own click, `disabled` and form submission)
594
+ **Events:** `search` (detail `{ value }`, cancelable), `input`, `change`, `select`, `keydown` (cancelling Enter prevents `search`), `focus`, `blur`, `invalid`. `focus`/`blur` fire when focus enters or leaves the component as a whole, not when it moves between the field and the button.
595
+ **Methods:** `focus()`, `blur()`, `select()`, `setSelectionRange()`, `selectionStart`/`selectionEnd`, `checkValidity()`, `reportValidity()`, `setCustomValidity()`, plus `validity`, `validationMessage`, `willValidate`.
596
+ **Note:** Clicking the button or pressing Enter validates the field (unless the form has `novalidate`), emits `search` if it is valid, then submits the surrounding form unless `search` was cancelled with `preventDefault()`. Always set `label`; use `hide-label` to hide it visually. The placeholder is not an accessible name. In React/Preact JSX without the wrapper, the listener must be lowercase: `onsearch`.
597
+
598
+ ---
599
+
335
600
  ## sds-select
336
601
 
337
602
  Dropdown select using native `<option>`/`<optgroup>` elements.
@@ -360,15 +625,16 @@ Dropdown select using native `<option>`/`<optgroup>` elements.
360
625
  </sds-select>
361
626
  ```
362
627
 
363
- **Props:** `label`, `name`, `value` (property only), `default-value` (attribute), `disabled`, `required`, `readonly`, `error-message`, `help-text`, `size`
364
- **Slots:** default (`<option>` / `<optgroup>` / `<hr>`)
628
+ **Props:** `label`, `name`, `value` (property only — no attribute), `default-value` (attribute), `disabled`, `required`, `readonly`, `error-message`, `help-text`, `size`
629
+ **Slots:** default (`<option>` / `<optgroup>` / `<hr>`), `label` (alternative to the `label` attribute)
365
630
  **Events:** `input`, `change`, `focus`, `blur`
631
+ **Note:** Options are projected from light DOM and mirrored into the shadow `<select>`, so adding, removing, or relabelling options at runtime is picked up automatically. `readonly` renders a lock icon next to the label.
366
632
 
367
633
  ---
368
634
 
369
635
  ## sds-stepper
370
636
 
371
- Step indicator for multi-step flows. Contains `sds-stepper-step` children.
637
+ Step indicator for multi-step flows. Contains `sds-stepper-step` children. Gets `aria-label="Steg"` unless you set your own.
372
638
 
373
639
  ```html
374
640
  <sds-stepper>
@@ -387,12 +653,13 @@ Step indicator for multi-step flows. Contains `sds-stepper-step` children.
387
653
  **Props:** `orientation` (`"horizontal"` | `"vertical"`, default `"horizontal"`)
388
654
  **Slots:** default (`sds-stepper-step` children)
389
655
  **Events:** `change` (detail: `{ index: number }`)
390
- **Methods:** `getActiveStep()` (returns index or -1), `goToStep(index)`
656
+ **Methods:** `getActiveStep()` (returns index or -1), `goToStep(index)` (out-of-range indices are ignored)
391
657
 
392
658
  ### sds-stepper-step
393
659
 
394
660
  **Props:** `complete`, `interactive` (clickable), `active` (current step)
395
661
  **Slots:** default (label text)
662
+ **Note:** Step numbers are generated automatically from the child order.
396
663
 
397
664
  ---
398
665
 
@@ -409,8 +676,9 @@ Toggle switch input.
409
676
  ```
410
677
 
411
678
  **Props:** `label`, `name`, `checked`, `disabled`, `readonly`, `reverse` (flip order), `hide-label`, `size`
679
+ **Slots:** `label` (alternative to the `label` attribute)
412
680
  **Events:** `change`, `focus`, `blur`
413
- **Note:** No `error-message`, `help-text`, or `required`. Value getter returns `"on"` | `"off"`.
681
+ **Note:** No `error-message`, `help-text`, or `required`. The `value` getter returns `"on"` | `"off"`, and `type` reports `"checkbox"`.
414
682
 
415
683
  ---
416
684
 
@@ -422,11 +690,13 @@ Non-interactive label/badge.
422
690
  <sds-tag>Default</sds-tag>
423
691
  <sds-tag data-palette="success">Approved</sds-tag>
424
692
  <sds-tag data-palette="danger">Rejected</sds-tag>
693
+ <sds-tag data-palette="danger-action">Kritisk</sds-tag>
425
694
  <sds-tag size="sm">Small</sds-tag>
426
695
  ```
427
696
 
428
- **Props:** `size`
697
+ **Props:** `size`, `data-palette`
429
698
  **Slots:** default
699
+ **Note:** In addition to the framework palettes, `sds-tag` accepts `data-palette="danger-action"` — a deep red that is not a general palette value.
430
700
 
431
701
  ---
432
702
 
@@ -437,10 +707,11 @@ Text container with typography styling. Source: `sds-text.component.ts`.
437
707
  ```html
438
708
  <sds-text>Regular body text.</sds-text>
439
709
  <sds-text size="lg" strong tall>Large bold text with tall line height.</sds-text>
710
+ <sds-text subtle>De-emphasised text.</sds-text>
440
711
  <sds-text data-palette="danger">Red danger text.</sds-text>
441
712
  ```
442
713
 
443
- **Props:** `size` (`"xl"` | `"lg"` | `"md"` | `"sm"` | `"xs"`), `strong` (bold), `tall` (increased line height)
714
+ **Props:** `size` (`"xl"` | `"lg"` | `"md"` | `"sm"` | `"xs"`), `strong` (bold), `subtle` (de-emphasised colour), `tall` (increased line height)
444
715
  **Slots:** default
445
716
 
446
717
  ---
@@ -454,9 +725,11 @@ Multi-line text input.
454
725
  <sds-textarea label="Comments" name="comments" required error-message="Required"></sds-textarea>
455
726
  <sds-textarea label="Bio" name="bio" counter="500"></sds-textarea>
456
727
  <sds-textarea label="Address" name="address" rows="4" wrap="soft"></sds-textarea>
728
+ <sds-textarea label="Notes" name="notes" autosize></sds-textarea>
457
729
  ```
458
730
 
459
- **Props:** `label`, `name`, `value`, `placeholder`, `disabled`, `readonly`, `required`, `rows`, `cols`, `wrap` (`"hard"` | `"soft"`), `minlength`, `maxlength`, `counter` (shows character count), `autocomplete`, `help-text`, `error-message`, `size`
731
+ **Props:** `label`, `name`, `value`, `placeholder`, `disabled`, `readonly`, `required`, `rows`, `cols`, `wrap` (`"hard"` | `"soft"`), `minlength`, `maxlength`, `counter` (shows character count), `autosize` (grows with content), `autocomplete`, `help-text`, `error-message`, `size`
732
+ **Slots:** `label` (alternative to the `label` attribute)
460
733
  **Events:** `input`, `change`, `select`, `focus`, `blur`
461
734
 
462
735
  ---
@@ -469,6 +742,7 @@ Single-line text input.
469
742
  <sds-textfield label="Email" name="email" type="email" placeholder="you@example.com"></sds-textfield>
470
743
  <sds-textfield label="Username" name="username" required help-text="3-20 characters" minlength="3" maxlength="20"></sds-textfield>
471
744
  <sds-textfield label="Phone" name="phone" type="tel" error-message="Invalid phone"></sds-textfield>
745
+ <sds-textfield label="Amount" name="amount" type="number" min="0" max="100"></sds-textfield>
472
746
  <sds-textfield label="Search" name="search" type="search">
473
747
  <sds-icon name="search-material-filled" slot="after"></sds-icon>
474
748
  </sds-textfield>
@@ -476,6 +750,29 @@ Single-line text input.
476
750
  <sds-textfield label="ID" name="id" value="12345" readonly></sds-textfield>
477
751
  ```
478
752
 
479
- **Props:** `label`, `name`, `value`, `type` (HTML input types), `placeholder`, `disabled`, `readonly`, `required`, `autocomplete`, `pattern`, `minlength`, `maxlength`, `help-text`, `error-message`, `size`
480
- **Slots:** `after` (e.g., icon)
753
+ **Props:** `label`, `hide-label`, `name`, `value`, `type` (HTML input types), `placeholder`, `disabled`, `readonly`, `required`, `autocomplete`, `pattern`, `minlength`, `maxlength`, `min`, `max`, `help-text`, `error-message`, `size`
754
+ **Slots:** `after` (e.g., icon), `label` (alternative to the `label` attribute)
481
755
  **Events:** `input`, `change`, `select`, `focus`, `blur`, `keydown`
756
+ **Note:** When both `error-message` and `help-text` are set, `aria-describedby` lists the error first, then the help text. `readonly` renders a lock icon next to the label.
757
+
758
+ ---
759
+
760
+ ## sds-tooltip
761
+
762
+ Hover/focus tooltip. The tooltip is a sibling of its trigger, and the trigger points at it with `aria-describedby` — the tooltip itself is `aria-hidden`, and its text is mirrored onto the trigger for screen readers.
763
+
764
+ ```html
765
+ <span style="position: relative; display: inline-block;">
766
+ <sds-button aria-describedby="orgnr-tip" variant="secondary" icon label="Om org.nr">
767
+ <sds-icon name="info-material-outlined"></sds-icon>
768
+ </sds-button>
769
+ <sds-tooltip id="orgnr-tip">Organisasjonsnummer</sds-tooltip>
770
+ </span>
771
+
772
+ <sds-tooltip id="tip-right" placement="right">Vises til høyre</sds-tooltip>
773
+ ```
774
+
775
+ **Props:** `id` (**required** — the value the trigger's `aria-describedby` references), `placement` (`"top"` | `"bottom"` | `"left"` | `"right"`, each also with `-start` / `-end`, or `"none"`; default `"top"`)
776
+ **Slots:** default (tooltip text — keep it to plain text)
777
+ **Events:** `toggle` (detail: the trigger element that opened it). The native popover `ToggleEvent` also fires on the host.
778
+ **Notes:** Sets `role="tooltip"` and `popover="manual"` on itself. Multiple triggers may reference the same tooltip. Give the trigger and tooltip a `position: relative` wrapper. `data-palette` has no effect — tooltip colours are fixed.