ui-ingredients 0.0.36 → 0.0.37

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,6 +22,17 @@ export function createCheckbox(props) {
22
22
  dir: locale?.dir,
23
23
  getRootNode: environment?.getRootNode,
24
24
  }));
25
- const api = $derived(reflect(() => checkbox.connect(state, send, normalizeProps)));
25
+ const api = $derived(reflect(() => {
26
+ const o = checkbox.connect(state, send, normalizeProps);
27
+ return {
28
+ ...o,
29
+ getHiddenInputProps() {
30
+ return {
31
+ 'aria-describedby': field?.['aria-describedby'],
32
+ ...o.getHiddenInputProps(),
33
+ };
34
+ },
35
+ };
36
+ }));
26
37
  return api;
27
38
  }
@@ -5,16 +5,14 @@
5
5
  </script>
6
6
 
7
7
  <script lang="ts">
8
- import {getFieldContext} from '../field/context.svelte.js';
9
8
  import {mergeProps} from '../merge-props.js';
10
9
  import {checkboxContext} from './context.svelte.js';
11
10
 
12
11
  let {...props}: CheckboxHiddenInputProps = $props();
13
12
 
14
- let field = getFieldContext();
15
13
  let checkbox = checkboxContext.get();
16
14
 
17
15
  let mergedProps = $derived(mergeProps(props, checkbox.getHiddenInputProps()));
18
16
  </script>
19
17
 
20
- <input aria-describedby={field?.['aria-describedby']} {...mergedProps} />
18
+ <input {...mergedProps} />
@@ -31,9 +31,18 @@ export function createCombobox(props) {
31
31
  'open.controlled': props.open != null,
32
32
  collection,
33
33
  }));
34
- const api = $derived(reflect(() => ({
35
- ...combobox.connect(state, send, normalizeProps),
36
- collection,
37
- })));
34
+ const api = $derived(reflect(() => {
35
+ const o = combobox.connect(state, send, normalizeProps);
36
+ return {
37
+ ...o,
38
+ getInputProps() {
39
+ return {
40
+ 'aria-describedby': field?.['aria-describedby'],
41
+ ...o.getInputProps(),
42
+ };
43
+ },
44
+ collection,
45
+ };
46
+ }));
38
47
  return api;
39
48
  }
@@ -7,13 +7,11 @@
7
7
  </script>
8
8
 
9
9
  <script lang="ts">
10
- import {getFieldContext} from '../field/context.svelte.js';
11
10
  import {mergeProps} from '../merge-props.js';
12
11
  import {comboboxContext} from './context.svelte.js';
13
12
 
14
13
  let {asChild, ...props}: ComboboxInputProps = $props();
15
14
 
16
- let field = getFieldContext();
17
15
  let combobox = comboboxContext.get();
18
16
 
19
17
  let mergedProps = $derived(mergeProps(props, combobox.getInputProps()));
@@ -22,5 +20,5 @@
22
20
  {#if asChild}
23
21
  {@render asChild(mergedProps)}
24
22
  {:else}
25
- <input aria-describedby={field?.['aria-describedby']} {...mergedProps} />
23
+ <input {...mergedProps} />
26
24
  {/if}
@@ -24,6 +24,17 @@ export function createEditable(props) {
24
24
  getRootNode: environment?.getRootNode,
25
25
  'edit.controlled': props.edit != null,
26
26
  }));
27
- const api = $derived(reflect(() => editable.connect(state, send, normalizeProps)));
27
+ const api = $derived(reflect(() => {
28
+ const o = editable.connect(state, send, normalizeProps);
29
+ return {
30
+ ...o,
31
+ getInputProps() {
32
+ return {
33
+ 'aria-describedby': field?.['aria-describedby'],
34
+ ...o.getInputProps(),
35
+ };
36
+ },
37
+ };
38
+ }));
28
39
  return api;
29
40
  }
@@ -7,13 +7,11 @@
7
7
  </script>
