@digdir/designsystemet-web 1.19.1 → 1.20.1

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 (33) hide show
  1. package/dist/cjs/_vendors/@oddbird/popover-polyfill/dist/popover-fn.cjs +2 -2
  2. package/dist/cjs/_vendors/@oddbird/popover-polyfill/dist/popover-fn.cjs.map +1 -1
  3. package/dist/cjs/_virtual/_rolldown/runtime.cjs +1 -1
  4. package/dist/cjs/clickdelegatefor/clickdelegatefor.cjs +1 -1
  5. package/dist/cjs/clickdelegatefor/clickdelegatefor.cjs.map +1 -1
  6. package/dist/cjs/field/field.cjs +1 -1
  7. package/dist/cjs/field/field.cjs.map +1 -1
  8. package/dist/cjs/fieldset/fieldset.cjs +1 -1
  9. package/dist/cjs/fieldset/fieldset.cjs.map +1 -1
  10. package/dist/cjs/packages/web/package.cjs +1 -1
  11. package/dist/cjs/popover/popover.cjs +1 -1
  12. package/dist/cjs/popover/popover.cjs.map +1 -1
  13. package/dist/cjs/suggestion/suggestion.cjs +1 -1
  14. package/dist/cjs/suggestion/suggestion.cjs.map +1 -1
  15. package/dist/custom-elements.json +2 -2
  16. package/dist/esm/_vendors/@oddbird/popover-polyfill/dist/popover-fn.js +2 -2
  17. package/dist/esm/_vendors/@oddbird/popover-polyfill/dist/popover-fn.js.map +1 -1
  18. package/dist/esm/clickdelegatefor/clickdelegatefor.js +1 -1
  19. package/dist/esm/clickdelegatefor/clickdelegatefor.js.map +1 -1
  20. package/dist/esm/field/field.js +1 -1
  21. package/dist/esm/field/field.js.map +1 -1
  22. package/dist/esm/fieldset/fieldset.js +1 -1
  23. package/dist/esm/fieldset/fieldset.js.map +1 -1
  24. package/dist/esm/packages/web/package.js +1 -1
  25. package/dist/esm/popover/popover.js +1 -1
  26. package/dist/esm/popover/popover.js.map +1 -1
  27. package/dist/esm/suggestion/suggestion.js +1 -1
  28. package/dist/esm/suggestion/suggestion.js.map +1 -1
  29. package/dist/index.d.ts +102 -108
  30. package/dist/index.js +95 -52
  31. package/dist/umd/index.js +8 -7
  32. package/dist/umd/index.js.map +1 -1
  33. package/package.json +8 -7
package/dist/index.d.ts CHANGED
@@ -156,93 +156,81 @@ declare class DSTabElement extends UTabs.UHTMLTabElement {}
156
156
  declare class DSTabPanelElement extends UTabs.UHTMLTabPanelElement {}
157
157
  //#endregion
158
158
  export { DSBreadcrumbsElement, DSErrorSummaryElement, DSFieldElement, DSPaginationElement, DSSuggestionElement, DSTabElement, DSTabListElement, DSTabPanelElement, DSTabsElement, initTooltips, pagination, setTooltipElement };
159
- import type * as PreactTypes from 'preact'
160
- import type * as ReactTypes from 'react'
161
- import type * as SvelteTypes from 'svelte/elements'
162
- import type * as VueJSX from '@vue/runtime-dom'
163
- import type { JSX as QwikJSX } from '@builder.io/qwik/jsx-runtime'
164
- import type { JSX as SolidJSX } from 'solid-js'
165
159
 
166
160
 
167
- export type PreactDsbreadcrumbs = PreactTypes.JSX.HTMLAttributes<DSBreadcrumbsElement> & { }
168
- export type ReactDsbreadcrumbs = ReactTypes.DetailedHTMLProps<ReactTypes.HTMLAttributes<DSBreadcrumbsElement>, DSBreadcrumbsElement> & { class?: string }
169
- export type QwikDsbreadcrumbs = QwikJSX.IntrinsicElements['div'] & { class?: string }
170
- export type VueDsbreadcrumbs = VueJSX.HTMLAttributes
171
- export type SvelteDsbreadcrumbs = SvelteTypes.HTMLAttributes<DSBreadcrumbsElement> & { }
172
- export type SolidDsbreadcrumbs = SolidJSX.HTMLAttributes<DSBreadcrumbsElement>
161
+ export type PreactDstabs = PreactTypes.JSX.HTMLAttributes<DSTabsElement> & { }
162
+ export type ReactDstabs = ReactTypes.DetailedHTMLProps<ReactTypes.HTMLAttributes<DSTabsElement>, DSTabsElement> & { class?: string }
163
+ export type QwikDstabs = QwikJSX.IntrinsicElements['div'] & { class?: string }
164
+ export type VueDstabs = VueJSX.HTMLAttributes
165
+ export type SvelteDstabs = SvelteTypes.HTMLAttributes<DSTabsElement> & { }
166
+ export type SolidDstabs = SolidJSX.HTMLAttributes<DSTabsElement>
173
167
 
174
- declare global { namespace React.JSX { interface IntrinsicElements { 'ds-breadcrumbs': ReactDsbreadcrumbs } } }
175
- declare global { namespace preact.JSX { interface IntrinsicElements { 'ds-breadcrumbs': PreactDsbreadcrumbs } } }
176
- declare module '@builder.io/qwik/jsx-runtime' { export namespace JSX { export interface IntrinsicElements { 'ds-breadcrumbs': QwikDsbreadcrumbs } } }
168
+ declare global { namespace React.JSX { interface IntrinsicElements { 'ds-tabs': ReactDstabs } } }
169
+ declare global { namespace preact.JSX { interface IntrinsicElements { 'ds-tabs': PreactDstabs } } }
170
+ declare module '@builder.io/qwik/jsx-runtime' { export namespace JSX { export interface IntrinsicElements { 'ds-tabs': QwikDstabs } } }
177
171
  // Augmenting @vue/runtime-dom instead of vue directly to avoid interfering with React JSX
