@r2digisolutions/components 0.25.13 → 0.25.15

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.
@@ -6,6 +6,8 @@
6
6
  description?: string;
7
7
  icon?: Snippet;
8
8
  action?: Snippet;
9
+ /** Heading level of the title, to keep the page outline in order. Default 3. */
10
+ headingLevel?: 2 | 3 | 4 | 5 | 6;
9
11
  class?: string;
10
12
  }
11
13
 
@@ -14,6 +16,7 @@
14
16
  description = 'There are no items to display right now.',
15
17
  icon,
16
18
  action,
19
+ headingLevel = 3,
17
20
  class: className = ''
18
21
  }: EmptyStateProps = $props();
19
22
  </script>
@@ -35,7 +38,9 @@
35
38
  {/if}
36
39
  </div>
37
40
 
38
- <h3 class="text-base font-semibold text-primary mb-1">{title}</h3>
41
+ <svelte:element this={`h${headingLevel}`} class="text-base font-semibold text-primary mb-1"
42
+ >{title}</svelte:element
43
+ >
39
44
  {#if description}
40
45
  <p class="text-xs text-muted max-w-sm leading-relaxed mb-5">{description}</p>
41
46
  {/if}
@@ -4,6 +4,8 @@ interface EmptyStateProps {
4
4
  description?: string;
5
5
  icon?: Snippet;
6
6
  action?: Snippet;
7
+ /** Heading level of the title, to keep the page outline in order. Default 3. */
8
+ headingLevel?: 2 | 3 | 4 | 5 | 6;
7
9
  class?: string;
8
10
  }
9
11
  declare const EmptyState: import("svelte").Component<EmptyStateProps, {}, "">;
@@ -87,6 +87,8 @@
87
87
 
88
88
  const labelId = $derived(`${id}-label`);
89
89
  const helperId = $derived(`${id}-helper`);
90
+ // The visible dropzone text must be part of its accessible name (WCAG 2.5.3 Label in Name).
91
+ const dropzoneContentId = $derived(`${id}-dropzone-content`);
90
92
  const errorId = $derived(`${id}-error`);
91
93
  const maxBytes = $derived(maxSizeMb * 1024 * 1024);
92
94
 
@@ -318,10 +320,8 @@
318
320
  <div
319
321
  role="button"
320
322
  tabindex={disabled ? -1 : 0}
321
- aria-labelledby={resolvedLabel ? labelId : undefined}
322
- aria-describedby={[resolvedHelperText ? helperId : '', errorMessage ? errorId : '']
323
- .filter(Boolean)
324
- .join(' ') || undefined}
323
+ aria-labelledby={resolvedLabel ? `${labelId} ${dropzoneContentId}` : dropzoneContentId}
324
+ aria-describedby={errorMessage ? errorId : undefined}
325
325
  aria-disabled={disabled || undefined}
326
326
  ondragenter={handleDragEnter}
327
327
  ondragover={handleDragOver}
@@ -346,6 +346,7 @@
346
346
  ]}
347
347
  >
348
348
  <div
349
+ id={dropzoneContentId}
349
350
  class={[
350
351
  'flex',
351
352
  vertical
@@ -398,7 +399,7 @@
398
399
  {#if resolvedHelperText}
399
400
  <p
400
401
  id={helperId}
401
- class={['mt-0.5 leading-relaxed text-secondary text-[11px]', vertical && 'text-center']}
402
+ class={['mt-0.5 leading-relaxed text-secondary text-xs', vertical && 'text-center']}
402
403
  >
403
404
  {resolvedHelperText}
404
405
  </p>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@r2digisolutions/components",
3
- "version": "0.25.13",
3
+ "version": "0.25.15",
4
4
  "private": false,
5
5
  "description": "R2DigiSolutions Svelte 5 component library — Atomic Design, Tailwind 4, Light/Dark mode",
6
6
  "license": "MIT",