8
8
 
9
9
  <script lang="ts">
10
- import {getFieldContext} from '../field/context.svelte.js';
11
10
  import {mergeProps} from '../merge-props.js';
12
11
  import {editableContext} from './context.svelte.js';
13
12
 
14
13
  let {asChild, ...props}: EditableInputProps = $props();
15
14
 
16
- let field = getFieldContext();
17
15
  let editable = editableContext.get();
18
16
 
19
17
  let mergedProps = $derived(mergeProps(props, editable.getInputProps()));
@@ -22,5 +20,5 @@
22
20
  {#if asChild}
23
21
  {@render asChild(mergedProps)}
24
22
  {:else}
25
- <input aria-describedby={field?.['aria-describedby']} {...mergedProps} />
23
+ <input {...mergedProps} />
26
24
  {/if}
@@ -76,6 +76,7 @@ export function createField(props) {
76
76
  ...parts.errorText.attrs,
77
77
  id: ids.errorText,
78
78
  hidden: !hasErrorText,
79
+ 'aria-live': 'polite',
79
80
  'data-invalid': dataAttr(invalid),
80
81
  'data-disabled': dataAttr(disabled),
81
82
  'data-required': dataAttr(required),
@@ -21,6 +21,17 @@ export function createFileUpload(props) {
21
21
  locale: props.locale ?? locale?.locale,
22
22
  getRootNode: environment?.getRootNode,
23
23
  }));
24
- const api = $derived(reflect(() => fileUpload.connect(state, send, normalizeProps)));
24
+ const api = $derived(reflect(() => {
25
+ const o = fileUpload.connect(state, send, normalizeProps);
26
+ return {
27
+ ...o,
28
+ getHiddenInputProps() {
29
+ return {
30
+ 'aria-describedby': field?.['aria-describedby'],
31
+ ...o.getHiddenInputProps(),
32
+ };
33
+ },
34
+ };
35
+ }));
25
36
  return api;
26
37
  }
@@ -5,13 +5,11 @@
5
5
  </script>
6
6
 
7
7
  <script lang="ts">
8
- import {getFieldContext} from '../field/context.svelte.js';
9
8
  import {mergeProps} from '../merge-props.js';
10
9
  import {fileUploadContext} from './context.svelte.js';
11
10
 
12
11
  let {...props}: FileUploadHiddenInputProps = $props();
13
12
 
14
- let field = getFieldContext();
15
13
  let fileUpload = fileUploadContext.get();
16
14
 
17
15
  let mergedProps = $derived(
@@ -19,4 +17,4 @@
19
17
  );
20
18
  </script>
21
19
 
22
- <input aria-describedby={field?.['aria-describedby']} {...mergedProps} />
20
+ <input {...mergedProps} />
@@ -23,6 +23,17 @@ export function createNumberInput(props) {
23
23
  locale: props.locale ?? locale?.locale,
24
24
  getRootNode: environment?.getRootNode,
25
25
  }));
26
- const api = $derived(reflect(() => numberInput.connect(state, send, normalizeProps)));
26
+ const api = $derived(reflect(() => {
27
+ const o = numberInput.connect(state, send, normalizeProps);
28
+ return {
29
+ ...o,
30
+ getInputProps() {
31
+ return {
32
+ 'aria-describedby': field?.['aria-describedby'],
33
+ ...o.getInputProps(),
34
+ };
35
+ },
36
+ };
37
+ }));
27
38
  return api;
28
39
  }
@@ -7,13 +7,11 @@
7
7
  </script>
8
8
 
9
9
  <script lang="ts">
10
- import {getFieldContext} from '../field/context.svelte.js';
11
10
  import {mergeProps} from '../merge-props.js';
12
11
  import {numberInputContext} from './context.svelte.js';
13
12
 
14
13
  let {asChild, ...props}: NumberInputInputProps = $props();
15
14
 
16
- let field = getFieldContext();
17
15
  let numberInput = numberInputContext.get();