178
- declare module '@vue/runtime-dom' { export interface GlobalComponents { 'ds-breadcrumbs': VueDsbreadcrumbs } }
179
- declare module 'svelte/elements' { interface SvelteHTMLElements { 'ds-breadcrumbs': SvelteDsbreadcrumbs } }
172
+ declare module '@vue/runtime-dom' { export interface GlobalComponents { 'ds-tabs': VueDstabs } }
173
+ declare module 'svelte/elements' { interface SvelteHTMLElements { 'ds-tabs': SvelteDstabs } }
180
174
  declare module 'solid-js' {
181
175
  namespace JSX {
182
- interface IntrinsicElements { 'ds-breadcrumbs': SolidDsbreadcrumbs }
176
+ interface IntrinsicElements { 'ds-tabs': SolidDstabs }
183
177
  interface CustomEvents { }
184
178
  }
185
179
  }
180
+ export type PreactDstablist = PreactTypes.JSX.HTMLAttributes<DSTabListElement> & { }
181
+ export type ReactDstablist = ReactTypes.DetailedHTMLProps<ReactTypes.HTMLAttributes<DSTabListElement>, DSTabListElement> & { class?: string }
182
+ export type QwikDstablist = QwikJSX.IntrinsicElements['div'] & { class?: string }
183
+ export type VueDstablist = VueJSX.HTMLAttributes
184
+ export type SvelteDstablist = SvelteTypes.HTMLAttributes<DSTabListElement> & { }
185
+ export type SolidDstablist = SolidJSX.HTMLAttributes<DSTabListElement>
186
186
 
187
-
188
- export type PreactDserrorsummary = PreactTypes.JSX.HTMLAttributes<DSErrorSummaryElement> & { }
189
- export type ReactDserrorsummary = ReactTypes.DetailedHTMLProps<ReactTypes.HTMLAttributes<DSErrorSummaryElement>, DSErrorSummaryElement> & { class?: string }
190
- export type QwikDserrorsummary = QwikJSX.IntrinsicElements['div'] & { class?: string }
191
- export type VueDserrorsummary = VueJSX.HTMLAttributes
192
- export type SvelteDserrorsummary = SvelteTypes.HTMLAttributes<DSErrorSummaryElement> & { }
193
- export type SolidDserrorsummary = SolidJSX.HTMLAttributes<DSErrorSummaryElement>
194
-
195
- declare global { namespace React.JSX { interface IntrinsicElements { 'ds-error-summary': ReactDserrorsummary } } }
196
- declare global { namespace preact.JSX { interface IntrinsicElements { 'ds-error-summary': PreactDserrorsummary } } }
197
- declare module '@builder.io/qwik/jsx-runtime' { export namespace JSX { export interface IntrinsicElements { 'ds-error-summary': QwikDserrorsummary } } }
187
+ declare global { namespace React.JSX { interface IntrinsicElements { 'ds-tablist': ReactDstablist } } }
188
+ declare global { namespace preact.JSX { interface IntrinsicElements { 'ds-tablist': PreactDstablist } } }
189
+ declare module '@builder.io/qwik/jsx-runtime' { export namespace JSX { export interface IntrinsicElements { 'ds-tablist': QwikDstablist } } }
198
190
  // Augmenting @vue/runtime-dom instead of vue directly to avoid interfering with React JSX
199
- declare module '@vue/runtime-dom' { export interface GlobalComponents { 'ds-error-summary': VueDserrorsummary } }
200
- declare module 'svelte/elements' { interface SvelteHTMLElements { 'ds-error-summary': SvelteDserrorsummary } }
191
+ declare module '@vue/runtime-dom' { export interface GlobalComponents { 'ds-tablist': VueDstablist } }
192
+ declare module 'svelte/elements' { interface SvelteHTMLElements { 'ds-tablist': SvelteDstablist } }
201
193
  declare module 'solid-js' {
202
194
  namespace JSX {
203
- interface IntrinsicElements { 'ds-error-summary': SolidDserrorsummary }
195
+ interface IntrinsicElements { 'ds-tablist': SolidDstablist }
204
196
  interface CustomEvents { }
205
197
  }
206
198
  }
199
+ export type PreactDstab = PreactTypes.JSX.HTMLAttributes<DSTabElement> & { }
200
+ export type ReactDstab = ReactTypes.DetailedHTMLProps<ReactTypes.HTMLAttributes<DSTabElement>, DSTabElement> & { class?: string }
201
+ export type QwikDstab = QwikJSX.IntrinsicElements['div'] & { class?: string }
202
+ export type VueDstab = VueJSX.HTMLAttributes
203
+ export type SvelteDstab = SvelteTypes.HTMLAttributes<DSTabElement> & { }
204
+ export type SolidDstab = SolidJSX.HTMLAttributes<DSTabElement>
207
205
 
208
-
209
- export type PreactDsfield = PreactTypes.JSX.HTMLAttributes<DSFieldElement> & { }
210
- export type ReactDsfield = ReactTypes.DetailedHTMLProps<ReactTypes.HTMLAttributes<DSFieldElement>, DSFieldElement> & { class?: string }
211
- export type QwikDsfield = QwikJSX.IntrinsicElements['div'] & { class?: string }
212
- export type VueDsfield = VueJSX.HTMLAttributes
213
- export type SvelteDsfield = SvelteTypes.HTMLAttributes<DSFieldElement> & { }
214
- export type SolidDsfield = SolidJSX.HTMLAttributes<DSFieldElement>
215
-
216
- declare global { namespace React.JSX { interface IntrinsicElements { 'ds-field': ReactDsfield } } }
217
- declare global { namespace preact.JSX { interface IntrinsicElements { 'ds-field': PreactDsfield } } }
218
- declare module '@builder.io/qwik/jsx-runtime' { export namespace JSX { export interface IntrinsicElements { 'ds-field': QwikDsfield } } }
206
+ declare global { namespace React.JSX { interface IntrinsicElements { 'ds-tab': ReactDstab } } }
207
+ declare global { namespace preact.JSX { interface IntrinsicElements { 'ds-tab': PreactDstab } } }
208
+ declare module '@builder.io/qwik/jsx-runtime' { export namespace JSX { export interface IntrinsicElements { 'ds-tab': QwikDstab } } }
219
209
  // Augmenting @vue/runtime-dom instead of vue directly to avoid interfering with React JSX
