@r2digisolutions/components 0.21.26 → 0.21.27

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.
@@ -17,6 +17,8 @@
17
17
  label?: string;
18
18
  hint?: string;
19
19
  accept?: string;
20
+ /** Form field name for the hidden file input (default `'files'`). */
21
+ name?: string;
20
22
  /** Allow selecting more than one file (default true). */
21
23
  multiple?: boolean;
22
24
  /** Cap on how many files can be kept when multiple. */
@@ -38,6 +40,7 @@
38
40
  label = 'Drop files here',
39
41
  hint = 'or click to browse',
40
42
  accept,
43
+ name = 'files',
41
44
  multiple = true,
42
45
  maxFiles,
43
46
  disabled = false,
@@ -50,6 +53,8 @@
50
53
  onremove
51
54
  }: DropZoneProps = $props();
52
55
 
56
+ const inputId = $props.id();
57
+
53
58
  let dragging = $state(false);
54
59
  let error = $state('');
55
60
  let inputEl = $state<HTMLInputElement | null>(null);
@@ -257,8 +262,11 @@
257
262
  </div>
258
263
  <input
259
264
  bind:this={inputEl}
265
+ id={inputId}
266
+ {name}
260
267
  type="file"
261
268
  class="sr-only"
269
+ aria-label={label}
262
270
  {accept}
263
271
  {multiple}
264
272
  {disabled}
@@ -8,6 +8,8 @@ interface DropZoneProps {
8
8
  label?: string;
9
9
  hint?: string;
10
10
  accept?: string;
11
+ /** Form field name for the hidden file input (default `'files'`). */
12
+ name?: string;
11
13
  /** Allow selecting more than one file (default true). */
12
14
  multiple?: boolean;
13
15
  /** Cap on how many files can be kept when multiple. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@r2digisolutions/components",
3
- "version": "0.21.26",
3
+ "version": "0.21.27",
4
4
  "private": false,
5
5
  "description": "R2DigiSolutions Svelte 5 component library — Atomic Design, Tailwind 4, Light/Dark mode",
6
6
  "license": "MIT",