18
16
 
19
17
  let mergedProps = $derived(mergeProps(props, numberInput.getInputProps()));
@@ -22,5 +20,5 @@
22
20
  {#if asChild}
23
21
  {@render asChild(mergedProps)}
24
22
  {:else}
25
- <input aria-describedby={field?.['aria-describedby']} {...mergedProps} />
23
+ <input {...mergedProps} />
26
24
  {/if}
@@ -33,6 +33,12 @@ export function createPinInputContext(props) {
33
33
  },
34
34
  };
35
35
  },
36
+ getHiddenInputProps() {
37
+ return {
38
+ 'aria-describedby': field?.['aria-describedby'],
39
+ ...o.getHiddenInputProps(),
40
+ };
41
+ },
36
42
  };
37
43
  }));
38
44
  return api;
@@ -5,16 +5,14 @@
5
5
  </script>
6
6
 
7
7
  <script lang="ts">
8
- import {getFieldContext} from '../field/context.svelte.js';
9
8
  import {mergeProps} from '../merge-props.js';
10
9
  import {pinInputContext} from './context.svelte.js';
11
10
 
12
11
  let {...props}: PinInputHiddenInputProps = $props();
13
12
 
14
- let field = getFieldContext();
15
13
  let pinInput = pinInputContext.get();
16
14
 
17
15
  let mergedProps = $derived(mergeProps(props, pinInput.getHiddenInputProps()));
18
16
  </script>
19
17
 
20
- <input aria-describedby={field?.['aria-describedby']} {...mergedProps} />
18
+ <input {...mergedProps} />
@@ -21,6 +21,17 @@ export function createRatingGroup(props) {
21
21
  dir: locale?.dir,
22
22
  getRootNode: environment?.getRootNode,
23
23
  }));
24
- const api = $derived(reflect(() => ratingGroup.connect(state, send, normalizeProps)));
24
+ const api = $derived(reflect(() => {
25
+ const o = ratingGroup.connect(state, send, normalizeProps);
26
+ return {
27
+ ...o,
28
+ getHiddenInputProps() {
29
+ return {
30
+ 'aria-describedby': field?.['aria-describedby'],
31
+ ...o.getHiddenInputProps(),
32
+ };
33
+ },
34
+ };
35
+ }));
25
36
  return api;
26
37
  }
@@ -5,13 +5,11 @@
5
5
  </script>
6
6
 
7
7
  <script lang="ts">
8
- import {getFieldContext} from '../field/context.svelte.js';
9
8
  import {mergeProps} from '../merge-props.js';
10
9
  import {ratingGroupContext} from './context.svelte.js';
11
10
 
12
11
  let {...props}: RatingGroupHiddenInputProps = $props();
13
12
 
14
- let field = getFieldContext();
15
13
  let radioGroup = ratingGroupContext.get();
16
14
 
17
15
  let mergedProps = $derived(
@@ -19,4 +17,4 @@
19
17
  );
20
18
  </script>
21
19
 
22
- <input aria-describedby={field?.['aria-describedby']} {...mergedProps} />
20
+ <input {...mergedProps} />
@@ -31,9 +31,18 @@ export function createSelect(props) {
31
31
  collection,
32
32
  'open.controlled': props.open != null,
33
33
  }));
34
- const api = $derived(reflect(() => ({
35
- ...select.connect(state, send, normalizeProps),
36
- collection,
37
- })));
34
+ const api = $derived(reflect(() => {
35
+ const o = select.connect(state, send, normalizeProps);
36
+ return {
37
+ ...o,
38
+ collection,
39
+ getHiddenSelectProps() {
40
+ return {
41
+ 'aria-describedby': field?.['aria-describedby'],
42
+ ...o.getHiddenSelectProps(),
43
+ };
44
+ },
45
+ };
46
+ }));
38
47
  return api;
39
48
  }
@@ -5,18 +5,16 @@
5
5
  </script>
6
6
 