220
- declare module '@vue/runtime-dom' { export interface GlobalComponents { 'ds-field': VueDsfield } }
221
- declare module 'svelte/elements' { interface SvelteHTMLElements { 'ds-field': SvelteDsfield } }
210
+ declare module '@vue/runtime-dom' { export interface GlobalComponents { 'ds-tab': VueDstab } }
211
+ declare module 'svelte/elements' { interface SvelteHTMLElements { 'ds-tab': SvelteDstab } }
222
212
  declare module 'solid-js' {
223
213
  namespace JSX {
224
- interface IntrinsicElements { 'ds-field': SolidDsfield }
214
+ interface IntrinsicElements { 'ds-tab': SolidDstab }
225
215
  interface CustomEvents { }
226
216
  }
227
217
  }
218
+ export type PreactDstabpanel = PreactTypes.JSX.HTMLAttributes<DSTabPanelElement> & { }
219
+ export type ReactDstabpanel = ReactTypes.DetailedHTMLProps<ReactTypes.HTMLAttributes<DSTabPanelElement>, DSTabPanelElement> & { class?: string }
220
+ export type QwikDstabpanel = QwikJSX.IntrinsicElements['div'] & { class?: string }
221
+ export type VueDstabpanel = VueJSX.HTMLAttributes
222
+ export type SvelteDstabpanel = SvelteTypes.HTMLAttributes<DSTabPanelElement> & { }
223
+ export type SolidDstabpanel = SolidJSX.HTMLAttributes<DSTabPanelElement>
228
224
 
229
-
230
- export type PreactDspagination = PreactTypes.JSX.HTMLAttributes<DSPaginationElement> & { }
231
- export type ReactDspagination = ReactTypes.DetailedHTMLProps<ReactTypes.HTMLAttributes<DSPaginationElement>, DSPaginationElement> & { class?: string }
232
- export type QwikDspagination = QwikJSX.IntrinsicElements['div'] & { class?: string }
233
- export type VueDspagination = VueJSX.HTMLAttributes
234
- export type SvelteDspagination = SvelteTypes.HTMLAttributes<DSPaginationElement> & { }
235
- export type SolidDspagination = SolidJSX.HTMLAttributes<DSPaginationElement>
236
-
237
- declare global { namespace React.JSX { interface IntrinsicElements { 'ds-pagination': ReactDspagination } } }
238
- declare global { namespace preact.JSX { interface IntrinsicElements { 'ds-pagination': PreactDspagination } } }
239
- declare module '@builder.io/qwik/jsx-runtime' { export namespace JSX { export interface IntrinsicElements { 'ds-pagination': QwikDspagination } } }
225
+ declare global { namespace React.JSX { interface IntrinsicElements { 'ds-tabpanel': ReactDstabpanel } } }
226
+ declare global { namespace preact.JSX { interface IntrinsicElements { 'ds-tabpanel': PreactDstabpanel } } }
227
+ declare module '@builder.io/qwik/jsx-runtime' { export namespace JSX { export interface IntrinsicElements { 'ds-tabpanel': QwikDstabpanel } } }
240
228
  // Augmenting @vue/runtime-dom instead of vue directly to avoid interfering with React JSX
241
- declare module '@vue/runtime-dom' { export interface GlobalComponents { 'ds-pagination': VueDspagination } }
242
- declare module 'svelte/elements' { interface SvelteHTMLElements { 'ds-pagination': SvelteDspagination } }
229
+ declare module '@vue/runtime-dom' { export interface GlobalComponents { 'ds-tabpanel': VueDstabpanel } }
230
+ declare module 'svelte/elements' { interface SvelteHTMLElements { 'ds-tabpanel': SvelteDstabpanel } }
243
231
  declare module 'solid-js' {
244
232
  namespace JSX {
245
- interface IntrinsicElements { 'ds-pagination': SolidDspagination }
233
+ interface IntrinsicElements { 'ds-tabpanel': SolidDstabpanel }
246
234
  interface CustomEvents { }
247
235
  }
248
236
  }
@@ -269,79 +257,85 @@ declare module 'solid-js' {
269
257
  }
270
258
 
271
259
 
272
- export type PreactDstabs = PreactTypes.JSX.HTMLAttributes<DSTabsElement> & { }
273
- export type ReactDstabs = ReactTypes.DetailedHTMLProps<ReactTypes.HTMLAttributes<DSTabsElement>, DSTabsElement> & { class?: string }
274
- export type QwikDstabs = QwikJSX.IntrinsicElements['div'] & { class?: string }
275
- export type VueDstabs = VueJSX.HTMLAttributes
276
- export type SvelteDstabs = SvelteTypes.HTMLAttributes<DSTabsElement> & { }
277
- export type SolidDstabs = SolidJSX.HTMLAttributes<DSTabsElement>
260
+ export type PreactDspagination = PreactTypes.JSX.HTMLAttributes<DSPaginationElement> & { }
261
+ export type ReactDspagination = ReactTypes.DetailedHTMLProps<ReactTypes.HTMLAttributes<DSPaginationElement>, DSPaginationElement> & { class?: string }
262
+ export type QwikDspagination = QwikJSX.IntrinsicElements['div'] & { class?: string }
263
+ export type VueDspagination = VueJSX.HTMLAttributes
264
+ export type SvelteDspagination = SvelteTypes.HTMLAttributes<DSPaginationElement> & { }
265
+ export type SolidDspagination = SolidJSX.HTMLAttributes<DSPaginationElement>
278
266
 
279
- declare global { namespace React.JSX { interface IntrinsicElements { 'ds-tabs': ReactDstabs } } }
280
- declare global { namespace preact.JSX { interface IntrinsicElements { 'ds-tabs': PreactDstabs } } }
281
- declare module '@builder.io/qwik/jsx-runtime' { export namespace JSX { export interface IntrinsicElements { 'ds-tabs': QwikDstabs } } }
267
+ declare global { namespace React.JSX { interface IntrinsicElements { 'ds-pagination': ReactDspagination } } }
268
+ declare global { namespace preact.JSX { interface IntrinsicElements { 'ds-pagination': PreactDspagination } } }
269
+ declare module '@builder.io/qwik/jsx-runtime' { export namespace JSX { export interface IntrinsicElements { 'ds-pagination': QwikDspagination } } }
282
270
  // Augmenting @vue/runtime-dom instead of vue directly to avoid interfering with React JSX
