ui-ingredients 0.0.35 → 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
  }
@@ -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
  }
@@ -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
  }
@@ -28,6 +28,7 @@ export declare function createField(props: CreateFieldProps): {
28
28
  readonly required: boolean;
29
29
  readonly readOnly: boolean;
30
30
  readonly invalid: boolean;
31
+ readonly 'aria-describedby': string;
31
32
  getRootProps: () => HTMLProps<"div">;
32
33
  getLabelProps: () => HTMLProps<"label">;
33
34
  getErrorTextProps: () => HTMLProps<"div">;
@@ -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),
@@ -151,6 +152,9 @@ export function createField(props) {
151
152
  get invalid() {
152
153
  return invalid;
153
154
  },
155
+ get 'aria-describedby'() {
156
+ return ariaDescribedby;
157
+ },
154
158
  getRootProps,
155
159
  getLabelProps,
156
160
  getErrorTextProps,
@@ -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
  }
@@ -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
  }
@@ -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;
@@ -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
  }
@@ -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
  }
@@ -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
  }
@@ -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
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ui-ingredients",
3
3
  "type": "module",
4
- "version": "0.0.35",
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",