7
7
  <script lang="ts">
8
- import {getFieldContext} from '../field/context.svelte.js';
9
8
  import {mergeProps} from '../merge-props.js';
10
9
  import {selectContext} from './context.svelte.js';
11
10
 
12
11
  let {children, ...props}: SelectHiddenSelectProps = $props();
13
12
 
14
- let field = getFieldContext();
15
13
  let select = selectContext.get();
16
14
 
17
15
  let mergedProps = $derived(mergeProps(props, select.getHiddenSelectProps()));
18
16
  </script>
19
17
 
20
- <select aria-describedby={field?.['aria-describedby']} {...mergedProps}>
18
+ <select {...mergedProps}>
21
19
  {@render children?.()}
22
20
  </select>
@@ -22,6 +22,17 @@ export function createSwitch(props) {
22
22
  dir: locale?.dir,
23
23
  getRootNode: environment?.getRootNode,
24
24
  }));
25
- const api = $derived(reflect(() => switch$.connect(state, send, normalizeProps)));
25
+ const api = $derived(reflect(() => {
26
+ const o = switch$.connect(state, send, normalizeProps);
27
+ return {
28
+ ...o,
29
+ getHiddenInputProps() {
30
+ return {
31
+ 'aria-describedby': field?.['aria-describedby'],
32
+ ...o.getHiddenInputProps(),
33
+ };
34
+ },
35
+ };
36
+ }));
26
37
  return api;
27
38
  }
@@ -5,16 +5,14 @@
5
5
  </script>
6
6
 
7
7
  <script lang="ts">
8
- import {getFieldContext} from '../field/context.svelte.js';
9
8
  import {mergeProps} from '../merge-props.js';
10
9
  import {switchContext} from './context.svelte.js';
11
10
 
12
11
  let {...props}: SwitchHiddenInputProps = $props();
13
12
 
14
- let field = getFieldContext();
15
13
  let switch$ = switchContext.get();
16
14
 
17
15
  let mergedProps = $derived(mergeProps(props, switch$.getHiddenInputProps()));
18
16
  </script>
19
17
 
20
- <input aria-describedby={field?.['aria-describedby']} {...mergedProps} />
18
+ <input {...mergedProps} />
@@ -22,6 +22,17 @@ export function createTagsInput(props) {
22
22
  dir: locale?.dir,
23
23
  getRootNode: environment?.getRootNode,
24
24
  }));
25
- const api = $derived(reflect(() => tagsInput.connect(state, send, normalizeProps)));
25
+ const api = $derived(reflect(() => {
26
+ const o = tagsInput.connect(state, send, normalizeProps);
27
+ return {
28
+ ...o,
29
+ getHiddenInputProps() {
30
+ return {
31
+ 'aria-describedby': field?.['aria-describedby'],
32
+ ...o.getHiddenInputProps(),
33
+ };
34
+ },
35
+ };
36
+ }));
26
37
  return api;
27
38
  }
@@ -5,13 +5,11 @@
5
5
  </script>
6
6
 
7
7
  <script lang="ts">
8
- import {getFieldContext} from '../field/context.svelte.js';
9
8
  import {mergeProps} from '../merge-props.js';
10
9
  import {tagsInputContext} from './context.svelte.js';
11
10
 
12
11
  let {...props}: TagsInputHiddenInputProps = $props();
13
12
 
14
- let field = getFieldContext();
15
13
  let tagsInput = tagsInputContext.get();
16
14
 
17
15
  let mergedProps = $derived(
@@ -19,4 +17,4 @@
19
17
  );
20
18
  </script>
21
19
 
22
- <input aria-describedby={field?.['aria-describedby']} {...mergedProps} />
20
+ <input {...mergedProps} />
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ui-ingredients",
3
3
  "type": "module",
4
- "version": "0.0.36",
4
+ "version": "0.0.37",
5
5
  "packageManager": "pnpm@9.7.0",
6
6
  "svelte": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",