283
- declare module '@vue/runtime-dom' { export interface GlobalComponents { 'ds-tabs': VueDstabs } }
284
- declare module 'svelte/elements' { interface SvelteHTMLElements { 'ds-tabs': SvelteDstabs } }
271
+ declare module '@vue/runtime-dom' { export interface GlobalComponents { 'ds-pagination': VueDspagination } }
272
+ declare module 'svelte/elements' { interface SvelteHTMLElements { 'ds-pagination': SvelteDspagination } }
285
273
  declare module 'solid-js' {
286
274
  namespace JSX {
287
- interface IntrinsicElements { 'ds-tabs': SolidDstabs }
275
+ interface IntrinsicElements { 'ds-pagination': SolidDspagination }
288
276
  interface CustomEvents { }
289
277
  }
290
278
  }
291
- export type PreactDstablist = PreactTypes.JSX.HTMLAttributes<DSTabListElement> & { }
292
- export type ReactDstablist = ReactTypes.DetailedHTMLProps<ReactTypes.HTMLAttributes<DSTabListElement>, DSTabListElement> & { class?: string }
293
- export type QwikDstablist = QwikJSX.IntrinsicElements['div'] & { class?: string }
294
- export type VueDstablist = VueJSX.HTMLAttributes
295
- export type SvelteDstablist = SvelteTypes.HTMLAttributes<DSTabListElement> & { }
296
- export type SolidDstablist = SolidJSX.HTMLAttributes<DSTabListElement>
297
279
 
298
- declare global { namespace React.JSX { interface IntrinsicElements { 'ds-tablist': ReactDstablist } } }
299
- declare global { namespace preact.JSX { interface IntrinsicElements { 'ds-tablist': PreactDstablist } } }
300
- declare module '@builder.io/qwik/jsx-runtime' { export namespace JSX { export interface IntrinsicElements { 'ds-tablist': QwikDstablist } } }
280
+
281
+ export type PreactDsfield = PreactTypes.JSX.HTMLAttributes<DSFieldElement> & { }
282
+ export type ReactDsfield = ReactTypes.DetailedHTMLProps<ReactTypes.HTMLAttributes<DSFieldElement>, DSFieldElement> & { class?: string }
283
+ export type QwikDsfield = QwikJSX.IntrinsicElements['div'] & { class?: string }
284
+ export type VueDsfield = VueJSX.HTMLAttributes
285
+ export type SvelteDsfield = SvelteTypes.HTMLAttributes<DSFieldElement> & { }
286
+ export type SolidDsfield = SolidJSX.HTMLAttributes<DSFieldElement>
287
+
288
+ declare global { namespace React.JSX { interface IntrinsicElements { 'ds-field': ReactDsfield } } }
289
+ declare global { namespace preact.JSX { interface IntrinsicElements { 'ds-field': PreactDsfield } } }
290
+ declare module '@builder.io/qwik/jsx-runtime' { export namespace JSX { export interface IntrinsicElements { 'ds-field': QwikDsfield } } }
301
291
  // Augmenting @vue/runtime-dom instead of vue directly to avoid interfering with React JSX
302
- declare module '@vue/runtime-dom' { export interface GlobalComponents { 'ds-tablist': VueDstablist } }
303
- declare module 'svelte/elements' { interface SvelteHTMLElements { 'ds-tablist': SvelteDstablist } }
292
+ declare module '@vue/runtime-dom' { export interface GlobalComponents { 'ds-field': VueDsfield } }
293
+ declare module 'svelte/elements' { interface SvelteHTMLElements { 'ds-field': SvelteDsfield } }
304
294
  declare module 'solid-js' {
305
295
  namespace JSX {
306
- interface IntrinsicElements { 'ds-tablist': SolidDstablist }
296
+ interface IntrinsicElements { 'ds-field': SolidDsfield }
307
297
  interface CustomEvents { }
308
298
  }
309
299
  }
310
- export type PreactDstab = PreactTypes.JSX.HTMLAttributes<DSTabElement> & { }
311
- export type ReactDstab = ReactTypes.DetailedHTMLProps<ReactTypes.HTMLAttributes<DSTabElement>, DSTabElement> & { class?: string }
312
- export type QwikDstab = QwikJSX.IntrinsicElements['div'] & { class?: string }
313
- export type VueDstab = VueJSX.HTMLAttributes
314
- export type SvelteDstab = SvelteTypes.HTMLAttributes<DSTabElement> & { }
315
- export type SolidDstab = SolidJSX.HTMLAttributes<DSTabElement>
316
300
 
317
- declare global { namespace React.JSX { interface IntrinsicElements { 'ds-tab': ReactDstab } } }
318
- declare global { namespace preact.JSX { interface IntrinsicElements { 'ds-tab': PreactDstab } } }
319
- declare module '@builder.io/qwik/jsx-runtime' { export namespace JSX { export interface IntrinsicElements { 'ds-tab': QwikDstab } } }
301
+
302
+ export type PreactDserrorsummary = PreactTypes.JSX.HTMLAttributes<DSErrorSummaryElement> & { }
303
+ export type ReactDserrorsummary = ReactTypes.DetailedHTMLProps<ReactTypes.HTMLAttributes<DSErrorSummaryElement>, DSErrorSummaryElement> & { class?: string }
304
+ export type QwikDserrorsummary = QwikJSX.IntrinsicElements['div'] & { class?: string }
305
+ export type VueDserrorsummary = VueJSX.HTMLAttributes
306
+ export type SvelteDserrorsummary = SvelteTypes.HTMLAttributes<DSErrorSummaryElement> & { }
307
+ export type SolidDserrorsummary = SolidJSX.HTMLAttributes<DSErrorSummaryElement>
308
+
309
+ declare global { namespace React.JSX { interface IntrinsicElements { 'ds-error-summary': ReactDserrorsummary } } }
310
+ declare global { namespace preact.JSX { interface IntrinsicElements { 'ds-error-summary': PreactDserrorsummary } } }
311
+ declare module '@builder.io/qwik/jsx-runtime' { export namespace JSX { export interface IntrinsicElements { 'ds-error-summary': QwikDserrorsummary } } }
320
312
  // Augmenting @vue/runtime-dom instead of vue directly to avoid interfering with React JSX
