bits-ui 0.12.0 → 0.13.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/bits/accordion/components/accordion-content.svelte.d.ts +2 -2
- package/dist/bits/accordion/components/accordion-header.svelte.d.ts +2 -2
- package/dist/bits/accordion/components/accordion-item.svelte.d.ts +2 -2
- package/dist/bits/accordion/components/accordion-trigger.svelte.d.ts +2 -2
- package/dist/bits/alert-dialog/_export.types.d.ts +1 -1
- package/dist/bits/alert-dialog/components/alert-dialog-content.svelte +20 -1
- package/dist/bits/alert-dialog/components/alert-dialog-content.svelte.d.ts +5 -1
- package/dist/bits/alert-dialog/components/alert-dialog.svelte +4 -0
- package/dist/bits/alert-dialog/components/alert-dialog.svelte.d.ts +1 -0
- package/dist/bits/alert-dialog/ctx.d.ts +1 -0
- package/dist/bits/alert-dialog/types.d.ts +7 -2
- package/dist/bits/aspect-ratio/_types.d.ts +1 -1
- package/dist/bits/aspect-ratio/components/aspect-ratio.svelte +1 -1
- package/dist/bits/calendar/components/calendar-day.svelte.d.ts +2 -2
- package/dist/bits/calendar/components/calendar-grid.svelte.d.ts +2 -2
- package/dist/bits/calendar/components/calendar-next-button.svelte.d.ts +1 -1
- package/dist/bits/calendar/components/calendar-prev-button.svelte.d.ts +1 -1
- package/dist/bits/calendar/ctx.d.ts +8 -8
- package/dist/bits/checkbox/components/checkbox.svelte.d.ts +1 -0
- package/dist/bits/checkbox/ctx.d.ts +1 -0
- package/dist/bits/context-menu/components/context-menu.svelte +4 -0
- package/dist/bits/context-menu/components/context-menu.svelte.d.ts +1 -0
- package/dist/bits/context-menu/ctx.d.ts +2 -0
- package/dist/bits/date-field/components/date-field-input.svelte.d.ts +3 -3
- package/dist/bits/date-field/components/date-field-segment.svelte.d.ts +7 -7
- package/dist/bits/date-field/ctx.d.ts +20 -20
- package/dist/bits/date-picker/components/date-picker-day.svelte.d.ts +2 -2
- package/dist/bits/date-picker/components/date-picker-field.svelte.d.ts +1 -0
- package/dist/bits/date-picker/components/date-picker-grid.svelte.d.ts +2 -2
- package/dist/bits/date-picker/components/date-picker-next-button.svelte.d.ts +1 -1
- package/dist/bits/date-picker/components/date-picker-prev-button.svelte.d.ts +1 -1
- package/dist/bits/date-picker/components/date-picker-segment.svelte.d.ts +7 -7
- package/dist/bits/date-picker/components/date-picker.svelte +4 -0
- package/dist/bits/date-picker/components/date-picker.svelte.d.ts +1 -0
- package/dist/bits/date-picker/ctx.d.ts +30 -28
- package/dist/bits/date-range-field/components/date-range-field-segment.svelte.d.ts +5 -17
- package/dist/bits/date-range-field/ctx.d.ts +28 -28
- package/dist/bits/date-range-picker/components/date-range-picker-day.svelte.d.ts +2 -2
- package/dist/bits/date-range-picker/components/date-range-picker-field.svelte.d.ts +1 -0
- package/dist/bits/date-range-picker/components/date-range-picker-grid.svelte.d.ts +2 -2
- package/dist/bits/date-range-picker/components/date-range-picker-next-button.svelte.d.ts +1 -1
- package/dist/bits/date-range-picker/components/date-range-picker-prev-button.svelte.d.ts +1 -1
- package/dist/bits/date-range-picker/components/date-range-picker-segment.svelte.d.ts +5 -17
- package/dist/bits/date-range-picker/components/date-range-picker.svelte +4 -0
- package/dist/bits/date-range-picker/components/date-range-picker.svelte.d.ts +1 -0
- package/dist/bits/date-range-picker/ctx.d.ts +38 -36
- package/dist/bits/dialog/_export.types.d.ts +1 -1
- package/dist/bits/dialog/_types.d.ts +10 -1
- package/dist/bits/dialog/components/dialog-content.svelte +20 -1
- package/dist/bits/dialog/components/dialog-content.svelte.d.ts +2 -4
- package/dist/bits/dialog/components/dialog-overlay.svelte +10 -1
- package/dist/bits/dialog/components/dialog-overlay.svelte.d.ts +2 -4
- package/dist/bits/dialog/components/dialog.svelte +4 -0
- package/dist/bits/dialog/components/dialog.svelte.d.ts +3 -2
- package/dist/bits/dialog/ctx.d.ts +1 -0
- package/dist/bits/dialog/types.d.ts +10 -2
- package/dist/bits/link-preview/components/link-preview.svelte +4 -0
- package/dist/bits/link-preview/components/link-preview.svelte.d.ts +1 -0
- package/dist/bits/link-preview/ctx.d.ts +1 -0
- package/dist/bits/menu/components/menu-group.svelte.d.ts +2 -2
- package/dist/bits/menu/components/menu-label.svelte.d.ts +2 -2
- package/dist/bits/menu/components/menu-radio-item.svelte.d.ts +2 -2
- package/dist/bits/menu/components/menu.svelte +4 -0
- package/dist/bits/menu/components/menu.svelte.d.ts +1 -0
- package/dist/bits/menu/ctx.d.ts +3 -0
- package/dist/bits/menubar/components/menubar-menu.svelte +4 -0
- package/dist/bits/menubar/components/menubar-menu.svelte.d.ts +1 -0
- package/dist/bits/menubar/ctx.d.ts +5 -0
- package/dist/bits/pagination/components/pagination-page.svelte.d.ts +2 -2
- package/dist/bits/pin-input/components/pin-input-input.svelte.d.ts +2 -2
- package/dist/bits/popover/components/popover.svelte +4 -0
- package/dist/bits/popover/components/popover.svelte.d.ts +1 -0
- package/dist/bits/popover/ctx.d.ts +1 -0
- package/dist/bits/radio-group/components/radio-group-item.svelte.d.ts +2 -2
- package/dist/bits/range-calendar/components/range-calendar-day.svelte.d.ts +2 -2
- package/dist/bits/range-calendar/components/range-calendar-grid.svelte.d.ts +2 -2
- package/dist/bits/range-calendar/components/range-calendar-next-button.svelte.d.ts +1 -1
- package/dist/bits/range-calendar/components/range-calendar-prev-button.svelte.d.ts +1 -1
- package/dist/bits/range-calendar/ctx.d.ts +8 -8
- package/dist/bits/select/components/select-group.svelte.d.ts +2 -2
- package/dist/bits/select/components/select-item.svelte.d.ts +2 -2
- package/dist/bits/select/components/select-label.svelte.d.ts +2 -2
- package/dist/bits/select/components/select.svelte +4 -0
- package/dist/bits/select/components/select.svelte.d.ts +1 -0
- package/dist/bits/select/ctx.d.ts +1 -0
- package/dist/bits/slider/components/slider-thumb.svelte.d.ts +4 -2
- package/dist/bits/slider/components/slider-tick.svelte.d.ts +2 -2
- package/dist/bits/slider/components/slider.svelte.d.ts +2 -1
- package/dist/bits/slider/ctx.d.ts +9 -5
- package/dist/bits/tabs/components/tabs-content.svelte.d.ts +2 -2
- package/dist/bits/tabs/components/tabs-trigger.svelte.d.ts +2 -2
- package/dist/bits/toggle-group/components/toggle-group-item.svelte.d.ts +2 -2
- package/dist/bits/toolbar/components/toolbar-group-item.svelte.d.ts +2 -2
- package/dist/internal/events.d.ts +3 -0
- package/dist/shared/index.d.ts +2 -0
- package/package.json +3 -3
|
@@ -130,9 +130,9 @@ export declare function setCtx(props: CreateDateRangePickerProps): {
|
|
|
130
130
|
dayPeriod: string;
|
|
131
131
|
timeZoneName: string;
|
|
132
132
|
}, string]) => (part: import("@melt-ui/svelte").SegmentPart) => {
|
|
133
|
-
'aria-invalid':
|
|
134
|
-
'aria-disabled':
|
|
135
|
-
'aria-readonly':
|
|
133
|
+
'aria-invalid': "true" | undefined;
|
|
134
|
+
'aria-disabled': "true" | undefined;
|
|
135
|
+
'aria-readonly': "true" | undefined;
|
|
136
136
|
'data-invalid': string | undefined;
|
|
137
137
|
'data-disabled': string | undefined;
|
|
138
138
|
'data-segment': string;
|
|
@@ -142,9 +142,9 @@ export declare function setCtx(props: CreateDateRangePickerProps): {
|
|
|
142
142
|
contentEditable: boolean;
|
|
143
143
|
'aria-describedby': string | undefined;
|
|
144
144
|
tabindex: number | undefined;
|
|
145
|
-
'aria-invalid':
|
|
146
|
-
'aria-disabled':
|
|
147
|
-
'aria-readonly':
|
|
145
|
+
'aria-invalid': "true" | undefined;
|
|
146
|
+
'aria-disabled': "true" | undefined;
|
|
147
|
+
'aria-readonly': "true" | undefined;
|
|
148
148
|
'data-invalid': string | undefined;
|
|
149
149
|
'data-disabled': string | undefined;
|
|
150
150
|
'data-segment': string;
|
|
@@ -195,9 +195,9 @@ export declare function setCtx(props: CreateDateRangePickerProps): {
|
|
|
195
195
|
dayPeriod: string;
|
|
196
196
|
timeZoneName: string;
|
|
197
197
|
}, string]) => (part: import("@melt-ui/svelte").SegmentPart) => {
|
|
198
|
-
'aria-invalid':
|
|
199
|
-
'aria-disabled':
|
|
200
|
-
'aria-readonly':
|
|
198
|
+
'aria-invalid': "true" | undefined;
|
|
199
|
+
'aria-disabled': "true" | undefined;
|
|
200
|
+
'aria-readonly': "true" | undefined;
|
|
201
201
|
'data-invalid': string | undefined;
|
|
202
202
|
'data-disabled': string | undefined;
|
|
203
203
|
'data-segment': string;
|
|
@@ -207,9 +207,9 @@ export declare function setCtx(props: CreateDateRangePickerProps): {
|
|
|
207
207
|
contentEditable: boolean;
|
|
208
208
|
'aria-describedby': string | undefined;
|
|
209
209
|
tabindex: number | undefined;
|
|
210
|
-
'aria-invalid':
|
|
211
|
-
'aria-disabled':
|
|
212
|
-
'aria-readonly':
|
|
210
|
+
'aria-invalid': "true" | undefined;
|
|
211
|
+
'aria-disabled': "true" | undefined;
|
|
212
|
+
'aria-readonly': "true" | undefined;
|
|
213
213
|
'data-invalid': string | undefined;
|
|
214
214
|
'data-disabled': string | undefined;
|
|
215
215
|
'data-segment': string;
|
|
@@ -221,7 +221,7 @@ export declare function setCtx(props: CreateDateRangePickerProps): {
|
|
|
221
221
|
}, Writable<string | undefined>, Writable<boolean>, Writable<boolean>], import("svelte/action").Action<any, any, Record<never, any>>, ([$value, $nameStore, $disabled, $required]: [import("@internationalized/date").DateValue | undefined, string | undefined, boolean, boolean]) => {
|
|
222
222
|
name: string | undefined;
|
|
223
223
|
value: string | undefined;
|
|
224
|
-
'aria-hidden':
|
|
224
|
+
'aria-hidden': "true";
|
|
225
225
|
hidden: boolean;
|
|
226
226
|
disabled: boolean;
|
|
227
227
|
required: boolean;
|
|
@@ -235,7 +235,7 @@ export declare function setCtx(props: CreateDateRangePickerProps): {
|
|
|
235
235
|
}, Writable<string | undefined>, Writable<boolean>, Writable<boolean>], import("svelte/action").Action<any, any, Record<never, any>>, ([$value, $nameStore, $disabled, $required]: [import("@internationalized/date").DateValue | undefined, string | undefined, boolean, boolean]) => {
|
|
236
236
|
name: string | undefined;
|
|
237
237
|
value: string | undefined;
|
|
238
|
-
'aria-hidden':
|
|
238
|
+
'aria-hidden': "true";
|
|
239
239
|
hidden: boolean;
|
|
240
240
|
disabled: boolean;
|
|
241
241
|
required: boolean;
|
|
@@ -262,8 +262,8 @@ export declare function setCtx(props: CreateDateRangePickerProps): {
|
|
|
262
262
|
grid: import("@melt-ui/svelte/internal/helpers").ExplicitBuilderReturn<[Writable<boolean>, Writable<boolean>], import("svelte/action").Action<any, any, Record<never, any>>, ([$readonly, $disabled]: [boolean, boolean]) => {
|
|
263
263
|
tabindex: number;
|
|
264
264
|
role: string;
|
|
265
|
-
'aria-readonly':
|
|
266
|
-
'aria-disabled':
|
|
265
|
+
'aria-readonly': "true" | undefined;
|
|
266
|
+
'aria-disabled': "true" | undefined;
|
|
267
267
|
'data-readonly': string | undefined;
|
|
268
268
|
'data-disabled': string | undefined;
|
|
269
269
|
}, string>;
|
|
@@ -309,14 +309,14 @@ export declare function setCtx(props: CreateDateRangePickerProps): {
|
|
|
309
309
|
nextButton: import("@melt-ui/svelte/internal/helpers").ExplicitBuilderReturn<[import("svelte/store").Readable<boolean>], (node: HTMLElement) => import("@melt-ui/svelte/internal/types").MeltActionReturn<"click">, ([$isNextButtonDisabled]: [boolean]) => {
|
|
310
310
|
role: string;
|
|
311
311
|
'aria-label': string;
|
|
312
|
-
'aria-disabled':
|
|
312
|
+
'aria-disabled': "true" | undefined;
|
|
313
313
|
disabled: boolean | undefined;
|
|
314
314
|
'data-disabled': string | undefined;
|
|
315
315
|
}, string>;
|
|
316
316
|
prevButton: import("@melt-ui/svelte/internal/helpers").ExplicitBuilderReturn<[import("svelte/store").Readable<boolean>], (node: HTMLElement) => import("@melt-ui/svelte/internal/types").MeltActionReturn<"click">, ([$isPrevButtonDisabled]: [boolean]) => {
|
|
317
317
|
role: string;
|
|
318
318
|
'aria-label': string;
|
|
319
|
-
'aria-disabled':
|
|
319
|
+
'aria-disabled': "true" | undefined;
|
|
320
320
|
disabled: boolean | undefined;
|
|
321
321
|
'data-disabled': string | undefined;
|
|
322
322
|
}, string>;
|
|
@@ -378,6 +378,7 @@ export declare function setCtx(props: CreateDateRangePickerProps): {
|
|
|
378
378
|
arrowSize: Writable<number>;
|
|
379
379
|
closeOnOutsideClick: Writable<boolean>;
|
|
380
380
|
closeOnEscape: Writable<boolean>;
|
|
381
|
+
onOutsideClick: Writable<((event: PointerEvent) => void) | undefined>;
|
|
381
382
|
closeFocus: Writable<import("@melt-ui/svelte").FocusProp | undefined>;
|
|
382
383
|
disableFocusTrap: Writable<boolean>;
|
|
383
384
|
openFocus: Writable<import("@melt-ui/svelte").FocusProp | undefined>;
|
|
@@ -629,9 +630,9 @@ export declare function getCtx(): {
|
|
|
629
630
|
dayPeriod: string;
|
|
630
631
|
timeZoneName: string;
|
|
631
632
|
}, string]) => (part: import("@melt-ui/svelte").SegmentPart) => {
|
|
632
|
-
'aria-invalid':
|
|
633
|
-
'aria-disabled':
|
|
634
|
-
'aria-readonly':
|
|
633
|
+
'aria-invalid': "true" | undefined;
|
|
634
|
+
'aria-disabled': "true" | undefined;
|
|
635
|
+
'aria-readonly': "true" | undefined;
|
|
635
636
|
'data-invalid': string | undefined;
|
|
636
637
|
'data-disabled': string | undefined;
|
|
637
638
|
'data-segment': string;
|
|
@@ -641,9 +642,9 @@ export declare function getCtx(): {
|
|
|
641
642
|
contentEditable: boolean;
|
|
642
643
|
'aria-describedby': string | undefined;
|
|
643
644
|
tabindex: number | undefined;
|
|
644
|
-
'aria-invalid':
|
|
645
|
-
'aria-disabled':
|
|
646
|
-
'aria-readonly':
|
|
645
|
+
'aria-invalid': "true" | undefined;
|
|
646
|
+
'aria-disabled': "true" | undefined;
|
|
647
|
+
'aria-readonly': "true" | undefined;
|
|
647
648
|
'data-invalid': string | undefined;
|
|
648
649
|
'data-disabled': string | undefined;
|
|
649
650
|
'data-segment': string;
|
|
@@ -694,9 +695,9 @@ export declare function getCtx(): {
|
|
|
694
695
|
dayPeriod: string;
|
|
695
696
|
timeZoneName: string;
|
|
696
697
|
}, string]) => (part: import("@melt-ui/svelte").SegmentPart) => {
|
|
697
|
-
'aria-invalid':
|
|
698
|
-
'aria-disabled':
|
|
699
|
-
'aria-readonly':
|
|
698
|
+
'aria-invalid': "true" | undefined;
|
|
699
|
+
'aria-disabled': "true" | undefined;
|
|
700
|
+
'aria-readonly': "true" | undefined;
|
|
700
701
|
'data-invalid': string | undefined;
|
|
701
702
|
'data-disabled': string | undefined;
|
|
702
703
|
'data-segment': string;
|
|
@@ -706,9 +707,9 @@ export declare function getCtx(): {
|
|
|
706
707
|
contentEditable: boolean;
|
|
707
708
|
'aria-describedby': string | undefined;
|
|
708
709
|
tabindex: number | undefined;
|
|
709
|
-
'aria-invalid':
|
|
710
|
-
'aria-disabled':
|
|
711
|
-
'aria-readonly':
|
|
710
|
+
'aria-invalid': "true" | undefined;
|
|
711
|
+
'aria-disabled': "true" | undefined;
|
|
712
|
+
'aria-readonly': "true" | undefined;
|
|
712
713
|
'data-invalid': string | undefined;
|
|
713
714
|
'data-disabled': string | undefined;
|
|
714
715
|
'data-segment': string;
|
|
@@ -720,7 +721,7 @@ export declare function getCtx(): {
|
|
|
720
721
|
}, Writable<string | undefined>, Writable<boolean>, Writable<boolean>], import("svelte/action").Action<any, any, Record<never, any>>, ([$value, $nameStore, $disabled, $required]: [import("@internationalized/date").DateValue | undefined, string | undefined, boolean, boolean]) => {
|
|
721
722
|
name: string | undefined;
|
|
722
723
|
value: string | undefined;
|
|
723
|
-
'aria-hidden':
|
|
724
|
+
'aria-hidden': "true";
|
|
724
725
|
hidden: boolean;
|
|
725
726
|
disabled: boolean;
|
|
726
727
|
required: boolean;
|
|
@@ -734,7 +735,7 @@ export declare function getCtx(): {
|
|
|
734
735
|
}, Writable<string | undefined>, Writable<boolean>, Writable<boolean>], import("svelte/action").Action<any, any, Record<never, any>>, ([$value, $nameStore, $disabled, $required]: [import("@internationalized/date").DateValue | undefined, string | undefined, boolean, boolean]) => {
|
|
735
736
|
name: string | undefined;
|
|
736
737
|
value: string | undefined;
|
|
737
|
-
'aria-hidden':
|
|
738
|
+
'aria-hidden': "true";
|
|
738
739
|
hidden: boolean;
|
|
739
740
|
disabled: boolean;
|
|
740
741
|
required: boolean;
|
|
@@ -761,8 +762,8 @@ export declare function getCtx(): {
|
|
|
761
762
|
grid: import("@melt-ui/svelte/internal/helpers").ExplicitBuilderReturn<[Writable<boolean>, Writable<boolean>], import("svelte/action").Action<any, any, Record<never, any>>, ([$readonly, $disabled]: [boolean, boolean]) => {
|
|
762
763
|
tabindex: number;
|
|
763
764
|
role: string;
|
|
764
|
-
'aria-readonly':
|
|
765
|
-
'aria-disabled':
|
|
765
|
+
'aria-readonly': "true" | undefined;
|
|
766
|
+
'aria-disabled': "true" | undefined;
|
|
766
767
|
'data-readonly': string | undefined;
|
|
767
768
|
'data-disabled': string | undefined;
|
|
768
769
|
}, string>;
|
|
@@ -808,14 +809,14 @@ export declare function getCtx(): {
|
|
|
808
809
|
nextButton: import("@melt-ui/svelte/internal/helpers").ExplicitBuilderReturn<[import("svelte/store").Readable<boolean>], (node: HTMLElement) => import("@melt-ui/svelte/internal/types").MeltActionReturn<"click">, ([$isNextButtonDisabled]: [boolean]) => {
|
|
809
810
|
role: string;
|
|
810
811
|
'aria-label': string;
|
|
811
|
-
'aria-disabled':
|
|
812
|
+
'aria-disabled': "true" | undefined;
|
|
812
813
|
disabled: boolean | undefined;
|
|
813
814
|
'data-disabled': string | undefined;
|
|
814
815
|
}, string>;
|
|
815
816
|
prevButton: import("@melt-ui/svelte/internal/helpers").ExplicitBuilderReturn<[import("svelte/store").Readable<boolean>], (node: HTMLElement) => import("@melt-ui/svelte/internal/types").MeltActionReturn<"click">, ([$isPrevButtonDisabled]: [boolean]) => {
|
|
816
817
|
role: string;
|
|
817
818
|
'aria-label': string;
|
|
818
|
-
'aria-disabled':
|
|
819
|
+
'aria-disabled': "true" | undefined;
|
|
819
820
|
disabled: boolean | undefined;
|
|
820
821
|
'data-disabled': string | undefined;
|
|
821
822
|
}, string>;
|
|
@@ -877,6 +878,7 @@ export declare function getCtx(): {
|
|
|
877
878
|
arrowSize: Writable<number>;
|
|
878
879
|
closeOnOutsideClick: Writable<boolean>;
|
|
879
880
|
closeOnEscape: Writable<boolean>;
|
|
881
|
+
onOutsideClick: Writable<((event: PointerEvent) => void) | undefined>;
|
|
880
882
|
closeFocus: Writable<import("@melt-ui/svelte").FocusProp | undefined>;
|
|
881
883
|
disableFocusTrap: Writable<boolean>;
|
|
882
884
|
openFocus: Writable<import("@melt-ui/svelte").FocusProp | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { Props as DialogProps, CloseProps as DialogCloseProps, TitleProps as DialogTitleProps, PortalProps as DialogPortalProps, ContentProps as DialogContentProps, TriggerProps as DialogTriggerProps, OverlayProps as DialogOverlayProps, DescriptionProps as DialogDescriptionProps, TriggerEvents as DialogTriggerEvents, CloseEvents as DialogCloseEvents } from "./types.js";
|
|
1
|
+
export type { Props as DialogProps, CloseProps as DialogCloseProps, TitleProps as DialogTitleProps, PortalProps as DialogPortalProps, ContentProps as DialogContentProps, TriggerProps as DialogTriggerProps, OverlayProps as DialogOverlayProps, DescriptionProps as DialogDescriptionProps, TriggerEvents as DialogTriggerEvents, CloseEvents as DialogCloseEvents, ContentEvents as DialogContentEvents } from "./types.js";
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
* to type-check our API documentation, which requires we document each prop,
|
|
4
4
|
* but we don't want to document the HTML attributes.
|
|
5
5
|
*/
|
|
6
|
+
import type { FocusProp } from "../../shared/index.js";
|
|
6
7
|
import type { DOMElement, Expand, OmitOpen, OnChangeFn, Transition, TransitionProps } from "../../internal/index.js";
|
|
7
8
|
import type { CreateDialogProps } from "@melt-ui/svelte";
|
|
8
|
-
type Props = Expand<OmitOpen<Omit<CreateDialogProps, "role" | "ids" | "forceVisible">> & {
|
|
9
|
+
type Props = Expand<OmitOpen<Omit<CreateDialogProps, "role" | "ids" | "forceVisible" | "openFocus" | "closeFocus">> & {
|
|
9
10
|
/**
|
|
10
11
|
* The open state of the dialog.
|
|
11
12
|
* You can bind this to a boolean value to programmatically control the open state.
|
|
@@ -17,6 +18,14 @@ type Props = Expand<OmitOpen<Omit<CreateDialogProps, "role" | "ids" | "forceVisi
|
|
|
17
18
|
* A callback function called when the open state changes.
|
|
18
19
|
*/
|
|
19
20
|
onOpenChange?: OnChangeFn<boolean>;
|
|
21
|
+
/**
|
|
22
|
+
* Override the default autofocus behavior of the dialog when it opens
|
|
23
|
+
*/
|
|
24
|
+
openFocus?: FocusProp;
|
|
25
|
+
/**
|
|
26
|
+
* Override the default autofocus behavior of the dialog after close
|
|
27
|
+
*/
|
|
28
|
+
closeFocus?: FocusProp;
|
|
20
29
|
}>;
|
|
21
30
|
type TriggerProps = DOMElement<HTMLButtonElement>;
|
|
22
31
|
type CloseProps = TriggerProps;
|
|
@@ -33,6 +33,9 @@ $:
|
|
|
33
33
|
transition:transition={transitionConfig}
|
|
34
34
|
{...builder} use:builder.action
|
|
35
35
|
{...$$restProps}
|
|
36
|
+
on:pointerdown
|
|
37
|
+
on:pointermove
|
|
38
|
+
on:pointerup
|
|
36
39
|
>
|
|
37
40
|
<slot {builder} />
|
|
38
41
|
</div>
|
|
@@ -42,6 +45,9 @@ $:
|
|
|
42
45
|
in:inTransition={inTransitionConfig}
|
|
43
46
|
out:outTransition={outTransitionConfig}
|
|
44
47
|
{...builder} use:builder.action
|
|
48
|
+
on:pointerdown
|
|
49
|
+
on:pointermove
|
|
50
|
+
on:pointerup
|
|
45
51
|
{...$$restProps}
|
|
46
52
|
>
|
|
47
53
|
<slot {builder} />
|
|
@@ -51,6 +57,9 @@ $:
|
|
|
51
57
|
bind:this={el}
|
|
52
58
|
in:inTransition={inTransitionConfig}
|
|
53
59
|
{...builder} use:builder.action
|
|
60
|
+
on:pointerdown
|
|
61
|
+
on:pointermove
|
|
62
|
+
on:pointerup
|
|
54
63
|
{...$$restProps}
|
|
55
64
|
>
|
|
56
65
|
<slot {builder} />
|
|
@@ -60,12 +69,22 @@ $:
|
|
|
60
69
|
bind:this={el}
|
|
61
70
|
out:outTransition={outTransitionConfig}
|
|
62
71
|
{...builder} use:builder.action
|
|
72
|
+
on:pointerdown
|
|
73
|
+
on:pointermove
|
|
74
|
+
on:pointerup
|
|
63
75
|
{...$$restProps}
|
|
64
76
|
>
|
|
65
77
|
<slot {builder} />
|
|
66
78
|
</div>
|
|
67
79
|
{:else if $open}
|
|
68
|
-
<div
|
|
80
|
+
<div
|
|
81
|
+
bind:this={el}
|
|
82
|
+
{...builder} use:builder.action
|
|
83
|
+
on:pointerdown
|
|
84
|
+
on:pointermove
|
|
85
|
+
on:pointerup
|
|
86
|
+
{...$$restProps}
|
|
87
|
+
>
|
|
69
88
|
<slot {builder} />
|
|
70
89
|
</div>
|
|
71
90
|
{/if}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
import type { Transition } from "../../../internal/index.js";
|
|
3
|
-
import type { ContentProps } from "../types.js";
|
|
3
|
+
import type { ContentEvents, ContentProps } from "../types.js";
|
|
4
4
|
declare class __sveltets_Render<T extends Transition, In extends Transition, Out extends Transition> {
|
|
5
5
|
props(): ContentProps<T, In, Out>;
|
|
6
|
-
events():
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
};
|
|
6
|
+
events(): ContentEvents;
|
|
9
7
|
slots(): {
|
|
10
8
|
default: {
|
|
11
9
|
builder: {
|
|
@@ -22,34 +22,43 @@ $:
|
|
|
22
22
|
{#if asChild && $open}
|
|
23
23
|
<slot {builder} />
|
|
24
24
|
{:else if transition && $open}
|
|
25
|
+
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
25
26
|
<div
|
|
27
|
+
on:mouseup
|
|
26
28
|
bind:this={el}
|
|
27
29
|
transition:transition={transitionConfig}
|
|
28
30
|
{...builder} use:builder.action
|
|
29
31
|
{...$$restProps}
|
|
30
32
|
/>
|
|
31
33
|
{:else if inTransition && outTransition && $open}
|
|
34
|
+
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
32
35
|
<div
|
|
33
36
|
bind:this={el}
|
|
34
37
|
in:inTransition={inTransitionConfig}
|
|
35
38
|
out:outTransition={outTransitionConfig}
|
|
36
39
|
{...builder} use:builder.action
|
|
40
|
+
on:mouseup
|
|
37
41
|
{...$$restProps}
|
|
38
42
|
/>
|
|
39
43
|
{:else if inTransition && $open}
|
|
44
|
+
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
40
45
|
<div
|
|
41
46
|
bind:this={el}
|
|
42
47
|
in:inTransition={inTransitionConfig}
|
|
43
48
|
{...builder} use:builder.action
|
|
49
|
+
on:mouseup
|
|
44
50
|
{...$$restProps}
|
|
45
51
|
/>
|
|
46
52
|
{:else if outTransition && $open}
|
|
53
|
+
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
47
54
|
<div
|
|
48
55
|
bind:this={el}
|
|
49
56
|
out:outTransition={outTransitionConfig}
|
|
50
57
|
{...builder} use:builder.action
|
|
58
|
+
on:mouseup
|
|
51
59
|
{...$$restProps}
|
|
52
60
|
/>
|
|
53
61
|
{:else if $open}
|
|
54
|
-
|
|
62
|
+
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
63
|
+
<div bind:this={el} {...builder} use:builder.action on:mouseup {...$$restProps} />
|
|
55
64
|
{/if}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
import type { Transition } from "../../../internal/index.js";
|
|
3
|
-
import type { OverlayProps } from "../types.js";
|
|
3
|
+
import type { OverlayEvents, OverlayProps } from "../types.js";
|
|
4
4
|
declare class __sveltets_Render<T extends Transition, In extends Transition, Out extends Transition> {
|
|
5
5
|
props(): OverlayProps<T, In, Out>;
|
|
6
|
-
events():
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
};
|
|
6
|
+
events(): OverlayEvents;
|
|
9
7
|
slots(): {
|
|
10
8
|
default: {
|
|
11
9
|
builder: {
|
|
@@ -8,6 +8,7 @@ export let open = void 0;
|
|
|
8
8
|
export let onOpenChange = void 0;
|
|
9
9
|
export let openFocus = void 0;
|
|
10
10
|
export let closeFocus = void 0;
|
|
11
|
+
export let onOutsideClick = void 0;
|
|
11
12
|
const {
|
|
12
13
|
states: { open: localOpen },
|
|
13
14
|
updateOption,
|
|
@@ -21,6 +22,7 @@ const {
|
|
|
21
22
|
defaultOpen: open,
|
|
22
23
|
openFocus,
|
|
23
24
|
closeFocus,
|
|
25
|
+
onOutsideClick,
|
|
24
26
|
onOpenChange: ({ next }) => {
|
|
25
27
|
if (open !== next) {
|
|
26
28
|
onOpenChange?.(next);
|
|
@@ -51,6 +53,8 @@ $:
|
|
|
51
53
|
updateOption("openFocus", openFocus);
|
|
52
54
|
$:
|
|
53
55
|
updateOption("closeFocus", closeFocus);
|
|
56
|
+
$:
|
|
57
|
+
updateOption("onOutsideClick", onOutsideClick);
|
|
54
58
|
</script>
|
|
55
59
|
|
|
56
60
|
<slot ids={$idValues} />
|
|
@@ -4,11 +4,12 @@ declare const __propDef: {
|
|
|
4
4
|
preventScroll?: boolean | undefined;
|
|
5
5
|
closeOnEscape?: boolean | undefined;
|
|
6
6
|
closeOnOutsideClick?: boolean | undefined;
|
|
7
|
+
onOutsideClick?: ((event: PointerEvent) => void) | undefined;
|
|
7
8
|
portal?: string | HTMLElement | null | undefined;
|
|
8
|
-
openFocus?: import("@melt-ui/svelte/index.js").FocusProp | undefined;
|
|
9
|
-
closeFocus?: import("@melt-ui/svelte/index.js").FocusProp | undefined;
|
|
10
9
|
open?: boolean | undefined;
|
|
11
10
|
onOpenChange?: import("../../../internal/types.js").OnChangeFn<boolean> | undefined;
|
|
11
|
+
openFocus?: import("../../../index.js").FocusProp | undefined;
|
|
12
|
+
closeFocus?: import("../../../index.js").FocusProp | undefined;
|
|
12
13
|
};
|
|
13
14
|
events: {
|
|
14
15
|
[evt: string]: CustomEvent<any>;
|
|
@@ -67,6 +67,7 @@ export declare function setCtx(props: SetProps): {
|
|
|
67
67
|
preventScroll: boolean;
|
|
68
68
|
closeOnEscape: boolean;
|
|
69
69
|
closeOnOutsideClick: boolean;
|
|
70
|
+
onOutsideClick: ((event: PointerEvent) => void) | undefined;
|
|
70
71
|
role: "dialog" | "alertdialog";
|
|
71
72
|
defaultOpen: boolean;
|
|
72
73
|
open?: import("svelte/store").Writable<boolean> | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HTMLDivAttributes, HTMLHeadingAttributes, Transition } from "../../internal/index.js";
|
|
1
|
+
import type { HTMLDivAttributes, HTMLHeadingAttributes, SvelteEvent, Transition } from "../../internal/index.js";
|
|
2
2
|
import type { HTMLButtonAttributes } from "svelte/elements";
|
|
3
3
|
import type { CustomEventHandler } from "../../index.js";
|
|
4
4
|
import type * as I from "./_types.js";
|
|
@@ -10,9 +10,17 @@ type DescriptionProps = I.DescriptionProps & HTMLDivAttributes;
|
|
|
10
10
|
type OverlayProps<T extends Transition = Transition, In extends Transition = Transition, Out extends Transition = Transition> = I.OverlayProps<T, In, Out> & HTMLDivAttributes;
|
|
11
11
|
type PortalProps = I.PortalProps & HTMLDivAttributes;
|
|
12
12
|
type TitleProps = I.TitleProps & HTMLHeadingAttributes;
|
|
13
|
+
type OverlayEvents<T extends Element = HTMLElement> = {
|
|
14
|
+
mouseup: SvelteEvent<MouseEvent, T>;
|
|
15
|
+
};
|
|
16
|
+
type ContentEvents<T extends Element = HTMLElement> = {
|
|
17
|
+
pointerdown: SvelteEvent<PointerEvent, T>;
|
|
18
|
+
pointerup: SvelteEvent<PointerEvent, T>;
|
|
19
|
+
pointermove: SvelteEvent<PointerEvent, T>;
|
|
20
|
+
};
|
|
13
21
|
type TriggerEvents<T extends Element = HTMLButtonElement> = {
|
|
14
22
|
click: CustomEventHandler<MouseEvent, T>;
|
|
15
23
|
keydown: CustomEventHandler<KeyboardEvent, T>;
|
|
16
24
|
};
|
|
17
25
|
type CloseEvents = TriggerEvents;
|
|
18
|
-
export type { Props, CloseProps, TitleProps, PortalProps, ContentProps, TriggerProps, OverlayProps, DescriptionProps, TriggerEvents, CloseEvents };
|
|
26
|
+
export type { Props, CloseProps, TitleProps, PortalProps, ContentProps, TriggerProps, OverlayProps, DescriptionProps, TriggerEvents, CloseEvents, ContentEvents, OverlayEvents };
|
|
@@ -7,6 +7,7 @@ export let closeDelay = 300;
|
|
|
7
7
|
export let closeOnOutsideClick = void 0;
|
|
8
8
|
export let closeOnEscape = void 0;
|
|
9
9
|
export let portal = void 0;
|
|
10
|
+
export let onOutsideClick = void 0;
|
|
10
11
|
const {
|
|
11
12
|
states: { open: localOpen },
|
|
12
13
|
updateOption,
|
|
@@ -18,6 +19,7 @@ const {
|
|
|
18
19
|
closeOnOutsideClick,
|
|
19
20
|
closeOnEscape,
|
|
20
21
|
portal,
|
|
22
|
+
onOutsideClick,
|
|
21
23
|
onOpenChange: ({ next }) => {
|
|
22
24
|
if (open !== next) {
|
|
23
25
|
onOpenChange?.(next);
|
|
@@ -45,6 +47,8 @@ $:
|
|
|
45
47
|
updateOption("closeOnEscape", closeOnEscape);
|
|
46
48
|
$:
|
|
47
49
|
updateOption("portal", portal);
|
|
50
|
+
$:
|
|
51
|
+
updateOption("onOutsideClick", onOutsideClick);
|
|
48
52
|
</script>
|
|
49
53
|
|
|
50
54
|
<slot ids={$idValues} />
|
|
@@ -3,6 +3,7 @@ declare const __propDef: {
|
|
|
3
3
|
props: {
|
|
4
4
|
closeOnEscape?: boolean | undefined;
|
|
5
5
|
closeOnOutsideClick?: boolean | undefined;
|
|
6
|
+
onOutsideClick?: ((event: PointerEvent) => void) | undefined;
|
|
6
7
|
portal?: string | HTMLElement | null | undefined;
|
|
7
8
|
openDelay?: number | undefined;
|
|
8
9
|
closeDelay?: number | undefined;
|
|
@@ -53,6 +53,7 @@ export declare function setCtx(props: CreateLinkPreviewProps): {
|
|
|
53
53
|
openDelay: number;
|
|
54
54
|
closeDelay: number;
|
|
55
55
|
closeOnOutsideClick: boolean;
|
|
56
|
+
onOutsideClick: ((event: PointerEvent) => void) | undefined;
|
|
56
57
|
closeOnEscape: boolean;
|
|
57
58
|
arrowSize: number;
|
|
58
59
|
forceVisible: boolean;
|
|
@@ -7,10 +7,10 @@ declare const __propDef: {
|
|
|
7
7
|
};
|
|
8
8
|
slots: {
|
|
9
9
|
default: {
|
|
10
|
-
builder:
|
|
10
|
+
builder: {
|
|
11
11
|
role: string;
|
|
12
12
|
'aria-labelledby': string;
|
|
13
|
-
}
|
|
13
|
+
} & {
|
|
14
14
|
[x: `data-melt-${string}`]: "";
|
|
15
15
|
} & {
|
|
16
16
|
action: import("svelte/action").Action<any, any, Record<never, any>>;
|
|
@@ -4,7 +4,7 @@ declare const __propDef: {
|
|
|
4
4
|
props: RadioItemProps;
|
|
5
5
|
slots: {
|
|
6
6
|
default: {
|
|
7
|
-
builder:
|
|
7
|
+
builder: {
|
|
8
8
|
disabled: boolean;
|
|
9
9
|
role: string;
|
|
10
10
|
'data-state': string;
|
|
@@ -13,7 +13,7 @@ declare const __propDef: {
|
|
|
13
13
|
'data-value': string;
|
|
14
14
|
'data-orientation': string;
|
|
15
15
|
tabindex: number;
|
|
16
|
-
}
|
|
16
|
+
} & {
|
|
17
17
|
[x: `data-melt-${string}`]: "";
|
|
18
18
|
} & {
|
|
19
19
|
action: (node: HTMLElement) => import("@melt-ui/svelte/internal/types").MeltActionReturn<"keydown" | "click" | "focusin" | "focusout" | "pointerdown" | "pointerleave" | "pointermove">;
|
|
@@ -12,6 +12,7 @@ export let typeahead = void 0;
|
|
|
12
12
|
export let closeFocus = void 0;
|
|
13
13
|
export let disableFocusFirstItem = void 0;
|
|
14
14
|
export let closeOnItemClick = void 0;
|
|
15
|
+
export let onOutsideClick = void 0;
|
|
15
16
|
const {
|
|
16
17
|
states: { open: localOpen },
|
|
17
18
|
updateOption,
|
|
@@ -29,6 +30,7 @@ const {
|
|
|
29
30
|
closeFocus,
|
|
30
31
|
disableFocusFirstItem,
|
|
31
32
|
closeOnItemClick,
|
|
33
|
+
onOutsideClick,
|
|
32
34
|
onOpenChange: ({ next }) => {
|
|
33
35
|
if (open !== next) {
|
|
34
36
|
onOpenChange?.(next);
|
|
@@ -66,6 +68,8 @@ $:
|
|
|
66
68
|
updateOption("typeahead", typeahead);
|
|
67
69
|
$:
|
|
68
70
|
updateOption("closeOnItemClick", closeOnItemClick);
|
|
71
|
+
$:
|
|
72
|
+
updateOption("onOutsideClick", onOutsideClick);
|
|
69
73
|
</script>
|
|
70
74
|
|
|
71
75
|
<slot ids={$idValues} />
|
|
@@ -4,6 +4,7 @@ declare const __propDef: {
|
|
|
4
4
|
preventScroll?: boolean | undefined;
|
|
5
5
|
closeOnEscape?: boolean | undefined;
|
|
6
6
|
closeOnOutsideClick?: boolean | undefined;
|
|
7
|
+
onOutsideClick?: ((event: PointerEvent) => void) | undefined;
|
|
7
8
|
portal?: string | HTMLElement | null | undefined;
|
|
8
9
|
closeFocus?: import("@melt-ui/svelte/index.js").FocusProp | undefined;
|
|
9
10
|
dir?: import("@melt-ui/svelte/internal/types").TextDirection | undefined;
|
package/dist/bits/menu/ctx.d.ts
CHANGED
|
@@ -153,6 +153,7 @@ export declare function setCtx(props: CreateDropdownMenuProps): {
|
|
|
153
153
|
defaultOpen: false;
|
|
154
154
|
typeahead: true;
|
|
155
155
|
closeOnItemClick: true;
|
|
156
|
+
onOutsideClick: undefined;
|
|
156
157
|
}, "ids">>;
|
|
157
158
|
};
|
|
158
159
|
createMenuRadioGroup: (args?: import("@melt-ui/svelte/dist/builders/menu/types.js")._CreateRadioGroupProps | undefined) => {
|
|
@@ -198,6 +199,7 @@ export declare function setCtx(props: CreateDropdownMenuProps): {
|
|
|
198
199
|
closeOnItemClick: boolean;
|
|
199
200
|
portal: string | HTMLElement | null | undefined;
|
|
200
201
|
closeOnOutsideClick: boolean;
|
|
202
|
+
onOutsideClick: ((event: PointerEvent) => void) | undefined;
|
|
201
203
|
loop: boolean;
|
|
202
204
|
defaultOpen: boolean;
|
|
203
205
|
open?: Writable<boolean> | undefined;
|
|
@@ -277,6 +279,7 @@ export declare function setSubMenuCtx(props: DropdownSubmenuProps): {
|
|
|
277
279
|
defaultOpen: false;
|
|
278
280
|
typeahead: true;
|
|
279
281
|
closeOnItemClick: true;
|
|
282
|
+
onOutsideClick: undefined;
|
|
280
283
|
}, "ids">>;
|
|
281
284
|
};
|
|
282
285
|
export declare function setRadioGroupCtx(props: DropdownRadioGroupProps): {
|
|
@@ -12,6 +12,7 @@ export let typeahead = void 0;
|
|
|
12
12
|
export let closeFocus = void 0;
|
|
13
13
|
export let disableFocusFirstItem = void 0;
|
|
14
14
|
export let closeOnItemClick = void 0;
|
|
15
|
+
export let onOutsideClick = void 0;
|
|
15
16
|
const {
|
|
16
17
|
states: { open: localOpen },
|
|
17
18
|
updateOption,
|
|
@@ -27,6 +28,7 @@ const {
|
|
|
27
28
|
closeFocus,
|
|
28
29
|
disableFocusFirstItem,
|
|
29
30
|
closeOnItemClick,
|
|
31
|
+
onOutsideClick,
|
|
30
32
|
onOpenChange: ({ next }) => {
|
|
31
33
|
if (open !== next) {
|
|
32
34
|
onOpenChange?.(next);
|
|
@@ -64,6 +66,8 @@ $:
|
|
|
64
66
|
updateOption("typeahead", typeahead);
|
|
65
67
|
$:
|
|
66
68
|
updateOption("closeOnItemClick", closeOnItemClick);
|
|
69
|
+
$:
|
|
70
|
+
updateOption("onOutsideClick", onOutsideClick);
|
|
67
71
|
</script>
|
|
68
72
|
|
|
69
73
|
<slot menuIds={$idValues} />
|
|
@@ -4,6 +4,7 @@ declare const __propDef: {
|
|
|
4
4
|
preventScroll?: boolean | undefined;
|
|
5
5
|
closeOnEscape?: boolean | undefined;
|
|
6
6
|
closeOnOutsideClick?: boolean | undefined;
|
|
7
|
+
onOutsideClick?: ((event: PointerEvent) => void) | undefined;
|
|
7
8
|
portal?: string | HTMLElement | null | undefined;
|
|
8
9
|
closeFocus?: import("@melt-ui/svelte/index.js").FocusProp | undefined;
|
|
9
10
|
dir?: import("@melt-ui/svelte/internal/types").TextDirection | undefined;
|