sv5ui 1.8.0 → 2.0.0
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.
- package/dist/Alert/alert.types.d.ts +1 -1
- package/dist/AvatarGroup/AvatarGroup.svelte +5 -3
- package/dist/Button/Button.svelte +7 -6
- package/dist/Button/button.types.d.ts +3 -3
- package/dist/Collapsible/collapsible.types.d.ts +4 -2
- package/dist/Drawer/Drawer.svelte +3 -1
- package/dist/DropdownMenu/DropdownMenu.svelte +1 -3
- package/dist/DropdownMenu/DropdownMenuTriggerTestWrapper.svelte +12 -0
- package/dist/DropdownMenu/DropdownMenuTriggerTestWrapper.svelte.d.ts +7 -0
- package/dist/DropdownMenu/dropdown-menu.types.d.ts +17 -9
- package/dist/Icon/icon.types.d.ts +4 -1
- package/dist/Input/Input.svelte +22 -16
- package/dist/Input/input.variants.d.ts +0 -15
- package/dist/Input/input.variants.js +1 -20
- package/dist/Link/Link.svelte +4 -3
- package/dist/Link/link.types.d.ts +2 -2
- package/dist/Pagination/Pagination.svelte +7 -1
- package/dist/Pagination/pagination.types.d.ts +4 -1
- package/dist/Pagination/pagination.variants.d.ts +0 -72
- package/dist/Pagination/pagination.variants.js +6 -30
- package/dist/Select/Select.svelte +3 -1
- package/dist/Select/select.types.d.ts +5 -9
- package/dist/SelectMenu/SelectMenu.svelte +6 -5
- package/dist/SelectMenu/SelectMenuFormFieldTestWrapper.svelte +11 -0
- package/dist/SelectMenu/SelectMenuFormFieldTestWrapper.svelte.d.ts +7 -0
- package/dist/SelectMenu/select-menu.types.d.ts +5 -2
- package/dist/SelectMenu/select-menu.variants.d.ts +12 -2
- package/dist/SelectMenu/select-menu.variants.js +10 -1
- package/dist/Separator/Separator.svelte +9 -2
- package/dist/Separator/separator.types.d.ts +5 -0
- package/dist/Separator/separator.variants.d.ts +25 -0
- package/dist/Separator/separator.variants.js +7 -1
- package/dist/Tabs/Tabs.svelte +4 -2
- package/dist/Tabs/tabs.types.d.ts +4 -6
- package/dist/hooks/HookContextProbe.svelte +7 -0
- package/dist/hooks/HookContextProbe.svelte.d.ts +18 -0
- package/dist/hooks/HookContextProvider.svelte +9 -0
- package/dist/hooks/HookContextProvider.svelte.d.ts +18 -0
- package/dist/hooks/HookEmitProbe.svelte +14 -0
- package/dist/hooks/HookEmitProbe.svelte.d.ts +18 -0
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useFormField.svelte.d.ts +0 -31
- package/dist/hooks/useFormField.svelte.js +0 -21
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
2
|
import type { ClassNameValue } from 'tailwind-merge';
|
|
3
|
+
import type { TabsRootProps } from 'bits-ui';
|
|
3
4
|
import type { TabsSlots, TabsVariantProps } from './tabs.variants.js';
|
|
4
5
|
/**
|
|
5
6
|
* Configuration for an individual tab item.
|
|
@@ -41,11 +42,6 @@ export interface TabsItem {
|
|
|
41
42
|
* For complex content, use the `body` snippet instead.
|
|
42
43
|
*/
|
|
43
44
|
content?: string;
|
|
44
|
-
/**
|
|
45
|
-
* Named slot identifier for custom content rendering.
|
|
46
|
-
* When provided, allows using dynamic snippet slots for this item.
|
|
47
|
-
*/
|
|
48
|
-
slot?: string;
|
|
49
45
|
/**
|
|
50
46
|
* Additional CSS classes applied to this item's trigger element.
|
|
51
47
|
*/
|
|
@@ -86,7 +82,9 @@ export interface TabsSlotProps {
|
|
|
86
82
|
*
|
|
87
83
|
* @see https://bits-ui.com/docs/components/tabs
|
|
88
84
|
*/
|
|
89
|
-
export interface TabsProps {
|
|
85
|
+
export interface TabsProps extends Pick<TabsRootProps, 'id' | 'style' | 'title' | 'role' | 'tabindex' | 'aria-label' | 'aria-labelledby' | 'aria-describedby' | 'onclick' | 'onkeydown' | 'onmouseenter' | 'onmouseleave' | 'onfocus' | 'onblur'> {
|
|
86
|
+
/** Custom data attributes are forwarded to the root element. */
|
|
87
|
+
[key: `data-${string}`]: unknown;
|
|
90
88
|
/**
|
|
91
89
|
* Bindable reference to the root DOM element.
|
|
92
90
|
*/
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const HookContextProbe: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type HookContextProbe = InstanceType<typeof HookContextProbe>;
|
|
18
|
+
export default HookContextProbe;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { setContext } from 'svelte'
|
|
3
|
+
import { FORM_FIELD_CONTEXT_KEY } from './useFormField.svelte.js'
|
|
4
|
+
import HookContextProbe from './HookContextProbe.svelte'
|
|
5
|
+
|
|
6
|
+
setContext(FORM_FIELD_CONTEXT_KEY, { name: 'email', size: 'md', ariaId: 'ff' })
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<HookContextProbe />
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const HookContextProvider: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type HookContextProvider = InstanceType<typeof HookContextProvider>;
|
|
18
|
+
export default HookContextProvider;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { useFormFieldEmit } from './useFormField.svelte.js'
|
|
3
|
+
|
|
4
|
+
const emit = useFormFieldEmit()
|
|
5
|
+
|
|
6
|
+
function fireAll() {
|
|
7
|
+
emit.onBlur()
|
|
8
|
+
emit.onFocus()
|
|
9
|
+
emit.onChange()
|
|
10
|
+
emit.onInput()
|
|
11
|
+
}
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<button data-testid="fire" onclick={fireAll}>fire</button>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const HookEmitProbe: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type HookEmitProbe = InstanceType<typeof HookEmitProbe>;
|
|
18
|
+
export default HookEmitProbe;
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { useMediaQuery } from './useMediaQuery.svelte.js';
|
|
|
2
2
|
export type { UseMediaQueryOptions } from './useMediaQuery.svelte.js';
|
|
3
3
|
export { useClipboard } from './useClipboard.svelte.js';
|
|
4
4
|
export type { UseClipboardOptions } from './useClipboard.svelte.js';
|
|
5
|
-
export { useFormField, useFormFieldEmit,
|
|
5
|
+
export { useFormField, useFormFieldEmit, FORM_FIELD_CONTEXT_KEY } from './useFormField.svelte.js';
|
|
6
6
|
export type { FormFieldContext } from './useFormField.svelte.js';
|
|
7
7
|
export { useClickOutside } from './useClickOutside.svelte.js';
|
|
8
8
|
export type { UseClickOutsideOptions } from './useClickOutside.svelte.js';
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { useMediaQuery } from './useMediaQuery.svelte.js';
|
|
2
2
|
export { useClipboard } from './useClipboard.svelte.js';
|
|
3
|
-
export { useFormField, useFormFieldEmit,
|
|
3
|
+
export { useFormField, useFormFieldEmit, FORM_FIELD_CONTEXT_KEY } from './useFormField.svelte.js';
|
|
4
4
|
export { useClickOutside } from './useClickOutside.svelte.js';
|
|
5
5
|
export { useInfiniteScroll } from './useInfiniteScroll.svelte.js';
|
|
6
6
|
export { useEscapeKeydown } from './useEscapeKeydown.svelte.js';
|
|
@@ -52,34 +52,3 @@ export declare function useFormFieldEmit(): {
|
|
|
52
52
|
onChange(): void;
|
|
53
53
|
onInput(): void;
|
|
54
54
|
};
|
|
55
|
-
/**
|
|
56
|
-
* Wires native DOM input events to the parent Form's event emitters while
|
|
57
|
-
* preserving any user-supplied handlers. Reduces boilerplate in wrapper
|
|
58
|
-
* components (Input, Textarea, etc.) from ~20 lines of handler definitions
|
|
59
|
-
* to 4 lines:
|
|
60
|
-
*
|
|
61
|
-
* ```svelte
|
|
62
|
-
* <script>
|
|
63
|
-
* const events = wireFormEvents({ onblur, oninput, onchange, onfocus })
|
|
64
|
-
* </script>
|
|
65
|
-
*
|
|
66
|
-
* <input {...events} />
|
|
67
|
-
* ```
|
|
68
|
-
*
|
|
69
|
-
* Each handler fires the Form emitter first, then calls the user handler
|
|
70
|
-
* (if any) with the original event.
|
|
71
|
-
*/
|
|
72
|
-
type InputEventHandler<E extends Event = Event> = (event: E) => void;
|
|
73
|
-
type FocusEventHandler = InputEventHandler<FocusEvent>;
|
|
74
|
-
export declare function wireFormEvents(userHandlers: {
|
|
75
|
-
onblur?: FocusEventHandler | null;
|
|
76
|
-
oninput?: InputEventHandler | null;
|
|
77
|
-
onchange?: InputEventHandler | null;
|
|
78
|
-
onfocus?: FocusEventHandler | null;
|
|
79
|
-
}): {
|
|
80
|
-
onblur(event: FocusEvent): void;
|
|
81
|
-
oninput(event: Event): void;
|
|
82
|
-
onchange(event: Event): void;
|
|
83
|
-
onfocus(event: FocusEvent): void;
|
|
84
|
-
};
|
|
85
|
-
export {};
|
|
@@ -63,24 +63,3 @@ export function useFormFieldEmit() {
|
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
export function wireFormEvents(userHandlers) {
|
|
67
|
-
const emit = useFormFieldEmit();
|
|
68
|
-
return {
|
|
69
|
-
onblur(event) {
|
|
70
|
-
emit.onBlur();
|
|
71
|
-
userHandlers.onblur?.(event);
|
|
72
|
-
},
|
|
73
|
-
oninput(event) {
|
|
74
|
-
emit.onInput();
|
|
75
|
-
userHandlers.oninput?.(event);
|
|
76
|
-
},
|
|
77
|
-
onchange(event) {
|
|
78
|
-
emit.onChange();
|
|
79
|
-
userHandlers.onchange?.(event);
|
|
80
|
-
},
|
|
81
|
-
onfocus(event) {
|
|
82
|
-
emit.onFocus();
|
|
83
|
-
userHandlers.onfocus?.(event);
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
}
|