321
- declare module '@vue/runtime-dom' { export interface GlobalComponents { 'ds-tab': VueDstab } }
322
- declare module 'svelte/elements' { interface SvelteHTMLElements { 'ds-tab': SvelteDstab } }
313
+ declare module '@vue/runtime-dom' { export interface GlobalComponents { 'ds-error-summary': VueDserrorsummary } }
314
+ declare module 'svelte/elements' { interface SvelteHTMLElements { 'ds-error-summary': SvelteDserrorsummary } }
323
315
  declare module 'solid-js' {
324
316
  namespace JSX {
325
- interface IntrinsicElements { 'ds-tab': SolidDstab }
317
+ interface IntrinsicElements { 'ds-error-summary': SolidDserrorsummary }
326
318
  interface CustomEvents { }
327
319
  }
328
320
  }
329
- export type PreactDstabpanel = PreactTypes.JSX.HTMLAttributes<DSTabPanelElement> & { }
330
- export type ReactDstabpanel = ReactTypes.DetailedHTMLProps<ReactTypes.HTMLAttributes<DSTabPanelElement>, DSTabPanelElement> & { class?: string }
331
- export type QwikDstabpanel = QwikJSX.IntrinsicElements['div'] & { class?: string }
332
- export type VueDstabpanel = VueJSX.HTMLAttributes
333
- export type SvelteDstabpanel = SvelteTypes.HTMLAttributes<DSTabPanelElement> & { }
334
- export type SolidDstabpanel = SolidJSX.HTMLAttributes<DSTabPanelElement>
335
321
 
336
- declare global { namespace React.JSX { interface IntrinsicElements { 'ds-tabpanel': ReactDstabpanel } } }
337
- declare global { namespace preact.JSX { interface IntrinsicElements { 'ds-tabpanel': PreactDstabpanel } } }
338
- declare module '@builder.io/qwik/jsx-runtime' { export namespace JSX { export interface IntrinsicElements { 'ds-tabpanel': QwikDstabpanel } } }
322
+
323
+ export type PreactDsbreadcrumbs = PreactTypes.JSX.HTMLAttributes<DSBreadcrumbsElement> & { }
324
+ export type ReactDsbreadcrumbs = ReactTypes.DetailedHTMLProps<ReactTypes.HTMLAttributes<DSBreadcrumbsElement>, DSBreadcrumbsElement> & { class?: string }
325
+ export type QwikDsbreadcrumbs = QwikJSX.IntrinsicElements['div'] & { class?: string }
326
+ export type VueDsbreadcrumbs = VueJSX.HTMLAttributes
327
+ export type SvelteDsbreadcrumbs = SvelteTypes.HTMLAttributes<DSBreadcrumbsElement> & { }
328
+ export type SolidDsbreadcrumbs = SolidJSX.HTMLAttributes<DSBreadcrumbsElement>
329
+
330
+ declare global { namespace React.JSX { interface IntrinsicElements { 'ds-breadcrumbs': ReactDsbreadcrumbs } } }
331
+ declare global { namespace preact.JSX { interface IntrinsicElements { 'ds-breadcrumbs': PreactDsbreadcrumbs } } }
332
+ declare module '@builder.io/qwik/jsx-runtime' { export namespace JSX { export interface IntrinsicElements { 'ds-breadcrumbs': QwikDsbreadcrumbs } } }
339
333
  // Augmenting @vue/runtime-dom instead of vue directly to avoid interfering with React JSX
340
- declare module '@vue/runtime-dom' { export interface GlobalComponents { 'ds-tabpanel': VueDstabpanel } }
341
- declare module 'svelte/elements' { interface SvelteHTMLElements { 'ds-tabpanel': SvelteDstabpanel } }
334
+ declare module '@vue/runtime-dom' { export interface GlobalComponents { 'ds-breadcrumbs': VueDsbreadcrumbs } }
335
+ declare module 'svelte/elements' { interface SvelteHTMLElements { 'ds-breadcrumbs': SvelteDsbreadcrumbs } }
342
336
  declare module 'solid-js' {
343
337
  namespace JSX {
344
- interface IntrinsicElements { 'ds-tabpanel': SolidDstabpanel }
338
+ interface IntrinsicElements { 'ds-breadcrumbs': SolidDsbreadcrumbs }
345
339
  interface CustomEvents { }
346
340
  }
347
341
  }
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import { UHTMLComboboxElement } from "@u-elements/u-combobox";
4
4
  import * as UTabs from "@u-elements/u-tabs";
5
5
  export * from "@u-elements/u-datalist";
6
6
  //#region package.json
7
- var version = "1.19.1";
7
+ var version = "1.20.1";
8
8
  //#endregion
9
9
  //#region src/utils/utils.ts
10
10
  const ARIA_DESC = "aria-description";
@@ -212,9 +212,10 @@ const handleClickDelegateFor = (event) => {
212
212
  const target = getComposedTarget(event);
213
213
  const delegateTarget = event.button < 2 && getDelegateTarget(event);
214
214
  if (!delegateTarget || delegateTarget.contains(target)) return;
215
+ for (const el of getComposedPath(target)) if (el.control === delegateTarget) return;
215
216
  if (isNewTab && delegateTarget instanceof HTMLAnchorElement) return window.open(delegateTarget.href, void 0, delegateTarget.rel);
216
217
  event.stopImmediatePropagation();
217
- if (delegateTarget.nodeName !== "LABEL") delegateTarget.click();
218
+ delegateTarget.click();
218
219
  };
219
220
  let HOVER;
220
221
  let TARGET$1;
