ui-ingredients 0.0.34 → 0.0.36
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +2 -2
- package/dist/checkbox/hidden-input.svelte +3 -1
- package/dist/combobox/input.svelte +3 -1
- package/dist/editable/input.svelte +3 -1
- package/dist/field/create-field.svelte.d.ts +1 -0
- package/dist/field/create-field.svelte.js +3 -0
- package/dist/file-upload/hidden-input.svelte +3 -1
- package/dist/number-input/input.svelte +3 -1
- package/dist/pin-input/hidden-input.svelte +3 -1
- package/dist/qr-code/context.svelte.d.ts +2 -2
- package/dist/qr-code/create-qr-code.svelte.d.ts +3 -3
- package/dist/qr-code/frame.svelte +2 -2
- package/dist/qr-code/frame.svelte.d.ts +1 -1
- package/dist/qr-code/index.d.ts +5 -5
- package/dist/qr-code/index.js +1 -1
- package/dist/qr-code/overlay.svelte +2 -2
- package/dist/qr-code/overlay.svelte.d.ts +1 -1
- package/dist/qr-code/pattern.svelte +2 -2
- package/dist/qr-code/pattern.svelte.d.ts +1 -1
- package/dist/qr-code/root.svelte +8 -8
- package/dist/qr-code/root.svelte.d.ts +1 -1
- package/dist/rating-group/hidden-input.svelte +3 -1
- package/dist/select/hidden-select.svelte +3 -1
- package/dist/switch/hidden-input.svelte +3 -1
- package/dist/tags-input/hidden-input.svelte +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
@@ -43,7 +43,7 @@ npm install ui-ingredients
|
|
43
43
|
- [Clipboard](https://github.com/calvo-jp/ui-ingredients/blob/main/docs/clipboard.md)
|
44
44
|
- [Collapsible](https://github.com/calvo-jp/ui-ingredients/blob/main/docs/collapsible.md)
|
45
45
|
- [Combobox](https://github.com/calvo-jp/ui-ingredients/blob/main/docs/combobox.md)
|
46
|
-
- [DatePicker](https://github.com/calvo-jp/ui-ingredients/blob/main/docs/
|
46
|
+
- [DatePicker](https://github.com/calvo-jp/ui-ingredients/blob/main/docs/date-picker.md)
|
47
47
|
- [Dialog](https://github.com/calvo-jp/ui-ingredients/blob/main/docs/dialog.md)
|
48
48
|
- [Editable](https://github.com/calvo-jp/ui-ingredients/blob/main/docs/editable.md)
|
49
49
|
- [Field](https://github.com/calvo-jp/ui-ingredients/blob/main/docs/field.md)
|
@@ -56,7 +56,7 @@ npm install ui-ingredients
|
|
56
56
|
- [Popover](https://github.com/calvo-jp/ui-ingredients/blob/main/docs/popover.md)
|
57
57
|
- [Portal](https://github.com/calvo-jp/ui-ingredients/blob/main/docs/portal.md)
|
58
58
|
- [Progress](https://github.com/calvo-jp/ui-ingredients/blob/main/docs/progress.md)
|
59
|
-
- [
|
59
|
+
- [QrCode](https://github.com/calvo-jp/ui-ingredients/blob/main/docs/qr-code.md)
|
60
60
|
- [RadioGroup](https://github.com/calvo-jp/ui-ingredients/blob/main/docs/radio-group.md)
|
61
61
|
- [RatingGroup](https://github.com/calvo-jp/ui-ingredients/blob/main/docs/rating-group.md)
|
62
62
|
- [Select](https://github.com/calvo-jp/ui-ingredients/blob/main/docs/select.md)
|
@@ -5,14 +5,16 @@
|
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
8
|
+
import {getFieldContext} from '../field/context.svelte.js';
|
8
9
|
import {mergeProps} from '../merge-props.js';
|
9
10
|
import {checkboxContext} from './context.svelte.js';
|
10
11
|
|
11
12
|
let {...props}: CheckboxHiddenInputProps = $props();
|
12
13
|
|
14
|
+
let field = getFieldContext();
|
13
15
|
let checkbox = checkboxContext.get();
|
14
16
|
|
15
17
|
let mergedProps = $derived(mergeProps(props, checkbox.getHiddenInputProps()));
|
16
18
|
</script>
|
17
19
|
|
18
|
-
<input {...mergedProps} />
|
20
|
+
<input aria-describedby={field?.['aria-describedby']} {...mergedProps} />
|
@@ -7,11 +7,13 @@
|
|
7
7
|
</script>
|
8
8
|
|
9
9
|
<script lang="ts">
|
10
|
+
import {getFieldContext} from '../field/context.svelte.js';
|
10
11
|
import {mergeProps} from '../merge-props.js';
|
11
12
|
import {comboboxContext} from './context.svelte.js';
|
12
13
|
|
13
14
|
let {asChild, ...props}: ComboboxInputProps = $props();
|
14
15
|
|
16
|
+
let field = getFieldContext();
|
15
17
|
let combobox = comboboxContext.get();
|
16
18
|
|
17
19
|
let mergedProps = $derived(mergeProps(props, combobox.getInputProps()));
|
@@ -20,5 +22,5 @@
|
|
20
22
|
{#if asChild}
|
21
23
|
{@render asChild(mergedProps)}
|
22
24
|
{:else}
|
23
|
-
<input {...mergedProps} />
|
25
|
+
<input aria-describedby={field?.['aria-describedby']} {...mergedProps} />
|
24
26
|
{/if}
|
@@ -7,11 +7,13 @@
|
|
7
7
|
</script>
|
8
8
|
|
9
9
|
<script lang="ts">
|
10
|
+
import {getFieldContext} from '../field/context.svelte.js';
|
10
11
|
import {mergeProps} from '../merge-props.js';
|
11
12
|
import {editableContext} from './context.svelte.js';
|
12
13
|
|
13
14
|
let {asChild, ...props}: EditableInputProps = $props();
|
14
15
|
|
16
|
+
let field = getFieldContext();
|
15
17
|
let editable = editableContext.get();
|
16
18
|
|
17
19
|
let mergedProps = $derived(mergeProps(props, editable.getInputProps()));
|
@@ -20,5 +22,5 @@
|
|
20
22
|
{#if asChild}
|
21
23
|
{@render asChild(mergedProps)}
|
22
24
|
{:else}
|
23
|
-
<input {...mergedProps} />
|
25
|
+
<input aria-describedby={field?.['aria-describedby']} {...mergedProps} />
|
24
26
|
{/if}
|
@@ -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">;
|
@@ -5,11 +5,13 @@
|
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
8
|
+
import {getFieldContext} from '../field/context.svelte.js';
|
8
9
|
import {mergeProps} from '../merge-props.js';
|
9
10
|
import {fileUploadContext} from './context.svelte.js';
|
10
11
|
|
11
12
|
let {...props}: FileUploadHiddenInputProps = $props();
|
12
13
|
|
14
|
+
let field = getFieldContext();
|
13
15
|
let fileUpload = fileUploadContext.get();
|
14
16
|
|
15
17
|
let mergedProps = $derived(
|
@@ -17,4 +19,4 @@
|
|
17
19
|
);
|
18
20
|
</script>
|
19
21
|
|
20
|
-
<input {...mergedProps} />
|
22
|
+
<input aria-describedby={field?.['aria-describedby']} {...mergedProps} />
|
@@ -7,11 +7,13 @@
|
|
7
7
|
</script>
|
8
8
|
|
9
9
|
<script lang="ts">
|
10
|
+
import {getFieldContext} from '../field/context.svelte.js';
|
10
11
|
import {mergeProps} from '../merge-props.js';
|
11
12
|
import {numberInputContext} from './context.svelte.js';
|
12
13
|
|
13
14
|
let {asChild, ...props}: NumberInputInputProps = $props();
|
14
15
|
|
16
|
+
let field = getFieldContext();
|
15
17
|
let numberInput = numberInputContext.get();
|
16
18
|
|
17
19
|
let mergedProps = $derived(mergeProps(props, numberInput.getInputProps()));
|
@@ -20,5 +22,5 @@
|
|
20
22
|
{#if asChild}
|
21
23
|
{@render asChild(mergedProps)}
|
22
24
|
{:else}
|
23
|
-
<input {...mergedProps} />
|
25
|
+
<input aria-describedby={field?.['aria-describedby']} {...mergedProps} />
|
24
26
|
{/if}
|
@@ -5,14 +5,16 @@
|
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
8
|
+
import {getFieldContext} from '../field/context.svelte.js';
|
8
9
|
import {mergeProps} from '../merge-props.js';
|
9
10
|
import {pinInputContext} from './context.svelte.js';
|
10
11
|
|
11
12
|
let {...props}: PinInputHiddenInputProps = $props();
|
12
13
|
|
14
|
+
let field = getFieldContext();
|
13
15
|
let pinInput = pinInputContext.get();
|
14
16
|
|
15
17
|
let mergedProps = $derived(mergeProps(props, pinInput.getHiddenInputProps()));
|
16
18
|
</script>
|
17
19
|
|
18
|
-
<input {...mergedProps} />
|
20
|
+
<input aria-describedby={field?.['aria-describedby']} {...mergedProps} />
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { Context } from '../context.svelte.js';
|
2
|
-
import type {
|
3
|
-
export declare const qrCodeContext: Context<
|
2
|
+
import type { CreateQrCodeReturn } from './create-qr-code.svelte.js';
|
3
|
+
export declare const qrCodeContext: Context<CreateQrCodeReturn>;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import * as qrCode from '@zag-js/qr-code';
|
2
|
-
export interface
|
2
|
+
export interface CreateQrCodeProps extends Omit<qrCode.Context, 'id' | 'dir' | 'getRootNode'> {
|
3
3
|
id?: string | null;
|
4
4
|
}
|
5
|
-
export interface
|
5
|
+
export interface CreateQrCodeReturn extends qrCode.Api {
|
6
6
|
}
|
7
|
-
export declare function createQRCode(props:
|
7
|
+
export declare function createQRCode(props: CreateQrCodeProps): CreateQrCodeReturn;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<script lang="ts" module>
|
2
2
|
import type {AsChild, HTMLProps} from '../types.js';
|
3
3
|
|
4
|
-
export interface
|
4
|
+
export interface QrCodeFrameProps extends HTMLProps<'svg'> {
|
5
5
|
asChild?: AsChild;
|
6
6
|
}
|
7
7
|
</script>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
import {mergeProps} from '../merge-props.js';
|
11
11
|
import {qrCodeContext} from './context.svelte.js';
|
12
12
|
|
13
|
-
let {asChild, children, ...props}:
|
13
|
+
let {asChild, children, ...props}: QrCodeFrameProps = $props();
|
14
14
|
|
15
15
|
let qrCode = qrCodeContext.get();
|
16
16
|
|
@@ -11,7 +11,7 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
11
11
|
};
|
12
12
|
z_$$bindings?: Bindings;
|
13
13
|
}
|
14
|
-
declare const Frame: $$__sveltets_2_IsomorphicComponent<
|
14
|
+
declare const Frame: $$__sveltets_2_IsomorphicComponent<QrCodeFrameProps, {
|
15
15
|
[evt: string]: CustomEvent<any>;
|
16
16
|
}, {}, {}, "">;
|
17
17
|
type Frame = InstanceType<typeof Frame>;
|
package/dist/qr-code/index.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
export * as
|
2
|
-
export type {
|
3
|
-
export type {
|
4
|
-
export type {
|
5
|
-
export type {
|
1
|
+
export * as QrCode from './qr-code.js';
|
2
|
+
export type { QrCodeFrameProps } from './frame.svelte';
|
3
|
+
export type { QrCodeOverlayProps } from './overlay.svelte';
|
4
|
+
export type { QrCodePatternProps } from './pattern.svelte';
|
5
|
+
export type { QrCodeProps } from './root.svelte';
|
6
6
|
export { anatomy as qrCodeAnatomy } from '@zag-js/qr-code';
|
package/dist/qr-code/index.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export * as
|
1
|
+
export * as QrCode from './qr-code.js';
|
2
2
|
export { anatomy as qrCodeAnatomy } from '@zag-js/qr-code';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<script lang="ts" module>
|
2
2
|
import type {AsChild, HTMLProps} from '../types.js';
|
3
3
|
|
4
|
-
export interface
|
4
|
+
export interface QrCodeOverlayProps extends HTMLProps<'div'> {
|
5
5
|
asChild?: AsChild;
|
6
6
|
}
|
7
7
|
</script>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
import {mergeProps} from '../merge-props.js';
|
11
11
|
import {qrCodeContext} from './context.svelte.js';
|
12
12
|
|
13
|
-
let {asChild, children, ...props}:
|
13
|
+
let {asChild, children, ...props}: QrCodeOverlayProps = $props();
|
14
14
|
|
15
15
|
let qrCode = qrCodeContext.get();
|
16
16
|
|
@@ -11,7 +11,7 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
11
11
|
};
|
12
12
|
z_$$bindings?: Bindings;
|
13
13
|
}
|
14
|
-
declare const Overlay: $$__sveltets_2_IsomorphicComponent<
|
14
|
+
declare const Overlay: $$__sveltets_2_IsomorphicComponent<QrCodeOverlayProps, {
|
15
15
|
[evt: string]: CustomEvent<any>;
|
16
16
|
}, {}, {}, "">;
|
17
17
|
type Overlay = InstanceType<typeof Overlay>;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<script lang="ts" module>
|
2
2
|
import type {AsChild, HTMLProps} from '../types.js';
|
3
3
|
|
4
|
-
export interface
|
4
|
+
export interface QrCodePatternProps extends HTMLProps<'path'> {
|
5
5
|
asChild?: AsChild;
|
6
6
|
}
|
7
7
|
</script>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
import {mergeProps} from '../merge-props.js';
|
11
11
|
import {qrCodeContext} from './context.svelte.js';
|
12
12
|
|
13
|
-
let {asChild, children, ...props}:
|
13
|
+
let {asChild, children, ...props}: QrCodePatternProps = $props();
|
14
14
|
|
15
15
|
let qrCode = qrCodeContext.get();
|
16
16
|
|
@@ -11,7 +11,7 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
11
11
|
};
|
12
12
|
z_$$bindings?: Bindings;
|
13
13
|
}
|
14
|
-
declare const Pattern: $$__sveltets_2_IsomorphicComponent<
|
14
|
+
declare const Pattern: $$__sveltets_2_IsomorphicComponent<QrCodePatternProps, {
|
15
15
|
[evt: string]: CustomEvent<any>;
|
16
16
|
}, {}, {}, "">;
|
17
17
|
type Pattern = InstanceType<typeof Pattern>;
|
package/dist/qr-code/root.svelte
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
import type {AsChild, Assign, HTMLProps} from '../types.js';
|
3
3
|
import type {Snippet} from 'svelte';
|
4
4
|
import type {
|
5
|
-
|
6
|
-
|
5
|
+
CreateQrCodeProps,
|
6
|
+
CreateQrCodeReturn,
|
7
7
|
} from './create-qr-code.svelte.js';
|
8
8
|
|
9
|
-
export interface
|
10
|
-
extends Assign<Omit<HTMLProps<'div'>, 'children'>,
|
11
|
-
asChild?: AsChild<
|
12
|
-
children?: Snippet<[
|
9
|
+
export interface QrCodeProps
|
10
|
+
extends Assign<Omit<HTMLProps<'div'>, 'children'>, CreateQrCodeProps> {
|
11
|
+
asChild?: AsChild<CreateQrCodeReturn>;
|
12
|
+
children?: Snippet<[CreateQrCodeReturn]>;
|
13
13
|
}
|
14
14
|
</script>
|
15
15
|
|
@@ -20,10 +20,10 @@
|
|
20
20
|
import {qrCodeContext} from './context.svelte.js';
|
21
21
|
import {createQRCode} from './create-qr-code.svelte.js';
|
22
22
|
|
23
|
-
let {asChild, children, ...props}:
|
23
|
+
let {asChild, children, ...props}: QrCodeProps = $props();
|
24
24
|
|
25
25
|
let [qrCodeProps, otherProps] = $derived(
|
26
|
-
createSplitProps<
|
26
|
+
createSplitProps<CreateQrCodeProps>(['id', 'ids', 'value', 'encoding'])(
|
27
27
|
props,
|
28
28
|
),
|
29
29
|
);
|
@@ -11,7 +11,7 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
11
11
|
};
|
12
12
|
z_$$bindings?: Bindings;
|
13
13
|
}
|
14
|
-
declare const Root: $$__sveltets_2_IsomorphicComponent<
|
14
|
+
declare const Root: $$__sveltets_2_IsomorphicComponent<QrCodeProps, {
|
15
15
|
[evt: string]: CustomEvent<any>;
|
16
16
|
}, {}, {}, "">;
|
17
17
|
type Root = InstanceType<typeof Root>;
|
@@ -5,11 +5,13 @@
|
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
8
|
+
import {getFieldContext} from '../field/context.svelte.js';
|
8
9
|
import {mergeProps} from '../merge-props.js';
|
9
10
|
import {ratingGroupContext} from './context.svelte.js';
|
10
11
|
|
11
12
|
let {...props}: RatingGroupHiddenInputProps = $props();
|
12
13
|
|
14
|
+
let field = getFieldContext();
|
13
15
|
let radioGroup = ratingGroupContext.get();
|
14
16
|
|
15
17
|
let mergedProps = $derived(
|
@@ -17,4 +19,4 @@
|
|
17
19
|
);
|
18
20
|
</script>
|
19
21
|
|
20
|
-
<input {...mergedProps} />
|
22
|
+
<input aria-describedby={field?.['aria-describedby']} {...mergedProps} />
|
@@ -5,16 +5,18 @@
|
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
8
|
+
import {getFieldContext} from '../field/context.svelte.js';
|
8
9
|
import {mergeProps} from '../merge-props.js';
|
9
10
|
import {selectContext} from './context.svelte.js';
|
10
11
|
|
11
12
|
let {children, ...props}: SelectHiddenSelectProps = $props();
|
12
13
|
|
14
|
+
let field = getFieldContext();
|
13
15
|
let select = selectContext.get();
|
14
16
|
|
15
17
|
let mergedProps = $derived(mergeProps(props, select.getHiddenSelectProps()));
|
16
18
|
</script>
|
17
19
|
|
18
|
-
<select {...mergedProps}>
|
20
|
+
<select aria-describedby={field?.['aria-describedby']} {...mergedProps}>
|
19
21
|
{@render children?.()}
|
20
22
|
</select>
|
@@ -5,14 +5,16 @@
|
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
8
|
+
import {getFieldContext} from '../field/context.svelte.js';
|
8
9
|
import {mergeProps} from '../merge-props.js';
|
9
10
|
import {switchContext} from './context.svelte.js';
|
10
11
|
|
11
12
|
let {...props}: SwitchHiddenInputProps = $props();
|
12
13
|
|
14
|
+
let field = getFieldContext();
|
13
15
|
let switch$ = switchContext.get();
|
14
16
|
|
15
17
|
let mergedProps = $derived(mergeProps(props, switch$.getHiddenInputProps()));
|
16
18
|
</script>
|
17
19
|
|
18
|
-
<input {...mergedProps} />
|
20
|
+
<input aria-describedby={field?.['aria-describedby']} {...mergedProps} />
|
@@ -5,11 +5,13 @@
|
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
8
|
+
import {getFieldContext} from '../field/context.svelte.js';
|
8
9
|
import {mergeProps} from '../merge-props.js';
|
9
10
|
import {tagsInputContext} from './context.svelte.js';
|
10
11
|
|
11
12
|
let {...props}: TagsInputHiddenInputProps = $props();
|
12
13
|
|
14
|
+
let field = getFieldContext();
|
13
15
|
let tagsInput = tagsInputContext.get();
|
14
16
|
|
15
17
|
let mergedProps = $derived(
|
@@ -17,4 +19,4 @@
|
|
17
19
|
);
|
18
20
|
</script>
|
19
21
|
|
20
|
-
<input {...mergedProps} />
|
22
|
+
<input aria-describedby={field?.['aria-describedby']} {...mergedProps} />
|