@@ -280,9 +281,14 @@ onHotReload("dialog", () => [
280
281
  //#region src/fieldset/fieldset.ts
281
282
  const FIELDSETS = isBrowser() ? document.getElementsByTagName("fieldset") : [];
282
283
  const handleFieldsetMutations = () => {
283
- for (const el of FIELDSETS) {
284
- if (el.hasAttribute("aria-labelledby")) continue;
285
- attr(el, ARIA_LABELLEDBY, `${useId(el.querySelector("legend"))} ${useId(el.querySelector(":scope > :is([data-field=\"description\"],legend + p)"))}`.trim() || null);
284
+ for (const fieldset of FIELDSETS) {
285
+ if (fieldset.hasAttribute("aria-labelledby")) continue;
286
+ let labelledby = "";
287
+ for (const el of fieldset.children) {
288
+ const name = el.nodeName;
289
+ if (name === "LEGEND" || el.getAttribute("data-field") === "description" || name === "P" && el.previousElementSibling?.nodeName === "LEGEND") labelledby += `${useId(el)} `;
290
+ }
291
+ attr(fieldset, ARIA_LABELLEDBY, labelledby.trim() || null);
286
292
  }
287
293
  };
288
294
  onHotReload("fieldset", () => [onMutation(document, handleFieldsetMutations, {
@@ -699,7 +705,7 @@ function apply$1() {
699
705
  //#region src/invokers/invokers.ts
700
706
  if (isBrowser() && !isSupported$1()) apply$1();
701
707
  //#endregion
702
- //#region ../../node_modules/.pnpm/@oddbird+popover-polyfill@0.7.1/node_modules/@oddbird/popover-polyfill/dist/popover-fn.js
708
+ //#region ../../node_modules/.pnpm/@oddbird+popover-polyfill@0.7.1_patch_hash=6227913935a153774e0e2569cb889d63767e7a5d572dbc6beeadfb2e77ed5c11/node_modules/@oddbird/popover-polyfill/dist/popover-fn.js
703
709
  var ToggleEvent = class extends Event {
704
710
  oldState;
705
711
  newState;
@@ -1035,7 +1041,7 @@ function setInvokerAriaExpanded(el, force = false) {
1035
1041
  var ShadowRoot2 = globalThis.ShadowRoot || function() {};
1036
1042
  var DEFAULT_LAYER_NAME = "popover-polyfill";
1037
1043
  function isSupported() {
1038
- return typeof HTMLElement !== "undefined" && typeof HTMLElement.prototype === "object" && "popover" in HTMLElement.prototype;
1044
+ return typeof HTMLElement !== "undefined" && typeof HTMLElement.prototype === "object" && "popover" in HTMLElement.prototype && "showPopover" in HTMLElement.prototype;
1039
1045
  }
1040
1046
  function isPolyfilled() {
1041
1047
  var _a;
@@ -1054,7 +1060,7 @@ function hasLayerSupport() {
1054
1060
  function getStyles(layerName) {
1055
1061
  var _a;
1056
1062
  const useLayer = hasLayerSupport();
1057
- const layerNameEscaped = (layerName ?? ((_a = window.POPOVER_POLYFILL_OPTIONS) == null ? void 0 : _a.layerName) ?? DEFAULT_LAYER_NAME).split(".").map(CSS.escape).join(".");
1063
+ const layerNameEscaped = (layerName ?? ((_a = window.POPOVER_POLYFILL_OPTIONS) == null ? void 0 : _a.layerName) ?? DEFAULT_LAYER_NAME).split(".").map((c) => CSS.escape(c)).join(".");
1058
1064
  return `
1059
1065
  ${useLayer ? `@layer ${layerNameEscaped} {` : ""}
1060
1066
  :where([popover]) {
@@ -1128,7 +1134,7 @@ function injectStyles(root, layerName) {
1128
1134
  } catch {
1129
1135
  popoverStyleSheet = false;
1130
1136
  }
1131
- if (popoverStyleSheet === false) {
1137
+ if (popoverStyleSheet === false || !root.adoptedStyleSheets) {
1132
1138
  const sheet = document.createElement("style");
1133
1139
  sheet.textContent = styles;
1134
1140
  if (root instanceof Document) root.head.prepend(sheet);
@@ -1169,6 +1175,7 @@ function apply(opts) {
1169
1175
  showPopover: {
1170
1176
  enumerable: true,
1171
1177
  configurable: true,
1178
+ writable: true,
1172
1179
  value(options = {}) {
1173
1180
  showPopover(this);
1174
1181
  }
@@ -1176,6 +1183,7 @@ function apply(opts) {
1176
1183
  hidePopover: {
1177
1184
  enumerable: true,
1178
1185
  configurable: true,
1186
+ writable: true,
1179
1187
  value() {
1180
1188
  hidePopover(this, true, true);
1181
1189
  }
@@ -1183,6 +1191,7 @@ function apply(opts) {
1183
1191
  togglePopover: {
1184
1192
  enumerable: true,
1185
1193
  configurable: true,
1194
+ writable: true,
1186
1195
  value(options = {}) {
1187
1196
  if (typeof options === "boolean") options = { force: options };
1188
1197
  if (visibilityState.get(this) === "showing" && options.force === void 0 || options.force === false) hidePopover(this, true, true);
@@ -1282,7 +1291,7 @@ function apply(opts) {
1282
1291
  const onKeydown = (event) => {
1283
1292
  const key = event.key;
1284
1293
  const target = event.target;
1285
- if (!event.defaultPrevented && target && (key === "Escape" || key === "Esc")) hideAllPopoversUntil(target.ownerDocument, true, true);
1294
+ if (!event.defaultPrevented && target && (key === "Escape" || key === "Esc")) hideAllPopoversUntil(target.ownerDocument || target, true, true);
1286
1295
  };
1287
1296
  const addEventListeners = (root) => {
1288
1297
  root.addEventListener("click", handleInvokerActivation);
@@ -1321,6 +1330,7 @@ function toggle(el, newState, oldState, source) {
1321
1330
  const shiftProp = placement.match(/left|right/gi) ? "Height" : "Width";
1322
1331
  const shiftLimit = source[`offset${shiftProp}`] / 2 + arrowSize;
1323
1332
  if (placement === "none") return;
1333
+ let sized = false;
1324
1334
  const options = {
1325
1335
  strategy: "absolute",
1326
1336
  placement,
@@ -1336,8 +1346,14 @@ function toggle(el, newState, oldState, source) {
1336
1346
  crossAxis: false
1337
1347
  })] : [],
1338
1348
  ...overscroll ? [size({ apply({ availableHeight }) {
1339
- if (overscroll === "fit") el.style.width = `${source.offsetWidth}px`;
1340
- el.style.maxHeight = `${Math.max(50, availableHeight - padding * 2)}px`;
1349
+ if (sized) return;
1350
+ sized = true;
1351
+ const width = `${source.offsetWidth}px`;
1352
+ const maxHeight = `${Math.max(50, availableHeight - padding * 2)}px`;
1353
+ requestAnimationFrame(() => {
1354
+ if (overscroll === "fit" && el.style.width !== width) el.style.width = width;
1355
+ if (el.style.maxHeight !== maxHeight) el.style.maxHeight = maxHeight;
1356
+ });
1341
1357
  } })] : []
1342
1358
  ]
1343
1359
  };
@@ -1363,40 +1379,62 @@ const handleClick$1 = (e) => {
1363
1379
  if (root instanceof ShadowRoot && !ROOTS.has(root)) ROOTS.set(root, on(root, "toggle", handleToggle, QUICK_EVENT));
1364
1380
  };
1365
1381
  onHotReload("popover", () => {
1366
- const isFunction = (fn) => typeof fn === "function";
1382
+ const descriptors = Object.getOwnPropertyDescriptors(HTMLElement.prototype);
1367
1383
  const togglePopover = HTMLElement.prototype.togglePopover;
1368
1384
  const showPopover = HTMLElement.prototype.showPopover;
1369
1385
  const hidePopover = HTMLElement.prototype.hidePopover;
1370
- if (isFunction(togglePopover)) HTMLElement.prototype.togglePopover = function(opt) {
1371
- const isOpen = this.matches(":popover-open");
1372
- const isBool = typeof opt === "boolean";
1373
- const prev = isOpen ? "open" : "closed";
1374
- const next = (isBool ? opt : opt?.force ?? !isOpen) ? "open" : "closed";
1375
- const source = isBool ? void 0 : opt?.source;
1376
- const result = togglePopover.call(this, opt);
1377
- toggle(this, next, prev, source);
1378
- return result;
1379
- };
1380
- if (isFunction(showPopover)) HTMLElement.prototype.showPopover = function(opt) {
1381
- const prev = this.matches(":popover-open") ? "open" : "closed";
1382
- const result = showPopover.call(this, opt);
1383
- toggle(this, "open", prev, opt?.source);
1384
- return result;
1385
- };
1386
- if (isFunction(hidePopover)) HTMLElement.prototype.hidePopover = function() {
1387
- const prev = this.matches(":popover-open") ? "open" : "closed";
1388
- const result = hidePopover.call(this);
1389
- toggle(this, "closed", prev);
1390
- return result;
1391
- };
1386
+ Object.defineProperties(HTMLElement.prototype, {
1387
+ togglePopover: {
1388
+ ...descriptors.togglePopover,
1389
+ value(opt) {
1390
+ const isOpen = this.matches(":popover-open");
1391
+ const isBool = typeof opt === "boolean";
1392
+ const prev = isOpen ? "open" : "closed";
1393
+ const next = (isBool ? opt : opt?.force ?? !isOpen) ? "open" : "closed";
1394
+ const source = isBool ? void 0 : opt?.source;
1395
+ const result = togglePopover?.call(this, opt);
1396
+ toggle(this, next, prev, source);
1397
+ return result;
1398
+ }
1399
+ },
1400
+ showPopover: {
1401
+ ...descriptors.showPopover,
1402
+ value(opt) {
1403
+ const prev = this.matches(":popover-open") ? "open" : "closed";
1404
+ const result = showPopover?.call(this, opt);
1405
+ toggle(this, "open", prev, opt?.source);
1406
+ return result;
1407
+ }
1408
+ },
1409
+ hidePopover: {
1410
+ ...descriptors.hidePopover,
1411
+ value() {
1412
+ const prev = this.matches(":popover-open") ? "open" : "closed";
1413
+ const result = hidePopover?.call(this);
1414
+ toggle(this, "closed", prev);
1415
+ return result;
1416
+ }
1417
+ }
1418
+ });
1392
1419
  return [
1393
1420
  on(document, "click", handleClick$1, QUICK_EVENT),
1394
1421
  on(document, "pointerdown pointerup scroll", handleScrollbar, QUICK_EVENT),
1395
1422
  on(document, "toggle ds-toggle-source", handleToggle, QUICK_EVENT),
1396
1423
  () => {
1397
- HTMLElement.prototype.togglePopover = togglePopover;
1398
- HTMLElement.prototype.showPopover = showPopover;
1399
- HTMLElement.prototype.hidePopover = hidePopover;
1424
+ Object.defineProperties(HTMLElement.prototype, {
1425
+ togglePopover: {
1426
+ ...descriptors.togglePopover,
1427
+ value: togglePopover
1428
+ },
1429
+ showPopover: {
1430
+ ...descriptors.showPopover,
1431
+ value: showPopover
1432
+ },
1433
+ hidePopover: {
1434
+ ...descriptors.hidePopover,
1435
+ value: hidePopover
1436
+ }
1437
+ });
1400
1438
  for (const [, off] of ROOTS) off();
1401
1439
  ROOTS.clear();
1402
1440
  }
@@ -1688,9 +1726,12 @@ const render$2 = (self) => {
1688
1726
  customElements.define("ds-error-summary", DSErrorSummaryElement);
1689
1727
  //#endregion
1690
1728
  //#region src/field/field.ts
1729
+ const ATTR_FIELD = "data-field";
1730
+ const ATTR_LIMIT = "data-limit";
1691
1731
  const ATTR_INVALID = "aria-invalid";
1692
1732
  const ATTR_DESCRIBEDBY = "aria-describedby";
1693
1733
  const ATTR_INDETERMINATE = "data-indeterminate";
1734
+ const SELECTOR_VALIDATION = `:scope > [${ATTR_FIELD}="validation"]`;
1694
1735
  const COUNTER_DEBOUNCE = isWindows() ? 800 : 200;
1695
1736
  const WARNING_MULTIPLE_INPUTS = `Fields should only have one input element. Use <fieldset> to group multiple fields:`;
1696
1737
  const handleFieldMutation = (field) => {
@@ -1706,22 +1747,22 @@ const handleFieldMutation = (field) => {
1706
1747
  if (isInputLike(el)) if (field._input?.isConnected && field._input !== el) warn(WARNING_MULTIPLE_INPUTS, field);
1707
1748
  else field._input = el;
1708
1749
  else {
1709
- const type = el.getAttribute("data-field");
1750
+ const type = el.getAttribute(ATTR_FIELD);
1710
1751
  if (type === "counter") field._counter = el;
1711
1752
  if (type === "validation") {
1712
1753
  nextDescs.unshift(useId(el));
1713
1754
  hasValidation = true;
1714
- invalid = invalid || isInvalid(el);
1755
+ invalid = invalid || isInvalidColor(el);
1715
1756
  } else if (type) nextDescs.push(useId(el));
1716
1757
  }
1717
1758
  }
1718
1759
  if (!field._input?.isConnected) return;
1719
1760
  const input = field._input;
1720
1761
  for (const label of labels) attr(label, "for", useId(input) || null);
1721
- const fieldsetValidation = field.closest("fieldset")?.querySelector(":scope > [data-field=\"validation\"]");
1762
+ const fieldsetValidation = field.closest("fieldset")?.querySelector(SELECTOR_VALIDATION);
1722
1763
  if (fieldsetValidation && !fieldsetValidation?.hidden) {
1723
1764
  hasValidation = true;
1724
- invalid = invalid || isInvalid(fieldsetValidation);
1765
+ invalid = invalid || isInvalidColor(fieldsetValidation);
1725
1766
  nextDescs.unshift(useId(fieldsetValidation));
1726
1767
  }
1727
1768
  const indeterminate = attr(input, ATTR_INDETERMINATE);
@@ -1732,7 +1773,7 @@ const handleFieldMutation = (field) => {
1732
1773
  field._descs = nextDescs;
1733
1774
  const hadValidation = field._validation;
1734
1775
  if (hasValidation && !hadValidation && !input.hasAttribute(ATTR_INVALID)) {
1735
- attr(input, ATTR_INVALID, "true");
1776
+ attr(input, ATTR_INVALID, invalid ? "true" : null);
1736
1777
  field._validation = true;
1737
1778
  } else if (!hasValidation && hadValidation) {
1738
1779
  attr(input, ATTR_INVALID, null);
@@ -1745,9 +1786,12 @@ const TEXTS = {
1745
1786
  under: "%d tegn igjen"
1746
1787
  };
1747
1788
  const debouncedCounterLiveRegion = debounce((input, text) => {
1748
- if (document.activeElement === input) announce(text);
1789
+ if (document?.activeElement === input) announce(text);
1749
1790
  }, COUNTER_DEBOUNCE);
1750
- const isInvalid = (el) => el.getAttribute("data-color") !== "success";
1791
+ const isInvalidColor = (el) => {
1792
+ const color = el.getAttribute("data-color");
1793
+ return !color || color === "danger";
1794
+ };
1751
1795
  const isInputLike = (el) => el instanceof HTMLElement && "validity" in el && !(el instanceof HTMLButtonElement) && el.type !== "hidden";
1752
1796
  var DSFieldElement = class extends DSElement {
1753
1797
  _counter;
@@ -1760,8 +1804,8 @@ var DSFieldElement = class extends DSElement {
1760
1804
  this._unevents = on(this, "input", this, QUICK_EVENT);
1761
1805
  this._unmutate = onMutation(this, () => handleFieldMutation(this), {
1762
1806
  attributeFilter: [
1763
- "data-field",
1764
- "data-limit",
1807
+ ATTR_FIELD,
1808
+ ATTR_LIMIT,
1765
1809
  "hidden",
1766
1810
  "id",
1767
1811
  "value",
@@ -1775,13 +1819,14 @@ var DSFieldElement = class extends DSElement {
1775
1819
  handleEvent(event) {
1776
1820
  const { _counter, _input } = this;
1777
1821
  if (_counter?.isConnected && _input) {
1778
- const count = (Number(attr(_counter, "data-limit")) || 0) - _input.value.length;
1822
+ const count = (Number(attr(_counter, ATTR_LIMIT)) || 0) - _input.value.length;
1779
1823
  const state = count < 0 ? "over" : "under";
1780
1824
  const label = (attrOrCSS(_counter, `data-${state}`) || TEXTS[state])?.replace("%d", `${Math.abs(count)}`);
1781
1825
  if (!label) warn(`Missing data-${state} on:`, _counter);
1782
1826
  attr(_counter, "data-label", label);
1783
1827
  attr(_counter, "data-state", state);
1784
1828
  attr(_counter, "data-color", count < 0 ? "danger" : null);
1829
+ attr(_input, "aria-invalid", count < 0 ? "true" : null);
1785
1830
  if (event?.type === "input" && label) debouncedCounterLiveRegion(_input, label);
1786
1831
  }
1787
1832
  if (_input instanceof HTMLTextAreaElement) {
@@ -1902,14 +1947,12 @@ var DSSuggestionElement = class extends UHTMLComboboxElement {
1902
1947
  const render = (self) => {
1903
1948
  const { control, list } = self;
1904
1949
  const datalist = list || self.querySelector("u-datalist");
1905
- if (control) {
1906
- attr(control, "popovertarget", list ? useId(list) : null);
1907
- if (!control.placeholder) attr(control, "placeholder", " ");
1908
- }
1950
+ if (control) attr(control, "popovertarget", list ? useId(list) : null);
1909
1951
  if (datalist) {
1910
1952
  attr(datalist, "popover", "manual");
1911
1953
  attr(datalist, "data-is-floating", "true");
1912
1954
  }
1955
+ handleEmpty({ currentTarget: self });
1913
1956
  };
1914
1957
  const handleEmpty = ({ currentTarget: self }) => {
1915
1958
  const { creatable, control, options } = self;